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,53 @@
1
+ /** The component categories and their default tags. */
2
+ declare const COMPONENT_CATEGORIES: {
3
+ readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
4
+ readonly text: readonly ["usa-typewriter", "usa-split-text", "usa-scramble", "usa-counter", "usa-shimmer-text", "usa-text-rotate", "usa-wave-text", "usa-glitch", "usa-gradient-text", "usa-handwriting", "usa-scroll-highlight"];
5
+ readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
6
+ readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
7
+ readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
8
+ readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-view-switch"];
9
+ readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
10
+ readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
11
+ readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
12
+ readonly ui: readonly ["usa-tabs", "usa-drawer", "usa-bottom-sheet", "usa-pull-refresh", "usa-fab", "usa-navbar", "usa-slider", "usa-rating", "usa-tooltip", "usa-popover", "usa-badge", "usa-avatar-stack"];
13
+ readonly page: readonly ["usa-cursor", "usa-fullpage", "usa-loading-bar", "usa-back-to-top", "usa-ambient", "usa-splash", "usa-auto-skeleton", "usa-motion-switch"];
14
+ readonly timeline: readonly ["usa-timeline"];
15
+ readonly gesture: readonly ["usa-swipeable", "usa-pinch-zoom"];
16
+ readonly svg: readonly ["usa-draw", "usa-morph", "usa-mask-reveal", "usa-anim-icon"];
17
+ readonly webgl: readonly ["usa-shader", "usa-distort", "usa-liquid", "usa-post-fx"];
18
+ readonly depth: readonly ["usa-cube", "usa-depth"];
19
+ readonly layout: readonly ["usa-auto-animate", "usa-masonry"];
20
+ readonly packs: readonly ["usa-pack"];
21
+ readonly fx: readonly ["usa-fx"];
22
+ };
23
+
24
+ /**
25
+ * motionary/components/jsx — JSX typings for the raw `<usa-*>` tags (v2.9).
26
+ *
27
+ * ```ts
28
+ * // src/usa-jsx.d.ts (React 18/19)
29
+ * import type { UsaIntrinsicElements } from 'motionary/components/jsx';
30
+ * declare module 'react' { namespace JSX { interface IntrinsicElements extends UsaIntrinsicElements {} } }
31
+ * // Solid / Preact / other JSX: extend their JSX.IntrinsicElements the same way.
32
+ * ```
33
+ */
34
+
35
+ type Tags = (typeof COMPONENT_CATEGORIES)[keyof typeof COMPONENT_CATEGORIES][number];
36
+ /** Attributes accepted by every `<usa-*>` element (all component attributes are strings / booleans). */
37
+ interface UsaAttributes {
38
+ [attr: string]: unknown;
39
+ class?: string;
40
+ className?: string;
41
+ id?: string;
42
+ style?: unknown;
43
+ slot?: string;
44
+ variant?: 'minimal' | 'neon' | 'glass' | 'brutalist' | 'fluent' | 'material' | (string & {});
45
+ children?: unknown;
46
+ ref?: unknown;
47
+ }
48
+ type UsaIntrinsicElements = {
49
+ [K in Tags]: UsaAttributes;
50
+ };
51
+ type UsaTag = Tags;
52
+
53
+ export type { UsaAttributes, UsaIntrinsicElements, UsaTag };
@@ -0,0 +1,53 @@
1
+ /** The component categories and their default tags. */
2
+ declare const COMPONENT_CATEGORIES: {
3
+ readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
4
+ readonly text: readonly ["usa-typewriter", "usa-split-text", "usa-scramble", "usa-counter", "usa-shimmer-text", "usa-text-rotate", "usa-wave-text", "usa-glitch", "usa-gradient-text", "usa-handwriting", "usa-scroll-highlight"];
5
+ readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
6
+ readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
7
+ readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
8
+ readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-view-switch"];
9
+ readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
10
+ readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
11
+ readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
12
+ readonly ui: readonly ["usa-tabs", "usa-drawer", "usa-bottom-sheet", "usa-pull-refresh", "usa-fab", "usa-navbar", "usa-slider", "usa-rating", "usa-tooltip", "usa-popover", "usa-badge", "usa-avatar-stack"];
13
+ readonly page: readonly ["usa-cursor", "usa-fullpage", "usa-loading-bar", "usa-back-to-top", "usa-ambient", "usa-splash", "usa-auto-skeleton", "usa-motion-switch"];
14
+ readonly timeline: readonly ["usa-timeline"];
15
+ readonly gesture: readonly ["usa-swipeable", "usa-pinch-zoom"];
16
+ readonly svg: readonly ["usa-draw", "usa-morph", "usa-mask-reveal", "usa-anim-icon"];
17
+ readonly webgl: readonly ["usa-shader", "usa-distort", "usa-liquid", "usa-post-fx"];
18
+ readonly depth: readonly ["usa-cube", "usa-depth"];
19
+ readonly layout: readonly ["usa-auto-animate", "usa-masonry"];
20
+ readonly packs: readonly ["usa-pack"];
21
+ readonly fx: readonly ["usa-fx"];
22
+ };
23
+
24
+ /**
25
+ * motionary/components/jsx — JSX typings for the raw `<usa-*>` tags (v2.9).
26
+ *
27
+ * ```ts
28
+ * // src/usa-jsx.d.ts (React 18/19)
29
+ * import type { UsaIntrinsicElements } from 'motionary/components/jsx';
30
+ * declare module 'react' { namespace JSX { interface IntrinsicElements extends UsaIntrinsicElements {} } }
31
+ * // Solid / Preact / other JSX: extend their JSX.IntrinsicElements the same way.
32
+ * ```
33
+ */
34
+
35
+ type Tags = (typeof COMPONENT_CATEGORIES)[keyof typeof COMPONENT_CATEGORIES][number];
36
+ /** Attributes accepted by every `<usa-*>` element (all component attributes are strings / booleans). */
37
+ interface UsaAttributes {
38
+ [attr: string]: unknown;
39
+ class?: string;
40
+ className?: string;
41
+ id?: string;
42
+ style?: unknown;
43
+ slot?: string;
44
+ variant?: 'minimal' | 'neon' | 'glass' | 'brutalist' | 'fluent' | 'material' | (string & {});
45
+ children?: unknown;
46
+ ref?: unknown;
47
+ }
48
+ type UsaIntrinsicElements = {
49
+ [K in Tags]: UsaAttributes;
50
+ };
51
+ type UsaTag = Tags;
52
+
53
+ export type { UsaAttributes, UsaIntrinsicElements, UsaTag };
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=jsx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,257 @@
1
+ 'use strict';
2
+
3
+ var base = require('../chunks/base-BaQV-2ha.cjs');
4
+
5
+ /** FLIP keyframes from a previous box to the current one (pure). */
6
+ function flipFrames(from, to, scale = true) {
7
+ const dx = from.left - to.left;
8
+ const dy = from.top - to.top;
9
+ const sx = scale && to.width ? from.width / to.width : 1;
10
+ const sy = scale && to.height ? from.height / to.height : 1;
11
+ return [
12
+ { transformOrigin: '0 0', transform: `translate(${dx}px, ${dy}px) scale(${sx}, ${sy})` },
13
+ { transformOrigin: '0 0', transform: 'none' },
14
+ ];
15
+ }
16
+ /**
17
+ * Auto-animate a container: children that are added fade / scale in, removed
18
+ * ones fade out in place, and moved ones (re-sort, filter, reflow, resize)
19
+ * glide to their new spot — no extra code at the call site. Returns
20
+ * `{ disable, enable, stop }`. Reduced motion: changes apply instantly.
21
+ *
22
+ * @example
23
+ * const ctl = autoAnimate(document.querySelector('ul'));
24
+ * list.append(item); // animates
25
+ */
26
+ function autoAnimate(parent, o = {}) {
27
+ let on = true;
28
+ const boxes = new WeakMap();
29
+ const rel = (el) => {
30
+ const r = el.getBoundingClientRect();
31
+ const p = parent.getBoundingClientRect();
32
+ return { left: r.left - p.left, top: r.top - p.top, width: r.width, height: r.height };
33
+ };
34
+ const snap = () => Array.from(parent.children).forEach((c) => boxes.set(c, rel(c)));
35
+ const dur = () => (o.duration ?? 300) * base.motionScale();
36
+ const timing = () => ({ duration: dur(), easing: o.easing ?? base.EASE_OUT });
37
+ const animate = (el, frames, t = timing()) => (typeof el.animate === 'function' ? el.animate(frames, t) : null);
38
+ const mo = typeof MutationObserver === 'function'
39
+ ? new MutationObserver((records) => {
40
+ if (!on || base.prefersReducedMotion() || dur() <= 0)
41
+ return snap();
42
+ const added = new Set();
43
+ for (const r of records) {
44
+ r.addedNodes.forEach((n) => n instanceof Element && n.parentElement === parent && added.add(n));
45
+ r.removedNodes.forEach((n) => {
46
+ if (!(n instanceof HTMLElement) || n.isConnected)
47
+ return;
48
+ const b = boxes.get(n);
49
+ if (!b)
50
+ return;
51
+ // put a ghost back at its old place and fade it out
52
+ n.style.position = 'absolute';
53
+ n.style.left = `${b.left}px`;
54
+ n.style.top = `${b.top}px`;
55
+ n.style.width = `${b.width}px`;
56
+ n.style.height = `${b.height}px`;
57
+ n.style.margin = '0';
58
+ n.style.pointerEvents = 'none';
59
+ if (getComputedStyle(parent).position === 'static')
60
+ parent.style.position = 'relative';
61
+ parent.appendChild(n);
62
+ n.__usaGhost = true;
63
+ const a = animate(n, [{ opacity: 1, transform: 'none' }, { opacity: 0, transform: 'scale(0.96)' }]);
64
+ const drop = () => {
65
+ n.remove();
66
+ for (const k of ['position', 'left', 'top', 'width', 'height', 'margin', 'pointerEvents'])
67
+ n.style[k] = '';
68
+ };
69
+ if (a)
70
+ a.finished.then(drop, drop);
71
+ else
72
+ drop();
73
+ });
74
+ }
75
+ Array.from(parent.children).forEach((c) => {
76
+ if (c.__usaGhost)
77
+ return;
78
+ if (added.has(c))
79
+ return void animate(c, [{ opacity: 0, transform: 'scale(0.96)' }, { opacity: 1, transform: 'none' }]);
80
+ const prev = boxes.get(c);
81
+ if (!prev)
82
+ return;
83
+ const now = rel(c);
84
+ if (Math.abs(prev.left - now.left) + Math.abs(prev.top - now.top) + Math.abs(prev.width - now.width) + Math.abs(prev.height - now.height) < 1)
85
+ return;
86
+ animate(c, flipFrames(prev, now, o.scale !== false));
87
+ });
88
+ snap();
89
+ })
90
+ : null;
91
+ mo?.observe(parent, { childList: true });
92
+ const ro = typeof ResizeObserver === 'function' ? new ResizeObserver(() => snap()) : null;
93
+ ro?.observe(parent);
94
+ snap();
95
+ // capture boxes right before any change in the same task (events, timers)
96
+ const capture = () => snap();
97
+ parent.addEventListener('pointerdown', capture, true);
98
+ return {
99
+ enable: () => ((on = true), snap()),
100
+ disable: () => (on = false),
101
+ stop: () => {
102
+ mo?.disconnect();
103
+ ro?.disconnect();
104
+ parent.removeEventListener('pointerdown', capture, true);
105
+ },
106
+ };
107
+ }
108
+ /** Masonry placement: shortest-column-first positions for item heights (pure). */
109
+ function masonryLayout(heights, columns, columnWidth, gap) {
110
+ const cols = Array(Math.max(1, columns)).fill(0);
111
+ const out = heights.map((h) => {
112
+ const c = cols.indexOf(Math.min(...cols));
113
+ const pos = { x: c * (columnWidth + gap), y: cols[c] };
114
+ cols[c] += h + gap;
115
+ return pos;
116
+ });
117
+ out.height = Math.max(0, Math.max(...cols) - gap);
118
+ return out;
119
+ }
120
+ /**
121
+ * Shared-element transition between two states of the page: every element
122
+ * with `data-shared="id"` before `update()` flies to the element with the
123
+ * same id afterwards (size and position), the rest cross-fades. Uses the
124
+ * View Transitions API when present (with `view-transition-name` per id),
125
+ * otherwise a FLIP fallback. Reduced motion: just runs `update()`.
126
+ */
127
+ async function sharedTransition(update, root = document, o = {}) {
128
+ if (base.prefersReducedMotion() || typeof document === 'undefined')
129
+ return void (await update());
130
+ const collect = () => new Map(Array.from(root.querySelectorAll('[data-shared]')).map((el) => [el.dataset.shared, el]));
131
+ const doc = document;
132
+ if (typeof doc.startViewTransition === 'function') {
133
+ const named = (m) => m.forEach((el, id) => (el.style.viewTransitionName = `usa-${id.replace(/[^\w-]/g, '_')}`));
134
+ const clear = (m) => m.forEach((el) => (el.style.viewTransitionName = ''));
135
+ const before = collect();
136
+ named(before);
137
+ let after = new Map();
138
+ const vt = doc.startViewTransition(async () => {
139
+ clear(before);
140
+ await update();
141
+ after = collect();
142
+ named(after);
143
+ });
144
+ await vt.finished.catch(() => undefined);
145
+ clear(after);
146
+ return;
147
+ }
148
+ const before = new Map(Array.from(collect()).map(([id, el]) => [id, el.getBoundingClientRect()]));
149
+ await update();
150
+ const anims = [];
151
+ collect().forEach((el, id) => {
152
+ const a = before.get(id);
153
+ if (!a || typeof el.animate !== 'function')
154
+ return;
155
+ const b = el.getBoundingClientRect();
156
+ if (!b.width || !b.height)
157
+ return;
158
+ anims.push(el.animate(flipFrames(a, b), { duration: (o.duration ?? 450) * base.motionScale(), easing: o.easing ?? base.EASE_OUT }).finished.catch(() => undefined));
159
+ });
160
+ await Promise.all(anims);
161
+ }
162
+
163
+ var css = "usa-auto-animate{display:block}usa-masonry{display:block;column-width:220px;column-gap:16px}usa-masonry>*{break-inside:avoid;margin-bottom:16px}usa-masonry[data-js]{position:relative;columns:auto}usa-masonry[data-js]>*{position:absolute;left:0;top:0;margin:0;box-sizing:border-box;transition:transform 0.45s cubic-bezier(0.22,1,0.36,1)}@media (prefers-reduced-motion:reduce){usa-masonry[data-js]>*{transition:none}}";
164
+
165
+ function defineAutoAnimate(tag = 'usa-auto-animate') {
166
+ return base.defineElement(tag, (Base) => class UsaAutoAnimate extends Base {
167
+ constructor() {
168
+ super(...arguments);
169
+ this._c = null;
170
+ }
171
+ enable() {
172
+ this._c?.enable();
173
+ }
174
+ disable() {
175
+ this._c?.disable();
176
+ }
177
+ mount() {
178
+ const c = (this._c = autoAnimate(this, { duration: this.num('duration', 300), scale: !this.flag('no-scale') }));
179
+ this.onCleanup(() => c.stop());
180
+ }
181
+ }, { id: 'layout', text: css });
182
+ }
183
+ function defineMasonry(tag = 'usa-masonry') {
184
+ return base.defineElement(tag, (Base) => class UsaMasonry extends Base {
185
+ static get observedAttributes() {
186
+ return ['columns', 'min', 'gap'];
187
+ }
188
+ changed() {
189
+ this.layout();
190
+ }
191
+ layout() {
192
+ const items = Array.from(this.children).filter((c) => !c.__usaGhost);
193
+ const w = this.clientWidth;
194
+ if (!w)
195
+ return;
196
+ const gap = this.num('gap', 16);
197
+ const cols = this.num('columns', 0) || Math.max(1, Math.floor((w + gap) / (this.num('min', 220) + gap)));
198
+ const cw = (w - gap * (cols - 1)) / cols;
199
+ items.forEach((el) => (el.style.width = `${cw}px`));
200
+ const pos = masonryLayout(items.map((el) => el.offsetHeight), cols, cw, gap);
201
+ items.forEach((el, i) => (el.style.transform = `translate(${pos[i].x}px, ${pos[i].y}px)`));
202
+ this.style.height = `${pos.height}px`;
203
+ this.style.setProperty('--usa-masonry-cols', String(cols));
204
+ }
205
+ mount() {
206
+ this.setAttribute('data-js', '');
207
+ this.onCleanup(() => this.removeAttribute('data-js'));
208
+ let id = 0;
209
+ const queue = () => {
210
+ if (id)
211
+ return;
212
+ id = requestAnimationFrame(() => {
213
+ id = 0;
214
+ this.layout();
215
+ });
216
+ };
217
+ if (typeof ResizeObserver === 'function') {
218
+ const ro = new ResizeObserver(queue);
219
+ ro.observe(this);
220
+ Array.from(this.children).forEach((c) => ro.observe(c));
221
+ const mo = new MutationObserver((recs) => {
222
+ recs.forEach((r) => r.addedNodes.forEach((n) => n instanceof Element && ro.observe(n)));
223
+ queue();
224
+ });
225
+ mo.observe(this, { childList: true });
226
+ this.onCleanup(() => (ro.disconnect(), mo.disconnect()));
227
+ }
228
+ this.listen(this, 'load', queue, { capture: true });
229
+ this.layout();
230
+ }
231
+ unmount() {
232
+ this.style.height = '';
233
+ Array.from(this.children).forEach((c) => (c.style.transform = '', c.style.width = ''));
234
+ }
235
+ }, { id: 'layout', text: css });
236
+ }
237
+
238
+ /**
239
+ * motionary/components/layout — layout animation (v3.6).
240
+ * `autoAnimate()` / `<usa-auto-animate>` (list & grid reflow),
241
+ * `<usa-masonry>`, and `sharedTransition()` for shared-element transitions
242
+ * (View Transitions API with a FLIP fallback).
243
+ */
244
+ /** Register every component of this category under its default tag. */
245
+ function defineLayoutComponents() {
246
+ defineAutoAnimate();
247
+ defineMasonry();
248
+ }
249
+
250
+ exports.autoAnimate = autoAnimate;
251
+ exports.defineAutoAnimate = defineAutoAnimate;
252
+ exports.defineLayoutComponents = defineLayoutComponents;
253
+ exports.defineMasonry = defineMasonry;
254
+ exports.flipFrames = flipFrames;
255
+ exports.masonryLayout = masonryLayout;
256
+ exports.sharedTransition = sharedTransition;
257
+ //# sourceMappingURL=layout.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.cjs","sources":["../../src/components/layout/core.ts","../../src/components/layout/elements.ts","../../src/components/layout/index.ts"],"sourcesContent":["import { prefersReducedMotion, motionScale, EASE_OUT } from '../base';\n\ntype Box = { left: number; top: number; width: number; height: number };\n\n/** FLIP keyframes from a previous box to the current one (pure). */\nexport function flipFrames(from: Box, to: Box, scale = true): Keyframe[] {\n const dx = from.left - to.left;\n const dy = from.top - to.top;\n const sx = scale && to.width ? from.width / to.width : 1;\n const sy = scale && to.height ? from.height / to.height : 1;\n return [\n { transformOrigin: '0 0', transform: `translate(${dx}px, ${dy}px) scale(${sx}, ${sy})` },\n { transformOrigin: '0 0', transform: 'none' },\n ];\n}\n\nexport interface AutoAnimateOptions {\n duration?: number;\n easing?: string;\n /** Also animate size changes (default true). */\n scale?: boolean;\n}\n\n/**\n * Auto-animate a container: children that are added fade / scale in, removed\n * ones fade out in place, and moved ones (re-sort, filter, reflow, resize)\n * glide to their new spot — no extra code at the call site. Returns\n * `{ disable, enable, stop }`. Reduced motion: changes apply instantly.\n *\n * @example\n * const ctl = autoAnimate(document.querySelector('ul'));\n * list.append(item); // animates\n */\nexport function autoAnimate(parent: HTMLElement, o: AutoAnimateOptions = {}): { enable(): void; disable(): void; stop(): void } {\n let on = true;\n const boxes = new WeakMap<Element, Box>();\n const rel = (el: Element): Box => {\n const r = el.getBoundingClientRect();\n const p = parent.getBoundingClientRect();\n return { left: r.left - p.left, top: r.top - p.top, width: r.width, height: r.height };\n };\n const snap = () => Array.from(parent.children).forEach((c) => boxes.set(c, rel(c)));\n const dur = () => (o.duration ?? 300) * motionScale();\n const timing = (): KeyframeAnimationOptions => ({ duration: dur(), easing: o.easing ?? EASE_OUT });\n const animate = (el: Element, frames: Keyframe[], t = timing()) => (typeof (el as HTMLElement).animate === 'function' ? (el as HTMLElement).animate(frames, t) : null);\n\n const mo =\n typeof MutationObserver === 'function'\n ? new MutationObserver((records) => {\n if (!on || prefersReducedMotion() || dur() <= 0) return snap();\n const added = new Set<Element>();\n for (const r of records) {\n r.addedNodes.forEach((n) => n instanceof Element && n.parentElement === parent && added.add(n));\n r.removedNodes.forEach((n) => {\n if (!(n instanceof HTMLElement) || n.isConnected) return;\n const b = boxes.get(n);\n if (!b) return;\n // put a ghost back at its old place and fade it out\n n.style.position = 'absolute';\n n.style.left = `${b.left}px`;\n n.style.top = `${b.top}px`;\n n.style.width = `${b.width}px`;\n n.style.height = `${b.height}px`;\n n.style.margin = '0';\n n.style.pointerEvents = 'none';\n if (getComputedStyle(parent).position === 'static') parent.style.position = 'relative';\n parent.appendChild(n);\n (n as any).__usaGhost = true;\n const a = animate(n, [{ opacity: 1, transform: 'none' }, { opacity: 0, transform: 'scale(0.96)' }]);\n const drop = () => {\n n.remove();\n for (const k of ['position', 'left', 'top', 'width', 'height', 'margin', 'pointerEvents'] as const) n.style[k] = '';\n };\n if (a) a.finished.then(drop, drop);\n else drop();\n });\n }\n Array.from(parent.children).forEach((c) => {\n if ((c as any).__usaGhost) return;\n if (added.has(c)) return void animate(c, [{ opacity: 0, transform: 'scale(0.96)' }, { opacity: 1, transform: 'none' }]);\n const prev = boxes.get(c);\n if (!prev) return;\n const now = rel(c);\n if (Math.abs(prev.left - now.left) + Math.abs(prev.top - now.top) + Math.abs(prev.width - now.width) + Math.abs(prev.height - now.height) < 1) return;\n animate(c, flipFrames(prev, now, o.scale !== false));\n });\n snap();\n })\n : null;\n mo?.observe(parent, { childList: true });\n const ro = typeof ResizeObserver === 'function' ? new ResizeObserver(() => snap()) : null;\n ro?.observe(parent);\n snap();\n // capture boxes right before any change in the same task (events, timers)\n const capture = () => snap();\n parent.addEventListener('pointerdown', capture, true);\n return {\n enable: () => ((on = true), snap()),\n disable: () => (on = false),\n stop: () => {\n mo?.disconnect();\n ro?.disconnect();\n parent.removeEventListener('pointerdown', capture, true);\n },\n };\n}\n\n/** Masonry placement: shortest-column-first positions for item heights (pure). */\nexport function masonryLayout(heights: number[], columns: number, columnWidth: number, gap: number): { x: number; y: number }[] & { height?: number } {\n const cols = Array(Math.max(1, columns)).fill(0);\n const out = heights.map((h) => {\n const c = cols.indexOf(Math.min(...cols));\n const pos = { x: c * (columnWidth + gap), y: cols[c] };\n cols[c] += h + gap;\n return pos;\n }) as { x: number; y: number }[] & { height?: number };\n out.height = Math.max(0, Math.max(...cols) - gap);\n return out;\n}\n\nexport interface SharedOptions {\n duration?: number;\n easing?: string;\n}\n\n/**\n * Shared-element transition between two states of the page: every element\n * with `data-shared=\"id\"` before `update()` flies to the element with the\n * same id afterwards (size and position), the rest cross-fades. Uses the\n * View Transitions API when present (with `view-transition-name` per id),\n * otherwise a FLIP fallback. Reduced motion: just runs `update()`.\n */\nexport async function sharedTransition(update: () => void | Promise<void>, root: ParentNode = document, o: SharedOptions = {}): Promise<void> {\n if (prefersReducedMotion() || typeof document === 'undefined') return void (await update());\n const collect = () => new Map(Array.from(root.querySelectorAll<HTMLElement>('[data-shared]')).map((el) => [el.dataset.shared!, el]));\n const doc = document as any;\n if (typeof doc.startViewTransition === 'function') {\n const named = (m: Map<string, HTMLElement>) => m.forEach((el, id) => (el.style.viewTransitionName = `usa-${id.replace(/[^\\w-]/g, '_')}`));\n const clear = (m: Map<string, HTMLElement>) => m.forEach((el) => (el.style.viewTransitionName = ''));\n const before = collect();\n named(before);\n let after = new Map<string, HTMLElement>();\n const vt = doc.startViewTransition(async () => {\n clear(before);\n await update();\n after = collect();\n named(after);\n });\n await vt.finished.catch(() => undefined);\n clear(after);\n return;\n }\n const before = new Map(Array.from(collect()).map(([id, el]) => [id, el.getBoundingClientRect()]));\n await update();\n const anims: Promise<unknown>[] = [];\n collect().forEach((el, id) => {\n const a = before.get(id);\n if (!a || typeof el.animate !== 'function') return;\n const b = el.getBoundingClientRect();\n if (!b.width || !b.height) return;\n anims.push(el.animate(flipFrames(a, b), { duration: (o.duration ?? 450) * motionScale(), easing: o.easing ?? EASE_OUT }).finished.catch(() => undefined));\n });\n await Promise.all(anims);\n}\n","import { defineElement, type UsaElement } from '../base';\nimport { autoAnimate, masonryLayout } from './core';\nimport css from './layout.css?raw';\n\n/**\n * `<usa-auto-animate>` — wraps `autoAnimate()`: any change to its children\n * (add, remove, re-order, filter, size) animates. Attributes `duration`\n * (300), `no-scale`. Works for lists and CSS grids alike.\n */\nexport interface UsaAutoAnimateElement extends UsaElement {\n enable(): void;\n disable(): void;\n}\n\nexport function defineAutoAnimate(tag = 'usa-auto-animate'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaAutoAnimate extends Base {\n private _c: ReturnType<typeof autoAnimate> | null = null;\n enable(): void {\n this._c?.enable();\n }\n disable(): void {\n this._c?.disable();\n }\n mount(): void {\n const c = (this._c = autoAnimate(this, { duration: this.num('duration', 300), scale: !this.flag('no-scale') }));\n this.onCleanup(() => c.stop());\n }\n },\n { id: 'layout', text: css }\n );\n}\n\n/**\n * `<usa-masonry>` — a masonry (Pinterest-style) grid: children are placed in\n * the shortest column and glide to new spots when the width, the items or\n * their sizes change. Attributes `columns` (fixed count) or `min` (min\n * column width px, 220), `gap` (16). Without JS layout support it is a\n * plain CSS multi-column flow. Reduced motion: no glide.\n */\nexport interface UsaMasonryElement extends UsaElement {\n layout(): void;\n}\n\nexport function defineMasonry(tag = 'usa-masonry'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaMasonry extends Base {\n static get observedAttributes(): string[] {\n return ['columns', 'min', 'gap'];\n }\n changed(): void {\n this.layout();\n }\n layout(): void {\n const items = Array.from(this.children).filter((c) => !(c as any).__usaGhost) as HTMLElement[];\n const w = this.clientWidth;\n if (!w) return;\n const gap = this.num('gap', 16);\n const cols = this.num('columns', 0) || Math.max(1, Math.floor((w + gap) / (this.num('min', 220) + gap)));\n const cw = (w - gap * (cols - 1)) / cols;\n items.forEach((el) => (el.style.width = `${cw}px`));\n const pos = masonryLayout(items.map((el) => el.offsetHeight), cols, cw, gap);\n items.forEach((el, i) => (el.style.transform = `translate(${pos[i].x}px, ${pos[i].y}px)`));\n this.style.height = `${pos.height}px`;\n this.style.setProperty('--usa-masonry-cols', String(cols));\n }\n mount(): void {\n this.setAttribute('data-js', '');\n this.onCleanup(() => this.removeAttribute('data-js'));\n let id = 0;\n const queue = () => {\n if (id) return;\n id = requestAnimationFrame(() => {\n id = 0;\n this.layout();\n });\n };\n if (typeof ResizeObserver === 'function') {\n const ro = new ResizeObserver(queue);\n ro.observe(this);\n Array.from(this.children).forEach((c) => ro.observe(c));\n const mo = new MutationObserver((recs) => {\n recs.forEach((r) => r.addedNodes.forEach((n) => n instanceof Element && ro.observe(n)));\n queue();\n });\n mo.observe(this, { childList: true });\n this.onCleanup(() => (ro.disconnect(), mo.disconnect()));\n }\n this.listen(this, 'load', queue, { capture: true });\n this.layout();\n }\n unmount(): void {\n this.style.height = '';\n Array.from(this.children).forEach((c) => ((c as HTMLElement).style.transform = '', (c as HTMLElement).style.width = ''));\n }\n },\n { id: 'layout', text: css }\n );\n}\n","/**\n * motionary/components/layout — layout animation (v3.6).\n * `autoAnimate()` / `<usa-auto-animate>` (list & grid reflow),\n * `<usa-masonry>`, and `sharedTransition()` for shared-element transitions\n * (View Transitions API with a FLIP fallback).\n */\nimport { defineAutoAnimate, defineMasonry, type UsaAutoAnimateElement, type UsaMasonryElement } from './elements';\n\nexport { defineAutoAnimate, defineMasonry };\nexport { autoAnimate, masonryLayout, sharedTransition, flipFrames } from './core';\nexport type { AutoAnimateOptions, SharedOptions } from './core';\nexport type { UsaAutoAnimateElement, UsaMasonryElement };\n\n/** Register every component of this category under its default tag. */\nexport function defineLayoutComponents(): void {\n defineAutoAnimate();\n defineMasonry();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-auto-animate': UsaAutoAnimateElement;\n 'usa-masonry':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UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC;YAC1D;AACA,YAAA,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YACnD,IAAI,CAAC,MAAM,EAAE;QACf;QACA,OAAO,GAAA;AACL,YAAA,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE;AACtB,YAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAO,CAAiB,CAAC,KAAK,CAAC,SAAS,GAAG,EAAE,EAAG,CAAiB,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;QAC1H;KACD,EACH,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,CAC5B;AACH;;ACtGA;;;;;AAKG;AAQH;SACgB,sBAAsB,GAAA;AACpC,IAAA,iBAAiB,EAAE;AACnB,IAAA,aAAa,EAAE;AACjB;;;;;;;;;;"}
@@ -0,0 +1,3 @@
1
+ /* motionary/components/layout */
2
+ .usa-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
3
+ usa-auto-animate{display:block}usa-masonry{display:block;column-width:220px;column-gap:16px}usa-masonry>*{break-inside:avoid;margin-bottom:16px}usa-masonry[data-js]{position:relative;columns:auto}usa-masonry[data-js]>*{position:absolute;left:0;top:0;margin:0;box-sizing:border-box;transition:transform 0.45s cubic-bezier(0.22,1,0.36,1)}@media (prefers-reduced-motion:reduce){usa-masonry[data-js]>*{transition:none}}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Members shared by every `<usa-*>` element. Attribute helpers, a cleanup
3
+ * bag that is emptied on disconnect, and motion helpers that degrade to the
4
+ * final state without WAAPI or under reduced motion.
5
+ */
6
+ interface UsaElement extends HTMLElement {
7
+ /** `true` while reduced motion applies to this element. */
8
+ readonly reduced: boolean;
9
+ }
10
+
11
+ /**
12
+ * `<usa-auto-animate>` — wraps `autoAnimate()`: any change to its children
13
+ * (add, remove, re-order, filter, size) animates. Attributes `duration`
14
+ * (300), `no-scale`. Works for lists and CSS grids alike.
15
+ */
16
+ interface UsaAutoAnimateElement extends UsaElement {
17
+ enable(): void;
18
+ disable(): void;
19
+ }
20
+ declare function defineAutoAnimate(tag?: string): CustomElementConstructor | undefined;
21
+ /**
22
+ * `<usa-masonry>` — a masonry (Pinterest-style) grid: children are placed in
23
+ * the shortest column and glide to new spots when the width, the items or
24
+ * their sizes change. Attributes `columns` (fixed count) or `min` (min
25
+ * column width px, 220), `gap` (16). Without JS layout support it is a
26
+ * plain CSS multi-column flow. Reduced motion: no glide.
27
+ */
28
+ interface UsaMasonryElement extends UsaElement {
29
+ layout(): void;
30
+ }
31
+ declare function defineMasonry(tag?: string): CustomElementConstructor | undefined;
32
+
33
+ type Box = {
34
+ left: number;
35
+ top: number;
36
+ width: number;
37
+ height: number;
38
+ };
39
+ /** FLIP keyframes from a previous box to the current one (pure). */
40
+ declare function flipFrames(from: Box, to: Box, scale?: boolean): Keyframe[];
41
+ interface AutoAnimateOptions {
42
+ duration?: number;
43
+ easing?: string;
44
+ /** Also animate size changes (default true). */
45
+ scale?: boolean;
46
+ }
47
+ /**
48
+ * Auto-animate a container: children that are added fade / scale in, removed
49
+ * ones fade out in place, and moved ones (re-sort, filter, reflow, resize)
50
+ * glide to their new spot — no extra code at the call site. Returns
51
+ * `{ disable, enable, stop }`. Reduced motion: changes apply instantly.
52
+ *
53
+ * @example
54
+ * const ctl = autoAnimate(document.querySelector('ul'));
55
+ * list.append(item); // animates
56
+ */
57
+ declare function autoAnimate(parent: HTMLElement, o?: AutoAnimateOptions): {
58
+ enable(): void;
59
+ disable(): void;
60
+ stop(): void;
61
+ };
62
+ /** Masonry placement: shortest-column-first positions for item heights (pure). */
63
+ declare function masonryLayout(heights: number[], columns: number, columnWidth: number, gap: number): {
64
+ x: number;
65
+ y: number;
66
+ }[] & {
67
+ height?: number;
68
+ };
69
+ interface SharedOptions {
70
+ duration?: number;
71
+ easing?: string;
72
+ }
73
+ /**
74
+ * Shared-element transition between two states of the page: every element
75
+ * with `data-shared="id"` before `update()` flies to the element with the
76
+ * same id afterwards (size and position), the rest cross-fades. Uses the
77
+ * View Transitions API when present (with `view-transition-name` per id),
78
+ * otherwise a FLIP fallback. Reduced motion: just runs `update()`.
79
+ */
80
+ declare function sharedTransition(update: () => void | Promise<void>, root?: ParentNode, o?: SharedOptions): Promise<void>;
81
+
82
+ /**
83
+ * motionary/components/layout — layout animation (v3.6).
84
+ * `autoAnimate()` / `<usa-auto-animate>` (list & grid reflow),
85
+ * `<usa-masonry>`, and `sharedTransition()` for shared-element transitions
86
+ * (View Transitions API with a FLIP fallback).
87
+ */
88
+
89
+ /** Register every component of this category under its default tag. */
90
+ declare function defineLayoutComponents(): void;
91
+ declare global {
92
+ interface HTMLElementTagNameMap {
93
+ 'usa-auto-animate': UsaAutoAnimateElement;
94
+ 'usa-masonry': UsaMasonryElement;
95
+ }
96
+ }
97
+
98
+ export { autoAnimate, defineAutoAnimate, defineLayoutComponents, defineMasonry, flipFrames, masonryLayout, sharedTransition };
99
+ export type { AutoAnimateOptions, SharedOptions, UsaAutoAnimateElement, UsaMasonryElement };
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Members shared by every `<usa-*>` element. Attribute helpers, a cleanup
3
+ * bag that is emptied on disconnect, and motion helpers that degrade to the
4
+ * final state without WAAPI or under reduced motion.
5
+ */
6
+ interface UsaElement extends HTMLElement {
7
+ /** `true` while reduced motion applies to this element. */
8
+ readonly reduced: boolean;
9
+ }
10
+
11
+ /**
12
+ * `<usa-auto-animate>` — wraps `autoAnimate()`: any change to its children
13
+ * (add, remove, re-order, filter, size) animates. Attributes `duration`
14
+ * (300), `no-scale`. Works for lists and CSS grids alike.
15
+ */
16
+ interface UsaAutoAnimateElement extends UsaElement {
17
+ enable(): void;
18
+ disable(): void;
19
+ }
20
+ declare function defineAutoAnimate(tag?: string): CustomElementConstructor | undefined;
21
+ /**
22
+ * `<usa-masonry>` — a masonry (Pinterest-style) grid: children are placed in
23
+ * the shortest column and glide to new spots when the width, the items or
24
+ * their sizes change. Attributes `columns` (fixed count) or `min` (min
25
+ * column width px, 220), `gap` (16). Without JS layout support it is a
26
+ * plain CSS multi-column flow. Reduced motion: no glide.
27
+ */
28
+ interface UsaMasonryElement extends UsaElement {
29
+ layout(): void;
30
+ }
31
+ declare function defineMasonry(tag?: string): CustomElementConstructor | undefined;
32
+
33
+ type Box = {
34
+ left: number;
35
+ top: number;
36
+ width: number;
37
+ height: number;
38
+ };
39
+ /** FLIP keyframes from a previous box to the current one (pure). */
40
+ declare function flipFrames(from: Box, to: Box, scale?: boolean): Keyframe[];
41
+ interface AutoAnimateOptions {
42
+ duration?: number;
43
+ easing?: string;
44
+ /** Also animate size changes (default true). */
45
+ scale?: boolean;
46
+ }
47
+ /**
48
+ * Auto-animate a container: children that are added fade / scale in, removed
49
+ * ones fade out in place, and moved ones (re-sort, filter, reflow, resize)
50
+ * glide to their new spot — no extra code at the call site. Returns
51
+ * `{ disable, enable, stop }`. Reduced motion: changes apply instantly.
52
+ *
53
+ * @example
54
+ * const ctl = autoAnimate(document.querySelector('ul'));
55
+ * list.append(item); // animates
56
+ */
57
+ declare function autoAnimate(parent: HTMLElement, o?: AutoAnimateOptions): {
58
+ enable(): void;
59
+ disable(): void;
60
+ stop(): void;
61
+ };
62
+ /** Masonry placement: shortest-column-first positions for item heights (pure). */
63
+ declare function masonryLayout(heights: number[], columns: number, columnWidth: number, gap: number): {
64
+ x: number;
65
+ y: number;
66
+ }[] & {
67
+ height?: number;
68
+ };
69
+ interface SharedOptions {
70
+ duration?: number;
71
+ easing?: string;
72
+ }
73
+ /**
74
+ * Shared-element transition between two states of the page: every element
75
+ * with `data-shared="id"` before `update()` flies to the element with the
76
+ * same id afterwards (size and position), the rest cross-fades. Uses the
77
+ * View Transitions API when present (with `view-transition-name` per id),
78
+ * otherwise a FLIP fallback. Reduced motion: just runs `update()`.
79
+ */
80
+ declare function sharedTransition(update: () => void | Promise<void>, root?: ParentNode, o?: SharedOptions): Promise<void>;
81
+
82
+ /**
83
+ * motionary/components/layout — layout animation (v3.6).
84
+ * `autoAnimate()` / `<usa-auto-animate>` (list & grid reflow),
85
+ * `<usa-masonry>`, and `sharedTransition()` for shared-element transitions
86
+ * (View Transitions API with a FLIP fallback).
87
+ */
88
+
89
+ /** Register every component of this category under its default tag. */
90
+ declare function defineLayoutComponents(): void;
91
+ declare global {
92
+ interface HTMLElementTagNameMap {
93
+ 'usa-auto-animate': UsaAutoAnimateElement;
94
+ 'usa-masonry': UsaMasonryElement;
95
+ }
96
+ }
97
+
98
+ export { autoAnimate, defineAutoAnimate, defineLayoutComponents, defineMasonry, flipFrames, masonryLayout, sharedTransition };
99
+ export type { AutoAnimateOptions, SharedOptions, UsaAutoAnimateElement, UsaMasonryElement };