@kumix/ui 0.4.0 → 0.4.2

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 (402) hide show
  1. package/README.md +52 -45
  2. package/dist/{cascader-types-DVT-znZ-.d.ts → cascader-types-zhnUQ4sP.d.ts} +11 -3
  3. package/dist/cascader-types-zhnUQ4sP.d.ts.map +1 -0
  4. package/dist/components/agents/agent-code.js +1 -1
  5. package/dist/components/agents/approval-card/index.d.ts +2 -0
  6. package/dist/components/agents/approval-card/index.d.ts.map +1 -1
  7. package/dist/components/agents/approval-card/index.js +2 -0
  8. package/dist/components/agents/approval-card/index.js.map +1 -1
  9. package/dist/components/agents/citations.d.ts +14 -2
  10. package/dist/components/agents/citations.d.ts.map +1 -1
  11. package/dist/components/agents/citations.js +11 -7
  12. package/dist/components/agents/citations.js.map +1 -1
  13. package/dist/components/agents/loading-states/reasoning-text.d.ts.map +1 -1
  14. package/dist/components/agents/loading-states/reasoning-text.js +3 -0
  15. package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
  16. package/dist/components/charts/bump-chart/context.js +1 -2
  17. package/dist/components/charts/bump-chart/plot.js +1 -2
  18. package/dist/components/charts/bump-chart/point.js +1 -1
  19. package/dist/components/charts/bump-chart/series.d.ts +1 -0
  20. package/dist/components/charts/candlestick-chart/context.d.ts +79 -0
  21. package/dist/components/charts/candlestick-chart/context.d.ts.map +1 -0
  22. package/dist/components/charts/candlestick-chart/context.js +69 -0
  23. package/dist/components/charts/candlestick-chart/context.js.map +1 -0
  24. package/dist/components/charts/candlestick-chart/legend.d.ts +12 -0
  25. package/dist/components/charts/candlestick-chart/legend.d.ts.map +1 -0
  26. package/dist/components/charts/candlestick-chart/legend.js +56 -0
  27. package/dist/components/charts/candlestick-chart/legend.js.map +1 -0
  28. package/dist/components/charts/candlestick-chart/plot.d.ts +9 -0
  29. package/dist/components/charts/candlestick-chart/plot.d.ts.map +1 -0
  30. package/dist/components/charts/candlestick-chart/plot.js +218 -0
  31. package/dist/components/charts/candlestick-chart/plot.js.map +1 -0
  32. package/dist/components/charts/candlestick-chart.d.ts +18 -0
  33. package/dist/components/charts/candlestick-chart.d.ts.map +1 -0
  34. package/dist/components/charts/candlestick-chart.js +34 -0
  35. package/dist/components/charts/candlestick-chart.js.map +1 -0
  36. package/dist/components/charts/composition-chart/context.js +1 -2
  37. package/dist/components/charts/composition-chart/plot.js +1 -1
  38. package/dist/components/charts/donut-chart/center.d.ts +16 -0
  39. package/dist/components/charts/donut-chart/center.d.ts.map +1 -0
  40. package/dist/components/charts/donut-chart/center.js +78 -0
  41. package/dist/components/charts/donut-chart/center.js.map +1 -0
  42. package/dist/components/charts/donut-chart/context.d.ts +68 -0
  43. package/dist/components/charts/donut-chart/context.d.ts.map +1 -0
  44. package/dist/components/charts/donut-chart/context.js +2 -0
  45. package/dist/components/charts/donut-chart/legend.d.ts +17 -0
  46. package/dist/components/charts/donut-chart/legend.d.ts.map +1 -0
  47. package/dist/components/charts/donut-chart/legend.js +85 -0
  48. package/dist/components/charts/donut-chart/legend.js.map +1 -0
  49. package/dist/components/charts/donut-chart/plot.d.ts +10 -0
  50. package/dist/components/charts/donut-chart/plot.d.ts.map +1 -0
  51. package/dist/components/charts/donut-chart/plot.js +108 -0
  52. package/dist/components/charts/donut-chart/plot.js.map +1 -0
  53. package/dist/components/charts/donut-chart.d.ts +22 -0
  54. package/dist/components/charts/donut-chart.d.ts.map +1 -0
  55. package/dist/components/charts/donut-chart.js +37 -0
  56. package/dist/components/charts/donut-chart.js.map +1 -0
  57. package/dist/components/charts/funnel-chart.d.ts.map +1 -1
  58. package/dist/components/charts/funnel-chart.js +1 -2
  59. package/dist/components/charts/funnel-chart.js.map +1 -1
  60. package/dist/components/charts/heat-calendar/tooltip.js +1 -1
  61. package/dist/components/charts/liquidity-heatmap.d.ts.map +1 -1
  62. package/dist/components/charts/liquidity-heatmap.js +1 -1
  63. package/dist/components/charts/order-book/depth-row.d.ts +8 -2
  64. package/dist/components/charts/order-book/depth-row.d.ts.map +1 -1
  65. package/dist/components/charts/order-book/depth-row.js +11 -3
  66. package/dist/components/charts/order-book/depth-row.js.map +1 -1
  67. package/dist/components/charts/order-book.d.ts +33 -1
  68. package/dist/components/charts/order-book.d.ts.map +1 -1
  69. package/dist/components/charts/order-book.js +92 -17
  70. package/dist/components/charts/order-book.js.map +1 -1
  71. package/dist/components/charts/price-target-fan/tooltip.js +1 -1
  72. package/dist/components/charts/returns-calendar/tooltip.js +1 -1
  73. package/dist/components/charts/status-bar/tooltip.js +1 -1
  74. package/dist/components/charts/treemap/tooltip.js +1 -1
  75. package/dist/components/charts/treemap.d.ts.map +1 -1
  76. package/dist/components/charts/volume-profile/tooltip.js +1 -1
  77. package/dist/components/charts/volume-profile.d.ts.map +1 -1
  78. package/dist/components/custom/confirm-dialog.d.ts +1 -0
  79. package/dist/components/custom/toast.d.ts +1 -0
  80. package/dist/components/motion/action-swap.d.ts +1 -1
  81. package/dist/components/motion/action-swap.d.ts.map +1 -1
  82. package/dist/components/motion/action-swap.js +46 -20
  83. package/dist/components/motion/action-swap.js.map +1 -1
  84. package/dist/components/motion/animated-badge.d.ts +1 -1
  85. package/dist/components/motion/animated-badge.d.ts.map +1 -1
  86. package/dist/components/motion/animated-badge.js +60 -101
  87. package/dist/components/motion/animated-badge.js.map +1 -1
  88. package/dist/components/motion/animated-sidebar.d.ts +1 -0
  89. package/dist/components/motion/animated-sidebar.js +1 -1
  90. package/dist/components/motion/animated-toast-stack.js +1 -1
  91. package/dist/components/motion/attachment-upload.d.ts.map +1 -1
  92. package/dist/components/motion/attachment-upload.js +2 -3
  93. package/dist/components/motion/attachment-upload.js.map +1 -1
  94. package/dist/components/motion/availability-scheduler/copy-menu.js +1 -2
  95. package/dist/components/motion/availability-scheduler/day-row.js +2 -2
  96. package/dist/components/motion/availability-scheduler/index.js +1 -1
  97. package/dist/components/motion/bloom-menu.d.ts +1 -0
  98. package/dist/components/motion/bloom-menu.d.ts.map +1 -1
  99. package/dist/components/motion/bloom-menu.js +73 -8
  100. package/dist/components/motion/bloom-menu.js.map +1 -1
  101. package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
  102. package/dist/components/motion/bottom-sheet.js +6 -10
  103. package/dist/components/motion/bottom-sheet.js.map +1 -1
  104. package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
  105. package/dist/components/motion/bounce-sidebar.js +34 -42
  106. package/dist/components/motion/bounce-sidebar.js.map +1 -1
  107. package/dist/components/motion/bouncy-accordion.d.ts.map +1 -1
  108. package/dist/components/motion/bouncy-accordion.js +35 -22
  109. package/dist/components/motion/bouncy-accordion.js.map +1 -1
  110. package/dist/components/motion/button/stateful.d.ts.map +1 -1
  111. package/dist/components/motion/button/stateful.js +3 -0
  112. package/dist/components/motion/button/stateful.js.map +1 -1
  113. package/dist/components/motion/card.d.ts +44 -0
  114. package/dist/components/motion/card.d.ts.map +1 -0
  115. package/dist/components/motion/card.js +122 -0
  116. package/dist/components/motion/card.js.map +1 -0
  117. package/dist/components/motion/center-morph-modal.js +1 -1
  118. package/dist/components/motion/checkbox.d.ts +3 -1
  119. package/dist/components/motion/checkbox.d.ts.map +1 -1
  120. package/dist/components/motion/checkbox.js +18 -6
  121. package/dist/components/motion/checkbox.js.map +1 -1
  122. package/dist/components/motion/color-picker.d.ts +110 -0
  123. package/dist/components/motion/color-picker.d.ts.map +1 -0
  124. package/dist/components/motion/color-picker.js +1053 -0
  125. package/dist/components/motion/color-picker.js.map +1 -0
  126. package/dist/components/motion/color-selector.d.ts.map +1 -1
  127. package/dist/components/motion/color-selector.js +9 -2
  128. package/dist/components/motion/color-selector.js.map +1 -1
  129. package/dist/components/motion/combobox/content.d.ts +1 -0
  130. package/dist/components/motion/command-palette.js +3 -3
  131. package/dist/components/motion/command-palette.js.map +1 -1
  132. package/dist/components/motion/context-menu.d.ts +1 -0
  133. package/dist/components/motion/context-menu.js +1 -1
  134. package/dist/components/motion/date-range-picker.d.ts.map +1 -1
  135. package/dist/components/motion/digit-swap.d.ts +9 -1
  136. package/dist/components/motion/digit-swap.d.ts.map +1 -1
  137. package/dist/components/motion/digit-swap.js +18 -7
  138. package/dist/components/motion/digit-swap.js.map +1 -1
  139. package/dist/components/motion/drawer.d.ts +1 -1
  140. package/dist/components/motion/drawer.d.ts.map +1 -1
  141. package/dist/components/motion/drawer.js +10 -10
  142. package/dist/components/motion/drawer.js.map +1 -1
  143. package/dist/components/motion/expandable-action-bar.d.ts.map +1 -1
  144. package/dist/components/motion/expandable-control.d.ts +1 -0
  145. package/dist/components/motion/feedback-widget.js +4 -1
  146. package/dist/components/motion/feedback-widget.js.map +1 -1
  147. package/dist/components/motion/knockout-wheel.d.ts.map +1 -1
  148. package/dist/components/motion/knockout-wheel.js +1 -2
  149. package/dist/components/motion/knockout-wheel.js.map +1 -1
  150. package/dist/components/motion/morphing-lightbox.d.ts.map +1 -1
  151. package/dist/components/motion/morphing-lightbox.js +1 -1
  152. package/dist/components/motion/morphing-modal.d.ts +6 -1
  153. package/dist/components/motion/morphing-modal.d.ts.map +1 -1
  154. package/dist/components/motion/morphing-modal.js +37 -5
  155. package/dist/components/motion/morphing-modal.js.map +1 -1
  156. package/dist/components/motion/morphing-search-chips.d.ts +54 -0
  157. package/dist/components/motion/morphing-search-chips.d.ts.map +1 -0
  158. package/dist/components/motion/morphing-search-chips.js +599 -0
  159. package/dist/components/motion/morphing-search-chips.js.map +1 -0
  160. package/dist/components/motion/morphing-search.js +1 -1
  161. package/dist/components/motion/morphing-tabs.js +1 -1
  162. package/dist/components/motion/multi-select/content.d.ts +1 -0
  163. package/dist/components/motion/not-found/shared.d.ts +1 -0
  164. package/dist/components/motion/number-ticker.d.ts +6 -1
  165. package/dist/components/motion/number-ticker.d.ts.map +1 -1
  166. package/dist/components/motion/number-ticker.js +19 -9
  167. package/dist/components/motion/number-ticker.js.map +1 -1
  168. package/dist/components/motion/otp-input.js +19 -11
  169. package/dist/components/motion/otp-input.js.map +1 -1
  170. package/dist/components/motion/parallax.js.map +1 -1
  171. package/dist/components/motion/popover-morph.d.ts +5 -3
  172. package/dist/components/motion/popover-morph.d.ts.map +1 -1
  173. package/dist/components/motion/popover-morph.js +47 -52
  174. package/dist/components/motion/popover-morph.js.map +1 -1
  175. package/dist/components/motion/popover.d.ts +1 -0
  176. package/dist/components/motion/popover.js +7 -1
  177. package/dist/components/motion/popover.js.map +1 -1
  178. package/dist/components/motion/prediction-market-card.js +2 -3
  179. package/dist/components/motion/prediction-market-card.js.map +1 -1
  180. package/dist/components/motion/prediction-market.js +1 -1
  181. package/dist/components/motion/project-folder.js +1 -1
  182. package/dist/components/motion/radio.d.ts +8 -2
  183. package/dist/components/motion/radio.d.ts.map +1 -1
  184. package/dist/components/motion/radio.js +70 -10
  185. package/dist/components/motion/radio.js.map +1 -1
  186. package/dist/components/motion/scroll-progress.d.ts +1 -0
  187. package/dist/components/motion/select-morph.d.ts +1 -1
  188. package/dist/components/motion/select-morph.d.ts.map +1 -1
  189. package/dist/components/motion/select-morph.js +89 -21
  190. package/dist/components/motion/select-morph.js.map +1 -1
  191. package/dist/components/motion/select.d.ts.map +1 -1
  192. package/dist/components/motion/select.js +153 -135
  193. package/dist/components/motion/select.js.map +1 -1
  194. package/dist/components/motion/shader-background.d.ts +4 -2
  195. package/dist/components/motion/shader-background.d.ts.map +1 -1
  196. package/dist/components/motion/shader-background.js +9 -3
  197. package/dist/components/motion/shader-background.js.map +1 -1
  198. package/dist/components/motion/shared-layout-bg.d.ts.map +1 -1
  199. package/dist/components/motion/shared-layout-bg.js +17 -3
  200. package/dist/components/motion/shared-layout-bg.js.map +1 -1
  201. package/dist/components/motion/sortable-list.d.ts +1 -0
  202. package/dist/components/motion/sortable-stack.js +1 -2
  203. package/dist/components/motion/swipeable-list.d.ts.map +1 -1
  204. package/dist/components/motion/swipeable-list.js +61 -4
  205. package/dist/components/motion/swipeable-list.js.map +1 -1
  206. package/dist/components/motion/table/row-handle.js +1 -1
  207. package/dist/components/motion/table/table-header.js +1 -1
  208. package/dist/components/motion/tabs.d.ts +13 -3
  209. package/dist/components/motion/tabs.d.ts.map +1 -1
  210. package/dist/components/motion/tabs.js +248 -26
  211. package/dist/components/motion/tabs.js.map +1 -1
  212. package/dist/components/motion/text-reveal.d.ts +1 -0
  213. package/dist/components/motion/theme-toggle.js +1 -1
  214. package/dist/components/motion/tooltip/positioner.d.ts +8 -26
  215. package/dist/components/motion/tooltip/positioner.d.ts.map +1 -1
  216. package/dist/components/motion/tooltip/positioner.js +1 -2
  217. package/dist/components/motion/tooltip.d.ts +62 -20
  218. package/dist/components/motion/tooltip.d.ts.map +1 -1
  219. package/dist/components/motion/tooltip.js +1 -135
  220. package/dist/components/motion/wallet-card/account-avatar.js +1 -2
  221. package/dist/components/reui/alert.d.ts +1 -1
  222. package/dist/components/reui/autocomplete.d.ts.map +1 -1
  223. package/dist/components/reui/autocomplete.js +1 -1
  224. package/dist/components/reui/autocomplete.js.map +1 -1
  225. package/dist/components/reui/badge.d.ts +1 -1
  226. package/dist/components/reui/cascader/cascader-async.d.ts +21 -5
  227. package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -1
  228. package/dist/components/reui/cascader/cascader-async.js +61 -34
  229. package/dist/components/reui/cascader/cascader-async.js.map +1 -1
  230. package/dist/components/reui/cascader/cascader-columns.d.ts.map +1 -1
  231. package/dist/components/reui/cascader/cascader-columns.js +5 -2
  232. package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
  233. package/dist/components/reui/cascader/cascader-context.d.ts +3 -1
  234. package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -1
  235. package/dist/components/reui/cascader/cascader-context.js.map +1 -1
  236. package/dist/components/reui/cascader/cascader-i18n.d.ts +1 -1
  237. package/dist/components/reui/cascader/cascader-item.d.ts +1 -1
  238. package/dist/components/reui/cascader/cascader-lib.d.ts +34 -8
  239. package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -1
  240. package/dist/components/reui/cascader/cascader-lib.js +145 -29
  241. package/dist/components/reui/cascader/cascader-lib.js.map +1 -1
  242. package/dist/components/reui/cascader/cascader-nav.d.ts +1 -1
  243. package/dist/components/reui/cascader/cascader-types.d.ts +1 -1
  244. package/dist/components/reui/cascader/cascader.d.ts +13 -8
  245. package/dist/components/reui/cascader/cascader.d.ts.map +1 -1
  246. package/dist/components/reui/cascader/cascader.js +31 -16
  247. package/dist/components/reui/cascader/cascader.js.map +1 -1
  248. package/dist/components/reui/code-block/code-block.d.ts.map +1 -1
  249. package/dist/components/reui/color-picker.d.ts +280 -0
  250. package/dist/components/reui/color-picker.d.ts.map +1 -0
  251. package/dist/components/reui/color-picker.js +2013 -0
  252. package/dist/components/reui/color-picker.js.map +1 -0
  253. package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts.map +1 -1
  254. package/dist/components/reui/data-grid/data-grid-cell-selection.js +1 -0
  255. package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -1
  256. package/dist/components/reui/data-grid/data-grid-column-filter.d.ts.map +1 -1
  257. package/dist/components/reui/data-grid/data-grid-column-filter.js +1 -0
  258. package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
  259. package/dist/components/reui/data-grid/data-grid-column-header.d.ts +6 -8
  260. package/dist/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -1
  261. package/dist/components/reui/data-grid/data-grid-column-header.js +50 -29
  262. package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
  263. package/dist/components/reui/data-grid/data-grid-column-visibility.d.ts.map +1 -1
  264. package/dist/components/reui/data-grid/data-grid-column-visibility.js +1 -0
  265. package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -1
  266. package/dist/components/reui/data-grid/data-grid-pagination.d.ts.map +1 -1
  267. package/dist/components/reui/data-grid/data-grid-pagination.js +2 -1
  268. package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
  269. package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -1
  270. package/dist/components/reui/data-grid/data-grid-scroll-area.js +10 -3
  271. package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
  272. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -1
  273. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +15 -10
  274. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
  275. package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts +1 -1
  276. package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -1
  277. package/dist/components/reui/data-grid/data-grid-table-dnd.js +54 -14
  278. package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
  279. package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -1
  280. package/dist/components/reui/data-grid/data-grid-table-virtual.js +37 -42
  281. package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
  282. package/dist/components/reui/data-grid/data-grid-table.d.ts +174 -16
  283. package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
  284. package/dist/components/reui/data-grid/data-grid-table.js +223 -89
  285. package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
  286. package/dist/components/reui/data-grid/data-grid.d.ts +55 -1
  287. package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
  288. package/dist/components/reui/data-grid/data-grid.js +112 -22
  289. package/dist/components/reui/data-grid/data-grid.js.map +1 -1
  290. package/dist/components/reui/date-selector.d.ts +1 -0
  291. package/dist/components/reui/date-selector.d.ts.map +1 -1
  292. package/dist/components/reui/date-selector.js +22 -16
  293. package/dist/components/reui/date-selector.js.map +1 -1
  294. package/dist/components/reui/emoji-picker.d.ts +367 -0
  295. package/dist/components/reui/emoji-picker.d.ts.map +1 -0
  296. package/dist/components/reui/emoji-picker.js +1768 -0
  297. package/dist/components/reui/emoji-picker.js.map +1 -0
  298. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +3 -5
  299. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
  300. package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts.map +1 -1
  301. package/dist/components/reui/event-calendar/event-calendar-nav.d.ts.map +1 -1
  302. package/dist/components/reui/event-calendar/event-calendar-nav.js +4 -4
  303. package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
  304. package/dist/components/reui/event-calendar/event-calendar.d.ts.map +1 -1
  305. package/dist/components/reui/event-calendar/event-calendar.js +34 -31
  306. package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
  307. package/dist/components/reui/file-type.d.ts +792 -0
  308. package/dist/components/reui/file-type.d.ts.map +1 -0
  309. package/dist/components/reui/file-type.js +1367 -0
  310. package/dist/components/reui/file-type.js.map +1 -0
  311. package/dist/components/reui/filters/filters-advanced.d.ts +1 -0
  312. package/dist/components/reui/filters/filters-advanced.js +1 -1
  313. package/dist/components/reui/filters/filters-advanced.js.map +1 -1
  314. package/dist/components/reui/filters/filters-builder.d.ts +1 -1
  315. package/dist/components/reui/filters/filters-chip.d.ts +5 -1
  316. package/dist/components/reui/filters/filters-chip.d.ts.map +1 -1
  317. package/dist/components/reui/filters/filters-chip.js +1 -1
  318. package/dist/components/reui/filters/filters-lib.d.ts +1 -1
  319. package/dist/components/reui/filters/filters-lib.d.ts.map +1 -1
  320. package/dist/components/reui/frame.d.ts.map +1 -1
  321. package/dist/components/reui/frame.js.map +1 -1
  322. package/dist/components/reui/gantt/gantt-nav.d.ts.map +1 -1
  323. package/dist/components/reui/gantt/gantt-nav.js +4 -4
  324. package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
  325. package/dist/components/reui/gantt/gantt.d.ts.map +1 -1
  326. package/dist/components/reui/gantt/gantt.js +5 -2
  327. package/dist/components/reui/gantt/gantt.js.map +1 -1
  328. package/dist/components/reui/icon-tile.d.ts +1 -1
  329. package/dist/components/reui/icon-tile.js +8 -7
  330. package/dist/components/reui/icon-tile.js.map +1 -1
  331. package/dist/components/reui/kanban.d.ts.map +1 -1
  332. package/dist/components/reui/kanban.js +1 -1
  333. package/dist/components/reui/kanban.js.map +1 -1
  334. package/dist/components/reui/number-field.d.ts.map +1 -1
  335. package/dist/components/reui/number-field.js.map +1 -1
  336. package/dist/components/reui/phone-input.js +30 -27
  337. package/dist/components/reui/phone-input.js.map +1 -1
  338. package/dist/components/reui/scrollspy.d.ts +1 -0
  339. package/dist/components/reui/time-picker.js +1 -1
  340. package/dist/components/reui/time-picker.js.map +1 -1
  341. package/dist/components/ui/attachment.d.ts +1 -1
  342. package/dist/components/ui/button-group.d.ts +1 -1
  343. package/dist/components/ui/button.d.ts +1 -1
  344. package/dist/components/ui/chart.d.ts.map +1 -1
  345. package/dist/components/ui/code-block.d.ts +29 -0
  346. package/dist/components/ui/code-block.d.ts.map +1 -0
  347. package/dist/components/ui/code-block.js +124 -0
  348. package/dist/components/ui/code-block.js.map +1 -0
  349. package/dist/components/ui/command.d.ts.map +1 -1
  350. package/dist/components/ui/direction.js +1 -2
  351. package/dist/components/ui/field.d.ts +1 -1
  352. package/dist/components/ui/field.js +1 -1
  353. package/dist/components/ui/input-group.d.ts +1 -1
  354. package/dist/components/ui/marker.d.ts +1 -1
  355. package/dist/components/ui/message-scroller.d.ts.map +1 -1
  356. package/dist/components/ui/questionnaire.d.ts.map +1 -1
  357. package/dist/components/ui/sidebar.js +1 -1
  358. package/dist/components/ui/trace.d.ts +21 -0
  359. package/dist/components/ui/trace.d.ts.map +1 -0
  360. package/dist/components/ui/trace.js +77 -0
  361. package/dist/components/ui/trace.js.map +1 -0
  362. package/dist/context-BYXeJQnz.d.ts.map +1 -1
  363. package/dist/context-tTdLKYNf.js +99 -0
  364. package/dist/context-tTdLKYNf.js.map +1 -0
  365. package/dist/{copy-menu-C5GaT4Z-.js → copy-menu-DOg9Jh-U.js} +2 -2
  366. package/dist/{copy-menu-C5GaT4Z-.js.map → copy-menu-DOg9Jh-U.js.map} +1 -1
  367. package/dist/hooks/use-copy-to-clipboard.d.ts +1 -0
  368. package/dist/hooks/use-focus-trap.d.ts +22 -0
  369. package/dist/hooks/use-focus-trap.d.ts.map +1 -0
  370. package/dist/hooks/use-focus-trap.js +80 -0
  371. package/dist/hooks/use-focus-trap.js.map +1 -0
  372. package/dist/hooks/use-highlighted-code.d.ts +5 -0
  373. package/dist/hooks/use-highlighted-code.d.ts.map +1 -0
  374. package/dist/hooks/use-highlighted-code.js +128 -0
  375. package/dist/hooks/use-highlighted-code.js.map +1 -0
  376. package/dist/hooks/use-hover-gesture.d.ts +1 -0
  377. package/dist/hooks/use-intersection-observer.d.ts +1 -0
  378. package/dist/hooks/use-listbox.d.ts +29 -0
  379. package/dist/hooks/use-listbox.d.ts.map +1 -0
  380. package/dist/hooks/use-listbox.js +75 -0
  381. package/dist/hooks/use-listbox.js.map +1 -0
  382. package/dist/hooks/use-scroll-position.d.ts +1 -0
  383. package/dist/hooks/use-slider-input.d.ts +1 -0
  384. package/dist/hooks/use-viewport.d.ts +1 -0
  385. package/dist/lib/tick-sound.d.ts +1 -0
  386. package/dist/model-NSIg2p7a.d.ts +20 -0
  387. package/dist/model-NSIg2p7a.d.ts.map +1 -0
  388. package/dist/model-_mRyI6V9.d.ts +18 -0
  389. package/dist/model-_mRyI6V9.d.ts.map +1 -0
  390. package/dist/{positioner-3mCqiebN.js → positioner-3r3cfkqT.js} +97 -33
  391. package/dist/positioner-3r3cfkqT.js.map +1 -0
  392. package/dist/tooltip-Bam5KeYe.js +535 -0
  393. package/dist/tooltip-Bam5KeYe.js.map +1 -0
  394. package/dist/tooltip-C01qUgsW.d.ts.map +1 -1
  395. package/dist/use-position-DOi1gVL0.d.ts +32 -0
  396. package/dist/use-position-DOi1gVL0.d.ts.map +1 -0
  397. package/package.json +11 -11
  398. package/dist/cascader-types-DVT-znZ-.d.ts.map +0 -1
  399. package/dist/components/motion/tooltip.js.map +0 -1
  400. package/dist/model-DfeFradZ.d.ts +0 -9
  401. package/dist/model-DfeFradZ.d.ts.map +0 -1
  402. package/dist/positioner-3mCqiebN.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","names":[],"sources":["../../../src/components/motion/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useEffect } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_PANEL } from \"../../lib/ease\";\nimport { PresenceGate } from \"../../lib/presence-gate\";\n\nexport interface DrawerProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n side?: \"left\" | \"right\";\n children: ReactNode;\n /** Class for the panel surface. */\n className?: string;\n /** Class for the backdrop. */\n backdropClassName?: string;\n ariaLabel?: string;\n /** Close when the backdrop is clicked. Default true. */\n dismissable?: boolean;\n}\n\nexport function Drawer({\n open,\n onOpenChange,\n side = \"right\",\n children,\n className,\n backdropClassName,\n ariaLabel,\n dismissable = true,\n}: DrawerProps) {\n const reduce = useReducedMotion();\n\n useEffect(() => {\n if (!open) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onOpenChange(false);\n };\n window.addEventListener(\"keydown\", onKey);\n const prevOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n return () => {\n window.removeEventListener(\"keydown\", onKey);\n document.body.style.overflow = prevOverflow;\n };\n }, [open, onOpenChange]);\n\n const offscreen = side === \"right\" ? \"100%\" : \"-100%\";\n\n // Two fixed siblings, no wrapper: the backdrop spans the viewport edges but\n // paints the scrim, and the panel is inset off one side and paints its own\n // surface, so neither is a transparent edge-spanning layer. Both hang off\n // `PresenceGate`, so interaction releases in the same commit that starts the\n // exit rather than when it ends.\n return (\n <AnimatePresence>\n {open ? (\n <PresenceGate key=\"backdrop\">\n {({ gate }) => (\n <motion.button\n type=\"button\"\n aria-label=\"Close\"\n tabIndex={dismissable ? 0 : -1}\n onClick={() => dismissable && onOpenChange(false)}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.25, ease: EASE_OUT }}\n {...gate}\n className={cn(\n \"fixed inset-0 z-50 h-full w-full cursor-default bg-black/40 backdrop-blur-sm\",\n backdropClassName,\n )}\n />\n )}\n </PresenceGate>\n ) : null}\n {open ? (\n <PresenceGate key=\"panel\">\n {({ gate }) => (\n <motion.aside\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={ariaLabel}\n initial={reduce ? { opacity: 0 } : { x: offscreen }}\n animate={reduce ? { opacity: 1 } : { x: 0 }}\n exit={reduce ? { opacity: 0 } : { x: offscreen }}\n transition={reduce ? { duration: 0.2, ease: EASE_OUT } : SPRING_PANEL}\n {...gate}\n className={cn(\n \"fixed inset-y-0 z-50 flex w-80 max-w-[85vw] flex-col bg-background shadow-2xl\",\n side === \"right\"\n ? \"right-0 border-border border-l\"\n : \"left-0 border-border border-r\",\n className,\n )}\n >\n {children}\n </motion.aside>\n )}\n </PresenceGate>\n ) : null}\n </AnimatePresence>\n );\n}\n"],"mappings":";;;;;;;;AAuBA,SAAgB,OAAO,EACrB,MACA,cACA,OAAO,SACP,UACA,WACA,mBACA,WACA,cAAc,QACA;CACd,MAAM,SAAS,iBAAiB;CAEhC,gBAAgB;EACd,IAAI,CAAC,MAAM;EACX,MAAM,SAAS,MAAqB;GAClC,IAAI,EAAE,QAAQ,UAAU,aAAa,KAAK;EAC5C;EACA,OAAO,iBAAiB,WAAW,KAAK;EACxC,MAAM,eAAe,SAAS,KAAK,MAAM;EACzC,SAAS,KAAK,MAAM,WAAW;EAC/B,aAAa;GACX,OAAO,oBAAoB,WAAW,KAAK;GAC3C,SAAS,KAAK,MAAM,WAAW;EACjC;CACF,GAAG,CAAC,MAAM,YAAY,CAAC;CAEvB,MAAM,YAAY,SAAS,UAAU,SAAS;CAO9C,OACE,qBAAC,iBAAD,EAAA,UAAA,CACG,OACC,oBAAC,cAAD,EAAA,WACI,EAAE,WACF,oBAAC,OAAO,QAAR;EACE,MAAK;EACL,cAAW;EACX,UAAU,cAAc,IAAI;EAC5B,eAAe,eAAe,aAAa,KAAK;EAChD,SAAS,EAAE,SAAS,EAAE;EACtB,SAAS,EAAE,SAAS,EAAE;EACtB,MAAM,EAAE,SAAS,EAAE;EACnB,YAAY;GAAE,UAAU;GAAM,MAAM;EAAS;EAC7C,GAAI;EACJ,WAAW,GACT,gFACA,iBACF;CACD,CAAA,EAES,GAlBI,UAkBJ,IACZ,MACH,OACC,oBAAC,cAAD,EAAA,WACI,EAAE,WACF,oBAAC,OAAO,OAAR;EACE,MAAK;EACL,cAAW;EACX,cAAY;EACZ,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,UAAU;EAClD,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE;EAC1C,MAAM,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,UAAU;EAC/C,YAAY,SAAS;GAAE,UAAU;GAAK,MAAM;EAAS,IAAI;EACzD,GAAI;EACJ,WAAW,GACT,iFACA,SAAS,UACL,mCACA,iCACJ,SACF;EAEC;CACW,CAAA,EAEJ,GAtBI,OAsBJ,IACZ,IACW,EAAA,CAAA;AAErB"}
1
+ {"version":3,"file":"drawer.js","names":[],"sources":["../../../src/components/motion/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useEffect, useRef } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useFocusTrap } from \"../../hooks/use-focus-trap\";\nimport { EASE_OUT, SPRING_PANEL } from \"../../lib/ease\";\nimport { PresenceGate } from \"../../lib/presence-gate\";\n\nexport interface DrawerProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n side?: \"left\" | \"right\";\n children: ReactNode;\n /** Class for the panel surface. */\n className?: string;\n /** Class for the backdrop. */\n backdropClassName?: string;\n ariaLabel?: string;\n /** Close when the backdrop is clicked or Escape is pressed. Default true. */\n dismissable?: boolean;\n}\n\nexport function Drawer({\n open,\n onOpenChange,\n side = \"right\",\n children,\n className,\n backdropClassName,\n ariaLabel,\n dismissable = true,\n}: DrawerProps) {\n const reduce = useReducedMotion();\n const panelRef = useRef<HTMLDivElement>(null);\n\n // Focus moves into the panel on open, Tab stays inside it, and focus returns\n // to the opener on close.\n useFocusTrap(open, panelRef, {\n onEscape: dismissable ? () => onOpenChange(false) : undefined,\n });\n\n useEffect(() => {\n if (!open) return;\n const prevOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n return () => {\n document.body.style.overflow = prevOverflow;\n };\n }, [open]);\n\n const offscreen = side === \"right\" ? \"100%\" : \"-100%\";\n\n // Two fixed siblings, no wrapper: the backdrop spans the viewport edges but\n // paints the scrim, and the panel is inset off one side and paints its own\n // surface, so neither is a transparent edge-spanning layer. Both hang off\n // `PresenceGate`, so interaction releases in the same commit that starts the\n // exit rather than when it ends.\n return (\n <AnimatePresence>\n {open ? (\n <PresenceGate key=\"backdrop\">\n {({ gate }) => (\n <motion.button\n type=\"button\"\n aria-label=\"Close\"\n // Outside the panel, so the focus trap never lands on it; it is\n // a pointer target only.\n tabIndex={-1}\n onClick={() => dismissable && onOpenChange(false)}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.25, ease: EASE_OUT }}\n {...gate}\n className={cn(\n \"fixed inset-0 z-50 h-full w-full cursor-default bg-black/40 backdrop-blur-sm\",\n backdropClassName,\n )}\n />\n )}\n </PresenceGate>\n ) : null}\n {open ? (\n <PresenceGate key=\"panel\">\n {({ gate }) => (\n <motion.div\n ref={panelRef}\n tabIndex={-1}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={ariaLabel}\n initial={reduce ? { opacity: 0 } : { x: offscreen }}\n animate={reduce ? { opacity: 1 } : { x: 0 }}\n exit={reduce ? { opacity: 0 } : { x: offscreen }}\n transition={reduce ? { duration: 0.2, ease: EASE_OUT } : SPRING_PANEL}\n {...gate}\n className={cn(\n \"fixed inset-y-0 z-50 flex w-80 max-w-[85vw] flex-col bg-background shadow-2xl outline-none\",\n side === \"right\"\n ? \"right-0 border-border border-l\"\n : \"left-0 border-border border-r\",\n className,\n )}\n >\n {children}\n </motion.div>\n )}\n </PresenceGate>\n ) : null}\n </AnimatePresence>\n );\n}\n"],"mappings":";;;;;;;;;AAwBA,SAAgB,OAAO,EACrB,MACA,cACA,OAAO,SACP,UACA,WACA,mBACA,WACA,cAAc,QACA;CACd,MAAM,SAAS,iBAAiB;CAChC,MAAM,WAAW,OAAuB,IAAI;CAI5C,aAAa,MAAM,UAAU,EAC3B,UAAU,oBAAoB,aAAa,KAAK,IAAI,KAAA,EACtD,CAAC;CAED,gBAAgB;EACd,IAAI,CAAC,MAAM;EACX,MAAM,eAAe,SAAS,KAAK,MAAM;EACzC,SAAS,KAAK,MAAM,WAAW;EAC/B,aAAa;GACX,SAAS,KAAK,MAAM,WAAW;EACjC;CACF,GAAG,CAAC,IAAI,CAAC;CAET,MAAM,YAAY,SAAS,UAAU,SAAS;CAO9C,OACE,qBAAC,iBAAD,EAAA,UAAA,CACG,OACC,oBAAC,cAAD,EAAA,WACI,EAAE,WACF,oBAAC,OAAO,QAAR;EACE,MAAK;EACL,cAAW;EAGX,UAAU;EACV,eAAe,eAAe,aAAa,KAAK;EAChD,SAAS,EAAE,SAAS,EAAE;EACtB,SAAS,EAAE,SAAS,EAAE;EACtB,MAAM,EAAE,SAAS,EAAE;EACnB,YAAY;GAAE,UAAU;GAAM,MAAM;EAAS;EAC7C,GAAI;EACJ,WAAW,GACT,gFACA,iBACF;CACD,CAAA,EAES,GApBI,UAoBJ,IACZ,MACH,OACC,oBAAC,cAAD,EAAA,WACI,EAAE,WACF,oBAAC,OAAO,KAAR;EACE,KAAK;EACL,UAAU;EACV,MAAK;EACL,cAAW;EACX,cAAY;EACZ,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,UAAU;EAClD,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE;EAC1C,MAAM,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,UAAU;EAC/C,YAAY,SAAS;GAAE,UAAU;GAAK,MAAM;EAAS,IAAI;EACzD,GAAI;EACJ,WAAW,GACT,8FACA,SAAS,UACL,mCACA,iCACJ,SACF;EAEC;CACS,CAAA,EAEF,GAxBI,OAwBJ,IACZ,IACW,EAAA,CAAA;AAErB"}
@@ -1 +1 @@
1
- {"version":3,"file":"expandable-action-bar.d.ts","names":[],"sources":["../../../src/components/motion/expandable-action-bar.tsx"],"mappings":";;YAqBY;YAEA;EACV;EACA,OAAO;EACP,MAAM;EACN;EACA;EACA;EACA,QAAQ;EACR,WAAW;;YAGD;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf,OAAO;EACP;EACA;EACA,oBAAoB;EACpB;EACA,YAAY,MAAM;EAClB,OAAO;;;;;;;EAOP;EACA;EACA;EACA;EACA,aAAa;EACb,cACE,MAAM,yBACN;IAAS;IAAmB;QACzB;;wBAwDS,sBACd,OACA,UACA,iBACA,kBACA,UACA,UACA,MACA,eACA,eACA,eACA,WACA,YACA,cACC,2CAAwB,IAAA;wBAyQX,uBAAuB,OAAO;;;;;cAAA"}
1
+ {"version":3,"file":"expandable-action-bar.d.ts","names":[],"sources":["../../../src/components/motion/expandable-action-bar.tsx"],"mappings":";;YAqBY;YAEA;EACV;EACA,OAAO;EACP,MAAM;EACN;EACA;EACA;EACA,QAAQ;EACR,WAAW;;YAGD;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf,OAAO;EACP;EACA;EACA,oBAAoB;EACpB;EACA,YAAY,MAAM;EAClB,OAAO;;;;;;;EAOP;EACA;EACA;EACA;EACA,aAAa;EACb,cACE,MAAM,yBACN;IAAS;IAAmB;QACzB;;wBAwDS,sBACd,OACA,UACA,iBACA,kBACA,UACA,UACA,MACA,eACA,eACA,eACA,WACA,YACA,cACC,2CAAwB,IAAA;wBAyQX,uBAAuB,OAAO"}
@@ -24,4 +24,5 @@ export interface ExpandableChipProps extends ExpandableStateProps {
24
24
  export declare function ExpandableButton({ icon, label, expanded, defaultExpanded, onExpandedChange, className, onClick, disabled, type, "aria-label": ariaLabel, ...props }: ExpandableButtonProps): import("react").JSX.Element;
25
25
  export declare function ExpandableChip({ label, actionIcon, actionLabel, onAction, collapseOnAction, expanded, defaultExpanded, onExpandedChange, disabled, className, labelClassName, actionClassName }: ExpandableChipProps): import("react").JSX.Element;
26
26
  //#endregion
27
+ export {};
27
28
  //# sourceMappingURL=expandable-control.d.ts.map
@@ -3,7 +3,7 @@ import { EASE_OUT } from "../../lib/ease.js";
3
3
  import { Button } from "./button/base.js";
4
4
  import { StatefulButton } from "./button/stateful.js";
5
5
  import "./button/index.js";
6
- import { useCallback, useEffect, useRef, useState } from "react";
6
+ import { useCallback, useEffect, useId, useRef, useState } from "react";
7
7
  import { cn } from "@kumix/utils";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { AnimatePresence, motion, useReducedMotion } from "motion/react";
@@ -40,6 +40,7 @@ function FeedbackWidget({ onSubmit, position = "bottom-right", title = "Help us
40
40
  const reduce = useReducedMotion();
41
41
  const rootRef = useRef(null);
42
42
  const textareaRef = useRef(null);
43
+ const titleId = useId();
43
44
  const closeTimerRef = useRef(null);
44
45
  const [status, setStatus] = useState("idle");
45
46
  const [message, setMessage] = useState("");
@@ -319,6 +320,7 @@ function FeedbackWidget({ onSubmit, position = "bottom-right", title = "Help us
319
320
  children: [/* @__PURE__ */ jsxs("div", {
320
321
  className: "flex items-start justify-between gap-3",
321
322
  children: [/* @__PURE__ */ jsx("h3", {
323
+ id: titleId,
322
324
  className: "font-semibold text-foreground text-sm",
323
325
  children: title
324
326
  }), /* @__PURE__ */ jsx("button", {
@@ -330,6 +332,7 @@ function FeedbackWidget({ onSubmit, position = "bottom-right", title = "Help us
330
332
  })]
331
333
  }), /* @__PURE__ */ jsx("textarea", {
332
334
  ref: textareaRef,
335
+ "aria-labelledby": titleId,
333
336
  value: message,
334
337
  onChange: (e) => setMessage(e.target.value),
335
338
  placeholder,
@@ -1 +1 @@
1
- {"version":3,"file":"feedback-widget.js","names":[],"sources":["../../../src/components/motion/feedback-widget.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { AlertCircle, MessageSquare, X } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT } from \"../../lib/ease\";\nimport { Button, StatefulButton } from \"./button\";\n\ntype Status = \"idle\" | \"open\" | \"sending\" | \"sent\" | \"error\";\n\nconst SUCCESS_DURATION_MS = 1600;\n\n// The trigger grows into the panel with a slight overshoot on open, then uses\n// a calmer curve on close so dismissing feels faster and less prominent.\nconst MORPH_OPEN_EASE = [0.34, 1.25, 0.64, 1] as const;\nconst MORPH_CLOSE_EASE = [0.22, 1, 0.36, 1] as const;\nconst MORPH_OPEN_DURATION = 0.4;\nconst MORPH_CLOSE_DURATION = 0.28;\nconst MORPH_FADE_DURATION = 0.22;\nconst MORPH_SLIDE = 40;\nconst MORPH_SCALE = 0.97;\nconst MORPH_BLUR = \"blur(2px)\";\n\n// Celebration sprinkles that burst from the success icon.\nconst SPRINKLES = Array.from({ length: 8 }, (_, i) => {\n const angle = (i / 8) * Math.PI * 2;\n return {\n x: Math.cos(angle) * 26,\n y: Math.sin(angle) * 26,\n color: i % 2 === 0 ? \"var(--color-success)\" : \"var(--accent)\",\n };\n});\n\nexport interface FeedbackData {\n message: string;\n}\n\nexport interface FeedbackWidgetProps {\n /** Called on submit. May be async; the button shows a sending state until it resolves. */\n onSubmit?: (data: FeedbackData) => void | Promise<void>;\n position?: \"bottom-right\" | \"bottom-left\";\n title?: string;\n placeholder?: string;\n icon?: ReactNode;\n className?: string;\n}\n\nexport function FeedbackWidget({\n onSubmit,\n position = \"bottom-right\",\n title = \"Help us improve\",\n placeholder = \"Share an idea or report a bug\",\n icon,\n className,\n}: FeedbackWidgetProps) {\n const reduce = useReducedMotion();\n const rootRef = useRef<HTMLDivElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const closeTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const [status, setStatus] = useState<Status>(\"idle\");\n const [message, setMessage] = useState(\"\");\n\n const open = status !== \"idle\";\n const busy = status === \"sending\";\n\n const clearCloseTimer = useCallback(() => {\n if (closeTimerRef.current === null) return;\n clearTimeout(closeTimerRef.current);\n closeTimerRef.current = null;\n }, []);\n\n const close = useCallback(() => {\n clearCloseTimer();\n setStatus(\"idle\");\n setMessage(\"\");\n }, [clearCloseTimer]);\n\n useEffect(\n () => () => {\n if (closeTimerRef.current !== null) {\n clearTimeout(closeTimerRef.current);\n }\n },\n [],\n );\n\n useEffect(() => {\n if (status !== \"open\") return;\n\n // Match the wallet account switcher's staged interaction: focusing while\n // the surface is still expanding makes the caret and focus state appear\n // inside a scaled panel. Arm the field once the open morph has settled.\n const timer = window.setTimeout(\n () => textareaRef.current?.focus(),\n reduce ? 0 : MORPH_OPEN_DURATION * 1000,\n );\n return () => window.clearTimeout(timer);\n }, [status, reduce]);\n\n // Dismiss on escape or outside click while open (but not mid-send).\n useEffect(() => {\n if (!open) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\" && !busy) close();\n };\n const onPointer = (e: PointerEvent) => {\n if (!busy && rootRef.current && !rootRef.current.contains(e.target as Node)) {\n close();\n }\n };\n window.addEventListener(\"keydown\", onKey);\n window.addEventListener(\"pointerdown\", onPointer);\n return () => {\n window.removeEventListener(\"keydown\", onKey);\n window.removeEventListener(\"pointerdown\", onPointer);\n };\n }, [open, busy, close]);\n\n const scheduleSuccessClose = () => {\n clearCloseTimer();\n closeTimerRef.current = setTimeout(close, SUCCESS_DURATION_MS);\n };\n\n const submit = async () => {\n if (busy || message.trim().length === 0) return;\n setStatus(\"sending\");\n try {\n await onSubmit?.({ message });\n setStatus(\"sent\");\n scheduleSuccessClose();\n } catch {\n // Preserve the message so a rejected submission can be retried.\n setStatus(\"error\");\n }\n };\n\n const left = position === \"bottom-left\";\n const contentOffset = left ? -MORPH_SLIDE : MORPH_SLIDE;\n const surfaceTransition = reduce\n ? { duration: 0 }\n : {\n layout: {\n duration: open ? MORPH_OPEN_DURATION : MORPH_CLOSE_DURATION,\n ease: open ? MORPH_OPEN_EASE : MORPH_CLOSE_EASE,\n },\n borderRadius: {\n duration: open ? MORPH_OPEN_DURATION : MORPH_CLOSE_DURATION,\n ease: open ? MORPH_OPEN_EASE : MORPH_CLOSE_EASE,\n },\n };\n const contentTransition = reduce\n ? { duration: 0 }\n : {\n opacity: {\n duration: MORPH_FADE_DURATION,\n ease: MORPH_CLOSE_EASE,\n },\n x: {\n duration: MORPH_OPEN_DURATION,\n ease: MORPH_CLOSE_EASE,\n },\n scale: {\n duration: MORPH_OPEN_DURATION,\n ease: MORPH_CLOSE_EASE,\n },\n filter: {\n duration: MORPH_FADE_DURATION,\n ease: MORPH_CLOSE_EASE,\n },\n rotate: {\n duration: MORPH_OPEN_DURATION,\n ease: MORPH_CLOSE_EASE,\n },\n };\n const viewInitial = reduce ? { opacity: 0 } : { opacity: 0, y: 8, filter: \"blur(4px)\" };\n const viewAnimate = reduce\n ? {\n opacity: 1,\n transition: { duration: 0.18, ease: EASE_OUT },\n }\n : {\n opacity: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: { duration: 0.24, ease: EASE_OUT },\n };\n const viewExit = reduce\n ? {\n opacity: 0,\n transition: { duration: 0.14, ease: EASE_OUT },\n }\n : {\n opacity: 0,\n y: -8,\n filter: \"blur(4px)\",\n transition: { duration: 0.16, ease: EASE_OUT },\n };\n\n return (\n <div\n ref={rootRef}\n className={cn(\n \"pointer-events-none absolute bottom-4 z-30\",\n left ? \"left-4\" : \"right-4\",\n className,\n )}\n >\n {/* One persistent shell grows out of the corner trigger. The shell and\n its contents use separate timing so the surface leads the reveal. */}\n <motion.div\n layout\n animate={{ borderRadius: open ? 20 : 40 }}\n transition={surfaceTransition}\n style={{ transformOrigin: left ? \"bottom left\" : \"bottom right\" }}\n className={cn(\n \"pointer-events-auto absolute bottom-0 overflow-hidden border border-border bg-background text-foreground shadow-lg\",\n open ? \"w-[min(86vw,320px)] p-2\" : \"h-12 w-12 p-0\",\n left ? \"left-0\" : \"right-0\",\n )}\n >\n <AnimatePresence initial={false} mode=\"popLayout\">\n {open ? (\n <motion.div\n key=\"panel\"\n initial={\n reduce\n ? { opacity: 0 }\n : {\n opacity: 0,\n x: contentOffset,\n scale: MORPH_SCALE,\n filter: MORPH_BLUR,\n }\n }\n animate={{ opacity: 1, x: 0, scale: 1, filter: \"blur(0px)\" }}\n exit={\n reduce\n ? { opacity: 0 }\n : {\n opacity: 0,\n x: contentOffset,\n scale: MORPH_SCALE,\n filter: MORPH_BLUR,\n }\n }\n transition={contentTransition}\n >\n <motion.div layout=\"position\">\n <AnimatePresence mode=\"popLayout\" initial={false} propagate>\n {status === \"sent\" ? (\n <motion.div\n key=\"sent\"\n initial={viewInitial}\n animate={viewAnimate}\n exit={viewExit}\n >\n <div className=\"flex flex-col items-center justify-center gap-1.5 rounded-[20px] bg-border/60 px-4 py-6 text-center\">\n <div className=\"relative mb-1 flex h-12 w-12 items-center justify-center\">\n {reduce\n ? null\n : SPRINKLES.map((s, i) => (\n <motion.span\n key={`${s.x}-${s.y}`}\n initial={{ opacity: 0, scale: 0.4, x: 0, y: 0 }}\n animate={{\n opacity: [0, 1, 0],\n scale: [0, 1, 0.4],\n x: s.x,\n y: s.y,\n }}\n transition={{\n duration: 0.6,\n delay: 0.18 + i * 0.02,\n ease: \"easeOut\",\n }}\n style={{ backgroundColor: s.color }}\n className=\"absolute h-1.5 w-1.5 rounded-full\"\n />\n ))}\n <motion.div\n initial={reduce ? { scale: 1 } : { scale: 0 }}\n animate={{ scale: 1 }}\n transition={{\n type: \"spring\",\n stiffness: 500,\n damping: 22,\n delay: 0.04,\n }}\n className=\"flex h-12 w-12 items-center justify-center rounded-full bg-(--color-success)\"\n >\n <motion.svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n className=\"h-5 w-5 text-white\"\n >\n <motion.path\n d=\"M5 12.5l4.5 4.5L19 7.5\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n initial={reduce ? { pathLength: 1 } : { pathLength: 0 }}\n animate={{ pathLength: 1 }}\n transition={{\n duration: 0.35,\n ease: \"easeOut\",\n delay: 0.15,\n }}\n />\n </motion.svg>\n </motion.div>\n </div>\n <h3 className=\"font-semibold text-foreground text-sm\">Thanks!</h3>\n <p className=\"text-muted-foreground text-xs leading-relaxed\">\n Your feedback helps us build something better.\n </p>\n </div>\n </motion.div>\n ) : status === \"error\" ? (\n <motion.div\n key=\"error\"\n initial={viewInitial}\n animate={viewAnimate}\n exit={viewExit}\n >\n <div\n role=\"alert\"\n className=\"rounded-[20px] bg-border/60 px-4 py-5 text-center\"\n >\n <div className=\"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10 text-destructive\">\n <AlertCircle className=\"h-5 w-5\" />\n </div>\n <h3 className=\"mt-3 font-semibold text-foreground text-sm\">\n Something went wrong\n </h3>\n <p className=\"mt-1 text-muted-foreground text-xs leading-relaxed\">\n We couldn&apos;t send your feedback. Please try again.\n </p>\n <Button size=\"sm\" onClick={submit} className=\"mt-4\">\n Try again\n </Button>\n </div>\n </motion.div>\n ) : (\n <motion.div\n key=\"form\"\n initial={viewInitial}\n animate={viewAnimate}\n exit={viewExit}\n >\n <div className=\"min-h-[150px] rounded-[20px] bg-border/60 px-4 py-3.5\">\n <div className=\"flex items-start justify-between gap-3\">\n <h3 className=\"font-semibold text-foreground text-sm\">{title}</h3>\n <button\n type=\"button\"\n onClick={close}\n aria-label=\"Close\"\n className=\"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-foreground/[0.07] text-muted-foreground transition-colors hover:text-foreground\"\n >\n <X className=\"h-3 w-3\" />\n </button>\n </div>\n <textarea\n ref={textareaRef}\n value={message}\n onChange={(e) => setMessage(e.target.value)}\n placeholder={placeholder}\n disabled={busy}\n rows={3}\n className=\"mt-2 w-full resize-none bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground/60 md:text-sm\"\n />\n </div>\n\n <div className=\"flex items-center gap-2 px-1 pt-2 pb-1\">\n <Button\n variant=\"secondary\"\n size=\"md\"\n onClick={close}\n disabled={busy}\n className=\"flex-1 bg-border text-muted-foreground hover:text-foreground\"\n >\n Cancel\n </Button>\n <StatefulButton\n state={busy ? \"loading\" : \"idle\"}\n loadingText=\"Sending\"\n size=\"md\"\n onClick={submit}\n disabled={busy || message.trim().length === 0}\n className=\"flex-1 bg-foreground text-background hover:bg-foreground/90\"\n >\n Submit\n </StatefulButton>\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n </motion.div>\n </motion.div>\n ) : (\n <motion.button\n key=\"trigger\"\n type=\"button\"\n initial={\n reduce\n ? { opacity: 0 }\n : {\n opacity: 0,\n x: -contentOffset,\n filter: MORPH_BLUR,\n }\n }\n animate={{ opacity: 1, x: 0, filter: \"blur(0px)\" }}\n exit={\n reduce\n ? { opacity: 0 }\n : {\n opacity: 0,\n x: -contentOffset,\n filter: MORPH_BLUR,\n }\n }\n transition={contentTransition}\n onClick={() => {\n clearCloseTimer();\n setStatus(\"open\");\n }}\n aria-label={title}\n aria-haspopup=\"dialog\"\n whileTap={reduce ? undefined : { scale: 0.92 }}\n className={cn(\n \"absolute bottom-0 flex h-12 w-12 items-center justify-center bg-transparent text-foreground\",\n left ? \"left-0\" : \"right-0\",\n )}\n >\n <motion.span\n initial={reduce ? false : { rotate: 45, scale: MORPH_SCALE }}\n animate={{ rotate: 0, scale: 1 }}\n exit={{ rotate: 45, scale: MORPH_SCALE }}\n transition={contentTransition}\n className=\"grid h-5 w-5 shrink-0 place-items-center [&>svg]:h-full [&>svg]:w-full\"\n >\n {icon ?? <MessageSquare className=\"h-5 w-5\" />}\n </motion.span>\n </motion.button>\n )}\n </AnimateP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AAK;UACL,SAAS;UACT,UAAU,QAAQ,QAAQ,KAAK,CAAC,CAAC,WAAW;UAC5C,WAAU;UACX,UAAA;SAEe,CAAA,CACb;QACK,CAAA,CAAA;OAjDN,GAAA,MAiDM;MAEC,CAAA;KACP,CAAA;IACF,GA/KN,OA+KM,IAEZ,oBAAC,OAAO,QAAR;KAEE,MAAK;KACL,SACE,SACI,EAAE,SAAS,EAAE,IACb;MACE,SAAS;MACT,GAAG,CAAC;MACJ,QAAQ;KACV;KAEN,SAAS;MAAE,SAAS;MAAG,GAAG;MAAG,QAAQ;KAAY;KACjD,MACE,SACI,EAAE,SAAS,EAAE,IACb;MACE,SAAS;MACT,GAAG,CAAC;MACJ,QAAQ;KACV;KAEN,YAAY;KACZ,eAAe;MACb,gBAAgB;MAChB,UAAU,MAAM;KAClB;KACA,cAAY;KACZ,iBAAc;KACd,UAAU,SAAS,KAAA,IAAY,EAAE,OAAO,IAAK;KAC7C,WAAW,GACT,+FACA,OAAO,WAAW,SACpB;KAEA,UAAA,oBAAC,OAAO,MAAR;MACE,SAAS,SAAS,QAAQ;OAAE,QAAQ;OAAI,OAAO;MAAY;MAC3D,SAAS;OAAE,QAAQ;OAAG,OAAO;MAAE;MAC/B,MAAM;OAAE,QAAQ;OAAI,OAAO;MAAY;MACvC,YAAY;MACZ,WAAU;MAET,UAAA,QAAQ,oBAAC,eAAD,EAAe,WAAU,UAAW,CAAA;KAClC,CAAA;IACA,GA3CT,SA2CS;GAEF,CAAA;EACP,CAAA;CACT,CAAA;AAET"}
1
+ {"version":3,"file":"feedback-widget.js","names":[],"sources":["../../../src/components/motion/feedback-widget.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useCallback, useEffect, useId, useRef, useState } from \"react\";\nimport { AlertCircle, MessageSquare, X } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT } from \"../../lib/ease\";\nimport { Button, StatefulButton } from \"./button\";\n\ntype Status = \"idle\" | \"open\" | \"sending\" | \"sent\" | \"error\";\n\nconst SUCCESS_DURATION_MS = 1600;\n\n// The trigger grows into the panel with a slight overshoot on open, then uses\n// a calmer curve on close so dismissing feels faster and less prominent.\nconst MORPH_OPEN_EASE = [0.34, 1.25, 0.64, 1] as const;\nconst MORPH_CLOSE_EASE = [0.22, 1, 0.36, 1] as const;\nconst MORPH_OPEN_DURATION = 0.4;\nconst MORPH_CLOSE_DURATION = 0.28;\nconst MORPH_FADE_DURATION = 0.22;\nconst MORPH_SLIDE = 40;\nconst MORPH_SCALE = 0.97;\nconst MORPH_BLUR = \"blur(2px)\";\n\n// Celebration sprinkles that burst from the success icon.\nconst SPRINKLES = Array.from({ length: 8 }, (_, i) => {\n const angle = (i / 8) * Math.PI * 2;\n return {\n x: Math.cos(angle) * 26,\n y: Math.sin(angle) * 26,\n color: i % 2 === 0 ? \"var(--color-success)\" : \"var(--accent)\",\n };\n});\n\nexport interface FeedbackData {\n message: string;\n}\n\nexport interface FeedbackWidgetProps {\n /** Called on submit. May be async; the button shows a sending state until it resolves. */\n onSubmit?: (data: FeedbackData) => void | Promise<void>;\n position?: \"bottom-right\" | \"bottom-left\";\n title?: string;\n placeholder?: string;\n icon?: ReactNode;\n className?: string;\n}\n\nexport function FeedbackWidget({\n onSubmit,\n position = \"bottom-right\",\n title = \"Help us improve\",\n placeholder = \"Share an idea or report a bug\",\n icon,\n className,\n}: FeedbackWidgetProps) {\n const reduce = useReducedMotion();\n const rootRef = useRef<HTMLDivElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const titleId = useId();\n const closeTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const [status, setStatus] = useState<Status>(\"idle\");\n const [message, setMessage] = useState(\"\");\n\n const open = status !== \"idle\";\n const busy = status === \"sending\";\n\n const clearCloseTimer = useCallback(() => {\n if (closeTimerRef.current === null) return;\n clearTimeout(closeTimerRef.current);\n closeTimerRef.current = null;\n }, []);\n\n const close = useCallback(() => {\n clearCloseTimer();\n setStatus(\"idle\");\n setMessage(\"\");\n }, [clearCloseTimer]);\n\n useEffect(\n () => () => {\n if (closeTimerRef.current !== null) {\n clearTimeout(closeTimerRef.current);\n }\n },\n [],\n );\n\n useEffect(() => {\n if (status !== \"open\") return;\n\n // Match the wallet account switcher's staged interaction: focusing while\n // the surface is still expanding makes the caret and focus state appear\n // inside a scaled panel. Arm the field once the open morph has settled.\n const timer = window.setTimeout(\n () => textareaRef.current?.focus(),\n reduce ? 0 : MORPH_OPEN_DURATION * 1000,\n );\n return () => window.clearTimeout(timer);\n }, [status, reduce]);\n\n // Dismiss on escape or outside click while open (but not mid-send).\n useEffect(() => {\n if (!open) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\" && !busy) close();\n };\n const onPointer = (e: PointerEvent) => {\n if (!busy && rootRef.current && !rootRef.current.contains(e.target as Node)) {\n close();\n }\n };\n window.addEventListener(\"keydown\", onKey);\n window.addEventListener(\"pointerdown\", onPointer);\n return () => {\n window.removeEventListener(\"keydown\", onKey);\n window.removeEventListener(\"pointerdown\", onPointer);\n };\n }, [open, busy, close]);\n\n const scheduleSuccessClose = () => {\n clearCloseTimer();\n closeTimerRef.current = setTimeout(close, SUCCESS_DURATION_MS);\n };\n\n const submit = async () => {\n if (busy || message.trim().length === 0) return;\n setStatus(\"sending\");\n try {\n await onSubmit?.({ message });\n setStatus(\"sent\");\n scheduleSuccessClose();\n } catch {\n // Preserve the message so a rejected submission can be retried.\n setStatus(\"error\");\n }\n };\n\n const left = position === \"bottom-left\";\n const contentOffset = left ? -MORPH_SLIDE : MORPH_SLIDE;\n const surfaceTransition = reduce\n ? { duration: 0 }\n : {\n layout: {\n duration: open ? MORPH_OPEN_DURATION : MORPH_CLOSE_DURATION,\n ease: open ? MORPH_OPEN_EASE : MORPH_CLOSE_EASE,\n },\n borderRadius: {\n duration: open ? MORPH_OPEN_DURATION : MORPH_CLOSE_DURATION,\n ease: open ? MORPH_OPEN_EASE : MORPH_CLOSE_EASE,\n },\n };\n const contentTransition = reduce\n ? { duration: 0 }\n : {\n opacity: {\n duration: MORPH_FADE_DURATION,\n ease: MORPH_CLOSE_EASE,\n },\n x: {\n duration: MORPH_OPEN_DURATION,\n ease: MORPH_CLOSE_EASE,\n },\n scale: {\n duration: MORPH_OPEN_DURATION,\n ease: MORPH_CLOSE_EASE,\n },\n filter: {\n duration: MORPH_FADE_DURATION,\n ease: MORPH_CLOSE_EASE,\n },\n rotate: {\n duration: MORPH_OPEN_DURATION,\n ease: MORPH_CLOSE_EASE,\n },\n };\n const viewInitial = reduce ? { opacity: 0 } : { opacity: 0, y: 8, filter: \"blur(4px)\" };\n const viewAnimate = reduce\n ? {\n opacity: 1,\n transition: { duration: 0.18, ease: EASE_OUT },\n }\n : {\n opacity: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: { duration: 0.24, ease: EASE_OUT },\n };\n const viewExit = reduce\n ? {\n opacity: 0,\n transition: { duration: 0.14, ease: EASE_OUT },\n }\n : {\n opacity: 0,\n y: -8,\n filter: \"blur(4px)\",\n transition: { duration: 0.16, ease: EASE_OUT },\n };\n\n return (\n <div\n ref={rootRef}\n className={cn(\n \"pointer-events-none absolute bottom-4 z-30\",\n left ? \"left-4\" : \"right-4\",\n className,\n )}\n >\n {/* One persistent shell grows out of the corner trigger. The shell and\n its contents use separate timing so the surface leads the reveal. */}\n <motion.div\n layout\n animate={{ borderRadius: open ? 20 : 40 }}\n transition={surfaceTransition}\n style={{ transformOrigin: left ? \"bottom left\" : \"bottom right\" }}\n className={cn(\n \"pointer-events-auto absolute bottom-0 overflow-hidden border border-border bg-background text-foreground shadow-lg\",\n open ? \"w-[min(86vw,320px)] p-2\" : \"h-12 w-12 p-0\",\n left ? \"left-0\" : \"right-0\",\n )}\n >\n <AnimatePresence initial={false} mode=\"popLayout\">\n {open ? (\n <motion.div\n key=\"panel\"\n initial={\n reduce\n ? { opacity: 0 }\n : {\n opacity: 0,\n x: contentOffset,\n scale: MORPH_SCALE,\n filter: MORPH_BLUR,\n }\n }\n animate={{ opacity: 1, x: 0, scale: 1, filter: \"blur(0px)\" }}\n exit={\n reduce\n ? { opacity: 0 }\n : {\n opacity: 0,\n x: contentOffset,\n scale: MORPH_SCALE,\n filter: MORPH_BLUR,\n }\n }\n transition={contentTransition}\n >\n <motion.div layout=\"position\">\n <AnimatePresence mode=\"popLayout\" initial={false} propagate>\n {status === \"sent\" ? (\n <motion.div\n key=\"sent\"\n initial={viewInitial}\n animate={viewAnimate}\n exit={viewExit}\n >\n <div className=\"flex flex-col items-center justify-center gap-1.5 rounded-[20px] bg-border/60 px-4 py-6 text-center\">\n <div className=\"relative mb-1 flex h-12 w-12 items-center justify-center\">\n {reduce\n ? null\n : SPRINKLES.map((s, i) => (\n <motion.span\n key={`${s.x}-${s.y}`}\n initial={{ opacity: 0, scale: 0.4, x: 0, y: 0 }}\n animate={{\n opacity: [0, 1, 0],\n scale: [0, 1, 0.4],\n x: s.x,\n y: s.y,\n }}\n transition={{\n duration: 0.6,\n delay: 0.18 + i * 0.02,\n ease: \"easeOut\",\n }}\n style={{ backgroundColor: s.color }}\n className=\"absolute h-1.5 w-1.5 rounded-full\"\n />\n ))}\n <motion.div\n initial={reduce ? { scale: 1 } : { scale: 0 }}\n animate={{ scale: 1 }}\n transition={{\n type: \"spring\",\n stiffness: 500,\n damping: 22,\n delay: 0.04,\n }}\n className=\"flex h-12 w-12 items-center justify-center rounded-full bg-(--color-success)\"\n >\n <motion.svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n className=\"h-5 w-5 text-white\"\n >\n <motion.path\n d=\"M5 12.5l4.5 4.5L19 7.5\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n initial={reduce ? { pathLength: 1 } : { pathLength: 0 }}\n animate={{ pathLength: 1 }}\n transition={{\n duration: 0.35,\n ease: \"easeOut\",\n delay: 0.15,\n }}\n />\n </motion.svg>\n </motion.div>\n </div>\n <h3 className=\"font-semibold text-foreground text-sm\">Thanks!</h3>\n <p className=\"text-muted-foreground text-xs leading-relaxed\">\n Your feedback helps us build something better.\n </p>\n </div>\n </motion.div>\n ) : status === \"error\" ? (\n <motion.div\n key=\"error\"\n initial={viewInitial}\n animate={viewAnimate}\n exit={viewExit}\n >\n <div\n role=\"alert\"\n className=\"rounded-[20px] bg-border/60 px-4 py-5 text-center\"\n >\n <div className=\"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10 text-destructive\">\n <AlertCircle className=\"h-5 w-5\" />\n </div>\n <h3 className=\"mt-3 font-semibold text-foreground text-sm\">\n Something went wrong\n </h3>\n <p className=\"mt-1 text-muted-foreground text-xs leading-relaxed\">\n We couldn&apos;t send your feedback. Please try again.\n </p>\n <Button size=\"sm\" onClick={submit} className=\"mt-4\">\n Try again\n </Button>\n </div>\n </motion.div>\n ) : (\n <motion.div\n key=\"form\"\n initial={viewInitial}\n animate={viewAnimate}\n exit={viewExit}\n >\n <div className=\"min-h-[150px] rounded-[20px] bg-border/60 px-4 py-3.5\">\n <div className=\"flex items-start justify-between gap-3\">\n <h3 id={titleId} className=\"font-semibold text-foreground text-sm\">\n {title}\n </h3>\n <button\n type=\"button\"\n onClick={close}\n aria-label=\"Close\"\n className=\"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-foreground/[0.07] text-muted-foreground transition-colors hover:text-foreground\"\n >\n <X className=\"h-3 w-3\" />\n </button>\n </div>\n <textarea\n ref={textareaRef}\n aria-labelledby={titleId}\n value={message}\n onChange={(e) => setMessage(e.target.value)}\n placeholder={placeholder}\n disabled={busy}\n rows={3}\n className=\"mt-2 w-full resize-none bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground/60 md:text-sm\"\n />\n </div>\n\n <div className=\"flex items-center gap-2 px-1 pt-2 pb-1\">\n <Button\n variant=\"secondary\"\n size=\"md\"\n onClick={close}\n disabled={busy}\n className=\"flex-1 bg-border text-muted-foreground hover:text-foreground\"\n >\n Cancel\n </Button>\n <StatefulButton\n state={busy ? \"loading\" : \"idle\"}\n loadingText=\"Sending\"\n size=\"md\"\n onClick={submit}\n disabled={busy || message.trim().length === 0}\n className=\"flex-1 bg-foreground text-background hover:bg-foreground/90\"\n >\n Submit\n </StatefulButton>\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n </motion.div>\n </motion.div>\n ) : (\n <motion.button\n key=\"trigger\"\n type=\"button\"\n initial={\n reduce\n ? { opacity: 0 }\n : {\n opacity: 0,\n x: -contentOffset,\n filter: MORPH_BLUR,\n }\n }\n animate={{ opacity: 1, x: 0, filter: \"blur(0px)\" }}\n exit={\n reduce\n ? { opacity: 0 }\n : {\n opacity: 0,\n x: -contentOffset,\n filter: MORPH_BLUR,\n }\n }\n transition={contentTransition}\n onClick={() => {\n clearCloseTimer();\n setStatus(\"open\");\n }}\n aria-label={title}\n aria-haspopup=\"dialog\"\n whileTap={reduce ? undefined : { scale: 0.92 }}\n className={cn(\n \"absolute bottom-0 flex h-12 w-12 items-center justify-center bg-transparent text-foreground\",\n left ? \"left-0\" : \"right-0\",\n )}\n >\n <motion.span\n initial={reduce ? false : { rotate: 45, scale: MORPH_SCALE }}\n animate={{ rotate: 0, scale: 1 }}\n exit={{ rotate: 45, scale: MORPH_SCALE }}\n transition={contentTransition}\n className=\"grid h-5 w-5 shrink-0 place-items-center [&>svg]:h-full [&>svg]:w-full\"\n >\n {icon ?? <MessageSquare className=\"h-5 w-5\" />}\n </motion.span>\n </motion.button>\n )}\n </AnimatePresence>\n </motion.div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,sBAAsB;AAI5B,MAAM,kBAAkB;CAAC;CAAM;CAAM;CAAM;AAAC;AAC5C,MAAM,mBAAmB;CAAC;CAAM;CAAG;CAAM;AAAC;AAC1C,MAAM,sBAAsB;AAC5B,MAAM,uBAAuB;AAC7B,MAAM,sBAAsB;AAC5B,MAAM,cAAc;AACpB,MAAM,cAAc;AAC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,SACI,EAAE,SAAS,EAAE,IACb;MACE,SAAS;MACT,GAAG,CAAC;MACJ,QAAQ;KACV;KAEN,SAAS;MAAE,SAAS;MAAG,GAAG;MAAG,QAAQ;KAAY;KACjD,MACE,SACI,EAAE,SAAS,EAAE,IACb;MACE,SAAS;MACT,GAAG,CAAC;MACJ,QAAQ;KACV;KAEN,YAAY;KACZ,eAAe;MACb,gBAAgB;MAChB,UAAU,MAAM;KAClB;KACA,cAAY;KACZ,iBAAc;KACd,UAAU,SAAS,KAAA,IAAY,EAAE,OAAO,IAAK;KAC7C,WAAW,GACT,+FACA,OAAO,WAAW,SACpB;KAEA,UAAA,oBAAC,OAAO,MAAR;MACE,SAAS,SAAS,QAAQ;OAAE,QAAQ;OAAI,OAAO;MAAY;MAC3D,SAAS;OAAE,QAAQ;OAAG,OAAO;MAAE;MAC/B,MAAM;OAAE,QAAQ;OAAI,OAAO;MAAY;MACvC,YAAY;MACZ,WAAU;MAET,UAAA,QAAQ,oBAAC,eAAD,EAAe,WAAU,UAAW,CAAA;KAClC,CAAA;IACA,GA3CT,SA2CS;GAEF,CAAA;EACP,CAAA;CACT,CAAA;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"knockout-wheel.d.ts","names":[],"sources":["../../../src/components/motion/knockout-wheel.tsx"],"mappings":";YAcY;EACV;;;;;;;EAOA;;EAEA;;YAGU;EACV,MAAM;EACN;;EAEA;;;;YAKU;EACV;EACA,MAAM;EACN,MAAM;EACN;;YAGU;;EAEV;EACA,SAAS;;iBAGM;;;;;;;;EAQf,QAAQ;;;;;;EAMR;EACA;;wBAgec,gBAAgB,QAAQ,cAAkB,aAAa,qCAAkB,IAAA;qBAuR5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAmCA,QAAQ"}
1
+ {"version":3,"file":"knockout-wheel.d.ts","names":[],"sources":["../../../src/components/motion/knockout-wheel.tsx"],"mappings":";YAcY;EACV;;;;;;;EAOA;;EAEA;;YAGU;EACV,MAAM;EACN;;EAEA;;;;YAKU;EACV;EACA,MAAM;EACN,MAAM;EACN;;YAGU;;EAEV;EACA,SAAS;;iBAGM;;;;;;;;EAQf,QAAQ;;;;;;EAMR;EACA;;wBA+dc,gBAAgB,QAAQ,cAAkB,aAAa,qCAAkB,IAAA;qBAuR5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAmCA,QAAQ"}
@@ -4,7 +4,7 @@ import { useHoverCapable } from "../../hooks/use-hover-capable.js";
4
4
  import { useHoverGesture } from "../../hooks/use-hover-gesture.js";
5
5
  import { useTapGesture } from "../../hooks/use-tap-gesture.js";
6
6
  import { SPRING_PANEL } from "../../lib/ease.js";
7
- import { Tooltip } from "./tooltip.js";
7
+ import { t as Tooltip } from "../../tooltip-Bam5KeYe.js";
8
8
  import { memo, useCallback, useId, useMemo, useRef, useState } from "react";
9
9
  import { cn } from "@kumix/utils";
10
10
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -310,7 +310,6 @@ const WheelAnchor = memo(function WheelAnchor({ node, caption, isTabStop, isPinn
310
310
  children: canHover ? /* @__PURE__ */ jsx(Tooltip, {
311
311
  content: caption,
312
312
  side: "top",
313
- wrapperClassName: "block h-full w-full",
314
313
  className: "wrap-break-word max-w-[20rem] whitespace-normal text-balance text-center",
315
314
  children: trigger
316
315
  }) : trigger
@@ -1 +1 @@
1
- {"version":3,"file":"knockout-wheel.js","names":[],"sources":["../../../src/components/motion/knockout-wheel.tsx"],"sourcesContent":["\"use client\";\n\nimport { type KeyboardEvent, memo, useCallback, useId, useMemo, useRef, useState } from \"react\";\nimport { Shield } from \"lucide-react\";\nimport { motion, useInView, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useDismiss } from \"../../hooks/use-dismiss\";\nimport { useHoverCapable } from \"../../hooks/use-hover-capable\";\nimport { useHoverGesture } from \"../../hooks/use-hover-gesture\";\nimport { useTapGesture } from \"../../hooks/use-tap-gesture\";\nimport { SPRING_PANEL } from \"../../lib/ease\";\nimport { Tooltip } from \"./tooltip\";\n\nexport type Team = {\n name: string;\n /**\n * Any square image URL — club crest, org mark, player photo. Wins over `code`.\n * Drawn as-is on the node's card-colored disc, so a transparent-background\n * mark inked for one theme disappears in the other: ship artwork that reads on\n * both, or pick the URL yourself from your theme state.\n */\n logo?: string;\n /** ISO 3166-1 alpha-2 code, loaded from flagcdn.com (England is gb-eng). Used when `logo` is absent. */\n code?: string;\n};\n\nexport type MatchSide = {\n team: Team | null;\n score: number | null;\n /** Present on both sides to render shootout scores — 1 (3). */\n penalties?: number | null;\n};\n\n/** Structurally compatible with the knockout bracket's Match, minus the fields\n * the wheel never draws (date, time, status). */\nexport type Match = {\n id: string;\n home: MatchSide;\n away: MatchSide;\n winner?: \"home\" | \"away\";\n};\n\nexport type Round = {\n /** Read out with the match in tooltips and the screen-reader list. */\n name: string;\n matches: Match[];\n};\n\nexport interface KnockoutWheelProps {\n /**\n * The whole draw, ordered widest round first — the same array the knockout\n * bracket takes. Any single-elimination tournament fits: each round holds half\n * the matches of the one before it (16 → 8 → 4 → 2 → 1) and `rounds[r].matches[k]`\n * is fed by matches `2k` and `2k + 1` of the round before it. Two rounds are\n * enough; the wheel grows a ring per round and sizes itself to the rim.\n */\n rounds: Round[];\n /**\n * Index of the outermost round to draw. Earlier rounds are dropped and the\n * kept round's own teams become the rim, so `1` on a 32-team draw opens at the\n * Round of 16. Defaults to 0 (the whole tree); clamped to the valid range.\n */\n initialRound?: number;\n className?: string;\n}\n\nconst SIZE = 760;\nconst CENTER = SIZE / 2;\n// Solid trophy glyph drawn in a 24-unit box.\nconst TROPHY_SIZE = 24;\nconst TROPHY_PATH =\n \"M5 1h12v3h3a2 2 0 0 1 2 2c0 3.3-2.2 5.6-5.2 6A6 6 0 0 1 12 15a6 6 0 0 1-4.8-2.9C4.2 11.6 2 9.3 2 6a2 2 0 0 1 2-2h1V1Zm0 5H4c0 1.9 1.1 3.2 2.6 3.7A12 12 0 0 1 5 6Zm14 0h-1a12 12 0 0 1-1.6 3.7C17.9 9.2 19 7.9 19 6ZM9 16.5h6V19h2.5v2h-11v-2H9v-2.5Z\";\n// Clears the hub's top edge. The hub's two feeders sit on the horizontal, so\n// the space directly above it is always free.\nconst TROPHY_GAP = 6;\n// Outermost ring. The remaining 62px of the box absorbs the largest node plus\n// its ring stroke, so nothing clips at the viewBox edge.\nconst OUTER_R = 318;\nconst HUB_R = 34;\n// Nodes grow outward so the crowded outer ring still reads at small sizes.\nconst NODE_MIN = 14.2;\nconst NODE_STEP = 2.2;\n// Initials floor, in viewBox units. The stage never goes below 32rem against a\n// 760-unit box (scale ~0.674), so 15 units is ~10px on screen — under that, two\n// letters are a smudge. `node.r * 0.8` alone puts the inner ring at 7.6px.\nconst INITIALS_MIN = 15;\n// Siblings pull slightly toward their parent, opening a lane between subtrees.\nconst SIBLING_GAP = 0.9;\n// Puts the hub's two feeders on the horizontal, where there's room for them.\nconst HUB_ANGLE = 90;\n\n// Module scope so the memoized marks keep a stable transition identity.\nconst DIM_TRANSITION = { duration: 0.18 } as const;\nconst NO_TRANSITION = { duration: 0 } as const;\n\n// Math.sin/cos are implementation-defined down in the last digits, so the SSR\n// engine and the browser disagree and React reports a hydration mismatch on\n// every coordinate. Quantizing well below sub-pixel makes both agree exactly.\nconst quantize = (n: number) => Math.round(n * 1e3) / 1e3;\n\nconst polar = (radius: number, deg: number) => {\n const rad = (deg * Math.PI) / 180;\n return {\n x: quantize(CENTER + radius * Math.cos(rad)),\n y: quantize(CENTER + radius * Math.sin(rad)),\n };\n};\n\nconst point = (radius: number, deg: number) => {\n const { x, y } = polar(radius, deg);\n return `${x.toFixed(2)} ${y.toFixed(2)}`;\n};\n\n// Fixed precision so the server and client render byte-identical style strings.\n// Raw floats serialize differently across the two and trip a hydration mismatch.\nconst pct = (value: number) => `${((value / SIZE) * 100).toFixed(4)}%`;\n\ntype WheelNode = {\n id: string;\n parentId: string | null;\n depth: number;\n /** Position around the wheel, in degrees. Orders arrow-key navigation. */\n angle: number;\n x: number;\n y: number;\n r: number;\n team: Team | null;\n label: string;\n /** Round the node's match belongs to; null on the rim, which holds teams. */\n round: string | null;\n};\n\ntype WheelLink = {\n id: string;\n d: string;\n depth: number;\n};\n\n// Names and round labels are single ideas, so they wrap as a unit. Without this\n// \"Round of 16\" strands a lone \"16\" on the next line.\nconst keepTogether = (text: string) => text.replace(/ /g, \" \");\n\nconst teamName = (side: MatchSide) => keepTogether(side.team?.name ?? \"TBD\");\n\n/** A `logo` is used as given; a country `code` loads a flag from flagcdn.com. */\nconst crestSrc = (team: Team) =>\n team.logo ?? (team.code ? `https://flagcdn.com/w80/${team.code}.png` : null);\n\n/** Two-letter stand-in when a team has no artwork — \"Real Madrid\" → RM.\n * Spread, not `word[0]`: an emoji or astral first character is a surrogate pair\n * and indexing it renders a replacement glyph. */\nconst initials = (name: string) =>\n name\n .split(/\\s+/)\n .slice(0, 2)\n .map((word) => [...word][0])\n .join(\"\")\n .toUpperCase();\n\n/** Teams · score, in the order they were played. The round is prepended by the\n * caller that has it, so the round list can reuse this without repeating it. */\nfunction matchLabel(match: Match) {\n const teams = `${teamName(match.home)} v ${teamName(match.away)}`;\n if (match.home.score == null || match.away.score == null) return teams;\n const pens =\n match.home.penalties != null && match.away.penalties != null\n ? ` (${match.home.penalties}–${match.away.penalties} pens)`\n : \"\";\n return `${teams} · ${match.home.score}–${match.away.score}${pens}`;\n}\n\n/** Walks the match tree from the final outward, laying every node on a ring and\n * splitting each parent's wedge between its two feeders. */\nfunction buildWheel(rounds: Round[]) {\n const nodes: WheelNode[] = [];\n const links: WheelLink[] = [];\n const layers = rounds.length;\n const ringR = (depth: number) => (depth / layers) * OUTER_R;\n const nodeR = (depth: number) => NODE_MIN + (depth - 1) * NODE_STEP;\n\n // An empty or malformed catalog renders nothing rather than throwing on the\n // way to the hub.\n const final = rounds[layers - 1]?.matches[0];\n if (!final) return { nodes, links, champion: null };\n\n const champion = final.winner ? final[final.winner].team : null;\n nodes.push({\n id: final.id,\n parentId: null,\n depth: 0,\n angle: HUB_ANGLE,\n x: CENTER,\n y: CENTER,\n r: HUB_R,\n team: champion,\n label: matchLabel(final),\n round: rounds[layers - 1].name,\n });\n\n // `roundIndex` is the round `match` belongs to; its two feeders live one round\n // out, or, past the first round, are the two teams that played it.\n const walk = (\n match: Match,\n roundIndex: number,\n index: number,\n parent: WheelNode,\n angle: number,\n wedge: number,\n ) => {\n const depth = parent.depth + 1;\n const radius = ringR(depth);\n const r = nodeR(depth);\n // The hub's two feeders sit opposite each other, so they get plain radial\n // lines; an arc between them would be a half circle.\n const offset = (wedge / 4) * (parent.depth === 0 ? 1 : SIBLING_GAP);\n const angles = [angle - offset, angle + offset];\n const sides = [\"home\", \"away\"] as const;\n\n const children = angles.map((childAngle, side) => {\n const { x, y } = polar(radius, childAngle);\n const feeder = roundIndex > 0 ? rounds[roundIndex - 1].matches[2 * index + side] : undefined;\n const node: WheelNode = feeder\n ? {\n id: feeder.id,\n parentId: parent.id,\n depth,\n angle: childAngle,\n x,\n y,\n r,\n team: feeder.winner ? feeder[feeder.winner].team : null,\n label: matchLabel(feeder),\n round: rounds[roundIndex - 1].name,\n }\n : {\n id: `${match.id}-${sides[side]}`,\n parentId: parent.id,\n depth,\n angle: childAngle,\n x,\n y,\n r,\n team: match[sides[side]].team,\n label: match[sides[side]].team?.name ?? \"TBD\",\n round: null,\n };\n nodes.push(node);\n return { node, angle: childAngle, feeder };\n });\n\n if (parent.depth === 0) {\n for (const child of children) {\n links.push({\n id: `${parent.id}-${child.node.id}`,\n d: `M ${point(radius, child.angle)} L ${CENTER} ${CENTER}`,\n depth,\n });\n }\n } else {\n const midR = (ringR(parent.depth) + radius) / 2;\n links.push({\n id: `${parent.id}-arc`,\n d: `M ${point(radius, angles[0])} L ${point(midR, angles[0])} A ${midR} ${midR} 0 0 1 ${point(midR, angles[1])} L ${point(radius, angles[1])}`,\n depth,\n });\n links.push({\n id: `${parent.id}-stem`,\n d: `M ${point(midR, angle)} L ${point(ringR(parent.depth), angle)}`,\n depth,\n });\n }\n\n for (const [side, child] of children.entries()) {\n if (child.feeder) {\n walk(child.feeder, roundIndex - 1, 2 * index + side, child.node, child.angle, wedge / 2);\n }\n }\n };\n\n walk(final, layers - 1, 0, nodes[0], HUB_ANGLE, 360);\n return { nodes, links, champion };\n}\n\n/** Match ids from the hub down to the champion's first-round win. */\nfunction championPath(rounds: Round[]) {\n const path = new Set<string>();\n let index = 0;\n for (let r = rounds.length - 1; r >= 0; r--) {\n const match = rounds[r].matches[index];\n if (!match?.winner) return path;\n path.add(match.id);\n if (r === 0) path.add(`${match.id}-${match.winner}`);\n index = 2 * index + (match.winner === \"home\" ? 0 : 1);\n }\n return path;\n}\n\nfunction TeamMark({\n node,\n clipId,\n lit,\n dimmed,\n loadFlag,\n transition,\n}: {\n node: WheelNode;\n clipId: string;\n lit: boolean;\n dimmed: boolean;\n loadFlag: boolean;\n transition: object;\n}) {\n // The failed URL, not a boolean: a corrected logo on the same node should be\n // tried again rather than stay initials for the life of the wheel.\n const [failedSrc, setFailedSrc] = useState<string | null>(null);\n const resolved = node.team ? crestSrc(node.team) : null;\n const src = resolved === failedSrc ? null : resolved;\n const showFlag = src != null && loadFlag;\n // A square logo is fitted whole; a 4:3 flag is cropped to fill the disc.\n const box = node.team?.logo\n ? { w: node.r * 1.44, h: node.r * 1.44, fit: \"xMidYMid meet\" }\n : { w: node.r * 2.68, h: node.r * 2, fit: \"xMidYMid slice\" };\n // Dimming rides on the mark itself rather than a scrim tinted with the page\n // background, so the wheel recedes correctly on any surface it's dropped on.\n const fade = { opacity: dimmed ? 0.38 : 1 };\n\n return (\n <>\n {/* Stays opaque at every state: links are routed underneath and would\n otherwise read straight through the flag. */}\n <circle cx={node.x} cy={node.y} r={node.r} className=\"fill-card\" />\n {showFlag && node.team ? (\n <>\n <clipPath id={clipId}>\n <circle cx={node.x} cy={node.y} r={node.r} />\n </clipPath>\n {/* Plain <image> — flags from flagcdn.com, logos from wherever you host\n them. A 4:3 flag is cropped to fill the disc; a logo is fitted whole\n inside it, since a crest cropped to a circle loses its shape. */}\n <motion.image\n href={src}\n x={node.x - box.w / 2}\n y={node.y - box.h / 2}\n width={box.w}\n height={box.h}\n clipPath={`url(#${clipId})`}\n preserveAspectRatio={box.fit}\n initial={false}\n animate={fade}\n transition={transition}\n onError={() => setFailedSrc(src)}\n />\n </>\n ) : node.team ? (\n // No artwork on this team — initials keep the ring readable.\n <motion.text\n x={node.x}\n y={node.y}\n textAnchor=\"middle\"\n dominantBaseline=\"central\"\n fontSize={Math.max(node.r * 0.8, INITIALS_MIN)}\n initial={false}\n animate={fade}\n transition={transition}\n className=\"fill-muted-foreground font-semibold\"\n >\n {initials(node.team.name)}\n </motion.text>\n ) : (\n // Same shield the knockout bracket uses for a TBD slot, so an\n // undecided place reads identically across both fixture styles.\n <motion.g initial={false} animate={fade} transition={transition}>\n <Shield\n x={node.x - node.r * 0.7}\n y={node.y - node.r * 0.7}\n width={node.r * 1.4}\n height={node.r * 1.4}\n className=\"fill-current text-muted-foreground/50\"\n />\n </motion.g>\n )}\n <circle\n cx={node.x}\n cy={node.y}\n r={node.r}\n fill=\"none\"\n strokeWidth={lit ? 2 : 1}\n className={lit ? \"stroke-foreground\" : \"stroke-border\"}\n />\n </>\n );\n}\n\n/** Memoized so pointing at one flag re-renders two marks, not all 63. */\nconst WheelMark = memo(function WheelMark({\n node,\n isLit,\n dimmed,\n loadFlag,\n reduce,\n enter,\n showTrophy,\n clipId,\n}: {\n node: WheelNode;\n isLit: boolean;\n dimmed: boolean;\n loadFlag: boolean;\n reduce: boolean;\n enter: object;\n showTrophy: boolean;\n clipId: string;\n}) {\n return (\n <motion.g\n initial={reduce ? false : { opacity: 0, scale: 0.6 }}\n animate={{ opacity: 1, scale: 1 }}\n transition={enter}\n style={{ transformOrigin: `${node.x}px ${node.y}px` }}\n >\n {showTrophy && (\n <g\n transform={`translate(${CENTER - TROPHY_SIZE / 2}, ${CENTER - HUB_R - TROPHY_GAP - TROPHY_SIZE})`}\n >\n <path d={TROPHY_PATH} className=\"fill-warning\" />\n </g>\n )}\n <TeamMark\n node={node}\n clipId={clipId}\n lit={isLit}\n dimmed={dimmed}\n loadFlag={loadFlag}\n transition={reduce ? NO_TRANSITION : DIM_TRANSITION}\n />\n </motion.g>\n );\n});\n\n/** Invisible hit area over one flag: hover, tap, focus and arrow keys. */\nconst WheelAnchor = memo(function WheelAnchor({\n node,\n caption,\n isTabStop,\n isPinned,\n canHover,\n uid,\n onHover,\n onFocusNode,\n onToggle,\n onKey,\n}: {\n node: WheelNode;\n caption: string;\n isTabStop: boolean;\n isPinned: boolean;\n canHover: boolean;\n uid: string;\n onHover: (id: string | null) => void;\n onFocusNode: (id: string | null) => void;\n onToggle: (id: string) => void;\n onKey: (node: WheelNode, key: string) => void;\n}) {\n const size = pct(node.r * 2);\n // Capture-phase focus props, so a Tooltip cloning the child cannot overwrite\n // them. Both interaction paths are always attached: iPadOS answers the hover\n // query with true for a finger, so hanging the tap path off \"cannot hover\"\n // left it unreachable on the very device it was written for. The event says\n // which input arrived.\n const tap = useTapGesture<boolean>();\n const hover = useHoverGesture();\n const trigger = (\n <button\n type=\"button\"\n id={`${uid}-${node.id}`}\n tabIndex={isTabStop ? 0 : -1}\n aria-label={caption}\n onKeyDown={(event: KeyboardEvent) => {\n // A key press starts a keyboard activation, which never had a pointer\n // behind it: a gesture the platform took away must not be read as the\n // tap behind the click this press synthesizes.\n tap.drop();\n if (!event.key.startsWith(\"Arrow\")) return;\n // Arrows drive the wheel here, so they must not also scroll the page.\n event.preventDefault();\n onKey(node, event.key);\n }}\n onFocusCapture={() => onFocusNode(node.id)}\n onBlurCapture={() => onFocusNode(null)}\n onPointerEnter={(event) => {\n if (hover.enter(event)) onHover(node.id);\n }}\n onPointerLeave={(event) => {\n if (hover.leave(event)) onHover(null);\n }}\n onPointerDown={(event) => {\n tap.start(event, isPinned);\n }}\n onPointerCancel={tap.drop}\n // Click, not pointerdown: a tap focuses the button first, and unpinning\n // has to also drop that focus or the flag stays lit.\n onClick={(event) => {\n const gesture = tap.take();\n // A hovering pointer lit the flag on its way in and puts it out on the\n // way past; only a gesture without a hover pins one.\n if (!gesture || gesture.pointerType === \"mouse\") return;\n onToggle(node.id);\n if (gesture.state) event.currentTarget.blur();\n }}\n // ring-foreground, not the ring token: --ring is a 10% white hairline\n // that disappears over a flag. Focus has to be obvious.\n className=\"block h-full w-full rounded-full outline-none focus-visible:ring-2 focus-visible:ring-foreground focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n />\n );\n\n return (\n <div\n className=\"absolute\"\n style={{\n left: pct(node.x - node.r),\n top: pct(node.y - node.r),\n width: size,\n height: size,\n }}\n >\n {/* Touch never opens a Tooltip, so those devices skip mounting one per\n flag and read the tapped label instead. */}\n {canHover ? (\n <Tooltip\n content={caption}\n side=\"top\"\n wrapperClassName=\"block h-full w-full\"\n className=\"wrap-break-word max-w-[20rem] whitespace-normal text-balance text-center\"\n >\n {trigger}\n </Tooltip>\n ) : (\n trigger\n )}\n </div>\n );\n});\n\nexport function KnockoutWheel({ rounds, initialRound = 0, className }: KnockoutWheelProps) {\n const reduce = useReducedMotion();\n const canHover = useHoverCapable();\n const uid = useId().replace(/:/g, \"\");\n const ref = useRef<SVGSVGElement>(null);\n const stageRef = useRef<HTMLDivElement>(null);\n // 63 flags for a 32-team draw, and SVG <image> has no lazy attribute — so the\n // requests wait until the wheel is nearly on screen.\n const inView = useInView(ref, { once: true, margin: \"300px\" });\n // Hover, tap and focus are tracked apart. Sharing one slot let a stray mouse\n // move clear the isolation while a node still held focus, and a tap has to\n // outlive the pointerleave that a finger fires the moment it lifts.\n const [hovered, setHovered] = useState<string | null>(null);\n const [pinned, setPinned] = useState<string | null>(null);\n const [focused, setFocused] = useState<string | null>(null);\n const active = hovered ?? pinned ?? focused;\n\n // Everything downstream reads the trimmed catalog, so the kept round's own\n // teams become the rim and the sr-only list matches what's drawn.\n const visible = useMemo(() => {\n const from = Math.min(Math.max(initialRound, 0), Math.max(rounds.length - 1, 0));\n return from > 0 ? rounds.slice(from) : rounds;\n }, [rounds, initialRound]);\n\n const { nodes, links, champion } = useMemo(() => buildWheel(visible), [visible]);\n const winners = useMemo(() => championPath(visible), [visible]);\n const activeNode = useMemo(() => nodes.find((node) => node.id === active), [active, nodes]);\n // Pointing at one flag isolates that flag. Only at rest does the wheel fall\n // back to lighting the champion's whole run.\n const lit = useMemo(\n () => (activeNode ? new Set([activeNode.id]) : winners),\n [activeNode, winners],\n );\n\n // Stable identity, or every mark re-renders on each pointer move.\n const enter = useMemo(\n () =>\n reduce\n ? { duration: 0, opacity: { duration: 0 } }\n : { ...SPRING_PANEL, opacity: { duration: 0.24 } },\n [reduce],\n );\n\n // One transition object per ring, cached, so the ring-by-ring entrance delay\n // survives memoization instead of allocating 63 objects per render.\n const enterFor = useMemo(() => {\n const cache = new Map<number, object>();\n return (depth: number) => {\n const hit = cache.get(depth);\n if (hit) return hit;\n const value = { ...enter, delay: reduce ? 0 : depth * 0.06 };\n cache.set(depth, value);\n return value;\n };\n }, [enter, reduce]);\n\n // Tooltip is hover-only by design, so touch gets the same label anchored to\n // the tapped flag. It flips to the far side near the rim so it stays on stage.\n const tapped = canHover ? undefined : activeNode;\n const tapAbove = tapped ? tapped.y > CENTER : false;\n\n // Arrow keys follow the geometry: up walks toward the hub, down walks out to\n // a feeder, left/right go round the ring.\n const { ring, firstChild } = useMemo(() => {\n const byDepth = new Map<number, WheelNode[]>();\n const child = new Map<string, WheelNode>();\n for (const node of nodes) {\n const peers = byDepth.get(node.depth) ?? [];\n peers.push(node);\n byDepth.set(node.depth, peers);\n if (node.parentId && !child.has(node.parentId)) {\n child.set(node.parentId, node);\n }\n }\n for (const peers of byDepth.values()) {\n peers.sort((a, b) => a.angle - b.angle);\n }\n return { ring: byDepth, firstChild: child };\n }, [nodes]);\n\n const tabStop = activeNode?.id ?? nodes[0]?.id;\n\n // Stable callbacks so the memoized anchors don't re-render on every hover.\n const onKey = useCallback(\n (node: WheelNode, key: string) => {\n if (!key.startsWith(\"Arrow\")) return;\n const target =\n key === \"ArrowUp\"\n ? nodes.find((peer) => peer.id === node.parentId)\n : key === \"ArrowDown\"\n ? firstChild.get(node.id)\n : (() => {\n const peers = ring.get(node.depth) ?? [];\n if (peers.length < 2) return undefined;\n const at = peers.indexOf(node);\n const next = key === \"ArrowRight\" ? at + 1 : at - 1;\n return peers[(next + peers.length) % peers.length];\n })();\n if (!target) return;\n // Focus moves; the focus handler lights the node it lands on.\n document.getElementById(`${uid}-${target.id}`)?.focus();\n },\n [nodes, ring, firstChild, uid],\n );\n\n const onToggle = useCallback(\n (id: string) => setPinned((current) => (current === id ? null : id)),\n [],\n );\n\n // A tap on another flag hands the isolation over rather than ending it.\n const onFlag = useCallback(\n (target: Element) => Boolean(stageRef.current?.contains(target) && target.closest(\"button\")),\n [],\n );\n\n // A finger never leaves the flag it lit, so the isolation would hold for good\n // — and bare stage reports no pointer event of its own to end it. The next\n // pointerdown that isn't on a flag stands in for the pointer leaving; it is\n // consumed, since a wheel spanning the viewport makes tapping past it the\n // natural way out and there is no reason for that tap to do anything else.\n // Only a pinned flag arms this: a mouse ends its own hover, and the browser\n // drops focus on its own.\n const unpin = useCallback(() => {\n setPinned(null);\n const focus = document.activeElement;\n if (focus instanceof HTMLElement && stageRef.current?.contains(focus)) {\n focus.blur();\n }\n }, []);\n\n useDismiss(pinned !== null, unpin, null, {\n behavior: \"consume\",\n ignore: onFlag,\n });\n\n // Round · teams · score for a decided match; a rim node is just a team. A slot\n // whose team isn't known yet reads TBD, matching the shield drawn in its place.\n const captions = useMemo(\n () =>\n new Map(\n nodes.map((node) => [\n node.id,\n node.team == null\n ? \"TBD\"\n : node.round\n ? `${keepTogether(node.round)} · ${node.label}`\n : node.team.name,\n ]),\n ),\n [nodes],\n );\n\n return (\n <div className={cn(\"w-full max-w-full overflow-x-auto overscroll-x-contain\", className)}>\n {/* Below the min width the rim's marks collapse too small to tell apart or\n tap, so the wheel holds its size and pans instead. The floor is fixed,\n not rim-derived: node radius grows with depth, so a shallower draw has\n *smaller* marks and needs the width more, not less. */}\n <div ref={stageRef} className=\"relative mx-auto w-full min-w-[32rem] max-w-[34rem]\">\n <svg\n ref={ref}\n viewBox={`0 0 ${SIZE} ${SIZE}`}\n role=\"img\"\n aria-label={`Tournament wheel${champion ? `, won by ${champion.name}` : \"\"}`}\n className=\"h-auto w-full touch-manipulation\"\n >\n <defs>\n {/* Warm halo marking the champion. Kept faint: --warning is saturated\n enough that anything stronger drowns the connectors under it. */}\n <radialGradient id={`${uid}-glow`}>\n <stop offset=\"0%\" stopColor=\"var(--color-warning)\" stopOpacity=\"0.14\" />\n <stop offset=\"45%\" stopColor=\"var(--color-warning)\" stopOpacity=\"0.04\" />\n <stop offset=\"100%\" stopColor=\"var(--color-warning)\" stopOpacity=\"0\" />\n </radialGradient>\n </defs>\n\n {champion && (\n <circle cx={CENTER} cy={CENTER} r={OUTER_R * 0.62} fill={`url(#${uid}-glow)`} />\n )}\n\n {/* role=\"img\" on the svg prunes descendants from the accessibility tree,\n so the structure needs no aria-hidden of its own. */}\n <g>\n {links.map((link) => (\n <motion.path\n key={link.id}\n d={link.d}\n fill=\"none\"\n initial={reduce ? false : { opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.3, delay: link.depth * 0.06 }}\n className=\"stroke-border-strong\"\n />\n ))}\n </g>\n\n {nodes.map((node) => (\n <WheelMark\n key={node.id}\n node={node}\n isLit={lit.has(node.id)}\n dimmed={lit.size > 0 && !lit.has(node.id)}\n loadFlag={inView}\n reduce={Boolean(reduce)}\n enter={enterFor(node.depth)}\n showTrophy={node.depth === 0 && champion != null}\n clipId={`${uid}-clip-${node.id}`}\n />\n ))}\n </svg>\n\n {/* An SVG <g> can't anchor a Tooltip, so each flag gets an invisible\n HTML hit area laid over it in percentage units, which track the\n wheel as it scales. */}\n {nodes.map((node) => (\n <WheelAnchor\n key={node.id}\n node={node}\n caption={captions.get(node.id) ?? \"\"}\n isTabStop={node.id === tabStop}\n isPinned={node.id === pinned}\n canHover={canHover}\n uid={uid}\n onHover={setHovered}\n onFocusNode={setFocused}\n onToggle={onToggle}\n onKey={onKey}\n />\n ))}\n\n {tapped && (\n <motion.p\n initial={reduce ? false : { opacity: 0, scale: 0.94 }}\n animate={{ opacity: 1, scale: 1 }}\n transition={reduce ? NO_TRANSITION : DIM_TRANSITION}\n style={{\n left: pct(tapped.x),\n top: pct(tapped.y + (tapAbove ? -tapped.r : tapped.r)),\n }}\n className={cn(\n \"wrap-break-word pointer-events-none absolute z-10 w-max max-w-[min(18rem,80vw)] -translate-x-1/2 text-balance rounded-lg border border-border bg-background px-2.5 py-1 text-center font-medium text-foreground text-xs shadow-lg\",\n tapAbove ? \"-translate-y-[calc(100%+8px)]\" : \"translate-y-2\",\n )}\n >\n {captions.get(tapped.id)}\n </motion.p>\n )}\n </div>\n\n {/* role=\"img\" prunes the svg's descendants, so every result is restated\n here for screen readers. */}\n {/* Named lists, not <section aria-label> — a named section is a landmark,\n and five of those would crowd real page landmarks. */}\n <div className=\"sr-only\">\n {visible\n .slice()\n .reverse()\n .map((round) => (\n <ul key={round.name} aria-label={round.name}>\n {round.matches.map((match) => (\n <li key={match.id}>{matchLabel(match)}</li>\n ))}\n </ul>\n ))}\n </div>\n </div>\n );\n}\n\n// ── Sample data ──────────────────────────────────────────────────────────────\n// A finished 32-team cup, here to demo the shape. Swap it for your own\n// tournament. Rounds run widest first and each holds half as many matches as the\n// one before it (16 → 8 → 4 → 2 → 1); `matches[k]` of a round is fed by matches\n// `2k` and `2k + 1` of the round before it, which is what pairs the branches.\n// Any draw works: pass fewer rounds for a smaller cup, give teams a `logo`\n// instead of a country `code`, or neither for initials. The knockout bracket\n// takes the same array, so one dataset feeds both fixture styles.\n\nexport const TEAMS = {\n spain: { name: \"Spain\", code: \"es\" },\n japan: { name: \"Japan\", code: \"jp\" },\n netherlands: { name: \"Netherlands\", code: \"nl\" },\n portugal: { name: \"Portugal\", code: \"pt\" },\n england: { name: \"England\", code: \"gb-eng\" },\n uruguay: { name: \"Uruguay\", code: \"uy\" },\n croatia: { name: \"Croatia\", code: \"hr\" },\n brazil: { name: \"Brazil\", code: \"br\" },\n france: { name: \"France\", code: \"fr\" },\n morocco: { name: \"Morocco\", code: \"ma\" },\n belgium: { name: \"Belgium\", code: \"be\" },\n italy: { name: \"Italy\", code: \"it\" },\n argentina: { name: \"Argentina\", code: \"ar\" },\n mexico: { name: \"Mexico\", code: \"mx\" },\n germany: { name: \"Germany\", code: \"de\" },\n norway: { name: \"Norway\", code: \"no\" },\n costaRica: { name: \"Costa Rica\", code: \"cr\" },\n serbia: { name: \"Serbia\", code: \"rs\" },\n ecuador: { name: \"Ecuador\", code: \"ec\" },\n ghana: { name: \"Ghana\", code: \"gh\" },\n wales: { name: \"Wales\", code: \"gb-wls\" },\n canada: { name: \"Canada\", code: \"ca\" },\n denmark: { name: \"Denmark\", code: \"dk\" },\n cameroon: { name: \"Cameroon\", code: \"cm\" },\n poland: { name: \"Poland\", code: \"pl\" },\n senegal: { name: \"Senegal\", code: \"sn\" },\n tunisia: { name: \"Tunisia\", code: \"tn\" },\n switzerland: { name: \"Switzerland\", code: \"ch\" },\n peru: { name: \"Peru\", code: \"pe\" },\n qatar: { name: \"Qatar\", code: \"qa\" },\n sweden: { name: \"Sweden\", code: \"se\" },\n austria: { name: \"Austria\", code: \"at\" },\n} satisfies Record<string, Team>;\n\nexport const ROUNDS: Round[] = [\n {\n name: \"Round of 32\",\n matches: [\n {\n id: \"w-r32-1\",\n home: { team: TEAMS.spain, score: 3 },\n away: { team: TEAMS.costaRica, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r32-2\",\n home: { team: TEAMS.japan, score: 2 },\n away: { team: TEAMS.serbia, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-r32-3\",\n home: { team: TEAMS.netherlands, score: 2 },\n away: { team: TEAMS.ecuador, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r32-4\",\n home: { team: TEAMS.ghana, score: 2 },\n away: { team: TEAMS.portugal, score: 3 },\n winner: \"away\",\n },\n {\n id: \"w-r32-5\",\n home: { team: TEAMS.england, score: 4 },\n away: { team: TEAMS.wales, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r32-6\",\n home: { team: TEAMS.canada, score: 0 },\n away: { team: TEAMS.uruguay, score: 2 },\n winner: \"away\",\n },\n {\n id: \"w-r32-7\",\n home: { team: TEAMS.croatia, score: 1 },\n away: { team: TEAMS.denmark, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r32-8\",\n home: { team: TEAMS.brazil, score: 3 },\n away: { team: TEAMS.cameroon, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-r32-9\",\n home: { team: TEAMS.france, score: 2 },\n away: { team: TEAMS.poland, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-r32-10\",\n home: { team: TEAMS.senegal, score: 0 },\n away: { team: TEAMS.morocco, score: 1 },\n winner: \"away\",\n },\n {\n id: \"w-r32-11\",\n home: { team: TEAMS.belgium, score: 2 },\n away: { team: TEAMS.tunisia, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r32-12\",\n home: { team: TEAMS.switzerland, score: 1 },\n away: { team: TEAMS.italy, score: 3 },\n winner: \"away\",\n },\n {\n id: \"w-r32-13\",\n home: { team: TEAMS.argentina, score: 2 },\n away: { team: TEAMS.peru, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r32-14\",\n home: { team: TEAMS.qatar, score: 0 },\n away: { team: TEAMS.mexico, score: 1 },\n winner: \"away\",\n },\n {\n id: \"w-r32-15\",\n home: { team: TEAMS.germany, score: 4 },\n away: { team: TEAMS.sweden, score: 2 },\n winner: \"home\",\n },\n {\n id: \"w-r32-16\",\n home: { team: TEAMS.austria, score: 1 },\n away: { team: TEAMS.norway, score: 2 },\n winner: \"away\",\n },\n ],\n },\n {\n name: \"Round of 16\",\n matches: [\n {\n id: \"w-r16-1\",\n home: { team: TEAMS.spain, score: 2 },\n away: { team: TEAMS.japan, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r16-2\",\n home: { team: TEAMS.netherlands, score: 1 },\n away: { team: TEAMS.portugal, score: 3 },\n winner: \"away\",\n },\n {\n id: \"w-r16-3\",\n home: { team: TEAMS.england, score: 2 },\n away: { team: TEAMS.uruguay, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-r16-4\",\n home: { team: TEAMS.croatia, score: 0 },\n away: { team: TEAMS.brazil, score: 1 },\n winner: \"away\",\n },\n {\n id: \"w-r16-5\",\n home: { team: TEAMS.france, score: 3 },\n away: { team: TEAMS.morocco, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-r16-6\",\n home: { team: TEAMS.belgium, score: 1 },\n away: { team: TEAMS.italy, score: 2 },\n winner: \"away\",\n },\n {\n id: \"w-r16-7\",\n home: { team: TEAMS.argentina, score: 2 },\n away: { team: TEAMS.mexico, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r16-8\",\n home: { team: TEAMS.germany, score: 1, penalties: 4 },\n away: { team: TEAMS.norway, score: 1, penalties: 2 },\n winner: \"home\",\n },\n ],\n },\n {\n name: \"Quarter-finals\",\n matches: [\n {\n id: \"w-qf-1\",\n home: { team: TEAMS.spain, score: 1 },\n away: { team: TEAMS.portugal, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-qf-2\",\n home: { team: TEAMS.england, score: 2 },\n away: { team: TEAMS.brazil, score: 3 },\n winner: \"away\",\n },\n {\n id: \"w-qf-3\",\n home: { team: TEAMS.france, score: 2 },\n away: { team: TEAMS.italy, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-qf-4\",\n home: { team: TEAMS.argentina, score: 3 },\n away: { team: TEAMS.germany, score: 1 },\n winner: \"home\",\n },\n ],\n },\n {\n name: \"Semi-finals\",\n matches: [\n {\n id: \"w-sf-1\",\n home: { team: TEAMS.spain, score: 2 },\n away: { team: TEAMS.brazil, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-sf-2\",\n home: { team: TEAMS.france, score: 0, penalties: 3 },\n away: { team: TEAMS.argentina, score: 0, penalties: 4 },\n winner: \"away\",\n },\n ],\n },\n {\n name: \"Final\",\n matches: [\n {\n id: \"w-f-1\",\n home: { team: TEAMS.spain, score: 2 },\n away: { team: TEAMS.argentina, score: 1 },\n winner: \"home\",\n },\n ],\n },\n];\n"],"mappings":";;;;;;;;;;;;;AAmEA,MAAM,OAAO;AACb,MAAM,SAAS,OAAO;AAEtB,MAAM,cAAc;AACpB,MAAM,cACJ;AAMF,MAAM,UAAU;AAChB,MAAM,QAAQ;AAEd,MAAM,WAAW;AACjB,MAAM,YAAY;AAIlB,MAAM,eAAe;AAErB,MAAM,cAAc;AAEpB,MAAM,YAAY;AAGlB,MAAM,iBAAiB,EAAE,UAAU,IAAK;AACxC,MAAM,gBAAgB,EAAE,UAAU,EAAE;AAKpC,MAAM,YAAY,MAAc,KAAK,MAAM,IAAI,GAAG,IAAI;AAEtD,MAAM,SAAS,QAAgB,QAAgB;CAC7C,MAAM,MAAO,MAAM,KAAK,KAAM;CAC9B,OAAO;EACL,GAAG,SAAS,SAAS,SAAS,KAAK,IAAI,GAAG,CAAC;EAC3C,GAAG,SAAS,SAAS,SAAS,KAAK,IAAI,GAAG,CAAC;CAC7C;AACF;AAEA,MAAM,SAAS,QAAgB,QAAgB;CAC7C,MAAM,EAAE,GAAG,MAAM,MAAM,QAAQ,GAAG;CAClC,OAAO,GAAG,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC;AACvC;AAIA,MAAM,OAAO,UAAkB,IAAK,QAAQ,OAAQ,IAAA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V;GACA;IACE,IAAI;IACJ,MAAM;KAAE,MAAM,MAAM;KAAS,OAAO;IAAE;IACtC,MAAM;KAAE,MAAM,MAAM;KAAQ,OAAO;IAAE;IACrC,QAAQ;GACV;GACA;IACE,IAAI;IACJ,MAAM;KAAE,MAAM,MAAM;KAAQ,OAAO;IAAE;IACrC,MAAM;KAAE,MAAM,MAAM;KAAO,OAAO;IAAE;IACpC,QAAQ;GACV;GACA;IACE,IAAI;IACJ,MAAM;KAAE,MAAM,MAAM;KAAW,OAAO;IAAE;IACxC,MAAM;KAAE,MAAM,MAAM;KAAS,OAAO;IAAE;IACtC,QAAQ;GACV;EACF;CACF;CACA;EACE,MAAM;EACN,SAAS,CACP;GACE,IAAI;GACJ,MAAM;IAAE,MAAM,MAAM;IAAO,OAAO;GAAE;GACpC,MAAM;IAAE,MAAM,MAAM;IAAQ,OAAO;GAAE;GACrC,QAAQ;EACV,GACA;GACE,IAAI;GACJ,MAAM;IAAE,MAAM,MAAM;IAAQ,OAAO;IAAG,WAAW;GAAE;GACnD,MAAM;IAAE,MAAM,MAAM;IAAW,OAAO;IAAG,WAAW;GAAE;GACtD,QAAQ;EACV,CACF;CACF;CACA;EACE,MAAM;EACN,SAAS,CACP;GACE,IAAI;GACJ,MAAM;IAAE,MAAM,MAAM;IAAO,OAAO;GAAE;GACpC,MAAM;IAAE,MAAM,MAAM;IAAW,OAAO;GAAE;GACxC,QAAQ;EACV,CACF;CACF;AACF"}
1
+ {"version":3,"file":"knockout-wheel.js","names":[],"sources":["../../../src/components/motion/knockout-wheel.tsx"],"sourcesContent":["\"use client\";\n\nimport { type KeyboardEvent, memo, useCallback, useId, useMemo, useRef, useState } from \"react\";\nimport { Shield } from \"lucide-react\";\nimport { motion, useInView, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useDismiss } from \"../../hooks/use-dismiss\";\nimport { useHoverCapable } from \"../../hooks/use-hover-capable\";\nimport { useHoverGesture } from \"../../hooks/use-hover-gesture\";\nimport { useTapGesture } from \"../../hooks/use-tap-gesture\";\nimport { SPRING_PANEL } from \"../../lib/ease\";\nimport { Tooltip } from \"./tooltip\";\n\nexport type Team = {\n name: string;\n /**\n * Any square image URL — club crest, org mark, player photo. Wins over `code`.\n * Drawn as-is on the node's card-colored disc, so a transparent-background\n * mark inked for one theme disappears in the other: ship artwork that reads on\n * both, or pick the URL yourself from your theme state.\n */\n logo?: string;\n /** ISO 3166-1 alpha-2 code, loaded from flagcdn.com (England is gb-eng). Used when `logo` is absent. */\n code?: string;\n};\n\nexport type MatchSide = {\n team: Team | null;\n score: number | null;\n /** Present on both sides to render shootout scores — 1 (3). */\n penalties?: number | null;\n};\n\n/** Structurally compatible with the knockout bracket's Match, minus the fields\n * the wheel never draws (date, time, status). */\nexport type Match = {\n id: string;\n home: MatchSide;\n away: MatchSide;\n winner?: \"home\" | \"away\";\n};\n\nexport type Round = {\n /** Read out with the match in tooltips and the screen-reader list. */\n name: string;\n matches: Match[];\n};\n\nexport interface KnockoutWheelProps {\n /**\n * The whole draw, ordered widest round first — the same array the knockout\n * bracket takes. Any single-elimination tournament fits: each round holds half\n * the matches of the one before it (16 → 8 → 4 → 2 → 1) and `rounds[r].matches[k]`\n * is fed by matches `2k` and `2k + 1` of the round before it. Two rounds are\n * enough; the wheel grows a ring per round and sizes itself to the rim.\n */\n rounds: Round[];\n /**\n * Index of the outermost round to draw. Earlier rounds are dropped and the\n * kept round's own teams become the rim, so `1` on a 32-team draw opens at the\n * Round of 16. Defaults to 0 (the whole tree); clamped to the valid range.\n */\n initialRound?: number;\n className?: string;\n}\n\nconst SIZE = 760;\nconst CENTER = SIZE / 2;\n// Solid trophy glyph drawn in a 24-unit box.\nconst TROPHY_SIZE = 24;\nconst TROPHY_PATH =\n \"M5 1h12v3h3a2 2 0 0 1 2 2c0 3.3-2.2 5.6-5.2 6A6 6 0 0 1 12 15a6 6 0 0 1-4.8-2.9C4.2 11.6 2 9.3 2 6a2 2 0 0 1 2-2h1V1Zm0 5H4c0 1.9 1.1 3.2 2.6 3.7A12 12 0 0 1 5 6Zm14 0h-1a12 12 0 0 1-1.6 3.7C17.9 9.2 19 7.9 19 6ZM9 16.5h6V19h2.5v2h-11v-2H9v-2.5Z\";\n// Clears the hub's top edge. The hub's two feeders sit on the horizontal, so\n// the space directly above it is always free.\nconst TROPHY_GAP = 6;\n// Outermost ring. The remaining 62px of the box absorbs the largest node plus\n// its ring stroke, so nothing clips at the viewBox edge.\nconst OUTER_R = 318;\nconst HUB_R = 34;\n// Nodes grow outward so the crowded outer ring still reads at small sizes.\nconst NODE_MIN = 14.2;\nconst NODE_STEP = 2.2;\n// Initials floor, in viewBox units. The stage never goes below 32rem against a\n// 760-unit box (scale ~0.674), so 15 units is ~10px on screen — under that, two\n// letters are a smudge. `node.r * 0.8` alone puts the inner ring at 7.6px.\nconst INITIALS_MIN = 15;\n// Siblings pull slightly toward their parent, opening a lane between subtrees.\nconst SIBLING_GAP = 0.9;\n// Puts the hub's two feeders on the horizontal, where there's room for them.\nconst HUB_ANGLE = 90;\n\n// Module scope so the memoized marks keep a stable transition identity.\nconst DIM_TRANSITION = { duration: 0.18 } as const;\nconst NO_TRANSITION = { duration: 0 } as const;\n\n// Math.sin/cos are implementation-defined down in the last digits, so the SSR\n// engine and the browser disagree and React reports a hydration mismatch on\n// every coordinate. Quantizing well below sub-pixel makes both agree exactly.\nconst quantize = (n: number) => Math.round(n * 1e3) / 1e3;\n\nconst polar = (radius: number, deg: number) => {\n const rad = (deg * Math.PI) / 180;\n return {\n x: quantize(CENTER + radius * Math.cos(rad)),\n y: quantize(CENTER + radius * Math.sin(rad)),\n };\n};\n\nconst point = (radius: number, deg: number) => {\n const { x, y } = polar(radius, deg);\n return `${x.toFixed(2)} ${y.toFixed(2)}`;\n};\n\n// Fixed precision so the server and client render byte-identical style strings.\n// Raw floats serialize differently across the two and trip a hydration mismatch.\nconst pct = (value: number) => `${((value / SIZE) * 100).toFixed(4)}%`;\n\ntype WheelNode = {\n id: string;\n parentId: string | null;\n depth: number;\n /** Position around the wheel, in degrees. Orders arrow-key navigation. */\n angle: number;\n x: number;\n y: number;\n r: number;\n team: Team | null;\n label: string;\n /** Round the node's match belongs to; null on the rim, which holds teams. */\n round: string | null;\n};\n\ntype WheelLink = {\n id: string;\n d: string;\n depth: number;\n};\n\n// Names and round labels are single ideas, so they wrap as a unit. Without this\n// \"Round of 16\" strands a lone \"16\" on the next line.\nconst keepTogether = (text: string) => text.replace(/ /g, \" \");\n\nconst teamName = (side: MatchSide) => keepTogether(side.team?.name ?? \"TBD\");\n\n/** A `logo` is used as given; a country `code` loads a flag from flagcdn.com. */\nconst crestSrc = (team: Team) =>\n team.logo ?? (team.code ? `https://flagcdn.com/w80/${team.code}.png` : null);\n\n/** Two-letter stand-in when a team has no artwork — \"Real Madrid\" → RM.\n * Spread, not `word[0]`: an emoji or astral first character is a surrogate pair\n * and indexing it renders a replacement glyph. */\nconst initials = (name: string) =>\n name\n .split(/\\s+/)\n .slice(0, 2)\n .map((word) => [...word][0])\n .join(\"\")\n .toUpperCase();\n\n/** Teams · score, in the order they were played. The round is prepended by the\n * caller that has it, so the round list can reuse this without repeating it. */\nfunction matchLabel(match: Match) {\n const teams = `${teamName(match.home)} v ${teamName(match.away)}`;\n if (match.home.score == null || match.away.score == null) return teams;\n const pens =\n match.home.penalties != null && match.away.penalties != null\n ? ` (${match.home.penalties}–${match.away.penalties} pens)`\n : \"\";\n return `${teams} · ${match.home.score}–${match.away.score}${pens}`;\n}\n\n/** Walks the match tree from the final outward, laying every node on a ring and\n * splitting each parent's wedge between its two feeders. */\nfunction buildWheel(rounds: Round[]) {\n const nodes: WheelNode[] = [];\n const links: WheelLink[] = [];\n const layers = rounds.length;\n const ringR = (depth: number) => (depth / layers) * OUTER_R;\n const nodeR = (depth: number) => NODE_MIN + (depth - 1) * NODE_STEP;\n\n // An empty or malformed catalog renders nothing rather than throwing on the\n // way to the hub.\n const final = rounds[layers - 1]?.matches[0];\n if (!final) return { nodes, links, champion: null };\n\n const champion = final.winner ? final[final.winner].team : null;\n nodes.push({\n id: final.id,\n parentId: null,\n depth: 0,\n angle: HUB_ANGLE,\n x: CENTER,\n y: CENTER,\n r: HUB_R,\n team: champion,\n label: matchLabel(final),\n round: rounds[layers - 1].name,\n });\n\n // `roundIndex` is the round `match` belongs to; its two feeders live one round\n // out, or, past the first round, are the two teams that played it.\n const walk = (\n match: Match,\n roundIndex: number,\n index: number,\n parent: WheelNode,\n angle: number,\n wedge: number,\n ) => {\n const depth = parent.depth + 1;\n const radius = ringR(depth);\n const r = nodeR(depth);\n // The hub's two feeders sit opposite each other, so they get plain radial\n // lines; an arc between them would be a half circle.\n const offset = (wedge / 4) * (parent.depth === 0 ? 1 : SIBLING_GAP);\n const angles = [angle - offset, angle + offset];\n const sides = [\"home\", \"away\"] as const;\n\n const children = angles.map((childAngle, side) => {\n const { x, y } = polar(radius, childAngle);\n const feeder = roundIndex > 0 ? rounds[roundIndex - 1].matches[2 * index + side] : undefined;\n const node: WheelNode = feeder\n ? {\n id: feeder.id,\n parentId: parent.id,\n depth,\n angle: childAngle,\n x,\n y,\n r,\n team: feeder.winner ? feeder[feeder.winner].team : null,\n label: matchLabel(feeder),\n round: rounds[roundIndex - 1].name,\n }\n : {\n id: `${match.id}-${sides[side]}`,\n parentId: parent.id,\n depth,\n angle: childAngle,\n x,\n y,\n r,\n team: match[sides[side]].team,\n label: match[sides[side]].team?.name ?? \"TBD\",\n round: null,\n };\n nodes.push(node);\n return { node, angle: childAngle, feeder };\n });\n\n if (parent.depth === 0) {\n for (const child of children) {\n links.push({\n id: `${parent.id}-${child.node.id}`,\n d: `M ${point(radius, child.angle)} L ${CENTER} ${CENTER}`,\n depth,\n });\n }\n } else {\n const midR = (ringR(parent.depth) + radius) / 2;\n links.push({\n id: `${parent.id}-arc`,\n d: `M ${point(radius, angles[0])} L ${point(midR, angles[0])} A ${midR} ${midR} 0 0 1 ${point(midR, angles[1])} L ${point(radius, angles[1])}`,\n depth,\n });\n links.push({\n id: `${parent.id}-stem`,\n d: `M ${point(midR, angle)} L ${point(ringR(parent.depth), angle)}`,\n depth,\n });\n }\n\n for (const [side, child] of children.entries()) {\n if (child.feeder) {\n walk(child.feeder, roundIndex - 1, 2 * index + side, child.node, child.angle, wedge / 2);\n }\n }\n };\n\n walk(final, layers - 1, 0, nodes[0], HUB_ANGLE, 360);\n return { nodes, links, champion };\n}\n\n/** Match ids from the hub down to the champion's first-round win. */\nfunction championPath(rounds: Round[]) {\n const path = new Set<string>();\n let index = 0;\n for (let r = rounds.length - 1; r >= 0; r--) {\n const match = rounds[r].matches[index];\n if (!match?.winner) return path;\n path.add(match.id);\n if (r === 0) path.add(`${match.id}-${match.winner}`);\n index = 2 * index + (match.winner === \"home\" ? 0 : 1);\n }\n return path;\n}\n\nfunction TeamMark({\n node,\n clipId,\n lit,\n dimmed,\n loadFlag,\n transition,\n}: {\n node: WheelNode;\n clipId: string;\n lit: boolean;\n dimmed: boolean;\n loadFlag: boolean;\n transition: object;\n}) {\n // The failed URL, not a boolean: a corrected logo on the same node should be\n // tried again rather than stay initials for the life of the wheel.\n const [failedSrc, setFailedSrc] = useState<string | null>(null);\n const resolved = node.team ? crestSrc(node.team) : null;\n const src = resolved === failedSrc ? null : resolved;\n const showFlag = src != null && loadFlag;\n // A square logo is fitted whole; a 4:3 flag is cropped to fill the disc.\n const box = node.team?.logo\n ? { w: node.r * 1.44, h: node.r * 1.44, fit: \"xMidYMid meet\" }\n : { w: node.r * 2.68, h: node.r * 2, fit: \"xMidYMid slice\" };\n // Dimming rides on the mark itself rather than a scrim tinted with the page\n // background, so the wheel recedes correctly on any surface it's dropped on.\n const fade = { opacity: dimmed ? 0.38 : 1 };\n\n return (\n <>\n {/* Stays opaque at every state: links are routed underneath and would\n otherwise read straight through the flag. */}\n <circle cx={node.x} cy={node.y} r={node.r} className=\"fill-card\" />\n {showFlag && node.team ? (\n <>\n <clipPath id={clipId}>\n <circle cx={node.x} cy={node.y} r={node.r} />\n </clipPath>\n {/* Plain <image> — flags from flagcdn.com, logos from wherever you host\n them. A 4:3 flag is cropped to fill the disc; a logo is fitted whole\n inside it, since a crest cropped to a circle loses its shape. */}\n <motion.image\n href={src}\n x={node.x - box.w / 2}\n y={node.y - box.h / 2}\n width={box.w}\n height={box.h}\n clipPath={`url(#${clipId})`}\n preserveAspectRatio={box.fit}\n initial={false}\n animate={fade}\n transition={transition}\n onError={() => setFailedSrc(src)}\n />\n </>\n ) : node.team ? (\n // No artwork on this team — initials keep the ring readable.\n <motion.text\n x={node.x}\n y={node.y}\n textAnchor=\"middle\"\n dominantBaseline=\"central\"\n fontSize={Math.max(node.r * 0.8, INITIALS_MIN)}\n initial={false}\n animate={fade}\n transition={transition}\n className=\"fill-muted-foreground font-semibold\"\n >\n {initials(node.team.name)}\n </motion.text>\n ) : (\n // Same shield the knockout bracket uses for a TBD slot, so an\n // undecided place reads identically across both fixture styles.\n <motion.g initial={false} animate={fade} transition={transition}>\n <Shield\n x={node.x - node.r * 0.7}\n y={node.y - node.r * 0.7}\n width={node.r * 1.4}\n height={node.r * 1.4}\n className=\"fill-current text-muted-foreground/50\"\n />\n </motion.g>\n )}\n <circle\n cx={node.x}\n cy={node.y}\n r={node.r}\n fill=\"none\"\n strokeWidth={lit ? 2 : 1}\n className={lit ? \"stroke-foreground\" : \"stroke-border\"}\n />\n </>\n );\n}\n\n/** Memoized so pointing at one flag re-renders two marks, not all 63. */\nconst WheelMark = memo(function WheelMark({\n node,\n isLit,\n dimmed,\n loadFlag,\n reduce,\n enter,\n showTrophy,\n clipId,\n}: {\n node: WheelNode;\n isLit: boolean;\n dimmed: boolean;\n loadFlag: boolean;\n reduce: boolean;\n enter: object;\n showTrophy: boolean;\n clipId: string;\n}) {\n return (\n <motion.g\n initial={reduce ? false : { opacity: 0, scale: 0.6 }}\n animate={{ opacity: 1, scale: 1 }}\n transition={enter}\n style={{ transformOrigin: `${node.x}px ${node.y}px` }}\n >\n {showTrophy && (\n <g\n transform={`translate(${CENTER - TROPHY_SIZE / 2}, ${CENTER - HUB_R - TROPHY_GAP - TROPHY_SIZE})`}\n >\n <path d={TROPHY_PATH} className=\"fill-warning\" />\n </g>\n )}\n <TeamMark\n node={node}\n clipId={clipId}\n lit={isLit}\n dimmed={dimmed}\n loadFlag={loadFlag}\n transition={reduce ? NO_TRANSITION : DIM_TRANSITION}\n />\n </motion.g>\n );\n});\n\n/** Invisible hit area over one flag: hover, tap, focus and arrow keys. */\nconst WheelAnchor = memo(function WheelAnchor({\n node,\n caption,\n isTabStop,\n isPinned,\n canHover,\n uid,\n onHover,\n onFocusNode,\n onToggle,\n onKey,\n}: {\n node: WheelNode;\n caption: string;\n isTabStop: boolean;\n isPinned: boolean;\n canHover: boolean;\n uid: string;\n onHover: (id: string | null) => void;\n onFocusNode: (id: string | null) => void;\n onToggle: (id: string) => void;\n onKey: (node: WheelNode, key: string) => void;\n}) {\n const size = pct(node.r * 2);\n // Capture-phase focus props, so a Tooltip cloning the child cannot overwrite\n // them. Both interaction paths are always attached: iPadOS answers the hover\n // query with true for a finger, so hanging the tap path off \"cannot hover\"\n // left it unreachable on the very device it was written for. The event says\n // which input arrived.\n const tap = useTapGesture<boolean>();\n const hover = useHoverGesture();\n const trigger = (\n <button\n type=\"button\"\n id={`${uid}-${node.id}`}\n tabIndex={isTabStop ? 0 : -1}\n aria-label={caption}\n onKeyDown={(event: KeyboardEvent) => {\n // A key press starts a keyboard activation, which never had a pointer\n // behind it: a gesture the platform took away must not be read as the\n // tap behind the click this press synthesizes.\n tap.drop();\n if (!event.key.startsWith(\"Arrow\")) return;\n // Arrows drive the wheel here, so they must not also scroll the page.\n event.preventDefault();\n onKey(node, event.key);\n }}\n onFocusCapture={() => onFocusNode(node.id)}\n onBlurCapture={() => onFocusNode(null)}\n onPointerEnter={(event) => {\n if (hover.enter(event)) onHover(node.id);\n }}\n onPointerLeave={(event) => {\n if (hover.leave(event)) onHover(null);\n }}\n onPointerDown={(event) => {\n tap.start(event, isPinned);\n }}\n onPointerCancel={tap.drop}\n // Click, not pointerdown: a tap focuses the button first, and unpinning\n // has to also drop that focus or the flag stays lit.\n onClick={(event) => {\n const gesture = tap.take();\n // A hovering pointer lit the flag on its way in and puts it out on the\n // way past; only a gesture without a hover pins one.\n if (!gesture || gesture.pointerType === \"mouse\") return;\n onToggle(node.id);\n if (gesture.state) event.currentTarget.blur();\n }}\n // ring-foreground, not the ring token: --ring is a 10% white hairline\n // that disappears over a flag. Focus has to be obvious.\n className=\"block h-full w-full rounded-full outline-none focus-visible:ring-2 focus-visible:ring-foreground focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n />\n );\n\n return (\n <div\n className=\"absolute\"\n style={{\n left: pct(node.x - node.r),\n top: pct(node.y - node.r),\n width: size,\n height: size,\n }}\n >\n {/* Touch never opens a Tooltip, so those devices skip mounting one per\n flag and read the tapped label instead. */}\n {canHover ? (\n <Tooltip\n content={caption}\n side=\"top\"\n className=\"wrap-break-word max-w-[20rem] whitespace-normal text-balance text-center\"\n >\n {trigger}\n </Tooltip>\n ) : (\n trigger\n )}\n </div>\n );\n});\n\nexport function KnockoutWheel({ rounds, initialRound = 0, className }: KnockoutWheelProps) {\n const reduce = useReducedMotion();\n const canHover = useHoverCapable();\n const uid = useId().replace(/:/g, \"\");\n const ref = useRef<SVGSVGElement>(null);\n const stageRef = useRef<HTMLDivElement>(null);\n // 63 flags for a 32-team draw, and SVG <image> has no lazy attribute — so the\n // requests wait until the wheel is nearly on screen.\n const inView = useInView(ref, { once: true, margin: \"300px\" });\n // Hover, tap and focus are tracked apart. Sharing one slot let a stray mouse\n // move clear the isolation while a node still held focus, and a tap has to\n // outlive the pointerleave that a finger fires the moment it lifts.\n const [hovered, setHovered] = useState<string | null>(null);\n const [pinned, setPinned] = useState<string | null>(null);\n const [focused, setFocused] = useState<string | null>(null);\n const active = hovered ?? pinned ?? focused;\n\n // Everything downstream reads the trimmed catalog, so the kept round's own\n // teams become the rim and the sr-only list matches what's drawn.\n const visible = useMemo(() => {\n const from = Math.min(Math.max(initialRound, 0), Math.max(rounds.length - 1, 0));\n return from > 0 ? rounds.slice(from) : rounds;\n }, [rounds, initialRound]);\n\n const { nodes, links, champion } = useMemo(() => buildWheel(visible), [visible]);\n const winners = useMemo(() => championPath(visible), [visible]);\n const activeNode = useMemo(() => nodes.find((node) => node.id === active), [active, nodes]);\n // Pointing at one flag isolates that flag. Only at rest does the wheel fall\n // back to lighting the champion's whole run.\n const lit = useMemo(\n () => (activeNode ? new Set([activeNode.id]) : winners),\n [activeNode, winners],\n );\n\n // Stable identity, or every mark re-renders on each pointer move.\n const enter = useMemo(\n () =>\n reduce\n ? { duration: 0, opacity: { duration: 0 } }\n : { ...SPRING_PANEL, opacity: { duration: 0.24 } },\n [reduce],\n );\n\n // One transition object per ring, cached, so the ring-by-ring entrance delay\n // survives memoization instead of allocating 63 objects per render.\n const enterFor = useMemo(() => {\n const cache = new Map<number, object>();\n return (depth: number) => {\n const hit = cache.get(depth);\n if (hit) return hit;\n const value = { ...enter, delay: reduce ? 0 : depth * 0.06 };\n cache.set(depth, value);\n return value;\n };\n }, [enter, reduce]);\n\n // Tooltip is hover-only by design, so touch gets the same label anchored to\n // the tapped flag. It flips to the far side near the rim so it stays on stage.\n const tapped = canHover ? undefined : activeNode;\n const tapAbove = tapped ? tapped.y > CENTER : false;\n\n // Arrow keys follow the geometry: up walks toward the hub, down walks out to\n // a feeder, left/right go round the ring.\n const { ring, firstChild } = useMemo(() => {\n const byDepth = new Map<number, WheelNode[]>();\n const child = new Map<string, WheelNode>();\n for (const node of nodes) {\n const peers = byDepth.get(node.depth) ?? [];\n peers.push(node);\n byDepth.set(node.depth, peers);\n if (node.parentId && !child.has(node.parentId)) {\n child.set(node.parentId, node);\n }\n }\n for (const peers of byDepth.values()) {\n peers.sort((a, b) => a.angle - b.angle);\n }\n return { ring: byDepth, firstChild: child };\n }, [nodes]);\n\n const tabStop = activeNode?.id ?? nodes[0]?.id;\n\n // Stable callbacks so the memoized anchors don't re-render on every hover.\n const onKey = useCallback(\n (node: WheelNode, key: string) => {\n if (!key.startsWith(\"Arrow\")) return;\n const target =\n key === \"ArrowUp\"\n ? nodes.find((peer) => peer.id === node.parentId)\n : key === \"ArrowDown\"\n ? firstChild.get(node.id)\n : (() => {\n const peers = ring.get(node.depth) ?? [];\n if (peers.length < 2) return undefined;\n const at = peers.indexOf(node);\n const next = key === \"ArrowRight\" ? at + 1 : at - 1;\n return peers[(next + peers.length) % peers.length];\n })();\n if (!target) return;\n // Focus moves; the focus handler lights the node it lands on.\n document.getElementById(`${uid}-${target.id}`)?.focus();\n },\n [nodes, ring, firstChild, uid],\n );\n\n const onToggle = useCallback(\n (id: string) => setPinned((current) => (current === id ? null : id)),\n [],\n );\n\n // A tap on another flag hands the isolation over rather than ending it.\n const onFlag = useCallback(\n (target: Element) => Boolean(stageRef.current?.contains(target) && target.closest(\"button\")),\n [],\n );\n\n // A finger never leaves the flag it lit, so the isolation would hold for good\n // — and bare stage reports no pointer event of its own to end it. The next\n // pointerdown that isn't on a flag stands in for the pointer leaving; it is\n // consumed, since a wheel spanning the viewport makes tapping past it the\n // natural way out and there is no reason for that tap to do anything else.\n // Only a pinned flag arms this: a mouse ends its own hover, and the browser\n // drops focus on its own.\n const unpin = useCallback(() => {\n setPinned(null);\n const focus = document.activeElement;\n if (focus instanceof HTMLElement && stageRef.current?.contains(focus)) {\n focus.blur();\n }\n }, []);\n\n useDismiss(pinned !== null, unpin, null, {\n behavior: \"consume\",\n ignore: onFlag,\n });\n\n // Round · teams · score for a decided match; a rim node is just a team. A slot\n // whose team isn't known yet reads TBD, matching the shield drawn in its place.\n const captions = useMemo(\n () =>\n new Map(\n nodes.map((node) => [\n node.id,\n node.team == null\n ? \"TBD\"\n : node.round\n ? `${keepTogether(node.round)} · ${node.label}`\n : node.team.name,\n ]),\n ),\n [nodes],\n );\n\n return (\n <div className={cn(\"w-full max-w-full overflow-x-auto overscroll-x-contain\", className)}>\n {/* Below the min width the rim's marks collapse too small to tell apart or\n tap, so the wheel holds its size and pans instead. The floor is fixed,\n not rim-derived: node radius grows with depth, so a shallower draw has\n *smaller* marks and needs the width more, not less. */}\n <div ref={stageRef} className=\"relative mx-auto w-full min-w-[32rem] max-w-[34rem]\">\n <svg\n ref={ref}\n viewBox={`0 0 ${SIZE} ${SIZE}`}\n role=\"img\"\n aria-label={`Tournament wheel${champion ? `, won by ${champion.name}` : \"\"}`}\n className=\"h-auto w-full touch-manipulation\"\n >\n <defs>\n {/* Warm halo marking the champion. Kept faint: --warning is saturated\n enough that anything stronger drowns the connectors under it. */}\n <radialGradient id={`${uid}-glow`}>\n <stop offset=\"0%\" stopColor=\"var(--color-warning)\" stopOpacity=\"0.14\" />\n <stop offset=\"45%\" stopColor=\"var(--color-warning)\" stopOpacity=\"0.04\" />\n <stop offset=\"100%\" stopColor=\"var(--color-warning)\" stopOpacity=\"0\" />\n </radialGradient>\n </defs>\n\n {champion && (\n <circle cx={CENTER} cy={CENTER} r={OUTER_R * 0.62} fill={`url(#${uid}-glow)`} />\n )}\n\n {/* role=\"img\" on the svg prunes descendants from the accessibility tree,\n so the structure needs no aria-hidden of its own. */}\n <g>\n {links.map((link) => (\n <motion.path\n key={link.id}\n d={link.d}\n fill=\"none\"\n initial={reduce ? false : { opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.3, delay: link.depth * 0.06 }}\n className=\"stroke-border-strong\"\n />\n ))}\n </g>\n\n {nodes.map((node) => (\n <WheelMark\n key={node.id}\n node={node}\n isLit={lit.has(node.id)}\n dimmed={lit.size > 0 && !lit.has(node.id)}\n loadFlag={inView}\n reduce={Boolean(reduce)}\n enter={enterFor(node.depth)}\n showTrophy={node.depth === 0 && champion != null}\n clipId={`${uid}-clip-${node.id}`}\n />\n ))}\n </svg>\n\n {/* An SVG <g> can't anchor a Tooltip, so each flag gets an invisible\n HTML hit area laid over it in percentage units, which track the\n wheel as it scales. */}\n {nodes.map((node) => (\n <WheelAnchor\n key={node.id}\n node={node}\n caption={captions.get(node.id) ?? \"\"}\n isTabStop={node.id === tabStop}\n isPinned={node.id === pinned}\n canHover={canHover}\n uid={uid}\n onHover={setHovered}\n onFocusNode={setFocused}\n onToggle={onToggle}\n onKey={onKey}\n />\n ))}\n\n {tapped && (\n <motion.p\n initial={reduce ? false : { opacity: 0, scale: 0.94 }}\n animate={{ opacity: 1, scale: 1 }}\n transition={reduce ? NO_TRANSITION : DIM_TRANSITION}\n style={{\n left: pct(tapped.x),\n top: pct(tapped.y + (tapAbove ? -tapped.r : tapped.r)),\n }}\n className={cn(\n \"wrap-break-word pointer-events-none absolute z-10 w-max max-w-[min(18rem,80vw)] -translate-x-1/2 text-balance rounded-lg border border-border bg-background px-2.5 py-1 text-center font-medium text-foreground text-xs shadow-lg\",\n tapAbove ? \"-translate-y-[calc(100%+8px)]\" : \"translate-y-2\",\n )}\n >\n {captions.get(tapped.id)}\n </motion.p>\n )}\n </div>\n\n {/* role=\"img\" prunes the svg's descendants, so every result is restated\n here for screen readers. */}\n {/* Named lists, not <section aria-label> — a named section is a landmark,\n and five of those would crowd real page landmarks. */}\n <div className=\"sr-only\">\n {visible\n .slice()\n .reverse()\n .map((round) => (\n <ul key={round.name} aria-label={round.name}>\n {round.matches.map((match) => (\n <li key={match.id}>{matchLabel(match)}</li>\n ))}\n </ul>\n ))}\n </div>\n </div>\n );\n}\n\n// ── Sample data ──────────────────────────────────────────────────────────────\n// A finished 32-team cup, here to demo the shape. Swap it for your own\n// tournament. Rounds run widest first and each holds half as many matches as the\n// one before it (16 → 8 → 4 → 2 → 1); `matches[k]` of a round is fed by matches\n// `2k` and `2k + 1` of the round before it, which is what pairs the branches.\n// Any draw works: pass fewer rounds for a smaller cup, give teams a `logo`\n// instead of a country `code`, or neither for initials. The knockout bracket\n// takes the same array, so one dataset feeds both fixture styles.\n\nexport const TEAMS = {\n spain: { name: \"Spain\", code: \"es\" },\n japan: { name: \"Japan\", code: \"jp\" },\n netherlands: { name: \"Netherlands\", code: \"nl\" },\n portugal: { name: \"Portugal\", code: \"pt\" },\n england: { name: \"England\", code: \"gb-eng\" },\n uruguay: { name: \"Uruguay\", code: \"uy\" },\n croatia: { name: \"Croatia\", code: \"hr\" },\n brazil: { name: \"Brazil\", code: \"br\" },\n france: { name: \"France\", code: \"fr\" },\n morocco: { name: \"Morocco\", code: \"ma\" },\n belgium: { name: \"Belgium\", code: \"be\" },\n italy: { name: \"Italy\", code: \"it\" },\n argentina: { name: \"Argentina\", code: \"ar\" },\n mexico: { name: \"Mexico\", code: \"mx\" },\n germany: { name: \"Germany\", code: \"de\" },\n norway: { name: \"Norway\", code: \"no\" },\n costaRica: { name: \"Costa Rica\", code: \"cr\" },\n serbia: { name: \"Serbia\", code: \"rs\" },\n ecuador: { name: \"Ecuador\", code: \"ec\" },\n ghana: { name: \"Ghana\", code: \"gh\" },\n wales: { name: \"Wales\", code: \"gb-wls\" },\n canada: { name: \"Canada\", code: \"ca\" },\n denmark: { name: \"Denmark\", code: \"dk\" },\n cameroon: { name: \"Cameroon\", code: \"cm\" },\n poland: { name: \"Poland\", code: \"pl\" },\n senegal: { name: \"Senegal\", code: \"sn\" },\n tunisia: { name: \"Tunisia\", code: \"tn\" },\n switzerland: { name: \"Switzerland\", code: \"ch\" },\n peru: { name: \"Peru\", code: \"pe\" },\n qatar: { name: \"Qatar\", code: \"qa\" },\n sweden: { name: \"Sweden\", code: \"se\" },\n austria: { name: \"Austria\", code: \"at\" },\n} satisfies Record<string, Team>;\n\nexport const ROUNDS: Round[] = [\n {\n name: \"Round of 32\",\n matches: [\n {\n id: \"w-r32-1\",\n home: { team: TEAMS.spain, score: 3 },\n away: { team: TEAMS.costaRica, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r32-2\",\n home: { team: TEAMS.japan, score: 2 },\n away: { team: TEAMS.serbia, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-r32-3\",\n home: { team: TEAMS.netherlands, score: 2 },\n away: { team: TEAMS.ecuador, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r32-4\",\n home: { team: TEAMS.ghana, score: 2 },\n away: { team: TEAMS.portugal, score: 3 },\n winner: \"away\",\n },\n {\n id: \"w-r32-5\",\n home: { team: TEAMS.england, score: 4 },\n away: { team: TEAMS.wales, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r32-6\",\n home: { team: TEAMS.canada, score: 0 },\n away: { team: TEAMS.uruguay, score: 2 },\n winner: \"away\",\n },\n {\n id: \"w-r32-7\",\n home: { team: TEAMS.croatia, score: 1 },\n away: { team: TEAMS.denmark, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r32-8\",\n home: { team: TEAMS.brazil, score: 3 },\n away: { team: TEAMS.cameroon, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-r32-9\",\n home: { team: TEAMS.france, score: 2 },\n away: { team: TEAMS.poland, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-r32-10\",\n home: { team: TEAMS.senegal, score: 0 },\n away: { team: TEAMS.morocco, score: 1 },\n winner: \"away\",\n },\n {\n id: \"w-r32-11\",\n home: { team: TEAMS.belgium, score: 2 },\n away: { team: TEAMS.tunisia, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r32-12\",\n home: { team: TEAMS.switzerland, score: 1 },\n away: { team: TEAMS.italy, score: 3 },\n winner: \"away\",\n },\n {\n id: \"w-r32-13\",\n home: { team: TEAMS.argentina, score: 2 },\n away: { team: TEAMS.peru, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r32-14\",\n home: { team: TEAMS.qatar, score: 0 },\n away: { team: TEAMS.mexico, score: 1 },\n winner: \"away\",\n },\n {\n id: \"w-r32-15\",\n home: { team: TEAMS.germany, score: 4 },\n away: { team: TEAMS.sweden, score: 2 },\n winner: \"home\",\n },\n {\n id: \"w-r32-16\",\n home: { team: TEAMS.austria, score: 1 },\n away: { team: TEAMS.norway, score: 2 },\n winner: \"away\",\n },\n ],\n },\n {\n name: \"Round of 16\",\n matches: [\n {\n id: \"w-r16-1\",\n home: { team: TEAMS.spain, score: 2 },\n away: { team: TEAMS.japan, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r16-2\",\n home: { team: TEAMS.netherlands, score: 1 },\n away: { team: TEAMS.portugal, score: 3 },\n winner: \"away\",\n },\n {\n id: \"w-r16-3\",\n home: { team: TEAMS.england, score: 2 },\n away: { team: TEAMS.uruguay, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-r16-4\",\n home: { team: TEAMS.croatia, score: 0 },\n away: { team: TEAMS.brazil, score: 1 },\n winner: \"away\",\n },\n {\n id: \"w-r16-5\",\n home: { team: TEAMS.france, score: 3 },\n away: { team: TEAMS.morocco, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-r16-6\",\n home: { team: TEAMS.belgium, score: 1 },\n away: { team: TEAMS.italy, score: 2 },\n winner: \"away\",\n },\n {\n id: \"w-r16-7\",\n home: { team: TEAMS.argentina, score: 2 },\n away: { team: TEAMS.mexico, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-r16-8\",\n home: { team: TEAMS.germany, score: 1, penalties: 4 },\n away: { team: TEAMS.norway, score: 1, penalties: 2 },\n winner: \"home\",\n },\n ],\n },\n {\n name: \"Quarter-finals\",\n matches: [\n {\n id: \"w-qf-1\",\n home: { team: TEAMS.spain, score: 1 },\n away: { team: TEAMS.portugal, score: 0 },\n winner: \"home\",\n },\n {\n id: \"w-qf-2\",\n home: { team: TEAMS.england, score: 2 },\n away: { team: TEAMS.brazil, score: 3 },\n winner: \"away\",\n },\n {\n id: \"w-qf-3\",\n home: { team: TEAMS.france, score: 2 },\n away: { team: TEAMS.italy, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-qf-4\",\n home: { team: TEAMS.argentina, score: 3 },\n away: { team: TEAMS.germany, score: 1 },\n winner: \"home\",\n },\n ],\n },\n {\n name: \"Semi-finals\",\n matches: [\n {\n id: \"w-sf-1\",\n home: { team: TEAMS.spain, score: 2 },\n away: { team: TEAMS.brazil, score: 1 },\n winner: \"home\",\n },\n {\n id: \"w-sf-2\",\n home: { team: TEAMS.france, score: 0, penalties: 3 },\n away: { team: TEAMS.argentina, score: 0, penalties: 4 },\n winner: \"away\",\n },\n ],\n },\n {\n name: \"Final\",\n matches: [\n {\n id: \"w-f-1\",\n home: { team: TEAMS.spain, score: 2 },\n away: { team: TEAMS.argentina, score: 1 },\n winner: \"home\",\n },\n ],\n },\n];\n"],"mappings":";;;;;;;;;;;;;AAmEA,MAAM,OAAO;AACb,MAAM,SAAS,OAAO;AAEtB,MAAM,cAAc;AACpB,MAAM,cACJ;AAMF,MAAM,UAAU;AAChB,MAAM,QAAQ;AAEd,MAAM,WAAW;AACjB,MAAM,YAAY;AAIlB,MAAM,eAAe;AAErB,MAAM,cAAc;AAEpB,MAAM,YAAY;AAGlB,MAAM,iBAAiB,EAAE,UAAU,IAAK;AACxC,MAAM,gBAAgB,EAAE,UAAU,EAAE;AAKpC,MAAM,YAAY,MAAc,KAAK,MAAM,IAAI,GAAG,IAAI;AAEtD,MAAM,SAAS,QAAgB,QAAgB;CAC7C,MAAM,MAAO,MAAM,KAAK,KAAM;CAC9B,OAAO;EACL,GAAG,SAAS,SAAS,SAAS,KAAK,IAAI,GAAG,CAAC;EAC3C,GAAG,SAAS,SAAS,SAAS,KAAK,IAAI,GAAG,CAAC;CAC7C;AACF;AAEA,MAAM,SAAS,QAAgB,QAAgB;CAC7C,MAAM,EAAE,GAAG,MAAM,MAAM,QAAQ,GAAG;CAClC,OAAO,GAAG,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC;AACvC;AAIA,MAAM,OAAO,UAAkB,IAAK,QAAQ,OAAQ,IAAA,CAAK,QAAQ,CAAC,EAAE;AAyBpE,MAAM,gBAAgB,SAAiB,KAAK,QAAQ,MAAM,MAAG;AAE7D,MAAM,YAAY,SAAoB,aAAa,KAAK,MAAM,QAAQ,KAAK;;AAG3E,MAAM,YAAY,SAChB,KAAK,SAAS,KAAK,OAAO,2BAA2B,KAAK,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AM,MAAM;KAAO,OAAO;IAAE;IACpC,QAAQ;GACV;GACA;IACE,IAAI;IACJ,MAAM;KAAE,MAAM,MAAM;KAAW,OAAO;IAAE;IACxC,MAAM;KAAE,MAAM,MAAM;KAAS,OAAO;IAAE;IACtC,QAAQ;GACV;EACF;CACF;CACA;EACE,MAAM;EACN,SAAS,CACP;GACE,IAAI;GACJ,MAAM;IAAE,MAAM,MAAM;IAAO,OAAO;GAAE;GACpC,MAAM;IAAE,MAAM,MAAM;IAAQ,OAAO;GAAE;GACrC,QAAQ;EACV,GACA;GACE,IAAI;GACJ,MAAM;IAAE,MAAM,MAAM;IAAQ,OAAO;IAAG,WAAW;GAAE;GACnD,MAAM;IAAE,MAAM,MAAM;IAAW,OAAO;IAAG,WAAW;GAAE;GACtD,QAAQ;EACV,CACF;CACF;CACA;EACE,MAAM;EACN,SAAS,CACP;GACE,IAAI;GACJ,MAAM;IAAE,MAAM,MAAM;IAAO,OAAO;GAAE;GACpC,MAAM;IAAE,MAAM,MAAM;IAAW,OAAO;GAAE;GACxC,QAAQ;EACV,CACF;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"morphing-lightbox.d.ts","names":[],"sources":["../../../src/components/motion/morphing-lightbox.tsx"],"mappings":";;;iBA+BiB;EACf;EACA;EACA;;EAEA;EACA;EACA;;iBAGe;EACf,QAAQ;EACR;EACA;EACA,iBAAiB;EACjB;EACA;EACA;EACA,iBAAiB,OAAO,kBAAkB;;EAE1C,WAAW;;YAkCD,mBAAmB;YACnB,mBAAmB;;wBAuBf;UAAA;;SAAA;;;;EAZD,SAAA;;;;;;wBA6BC,cACd,QACA,OAAO,iBACP,cACA,eACA,OACA,WACA,oBACA,eACA,YACC,mCAAgB,IAAA;wBAqEH,qBAAqB,cAAc,SAAS,mDAAgC,IAAA;iBAW3E,kCAAkC,KAAK;EACtD;EACA;EACA,WAAW;;;wBAIG,uBACd,SACA,WACA,gBACA,UACA,SACA,aACG,SACF,4CAAyB,IAAA;wBAuCZ,qBAAqB,cAAc,SAAS,gDAA6B,IAAA;wBASzE,qBACd,WACA,aACG,SACF,+CAA4B,IAAA;KAc1B,oBAAoB;wBA0CT,iBAAiB,OAAO,oCAAiB,IAAA;wBAGzC,oBAAoB,OAAO,oCAAiB,IAAA;wBAG5C,gBAAgB,OAAO,oCAAiB,IAAA;iBAIvC;EACf;;EAEA,SAAS;;EAET,WAAW;;;wBAIG,qBAAqB,WAAW,QAAQ,YAAY,0CAAuB"}
1
+ {"version":3,"file":"morphing-lightbox.d.ts","names":[],"sources":["../../../src/components/motion/morphing-lightbox.tsx"],"mappings":";;;iBA+BiB;EACf;EACA;EACA;;EAEA;EACA;EACA;;iBAGe;EACf,QAAQ;EACR;EACA;EACA,iBAAiB;EACjB;EACA;EACA;EACA,iBAAiB,OAAO,kBAAkB;;EAE1C,WAAW;;YAkCD,mBAAmB;YACnB,mBAAmB;;wBAuBf;;;;;;;EAZD,SAAA;;;;;;wBA6BC,cACd,QACA,OAAO,iBACP,cACA,eACA,OACA,WACA,oBACA,eACA,YACC,mCAAgB,IAAA;wBAqEH,qBAAqB,cAAc,SAAS,mDAAgC,IAAA;iBAW3E,kCAAkC,KAAK;EACtD;EACA;EACA,WAAW;;;wBAIG,uBACd,SACA,WACA,gBACA,UACA,SACA,aACG,SACF,4CAAyB,IAAA;wBAuCZ,qBAAqB,cAAc,SAAS,gDAA6B,IAAA;wBASzE,qBACd,WACA,aACG,SACF,+CAA4B,IAAA;KAc1B,oBAAoB;wBA0CT,iBAAiB,OAAO,oCAAiB,IAAA;wBAGzC,oBAAoB,OAAO,oCAAiB,IAAA;wBAG5C,gBAAgB,OAAO,oCAAiB,IAAA;iBAIvC;EACf;;EAEA,SAAS;;EAET,WAAW;;;wBAIG,qBAAqB,WAAW,QAAQ,YAAY,0CAAuB"}
@@ -6,8 +6,8 @@ import { createContext, useContext, useEffect, useId, useLayoutEffect, useRef, u
6
6
  import { cn } from "@kumix/utils";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
8
  import { AnimatePresence, LayoutGroup, motion, useIsPresent, useMotionValue, useReducedMotion } from "motion/react";
9
- import { ChevronLeft, ChevronRight, Minus, Plus, X } from "lucide-react";
10
9
  import { createPortal } from "react-dom";
10
+ import { ChevronLeft, ChevronRight, Minus, Plus, X } from "lucide-react";
11
11
  //#region src/components/motion/morphing-lightbox.tsx
12
12
  const IMAGE_SLIDE_TRANSITION = {
13
13
  type: "tween",
@@ -7,8 +7,13 @@ export interface MorphingModalProps {
7
7
  children: ReactNode;
8
8
  /** "bottom" anchors to the viewport bottom (mobile-like). "center" centers vertically. */
9
9
  placement?: "bottom" | "center";
10
+ /**
11
+ * Accessible name for the dialog. Without it, the dialog is named by the
12
+ * first heading in the current view.
13
+ */
14
+ ariaLabel?: string;
10
15
  className?: string;
11
16
  }
12
- export declare function MorphingModal({ viewId, onClose, children, placement, className }: MorphingModalProps): import("react").JSX.Element;
17
+ export declare function MorphingModal({ viewId, onClose, children, placement, ariaLabel, className }: MorphingModalProps): import("react").JSX.Element;
13
18
  //#endregion
14
19
  //# sourceMappingURL=morphing-modal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"morphing-modal.d.ts","names":[],"sources":["../../../src/components/motion/morphing-modal.tsx"],"mappings":";;iBASiB;;EAEf;EACA;EACA,UAAU;;EAEV;EACA;;wBAGc,gBACd,QACA,SACA,UACA,WACA,aACC,qCAAkB,IAAA"}
1
+ {"version":3,"file":"morphing-modal.d.ts","names":[],"sources":["../../../src/components/motion/morphing-modal.tsx"],"mappings":";;iBAUiB;;EAEf;EACA;EACA,UAAU;;EAEV;;;;;EAKA;EACA;;wBAGc,gBACd,QACA,SACA,UACA,WACA,WACA,aACC,qCAAkB,IAAA"}