use-scroll-animate 3.8.0 → 3.9.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 (123) hide show
  1. package/CHANGELOG.md +20 -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/{base-BpROOcey.js → base-BRIPyPtX.js} +11 -2
  6. package/dist/chunks/{base-BpROOcey.js.map → base-BRIPyPtX.js.map} +1 -1
  7. package/dist/chunks/{base-CXx7jZ-o.cjs → base-Dm6ee5ug.cjs} +11 -1
  8. package/dist/chunks/{base-CXx7jZ-o.cjs.map → base-Dm6ee5ug.cjs.map} +1 -1
  9. package/dist/chunks/{core-IaorbTdu.cjs → core-CHAtivHV.cjs} +2 -2
  10. package/dist/chunks/{core-IaorbTdu.cjs.map → core-CHAtivHV.cjs.map} +1 -1
  11. package/dist/chunks/{core-uxs3ETou.js → core-CYozf_E-.js} +2 -2
  12. package/dist/chunks/{core-uxs3ETou.js.map → core-CYozf_E-.js.map} +1 -1
  13. package/dist/chunks/{index-tags-BANJ-e4H.js → index-tags-BmQR17Sb.js} +2 -1
  14. package/dist/chunks/{index-tags-BANJ-e4H.js.map → index-tags-BmQR17Sb.js.map} +1 -1
  15. package/dist/chunks/{index-tags-wbuPiMR6.cjs → index-tags-DYYsgbba.cjs} +2 -1
  16. package/dist/chunks/{index-tags-wbuPiMR6.cjs.map → index-tags-DYYsgbba.cjs.map} +1 -1
  17. package/dist/chunks/{spring-2OTnYCzm.cjs → spring-Dp5BllPB.cjs} +2 -2
  18. package/dist/chunks/{spring-2OTnYCzm.cjs.map → spring-Dp5BllPB.cjs.map} +1 -1
  19. package/dist/chunks/{spring-C-fw7_9f.js → spring-UBPhrh1X.js} +2 -2
  20. package/dist/chunks/{spring-C-fw7_9f.js.map → spring-UBPhrh1X.js.map} +1 -1
  21. package/dist/chunks/{variants-CHe1VbSn.js → variants-DTypaOH3.js} +2 -2
  22. package/dist/chunks/{variants-CHe1VbSn.js.map → variants-DTypaOH3.js.map} +1 -1
  23. package/dist/chunks/{variants-BNIrn4ch.cjs → variants-_dC-ey6R.cjs} +2 -2
  24. package/dist/chunks/{variants-BNIrn4ch.cjs.map → variants-_dC-ey6R.cjs.map} +1 -1
  25. package/dist/components/angular.cjs +6 -5
  26. package/dist/components/angular.cjs.map +1 -1
  27. package/dist/components/angular.d.cts +25 -0
  28. package/dist/components/angular.d.ts +25 -0
  29. package/dist/components/angular.js +6 -5
  30. package/dist/components/angular.js.map +1 -1
  31. package/dist/components/background.cjs +2 -2
  32. package/dist/components/background.js +3 -3
  33. package/dist/components/cards.cjs +2 -2
  34. package/dist/components/cards.js +3 -3
  35. package/dist/components/click.cjs +2 -2
  36. package/dist/components/click.js +3 -3
  37. package/dist/components/depth.cjs +3 -3
  38. package/dist/components/depth.js +4 -4
  39. package/dist/components/feedback.cjs +1 -1
  40. package/dist/components/feedback.js +2 -2
  41. package/dist/components/gesture.cjs +3 -3
  42. package/dist/components/gesture.js +5 -5
  43. package/dist/components/interaction.cjs +1 -1
  44. package/dist/components/interaction.js +2 -2
  45. package/dist/components/jsx.d.cts +1 -0
  46. package/dist/components/jsx.d.ts +1 -0
  47. package/dist/components/layout.cjs +1 -1
  48. package/dist/components/layout.js +2 -2
  49. package/dist/components/lazy.cjs +2 -1
  50. package/dist/components/lazy.cjs.map +1 -1
  51. package/dist/components/lazy.d.cts +1 -0
  52. package/dist/components/lazy.d.ts +1 -0
  53. package/dist/components/lazy.js +2 -1
  54. package/dist/components/lazy.js.map +1 -1
  55. package/dist/components/packs.cjs +194 -0
  56. package/dist/components/packs.cjs.map +1 -0
  57. package/dist/components/packs.css +3 -0
  58. package/dist/components/packs.d.cts +107 -0
  59. package/dist/components/packs.d.ts +107 -0
  60. package/dist/components/packs.js +185 -0
  61. package/dist/components/packs.js.map +1 -0
  62. package/dist/components/page.cjs +2 -2
  63. package/dist/components/page.js +3 -3
  64. package/dist/components/physics.cjs +2 -2
  65. package/dist/components/physics.js +4 -4
  66. package/dist/components/react.cjs +1 -1
  67. package/dist/components/react.js +1 -1
  68. package/dist/components/reveal.cjs +1 -1
  69. package/dist/components/reveal.js +2 -2
  70. package/dist/components/solid.cjs +6 -5
  71. package/dist/components/solid.cjs.map +1 -1
  72. package/dist/components/solid.d.cts +25 -0
  73. package/dist/components/solid.d.ts +25 -0
  74. package/dist/components/solid.js +6 -5
  75. package/dist/components/solid.js.map +1 -1
  76. package/dist/components/svelte.cjs +6 -5
  77. package/dist/components/svelte.cjs.map +1 -1
  78. package/dist/components/svelte.d.cts +25 -0
  79. package/dist/components/svelte.d.ts +25 -0
  80. package/dist/components/svelte.js +6 -5
  81. package/dist/components/svelte.js.map +1 -1
  82. package/dist/components/svg.cjs +1 -1
  83. package/dist/components/svg.js +2 -2
  84. package/dist/components/text.cjs +1 -1
  85. package/dist/components/text.js +2 -2
  86. package/dist/components/timeline.cjs +1 -1
  87. package/dist/components/timeline.js +2 -2
  88. package/dist/components/transitions.cjs +5 -1
  89. package/dist/components/transitions.cjs.map +1 -1
  90. package/dist/components/transitions.d.cts +2 -0
  91. package/dist/components/transitions.d.ts +2 -0
  92. package/dist/components/transitions.js +6 -2
  93. package/dist/components/transitions.js.map +1 -1
  94. package/dist/components/ui.cjs +3 -3
  95. package/dist/components/ui.js +5 -5
  96. package/dist/components/vue.cjs +6 -5
  97. package/dist/components/vue.cjs.map +1 -1
  98. package/dist/components/vue.d.cts +25 -0
  99. package/dist/components/vue.d.ts +25 -0
  100. package/dist/components/vue.js +6 -5
  101. package/dist/components/vue.js.map +1 -1
  102. package/dist/components/webgl.cjs +1 -1
  103. package/dist/components/webgl.js +2 -2
  104. package/dist/components.cjs +14 -5
  105. package/dist/components.cjs.map +1 -1
  106. package/dist/components.css +1 -0
  107. package/dist/components.d.cts +65 -2
  108. package/dist/components.d.ts +65 -2
  109. package/dist/components.js +11 -8
  110. package/dist/components.js.map +1 -1
  111. package/dist/components.umd.js +2 -2
  112. package/dist/components.umd.js.map +1 -1
  113. package/dist/index.cjs +7 -0
  114. package/dist/index.cjs.map +1 -1
  115. package/dist/index.d.cts +2 -0
  116. package/dist/index.d.ts +2 -0
  117. package/dist/index.js +7 -0
  118. package/dist/index.js.map +1 -1
  119. package/dist/index.umd.js +2 -2
  120. package/dist/index.umd.js.map +1 -1
  121. package/docs/components.md +14 -0
  122. package/docs/upgrading-4.md +65 -0
  123. package/package.json +13 -2
@@ -0,0 +1,107 @@
1
+ /**
2
+ * use-scroll-animate/components — shared base for the `<usa-*>` custom elements.
3
+ *
4
+ * Everything here is lazy: nothing touches `window`, `document`,
5
+ * `HTMLElement` or `matchMedia` at import time, so the components can be
6
+ * imported during SSR (Next, Nuxt, Astro…) and in Electron/Tauri preload
7
+ * scripts. Classes are created the first time a `define*()` function runs.
8
+ */
9
+ interface ComponentsConfig {
10
+ /**
11
+ * Inject each component's CSS when it is defined (default `true`). Uses a
12
+ * constructable stylesheet (`document.adoptedStyleSheets`, which a strict
13
+ * `style-src` CSP does not block) and falls back to a `<style>` tag. Set
14
+ * to `false` when you load `use-scroll-animate/components.css` yourself.
15
+ */
16
+ injectStyles?: boolean;
17
+ /**
18
+ * `'user'` (default) follows `prefers-reduced-motion`; `'reduce'` always
19
+ * uses the reduced variants (e.g. a kiosk / battery-saver mode);
20
+ * `'no-preference'` ignores the OS setting (only for demos — respect your users).
21
+ */
22
+ reducedMotion?: 'user' | 'reduce' | 'no-preference';
23
+ /**
24
+ * Global motion intensity (v2.7): `'off'` (same as reduced motion),
25
+ * `'low'` (shorter, calmer), `'normal'` (default) or `'high'`. Scales every
26
+ * component animation's duration and sets `--usa-motion` (0 / 0.6 / 1 /
27
+ * 1.25) on `<html>` for your own CSS. See `setMotionIntensity()`.
28
+ */
29
+ motionIntensity?: MotionIntensity;
30
+ }
31
+ type MotionIntensity = 'off' | 'low' | 'normal' | 'high';
32
+ /** Change global component settings (call before `define*()` for `injectStyles`). */
33
+ declare function configureComponents(options: ComponentsConfig): void;
34
+ /** `true` when animations should be reduced (OS setting or `configureComponents`). */
35
+ declare function prefersReducedMotion(): boolean;
36
+ /**
37
+ * Members shared by every `<usa-*>` element. Attribute helpers, a cleanup
38
+ * bag that is emptied on disconnect, and motion helpers that degrade to the
39
+ * final state without WAAPI or under reduced motion.
40
+ */
41
+ interface UsaElement extends HTMLElement {
42
+ /** `true` while reduced motion applies to this element. */
43
+ readonly reduced: boolean;
44
+ }
45
+
46
+ /**
47
+ * `<usa-pack name="ecommerce">` — applies an effect pack (`ecommerce` ·
48
+ * `portfolio` · `dashboard` · `game` · `landing`) to its subtree:
49
+ * descendants opt in with `data-role` (see `PACKS`). Re-applies when
50
+ * `name` changes; undone on disconnect.
51
+ */
52
+ interface UsaPackElement extends UsaElement {
53
+ readonly roles: string[];
54
+ }
55
+ declare function definePack(tag?: string): CustomElementConstructor | undefined;
56
+
57
+ type Cleanup = () => void;
58
+ interface PackContext {
59
+ root: HTMLElement;
60
+ /** Index of the element among those with the same role (for staggering). */
61
+ index: number;
62
+ reduced: boolean;
63
+ }
64
+ /** Count `el`'s number up from 0 when it enters the view (keeps prefix / suffix / decimals). */
65
+ declare function countUp(el: HTMLElement, duration?: number): Cleanup;
66
+ /**
67
+ * Fly a copy of `from` (e.g. a product image) into `to` (the cart icon) along
68
+ * an arc, then bump the target. Resolves when it lands. Instant under
69
+ * reduced motion (only the bump's state change, no flight).
70
+ */
71
+ declare function flyToCart(from: Element, to: Element, o?: {
72
+ duration?: number;
73
+ }): Promise<void>;
74
+ /** The five effect packs: `data-role` → primitives. */
75
+ declare const PACKS: Record<string, Record<string, string[]>>;
76
+ type PackName = keyof typeof PACKS;
77
+ /**
78
+ * Apply an effect pack to `root`: every descendant with a `data-role` the
79
+ * pack knows gets its effects (staggered by index). Returns an undo function.
80
+ * Reduced motion: only non-motion behaviour (e.g. the cart event) remains.
81
+ *
82
+ * @example
83
+ * applyPack('ecommerce', document.querySelector('main'));
84
+ * // <article data-role="product">… <button data-role="add-to-cart"> … <a data-role="cart">
85
+ */
86
+ declare function applyPack(name: PackName | string, root?: HTMLElement | Document): Cleanup;
87
+ /** Primitive names a pack uses (for docs / tooling). */
88
+ declare const PACK_PRIMITIVES: string[];
89
+
90
+ /**
91
+ * use-scroll-animate/components/packs — effect packs (v3.9).
92
+ * Ready-made motion for e-commerce, portfolio, dashboard, game UI and
93
+ * landing pages: mark elements with `data-role` and apply a pack with
94
+ * `<usa-pack name="…">` or `applyPack(name, root)`. Includes `flyToCart()`
95
+ * and `countUp()`.
96
+ */
97
+
98
+ /** Register every component of this category under its default tag. */
99
+ declare function definePacksComponents(): void;
100
+ declare global {
101
+ interface HTMLElementTagNameMap {
102
+ 'usa-pack': UsaPackElement;
103
+ }
104
+ }
105
+
106
+ export { PACKS, PACK_PRIMITIVES, applyPack, configureComponents, countUp, definePack, definePacksComponents, flyToCart, prefersReducedMotion };
107
+ export type { ComponentsConfig, PackContext, PackName, UsaElement, UsaPackElement };
@@ -0,0 +1,185 @@
1
+ import { p as prefersReducedMotion, n as now, m as motionScale, r as raf, h as EASE_OUT, b as clamp, E as EASE_SPRING, i as defineElement } from '../chunks/base-BRIPyPtX.js';
2
+ export { a as configureComponents } from '../chunks/base-BRIPyPtX.js';
3
+
4
+ const anim = (el, frames, o) => {
5
+ if (typeof el.animate !== 'function')
6
+ return null;
7
+ const k = motionScale();
8
+ return el.animate(frames, { ...o, duration: (o.duration ?? 400) * k, delay: (o.delay ?? 0) * k });
9
+ };
10
+ const on = (el, type, fn) => {
11
+ el.addEventListener(type, fn);
12
+ return () => el.removeEventListener(type, fn);
13
+ };
14
+ const io = (el, cb) => {
15
+ if (typeof IntersectionObserver === 'undefined')
16
+ return void cb();
17
+ const o = new IntersectionObserver((es) => es.some((e) => e.isIntersecting) && (o.disconnect(), cb()), { threshold: 0.15 });
18
+ o.observe(el);
19
+ return () => o.disconnect();
20
+ };
21
+ /** Count `el`'s number up from 0 when it enters the view (keeps prefix / suffix / decimals). */
22
+ function countUp(el, duration = 1200) {
23
+ const text = el.textContent || '';
24
+ const m = /(-?[\d,]*\.?\d+)/.exec(text);
25
+ if (!m || prefersReducedMotion())
26
+ return () => { };
27
+ const target = Number(m[1].replace(/,/g, ''));
28
+ const dec = (m[1].split('.')[1] || '').length;
29
+ const fmt = (v) => text.replace(m[1], v.toLocaleString('en-US', { minimumFractionDigits: dec, maximumFractionDigits: dec }));
30
+ el.setAttribute('aria-label', text.trim());
31
+ el.textContent = fmt(0);
32
+ let stop = false;
33
+ const off = io(el, () => {
34
+ const t0 = now();
35
+ const d = duration * motionScale() || 1;
36
+ const step = () => {
37
+ if (stop)
38
+ return;
39
+ const p = clamp((now() - t0) / d, 0, 1);
40
+ el.textContent = fmt(target * (1 - Math.pow(1 - p, 3)));
41
+ if (p < 1)
42
+ raf(step);
43
+ };
44
+ raf(step);
45
+ });
46
+ return () => {
47
+ stop = true;
48
+ off();
49
+ el.textContent = text;
50
+ };
51
+ }
52
+ /**
53
+ * Fly a copy of `from` (e.g. a product image) into `to` (the cart icon) along
54
+ * an arc, then bump the target. Resolves when it lands. Instant under
55
+ * reduced motion (only the bump's state change, no flight).
56
+ */
57
+ async function flyToCart(from, to, o = {}) {
58
+ if (prefersReducedMotion() || typeof document === 'undefined')
59
+ return;
60
+ const a = from.getBoundingClientRect();
61
+ const b = to.getBoundingClientRect();
62
+ const ghost = from.cloneNode(true);
63
+ ghost.setAttribute('aria-hidden', 'true');
64
+ Object.assign(ghost.style, { position: 'fixed', left: `${a.left}px`, top: `${a.top}px`, width: `${a.width}px`, height: `${a.height}px`, margin: '0', zIndex: '2147483000', pointerEvents: 'none' });
65
+ document.body.appendChild(ghost);
66
+ const dx = b.left + b.width / 2 - (a.left + a.width / 2);
67
+ const dy = b.top + b.height / 2 - (a.top + a.height / 2);
68
+ const f = anim(ghost, [
69
+ { transform: 'translate(0, 0) scale(1)', opacity: 1 },
70
+ { transform: `translate(${dx * 0.5}px, ${dy * 0.5 - 80}px) scale(0.6)`, opacity: 0.9, offset: 0.5 },
71
+ { transform: `translate(${dx}px, ${dy}px) scale(0.15)`, opacity: 0.4 },
72
+ ], { duration: o.duration ?? 700, easing: 'cubic-bezier(0.5, 0, 0.5, 1)' });
73
+ await f?.finished.catch(() => undefined);
74
+ ghost.remove();
75
+ anim(to, [{ transform: 'scale(1)' }, { transform: 'scale(1.3)' }, { transform: 'scale(1)' }], { duration: 380, easing: EASE_SPRING });
76
+ }
77
+ const PRIMITIVES = {
78
+ reveal: (el, c) => {
79
+ if (c.reduced)
80
+ return;
81
+ el.style.opacity = '0';
82
+ const off = io(el, () => {
83
+ el.style.opacity = '';
84
+ anim(el, [{ opacity: 0, transform: 'translateY(24px)' }, { opacity: 1, transform: 'none' }], { duration: 600, delay: Math.min(c.index, 8) * 70, easing: EASE_OUT, fill: 'backwards' });
85
+ });
86
+ return () => (off(), (el.style.opacity = ''));
87
+ },
88
+ lift: (el, c) => {
89
+ if (c.reduced)
90
+ return;
91
+ const a = on(el, 'pointerenter', () => anim(el, [{ transform: 'none' }, { transform: 'translateY(-6px) scale(1.02)' }], { duration: 220, easing: EASE_OUT, fill: 'forwards' }));
92
+ const b = on(el, 'pointerleave', () => anim(el, [{ transform: 'translateY(-6px) scale(1.02)' }, { transform: 'none' }], { duration: 260, easing: EASE_OUT, fill: 'forwards' }));
93
+ return () => (a(), b());
94
+ },
95
+ press: (el, c) => (c.reduced ? undefined : on(el, 'pointerdown', () => anim(el, [{ transform: 'scale(1)' }, { transform: 'scale(0.94)' }, { transform: 'scale(1)' }], { duration: 260, easing: EASE_SPRING }))),
96
+ 'count-up': (el) => countUp(el),
97
+ pulse: (el, c) => {
98
+ if (c.reduced)
99
+ return;
100
+ const a = anim(el, [{ boxShadow: '0 0 0 0 rgba(124, 92, 255, 0.55)' }, { boxShadow: '0 0 0 14px rgba(124, 92, 255, 0)' }], { duration: 1600, iterations: Infinity });
101
+ return () => a?.cancel();
102
+ },
103
+ float: (el, c) => {
104
+ if (c.reduced)
105
+ return;
106
+ const a = anim(el, [{ transform: 'translateY(0)' }, { transform: 'translateY(-8px)' }, { transform: 'translateY(0)' }], { duration: 3000, delay: c.index * 300, iterations: Infinity, easing: 'ease-in-out' });
107
+ return () => a?.cancel();
108
+ },
109
+ shake: (el, c) => (c.reduced ? undefined : on(el, 'click', () => anim(el, [0, -8, 8, -6, 6, -3, 0].map((x) => ({ transform: `translateX(${x}px)` })), { duration: 420 }))),
110
+ bump: (el, c) => (c.reduced ? undefined : on(el, 'usa:bump', () => anim(el, [{ transform: 'scale(1)' }, { transform: 'scale(1.25)' }, { transform: 'scale(1)' }], { duration: 360, easing: EASE_SPRING }))),
111
+ 'fly-to-cart': (el, c) => on(el, 'click', () => {
112
+ const cart = c.root.querySelector('[data-role="cart"]') || document.querySelector('[data-role="cart"]');
113
+ const item = el.closest('[data-role="product"]')?.querySelector('img, [data-role="thumb"]') || el;
114
+ if (cart)
115
+ void flyToCart(item, cart).then(() => cart.dispatchEvent(new CustomEvent('usa:added', { bubbles: true })));
116
+ }),
117
+ };
118
+ /** The five effect packs: `data-role` → primitives. */
119
+ const PACKS = {
120
+ ecommerce: { product: ['reveal', 'lift'], 'add-to-cart': ['press', 'fly-to-cart'], cart: ['bump'], price: ['count-up'], badge: ['pulse'] },
121
+ portfolio: { project: ['reveal', 'lift'], heading: ['reveal'], stat: ['count-up'], contact: ['press', 'pulse'] },
122
+ dashboard: { card: ['reveal'], stat: ['count-up'], alert: ['pulse'], action: ['press'] },
123
+ game: { button: ['press'], score: ['count-up', 'bump'], item: ['float'], hit: ['shake'], reward: ['pulse'] },
124
+ landing: { hero: ['reveal'], feature: ['reveal', 'lift'], cta: ['press', 'pulse'], logo: ['float'], stat: ['count-up'] },
125
+ };
126
+ /**
127
+ * Apply an effect pack to `root`: every descendant with a `data-role` the
128
+ * pack knows gets its effects (staggered by index). Returns an undo function.
129
+ * Reduced motion: only non-motion behaviour (e.g. the cart event) remains.
130
+ *
131
+ * @example
132
+ * applyPack('ecommerce', document.querySelector('main'));
133
+ * // <article data-role="product">… <button data-role="add-to-cart"> … <a data-role="cart">
134
+ */
135
+ function applyPack(name, root = document) {
136
+ const pack = PACKS[name];
137
+ if (!pack || typeof document === 'undefined')
138
+ return () => { };
139
+ const r = root.documentElement ? root.body : root;
140
+ const reduced = prefersReducedMotion();
141
+ const cleanups = [];
142
+ for (const [role, fx] of Object.entries(pack)) {
143
+ r.querySelectorAll(`[data-role="${role}"]`).forEach((el, index) => {
144
+ for (const f of fx) {
145
+ const c = PRIMITIVES[f]?.(el, { root: r, index, reduced });
146
+ if (c)
147
+ cleanups.push(c);
148
+ }
149
+ });
150
+ }
151
+ return () => cleanups.splice(0).forEach((c) => c());
152
+ }
153
+ /** Primitive names a pack uses (for docs / tooling). */
154
+ const PACK_PRIMITIVES = Object.keys(PRIMITIVES);
155
+
156
+ function definePack(tag = 'usa-pack') {
157
+ return defineElement(tag, (Base) => class UsaPack extends Base {
158
+ static get observedAttributes() {
159
+ return ['name'];
160
+ }
161
+ get roles() {
162
+ return Object.keys(PACKS[this.str('name', 'landing')] || {});
163
+ }
164
+ mount() {
165
+ var _a;
166
+ (_a = this.style).display || (_a.display = 'block');
167
+ this.onCleanup(applyPack(this.str('name', 'landing'), this));
168
+ }
169
+ });
170
+ }
171
+
172
+ /**
173
+ * use-scroll-animate/components/packs — effect packs (v3.9).
174
+ * Ready-made motion for e-commerce, portfolio, dashboard, game UI and
175
+ * landing pages: mark elements with `data-role` and apply a pack with
176
+ * `<usa-pack name="…">` or `applyPack(name, root)`. Includes `flyToCart()`
177
+ * and `countUp()`.
178
+ */
179
+ /** Register every component of this category under its default tag. */
180
+ function definePacksComponents() {
181
+ definePack();
182
+ }
183
+
184
+ export { PACKS, PACK_PRIMITIVES, applyPack, countUp, definePack, definePacksComponents, flyToCart, prefersReducedMotion };
185
+ //# sourceMappingURL=packs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packs.js","sources":["../../src/components/packs/core.ts","../../src/components/packs/pack-el.ts","../../src/components/packs/index.ts"],"sourcesContent":["import { prefersReducedMotion, motionScale, EASE_OUT, EASE_SPRING, raf, now, clamp } from '../base';\n\ntype Cleanup = () => void;\n/** A pack primitive: wire one element, return a cleanup. */\ntype Effect = (el: HTMLElement, ctx: PackContext) => Cleanup | void;\n\nexport interface PackContext {\n root: HTMLElement;\n /** Index of the element among those with the same role (for staggering). */\n index: number;\n reduced: boolean;\n}\n\nconst anim = (el: Element, frames: Keyframe[], o: KeyframeAnimationOptions): Animation | null => {\n if (typeof (el as HTMLElement).animate !== 'function') return null;\n const k = motionScale();\n return (el as HTMLElement).animate(frames, { ...o, duration: ((o.duration as number) ?? 400) * k, delay: (o.delay ?? 0) * k });\n};\nconst on = (el: EventTarget, type: string, fn: (e: any) => void): Cleanup => {\n el.addEventListener(type, fn);\n return () => el.removeEventListener(type, fn);\n};\nconst io = (el: Element, cb: () => void): Cleanup => {\n if (typeof IntersectionObserver === 'undefined') return void cb() as unknown as Cleanup;\n const o = new IntersectionObserver((es) => es.some((e) => e.isIntersecting) && (o.disconnect(), cb()), { threshold: 0.15 });\n o.observe(el);\n return () => o.disconnect();\n};\n\n/** Count `el`'s number up from 0 when it enters the view (keeps prefix / suffix / decimals). */\nexport function countUp(el: HTMLElement, duration = 1200): Cleanup {\n const text = el.textContent || '';\n const m = /(-?[\\d,]*\\.?\\d+)/.exec(text);\n if (!m || prefersReducedMotion()) return () => {};\n const target = Number(m[1].replace(/,/g, ''));\n const dec = (m[1].split('.')[1] || '').length;\n const fmt = (v: number) => text.replace(m[1], v.toLocaleString('en-US', { minimumFractionDigits: dec, maximumFractionDigits: dec }));\n el.setAttribute('aria-label', text.trim());\n el.textContent = fmt(0);\n let stop = false;\n const off = io(el, () => {\n const t0 = now();\n const d = duration * motionScale() || 1;\n const step = () => {\n if (stop) return;\n const p = clamp((now() - t0) / d, 0, 1);\n el.textContent = fmt(target * (1 - Math.pow(1 - p, 3)));\n if (p < 1) raf(step);\n };\n raf(step);\n });\n return () => {\n stop = true;\n off();\n el.textContent = text;\n };\n}\n\n/**\n * Fly a copy of `from` (e.g. a product image) into `to` (the cart icon) along\n * an arc, then bump the target. Resolves when it lands. Instant under\n * reduced motion (only the bump's state change, no flight).\n */\nexport async function flyToCart(from: Element, to: Element, o: { duration?: number } = {}): Promise<void> {\n if (prefersReducedMotion() || typeof document === 'undefined') return;\n const a = from.getBoundingClientRect();\n const b = to.getBoundingClientRect();\n const ghost = from.cloneNode(true) as HTMLElement;\n ghost.setAttribute('aria-hidden', 'true');\n Object.assign(ghost.style, { position: 'fixed', left: `${a.left}px`, top: `${a.top}px`, width: `${a.width}px`, height: `${a.height}px`, margin: '0', zIndex: '2147483000', pointerEvents: 'none' });\n document.body.appendChild(ghost);\n const dx = b.left + b.width / 2 - (a.left + a.width / 2);\n const dy = b.top + b.height / 2 - (a.top + a.height / 2);\n const f = anim(ghost, [\n { transform: 'translate(0, 0) scale(1)', opacity: 1 },\n { transform: `translate(${dx * 0.5}px, ${dy * 0.5 - 80}px) scale(0.6)`, opacity: 0.9, offset: 0.5 },\n { transform: `translate(${dx}px, ${dy}px) scale(0.15)`, opacity: 0.4 },\n ], { duration: o.duration ?? 700, easing: 'cubic-bezier(0.5, 0, 0.5, 1)' });\n await f?.finished.catch(() => undefined);\n ghost.remove();\n anim(to, [{ transform: 'scale(1)' }, { transform: 'scale(1.3)' }, { transform: 'scale(1)' }], { duration: 380, easing: EASE_SPRING });\n}\n\nconst PRIMITIVES: Record<string, Effect> = {\n reveal: (el, c) => {\n if (c.reduced) return;\n el.style.opacity = '0';\n const off = io(el, () => {\n el.style.opacity = '';\n anim(el, [{ opacity: 0, transform: 'translateY(24px)' }, { opacity: 1, transform: 'none' }], { duration: 600, delay: Math.min(c.index, 8) * 70, easing: EASE_OUT, fill: 'backwards' });\n });\n return () => (off(), (el.style.opacity = ''));\n },\n lift: (el, c) => {\n if (c.reduced) return;\n const a = on(el, 'pointerenter', () => anim(el, [{ transform: 'none' }, { transform: 'translateY(-6px) scale(1.02)' }], { duration: 220, easing: EASE_OUT, fill: 'forwards' }));\n const b = on(el, 'pointerleave', () => anim(el, [{ transform: 'translateY(-6px) scale(1.02)' }, { transform: 'none' }], { duration: 260, easing: EASE_OUT, fill: 'forwards' }));\n return () => (a(), b());\n },\n press: (el, c) => (c.reduced ? undefined : on(el, 'pointerdown', () => anim(el, [{ transform: 'scale(1)' }, { transform: 'scale(0.94)' }, { transform: 'scale(1)' }], { duration: 260, easing: EASE_SPRING }))),\n 'count-up': (el) => countUp(el),\n pulse: (el, c) => {\n if (c.reduced) return;\n const a = anim(el, [{ boxShadow: '0 0 0 0 rgba(124, 92, 255, 0.55)' }, { boxShadow: '0 0 0 14px rgba(124, 92, 255, 0)' }], { duration: 1600, iterations: Infinity });\n return () => a?.cancel();\n },\n float: (el, c) => {\n if (c.reduced) return;\n const a = anim(el, [{ transform: 'translateY(0)' }, { transform: 'translateY(-8px)' }, { transform: 'translateY(0)' }], { duration: 3000, delay: c.index * 300, iterations: Infinity, easing: 'ease-in-out' });\n return () => a?.cancel();\n },\n shake: (el, c) => (c.reduced ? undefined : on(el, 'click', () => anim(el, [0, -8, 8, -6, 6, -3, 0].map((x) => ({ transform: `translateX(${x}px)` })), { duration: 420 }))),\n bump: (el, c) => (c.reduced ? undefined : on(el, 'usa:bump', () => anim(el, [{ transform: 'scale(1)' }, { transform: 'scale(1.25)' }, { transform: 'scale(1)' }], { duration: 360, easing: EASE_SPRING }))),\n 'fly-to-cart': (el, c) =>\n on(el, 'click', () => {\n const cart = c.root.querySelector('[data-role=\"cart\"]') || document.querySelector('[data-role=\"cart\"]');\n const item = el.closest('[data-role=\"product\"]')?.querySelector('img, [data-role=\"thumb\"]') || el;\n if (cart) void flyToCart(item, cart).then(() => cart.dispatchEvent(new CustomEvent('usa:added', { bubbles: true })));\n }),\n};\n\n/** The five effect packs: `data-role` → primitives. */\nexport const PACKS: Record<string, Record<string, string[]>> = {\n ecommerce: { product: ['reveal', 'lift'], 'add-to-cart': ['press', 'fly-to-cart'], cart: ['bump'], price: ['count-up'], badge: ['pulse'] },\n portfolio: { project: ['reveal', 'lift'], heading: ['reveal'], stat: ['count-up'], contact: ['press', 'pulse'] },\n dashboard: { card: ['reveal'], stat: ['count-up'], alert: ['pulse'], action: ['press'] },\n game: { button: ['press'], score: ['count-up', 'bump'], item: ['float'], hit: ['shake'], reward: ['pulse'] },\n landing: { hero: ['reveal'], feature: ['reveal', 'lift'], cta: ['press', 'pulse'], logo: ['float'], stat: ['count-up'] },\n};\n\nexport type PackName = keyof typeof PACKS;\n\n/**\n * Apply an effect pack to `root`: every descendant with a `data-role` the\n * pack knows gets its effects (staggered by index). Returns an undo function.\n * Reduced motion: only non-motion behaviour (e.g. the cart event) remains.\n *\n * @example\n * applyPack('ecommerce', document.querySelector('main'));\n * // <article data-role=\"product\">… <button data-role=\"add-to-cart\"> … <a data-role=\"cart\">\n */\nexport function applyPack(name: PackName | string, root: HTMLElement | Document = document): Cleanup {\n const pack = PACKS[name];\n if (!pack || typeof document === 'undefined') return () => {};\n const r = (root as Document).documentElement ? (root as Document).body : (root as HTMLElement);\n const reduced = prefersReducedMotion();\n const cleanups: Cleanup[] = [];\n for (const [role, fx] of Object.entries(pack)) {\n r.querySelectorAll<HTMLElement>(`[data-role=\"${role}\"]`).forEach((el, index) => {\n for (const f of fx) {\n const c = PRIMITIVES[f]?.(el, { root: r, index, reduced });\n if (c) cleanups.push(c);\n }\n });\n }\n return () => cleanups.splice(0).forEach((c) => c());\n}\n\n/** Primitive names a pack uses (for docs / tooling). */\nexport const PACK_PRIMITIVES = Object.keys(PRIMITIVES);\n","import { defineElement, type UsaElement } from '../base';\nimport { applyPack, PACKS } from './core';\n\n/**\n * `<usa-pack name=\"ecommerce\">` — applies an effect pack (`ecommerce` ·\n * `portfolio` · `dashboard` · `game` · `landing`) to its subtree:\n * descendants opt in with `data-role` (see `PACKS`). Re-applies when\n * `name` changes; undone on disconnect.\n */\nexport interface UsaPackElement extends UsaElement {\n readonly roles: string[];\n}\n\nexport function definePack(tag = 'usa-pack'): CustomElementConstructor | undefined {\n return defineElement(tag, (Base) =>\n class UsaPack extends Base {\n static get observedAttributes(): string[] {\n return ['name'];\n }\n get roles(): string[] {\n return Object.keys(PACKS[this.str('name', 'landing')] || {});\n }\n mount(): void {\n this.style.display ||= 'block';\n this.onCleanup(applyPack(this.str('name', 'landing'), this));\n }\n }\n );\n}\n","/**\n * use-scroll-animate/components/packs — effect packs (v3.9).\n * Ready-made motion for e-commerce, portfolio, dashboard, game UI and\n * landing pages: mark elements with `data-role` and apply a pack with\n * `<usa-pack name=\"…\">` or `applyPack(name, root)`. Includes `flyToCart()`\n * and `countUp()`.\n */\nimport { definePack, type UsaPackElement } from './pack-el';\n\nexport { definePack };\nexport { applyPack, flyToCart, countUp, PACKS, PACK_PRIMITIVES } from './core';\nexport type { PackName, PackContext } from './core';\nexport type { UsaPackElement };\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 definePacksComponents(): void {\n definePack();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-pack': UsaPackElement;\n }\n}\n"],"names":[],"mappings":";;;AAaA,MAAM,IAAI,GAAG,CAAC,EAAW,EAAE,MAAkB,EAAE,CAA2B,KAAsB;AAC9F,IAAA,IAAI,OAAQ,EAAkB,CAAC,OAAO,KAAK,UAAU;AAAE,QAAA,OAAO,IAAI;AAClE,IAAA,MAAM,CAAC,GAAG,WAAW,EAAE;AACvB,IAAA,OAAQ,EAAkB,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAE,CAAC,CAAC,QAAmB,IAAI,GAAG,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAChI,CAAC;AACD,MAAM,EAAE,GAAG,CAAC,EAAe,EAAE,IAAY,EAAE,EAAoB,KAAa;AAC1E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;AACH;;AC5BA;;;;;;AAMG;AAUH;SACgB,qBAAqB,GAAA;AACnC,IAAA,UAAU,EAAE;AACd;;;;"}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var base = require('../chunks/base-CXx7jZ-o.cjs');
4
- var spring = require('../chunks/spring-2OTnYCzm.cjs');
3
+ var base = require('../chunks/base-Dm6ee5ug.cjs');
4
+ var spring = require('../chunks/spring-Dp5BllPB.cjs');
5
5
 
6
6
  var css$8 = "usa-cursor{--usa-cursor-color:var(--usa-accent,#7c5cff);--usa-cursor-size:28px;position:fixed;inset:0;pointer-events:none;z-index:2147483600;opacity:0;transition:opacity 0.2s ease;contain:strict}usa-cursor[data-active]{opacity:1}usa-cursor .usa-cursor-ring{position:absolute;left:0;top:0;width:var(--usa-cursor-size);height:var(--usa-cursor-size);margin:calc(var(--usa-cursor-size) / -2) 0 0 calc(var(--usa-cursor-size) / -2);border:1.5px solid var(--usa-cursor-color);border-radius:999px;box-sizing:border-box;transition:width 0.25s cubic-bezier(0.34,1.56,0.64,1),height 0.25s cubic-bezier(0.34,1.56,0.64,1),margin 0.25s ease,border-radius 0.25s ease,background-color 0.2s ease;will-change:transform}usa-cursor[mode=\"trail\"] .usa-cursor-ring{border:0;background:var(--usa-cursor-color);width:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04));height:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04));margin:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04) / -2) 0 0 calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04) / -2);opacity:calc(1 - var(--i) * 0.11)}usa-cursor[data-hover] .usa-cursor-ring:first-child{width:calc(var(--usa-cursor-size) * 1.6);height:calc(var(--usa-cursor-size) * 1.6);margin:calc(var(--usa-cursor-size) * -0.8) 0 0 calc(var(--usa-cursor-size) * -0.8);background:color-mix(in srgb,var(--usa-cursor-color) 15%,transparent)}usa-cursor[data-snapped] .usa-cursor-ring{border-radius:12px;background:color-mix(in srgb,var(--usa-cursor-color) 12%,transparent);translate:-50% -50%;margin:0}usa-cursor[data-down] .usa-cursor-ring:first-child{scale:0.8}usa-cursor .usa-cursor-dot{position:absolute;left:-3px;top:-3px;width:6px;height:6px;border-radius:50%;background:var(--usa-cursor-color)}usa-cursor[data-snapped] .usa-cursor-dot{opacity:0}usa-cursor .usa-cursor-glow{position:absolute;left:-200px;top:-200px;width:400px;height:400px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--usa-cursor-color) 35%,transparent),transparent 65%);mix-blend-mode:screen}.usa-cursor-none,.usa-cursor-none *{cursor:none !important}@media (pointer:coarse),(prefers-reduced-motion:reduce){usa-cursor{display:none}.usa-cursor-none,.usa-cursor-none *{cursor:auto !important}}";
7
7
 
@@ -1,6 +1,6 @@
1
- import { h as defineElement, e as caf, r as raf, p as prefersReducedMotion, n as now, g as getMotionIntensity, a as configureComponents, f as adoptStyles } from '../chunks/base-BpROOcey.js';
2
- export { M as MOTION_SCALE } from '../chunks/base-BpROOcey.js';
3
- import { e as springSamples } from '../chunks/spring-C-fw7_9f.js';
1
+ import { i as defineElement, e as caf, r as raf, p as prefersReducedMotion, n as now, g as getMotionIntensity, a as configureComponents, f as adoptStyles } from '../chunks/base-BRIPyPtX.js';
2
+ export { M as MOTION_SCALE } from '../chunks/base-BRIPyPtX.js';
3
+ import { e as springSamples } from '../chunks/spring-UBPhrh1X.js';
4
4
 
5
5
  var css$8 = "usa-cursor{--usa-cursor-color:var(--usa-accent,#7c5cff);--usa-cursor-size:28px;position:fixed;inset:0;pointer-events:none;z-index:2147483600;opacity:0;transition:opacity 0.2s ease;contain:strict}usa-cursor[data-active]{opacity:1}usa-cursor .usa-cursor-ring{position:absolute;left:0;top:0;width:var(--usa-cursor-size);height:var(--usa-cursor-size);margin:calc(var(--usa-cursor-size) / -2) 0 0 calc(var(--usa-cursor-size) / -2);border:1.5px solid var(--usa-cursor-color);border-radius:999px;box-sizing:border-box;transition:width 0.25s cubic-bezier(0.34,1.56,0.64,1),height 0.25s cubic-bezier(0.34,1.56,0.64,1),margin 0.25s ease,border-radius 0.25s ease,background-color 0.2s ease;will-change:transform}usa-cursor[mode=\"trail\"] .usa-cursor-ring{border:0;background:var(--usa-cursor-color);width:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04));height:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04));margin:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04) / -2) 0 0 calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04) / -2);opacity:calc(1 - var(--i) * 0.11)}usa-cursor[data-hover] .usa-cursor-ring:first-child{width:calc(var(--usa-cursor-size) * 1.6);height:calc(var(--usa-cursor-size) * 1.6);margin:calc(var(--usa-cursor-size) * -0.8) 0 0 calc(var(--usa-cursor-size) * -0.8);background:color-mix(in srgb,var(--usa-cursor-color) 15%,transparent)}usa-cursor[data-snapped] .usa-cursor-ring{border-radius:12px;background:color-mix(in srgb,var(--usa-cursor-color) 12%,transparent);translate:-50% -50%;margin:0}usa-cursor[data-down] .usa-cursor-ring:first-child{scale:0.8}usa-cursor .usa-cursor-dot{position:absolute;left:-3px;top:-3px;width:6px;height:6px;border-radius:50%;background:var(--usa-cursor-color)}usa-cursor[data-snapped] .usa-cursor-dot{opacity:0}usa-cursor .usa-cursor-glow{position:absolute;left:-200px;top:-200px;width:400px;height:400px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--usa-cursor-color) 35%,transparent),transparent 65%);mix-blend-mode:screen}.usa-cursor-none,.usa-cursor-none *{cursor:none !important}@media (pointer:coarse),(prefers-reduced-motion:reduce){usa-cursor{display:none}.usa-cursor-none,.usa-cursor-none *{cursor:auto !important}}";
6
6
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var base = require('../chunks/base-CXx7jZ-o.cjs');
4
- var spring = require('../chunks/spring-2OTnYCzm.cjs');
3
+ var base = require('../chunks/base-Dm6ee5ug.cjs');
4
+ var spring = require('../chunks/spring-Dp5BllPB.cjs');
5
5
 
6
6
  var css$2 = "usa-spring{display:inline-block;transform-origin:50% 70%}usa-spring[block]{display:block}usa-spring[effect=\"drop\"]{transform-origin:50% 100%}usa-spring[data-state=\"hidden\"]{opacity:0}usa-spring[trigger=\"click\"],usa-spring[trigger=\"hover\"]{cursor:pointer;-webkit-tap-highlight-color:transparent}";
7
7
 
@@ -1,7 +1,7 @@
1
- import { h as defineElement, b as clamp } from '../chunks/base-BpROOcey.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-BpROOcey.js';
3
- import { d as springEasing, c as createSpring, s as snapTo, a as rubberBand, p as projectInertia } from '../chunks/spring-C-fw7_9f.js';
4
- export { S as SPRING_PRESETS, l as linearEasing, r as resolveSpring, b as spring, e as springSamples, f as stepSpring, g as supportsLinearEasing } from '../chunks/spring-C-fw7_9f.js';
1
+ import { i as defineElement, b as clamp } from '../chunks/base-BRIPyPtX.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-BRIPyPtX.js';
3
+ import { d as springEasing, c as createSpring, s as snapTo, a as rubberBand, p as projectInertia } from '../chunks/spring-UBPhrh1X.js';
4
+ export { S as SPRING_PRESETS, l as linearEasing, r as resolveSpring, b as spring, e as springSamples, f as stepSpring, g as supportsLinearEasing } from '../chunks/spring-UBPhrh1X.js';
5
5
 
6
6
  var css$2 = "usa-spring{display:inline-block;transform-origin:50% 70%}usa-spring[block]{display:block}usa-spring[effect=\"drop\"]{transform-origin:50% 100%}usa-spring[data-state=\"hidden\"]{opacity:0}usa-spring[trigger=\"click\"],usa-spring[trigger=\"hover\"]{cursor:pointer;-webkit-tap-highlight-color:transparent}";
7
7
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var indexTags = require('../chunks/index-tags-wbuPiMR6.cjs');
3
+ var indexTags = require('../chunks/index-tags-DYYsgbba.cjs');
4
4
 
5
5
  /**
6
6
  * use-scroll-animate/components/react — React wrappers for every `<usa-*>`
@@ -1,4 +1,4 @@
1
- import { C as COMPONENT_CATEGORIES } from '../chunks/index-tags-BANJ-e4H.js';
1
+ import { C as COMPONENT_CATEGORIES } from '../chunks/index-tags-BmQR17Sb.js';
2
2
 
3
3
  /**
4
4
  * use-scroll-animate/components/react — React wrappers for every `<usa-*>`
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var base = require('../chunks/base-CXx7jZ-o.cjs');
3
+ var base = require('../chunks/base-Dm6ee5ug.cjs');
4
4
 
5
5
  /** Entrance effects shared by `<usa-reveal>` and `<usa-stagger>` (transform / opacity / filter only). */
6
6
  const REVEAL_EFFECTS = [
@@ -1,5 +1,5 @@
1
- import { h as defineElement, i as EASE_OUT, b as clamp, e as caf, r as raf } from '../chunks/base-BpROOcey.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-BpROOcey.js';
1
+ import { i as defineElement, h as EASE_OUT, b as clamp, e as caf, r as raf } from '../chunks/base-BRIPyPtX.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-BRIPyPtX.js';
3
3
 
4
4
  /** Entrance effects shared by `<usa-reveal>` and `<usa-stagger>` (transform / opacity / filter only). */
5
5
  const REVEAL_EFFECTS = [
@@ -3,27 +3,28 @@
3
3
  var components = require('../components.cjs');
4
4
  var bind = require('../chunks/bind-Ui43-n2d.cjs');
5
5
  require('./reveal.cjs');
6
- require('../chunks/base-CXx7jZ-o.cjs');
6
+ require('../chunks/base-Dm6ee5ug.cjs');
7
7
  require('./text.cjs');
8
8
  require('./interaction.cjs');
9
9
  require('./feedback.cjs');
10
10
  require('./background.cjs');
11
- require('../chunks/variants-BNIrn4ch.cjs');
11
+ require('../chunks/variants-_dC-ey6R.cjs');
12
12
  require('./transitions.cjs');
13
13
  require('./physics.cjs');
14
- require('../chunks/spring-2OTnYCzm.cjs');
14
+ require('../chunks/spring-Dp5BllPB.cjs');
15
15
  require('./cards.cjs');
16
16
  require('./click.cjs');
17
17
  require('./ui.cjs');
18
18
  require('./page.cjs');
19
19
  require('./timeline.cjs');
20
20
  require('./gesture.cjs');
21
- require('../chunks/core-IaorbTdu.cjs');
21
+ require('../chunks/core-CHAtivHV.cjs');
22
22
  require('./svg.cjs');
23
23
  require('./webgl.cjs');
24
24
  require('./depth.cjs');
25
25
  require('./layout.cjs');
26
- require('../chunks/index-tags-wbuPiMR6.cjs');
26
+ require('./packs.cjs');
27
+ require('../chunks/index-tags-DYYsgbba.cjs');
27
28
 
28
29
  /**
29
30
  * use-scroll-animate/components/solid — Solid integration (v3.8).
@@ -1 +1 @@
1
- {"version":3,"file":"solid.cjs","sources":["../../src/components/frameworks/solid.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/solid — Solid integration (v3.8).\n * Solid renders custom elements natively: set properties with `prop:` and\n * listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).\n * This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`\n * directive for `use:usa={{ props, on }}`, and JSX types.\n *\n * ```tsx\n * import { defineUsa, usa } from 'use-scroll-animate/components/solid';\n * import type {} from 'use-scroll-animate/components/solid'; // JSX types\n * onMount(() => defineUsa());\n * false && usa; // keep the directive import (Solid convention)\n * <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect=\"flip\">…</usa-card>\n * ```\n */\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\nimport type { UsaIntrinsicElements } from './jsx';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/**\n * Solid directive (`use:usa`). Solid calls it with the element and an\n * accessor; the binding is read once on mount and re-read whenever\n * `refresh()` on the returned handle is called (or wrap it in `createEffect`).\n */\nexport function usa(el: HTMLElement, accessor: () => UsaBinding | undefined): { refresh(): void; destroy(): void } {\n const b = bindUsa(el, accessor() || {});\n return { refresh: () => b.update(accessor() || {}), destroy: b.destroy };\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` in SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n\n/** JSX intrinsic elements for Solid (same attribute types as the React/Preact ones). */\nexport type SolidUsaIntrinsicElements = UsaIntrinsicElements;\n"],"names":["bindUsa","defineComponents"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;AAQH;;;;AAIG;AACG,SAAU,GAAG,CAAC,EAAe,EAAE,QAAsC,EAAA;IACzE,MAAM,CAAC,GAAGA,YAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;AAC1E;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAEC,2BAAgB,CAAC,UAAU,CAAC;AACjE;;;;;;;"}
1
+ {"version":3,"file":"solid.cjs","sources":["../../src/components/frameworks/solid.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/solid — Solid integration (v3.8).\n * Solid renders custom elements natively: set properties with `prop:` and\n * listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).\n * This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`\n * directive for `use:usa={{ props, on }}`, and JSX types.\n *\n * ```tsx\n * import { defineUsa, usa } from 'use-scroll-animate/components/solid';\n * import type {} from 'use-scroll-animate/components/solid'; // JSX types\n * onMount(() => defineUsa());\n * false && usa; // keep the directive import (Solid convention)\n * <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect=\"flip\">…</usa-card>\n * ```\n */\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\nimport type { UsaIntrinsicElements } from './jsx';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/**\n * Solid directive (`use:usa`). Solid calls it with the element and an\n * accessor; the binding is read once on mount and re-read whenever\n * `refresh()` on the returned handle is called (or wrap it in `createEffect`).\n */\nexport function usa(el: HTMLElement, accessor: () => UsaBinding | undefined): { refresh(): void; destroy(): void } {\n const b = bindUsa(el, accessor() || {});\n return { refresh: () => b.update(accessor() || {}), destroy: b.destroy };\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` in SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n\n/** JSX intrinsic elements for Solid (same attribute types as the React/Preact ones). */\nexport type SolidUsaIntrinsicElements = UsaIntrinsicElements;\n"],"names":["bindUsa","defineComponents"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;AAQH;;;;AAIG;AACG,SAAU,GAAG,CAAC,EAAe,EAAE,QAAsC,EAAA;IACzE,MAAM,CAAC,GAAGA,YAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;AAC1E;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAEC,2BAAgB,CAAC,UAAU,CAAC;AACjE;;;;;;;"}
@@ -1590,6 +1590,30 @@ declare global {
1590
1590
  }
1591
1591
  }
1592
1592
 
1593
+ /**
1594
+ * `<usa-pack name="ecommerce">` — applies an effect pack (`ecommerce` ·
1595
+ * `portfolio` · `dashboard` · `game` · `landing`) to its subtree:
1596
+ * descendants opt in with `data-role` (see `PACKS`). Re-applies when
1597
+ * `name` changes; undone on disconnect.
1598
+ */
1599
+ interface UsaPackElement extends UsaElement {
1600
+ readonly roles: string[];
1601
+ }
1602
+
1603
+ /**
1604
+ * use-scroll-animate/components/packs — effect packs (v3.9).
1605
+ * Ready-made motion for e-commerce, portfolio, dashboard, game UI and
1606
+ * landing pages: mark elements with `data-role` and apply a pack with
1607
+ * `<usa-pack name="…">` or `applyPack(name, root)`. Includes `flyToCart()`
1608
+ * and `countUp()`.
1609
+ */
1610
+
1611
+ declare global {
1612
+ interface HTMLElementTagNameMap {
1613
+ 'usa-pack': UsaPackElement;
1614
+ }
1615
+ }
1616
+
1593
1617
  /** The component categories and their default tags. */
1594
1618
  declare const COMPONENT_CATEGORIES: {
1595
1619
  readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
@@ -1609,6 +1633,7 @@ declare const COMPONENT_CATEGORIES: {
1609
1633
  readonly webgl: readonly ["usa-shader", "usa-distort", "usa-liquid"];
1610
1634
  readonly depth: readonly ["usa-cube", "usa-depth"];
1611
1635
  readonly layout: readonly ["usa-auto-animate", "usa-masonry"];
1636
+ readonly packs: readonly ["usa-pack"];
1612
1637
  };
1613
1638
  type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
1614
1639
 
@@ -1590,6 +1590,30 @@ declare global {
1590
1590
  }
1591
1591
  }
1592
1592
 
1593
+ /**
1594
+ * `<usa-pack name="ecommerce">` — applies an effect pack (`ecommerce` ·
1595
+ * `portfolio` · `dashboard` · `game` · `landing`) to its subtree:
1596
+ * descendants opt in with `data-role` (see `PACKS`). Re-applies when
1597
+ * `name` changes; undone on disconnect.
1598
+ */
1599
+ interface UsaPackElement extends UsaElement {
1600
+ readonly roles: string[];
1601
+ }
1602
+
1603
+ /**
1604
+ * use-scroll-animate/components/packs — effect packs (v3.9).
1605
+ * Ready-made motion for e-commerce, portfolio, dashboard, game UI and
1606
+ * landing pages: mark elements with `data-role` and apply a pack with
1607
+ * `<usa-pack name="…">` or `applyPack(name, root)`. Includes `flyToCart()`
1608
+ * and `countUp()`.
1609
+ */
1610
+
1611
+ declare global {
1612
+ interface HTMLElementTagNameMap {
1613
+ 'usa-pack': UsaPackElement;
1614
+ }
1615
+ }
1616
+
1593
1617
  /** The component categories and their default tags. */
1594
1618
  declare const COMPONENT_CATEGORIES: {
1595
1619
  readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
@@ -1609,6 +1633,7 @@ declare const COMPONENT_CATEGORIES: {
1609
1633
  readonly webgl: readonly ["usa-shader", "usa-distort", "usa-liquid"];
1610
1634
  readonly depth: readonly ["usa-cube", "usa-depth"];
1611
1635
  readonly layout: readonly ["usa-auto-animate", "usa-masonry"];
1636
+ readonly packs: readonly ["usa-pack"];
1612
1637
  };
1613
1638
  type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
1614
1639
 
@@ -2,27 +2,28 @@ import { defineComponents } from '../components.js';
2
2
  import { b as bindUsa } from '../chunks/bind-B_CTL6Qn.js';
3
3
  export { u as usaEventName } from '../chunks/bind-B_CTL6Qn.js';
4
4
  import './reveal.js';
5
- import '../chunks/base-BpROOcey.js';
5
+ import '../chunks/base-BRIPyPtX.js';
6
6
  import './text.js';
7
7
  import './interaction.js';
8
8
  import './feedback.js';
9
9
  import './background.js';
10
- import '../chunks/variants-CHe1VbSn.js';
10
+ import '../chunks/variants-DTypaOH3.js';
11
11
  import './transitions.js';
12
12
  import './physics.js';
13
- import '../chunks/spring-C-fw7_9f.js';
13
+ import '../chunks/spring-UBPhrh1X.js';
14
14
  import './cards.js';
15
15
  import './click.js';
16
16
  import './ui.js';
17
17
  import './page.js';
18
18
  import './timeline.js';
19
19
  import './gesture.js';
20
- import '../chunks/core-uxs3ETou.js';
20
+ import '../chunks/core-CYozf_E-.js';
21
21
  import './svg.js';
22
22
  import './webgl.js';
23
23
  import './depth.js';
24
24
  import './layout.js';
25
- import '../chunks/index-tags-BANJ-e4H.js';
25
+ import './packs.js';
26
+ import '../chunks/index-tags-BmQR17Sb.js';
26
27
 
27
28
  /**
28
29
  * use-scroll-animate/components/solid — Solid integration (v3.8).
@@ -1 +1 @@
1
- {"version":3,"file":"solid.js","sources":["../../src/components/frameworks/solid.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/solid — Solid integration (v3.8).\n * Solid renders custom elements natively: set properties with `prop:` and\n * listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).\n * This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`\n * directive for `use:usa={{ props, on }}`, and JSX types.\n *\n * ```tsx\n * import { defineUsa, usa } from 'use-scroll-animate/components/solid';\n * import type {} from 'use-scroll-animate/components/solid'; // JSX types\n * onMount(() => defineUsa());\n * false && usa; // keep the directive import (Solid convention)\n * <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect=\"flip\">…</usa-card>\n * ```\n */\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\nimport type { UsaIntrinsicElements } from './jsx';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/**\n * Solid directive (`use:usa`). Solid calls it with the element and an\n * accessor; the binding is read once on mount and re-read whenever\n * `refresh()` on the returned handle is called (or wrap it in `createEffect`).\n */\nexport function usa(el: HTMLElement, accessor: () => UsaBinding | undefined): { refresh(): void; destroy(): void } {\n const b = bindUsa(el, accessor() || {});\n return { refresh: () => b.update(accessor() || {}), destroy: b.destroy };\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` in SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n\n/** JSX intrinsic elements for Solid (same attribute types as the React/Preact ones). */\nexport type SolidUsaIntrinsicElements = UsaIntrinsicElements;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;AAQH;;;;AAIG;AACG,SAAU,GAAG,CAAC,EAAe,EAAE,QAAsC,EAAA;IACzE,MAAM,CAAC,GAAG,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;AAC1E;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,gBAAgB,CAAC,UAAU,CAAC;AACjE;;;;"}
1
+ {"version":3,"file":"solid.js","sources":["../../src/components/frameworks/solid.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/solid — Solid integration (v3.8).\n * Solid renders custom elements natively: set properties with `prop:` and\n * listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).\n * This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`\n * directive for `use:usa={{ props, on }}`, and JSX types.\n *\n * ```tsx\n * import { defineUsa, usa } from 'use-scroll-animate/components/solid';\n * import type {} from 'use-scroll-animate/components/solid'; // JSX types\n * onMount(() => defineUsa());\n * false && usa; // keep the directive import (Solid convention)\n * <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect=\"flip\">…</usa-card>\n * ```\n */\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\nimport type { UsaIntrinsicElements } from './jsx';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/**\n * Solid directive (`use:usa`). Solid calls it with the element and an\n * accessor; the binding is read once on mount and re-read whenever\n * `refresh()` on the returned handle is called (or wrap it in `createEffect`).\n */\nexport function usa(el: HTMLElement, accessor: () => UsaBinding | undefined): { refresh(): void; destroy(): void } {\n const b = bindUsa(el, accessor() || {});\n return { refresh: () => b.update(accessor() || {}), destroy: b.destroy };\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` in SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n\n/** JSX intrinsic elements for Solid (same attribute types as the React/Preact ones). */\nexport type SolidUsaIntrinsicElements = UsaIntrinsicElements;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;AAQH;;;;AAIG;AACG,SAAU,GAAG,CAAC,EAAe,EAAE,QAAsC,EAAA;IACzE,MAAM,CAAC,GAAG,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;AAC1E;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,gBAAgB,CAAC,UAAU,CAAC;AACjE;;;;"}