use-scroll-animate 2.1.0 → 2.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 (70) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +31 -2
  3. package/README_ja.md +19 -0
  4. package/README_zh.md +30 -0
  5. package/dist/chunks/base-CJ7XfidP.cjs +233 -0
  6. package/dist/chunks/base-CJ7XfidP.cjs.map +1 -0
  7. package/dist/chunks/base-CuvCgqLy.js +219 -0
  8. package/dist/chunks/base-CuvCgqLy.js.map +1 -0
  9. package/dist/components/background.cjs +395 -0
  10. package/dist/components/background.cjs.map +1 -0
  11. package/dist/components/background.css +7 -0
  12. package/dist/components/background.d.cts +132 -0
  13. package/dist/components/background.d.ts +132 -0
  14. package/dist/components/background.js +387 -0
  15. package/dist/components/background.js.map +1 -0
  16. package/dist/components/feedback.cjs +444 -0
  17. package/dist/components/feedback.cjs.map +1 -0
  18. package/dist/components/feedback.css +7 -0
  19. package/dist/components/feedback.d.cts +170 -0
  20. package/dist/components/feedback.d.ts +170 -0
  21. package/dist/components/feedback.js +434 -0
  22. package/dist/components/feedback.js.map +1 -0
  23. package/dist/components/interaction.cjs +426 -0
  24. package/dist/components/interaction.cjs.map +1 -0
  25. package/dist/components/interaction.css +8 -0
  26. package/dist/components/interaction.d.cts +142 -0
  27. package/dist/components/interaction.d.ts +142 -0
  28. package/dist/components/interaction.js +417 -0
  29. package/dist/components/interaction.js.map +1 -0
  30. package/dist/components/physics.cjs +664 -0
  31. package/dist/components/physics.cjs.map +1 -0
  32. package/dist/components/physics.css +5 -0
  33. package/dist/components/physics.d.cts +216 -0
  34. package/dist/components/physics.d.ts +216 -0
  35. package/dist/components/physics.js +644 -0
  36. package/dist/components/physics.js.map +1 -0
  37. package/dist/components/reveal.cjs +360 -0
  38. package/dist/components/reveal.cjs.map +1 -0
  39. package/dist/components/reveal.css +5 -0
  40. package/dist/components/reveal.d.cts +132 -0
  41. package/dist/components/reveal.d.ts +132 -0
  42. package/dist/components/reveal.js +350 -0
  43. package/dist/components/reveal.js.map +1 -0
  44. package/dist/components/text.cjs +528 -0
  45. package/dist/components/text.cjs.map +1 -0
  46. package/dist/components/text.css +7 -0
  47. package/dist/components/text.d.cts +164 -0
  48. package/dist/components/text.d.ts +164 -0
  49. package/dist/components/text.js +517 -0
  50. package/dist/components/text.js.map +1 -0
  51. package/dist/components/transitions.cjs +546 -0
  52. package/dist/components/transitions.cjs.map +1 -0
  53. package/dist/components/transitions.css +6 -0
  54. package/dist/components/transitions.d.cts +180 -0
  55. package/dist/components/transitions.d.ts +180 -0
  56. package/dist/components/transitions.js +536 -0
  57. package/dist/components/transitions.js.map +1 -0
  58. package/dist/components.cjs +127 -0
  59. package/dist/components.cjs.map +1 -0
  60. package/dist/components.css +33 -0
  61. package/dist/components.d.cts +919 -0
  62. package/dist/components.d.ts +919 -0
  63. package/dist/components.js +65 -0
  64. package/dist/components.js.map +1 -0
  65. package/dist/components.umd.js +22 -0
  66. package/dist/components.umd.js.map +1 -0
  67. package/docs/API.md +2 -0
  68. package/docs/components.md +169 -0
  69. package/docs/windows-apps.md +108 -0
  70. package/package.json +105 -5
@@ -0,0 +1,536 @@
1
+ import { d as defineElement, f as shadowStyles, E as EASE_OUT, F as FLUENT_DECELERATE, p as prefersReducedMotion } from '../chunks/base-CuvCgqLy.js';
2
+ export { c as configureComponents } from '../chunks/base-CuvCgqLy.js';
3
+
4
+ var shadowCss = ":host{display:contents}dialog{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;color:inherit;overflow:hidden}dialog:not([open]){display:none}dialog::backdrop{background:transparent}[part=\"backdrop\"]{position:absolute;inset:0;background:var(--usa-dialog-backdrop,rgb(0 0 0 / 0.42))}[part=\"panel\"]{position:absolute;left:50%;top:50%;translate:-50% -50%;box-sizing:border-box;width:min(var(--usa-dialog-width,480px),calc(100vw - 32px));max-height:calc(100vh - 32px);overflow:auto;padding:var(--usa-dialog-padding,24px);border-radius:var(--usa-dialog-radius,12px);background:var(--usa-dialog-bg,Canvas);color:var(--usa-dialog-fg,CanvasText);box-shadow:0 32px 64px -12px rgb(0 0 0 / 0.45),0 0 0 1px rgb(127 127 127 / 0.18)}dialog[data-variant^=\"drawer\"] [part=\"panel\"]{top:0;bottom:0;translate:none;max-height:none;height:100%;border-radius:0;width:min(var(--usa-dialog-width,380px),88vw)}dialog[data-variant=\"drawer-start\"] [part=\"panel\"]{left:0}dialog[data-variant=\"drawer-end\"] [part=\"panel\"]{left:auto;right:0}dialog[data-variant=\"drawer-bottom\"] [part=\"panel\"],dialog[data-variant=\"sheet\"] [part=\"panel\"]{top:auto;bottom:0;left:0;right:0;translate:none;width:100%;height:auto;max-height:85vh;border-radius:var(--usa-dialog-radius,16px) var(--usa-dialog-radius,16px) 0 0}dialog[data-variant=\"sheet\"] [part=\"panel\"]{left:50%;translate:-50% 0;width:min(var(--usa-dialog-width,560px),100vw)}";
5
+
6
+ var css$3 = "usa-dialog{display:contents}usa-dialog:not(:defined){display:none}";
7
+
8
+ const FROM = {
9
+ modal: 'scale(0.94)',
10
+ 'drawer-start': 'translateX(-100%)',
11
+ 'drawer-end': 'translateX(100%)',
12
+ 'drawer-bottom': 'translateY(100%)',
13
+ sheet: 'translateY(40px)',
14
+ };
15
+ function defineDialog(tag = 'usa-dialog') {
16
+ return defineElement(tag, (Base) => class UsaDialog extends Base {
17
+ constructor() {
18
+ super(...arguments);
19
+ this._dialog = null;
20
+ this._panel = null;
21
+ this._backdrop = null;
22
+ this._busy = null;
23
+ this._syncing = false;
24
+ this.returnValue = '';
25
+ }
26
+ static get observedAttributes() {
27
+ return ['open', 'variant', 'label'];
28
+ }
29
+ get dialog() {
30
+ return this._dialog;
31
+ }
32
+ get open() {
33
+ return this.hasAttribute('open');
34
+ }
35
+ set open(v) {
36
+ this.toggleAttribute('open', !!v);
37
+ }
38
+ get variant() {
39
+ const v = this.str('variant', 'modal');
40
+ return FROM[v] ? v : 'modal';
41
+ }
42
+ changed(name) {
43
+ if (name === 'open') {
44
+ if (this._syncing)
45
+ return;
46
+ if (this.open)
47
+ this.show();
48
+ else
49
+ this.close();
50
+ }
51
+ else
52
+ this.syncAttrs();
53
+ }
54
+ syncAttrs() {
55
+ if (!this._dialog)
56
+ return;
57
+ this._dialog.setAttribute('data-variant', this.variant);
58
+ this._dialog.setAttribute('aria-modal', 'true');
59
+ const label = this.getAttribute('label');
60
+ if (label)
61
+ this._dialog.setAttribute('aria-label', label);
62
+ }
63
+ mount() {
64
+ if (!this._dialog) {
65
+ const root = this.shadowRoot || this.attachShadow({ mode: 'open' });
66
+ root.innerHTML = '<dialog part="dialog"><div part="backdrop" aria-hidden="true"></div><div part="panel"><slot></slot></div></dialog>';
67
+ shadowStyles(root, shadowCss);
68
+ this._dialog = root.querySelector('dialog');
69
+ this._backdrop = root.querySelector('[part=backdrop]');
70
+ this._panel = root.querySelector('[part=panel]');
71
+ }
72
+ this.syncAttrs();
73
+ const dlg = this._dialog;
74
+ this.listen(dlg, 'cancel', (e) => {
75
+ e.preventDefault();
76
+ if (!this.flag('no-esc'))
77
+ this.close('cancel');
78
+ });
79
+ this.listen(this._backdrop, 'click', () => !this.flag('no-backdrop-close') && this.close('backdrop'));
80
+ this.listen(this, 'click', (e) => {
81
+ const t = e.target.closest?.('[data-close]');
82
+ if (t && this.contains(t))
83
+ this.close(t.getAttribute('data-close') || 'close');
84
+ });
85
+ if (this.open && !dlg.open)
86
+ this.show();
87
+ }
88
+ unmount() {
89
+ if (this._dialog?.open)
90
+ this._dialog.close();
91
+ }
92
+ setOpenAttr(on) {
93
+ this._syncing = true;
94
+ this.toggleAttribute('open', on);
95
+ this._syncing = false;
96
+ }
97
+ async show() {
98
+ await this._busy;
99
+ const dlg = this._dialog;
100
+ if (!dlg) {
101
+ this.setOpenAttr(true); // opens on connect
102
+ return;
103
+ }
104
+ if (dlg.open)
105
+ return;
106
+ this.setOpenAttr(true);
107
+ try {
108
+ if (typeof dlg.showModal === 'function')
109
+ dlg.showModal();
110
+ else
111
+ dlg.setAttribute('open', '');
112
+ }
113
+ catch {
114
+ dlg.setAttribute('open', '');
115
+ }
116
+ this.emit('open');
117
+ if (this.reduced) {
118
+ await this.animate2([{ opacity: 0 }, { opacity: 1 }], [{ opacity: 0 }, { opacity: 1 }], 160, EASE_OUT);
119
+ return;
120
+ }
121
+ await this.animate2([{ opacity: 0, transform: FROM[this.variant] }, { opacity: 1, transform: 'none' }], [{ opacity: 0 }, { opacity: 1 }], this.variant === 'modal' ? 260 : 360, FLUENT_DECELERATE);
122
+ }
123
+ async close(returnValue = '') {
124
+ await this._busy;
125
+ const dlg = this._dialog;
126
+ if (!dlg || !dlg.open) {
127
+ this.setOpenAttr(false);
128
+ return;
129
+ }
130
+ if (!this.emit('beforeclose', { returnValue })) {
131
+ this.setOpenAttr(true);
132
+ return;
133
+ }
134
+ this.returnValue = returnValue;
135
+ this._busy = (async () => {
136
+ const panelTo = this.reduced ? { opacity: 0 } : { opacity: 0, transform: FROM[this.variant] };
137
+ const panelFrom = this.reduced ? { opacity: 1 } : { opacity: 1, transform: 'none' };
138
+ await this.animate2([panelFrom, panelTo], [{ opacity: 1 }, { opacity: 0 }], this.reduced ? 120 : 200, 'cubic-bezier(0.7, 0, 0.84, 0)', 'forwards');
139
+ try {
140
+ if (typeof dlg.close === 'function')
141
+ dlg.close(returnValue);
142
+ else
143
+ dlg.removeAttribute('open');
144
+ }
145
+ catch {
146
+ dlg.removeAttribute('open');
147
+ }
148
+ dlg.removeAttribute('open');
149
+ this._panel?.getAnimations?.().forEach((a) => a.cancel());
150
+ this._backdrop?.getAnimations?.().forEach((a) => a.cancel());
151
+ this.setOpenAttr(false);
152
+ this.emit('close', { returnValue });
153
+ })();
154
+ await this._busy;
155
+ this._busy = null;
156
+ }
157
+ animate2(panel, backdrop, duration, easing, fill = 'none') {
158
+ const a = this._panel ? this.motion(this._panel, panel, { duration, easing, fill }) : null;
159
+ const b = this._backdrop ? this.motion(this._backdrop, backdrop, { duration, easing: 'linear', fill }) : null;
160
+ return Promise.all([a?.finished, b?.finished].map((p) => p?.catch(() => undefined))).then(() => undefined);
161
+ }
162
+ }, { id: 'dialog', text: css$3 });
163
+ }
164
+
165
+ var css$2 = "usa-accordion{display:block}usa-accordion>details>summary{cursor:pointer}usa-accordion>details>summary::-webkit-details-marker{display:none}usa-accordion>details>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:1em}usa-accordion>details>summary::after{content:\"\";flex:none;width:0.5em;height:0.5em;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:translateY(-25%) rotate(45deg);transition:transform 0.3s cubic-bezier(0.22,1,0.36,1);opacity:0.7}usa-accordion>details[open]:not([data-closing])>summary::after{transform:translateY(25%) rotate(-135deg)}@media (prefers-reduced-motion:reduce){usa-accordion>details>summary::after{transition:none}}";
166
+
167
+ function defineAccordion(tag = 'usa-accordion') {
168
+ return defineElement(tag, (Base) => class UsaAccordion extends Base {
169
+ constructor() {
170
+ super(...arguments);
171
+ this._running = new WeakMap();
172
+ }
173
+ static get observedAttributes() {
174
+ return [];
175
+ }
176
+ get items() {
177
+ return Array.from(this.children).filter((c) => c.tagName === 'DETAILS');
178
+ }
179
+ mount() {
180
+ this.listen(this, 'click', (e) => {
181
+ const summary = e.target.closest?.('summary');
182
+ const d = summary?.parentElement;
183
+ if (!summary || !d || d.tagName !== 'DETAILS' || d.parentElement !== this)
184
+ return;
185
+ e.preventDefault();
186
+ this.toggleItem(d);
187
+ });
188
+ }
189
+ /** Height of `d` when closed: its summary plus its own padding and border. */
190
+ closedHeight(d) {
191
+ const summary = d.querySelector(':scope > summary');
192
+ const cs = typeof getComputedStyle === 'function' ? getComputedStyle(d) : null;
193
+ const extra = cs
194
+ ? ['paddingTop', 'paddingBottom', 'borderTopWidth', 'borderBottomWidth'].reduce((n, k) => n + (parseFloat(cs[k]) || 0), 0)
195
+ : 0;
196
+ return (summary ? summary.getBoundingClientRect().height : 0) + extra;
197
+ }
198
+ async toggleItem(d, open = !d.open || d.hasAttribute('data-closing')) {
199
+ if (open && !this.flag('multiple'))
200
+ this.items.forEach((o) => o !== d && o.open && this.toggleItem(o, false));
201
+ this._running.get(d)?.cancel();
202
+ this._running.delete(d);
203
+ const duration = this.reduced ? 0 : this.num('duration', 300);
204
+ const startH = d.getBoundingClientRect().height;
205
+ if (open) {
206
+ d.removeAttribute('data-closing');
207
+ d.open = true;
208
+ }
209
+ this.emit('toggle', { details: d, open });
210
+ if (!duration || typeof d.animate !== 'function') {
211
+ if (!open)
212
+ d.open = false;
213
+ return;
214
+ }
215
+ const endH = open ? d.getBoundingClientRect().height : this.closedHeight(d);
216
+ if (!open)
217
+ d.setAttribute('data-closing', '');
218
+ d.style.overflow = 'hidden';
219
+ const a = d.animate([{ height: `${startH}px` }, { height: `${endH}px` }], { duration, easing: EASE_OUT });
220
+ this._running.set(d, a);
221
+ await a.finished.catch(() => undefined);
222
+ if (this._running.get(d) !== a)
223
+ return;
224
+ this._running.delete(d);
225
+ d.style.overflow = '';
226
+ if (!open) {
227
+ d.open = false;
228
+ d.removeAttribute('data-closing');
229
+ }
230
+ }
231
+ }, { id: 'accordion', text: css$2 });
232
+ }
233
+
234
+ var css$1 = "usa-flip-list{display:block}";
235
+
236
+ function defineFlipList(tag = 'usa-flip-list') {
237
+ return defineElement(tag, (Base) => class UsaFlipList extends Base {
238
+ constructor() {
239
+ super(...arguments);
240
+ /** Child positions relative to the host, from the last layout we saw. */
241
+ this._pos = new WeakMap();
242
+ this._manual = false;
243
+ }
244
+ static get observedAttributes() {
245
+ return [];
246
+ }
247
+ snapshot() {
248
+ const host = this.getBoundingClientRect();
249
+ for (const el of Array.from(this.children)) {
250
+ const r = el.getBoundingClientRect();
251
+ this._pos.set(el, { x: r.left - host.left, y: r.top - host.top });
252
+ }
253
+ }
254
+ mount() {
255
+ this.snapshot();
256
+ if (typeof MutationObserver !== 'undefined') {
257
+ const mo = new MutationObserver(() => {
258
+ if (!this._manual)
259
+ this.animateFrom(this._pos);
260
+ });
261
+ mo.observe(this, { childList: true });
262
+ this.onCleanup(() => mo.disconnect());
263
+ }
264
+ if (typeof ResizeObserver !== 'undefined') {
265
+ const ro = new ResizeObserver(() => this.snapshot());
266
+ ro.observe(this);
267
+ this.onCleanup(() => ro.disconnect());
268
+ }
269
+ }
270
+ animateFrom(prev) {
271
+ const off = this.reduced || this.flag('disabled');
272
+ const host = this.getBoundingClientRect();
273
+ const kids = Array.from(this.children);
274
+ const now = kids.map((el) => {
275
+ const r = el.getBoundingClientRect();
276
+ return { x: r.left - host.left, y: r.top - host.top };
277
+ });
278
+ const anims = [];
279
+ const duration = this.num('duration', 420);
280
+ const easing = this.str('easing', FLUENT_DECELERATE);
281
+ kids.forEach((el, i) => {
282
+ const before = prev.get(el);
283
+ this._pos.set(el, now[i]);
284
+ if (off || typeof el.animate !== 'function')
285
+ return;
286
+ if (!before) {
287
+ anims.push(el.animate([{ opacity: 0, transform: 'scale(0.92)' }, { opacity: 1, transform: 'none' }], { duration, easing }).finished.catch(() => 0));
288
+ return;
289
+ }
290
+ const dx = before.x - now[i].x;
291
+ const dy = before.y - now[i].y;
292
+ if (Math.abs(dx) < 0.5 && Math.abs(dy) < 0.5)
293
+ return;
294
+ anims.push(el.animate([{ transform: `translate(${dx}px, ${dy}px)` }, { transform: 'none' }], { duration, easing, composite: 'add' }).finished.catch(() => 0));
295
+ });
296
+ return Promise.all(anims).then(() => undefined);
297
+ }
298
+ async flip(mutate) {
299
+ this.snapshot();
300
+ const prev = this._pos;
301
+ this._pos = new WeakMap();
302
+ // Copy the snapshot so the observer does not overwrite it mid-mutation
303
+ for (const el of Array.from(this.children)) {
304
+ const p = prev.get(el);
305
+ if (p)
306
+ this._pos.set(el, p);
307
+ }
308
+ this._manual = true;
309
+ try {
310
+ await mutate();
311
+ }
312
+ finally {
313
+ this._manual = false;
314
+ }
315
+ await this.animateFrom(prev);
316
+ }
317
+ }, { id: 'flip-list', text: css$1 });
318
+ }
319
+
320
+ var css = "usa-view-switch{display:grid}usa-view-switch>*{grid-area:1 / 1;min-width:0}usa-view-switch>[hidden]:not([data-leaving]){display:none !important}usa-view-switch>[data-leaving]{display:block;pointer-events:none}";
321
+
322
+ function defineViewSwitch(tag = 'usa-view-switch') {
323
+ return defineElement(tag, (Base) => class UsaViewSwitch extends Base {
324
+ constructor() {
325
+ super(...arguments);
326
+ this._index = -1;
327
+ this._anims = [];
328
+ }
329
+ static get observedAttributes() {
330
+ return ['active'];
331
+ }
332
+ get views() {
333
+ return Array.from(this.children);
334
+ }
335
+ get active() {
336
+ return this.str('active', '0');
337
+ }
338
+ set active(v) {
339
+ this.setAttribute('active', String(v));
340
+ }
341
+ indexOf(v) {
342
+ const views = this.views;
343
+ const byName = views.findIndex((el) => el.dataset.view === String(v));
344
+ if (byName >= 0)
345
+ return byName;
346
+ const n = Number(v);
347
+ return Number.isInteger(n) && n >= 0 && n < views.length ? n : -1;
348
+ }
349
+ changed() {
350
+ this.show(this.active);
351
+ }
352
+ mount() {
353
+ const i = Math.max(0, this.indexOf(this.active));
354
+ this._index = i;
355
+ this.views.forEach((v, j) => this.setVisible(v, j === i));
356
+ }
357
+ setVisible(v, on) {
358
+ v.hidden = !on;
359
+ v.toggleAttribute('inert', !on);
360
+ v.toggleAttribute('data-active', on);
361
+ }
362
+ async show(view) {
363
+ const next = this.indexOf(view);
364
+ const prev = this._index;
365
+ if (next < 0 || next === prev)
366
+ return;
367
+ const views = this.views;
368
+ const from = views[prev];
369
+ const to = views[next];
370
+ this._index = next;
371
+ const name = to.dataset.view ?? String(next);
372
+ if (this.active !== name && this.active !== String(next))
373
+ this.setAttribute('active', name);
374
+ this._anims.splice(0).forEach((a) => a.finish());
375
+ this.setVisible(to, true);
376
+ this.emit('change', { view: to, index: next, name });
377
+ if (!from)
378
+ return;
379
+ const duration = this.num('duration', 320);
380
+ const effect = this.reduced ? 'fade' : this.str('effect', 'slide');
381
+ const dir = next > prev ? 1 : -1;
382
+ let outF;
383
+ let inF;
384
+ switch (effect) {
385
+ case 'fade':
386
+ outF = { opacity: 0 };
387
+ inF = { opacity: 0 };
388
+ break;
389
+ case 'scale':
390
+ outF = { opacity: 0, transform: 'scale(0.96)' };
391
+ inF = { opacity: 0, transform: 'scale(1.04)' };
392
+ break;
393
+ case 'drill':
394
+ outF = { opacity: 0, transform: `scale(${dir > 0 ? 1.06 : 0.94})` };
395
+ inF = { opacity: 0, transform: `scale(${dir > 0 ? 0.94 : 1.06})` };
396
+ break;
397
+ default:
398
+ outF = { opacity: 0, transform: `translateX(${-dir * 32}px)` };
399
+ inF = { opacity: 0, transform: `translateX(${dir * 48}px)` };
400
+ }
401
+ const neutral = (f) => ('transform' in f ? { opacity: 1, transform: 'none' } : { opacity: 1 });
402
+ // Outgoing view stays stacked in the same grid cell while it leaves
403
+ from.setAttribute('data-leaving', '');
404
+ const a = this.motion(from, [neutral(outF), outF], { duration: duration * 0.6, easing: EASE_OUT, fill: 'forwards' });
405
+ const b = this.motion(to, [inF, neutral(inF)], { duration, delay: duration * 0.15, easing: FLUENT_DECELERATE, fill: 'backwards' });
406
+ this._anims = [a, b].filter((x) => !!x);
407
+ await Promise.all(this._anims.map((x) => x.finished.catch(() => undefined)));
408
+ from.removeAttribute('data-leaving');
409
+ if (this._index !== prev)
410
+ this.setVisible(from, false);
411
+ a?.cancel();
412
+ }
413
+ }, { id: 'view-switch', text: css });
414
+ }
415
+
416
+ /**
417
+ * Run `update()` (which changes the DOM) inside a view transition:
418
+ * `document.startViewTransition()` where available (Chrome/Edge 111+, so
419
+ * Electron, WebView2 and Tauri on Windows), otherwise a short cross-fade of
420
+ * `options.fallback`. Instant under reduced motion. Resolves when finished.
421
+ *
422
+ * Give elements a `view-transition-name` in CSS for shared-element morphs.
423
+ */
424
+ async function viewTransition(update, options = {}) {
425
+ const doc = typeof document !== 'undefined' ? document : null;
426
+ if (!doc || prefersReducedMotion()) {
427
+ await update();
428
+ return;
429
+ }
430
+ if (typeof doc.startViewTransition === 'function') {
431
+ let vt;
432
+ try {
433
+ vt = options.types ? doc.startViewTransition({ update, types: options.types }) : doc.startViewTransition(update);
434
+ }
435
+ catch {
436
+ vt = doc.startViewTransition(update);
437
+ }
438
+ await vt.finished.catch(() => undefined);
439
+ return;
440
+ }
441
+ const el = options.fallback;
442
+ const d = options.duration ?? 200;
443
+ if (!el || typeof el.animate !== 'function') {
444
+ await update();
445
+ return;
446
+ }
447
+ await el.animate([{ opacity: 1 }, { opacity: 0 }], { duration: d * 0.8, easing: 'ease-in', fill: 'forwards' }).finished.catch(() => undefined);
448
+ await update();
449
+ const a = el.animate([{ opacity: 0, transform: 'translateY(6px)' }, { opacity: 1, transform: 'none' }], { duration: d * 1.1, easing: EASE_OUT });
450
+ // remove the forwards fill of the fade-out
451
+ el.getAnimations?.().forEach((x) => x !== a && x.cancel());
452
+ await a.finished.catch(() => undefined);
453
+ }
454
+ const list = (t) => (t instanceof Element ? Array.from(t.children) : Array.from(t));
455
+ /**
456
+ * FLIP animation for layout changes (list reorder, filter, grid resize):
457
+ * measures `targets` (an element's children, or a list), runs `mutate()`,
458
+ * then animates each element from its old position to its new one with
459
+ * transforms only. Elements added by `mutate()` fade in.
460
+ *
461
+ * ```js
462
+ * await flip(list, () => list.append(...shuffled));
463
+ * ```
464
+ */
465
+ async function flip(targets, mutate, options = {}) {
466
+ const before = new Map(list(targets).map((el) => [el, el.getBoundingClientRect()]));
467
+ await mutate();
468
+ if (prefersReducedMotion())
469
+ return;
470
+ const after = list(targets);
471
+ const duration = options.duration ?? 420;
472
+ const easing = options.easing ?? FLUENT_DECELERATE;
473
+ const anims = [];
474
+ // Read all, then write all
475
+ const rects = after.map((el) => el.getBoundingClientRect());
476
+ after.forEach((el, i) => {
477
+ if (typeof el.animate !== 'function')
478
+ return;
479
+ const first = before.get(el);
480
+ const last = rects[i];
481
+ if (!first) {
482
+ if (options.animateEnter !== false)
483
+ anims.push(el.animate([{ opacity: 0, transform: 'scale(0.9)' }, { opacity: 1, transform: 'none' }], { duration, easing }));
484
+ return;
485
+ }
486
+ const dx = first.left - last.left;
487
+ const dy = first.top - last.top;
488
+ const sx = last.width ? first.width / last.width : 1;
489
+ const sy = last.height ? first.height / last.height : 1;
490
+ if (Math.abs(dx) < 0.5 && Math.abs(dy) < 0.5 && Math.abs(sx - 1) < 0.01 && Math.abs(sy - 1) < 0.01)
491
+ return;
492
+ anims.push(el.animate([{ transformOrigin: '0 0', transform: `translate(${dx}px, ${dy}px) scale(${sx}, ${sy})` }, { transformOrigin: '0 0', transform: 'none' }], { duration, easing }));
493
+ });
494
+ await Promise.all(anims.map((a) => a.finished.catch(() => undefined)));
495
+ }
496
+ /**
497
+ * Connected (shared-element) animation, like WinUI's
498
+ * `ConnectedAnimationService`: `to` flies from the position and size of
499
+ * `from` into its own place (e.g. a thumbnail opening into a detail view).
500
+ * Call it right after `to` is shown. Transforms only.
501
+ */
502
+ async function connectedAnimation(from, to, options = {}) {
503
+ if (prefersReducedMotion() || typeof to.animate !== 'function')
504
+ return;
505
+ const a = from.getBoundingClientRect();
506
+ const b = to.getBoundingClientRect();
507
+ if (!b.width || !b.height)
508
+ return;
509
+ const hide = options.hideSource !== false && from instanceof HTMLElement;
510
+ const prev = hide ? from.style.visibility : '';
511
+ if (hide)
512
+ from.style.visibility = 'hidden';
513
+ const anim = to.animate([
514
+ { transformOrigin: '0 0', transform: `translate(${a.left - b.left}px, ${a.top - b.top}px) scale(${a.width / b.width}, ${a.height / b.height})` },
515
+ { transformOrigin: '0 0', transform: 'none' },
516
+ ], { duration: options.duration ?? 480, easing: options.easing ?? FLUENT_DECELERATE });
517
+ await anim.finished.catch(() => undefined);
518
+ if (hide)
519
+ from.style.visibility = prev;
520
+ }
521
+
522
+ /**
523
+ * use-scroll-animate/components/transitions — view & layout transitions.
524
+ * `<usa-dialog>`, `<usa-accordion>`, `<usa-flip-list>`, `<usa-view-switch>`
525
+ * and the `viewTransition()`, `flip()`, `connectedAnimation()` helpers.
526
+ */
527
+ /** Register every component of this category under its default tag. */
528
+ function defineTransitionComponents() {
529
+ defineDialog();
530
+ defineAccordion();
531
+ defineFlipList();
532
+ defineViewSwitch();
533
+ }
534
+
535
+ export { connectedAnimation, defineAccordion, defineDialog, defineFlipList, defineTransitionComponents, defineViewSwitch, flip, prefersReducedMotion, viewTransition };
536
+ //# sourceMappingURL=transitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transitions.js","sources":["../../src/components/transitions/dialog.ts","../../src/components/transitions/accordion.ts","../../src/components/transitions/flip-list.ts","../../src/components/transitions/view-switch.ts","../../src/components/transitions/helpers.ts","../../src/components/transitions/index.ts"],"sourcesContent":["import { defineElement, shadowStyles, EASE_OUT, FLUENT_DECELERATE, type UsaElement } from '../base';\nimport shadowCss from './dialog.shadow.css?raw';\nimport css from './dialog.css?raw';\n\nexport type DialogVariant = 'modal' | 'drawer-start' | 'drawer-end' | 'drawer-bottom' | 'sheet';\n\n/**\n * `<usa-dialog>` — an animated modal or drawer built on the native\n * `<dialog>` (top layer, focus trapping, inert page, Esc to close). Its\n * children are slotted into the panel (they stay in the light DOM, so\n * React / Vue / Svelte keep owning them). Style with `::part(panel)`,\n * `::part(backdrop)` and the `--usa-dialog-*` custom properties.\n *\n * Attributes: `open` (reflects; set/remove to open/close), `variant`\n * (`modal` default — Fluent scale + fade; `drawer-start` / `drawer-end`\n * slide from the side, `drawer-bottom` / `sheet` from below), `label`\n * (accessible name), `no-backdrop-close`, `no-esc`. Elements inside\n * with `data-close` close it. Events: `usa:open`, `usa:close` (cancelable\n * `usa:beforeclose`). Reduced motion: fade only.\n */\nexport interface UsaDialogElement extends UsaElement {\n open: boolean;\n show(): Promise<void>;\n close(returnValue?: string): Promise<void>;\n readonly dialog: HTMLDialogElement | null;\n returnValue: string;\n}\n\nconst FROM: Record<string, string> = {\n modal: 'scale(0.94)',\n 'drawer-start': 'translateX(-100%)',\n 'drawer-end': 'translateX(100%)',\n 'drawer-bottom': 'translateY(100%)',\n sheet: 'translateY(40px)',\n};\n\nexport function defineDialog(tag = 'usa-dialog'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaDialog extends Base {\n static get observedAttributes(): string[] {\n return ['open', 'variant', 'label'];\n }\n\n private _dialog: HTMLDialogElement | null = null;\n private _panel: HTMLElement | null = null;\n private _backdrop: HTMLElement | null = null;\n private _busy: Promise<void> | null = null;\n private _syncing = false;\n returnValue = '';\n\n get dialog(): HTMLDialogElement | null {\n return this._dialog;\n }\n get open(): boolean {\n return this.hasAttribute('open');\n }\n set open(v: boolean) {\n this.toggleAttribute('open', !!v);\n }\n\n private get variant(): string {\n const v = this.str('variant', 'modal');\n return FROM[v] ? v : 'modal';\n }\n\n changed(name: string): void {\n if (name === 'open') {\n if (this._syncing) return;\n if (this.open) this.show();\n else this.close();\n } else this.syncAttrs();\n }\n\n private syncAttrs(): void {\n if (!this._dialog) return;\n this._dialog.setAttribute('data-variant', this.variant);\n this._dialog.setAttribute('aria-modal', 'true');\n const label = this.getAttribute('label');\n if (label) this._dialog.setAttribute('aria-label', label);\n }\n\n mount(): void {\n if (!this._dialog) {\n const root = this.shadowRoot || this.attachShadow({ mode: 'open' });\n root.innerHTML = '<dialog part=\"dialog\"><div part=\"backdrop\" aria-hidden=\"true\"></div><div part=\"panel\"><slot></slot></div></dialog>';\n shadowStyles(root, shadowCss);\n this._dialog = root.querySelector('dialog');\n this._backdrop = root.querySelector('[part=backdrop]');\n this._panel = root.querySelector('[part=panel]');\n }\n this.syncAttrs();\n const dlg = this._dialog!;\n this.listen(dlg, 'cancel', (e: Event) => {\n e.preventDefault();\n if (!this.flag('no-esc')) this.close('cancel');\n });\n this.listen(this._backdrop!, 'click', () => !this.flag('no-backdrop-close') && this.close('backdrop'));\n this.listen(this, 'click', (e: Event) => {\n const t = (e.target as Element).closest?.('[data-close]');\n if (t && this.contains(t)) this.close((t as HTMLElement).getAttribute('data-close') || 'close');\n });\n if (this.open && !dlg.open) this.show();\n }\n\n unmount(): void {\n if (this._dialog?.open) this._dialog.close();\n }\n\n private setOpenAttr(on: boolean): void {\n this._syncing = true;\n this.toggleAttribute('open', on);\n this._syncing = false;\n }\n\n async show(): Promise<void> {\n await this._busy;\n const dlg = this._dialog;\n if (!dlg) {\n this.setOpenAttr(true); // opens on connect\n return;\n }\n if (dlg.open) return;\n this.setOpenAttr(true);\n try {\n if (typeof dlg.showModal === 'function') dlg.showModal();\n else dlg.setAttribute('open', '');\n } catch {\n dlg.setAttribute('open', '');\n }\n this.emit('open');\n if (this.reduced) {\n await this.animate2([{ opacity: 0 }, { opacity: 1 }], [{ opacity: 0 }, { opacity: 1 }], 160, EASE_OUT);\n return;\n }\n await this.animate2(\n [{ opacity: 0, transform: FROM[this.variant] }, { opacity: 1, transform: 'none' }],\n [{ opacity: 0 }, { opacity: 1 }],\n this.variant === 'modal' ? 260 : 360,\n FLUENT_DECELERATE\n );\n }\n\n async close(returnValue = ''): Promise<void> {\n await this._busy;\n const dlg = this._dialog;\n if (!dlg || !dlg.open) {\n this.setOpenAttr(false);\n return;\n }\n if (!this.emit('beforeclose', { returnValue })) {\n this.setOpenAttr(true);\n return;\n }\n this.returnValue = returnValue;\n this._busy = (async () => {\n const panelTo = this.reduced ? { opacity: 0 } : { opacity: 0, transform: FROM[this.variant] };\n const panelFrom = this.reduced ? { opacity: 1 } : { opacity: 1, transform: 'none' };\n await this.animate2([panelFrom, panelTo], [{ opacity: 1 }, { opacity: 0 }], this.reduced ? 120 : 200, 'cubic-bezier(0.7, 0, 0.84, 0)', 'forwards');\n try {\n if (typeof dlg.close === 'function') dlg.close(returnValue);\n else dlg.removeAttribute('open');\n } catch {\n dlg.removeAttribute('open');\n }\n dlg.removeAttribute('open');\n this._panel?.getAnimations?.().forEach((a) => a.cancel());\n this._backdrop?.getAnimations?.().forEach((a) => a.cancel());\n this.setOpenAttr(false);\n this.emit('close', { returnValue });\n })();\n await this._busy;\n this._busy = null;\n }\n\n private animate2(panel: Keyframe[], backdrop: Keyframe[], duration: number, easing: string, fill: FillMode = 'none'): Promise<void> {\n const a = this._panel ? this.motion(this._panel, panel, { duration, easing, fill }) : null;\n const b = this._backdrop ? this.motion(this._backdrop, backdrop, { duration, easing: 'linear', fill }) : null;\n return Promise.all([a?.finished, b?.finished].map((p) => p?.catch(() => undefined))).then(() => undefined);\n }\n },\n { id: 'dialog', text: css }\n );\n}\n","import { defineElement, EASE_OUT, type UsaElement } from '../base';\nimport css from './accordion.css?raw';\n\n/**\n * `<usa-accordion>` — smooth expand / collapse for the native `<details>`\n * elements inside it (keeps their semantics, keyboard support and\n * find-in-page, and adds no wrapper elements, so framework-rendered content\n * is left alone). Only one stays open unless `multiple` is set.\n *\n * Attributes: `multiple`, `duration` (ms, 300). Event: `usa:toggle`\n * (`detail.details`, `detail.open`). Reduced motion: instant.\n * Heights are measured once per toggle and animated on the `<details>`.\n */\nexport interface UsaAccordionElement extends UsaElement {\n readonly items: HTMLDetailsElement[];\n toggleItem(details: HTMLDetailsElement, open?: boolean): Promise<void>;\n}\n\nexport function defineAccordion(tag = 'usa-accordion'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaAccordion extends Base {\n static get observedAttributes(): string[] {\n return [];\n }\n\n private _running = new WeakMap<HTMLDetailsElement, Animation>();\n\n get items(): HTMLDetailsElement[] {\n return Array.from(this.children).filter((c): c is HTMLDetailsElement => c.tagName === 'DETAILS');\n }\n\n mount(): void {\n this.listen(this, 'click', (e: MouseEvent) => {\n const summary = (e.target as Element).closest?.('summary');\n const d = summary?.parentElement;\n if (!summary || !d || d.tagName !== 'DETAILS' || d.parentElement !== this) return;\n e.preventDefault();\n this.toggleItem(d as HTMLDetailsElement);\n });\n }\n\n /** Height of `d` when closed: its summary plus its own padding and border. */\n private closedHeight(d: HTMLDetailsElement): number {\n const summary = d.querySelector(':scope > summary');\n const cs = typeof getComputedStyle === 'function' ? getComputedStyle(d) : null;\n const extra = cs\n ? ['paddingTop', 'paddingBottom', 'borderTopWidth', 'borderBottomWidth'].reduce((n, k) => n + (parseFloat((cs as any)[k]) || 0), 0)\n : 0;\n return (summary ? summary.getBoundingClientRect().height : 0) + extra;\n }\n\n async toggleItem(d: HTMLDetailsElement, open = !d.open || d.hasAttribute('data-closing')): Promise<void> {\n if (open && !this.flag('multiple')) this.items.forEach((o) => o !== d && o.open && this.toggleItem(o, false));\n this._running.get(d)?.cancel();\n this._running.delete(d);\n const duration = this.reduced ? 0 : this.num('duration', 300);\n const startH = d.getBoundingClientRect().height;\n if (open) {\n d.removeAttribute('data-closing');\n d.open = true;\n }\n this.emit('toggle', { details: d, open });\n if (!duration || typeof d.animate !== 'function') {\n if (!open) d.open = false;\n return;\n }\n const endH = open ? d.getBoundingClientRect().height : this.closedHeight(d);\n if (!open) d.setAttribute('data-closing', '');\n d.style.overflow = 'hidden';\n const a = d.animate([{ height: `${startH}px` }, { height: `${endH}px` }], { duration, easing: EASE_OUT });\n this._running.set(d, a);\n await a.finished.catch(() => undefined);\n if (this._running.get(d) !== a) return;\n this._running.delete(d);\n d.style.overflow = '';\n if (!open) {\n d.open = false;\n d.removeAttribute('data-closing');\n }\n }\n },\n { id: 'accordion', text: css }\n );\n}\n","import { defineElement, FLUENT_DECELERATE, type UsaElement } from '../base';\nimport css from './flip-list.css?raw';\n\n/**\n * `<usa-flip-list>` — animates its children to their new places whenever\n * they are added, removed or reordered (FLIP: transforms only). Works with\n * any rendering: plain DOM, React keyed lists, Vue `v-for`, Svelte `{#each}`.\n *\n * Attributes: `duration` (ms, 420), `easing`, `disabled`.\n * Method: `flip(mutate)` for explicit changes (also measures resizes).\n * Reduced motion: no animation.\n */\nexport interface UsaFlipListElement extends UsaElement {\n flip(mutate: () => void | Promise<void>): Promise<void>;\n}\n\nexport function defineFlipList(tag = 'usa-flip-list'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaFlipList extends Base {\n static get observedAttributes(): string[] {\n return [];\n }\n\n /** Child positions relative to the host, from the last layout we saw. */\n private _pos = new WeakMap<Element, { x: number; y: number }>();\n private _manual = false;\n\n private snapshot(): void {\n const host = this.getBoundingClientRect();\n for (const el of Array.from(this.children)) {\n const r = el.getBoundingClientRect();\n this._pos.set(el, { x: r.left - host.left, y: r.top - host.top });\n }\n }\n\n mount(): void {\n this.snapshot();\n if (typeof MutationObserver !== 'undefined') {\n const mo = new MutationObserver(() => {\n if (!this._manual) this.animateFrom(this._pos);\n });\n mo.observe(this, { childList: true });\n this.onCleanup(() => mo.disconnect());\n }\n if (typeof ResizeObserver !== 'undefined') {\n const ro = new ResizeObserver(() => this.snapshot());\n ro.observe(this);\n this.onCleanup(() => ro.disconnect());\n }\n }\n\n private animateFrom(prev: WeakMap<Element, { x: number; y: number }>): Promise<void> {\n const off = this.reduced || this.flag('disabled');\n const host = this.getBoundingClientRect();\n const kids = Array.from(this.children) as HTMLElement[];\n const now = kids.map((el) => {\n const r = el.getBoundingClientRect();\n return { x: r.left - host.left, y: r.top - host.top };\n });\n const anims: Promise<unknown>[] = [];\n const duration = this.num('duration', 420);\n const easing = this.str('easing', FLUENT_DECELERATE);\n kids.forEach((el, i) => {\n const before = prev.get(el);\n this._pos.set(el, now[i]);\n if (off || typeof el.animate !== 'function') return;\n if (!before) {\n anims.push(el.animate([{ opacity: 0, transform: 'scale(0.92)' }, { opacity: 1, transform: 'none' }], { duration, easing }).finished.catch(() => 0));\n return;\n }\n const dx = before.x - now[i].x;\n const dy = before.y - now[i].y;\n if (Math.abs(dx) < 0.5 && Math.abs(dy) < 0.5) return;\n anims.push(el.animate([{ transform: `translate(${dx}px, ${dy}px)` }, { transform: 'none' }], { duration, easing, composite: 'add' } as KeyframeAnimationOptions).finished.catch(() => 0));\n });\n return Promise.all(anims).then(() => undefined);\n }\n\n async flip(mutate: () => void | Promise<void>): Promise<void> {\n this.snapshot();\n const prev = this._pos;\n this._pos = new WeakMap();\n // Copy the snapshot so the observer does not overwrite it mid-mutation\n for (const el of Array.from(this.children)) {\n const p = prev.get(el);\n if (p) this._pos.set(el, p);\n }\n this._manual = true;\n try {\n await mutate();\n } finally {\n this._manual = false;\n }\n await this.animateFrom(prev);\n }\n },\n { id: 'flip-list', text: css }\n );\n}\n","import { defineElement, EASE_OUT, FLUENT_DECELERATE, type UsaElement } from '../base';\nimport css from './view-switch.css?raw';\n\n/**\n * `<usa-view-switch>` — shows one of its children at a time (tabs, wizard\n * steps, app pages) and animates between them. Children are views; name\n * them with `data-view`, or address them by index.\n *\n * Attributes: `active` (view name or index, default the first),\n * `effect` (`fade` | `slide` (default, direction-aware — Fluent \"page\n * transition\") | `scale` | `drill`), `duration` (ms, 320). Inactive views\n * get `hidden` + `inert`. Event: `usa:change` (`detail.view`,\n * `detail.index`). Reduced motion: a quick fade.\n */\nexport interface UsaViewSwitchElement extends UsaElement {\n active: string;\n readonly views: HTMLElement[];\n show(view: string | number): Promise<void>;\n}\n\nexport function defineViewSwitch(tag = 'usa-view-switch'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaViewSwitch extends Base {\n static get observedAttributes(): string[] {\n return ['active'];\n }\n\n private _index = -1;\n private _anims: Animation[] = [];\n\n get views(): HTMLElement[] {\n return Array.from(this.children) as HTMLElement[];\n }\n get active(): string {\n return this.str('active', '0');\n }\n set active(v: string) {\n this.setAttribute('active', String(v));\n }\n\n private indexOf(v: string | number): number {\n const views = this.views;\n const byName = views.findIndex((el) => el.dataset.view === String(v));\n if (byName >= 0) return byName;\n const n = Number(v);\n return Number.isInteger(n) && n >= 0 && n < views.length ? n : -1;\n }\n\n changed(): void {\n this.show(this.active);\n }\n\n mount(): void {\n const i = Math.max(0, this.indexOf(this.active));\n this._index = i;\n this.views.forEach((v, j) => this.setVisible(v, j === i));\n }\n\n private setVisible(v: HTMLElement, on: boolean): void {\n v.hidden = !on;\n v.toggleAttribute('inert', !on);\n v.toggleAttribute('data-active', on);\n }\n\n async show(view: string | number): Promise<void> {\n const next = this.indexOf(view);\n const prev = this._index;\n if (next < 0 || next === prev) return;\n const views = this.views;\n const from = views[prev];\n const to = views[next];\n this._index = next;\n const name = to.dataset.view ?? String(next);\n if (this.active !== name && this.active !== String(next)) this.setAttribute('active', name);\n this._anims.splice(0).forEach((a) => a.finish());\n this.setVisible(to, true);\n this.emit('change', { view: to, index: next, name });\n if (!from) return;\n const duration = this.num('duration', 320);\n const effect = this.reduced ? 'fade' : this.str('effect', 'slide');\n const dir = next > prev ? 1 : -1;\n let outF: Keyframe;\n let inF: Keyframe;\n switch (effect) {\n case 'fade':\n outF = { opacity: 0 };\n inF = { opacity: 0 };\n break;\n case 'scale':\n outF = { opacity: 0, transform: 'scale(0.96)' };\n inF = { opacity: 0, transform: 'scale(1.04)' };\n break;\n case 'drill':\n outF = { opacity: 0, transform: `scale(${dir > 0 ? 1.06 : 0.94})` };\n inF = { opacity: 0, transform: `scale(${dir > 0 ? 0.94 : 1.06})` };\n break;\n default:\n outF = { opacity: 0, transform: `translateX(${-dir * 32}px)` };\n inF = { opacity: 0, transform: `translateX(${dir * 48}px)` };\n }\n const neutral = (f: Keyframe): Keyframe => ('transform' in f ? { opacity: 1, transform: 'none' } : { opacity: 1 });\n // Outgoing view stays stacked in the same grid cell while it leaves\n from.setAttribute('data-leaving', '');\n const a = this.motion(from, [neutral(outF), outF], { duration: duration * 0.6, easing: EASE_OUT, fill: 'forwards' });\n const b = this.motion(to, [inF, neutral(inF)], { duration, delay: duration * 0.15, easing: FLUENT_DECELERATE, fill: 'backwards' });\n this._anims = [a, b].filter((x): x is Animation => !!x);\n await Promise.all(this._anims.map((x) => x.finished.catch(() => undefined)));\n from.removeAttribute('data-leaving');\n if (this._index !== prev) this.setVisible(from, false);\n a?.cancel();\n }\n },\n { id: 'view-switch', text: css }\n );\n}\n","import { prefersReducedMotion, EASE_OUT, FLUENT_DECELERATE } from '../base';\n\nexport interface ViewTransitionOptions {\n /**\n * Element to cross-fade when the View Transitions API is missing (default:\n * none — the update is applied without animation).\n */\n fallback?: HTMLElement | null;\n /** Fallback fade duration in ms (default 180 out + 220 in). */\n duration?: number;\n /** View transition types (`document.startViewTransition({ types })`, where supported). */\n types?: string[];\n}\n\n/**\n * Run `update()` (which changes the DOM) inside a view transition:\n * `document.startViewTransition()` where available (Chrome/Edge 111+, so\n * Electron, WebView2 and Tauri on Windows), otherwise a short cross-fade of\n * `options.fallback`. Instant under reduced motion. Resolves when finished.\n *\n * Give elements a `view-transition-name` in CSS for shared-element morphs.\n */\nexport async function viewTransition(update: () => void | Promise<void>, options: ViewTransitionOptions = {}): Promise<void> {\n const doc: any = typeof document !== 'undefined' ? document : null;\n if (!doc || prefersReducedMotion()) {\n await update();\n return;\n }\n if (typeof doc.startViewTransition === 'function') {\n let vt: any;\n try {\n vt = options.types ? doc.startViewTransition({ update, types: options.types }) : doc.startViewTransition(update);\n } catch {\n vt = doc.startViewTransition(update);\n }\n await vt.finished.catch(() => undefined);\n return;\n }\n const el = options.fallback;\n const d = options.duration ?? 200;\n if (!el || typeof el.animate !== 'function') {\n await update();\n return;\n }\n await el.animate([{ opacity: 1 }, { opacity: 0 }], { duration: d * 0.8, easing: 'ease-in', fill: 'forwards' }).finished.catch(() => undefined);\n await update();\n const a = el.animate([{ opacity: 0, transform: 'translateY(6px)' }, { opacity: 1, transform: 'none' }], { duration: d * 1.1, easing: EASE_OUT });\n // remove the forwards fill of the fade-out\n el.getAnimations?.().forEach((x) => x !== a && x.cancel());\n await a.finished.catch(() => undefined);\n}\n\nexport interface FlipOptions {\n duration?: number;\n easing?: string;\n /** Fade/scale in elements that did not exist before (default true). */\n animateEnter?: boolean;\n}\n\ntype Targets = Element | Iterable<Element> | ArrayLike<Element>;\nconst list = (t: Targets): HTMLElement[] =>\n (t instanceof Element ? Array.from(t.children) : Array.from(t as ArrayLike<Element>)) as HTMLElement[];\n\n/**\n * FLIP animation for layout changes (list reorder, filter, grid resize):\n * measures `targets` (an element's children, or a list), runs `mutate()`,\n * then animates each element from its old position to its new one with\n * transforms only. Elements added by `mutate()` fade in.\n *\n * ```js\n * await flip(list, () => list.append(...shuffled));\n * ```\n */\nexport async function flip(targets: Targets, mutate: () => void | Promise<void>, options: FlipOptions = {}): Promise<void> {\n const before = new Map(list(targets).map((el) => [el, el.getBoundingClientRect()]));\n await mutate();\n if (prefersReducedMotion()) return;\n const after = list(targets);\n const duration = options.duration ?? 420;\n const easing = options.easing ?? FLUENT_DECELERATE;\n const anims: Animation[] = [];\n // Read all, then write all\n const rects = after.map((el) => el.getBoundingClientRect());\n after.forEach((el, i) => {\n if (typeof el.animate !== 'function') return;\n const first = before.get(el);\n const last = rects[i];\n if (!first) {\n if (options.animateEnter !== false) anims.push(el.animate([{ opacity: 0, transform: 'scale(0.9)' }, { opacity: 1, transform: 'none' }], { duration, easing }));\n return;\n }\n const dx = first.left - last.left;\n const dy = first.top - last.top;\n const sx = last.width ? first.width / last.width : 1;\n const sy = last.height ? first.height / last.height : 1;\n if (Math.abs(dx) < 0.5 && Math.abs(dy) < 0.5 && Math.abs(sx - 1) < 0.01 && Math.abs(sy - 1) < 0.01) return;\n anims.push(\n el.animate(\n [{ transformOrigin: '0 0', transform: `translate(${dx}px, ${dy}px) scale(${sx}, ${sy})` }, { transformOrigin: '0 0', transform: 'none' }],\n { duration, easing }\n )\n );\n });\n await Promise.all(anims.map((a) => a.finished.catch(() => undefined)));\n}\n\nexport interface ConnectedOptions {\n duration?: number;\n easing?: string;\n /** Hide `from` while the animation runs (default true). */\n hideSource?: boolean;\n}\n\n/**\n * Connected (shared-element) animation, like WinUI's\n * `ConnectedAnimationService`: `to` flies from the position and size of\n * `from` into its own place (e.g. a thumbnail opening into a detail view).\n * Call it right after `to` is shown. Transforms only.\n */\nexport async function connectedAnimation(from: Element, to: HTMLElement, options: ConnectedOptions = {}): Promise<void> {\n if (prefersReducedMotion() || typeof to.animate !== 'function') return;\n const a = from.getBoundingClientRect();\n const b = to.getBoundingClientRect();\n if (!b.width || !b.height) return;\n const hide = options.hideSource !== false && from instanceof HTMLElement;\n const prev = hide ? (from as HTMLElement).style.visibility : '';\n if (hide) (from as HTMLElement).style.visibility = 'hidden';\n const anim = to.animate(\n [\n { transformOrigin: '0 0', transform: `translate(${a.left - b.left}px, ${a.top - b.top}px) scale(${a.width / b.width}, ${a.height / b.height})` },\n { transformOrigin: '0 0', transform: 'none' },\n ],\n { duration: options.duration ?? 480, easing: options.easing ?? FLUENT_DECELERATE }\n );\n await anim.finished.catch(() => undefined);\n if (hide) (from as HTMLElement).style.visibility = prev;\n}\n","/**\n * use-scroll-animate/components/transitions — view & layout transitions.\n * `<usa-dialog>`, `<usa-accordion>`, `<usa-flip-list>`, `<usa-view-switch>`\n * and the `viewTransition()`, `flip()`, `connectedAnimation()` helpers.\n */\nimport { defineDialog, type UsaDialogElement } from './dialog';\nimport { defineAccordion, type UsaAccordionElement } from './accordion';\nimport { defineFlipList, type UsaFlipListElement } from './flip-list';\nimport { defineViewSwitch, type UsaViewSwitchElement } from './view-switch';\n\nexport { defineDialog, defineAccordion, defineFlipList, defineViewSwitch };\nexport { viewTransition, flip, connectedAnimation } from './helpers';\nexport type { ViewTransitionOptions, FlipOptions, ConnectedOptions } from './helpers';\nexport type { DialogVariant } from './dialog';\nexport type { UsaDialogElement, UsaAccordionElement, UsaFlipListElement, UsaViewSwitchElement };\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 defineTransitionComponents(): void {\n defineDialog();\n defineAccordion();\n defineFlipList();\n defineViewSwitch();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-dialog': UsaDialogElement;\n 'usa-accordion': UsaAccordionElement;\n 'usa-flip-list': UsaFlipListElement;\n 'usa-view-switch': UsaViewSwitchElement;\n }\n}\n"],"names":["css"],"mappings":";;;;;;;AA4BA,MAAM,IAAI,GAA2B;AACnC,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,cAAc,EAAE,mBAAmB;AACnC,IAAA,YAAY,EAAE,kBAAkB;AAChC,IAAA,eAAe,EAAE,kBAAkB;AACnC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