motionary 0.0.0-stage → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/CHANGELOG.md +803 -0
  2. package/LICENSE +21 -0
  3. package/README.md +218 -2
  4. package/README_ja.md +219 -0
  5. package/README_zh.md +219 -0
  6. package/bin/usa-codemod-5.mjs +79 -0
  7. package/bin/usa-codemod-6.mjs +146 -0
  8. package/dist/chunks/base-BaQV-2ha.cjs +436 -0
  9. package/dist/chunks/base-BaQV-2ha.cjs.map +1 -0
  10. package/dist/chunks/base-C_3cAoRz.js +404 -0
  11. package/dist/chunks/base-C_3cAoRz.js.map +1 -0
  12. package/dist/chunks/bind-B_CTL6Qn.js +22 -0
  13. package/dist/chunks/bind-B_CTL6Qn.js.map +1 -0
  14. package/dist/chunks/bind-Ui43-n2d.cjs +25 -0
  15. package/dist/chunks/bind-Ui43-n2d.cjs.map +1 -0
  16. package/dist/chunks/core-B5T0dhFH.cjs +920 -0
  17. package/dist/chunks/core-B5T0dhFH.cjs.map +1 -0
  18. package/dist/chunks/core-BGAyaY6L.cjs +265 -0
  19. package/dist/chunks/core-BGAyaY6L.cjs.map +1 -0
  20. package/dist/chunks/core-D7cVumUu.js +909 -0
  21. package/dist/chunks/core-D7cVumUu.js.map +1 -0
  22. package/dist/chunks/core-VEBw36QK.js +260 -0
  23. package/dist/chunks/core-VEBw36QK.js.map +1 -0
  24. package/dist/chunks/core-ps8uvYuN.js +181 -0
  25. package/dist/chunks/core-ps8uvYuN.js.map +1 -0
  26. package/dist/chunks/core-zq17EeCI.cjs +185 -0
  27. package/dist/chunks/core-zq17EeCI.cjs.map +1 -0
  28. package/dist/chunks/fx-Bs6IrV4Q.js +109 -0
  29. package/dist/chunks/fx-Bs6IrV4Q.js.map +1 -0
  30. package/dist/chunks/fx-lBGVtQO1.cjs +114 -0
  31. package/dist/chunks/fx-lBGVtQO1.cjs.map +1 -0
  32. package/dist/chunks/generative-D2YyhaeO.js +336 -0
  33. package/dist/chunks/generative-D2YyhaeO.js.map +1 -0
  34. package/dist/chunks/generative-DzIZq-_g.cjs +348 -0
  35. package/dist/chunks/generative-DzIZq-_g.cjs.map +1 -0
  36. package/dist/chunks/gpu-Bu7qwugO.js +380 -0
  37. package/dist/chunks/gpu-Bu7qwugO.js.map +1 -0
  38. package/dist/chunks/gpu-CenK2l6b.cjs +387 -0
  39. package/dist/chunks/gpu-CenK2l6b.cjs.map +1 -0
  40. package/dist/chunks/index-tags-DucKMQr_.js +26 -0
  41. package/dist/chunks/index-tags-DucKMQr_.js.map +1 -0
  42. package/dist/chunks/index-tags-wv0R_vkO.cjs +28 -0
  43. package/dist/chunks/index-tags-wv0R_vkO.cjs.map +1 -0
  44. package/dist/chunks/presets-BYBVJVeP.js +226 -0
  45. package/dist/chunks/presets-BYBVJVeP.js.map +1 -0
  46. package/dist/chunks/presets-CUHys3sK.cjs +233 -0
  47. package/dist/chunks/presets-CUHys3sK.cjs.map +1 -0
  48. package/dist/chunks/registry-CKNLQpwd.js +121 -0
  49. package/dist/chunks/registry-CKNLQpwd.js.map +1 -0
  50. package/dist/chunks/registry-DehBVRDV.cjs +131 -0
  51. package/dist/chunks/registry-DehBVRDV.cjs.map +1 -0
  52. package/dist/chunks/spring-CbvHfVtP.js +219 -0
  53. package/dist/chunks/spring-CbvHfVtP.js.map +1 -0
  54. package/dist/chunks/spring-Dgx187Vh.cjs +232 -0
  55. package/dist/chunks/spring-Dgx187Vh.cjs.map +1 -0
  56. package/dist/chunks/stagger-CCFyhzSw.cjs +86 -0
  57. package/dist/chunks/stagger-CCFyhzSw.cjs.map +1 -0
  58. package/dist/chunks/stagger-DtMKo2SK.js +84 -0
  59. package/dist/chunks/stagger-DtMKo2SK.js.map +1 -0
  60. package/dist/chunks/variants-BhjyddG8.cjs +39 -0
  61. package/dist/chunks/variants-BhjyddG8.cjs.map +1 -0
  62. package/dist/chunks/variants-DRlKVHvu.js +35 -0
  63. package/dist/chunks/variants-DRlKVHvu.js.map +1 -0
  64. package/dist/components/a11y.cjs +276 -0
  65. package/dist/components/a11y.cjs.map +1 -0
  66. package/dist/components/a11y.d.cts +131 -0
  67. package/dist/components/a11y.d.ts +131 -0
  68. package/dist/components/a11y.js +259 -0
  69. package/dist/components/a11y.js.map +1 -0
  70. package/dist/components/angular.cjs +76 -0
  71. package/dist/components/angular.cjs.map +1 -0
  72. package/dist/components/angular.d.cts +1734 -0
  73. package/dist/components/angular.d.ts +1734 -0
  74. package/dist/components/angular.js +70 -0
  75. package/dist/components/angular.js.map +1 -0
  76. package/dist/components/background.cjs +659 -0
  77. package/dist/components/background.cjs.map +1 -0
  78. package/dist/components/background.css +9 -0
  79. package/dist/components/background.d.cts +166 -0
  80. package/dist/components/background.d.ts +166 -0
  81. package/dist/components/background.js +647 -0
  82. package/dist/components/background.js.map +1 -0
  83. package/dist/components/bridge.cjs +154 -0
  84. package/dist/components/bridge.cjs.map +1 -0
  85. package/dist/components/bridge.d.cts +63 -0
  86. package/dist/components/bridge.d.ts +63 -0
  87. package/dist/components/bridge.js +147 -0
  88. package/dist/components/bridge.js.map +1 -0
  89. package/dist/components/cards.cjs +561 -0
  90. package/dist/components/cards.cjs.map +1 -0
  91. package/dist/components/cards.css +6 -0
  92. package/dist/components/cards.d.cts +115 -0
  93. package/dist/components/cards.d.ts +115 -0
  94. package/dist/components/cards.js +554 -0
  95. package/dist/components/cards.js.map +1 -0
  96. package/dist/components/click.cjs +877 -0
  97. package/dist/components/click.cjs.map +1 -0
  98. package/dist/components/click.css +9 -0
  99. package/dist/components/click.d.cts +218 -0
  100. package/dist/components/click.d.ts +218 -0
  101. package/dist/components/click.js +863 -0
  102. package/dist/components/click.js.map +1 -0
  103. package/dist/components/depth.cjs +250 -0
  104. package/dist/components/depth.cjs.map +1 -0
  105. package/dist/components/depth.css +3 -0
  106. package/dist/components/depth.d.cts +86 -0
  107. package/dist/components/depth.d.ts +86 -0
  108. package/dist/components/depth.js +242 -0
  109. package/dist/components/depth.js.map +1 -0
  110. package/dist/components/effects.cjs +2258 -0
  111. package/dist/components/effects.cjs.map +1 -0
  112. package/dist/components/effects.d.cts +545 -0
  113. package/dist/components/effects.d.ts +545 -0
  114. package/dist/components/effects.js +2200 -0
  115. package/dist/components/effects.js.map +1 -0
  116. package/dist/components/feedback.cjs +442 -0
  117. package/dist/components/feedback.cjs.map +1 -0
  118. package/dist/components/feedback.css +7 -0
  119. package/dist/components/feedback.d.cts +144 -0
  120. package/dist/components/feedback.d.ts +144 -0
  121. package/dist/components/feedback.js +433 -0
  122. package/dist/components/feedback.js.map +1 -0
  123. package/dist/components/fx-gpu.cjs +12 -0
  124. package/dist/components/fx-gpu.cjs.map +1 -0
  125. package/dist/components/fx-gpu.d.cts +63 -0
  126. package/dist/components/fx-gpu.d.ts +63 -0
  127. package/dist/components/fx-gpu.js +5 -0
  128. package/dist/components/fx-gpu.js.map +1 -0
  129. package/dist/components/fx.cjs +169 -0
  130. package/dist/components/fx.cjs.map +1 -0
  131. package/dist/components/fx.css +3 -0
  132. package/dist/components/fx.d.cts +114 -0
  133. package/dist/components/fx.d.ts +114 -0
  134. package/dist/components/fx.js +156 -0
  135. package/dist/components/fx.js.map +1 -0
  136. package/dist/components/fx2.cjs +25 -0
  137. package/dist/components/fx2.cjs.map +1 -0
  138. package/dist/components/fx2.d.cts +136 -0
  139. package/dist/components/fx2.d.ts +136 -0
  140. package/dist/components/fx2.js +17 -0
  141. package/dist/components/fx2.js.map +1 -0
  142. package/dist/components/gesture.cjs +209 -0
  143. package/dist/components/gesture.cjs.map +1 -0
  144. package/dist/components/gesture.css +3 -0
  145. package/dist/components/gesture.d.cts +134 -0
  146. package/dist/components/gesture.d.ts +134 -0
  147. package/dist/components/gesture.js +203 -0
  148. package/dist/components/gesture.js.map +1 -0
  149. package/dist/components/interaction.cjs +424 -0
  150. package/dist/components/interaction.cjs.map +1 -0
  151. package/dist/components/interaction.css +8 -0
  152. package/dist/components/interaction.d.cts +115 -0
  153. package/dist/components/interaction.d.ts +115 -0
  154. package/dist/components/interaction.js +416 -0
  155. package/dist/components/interaction.js.map +1 -0
  156. package/dist/components/jsx.cjs +3 -0
  157. package/dist/components/jsx.cjs.map +1 -0
  158. package/dist/components/jsx.d.cts +53 -0
  159. package/dist/components/jsx.d.ts +53 -0
  160. package/dist/components/jsx.js +2 -0
  161. package/dist/components/jsx.js.map +1 -0
  162. package/dist/components/layout.cjs +257 -0
  163. package/dist/components/layout.cjs.map +1 -0
  164. package/dist/components/layout.css +3 -0
  165. package/dist/components/layout.d.cts +99 -0
  166. package/dist/components/layout.d.ts +99 -0
  167. package/dist/components/layout.js +249 -0
  168. package/dist/components/layout.js.map +1 -0
  169. package/dist/components/lazy.cjs +92 -0
  170. package/dist/components/lazy.cjs.map +1 -0
  171. package/dist/components/lazy.d.cts +48 -0
  172. package/dist/components/lazy.d.ts +48 -0
  173. package/dist/components/lazy.js +87 -0
  174. package/dist/components/lazy.js.map +1 -0
  175. package/dist/components/lite.cjs +11095 -0
  176. package/dist/components/lite.cjs.map +1 -0
  177. package/dist/components/lite.d.cts +4 -0
  178. package/dist/components/lite.d.ts +4 -0
  179. package/dist/components/lite.js +10827 -0
  180. package/dist/components/lite.js.map +1 -0
  181. package/dist/components/packs.cjs +192 -0
  182. package/dist/components/packs.cjs.map +1 -0
  183. package/dist/components/packs.css +3 -0
  184. package/dist/components/packs.d.cts +72 -0
  185. package/dist/components/packs.d.ts +72 -0
  186. package/dist/components/packs.js +184 -0
  187. package/dist/components/packs.js.map +1 -0
  188. package/dist/components/page.cjs +824 -0
  189. package/dist/components/page.cjs.map +1 -0
  190. package/dist/components/page.css +11 -0
  191. package/dist/components/page.d.cts +249 -0
  192. package/dist/components/page.d.ts +249 -0
  193. package/dist/components/page.js +799 -0
  194. package/dist/components/page.js.map +1 -0
  195. package/dist/components/perf.cjs +120 -0
  196. package/dist/components/perf.cjs.map +1 -0
  197. package/dist/components/perf.d.cts +98 -0
  198. package/dist/components/perf.d.ts +98 -0
  199. package/dist/components/perf.js +110 -0
  200. package/dist/components/perf.js.map +1 -0
  201. package/dist/components/physics.cjs +448 -0
  202. package/dist/components/physics.cjs.map +1 -0
  203. package/dist/components/physics.css +5 -0
  204. package/dist/components/physics.d.cts +189 -0
  205. package/dist/components/physics.d.ts +189 -0
  206. package/dist/components/physics.js +430 -0
  207. package/dist/components/physics.js.map +1 -0
  208. package/dist/components/react.cjs +96 -0
  209. package/dist/components/react.cjs.map +1 -0
  210. package/dist/components/react.d.cts +18 -0
  211. package/dist/components/react.d.ts +18 -0
  212. package/dist/components/react.js +91 -0
  213. package/dist/components/react.js.map +1 -0
  214. package/dist/components/reveal.cjs +362 -0
  215. package/dist/components/reveal.cjs.map +1 -0
  216. package/dist/components/reveal.css +5 -0
  217. package/dist/components/reveal.d.cts +105 -0
  218. package/dist/components/reveal.d.ts +105 -0
  219. package/dist/components/reveal.js +353 -0
  220. package/dist/components/reveal.js.map +1 -0
  221. package/dist/components/solid.cjs +86 -0
  222. package/dist/components/solid.cjs.map +1 -0
  223. package/dist/components/solid.d.cts +1751 -0
  224. package/dist/components/solid.d.ts +1751 -0
  225. package/dist/components/solid.js +82 -0
  226. package/dist/components/solid.js.map +1 -0
  227. package/dist/components/svelte.cjs +68 -0
  228. package/dist/components/svelte.cjs.map +1 -0
  229. package/dist/components/svelte.d.cts +1733 -0
  230. package/dist/components/svelte.d.ts +1733 -0
  231. package/dist/components/svelte.js +64 -0
  232. package/dist/components/svelte.js.map +1 -0
  233. package/dist/components/svg.cjs +359 -0
  234. package/dist/components/svg.cjs.map +1 -0
  235. package/dist/components/svg.css +3 -0
  236. package/dist/components/svg.d.cts +113 -0
  237. package/dist/components/svg.d.ts +113 -0
  238. package/dist/components/svg.js +347 -0
  239. package/dist/components/svg.js.map +1 -0
  240. package/dist/components/text.cjs +968 -0
  241. package/dist/components/text.cjs.map +1 -0
  242. package/dist/components/text.css +8 -0
  243. package/dist/components/text.d.cts +342 -0
  244. package/dist/components/text.d.ts +342 -0
  245. package/dist/components/text.js +947 -0
  246. package/dist/components/text.js.map +1 -0
  247. package/dist/components/timeline.cjs +109 -0
  248. package/dist/components/timeline.cjs.map +1 -0
  249. package/dist/components/timeline.css +3 -0
  250. package/dist/components/timeline.d.cts +155 -0
  251. package/dist/components/timeline.d.ts +155 -0
  252. package/dist/components/timeline.js +103 -0
  253. package/dist/components/timeline.js.map +1 -0
  254. package/dist/components/tokens.cjs +226 -0
  255. package/dist/components/tokens.cjs.map +1 -0
  256. package/dist/components/tokens.d.cts +74 -0
  257. package/dist/components/tokens.d.ts +74 -0
  258. package/dist/components/tokens.js +211 -0
  259. package/dist/components/tokens.js.map +1 -0
  260. package/dist/components/transitions.cjs +430 -0
  261. package/dist/components/transitions.cjs.map +1 -0
  262. package/dist/components/transitions.css +5 -0
  263. package/dist/components/transitions.d.cts +126 -0
  264. package/dist/components/transitions.d.ts +126 -0
  265. package/dist/components/transitions.js +423 -0
  266. package/dist/components/transitions.js.map +1 -0
  267. package/dist/components/ui.cjs +1050 -0
  268. package/dist/components/ui.cjs.map +1 -0
  269. package/dist/components/ui.css +14 -0
  270. package/dist/components/ui.d.cts +224 -0
  271. package/dist/components/ui.d.ts +224 -0
  272. package/dist/components/ui.js +1034 -0
  273. package/dist/components/ui.js.map +1 -0
  274. package/dist/components/vue.cjs +67 -0
  275. package/dist/components/vue.cjs.map +1 -0
  276. package/dist/components/vue.d.cts +1722 -0
  277. package/dist/components/vue.d.ts +1722 -0
  278. package/dist/components/vue.js +64 -0
  279. package/dist/components/vue.js.map +1 -0
  280. package/dist/components/webgl.cjs +459 -0
  281. package/dist/components/webgl.cjs.map +1 -0
  282. package/dist/components/webgl.css +3 -0
  283. package/dist/components/webgl.d.cts +133 -0
  284. package/dist/components/webgl.d.ts +133 -0
  285. package/dist/components/webgl.js +442 -0
  286. package/dist/components/webgl.js.map +1 -0
  287. package/dist/components/widgets.cjs +591 -0
  288. package/dist/components/widgets.cjs.map +1 -0
  289. package/dist/components/widgets.d.cts +110 -0
  290. package/dist/components/widgets.d.ts +110 -0
  291. package/dist/components/widgets.js +581 -0
  292. package/dist/components/widgets.js.map +1 -0
  293. package/dist/components.cjs +351 -0
  294. package/dist/components.cjs.map +1 -0
  295. package/dist/components.css +75 -0
  296. package/dist/components.d.cts +2997 -0
  297. package/dist/components.d.ts +2997 -0
  298. package/dist/components.js +106 -0
  299. package/dist/components.js.map +1 -0
  300. package/dist/components.umd.js +23 -0
  301. package/dist/components.umd.js.map +1 -0
  302. package/dist/element.cjs +97 -0
  303. package/dist/element.cjs.map +1 -0
  304. package/dist/element.d.cts +215 -0
  305. package/dist/element.d.ts +215 -0
  306. package/dist/element.js +95 -0
  307. package/dist/element.js.map +1 -0
  308. package/dist/element.umd.js +2 -0
  309. package/dist/element.umd.js.map +1 -0
  310. package/dist/index.cjs +149 -0
  311. package/dist/index.cjs.map +1 -0
  312. package/dist/index.d.cts +425 -0
  313. package/dist/index.d.ts +425 -0
  314. package/dist/index.js +131 -0
  315. package/dist/index.js.map +1 -0
  316. package/dist/index.umd.js +15 -0
  317. package/dist/index.umd.js.map +1 -0
  318. package/dist/presets/extended.cjs +243 -0
  319. package/dist/presets/extended.cjs.map +1 -0
  320. package/dist/presets/extended.d.cts +37 -0
  321. package/dist/presets/extended.d.ts +37 -0
  322. package/dist/presets/extended.js +239 -0
  323. package/dist/presets/extended.js.map +1 -0
  324. package/dist/presets-extended.umd.js +2 -0
  325. package/dist/presets-extended.umd.js.map +1 -0
  326. package/dist/react.cjs +68 -0
  327. package/dist/react.cjs.map +1 -0
  328. package/dist/react.d.cts +158 -0
  329. package/dist/react.d.ts +158 -0
  330. package/dist/react.js +65 -0
  331. package/dist/react.js.map +1 -0
  332. package/dist/solid.cjs +93 -0
  333. package/dist/solid.cjs.map +1 -0
  334. package/dist/solid.d.cts +249 -0
  335. package/dist/solid.d.ts +249 -0
  336. package/dist/solid.js +89 -0
  337. package/dist/solid.js.map +1 -0
  338. package/dist/svelte.cjs +66 -0
  339. package/dist/svelte.cjs.map +1 -0
  340. package/dist/svelte.d.cts +243 -0
  341. package/dist/svelte.d.ts +243 -0
  342. package/dist/svelte.js +63 -0
  343. package/dist/svelte.js.map +1 -0
  344. package/dist/vue.cjs +62 -0
  345. package/dist/vue.cjs.map +1 -0
  346. package/dist/vue.d.cts +158 -0
  347. package/dist/vue.d.ts +158 -0
  348. package/dist/vue.js +60 -0
  349. package/dist/vue.js.map +1 -0
  350. package/dist/widgets.umd.js +2 -0
  351. package/dist/widgets.umd.js.map +1 -0
  352. package/docs/API.md +147 -0
  353. package/docs/ROADMAP.md +14 -0
  354. package/docs/accessibility.md +60 -0
  355. package/docs/components.md +564 -0
  356. package/docs/deprecations.md +30 -0
  357. package/docs/frameworks-ssr.md +100 -0
  358. package/docs/hybrid-apps.md +145 -0
  359. package/docs/images/showcase-detail.png +0 -0
  360. package/docs/images/showcase-grid.png +0 -0
  361. package/docs/images/showcase-mobile.png +0 -0
  362. package/docs/migration-from-aos.md +67 -0
  363. package/docs/migration-from-gsap-scrolltrigger.md +80 -0
  364. package/docs/motion-tokens.css +31 -0
  365. package/docs/motion-tokens.md +46 -0
  366. package/docs/motion.tokens.json +132 -0
  367. package/docs/performance.md +24 -0
  368. package/docs/presets.md +310 -0
  369. package/docs/upgrading-3.md +21 -0
  370. package/docs/upgrading-4.md +65 -0
  371. package/docs/upgrading-5.md +31 -0
  372. package/docs/upgrading-6.md +32 -0
  373. package/docs/windows-apps.md +119 -0
  374. package/package.json +562 -4
@@ -0,0 +1,799 @@
1
+ import { x as defineElement, l as caf, r as raf, p as prefersReducedMotion, q as now, i as getMotionSensitivity, h as getMotionIntensity, g as configureComponents, u as adoptStyles } from '../chunks/base-C_3cAoRz.js';
2
+ export { M as MOTION_SCALE } from '../chunks/base-C_3cAoRz.js';
3
+ import { e as springSamples } from '../chunks/spring-CbvHfVtP.js';
4
+
5
+ var css$8 = "usa-cursor{--usa-cursor-color:var(--usa-accent,#7c5cff);--usa-cursor-size:28px;position:fixed;inset:0;pointer-events:none;z-index:2147483600;opacity:0;transition:opacity 0.2s ease;contain:strict}usa-cursor[data-active]{opacity:1}usa-cursor .usa-cursor-ring{position:absolute;left:0;top:0;width:var(--usa-cursor-size);height:var(--usa-cursor-size);margin:calc(var(--usa-cursor-size) / -2) 0 0 calc(var(--usa-cursor-size) / -2);border:1.5px solid var(--usa-cursor-color);border-radius:999px;box-sizing:border-box;transition:width 0.25s cubic-bezier(0.34,1.56,0.64,1),height 0.25s cubic-bezier(0.34,1.56,0.64,1),margin 0.25s ease,border-radius 0.25s ease,background-color 0.2s ease;will-change:transform}usa-cursor[data-hover] .usa-cursor-ring:first-child{width:calc(var(--usa-cursor-size) * 1.6);height:calc(var(--usa-cursor-size) * 1.6);margin:calc(var(--usa-cursor-size) * -0.8) 0 0 calc(var(--usa-cursor-size) * -0.8);background:color-mix(in srgb,var(--usa-cursor-color) 15%,transparent)}usa-cursor[data-snapped] .usa-cursor-ring{border-radius:12px;background:color-mix(in srgb,var(--usa-cursor-color) 12%,transparent);translate:-50% -50%;margin:0}usa-cursor[data-down] .usa-cursor-ring:first-child{scale:0.8}usa-cursor .usa-cursor-dot{position:absolute;left:-3px;top:-3px;width:6px;height:6px;border-radius:50%;background:var(--usa-cursor-color)}usa-cursor[data-snapped] .usa-cursor-dot{opacity:0}usa-cursor .usa-cursor-glow{position:absolute;left:-200px;top:-200px;width:400px;height:400px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--usa-cursor-color) 35%,transparent),transparent 65%);mix-blend-mode:screen}.usa-cursor-none,.usa-cursor-none *{cursor:none !important}@media (pointer:coarse),(prefers-reduced-motion:reduce){usa-cursor{display:none}.usa-cursor-none,.usa-cursor-none *{cursor:auto !important}}";
6
+
7
+ const CURSOR_MODES = ['dot', 'magnetic', 'glow'];
8
+ function defineCursor(tag = 'usa-cursor') {
9
+ return defineElement(tag, (Base) => class UsaCursor extends Base {
10
+ constructor() {
11
+ super(...arguments);
12
+ this._frame = 0;
13
+ }
14
+ static get observedAttributes() {
15
+ return ['mode', 'size', 'color', 'hide-native'];
16
+ }
17
+ get active() {
18
+ return this.hasAttribute('data-active');
19
+ }
20
+ mount() {
21
+ this.setAttribute('aria-hidden', 'true');
22
+ const fine = typeof matchMedia !== 'function' || matchMedia('(pointer: fine)').matches || matchMedia('(hover: hover)').matches;
23
+ if (this.reduced || !fine) {
24
+ // Decorative only: never leave (focusable) content inside aria-hidden (4.4 audit).
25
+ this.replaceChildren();
26
+ return;
27
+ }
28
+ const m = this.str('mode', 'dot');
29
+ const mode = CURSOR_MODES.includes(m) ? m : 'dot';
30
+ const n = 1;
31
+ this.innerHTML = Array.from({ length: n }, (_, i) => `<span class="usa-cursor-${mode === 'glow' ? 'glow' : 'ring'}" style="--i:${i}"></span>`).join('') + (mode === 'glow' ? '' : '<span class="usa-cursor-dot"></span>');
32
+ if (this.str('color'))
33
+ this.style.setProperty('--usa-cursor-color', this.str('color'));
34
+ this.style.setProperty('--usa-cursor-size', `${this.num('size', 28)}px`);
35
+ if (this.flag('hide-native'))
36
+ document.documentElement.classList.add('usa-cursor-none');
37
+ this.onCleanup(() => document.documentElement.classList.remove('usa-cursor-none'));
38
+ const parts = Array.from(this.querySelectorAll('.usa-cursor-ring, .usa-cursor-glow'));
39
+ const dot = this.querySelector('.usa-cursor-dot');
40
+ const pts = parts.map(() => ({ x: -100, y: -100 }));
41
+ let mx = -100;
42
+ let my = -100;
43
+ let snap = null;
44
+ const sel = this.str('targets', 'a, button, [role="button"], [data-cursor], input, select, textarea, label');
45
+ const loop = () => {
46
+ this._frame = 0;
47
+ let tx = mx;
48
+ let ty = my;
49
+ pts.forEach((p, i) => {
50
+ const k = mode === 'glow' ? 0.12 : 0.22;
51
+ const goalX = snap && i === 0 ? snap.left + snap.width / 2 : tx;
52
+ const goalY = snap && i === 0 ? snap.top + snap.height / 2 : ty;
53
+ p.x += (goalX - p.x) * k;
54
+ p.y += (goalY - p.y) * k;
55
+ parts[i].style.transform = `translate3d(${p.x.toFixed(1)}px, ${p.y.toFixed(1)}px, 0)`;
56
+ tx = p.x;
57
+ ty = p.y;
58
+ });
59
+ if (snap && parts[0]) {
60
+ parts[0].style.width = `${snap.width + 12}px`;
61
+ parts[0].style.height = `${snap.height + 12}px`;
62
+ }
63
+ else if (parts[0]) {
64
+ parts[0].style.width = parts[0].style.height = '';
65
+ }
66
+ if (dot)
67
+ dot.style.transform = `translate3d(${mx}px, ${my}px, 0)`;
68
+ const moving = pts.some((p, i) => Math.abs(p.x - (i === 0 && snap ? snap.left + snap.width / 2 : mx)) > 0.3);
69
+ if (moving)
70
+ this._frame = raf(loop);
71
+ };
72
+ const kick = () => {
73
+ if (!this._frame)
74
+ this._frame = raf(loop);
75
+ };
76
+ this.listen(document, 'pointermove', (e) => {
77
+ if (e.pointerType === 'touch')
78
+ return;
79
+ mx = e.clientX;
80
+ my = e.clientY;
81
+ this.setAttribute('data-active', '');
82
+ if (mode === 'magnetic') {
83
+ const t = e.target?.closest?.(sel);
84
+ snap = t ? t.getBoundingClientRect() : null;
85
+ this.toggleAttribute('data-snapped', !!t);
86
+ }
87
+ else {
88
+ this.toggleAttribute('data-hover', !!e.target?.closest?.(sel));
89
+ }
90
+ kick();
91
+ }, { passive: true });
92
+ this.listen(document, 'pointerdown', () => this.setAttribute('data-down', ''));
93
+ this.listen(document, 'pointerup', () => this.removeAttribute('data-down'));
94
+ this.listen(document.documentElement, 'pointerleave', () => this.removeAttribute('data-active'));
95
+ }
96
+ unmount() {
97
+ caf(this._frame);
98
+ this._frame = 0;
99
+ this.removeAttribute('data-active');
100
+ }
101
+ }, { id: 'cursor', text: css$8 });
102
+ }
103
+
104
+ function smoothScroll(options = {}) {
105
+ if (typeof window === 'undefined' || prefersReducedMotion())
106
+ return () => undefined;
107
+ const el = options.target || null;
108
+ const lerp = Math.min(1, Math.max(0.02, options.lerp ?? 0.12));
109
+ const mult = options.wheelMultiplier ?? 1;
110
+ const get = () => (el ? el.scrollTop : window.scrollY);
111
+ const max = () => (el ? el.scrollHeight - el.clientHeight : document.documentElement.scrollHeight - window.innerHeight);
112
+ const set = (y) => (el ? (el.scrollTop = y) : window.scrollTo(0, y));
113
+ let target = get();
114
+ let current = target;
115
+ let id = 0;
116
+ const loop = () => {
117
+ current += (target - current) * lerp;
118
+ if (Math.abs(target - current) < 0.5)
119
+ current = target;
120
+ set(current);
121
+ id = current === target ? 0 : raf(loop);
122
+ };
123
+ const onWheel = (e) => {
124
+ if (e.ctrlKey || e.defaultPrevented)
125
+ return;
126
+ if (!id)
127
+ target = current = get();
128
+ e.preventDefault();
129
+ const dy = e.deltaMode === 1 ? e.deltaY * 16 : e.deltaMode === 2 ? e.deltaY * (window.innerHeight || 800) : e.deltaY;
130
+ target = Math.max(0, Math.min(max(), target + dy * mult));
131
+ if (!id)
132
+ id = raf(loop);
133
+ };
134
+ const onScroll = () => {
135
+ if (!id)
136
+ target = current = get();
137
+ };
138
+ const host = el || window;
139
+ host.addEventListener('wheel', onWheel, { passive: false });
140
+ host.addEventListener('scroll', onScroll, { passive: true });
141
+ return () => {
142
+ host.removeEventListener('wheel', onWheel);
143
+ host.removeEventListener('scroll', onScroll);
144
+ if (id)
145
+ caf(id);
146
+ id = 0;
147
+ };
148
+ }
149
+ /**
150
+ * Scroll to a y position, element or selector with spring timing (or
151
+ * instantly under reduced motion). Resolves when done.
152
+ */
153
+ function scrollToTarget(to, options = {}) {
154
+ if (typeof window === 'undefined')
155
+ return Promise.resolve();
156
+ const el = options.target || null;
157
+ const start = el ? el.scrollTop : window.scrollY;
158
+ let y = typeof to === 'number' ? to : 0;
159
+ if (typeof to !== 'number') {
160
+ const node = typeof to === 'string' ? document.querySelector(to) : to;
161
+ if (!node)
162
+ return Promise.resolve();
163
+ const top = node.getBoundingClientRect().top;
164
+ y = start + top - (el ? el.getBoundingClientRect().top : 0);
165
+ }
166
+ y = Math.max(0, y - (options.offset ?? 0));
167
+ const set = (v) => (el ? (el.scrollTop = v) : window.scrollTo(0, v));
168
+ if (prefersReducedMotion()) {
169
+ set(y);
170
+ return Promise.resolve();
171
+ }
172
+ const { values, duration } = springSamples(options.preset || 'slow');
173
+ const t0 = now();
174
+ return new Promise((resolve) => {
175
+ const step = () => {
176
+ const p = Math.min(1, (now() - t0) / Math.max(1, duration));
177
+ const v = values[Math.min(values.length - 1, Math.round(p * (values.length - 1)))];
178
+ set(start + (y - start) * v);
179
+ if (p < 1)
180
+ raf(step);
181
+ else
182
+ resolve();
183
+ };
184
+ raf(step);
185
+ });
186
+ }
187
+
188
+ var css$7 = "usa-fullpage{position:relative;display:block;height:100vh;height:100dvh;overflow-y:auto;scroll-snap-type:y mandatory;overscroll-behavior:contain;outline:none}usa-fullpage[axis=\"x\"]{display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory}usa-fullpage .usa-fullpage-section{box-sizing:border-box;min-height:100%;scroll-snap-align:start;scroll-snap-stop:always}usa-fullpage[axis=\"x\"] .usa-fullpage-section{flex:0 0 100%}usa-fullpage .usa-fullpage-dots{position:sticky;float:right;top:50%;margin-right:16px;transform:translateY(-50%);display:grid;gap:10px;z-index:5}usa-fullpage .usa-fullpage-dots button{width:10px;height:10px;padding:0;border-radius:50%;border:0;cursor:pointer;background:color-mix(in srgb,currentColor 35%,transparent);transition:transform 0.3s cubic-bezier(0.34,1.56,0.64,1),background-color 0.2s ease}usa-fullpage .usa-fullpage-dots button[aria-current]{background:var(--usa-accent,#7c5cff);transform:scale(1.5)}";
189
+
190
+ function defineFullpage(tag = 'usa-fullpage') {
191
+ return defineElement(tag, (Base) => class UsaFullpage extends Base {
192
+ constructor() {
193
+ super(...arguments);
194
+ this._i = 0;
195
+ }
196
+ get index() {
197
+ return this._i;
198
+ }
199
+ sections() {
200
+ return Array.from(this.children).filter((c) => !c.classList.contains('usa-fullpage-dots'));
201
+ }
202
+ mount() {
203
+ if (!this.hasAttribute('tabindex'))
204
+ this.tabIndex = 0;
205
+ const secs = this.sections();
206
+ secs.forEach((s, i) => {
207
+ s.classList.add('usa-fullpage-section');
208
+ s.setAttribute('data-index', String(i));
209
+ });
210
+ let nav = null;
211
+ if (this.flag('dots')) {
212
+ nav = document.createElement('nav');
213
+ nav.className = 'usa-fullpage-dots';
214
+ nav.setAttribute('aria-label', 'Sections');
215
+ secs.forEach((s, i) => {
216
+ const b = document.createElement('button');
217
+ b.type = 'button';
218
+ b.setAttribute('aria-label', s.getAttribute('aria-label') || s.querySelector('h1,h2,h3')?.textContent?.trim() || `Section ${i + 1}`);
219
+ b.addEventListener('click', () => this.go(i));
220
+ nav.append(b);
221
+ });
222
+ this.append(nav);
223
+ this.onCleanup(() => nav?.remove());
224
+ }
225
+ this.mark(0);
226
+ if (typeof IntersectionObserver !== 'undefined') {
227
+ const io = new IntersectionObserver((entries) => {
228
+ for (const e of entries)
229
+ if (e.isIntersecting && e.intersectionRatio >= 0.6)
230
+ this.mark(Number(e.target.dataset.index));
231
+ }, { root: this, threshold: [0.6] });
232
+ secs.forEach((s) => io.observe(s));
233
+ this.onCleanup(() => io.disconnect());
234
+ }
235
+ this.listen(this, 'keydown', (e) => {
236
+ const n = this.sections().length;
237
+ const map = { PageDown: this._i + 1, ArrowDown: this._i + 1, ' ': this._i + 1, PageUp: this._i - 1, ArrowUp: this._i - 1, Home: 0, End: n - 1 };
238
+ if (this.str('axis') === 'x')
239
+ Object.assign(map, { ArrowRight: this._i + 1, ArrowLeft: this._i - 1 });
240
+ if (!(e.key in map) || e.target.closest?.('input, textarea, select'))
241
+ return;
242
+ e.preventDefault();
243
+ this.go(map[e.key]);
244
+ });
245
+ }
246
+ mark(i) {
247
+ if (i === this._i && this.hasAttribute('data-ready'))
248
+ return;
249
+ this.setAttribute('data-ready', '');
250
+ this._i = i;
251
+ this.sections().forEach((s, j) => s.toggleAttribute('data-current', j === i));
252
+ this.querySelectorAll('.usa-fullpage-dots button').forEach((b, j) => (j === i ? b.setAttribute('aria-current', 'true') : b.removeAttribute('aria-current')));
253
+ this.emit('section', { index: i });
254
+ }
255
+ go(i) {
256
+ const secs = this.sections();
257
+ const t = secs[Math.max(0, Math.min(secs.length - 1, i))];
258
+ if (!t)
259
+ return;
260
+ if (this.str('axis') === 'x')
261
+ this.scrollTo({ left: t.offsetLeft, behavior: this.reduced ? 'auto' : 'smooth' });
262
+ else
263
+ scrollToTarget(t.offsetTop, { target: this, preset: 'stiff' });
264
+ this.mark(secs.indexOf(t));
265
+ }
266
+ next() {
267
+ this.go(this._i + 1);
268
+ }
269
+ prev() {
270
+ this.go(this._i - 1);
271
+ }
272
+ }, { id: 'fullpage', text: css$7 });
273
+ }
274
+
275
+ var css$6 = "usa-loading-bar{--usa-loading:0;--usa-loading-h:3px;--usa-loading-color:var(--usa-accent,#7c5cff);position:fixed;left:0;right:0;top:0;height:var(--usa-loading-h);z-index:2147483500;pointer-events:none;opacity:0;transition:opacity 0.3s ease}usa-loading-bar[position=\"bottom\"]{top:auto;bottom:0}usa-loading-bar[data-active]{opacity:1}usa-loading-bar .usa-loading-bar-fill{position:absolute;inset:0;transform-origin:0 50%;transform:scaleX(var(--usa-loading));background:var(--usa-loading-color);box-shadow:0 0 10px var(--usa-loading-color);transition:transform 0.2s ease-out}@media (prefers-reduced-motion:reduce){usa-loading-bar .usa-loading-bar-fill{transition:none}}";
276
+
277
+ function defineLoadingBar(tag = 'usa-loading-bar') {
278
+ return defineElement(tag, (Base) => class UsaLoadingBar extends Base {
279
+ constructor() {
280
+ super(...arguments);
281
+ this._p = 0;
282
+ }
283
+ get progress() {
284
+ return this._p;
285
+ }
286
+ mount() {
287
+ if (!this.querySelector('.usa-loading-bar-fill'))
288
+ this.innerHTML = '<span class="usa-loading-bar-fill"></span>';
289
+ this.setAttribute('role', 'progressbar');
290
+ this.setAttribute('aria-label', this.str('label', 'Loading'));
291
+ this.setAttribute('aria-valuemin', '0');
292
+ this.setAttribute('aria-valuemax', '100');
293
+ if (this.str('color'))
294
+ this.style.setProperty('--usa-loading-color', this.str('color'));
295
+ this.style.setProperty('--usa-loading-h', `${this.num('height', 3)}px`);
296
+ this.paint();
297
+ }
298
+ unmount() {
299
+ clearInterval(this._t);
300
+ clearTimeout(this._h);
301
+ }
302
+ paint() {
303
+ this.style.setProperty('--usa-loading', this._p.toFixed(4));
304
+ this.setAttribute('aria-valuenow', String(Math.round(this._p * 100)));
305
+ }
306
+ start() {
307
+ clearTimeout(this._h);
308
+ clearInterval(this._t);
309
+ this.setAttribute('data-active', '');
310
+ this.setAttribute('aria-busy', 'true');
311
+ this._p = Math.max(this._p, 0.08);
312
+ this.paint();
313
+ this._t = setInterval(() => {
314
+ this._p += (0.9 - this._p) * (this.reduced ? 0.5 : 0.08);
315
+ this.paint();
316
+ }, 200);
317
+ }
318
+ set(p) {
319
+ this.setAttribute('data-active', '');
320
+ this._p = Math.max(0, Math.min(1, p));
321
+ this.paint();
322
+ }
323
+ done() {
324
+ clearInterval(this._t);
325
+ this._p = 1;
326
+ this.paint();
327
+ this.removeAttribute('aria-busy');
328
+ this._h = setTimeout(() => {
329
+ this.removeAttribute('data-active');
330
+ this._h = setTimeout(() => {
331
+ this._p = 0;
332
+ this.paint();
333
+ }, 300);
334
+ }, 250);
335
+ }
336
+ }, { id: 'loading-bar', text: css$6 });
337
+ }
338
+ function bar() {
339
+ if (typeof document === 'undefined')
340
+ return null;
341
+ let el = document.querySelector('usa-loading-bar');
342
+ if (!el) {
343
+ defineLoadingBar();
344
+ el = document.createElement('usa-loading-bar');
345
+ document.body.appendChild(el);
346
+ }
347
+ return typeof el.start === 'function' ? el : null;
348
+ }
349
+ /** Drive the page's `<usa-loading-bar>` (created on first use). */
350
+ const loadingBar = {
351
+ start: () => bar()?.start(),
352
+ set: (p) => bar()?.set(p),
353
+ done: () => bar()?.done(),
354
+ /** Run `task` with the bar shown; resolves with its result. */
355
+ async track(task) {
356
+ bar()?.start();
357
+ try {
358
+ return await (typeof task === 'function' ? task() : task);
359
+ }
360
+ finally {
361
+ bar()?.done();
362
+ }
363
+ },
364
+ };
365
+
366
+ var css$5 = "usa-back-to-top{--usa-btt:0;position:fixed;right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));z-index:850;opacity:0;transform:translateY(16px) scale(0.8);pointer-events:none;transition:opacity 0.25s ease,transform 0.4s cubic-bezier(0.34,1.56,0.64,1)}usa-back-to-top[position=\"bottom-left\"]{right:auto;left:max(20px,env(safe-area-inset-left))}usa-back-to-top[data-visible]{opacity:1;transform:none;pointer-events:auto}usa-back-to-top button{width:48px;height:48px;padding:0;border:0;border-radius:50%;cursor:pointer;display:grid;place-items:center;color:var(--usa-accent,#7c5cff);background:var(--usa-surface,#1b1e27);box-shadow:var(--usa-shadow,0 8px 24px -10px rgb(0 0 0 / 0.5))}usa-back-to-top svg{width:44px;height:44px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}usa-back-to-top circle{stroke-dasharray:100;stroke-dashoffset:calc(100 - var(--usa-btt) * 100);transform:rotate(-90deg);transform-origin:50% 50%;opacity:0.85}usa-back-to-top button:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:3px}@media (prefers-reduced-motion:reduce){usa-back-to-top{transition:opacity 0.2s ease;transform:none}}";
367
+
368
+ function defineBackToTop(tag = 'usa-back-to-top') {
369
+ return defineElement(tag, (Base) => class UsaBackToTop extends Base {
370
+ constructor() {
371
+ super(...arguments);
372
+ this._frame = 0;
373
+ }
374
+ get visible() {
375
+ return this.hasAttribute('data-visible');
376
+ }
377
+ mount() {
378
+ if (!this.querySelector('button')) {
379
+ this.innerHTML = `<button type="button" aria-label="${this.str('label', 'Back to top')}"><svg viewBox="0 0 36 36" aria-hidden="true"><circle cx="18" cy="18" r="16" pathLength="100"/><path d="M12 20l6-6 6 6"/></svg></button>`;
380
+ }
381
+ const btn = this.querySelector('button');
382
+ const update = () => {
383
+ this._frame = 0;
384
+ const y = window.scrollY || document.documentElement.scrollTop || 0;
385
+ const max = Math.max(1, (document.documentElement.scrollHeight || 0) - (window.innerHeight || 0));
386
+ this.toggleAttribute('data-visible', y > this.num('offset', 300));
387
+ this.style.setProperty('--usa-btt', Math.min(1, y / max).toFixed(4));
388
+ };
389
+ this.listen(window, 'scroll', () => {
390
+ if (!this._frame)
391
+ this._frame = raf(update);
392
+ }, { passive: true });
393
+ this.listen(btn, 'click', async () => {
394
+ await scrollToTarget(0, { preset: 'slow' });
395
+ const f = document.querySelector(this.str('focus-target', '#main')) || document.body;
396
+ if (!f.hasAttribute('tabindex') && f !== document.body)
397
+ f.tabIndex = -1;
398
+ f.focus?.({ preventScroll: true });
399
+ });
400
+ update();
401
+ }
402
+ unmount() {
403
+ caf(this._frame);
404
+ this._frame = 0;
405
+ }
406
+ }, { id: 'back-to-top', text: css$5 });
407
+ }
408
+
409
+ var css$4 = "usa-ambient{--usa-ambient-opacity:0.6;--usa-ambient-p:0;position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:var(--usa-ambient-opacity);contain:strict}usa-ambient[layer=\"front\"]{z-index:2147483000}usa-ambient canvas{display:block}usa-ambient[effect=\"noise\"]{opacity:calc(var(--usa-ambient-opacity) * 0.25);background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E\");animation:usa-ambient-grain 0.6s steps(4) infinite;mix-blend-mode:overlay}@keyframes usa-ambient-grain{25%{background-position:-40px 20px}50%{background-position:30px -50px}75%{background-position:-20px -30px}}usa-ambient[effect=\"gradient\"]{background:linear-gradient(135deg,hsl(calc(250 + var(--usa-ambient-p) * 140) 85% 60%),hsl(calc(190 + var(--usa-ambient-p) * 160) 85% 55%) 50%,hsl(calc(320 + var(--usa-ambient-p) * 90) 85% 62%))}@media (prefers-reduced-motion:reduce){usa-ambient[effect=\"noise\"]{animation:none}}";
410
+
411
+ const AMBIENT_EFFECTS = ['particles', 'snow', 'stars', 'noise', 'gradient'];
412
+ function defineAmbient(tag = 'usa-ambient') {
413
+ return defineElement(tag, (Base) => class UsaAmbient extends Base {
414
+ constructor() {
415
+ super(...arguments);
416
+ this._frame = 0;
417
+ }
418
+ static get observedAttributes() {
419
+ return ['effect', 'density', 'color'];
420
+ }
421
+ mount() {
422
+ this.setAttribute('aria-hidden', 'true');
423
+ const effect = this.str('effect', 'particles');
424
+ this.style.setProperty('--usa-ambient-opacity', String(this.num('opacity', 0.6)));
425
+ this.replaceChildren();
426
+ if (effect === 'noise')
427
+ return;
428
+ if (effect === 'gradient') {
429
+ const upd = () => {
430
+ this._frame = 0;
431
+ const max = Math.max(1, document.documentElement.scrollHeight - window.innerHeight);
432
+ this.style.setProperty('--usa-ambient-p', ((window.scrollY || 0) / max).toFixed(4));
433
+ };
434
+ if (!this.reduced)
435
+ this.listen(window, 'scroll', () => !this._frame && (this._frame = raf(upd)), { passive: true });
436
+ upd();
437
+ return;
438
+ }
439
+ const canvas = document.createElement('canvas');
440
+ this.append(canvas);
441
+ const ctx = canvas.getContext?.('2d');
442
+ if (!ctx)
443
+ return;
444
+ const dpr = Math.min(2, window.devicePixelRatio || 1);
445
+ let W = 0;
446
+ let H = 0;
447
+ const color = this.str('color', effect === 'snow' ? '#ffffff' : effect === 'stars' ? '#ffffff' : '#a78bfa');
448
+ const speed = this.num('speed', 1);
449
+ const resize = () => {
450
+ W = window.innerWidth || 800;
451
+ H = window.innerHeight || 600;
452
+ canvas.width = W * dpr;
453
+ canvas.height = H * dpr;
454
+ canvas.style.width = `${W}px`;
455
+ canvas.style.height = `${H}px`;
456
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
457
+ };
458
+ resize();
459
+ const base = effect === 'stars' ? 140 : effect === 'snow' ? 90 : 60;
460
+ const n = Math.round(base * Math.max(0.2, Math.min(3, this.num('density', 1))) * Math.min(1.5, (W * H) / (1280 * 800)));
461
+ const dots = Array.from({ length: n }, () => ({
462
+ x: Math.random() * W,
463
+ y: Math.random() * H,
464
+ r: effect === 'stars' ? Math.random() * 1.3 + 0.2 : effect === 'snow' ? Math.random() * 2.6 + 0.8 : Math.random() * 2 + 0.6,
465
+ vx: (Math.random() - 0.5) * 0.25,
466
+ vy: effect === 'snow' ? Math.random() * 0.8 + 0.4 : (Math.random() - 0.5) * 0.25,
467
+ t: Math.random() * Math.PI * 2,
468
+ }));
469
+ ctx.fillStyle = color;
470
+ const draw = (move) => {
471
+ ctx.clearRect(0, 0, W, H);
472
+ for (const d of dots) {
473
+ if (move) {
474
+ d.t += 0.02 * speed;
475
+ d.x += (d.vx + (effect === 'snow' ? Math.sin(d.t) * 0.3 : 0)) * speed;
476
+ d.y += d.vy * speed;
477
+ if (d.y > H + 5)
478
+ d.y = -5;
479
+ if (d.y < -5)
480
+ d.y = H + 5;
481
+ if (d.x > W + 5)
482
+ d.x = -5;
483
+ if (d.x < -5)
484
+ d.x = W + 5;
485
+ }
486
+ ctx.globalAlpha = effect === 'stars' ? 0.35 + 0.65 * Math.abs(Math.sin(d.t)) : 0.85;
487
+ ctx.beginPath();
488
+ ctx.arc(d.x, d.y, d.r, 0, Math.PI * 2);
489
+ ctx.fill();
490
+ }
491
+ };
492
+ this.listen(window, 'resize', () => {
493
+ resize();
494
+ ctx.fillStyle = color;
495
+ draw(false);
496
+ });
497
+ if (this.reduced) {
498
+ draw(false);
499
+ return;
500
+ }
501
+ const loop = () => {
502
+ if (!document.hidden)
503
+ draw(true);
504
+ this._frame = raf(loop);
505
+ };
506
+ this._frame = raf(loop);
507
+ }
508
+ unmount() {
509
+ caf(this._frame);
510
+ this._frame = 0;
511
+ }
512
+ }, { id: 'ambient', text: css$4 });
513
+ }
514
+
515
+ var css$3 = "usa-splash{position:fixed;inset:0;z-index:2147483400;display:grid;place-items:center;background:var(--usa-splash-bg,var(--usa-surface,#0b0d12));color:var(--usa-text,#fff)}usa-splash[hidden]{display:none}";
516
+
517
+ function defineSplash(tag = 'usa-splash') {
518
+ return defineElement(tag, (Base) => class UsaSplash extends Base {
519
+ constructor() {
520
+ super(...arguments);
521
+ this._t0 = 0;
522
+ this._gone = false;
523
+ }
524
+ mount() {
525
+ this._t0 = Date.now();
526
+ this.setAttribute('role', 'status');
527
+ this.setAttribute('aria-label', this.str('label', 'Loading'));
528
+ document.body?.setAttribute('aria-busy', 'true');
529
+ if (this.flag('manual'))
530
+ return;
531
+ if (document.readyState === 'complete')
532
+ this.done();
533
+ else
534
+ this.listen(window, 'load', () => this.done(), { once: true });
535
+ }
536
+ async done() {
537
+ if (this._gone)
538
+ return;
539
+ this._gone = true;
540
+ const wait = Math.max(0, this.num('min', 600) - (Date.now() - this._t0));
541
+ if (wait)
542
+ await new Promise((r) => setTimeout(r, wait));
543
+ const exit = this.reduced ? 'fade' : this.str('exit', 'fade');
544
+ const frames = {
545
+ fade: [{ opacity: 1 }, { opacity: 0 }],
546
+ scale: [{ opacity: 1, transform: 'scale(1)' }, { opacity: 0, transform: 'scale(1.15)' }],
547
+ 'slide-up': [{ transform: 'translateY(0)' }, { transform: 'translateY(-100%)' }],
548
+ circle: [{ clipPath: 'circle(150% at 50% 50%)' }, { clipPath: 'circle(0% at 50% 50%)' }],
549
+ };
550
+ const a = this.motion(this, frames[exit] || frames.fade, { duration: this.reduced ? 200 : 550, easing: 'cubic-bezier(0.65, 0, 0.35, 1)', fill: 'forwards' });
551
+ await a?.finished.catch(() => undefined);
552
+ document.body?.removeAttribute('aria-busy');
553
+ this.hidden = true;
554
+ this.emit('done');
555
+ }
556
+ }, { id: 'splash', text: css$3 });
557
+ }
558
+
559
+ var css$2 = "usa-auto-skeleton{display:block;--usa-skel-base:color-mix(in srgb,currentColor 10%,transparent);--usa-skel-shine:color-mix(in srgb,currentColor 18%,transparent)}usa-auto-skeleton[loading] :is(h1,h2,h3,h4,h5,h6,p,li,span,a,button,label,img,svg,video,input,select,textarea,td,th,figcaption,blockquote,[data-skeleton]):not([data-no-skeleton]):not(:has(:is(h1,h2,h3,h4,h5,h6,p,li,img,button,input))){color:transparent !important;border-color:transparent !important;box-shadow:none !important;user-select:none;pointer-events:none;background:linear-gradient(90deg,var(--usa-skel-base) 25%,var(--usa-skel-shine) 50%,var(--usa-skel-base) 75%) 0 0 / 300% 100% !important;border-radius:6px;animation:usa-skel-shimmer 1.4s ease-in-out infinite}usa-auto-skeleton[loading] :is(img,svg,video){opacity:0}usa-auto-skeleton[loading] :is(img,svg,video):not([data-no-skeleton]){opacity:1;object-position:-9999px}@keyframes usa-skel-shimmer{from{background-position:100% 0}to{background-position:0 0}}@media (prefers-reduced-motion:reduce){usa-auto-skeleton[loading] *{animation:none !important}}";
560
+
561
+ function defineAutoSkeleton(tag = 'usa-auto-skeleton') {
562
+ return defineElement(tag, (Base) => class UsaAutoSkeleton extends Base {
563
+ static get observedAttributes() {
564
+ return ['loading'];
565
+ }
566
+ get loading() {
567
+ return this.flag('loading');
568
+ }
569
+ set loading(v) {
570
+ this.setFlag('loading', v);
571
+ }
572
+ mount() {
573
+ this.sync(false);
574
+ }
575
+ changed() {
576
+ this.sync(true);
577
+ }
578
+ sync(animate) {
579
+ if (this.loading)
580
+ this.setAttribute('aria-busy', 'true');
581
+ else {
582
+ this.removeAttribute('aria-busy');
583
+ if (animate && !this.reduced)
584
+ this.motion(this, [{ opacity: 0.4 }, { opacity: 1 }], { duration: 300, easing: 'ease-out' });
585
+ }
586
+ }
587
+ }, { id: 'auto-skeleton', text: css$2 });
588
+ }
589
+
590
+ var css$1 = "usa-motion-switch{--usa-motion-i:2;position:relative;display:inline-grid;grid-auto-flow:column;grid-auto-columns:1fr;padding:3px;border-radius:999px;background:color-mix(in srgb,currentColor 9%,transparent);isolation:isolate}usa-motion-switch button{position:relative;z-index:1;padding:6px 12px;border:0;background:none;color:inherit;font:inherit;font-size:0.85em;border-radius:999px;cursor:pointer}usa-motion-switch button[aria-checked=\"true\"]{color:var(--usa-accent-text,#fff)}usa-motion-switch button:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:1px}usa-motion-switch .usa-motion-thumb{position:absolute;z-index:0;top:3px;bottom:3px;left:3px;width:calc((100% - 6px) / 4);border-radius:999px;background:var(--usa-accent,#7c5cff);transform:translateX(calc(var(--usa-motion-i) * 100%));transition:transform 0.4s cubic-bezier(0.34,1.4,0.64,1)}@media (prefers-reduced-motion:reduce){usa-motion-switch .usa-motion-thumb{transition:none}}";
591
+
592
+ const INTENSITIES = ['low', 'normal', 'high'];
593
+ const LEVELS = ['off', 'low', 'normal', 'high'];
594
+ const KEY = 'usa:motion';
595
+ /**
596
+ * Set the global motion intensity for every `<usa-*>` component:
597
+ * `'low'`, `'normal'` (default), `'high'`. Sets `--usa-motion` and
598
+ * `data-usa-motion` on `<html>`; with `persist` the choice is remembered
599
+ * (localStorage) and restored by `restoreMotionIntensity()`.
600
+ * 5.0: `'off'` was removed — use `setMotionSensitivity('minimal')`.
601
+ */
602
+ function setMotionIntensity(level, persist = false) {
603
+ if (!INTENSITIES.includes(level))
604
+ return;
605
+ configureComponents({ motionIntensity: level });
606
+ store(level, persist);
607
+ }
608
+ function store(level, persist) {
609
+ if (persist) {
610
+ try {
611
+ localStorage.setItem(KEY, level);
612
+ }
613
+ catch {
614
+ /* private mode */
615
+ }
616
+ }
617
+ if (typeof document !== 'undefined')
618
+ document.dispatchEvent(new CustomEvent('usa:motion', { detail: { level } }));
619
+ }
620
+ /** Apply a switch level: `'off'` = motion sensitivity `minimal`, otherwise full motion at that intensity. */
621
+ function setMotionLevel(level, persist = false) {
622
+ if (!LEVELS.includes(level))
623
+ return;
624
+ if (level === 'off')
625
+ configureComponents({ motionSensitivity: 'minimal' });
626
+ else
627
+ configureComponents({ motionIntensity: level, ...(getMotionSensitivity() === 'minimal' ? { motionSensitivity: 'full' } : {}) });
628
+ store(level, persist);
629
+ }
630
+ /** The current switch level. */
631
+ function getMotionLevel() {
632
+ return getMotionSensitivity() === 'minimal' || getMotionSensitivity() === 'static' ? 'off' : getMotionIntensity();
633
+ }
634
+ /** Re-apply a persisted level (call early on page load). Returns the active intensity. */
635
+ function restoreMotionIntensity() {
636
+ try {
637
+ const v = localStorage.getItem(KEY);
638
+ if (v && LEVELS.includes(v))
639
+ setMotionLevel(v);
640
+ }
641
+ catch {
642
+ /* ignore */
643
+ }
644
+ return getMotionIntensity();
645
+ }
646
+ function defineMotionSwitch(tag = 'usa-motion-switch') {
647
+ return defineElement(tag, (Base) => class UsaMotionSwitch extends Base {
648
+ get value() {
649
+ return getMotionLevel();
650
+ }
651
+ set value(v) {
652
+ setMotionLevel(v, true);
653
+ this.sync();
654
+ }
655
+ mount() {
656
+ restoreMotionIntensity();
657
+ const labels = this.str('labels', 'Off,Low,Normal,High').split(',');
658
+ this.setAttribute('role', 'radiogroup');
659
+ this.setAttribute('aria-label', this.str('label', 'Motion'));
660
+ this.innerHTML = LEVELS.map((l, i) => `<button type="button" role="radio" data-level="${l}">${labels[i] || l}</button><span hidden></span>`.replace('<span hidden></span>', '')).join('') + '<span class="usa-motion-thumb" aria-hidden="true"></span>';
661
+ this.listen(this, 'click', (e) => {
662
+ const b = e.target.closest?.('[data-level]');
663
+ if (b)
664
+ this.pick(b.dataset.level);
665
+ });
666
+ this.listen(this, 'keydown', (e) => {
667
+ const i = LEVELS.indexOf(this.value);
668
+ const n = e.key === 'ArrowRight' || e.key === 'ArrowDown' ? i + 1 : e.key === 'ArrowLeft' || e.key === 'ArrowUp' ? i - 1 : null;
669
+ if (n === null)
670
+ return;
671
+ e.preventDefault();
672
+ this.pick(LEVELS[(n + LEVELS.length) % LEVELS.length]);
673
+ this.querySelector('[aria-checked="true"]')?.focus();
674
+ });
675
+ this.listen(document, 'usa:motion', () => this.sync());
676
+ this.sync();
677
+ }
678
+ pick(l) {
679
+ this.value = l;
680
+ this.emit('change', { level: l });
681
+ }
682
+ sync() {
683
+ const v = this.value;
684
+ const i = LEVELS.indexOf(v);
685
+ this.style.setProperty('--usa-motion-i', String(i));
686
+ this.querySelectorAll('[data-level]').forEach((b) => {
687
+ const on = b.dataset.level === v;
688
+ b.setAttribute('aria-checked', String(on));
689
+ b.tabIndex = on ? 0 : -1;
690
+ });
691
+ }
692
+ }, { id: 'motion-switch', text: css$1 });
693
+ }
694
+
695
+ var css = "::view-transition-group(root){animation-duration:var(--usa-pt-duration,600ms)}html[data-usa-pt] ::view-transition-old(root),html[data-usa-pt] ::view-transition-new(root){animation-duration:var(--usa-pt-duration,600ms);animation-timing-function:cubic-bezier(0.22,1,0.36,1);mix-blend-mode:normal}html[data-usa-pt=\"slide\"] ::view-transition-old(root),html[data-usa-pt=\"slide-left\"] ::view-transition-old(root){animation-name:usa-pt-out-left}html[data-usa-pt=\"slide\"] ::view-transition-new(root),html[data-usa-pt=\"slide-left\"] ::view-transition-new(root){animation-name:usa-pt-in-right}html[data-usa-pt=\"slide-right\"] ::view-transition-old(root){animation-name:usa-pt-out-right}html[data-usa-pt=\"slide-right\"] ::view-transition-new(root){animation-name:usa-pt-in-left}html[data-usa-pt=\"slide-up\"] ::view-transition-old(root){animation-name:usa-pt-out-up}html[data-usa-pt=\"slide-up\"] ::view-transition-new(root){animation-name:usa-pt-in-up}html[data-usa-pt=\"zoom\"] ::view-transition-old(root){animation-name:usa-pt-zoom-out}html[data-usa-pt=\"zoom\"] ::view-transition-new(root){animation-name:usa-pt-zoom-in}html[data-usa-pt=\"circle\"] ::view-transition-old(root){animation:none}html[data-usa-pt=\"circle\"] ::view-transition-new(root){animation-name:usa-pt-circle}html[data-usa-pt=\"blinds\"] ::view-transition-old(root){animation:none}html[data-usa-pt=\"blinds\"] ::view-transition-new(root){animation-name:usa-pt-blinds;-webkit-mask-image:repeating-linear-gradient(to bottom,#000 0 var(--usa-blind),transparent var(--usa-blind) 10vh);mask-image:repeating-linear-gradient(to bottom,#000 0 var(--usa-blind),transparent var(--usa-blind) 10vh)}html[data-usa-pt=\"pixel\"] ::view-transition-old(root){animation-name:usa-pt-pixel-out;animation-timing-function:steps(10,end)}html[data-usa-pt=\"pixel\"] ::view-transition-new(root){animation-name:usa-pt-pixel-in;animation-timing-function:steps(10,end)}@property --usa-blind{syntax:\"<length-percentage>\";inherits:false;initial-value:0vh}@keyframes usa-pt-out-left{to{transform:translateX(-30%);opacity:0}}@keyframes usa-pt-in-right{from{transform:translateX(30%);opacity:0}}@keyframes usa-pt-out-right{to{transform:translateX(30%);opacity:0}}@keyframes usa-pt-in-left{from{transform:translateX(-30%);opacity:0}}@keyframes usa-pt-out-up{to{transform:translateY(-12%);opacity:0}}@keyframes usa-pt-in-up{from{transform:translateY(12%);opacity:0}}@keyframes usa-pt-zoom-out{to{transform:scale(0.92);opacity:0}}@keyframes usa-pt-zoom-in{from{transform:scale(1.08);opacity:0}}@keyframes usa-pt-circle{from{clip-path:circle(0 at var(--usa-pt-x,50%) var(--usa-pt-y,50%))}to{clip-path:circle(var(--usa-pt-r,150vmax) at var(--usa-pt-x,50%) var(--usa-pt-y,50%))}}@keyframes usa-pt-blinds{from{--usa-blind:0vh}to{--usa-blind:10vh}}@keyframes usa-pt-pixel-out{to{opacity:0;filter:blur(6px) contrast(1.4)}}@keyframes usa-pt-pixel-in{from{opacity:0;filter:blur(6px) contrast(1.4)}}@media (prefers-reduced-motion:reduce){::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none !important}}";
696
+
697
+ /**
698
+ * Page & app-wide transitions (v2.7), built on the View Transitions API
699
+ * (Chromium: Chrome, Edge, Electron, WebView2) with graceful fallbacks.
700
+ *
701
+ * - `pageTransition(update, { effect })` — SPA route changes: `fade`,
702
+ * `slide` (`slide-left` / `slide-right` / `slide-up`), `circle` (reveal
703
+ * from `x`, `y`), `blinds`, `pixel` (stepped dissolve), `zoom`.
704
+ * - `enableMpaTransitions(effect)` — the same effects for multi-page sites
705
+ * (`@view-transition { navigation: auto }`); call it on every page.
706
+ * - `themeTransition(apply, { x, y })` — a circle-reveal theme switch.
707
+ *
708
+ * Without View Transitions (Firefox, older Safari) or under reduced motion
709
+ * the update runs immediately (`fade` falls back to a short cross-fade of
710
+ * `fallback` when given).
711
+ */
712
+ const PAGE_EFFECTS = ['fade', 'slide', 'slide-left', 'slide-right', 'slide-up', 'circle', 'blinds', 'pixel', 'zoom'];
713
+ let lastPointer = null;
714
+ function trackPointer() {
715
+ if (typeof document === 'undefined' || trackPointer.done)
716
+ return;
717
+ trackPointer.done = true;
718
+ document.addEventListener('pointerdown', (e) => (lastPointer = [e.clientX, e.clientY]), { capture: true, passive: true });
719
+ }
720
+ /** `true` when `document.startViewTransition` exists. */
721
+ const supportsViewTransitions = () => typeof document !== 'undefined' && typeof document.startViewTransition === 'function';
722
+ function setVars(o) {
723
+ const d = document.documentElement;
724
+ const W = window.innerWidth || 1024;
725
+ const H = window.innerHeight || 768;
726
+ const [x, y] = o.x !== undefined && o.y !== undefined ? [o.x, o.y] : lastPointer || [W / 2, H / 2];
727
+ const r = Math.hypot(Math.max(x, W - x), Math.max(y, H - y));
728
+ d.style.setProperty('--usa-pt-x', `${x}px`);
729
+ d.style.setProperty('--usa-pt-y', `${y}px`);
730
+ d.style.setProperty('--usa-pt-r', `${Math.ceil(r)}px`);
731
+ d.style.setProperty('--usa-pt-duration', `${o.duration ?? 600}ms`);
732
+ }
733
+ /** Run `update` (sync or async) as an animated page transition. Resolves when it is done. */
734
+ async function pageTransition(update, options = {}) {
735
+ if (typeof document === 'undefined') {
736
+ await update();
737
+ return;
738
+ }
739
+ adoptStyles('page-transitions', css);
740
+ trackPointer();
741
+ const effect = options.effect || 'fade';
742
+ if (prefersReducedMotion() || !supportsViewTransitions()) {
743
+ await update();
744
+ const f = options.fallback;
745
+ if (f && typeof f.animate === 'function' && !prefersReducedMotion())
746
+ await f.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 200 }).finished.catch(() => undefined);
747
+ return;
748
+ }
749
+ const d = document.documentElement;
750
+ setVars(options);
751
+ d.setAttribute('data-usa-pt', effect);
752
+ try {
753
+ const vt = document.startViewTransition(() => update());
754
+ await vt.finished;
755
+ }
756
+ finally {
757
+ d.removeAttribute('data-usa-pt');
758
+ }
759
+ }
760
+ /** Opt a multi-page site into cross-document view transitions with `effect`. */
761
+ function enableMpaTransitions(effect = 'fade', duration = 450) {
762
+ if (typeof document === 'undefined')
763
+ return;
764
+ adoptStyles('page-transitions', css);
765
+ adoptStyles('mpa-transitions', prefersReducedMotion() ? '' : '@view-transition{navigation:auto}');
766
+ const d = document.documentElement;
767
+ d.setAttribute('data-usa-pt', effect);
768
+ setVars({ duration });
769
+ }
770
+ /**
771
+ * Switch theme with a circle reveal from (`x`, `y`) (default: last pointer).
772
+ * `apply` flips your theme (e.g. toggles a class / `data-theme`).
773
+ */
774
+ function themeTransition(apply, options = {}) {
775
+ return pageTransition(apply, { ...options, effect: 'circle', duration: options.duration ?? 650 });
776
+ }
777
+
778
+ /**
779
+ * motionary/components/page — page & app-wide effects (v2.7).
780
+ * Page transitions (`pageTransition()`, `enableMpaTransitions()`,
781
+ * `themeTransition()`), `<usa-cursor>`, `smoothScroll()` / `scrollToTarget()`,
782
+ * `<usa-fullpage>`, `<usa-loading-bar>` + `loadingBar`, `<usa-back-to-top>`,
783
+ * `<usa-ambient>`, `<usa-splash>`, `<usa-auto-skeleton>` and the global motion
784
+ * intensity (`setMotionIntensity()`, `<usa-motion-switch>`).
785
+ */
786
+ /** Register every component of this category under its default tag. */
787
+ function definePageComponents() {
788
+ defineCursor();
789
+ defineFullpage();
790
+ defineLoadingBar();
791
+ defineBackToTop();
792
+ defineAmbient();
793
+ defineSplash();
794
+ defineAutoSkeleton();
795
+ defineMotionSwitch();
796
+ }
797
+
798
+ export { AMBIENT_EFFECTS, CURSOR_MODES, PAGE_EFFECTS, defineAmbient, defineAutoSkeleton, defineBackToTop, defineCursor, defineFullpage, defineLoadingBar, defineMotionSwitch, definePageComponents, defineSplash, enableMpaTransitions, getMotionIntensity, getMotionLevel, loadingBar, pageTransition, restoreMotionIntensity, scrollToTarget, setMotionIntensity, setMotionLevel, smoothScroll, supportsViewTransitions, themeTransition };
799
+ //# sourceMappingURL=page.js.map