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