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,144 @@
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
+ declare const SPINNER_VARIANTS: readonly ["fluent", "windows", "ring", "dots", "pulse", "bars"];
12
+ type SpinnerVariant = (typeof SPINNER_VARIANTS)[number];
13
+ /**
14
+ * `<usa-spinner>` — indeterminate loading indicators, pure CSS animations
15
+ * of `transform` / `opacity` (plus an SVG stroke for `fluent`).
16
+ *
17
+ * Kinds (`kind`): `fluent` (default — the WinUI / Windows 11
18
+ * ProgressRing arc), `windows` (the Windows 10 boot "orbiting dots"),
19
+ * `ring` (classic border spinner), `dots` (three bouncing dots / typing
20
+ * indicator), `pulse` (expanding ripple), `bars` (equalizer).
21
+ * Attributes: `size` (px, 32), `label` (accessible name, "Loading"),
22
+ * `paused`. Colour follows `color` / `--usa-spinner-color`.
23
+ * `role="progressbar"` without a value (indeterminate). Reduced motion:
24
+ * a slow opacity pulse instead of movement.
25
+ */
26
+ interface UsaSpinnerElement extends UsaElement {
27
+ /** Spinner kind (`kind` attribute). */
28
+ kind: SpinnerVariant;
29
+ }
30
+ declare function defineSpinner(tag?: string): CustomElementConstructor | undefined;
31
+
32
+ /**
33
+ * `<usa-skeleton>` — shimmering placeholders while content loads. With
34
+ * `loading`, it shows `lines` bars (or one block of `width` × `height`,
35
+ * or a `circle`) and hides its children; remove `loading` and the real
36
+ * content fades in.
37
+ *
38
+ * Attributes: `loading`, `lines` (3), `width`, `height` (CSS lengths),
39
+ * `circle`, `radius`, `avatar` (circle + lines, like a list row).
40
+ * `aria-busy` follows `loading`. Reduced motion: no shimmer sweep.
41
+ */
42
+ interface UsaSkeletonElement extends UsaElement {
43
+ loading: boolean;
44
+ }
45
+ declare function defineSkeleton(tag?: string): CustomElementConstructor | undefined;
46
+
47
+ /**
48
+ * `<usa-progress>` — a linear progress bar. Determinate (`value` / `max`)
49
+ * bars glide between values with `transform: scaleX()`; without a value,
50
+ * or with `indeterminate`, it shows the Windows Fluent indeterminate
51
+ * animation (two sliding segments).
52
+ *
53
+ * Attributes: `value`, `max` (100), `indeterminate`, `state`
54
+ * (`paused` | `error` — the WinUI states), `label` (accessible name).
55
+ * `role="progressbar"` with `aria-valuenow` when determinate.
56
+ * Reduced motion: no glide; indeterminate becomes a gentle pulse.
57
+ */
58
+ interface UsaProgressElement extends UsaElement {
59
+ value: number | null;
60
+ max: number;
61
+ /** 0–1, or `null` when indeterminate. */
62
+ readonly ratio: number | null;
63
+ }
64
+ declare function defineProgress(tag?: string): CustomElementConstructor | undefined;
65
+
66
+ type ToastType = 'info' | 'success' | 'warning' | 'error';
67
+ interface ToastOptions {
68
+ /** ms before it hides itself; `0` keeps it until closed (default 4000). */
69
+ duration?: number;
70
+ type?: ToastType;
71
+ /** Optional action button. */
72
+ action?: {
73
+ label: string;
74
+ onClick: () => void;
75
+ };
76
+ /** Show a close button (default `true`). */
77
+ dismissible?: boolean;
78
+ /** The toaster to use (default: the first `<usa-toaster>`, created if missing). */
79
+ toaster?: UsaToasterElement | string;
80
+ }
81
+ interface ToastHandle {
82
+ element: HTMLElement;
83
+ close(): Promise<void>;
84
+ }
85
+ /**
86
+ * `<usa-toaster>` — the region toasts slide into (`role="region"`, each
87
+ * toast `role="status"`, errors `role="alert"`). Toasts pause their timer
88
+ * while hovered or focused, and the stack re-flows with a FLIP animation.
89
+ *
90
+ * Attributes: `position` (`bottom-right` default, `bottom-left`,
91
+ * `bottom-center`, `top-right`, `top-left`, `top-center`), `max` (visible
92
+ * toasts, 4), `label` (region name, "Notifications").
93
+ * Reduced motion: toasts fade instead of sliding.
94
+ */
95
+ interface UsaToasterElement extends UsaElement {
96
+ show(message: string, options?: ToastOptions): ToastHandle;
97
+ clear(): void;
98
+ }
99
+ declare function defineToaster(tag?: string): CustomElementConstructor | undefined;
100
+ /**
101
+ * Show a toast. Defines `<usa-toaster>` and adds one to `<body>` if the
102
+ * page has none. Returns a handle with `close()`. No-op on the server.
103
+ *
104
+ * ```js
105
+ * toast('Saved', { type: 'success' });
106
+ * ```
107
+ */
108
+ declare function toast(message: string, options?: ToastOptions): ToastHandle | null;
109
+
110
+ /**
111
+ * `<usa-check>` — an animated result icon: the circle draws itself, then the
112
+ * check mark (or cross / exclamation) strokes in with a little pop.
113
+ *
114
+ * Attributes: `kind` (`success` default, `error`, `warning`), `size`
115
+ * (px, 56), `start` (`view` default | `load` | `manual`), `label`
116
+ * (accessible name, e.g. "Payment complete"; the icon is decorative
117
+ * without it). Event: `usa:complete`. Reduced motion: drawn instantly.
118
+ */
119
+ interface UsaCheckElement extends UsaElement {
120
+ play(): Promise<void>;
121
+ reset(): void;
122
+ }
123
+ declare function defineCheck(tag?: string): CustomElementConstructor | undefined;
124
+
125
+ /**
126
+ * motionary/components/feedback — loading & feedback.
127
+ * `<usa-spinner>`, `<usa-skeleton>`, `<usa-progress>`, `<usa-toaster>` +
128
+ * `toast()`, `<usa-check>`.
129
+ */
130
+
131
+ /** Register every component of this category under its default tag. */
132
+ declare function defineFeedbackComponents(): void;
133
+ declare global {
134
+ interface HTMLElementTagNameMap {
135
+ 'usa-spinner': UsaSpinnerElement;
136
+ 'usa-skeleton': UsaSkeletonElement;
137
+ 'usa-progress': UsaProgressElement;
138
+ 'usa-toaster': UsaToasterElement;
139
+ 'usa-check': UsaCheckElement;
140
+ }
141
+ }
142
+
143
+ export { SPINNER_VARIANTS, defineCheck, defineFeedbackComponents, defineProgress, defineSkeleton, defineSpinner, defineToaster, toast };
144
+ export type { SpinnerVariant, ToastHandle, ToastOptions, ToastType, UsaCheckElement, UsaProgressElement, UsaSkeletonElement, UsaSpinnerElement, UsaToasterElement };
@@ -0,0 +1,144 @@
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
+ declare const SPINNER_VARIANTS: readonly ["fluent", "windows", "ring", "dots", "pulse", "bars"];
12
+ type SpinnerVariant = (typeof SPINNER_VARIANTS)[number];
13
+ /**
14
+ * `<usa-spinner>` — indeterminate loading indicators, pure CSS animations
15
+ * of `transform` / `opacity` (plus an SVG stroke for `fluent`).
16
+ *
17
+ * Kinds (`kind`): `fluent` (default — the WinUI / Windows 11
18
+ * ProgressRing arc), `windows` (the Windows 10 boot "orbiting dots"),
19
+ * `ring` (classic border spinner), `dots` (three bouncing dots / typing
20
+ * indicator), `pulse` (expanding ripple), `bars` (equalizer).
21
+ * Attributes: `size` (px, 32), `label` (accessible name, "Loading"),
22
+ * `paused`. Colour follows `color` / `--usa-spinner-color`.
23
+ * `role="progressbar"` without a value (indeterminate). Reduced motion:
24
+ * a slow opacity pulse instead of movement.
25
+ */
26
+ interface UsaSpinnerElement extends UsaElement {
27
+ /** Spinner kind (`kind` attribute). */
28
+ kind: SpinnerVariant;
29
+ }
30
+ declare function defineSpinner(tag?: string): CustomElementConstructor | undefined;
31
+
32
+ /**
33
+ * `<usa-skeleton>` — shimmering placeholders while content loads. With
34
+ * `loading`, it shows `lines` bars (or one block of `width` × `height`,
35
+ * or a `circle`) and hides its children; remove `loading` and the real
36
+ * content fades in.
37
+ *
38
+ * Attributes: `loading`, `lines` (3), `width`, `height` (CSS lengths),
39
+ * `circle`, `radius`, `avatar` (circle + lines, like a list row).
40
+ * `aria-busy` follows `loading`. Reduced motion: no shimmer sweep.
41
+ */
42
+ interface UsaSkeletonElement extends UsaElement {
43
+ loading: boolean;
44
+ }
45
+ declare function defineSkeleton(tag?: string): CustomElementConstructor | undefined;
46
+
47
+ /**
48
+ * `<usa-progress>` — a linear progress bar. Determinate (`value` / `max`)
49
+ * bars glide between values with `transform: scaleX()`; without a value,
50
+ * or with `indeterminate`, it shows the Windows Fluent indeterminate
51
+ * animation (two sliding segments).
52
+ *
53
+ * Attributes: `value`, `max` (100), `indeterminate`, `state`
54
+ * (`paused` | `error` — the WinUI states), `label` (accessible name).
55
+ * `role="progressbar"` with `aria-valuenow` when determinate.
56
+ * Reduced motion: no glide; indeterminate becomes a gentle pulse.
57
+ */
58
+ interface UsaProgressElement extends UsaElement {
59
+ value: number | null;
60
+ max: number;
61
+ /** 0–1, or `null` when indeterminate. */
62
+ readonly ratio: number | null;
63
+ }
64
+ declare function defineProgress(tag?: string): CustomElementConstructor | undefined;
65
+
66
+ type ToastType = 'info' | 'success' | 'warning' | 'error';
67
+ interface ToastOptions {
68
+ /** ms before it hides itself; `0` keeps it until closed (default 4000). */
69
+ duration?: number;
70
+ type?: ToastType;
71
+ /** Optional action button. */
72
+ action?: {
73
+ label: string;
74
+ onClick: () => void;
75
+ };
76
+ /** Show a close button (default `true`). */
77
+ dismissible?: boolean;
78
+ /** The toaster to use (default: the first `<usa-toaster>`, created if missing). */
79
+ toaster?: UsaToasterElement | string;
80
+ }
81
+ interface ToastHandle {
82
+ element: HTMLElement;
83
+ close(): Promise<void>;
84
+ }
85
+ /**
86
+ * `<usa-toaster>` — the region toasts slide into (`role="region"`, each
87
+ * toast `role="status"`, errors `role="alert"`). Toasts pause their timer
88
+ * while hovered or focused, and the stack re-flows with a FLIP animation.
89
+ *
90
+ * Attributes: `position` (`bottom-right` default, `bottom-left`,
91
+ * `bottom-center`, `top-right`, `top-left`, `top-center`), `max` (visible
92
+ * toasts, 4), `label` (region name, "Notifications").
93
+ * Reduced motion: toasts fade instead of sliding.
94
+ */
95
+ interface UsaToasterElement extends UsaElement {
96
+ show(message: string, options?: ToastOptions): ToastHandle;
97
+ clear(): void;
98
+ }
99
+ declare function defineToaster(tag?: string): CustomElementConstructor | undefined;
100
+ /**
101
+ * Show a toast. Defines `<usa-toaster>` and adds one to `<body>` if the
102
+ * page has none. Returns a handle with `close()`. No-op on the server.
103
+ *
104
+ * ```js
105
+ * toast('Saved', { type: 'success' });
106
+ * ```
107
+ */
108
+ declare function toast(message: string, options?: ToastOptions): ToastHandle | null;
109
+
110
+ /**
111
+ * `<usa-check>` — an animated result icon: the circle draws itself, then the
112
+ * check mark (or cross / exclamation) strokes in with a little pop.
113
+ *
114
+ * Attributes: `kind` (`success` default, `error`, `warning`), `size`
115
+ * (px, 56), `start` (`view` default | `load` | `manual`), `label`
116
+ * (accessible name, e.g. "Payment complete"; the icon is decorative
117
+ * without it). Event: `usa:complete`. Reduced motion: drawn instantly.
118
+ */
119
+ interface UsaCheckElement extends UsaElement {
120
+ play(): Promise<void>;
121
+ reset(): void;
122
+ }
123
+ declare function defineCheck(tag?: string): CustomElementConstructor | undefined;
124
+
125
+ /**
126
+ * motionary/components/feedback — loading & feedback.
127
+ * `<usa-spinner>`, `<usa-skeleton>`, `<usa-progress>`, `<usa-toaster>` +
128
+ * `toast()`, `<usa-check>`.
129
+ */
130
+
131
+ /** Register every component of this category under its default tag. */
132
+ declare function defineFeedbackComponents(): void;
133
+ declare global {
134
+ interface HTMLElementTagNameMap {
135
+ 'usa-spinner': UsaSpinnerElement;
136
+ 'usa-skeleton': UsaSkeletonElement;
137
+ 'usa-progress': UsaProgressElement;
138
+ 'usa-toaster': UsaToasterElement;
139
+ 'usa-check': UsaCheckElement;
140
+ }
141
+ }
142
+
143
+ export { SPINNER_VARIANTS, defineCheck, defineFeedbackComponents, defineProgress, defineSkeleton, defineSpinner, defineToaster, toast };
144
+ export type { SpinnerVariant, ToastHandle, ToastOptions, ToastType, UsaCheckElement, UsaProgressElement, UsaSkeletonElement, UsaSpinnerElement, UsaToasterElement };