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,554 @@
1
+ import { x as defineElement, r as raf, l as caf, y as EASE_OUT, k as clamp } from '../chunks/base-C_3cAoRz.js';
2
+ import { d as springEasing, c as createSpring } from '../chunks/spring-CbvHfVtP.js';
3
+
4
+ var css$3 = "usa-card{--usa-card-radius:18px;--usa-card-bg:var(--usa-surface,#1b1e27);--usa-card-glow:var(--usa-accent,#7c5cff);--usa-card-x:50%;--usa-card-y:50%;--usa-card-nx:0;--usa-card-ny:0;position:relative;display:block;border-radius:var(--usa-card-radius);isolation:isolate;-webkit-tap-highlight-color:transparent}usa-card:focus-visible{outline:2px solid var(--usa-card-glow);outline-offset:3px}usa-card[effect~=\"lift\"]{transition:transform 0.45s cubic-bezier(0.34,1.56,0.64,1),box-shadow 0.45s ease}usa-card[effect~=\"lift\"][data-hover],usa-card[effect~=\"lift\"]:focus-visible{transform:translateY(-6px) perspective(900px) rotateX(calc(var(--usa-card-ny) * -4deg)) rotateY(calc(var(--usa-card-nx) * 4deg));box-shadow:0 22px 44px -18px rgb(0 0 0 / 0.55)}usa-card[effect~=\"glass\"]{background:color-mix(in srgb,var(--usa-card-bg) 45%,transparent);border:1px solid rgb(255 255 255 / 0.16);-webkit-backdrop-filter:blur(18px) saturate(1.5);backdrop-filter:blur(18px) saturate(1.5)}usa-card[effect~=\"spotlight\"]::before,usa-card[effect~=\"border-glow\"]::after{content:\"\";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity 0.3s ease}usa-card[effect~=\"spotlight\"]::before{z-index:-1;background:radial-gradient(260px circle at var(--usa-card-x) var(--usa-card-y),color-mix(in srgb,var(--usa-card-glow) 28%,transparent),transparent 70%)}usa-card[effect~=\"border-glow\"]::after{padding:1.5px;background:radial-gradient(180px circle at var(--usa-card-x) var(--usa-card-y),var(--usa-card-glow),transparent 70%);-webkit-mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0);mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}usa-card[data-hover]::before,usa-card[data-hover]::after{opacity:1}@property --usa-card-angle{syntax:\"<angle>\";inherits:false;initial-value:0deg}usa-card[effect~=\"conic-border\"]{border:2px solid transparent;background:linear-gradient(var(--usa-card-bg),var(--usa-card-bg)) padding-box,conic-gradient(from var(--usa-card-angle),var(--usa-card-glow),#22d3ee,#f472b6,var(--usa-card-glow)) border-box;animation:usa-card-spin 4s linear infinite}@keyframes usa-card-spin{to{--usa-card-angle:360deg}}usa-card .usa-card-sheen{position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none}usa-card .usa-card-sheen::before{content:\"\";position:absolute;top:0;bottom:0;width:45%;left:-60%;transform:skewX(-20deg);background:linear-gradient(90deg,transparent,rgb(255 255 255 / 0.35),transparent)}usa-card[effect~=\"sheen\"]:hover .usa-card-sheen::before,usa-card[effect~=\"sheen\"]:focus-visible .usa-card-sheen::before{left:130%;transition:left 0.8s cubic-bezier(0.22,1,0.36,1)}usa-card .usa-card-holo{position:absolute;inset:0;border-radius:inherit;pointer-events:none;mix-blend-mode:color-dodge;opacity:0.35;background:linear-gradient(115deg,transparent 20%,#ff7ad9 35%,#7af0ff 45%,#ffe27a 55%,transparent 70%) calc(var(--usa-card-x) * 1.4 - 20%) calc(var(--usa-card-y) * 1.4 - 20%) / 220% 220%;transition:opacity 0.3s ease}usa-card[data-hover] .usa-card-holo{opacity:0.7}usa-card[effect~=\"parallax-layers\"] [data-depth]{transition:transform 0.25s ease-out;will-change:transform}usa-card[effect~=\"flip\"]{perspective:1000px;display:grid}usa-card[effect~=\"flip\"]>[data-front],usa-card[effect~=\"flip\"]>[data-back]{grid-area:1 / 1;backface-visibility:hidden;-webkit-backface-visibility:hidden;border-radius:inherit;transition:transform 0.7s cubic-bezier(0.34,1.3,0.64,1),opacity 0.3s ease}usa-card[effect~=\"flip\"]>[data-back]{transform:rotateY(180deg)}usa-card[effect~=\"flip\"][axis=\"x\"]>[data-back]{transform:rotateX(180deg)}usa-card[effect~=\"flip\"][flipped]>[data-front],usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-front]{transform:rotateY(-180deg)}usa-card[effect~=\"flip\"][flipped]>[data-back],usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-back]{transform:rotateY(0deg)}usa-card[effect~=\"flip\"][axis=\"x\"][flipped]>[data-front],usa-card[effect~=\"flip\"][axis=\"x\"]:not([trigger=\"click\"]):hover>[data-front]{transform:rotateX(180deg)}usa-card[effect~=\"flip\"][axis=\"x\"][flipped]>[data-back],usa-card[effect~=\"flip\"][axis=\"x\"]:not([trigger=\"click\"]):hover>[data-back]{transform:rotateX(0deg)}usa-card[effect~=\"flip\"][trigger=\"click\"]{cursor:pointer}usa-card[effect~=\"expand\"]{cursor:zoom-in}usa-card[effect~=\"expand\"]:not([expanded]) [data-detail]{display:none}usa-card[expanded]{position:fixed;inset:6vh max(4vw,calc(50vw - 420px));z-index:1000;overflow:auto;cursor:default;background:var(--usa-card-bg);box-shadow:0 30px 80px -20px rgb(0 0 0 / 0.6)}.usa-card-backdrop{position:fixed;inset:0;z-index:999;background:rgb(0 0 0 / 0.45)}@media (prefers-reduced-motion:reduce){usa-card,usa-card *,usa-card .usa-card-sheen::before{transition-duration:0.01ms !important;animation:none !important}usa-card[effect~=\"lift\"][data-hover]{transform:none}usa-card[effect~=\"flip\"]>[data-front],usa-card[effect~=\"flip\"]>[data-back]{transform:none !important}usa-card[effect~=\"flip\"][flipped]>[data-front],usa-card[effect~=\"flip\"]:not([flipped])>[data-back]{opacity:0;visibility:hidden}usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-front]{opacity:0;visibility:hidden}usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-back]{opacity:1;visibility:visible}}@media (prefers-reduced-transparency:reduce),(forced-colors:active){usa-card[effect~=\"glass\"]{background:var(--usa-card-bg);-webkit-backdrop-filter:none;backdrop-filter:none}}";
5
+
6
+ const CARD_EFFECTS = ['flip', 'holo', 'glass', 'border-glow', 'conic-border', 'lift', 'spotlight', 'sheen', 'parallax-layers', 'expand'];
7
+ /** Effects that follow the pointer (they share one rAF-throttled tracker). */
8
+ const TRACKING = new Set(['holo', 'border-glow', 'spotlight', 'parallax-layers', 'lift']);
9
+ function defineCard(tag = 'usa-card') {
10
+ return defineElement(tag, (Base) => class UsaCard extends Base {
11
+ constructor() {
12
+ super(...arguments);
13
+ this._frame = 0;
14
+ this._spacer = null;
15
+ this._backdrop = null;
16
+ this._busy = false;
17
+ }
18
+ static get observedAttributes() {
19
+ return ['effect', 'trigger', 'disabled'];
20
+ }
21
+ get effects() {
22
+ return this.str('effect', 'lift').split(/[\s,]+/).filter(Boolean);
23
+ }
24
+ has(e) {
25
+ return this.effects.includes(e);
26
+ }
27
+ get flipped() {
28
+ return this.flag('flipped');
29
+ }
30
+ set flipped(v) {
31
+ this.setFlag('flipped', v);
32
+ }
33
+ get expanded() {
34
+ return this.flag('expanded');
35
+ }
36
+ mount() {
37
+ if (this.flag('disabled'))
38
+ return;
39
+ const color = this.str('color');
40
+ if (color)
41
+ this.style.setProperty('--usa-card-glow', color);
42
+ if (this.has('sheen') && !this.querySelector(':scope > .usa-card-sheen'))
43
+ this.append(deco('usa-card-sheen'));
44
+ if (this.has('holo') && !this.querySelector(':scope > .usa-card-holo'))
45
+ this.append(deco('usa-card-holo'));
46
+ if (this.has('flip')) {
47
+ const click = this.str('trigger', 'hover') === 'click';
48
+ if (click) {
49
+ if (!this.hasAttribute('tabindex'))
50
+ this.tabIndex = 0;
51
+ this.setAttribute('role', this.getAttribute('role') || 'button');
52
+ this.setAttribute('aria-pressed', String(this.flipped));
53
+ this.listen(this, 'click', (e) => !interactive(e.target, this) && this.flip());
54
+ this.listen(this, 'keydown', (e) => {
55
+ if ((e.key === 'Enter' || e.key === ' ') && e.target === this) {
56
+ e.preventDefault();
57
+ this.flip();
58
+ }
59
+ });
60
+ }
61
+ this.setBackHidden();
62
+ }
63
+ if (this.has('expand')) {
64
+ if (!this.hasAttribute('tabindex'))
65
+ this.tabIndex = 0;
66
+ this.setAttribute('aria-expanded', String(this.expanded));
67
+ this.listen(this, 'click', (e) => {
68
+ const t = e.target;
69
+ if (t.closest?.('[data-close]')) {
70
+ e.stopPropagation();
71
+ this.collapse();
72
+ }
73
+ else if (!this.expanded && !interactive(t, this))
74
+ this.expand();
75
+ });
76
+ this.listen(this, 'keydown', (e) => {
77
+ if (e.key === 'Escape' && this.expanded)
78
+ this.collapse();
79
+ else if ((e.key === 'Enter' || e.key === ' ') && e.target === this && !this.expanded) {
80
+ e.preventDefault();
81
+ this.expand();
82
+ }
83
+ });
84
+ }
85
+ if (!this.effects.some((e) => TRACKING.has(e)) || this.reduced)
86
+ return;
87
+ let rect = null;
88
+ let px = 0.5;
89
+ let py = 0.5;
90
+ const apply = () => {
91
+ this._frame = 0;
92
+ const nx = clamp(px * 2 - 1, -1, 1);
93
+ const ny = clamp(py * 2 - 1, -1, 1);
94
+ this.style.setProperty('--usa-card-x', `${(px * 100).toFixed(1)}%`);
95
+ this.style.setProperty('--usa-card-y', `${(py * 100).toFixed(1)}%`);
96
+ this.style.setProperty('--usa-card-nx', nx.toFixed(3));
97
+ this.style.setProperty('--usa-card-ny', ny.toFixed(3));
98
+ if (this.has('parallax-layers')) {
99
+ const depth = this.num('depth', 16);
100
+ this.querySelectorAll('[data-depth]').forEach((l) => {
101
+ const d = Number(l.dataset.depth) || 0.5;
102
+ l.style.transform = `translate3d(${(nx * depth * d).toFixed(1)}px, ${(ny * depth * d).toFixed(1)}px, 0)`;
103
+ });
104
+ }
105
+ };
106
+ this.listen(this, 'pointerenter', () => {
107
+ rect = this.getBoundingClientRect();
108
+ this.setAttribute('data-hover', '');
109
+ });
110
+ this.listen(this, 'pointermove', (e) => {
111
+ if (this.expanded)
112
+ return;
113
+ rect = rect || this.getBoundingClientRect();
114
+ px = (e.clientX - rect.left) / (rect.width || 1);
115
+ py = (e.clientY - rect.top) / (rect.height || 1);
116
+ if (!this._frame)
117
+ this._frame = raf(apply);
118
+ });
119
+ this.listen(this, 'pointerleave', () => {
120
+ rect = null;
121
+ px = py = 0.5;
122
+ this.removeAttribute('data-hover');
123
+ if (!this._frame)
124
+ this._frame = raf(apply);
125
+ });
126
+ }
127
+ unmount() {
128
+ caf(this._frame);
129
+ this._frame = 0;
130
+ if (this.expanded)
131
+ this.finishCollapse();
132
+ }
133
+ setBackHidden() {
134
+ const front = this.querySelector(':scope > [data-front]');
135
+ const back = this.querySelector(':scope > [data-back]');
136
+ front?.setAttribute('aria-hidden', String(this.flipped));
137
+ back?.setAttribute('aria-hidden', String(!this.flipped));
138
+ }
139
+ flip(force) {
140
+ const next = force === undefined ? !this.flipped : force;
141
+ if (next === this.flipped)
142
+ return;
143
+ this.flipped = next;
144
+ if (this.hasAttribute('aria-pressed'))
145
+ this.setAttribute('aria-pressed', String(next));
146
+ this.setBackHidden();
147
+ this.emit('flip', { flipped: next });
148
+ }
149
+ async expand() {
150
+ if (this.expanded || this._busy)
151
+ return;
152
+ this._busy = true;
153
+ const first = this.getBoundingClientRect();
154
+ const spacer = document.createElement('div');
155
+ spacer.className = 'usa-card-spacer';
156
+ spacer.style.cssText = `width:${first.width}px;height:${first.height}px`;
157
+ spacer.setAttribute('aria-hidden', 'true');
158
+ this.before(spacer);
159
+ this._spacer = spacer;
160
+ const backdrop = document.createElement('div');
161
+ backdrop.className = 'usa-card-backdrop';
162
+ backdrop.addEventListener('click', () => this.collapse());
163
+ this.before(backdrop);
164
+ this._backdrop = backdrop;
165
+ this.setFlag('expanded', true);
166
+ this.setAttribute('aria-expanded', 'true');
167
+ this.emit('expand');
168
+ const last = this.getBoundingClientRect();
169
+ await this.flipFrom(first, last);
170
+ this.motion(backdrop, [{ opacity: 0 }, { opacity: 1 }], { duration: 250, easing: 'ease-out' });
171
+ this.focus({ preventScroll: true });
172
+ this._busy = false;
173
+ }
174
+ async collapse() {
175
+ if (!this.expanded || this._busy)
176
+ return;
177
+ this._busy = true;
178
+ const first = this.getBoundingClientRect();
179
+ const b = this._backdrop;
180
+ if (b)
181
+ this.motion(b, [{ opacity: 1 }, { opacity: 0 }], { duration: 200, easing: 'ease-in', fill: 'forwards' });
182
+ this.finishCollapse();
183
+ this.emit('collapse');
184
+ const last = this.getBoundingClientRect();
185
+ await this.flipFrom(first, last);
186
+ this._busy = false;
187
+ }
188
+ finishCollapse() {
189
+ this.setFlag('expanded', false);
190
+ this.setAttribute('aria-expanded', 'false');
191
+ this._spacer?.remove();
192
+ this._backdrop?.remove();
193
+ this._spacer = this._backdrop = null;
194
+ }
195
+ async flipFrom(first, last) {
196
+ if (this.reduced) {
197
+ const a = this.motion(this, [{ opacity: 0.4 }, { opacity: 1 }], { duration: 200 });
198
+ await a?.finished.catch(() => undefined);
199
+ return;
200
+ }
201
+ const sx = first.width / (last.width || 1);
202
+ const sy = first.height / (last.height || 1);
203
+ const dx = first.left - last.left;
204
+ const dy = first.top - last.top;
205
+ const { easing, duration } = springEasing('stiff');
206
+ const a = this.motion(this, [{ transformOrigin: '0 0', transform: `translate(${dx}px, ${dy}px) scale(${sx}, ${sy})` }, { transformOrigin: '0 0', transform: 'none' }], { duration: Math.min(duration, 900), easing: easing || EASE_OUT });
207
+ await a?.finished.catch(() => undefined);
208
+ }
209
+ }, { id: 'card', text: css$3 });
210
+ }
211
+ function deco(cls) {
212
+ const s = document.createElement('span');
213
+ s.className = cls;
214
+ s.setAttribute('aria-hidden', 'true');
215
+ return s;
216
+ }
217
+ /** Clicks on links, buttons and form fields inside the card keep their own behaviour. */
218
+ function interactive(t, host) {
219
+ const el = t?.closest?.('a, button, input, select, textarea, label, [contenteditable]');
220
+ return !!el && el !== host && host.contains(el);
221
+ }
222
+
223
+ var css$2 = "usa-card-stack{position:relative;display:grid;touch-action:pan-y;user-select:none;-webkit-user-select:none}usa-card-stack>*{grid-area:1 / 1;transform-origin:50% 100%;transition:transform 0.35s cubic-bezier(0.34,1.3,0.64,1),opacity 0.3s ease;will-change:transform}usa-card-stack>[data-top]{cursor:grab}usa-card-stack[data-dragging]>*,usa-card-stack>[data-top]{transition:none}usa-card-stack:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:4px;border-radius:12px}@media (prefers-reduced-motion:reduce){usa-card-stack>*{transition:none}}";
224
+
225
+ function defineCardStack(tag = 'usa-card-stack') {
226
+ return defineElement(tag, (Base) => class UsaCardStack extends Base {
227
+ constructor() {
228
+ super(...arguments);
229
+ this._drag = null;
230
+ this._busy = false;
231
+ }
232
+ static get observedAttributes() {
233
+ return ['visible', 'offset', 'disabled'];
234
+ }
235
+ get top() {
236
+ return this.cards()[0] || null;
237
+ }
238
+ cards() {
239
+ return Array.from(this.children).filter((c) => !c.hasAttribute('data-gone'));
240
+ }
241
+ layout(dragX = 0) {
242
+ const visible = this.num('visible', 3);
243
+ const off = this.num('offset', 10);
244
+ const reduced = this.reduced;
245
+ this.cards().forEach((c, i) => {
246
+ c.style.zIndex = String(100 - i);
247
+ c.toggleAttribute('data-top', i === 0);
248
+ c.setAttribute('aria-hidden', String(i !== 0));
249
+ if (i === 0) {
250
+ const rot = reduced ? 0 : dragX / 18;
251
+ c.style.transform = `translate3d(${dragX}px, 0, 0) rotate(${rot.toFixed(2)}deg)`;
252
+ c.style.opacity = '1';
253
+ }
254
+ else {
255
+ const k = Math.min(i, visible);
256
+ const pull = Math.min(1, Math.abs(dragX) / this.num('threshold', 90));
257
+ const kk = Math.max(0, k - pull);
258
+ c.style.transform = `translate3d(0, ${(kk * off).toFixed(1)}px, 0) scale(${(1 - kk * 0.05).toFixed(3)})`;
259
+ c.style.opacity = i > visible ? '0' : '1';
260
+ }
261
+ });
262
+ }
263
+ mount() {
264
+ if (!this.hasAttribute('tabindex'))
265
+ this.tabIndex = 0;
266
+ if (!this.hasAttribute('role'))
267
+ this.setAttribute('role', 'group');
268
+ this.setAttribute('aria-roledescription', 'card stack');
269
+ this._x = createSpring({ spring: 'wobbly', onUpdate: (v) => this.layout(v) });
270
+ this.layout();
271
+ this.listen(this, 'pointerdown', (e) => {
272
+ if (this.flag('disabled') || this._busy || !this.top || !this.top.contains(e.target))
273
+ return;
274
+ this._x.stop();
275
+ this._drag = { id: e.pointerId, x0: e.clientX - this._x.value, t0: e.timeStamp };
276
+ try {
277
+ this.setPointerCapture?.(e.pointerId);
278
+ }
279
+ catch {
280
+ /* synthetic */
281
+ }
282
+ this.setAttribute('data-dragging', '');
283
+ });
284
+ this.listen(this, 'pointermove', (e) => {
285
+ if (!this._drag || e.pointerId !== this._drag.id)
286
+ return;
287
+ this._x.jump(e.clientX - this._drag.x0);
288
+ });
289
+ const up = (e) => {
290
+ if (!this._drag || e.pointerId !== this._drag.id)
291
+ return;
292
+ this._drag = null;
293
+ this.removeAttribute('data-dragging');
294
+ const x = this._x.value;
295
+ if (Math.abs(x) >= this.num('threshold', 90))
296
+ this.swipe(x > 0 ? 'right' : 'left');
297
+ else
298
+ this._x.set(0);
299
+ };
300
+ this.listen(this, 'pointerup', up);
301
+ this.listen(this, 'pointercancel', up);
302
+ this.listen(this, 'keydown', (e) => {
303
+ if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
304
+ e.preventDefault();
305
+ this.swipe(e.key === 'ArrowLeft' ? 'left' : 'right');
306
+ }
307
+ });
308
+ const mo = typeof MutationObserver !== 'undefined' ? new MutationObserver(() => this.layout(this._x.value)) : null;
309
+ mo?.observe(this, { childList: true });
310
+ this.onCleanup(() => mo?.disconnect());
311
+ }
312
+ unmount() {
313
+ this._x?.stop();
314
+ }
315
+ async swipe(direction) {
316
+ const card = this.top;
317
+ if (!card || this._busy || this.flag('disabled'))
318
+ return;
319
+ this._busy = true;
320
+ this._x.stop();
321
+ const from = this._x.value;
322
+ const to = (direction === 'left' ? -1 : 1) * Math.max(320, (this.getBoundingClientRect().width || 300) * 1.4);
323
+ card.setAttribute('data-gone', '');
324
+ this._x.jump(0);
325
+ this.layout(0);
326
+ const a = this.reduced
327
+ ? null
328
+ : this.motion(card, [{ transform: `translate3d(${from}px,0,0) rotate(${from / 18}deg)`, opacity: 1 }, { transform: `translate3d(${to}px,0,0) rotate(${to / 14}deg)`, opacity: 0 }], {
329
+ duration: 380,
330
+ easing: 'cubic-bezier(0.3, 0.7, 0.4, 1)',
331
+ fill: 'forwards',
332
+ });
333
+ await a?.finished.catch(() => undefined);
334
+ a?.cancel();
335
+ card.removeAttribute('data-gone');
336
+ if (this.flag('loop'))
337
+ this.append(card);
338
+ else
339
+ card.remove();
340
+ this.layout(0);
341
+ this._busy = false;
342
+ this.emit('swipe', { direction, card });
343
+ if (!this.top)
344
+ this.emit('empty');
345
+ }
346
+ }, { id: 'card-stack', text: css$2 });
347
+ }
348
+
349
+ var css$1 = "usa-sticky-stack{display:grid;gap:28vh;padding-bottom:10vh}usa-sticky-stack>*{position:sticky;transform-origin:50% 0;will-change:transform}";
350
+
351
+ function defineStickyStack(tag = 'usa-sticky-stack') {
352
+ return defineElement(tag, (Base) => class UsaStickyStack extends Base {
353
+ constructor() {
354
+ super(...arguments);
355
+ this._frame = 0;
356
+ }
357
+ static get observedAttributes() {
358
+ return ['top', 'gap', 'scale'];
359
+ }
360
+ mount() {
361
+ const top = this.num('top', 80);
362
+ const gap = this.num('gap', 16);
363
+ const cards = Array.from(this.children);
364
+ cards.forEach((c, i) => {
365
+ c.style.top = `${top + i * gap}px`;
366
+ c.style.zIndex = String(i + 1);
367
+ });
368
+ if (this.reduced)
369
+ return;
370
+ const schedule = () => {
371
+ if (!this._frame)
372
+ this._frame = raf(() => this.update());
373
+ };
374
+ let active = false;
375
+ this.inView((v) => {
376
+ if (v && !active) {
377
+ active = true;
378
+ window.addEventListener('scroll', schedule, { passive: true });
379
+ window.addEventListener('resize', schedule, { passive: true });
380
+ schedule();
381
+ }
382
+ else if (!v && active) {
383
+ active = false;
384
+ window.removeEventListener('scroll', schedule);
385
+ window.removeEventListener('resize', schedule);
386
+ }
387
+ });
388
+ this.onCleanup(() => {
389
+ window.removeEventListener('scroll', schedule);
390
+ window.removeEventListener('resize', schedule);
391
+ });
392
+ }
393
+ unmount() {
394
+ caf(this._frame);
395
+ this._frame = 0;
396
+ }
397
+ update() {
398
+ this._frame = 0;
399
+ const cards = Array.from(this.children);
400
+ const rects = cards.map((c) => c.getBoundingClientRect());
401
+ const shrink = this.num('scale', 0.06);
402
+ cards.forEach((c, i) => {
403
+ let covered = 0;
404
+ for (let j = i + 1; j < cards.length; j++) {
405
+ const h = rects[i].height || 1;
406
+ covered += clamp((rects[i].bottom - rects[j].top) / h, 0, 1);
407
+ }
408
+ const s = 1 - Math.min(3, covered) * shrink;
409
+ c.style.transform = covered > 0.001 ? `scale(${s.toFixed(4)})` : '';
410
+ c.style.filter = covered > 0.001 ? `brightness(${(1 - Math.min(0.35, covered * 0.12)).toFixed(3)})` : '';
411
+ });
412
+ }
413
+ }, { id: 'sticky-stack', text: css$1 });
414
+ }
415
+
416
+ var css = "usa-carousel-3d{position:relative;display:grid;place-items:center;perspective:var(--usa-c3d-perspective,1200px);transform-style:preserve-3d;touch-action:pan-y;user-select:none;-webkit-user-select:none;min-height:220px}usa-carousel-3d>*{grid-area:1 / 1;backface-visibility:hidden;transition:opacity 0.3s ease;cursor:pointer}usa-carousel-3d>[aria-current]{cursor:default}usa-carousel-3d:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:4px;border-radius:12px}@media (prefers-reduced-motion:reduce){usa-carousel-3d{perspective:none}usa-carousel-3d>:not([aria-current]){visibility:hidden}}";
417
+
418
+ function defineCarousel3d(tag = 'usa-carousel-3d') {
419
+ return defineElement(tag, (Base) => class UsaCarousel3d extends Base {
420
+ constructor() {
421
+ super(...arguments);
422
+ this._i = 0;
423
+ }
424
+ static get observedAttributes() {
425
+ return ['radius', 'perspective', 'autoplay'];
426
+ }
427
+ get index() {
428
+ return this._i;
429
+ }
430
+ set index(v) {
431
+ this.goTo(v);
432
+ }
433
+ items() {
434
+ return Array.from(this.children);
435
+ }
436
+ render(angle) {
437
+ const items = this.items();
438
+ const n = items.length || 1;
439
+ const step = 360 / n;
440
+ const w = items[0]?.offsetWidth || 200;
441
+ const r = this.num('radius', Math.round(w / 2 / Math.tan(Math.PI / n)) + 24);
442
+ const reduced = this.reduced;
443
+ items.forEach((it, i) => {
444
+ const norm = ((((i * step - angle) % 360) + 540) % 360) - 180;
445
+ it.style.transform = reduced ? '' : `rotateY(${norm.toFixed(2)}deg) translateZ(${r}px)`;
446
+ it.style.opacity = reduced ? (i === this._i ? '1' : '0') : String(Math.max(0.25, 1 - Math.abs(norm) / 200));
447
+ });
448
+ }
449
+ mount() {
450
+ this.style.setProperty('--usa-c3d-perspective', `${this.num('perspective', 1200)}px`);
451
+ if (!this.hasAttribute('tabindex'))
452
+ this.tabIndex = 0;
453
+ this.setAttribute('role', 'region');
454
+ this.setAttribute('aria-roledescription', 'carousel');
455
+ this._i = Math.max(0, Math.min(this.items().length - 1, this.num('index', 0)));
456
+ const step = () => 360 / (this.items().length || 1);
457
+ this._angle = createSpring({ value: this._i * step(), spring: 'gentle', onUpdate: (v) => this.render(v) });
458
+ this.render(this._angle.value);
459
+ this.mark();
460
+ this.listen(this, 'keydown', (e) => {
461
+ if (e.key === 'ArrowRight')
462
+ this.next();
463
+ else if (e.key === 'ArrowLeft')
464
+ this.prev();
465
+ else
466
+ return;
467
+ e.preventDefault();
468
+ });
469
+ let x0 = null;
470
+ this.listen(this, 'pointerdown', (e) => (x0 = e.clientX));
471
+ this.listen(this, 'pointerup', (e) => {
472
+ if (x0 === null)
473
+ return;
474
+ const dx = e.clientX - x0;
475
+ x0 = null;
476
+ if (Math.abs(dx) > 40)
477
+ dx < 0 ? this.next() : this.prev();
478
+ });
479
+ this.listen(this, 'click', (e) => {
480
+ const it = this.items().find((c) => c.contains(e.target));
481
+ if (it) {
482
+ const i = this.items().indexOf(it);
483
+ if (i !== this._i)
484
+ this.goTo(i);
485
+ }
486
+ });
487
+ const every = this.num('autoplay', 0);
488
+ if (every > 0 && !this.reduced) {
489
+ let paused = false;
490
+ const pause = () => (paused = true);
491
+ const resume = () => (paused = false);
492
+ this.listen(this, 'pointerenter', pause);
493
+ this.listen(this, 'pointerleave', resume);
494
+ this.listen(this, 'focusin', pause);
495
+ this.listen(this, 'focusout', resume);
496
+ const t = setInterval(() => !paused && !document.hidden && this.next(), every);
497
+ this.onCleanup(() => clearInterval(t));
498
+ }
499
+ }
500
+ unmount() {
501
+ this._angle?.stop();
502
+ }
503
+ mark() {
504
+ this.items().forEach((it, i) => {
505
+ if (i === this._i)
506
+ it.setAttribute('aria-current', 'true');
507
+ else
508
+ it.removeAttribute('aria-current');
509
+ });
510
+ }
511
+ goTo(i) {
512
+ const n = this.items().length;
513
+ if (!n || !this._angle)
514
+ return;
515
+ const step = 360 / n;
516
+ // shortest rotation from the current target
517
+ const cur = this._angle.target;
518
+ const curIdx = Math.round(cur / step);
519
+ let delta = (((i - curIdx) % n) + n) % n;
520
+ if (delta > n / 2)
521
+ delta -= n;
522
+ this._i = ((i % n) + n) % n;
523
+ this._angle.set((curIdx + delta) * step);
524
+ if (this.reduced)
525
+ this.render(this._angle.value);
526
+ this.mark();
527
+ this.emit('change', { index: this._i });
528
+ }
529
+ next() {
530
+ this.goTo(this._i + 1);
531
+ }
532
+ prev() {
533
+ this.goTo(this._i - 1);
534
+ }
535
+ }, { id: 'carousel-3d', text: css });
536
+ }
537
+
538
+ /**
539
+ * motionary/components/cards — card effects (v2.4).
540
+ * `<usa-card effect="flip | holo | glass | border-glow | conic-border | lift |
541
+ * spotlight | sheen | parallax-layers | expand">` (combinable),
542
+ * `<usa-card-stack>` (swipeable deck), `<usa-sticky-stack>` (stacking on
543
+ * scroll) and `<usa-carousel-3d>`.
544
+ */
545
+ /** Register every component of this category under its default tag. */
546
+ function defineCardComponents() {
547
+ defineCard();
548
+ defineCardStack();
549
+ defineStickyStack();
550
+ defineCarousel3d();
551
+ }
552
+
553
+ export { CARD_EFFECTS, defineCard, defineCardComponents, defineCardStack, defineCarousel3d, defineStickyStack };
554
+ //# sourceMappingURL=cards.js.map