motionary 0.0.0-stage → 6.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/CHANGELOG.md +784 -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-Yno7N2eC.js +404 -0
  11. package/dist/chunks/base-Yno7N2eC.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-BIOaYdgN.js +181 -0
  21. package/dist/chunks/core-BIOaYdgN.js.map +1 -0
  22. package/dist/chunks/core-CUGCsMsJ.js +260 -0
  23. package/dist/chunks/core-CUGCsMsJ.js.map +1 -0
  24. package/dist/chunks/core-D7cVumUu.js +909 -0
  25. package/dist/chunks/core-D7cVumUu.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-BqDeFywO.js +109 -0
  29. package/dist/chunks/fx-BqDeFywO.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/index-tags-DucKMQr_.js +26 -0
  33. package/dist/chunks/index-tags-DucKMQr_.js.map +1 -0
  34. package/dist/chunks/index-tags-wv0R_vkO.cjs +28 -0
  35. package/dist/chunks/index-tags-wv0R_vkO.cjs.map +1 -0
  36. package/dist/chunks/presets-BYBVJVeP.js +226 -0
  37. package/dist/chunks/presets-BYBVJVeP.js.map +1 -0
  38. package/dist/chunks/presets-CUHys3sK.cjs +233 -0
  39. package/dist/chunks/presets-CUHys3sK.cjs.map +1 -0
  40. package/dist/chunks/spring-DfQO5USi.js +219 -0
  41. package/dist/chunks/spring-DfQO5USi.js.map +1 -0
  42. package/dist/chunks/spring-Dgx187Vh.cjs +232 -0
  43. package/dist/chunks/spring-Dgx187Vh.cjs.map +1 -0
  44. package/dist/chunks/stagger-CCFyhzSw.cjs +86 -0
  45. package/dist/chunks/stagger-CCFyhzSw.cjs.map +1 -0
  46. package/dist/chunks/stagger-DtMKo2SK.js +84 -0
  47. package/dist/chunks/stagger-DtMKo2SK.js.map +1 -0
  48. package/dist/chunks/variants-BhjyddG8.cjs +39 -0
  49. package/dist/chunks/variants-BhjyddG8.cjs.map +1 -0
  50. package/dist/chunks/variants-VNscPeTD.js +35 -0
  51. package/dist/chunks/variants-VNscPeTD.js.map +1 -0
  52. package/dist/components/a11y.cjs +276 -0
  53. package/dist/components/a11y.cjs.map +1 -0
  54. package/dist/components/a11y.d.cts +131 -0
  55. package/dist/components/a11y.d.ts +131 -0
  56. package/dist/components/a11y.js +259 -0
  57. package/dist/components/a11y.js.map +1 -0
  58. package/dist/components/angular.cjs +75 -0
  59. package/dist/components/angular.cjs.map +1 -0
  60. package/dist/components/angular.d.cts +1734 -0
  61. package/dist/components/angular.d.ts +1734 -0
  62. package/dist/components/angular.js +69 -0
  63. package/dist/components/angular.js.map +1 -0
  64. package/dist/components/background.cjs +659 -0
  65. package/dist/components/background.cjs.map +1 -0
  66. package/dist/components/background.css +9 -0
  67. package/dist/components/background.d.cts +166 -0
  68. package/dist/components/background.d.ts +166 -0
  69. package/dist/components/background.js +647 -0
  70. package/dist/components/background.js.map +1 -0
  71. package/dist/components/bridge.cjs +154 -0
  72. package/dist/components/bridge.cjs.map +1 -0
  73. package/dist/components/bridge.d.cts +63 -0
  74. package/dist/components/bridge.d.ts +63 -0
  75. package/dist/components/bridge.js +147 -0
  76. package/dist/components/bridge.js.map +1 -0
  77. package/dist/components/cards.cjs +561 -0
  78. package/dist/components/cards.cjs.map +1 -0
  79. package/dist/components/cards.css +6 -0
  80. package/dist/components/cards.d.cts +115 -0
  81. package/dist/components/cards.d.ts +115 -0
  82. package/dist/components/cards.js +554 -0
  83. package/dist/components/cards.js.map +1 -0
  84. package/dist/components/click.cjs +877 -0
  85. package/dist/components/click.cjs.map +1 -0
  86. package/dist/components/click.css +9 -0
  87. package/dist/components/click.d.cts +218 -0
  88. package/dist/components/click.d.ts +218 -0
  89. package/dist/components/click.js +863 -0
  90. package/dist/components/click.js.map +1 -0
  91. package/dist/components/depth.cjs +250 -0
  92. package/dist/components/depth.cjs.map +1 -0
  93. package/dist/components/depth.css +3 -0
  94. package/dist/components/depth.d.cts +86 -0
  95. package/dist/components/depth.d.ts +86 -0
  96. package/dist/components/depth.js +242 -0
  97. package/dist/components/depth.js.map +1 -0
  98. package/dist/components/effects.cjs +2590 -0
  99. package/dist/components/effects.cjs.map +1 -0
  100. package/dist/components/effects.d.cts +545 -0
  101. package/dist/components/effects.d.ts +545 -0
  102. package/dist/components/effects.js +2531 -0
  103. package/dist/components/effects.js.map +1 -0
  104. package/dist/components/feedback.cjs +442 -0
  105. package/dist/components/feedback.cjs.map +1 -0
  106. package/dist/components/feedback.css +7 -0
  107. package/dist/components/feedback.d.cts +144 -0
  108. package/dist/components/feedback.d.ts +144 -0
  109. package/dist/components/feedback.js +433 -0
  110. package/dist/components/feedback.js.map +1 -0
  111. package/dist/components/fx.cjs +289 -0
  112. package/dist/components/fx.cjs.map +1 -0
  113. package/dist/components/fx.css +3 -0
  114. package/dist/components/fx.d.cts +114 -0
  115. package/dist/components/fx.d.ts +114 -0
  116. package/dist/components/fx.js +275 -0
  117. package/dist/components/fx.js.map +1 -0
  118. package/dist/components/gesture.cjs +209 -0
  119. package/dist/components/gesture.cjs.map +1 -0
  120. package/dist/components/gesture.css +3 -0
  121. package/dist/components/gesture.d.cts +134 -0
  122. package/dist/components/gesture.d.ts +134 -0
  123. package/dist/components/gesture.js +203 -0
  124. package/dist/components/gesture.js.map +1 -0
  125. package/dist/components/interaction.cjs +424 -0
  126. package/dist/components/interaction.cjs.map +1 -0
  127. package/dist/components/interaction.css +8 -0
  128. package/dist/components/interaction.d.cts +115 -0
  129. package/dist/components/interaction.d.ts +115 -0
  130. package/dist/components/interaction.js +416 -0
  131. package/dist/components/interaction.js.map +1 -0
  132. package/dist/components/jsx.cjs +3 -0
  133. package/dist/components/jsx.cjs.map +1 -0
  134. package/dist/components/jsx.d.cts +53 -0
  135. package/dist/components/jsx.d.ts +53 -0
  136. package/dist/components/jsx.js +2 -0
  137. package/dist/components/jsx.js.map +1 -0
  138. package/dist/components/layout.cjs +257 -0
  139. package/dist/components/layout.cjs.map +1 -0
  140. package/dist/components/layout.css +3 -0
  141. package/dist/components/layout.d.cts +99 -0
  142. package/dist/components/layout.d.ts +99 -0
  143. package/dist/components/layout.js +249 -0
  144. package/dist/components/layout.js.map +1 -0
  145. package/dist/components/lazy.cjs +92 -0
  146. package/dist/components/lazy.cjs.map +1 -0
  147. package/dist/components/lazy.d.cts +48 -0
  148. package/dist/components/lazy.d.ts +48 -0
  149. package/dist/components/lazy.js +87 -0
  150. package/dist/components/lazy.js.map +1 -0
  151. package/dist/components/lite.cjs +11099 -0
  152. package/dist/components/lite.cjs.map +1 -0
  153. package/dist/components/lite.d.cts +4 -0
  154. package/dist/components/lite.d.ts +4 -0
  155. package/dist/components/lite.js +10831 -0
  156. package/dist/components/lite.js.map +1 -0
  157. package/dist/components/packs.cjs +192 -0
  158. package/dist/components/packs.cjs.map +1 -0
  159. package/dist/components/packs.css +3 -0
  160. package/dist/components/packs.d.cts +72 -0
  161. package/dist/components/packs.d.ts +72 -0
  162. package/dist/components/packs.js +184 -0
  163. package/dist/components/packs.js.map +1 -0
  164. package/dist/components/page.cjs +824 -0
  165. package/dist/components/page.cjs.map +1 -0
  166. package/dist/components/page.css +11 -0
  167. package/dist/components/page.d.cts +249 -0
  168. package/dist/components/page.d.ts +249 -0
  169. package/dist/components/page.js +799 -0
  170. package/dist/components/page.js.map +1 -0
  171. package/dist/components/perf.cjs +120 -0
  172. package/dist/components/perf.cjs.map +1 -0
  173. package/dist/components/perf.d.cts +98 -0
  174. package/dist/components/perf.d.ts +98 -0
  175. package/dist/components/perf.js +110 -0
  176. package/dist/components/perf.js.map +1 -0
  177. package/dist/components/physics.cjs +448 -0
  178. package/dist/components/physics.cjs.map +1 -0
  179. package/dist/components/physics.css +5 -0
  180. package/dist/components/physics.d.cts +189 -0
  181. package/dist/components/physics.d.ts +189 -0
  182. package/dist/components/physics.js +430 -0
  183. package/dist/components/physics.js.map +1 -0
  184. package/dist/components/react.cjs +96 -0
  185. package/dist/components/react.cjs.map +1 -0
  186. package/dist/components/react.d.cts +18 -0
  187. package/dist/components/react.d.ts +18 -0
  188. package/dist/components/react.js +91 -0
  189. package/dist/components/react.js.map +1 -0
  190. package/dist/components/reveal.cjs +362 -0
  191. package/dist/components/reveal.cjs.map +1 -0
  192. package/dist/components/reveal.css +5 -0
  193. package/dist/components/reveal.d.cts +105 -0
  194. package/dist/components/reveal.d.ts +105 -0
  195. package/dist/components/reveal.js +353 -0
  196. package/dist/components/reveal.js.map +1 -0
  197. package/dist/components/solid.cjs +85 -0
  198. package/dist/components/solid.cjs.map +1 -0
  199. package/dist/components/solid.d.cts +1751 -0
  200. package/dist/components/solid.d.ts +1751 -0
  201. package/dist/components/solid.js +81 -0
  202. package/dist/components/solid.js.map +1 -0
  203. package/dist/components/svelte.cjs +67 -0
  204. package/dist/components/svelte.cjs.map +1 -0
  205. package/dist/components/svelte.d.cts +1733 -0
  206. package/dist/components/svelte.d.ts +1733 -0
  207. package/dist/components/svelte.js +63 -0
  208. package/dist/components/svelte.js.map +1 -0
  209. package/dist/components/svg.cjs +359 -0
  210. package/dist/components/svg.cjs.map +1 -0
  211. package/dist/components/svg.css +3 -0
  212. package/dist/components/svg.d.cts +113 -0
  213. package/dist/components/svg.d.ts +113 -0
  214. package/dist/components/svg.js +347 -0
  215. package/dist/components/svg.js.map +1 -0
  216. package/dist/components/text.cjs +968 -0
  217. package/dist/components/text.cjs.map +1 -0
  218. package/dist/components/text.css +8 -0
  219. package/dist/components/text.d.cts +342 -0
  220. package/dist/components/text.d.ts +342 -0
  221. package/dist/components/text.js +947 -0
  222. package/dist/components/text.js.map +1 -0
  223. package/dist/components/timeline.cjs +109 -0
  224. package/dist/components/timeline.cjs.map +1 -0
  225. package/dist/components/timeline.css +3 -0
  226. package/dist/components/timeline.d.cts +155 -0
  227. package/dist/components/timeline.d.ts +155 -0
  228. package/dist/components/timeline.js +103 -0
  229. package/dist/components/timeline.js.map +1 -0
  230. package/dist/components/tokens.cjs +226 -0
  231. package/dist/components/tokens.cjs.map +1 -0
  232. package/dist/components/tokens.d.cts +74 -0
  233. package/dist/components/tokens.d.ts +74 -0
  234. package/dist/components/tokens.js +211 -0
  235. package/dist/components/tokens.js.map +1 -0
  236. package/dist/components/transitions.cjs +430 -0
  237. package/dist/components/transitions.cjs.map +1 -0
  238. package/dist/components/transitions.css +5 -0
  239. package/dist/components/transitions.d.cts +126 -0
  240. package/dist/components/transitions.d.ts +126 -0
  241. package/dist/components/transitions.js +423 -0
  242. package/dist/components/transitions.js.map +1 -0
  243. package/dist/components/ui.cjs +1050 -0
  244. package/dist/components/ui.cjs.map +1 -0
  245. package/dist/components/ui.css +14 -0
  246. package/dist/components/ui.d.cts +224 -0
  247. package/dist/components/ui.d.ts +224 -0
  248. package/dist/components/ui.js +1034 -0
  249. package/dist/components/ui.js.map +1 -0
  250. package/dist/components/vue.cjs +66 -0
  251. package/dist/components/vue.cjs.map +1 -0
  252. package/dist/components/vue.d.cts +1722 -0
  253. package/dist/components/vue.d.ts +1722 -0
  254. package/dist/components/vue.js +63 -0
  255. package/dist/components/vue.js.map +1 -0
  256. package/dist/components/webgl.cjs +459 -0
  257. package/dist/components/webgl.cjs.map +1 -0
  258. package/dist/components/webgl.css +3 -0
  259. package/dist/components/webgl.d.cts +133 -0
  260. package/dist/components/webgl.d.ts +133 -0
  261. package/dist/components/webgl.js +442 -0
  262. package/dist/components/webgl.js.map +1 -0
  263. package/dist/components.cjs +350 -0
  264. package/dist/components.cjs.map +1 -0
  265. package/dist/components.css +75 -0
  266. package/dist/components.d.cts +2997 -0
  267. package/dist/components.d.ts +2997 -0
  268. package/dist/components.js +105 -0
  269. package/dist/components.js.map +1 -0
  270. package/dist/components.umd.js +23 -0
  271. package/dist/components.umd.js.map +1 -0
  272. package/dist/element.cjs +97 -0
  273. package/dist/element.cjs.map +1 -0
  274. package/dist/element.d.cts +215 -0
  275. package/dist/element.d.ts +215 -0
  276. package/dist/element.js +95 -0
  277. package/dist/element.js.map +1 -0
  278. package/dist/element.umd.js +2 -0
  279. package/dist/element.umd.js.map +1 -0
  280. package/dist/index.cjs +149 -0
  281. package/dist/index.cjs.map +1 -0
  282. package/dist/index.d.cts +425 -0
  283. package/dist/index.d.ts +425 -0
  284. package/dist/index.js +131 -0
  285. package/dist/index.js.map +1 -0
  286. package/dist/index.umd.js +15 -0
  287. package/dist/index.umd.js.map +1 -0
  288. package/dist/presets/extended.cjs +243 -0
  289. package/dist/presets/extended.cjs.map +1 -0
  290. package/dist/presets/extended.d.cts +37 -0
  291. package/dist/presets/extended.d.ts +37 -0
  292. package/dist/presets/extended.js +239 -0
  293. package/dist/presets/extended.js.map +1 -0
  294. package/dist/presets-extended.umd.js +2 -0
  295. package/dist/presets-extended.umd.js.map +1 -0
  296. package/dist/react.cjs +68 -0
  297. package/dist/react.cjs.map +1 -0
  298. package/dist/react.d.cts +158 -0
  299. package/dist/react.d.ts +158 -0
  300. package/dist/react.js +65 -0
  301. package/dist/react.js.map +1 -0
  302. package/dist/solid.cjs +93 -0
  303. package/dist/solid.cjs.map +1 -0
  304. package/dist/solid.d.cts +249 -0
  305. package/dist/solid.d.ts +249 -0
  306. package/dist/solid.js +89 -0
  307. package/dist/solid.js.map +1 -0
  308. package/dist/svelte.cjs +66 -0
  309. package/dist/svelte.cjs.map +1 -0
  310. package/dist/svelte.d.cts +243 -0
  311. package/dist/svelte.d.ts +243 -0
  312. package/dist/svelte.js +63 -0
  313. package/dist/svelte.js.map +1 -0
  314. package/dist/vue.cjs +62 -0
  315. package/dist/vue.cjs.map +1 -0
  316. package/dist/vue.d.cts +158 -0
  317. package/dist/vue.d.ts +158 -0
  318. package/dist/vue.js +60 -0
  319. package/dist/vue.js.map +1 -0
  320. package/docs/API.md +147 -0
  321. package/docs/ROADMAP.md +15 -0
  322. package/docs/accessibility.md +60 -0
  323. package/docs/components.md +535 -0
  324. package/docs/deprecations.md +30 -0
  325. package/docs/frameworks-ssr.md +100 -0
  326. package/docs/hybrid-apps.md +145 -0
  327. package/docs/images/showcase-detail.png +0 -0
  328. package/docs/images/showcase-grid.png +0 -0
  329. package/docs/images/showcase-mobile.png +0 -0
  330. package/docs/migration-from-aos.md +67 -0
  331. package/docs/migration-from-gsap-scrolltrigger.md +80 -0
  332. package/docs/motion-tokens.css +31 -0
  333. package/docs/motion-tokens.md +46 -0
  334. package/docs/motion.tokens.json +132 -0
  335. package/docs/performance.md +24 -0
  336. package/docs/presets.md +310 -0
  337. package/docs/upgrading-3.md +21 -0
  338. package/docs/upgrading-4.md +65 -0
  339. package/docs/upgrading-5.md +31 -0
  340. package/docs/upgrading-6.md +32 -0
  341. package/docs/windows-apps.md +119 -0
  342. package/package.json +532 -4
@@ -0,0 +1,84 @@
1
+ import { h as hasDOM, s as supportsObserver, c as createScrollAnimate, p as prepareElement, a as stopAnimation } from './core-D7cVumUu.js';
2
+
3
+ /**
4
+ * motionary - Staggered children
5
+ * Reveal a container's children one after another when the container scrolls
6
+ * into view, optionally also animating children that are added later.
7
+ */
8
+ let fallback = null;
9
+ /**
10
+ * Animate the children of `container` with a stagger once it enters the
11
+ * viewport. Returns a cleanup function. SSR-safe (no-op without a DOM).
12
+ *
13
+ * @example
14
+ * const stop = staggerChildren(document.querySelector('ul'), { stagger: 60, observeChildren: true });
15
+ */
16
+ function staggerChildren(container, options = {}, instance) {
17
+ if (!container || !hasDOM() || !supportsObserver())
18
+ return () => undefined; // leave content visible
19
+ const sa = instance || fallback || (fallback = createScrollAnimate());
20
+ const { stagger = 80, delay = 0, threshold = 0.1, rootMargin = '0px', observeChildren = false, ...rest } = options;
21
+ let items = Array.from(container.children);
22
+ let revealed = false;
23
+ const late = [];
24
+ items.forEach((child) => prepareElement(child));
25
+ const io = new IntersectionObserver((entries) => {
26
+ if (revealed || !entries.some((entry) => entry.isIntersecting))
27
+ return;
28
+ revealed = true;
29
+ io.disconnect();
30
+ items.forEach((child, i) => {
31
+ if (child.parentNode === container)
32
+ sa.animate(child, { ...rest, delay: delay + i * stagger });
33
+ });
34
+ items = [];
35
+ }, { threshold, rootMargin });
36
+ io.observe(container);
37
+ let mo;
38
+ if (observeChildren && typeof MutationObserver !== 'undefined') {
39
+ mo = new MutationObserver((records) => {
40
+ records.forEach((record) => {
41
+ record.addedNodes.forEach((node) => {
42
+ if (!(node instanceof Element) || node.parentNode !== container)
43
+ return;
44
+ if (!revealed) {
45
+ prepareElement(node);
46
+ items.push(node);
47
+ }
48
+ else {
49
+ // The core engine staggers siblings relative to the batch that
50
+ // enters the viewport together.
51
+ late.push(node);
52
+ sa.observe(node, { ...rest, delay, stagger, threshold, rootMargin });
53
+ }
54
+ });
55
+ record.removedNodes.forEach((node) => {
56
+ if (!(node instanceof Element))
57
+ return;
58
+ items = items.filter((el) => el !== node);
59
+ const i = late.indexOf(node);
60
+ if (i >= 0) {
61
+ late.splice(i, 1);
62
+ sa.unobserve(node);
63
+ }
64
+ });
65
+ });
66
+ });
67
+ mo.observe(container, { childList: true });
68
+ }
69
+ return () => {
70
+ io.disconnect();
71
+ mo?.disconnect();
72
+ // Stopped before the container was revealed: never leave the children hidden.
73
+ if (!revealed) {
74
+ revealed = true;
75
+ items.forEach((child) => stopAnimation(child));
76
+ items = [];
77
+ }
78
+ late.forEach((el) => sa.unobserve(el));
79
+ late.length = 0;
80
+ };
81
+ }
82
+
83
+ export { staggerChildren as s };
84
+ //# sourceMappingURL=stagger-DtMKo2SK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stagger-DtMKo2SK.js","sources":["../../src/stagger.ts"],"sourcesContent":["/**\n * motionary - Staggered children\n * Reveal a container's children one after another when the container scrolls\n * into view, optionally also animating children that are added later.\n */\n\nimport type { AnimateOptions, ScrollAnimateInstance } from './types';\nimport { createScrollAnimate, hasDOM, prepareElement, stopAnimation, supportsObserver } from './core';\n\nexport interface StaggerOptions extends AnimateOptions {\n /** Delay between consecutive children in ms (default: 80) */\n stagger?: number;\n /**\n * Watch the container with a MutationObserver and animate children added\n * later (e.g. infinite lists). Children added after the container was\n * revealed animate when they scroll into view, staggered per batch.\n * (default: false)\n */\n observeChildren?: boolean;\n}\n\nlet fallback: ScrollAnimateInstance | null = null;\n\n/**\n * Animate the children of `container` with a stagger once it enters the\n * viewport. Returns a cleanup function. SSR-safe (no-op without a DOM).\n *\n * @example\n * const stop = staggerChildren(document.querySelector('ul'), { stagger: 60, observeChildren: true });\n */\nexport function staggerChildren(\n container: Element | null | undefined,\n options: StaggerOptions = {},\n instance?: ScrollAnimateInstance\n): () => void {\n if (!container || !hasDOM() || !supportsObserver()) return () => undefined; // leave content visible\n const sa = instance || fallback || (fallback = createScrollAnimate());\n const { stagger = 80, delay = 0, threshold = 0.1, rootMargin = '0px', observeChildren = false, ...rest } = options;\n\n let items = Array.from(container.children);\n let revealed = false;\n const late: Element[] = [];\n items.forEach((child) => prepareElement(child));\n\n const io = new IntersectionObserver(\n (entries) => {\n if (revealed || !entries.some((entry) => entry.isIntersecting)) return;\n revealed = true;\n io.disconnect();\n items.forEach((child, i) => {\n if (child.parentNode === container) sa.animate(child, { ...rest, delay: delay + i * stagger });\n });\n items = [];\n },\n { threshold, rootMargin }\n );\n io.observe(container);\n\n let mo: MutationObserver | undefined;\n if (observeChildren && typeof MutationObserver !== 'undefined') {\n mo = new MutationObserver((records) => {\n records.forEach((record) => {\n record.addedNodes.forEach((node) => {\n if (!(node instanceof Element) || node.parentNode !== container) return;\n if (!revealed) {\n prepareElement(node);\n items.push(node);\n } else {\n // The core engine staggers siblings relative to the batch that\n // enters the viewport together.\n late.push(node);\n sa.observe(node, { ...rest, delay, stagger, threshold, rootMargin });\n }\n });\n record.removedNodes.forEach((node) => {\n if (!(node instanceof Element)) return;\n items = items.filter((el) => el !== node);\n const i = late.indexOf(node);\n if (i >= 0) {\n late.splice(i, 1);\n sa.unobserve(node);\n }\n });\n });\n });\n mo.observe(container, { childList: true });\n }\n\n return () => {\n io.disconnect();\n mo?.disconnect();\n // Stopped before the container was revealed: never leave the children hidden.\n if (!revealed) {\n revealed = true;\n items.forEach((child) => stopAnimation(child));\n items = [];\n }\n late.forEach((el) => sa.unobserve(el));\n late.length = 0;\n };\n}\n"],"names":[],"mappings":";;AAAA;;;;AAIG;AAiBH,IAAI,QAAQ,GAAiC,IAAI;AAEjD;;;;;;AAMG;AACG,SAAU,eAAe,CAC7B,SAAqC,EACrC,OAAA,GAA0B,EAAE,EAC5B,QAAgC,EAAA;IAEhC,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE;AAAE,QAAA,OAAO,MAAM,SAAS,CAAC;AAC3E,IAAA,MAAM,EAAE,GAAG,QAAQ,IAAI,QAAQ,KAAK,QAAQ,GAAG,mBAAmB,EAAE,CAAC;IACrE,MAAM,EAAE,OAAO,GAAG,EAAE,EAAE,KAAK,GAAG,CAAC,EAAE,SAAS,GAAG,GAAG,EAAE,UAAU,GAAG,KAAK,EAAE,eAAe,GAAG,KAAK,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AC,SAAS,CAAC,EAAE,CAAC,CAAC;AACtC,QAAA,IAAI,CAAC,MAAM,GAAG,CAAC;AACjB,IAAA,CAAC;AACH;;;;"}
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+
3
+ var base = require('./base-BaQV-2ha.cjs');
4
+
5
+ var css = ":root{--usa-accent:#7c5cff;--usa-accent-text:#fff;--usa-surface:#1b1e27;--usa-text:inherit;--usa-radius:14px;--usa-border:1px solid rgb(127 127 127 / 0.25);--usa-shadow:0 10px 30px -12px rgb(0 0 0 / 0.45);--usa-blur:0px;--usa-font:inherit}:where([variant=\"minimal\"],[data-usa-variant=\"minimal\"]){--usa-accent:currentColor;--usa-accent-text:Canvas;--usa-surface:transparent;--usa-radius:6px;--usa-border:1px solid color-mix(in srgb,currentColor 22%,transparent);--usa-shadow:none;--usa-blur:0px}:where([variant=\"neon\"],[data-usa-variant=\"neon\"]){--usa-accent:#00f0ff;--usa-accent-text:#04121a;--usa-surface:#0a0b14;--usa-text:#e6fbff;--usa-radius:10px;--usa-border:1px solid #00f0ff;--usa-shadow:0 0 6px #00f0ff,0 0 22px rgb(0 240 255 / 0.45);--usa-blur:0px}:where([variant=\"glass\"],[data-usa-variant=\"glass\"]){--usa-accent:#a78bfa;--usa-accent-text:#fff;--usa-surface:rgb(255 255 255 / 0.12);--usa-radius:18px;--usa-border:1px solid rgb(255 255 255 / 0.28);--usa-shadow:0 12px 40px -12px rgb(0 0 0 / 0.35);--usa-blur:16px}:where([variant=\"brutalist\"],[data-usa-variant=\"brutalist\"]){--usa-accent:#ff3d00;--usa-accent-text:#000;--usa-surface:#fff;--usa-text:#000;--usa-radius:0px;--usa-border:3px solid #000;--usa-shadow:5px 5px 0 #000;--usa-blur:0px;--usa-font:ui-monospace,\"SFMono-Regular\",Menlo,monospace}:where([variant=\"fluent\"],[data-usa-variant=\"fluent\"]){--usa-accent:#0067c0;--usa-accent-text:#fff;--usa-surface:rgb(249 249 249 / 0.82);--usa-text:#1a1a1a;--usa-radius:8px;--usa-border:1px solid rgb(0 0 0 / 0.08);--usa-shadow:0 2px 4px rgb(0 0 0 / 0.14),0 0 2px rgb(0 0 0 / 0.12);--usa-blur:30px;--usa-font:\"Segoe UI Variable\",\"Segoe UI\",system-ui,sans-serif}:where([variant=\"material\"],[data-usa-variant=\"material\"]){--usa-accent:#6750a4;--usa-accent-text:#fff;--usa-surface:#fffbfe;--usa-text:#1c1b1f;--usa-radius:20px;--usa-border:0 solid transparent;--usa-shadow:0 1px 3px rgb(0 0 0 / 0.3),0 4px 8px 3px rgb(0 0 0 / 0.15);--usa-blur:0px;--usa-font:Roboto,system-ui,sans-serif}@media (prefers-color-scheme:dark){:where([variant=\"fluent\"],[data-usa-variant=\"fluent\"]){--usa-accent:#4cc2ff;--usa-accent-text:#000;--usa-surface:rgb(44 44 44 / 0.8);--usa-text:#fff;--usa-border:1px solid rgb(255 255 255 / 0.08)}:where([variant=\"material\"],[data-usa-variant=\"material\"]){--usa-accent:#d0bcff;--usa-accent-text:#381e72;--usa-surface:#1c1b1f;--usa-text:#e6e1e5}}.usa-surface{background:var(--usa-surface);color:var(--usa-text);border:var(--usa-border);border-radius:var(--usa-radius);box-shadow:var(--usa-shadow);font-family:var(--usa-font);-webkit-backdrop-filter:blur(var(--usa-blur));backdrop-filter:blur(var(--usa-blur))}@media (prefers-reduced-transparency:reduce){.usa-surface{-webkit-backdrop-filter:none;backdrop-filter:none}}";
6
+
7
+ /**
8
+ * Style variants (v2.6): `variant="minimal | neon | glass | brutalist |
9
+ * fluent | material"` on any `<usa-*>` element — or on any ancestor as
10
+ * `data-usa-variant`, or page-wide with `setVariant()` — sets the shared
11
+ * design tokens every component reads:
12
+ *
13
+ * `--usa-accent`, `--usa-accent-text`, `--usa-surface`, `--usa-text`,
14
+ * `--usa-radius`, `--usa-border`, `--usa-shadow`, `--usa-blur`, `--usa-font`.
15
+ *
16
+ * (`<usa-spinner>`, `<usa-check>` and `<usa-dialog>` already use `variant`
17
+ * for their kind; the token names never clash with those values except
18
+ * `fluent`, which means the same thing there.)
19
+ */
20
+ const VARIANTS = ['minimal', 'neon', 'glass', 'brutalist', 'fluent', 'material'];
21
+ /** Inject the variant token sheet (done automatically by every `ui` component). */
22
+ function adoptVariants() {
23
+ base.adoptStyles('variants', css);
24
+ }
25
+ /** Apply a variant to the whole page (or `root`); `null` removes it. */
26
+ function setVariant(variant, root = typeof document !== 'undefined' ? document.documentElement : null) {
27
+ if (!root)
28
+ return;
29
+ adoptVariants();
30
+ if (variant)
31
+ root.setAttribute('data-usa-variant', variant);
32
+ else
33
+ root.removeAttribute('data-usa-variant');
34
+ }
35
+
36
+ exports.VARIANTS = VARIANTS;
37
+ exports.adoptVariants = adoptVariants;
38
+ exports.setVariant = setVariant;
39
+ //# sourceMappingURL=variants-BhjyddG8.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants-BhjyddG8.cjs","sources":["../../src/components/ui/variants.ts"],"sourcesContent":["import { adoptStyles } from '../base';\nimport css from './variants.css?raw';\n\n/**\n * Style variants (v2.6): `variant=\"minimal | neon | glass | brutalist |\n * fluent | material\"` on any `<usa-*>` element — or on any ancestor as\n * `data-usa-variant`, or page-wide with `setVariant()` — sets the shared\n * design tokens every component reads:\n *\n * `--usa-accent`, `--usa-accent-text`, `--usa-surface`, `--usa-text`,\n * `--usa-radius`, `--usa-border`, `--usa-shadow`, `--usa-blur`, `--usa-font`.\n *\n * (`<usa-spinner>`, `<usa-check>` and `<usa-dialog>` already use `variant`\n * for their kind; the token names never clash with those values except\n * `fluent`, which means the same thing there.)\n */\nexport const VARIANTS = ['minimal', 'neon', 'glass', 'brutalist', 'fluent', 'material'] as const;\nexport type Variant = (typeof VARIANTS)[number];\n\n/** Inject the variant token sheet (done automatically by every `ui` component). */\nexport function adoptVariants(): void {\n adoptStyles('variants', css);\n}\n\n/** Apply a variant to the whole page (or `root`); `null` removes it. */\nexport function setVariant(variant: Variant | null, root: Element | null = typeof document !== 'undefined' ? document.documentElement : null): void {\n if (!root) return;\n adoptVariants();\n if (variant) root.setAttribute('data-usa-variant', variant);\n else root.removeAttribute('data-usa-variant');\n}\n"],"names":["adoptStyles"],"mappings":";;;;;;AAGA;;;;;;;;;;;;AAYG;AACI,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU;AAGtF;SACgB,aAAa,GAAA;AAC3B,IAAAA,gBAAW,CAAC,UAAU,EAAE,GAAG,CAAC;AAC9B;AAEA;SACgB,UAAU,CAAC,OAAuB,EAAE,IAAA,GAAuB,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,CAAC,eAAe,GAAG,IAAI,EAAA;AAC1I,IAAA,IAAI,CAAC,IAAI;QAAE;AACX,IAAA,aAAa,EAAE;AACf,IAAA,IAAI,OAAO;AAAE,QAAA,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC;;AACtD,QAAA,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC;AAC/C;;;;;;"}
@@ -0,0 +1,35 @@
1
+ import { u as adoptStyles } from './base-Yno7N2eC.js';
2
+
3
+ var css = ":root{--usa-accent:#7c5cff;--usa-accent-text:#fff;--usa-surface:#1b1e27;--usa-text:inherit;--usa-radius:14px;--usa-border:1px solid rgb(127 127 127 / 0.25);--usa-shadow:0 10px 30px -12px rgb(0 0 0 / 0.45);--usa-blur:0px;--usa-font:inherit}:where([variant=\"minimal\"],[data-usa-variant=\"minimal\"]){--usa-accent:currentColor;--usa-accent-text:Canvas;--usa-surface:transparent;--usa-radius:6px;--usa-border:1px solid color-mix(in srgb,currentColor 22%,transparent);--usa-shadow:none;--usa-blur:0px}:where([variant=\"neon\"],[data-usa-variant=\"neon\"]){--usa-accent:#00f0ff;--usa-accent-text:#04121a;--usa-surface:#0a0b14;--usa-text:#e6fbff;--usa-radius:10px;--usa-border:1px solid #00f0ff;--usa-shadow:0 0 6px #00f0ff,0 0 22px rgb(0 240 255 / 0.45);--usa-blur:0px}:where([variant=\"glass\"],[data-usa-variant=\"glass\"]){--usa-accent:#a78bfa;--usa-accent-text:#fff;--usa-surface:rgb(255 255 255 / 0.12);--usa-radius:18px;--usa-border:1px solid rgb(255 255 255 / 0.28);--usa-shadow:0 12px 40px -12px rgb(0 0 0 / 0.35);--usa-blur:16px}:where([variant=\"brutalist\"],[data-usa-variant=\"brutalist\"]){--usa-accent:#ff3d00;--usa-accent-text:#000;--usa-surface:#fff;--usa-text:#000;--usa-radius:0px;--usa-border:3px solid #000;--usa-shadow:5px 5px 0 #000;--usa-blur:0px;--usa-font:ui-monospace,\"SFMono-Regular\",Menlo,monospace}:where([variant=\"fluent\"],[data-usa-variant=\"fluent\"]){--usa-accent:#0067c0;--usa-accent-text:#fff;--usa-surface:rgb(249 249 249 / 0.82);--usa-text:#1a1a1a;--usa-radius:8px;--usa-border:1px solid rgb(0 0 0 / 0.08);--usa-shadow:0 2px 4px rgb(0 0 0 / 0.14),0 0 2px rgb(0 0 0 / 0.12);--usa-blur:30px;--usa-font:\"Segoe UI Variable\",\"Segoe UI\",system-ui,sans-serif}:where([variant=\"material\"],[data-usa-variant=\"material\"]){--usa-accent:#6750a4;--usa-accent-text:#fff;--usa-surface:#fffbfe;--usa-text:#1c1b1f;--usa-radius:20px;--usa-border:0 solid transparent;--usa-shadow:0 1px 3px rgb(0 0 0 / 0.3),0 4px 8px 3px rgb(0 0 0 / 0.15);--usa-blur:0px;--usa-font:Roboto,system-ui,sans-serif}@media (prefers-color-scheme:dark){:where([variant=\"fluent\"],[data-usa-variant=\"fluent\"]){--usa-accent:#4cc2ff;--usa-accent-text:#000;--usa-surface:rgb(44 44 44 / 0.8);--usa-text:#fff;--usa-border:1px solid rgb(255 255 255 / 0.08)}:where([variant=\"material\"],[data-usa-variant=\"material\"]){--usa-accent:#d0bcff;--usa-accent-text:#381e72;--usa-surface:#1c1b1f;--usa-text:#e6e1e5}}.usa-surface{background:var(--usa-surface);color:var(--usa-text);border:var(--usa-border);border-radius:var(--usa-radius);box-shadow:var(--usa-shadow);font-family:var(--usa-font);-webkit-backdrop-filter:blur(var(--usa-blur));backdrop-filter:blur(var(--usa-blur))}@media (prefers-reduced-transparency:reduce){.usa-surface{-webkit-backdrop-filter:none;backdrop-filter:none}}";
4
+
5
+ /**
6
+ * Style variants (v2.6): `variant="minimal | neon | glass | brutalist |
7
+ * fluent | material"` on any `<usa-*>` element — or on any ancestor as
8
+ * `data-usa-variant`, or page-wide with `setVariant()` — sets the shared
9
+ * design tokens every component reads:
10
+ *
11
+ * `--usa-accent`, `--usa-accent-text`, `--usa-surface`, `--usa-text`,
12
+ * `--usa-radius`, `--usa-border`, `--usa-shadow`, `--usa-blur`, `--usa-font`.
13
+ *
14
+ * (`<usa-spinner>`, `<usa-check>` and `<usa-dialog>` already use `variant`
15
+ * for their kind; the token names never clash with those values except
16
+ * `fluent`, which means the same thing there.)
17
+ */
18
+ const VARIANTS = ['minimal', 'neon', 'glass', 'brutalist', 'fluent', 'material'];
19
+ /** Inject the variant token sheet (done automatically by every `ui` component). */
20
+ function adoptVariants() {
21
+ adoptStyles('variants', css);
22
+ }
23
+ /** Apply a variant to the whole page (or `root`); `null` removes it. */
24
+ function setVariant(variant, root = typeof document !== 'undefined' ? document.documentElement : null) {
25
+ if (!root)
26
+ return;
27
+ adoptVariants();
28
+ if (variant)
29
+ root.setAttribute('data-usa-variant', variant);
30
+ else
31
+ root.removeAttribute('data-usa-variant');
32
+ }
33
+
34
+ export { VARIANTS as V, adoptVariants as a, setVariant as s };
35
+ //# sourceMappingURL=variants-VNscPeTD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants-VNscPeTD.js","sources":["../../src/components/ui/variants.ts"],"sourcesContent":["import { adoptStyles } from '../base';\nimport css from './variants.css?raw';\n\n/**\n * Style variants (v2.6): `variant=\"minimal | neon | glass | brutalist |\n * fluent | material\"` on any `<usa-*>` element — or on any ancestor as\n * `data-usa-variant`, or page-wide with `setVariant()` — sets the shared\n * design tokens every component reads:\n *\n * `--usa-accent`, `--usa-accent-text`, `--usa-surface`, `--usa-text`,\n * `--usa-radius`, `--usa-border`, `--usa-shadow`, `--usa-blur`, `--usa-font`.\n *\n * (`<usa-spinner>`, `<usa-check>` and `<usa-dialog>` already use `variant`\n * for their kind; the token names never clash with those values except\n * `fluent`, which means the same thing there.)\n */\nexport const VARIANTS = ['minimal', 'neon', 'glass', 'brutalist', 'fluent', 'material'] as const;\nexport type Variant = (typeof VARIANTS)[number];\n\n/** Inject the variant token sheet (done automatically by every `ui` component). */\nexport function adoptVariants(): void {\n adoptStyles('variants', css);\n}\n\n/** Apply a variant to the whole page (or `root`); `null` removes it. */\nexport function setVariant(variant: Variant | null, root: Element | null = typeof document !== 'undefined' ? document.documentElement : null): void {\n if (!root) return;\n adoptVariants();\n if (variant) root.setAttribute('data-usa-variant', variant);\n else root.removeAttribute('data-usa-variant');\n}\n"],"names":[],"mappings":";;;;AAGA;;;;;;;;;;;;AAYG;AACI,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU;AAGtF;SACgB,aAAa,GAAA;AAC3B,IAAA,WAAW,CAAC,UAAU,EAAE,GAAG,CAAC;AAC9B;AAEA;SACgB,UAAU,CAAC,OAAuB,EAAE,IAAA,GAAuB,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,CAAC,eAAe,GAAG,IAAI,EAAA;AAC1I,IAAA,IAAI,CAAC,IAAI;QAAE;AACX,IAAA,aAAa,EAAE;AACf,IAAA,IAAI,OAAO;AAAE,QAAA,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC;;AACtD,QAAA,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC;AAC/C;;;;"}
@@ -0,0 +1,276 @@
1
+ 'use strict';
2
+
3
+ var base = require('../chunks/base-BaQV-2ha.cjs');
4
+ var indexTags = require('../chunks/index-tags-wv0R_vkO.cjs');
5
+
6
+ /**
7
+ * 4.9 — the 5.0 modern-browser baseline. `baselineReport()` lists which
8
+ * required / progressive features this browser has; `warnBaseline()` logs
9
+ * once in development when a required one is missing.
10
+ */
11
+ /** Required in 5.0: Custom Elements, WAAPI, IntersectionObserver, ResizeObserver, adoptedStyleSheets. Progressive: View Transitions, scroll-driven animations, WebGL. */
12
+ function baselineReport() {
13
+ const w = (typeof window !== 'undefined' ? window : {});
14
+ const d = (typeof document !== 'undefined' ? document : {});
15
+ const css = (q) => typeof w.CSS?.supports === 'function' && w.CSS.supports(q);
16
+ return [
17
+ { id: 'custom-elements', required: true, supported: !!w.customElements },
18
+ { id: 'web-animations', required: true, supported: typeof w.Element?.prototype?.animate === 'function' },
19
+ { id: 'intersection-observer', required: true, supported: typeof w.IntersectionObserver === 'function' },
20
+ { id: 'resize-observer', required: true, supported: typeof w.ResizeObserver === 'function' },
21
+ { id: 'adopted-stylesheets', required: true, supported: 'adoptedStyleSheets' in d },
22
+ { id: 'view-transitions', required: false, supported: typeof d.startViewTransition === 'function' },
23
+ { id: 'scroll-driven-animations', required: false, supported: css('animation-timeline: view()') },
24
+ { id: 'webgl', required: false, supported: !!(d.createElement && (() => { try {
25
+ return d.createElement('canvas').getContext('webgl');
26
+ }
27
+ catch {
28
+ return null;
29
+ } })()) },
30
+ ];
31
+ }
32
+ /** Log (once) which required 5.0 features are missing here. Returns the missing ids. */
33
+ function warnBaseline() {
34
+ const missing = baselineReport().filter((f) => f.required && !f.supported).map((f) => f.id);
35
+ if (missing.length)
36
+ base.deprecate('baseline', `this browser lacks ${missing.join(', ')}; motionary 5.0 requires them (modern-browser baseline, see docs/upgrading-5.md).`);
37
+ return missing;
38
+ }
39
+
40
+ /**
41
+ * motionary/components/a11y — accessibility toolkit (4.4).
42
+ *
43
+ * - Motion-sensitivity levels: `setMotionSensitivity('full' | 'gentle' | 'minimal' | 'static')`.
44
+ * - Static alternatives: what every component shows when motion is off, and
45
+ * `staticAlternative(root)` to freeze any subtree at its final state.
46
+ * - `aria-live` conventions: one shared polite and one assertive region,
47
+ * `announce(message, { politeness })`.
48
+ * - `auditMotionA11y(root)`: the rules the automated regression tests run
49
+ * over every `<usa-*>` element — usable in your own tests too.
50
+ *
51
+ * ```ts
52
+ * import { setMotionSensitivity, announce, auditMotionA11y } from 'motionary/components/a11y';
53
+ * setMotionSensitivity('gentle', true); // no spins / zooms / parallax, remembered
54
+ * announce('3 items added to cart'); // polite live region
55
+ * expect(auditMotionA11y(document.body).errors).toEqual([]);
56
+ * ```
57
+ */
58
+ const KEY = 'usa:sensitivity';
59
+ /** What each level allows, for docs and settings UIs. */
60
+ const MOTION_SENSITIVITY = {
61
+ full: { en: 'All motion', zh: '全部动效', allows: ['fade', 'translate', 'scale', 'rotate', 'parallax', 'loop', 'flash'] },
62
+ gentle: { en: 'Gentle — no spins, zooms or parallax', zh: '温和 —— 无旋转、缩放与视差', allows: ['fade', 'translate', 'loop'] },
63
+ minimal: { en: 'Minimal — fades only', zh: '最少 —— 仅淡入淡出', allows: ['fade'] },
64
+ static: { en: 'Static — no animation', zh: '静态 —— 无动画', allows: [] },
65
+ };
66
+ /** CSS applied at the `static` / `minimal` / `gentle` levels (also stops your own CSS animations under `static`). */
67
+ const SENSITIVITY_CSS = 'html[data-usa-sensitivity="static"] *,html[data-usa-sensitivity="static"] *::before,html[data-usa-sensitivity="static"] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}' +
68
+ 'html[data-usa-sensitivity="minimal"] *,html[data-usa-sensitivity="minimal"] *::before,html[data-usa-sensitivity="minimal"] *::after{animation-duration:1ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}' +
69
+ 'html[data-usa-sensitivity="gentle"]{--usa-parallax:0;--usa-tilt:0}';
70
+ /**
71
+ * Set the motion-sensitivity level for every `<usa-*>` component and the page:
72
+ * sets `data-usa-sensitivity` on `<html>`, adapts component keyframes, and
73
+ * with `persist` remembers the choice (`restoreMotionSensitivity()`).
74
+ * Dispatches `usa:sensitivity` on `document`.
75
+ */
76
+ function setMotionSensitivity(level, persist = false) {
77
+ if (!base.MOTION_SENSITIVITY_LEVELS.includes(level))
78
+ return;
79
+ base.configureComponents({ motionSensitivity: level });
80
+ base.adoptStyles('a11y-sensitivity', SENSITIVITY_CSS);
81
+ if (persist) {
82
+ try {
83
+ localStorage.setItem(KEY, level);
84
+ }
85
+ catch {
86
+ /* private mode */
87
+ }
88
+ }
89
+ if (level === 'static' && typeof document !== 'undefined')
90
+ staticAlternative(document.documentElement);
91
+ if (typeof document !== 'undefined')
92
+ document.dispatchEvent(new CustomEvent('usa:sensitivity', { detail: { level } }));
93
+ }
94
+ /** Re-apply a persisted level (call early on page load). Returns the active level. */
95
+ function restoreMotionSensitivity() {
96
+ try {
97
+ const v = localStorage.getItem(KEY);
98
+ if (v && base.MOTION_SENSITIVITY_LEVELS.includes(v))
99
+ setMotionSensitivity(v);
100
+ }
101
+ catch {
102
+ /* ignore */
103
+ }
104
+ return base.getMotionSensitivity();
105
+ }
106
+ /** `true` when the current level allows a kind of motion (`'rotate'`, `'parallax'`, `'loop'`…). */
107
+ function motionAllowed(kind, level = base.getMotionSensitivity()) {
108
+ return MOTION_SENSITIVITY[level].allows.includes(kind);
109
+ }
110
+ /** The static alternative of each category: what its elements show without motion. */
111
+ const STATIC_ALTERNATIVES = {
112
+ reveal: 'Content visible in place; progress bars show the current value.',
113
+ text: 'Full final text (screen readers always get a plain copy).',
114
+ interaction: 'Normal hover / focus styles; no tilt, magnet or ripple.',
115
+ feedback: 'Spinners become a static busy indicator; progress shows its value; toasts appear without sliding.',
116
+ background: 'A still frame of the background (gradient / pattern); particles and marquees stop.',
117
+ transitions: 'Dialogs, accordions and views switch instantly.',
118
+ physics: 'Values jump to their target; drag still works, without inertia.',
119
+ cards: 'Cards are shown flat and fully readable; stacks become lists.',
120
+ click: 'Clicks work and states are announced; no bursts, confetti or deformation.',
121
+ ui: 'Tabs, drawers, sheets and popovers open instantly with focus management intact.',
122
+ page: 'Page transitions are instant; cursors and ambient layers are hidden.',
123
+ timeline: 'Every step is shown at its final state.',
124
+ gesture: 'Buttons / keys provide the same actions as swipes and pinches.',
125
+ svg: 'Drawings and icons are shown complete.',
126
+ webgl: 'A static poster image or CSS gradient instead of the shader.',
127
+ depth: 'Flat, front-facing layout.',
128
+ layout: 'Items reflow instantly.',
129
+ packs: 'Roles are styled but not animated.',
130
+ fx: 'Effects are skipped or reduced to a short fade; the content is unchanged.',
131
+ };
132
+ /**
133
+ * Freeze a subtree at its static alternative: finishes running animations
134
+ * (`finish()`, so content lands on its final state), marks the root with
135
+ * `data-usa-static` and returns an undo that removes the mark.
136
+ */
137
+ function staticAlternative(root) {
138
+ const getAll = root.getAnimations;
139
+ if (typeof getAll === 'function') {
140
+ for (const a of getAll.call(root, { subtree: true })) {
141
+ try {
142
+ const it = a.effect?.getComputedTiming().iterations;
143
+ if (it === Infinity)
144
+ a.cancel();
145
+ else
146
+ a.finish();
147
+ }
148
+ catch {
149
+ /* finished already */
150
+ }
151
+ }
152
+ }
153
+ root.setAttribute('data-usa-static', '');
154
+ return () => root.removeAttribute('data-usa-static');
155
+ }
156
+ /** The ids of the shared live regions. */
157
+ const LIVE_REGION_IDS = { polite: 'usa-live-polite', assertive: 'usa-live-assertive' };
158
+ /** The shared live region (created once, visually hidden, `role="status"` / `role="alert"`). */
159
+ function liveRegion(politeness = 'polite') {
160
+ if (typeof document === 'undefined' || !document.body)
161
+ return null;
162
+ const id = LIVE_REGION_IDS[politeness];
163
+ let el = document.getElementById(id);
164
+ if (!el) {
165
+ el = document.createElement('div');
166
+ el.id = id;
167
+ el.className = 'usa-sr';
168
+ el.setAttribute('role', politeness === 'assertive' ? 'alert' : 'status');
169
+ el.setAttribute('aria-live', politeness);
170
+ el.setAttribute('aria-atomic', 'true');
171
+ document.body.appendChild(el);
172
+ }
173
+ return el;
174
+ }
175
+ let lastMsg = '';
176
+ let lastAt = 0;
177
+ /**
178
+ * Announce a message through the shared live region. Conventions: `polite`
179
+ * for results of the user's own actions (added, saved, copied), `assertive`
180
+ * only for errors that block them. Identical messages within `dedupe` ms
181
+ * (default 500) are dropped; the region is cleared first so repeats are read.
182
+ */
183
+ function announce(message, options = {}) {
184
+ const { politeness = 'polite', dedupe = 500 } = options;
185
+ const t = Date.now();
186
+ if (!message || (message === lastMsg && t - lastAt < dedupe))
187
+ return false;
188
+ lastMsg = message;
189
+ lastAt = t;
190
+ const el = liveRegion(politeness);
191
+ if (!el)
192
+ return false;
193
+ el.textContent = '';
194
+ el.textContent = message;
195
+ return true;
196
+ }
197
+ const FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
198
+ const NAMED_ROLES = ['button', 'switch', 'checkbox', 'slider', 'tab', 'progressbar', 'radiogroup', 'dialog'];
199
+ function accessibleName(el) {
200
+ const label = el.getAttribute('aria-label');
201
+ if (label)
202
+ return label;
203
+ const by = el.getAttribute('aria-labelledby');
204
+ if (by)
205
+ return by.split(/\s+/).map((id) => el.ownerDocument.getElementById(id)?.textContent || '').join(' ').trim();
206
+ return (el.textContent || el.getAttribute('title') || '').trim();
207
+ }
208
+ /**
209
+ * Check a subtree against the library's motion-a11y rules:
210
+ * - `aria-hidden-focusable` (error): focusable content inside `aria-hidden`.
211
+ * - `role-name` (error): a widget role without an accessible name.
212
+ * - `range-value` (error): a slider / determinate progressbar without `aria-valuenow`.
213
+ * - `img-alt` (error): an `<img>` without `alt`.
214
+ * - `assertive-live` (warning): `aria-live="assertive"` outside `role="alert"`.
215
+ * - `infinite-no-control` (warning, WCAG 2.2.2): an endless animation on a
216
+ * page with no way to pause motion (`<usa-motion-switch>` or `[data-usa-pause]`).
217
+ */
218
+ function auditMotionA11y(root) {
219
+ const issues = [];
220
+ const add = (rule, level, element, message) => issues.push({ rule, level, element, message });
221
+ const scope = root;
222
+ scope.querySelectorAll('[aria-hidden="true"]').forEach((h) => {
223
+ const f = (h.matches(FOCUSABLE) ? [h] : Array.from(h.querySelectorAll(FOCUSABLE))).filter((x) => !x.closest('[inert]'));
224
+ f.forEach((x) => add('aria-hidden-focusable', 'error', x, `focusable <${x.tagName.toLowerCase()}> inside aria-hidden`));
225
+ });
226
+ scope.querySelectorAll('[role]').forEach((el) => {
227
+ const role = el.getAttribute('role');
228
+ if (NAMED_ROLES.includes(role) && !accessibleName(el))
229
+ add('role-name', 'error', el, `role="${role}" has no accessible name`);
230
+ if (role === 'slider' && !el.hasAttribute('aria-valuenow'))
231
+ add('range-value', 'error', el, 'slider without aria-valuenow');
232
+ });
233
+ scope.querySelectorAll('img:not([alt])').forEach((el) => add('img-alt', 'error', el, '<img> without alt'));
234
+ scope.querySelectorAll('[aria-live="assertive"]').forEach((el) => {
235
+ if (el.getAttribute('role') !== 'alert')
236
+ add('assertive-live', 'warning', el, 'assertive live region outside role="alert"');
237
+ });
238
+ const doc = root.ownerDocument || root;
239
+ const anims = typeof root.getAnimations === 'function' ? root.getAnimations({ subtree: true }) : [];
240
+ const control = doc && (doc.querySelector('usa-motion-switch, [data-usa-pause]') || doc.documentElement.hasAttribute('data-usa-sensitivity'));
241
+ if (!control)
242
+ anims.forEach((a) => {
243
+ try {
244
+ if (a.effect?.getComputedTiming().iterations === Infinity) {
245
+ const t = a.effect.target;
246
+ if (t)
247
+ add('infinite-no-control', 'warning', t, 'endless animation and no motion control on the page');
248
+ }
249
+ }
250
+ catch {
251
+ /* ignore */
252
+ }
253
+ });
254
+ return { errors: issues.filter((i) => i.level === 'error'), warnings: issues.filter((i) => i.level === 'warning') };
255
+ }
256
+ /** Every `<usa-*>` tag, for sweeping audits. */
257
+ const ALL_TAGS = Object.values(indexTags.COMPONENT_CATEGORIES).flat();
258
+
259
+ exports.MOTION_SENSITIVITY_LEVELS = base.MOTION_SENSITIVITY_LEVELS;
260
+ exports.adaptKeyframes = base.adaptKeyframes;
261
+ exports.getMotionSensitivity = base.getMotionSensitivity;
262
+ exports.ALL_TAGS = ALL_TAGS;
263
+ exports.LIVE_REGION_IDS = LIVE_REGION_IDS;
264
+ exports.MOTION_SENSITIVITY = MOTION_SENSITIVITY;
265
+ exports.SENSITIVITY_CSS = SENSITIVITY_CSS;
266
+ exports.STATIC_ALTERNATIVES = STATIC_ALTERNATIVES;
267
+ exports.announce = announce;
268
+ exports.auditMotionA11y = auditMotionA11y;
269
+ exports.baselineReport = baselineReport;
270
+ exports.liveRegion = liveRegion;
271
+ exports.motionAllowed = motionAllowed;
272
+ exports.restoreMotionSensitivity = restoreMotionSensitivity;
273
+ exports.setMotionSensitivity = setMotionSensitivity;
274
+ exports.staticAlternative = staticAlternative;
275
+ exports.warnBaseline = warnBaseline;
276
+ //# sourceMappingURL=a11y.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a11y.cjs","sources":["../../src/components/a11y/baseline.ts","../../src/components/a11y/index.ts"],"sourcesContent":["/**\n * 4.9 — the 5.0 modern-browser baseline. `baselineReport()` lists which\n * required / progressive features this browser has; `warnBaseline()` logs\n * once in development when a required one is missing.\n */\nimport { deprecate } from '../base';\n\nexport interface BaselineFeature {\n id: string;\n required: boolean;\n supported: boolean;\n}\n\n/** Required in 5.0: Custom Elements, WAAPI, IntersectionObserver, ResizeObserver, adoptedStyleSheets. Progressive: View Transitions, scroll-driven animations, WebGL. */\nexport function baselineReport(): BaselineFeature[] {\n const w = (typeof window !== 'undefined' ? window : {}) as any;\n const d = (typeof document !== 'undefined' ? document : {}) as any;\n const css = (q: string) => typeof w.CSS?.supports === 'function' && w.CSS.supports(q);\n return [\n { id: 'custom-elements', required: true, supported: !!w.customElements },\n { id: 'web-animations', required: true, supported: typeof w.Element?.prototype?.animate === 'function' },\n { id: 'intersection-observer', required: true, supported: typeof w.IntersectionObserver === 'function' },\n { id: 'resize-observer', required: true, supported: typeof w.ResizeObserver === 'function' },\n { id: 'adopted-stylesheets', required: true, supported: 'adoptedStyleSheets' in d },\n { id: 'view-transitions', required: false, supported: typeof d.startViewTransition === 'function' },\n { id: 'scroll-driven-animations', required: false, supported: css('animation-timeline: view()') },\n { id: 'webgl', required: false, supported: !!(d.createElement && (() => { try { return d.createElement('canvas').getContext('webgl'); } catch { return null; } })()) },\n ];\n}\n\n/** Log (once) which required 5.0 features are missing here. Returns the missing ids. */\nexport function warnBaseline(): string[] {\n const missing = baselineReport().filter((f) => f.required && !f.supported).map((f) => f.id);\n if (missing.length) deprecate('baseline', `this browser lacks ${missing.join(', ')}; motionary 5.0 requires them (modern-browser baseline, see docs/upgrading-5.md).`);\n return missing;\n}\n","/**\n * motionary/components/a11y — accessibility toolkit (4.4).\n *\n * - Motion-sensitivity levels: `setMotionSensitivity('full' | 'gentle' | 'minimal' | 'static')`.\n * - Static alternatives: what every component shows when motion is off, and\n * `staticAlternative(root)` to freeze any subtree at its final state.\n * - `aria-live` conventions: one shared polite and one assertive region,\n * `announce(message, { politeness })`.\n * - `auditMotionA11y(root)`: the rules the automated regression tests run\n * over every `<usa-*>` element — usable in your own tests too.\n *\n * ```ts\n * import { setMotionSensitivity, announce, auditMotionA11y } from 'motionary/components/a11y';\n * setMotionSensitivity('gentle', true); // no spins / zooms / parallax, remembered\n * announce('3 items added to cart'); // polite live region\n * expect(auditMotionA11y(document.body).errors).toEqual([]);\n * ```\n */\nimport {\n configureComponents,\n getMotionSensitivity,\n adaptKeyframes,\n adoptStyles,\n MOTION_SENSITIVITY_LEVELS,\n type MotionSensitivity,\n} from '../base';\nimport { COMPONENT_CATEGORIES, type ComponentCategory } from '../index-tags';\n\nexport { getMotionSensitivity, adaptKeyframes, MOTION_SENSITIVITY_LEVELS };\nexport { baselineReport, warnBaseline } from './baseline';\nexport type { BaselineFeature } from './baseline';\nexport type { MotionSensitivity };\n\nconst KEY = 'usa:sensitivity';\n\n/** What each level allows, for docs and settings UIs. */\nexport const MOTION_SENSITIVITY: Record<MotionSensitivity, { en: string; zh: string; allows: string[] }> = {\n full: { en: 'All motion', zh: '全部动效', allows: ['fade', 'translate', 'scale', 'rotate', 'parallax', 'loop', 'flash'] },\n gentle: { en: 'Gentle — no spins, zooms or parallax', zh: '温和 —— 无旋转、缩放与视差', allows: ['fade', 'translate', 'loop'] },\n minimal: { en: 'Minimal — fades only', zh: '最少 —— 仅淡入淡出', allows: ['fade'] },\n static: { en: 'Static — no animation', zh: '静态 —— 无动画', allows: [] },\n};\n\n/** CSS applied at the `static` / `minimal` / `gentle` levels (also stops your own CSS animations under `static`). */\nexport const SENSITIVITY_CSS =\n 'html[data-usa-sensitivity=\"static\"] *,html[data-usa-sensitivity=\"static\"] *::before,html[data-usa-sensitivity=\"static\"] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}' +\n 'html[data-usa-sensitivity=\"minimal\"] *,html[data-usa-sensitivity=\"minimal\"] *::before,html[data-usa-sensitivity=\"minimal\"] *::after{animation-duration:1ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}' +\n 'html[data-usa-sensitivity=\"gentle\"]{--usa-parallax:0;--usa-tilt:0}';\n\n/**\n * Set the motion-sensitivity level for every `<usa-*>` component and the page:\n * sets `data-usa-sensitivity` on `<html>`, adapts component keyframes, and\n * with `persist` remembers the choice (`restoreMotionSensitivity()`).\n * Dispatches `usa:sensitivity` on `document`.\n */\nexport function setMotionSensitivity(level: MotionSensitivity, persist = false): void {\n if (!MOTION_SENSITIVITY_LEVELS.includes(level)) return;\n configureComponents({ motionSensitivity: level });\n adoptStyles('a11y-sensitivity', SENSITIVITY_CSS);\n if (persist) {\n try {\n localStorage.setItem(KEY, level);\n } catch {\n /* private mode */\n }\n }\n if (level === 'static' && typeof document !== 'undefined') staticAlternative(document.documentElement);\n if (typeof document !== 'undefined') document.dispatchEvent(new CustomEvent('usa:sensitivity', { detail: { level } }));\n}\n\n/** Re-apply a persisted level (call early on page load). Returns the active level. */\nexport function restoreMotionSensitivity(): MotionSensitivity {\n try {\n const v = localStorage.getItem(KEY) as MotionSensitivity | null;\n if (v && MOTION_SENSITIVITY_LEVELS.includes(v)) setMotionSensitivity(v);\n } catch {\n /* ignore */\n }\n return getMotionSensitivity();\n}\n\n/** `true` when the current level allows a kind of motion (`'rotate'`, `'parallax'`, `'loop'`…). */\nexport function motionAllowed(kind: string, level: MotionSensitivity = getMotionSensitivity()): boolean {\n return MOTION_SENSITIVITY[level].allows.includes(kind);\n}\n\n/** The static alternative of each category: what its elements show without motion. */\nexport const STATIC_ALTERNATIVES: Record<ComponentCategory, string> = {\n reveal: 'Content visible in place; progress bars show the current value.',\n text: 'Full final text (screen readers always get a plain copy).',\n interaction: 'Normal hover / focus styles; no tilt, magnet or ripple.',\n feedback: 'Spinners become a static busy indicator; progress shows its value; toasts appear without sliding.',\n background: 'A still frame of the background (gradient / pattern); particles and marquees stop.',\n transitions: 'Dialogs, accordions and views switch instantly.',\n physics: 'Values jump to their target; drag still works, without inertia.',\n cards: 'Cards are shown flat and fully readable; stacks become lists.',\n click: 'Clicks work and states are announced; no bursts, confetti or deformation.',\n ui: 'Tabs, drawers, sheets and popovers open instantly with focus management intact.',\n page: 'Page transitions are instant; cursors and ambient layers are hidden.',\n timeline: 'Every step is shown at its final state.',\n gesture: 'Buttons / keys provide the same actions as swipes and pinches.',\n svg: 'Drawings and icons are shown complete.',\n webgl: 'A static poster image or CSS gradient instead of the shader.',\n depth: 'Flat, front-facing layout.',\n layout: 'Items reflow instantly.',\n packs: 'Roles are styled but not animated.',\n fx: 'Effects are skipped or reduced to a short fade; the content is unchanged.',\n};\n\n/**\n * Freeze a subtree at its static alternative: finishes running animations\n * (`finish()`, so content lands on its final state), marks the root with\n * `data-usa-static` and returns an undo that removes the mark.\n */\nexport function staticAlternative(root: Element): () => void {\n const getAll = (root as any).getAnimations as undefined | ((o: { subtree: boolean }) => Animation[]);\n if (typeof getAll === 'function') {\n for (const a of getAll.call(root, { subtree: true })) {\n try {\n const it = a.effect?.getComputedTiming().iterations;\n if (it === Infinity) a.cancel();\n else a.finish();\n } catch {\n /* finished already */\n }\n }\n }\n root.setAttribute('data-usa-static', '');\n return () => root.removeAttribute('data-usa-static');\n}\n\n// --- aria-live conventions ---------------------------------------------------\n\nexport type Politeness = 'polite' | 'assertive';\n/** The ids of the shared live regions. */\nexport const LIVE_REGION_IDS: Record<Politeness, string> = { polite: 'usa-live-polite', assertive: 'usa-live-assertive' };\n\n/** The shared live region (created once, visually hidden, `role=\"status\"` / `role=\"alert\"`). */\nexport function liveRegion(politeness: Politeness = 'polite'): HTMLElement | null {\n if (typeof document === 'undefined' || !document.body) return null;\n const id = LIVE_REGION_IDS[politeness];\n let el = document.getElementById(id);\n if (!el) {\n el = document.createElement('div');\n el.id = id;\n el.className = 'usa-sr';\n el.setAttribute('role', politeness === 'assertive' ? 'alert' : 'status');\n el.setAttribute('aria-live', politeness);\n el.setAttribute('aria-atomic', 'true');\n document.body.appendChild(el);\n }\n return el;\n}\n\nlet lastMsg = '';\nlet lastAt = 0;\n/**\n * Announce a message through the shared live region. Conventions: `polite`\n * for results of the user's own actions (added, saved, copied), `assertive`\n * only for errors that block them. Identical messages within `dedupe` ms\n * (default 500) are dropped; the region is cleared first so repeats are read.\n */\nexport function announce(message: string, options: { politeness?: Politeness; dedupe?: number } = {}): boolean {\n const { politeness = 'polite', dedupe = 500 } = options;\n const t = Date.now();\n if (!message || (message === lastMsg && t - lastAt < dedupe)) return false;\n lastMsg = message;\n lastAt = t;\n const el = liveRegion(politeness);\n if (!el) return false;\n el.textContent = '';\n el.textContent = message;\n return true;\n}\n\n// --- audit ---------------------------------------------------------------------\n\nexport interface A11yIssue {\n rule: string;\n level: 'error' | 'warning';\n element: Element;\n message: string;\n}\n\nconst FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])';\nconst NAMED_ROLES = ['button', 'switch', 'checkbox', 'slider', 'tab', 'progressbar', 'radiogroup', 'dialog'];\n\nfunction accessibleName(el: Element): string {\n const label = el.getAttribute('aria-label');\n if (label) return label;\n const by = el.getAttribute('aria-labelledby');\n if (by) return by.split(/\\s+/).map((id) => el.ownerDocument.getElementById(id)?.textContent || '').join(' ').trim();\n return (el.textContent || el.getAttribute('title') || '').trim();\n}\n\n/**\n * Check a subtree against the library's motion-a11y rules:\n * - `aria-hidden-focusable` (error): focusable content inside `aria-hidden`.\n * - `role-name` (error): a widget role without an accessible name.\n * - `range-value` (error): a slider / determinate progressbar without `aria-valuenow`.\n * - `img-alt` (error): an `<img>` without `alt`.\n * - `assertive-live` (warning): `aria-live=\"assertive\"` outside `role=\"alert\"`.\n * - `infinite-no-control` (warning, WCAG 2.2.2): an endless animation on a\n * page with no way to pause motion (`<usa-motion-switch>` or `[data-usa-pause]`).\n */\nexport function auditMotionA11y(root: Element | Document): { errors: A11yIssue[]; warnings: A11yIssue[] } {\n const issues: A11yIssue[] = [];\n const add = (rule: string, level: A11yIssue['level'], element: Element, message: string) => issues.push({ rule, level, element, message });\n const scope = root as ParentNode;\n scope.querySelectorAll('[aria-hidden=\"true\"]').forEach((h) => {\n const f = (h.matches(FOCUSABLE) ? [h] : Array.from(h.querySelectorAll(FOCUSABLE))).filter((x) => !x.closest('[inert]'));\n f.forEach((x) => add('aria-hidden-focusable', 'error', x, `focusable <${x.tagName.toLowerCase()}> inside aria-hidden`));\n });\n scope.querySelectorAll('[role]').forEach((el) => {\n const role = el.getAttribute('role')!;\n if (NAMED_ROLES.includes(role) && !accessibleName(el)) add('role-name', 'error', el, `role=\"${role}\" has no accessible name`);\n if (role === 'slider' && !el.hasAttribute('aria-valuenow'))\n add('range-value', 'error', el, 'slider without aria-valuenow');\n });\n scope.querySelectorAll('img:not([alt])').forEach((el) => add('img-alt', 'error', el, '<img> without alt'));\n scope.querySelectorAll('[aria-live=\"assertive\"]').forEach((el) => {\n if (el.getAttribute('role') !== 'alert') add('assertive-live', 'warning', el, 'assertive live region outside role=\"alert\"');\n });\n const doc = (root as Node).ownerDocument || (root as Document);\n const anims = typeof (root as any).getAnimations === 'function' ? ((root as any).getAnimations({ subtree: true }) as Animation[]) : [];\n const control = doc && (doc.querySelector('usa-motion-switch, [data-usa-pause]') || doc.documentElement.hasAttribute('data-usa-sensitivity'));\n if (!control)\n anims.forEach((a) => {\n try {\n if (a.effect?.getComputedTiming().iterations === Infinity) {\n const t = (a.effect as KeyframeEffect).target;\n if (t) add('infinite-no-control', 'warning', t, 'endless animation and no motion control on the page');\n }\n } catch {\n /* ignore */\n }\n });\n return { errors: issues.filter((i) => i.level === 'error'), warnings: issues.filter((i) => i.level === 'warning') };\n}\n\n/** Every `<usa-*>` tag, for sweeping audits. */\nexport const ALL_TAGS: string[] = (Object.values(COMPONENT_CATEGORIES) as readonly (readonly string[])[]).flat();\n"],"names":["deprecate","MOTION_SENSITIVITY_LEVELS","configureComponents","adoptStyles","getMotionSensitivity","COMPONENT_CATEGORIES"],"mappings":";;;;;AAAA;;;;AAIG;AASH;SACgB,cAAc,GAAA;AAC5B,IAAA,MAAM,CAAC,IAAI,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,EAAE,CAAQ;AAC9D,IAAA,MAAM,CAAC,IAAI,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,GAAG,EAAE,CAAQ;IAClE,MAAM,GAAG,GAAG,CAAC,CAAS,KAAK,OAAO,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,UAAU,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrF,OAAO;AACL,QAAA,EAAE,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE;QACxE,EAAE,EAAE,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,KAAK,UAAU,EAAE;AACxG,QAAA,EAAE,EAAE,EAAE,uBAAuB,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,oBAAoB,KAAK,UAAU,EAAE;AACxG,Q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