use-scroll-animate 3.8.0 → 4.0.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 (117) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +17 -14
  3. package/README_ja.md +11 -11
  4. package/README_zh.md +12 -12
  5. package/dist/chunks/{base-BpROOcey.js → base-ZARFccur.js} +2 -2
  6. package/dist/chunks/{base-BpROOcey.js.map → base-ZARFccur.js.map} +1 -1
  7. package/dist/chunks/core-Co-6AL0h.js +218 -0
  8. package/dist/chunks/core-Co-6AL0h.js.map +1 -0
  9. package/dist/chunks/{core-uxs3ETou.js → core-DKY-fVzR.js} +2 -2
  10. package/dist/chunks/{core-uxs3ETou.js.map → core-DKY-fVzR.js.map} +1 -1
  11. package/dist/chunks/core-DXqZm5Il.cjs +222 -0
  12. package/dist/chunks/core-DXqZm5Il.cjs.map +1 -0
  13. package/dist/chunks/{index-tags-BANJ-e4H.js → index-tags-43Xtd01A.js} +3 -2
  14. package/dist/chunks/index-tags-43Xtd01A.js.map +1 -0
  15. package/dist/chunks/{index-tags-wbuPiMR6.cjs → index-tags-BQh_uGqH.cjs} +3 -2
  16. package/dist/chunks/index-tags-BQh_uGqH.cjs.map +1 -0
  17. package/dist/chunks/{spring-C-fw7_9f.js → spring-E2ickYNI.js} +2 -2
  18. package/dist/chunks/{spring-C-fw7_9f.js.map → spring-E2ickYNI.js.map} +1 -1
  19. package/dist/chunks/{variants-CHe1VbSn.js → variants-DvnxvRCM.js} +2 -2
  20. package/dist/chunks/{variants-CHe1VbSn.js.map → variants-DvnxvRCM.js.map} +1 -1
  21. package/dist/components/angular.cjs +3 -1
  22. package/dist/components/angular.cjs.map +1 -1
  23. package/dist/components/angular.d.cts +29 -17
  24. package/dist/components/angular.d.ts +29 -17
  25. package/dist/components/angular.js +7 -5
  26. package/dist/components/angular.js.map +1 -1
  27. package/dist/components/background.js +3 -3
  28. package/dist/components/cards.js +3 -3
  29. package/dist/components/click.js +3 -3
  30. package/dist/components/depth.js +4 -4
  31. package/dist/components/feedback.js +2 -2
  32. package/dist/components/gesture.js +5 -5
  33. package/dist/components/interaction.js +2 -2
  34. package/dist/components/jsx.d.cts +2 -1
  35. package/dist/components/jsx.d.ts +2 -1
  36. package/dist/components/layout.js +2 -2
  37. package/dist/components/lazy.cjs +2 -1
  38. package/dist/components/lazy.cjs.map +1 -1
  39. package/dist/components/lazy.d.cts +2 -1
  40. package/dist/components/lazy.d.ts +2 -1
  41. package/dist/components/lazy.js +2 -1
  42. package/dist/components/lazy.js.map +1 -1
  43. package/dist/components/packs.cjs +194 -0
  44. package/dist/components/packs.cjs.map +1 -0
  45. package/dist/components/packs.css +3 -0
  46. package/dist/components/packs.d.cts +107 -0
  47. package/dist/components/packs.d.ts +107 -0
  48. package/dist/components/packs.js +185 -0
  49. package/dist/components/packs.js.map +1 -0
  50. package/dist/components/page.js +3 -3
  51. package/dist/components/physics.js +4 -4
  52. package/dist/components/react.cjs +2 -2
  53. package/dist/components/react.cjs.map +1 -1
  54. package/dist/components/react.d.cts +1 -1
  55. package/dist/components/react.d.ts +1 -1
  56. package/dist/components/react.js +2 -2
  57. package/dist/components/react.js.map +1 -1
  58. package/dist/components/reveal.js +2 -2
  59. package/dist/components/solid.cjs +3 -1
  60. package/dist/components/solid.cjs.map +1 -1
  61. package/dist/components/solid.d.cts +29 -17
  62. package/dist/components/solid.d.ts +29 -17
  63. package/dist/components/solid.js +7 -5
  64. package/dist/components/solid.js.map +1 -1
  65. package/dist/components/svelte.cjs +3 -1
  66. package/dist/components/svelte.cjs.map +1 -1
  67. package/dist/components/svelte.d.cts +29 -17
  68. package/dist/components/svelte.d.ts +29 -17
  69. package/dist/components/svelte.js +7 -5
  70. package/dist/components/svelte.js.map +1 -1
  71. package/dist/components/svg.js +2 -2
  72. package/dist/components/text.js +2 -2
  73. package/dist/components/timeline.cjs +6 -219
  74. package/dist/components/timeline.cjs.map +1 -1
  75. package/dist/components/timeline.js +5 -217
  76. package/dist/components/timeline.js.map +1 -1
  77. package/dist/components/transitions.cjs +7 -120
  78. package/dist/components/transitions.cjs.map +1 -1
  79. package/dist/components/transitions.css +0 -1
  80. package/dist/components/transitions.d.cts +5 -32
  81. package/dist/components/transitions.d.ts +5 -32
  82. package/dist/components/transitions.js +10 -121
  83. package/dist/components/transitions.js.map +1 -1
  84. package/dist/components/ui.js +5 -5
  85. package/dist/components/vue.cjs +3 -1
  86. package/dist/components/vue.cjs.map +1 -1
  87. package/dist/components/vue.d.cts +29 -17
  88. package/dist/components/vue.d.ts +29 -17
  89. package/dist/components/vue.js +7 -5
  90. package/dist/components/vue.js.map +1 -1
  91. package/dist/components/webgl.js +2 -2
  92. package/dist/components.cjs +18 -10
  93. package/dist/components.cjs.map +1 -1
  94. package/dist/components.css +1 -1
  95. package/dist/components.d.cts +67 -33
  96. package/dist/components.d.ts +67 -33
  97. package/dist/components.js +14 -10
  98. package/dist/components.js.map +1 -1
  99. package/dist/components.umd.js +2 -2
  100. package/dist/components.umd.js.map +1 -1
  101. package/dist/index.cjs +5 -102
  102. package/dist/index.cjs.map +1 -1
  103. package/dist/index.d.cts +72 -30
  104. package/dist/index.d.ts +72 -30
  105. package/dist/index.js +4 -103
  106. package/dist/index.js.map +1 -1
  107. package/dist/index.umd.js +2 -2
  108. package/dist/index.umd.js.map +1 -1
  109. package/docs/API.md +6 -6
  110. package/docs/ROADMAP.md +14 -0
  111. package/docs/components.md +16 -4
  112. package/docs/migration-from-aos.md +1 -1
  113. package/docs/migration-from-gsap-scrolltrigger.md +6 -6
  114. package/docs/upgrading-4.md +65 -0
  115. package/package.json +13 -2
  116. package/dist/chunks/index-tags-BANJ-e4H.js.map +0 -1
  117. package/dist/chunks/index-tags-wbuPiMR6.cjs.map +0 -1
@@ -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,IAAA,EAAE,CAAC,gBAAgB,CA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H;SACgB,qBAAqB,GAAA;AACnC,IAAA,UAAU,EAAE;AACd;;;;"}
@@ -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 { h as defineElement, b as caf, r as raf, p as prefersReducedMotion, n as now, g as getMotionIntensity, a as configureComponents, f as adoptStyles } from '../chunks/base-ZARFccur.js';
2
+ export { M as MOTION_SCALE } from '../chunks/base-ZARFccur.js';
3
+ import { e as springSamples } from '../chunks/spring-E2ickYNI.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
- 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 { h as defineElement, d as clamp } from '../chunks/base-ZARFccur.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-ZARFccur.js';
3
+ import { d as springEasing, c as createSpring, s as snapTo, a as rubberBand, p as projectInertia } from '../chunks/spring-E2ickYNI.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-E2ickYNI.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-BQh_uGqH.cjs');
4
4
 
5
5
  /**
6
6
  * use-scroll-animate/components/react — React wrappers for every `<usa-*>`
@@ -21,7 +21,7 @@ var indexTags = require('../chunks/index-tags-wbuPiMR6.cjs');
21
21
  * JSX types for the raw tags (`<usa-card effect="flip">`) come from
22
22
  * `use-scroll-animate/components/jsx` (see `UsaIntrinsicElements`).
23
23
  */
24
- /** `usa-flip-list` → `UsaFlipList` */
24
+ /** `usa-auto-animate` → `UsaAutoAnimate` */
25
25
  const pascal = (tag) => tag.replace(/(^|-)([a-z0-9])/g, (_, __, c) => c.toUpperCase());
26
26
  /** `onUsaChange` → `usa:change`, `onUsaDragEnd` → `usa:drag-end`; `onChange` → `change`. */
27
27
  function eventName(prop) {
@@ -1 +1 @@
1
- {"version":3,"file":"react.cjs","sources":["../../src/components/frameworks/react.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/react — React wrappers for every `<usa-*>`\n * element (v2.9). React 19 handles custom elements natively; for React 18\n * (and nicer DX in both) `createUsaComponents(React)` returns typed wrapper\n * components that set **properties** (`checked`, `value`, `state`, …),\n * forward `ref`, and map `onUsaChange`-style props to `usa:change` events.\n *\n * ```tsx\n * import * as React from 'react';\n * import { createUsaComponents } from 'use-scroll-animate/components/react';\n * import { defineComponents } from 'use-scroll-animate/components';\n * defineComponents();\n * const { UsaButton, UsaToggle } = createUsaComponents(React);\n * <UsaButton deform=\"squash\" onUsaSubmit={(e) => e.detail.done(true)}><button>Pay</button></UsaButton>\n * ```\n *\n * JSX types for the raw tags (`<usa-card effect=\"flip\">`) come from\n * `use-scroll-animate/components/jsx` (see `UsaIntrinsicElements`).\n */\nimport { COMPONENT_CATEGORIES } from '../index-tags';\n\ntype AnyProps = Record<string, any>;\ninterface ReactLike {\n createElement: (type: any, props?: any, ...children: any[]) => any;\n forwardRef: (render: (props: any, ref: any) => any) => any;\n useRef: <T>(v: T) => { current: T };\n useEffect: (fn: () => void | (() => void), deps?: unknown[]) => void;\n useLayoutEffect?: (fn: () => void | (() => void), deps?: unknown[]) => void;\n}\n\n/** `usa-flip-list` → `UsaFlipList` */\nexport const pascal = (tag: string): string => tag.replace(/(^|-)([a-z0-9])/g, (_, __, c) => c.toUpperCase());\n/** `onUsaChange` → `usa:change`, `onUsaDragEnd` → `usa:drag-end`; `onChange` → `change`. */\nexport function eventName(prop: string): string | null {\n const m = /^on([A-Z].*)$/.exec(prop);\n if (!m) return null;\n const kebab = m[1].replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n return kebab.startsWith('usa-') ? `usa:${kebab.slice(4)}` : kebab;\n}\n\n/** Props written as DOM properties (not attributes) when given non-string values. */\nconst PROPS = new Set(['checked', 'value', 'state', 'open', 'liked', 'count', 'loading', 'flipped', 'selected', 'index', 'indeterminate']);\n\n/** All `<usa-*>` tags shipped by the package. */\nexport const USA_TAGS: string[] = Object.values(COMPONENT_CATEGORIES).flat() as string[];\n\nexport function createUsaComponents(React: ReactLike): Record<string, any> {\n const useIso = React.useLayoutEffect || React.useEffect;\n const make = (tag: string) => {\n const C = React.forwardRef((props: AnyProps, ref: any) => {\n const inner = React.useRef<HTMLElement | null>(null);\n const attrs: AnyProps = {};\n const events: [string, any][] = [];\n const propsSet: [string, any][] = [];\n for (const [k, v] of Object.entries(props)) {\n if (k === 'children') continue;\n const ev = typeof v === 'function' ? eventName(k) : null;\n if (ev) events.push([ev, v]);\n else if (PROPS.has(k) && typeof v !== 'string') propsSet.push([k, v]);\n else if (k === 'className') attrs.class = v;\n else if (typeof v === 'boolean') {\n if (v) attrs[k] = '';\n } else attrs[k] = v;\n }\n useIso(() => {\n const el = inner.current as any;\n if (!el) return;\n for (const [k, v] of propsSet) el[k] = v;\n });\n useIso(() => {\n const el = inner.current;\n if (!el) return;\n events.forEach(([n, f]) => el.addEventListener(n, f));\n return () => events.forEach(([n, f]) => el.removeEventListener(n, f));\n });\n const setRef = (node: HTMLElement | null) => {\n inner.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n };\n return React.createElement(tag, { ...attrs, ref: setRef }, props.children);\n });\n (C as any).displayName = pascal(tag);\n return C;\n };\n return Object.fromEntries(USA_TAGS.map((t) => [pascal(t), make(t)]));\n}\n"],"names":["COMPONENT_CATEGORIES"],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;AAkBG;AAYH;AACO,MAAM,MAAM,GAAG,CAAC,GAAW,KAAa,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE;AAC5G;AACM,SAAU,SAAS,CAAC,IAAY,EAAA;IACpC,MAAM,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;AACpC,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,OAAO,IAAI;AACnB,IAAA,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE;IACvE,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAA,IAAA,EAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK;AACnE;AAEA;AACA,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE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G,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE;;;;;;;"}
1
+ {"version":3,"file":"react.cjs","sources":["../../src/components/frameworks/react.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/react — React wrappers for every `<usa-*>`\n * element (v2.9). React 19 handles custom elements natively; for React 18\n * (and nicer DX in both) `createUsaComponents(React)` returns typed wrapper\n * components that set **properties** (`checked`, `value`, `state`, …),\n * forward `ref`, and map `onUsaChange`-style props to `usa:change` events.\n *\n * ```tsx\n * import * as React from 'react';\n * import { createUsaComponents } from 'use-scroll-animate/components/react';\n * import { defineComponents } from 'use-scroll-animate/components';\n * defineComponents();\n * const { UsaButton, UsaToggle } = createUsaComponents(React);\n * <UsaButton deform=\"squash\" onUsaSubmit={(e) => e.detail.done(true)}><button>Pay</button></UsaButton>\n * ```\n *\n * JSX types for the raw tags (`<usa-card effect=\"flip\">`) come from\n * `use-scroll-animate/components/jsx` (see `UsaIntrinsicElements`).\n */\nimport { COMPONENT_CATEGORIES } from '../index-tags';\n\ntype AnyProps = Record<string, any>;\ninterface ReactLike {\n createElement: (type: any, props?: any, ...children: any[]) => any;\n forwardRef: (render: (props: any, ref: any) => any) => any;\n useRef: <T>(v: T) => { current: T };\n useEffect: (fn: () => void | (() => void), deps?: unknown[]) => void;\n useLayoutEffect?: (fn: () => void | (() => void), deps?: unknown[]) => void;\n}\n\n/** `usa-auto-animate` → `UsaAutoAnimate` */\nexport const pascal = (tag: string): string => tag.replace(/(^|-)([a-z0-9])/g, (_, __, c) => c.toUpperCase());\n/** `onUsaChange` → `usa:change`, `onUsaDragEnd` → `usa:drag-end`; `onChange` → `change`. */\nexport function eventName(prop: string): string | null {\n const m = /^on([A-Z].*)$/.exec(prop);\n if (!m) return null;\n const kebab = m[1].replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n return kebab.startsWith('usa-') ? `usa:${kebab.slice(4)}` : kebab;\n}\n\n/** Props written as DOM properties (not attributes) when given non-string values. */\nconst PROPS = new Set(['checked', 'value', 'state', 'open', 'liked', 'count', 'loading', 'flipped', 'selected', 'index', 'indeterminate']);\n\n/** All `<usa-*>` tags shipped by the package. */\nexport const USA_TAGS: string[] = Object.values(COMPONENT_CATEGORIES).flat() as string[];\n\nexport function createUsaComponents(React: ReactLike): Record<string, any> {\n const useIso = React.useLayoutEffect || React.useEffect;\n const make = (tag: string) => {\n const C = React.forwardRef((props: AnyProps, ref: any) => {\n const inner = React.useRef<HTMLElement | null>(null);\n const attrs: AnyProps = {};\n const events: [string, any][] = [];\n const propsSet: [string, any][] = [];\n for (const [k, v] of Object.entries(props)) {\n if (k === 'children') continue;\n const ev = typeof v === 'function' ? eventName(k) : null;\n if (ev) events.push([ev, v]);\n else if (PROPS.has(k) && typeof v !== 'string') propsSet.push([k, v]);\n else if (k === 'className') attrs.class = v;\n else if (typeof v === 'boolean') {\n if (v) attrs[k] = '';\n } else attrs[k] = v;\n }\n useIso(() => {\n const el = inner.current as any;\n if (!el) return;\n for (const [k, v] of propsSet) el[k] = v;\n });\n useIso(() => {\n const el = inner.current;\n if (!el) return;\n events.forEach(([n, f]) => el.addEventListener(n, f));\n return () => events.forEach(([n, f]) => el.removeEventListener(n, f));\n });\n const setRef = (node: HTMLElement | null) => {\n inner.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n };\n return React.createElement(tag, { ...attrs, ref: setRef }, props.children);\n });\n (C as any).displayName = pascal(tag);\n return C;\n };\n return Object.fromEntries(USA_TAGS.map((t) => [pascal(t), make(t)]));\n}\n"],"names":["COMPONENT_CATEGORIES"],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;AAkBG;AAYH;AACO,MAAM,MAAM,GAAG,CAAC,GAAW,KAAa,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,WAAW,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A,CAAC,CAAC;AACF,YAAA,MAAM,MAAM,GAAG,CAAC,IAAwB,KAAI;AAC1C,gBAAA,KAAK,CAAC,OAAO,GAAG,IAAI;gBACpB,IAAI,OAAO,GAAG,KAAK,UAAU;oBAAE,GAAG,CAAC,IAAI,CAAC;AACnC,qBAAA,IAAI,GAAG;AAAE,oBAAA,GAAG,CAAC,OAAO,GAAG,IAAI;AAClC,YAAA,CAAC;AACD,YAAA,OAAO,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC;AAC5E,QAAA,CAAC,CAAC;AACD,QAAA,CAAS,CAAC,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC;AACpC,QAAA,OAAO,CAAC;AACV,IAAA,CAAC;IACD,OAAO,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE;;;;;;;"}
@@ -7,7 +7,7 @@ interface ReactLike {
7
7
  useEffect: (fn: () => void | (() => void), deps?: unknown[]) => void;
8
8
  useLayoutEffect?: (fn: () => void | (() => void), deps?: unknown[]) => void;
9
9
  }
10
- /** `usa-flip-list` → `UsaFlipList` */
10
+ /** `usa-auto-animate` → `UsaAutoAnimate` */
11
11
  declare const pascal: (tag: string) => string;
12
12
  /** `onUsaChange` → `usa:change`, `onUsaDragEnd` → `usa:drag-end`; `onChange` → `change`. */
13
13
  declare function eventName(prop: string): string | null;
@@ -7,7 +7,7 @@ interface ReactLike {
7
7
  useEffect: (fn: () => void | (() => void), deps?: unknown[]) => void;
8
8
  useLayoutEffect?: (fn: () => void | (() => void), deps?: unknown[]) => void;
9
9
  }
10
- /** `usa-flip-list` → `UsaFlipList` */
10
+ /** `usa-auto-animate` → `UsaAutoAnimate` */
11
11
  declare const pascal: (tag: string) => string;
12
12
  /** `onUsaChange` → `usa:change`, `onUsaDragEnd` → `usa:drag-end`; `onChange` → `change`. */
13
13
  declare function eventName(prop: string): string | null;
@@ -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-43Xtd01A.js';
2
2
 
3
3
  /**
4
4
  * use-scroll-animate/components/react — React wrappers for every `<usa-*>`
@@ -19,7 +19,7 @@ import { C as COMPONENT_CATEGORIES } from '../chunks/index-tags-BANJ-e4H.js';
19
19
  * JSX types for the raw tags (`<usa-card effect="flip">`) come from
20
20
  * `use-scroll-animate/components/jsx` (see `UsaIntrinsicElements`).
21
21
  */
22
- /** `usa-flip-list` → `UsaFlipList` */
22
+ /** `usa-auto-animate` → `UsaAutoAnimate` */
23
23
  const pascal = (tag) => tag.replace(/(^|-)([a-z0-9])/g, (_, __, c) => c.toUpperCase());
24
24
  /** `onUsaChange` → `usa:change`, `onUsaDragEnd` → `usa:drag-end`; `onChange` → `change`. */
25
25
  function eventName(prop) {
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sources":["../../src/components/frameworks/react.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/react — React wrappers for every `<usa-*>`\n * element (v2.9). React 19 handles custom elements natively; for React 18\n * (and nicer DX in both) `createUsaComponents(React)` returns typed wrapper\n * components that set **properties** (`checked`, `value`, `state`, …),\n * forward `ref`, and map `onUsaChange`-style props to `usa:change` events.\n *\n * ```tsx\n * import * as React from 'react';\n * import { createUsaComponents } from 'use-scroll-animate/components/react';\n * import { defineComponents } from 'use-scroll-animate/components';\n * defineComponents();\n * const { UsaButton, UsaToggle } = createUsaComponents(React);\n * <UsaButton deform=\"squash\" onUsaSubmit={(e) => e.detail.done(true)}><button>Pay</button></UsaButton>\n * ```\n *\n * JSX types for the raw tags (`<usa-card effect=\"flip\">`) come from\n * `use-scroll-animate/components/jsx` (see `UsaIntrinsicElements`).\n */\nimport { COMPONENT_CATEGORIES } from '../index-tags';\n\ntype AnyProps = Record<string, any>;\ninterface ReactLike {\n createElement: (type: any, props?: any, ...children: any[]) => any;\n forwardRef: (render: (props: any, ref: any) => any) => any;\n useRef: <T>(v: T) => { current: T };\n useEffect: (fn: () => void | (() => void), deps?: unknown[]) => void;\n useLayoutEffect?: (fn: () => void | (() => void), deps?: unknown[]) => void;\n}\n\n/** `usa-flip-list` → `UsaFlipList` */\nexport const pascal = (tag: string): string => tag.replace(/(^|-)([a-z0-9])/g, (_, __, c) => c.toUpperCase());\n/** `onUsaChange` → `usa:change`, `onUsaDragEnd` → `usa:drag-end`; `onChange` → `change`. */\nexport function eventName(prop: string): string | null {\n const m = /^on([A-Z].*)$/.exec(prop);\n if (!m) return null;\n const kebab = m[1].replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n return kebab.startsWith('usa-') ? `usa:${kebab.slice(4)}` : kebab;\n}\n\n/** Props written as DOM properties (not attributes) when given non-string values. */\nconst PROPS = new Set(['checked', 'value', 'state', 'open', 'liked', 'count', 'loading', 'flipped', 'selected', 'index', 'indeterminate']);\n\n/** All `<usa-*>` tags shipped by the package. */\nexport const USA_TAGS: string[] = Object.values(COMPONENT_CATEGORIES).flat() as string[];\n\nexport function createUsaComponents(React: ReactLike): Record<string, any> {\n const useIso = React.useLayoutEffect || React.useEffect;\n const make = (tag: string) => {\n const C = React.forwardRef((props: AnyProps, ref: any) => {\n const inner = React.useRef<HTMLElement | null>(null);\n const attrs: AnyProps = {};\n const events: [string, any][] = [];\n const propsSet: [string, any][] = [];\n for (const [k, v] of Object.entries(props)) {\n if (k === 'children') continue;\n const ev = typeof v === 'function' ? eventName(k) : null;\n if (ev) events.push([ev, v]);\n else if (PROPS.has(k) && typeof v !== 'string') propsSet.push([k, v]);\n else if (k === 'className') attrs.class = v;\n else if (typeof v === 'boolean') {\n if (v) attrs[k] = '';\n } else attrs[k] = v;\n }\n useIso(() => {\n const el = inner.current as any;\n if (!el) return;\n for (const [k, v] of propsSet) el[k] = v;\n });\n useIso(() => {\n const el = inner.current;\n if (!el) return;\n events.forEach(([n, f]) => el.addEventListener(n, f));\n return () => events.forEach(([n, f]) => el.removeEventListener(n, f));\n });\n const setRef = (node: HTMLElement | null) => {\n inner.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n };\n return React.createElement(tag, { ...attrs, ref: setRef }, props.children);\n });\n (C as any).displayName = pascal(tag);\n return C;\n };\n return Object.fromEntries(USA_TAGS.map((t) => [pascal(t), make(t)]));\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;AAkBG;AAYH;AACO,MAAM,MAAM,GAAG,CAAC,GAAW,KAAa,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE;AAC5G;AACM,SAAU,SAAS,CAAC,IAAY,EAAA;IACpC,MAAM,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;AACpC,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,OAAO,IAAI;AACnB,IAAA,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE;IACvE,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAA,IAAA,EAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK;AACnE;AAEA;AACA,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;AAE1I;AACO,MAAM,QAAQ,GAAa,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,IA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;;;;"}
1
+ {"version":3,"file":"react.js","sources":["../../src/components/frameworks/react.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/react — React wrappers for every `<usa-*>`\n * element (v2.9). React 19 handles custom elements natively; for React 18\n * (and nicer DX in both) `createUsaComponents(React)` returns typed wrapper\n * components that set **properties** (`checked`, `value`, `state`, …),\n * forward `ref`, and map `onUsaChange`-style props to `usa:change` events.\n *\n * ```tsx\n * import * as React from 'react';\n * import { createUsaComponents } from 'use-scroll-animate/components/react';\n * import { defineComponents } from 'use-scroll-animate/components';\n * defineComponents();\n * const { UsaButton, UsaToggle } = createUsaComponents(React);\n * <UsaButton deform=\"squash\" onUsaSubmit={(e) => e.detail.done(true)}><button>Pay</button></UsaButton>\n * ```\n *\n * JSX types for the raw tags (`<usa-card effect=\"flip\">`) come from\n * `use-scroll-animate/components/jsx` (see `UsaIntrinsicElements`).\n */\nimport { COMPONENT_CATEGORIES } from '../index-tags';\n\ntype AnyProps = Record<string, any>;\ninterface ReactLike {\n createElement: (type: any, props?: any, ...children: any[]) => any;\n forwardRef: (render: (props: any, ref: any) => any) => any;\n useRef: <T>(v: T) => { current: T };\n useEffect: (fn: () => void | (() => void), deps?: unknown[]) => void;\n useLayoutEffect?: (fn: () => void | (() => void), deps?: unknown[]) => void;\n}\n\n/** `usa-auto-animate` → `UsaAutoAnimate` */\nexport const pascal = (tag: string): string => tag.replace(/(^|-)([a-z0-9])/g, (_, __, c) => c.toUpperCase());\n/** `onUsaChange` → `usa:change`, `onUsaDragEnd` → `usa:drag-end`; `onChange` → `change`. */\nexport function eventName(prop: string): string | null {\n const m = /^on([A-Z].*)$/.exec(prop);\n if (!m) return null;\n const kebab = m[1].replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n return kebab.startsWith('usa-') ? `usa:${kebab.slice(4)}` : kebab;\n}\n\n/** Props written as DOM properties (not attributes) when given non-string values. */\nconst PROPS = new Set(['checked', 'value', 'state', 'open', 'liked', 'count', 'loading', 'flipped', 'selected', 'index', 'indeterminate']);\n\n/** All `<usa-*>` tags shipped by the package. */\nexport const USA_TAGS: string[] = Object.values(COMPONENT_CATEGORIES).flat() as string[];\n\nexport function createUsaComponents(React: ReactLike): Record<string, any> {\n const useIso = React.useLayoutEffect || React.useEffect;\n const make = (tag: string) => {\n const C = React.forwardRef((props: AnyProps, ref: any) => {\n const inner = React.useRef<HTMLElement | null>(null);\n const attrs: AnyProps = {};\n const events: [string, any][] = [];\n const propsSet: [string, any][] = [];\n for (const [k, v] of Object.entries(props)) {\n if (k === 'children') continue;\n const ev = typeof v === 'function' ? eventName(k) : null;\n if (ev) events.push([ev, v]);\n else if (PROPS.has(k) && typeof v !== 'string') propsSet.push([k, v]);\n else if (k === 'className') attrs.class = v;\n else if (typeof v === 'boolean') {\n if (v) attrs[k] = '';\n } else attrs[k] = v;\n }\n useIso(() => {\n const el = inner.current as any;\n if (!el) return;\n for (const [k, v] of propsSet) el[k] = v;\n });\n useIso(() => {\n const el = inner.current;\n if (!el) return;\n events.forEach(([n, f]) => el.addEventListener(n, f));\n return () => events.forEach(([n, f]) => el.removeEventListener(n, f));\n });\n const setRef = (node: HTMLElement | null) => {\n inner.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n };\n return React.createElement(tag, { ...attrs, ref: setRef }, props.children);\n });\n (C as any).displayName = pascal(tag);\n return C;\n };\n return Object.fromEntries(USA_TAGS.map((t) => [pascal(t), make(t)]));\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;AAkBG;AAYH;AACO,MAAM,MAAM,GAAG,CAAC,GAAW,KAAa,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE;AAC5G;AACM,SAAU,SAAS,CAAC,IAAY,EAAA;IACpC,MAAM,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;AACpC,IAAA,IAAI,CAAC,CAA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K,UAAU;oBAAE,GAAG,CAAC,IAAI,CAAC;AACnC,qBAAA,IAAI,GAAG;AAAE,oBAAA,GAAG,CAAC,OAAO,GAAG,IAAI;AAClC,YAAA,CAAC;AACD,YAAA,OAAO,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC;AAC5E,QAAA,CAAC,CAAC;AACD,QAAA,CAAS,CAAC,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC;AACpC,QAAA,OAAO,CAAC;AACV,IAAA,CAAC;IACD,OAAO,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE;;;;"}
@@ -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 { h as defineElement, i as EASE_OUT, d as clamp, b as caf, r as raf } from '../chunks/base-ZARFccur.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-ZARFccur.js';
3
3
 
4
4
  /** Entrance effects shared by `<usa-reveal>` and `<usa-stagger>` (transform / opacity / filter only). */
5
5
  const REVEAL_EFFECTS = [
@@ -17,13 +17,15 @@ require('./click.cjs');
17
17
  require('./ui.cjs');
18
18
  require('./page.cjs');
19
19
  require('./timeline.cjs');
20
+ require('../chunks/core-DXqZm5Il.cjs');
20
21
  require('./gesture.cjs');
21
22
  require('../chunks/core-IaorbTdu.cjs');
22
23
  require('./svg.cjs');
23
24
  require('./webgl.cjs');
24
25
  require('./depth.cjs');
25
26
  require('./layout.cjs');
26
- require('../chunks/index-tags-wbuPiMR6.cjs');
27
+ require('./packs.cjs');
28
+ require('../chunks/index-tags-BQh_uGqH.cjs');
27
29
 
28
30
  /**
29
31
  * 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;;;;;;;"}
@@ -622,19 +622,6 @@ interface UsaAccordionElement extends UsaElement {
622
622
  toggleItem(details: HTMLDetailsElement, open?: boolean): Promise<void>;
623
623
  }
624
624
 
625
- /**
626
- * `<usa-flip-list>` — animates its children to their new places whenever
627
- * they are added, removed or reordered (FLIP: transforms only). Works with
628
- * any rendering: plain DOM, React keyed lists, Vue `v-for`, Svelte `{#each}`.
629
- *
630
- * Attributes: `duration` (ms, 420), `easing`, `disabled`.
631
- * Method: `flip(mutate)` for explicit changes (also measures resizes).
632
- * Reduced motion: no animation.
633
- */
634
- interface UsaFlipListElement extends UsaElement {
635
- flip(mutate: () => void | Promise<void>): Promise<void>;
636
- }
637
-
638
625
  /**
639
626
  * `<usa-view-switch>` — shows one of its children at a time (tabs, wizard
640
627
  * steps, app pages) and animates between them. Children are views; name
@@ -654,15 +641,15 @@ interface UsaViewSwitchElement extends UsaElement {
654
641
 
655
642
  /**
656
643
  * use-scroll-animate/components/transitions — view & layout transitions.
657
- * `<usa-dialog>`, `<usa-accordion>`, `<usa-flip-list>`, `<usa-view-switch>`
658
- * and the `viewTransition()`, `flip()`, `connectedAnimation()` helpers.
644
+ * `<usa-dialog>`, `<usa-accordion>`, `<usa-view-switch>`
645
+ * and the `viewTransition()` and `flip()` helpers (4.0: `<usa-flip-list>` → `<usa-auto-animate>`,
646
+ * `connectedAnimation()` → `sharedTransition()`, both in `components/layout`).
659
647
  */
660
648
 
661
649
  declare global {
662
650
  interface HTMLElementTagNameMap {
663
651
  'usa-dialog': UsaDialogElement;
664
652
  'usa-accordion': UsaAccordionElement;
665
- 'usa-flip-list': UsaFlipListElement;
666
653
  'usa-view-switch': UsaViewSwitchElement;
667
654
  }
668
655
  }
@@ -1590,6 +1577,30 @@ declare global {
1590
1577
  }
1591
1578
  }
1592
1579
 
1580
+ /**
1581
+ * `<usa-pack name="ecommerce">` — applies an effect pack (`ecommerce` ·
1582
+ * `portfolio` · `dashboard` · `game` · `landing`) to its subtree:
1583
+ * descendants opt in with `data-role` (see `PACKS`). Re-applies when
1584
+ * `name` changes; undone on disconnect.
1585
+ */
1586
+ interface UsaPackElement extends UsaElement {
1587
+ readonly roles: string[];
1588
+ }
1589
+
1590
+ /**
1591
+ * use-scroll-animate/components/packs — effect packs (v3.9).
1592
+ * Ready-made motion for e-commerce, portfolio, dashboard, game UI and
1593
+ * landing pages: mark elements with `data-role` and apply a pack with
1594
+ * `<usa-pack name="…">` or `applyPack(name, root)`. Includes `flyToCart()`
1595
+ * and `countUp()`.
1596
+ */
1597
+
1598
+ declare global {
1599
+ interface HTMLElementTagNameMap {
1600
+ 'usa-pack': UsaPackElement;
1601
+ }
1602
+ }
1603
+
1593
1604
  /** The component categories and their default tags. */
1594
1605
  declare const COMPONENT_CATEGORIES: {
1595
1606
  readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
@@ -1597,7 +1608,7 @@ declare const COMPONENT_CATEGORIES: {
1597
1608
  readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
1598
1609
  readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
1599
1610
  readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
1600
- readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-flip-list", "usa-view-switch"];
1611
+ readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-view-switch"];
1601
1612
  readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
1602
1613
  readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
1603
1614
  readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
@@ -1609,6 +1620,7 @@ declare const COMPONENT_CATEGORIES: {
1609
1620
  readonly webgl: readonly ["usa-shader", "usa-distort", "usa-liquid"];
1610
1621
  readonly depth: readonly ["usa-cube", "usa-depth"];
1611
1622
  readonly layout: readonly ["usa-auto-animate", "usa-masonry"];
1623
+ readonly packs: readonly ["usa-pack"];
1612
1624
  };
1613
1625
  type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
1614
1626
 
@@ -622,19 +622,6 @@ interface UsaAccordionElement extends UsaElement {
622
622
  toggleItem(details: HTMLDetailsElement, open?: boolean): Promise<void>;
623
623
  }
624
624
 
625
- /**
626
- * `<usa-flip-list>` — animates its children to their new places whenever
627
- * they are added, removed or reordered (FLIP: transforms only). Works with
628
- * any rendering: plain DOM, React keyed lists, Vue `v-for`, Svelte `{#each}`.
629
- *
630
- * Attributes: `duration` (ms, 420), `easing`, `disabled`.
631
- * Method: `flip(mutate)` for explicit changes (also measures resizes).
632
- * Reduced motion: no animation.
633
- */
634
- interface UsaFlipListElement extends UsaElement {
635
- flip(mutate: () => void | Promise<void>): Promise<void>;
636
- }
637
-
638
625
  /**
639
626
  * `<usa-view-switch>` — shows one of its children at a time (tabs, wizard
640
627
  * steps, app pages) and animates between them. Children are views; name
@@ -654,15 +641,15 @@ interface UsaViewSwitchElement extends UsaElement {
654
641
 
655
642
  /**
656
643
  * use-scroll-animate/components/transitions — view & layout transitions.
657
- * `<usa-dialog>`, `<usa-accordion>`, `<usa-flip-list>`, `<usa-view-switch>`
658
- * and the `viewTransition()`, `flip()`, `connectedAnimation()` helpers.
644
+ * `<usa-dialog>`, `<usa-accordion>`, `<usa-view-switch>`
645
+ * and the `viewTransition()` and `flip()` helpers (4.0: `<usa-flip-list>` → `<usa-auto-animate>`,
646
+ * `connectedAnimation()` → `sharedTransition()`, both in `components/layout`).
659
647
  */
660
648
 
661
649
  declare global {
662
650
  interface HTMLElementTagNameMap {
663
651
  'usa-dialog': UsaDialogElement;
664
652
  'usa-accordion': UsaAccordionElement;
665
- 'usa-flip-list': UsaFlipListElement;
666
653
  'usa-view-switch': UsaViewSwitchElement;
667
654
  }
668
655
  }
@@ -1590,6 +1577,30 @@ declare global {
1590
1577
  }
1591
1578
  }
1592
1579
 
1580
+ /**
1581
+ * `<usa-pack name="ecommerce">` — applies an effect pack (`ecommerce` ·
1582
+ * `portfolio` · `dashboard` · `game` · `landing`) to its subtree:
1583
+ * descendants opt in with `data-role` (see `PACKS`). Re-applies when
1584
+ * `name` changes; undone on disconnect.
1585
+ */
1586
+ interface UsaPackElement extends UsaElement {
1587
+ readonly roles: string[];
1588
+ }
1589
+
1590
+ /**
1591
+ * use-scroll-animate/components/packs — effect packs (v3.9).
1592
+ * Ready-made motion for e-commerce, portfolio, dashboard, game UI and
1593
+ * landing pages: mark elements with `data-role` and apply a pack with
1594
+ * `<usa-pack name="…">` or `applyPack(name, root)`. Includes `flyToCart()`
1595
+ * and `countUp()`.
1596
+ */
1597
+
1598
+ declare global {
1599
+ interface HTMLElementTagNameMap {
1600
+ 'usa-pack': UsaPackElement;
1601
+ }
1602
+ }
1603
+
1593
1604
  /** The component categories and their default tags. */
1594
1605
  declare const COMPONENT_CATEGORIES: {
1595
1606
  readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
@@ -1597,7 +1608,7 @@ declare const COMPONENT_CATEGORIES: {
1597
1608
  readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
1598
1609
  readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
1599
1610
  readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
1600
- readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-flip-list", "usa-view-switch"];
1611
+ readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-view-switch"];
1601
1612
  readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
1602
1613
  readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
1603
1614
  readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
@@ -1609,6 +1620,7 @@ declare const COMPONENT_CATEGORIES: {
1609
1620
  readonly webgl: readonly ["usa-shader", "usa-distort", "usa-liquid"];
1610
1621
  readonly depth: readonly ["usa-cube", "usa-depth"];
1611
1622
  readonly layout: readonly ["usa-auto-animate", "usa-masonry"];
1623
+ readonly packs: readonly ["usa-pack"];
1612
1624
  };
1613
1625
  type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
1614
1626
 
@@ -2,27 +2,29 @@ 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-ZARFccur.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-DvnxvRCM.js';
11
11
  import './transitions.js';
12
12
  import './physics.js';
13
- import '../chunks/spring-C-fw7_9f.js';
13
+ import '../chunks/spring-E2ickYNI.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
+ import '../chunks/core-Co-6AL0h.js';
19
20
  import './gesture.js';
20
- import '../chunks/core-uxs3ETou.js';
21
+ import '../chunks/core-DKY-fVzR.js';
21
22
  import './svg.js';
22
23
  import './webgl.js';
23
24
  import './depth.js';
24
25
  import './layout.js';
25
- import '../chunks/index-tags-BANJ-e4H.js';
26
+ import './packs.js';
27
+ import '../chunks/index-tags-43Xtd01A.js';
26
28
 
27
29
  /**
28
30
  * 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;;;;"}
@@ -17,13 +17,15 @@ require('./click.cjs');
17
17
  require('./ui.cjs');
18
18
  require('./page.cjs');
19
19
  require('./timeline.cjs');
20
+ require('../chunks/core-DXqZm5Il.cjs');
20
21
  require('./gesture.cjs');
21
22
  require('../chunks/core-IaorbTdu.cjs');
22
23
  require('./svg.cjs');
23
24
  require('./webgl.cjs');
24
25
  require('./depth.cjs');
25
26
  require('./layout.cjs');
26
- require('../chunks/index-tags-wbuPiMR6.cjs');
27
+ require('./packs.cjs');
28
+ require('../chunks/index-tags-BQh_uGqH.cjs');
27
29
 
28
30
  /**
29
31
  * use-scroll-animate/components/svelte — Svelte integration (v3.8).
@@ -1 +1 @@
1
- {"version":3,"file":"svelte.cjs","sources":["../../src/components/frameworks/svelte.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/svelte — Svelte integration (v3.8).\n * Svelte (3, 4, 5) renders `<usa-*>` tags natively; `use:usa` sets\n * **properties** and `usa:*` listeners in one place, and `defineUsa()`\n * registers the elements on the client only (safe in SvelteKit SSR).\n *\n * ```svelte\n * <script>\n * import { usa, defineUsa } from 'use-scroll-animate/components/svelte';\n * import { onMount } from 'svelte';\n * onMount(() => defineUsa(['click', 'ui']));\n * let on = false;\n * </script>\n * <usa-toggle use:usa={{ props: { checked: on }, on: { change: (e) => (on = e.detail.checked) } }}></usa-toggle>\n * ```\n * Plain `on:usa:change` does not compile in Svelte 3/4 (colon); use the action or `onusa:change` in Svelte 5.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/** Svelte action: `use:usa={{ props, on }}`. */\nexport function usa(node: HTMLElement, binding: UsaBinding = {}): { update(b: UsaBinding): void; destroy(): void } {\n return bindUsa(node, binding);\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` for SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n"],"names":["bindUsa","defineComponents"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;AAgBG;AAOH;SACgB,GAAG,CAAC,IAAiB,EAAE,UAAsB,EAAE,EAAA;AAC7D,IAAA,OAAOA,YAAO,CAAC,IAAI,EAAE,OAAO,CAAC;AAC/B;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAEC,2BAAgB,CAAC,UAAU,CAAC;AACjE;;;;;;;"}
1
+ {"version":3,"file":"svelte.cjs","sources":["../../src/components/frameworks/svelte.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/svelte — Svelte integration (v3.8).\n * Svelte (3, 4, 5) renders `<usa-*>` tags natively; `use:usa` sets\n * **properties** and `usa:*` listeners in one place, and `defineUsa()`\n * registers the elements on the client only (safe in SvelteKit SSR).\n *\n * ```svelte\n * <script>\n * import { usa, defineUsa } from 'use-scroll-animate/components/svelte';\n * import { onMount } from 'svelte';\n * onMount(() => defineUsa(['click', 'ui']));\n * let on = false;\n * </script>\n * <usa-toggle use:usa={{ props: { checked: on }, on: { change: (e) => (on = e.detail.checked) } }}></usa-toggle>\n * ```\n * Plain `on:usa:change` does not compile in Svelte 3/4 (colon); use the action or `onusa:change` in Svelte 5.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/** Svelte action: `use:usa={{ props, on }}`. */\nexport function usa(node: HTMLElement, binding: UsaBinding = {}): { update(b: UsaBinding): void; destroy(): void } {\n return bindUsa(node, binding);\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` for SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n"],"names":["bindUsa","defineComponents"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;AAgBG;AAOH;SACgB,GAAG,CAAC,IAAiB,EAAE,UAAsB,EAAE,EAAA;AAC7D,IAAA,OAAOA,YAAO,CAAC,IAAI,EAAE,OAAO,CAAC;AAC/B;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAEC,2BAAgB,CAAC,UAAU,CAAC;AACjE;;;;;;;"}
@@ -622,19 +622,6 @@ interface UsaAccordionElement extends UsaElement {
622
622
  toggleItem(details: HTMLDetailsElement, open?: boolean): Promise<void>;
623
623
  }
624
624
 
625
- /**
626
- * `<usa-flip-list>` — animates its children to their new places whenever
627
- * they are added, removed or reordered (FLIP: transforms only). Works with
628
- * any rendering: plain DOM, React keyed lists, Vue `v-for`, Svelte `{#each}`.
629
- *
630
- * Attributes: `duration` (ms, 420), `easing`, `disabled`.
631
- * Method: `flip(mutate)` for explicit changes (also measures resizes).
632
- * Reduced motion: no animation.
633
- */
634
- interface UsaFlipListElement extends UsaElement {
635
- flip(mutate: () => void | Promise<void>): Promise<void>;
636
- }
637
-
638
625
  /**
639
626
  * `<usa-view-switch>` — shows one of its children at a time (tabs, wizard
640
627
  * steps, app pages) and animates between them. Children are views; name
@@ -654,15 +641,15 @@ interface UsaViewSwitchElement extends UsaElement {
654
641
 
655
642
  /**
656
643
  * use-scroll-animate/components/transitions — view & layout transitions.
657
- * `<usa-dialog>`, `<usa-accordion>`, `<usa-flip-list>`, `<usa-view-switch>`
658
- * and the `viewTransition()`, `flip()`, `connectedAnimation()` helpers.
644
+ * `<usa-dialog>`, `<usa-accordion>`, `<usa-view-switch>`
645
+ * and the `viewTransition()` and `flip()` helpers (4.0: `<usa-flip-list>` → `<usa-auto-animate>`,
646
+ * `connectedAnimation()` → `sharedTransition()`, both in `components/layout`).
659
647
  */
660
648
 
661
649
  declare global {
662
650
  interface HTMLElementTagNameMap {
663
651
  'usa-dialog': UsaDialogElement;
664
652
  'usa-accordion': UsaAccordionElement;
665
- 'usa-flip-list': UsaFlipListElement;
666
653
  'usa-view-switch': UsaViewSwitchElement;
667
654
  }
668
655
  }
@@ -1590,6 +1577,30 @@ declare global {
1590
1577
  }
1591
1578
  }
1592
1579
 
1580
+ /**
1581
+ * `<usa-pack name="ecommerce">` — applies an effect pack (`ecommerce` ·
1582
+ * `portfolio` · `dashboard` · `game` · `landing`) to its subtree:
1583
+ * descendants opt in with `data-role` (see `PACKS`). Re-applies when
1584
+ * `name` changes; undone on disconnect.
1585
+ */
1586
+ interface UsaPackElement extends UsaElement {
1587
+ readonly roles: string[];
1588
+ }
1589
+
1590
+ /**
1591
+ * use-scroll-animate/components/packs — effect packs (v3.9).
1592
+ * Ready-made motion for e-commerce, portfolio, dashboard, game UI and
1593
+ * landing pages: mark elements with `data-role` and apply a pack with
1594
+ * `<usa-pack name="…">` or `applyPack(name, root)`. Includes `flyToCart()`
1595
+ * and `countUp()`.
1596
+ */
1597
+
1598
+ declare global {
1599
+ interface HTMLElementTagNameMap {
1600
+ 'usa-pack': UsaPackElement;
1601
+ }
1602
+ }
1603
+
1593
1604
  /** The component categories and their default tags. */
1594
1605
  declare const COMPONENT_CATEGORIES: {
1595
1606
  readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
@@ -1597,7 +1608,7 @@ declare const COMPONENT_CATEGORIES: {
1597
1608
  readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
1598
1609
  readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
1599
1610
  readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
1600
- readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-flip-list", "usa-view-switch"];
1611
+ readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-view-switch"];
1601
1612
  readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
1602
1613
  readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
1603
1614
  readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
@@ -1609,6 +1620,7 @@ declare const COMPONENT_CATEGORIES: {
1609
1620
  readonly webgl: readonly ["usa-shader", "usa-distort", "usa-liquid"];
1610
1621
  readonly depth: readonly ["usa-cube", "usa-depth"];
1611
1622
  readonly layout: readonly ["usa-auto-animate", "usa-masonry"];
1623
+ readonly packs: readonly ["usa-pack"];
1612
1624
  };
1613
1625
  type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
1614
1626