use-scroll-animate 6.0.1 → 6.1.1

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 (320) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +157 -373
  3. package/README_ja.md +171 -145
  4. package/README_zh.md +169 -167
  5. package/dist/chunks/{base-B5i8qQPR.cjs → base-BaQV-2ha.cjs} +3 -3
  6. package/dist/chunks/base-BaQV-2ha.cjs.map +1 -0
  7. package/dist/chunks/{base-C3Sw9sAO.js → base-Yno7N2eC.js} +3 -3
  8. package/dist/chunks/base-Yno7N2eC.js.map +1 -0
  9. package/dist/chunks/{core-qpECfEkb.cjs → core-B5T0dhFH.cjs} +14 -210
  10. package/dist/chunks/core-B5T0dhFH.cjs.map +1 -0
  11. package/dist/chunks/{core-BDcszY4L.cjs → core-BGAyaY6L.cjs} +2 -2
  12. package/dist/chunks/{core-BDcszY4L.cjs.map → core-BGAyaY6L.cjs.map} +1 -1
  13. package/dist/chunks/{core-BTf__I-8.js → core-BIOaYdgN.js} +2 -2
  14. package/dist/chunks/{core-BTf__I-8.js.map → core-BIOaYdgN.js.map} +1 -1
  15. package/dist/chunks/{core-DN3hHbHh.js → core-CUGCsMsJ.js} +2 -2
  16. package/dist/chunks/{core-DN3hHbHh.js.map → core-CUGCsMsJ.js.map} +1 -1
  17. package/dist/chunks/{core-mV_TPgG_.js → core-D7cVumUu.js} +11 -203
  18. package/dist/chunks/core-D7cVumUu.js.map +1 -0
  19. package/dist/chunks/{core-BjOYKSrV.cjs → core-zq17EeCI.cjs} +2 -2
  20. package/dist/chunks/{core-BjOYKSrV.cjs.map → core-zq17EeCI.cjs.map} +1 -1
  21. package/dist/chunks/{fx-ChjxrMBo.js → fx-BqDeFywO.js} +2 -2
  22. package/dist/chunks/{fx-ChjxrMBo.js.map → fx-BqDeFywO.js.map} +1 -1
  23. package/dist/chunks/{fx-B8hk1Fby.cjs → fx-lBGVtQO1.cjs} +2 -2
  24. package/dist/chunks/{fx-B8hk1Fby.cjs.map → fx-lBGVtQO1.cjs.map} +1 -1
  25. package/dist/chunks/presets-BYBVJVeP.js +226 -0
  26. package/dist/chunks/presets-BYBVJVeP.js.map +1 -0
  27. package/dist/chunks/presets-CUHys3sK.cjs +233 -0
  28. package/dist/chunks/presets-CUHys3sK.cjs.map +1 -0
  29. package/dist/chunks/{spring-CckMe3x0.js → spring-DfQO5USi.js} +2 -2
  30. package/dist/chunks/{spring-CckMe3x0.js.map → spring-DfQO5USi.js.map} +1 -1
  31. package/dist/chunks/{spring--oZh55tB.cjs → spring-Dgx187Vh.cjs} +2 -2
  32. package/dist/chunks/{spring--oZh55tB.cjs.map → spring-Dgx187Vh.cjs.map} +1 -1
  33. package/dist/chunks/{stagger-CLc3j58T.cjs → stagger-CCFyhzSw.cjs} +3 -3
  34. package/dist/chunks/stagger-CCFyhzSw.cjs.map +1 -0
  35. package/dist/chunks/{stagger-BFAhKknX.js → stagger-DtMKo2SK.js} +3 -3
  36. package/dist/chunks/stagger-DtMKo2SK.js.map +1 -0
  37. package/dist/chunks/{variants-DxPmgrNX.cjs → variants-BhjyddG8.cjs} +2 -2
  38. package/dist/chunks/{variants-DxPmgrNX.cjs.map → variants-BhjyddG8.cjs.map} +1 -1
  39. package/dist/chunks/{variants-Bsevy6Xm.js → variants-VNscPeTD.js} +2 -2
  40. package/dist/chunks/{variants-Bsevy6Xm.js.map → variants-VNscPeTD.js.map} +1 -1
  41. package/dist/components/a11y.cjs +4 -4
  42. package/dist/components/a11y.cjs.map +1 -1
  43. package/dist/components/a11y.d.cts +2 -2
  44. package/dist/components/a11y.d.ts +2 -2
  45. package/dist/components/a11y.js +5 -5
  46. package/dist/components/a11y.js.map +1 -1
  47. package/dist/components/angular.cjs +8 -8
  48. package/dist/components/angular.cjs.map +1 -1
  49. package/dist/components/angular.d.cts +22 -22
  50. package/dist/components/angular.d.ts +22 -22
  51. package/dist/components/angular.js +8 -8
  52. package/dist/components/angular.js.map +1 -1
  53. package/dist/components/background.cjs +3 -3
  54. package/dist/components/background.cjs.map +1 -1
  55. package/dist/components/background.css +1 -1
  56. package/dist/components/background.d.cts +1 -1
  57. package/dist/components/background.d.ts +1 -1
  58. package/dist/components/background.js +3 -3
  59. package/dist/components/background.js.map +1 -1
  60. package/dist/components/bridge.cjs +2 -2
  61. package/dist/components/bridge.cjs.map +1 -1
  62. package/dist/components/bridge.d.cts +1 -1
  63. package/dist/components/bridge.d.ts +1 -1
  64. package/dist/components/bridge.js +2 -2
  65. package/dist/components/bridge.js.map +1 -1
  66. package/dist/components/cards.cjs +3 -3
  67. package/dist/components/cards.cjs.map +1 -1
  68. package/dist/components/cards.css +1 -1
  69. package/dist/components/cards.d.cts +1 -1
  70. package/dist/components/cards.d.ts +1 -1
  71. package/dist/components/cards.js +3 -3
  72. package/dist/components/cards.js.map +1 -1
  73. package/dist/components/click.cjs +4 -4
  74. package/dist/components/click.cjs.map +1 -1
  75. package/dist/components/click.css +1 -1
  76. package/dist/components/click.d.cts +1 -1
  77. package/dist/components/click.d.ts +1 -1
  78. package/dist/components/click.js +4 -4
  79. package/dist/components/click.js.map +1 -1
  80. package/dist/components/depth.cjs +4 -4
  81. package/dist/components/depth.cjs.map +1 -1
  82. package/dist/components/depth.css +1 -1
  83. package/dist/components/depth.d.cts +1 -1
  84. package/dist/components/depth.d.ts +1 -1
  85. package/dist/components/depth.js +4 -4
  86. package/dist/components/depth.js.map +1 -1
  87. package/dist/components/effects.cjs +13 -13
  88. package/dist/components/effects.cjs.map +1 -1
  89. package/dist/components/effects.d.cts +2 -2
  90. package/dist/components/effects.d.ts +2 -2
  91. package/dist/components/effects.js +13 -13
  92. package/dist/components/effects.js.map +1 -1
  93. package/dist/components/feedback.cjs +2 -2
  94. package/dist/components/feedback.cjs.map +1 -1
  95. package/dist/components/feedback.css +1 -1
  96. package/dist/components/feedback.d.cts +1 -1
  97. package/dist/components/feedback.d.ts +1 -1
  98. package/dist/components/feedback.js +2 -2
  99. package/dist/components/feedback.js.map +1 -1
  100. package/dist/components/fx.cjs +10 -10
  101. package/dist/components/fx.cjs.map +1 -1
  102. package/dist/components/fx.css +1 -1
  103. package/dist/components/fx.d.cts +2 -2
  104. package/dist/components/fx.d.ts +2 -2
  105. package/dist/components/fx.js +10 -10
  106. package/dist/components/fx.js.map +1 -1
  107. package/dist/components/gesture.cjs +4 -4
  108. package/dist/components/gesture.cjs.map +1 -1
  109. package/dist/components/gesture.css +1 -1
  110. package/dist/components/gesture.d.cts +1 -1
  111. package/dist/components/gesture.d.ts +1 -1
  112. package/dist/components/gesture.js +5 -5
  113. package/dist/components/gesture.js.map +1 -1
  114. package/dist/components/interaction.cjs +2 -2
  115. package/dist/components/interaction.cjs.map +1 -1
  116. package/dist/components/interaction.css +1 -1
  117. package/dist/components/interaction.d.cts +1 -1
  118. package/dist/components/interaction.d.ts +1 -1
  119. package/dist/components/interaction.js +2 -2
  120. package/dist/components/interaction.js.map +1 -1
  121. package/dist/components/jsx.d.cts +2 -2
  122. package/dist/components/jsx.d.ts +2 -2
  123. package/dist/components/layout.cjs +2 -2
  124. package/dist/components/layout.cjs.map +1 -1
  125. package/dist/components/layout.css +1 -1
  126. package/dist/components/layout.d.cts +1 -1
  127. package/dist/components/layout.d.ts +1 -1
  128. package/dist/components/layout.js +2 -2
  129. package/dist/components/layout.js.map +1 -1
  130. package/dist/components/lazy.cjs +2 -2
  131. package/dist/components/lazy.cjs.map +1 -1
  132. package/dist/components/lazy.d.cts +2 -2
  133. package/dist/components/lazy.d.ts +2 -2
  134. package/dist/components/lazy.js +2 -2
  135. package/dist/components/lazy.js.map +1 -1
  136. package/dist/components/lite.cjs +45 -41
  137. package/dist/components/lite.cjs.map +1 -1
  138. package/dist/components/lite.js +45 -41
  139. package/dist/components/lite.js.map +1 -1
  140. package/dist/components/packs.cjs +2 -2
  141. package/dist/components/packs.cjs.map +1 -1
  142. package/dist/components/packs.css +1 -1
  143. package/dist/components/packs.d.cts +1 -1
  144. package/dist/components/packs.d.ts +1 -1
  145. package/dist/components/packs.js +2 -2
  146. package/dist/components/packs.js.map +1 -1
  147. package/dist/components/page.cjs +3 -3
  148. package/dist/components/page.cjs.map +1 -1
  149. package/dist/components/page.css +1 -1
  150. package/dist/components/page.d.cts +1 -1
  151. package/dist/components/page.d.ts +1 -1
  152. package/dist/components/page.js +4 -4
  153. package/dist/components/page.js.map +1 -1
  154. package/dist/components/perf.cjs +3 -3
  155. package/dist/components/perf.cjs.map +1 -1
  156. package/dist/components/perf.d.cts +2 -2
  157. package/dist/components/perf.d.ts +2 -2
  158. package/dist/components/perf.js +4 -4
  159. package/dist/components/perf.js.map +1 -1
  160. package/dist/components/physics.cjs +3 -3
  161. package/dist/components/physics.cjs.map +1 -1
  162. package/dist/components/physics.css +1 -1
  163. package/dist/components/physics.d.cts +1 -1
  164. package/dist/components/physics.d.ts +1 -1
  165. package/dist/components/physics.js +4 -4
  166. package/dist/components/physics.js.map +1 -1
  167. package/dist/components/react.cjs +4 -4
  168. package/dist/components/react.cjs.map +1 -1
  169. package/dist/components/react.js +4 -4
  170. package/dist/components/react.js.map +1 -1
  171. package/dist/components/reveal.cjs +6 -2
  172. package/dist/components/reveal.cjs.map +1 -1
  173. package/dist/components/reveal.css +1 -1
  174. package/dist/components/reveal.d.cts +1 -1
  175. package/dist/components/reveal.d.ts +1 -1
  176. package/dist/components/reveal.js +6 -2
  177. package/dist/components/reveal.js.map +1 -1
  178. package/dist/components/solid.cjs +9 -9
  179. package/dist/components/solid.cjs.map +1 -1
  180. package/dist/components/solid.d.cts +22 -22
  181. package/dist/components/solid.d.ts +22 -22
  182. package/dist/components/solid.js +9 -9
  183. package/dist/components/solid.js.map +1 -1
  184. package/dist/components/svelte.cjs +8 -8
  185. package/dist/components/svelte.cjs.map +1 -1
  186. package/dist/components/svelte.d.cts +22 -22
  187. package/dist/components/svelte.d.ts +22 -22
  188. package/dist/components/svelte.js +8 -8
  189. package/dist/components/svelte.js.map +1 -1
  190. package/dist/components/svg.cjs +2 -2
  191. package/dist/components/svg.cjs.map +1 -1
  192. package/dist/components/svg.css +1 -1
  193. package/dist/components/svg.d.cts +1 -1
  194. package/dist/components/svg.d.ts +1 -1
  195. package/dist/components/svg.js +2 -2
  196. package/dist/components/svg.js.map +1 -1
  197. package/dist/components/text.cjs +3 -3
  198. package/dist/components/text.cjs.map +1 -1
  199. package/dist/components/text.css +1 -1
  200. package/dist/components/text.d.cts +1 -1
  201. package/dist/components/text.d.ts +1 -1
  202. package/dist/components/text.js +3 -3
  203. package/dist/components/text.js.map +1 -1
  204. package/dist/components/timeline.cjs +3 -3
  205. package/dist/components/timeline.cjs.map +1 -1
  206. package/dist/components/timeline.css +1 -1
  207. package/dist/components/timeline.d.cts +1 -1
  208. package/dist/components/timeline.d.ts +1 -1
  209. package/dist/components/timeline.js +4 -4
  210. package/dist/components/timeline.js.map +1 -1
  211. package/dist/components/tokens.cjs +2 -2
  212. package/dist/components/tokens.cjs.map +1 -1
  213. package/dist/components/tokens.d.cts +2 -2
  214. package/dist/components/tokens.d.ts +2 -2
  215. package/dist/components/tokens.js +2 -2
  216. package/dist/components/tokens.js.map +1 -1
  217. package/dist/components/transitions.cjs +2 -2
  218. package/dist/components/transitions.cjs.map +1 -1
  219. package/dist/components/transitions.css +1 -1
  220. package/dist/components/transitions.d.cts +1 -1
  221. package/dist/components/transitions.d.ts +1 -1
  222. package/dist/components/transitions.js +2 -2
  223. package/dist/components/transitions.js.map +1 -1
  224. package/dist/components/ui.cjs +4 -4
  225. package/dist/components/ui.cjs.map +1 -1
  226. package/dist/components/ui.css +1 -1
  227. package/dist/components/ui.d.cts +1 -1
  228. package/dist/components/ui.d.ts +1 -1
  229. package/dist/components/ui.js +5 -5
  230. package/dist/components/ui.js.map +1 -1
  231. package/dist/components/vue.cjs +9 -9
  232. package/dist/components/vue.cjs.map +1 -1
  233. package/dist/components/vue.d.cts +23 -23
  234. package/dist/components/vue.d.ts +23 -23
  235. package/dist/components/vue.js +9 -9
  236. package/dist/components/vue.js.map +1 -1
  237. package/dist/components/webgl.cjs +2 -2
  238. package/dist/components/webgl.cjs.map +1 -1
  239. package/dist/components/webgl.css +1 -1
  240. package/dist/components/webgl.d.cts +1 -1
  241. package/dist/components/webgl.d.ts +1 -1
  242. package/dist/components/webgl.js +2 -2
  243. package/dist/components/webgl.js.map +1 -1
  244. package/dist/components.cjs +9 -9
  245. package/dist/components.cjs.map +1 -1
  246. package/dist/components.css +1 -1
  247. package/dist/components.d.cts +30 -30
  248. package/dist/components.d.ts +30 -30
  249. package/dist/components.js +11 -11
  250. package/dist/components.js.map +1 -1
  251. package/dist/components.umd.js +5 -5
  252. package/dist/components.umd.js.map +1 -1
  253. package/dist/element.cjs +4 -3
  254. package/dist/element.cjs.map +1 -1
  255. package/dist/element.d.cts +19 -5
  256. package/dist/element.d.ts +19 -5
  257. package/dist/element.js +4 -3
  258. package/dist/element.js.map +1 -1
  259. package/dist/element.umd.js +1 -1
  260. package/dist/element.umd.js.map +1 -1
  261. package/dist/index.cjs +28 -25
  262. package/dist/index.cjs.map +1 -1
  263. package/dist/index.d.cts +40 -15
  264. package/dist/index.d.ts +40 -15
  265. package/dist/index.js +11 -10
  266. package/dist/index.js.map +1 -1
  267. package/dist/index.umd.js +5 -5
  268. package/dist/index.umd.js.map +1 -1
  269. package/dist/presets/extended.cjs +243 -0
  270. package/dist/presets/extended.cjs.map +1 -0
  271. package/dist/presets/extended.d.cts +37 -0
  272. package/dist/presets/extended.d.ts +37 -0
  273. package/dist/presets/extended.js +239 -0
  274. package/dist/presets/extended.js.map +1 -0
  275. package/dist/presets-extended.umd.js +2 -0
  276. package/dist/presets-extended.umd.js.map +1 -0
  277. package/dist/react.cjs +4 -3
  278. package/dist/react.cjs.map +1 -1
  279. package/dist/react.d.cts +19 -5
  280. package/dist/react.d.ts +19 -5
  281. package/dist/react.js +4 -3
  282. package/dist/react.js.map +1 -1
  283. package/dist/solid.cjs +5 -4
  284. package/dist/solid.cjs.map +1 -1
  285. package/dist/solid.d.cts +20 -6
  286. package/dist/solid.d.ts +20 -6
  287. package/dist/solid.js +5 -4
  288. package/dist/solid.js.map +1 -1
  289. package/dist/svelte.cjs +5 -4
  290. package/dist/svelte.cjs.map +1 -1
  291. package/dist/svelte.d.cts +20 -6
  292. package/dist/svelte.d.ts +20 -6
  293. package/dist/svelte.js +5 -4
  294. package/dist/svelte.js.map +1 -1
  295. package/dist/vue.cjs +4 -3
  296. package/dist/vue.cjs.map +1 -1
  297. package/dist/vue.d.cts +19 -5
  298. package/dist/vue.d.ts +19 -5
  299. package/dist/vue.js +4 -3
  300. package/dist/vue.js.map +1 -1
  301. package/docs/API.md +17 -12
  302. package/docs/ROADMAP.md +12 -11
  303. package/docs/accessibility.md +2 -2
  304. package/docs/components.md +33 -33
  305. package/docs/frameworks-ssr.md +12 -12
  306. package/docs/hybrid-apps.md +10 -10
  307. package/docs/migration-from-aos.md +5 -5
  308. package/docs/migration-from-gsap-scrolltrigger.md +3 -3
  309. package/docs/motion-tokens.css +1 -1
  310. package/docs/motion-tokens.md +2 -2
  311. package/docs/performance.md +6 -6
  312. package/docs/presets.md +310 -0
  313. package/docs/windows-apps.md +8 -8
  314. package/package.json +40 -26
  315. package/dist/chunks/base-B5i8qQPR.cjs.map +0 -1
  316. package/dist/chunks/base-C3Sw9sAO.js.map +0 -1
  317. package/dist/chunks/core-mV_TPgG_.js.map +0 -1
  318. package/dist/chunks/core-qpECfEkb.cjs.map +0 -1
  319. package/dist/chunks/stagger-BFAhKknX.js.map +0 -1
  320. package/dist/chunks/stagger-CLc3j58T.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"gesture.js","sources":["../../src/components/gesture/swipeable.ts","../../src/components/gesture/pinch-zoom.ts","../../src/components/gesture/index.ts"],"sourcesContent":["import { defineElement, type UsaElement } from '../base';\nimport { createSpring, type SpringValue } from '../physics/spring';\nimport { gesture, type SwipeDirection } from './core';\nimport css from './gesture.css?raw';\n\n/**\n * `<usa-swipeable>` — swipe-to-dismiss / swipe actions. The content follows\n * the finger (rubber-banded past `distance`), flies out on a swipe or a drag\n * past `distance`, otherwise springs home with the release velocity.\n *\n * Attributes: `axis` (`x` default · `y`), `distance` (px, 120), `preset`\n * (spring), `dismiss` (remove the element after flying out), `disabled`.\n * Keyboard: Delete/Backspace dismisses, ←/→ swipe. Events `usa:swipe`\n * (`{ direction }`, cancelable), `usa:dismiss`. Methods `swipe(dir)`, `reset()`.\n * Reduced motion: no follow / fly-out animation, events still fire.\n */\nexport interface UsaSwipeableElement extends UsaElement {\n swipe(direction: SwipeDirection): void;\n reset(): void;\n readonly offset: number;\n}\n\nexport function defineSwipeable(tag = 'usa-swipeable'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaSwipeable extends Base {\n static get observedAttributes(): string[] {\n return ['axis', 'disabled'];\n }\n private _s!: SpringValue;\n private _off = 0;\n\n get offset(): number {\n return this._off;\n }\n\n private put(v: number): void {\n this._off = v;\n this.style.setProperty('--usa-swipe', `${v}px`);\n this.style.setProperty('--usa-swipe-p', String(Math.min(1, Math.abs(v) / this.num('distance', 120))));\n }\n\n swipe(direction: SwipeDirection): void {\n if (!this.emit('swipe', { direction })) return this.reset();\n const sign = direction === 'left' || direction === 'up' ? -1 : 1;\n const far = sign * ((this.str('axis', 'x') === 'y' ? this.offsetHeight : this.offsetWidth) + 80 || 600);\n const done = () => {\n this.emit('dismiss', { direction });\n if (this.flag('dismiss')) this.remove();\n };\n if (this.reduced) {\n this.put(0);\n return done();\n }\n this.setAttribute('data-gone', '');\n this._s = createSpring({ spring: 'stiff', value: this._off, onUpdate: (v) => this.put(v), onRest: done });\n this._s.set(far, sign * 1500);\n }\n\n reset(): void {\n this.removeAttribute('data-gone');\n if (this.reduced) return this.put(0);\n this._s.set(0);\n }\n\n mount(): void {\n this._s = createSpring({ spring: this.str('preset', 'default'), onUpdate: (v) => this.put(v) });\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n const y = this.str('axis', 'x') === 'y';\n const max = () => this.num('distance', 120);\n this.onCleanup(\n gesture(this, {\n onPan: ({ dx, dy, vx, vy, last }) => {\n if (this.flag('disabled')) return;\n const d = y ? dy : dx;\n if (!last) {\n this._s.stop();\n if (!this.reduced) this.put(Math.abs(d) > max() ? Math.sign(d) * (max() + (Math.abs(d) - max()) * 0.35) : d);\n return;\n }\n if (Math.abs(d) > max()) this.swipe(y ? (d > 0 ? 'down' : 'up') : d > 0 ? 'right' : 'left');\n else if (!this.hasAttribute('data-gone')) {\n if (this.reduced) this.put(0);\n else this._s.set(0, y ? vy : vx);\n }\n },\n onSwipe: ({ direction }) => {\n if (this.flag('disabled') || this.hasAttribute('data-gone')) return;\n if (y === (direction === 'up' || direction === 'down')) this.swipe(direction);\n },\n }, { axis: y ? 'y' : 'x' })\n );\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (this.flag('disabled')) return;\n const map: Record<string, SwipeDirection> = y ? { ArrowUp: 'up', ArrowDown: 'down' } : { ArrowLeft: 'left', ArrowRight: 'right' };\n if (e.key === 'Delete' || e.key === 'Backspace') this.swipe(y ? 'up' : 'left');\n else if (map[e.key]) this.swipe(map[e.key]);\n else return;\n e.preventDefault();\n });\n }\n\n unmount(): void {\n this._s?.stop();\n }\n },\n { id: 'gesture', text: css }\n );\n}\n","import { defineElement, clamp, type UsaElement } from '../base';\nimport { createSpring, type SpringValue } from '../physics/spring';\nimport { gesture } from './core';\nimport css from './gesture.css?raw';\n\n/**\n * `<usa-pinch-zoom>` — pinch (two fingers or Ctrl/⌘ + wheel / trackpad\n * pinch) to zoom its content, pan while zoomed, double-tap to toggle zoom;\n * scale and position spring back inside the bounds on release.\n *\n * Attributes: `min` (1), `max` (4), `double-tap` (zoom level, 2), `preset`.\n * Keyboard: `+` / `-` / `0`. Property `scale`, method `zoomTo(scale)`.\n * Event `usa:zoom` (`{ scale }`). Reduced motion: zoom changes instantly.\n */\nexport interface UsaPinchZoomElement extends UsaElement {\n readonly scale: number;\n zoomTo(scale: number): void;\n}\n\nexport function definePinchZoom(tag = 'usa-pinch-zoom'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaPinchZoom extends Base {\n private _k!: SpringValue;\n private _x!: SpringValue;\n private _y!: SpringValue;\n private _v = { k: 1, x: 0, y: 0 };\n\n get scale(): number {\n return this._v.k;\n }\n\n private paint(): void {\n const { k, x, y } = this._v;\n this.style.setProperty('--usa-zoom', String(k));\n this.style.setProperty('--usa-zoom-x', `${x}px`);\n this.style.setProperty('--usa-zoom-y', `${y}px`);\n this.toggleAttribute('data-zoomed', k > 1.01);\n }\n\n private bound(k: number, x: number, y: number) {\n const w = (this.clientWidth * (k - 1)) / 2;\n const h = (this.clientHeight * (k - 1)) / 2;\n return { x: clamp(x, -w, w), y: clamp(y, -h, h) };\n }\n\n zoomTo(scale: number): void {\n const k = clamp(scale, this.num('min', 1), this.num('max', 4));\n const b = this.bound(k, this._v.x, this._v.y);\n if (this.reduced) {\n this._v = { k, ...b };\n this.paint();\n } else {\n this._k.set(k);\n this._x.set(b.x);\n this._y.set(b.y);\n }\n this.emit('zoom', { scale: k });\n }\n\n mount(): void {\n const preset = this.str('preset', 'gentle');\n this._k = createSpring({ spring: preset, value: this._v.k, onUpdate: (v) => ((this._v.k = v), this.paint()) });\n this._x = createSpring({ spring: preset, value: this._v.x, onUpdate: (v) => ((this._v.x = v), this.paint()) });\n this._y = createSpring({ spring: preset, value: this._v.y, onUpdate: (v) => ((this._v.y = v), this.paint()) });\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n let base = 1;\n let ox = 0;\n let oy = 0;\n this.onCleanup(\n gesture(this, {\n onPinch: ({ scale, first, last }) => {\n if (first) base = this._v.k;\n const k = clamp(base * scale, this.num('min', 1) * 0.7, this.num('max', 4) * 1.3);\n if (last) return this.zoomTo(k);\n this._k.jump(k);\n },\n onPan: ({ dx, dy, vx, vy, first, last }) => {\n if (this._v.k <= 1.01) return;\n if (first) ((ox = this._v.x), (oy = this._v.y));\n if (!last) {\n this._x.jump(ox + dx);\n this._y.jump(oy + dy);\n return;\n }\n const b = this.bound(this._v.k, ox + dx + vx * 0.15, oy + dy + vy * 0.15);\n this._x.set(b.x, vx);\n this._y.set(b.y, vy);\n },\n onDoubleTap: () => this.zoomTo(this._v.k > 1.01 ? 1 : this.num('double-tap', 2)),\n })\n );\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === '+' || e.key === '=') this.zoomTo(this._v.k * 1.25);\n else if (e.key === '-') this.zoomTo(this._v.k / 1.25);\n else if (e.key === '0') this.zoomTo(1);\n else return;\n e.preventDefault();\n });\n this.paint();\n }\n\n unmount(): void {\n [this._k, this._x, this._y].forEach((s) => s?.stop());\n }\n },\n { id: 'gesture', text: css }\n );\n}\n","/**\n * use-scroll-animate/components/gesture — unified gestures (v3.2).\n * `gesture()` recognises pan, swipe, pinch, long-press, tap and double-tap\n * with release velocities for springs; `<usa-swipeable>` (swipe-to-dismiss)\n * and `<usa-pinch-zoom>` are built on it.\n */\nimport { defineSwipeable, type UsaSwipeableElement } from './swipeable';\nimport { definePinchZoom, type UsaPinchZoomElement } from './pinch-zoom';\n\nexport { defineSwipeable, definePinchZoom };\nexport { gesture, swipeDirection, pinchScale } from './core';\nexport type { GestureHandlers, GestureOptions, PanState, SwipeState, SwipeDirection, PinchState, PressState } from './core';\nexport type { UsaSwipeableElement, UsaPinchZoomElement };\n\n/** Register every component of this category under its default tag. */\nexport function defineGestureComponents(): void {\n defineSwipeable();\n definePinchZoom();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-swipeable': UsaSwipeableElement;\n 'usa-pinch-zoom': UsaPinchZoomElement;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAsBM,SAAU,eAAe,CAAC,GAAG,GAAG,eAAe,EAAA;AACnD,IAAA,OAAO,aAAa,CAClB,GAAG,EACH,CAAC,IAAI,KACH,MAAM,YAAa,SAAQ,IAAI,CAAA;AAA/B,QAAA,WAAA,GAAA;;YAKU,IAAA,C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,MAAM,CAAC,CAAC,CAAC;;oBACjC;gBACL,CAAC,CAAC,cAAc,EAAE;AACpB,YAAA,CAAC,CAAC;YACF,IAAI,CAAC,KAAK,EAAE;QACd;QAEA,OAAO,GAAA;YACL,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;QACvD;KACD,EACH,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,CAC7B;AACH;;AC7GA;;;;;AAKG;AASH;SACgB,uBAAuB,GAAA;AACrC,IAAA,eAAe,EAAE;AACjB,IAAA,eAAe,EAAE;AACnB;;;;"}
1
+ {"version":3,"file":"gesture.js","sources":["../../src/components/gesture/swipeable.ts","../../src/components/gesture/pinch-zoom.ts","../../src/components/gesture/index.ts"],"sourcesContent":["import { defineElement, type UsaElement } from '../base';\nimport { createSpring, type SpringValue } from '../physics/spring';\nimport { gesture, type SwipeDirection } from './core';\nimport css from './gesture.css?raw';\n\n/**\n * `<usa-swipeable>` — swipe-to-dismiss / swipe actions. The content follows\n * the finger (rubber-banded past `distance`), flies out on a swipe or a drag\n * past `distance`, otherwise springs home with the release velocity.\n *\n * Attributes: `axis` (`x` default · `y`), `distance` (px, 120), `preset`\n * (spring), `dismiss` (remove the element after flying out), `disabled`.\n * Keyboard: Delete/Backspace dismisses, ←/→ swipe. Events `usa:swipe`\n * (`{ direction }`, cancelable), `usa:dismiss`. Methods `swipe(dir)`, `reset()`.\n * Reduced motion: no follow / fly-out animation, events still fire.\n */\nexport interface UsaSwipeableElement extends UsaElement {\n swipe(direction: SwipeDirection): void;\n reset(): void;\n readonly offset: number;\n}\n\nexport function defineSwipeable(tag = 'usa-swipeable'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaSwipeable extends Base {\n static get observedAttributes(): string[] {\n return ['axis', 'disabled'];\n }\n private _s!: SpringValue;\n private _off = 0;\n\n get offset(): number {\n return this._off;\n }\n\n private put(v: number): void {\n this._off = v;\n this.style.setProperty('--usa-swipe', `${v}px`);\n this.style.setProperty('--usa-swipe-p', String(Math.min(1, Math.abs(v) / this.num('distance', 120))));\n }\n\n swipe(direction: SwipeDirection): void {\n if (!this.emit('swipe', { direction })) return this.reset();\n const sign = direction === 'left' || direction === 'up' ? -1 : 1;\n const far = sign * ((this.str('axis', 'x') === 'y' ? this.offsetHeight : this.offsetWidth) + 80 || 600);\n const done = () => {\n this.emit('dismiss', { direction });\n if (this.flag('dismiss')) this.remove();\n };\n if (this.reduced) {\n this.put(0);\n return done();\n }\n this.setAttribute('data-gone', '');\n this._s = createSpring({ spring: 'stiff', value: this._off, onUpdate: (v) => this.put(v), onRest: done });\n this._s.set(far, sign * 1500);\n }\n\n reset(): void {\n this.removeAttribute('data-gone');\n if (this.reduced) return this.put(0);\n this._s.set(0);\n }\n\n mount(): void {\n this._s = createSpring({ spring: this.str('preset', 'default'), onUpdate: (v) => this.put(v) });\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n const y = this.str('axis', 'x') === 'y';\n const max = () => this.num('distance', 120);\n this.onCleanup(\n gesture(this, {\n onPan: ({ dx, dy, vx, vy, last }) => {\n if (this.flag('disabled')) return;\n const d = y ? dy : dx;\n if (!last) {\n this._s.stop();\n if (!this.reduced) this.put(Math.abs(d) > max() ? Math.sign(d) * (max() + (Math.abs(d) - max()) * 0.35) : d);\n return;\n }\n if (Math.abs(d) > max()) this.swipe(y ? (d > 0 ? 'down' : 'up') : d > 0 ? 'right' : 'left');\n else if (!this.hasAttribute('data-gone')) {\n if (this.reduced) this.put(0);\n else this._s.set(0, y ? vy : vx);\n }\n },\n onSwipe: ({ direction }) => {\n if (this.flag('disabled') || this.hasAttribute('data-gone')) return;\n if (y === (direction === 'up' || direction === 'down')) this.swipe(direction);\n },\n }, { axis: y ? 'y' : 'x' })\n );\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (this.flag('disabled')) return;\n const map: Record<string, SwipeDirection> = y ? { ArrowUp: 'up', ArrowDown: 'down' } : { ArrowLeft: 'left', ArrowRight: 'right' };\n if (e.key === 'Delete' || e.key === 'Backspace') this.swipe(y ? 'up' : 'left');\n else if (map[e.key]) this.swipe(map[e.key]);\n else return;\n e.preventDefault();\n });\n }\n\n unmount(): void {\n this._s?.stop();\n }\n },\n { id: 'gesture', text: css }\n );\n}\n","import { defineElement, clamp, type UsaElement } from '../base';\nimport { createSpring, type SpringValue } from '../physics/spring';\nimport { gesture } from './core';\nimport css from './gesture.css?raw';\n\n/**\n * `<usa-pinch-zoom>` — pinch (two fingers or Ctrl/⌘ + wheel / trackpad\n * pinch) to zoom its content, pan while zoomed, double-tap to toggle zoom;\n * scale and position spring back inside the bounds on release.\n *\n * Attributes: `min` (1), `max` (4), `double-tap` (zoom level, 2), `preset`.\n * Keyboard: `+` / `-` / `0`. Property `scale`, method `zoomTo(scale)`.\n * Event `usa:zoom` (`{ scale }`). Reduced motion: zoom changes instantly.\n */\nexport interface UsaPinchZoomElement extends UsaElement {\n readonly scale: number;\n zoomTo(scale: number): void;\n}\n\nexport function definePinchZoom(tag = 'usa-pinch-zoom'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaPinchZoom extends Base {\n private _k!: SpringValue;\n private _x!: SpringValue;\n private _y!: SpringValue;\n private _v = { k: 1, x: 0, y: 0 };\n\n get scale(): number {\n return this._v.k;\n }\n\n private paint(): void {\n const { k, x, y } = this._v;\n this.style.setProperty('--usa-zoom', String(k));\n this.style.setProperty('--usa-zoom-x', `${x}px`);\n this.style.setProperty('--usa-zoom-y', `${y}px`);\n this.toggleAttribute('data-zoomed', k > 1.01);\n }\n\n private bound(k: number, x: number, y: number) {\n const w = (this.clientWidth * (k - 1)) / 2;\n const h = (this.clientHeight * (k - 1)) / 2;\n return { x: clamp(x, -w, w), y: clamp(y, -h, h) };\n }\n\n zoomTo(scale: number): void {\n const k = clamp(scale, this.num('min', 1), this.num('max', 4));\n const b = this.bound(k, this._v.x, this._v.y);\n if (this.reduced) {\n this._v = { k, ...b };\n this.paint();\n } else {\n this._k.set(k);\n this._x.set(b.x);\n this._y.set(b.y);\n }\n this.emit('zoom', { scale: k });\n }\n\n mount(): void {\n const preset = this.str('preset', 'gentle');\n this._k = createSpring({ spring: preset, value: this._v.k, onUpdate: (v) => ((this._v.k = v), this.paint()) });\n this._x = createSpring({ spring: preset, value: this._v.x, onUpdate: (v) => ((this._v.x = v), this.paint()) });\n this._y = createSpring({ spring: preset, value: this._v.y, onUpdate: (v) => ((this._v.y = v), this.paint()) });\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n let base = 1;\n let ox = 0;\n let oy = 0;\n this.onCleanup(\n gesture(this, {\n onPinch: ({ scale, first, last }) => {\n if (first) base = this._v.k;\n const k = clamp(base * scale, this.num('min', 1) * 0.7, this.num('max', 4) * 1.3);\n if (last) return this.zoomTo(k);\n this._k.jump(k);\n },\n onPan: ({ dx, dy, vx, vy, first, last }) => {\n if (this._v.k <= 1.01) return;\n if (first) ((ox = this._v.x), (oy = this._v.y));\n if (!last) {\n this._x.jump(ox + dx);\n this._y.jump(oy + dy);\n return;\n }\n const b = this.bound(this._v.k, ox + dx + vx * 0.15, oy + dy + vy * 0.15);\n this._x.set(b.x, vx);\n this._y.set(b.y, vy);\n },\n onDoubleTap: () => this.zoomTo(this._v.k > 1.01 ? 1 : this.num('double-tap', 2)),\n })\n );\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === '+' || e.key === '=') this.zoomTo(this._v.k * 1.25);\n else if (e.key === '-') this.zoomTo(this._v.k / 1.25);\n else if (e.key === '0') this.zoomTo(1);\n else return;\n e.preventDefault();\n });\n this.paint();\n }\n\n unmount(): void {\n [this._k, this._x, this._y].forEach((s) => s?.stop());\n }\n },\n { id: 'gesture', text: css }\n );\n}\n","/**\n * motionary/components/gesture — unified gestures (v3.2).\n * `gesture()` recognises pan, swipe, pinch, long-press, tap and double-tap\n * with release velocities for springs; `<usa-swipeable>` (swipe-to-dismiss)\n * and `<usa-pinch-zoom>` are built on it.\n */\nimport { defineSwipeable, type UsaSwipeableElement } from './swipeable';\nimport { definePinchZoom, type UsaPinchZoomElement } from './pinch-zoom';\n\nexport { defineSwipeable, definePinchZoom };\nexport { gesture, swipeDirection, pinchScale } from './core';\nexport type { GestureHandlers, GestureOptions, PanState, SwipeState, SwipeDirection, PinchState, PressState } from './core';\nexport type { UsaSwipeableElement, UsaPinchZoomElement };\n\n/** Register every component of this category under its default tag. */\nexport function defineGestureComponents(): void {\n defineSwipeable();\n definePinchZoom();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-swipeable': UsaSwipeableElement;\n 'usa-pinch-zoom': UsaPinchZoomElement;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAsBM,SAAU,eAAe,CAAC,GAAG,GAAG,eAAe,EAAA;AACnD,IAAA,OAAO,aAAa,CAClB,GAAG,EACH,CAAC,IAAI,KACH,MAAM,YAAa,SAAQ,IAAI,CAAA;AAA/B,QAAA,WAAA,GAAA;;YAKU,IAAA,CAAA,IAAI,GAAG,CAAC;QA2ElB;AA/EE,QAAA,WAAW,kBAAkB,GAAA;AAC3B,YAAA,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC;QAC7B;AAIA,QAAA,IAAI,MAAM,GAAA;YACR,OAAO,IAAI,CAAC,IAAI;QAClB;AAEQ,QAAA,GAAG,CAAC,CAAS,EAAA;AACnB,YAAA,IAAI,CAAC,IAAI,GAAG,CAAC;YACb,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,aAAa,EAAE,CAAA,EAAG,CAAC,CAAA,EAAA,CAAI,CAAC;AAC/C,YAAA,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IA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
3
- var base = require('../chunks/base-B5i8qQPR.cjs');
3
+ var base = require('../chunks/base-BaQV-2ha.cjs');
4
4
 
5
5
  var css$5 = "usa-ripple{position:relative;display:inline-block;overflow:hidden;isolation:isolate;border-radius:inherit;-webkit-tap-highlight-color:transparent}usa-ripple[block]{display:block}usa-ripple .usa-ripple-wave{position:absolute;border-radius:50%;pointer-events:none;transform:scale(0);z-index:-1;will-change:transform,opacity}";
6
6
 
@@ -400,7 +400,7 @@ function defineToggle(tag = 'usa-toggle') {
400
400
  }
401
401
 
402
402
  /**
403
- * use-scroll-animate/components/interaction — micro-interactions.
403
+ * motionary/components/interaction — micro-interactions.
404
404
  * `<usa-ripple>`, `<usa-magnetic>`, `<usa-tilt>`, `<usa-spotlight>`,
405
405
  * `<usa-press>`, `<usa-toggle>`.
406
406
  */
@@ -1 +1 @@
1
- {"version":3,"file":"interaction.cjs","sources":["../../src/components/interaction/ripple.ts","../../src/components/interaction/magnetic.ts","../../src/components/interaction/tilt.ts","../../src/components/interaction/spotlight.ts","../../src/components/interaction/press.ts","../../src/components/interaction/toggle.ts","../../src/components/interaction/index.ts"],"sourcesContent":["import { defineElement, EASE_OUT, type UsaElement } from '../base';\nimport css from './ripple.css?raw';\n\n/**\n * `<usa-ripple>` — an ink ripple from the pointer (or the centre, for\n * keyboard presses) on whatever it wraps: buttons, list items, cards.\n *\n * Attributes: `color` (default `currentColor`), `opacity` (0.22),\n * `duration` (ms, 550), `centered`, `disabled`. Clips its content to its\n * own border radius. Reduced motion: a brief highlight instead of the wave.\n */\nexport interface UsaRippleElement extends UsaElement {\n /** Spawn a ripple at client coordinates (default: centre). */\n ripple(x?: number, y?: number): void;\n}\n\nexport function defineRipple(tag = 'usa-ripple'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaRipple extends Base {\n static get observedAttributes(): string[] {\n return [];\n }\n\n mount(): void {\n this.listen(this, 'pointerdown', (e: PointerEvent) => {\n if (e.button !== 0 && e.pointerType === 'mouse') return;\n this.ripple(e.clientX, e.clientY);\n });\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !e.repeat) this.ripple();\n });\n }\n\n ripple(x?: number, y?: number): void {\n if (this.flag('disabled')) return;\n const r = this.getBoundingClientRect();\n const centered = this.flag('centered') || x === undefined || y === undefined;\n const cx = centered ? r.width / 2 : (x as number) - r.left;\n const cy = centered ? r.height / 2 : (y as number) - r.top;\n const radius = Math.hypot(Math.max(cx, r.width - cx), Math.max(cy, r.height - cy));\n const wave = document.createElement('span');\n wave.className = 'usa-ripple-wave';\n wave.setAttribute('aria-hidden', 'true');\n const size = radius * 2;\n wave.style.cssText = `width:${size}px;height:${size}px;left:${cx - radius}px;top:${cy - radius}px;background:${this.str('color', 'currentColor')}`;\n this.append(wave);\n const opacity = this.num('opacity', 0.22);\n const duration = this.num('duration', 550);\n const frames = this.reduced\n ? [{ opacity }, { opacity: 0 }]\n : [\n { transform: 'scale(0)', opacity },\n { transform: 'scale(1)', opacity, offset: 0.7 },\n { transform: 'scale(1)', opacity: 0 },\n ];\n const a = this.motion(wave, frames, { duration: this.reduced ? 300 : duration, easing: EASE_OUT, fill: 'forwards' });\n if (a) a.onfinish = () => wave.remove();\n else setTimeout(() => wave.remove(), 0);\n }\n },\n { id: 'ripple', text: css }\n );\n}\n","import { defineElement, raf, caf, type UsaElement } from '../base';\nimport css from './magnetic.css?raw';\n\n/**\n * `<usa-magnetic>` — its content leans toward the pointer when the pointer\n * comes near, and springs back when it leaves (great for CTAs and icons).\n *\n * Attributes: `strength` (0–1 share of the pointer offset, 0.35), `radius`\n * (px of attraction beyond the element's edge, 60), `disabled`. Only on\n * devices with a fine pointer that hovers; off under reduced motion.\n * Writes one `transform` per frame through `--usa-mx` / `--usa-my`.\n */\nexport type UsaMagneticElement = UsaElement;\n\nexport function defineMagnetic(tag = 'usa-magnetic'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaMagnetic extends Base {\n static get observedAttributes(): string[] {\n return ['strength', 'radius', 'disabled'];\n }\n\n private _frame = 0;\n\n mount(): void {\n if (this.reduced || this.flag('disabled')) return;\n if (typeof matchMedia === 'function' && !matchMedia('(hover: hover) and (pointer: fine)').matches) return;\n const strength = this.num('strength', 0.35);\n const radius = this.num('radius', 60);\n let x = 0;\n let y = 0;\n let active = false;\n const apply = () => {\n this._frame = 0;\n const r = this.getBoundingClientRect();\n const dx = x - (r.left + r.width / 2);\n const dy = y - (r.top + r.height / 2);\n const near = Math.abs(dx) < r.width / 2 + radius && Math.abs(dy) < r.height / 2 + radius;\n if (near) {\n active = true;\n this.setAttribute('data-active', '');\n this.style.setProperty('--usa-mx', `${(dx * strength).toFixed(2)}px`);\n this.style.setProperty('--usa-my', `${(dy * strength).toFixed(2)}px`);\n } else if (active) this.release();\n };\n this.listen(\n document,\n 'pointermove',\n (e: PointerEvent) => {\n if (e.pointerType !== 'mouse' && e.pointerType !== 'pen') return;\n x = e.clientX;\n y = e.clientY;\n if (!this._frame) this._frame = raf(apply);\n },\n { passive: true }\n );\n this.listen(document, 'pointerleave', () => this.release());\n this.listen(window, 'blur', () => this.release());\n }\n\n private release(): void {\n this.removeAttribute('data-active');\n this.style.removeProperty('--usa-mx');\n this.style.removeProperty('--usa-my');\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n this.release();\n }\n },\n { id: 'magnetic', text: css }\n );\n}\n","import { defineElement, raf, caf, clamp, type UsaElement } from '../base';\nimport css from './tilt.css?raw';\n\n/**\n * `<usa-tilt>` — a 3D card that tilts toward the pointer, with an optional\n * glare highlight that follows it.\n *\n * Attributes: `max` (deg, 10), `scale` (1.03 while hovered), `perspective`\n * (px, 900), `glare` (add the light reflection), `reverse` (tilt away),\n * `disabled`. Off under reduced motion. Exposes `--usa-tilt-x` /\n * `--usa-tilt-y` (−1…1) for parallax layers inside the card.\n */\nexport type UsaTiltElement = UsaElement;\n\nexport function defineTilt(tag = 'usa-tilt'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaTilt extends Base {\n static get observedAttributes(): string[] {\n return ['max', 'scale', 'perspective', 'glare', 'reverse', 'disabled'];\n }\n\n private _frame = 0;\n private _glare: HTMLElement | null = null;\n\n mount(): void {\n if (this.flag('glare') && !this._glare) {\n this._glare = document.createElement('span');\n this._glare.className = 'usa-tilt-glare';\n this._glare.setAttribute('aria-hidden', 'true');\n this.append(this._glare);\n } else if (!this.flag('glare') && this._glare) {\n this._glare.remove();\n this._glare = null;\n }\n if (this.reduced || this.flag('disabled')) return;\n const max = this.num('max', 10) * (this.flag('reverse') ? -1 : 1);\n const scale = this.num('scale', 1.03);\n const persp = this.num('perspective', 900);\n let px = 0.5;\n let py = 0.5;\n let rect: DOMRect | null = null;\n const apply = () => {\n this._frame = 0;\n const nx = clamp(px * 2 - 1, -1, 1);\n const ny = clamp(py * 2 - 1, -1, 1);\n this.style.transform = `perspective(${persp}px) rotateX(${(-ny * max).toFixed(2)}deg) rotateY(${(nx * max).toFixed(2)}deg) scale(${scale})`;\n this.style.setProperty('--usa-tilt-x', nx.toFixed(3));\n this.style.setProperty('--usa-tilt-y', ny.toFixed(3));\n this.style.setProperty('--usa-glare-x', `${(px * 100).toFixed(1)}%`);\n this.style.setProperty('--usa-glare-y', `${(py * 100).toFixed(1)}%`);\n };\n this.listen(this, 'pointerenter', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n rect = this.getBoundingClientRect();\n this.setAttribute('data-active', '');\n });\n this.listen(this, 'pointermove', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n rect = rect || this.getBoundingClientRect();\n px = (e.clientX - rect.left) / (rect.width || 1);\n py = (e.clientY - rect.top) / (rect.height || 1);\n if (!this._frame) this._frame = raf(apply);\n });\n this.listen(this, 'pointerleave', () => this.reset());\n }\n\n private reset(): void {\n caf(this._frame);\n this._frame = 0;\n this.removeAttribute('data-active');\n this.style.transform = '';\n this.style.setProperty('--usa-tilt-x', '0');\n this.style.setProperty('--usa-tilt-y', '0');\n }\n\n unmount(): void {\n this.reset();\n }\n },\n { id: 'tilt', text: css }\n );\n}\n","import { defineElement, raf, caf, type UsaElement } from '../base';\nimport css from './spotlight.css?raw';\n\n/**\n * `<usa-spotlight>` — the Windows Fluent \"Reveal highlight\": a soft light\n * follows the pointer across a group of items, lighting up their borders\n * (even of neighbours) and the background of the hovered one. Put buttons,\n * tiles or menu items inside; each direct child is an item (or mark items\n * with `data-spotlight` to pick them yourself).\n *\n * Attributes: `size` (px, radius of the light, 160), `color` (default a\n * translucent white), `border` (px width of the lit border, 1),\n * `no-fill` (only light the borders). Not a motion effect, so it stays on\n * under reduced motion; off on touch-only devices.\n */\nexport type UsaSpotlightElement = UsaElement;\n\nexport function defineSpotlight(tag = 'usa-spotlight'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaSpotlight extends Base {\n static get observedAttributes(): string[] {\n return ['size', 'color', 'border'];\n }\n\n private _frame = 0;\n\n private items(): HTMLElement[] {\n const marked = Array.from(this.querySelectorAll<HTMLElement>('[data-spotlight]'));\n const items = marked.length ? marked : (Array.from(this.children) as HTMLElement[]);\n items.forEach((el) => el.classList.add('usa-spotlight-item'));\n return items;\n }\n\n mount(): void {\n const size = this.getAttribute('size');\n if (size) this.style.setProperty('--usa-spot-size', `${Number(size)}px`);\n const color = this.getAttribute('color');\n if (color) this.style.setProperty('--usa-spot-color', color);\n const border = this.getAttribute('border');\n if (border) this.style.setProperty('--usa-spot-border', `${Number(border)}px`);\n let items = this.items();\n let x = 0;\n let y = 0;\n const apply = () => {\n this._frame = 0;\n // All reads, then all writes\n const rects = items.map((el) => el.getBoundingClientRect());\n rects.forEach((r, i) => {\n items[i].style.setProperty('--usa-spot-x', `${(x - r.left).toFixed(1)}px`);\n items[i].style.setProperty('--usa-spot-y', `${(y - r.top).toFixed(1)}px`);\n });\n };\n this.listen(this, 'pointerenter', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n items = this.items();\n this.setAttribute('data-lit', '');\n });\n this.listen(this, 'pointermove', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n x = e.clientX;\n y = e.clientY;\n if (!this.hasAttribute('data-lit')) this.setAttribute('data-lit', '');\n if (!this._frame) this._frame = raf(apply);\n });\n this.listen(this, 'pointerleave', () => this.removeAttribute('data-lit'));\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n this.removeAttribute('data-lit');\n }\n },\n { id: 'spotlight', text: css }\n );\n}\n","import { defineElement, EASE_SPRING, type UsaElement } from '../base';\nimport css from './press.css?raw';\n\n/**\n * `<usa-press>` — tactile press feedback: content dips while pressed and\n * springs back on release (the Fluent \"pointer down\" scale), or bounces once\n * on click with `bounce`.\n *\n * Attributes: `scale` (pressed scale, 0.95), `bounce` (overshoot on\n * release), `disabled`. Works with mouse, touch, pen and Space/Enter.\n * Reduced motion: a subtle dim instead of scaling.\n */\nexport interface UsaPressElement extends UsaElement {\n readonly pressed: boolean;\n}\n\nexport function definePress(tag = 'usa-press'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaPress extends Base {\n static get observedAttributes(): string[] {\n return ['disabled'];\n }\n\n private _anim: Animation | null = null;\n private _down = false;\n\n get pressed(): boolean {\n return this._down;\n }\n\n private frame(down: boolean): Keyframe {\n if (this.reduced) return { opacity: down ? 0.7 : 1 };\n return { transform: down ? `scale(${this.num('scale', 0.95)})` : 'scale(1)' };\n }\n\n private down(): void {\n if (this._down || this.flag('disabled')) return;\n this._down = true;\n this.setAttribute('data-pressed', '');\n const from = this.currentFrame();\n this._anim?.cancel();\n this._anim = this.motion(this, [from, this.frame(true)], { duration: 120, easing: 'cubic-bezier(0.3, 0, 0.7, 1)', fill: 'forwards' });\n }\n\n private up(): void {\n if (!this._down) return;\n this._down = false;\n this.removeAttribute('data-pressed');\n const from = this.currentFrame();\n this._anim?.cancel();\n const frames: Keyframe[] =\n this.flag('bounce') && !this.reduced\n ? [from, { transform: 'scale(1.06)', offset: 0.45 }, { transform: 'scale(0.99)', offset: 0.75 }, this.frame(false)]\n : [from, this.frame(false)];\n const a = this.motion(this, frames, { duration: this.flag('bounce') ? 480 : 320, easing: EASE_SPRING });\n this._anim = a;\n if (a) a.onfinish = () => this._anim === a && (this._anim = null);\n }\n\n private currentFrame(): Keyframe {\n if (typeof getComputedStyle !== 'function') return this.frame(false);\n const cs = getComputedStyle(this);\n return this.reduced ? { opacity: cs.opacity || '1' } : { transform: cs.transform && cs.transform !== 'none' ? cs.transform : 'scale(1)' };\n }\n\n mount(): void {\n this.listen(this, 'pointerdown', (e: PointerEvent) => {\n if (e.pointerType === 'mouse' && e.button !== 0) return;\n this.down();\n });\n for (const t of ['pointerup', 'pointerleave', 'pointercancel', 'blur']) this.listen(this, t, () => this.up());\n this.listen(this, 'keydown', (e: KeyboardEvent) => (e.key === ' ' || e.key === 'Enter') && !e.repeat && this.down());\n this.listen(this, 'keyup', (e: KeyboardEvent) => (e.key === ' ' || e.key === 'Enter') && this.up());\n }\n\n unmount(): void {\n this._anim?.cancel();\n this._anim = null;\n this._down = false;\n }\n },\n { id: 'press', text: css }\n );\n}\n","import { defineElement, type UsaElement } from '../base';\nimport css from './toggle.css?raw';\n\n/**\n * `<usa-toggle>` — an accessible switch whose knob stretches while pressed\n * and glides across (the Windows 11 / iOS toggle). `role=\"switch\"`,\n * keyboard (Space / Enter), and form-associated where `ElementInternals`\n * exists (submits `value`, default `\"on\"`, under `name` when checked).\n *\n * Attributes: `checked`, `disabled`, `name`, `value`, `label`\n * (accessible name if there is no `aria-label` / `<label>`). Events:\n * `change` and `usa:change` (`detail.checked`). Reduced motion: no glide.\n */\nexport interface UsaToggleElement extends UsaElement {\n checked: boolean;\n disabled: boolean;\n toggle(force?: boolean): void;\n}\n\nexport function defineToggle(tag = 'usa-toggle'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaToggle extends Base {\n static formAssociated = true;\n static get observedAttributes(): string[] {\n return ['checked', 'disabled', 'label'];\n }\n\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n try {\n this._internals = typeof (this as any).attachInternals === 'function' ? (this as any).attachInternals() : null;\n } catch {\n this._internals = null;\n }\n }\n\n get checked(): boolean {\n return this.hasAttribute('checked');\n }\n set checked(v: boolean) {\n this.toggleAttribute('checked', !!v);\n }\n get disabled(): boolean {\n return this.hasAttribute('disabled');\n }\n set disabled(v: boolean) {\n this.toggleAttribute('disabled', !!v);\n }\n\n changed(): void {\n this.sync();\n }\n\n private sync(): void {\n this.setAttribute('aria-checked', String(this.checked));\n this.setAttribute('aria-disabled', String(this.disabled));\n this.tabIndex = this.disabled ? -1 : 0;\n const label = this.getAttribute('label');\n if (label && !this.hasAttribute('aria-label')) this.setAttribute('aria-label', label);\n this._internals?.setFormValue?.(this.checked ? this.str('value', 'on') : null);\n }\n\n mount(): void {\n if (!this.querySelector(':scope > .usa-toggle-track')) {\n const track = document.createElement('span');\n track.className = 'usa-toggle-track';\n track.setAttribute('aria-hidden', 'true');\n const knob = document.createElement('span');\n knob.className = 'usa-toggle-knob';\n track.append(knob);\n this.prepend(track);\n }\n this.setAttribute('role', 'switch');\n this.sync();\n this.listen(this, 'click', () => this.toggle());\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n if (!e.repeat) this.toggle();\n }\n });\n this.listen(this, 'pointerdown', () => !this.disabled && this.setAttribute('data-pressed', ''));\n for (const t of ['pointerup', 'pointerleave', 'pointercancel']) this.listen(this, t, () => this.removeAttribute('data-pressed'));\n }\n\n toggle(force?: boolean): void {\n if (this.disabled) return;\n const next = force === undefined ? !this.checked : force;\n if (next === this.checked) return;\n this.checked = next;\n this.sync();\n this.dispatchEvent(new Event('change', { bubbles: true }));\n this.emit('change', { checked: next });\n }\n },\n { id: 'toggle', text: css }\n );\n}\n","/**\n * use-scroll-animate/components/interaction — micro-interactions.\n * `<usa-ripple>`, `<usa-magnetic>`, `<usa-tilt>`, `<usa-spotlight>`,\n * `<usa-press>`, `<usa-toggle>`.\n */\nimport { defineRipple, type UsaRippleElement } from './ripple';\nimport { defineMagnetic, type UsaMagneticElement } from './magnetic';\nimport { defineTilt, type UsaTiltElement } from './tilt';\nimport { defineSpotlight, type UsaSpotlightElement } from './spotlight';\nimport { definePress, type UsaPressElement } from './press';\nimport { defineToggle, type UsaToggleElement } from './toggle';\n\nexport { defineRipple, defineMagnetic, defineTilt, defineSpotlight, definePress, defineToggle };\nexport type { UsaRippleElement, UsaMagneticElement, UsaTiltElement, UsaSpotlightElement, UsaPressElement, UsaToggleElement };\n\n/** Register every component of this category under its default tag. */\nexport function defineInteractionComponents(): void {\n defineRipple();\n defineMagnetic();\n defineTilt();\n defineSpotlight();\n definePress();\n defineToggle();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-ripple': UsaRippleElement;\n 'usa-magnetic': UsaMagneticElement;\n 'usa-tilt': UsaTiltElement;\n 'usa-spotlight': UsaSpotlightElement;\n 'usa-press': UsaPressElement;\n 'usa-toggle': UsaToggleElement;\n }\n}\n"],"names":["defineElement","EASE_OUT","css","raf","caf","clamp","EASE_SPRING"],"mappings":";;;;;;AAgBM,SAAU,YAAY,CAAC,GAAG,GAAG,YAAY,EAAA;AAC7C,IAAA,OAAOA,kBAAa,CAClB,GAAG,EACH,CAAC,IAAI,KACH,MAAM,SAAU,SAAQ,IAAI,CAAA;AAC1B,QAAA,WAAW,kBAAkB,GAAA;AAC3B,YAAA,OAAO,EAAE;QACX;QAEA,KAAK,GAAA;YACH,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC,CAAe,KAAI;gBACnD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,KAAK,OAAO;oBAAE;gBACjD,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC;AACnC,YAAA,CAAC,CAAC;YACF,I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AI,CAAC,YAAY,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;gBAC/F,KAAK,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,eAAe,CAAC;AAAE,oBAAA,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;YAClI;AAEA,YAAA,MAAM,CAAC,KAAe,EAAA;gBACpB,IAAI,IAAI,CAAC,QAAQ;oBAAE;AACnB,gBAAA,MAAM,IAAI,GAAG,KAAK,KAAK,SAAS,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,KAAK;AACxD,gBAAA,IAAI,IAAI,KAAK,IAAI,CAAC,OAAO;oBAAE;AAC3B,gBAAA,IAAI,CAAC,OAAO,GAAG,IAAI;gBACnB,IAAI,CAAC,IAAI,EAAE;AACX,gBAAA,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC1D,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YACxC;AACD,SAAA;AA1EQ,QAAA,EAAA,CAAA,cAAc,GAAG,IAAK;aA0E9B,EACH,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,CAC5B;AACH;;ACrGA;;;;AAIG;AAWH;SACgB,2BAA2B,GAAA;AACzC,IAAA,YAAY,EAAE;AACd,IAAA,cAAc,EAAE;AAChB,IAAA,UAAU,EAAE;AACZ,IAAA,eAAe,EAAE;AACjB,IAAA,WAAW,EAAE;AACb,IAAA,YAAY,EAAE;AAChB;;;;;;;;;;"}
1
+ {"version":3,"file":"interaction.cjs","sources":["../../src/components/interaction/ripple.ts","../../src/components/interaction/magnetic.ts","../../src/components/interaction/tilt.ts","../../src/components/interaction/spotlight.ts","../../src/components/interaction/press.ts","../../src/components/interaction/toggle.ts","../../src/components/interaction/index.ts"],"sourcesContent":["import { defineElement, EASE_OUT, type UsaElement } from '../base';\nimport css from './ripple.css?raw';\n\n/**\n * `<usa-ripple>` — an ink ripple from the pointer (or the centre, for\n * keyboard presses) on whatever it wraps: buttons, list items, cards.\n *\n * Attributes: `color` (default `currentColor`), `opacity` (0.22),\n * `duration` (ms, 550), `centered`, `disabled`. Clips its content to its\n * own border radius. Reduced motion: a brief highlight instead of the wave.\n */\nexport interface UsaRippleElement extends UsaElement {\n /** Spawn a ripple at client coordinates (default: centre). */\n ripple(x?: number, y?: number): void;\n}\n\nexport function defineRipple(tag = 'usa-ripple'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaRipple extends Base {\n static get observedAttributes(): string[] {\n return [];\n }\n\n mount(): void {\n this.listen(this, 'pointerdown', (e: PointerEvent) => {\n if (e.button !== 0 && e.pointerType === 'mouse') return;\n this.ripple(e.clientX, e.clientY);\n });\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !e.repeat) this.ripple();\n });\n }\n\n ripple(x?: number, y?: number): void {\n if (this.flag('disabled')) return;\n const r = this.getBoundingClientRect();\n const centered = this.flag('centered') || x === undefined || y === undefined;\n const cx = centered ? r.width / 2 : (x as number) - r.left;\n const cy = centered ? r.height / 2 : (y as number) - r.top;\n const radius = Math.hypot(Math.max(cx, r.width - cx), Math.max(cy, r.height - cy));\n const wave = document.createElement('span');\n wave.className = 'usa-ripple-wave';\n wave.setAttribute('aria-hidden', 'true');\n const size = radius * 2;\n wave.style.cssText = `width:${size}px;height:${size}px;left:${cx - radius}px;top:${cy - radius}px;background:${this.str('color', 'currentColor')}`;\n this.append(wave);\n const opacity = this.num('opacity', 0.22);\n const duration = this.num('duration', 550);\n const frames = this.reduced\n ? [{ opacity }, { opacity: 0 }]\n : [\n { transform: 'scale(0)', opacity },\n { transform: 'scale(1)', opacity, offset: 0.7 },\n { transform: 'scale(1)', opacity: 0 },\n ];\n const a = this.motion(wave, frames, { duration: this.reduced ? 300 : duration, easing: EASE_OUT, fill: 'forwards' });\n if (a) a.onfinish = () => wave.remove();\n else setTimeout(() => wave.remove(), 0);\n }\n },\n { id: 'ripple', text: css }\n );\n}\n","import { defineElement, raf, caf, type UsaElement } from '../base';\nimport css from './magnetic.css?raw';\n\n/**\n * `<usa-magnetic>` — its content leans toward the pointer when the pointer\n * comes near, and springs back when it leaves (great for CTAs and icons).\n *\n * Attributes: `strength` (0–1 share of the pointer offset, 0.35), `radius`\n * (px of attraction beyond the element's edge, 60), `disabled`. Only on\n * devices with a fine pointer that hovers; off under reduced motion.\n * Writes one `transform` per frame through `--usa-mx` / `--usa-my`.\n */\nexport type UsaMagneticElement = UsaElement;\n\nexport function defineMagnetic(tag = 'usa-magnetic'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaMagnetic extends Base {\n static get observedAttributes(): string[] {\n return ['strength', 'radius', 'disabled'];\n }\n\n private _frame = 0;\n\n mount(): void {\n if (this.reduced || this.flag('disabled')) return;\n if (typeof matchMedia === 'function' && !matchMedia('(hover: hover) and (pointer: fine)').matches) return;\n const strength = this.num('strength', 0.35);\n const radius = this.num('radius', 60);\n let x = 0;\n let y = 0;\n let active = false;\n const apply = () => {\n this._frame = 0;\n const r = this.getBoundingClientRect();\n const dx = x - (r.left + r.width / 2);\n const dy = y - (r.top + r.height / 2);\n const near = Math.abs(dx) < r.width / 2 + radius && Math.abs(dy) < r.height / 2 + radius;\n if (near) {\n active = true;\n this.setAttribute('data-active', '');\n this.style.setProperty('--usa-mx', `${(dx * strength).toFixed(2)}px`);\n this.style.setProperty('--usa-my', `${(dy * strength).toFixed(2)}px`);\n } else if (active) this.release();\n };\n this.listen(\n document,\n 'pointermove',\n (e: PointerEvent) => {\n if (e.pointerType !== 'mouse' && e.pointerType !== 'pen') return;\n x = e.clientX;\n y = e.clientY;\n if (!this._frame) this._frame = raf(apply);\n },\n { passive: true }\n );\n this.listen(document, 'pointerleave', () => this.release());\n this.listen(window, 'blur', () => this.release());\n }\n\n private release(): void {\n this.removeAttribute('data-active');\n this.style.removeProperty('--usa-mx');\n this.style.removeProperty('--usa-my');\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n this.release();\n }\n },\n { id: 'magnetic', text: css }\n );\n}\n","import { defineElement, raf, caf, clamp, type UsaElement } from '../base';\nimport css from './tilt.css?raw';\n\n/**\n * `<usa-tilt>` — a 3D card that tilts toward the pointer, with an optional\n * glare highlight that follows it.\n *\n * Attributes: `max` (deg, 10), `scale` (1.03 while hovered), `perspective`\n * (px, 900), `glare` (add the light reflection), `reverse` (tilt away),\n * `disabled`. Off under reduced motion. Exposes `--usa-tilt-x` /\n * `--usa-tilt-y` (−1…1) for parallax layers inside the card.\n */\nexport type UsaTiltElement = UsaElement;\n\nexport function defineTilt(tag = 'usa-tilt'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaTilt extends Base {\n static get observedAttributes(): string[] {\n return ['max', 'scale', 'perspective', 'glare', 'reverse', 'disabled'];\n }\n\n private _frame = 0;\n private _glare: HTMLElement | null = null;\n\n mount(): void {\n if (this.flag('glare') && !this._glare) {\n this._glare = document.createElement('span');\n this._glare.className = 'usa-tilt-glare';\n this._glare.setAttribute('aria-hidden', 'true');\n this.append(this._glare);\n } else if (!this.flag('glare') && this._glare) {\n this._glare.remove();\n this._glare = null;\n }\n if (this.reduced || this.flag('disabled')) return;\n const max = this.num('max', 10) * (this.flag('reverse') ? -1 : 1);\n const scale = this.num('scale', 1.03);\n const persp = this.num('perspective', 900);\n let px = 0.5;\n let py = 0.5;\n let rect: DOMRect | null = null;\n const apply = () => {\n this._frame = 0;\n const nx = clamp(px * 2 - 1, -1, 1);\n const ny = clamp(py * 2 - 1, -1, 1);\n this.style.transform = `perspective(${persp}px) rotateX(${(-ny * max).toFixed(2)}deg) rotateY(${(nx * max).toFixed(2)}deg) scale(${scale})`;\n this.style.setProperty('--usa-tilt-x', nx.toFixed(3));\n this.style.setProperty('--usa-tilt-y', ny.toFixed(3));\n this.style.setProperty('--usa-glare-x', `${(px * 100).toFixed(1)}%`);\n this.style.setProperty('--usa-glare-y', `${(py * 100).toFixed(1)}%`);\n };\n this.listen(this, 'pointerenter', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n rect = this.getBoundingClientRect();\n this.setAttribute('data-active', '');\n });\n this.listen(this, 'pointermove', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n rect = rect || this.getBoundingClientRect();\n px = (e.clientX - rect.left) / (rect.width || 1);\n py = (e.clientY - rect.top) / (rect.height || 1);\n if (!this._frame) this._frame = raf(apply);\n });\n this.listen(this, 'pointerleave', () => this.reset());\n }\n\n private reset(): void {\n caf(this._frame);\n this._frame = 0;\n this.removeAttribute('data-active');\n this.style.transform = '';\n this.style.setProperty('--usa-tilt-x', '0');\n this.style.setProperty('--usa-tilt-y', '0');\n }\n\n unmount(): void {\n this.reset();\n }\n },\n { id: 'tilt', text: css }\n );\n}\n","import { defineElement, raf, caf, type UsaElement } from '../base';\nimport css from './spotlight.css?raw';\n\n/**\n * `<usa-spotlight>` — the Windows Fluent \"Reveal highlight\": a soft light\n * follows the pointer across a group of items, lighting up their borders\n * (even of neighbours) and the background of the hovered one. Put buttons,\n * tiles or menu items inside; each direct child is an item (or mark items\n * with `data-spotlight` to pick them yourself).\n *\n * Attributes: `size` (px, radius of the light, 160), `color` (default a\n * translucent white), `border` (px width of the lit border, 1),\n * `no-fill` (only light the borders). Not a motion effect, so it stays on\n * under reduced motion; off on touch-only devices.\n */\nexport type UsaSpotlightElement = UsaElement;\n\nexport function defineSpotlight(tag = 'usa-spotlight'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaSpotlight extends Base {\n static get observedAttributes(): string[] {\n return ['size', 'color', 'border'];\n }\n\n private _frame = 0;\n\n private items(): HTMLElement[] {\n const marked = Array.from(this.querySelectorAll<HTMLElement>('[data-spotlight]'));\n const items = marked.length ? marked : (Array.from(this.children) as HTMLElement[]);\n items.forEach((el) => el.classList.add('usa-spotlight-item'));\n return items;\n }\n\n mount(): void {\n const size = this.getAttribute('size');\n if (size) this.style.setProperty('--usa-spot-size', `${Number(size)}px`);\n const color = this.getAttribute('color');\n if (color) this.style.setProperty('--usa-spot-color', color);\n const border = this.getAttribute('border');\n if (border) this.style.setProperty('--usa-spot-border', `${Number(border)}px`);\n let items = this.items();\n let x = 0;\n let y = 0;\n const apply = () => {\n this._frame = 0;\n // All reads, then all writes\n const rects = items.map((el) => el.getBoundingClientRect());\n rects.forEach((r, i) => {\n items[i].style.setProperty('--usa-spot-x', `${(x - r.left).toFixed(1)}px`);\n items[i].style.setProperty('--usa-spot-y', `${(y - r.top).toFixed(1)}px`);\n });\n };\n this.listen(this, 'pointerenter', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n items = this.items();\n this.setAttribute('data-lit', '');\n });\n this.listen(this, 'pointermove', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n x = e.clientX;\n y = e.clientY;\n if (!this.hasAttribute('data-lit')) this.setAttribute('data-lit', '');\n if (!this._frame) this._frame = raf(apply);\n });\n this.listen(this, 'pointerleave', () => this.removeAttribute('data-lit'));\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n this.removeAttribute('data-lit');\n }\n },\n { id: 'spotlight', text: css }\n );\n}\n","import { defineElement, EASE_SPRING, type UsaElement } from '../base';\nimport css from './press.css?raw';\n\n/**\n * `<usa-press>` — tactile press feedback: content dips while pressed and\n * springs back on release (the Fluent \"pointer down\" scale), or bounces once\n * on click with `bounce`.\n *\n * Attributes: `scale` (pressed scale, 0.95), `bounce` (overshoot on\n * release), `disabled`. Works with mouse, touch, pen and Space/Enter.\n * Reduced motion: a subtle dim instead of scaling.\n */\nexport interface UsaPressElement extends UsaElement {\n readonly pressed: boolean;\n}\n\nexport function definePress(tag = 'usa-press'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaPress extends Base {\n static get observedAttributes(): string[] {\n return ['disabled'];\n }\n\n private _anim: Animation | null = null;\n private _down = false;\n\n get pressed(): boolean {\n return this._down;\n }\n\n private frame(down: boolean): Keyframe {\n if (this.reduced) return { opacity: down ? 0.7 : 1 };\n return { transform: down ? `scale(${this.num('scale', 0.95)})` : 'scale(1)' };\n }\n\n private down(): void {\n if (this._down || this.flag('disabled')) return;\n this._down = true;\n this.setAttribute('data-pressed', '');\n const from = this.currentFrame();\n this._anim?.cancel();\n this._anim = this.motion(this, [from, this.frame(true)], { duration: 120, easing: 'cubic-bezier(0.3, 0, 0.7, 1)', fill: 'forwards' });\n }\n\n private up(): void {\n if (!this._down) return;\n this._down = false;\n this.removeAttribute('data-pressed');\n const from = this.currentFrame();\n this._anim?.cancel();\n const frames: Keyframe[] =\n this.flag('bounce') && !this.reduced\n ? [from, { transform: 'scale(1.06)', offset: 0.45 }, { transform: 'scale(0.99)', offset: 0.75 }, this.frame(false)]\n : [from, this.frame(false)];\n const a = this.motion(this, frames, { duration: this.flag('bounce') ? 480 : 320, easing: EASE_SPRING });\n this._anim = a;\n if (a) a.onfinish = () => this._anim === a && (this._anim = null);\n }\n\n private currentFrame(): Keyframe {\n if (typeof getComputedStyle !== 'function') return this.frame(false);\n const cs = getComputedStyle(this);\n return this.reduced ? { opacity: cs.opacity || '1' } : { transform: cs.transform && cs.transform !== 'none' ? cs.transform : 'scale(1)' };\n }\n\n mount(): void {\n this.listen(this, 'pointerdown', (e: PointerEvent) => {\n if (e.pointerType === 'mouse' && e.button !== 0) return;\n this.down();\n });\n for (const t of ['pointerup', 'pointerleave', 'pointercancel', 'blur']) this.listen(this, t, () => this.up());\n this.listen(this, 'keydown', (e: KeyboardEvent) => (e.key === ' ' || e.key === 'Enter') && !e.repeat && this.down());\n this.listen(this, 'keyup', (e: KeyboardEvent) => (e.key === ' ' || e.key === 'Enter') && this.up());\n }\n\n unmount(): void {\n this._anim?.cancel();\n this._anim = null;\n this._down = false;\n }\n },\n { id: 'press', text: css }\n );\n}\n","import { defineElement, type UsaElement } from '../base';\nimport css from './toggle.css?raw';\n\n/**\n * `<usa-toggle>` — an accessible switch whose knob stretches while pressed\n * and glides across (the Windows 11 / iOS toggle). `role=\"switch\"`,\n * keyboard (Space / Enter), and form-associated where `ElementInternals`\n * exists (submits `value`, default `\"on\"`, under `name` when checked).\n *\n * Attributes: `checked`, `disabled`, `name`, `value`, `label`\n * (accessible name if there is no `aria-label` / `<label>`). Events:\n * `change` and `usa:change` (`detail.checked`). Reduced motion: no glide.\n */\nexport interface UsaToggleElement extends UsaElement {\n checked: boolean;\n disabled: boolean;\n toggle(force?: boolean): void;\n}\n\nexport function defineToggle(tag = 'usa-toggle'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaToggle extends Base {\n static formAssociated = true;\n static get observedAttributes(): string[] {\n return ['checked', 'disabled', 'label'];\n }\n\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n try {\n this._internals = typeof (this as any).attachInternals === 'function' ? (this as any).attachInternals() : null;\n } catch {\n this._internals = null;\n }\n }\n\n get checked(): boolean {\n return this.hasAttribute('checked');\n }\n set checked(v: boolean) {\n this.toggleAttribute('checked', !!v);\n }\n get disabled(): boolean {\n return this.hasAttribute('disabled');\n }\n set disabled(v: boolean) {\n this.toggleAttribute('disabled', !!v);\n }\n\n changed(): void {\n this.sync();\n }\n\n private sync(): void {\n this.setAttribute('aria-checked', String(this.checked));\n this.setAttribute('aria-disabled', String(this.disabled));\n this.tabIndex = this.disabled ? -1 : 0;\n const label = this.getAttribute('label');\n if (label && !this.hasAttribute('aria-label')) this.setAttribute('aria-label', label);\n this._internals?.setFormValue?.(this.checked ? this.str('value', 'on') : null);\n }\n\n mount(): void {\n if (!this.querySelector(':scope > .usa-toggle-track')) {\n const track = document.createElement('span');\n track.className = 'usa-toggle-track';\n track.setAttribute('aria-hidden', 'true');\n const knob = document.createElement('span');\n knob.className = 'usa-toggle-knob';\n track.append(knob);\n this.prepend(track);\n }\n this.setAttribute('role', 'switch');\n this.sync();\n this.listen(this, 'click', () => this.toggle());\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n if (!e.repeat) this.toggle();\n }\n });\n this.listen(this, 'pointerdown', () => !this.disabled && this.setAttribute('data-pressed', ''));\n for (const t of ['pointerup', 'pointerleave', 'pointercancel']) this.listen(this, t, () => this.removeAttribute('data-pressed'));\n }\n\n toggle(force?: boolean): void {\n if (this.disabled) return;\n const next = force === undefined ? !this.checked : force;\n if (next === this.checked) return;\n this.checked = next;\n this.sync();\n this.dispatchEvent(new Event('change', { bubbles: true }));\n this.emit('change', { checked: next });\n }\n },\n { id: 'toggle', text: css }\n );\n}\n","/**\n * motionary/components/interaction — micro-interactions.\n * `<usa-ripple>`, `<usa-magnetic>`, `<usa-tilt>`, `<usa-spotlight>`,\n * `<usa-press>`, `<usa-toggle>`.\n */\nimport { defineRipple, type UsaRippleElement } from './ripple';\nimport { defineMagnetic, type UsaMagneticElement } from './magnetic';\nimport { defineTilt, type UsaTiltElement } from './tilt';\nimport { defineSpotlight, type UsaSpotlightElement } from './spotlight';\nimport { definePress, type UsaPressElement } from './press';\nimport { defineToggle, type UsaToggleElement } from './toggle';\n\nexport { defineRipple, defineMagnetic, defineTilt, defineSpotlight, definePress, defineToggle };\nexport type { UsaRippleElement, UsaMagneticElement, UsaTiltElement, UsaSpotlightElement, UsaPressElement, UsaToggleElement };\n\n/** Register every component of this category under its default tag. */\nexport function defineInteractionComponents(): void {\n defineRipple();\n defineMagnetic();\n defineTilt();\n defineSpotlight();\n definePress();\n defineToggle();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-ripple': UsaRippleElement;\n 'usa-magnetic': UsaMagneticElement;\n 'usa-tilt': UsaTiltElement;\n 'usa-spotlight': UsaSpotlightElement;\n 'usa-press': UsaPressElement;\n 'usa-toggle': UsaToggleElement;\n }\n}\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CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YACxC;AACD,SAAA;AA1EQ,QAAA,EAAA,CAAA,cAAc,GAAG,IAAK;aA0E9B,EACH,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,CAC5B;AACH;;ACrGA;;;;AAIG;AAWH;SACgB,2BAA2B,GAAA;AACzC,IAAA,YAAY,EAAE;AACd,IAAA,cAAc,EAAE;AAChB,IAAA,UAAU,EAAE;AACZ,IAAA,eAAe,EAAE;AACjB,IAAA,WAAW,EAAE;AACb,IAAA,YAAY,EAAE;AAChB;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- /* use-scroll-animate/components/interaction */
1
+ /* motionary/components/interaction */
2
2
  .usa-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
3
3
  usa-magnetic{display:inline-block}usa-magnetic>*{transform:translate3d(var(--usa-mx,0px),var(--usa-my,0px),0);transition:transform 0.6s cubic-bezier(0.34,1.56,0.64,1)}usa-magnetic[data-active]>*{transition-duration:0.15s;transition-timing-function:ease-out}@media (prefers-reduced-motion:reduce){usa-magnetic>*,usa-tilt,usa-toggle .usa-toggle-knob{transition:none}}
4
4
  usa-press{display:inline-block;touch-action:manipulation;-webkit-tap-highlight-color:transparent}usa-press[block]{display:block}
@@ -93,7 +93,7 @@ interface UsaToggleElement extends UsaElement {
93
93
  declare function defineToggle(tag?: string): CustomElementConstructor | undefined;
94
94
 
95
95
  /**
96
- * use-scroll-animate/components/interaction — micro-interactions.
96
+ * motionary/components/interaction — micro-interactions.
97
97
  * `<usa-ripple>`, `<usa-magnetic>`, `<usa-tilt>`, `<usa-spotlight>`,
98
98
  * `<usa-press>`, `<usa-toggle>`.
99
99
  */
@@ -93,7 +93,7 @@ interface UsaToggleElement extends UsaElement {
93
93
  declare function defineToggle(tag?: string): CustomElementConstructor | undefined;
94
94
 
95
95
  /**
96
- * use-scroll-animate/components/interaction — micro-interactions.
96
+ * motionary/components/interaction — micro-interactions.
97
97
  * `<usa-ripple>`, `<usa-magnetic>`, `<usa-tilt>`, `<usa-spotlight>`,
98
98
  * `<usa-press>`, `<usa-toggle>`.
99
99
  */
@@ -1,4 +1,4 @@
1
- import { x as defineElement, y as EASE_OUT, r as raf, q as caf, k as clamp, E as EASE_SPRING } from '../chunks/base-C3Sw9sAO.js';
1
+ import { x as defineElement, y as EASE_OUT, r as raf, q as caf, k as clamp, E as EASE_SPRING } from '../chunks/base-Yno7N2eC.js';
2
2
 
3
3
  var css$5 = "usa-ripple{position:relative;display:inline-block;overflow:hidden;isolation:isolate;border-radius:inherit;-webkit-tap-highlight-color:transparent}usa-ripple[block]{display:block}usa-ripple .usa-ripple-wave{position:absolute;border-radius:50%;pointer-events:none;transform:scale(0);z-index:-1;will-change:transform,opacity}";
4
4
 
@@ -398,7 +398,7 @@ function defineToggle(tag = 'usa-toggle') {
398
398
  }
399
399
 
400
400
  /**
401
- * use-scroll-animate/components/interaction — micro-interactions.
401
+ * motionary/components/interaction — micro-interactions.
402
402
  * `<usa-ripple>`, `<usa-magnetic>`, `<usa-tilt>`, `<usa-spotlight>`,
403
403
  * `<usa-press>`, `<usa-toggle>`.
404
404
  */
@@ -1 +1 @@
1
- {"version":3,"file":"interaction.js","sources":["../../src/components/interaction/ripple.ts","../../src/components/interaction/magnetic.ts","../../src/components/interaction/tilt.ts","../../src/components/interaction/spotlight.ts","../../src/components/interaction/press.ts","../../src/components/interaction/toggle.ts","../../src/components/interaction/index.ts"],"sourcesContent":["import { defineElement, EASE_OUT, type UsaElement } from '../base';\nimport css from './ripple.css?raw';\n\n/**\n * `<usa-ripple>` — an ink ripple from the pointer (or the centre, for\n * keyboard presses) on whatever it wraps: buttons, list items, cards.\n *\n * Attributes: `color` (default `currentColor`), `opacity` (0.22),\n * `duration` (ms, 550), `centered`, `disabled`. Clips its content to its\n * own border radius. Reduced motion: a brief highlight instead of the wave.\n */\nexport interface UsaRippleElement extends UsaElement {\n /** Spawn a ripple at client coordinates (default: centre). */\n ripple(x?: number, y?: number): void;\n}\n\nexport function defineRipple(tag = 'usa-ripple'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaRipple extends Base {\n static get observedAttributes(): string[] {\n return [];\n }\n\n mount(): void {\n this.listen(this, 'pointerdown', (e: PointerEvent) => {\n if (e.button !== 0 && e.pointerType === 'mouse') return;\n this.ripple(e.clientX, e.clientY);\n });\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !e.repeat) this.ripple();\n });\n }\n\n ripple(x?: number, y?: number): void {\n if (this.flag('disabled')) return;\n const r = this.getBoundingClientRect();\n const centered = this.flag('centered') || x === undefined || y === undefined;\n const cx = centered ? r.width / 2 : (x as number) - r.left;\n const cy = centered ? r.height / 2 : (y as number) - r.top;\n const radius = Math.hypot(Math.max(cx, r.width - cx), Math.max(cy, r.height - cy));\n const wave = document.createElement('span');\n wave.className = 'usa-ripple-wave';\n wave.setAttribute('aria-hidden', 'true');\n const size = radius * 2;\n wave.style.cssText = `width:${size}px;height:${size}px;left:${cx - radius}px;top:${cy - radius}px;background:${this.str('color', 'currentColor')}`;\n this.append(wave);\n const opacity = this.num('opacity', 0.22);\n const duration = this.num('duration', 550);\n const frames = this.reduced\n ? [{ opacity }, { opacity: 0 }]\n : [\n { transform: 'scale(0)', opacity },\n { transform: 'scale(1)', opacity, offset: 0.7 },\n { transform: 'scale(1)', opacity: 0 },\n ];\n const a = this.motion(wave, frames, { duration: this.reduced ? 300 : duration, easing: EASE_OUT, fill: 'forwards' });\n if (a) a.onfinish = () => wave.remove();\n else setTimeout(() => wave.remove(), 0);\n }\n },\n { id: 'ripple', text: css }\n );\n}\n","import { defineElement, raf, caf, type UsaElement } from '../base';\nimport css from './magnetic.css?raw';\n\n/**\n * `<usa-magnetic>` — its content leans toward the pointer when the pointer\n * comes near, and springs back when it leaves (great for CTAs and icons).\n *\n * Attributes: `strength` (0–1 share of the pointer offset, 0.35), `radius`\n * (px of attraction beyond the element's edge, 60), `disabled`. Only on\n * devices with a fine pointer that hovers; off under reduced motion.\n * Writes one `transform` per frame through `--usa-mx` / `--usa-my`.\n */\nexport type UsaMagneticElement = UsaElement;\n\nexport function defineMagnetic(tag = 'usa-magnetic'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaMagnetic extends Base {\n static get observedAttributes(): string[] {\n return ['strength', 'radius', 'disabled'];\n }\n\n private _frame = 0;\n\n mount(): void {\n if (this.reduced || this.flag('disabled')) return;\n if (typeof matchMedia === 'function' && !matchMedia('(hover: hover) and (pointer: fine)').matches) return;\n const strength = this.num('strength', 0.35);\n const radius = this.num('radius', 60);\n let x = 0;\n let y = 0;\n let active = false;\n const apply = () => {\n this._frame = 0;\n const r = this.getBoundingClientRect();\n const dx = x - (r.left + r.width / 2);\n const dy = y - (r.top + r.height / 2);\n const near = Math.abs(dx) < r.width / 2 + radius && Math.abs(dy) < r.height / 2 + radius;\n if (near) {\n active = true;\n this.setAttribute('data-active', '');\n this.style.setProperty('--usa-mx', `${(dx * strength).toFixed(2)}px`);\n this.style.setProperty('--usa-my', `${(dy * strength).toFixed(2)}px`);\n } else if (active) this.release();\n };\n this.listen(\n document,\n 'pointermove',\n (e: PointerEvent) => {\n if (e.pointerType !== 'mouse' && e.pointerType !== 'pen') return;\n x = e.clientX;\n y = e.clientY;\n if (!this._frame) this._frame = raf(apply);\n },\n { passive: true }\n );\n this.listen(document, 'pointerleave', () => this.release());\n this.listen(window, 'blur', () => this.release());\n }\n\n private release(): void {\n this.removeAttribute('data-active');\n this.style.removeProperty('--usa-mx');\n this.style.removeProperty('--usa-my');\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n this.release();\n }\n },\n { id: 'magnetic', text: css }\n );\n}\n","import { defineElement, raf, caf, clamp, type UsaElement } from '../base';\nimport css from './tilt.css?raw';\n\n/**\n * `<usa-tilt>` — a 3D card that tilts toward the pointer, with an optional\n * glare highlight that follows it.\n *\n * Attributes: `max` (deg, 10), `scale` (1.03 while hovered), `perspective`\n * (px, 900), `glare` (add the light reflection), `reverse` (tilt away),\n * `disabled`. Off under reduced motion. Exposes `--usa-tilt-x` /\n * `--usa-tilt-y` (−1…1) for parallax layers inside the card.\n */\nexport type UsaTiltElement = UsaElement;\n\nexport function defineTilt(tag = 'usa-tilt'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaTilt extends Base {\n static get observedAttributes(): string[] {\n return ['max', 'scale', 'perspective', 'glare', 'reverse', 'disabled'];\n }\n\n private _frame = 0;\n private _glare: HTMLElement | null = null;\n\n mount(): void {\n if (this.flag('glare') && !this._glare) {\n this._glare = document.createElement('span');\n this._glare.className = 'usa-tilt-glare';\n this._glare.setAttribute('aria-hidden', 'true');\n this.append(this._glare);\n } else if (!this.flag('glare') && this._glare) {\n this._glare.remove();\n this._glare = null;\n }\n if (this.reduced || this.flag('disabled')) return;\n const max = this.num('max', 10) * (this.flag('reverse') ? -1 : 1);\n const scale = this.num('scale', 1.03);\n const persp = this.num('perspective', 900);\n let px = 0.5;\n let py = 0.5;\n let rect: DOMRect | null = null;\n const apply = () => {\n this._frame = 0;\n const nx = clamp(px * 2 - 1, -1, 1);\n const ny = clamp(py * 2 - 1, -1, 1);\n this.style.transform = `perspective(${persp}px) rotateX(${(-ny * max).toFixed(2)}deg) rotateY(${(nx * max).toFixed(2)}deg) scale(${scale})`;\n this.style.setProperty('--usa-tilt-x', nx.toFixed(3));\n this.style.setProperty('--usa-tilt-y', ny.toFixed(3));\n this.style.setProperty('--usa-glare-x', `${(px * 100).toFixed(1)}%`);\n this.style.setProperty('--usa-glare-y', `${(py * 100).toFixed(1)}%`);\n };\n this.listen(this, 'pointerenter', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n rect = this.getBoundingClientRect();\n this.setAttribute('data-active', '');\n });\n this.listen(this, 'pointermove', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n rect = rect || this.getBoundingClientRect();\n px = (e.clientX - rect.left) / (rect.width || 1);\n py = (e.clientY - rect.top) / (rect.height || 1);\n if (!this._frame) this._frame = raf(apply);\n });\n this.listen(this, 'pointerleave', () => this.reset());\n }\n\n private reset(): void {\n caf(this._frame);\n this._frame = 0;\n this.removeAttribute('data-active');\n this.style.transform = '';\n this.style.setProperty('--usa-tilt-x', '0');\n this.style.setProperty('--usa-tilt-y', '0');\n }\n\n unmount(): void {\n this.reset();\n }\n },\n { id: 'tilt', text: css }\n );\n}\n","import { defineElement, raf, caf, type UsaElement } from '../base';\nimport css from './spotlight.css?raw';\n\n/**\n * `<usa-spotlight>` — the Windows Fluent \"Reveal highlight\": a soft light\n * follows the pointer across a group of items, lighting up their borders\n * (even of neighbours) and the background of the hovered one. Put buttons,\n * tiles or menu items inside; each direct child is an item (or mark items\n * with `data-spotlight` to pick them yourself).\n *\n * Attributes: `size` (px, radius of the light, 160), `color` (default a\n * translucent white), `border` (px width of the lit border, 1),\n * `no-fill` (only light the borders). Not a motion effect, so it stays on\n * under reduced motion; off on touch-only devices.\n */\nexport type UsaSpotlightElement = UsaElement;\n\nexport function defineSpotlight(tag = 'usa-spotlight'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaSpotlight extends Base {\n static get observedAttributes(): string[] {\n return ['size', 'color', 'border'];\n }\n\n private _frame = 0;\n\n private items(): HTMLElement[] {\n const marked = Array.from(this.querySelectorAll<HTMLElement>('[data-spotlight]'));\n const items = marked.length ? marked : (Array.from(this.children) as HTMLElement[]);\n items.forEach((el) => el.classList.add('usa-spotlight-item'));\n return items;\n }\n\n mount(): void {\n const size = this.getAttribute('size');\n if (size) this.style.setProperty('--usa-spot-size', `${Number(size)}px`);\n const color = this.getAttribute('color');\n if (color) this.style.setProperty('--usa-spot-color', color);\n const border = this.getAttribute('border');\n if (border) this.style.setProperty('--usa-spot-border', `${Number(border)}px`);\n let items = this.items();\n let x = 0;\n let y = 0;\n const apply = () => {\n this._frame = 0;\n // All reads, then all writes\n const rects = items.map((el) => el.getBoundingClientRect());\n rects.forEach((r, i) => {\n items[i].style.setProperty('--usa-spot-x', `${(x - r.left).toFixed(1)}px`);\n items[i].style.setProperty('--usa-spot-y', `${(y - r.top).toFixed(1)}px`);\n });\n };\n this.listen(this, 'pointerenter', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n items = this.items();\n this.setAttribute('data-lit', '');\n });\n this.listen(this, 'pointermove', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n x = e.clientX;\n y = e.clientY;\n if (!this.hasAttribute('data-lit')) this.setAttribute('data-lit', '');\n if (!this._frame) this._frame = raf(apply);\n });\n this.listen(this, 'pointerleave', () => this.removeAttribute('data-lit'));\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n this.removeAttribute('data-lit');\n }\n },\n { id: 'spotlight', text: css }\n );\n}\n","import { defineElement, EASE_SPRING, type UsaElement } from '../base';\nimport css from './press.css?raw';\n\n/**\n * `<usa-press>` — tactile press feedback: content dips while pressed and\n * springs back on release (the Fluent \"pointer down\" scale), or bounces once\n * on click with `bounce`.\n *\n * Attributes: `scale` (pressed scale, 0.95), `bounce` (overshoot on\n * release), `disabled`. Works with mouse, touch, pen and Space/Enter.\n * Reduced motion: a subtle dim instead of scaling.\n */\nexport interface UsaPressElement extends UsaElement {\n readonly pressed: boolean;\n}\n\nexport function definePress(tag = 'usa-press'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaPress extends Base {\n static get observedAttributes(): string[] {\n return ['disabled'];\n }\n\n private _anim: Animation | null = null;\n private _down = false;\n\n get pressed(): boolean {\n return this._down;\n }\n\n private frame(down: boolean): Keyframe {\n if (this.reduced) return { opacity: down ? 0.7 : 1 };\n return { transform: down ? `scale(${this.num('scale', 0.95)})` : 'scale(1)' };\n }\n\n private down(): void {\n if (this._down || this.flag('disabled')) return;\n this._down = true;\n this.setAttribute('data-pressed', '');\n const from = this.currentFrame();\n this._anim?.cancel();\n this._anim = this.motion(this, [from, this.frame(true)], { duration: 120, easing: 'cubic-bezier(0.3, 0, 0.7, 1)', fill: 'forwards' });\n }\n\n private up(): void {\n if (!this._down) return;\n this._down = false;\n this.removeAttribute('data-pressed');\n const from = this.currentFrame();\n this._anim?.cancel();\n const frames: Keyframe[] =\n this.flag('bounce') && !this.reduced\n ? [from, { transform: 'scale(1.06)', offset: 0.45 }, { transform: 'scale(0.99)', offset: 0.75 }, this.frame(false)]\n : [from, this.frame(false)];\n const a = this.motion(this, frames, { duration: this.flag('bounce') ? 480 : 320, easing: EASE_SPRING });\n this._anim = a;\n if (a) a.onfinish = () => this._anim === a && (this._anim = null);\n }\n\n private currentFrame(): Keyframe {\n if (typeof getComputedStyle !== 'function') return this.frame(false);\n const cs = getComputedStyle(this);\n return this.reduced ? { opacity: cs.opacity || '1' } : { transform: cs.transform && cs.transform !== 'none' ? cs.transform : 'scale(1)' };\n }\n\n mount(): void {\n this.listen(this, 'pointerdown', (e: PointerEvent) => {\n if (e.pointerType === 'mouse' && e.button !== 0) return;\n this.down();\n });\n for (const t of ['pointerup', 'pointerleave', 'pointercancel', 'blur']) this.listen(this, t, () => this.up());\n this.listen(this, 'keydown', (e: KeyboardEvent) => (e.key === ' ' || e.key === 'Enter') && !e.repeat && this.down());\n this.listen(this, 'keyup', (e: KeyboardEvent) => (e.key === ' ' || e.key === 'Enter') && this.up());\n }\n\n unmount(): void {\n this._anim?.cancel();\n this._anim = null;\n this._down = false;\n }\n },\n { id: 'press', text: css }\n );\n}\n","import { defineElement, type UsaElement } from '../base';\nimport css from './toggle.css?raw';\n\n/**\n * `<usa-toggle>` — an accessible switch whose knob stretches while pressed\n * and glides across (the Windows 11 / iOS toggle). `role=\"switch\"`,\n * keyboard (Space / Enter), and form-associated where `ElementInternals`\n * exists (submits `value`, default `\"on\"`, under `name` when checked).\n *\n * Attributes: `checked`, `disabled`, `name`, `value`, `label`\n * (accessible name if there is no `aria-label` / `<label>`). Events:\n * `change` and `usa:change` (`detail.checked`). Reduced motion: no glide.\n */\nexport interface UsaToggleElement extends UsaElement {\n checked: boolean;\n disabled: boolean;\n toggle(force?: boolean): void;\n}\n\nexport function defineToggle(tag = 'usa-toggle'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaToggle extends Base {\n static formAssociated = true;\n static get observedAttributes(): string[] {\n return ['checked', 'disabled', 'label'];\n }\n\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n try {\n this._internals = typeof (this as any).attachInternals === 'function' ? (this as any).attachInternals() : null;\n } catch {\n this._internals = null;\n }\n }\n\n get checked(): boolean {\n return this.hasAttribute('checked');\n }\n set checked(v: boolean) {\n this.toggleAttribute('checked', !!v);\n }\n get disabled(): boolean {\n return this.hasAttribute('disabled');\n }\n set disabled(v: boolean) {\n this.toggleAttribute('disabled', !!v);\n }\n\n changed(): void {\n this.sync();\n }\n\n private sync(): void {\n this.setAttribute('aria-checked', String(this.checked));\n this.setAttribute('aria-disabled', String(this.disabled));\n this.tabIndex = this.disabled ? -1 : 0;\n const label = this.getAttribute('label');\n if (label && !this.hasAttribute('aria-label')) this.setAttribute('aria-label', label);\n this._internals?.setFormValue?.(this.checked ? this.str('value', 'on') : null);\n }\n\n mount(): void {\n if (!this.querySelector(':scope > .usa-toggle-track')) {\n const track = document.createElement('span');\n track.className = 'usa-toggle-track';\n track.setAttribute('aria-hidden', 'true');\n const knob = document.createElement('span');\n knob.className = 'usa-toggle-knob';\n track.append(knob);\n this.prepend(track);\n }\n this.setAttribute('role', 'switch');\n this.sync();\n this.listen(this, 'click', () => this.toggle());\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n if (!e.repeat) this.toggle();\n }\n });\n this.listen(this, 'pointerdown', () => !this.disabled && this.setAttribute('data-pressed', ''));\n for (const t of ['pointerup', 'pointerleave', 'pointercancel']) this.listen(this, t, () => this.removeAttribute('data-pressed'));\n }\n\n toggle(force?: boolean): void {\n if (this.disabled) return;\n const next = force === undefined ? !this.checked : force;\n if (next === this.checked) return;\n this.checked = next;\n this.sync();\n this.dispatchEvent(new Event('change', { bubbles: true }));\n this.emit('change', { checked: next });\n }\n },\n { id: 'toggle', text: css }\n );\n}\n","/**\n * use-scroll-animate/components/interaction — micro-interactions.\n * `<usa-ripple>`, `<usa-magnetic>`, `<usa-tilt>`, `<usa-spotlight>`,\n * `<usa-press>`, `<usa-toggle>`.\n */\nimport { defineRipple, type UsaRippleElement } from './ripple';\nimport { defineMagnetic, type UsaMagneticElement } from './magnetic';\nimport { defineTilt, type UsaTiltElement } from './tilt';\nimport { defineSpotlight, type UsaSpotlightElement } from './spotlight';\nimport { definePress, type UsaPressElement } from './press';\nimport { defineToggle, type UsaToggleElement } from './toggle';\n\nexport { defineRipple, defineMagnetic, defineTilt, defineSpotlight, definePress, defineToggle };\nexport type { UsaRippleElement, UsaMagneticElement, UsaTiltElement, UsaSpotlightElement, UsaPressElement, UsaToggleElement };\n\n/** Register every component of this category under its default tag. */\nexport function defineInteractionComponents(): void {\n defineRipple();\n defineMagnetic();\n defineTilt();\n defineSpotlight();\n definePress();\n defineToggle();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-ripple': UsaRippleElement;\n 'usa-magnetic': UsaMagneticElement;\n 'usa-tilt': UsaTiltElement;\n 'usa-spotlight': UsaSpotlightElement;\n 'usa-press': UsaPressElement;\n 'usa-toggle': UsaToggleElement;\n }\n}\n"],"names":["css"],"mappings":";;;;AAgBM,SAAU,YAAY,CAAC,GAAG,GAAG,YAAY,EAAA;AAC7C,IAAA,OAAO,aAAa,CAClB,GAAG,EACH,CAAC,IAAI,KACH,MAAM,SAAU,SAAQ,IAAI,CAAA;AAC1B,QAAA,WAAW,kBAAkB,GAAA;AAC3B,YAAA,OAAO,EAAE;QACX;QAEA,KAAK,GAAA;YACH,IAAI,CAAC,M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AAE;AACjB,IAAA,WAAW,EAAE;AACb,IAAA,YAAY,EAAE;AAChB;;;;"}
1
+ {"version":3,"file":"interaction.js","sources":["../../src/components/interaction/ripple.ts","../../src/components/interaction/magnetic.ts","../../src/components/interaction/tilt.ts","../../src/components/interaction/spotlight.ts","../../src/components/interaction/press.ts","../../src/components/interaction/toggle.ts","../../src/components/interaction/index.ts"],"sourcesContent":["import { defineElement, EASE_OUT, type UsaElement } from '../base';\nimport css from './ripple.css?raw';\n\n/**\n * `<usa-ripple>` — an ink ripple from the pointer (or the centre, for\n * keyboard presses) on whatever it wraps: buttons, list items, cards.\n *\n * Attributes: `color` (default `currentColor`), `opacity` (0.22),\n * `duration` (ms, 550), `centered`, `disabled`. Clips its content to its\n * own border radius. Reduced motion: a brief highlight instead of the wave.\n */\nexport interface UsaRippleElement extends UsaElement {\n /** Spawn a ripple at client coordinates (default: centre). */\n ripple(x?: number, y?: number): void;\n}\n\nexport function defineRipple(tag = 'usa-ripple'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaRipple extends Base {\n static get observedAttributes(): string[] {\n return [];\n }\n\n mount(): void {\n this.listen(this, 'pointerdown', (e: PointerEvent) => {\n if (e.button !== 0 && e.pointerType === 'mouse') return;\n this.ripple(e.clientX, e.clientY);\n });\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !e.repeat) this.ripple();\n });\n }\n\n ripple(x?: number, y?: number): void {\n if (this.flag('disabled')) return;\n const r = this.getBoundingClientRect();\n const centered = this.flag('centered') || x === undefined || y === undefined;\n const cx = centered ? r.width / 2 : (x as number) - r.left;\n const cy = centered ? r.height / 2 : (y as number) - r.top;\n const radius = Math.hypot(Math.max(cx, r.width - cx), Math.max(cy, r.height - cy));\n const wave = document.createElement('span');\n wave.className = 'usa-ripple-wave';\n wave.setAttribute('aria-hidden', 'true');\n const size = radius * 2;\n wave.style.cssText = `width:${size}px;height:${size}px;left:${cx - radius}px;top:${cy - radius}px;background:${this.str('color', 'currentColor')}`;\n this.append(wave);\n const opacity = this.num('opacity', 0.22);\n const duration = this.num('duration', 550);\n const frames = this.reduced\n ? [{ opacity }, { opacity: 0 }]\n : [\n { transform: 'scale(0)', opacity },\n { transform: 'scale(1)', opacity, offset: 0.7 },\n { transform: 'scale(1)', opacity: 0 },\n ];\n const a = this.motion(wave, frames, { duration: this.reduced ? 300 : duration, easing: EASE_OUT, fill: 'forwards' });\n if (a) a.onfinish = () => wave.remove();\n else setTimeout(() => wave.remove(), 0);\n }\n },\n { id: 'ripple', text: css }\n );\n}\n","import { defineElement, raf, caf, type UsaElement } from '../base';\nimport css from './magnetic.css?raw';\n\n/**\n * `<usa-magnetic>` — its content leans toward the pointer when the pointer\n * comes near, and springs back when it leaves (great for CTAs and icons).\n *\n * Attributes: `strength` (0–1 share of the pointer offset, 0.35), `radius`\n * (px of attraction beyond the element's edge, 60), `disabled`. Only on\n * devices with a fine pointer that hovers; off under reduced motion.\n * Writes one `transform` per frame through `--usa-mx` / `--usa-my`.\n */\nexport type UsaMagneticElement = UsaElement;\n\nexport function defineMagnetic(tag = 'usa-magnetic'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaMagnetic extends Base {\n static get observedAttributes(): string[] {\n return ['strength', 'radius', 'disabled'];\n }\n\n private _frame = 0;\n\n mount(): void {\n if (this.reduced || this.flag('disabled')) return;\n if (typeof matchMedia === 'function' && !matchMedia('(hover: hover) and (pointer: fine)').matches) return;\n const strength = this.num('strength', 0.35);\n const radius = this.num('radius', 60);\n let x = 0;\n let y = 0;\n let active = false;\n const apply = () => {\n this._frame = 0;\n const r = this.getBoundingClientRect();\n const dx = x - (r.left + r.width / 2);\n const dy = y - (r.top + r.height / 2);\n const near = Math.abs(dx) < r.width / 2 + radius && Math.abs(dy) < r.height / 2 + radius;\n if (near) {\n active = true;\n this.setAttribute('data-active', '');\n this.style.setProperty('--usa-mx', `${(dx * strength).toFixed(2)}px`);\n this.style.setProperty('--usa-my', `${(dy * strength).toFixed(2)}px`);\n } else if (active) this.release();\n };\n this.listen(\n document,\n 'pointermove',\n (e: PointerEvent) => {\n if (e.pointerType !== 'mouse' && e.pointerType !== 'pen') return;\n x = e.clientX;\n y = e.clientY;\n if (!this._frame) this._frame = raf(apply);\n },\n { passive: true }\n );\n this.listen(document, 'pointerleave', () => this.release());\n this.listen(window, 'blur', () => this.release());\n }\n\n private release(): void {\n this.removeAttribute('data-active');\n this.style.removeProperty('--usa-mx');\n this.style.removeProperty('--usa-my');\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n this.release();\n }\n },\n { id: 'magnetic', text: css }\n );\n}\n","import { defineElement, raf, caf, clamp, type UsaElement } from '../base';\nimport css from './tilt.css?raw';\n\n/**\n * `<usa-tilt>` — a 3D card that tilts toward the pointer, with an optional\n * glare highlight that follows it.\n *\n * Attributes: `max` (deg, 10), `scale` (1.03 while hovered), `perspective`\n * (px, 900), `glare` (add the light reflection), `reverse` (tilt away),\n * `disabled`. Off under reduced motion. Exposes `--usa-tilt-x` /\n * `--usa-tilt-y` (−1…1) for parallax layers inside the card.\n */\nexport type UsaTiltElement = UsaElement;\n\nexport function defineTilt(tag = 'usa-tilt'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaTilt extends Base {\n static get observedAttributes(): string[] {\n return ['max', 'scale', 'perspective', 'glare', 'reverse', 'disabled'];\n }\n\n private _frame = 0;\n private _glare: HTMLElement | null = null;\n\n mount(): void {\n if (this.flag('glare') && !this._glare) {\n this._glare = document.createElement('span');\n this._glare.className = 'usa-tilt-glare';\n this._glare.setAttribute('aria-hidden', 'true');\n this.append(this._glare);\n } else if (!this.flag('glare') && this._glare) {\n this._glare.remove();\n this._glare = null;\n }\n if (this.reduced || this.flag('disabled')) return;\n const max = this.num('max', 10) * (this.flag('reverse') ? -1 : 1);\n const scale = this.num('scale', 1.03);\n const persp = this.num('perspective', 900);\n let px = 0.5;\n let py = 0.5;\n let rect: DOMRect | null = null;\n const apply = () => {\n this._frame = 0;\n const nx = clamp(px * 2 - 1, -1, 1);\n const ny = clamp(py * 2 - 1, -1, 1);\n this.style.transform = `perspective(${persp}px) rotateX(${(-ny * max).toFixed(2)}deg) rotateY(${(nx * max).toFixed(2)}deg) scale(${scale})`;\n this.style.setProperty('--usa-tilt-x', nx.toFixed(3));\n this.style.setProperty('--usa-tilt-y', ny.toFixed(3));\n this.style.setProperty('--usa-glare-x', `${(px * 100).toFixed(1)}%`);\n this.style.setProperty('--usa-glare-y', `${(py * 100).toFixed(1)}%`);\n };\n this.listen(this, 'pointerenter', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n rect = this.getBoundingClientRect();\n this.setAttribute('data-active', '');\n });\n this.listen(this, 'pointermove', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n rect = rect || this.getBoundingClientRect();\n px = (e.clientX - rect.left) / (rect.width || 1);\n py = (e.clientY - rect.top) / (rect.height || 1);\n if (!this._frame) this._frame = raf(apply);\n });\n this.listen(this, 'pointerleave', () => this.reset());\n }\n\n private reset(): void {\n caf(this._frame);\n this._frame = 0;\n this.removeAttribute('data-active');\n this.style.transform = '';\n this.style.setProperty('--usa-tilt-x', '0');\n this.style.setProperty('--usa-tilt-y', '0');\n }\n\n unmount(): void {\n this.reset();\n }\n },\n { id: 'tilt', text: css }\n );\n}\n","import { defineElement, raf, caf, type UsaElement } from '../base';\nimport css from './spotlight.css?raw';\n\n/**\n * `<usa-spotlight>` — the Windows Fluent \"Reveal highlight\": a soft light\n * follows the pointer across a group of items, lighting up their borders\n * (even of neighbours) and the background of the hovered one. Put buttons,\n * tiles or menu items inside; each direct child is an item (or mark items\n * with `data-spotlight` to pick them yourself).\n *\n * Attributes: `size` (px, radius of the light, 160), `color` (default a\n * translucent white), `border` (px width of the lit border, 1),\n * `no-fill` (only light the borders). Not a motion effect, so it stays on\n * under reduced motion; off on touch-only devices.\n */\nexport type UsaSpotlightElement = UsaElement;\n\nexport function defineSpotlight(tag = 'usa-spotlight'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaSpotlight extends Base {\n static get observedAttributes(): string[] {\n return ['size', 'color', 'border'];\n }\n\n private _frame = 0;\n\n private items(): HTMLElement[] {\n const marked = Array.from(this.querySelectorAll<HTMLElement>('[data-spotlight]'));\n const items = marked.length ? marked : (Array.from(this.children) as HTMLElement[]);\n items.forEach((el) => el.classList.add('usa-spotlight-item'));\n return items;\n }\n\n mount(): void {\n const size = this.getAttribute('size');\n if (size) this.style.setProperty('--usa-spot-size', `${Number(size)}px`);\n const color = this.getAttribute('color');\n if (color) this.style.setProperty('--usa-spot-color', color);\n const border = this.getAttribute('border');\n if (border) this.style.setProperty('--usa-spot-border', `${Number(border)}px`);\n let items = this.items();\n let x = 0;\n let y = 0;\n const apply = () => {\n this._frame = 0;\n // All reads, then all writes\n const rects = items.map((el) => el.getBoundingClientRect());\n rects.forEach((r, i) => {\n items[i].style.setProperty('--usa-spot-x', `${(x - r.left).toFixed(1)}px`);\n items[i].style.setProperty('--usa-spot-y', `${(y - r.top).toFixed(1)}px`);\n });\n };\n this.listen(this, 'pointerenter', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n items = this.items();\n this.setAttribute('data-lit', '');\n });\n this.listen(this, 'pointermove', (e: PointerEvent) => {\n if (e.pointerType === 'touch') return;\n x = e.clientX;\n y = e.clientY;\n if (!this.hasAttribute('data-lit')) this.setAttribute('data-lit', '');\n if (!this._frame) this._frame = raf(apply);\n });\n this.listen(this, 'pointerleave', () => this.removeAttribute('data-lit'));\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n this.removeAttribute('data-lit');\n }\n },\n { id: 'spotlight', text: css }\n );\n}\n","import { defineElement, EASE_SPRING, type UsaElement } from '../base';\nimport css from './press.css?raw';\n\n/**\n * `<usa-press>` — tactile press feedback: content dips while pressed and\n * springs back on release (the Fluent \"pointer down\" scale), or bounces once\n * on click with `bounce`.\n *\n * Attributes: `scale` (pressed scale, 0.95), `bounce` (overshoot on\n * release), `disabled`. Works with mouse, touch, pen and Space/Enter.\n * Reduced motion: a subtle dim instead of scaling.\n */\nexport interface UsaPressElement extends UsaElement {\n readonly pressed: boolean;\n}\n\nexport function definePress(tag = 'usa-press'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaPress extends Base {\n static get observedAttributes(): string[] {\n return ['disabled'];\n }\n\n private _anim: Animation | null = null;\n private _down = false;\n\n get pressed(): boolean {\n return this._down;\n }\n\n private frame(down: boolean): Keyframe {\n if (this.reduced) return { opacity: down ? 0.7 : 1 };\n return { transform: down ? `scale(${this.num('scale', 0.95)})` : 'scale(1)' };\n }\n\n private down(): void {\n if (this._down || this.flag('disabled')) return;\n this._down = true;\n this.setAttribute('data-pressed', '');\n const from = this.currentFrame();\n this._anim?.cancel();\n this._anim = this.motion(this, [from, this.frame(true)], { duration: 120, easing: 'cubic-bezier(0.3, 0, 0.7, 1)', fill: 'forwards' });\n }\n\n private up(): void {\n if (!this._down) return;\n this._down = false;\n this.removeAttribute('data-pressed');\n const from = this.currentFrame();\n this._anim?.cancel();\n const frames: Keyframe[] =\n this.flag('bounce') && !this.reduced\n ? [from, { transform: 'scale(1.06)', offset: 0.45 }, { transform: 'scale(0.99)', offset: 0.75 }, this.frame(false)]\n : [from, this.frame(false)];\n const a = this.motion(this, frames, { duration: this.flag('bounce') ? 480 : 320, easing: EASE_SPRING });\n this._anim = a;\n if (a) a.onfinish = () => this._anim === a && (this._anim = null);\n }\n\n private currentFrame(): Keyframe {\n if (typeof getComputedStyle !== 'function') return this.frame(false);\n const cs = getComputedStyle(this);\n return this.reduced ? { opacity: cs.opacity || '1' } : { transform: cs.transform && cs.transform !== 'none' ? cs.transform : 'scale(1)' };\n }\n\n mount(): void {\n this.listen(this, 'pointerdown', (e: PointerEvent) => {\n if (e.pointerType === 'mouse' && e.button !== 0) return;\n this.down();\n });\n for (const t of ['pointerup', 'pointerleave', 'pointercancel', 'blur']) this.listen(this, t, () => this.up());\n this.listen(this, 'keydown', (e: KeyboardEvent) => (e.key === ' ' || e.key === 'Enter') && !e.repeat && this.down());\n this.listen(this, 'keyup', (e: KeyboardEvent) => (e.key === ' ' || e.key === 'Enter') && this.up());\n }\n\n unmount(): void {\n this._anim?.cancel();\n this._anim = null;\n this._down = false;\n }\n },\n { id: 'press', text: css }\n );\n}\n","import { defineElement, type UsaElement } from '../base';\nimport css from './toggle.css?raw';\n\n/**\n * `<usa-toggle>` — an accessible switch whose knob stretches while pressed\n * and glides across (the Windows 11 / iOS toggle). `role=\"switch\"`,\n * keyboard (Space / Enter), and form-associated where `ElementInternals`\n * exists (submits `value`, default `\"on\"`, under `name` when checked).\n *\n * Attributes: `checked`, `disabled`, `name`, `value`, `label`\n * (accessible name if there is no `aria-label` / `<label>`). Events:\n * `change` and `usa:change` (`detail.checked`). Reduced motion: no glide.\n */\nexport interface UsaToggleElement extends UsaElement {\n checked: boolean;\n disabled: boolean;\n toggle(force?: boolean): void;\n}\n\nexport function defineToggle(tag = 'usa-toggle'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaToggle extends Base {\n static formAssociated = true;\n static get observedAttributes(): string[] {\n return ['checked', 'disabled', 'label'];\n }\n\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n try {\n this._internals = typeof (this as any).attachInternals === 'function' ? (this as any).attachInternals() : null;\n } catch {\n this._internals = null;\n }\n }\n\n get checked(): boolean {\n return this.hasAttribute('checked');\n }\n set checked(v: boolean) {\n this.toggleAttribute('checked', !!v);\n }\n get disabled(): boolean {\n return this.hasAttribute('disabled');\n }\n set disabled(v: boolean) {\n this.toggleAttribute('disabled', !!v);\n }\n\n changed(): void {\n this.sync();\n }\n\n private sync(): void {\n this.setAttribute('aria-checked', String(this.checked));\n this.setAttribute('aria-disabled', String(this.disabled));\n this.tabIndex = this.disabled ? -1 : 0;\n const label = this.getAttribute('label');\n if (label && !this.hasAttribute('aria-label')) this.setAttribute('aria-label', label);\n this._internals?.setFormValue?.(this.checked ? this.str('value', 'on') : null);\n }\n\n mount(): void {\n if (!this.querySelector(':scope > .usa-toggle-track')) {\n const track = document.createElement('span');\n track.className = 'usa-toggle-track';\n track.setAttribute('aria-hidden', 'true');\n const knob = document.createElement('span');\n knob.className = 'usa-toggle-knob';\n track.append(knob);\n this.prepend(track);\n }\n this.setAttribute('role', 'switch');\n this.sync();\n this.listen(this, 'click', () => this.toggle());\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n if (!e.repeat) this.toggle();\n }\n });\n this.listen(this, 'pointerdown', () => !this.disabled && this.setAttribute('data-pressed', ''));\n for (const t of ['pointerup', 'pointerleave', 'pointercancel']) this.listen(this, t, () => this.removeAttribute('data-pressed'));\n }\n\n toggle(force?: boolean): void {\n if (this.disabled) return;\n const next = force === undefined ? !this.checked : force;\n if (next === this.checked) return;\n this.checked = next;\n this.sync();\n this.dispatchEvent(new Event('change', { bubbles: true }));\n this.emit('change', { checked: next });\n }\n },\n { id: 'toggle', text: css }\n );\n}\n","/**\n * motionary/components/interaction — micro-interactions.\n * `<usa-ripple>`, `<usa-magnetic>`, `<usa-tilt>`, `<usa-spotlight>`,\n * `<usa-press>`, `<usa-toggle>`.\n */\nimport { defineRipple, type UsaRippleElement } from './ripple';\nimport { defineMagnetic, type UsaMagneticElement } from './magnetic';\nimport { defineTilt, type UsaTiltElement } from './tilt';\nimport { defineSpotlight, type UsaSpotlightElement } from './spotlight';\nimport { definePress, type UsaPressElement } from './press';\nimport { defineToggle, type UsaToggleElement } from './toggle';\n\nexport { defineRipple, defineMagnetic, defineTilt, defineSpotlight, definePress, defineToggle };\nexport type { UsaRippleElement, UsaMagneticElement, UsaTiltElement, UsaSpotlightElement, UsaPressElement, UsaToggleElement };\n\n/** Register every component of this category under its default tag. */\nexport function defineInteractionComponents(): void {\n defineRipple();\n defineMagnetic();\n defineTilt();\n defineSpotlight();\n definePress();\n defineToggle();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-ripple': UsaRippleElement;\n 'usa-magnetic': UsaMagneticElement;\n 'usa-tilt': UsaTiltElement;\n 'usa-spotlight': UsaSpotlightElement;\n 'usa-press': UsaPressElement;\n 'usa-toggle': UsaToggleElement;\n }\n}\n"],"names":["css"],"mappings":";;;;AAgBM,SAAU,YAAY,CAAC,GAAG,GAAG,YAAY,EAAA;AAC7C,IAAA,OAAO,aAAa,CAClB,GAAG,EACH,CAAC,IAAI,KACH,MAAM,SAAU,SAAQ,IAAI,CAAA;AAC1B,QAAA,WAAW,kBAAkB,GAAA;AAC3B,YAAA,OAAO,EAAE;QACX;QAEA,KAAK,GAAA;YACH,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC,CAAe,KAAI;gBACnD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,KAAK,OAAO;oBAAE;gBACjD,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC;AACnC,YAAA,CAAC,CAAC;YACF,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAgB,KAAI;AAChD,gBAAA,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM;oBAAE,IAAI,CAAC,MAAM,EAAE;AACtE,YAAA,CAAC,CAAC;QACJ;QAEA,MAAM,CAAC,CAAU,EAAE,CAAU,EAAA;AAC3B,YAAA,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;gBAAE;AAC3B,YAAA,MAAM,CAAC,GAAG,IAAI,CAAC,qBAAqB,EAAE;AACtC,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,SAAS,IAAI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,EAAE;AACX,gBAAA,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC1D,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YACxC;AACD,SAAA;AA1EQ,QAAA,EAAA,CAAA,cAAc,GAAG,IAAK;aA0E9B,EACH,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,CAC5B;AACH;;ACrGA;;;;AAIG;AAWH;SACgB,2BAA2B,GAAA;AACzC,IAAA,YAAY,EAAE;AACd,IAAA,cAAc,EAAE;AAChB,IAAA,UAAU,EAAE;AACZ,IAAA,eAAe,EAAE;AACjB,IAAA,WAAW,EAAE;AACb,IAAA,YAAY,EAAE;AAChB;;;;"}
@@ -22,11 +22,11 @@ declare const COMPONENT_CATEGORIES: {
22
22
  };
23
23
 
24
24
  /**
25
- * use-scroll-animate/components/jsx — JSX typings for the raw `<usa-*>` tags (v2.9).
25
+ * motionary/components/jsx — JSX typings for the raw `<usa-*>` tags (v2.9).
26
26
  *
27
27
  * ```ts
28
28
  * // src/usa-jsx.d.ts (React 18/19)
29
- * import type { UsaIntrinsicElements } from 'use-scroll-animate/components/jsx';
29
+ * import type { UsaIntrinsicElements } from 'motionary/components/jsx';
30
30
  * declare module 'react' { namespace JSX { interface IntrinsicElements extends UsaIntrinsicElements {} } }
31
31
  * // Solid / Preact / other JSX: extend their JSX.IntrinsicElements the same way.
32
32
  * ```
@@ -22,11 +22,11 @@ declare const COMPONENT_CATEGORIES: {
22
22
  };
23
23
 
24
24
  /**
25
- * use-scroll-animate/components/jsx — JSX typings for the raw `<usa-*>` tags (v2.9).
25
+ * motionary/components/jsx — JSX typings for the raw `<usa-*>` tags (v2.9).
26
26
  *
27
27
  * ```ts
28
28
  * // src/usa-jsx.d.ts (React 18/19)
29
- * import type { UsaIntrinsicElements } from 'use-scroll-animate/components/jsx';
29
+ * import type { UsaIntrinsicElements } from 'motionary/components/jsx';
30
30
  * declare module 'react' { namespace JSX { interface IntrinsicElements extends UsaIntrinsicElements {} } }
31
31
  * // Solid / Preact / other JSX: extend their JSX.IntrinsicElements the same way.
32
32
  * ```
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var base = require('../chunks/base-B5i8qQPR.cjs');
3
+ var base = require('../chunks/base-BaQV-2ha.cjs');
4
4
 
5
5
  /** FLIP keyframes from a previous box to the current one (pure). */
6
6
  function flipFrames(from, to, scale = true) {
@@ -236,7 +236,7 @@ function defineMasonry(tag = 'usa-masonry') {
236
236
  }
237
237
 
238
238
  /**
239
- * use-scroll-animate/components/layout — layout animation (v3.6).
239
+ * motionary/components/layout — layout animation (v3.6).
240
240
  * `autoAnimate()` / `<usa-auto-animate>` (list & grid reflow),
241
241
  * `<usa-masonry>`, and `sharedTransition()` for shared-element transitions
242
242
  * (View Transitions API with a FLIP fallback).