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,1050 @@
1
+ 'use strict';
2
+
3
+ var base = require('../chunks/base-BaQV-2ha.cjs');
4
+ var spring = require('../chunks/spring-Dgx187Vh.cjs');
5
+ var variants = require('../chunks/variants-BhjyddG8.cjs');
6
+
7
+ /** Position a fixed `floating` element next to `anchor`, flipping when it would leave the viewport. */
8
+ function place(floating, anchor, placement = 'top', gap = 8) {
9
+ const a = anchor.getBoundingClientRect();
10
+ const f = floating.getBoundingClientRect();
11
+ const W = window.innerWidth || 1024;
12
+ const H = window.innerHeight || 768;
13
+ const fits = {
14
+ top: a.top - f.height - gap >= 0,
15
+ bottom: a.bottom + f.height + gap <= H,
16
+ left: a.left - f.width - gap >= 0,
17
+ right: a.right + f.width + gap <= W,
18
+ };
19
+ const opposite = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' };
20
+ const p = fits[placement] || !fits[opposite[placement]] ? placement : opposite[placement];
21
+ let x = 0;
22
+ let y = 0;
23
+ if (p === 'top' || p === 'bottom') {
24
+ x = Math.min(Math.max(4, a.left + a.width / 2 - f.width / 2), W - f.width - 4);
25
+ y = p === 'top' ? a.top - f.height - gap : a.bottom + gap;
26
+ }
27
+ else {
28
+ y = Math.min(Math.max(4, a.top + a.height / 2 - f.height / 2), H - f.height - 4);
29
+ x = p === 'left' ? a.left - f.width - gap : a.right + gap;
30
+ }
31
+ floating.style.left = `${Math.round(x)}px`;
32
+ floating.style.top = `${Math.round(y)}px`;
33
+ floating.setAttribute('data-placement', p);
34
+ return p;
35
+ }
36
+ let uid = 0;
37
+ const nextId = (prefix) => `${prefix}-${++uid}`;
38
+
39
+ var css$a = "usa-tabs{display:block;font-family:var(--usa-font)}usa-tabs .usa-tabs-list{position:relative;display:flex;gap:4px;border-bottom:1px solid color-mix(in srgb,currentColor 14%,transparent)}usa-tabs [role=\"tab\"]{position:relative;z-index:1;padding:10px 14px;border:0;background:none;color:inherit;font:inherit;cursor:pointer;opacity:0.7;transition:opacity 0.2s ease,color 0.2s ease;border-radius:calc(var(--usa-radius,14px) / 2)}usa-tabs [role=\"tab\"][aria-selected=\"true\"]{opacity:1;color:var(--usa-accent,#7c5cff)}usa-tabs [role=\"tab\"]:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:-2px}usa-tabs .usa-tabs-indicator{position:absolute;left:0;bottom:-1px;height:3px;width:0;border-radius:3px;background:var(--usa-accent,#7c5cff);pointer-events:none}usa-tabs[indicator=\"pill\"] .usa-tabs-list{border-bottom:0;padding:4px;border-radius:999px;background:color-mix(in srgb,currentColor 8%,transparent)}usa-tabs[indicator=\"pill\"] .usa-tabs-indicator{top:4px;bottom:4px;height:auto;border-radius:999px;opacity:0.18}usa-tabs [role=\"tabpanel\"]{padding:14px 2px}usa-tabs [role=\"tabpanel\"]:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:2px;border-radius:6px}";
40
+
41
+ function defineTabs(tag = 'usa-tabs') {
42
+ variants.adoptVariants();
43
+ return base.defineElement(tag, (Base) => class UsaTabs extends Base {
44
+ constructor() {
45
+ super(...arguments);
46
+ this._i = 0;
47
+ this._bar = null;
48
+ }
49
+ static get observedAttributes() {
50
+ return ['indicator'];
51
+ }
52
+ get selected() {
53
+ return this._i;
54
+ }
55
+ set selected(v) {
56
+ this.select(v);
57
+ }
58
+ tabs() {
59
+ return Array.from(this.querySelectorAll('[data-tab]')).filter((t) => t.closest(this.localName) === this);
60
+ }
61
+ panels() {
62
+ return Array.from(this.querySelectorAll('[data-panel]')).filter((t) => t.closest(this.localName) === this);
63
+ }
64
+ mount() {
65
+ const tabs = this.tabs();
66
+ const panels = this.panels();
67
+ const list = tabs[0]?.parentElement;
68
+ if (!list)
69
+ return;
70
+ list.setAttribute('role', 'tablist');
71
+ list.classList.add('usa-tabs-list');
72
+ if (!list.querySelector(':scope > .usa-tabs-indicator')) {
73
+ this._bar = document.createElement('span');
74
+ this._bar.className = 'usa-tabs-indicator';
75
+ this._bar.setAttribute('aria-hidden', 'true');
76
+ list.append(this._bar);
77
+ }
78
+ else
79
+ this._bar = list.querySelector(':scope > .usa-tabs-indicator');
80
+ tabs.forEach((t, i) => {
81
+ t.id || (t.id = nextId('usa-tab'));
82
+ t.setAttribute('role', 'tab');
83
+ const p = panels[i];
84
+ if (p) {
85
+ p.id || (p.id = nextId('usa-panel'));
86
+ p.setAttribute('role', 'tabpanel');
87
+ p.setAttribute('aria-labelledby', t.id);
88
+ t.setAttribute('aria-controls', p.id);
89
+ if (!p.hasAttribute('tabindex'))
90
+ p.tabIndex = 0;
91
+ }
92
+ this.listen(t, 'click', () => this.select(i));
93
+ });
94
+ this.listen(list, 'keydown', (e) => {
95
+ const n = tabs.length;
96
+ const map = { ArrowRight: this._i + 1, ArrowDown: this._i + 1, ArrowLeft: this._i - 1, ArrowUp: this._i - 1, Home: 0, End: n - 1 };
97
+ if (!(e.key in map))
98
+ return;
99
+ e.preventDefault();
100
+ this.select((map[e.key] + n) % n, true);
101
+ });
102
+ const ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(() => this.moveBar(false)) : null;
103
+ ro?.observe(list);
104
+ this.onCleanup(() => ro?.disconnect());
105
+ this.select(Math.max(0, Math.min(tabs.length - 1, this.num('selected', 0))), false, true);
106
+ }
107
+ moveBar(animate) {
108
+ const t = this.tabs()[this._i];
109
+ const bar = this._bar;
110
+ if (!t || !bar)
111
+ return;
112
+ const from = bar.style.transform;
113
+ const fromW = bar.style.width;
114
+ bar.style.width = `${t.offsetWidth}px`;
115
+ bar.style.transform = `translateX(${t.offsetLeft}px)`;
116
+ if (animate && from && !this.reduced)
117
+ this.motion(bar, [{ transform: from, width: fromW }, { transform: bar.style.transform, width: bar.style.width }], spring.springEasing('stiff'));
118
+ }
119
+ select(i, focus = false, initial = false) {
120
+ const tabs = this.tabs();
121
+ const panels = this.panels();
122
+ if (!tabs[i])
123
+ return;
124
+ const prev = this._i;
125
+ this._i = i;
126
+ this.setAttribute('selected', String(i));
127
+ tabs.forEach((t, j) => {
128
+ t.setAttribute('aria-selected', String(j === i));
129
+ t.tabIndex = j === i ? 0 : -1;
130
+ });
131
+ panels.forEach((p, j) => (p.hidden = j !== i));
132
+ if (focus)
133
+ tabs[i].focus();
134
+ this.moveBar(!initial);
135
+ if (initial || prev === i)
136
+ return;
137
+ const p = panels[i];
138
+ if (p && !this.reduced)
139
+ this.motion(p, [{ opacity: 0, transform: `translateX(${i > prev ? 16 : -16}px)` }, { opacity: 1, transform: 'none' }], { duration: 280, easing: 'cubic-bezier(0.22, 1, 0.36, 1)' });
140
+ this.emit('change', { index: i });
141
+ }
142
+ }, { id: 'tabs', text: css$a });
143
+ }
144
+
145
+ var css$9 = "usa-drawer,usa-bottom-sheet{position:fixed;z-index:1001;box-sizing:border-box;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;will-change:transform;outline:none}usa-drawer{top:0;bottom:0;left:0;width:min(86vw,360px);border-radius:0 var(--usa-radius,14px) var(--usa-radius,14px) 0;padding:20px}usa-drawer[side=\"right\"]{left:auto;right:0;border-radius:var(--usa-radius,14px) 0 0 var(--usa-radius,14px)}usa-drawer[side=\"top\"],usa-drawer[side=\"bottom\"]{left:0;right:0;width:auto;bottom:auto;max-height:80vh;border-radius:0 0 var(--usa-radius,14px) var(--usa-radius,14px);touch-action:pan-x}usa-drawer[side=\"bottom\"]{top:auto;bottom:0;border-radius:var(--usa-radius,14px) var(--usa-radius,14px) 0 0}usa-bottom-sheet{left:0;right:0;bottom:0;margin:0 auto;max-width:640px;border-radius:22px 22px 0 0;padding:8px 20px 24px;touch-action:none}usa-bottom-sheet .usa-sheet-handle{width:40px;height:5px;border-radius:3px;margin:4px auto 14px;background:color-mix(in srgb,currentColor 35%,transparent);cursor:grab}usa-drawer[hidden],usa-bottom-sheet[hidden]{display:none}.usa-panel-backdrop{position:fixed;inset:0;z-index:1000;background:rgb(0 0 0 / 0.45)}";
146
+
147
+ /** Shared machinery of `<usa-drawer>` and `<usa-bottom-sheet>`: backdrop, focus, Esc, drag-to-dismiss. */
148
+ function makePanel(Base, kind) {
149
+ return class UsaPanel extends Base {
150
+ constructor() {
151
+ super(...arguments);
152
+ this._backdrop = null;
153
+ this._return = null;
154
+ this._drag = null;
155
+ }
156
+ static get observedAttributes() {
157
+ return ['open', 'side'];
158
+ }
159
+ get open() {
160
+ return this.flag('open');
161
+ }
162
+ set open(v) {
163
+ this.setFlag('open', v);
164
+ }
165
+ /** Main axis size of the panel (px). */
166
+ size() {
167
+ const r = this.getBoundingClientRect();
168
+ return (kind === 'sheet' || this.vertical() ? r.height : r.width) || (kind === 'sheet' ? window.innerHeight * 0.9 : 320);
169
+ }
170
+ vertical() {
171
+ return kind === 'sheet' || this.str('side') === 'top' || this.str('side') === 'bottom';
172
+ }
173
+ /** +1 when hiding moves the panel in the positive axis direction. */
174
+ dir() {
175
+ const side = kind === 'sheet' ? 'bottom' : this.str('side', 'left');
176
+ return side === 'left' || side === 'top' ? -1 : 1;
177
+ }
178
+ /** Offsets (px from fully open) the panel may rest at; the largest closes it. */
179
+ stops() {
180
+ return [0];
181
+ }
182
+ render(v) {
183
+ const axis = this.vertical() ? 'Y' : 'X';
184
+ this.style.transform = `translate${axis}(${(v * this.dir()).toFixed(1)}px)`;
185
+ if (this._backdrop)
186
+ this._backdrop.style.opacity = String(base.clamp(1 - v / (this.size() || 1), 0, 1));
187
+ }
188
+ mount() {
189
+ this.setAttribute('role', 'dialog');
190
+ if (this.str('label'))
191
+ this.setAttribute('aria-label', this.str('label'));
192
+ if (!this.hasAttribute('tabindex'))
193
+ this.tabIndex = -1;
194
+ this.classList.add('usa-surface');
195
+ this._pos = spring.createSpring({ value: this.size() * 2, spring: 'stiff', onUpdate: (v) => this.render(v), onRest: (v) => v >= this.size() - 1 && !this.open && this.afterClose() });
196
+ if (this.open)
197
+ this.show(false);
198
+ else {
199
+ this.hidden = true;
200
+ this._pos.jump(this.size() * 1.2);
201
+ }
202
+ this.listen(document, 'keydown', (e) => e.key === 'Escape' && this.open && this.close());
203
+ this.listen(this, 'click', (e) => e.target.closest?.('[data-close]') && this.close());
204
+ this.listen(this, 'pointerdown', (e) => this.dragStart(e));
205
+ this.listen(this, 'pointermove', (e) => this.dragMove(e));
206
+ this.listen(this, 'pointerup', (e) => this.dragEnd(e));
207
+ this.listen(this, 'pointercancel', (e) => this.dragEnd(e));
208
+ }
209
+ unmount() {
210
+ this._pos?.stop();
211
+ this._backdrop?.remove();
212
+ this._backdrop = null;
213
+ }
214
+ changed(name) {
215
+ if (name !== 'open')
216
+ return super.changed(name);
217
+ if (this.open && this.hidden)
218
+ this.show(true);
219
+ else if (!this.open && !this.hidden)
220
+ this.hide();
221
+ }
222
+ show(animate = true) {
223
+ this._return = document.activeElement;
224
+ this.hidden = false;
225
+ this.setAttribute('aria-modal', 'true');
226
+ if (!this._backdrop) {
227
+ this._backdrop = document.createElement('div');
228
+ this._backdrop.className = 'usa-panel-backdrop';
229
+ this._backdrop.addEventListener('click', () => this.close());
230
+ this.before(this._backdrop);
231
+ }
232
+ const target = this.stops()[this.initialStop()];
233
+ if (!animate)
234
+ this._pos.jump(target);
235
+ else {
236
+ this._pos.jump(this.size());
237
+ this._pos.set(target);
238
+ }
239
+ this.setFlag('open', true);
240
+ this.focus({ preventScroll: true });
241
+ this.emit('open');
242
+ }
243
+ initialStop() {
244
+ return 0;
245
+ }
246
+ hide() {
247
+ this._pos.set(this.size() * 1.05);
248
+ this.emit('close');
249
+ }
250
+ afterClose() {
251
+ this.hidden = true;
252
+ this._backdrop?.remove();
253
+ this._backdrop = null;
254
+ if (this._return instanceof HTMLElement)
255
+ this._return.focus({ preventScroll: true });
256
+ }
257
+ close() {
258
+ this.setFlag('open', false);
259
+ }
260
+ dragStart(e) {
261
+ const handle = kind === 'sheet' ? e.target.closest?.('[data-handle], .usa-sheet-handle') || (this.scrollTop <= 0 ? this : null) : this;
262
+ if (!handle || e.target.closest?.('input, textarea, select, button, a, [data-no-drag]'))
263
+ return;
264
+ const p = this.vertical() ? e.clientY : e.clientX;
265
+ this._pos.stop();
266
+ this._drag = { id: e.pointerId, start: p, origin: this._pos.value, t: e.timeStamp, last: p, lt: e.timeStamp };
267
+ }
268
+ dragMove(e) {
269
+ const d = this._drag;
270
+ if (!d || e.pointerId !== d.id)
271
+ return;
272
+ const p = this.vertical() ? e.clientY : e.clientX;
273
+ let v = d.origin + (p - d.start) * this.dir();
274
+ if (v < 0)
275
+ v = spring.rubberBand(v, 200);
276
+ d.lt = d.t;
277
+ d.t = e.timeStamp;
278
+ d.last = p;
279
+ this._pos.jump(v);
280
+ }
281
+ dragEnd(e) {
282
+ const d = this._drag;
283
+ if (!d || e.pointerId !== d.id)
284
+ return;
285
+ this._drag = null;
286
+ const moved = this._pos.value - d.origin;
287
+ const dt = Math.max(16, d.t - d.lt) / 1000;
288
+ const vel = Math.abs(moved) > 4 ? (moved / Math.max(dt, (e.timeStamp - (d.lt || 0)) / 1000 || 0.1)) * 0.2 : 0;
289
+ const projected = spring.projectInertia(this._pos.value, base.clamp(vel, -3e3, 3000));
290
+ const stops = [...this.stops(), this.size()];
291
+ const to = spring.snapTo(projected, stops);
292
+ if (to >= this.size() - 1)
293
+ this.close();
294
+ else
295
+ this._pos.set(to);
296
+ this.emit('snap', { offset: to });
297
+ }
298
+ };
299
+ }
300
+ function defineDrawer(tag = 'usa-drawer') {
301
+ variants.adoptVariants();
302
+ return base.defineElement(tag, (Base) => makePanel(Base, 'drawer'), { id: 'sheet', text: css$9 });
303
+ }
304
+ function defineBottomSheet(tag = 'usa-bottom-sheet') {
305
+ variants.adoptVariants();
306
+ return base.defineElement(tag, (Base) => {
307
+ const Panel = makePanel(Base, 'sheet');
308
+ return class UsaBottomSheet extends Panel {
309
+ static get observedAttributes() {
310
+ return ['open', 'snap'];
311
+ }
312
+ mount() {
313
+ if (!this.querySelector(':scope > .usa-sheet-handle')) {
314
+ const h = document.createElement('div');
315
+ h.className = 'usa-sheet-handle';
316
+ h.setAttribute('aria-hidden', 'true');
317
+ this.prepend(h);
318
+ }
319
+ super.mount();
320
+ }
321
+ size() {
322
+ return (window.innerHeight || 800) * Math.max(...this.fractions());
323
+ }
324
+ fractions() {
325
+ const f = this.str('snap', '0.5,0.92').split(',').map(Number).filter((n) => n > 0 && n <= 1);
326
+ return f.length ? f : [0.5, 0.92];
327
+ }
328
+ stops() {
329
+ const full = this.size();
330
+ const H = window.innerHeight || 800;
331
+ return this.fractions().map((f) => Math.max(0, full - f * H)).sort((a, b) => a - b);
332
+ }
333
+ initialStop() {
334
+ const f = this.fractions();
335
+ const pick = f[base.clamp(this.num('start', 0), 0, f.length - 1)];
336
+ const target = Math.max(0, this.size() - pick * (window.innerHeight || 800));
337
+ const s = this.stops();
338
+ return Math.max(0, s.indexOf(target));
339
+ }
340
+ render(v) {
341
+ this.style.height = `${this.size()}px`;
342
+ super.render(v);
343
+ }
344
+ };
345
+ }, { id: 'sheet', text: css$9 });
346
+ }
347
+
348
+ var css$8 = "usa-pull-refresh{position:relative;display:block;overflow:auto;overscroll-behavior-y:contain;touch-action:pan-x pan-down}usa-pull-refresh>:not(.usa-pull-indicator):not(.usa-sr){transform:translateY(var(--usa-pull,0px))}usa-pull-refresh .usa-pull-indicator{position:absolute;left:50%;top:0;width:34px;height:34px;margin-left:-17px;z-index:2;display:grid;place-items:center;border-radius:50%;background:var(--usa-surface,#1b1e27);box-shadow:var(--usa-shadow);color:var(--usa-accent,#7c5cff);transform:translateY(calc(var(--usa-pull,0px) - 40px)) rotate(calc(var(--usa-pull-p,0) * 270deg));opacity:var(--usa-pull-p,0);pointer-events:none}usa-pull-refresh .usa-pull-indicator svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round}usa-pull-refresh .usa-pull-indicator circle{stroke-dasharray:calc(var(--usa-pull-p,0) * 75) 100}usa-pull-refresh[data-armed] .usa-pull-indicator{background:var(--usa-accent,#7c5cff);color:var(--usa-accent-text,#fff)}usa-pull-refresh[data-refreshing] .usa-pull-indicator{opacity:1;animation:usa-pull-spin 0.8s linear infinite}usa-pull-refresh[data-refreshing] .usa-pull-indicator circle{stroke-dasharray:60 100}@keyframes usa-pull-spin{from{transform:translateY(calc(var(--usa-pull,0px) - 40px)) rotate(0)}to{transform:translateY(calc(var(--usa-pull,0px) - 40px)) rotate(360deg)}}@media (prefers-reduced-motion:reduce){usa-pull-refresh[data-refreshing] .usa-pull-indicator{animation-duration:2.4s;transform:translateY(8px)}}";
349
+
350
+ function definePullRefresh(tag = 'usa-pull-refresh') {
351
+ variants.adoptVariants();
352
+ return base.defineElement(tag, (Base) => class UsaPullRefresh extends Base {
353
+ constructor() {
354
+ super(...arguments);
355
+ this._busy = false;
356
+ this._ind = null;
357
+ this._live = null;
358
+ }
359
+ get refreshing() {
360
+ return this._busy;
361
+ }
362
+ draw(v) {
363
+ const th = this.num('threshold', 70);
364
+ this.style.setProperty('--usa-pull', `${v.toFixed(1)}px`);
365
+ this.style.setProperty('--usa-pull-p', Math.min(1, v / th).toFixed(3));
366
+ this.toggleAttribute('data-armed', v >= th && !this._busy);
367
+ }
368
+ mount() {
369
+ if (!this.querySelector(':scope > .usa-pull-indicator')) {
370
+ this._ind = document.createElement('div');
371
+ this._ind.className = 'usa-pull-indicator';
372
+ this._ind.setAttribute('aria-hidden', 'true');
373
+ this._ind.innerHTML = '<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9" pathLength="100"/></svg>';
374
+ this.prepend(this._ind);
375
+ this._live = document.createElement('span');
376
+ this._live.className = 'usa-sr';
377
+ this._live.setAttribute('role', 'status');
378
+ this.append(this._live);
379
+ }
380
+ this._y = spring.createSpring({ spring: 'stiff', onUpdate: (v) => this.draw(v) });
381
+ let start = null;
382
+ let id = -1;
383
+ this.listen(this, 'pointerdown', (e) => {
384
+ if (this.flag('disabled') || this._busy || this.scrollTop > 0)
385
+ return;
386
+ start = e.clientY;
387
+ id = e.pointerId;
388
+ });
389
+ this.listen(this, 'pointermove', (e) => {
390
+ if (start === null || e.pointerId !== id)
391
+ return;
392
+ const d = e.clientY - start;
393
+ if (d <= 0)
394
+ return;
395
+ this._y.jump(this.reduced ? 0 : spring.rubberBand(d, 220));
396
+ if (this.reduced && d > this.num('threshold', 70))
397
+ this.setAttribute('data-armed', '');
398
+ });
399
+ const end = (e) => {
400
+ if (start === null || e.pointerId !== id)
401
+ return;
402
+ const d = e.clientY - start;
403
+ start = null;
404
+ const armed = this.hasAttribute('data-armed') || (!this.reduced && this._y.value >= this.num('threshold', 70)) || (this.reduced && d > this.num('threshold', 70));
405
+ if (armed)
406
+ this.refresh();
407
+ else
408
+ this._y.set(0);
409
+ };
410
+ this.listen(this, 'pointerup', end);
411
+ this.listen(this, 'pointercancel', end);
412
+ }
413
+ unmount() {
414
+ this._y?.stop();
415
+ }
416
+ refresh() {
417
+ if (this._busy)
418
+ return Promise.resolve();
419
+ this._busy = true;
420
+ this.removeAttribute('data-armed');
421
+ this.setAttribute('data-refreshing', '');
422
+ this.setAttribute('aria-busy', 'true');
423
+ if (this._live)
424
+ this._live.textContent = this.str('label', 'Refreshing');
425
+ this._y.set(this.reduced ? 0 : this.num('threshold', 70) * 0.8);
426
+ return new Promise((resolve) => {
427
+ let finished = false;
428
+ const done = () => {
429
+ if (finished)
430
+ return;
431
+ finished = true;
432
+ this._busy = false;
433
+ this.removeAttribute('data-refreshing');
434
+ this.removeAttribute('aria-busy');
435
+ if (this._live)
436
+ this._live.textContent = '';
437
+ this._y.set(0);
438
+ resolve();
439
+ };
440
+ const ev = new CustomEvent('usa:refresh', { detail: { done }, bubbles: true, cancelable: true });
441
+ this.dispatchEvent(ev);
442
+ const fn = this.onrefresh;
443
+ if (typeof fn === 'function')
444
+ Promise.resolve(fn(ev)).then(done, done);
445
+ });
446
+ }
447
+ }, { id: 'pull-refresh', text: css$8 });
448
+ }
449
+
450
+ var css$7 = "usa-fab{position:fixed;right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));z-index:900;display:grid;place-items:center}usa-fab[position=\"bottom-left\"]{right:auto;left:max(20px,env(safe-area-inset-left))}usa-fab[position=\"inline\"]{position:relative;right:auto;bottom:auto;display:inline-grid}usa-fab>*{grid-area:1 / 1}usa-fab .usa-fab-main{position:relative;z-index:1;width:56px;height:56px;border-radius:min(var(--usa-radius,14px) * 1.2,28px);border:0;display:grid;place-items:center;font-size:24px;cursor:pointer;background:var(--usa-accent,#7c5cff);color:var(--usa-accent-text,#fff);box-shadow:var(--usa-shadow);transition:transform 0.35s cubic-bezier(0.34,1.56,0.64,1)}usa-fab[open] .usa-fab-main{transform:rotate(45deg)}usa-fab .usa-fab-action{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;opacity:0;transform:scale(0.4);will-change:transform,opacity}usa-fab .usa-fab-main:focus-visible,usa-fab .usa-fab-action:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:3px}@media (prefers-reduced-motion:reduce){usa-fab .usa-fab-main{transition:none}}";
451
+
452
+ function defineFab(tag = 'usa-fab') {
453
+ variants.adoptVariants();
454
+ return base.defineElement(tag, (Base) => class UsaFab extends Base {
455
+ static get observedAttributes() {
456
+ return ['direction', 'gap'];
457
+ }
458
+ get open() {
459
+ return this.flag('open');
460
+ }
461
+ set open(v) {
462
+ this.toggle(v);
463
+ }
464
+ parts() {
465
+ const kids = Array.from(this.children);
466
+ return [kids[0] || null, kids.slice(1)];
467
+ }
468
+ offset(i, n) {
469
+ const g = this.num('gap', 56) * (i + 1);
470
+ switch (this.str('direction', 'up')) {
471
+ case 'down':
472
+ return [0, g];
473
+ case 'left':
474
+ return [-g, 0];
475
+ case 'right':
476
+ return [g, 0];
477
+ case 'radial': {
478
+ const a = Math.PI + (n > 1 ? (i / (n - 1)) * (Math.PI / 2) : Math.PI / 4);
479
+ const r = this.num('gap', 56) * 1.6;
480
+ return [Math.cos(a) * r, Math.sin(a) * r];
481
+ }
482
+ default:
483
+ return [0, -g];
484
+ }
485
+ }
486
+ mount() {
487
+ const [main, actions] = this.parts();
488
+ if (!main)
489
+ return;
490
+ main.classList.add('usa-fab-main');
491
+ main.setAttribute('aria-haspopup', 'true');
492
+ actions.forEach((a) => a.classList.add('usa-fab-action'));
493
+ this.apply(false);
494
+ this.listen(main, 'click', () => this.toggle());
495
+ this.listen(document, 'keydown', (e) => {
496
+ if (e.key === 'Escape' && this.open) {
497
+ this.toggle(false);
498
+ main.focus();
499
+ }
500
+ });
501
+ this.listen(document, 'pointerdown', (e) => this.open && !this.contains(e.target) && this.toggle(false));
502
+ this.listen(this, 'click', (e) => {
503
+ const a = e.target.closest?.('.usa-fab-action');
504
+ if (a && this.contains(a))
505
+ this.toggle(false);
506
+ });
507
+ }
508
+ apply(animate) {
509
+ const [main, actions] = this.parts();
510
+ if (!main)
511
+ return;
512
+ const open = this.open;
513
+ main.setAttribute('aria-expanded', String(open));
514
+ actions.forEach((a, i) => {
515
+ const [x, y] = this.offset(i, actions.length);
516
+ a.toggleAttribute('inert', !open);
517
+ a.setAttribute('aria-hidden', String(!open));
518
+ const to = open ? `translate(${x.toFixed(1)}px, ${y.toFixed(1)}px) scale(1)` : 'translate(0, 0) scale(0.4)';
519
+ const from = a.style.transform || 'translate(0, 0) scale(0.4)';
520
+ a.style.transform = this.reduced ? (open ? `translate(${x.toFixed(1)}px, ${y.toFixed(1)}px)` : 'translate(0, 0)') : to;
521
+ a.style.opacity = open ? '1' : '0';
522
+ if (animate && !this.reduced) {
523
+ const t = spring.springEasing(open ? 'wobbly' : 'stiff');
524
+ this.motion(a, [{ transform: from, opacity: open ? 0 : 1 }, { transform: to, opacity: open ? 1 : 0 }], { ...t, delay: (open ? i : actions.length - 1 - i) * 35 });
525
+ }
526
+ });
527
+ }
528
+ toggle(force) {
529
+ const next = force === undefined ? !this.open : force;
530
+ if (next === this.open)
531
+ return;
532
+ this.setFlag('open', next);
533
+ this.apply(true);
534
+ this.emit('toggle', { open: next });
535
+ }
536
+ }, { id: 'fab', text: css$7 });
537
+ }
538
+
539
+ var css$6 = "usa-navbar{position:sticky;top:0;z-index:800;display:block;transition:transform 0.35s cubic-bezier(0.22,1,0.36,1),padding 0.25s ease,box-shadow 0.25s ease;will-change:transform}usa-navbar[data-hidden]{transform:translateY(-100%)}usa-navbar[data-scrolled]{box-shadow:var(--usa-shadow,0 6px 20px -10px rgb(0 0 0 / 0.4))}usa-navbar[shrink][data-scrolled]{padding-block:4px}@media (prefers-reduced-motion:reduce){usa-navbar{transition:none}}";
540
+
541
+ function defineNavbar(tag = 'usa-navbar') {
542
+ variants.adoptVariants();
543
+ return base.defineElement(tag, (Base) => class UsaNavbar extends Base {
544
+ constructor() {
545
+ super(...arguments);
546
+ this._frame = 0;
547
+ this._last = 0;
548
+ }
549
+ get hiddenByScroll() {
550
+ return this.hasAttribute('data-hidden');
551
+ }
552
+ mount() {
553
+ const sel = this.str('target');
554
+ const scroller = (sel && document.querySelector(sel)) || window;
555
+ const pos = () => (scroller === window ? window.scrollY || document.documentElement.scrollTop : scroller.scrollTop);
556
+ this._last = pos();
557
+ const update = () => {
558
+ this._frame = 0;
559
+ const y = pos();
560
+ const dy = y - this._last;
561
+ this._last = y;
562
+ this.toggleAttribute('data-scrolled', y > 4);
563
+ if (y <= this.num('threshold', 64) || dy < -2)
564
+ this.show();
565
+ else if (dy > 2 && !this.contains(document.activeElement))
566
+ this.hide();
567
+ };
568
+ const on = () => {
569
+ if (!this._frame)
570
+ this._frame = base.raf(update);
571
+ };
572
+ this.listen(scroller, 'scroll', on, { passive: true });
573
+ this.listen(this, 'focusin', () => this.show());
574
+ update();
575
+ }
576
+ unmount() {
577
+ base.caf(this._frame);
578
+ this._frame = 0;
579
+ }
580
+ hide() {
581
+ if (this.hiddenByScroll)
582
+ return;
583
+ this.setAttribute('data-hidden', '');
584
+ this.emit('hide');
585
+ }
586
+ show() {
587
+ if (!this.hiddenByScroll)
588
+ return;
589
+ this.removeAttribute('data-hidden');
590
+ this.emit('show');
591
+ }
592
+ }, { id: 'navbar', text: css$6 });
593
+ }
594
+
595
+ var css$5 = "usa-slider{--usa-slider:0;position:relative;display:block;height:28px;min-width:120px;touch-action:none;cursor:pointer;-webkit-tap-highlight-color:transparent}usa-slider .usa-slider-track{position:absolute;left:0;right:0;top:50%;height:6px;margin-top:-3px;border-radius:3px;background:color-mix(in srgb,currentColor 16%,transparent);overflow:hidden}usa-slider .usa-slider-fill{position:absolute;inset:0;background:var(--usa-accent,#7c5cff);transform-origin:0 50%;transform:scaleX(var(--usa-slider))}usa-slider .usa-slider-thumb{position:absolute;top:50%;left:calc(var(--usa-slider) * 100%);width:20px;height:20px;margin:-10px 0 0 -10px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgb(0 0 0 / 0.35),0 0 0 4px color-mix(in srgb,var(--usa-accent,#7c5cff) 0%,transparent);transition:transform 0.25s cubic-bezier(0.34,1.56,0.64,1),box-shadow 0.2s ease}usa-slider:hover .usa-slider-thumb,usa-slider:focus-visible .usa-slider-thumb{box-shadow:0 1px 4px rgb(0 0 0 / 0.35),0 0 0 6px color-mix(in srgb,var(--usa-accent,#7c5cff) 25%,transparent)}usa-slider[data-dragging] .usa-slider-thumb{transform:scale(1.25)}usa-slider .usa-slider-bubble{position:absolute;bottom:150%;left:50%;transform:translateX(-50%) scale(0.6);opacity:0;padding:2px 8px;border-radius:8px;font:600 12px/1.6 system-ui,sans-serif;color:var(--usa-accent-text,#fff);background:var(--usa-accent,#7c5cff);white-space:nowrap;pointer-events:none;transition:opacity 0.15s ease,transform 0.25s cubic-bezier(0.34,1.56,0.64,1)}usa-slider[bubble][data-dragging] .usa-slider-bubble,usa-slider[bubble]:focus-visible .usa-slider-bubble{opacity:1;transform:translateX(-50%) scale(1)}usa-slider:focus-visible{outline:none}usa-slider[disabled]{opacity:0.45;cursor:not-allowed}@media (prefers-reduced-motion:reduce){usa-slider .usa-slider-thumb,usa-slider .usa-slider-bubble{transition:none}}";
596
+
597
+ function defineSlider(tag = 'usa-slider') {
598
+ variants.adoptVariants();
599
+ return base.defineElement(tag, (Base) => {
600
+ class UsaSlider extends Base {
601
+ static get observedAttributes() {
602
+ return ['min', 'max', 'disabled', 'label'];
603
+ }
604
+ constructor() {
605
+ super();
606
+ this._internals = null;
607
+ this._v = 0;
608
+ this._id = -1;
609
+ try {
610
+ this._internals = this.attachInternals?.() ?? null;
611
+ }
612
+ catch {
613
+ this._internals = null;
614
+ }
615
+ }
616
+ range() {
617
+ const min = this.num('min', 0);
618
+ const max = Math.max(min + 1e-9, this.num('max', 100));
619
+ return [min, max, Math.max(1e-9, this.num('step', 1))];
620
+ }
621
+ get value() {
622
+ return this._v;
623
+ }
624
+ set value(v) {
625
+ this.setValue(v, false);
626
+ }
627
+ fraction(v = this._v) {
628
+ const [min, max] = this.range();
629
+ return (v - min) / (max - min);
630
+ }
631
+ setValue(v, user, animate = true) {
632
+ const [min, max, step] = this.range();
633
+ const q = base.clamp(Math.round((v - min) / step) * step + min, min, max);
634
+ const val = Number(q.toFixed(10));
635
+ const changed = val !== this._v;
636
+ this._v = val;
637
+ this.setAttribute('aria-valuenow', String(val));
638
+ this.setAttribute('aria-valuetext', String(val));
639
+ this._internals?.setFormValue?.(String(val));
640
+ const bubble = this.querySelector('.usa-slider-bubble');
641
+ if (bubble)
642
+ bubble.textContent = String(val);
643
+ if (animate)
644
+ this._pos?.set(this.fraction());
645
+ else
646
+ this._pos?.jump(this.fraction());
647
+ if (changed && user) {
648
+ this.dispatchEvent(new Event('input', { bubbles: true }));
649
+ this.emit('input', { value: val });
650
+ }
651
+ }
652
+ mount() {
653
+ if (!this.querySelector(':scope > .usa-slider-track')) {
654
+ this.innerHTML = '<span class="usa-slider-track"><span class="usa-slider-fill"></span></span><span class="usa-slider-thumb"><span class="usa-slider-bubble"></span></span>';
655
+ }
656
+ this.setAttribute('role', 'slider');
657
+ if (!this.hasAttribute('tabindex'))
658
+ this.tabIndex = 0;
659
+ const [min, max] = this.range();
660
+ this.setAttribute('aria-valuemin', String(min));
661
+ this.setAttribute('aria-valuemax', String(max));
662
+ if (this.str('label'))
663
+ this.setAttribute('aria-label', this.str('label'));
664
+ this.toggleAttribute('aria-disabled', this.flag('disabled'));
665
+ this._pos = spring.createSpring({ spring: 'stiff', onUpdate: (f) => this.style.setProperty('--usa-slider', base.clamp(f, 0, 1).toFixed(4)) });
666
+ this.setValue(this.num('value', min), false, false);
667
+ const fromPointer = (e) => {
668
+ const r = this.getBoundingClientRect();
669
+ return min + base.clamp((e.clientX - r.left) / (r.width || 1), 0, 1) * (max - min);
670
+ };
671
+ this.listen(this, 'pointerdown', (e) => {
672
+ if (this.flag('disabled'))
673
+ return;
674
+ this._id = e.pointerId;
675
+ try {
676
+ this.setPointerCapture?.(e.pointerId);
677
+ }
678
+ catch {
679
+ /* synthetic */
680
+ }
681
+ this.setAttribute('data-dragging', '');
682
+ this.setValue(fromPointer(e), true);
683
+ });
684
+ this.listen(this, 'pointermove', (e) => e.pointerId === this._id && this.setValue(fromPointer(e), true));
685
+ const end = (e) => {
686
+ if (e.pointerId !== this._id)
687
+ return;
688
+ this._id = -1;
689
+ this.removeAttribute('data-dragging');
690
+ this.commit();
691
+ };
692
+ this.listen(this, 'pointerup', end);
693
+ this.listen(this, 'pointercancel', end);
694
+ this.listen(this, 'keydown', (e) => {
695
+ if (this.flag('disabled'))
696
+ return;
697
+ const [mn, mx, st] = this.range();
698
+ const map = { ArrowRight: this._v + st, ArrowUp: this._v + st, ArrowLeft: this._v - st, ArrowDown: this._v - st, PageUp: this._v + st * 10, PageDown: this._v - st * 10, Home: mn, End: mx };
699
+ if (!(e.key in map))
700
+ return;
701
+ e.preventDefault();
702
+ this.setValue(map[e.key], true);
703
+ this.commit();
704
+ });
705
+ }
706
+ unmount() {
707
+ this._pos?.stop();
708
+ }
709
+ commit() {
710
+ this.dispatchEvent(new Event('change', { bubbles: true }));
711
+ this.emit('change', { value: this._v });
712
+ }
713
+ }
714
+ UsaSlider.formAssociated = true;
715
+ return UsaSlider;
716
+ }, { id: 'slider', text: css$5 });
717
+ }
718
+
719
+ var css$4 = "usa-rating{--usa-rating-on:#f5b301;display:inline-flex;gap:2px;font-size:1.5em;line-height:1;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}usa-rating[readonly]{cursor:default}usa-rating .usa-rating-star{display:inline-block;color:color-mix(in srgb,currentColor 22%,transparent);transition:color 0.15s ease,transform 0.2s ease}usa-rating .usa-rating-star[data-on]{color:var(--usa-rating-on)}usa-rating[data-previewing] .usa-rating-star{color:color-mix(in srgb,currentColor 22%,transparent)}usa-rating[data-previewing] .usa-rating-star[data-preview]{color:var(--usa-rating-on);transform:scale(1.12)}usa-rating:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:3px;border-radius:6px}@media (prefers-reduced-motion:reduce){usa-rating .usa-rating-star{transition:none;transform:none !important}}";
720
+
721
+ function defineRating(tag = 'usa-rating') {
722
+ variants.adoptVariants();
723
+ return base.defineElement(tag, (Base) => {
724
+ class UsaRating extends Base {
725
+ static get observedAttributes() {
726
+ return ['max', 'icon', 'readonly'];
727
+ }
728
+ constructor() {
729
+ super();
730
+ this._internals = null;
731
+ try {
732
+ this._internals = this.attachInternals?.() ?? null;
733
+ }
734
+ catch {
735
+ this._internals = null;
736
+ }
737
+ }
738
+ get value() {
739
+ return base.clamp(this.num('value', 0), 0, this.num('max', 5));
740
+ }
741
+ set value(v) {
742
+ this.setAttribute('value', String(base.clamp(Math.round(v), 0, this.num('max', 5))));
743
+ this.sync();
744
+ }
745
+ mount() {
746
+ const max = this.num('max', 5);
747
+ this.innerHTML = Array.from({ length: max }, (_, i) => `<span class="usa-rating-star" data-i="${i + 1}" aria-hidden="true">${this.str('icon', '★')}</span>`).join('');
748
+ this.setAttribute('role', 'slider');
749
+ this.setAttribute('aria-valuemin', '0');
750
+ this.setAttribute('aria-valuemax', String(max));
751
+ this.setAttribute('aria-label', this.str('label', 'Rating'));
752
+ if (this.flag('readonly'))
753
+ this.setAttribute('aria-readonly', 'true');
754
+ else if (!this.hasAttribute('tabindex'))
755
+ this.tabIndex = 0;
756
+ this.sync();
757
+ if (this.flag('readonly'))
758
+ return;
759
+ this.listen(this, 'pointerover', (e) => {
760
+ const s = e.target.closest?.('[data-i]');
761
+ if (s)
762
+ this.preview(Number(s.dataset.i));
763
+ });
764
+ this.listen(this, 'pointerleave', () => this.preview(0));
765
+ this.listen(this, 'click', (e) => {
766
+ const s = e.target.closest?.('[data-i]');
767
+ if (s)
768
+ this.choose(Number(s.dataset.i) === this.value ? 0 : Number(s.dataset.i));
769
+ });
770
+ this.listen(this, 'keydown', (e) => {
771
+ const v = this.value;
772
+ const map = { ArrowRight: v + 1, ArrowUp: v + 1, ArrowLeft: v - 1, ArrowDown: v - 1, Home: 0, End: max };
773
+ const n = /^[0-9]$/.test(e.key) ? Number(e.key) : map[e.key];
774
+ if (n === undefined)
775
+ return;
776
+ e.preventDefault();
777
+ this.choose(base.clamp(n, 0, max));
778
+ });
779
+ }
780
+ preview(n) {
781
+ this.querySelectorAll('[data-i]').forEach((s) => s.toggleAttribute('data-preview', n > 0 && Number(s.dataset.i) <= n));
782
+ this.toggleAttribute('data-previewing', n > 0);
783
+ }
784
+ sync() {
785
+ const v = this.value;
786
+ this.setAttribute('aria-valuenow', String(v));
787
+ this.setAttribute('aria-valuetext', `${v} of ${this.num('max', 5)}`);
788
+ this._internals?.setFormValue?.(String(v));
789
+ this.querySelectorAll('[data-i]').forEach((s) => s.toggleAttribute('data-on', Number(s.dataset.i) <= v));
790
+ }
791
+ choose(n) {
792
+ if (n === this.value)
793
+ return;
794
+ this.value = n;
795
+ const star = this.querySelector(`[data-i="${n}"]`);
796
+ if (star && !this.reduced)
797
+ this.motion(star, [{ transform: 'scale(0.5) rotate(-20deg)' }, { transform: 'scale(1) rotate(0)' }], spring.springEasing('bouncy'));
798
+ this.dispatchEvent(new Event('change', { bubbles: true }));
799
+ this.emit('change', { value: n });
800
+ }
801
+ }
802
+ UsaRating.formAssociated = true;
803
+ return UsaRating;
804
+ }, { id: 'rating', text: css$4 });
805
+ }
806
+
807
+ var css$3 = "usa-tooltip{display:inline-block}usa-tooltip .usa-tooltip-bubble{position:fixed;z-index:2000;max-width:260px;padding:6px 10px;font-size:0.85rem;line-height:1.4;pointer-events:none;--usa-radius:8px;white-space:normal}usa-tooltip .usa-tooltip-bubble[hidden]{display:none}";
808
+
809
+ function defineTooltip(tag = 'usa-tooltip') {
810
+ variants.adoptVariants();
811
+ return base.defineElement(tag, (Base) => class UsaTooltip extends Base {
812
+ constructor() {
813
+ super(...arguments);
814
+ this._tip = null;
815
+ }
816
+ static get observedAttributes() {
817
+ return ['text'];
818
+ }
819
+ mount() {
820
+ const trigger = this.firstElementChild || this;
821
+ const tip = document.createElement('span');
822
+ tip.className = 'usa-tooltip-bubble usa-surface';
823
+ tip.setAttribute('role', 'tooltip');
824
+ tip.id = nextId('usa-tip');
825
+ tip.textContent = this.str('text');
826
+ tip.hidden = true;
827
+ this.append(tip);
828
+ this._tip = tip;
829
+ trigger.setAttribute('aria-describedby', tip.id);
830
+ const later = () => {
831
+ clearTimeout(this._t);
832
+ this._t = setTimeout(() => this.show(), this.num('delay', 300));
833
+ };
834
+ this.listen(this, 'pointerenter', later);
835
+ this.listen(this, 'pointerleave', () => this.hide());
836
+ this.listen(this, 'focusin', () => this.show());
837
+ this.listen(this, 'focusout', () => this.hide());
838
+ this.listen(document, 'keydown', (e) => e.key === 'Escape' && this.hide());
839
+ this.onCleanup(() => {
840
+ clearTimeout(this._t);
841
+ tip.remove();
842
+ trigger.removeAttribute('aria-describedby');
843
+ });
844
+ }
845
+ show() {
846
+ const tip = this._tip;
847
+ if (!tip || !tip.hidden || !this.str('text'))
848
+ return;
849
+ clearTimeout(this._t);
850
+ tip.hidden = false;
851
+ const p = place(tip, this.firstElementChild || this, this.str('placement', 'top'));
852
+ const d = { top: [0, 6], bottom: [0, -6], left: [6, 0], right: [-6, 0] }[p];
853
+ this.motion(tip, this.reduced ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 0, transform: `translate(${d[0]}px, ${d[1]}px) scale(0.85)` }, { opacity: 1, transform: 'none' }], this.reduced ? { duration: 120 } : spring.springEasing('stiff'));
854
+ }
855
+ hide() {
856
+ clearTimeout(this._t);
857
+ if (this._tip)
858
+ this._tip.hidden = true;
859
+ }
860
+ }, { id: 'tooltip', text: css$3 });
861
+ }
862
+
863
+ var css$2 = "usa-popover{display:inline-block}usa-popover .usa-popover-panel{position:fixed;z-index:1500;min-width:180px;max-width:min(92vw,360px);padding:12px 14px;outline:none}usa-popover .usa-popover-panel[hidden]{display:none}";
864
+
865
+ function definePopover(tag = 'usa-popover') {
866
+ variants.adoptVariants();
867
+ return base.defineElement(tag, (Base) => class UsaPopover extends Base {
868
+ get open() {
869
+ return this.flag('open');
870
+ }
871
+ set open(v) {
872
+ this.toggle(v);
873
+ }
874
+ parts() {
875
+ return [this.firstElementChild, this.querySelector(':scope > [data-popover]')];
876
+ }
877
+ mount() {
878
+ const [trigger, panel] = this.parts();
879
+ if (!trigger || !panel || trigger === panel)
880
+ return;
881
+ panel.id || (panel.id = nextId('usa-pop'));
882
+ panel.classList.add('usa-surface', 'usa-popover-panel');
883
+ if (!panel.hasAttribute('role'))
884
+ panel.setAttribute('role', 'dialog');
885
+ panel.tabIndex = -1;
886
+ trigger.setAttribute('aria-controls', panel.id);
887
+ trigger.setAttribute('aria-haspopup', 'dialog');
888
+ this.render(false);
889
+ this.listen(trigger, 'click', () => this.toggle());
890
+ this.listen(document, 'keydown', (e) => {
891
+ if (e.key === 'Escape' && this.open) {
892
+ this.toggle(false);
893
+ trigger.focus();
894
+ }
895
+ });
896
+ this.listen(document, 'pointerdown', (e) => this.open && !this.contains(e.target) && this.toggle(false));
897
+ this.listen(window, 'resize', () => this.open && place(panel, trigger, this.str('placement', 'bottom')));
898
+ }
899
+ render(animate) {
900
+ const [trigger, panel] = this.parts();
901
+ if (!trigger || !panel)
902
+ return;
903
+ trigger.setAttribute('aria-expanded', String(this.open));
904
+ panel.hidden = !this.open;
905
+ if (!this.open)
906
+ return;
907
+ const p = place(panel, trigger, this.str('placement', 'bottom'));
908
+ if (!animate)
909
+ return;
910
+ const origin = { top: '50% 100%', bottom: '50% 0', left: '100% 50%', right: '0 50%' }[p];
911
+ panel.style.transformOrigin = origin;
912
+ this.motion(panel, this.reduced ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 0, transform: 'scale(0.9)' }, { opacity: 1, transform: 'none' }], this.reduced ? { duration: 120 } : spring.springEasing('wobbly'));
913
+ panel.focus({ preventScroll: true });
914
+ }
915
+ toggle(force) {
916
+ const next = force === undefined ? !this.open : force;
917
+ if (next === this.open)
918
+ return;
919
+ this.setFlag('open', next);
920
+ this.render(true);
921
+ this.emit(next ? 'open' : 'close');
922
+ }
923
+ }, { id: 'popover', text: css$2 });
924
+ }
925
+
926
+ var css$1 = "usa-badge{position:relative;display:inline-block}usa-badge .usa-badge-count{position:absolute;top:0;right:0;transform-origin:50% 50%;translate:45% -45%;min-width:18px;height:18px;padding:0 5px;box-sizing:border-box;border-radius:9px;display:grid;place-items:center;font:700 11px/1 system-ui,sans-serif;color:var(--usa-accent-text,#fff);background:var(--usa-badge-color,#e5484d);box-shadow:0 0 0 2px var(--usa-badge-ring,Canvas);pointer-events:none}usa-badge[data-dot] .usa-badge-count{min-width:10px;width:10px;height:10px;padding:0}usa-badge .usa-badge-count[hidden]{display:none}usa-badge[pulse] .usa-badge-count::after{content:\"\";position:absolute;inset:0;border-radius:inherit;background:inherit;animation:usa-badge-pulse 1.6s ease-out infinite;z-index:-1}@keyframes usa-badge-pulse{from{transform:scale(1);opacity:0.6}to{transform:scale(2.4);opacity:0}}@media (prefers-reduced-motion:reduce){usa-badge[pulse] .usa-badge-count::after{animation:none}}";
927
+
928
+ function defineBadge(tag = 'usa-badge') {
929
+ variants.adoptVariants();
930
+ return base.defineElement(tag, (Base) => class UsaBadge extends Base {
931
+ constructor() {
932
+ super(...arguments);
933
+ this._el = null;
934
+ }
935
+ static get observedAttributes() {
936
+ return ['value', 'max', 'dot', 'label'];
937
+ }
938
+ get value() {
939
+ return this.str('value');
940
+ }
941
+ set value(v) {
942
+ this.setAttribute('value', String(v));
943
+ }
944
+ mount() {
945
+ if (!this._el || !this._el.isConnected) {
946
+ this._el = document.createElement('span');
947
+ this._el.className = 'usa-badge-count';
948
+ this.append(this._el);
949
+ }
950
+ this.sync(false);
951
+ }
952
+ changed(name) {
953
+ this.sync(name === 'value');
954
+ }
955
+ sync(bump) {
956
+ const el = this._el;
957
+ if (!el)
958
+ return;
959
+ const raw = this.value;
960
+ const n = Number(raw);
961
+ const max = this.num('max', 99);
962
+ const text = this.flag('dot') ? '' : raw !== '' && Number.isFinite(n) && n > max ? `${max}+` : raw;
963
+ const empty = !this.flag('dot') && (raw === '' || (raw === '0' && !this.flag('show-zero')));
964
+ el.textContent = text;
965
+ el.hidden = empty;
966
+ this.toggleAttribute('data-dot', this.flag('dot'));
967
+ const label = this.str('label', raw ? `${raw} new` : 'New');
968
+ el.setAttribute('aria-label', label.replace('{n}', raw));
969
+ el.setAttribute('role', 'status');
970
+ if (bump && !empty && !this.reduced)
971
+ this.motion(el, [{ transform: 'scale(0.4)' }, { transform: 'scale(1)' }], spring.springEasing('bouncy'));
972
+ }
973
+ }, { id: 'badge', text: css$1 });
974
+ }
975
+
976
+ var css = "usa-avatar-stack{--usa-avatar-size:36px;--usa-avatar-overlap:0.35;display:inline-flex;align-items:center;padding-inline-start:calc(var(--usa-avatar-size) * var(--usa-avatar-overlap))}usa-avatar-stack .usa-avatar{width:var(--usa-avatar-size);height:var(--usa-avatar-size);border-radius:50%;object-fit:cover;flex:none;box-shadow:0 0 0 2px var(--usa-avatar-ring,Canvas);margin-inline-start:calc(var(--usa-avatar-size) * var(--usa-avatar-overlap) * -1);transition:margin 0.45s cubic-bezier(0.34,1.56,0.64,1),transform 0.3s cubic-bezier(0.34,1.56,0.64,1);display:grid;place-items:center;font:700 12px/1 system-ui,sans-serif;background:color-mix(in srgb,currentColor 14%,transparent)}usa-avatar-stack .usa-avatar[hidden]{display:none}usa-avatar-stack:hover .usa-avatar,usa-avatar-stack:focus-within .usa-avatar{margin-inline-start:4px}usa-avatar-stack .usa-avatar:hover{transform:translateY(-4px) scale(1.08)}@media (prefers-reduced-motion:reduce){usa-avatar-stack .usa-avatar{transition:none}usa-avatar-stack:hover .usa-avatar,usa-avatar-stack:focus-within .usa-avatar{margin-inline-start:calc(var(--usa-avatar-size) * var(--usa-avatar-overlap) * -1)}usa-avatar-stack .usa-avatar:hover{transform:none}}";
977
+
978
+ function defineAvatarStack(tag = 'usa-avatar-stack') {
979
+ variants.adoptVariants();
980
+ return base.defineElement(tag, (Base) => class UsaAvatarStack extends Base {
981
+ static get observedAttributes() {
982
+ return ['max', 'size', 'overlap'];
983
+ }
984
+ mount() {
985
+ this.querySelector(':scope > .usa-avatar-more')?.remove();
986
+ const kids = Array.from(this.children);
987
+ const max = Math.max(1, this.num('max', 5));
988
+ this.style.setProperty('--usa-avatar-size', `${this.num('size', 36)}px`);
989
+ this.style.setProperty('--usa-avatar-overlap', String(this.num('overlap', 0.35)));
990
+ this.setAttribute('role', 'group');
991
+ this.setAttribute('aria-label', this.str('label', `${kids.length} people`));
992
+ kids.forEach((k, i) => {
993
+ k.classList.add('usa-avatar');
994
+ k.hidden = i >= max;
995
+ k.style.setProperty('--i', String(i));
996
+ k.style.zIndex = String(kids.length - i);
997
+ });
998
+ if (kids.length > max) {
999
+ const more = document.createElement('span');
1000
+ more.className = 'usa-avatar usa-avatar-more';
1001
+ more.textContent = `+${kids.length - max}`;
1002
+ more.style.setProperty('--i', String(max));
1003
+ more.setAttribute('aria-label', `and ${kids.length - max} more`);
1004
+ this.append(more);
1005
+ }
1006
+ }
1007
+ }, { id: 'avatar-stack', text: css });
1008
+ }
1009
+
1010
+ /**
1011
+ * motionary/components/ui — animated UI components + style variants (v2.6).
1012
+ * `<usa-tabs>`, `<usa-drawer>`, `<usa-bottom-sheet>`, `<usa-pull-refresh>`,
1013
+ * `<usa-fab>`, `<usa-navbar>`, `<usa-slider>`, `<usa-rating>`,
1014
+ * `<usa-tooltip>`, `<usa-popover>`, `<usa-badge>`, `<usa-avatar-stack>`,
1015
+ * and `variant="minimal | neon | glass | brutalist | fluent | material"`
1016
+ * design tokens (`setVariant()`, `VARIANTS`).
1017
+ */
1018
+ /** Register every component of this category under its default tag. */
1019
+ function defineUiComponents() {
1020
+ defineTabs();
1021
+ defineDrawer();
1022
+ defineBottomSheet();
1023
+ definePullRefresh();
1024
+ defineFab();
1025
+ defineNavbar();
1026
+ defineSlider();
1027
+ defineRating();
1028
+ defineTooltip();
1029
+ definePopover();
1030
+ defineBadge();
1031
+ defineAvatarStack();
1032
+ }
1033
+
1034
+ exports.VARIANTS = variants.VARIANTS;
1035
+ exports.adoptVariants = variants.adoptVariants;
1036
+ exports.setVariant = variants.setVariant;
1037
+ exports.defineAvatarStack = defineAvatarStack;
1038
+ exports.defineBadge = defineBadge;
1039
+ exports.defineBottomSheet = defineBottomSheet;
1040
+ exports.defineDrawer = defineDrawer;
1041
+ exports.defineFab = defineFab;
1042
+ exports.defineNavbar = defineNavbar;
1043
+ exports.definePopover = definePopover;
1044
+ exports.definePullRefresh = definePullRefresh;
1045
+ exports.defineRating = defineRating;
1046
+ exports.defineSlider = defineSlider;
1047
+ exports.defineTabs = defineTabs;
1048
+ exports.defineTooltip = defineTooltip;
1049
+ exports.defineUiComponents = defineUiComponents;
1050
+ //# sourceMappingURL=ui.cjs.map