@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
@@ -22,7 +22,8 @@ function createStore() {
22
22
  return {
23
23
  pages: /* @__PURE__ */ new Map(),
24
24
  states: /* @__PURE__ */ new Map(),
25
- detached: /* @__PURE__ */ new Map()
25
+ detached: /* @__PURE__ */ new Map(),
26
+ links: /* @__PURE__ */ new Map()
26
27
  };
27
28
  }
28
29
  function sameLoadState(a, b) {
@@ -39,9 +40,8 @@ function withLoadState(store, key, update) {
39
40
  const states = new Map(store.states);
40
41
  states.set(key, next);
41
42
  return {
42
- pages: store.pages,
43
- states,
44
- detached: store.detached
43
+ ...store,
44
+ states
45
45
  };
46
46
  }
47
47
  function withPage(store, key, items, options) {
@@ -63,9 +63,9 @@ function withPage(store, key, items, options) {
63
63
  cursor: options.cursor
64
64
  });
65
65
  return {
66
+ ...store,
66
67
  pages,
67
- states,
68
- detached: store.detached
68
+ states
69
69
  };
70
70
  }
71
71
  function withDetached(store, items) {
@@ -77,32 +77,29 @@ function withDetached(store, items) {
77
77
  }
78
78
  if (!detached) return store;
79
79
  return {
80
- pages: store.pages,
81
- states: store.states,
80
+ ...store,
82
81
  detached
83
82
  };
84
83
  }
85
84
  /**
86
- * Places a resolved ancestor chain into `pages`, root first. Writes no
87
- * `states`, so those levels still read as unloaded and a drill-in still fetches
88
- * for real. Mirrored into `detached` so the trigger keeps its label.
85
+ * Records a resolved ancestor chain, root first, as `detached` nodes plus
86
+ * `links`, never as rows in `pages`: a stub there made an unloaded level read
87
+ * as loaded. Writes no `states`, so every level on it still fetches for real.
89
88
  */
90
89
  function withChain(store, chain) {
91
90
  if (chain.length === 0) return store;
92
- const pages = new Map(store.pages);
93
91
  const detached = new Map(store.detached);
92
+ const links = new Map(store.links);
94
93
  let parentKey = CASCADER_ROOT_KEY;
95
94
  for (const node of chain) {
96
- const bucket = pages.get(parentKey);
97
- if (!bucket) pages.set(parentKey, [node]);
98
- else if (!bucket.some((entry) => entry.value === node.value)) pages.set(parentKey, [...bucket, node]);
99
95
  detached.set(node.value, node);
96
+ links.set(node.value, parentKey);
100
97
  parentKey = node.value;
101
98
  }
102
99
  return {
103
- pages,
104
- states: store.states,
105
- detached
100
+ ...store,
101
+ detached,
102
+ links
106
103
  };
107
104
  }
108
105
  /**
@@ -127,7 +124,8 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
127
124
  resolveValue,
128
125
  onLoadError,
129
126
  prefetch,
130
- path
127
+ path,
128
+ query
131
129
  });
132
130
  React$1.useEffect(() => {
133
131
  latest.current = {
@@ -138,7 +136,8 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
138
136
  resolveValue,
139
137
  onLoadError,
140
138
  prefetch,
141
- path
139
+ path,
140
+ query
142
141
  };
143
142
  });
144
143
  /** One AbortController PER KEY: columns mode runs several levels at once. */
@@ -157,6 +156,12 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
157
156
  const moreLatch = React$1.useRef(/* @__PURE__ */ new Map());
158
157
  /** Values `resolveValue` has already been asked about, so it asks once. */
159
158
  const attempted = React$1.useRef(/* @__PURE__ */ new Set());
159
+ /**
160
+ * Values whose resolve failed. They stay `attempted` until the next open
161
+ * rather than the next values pass: with inline `items` every parent render
162
+ * is one, and an `onLoadError` that set parent state looped at network speed.
163
+ */
164
+ const failed = React$1.useRef(/* @__PURE__ */ new Set());
160
165
  /** Every node the loader has seen, so a level key can name its own node. */
161
166
  const known = React$1.useRef(/* @__PURE__ */ new Map());
162
167
  const timers = React$1.useRef({ prefetch: null });
@@ -191,7 +196,10 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
191
196
  const requestId = (requestIds.current.get(key) ?? 0) + 1;
192
197
  requestIds.current.set(key, requestId);
193
198
  const startEpoch = epoch.current;
194
- const node = key === "\0root" ? null : currentBase.byValue.get(key) ?? known.current.get(key) ?? null;
199
+ const node = key === "\0root" ? null : currentBase.byValue.get(key) ?? known.current.get(key) ?? {
200
+ value: key,
201
+ label: key
202
+ };
195
203
  setStore((prev) => withLoadState(prev, key, (state) => ({
196
204
  ...state,
197
205
  loading: true,
@@ -260,8 +268,9 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
260
268
  runLoad(key, "retry", loaded > 0 ? state.cursor : void 0, loaded > 0);
261
269
  }, [runLoad]);
262
270
  /**
263
- * `detached` is deliberately untouched: chains and search hits belong to no
264
- * level, and the trigger needs their labels while the new page is in flight.
271
+ * `detached` and `links` are deliberately untouched: chains and search hits
272
+ * belong to no level, and the trigger needs their path while the new page is
273
+ * in flight.
265
274
  */
266
275
  const invalidateLevel = React$1.useCallback((value) => {
267
276
  const key = value ?? "\0root";
@@ -275,9 +284,9 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
275
284
  const pages = new Map(prev.pages);
276
285
  pages.delete(key);
277
286
  return {
287
+ ...prev,
278
288
  pages,
279
- states,
280
- detached: prev.detached
289
+ states
281
290
  };
282
291
  });
283
292
  }, [abortKey]);
@@ -343,6 +352,10 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
343
352
  });
344
353
  });
345
354
  }, [abortKey, remember]);
355
+ const retrySearch = React$1.useCallback(() => {
356
+ const text = latest.current.query.trim();
357
+ if (text) runSearch(text);
358
+ }, [runSearch]);
346
359
  const runResolve = React$1.useCallback((value) => {
347
360
  const { resolveValue: resolver } = latest.current;
348
361
  if (!resolver) return;
@@ -364,8 +377,9 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
364
377
  remember(chain);
365
378
  setStore((prev) => withChain(prev, chain));
366
379
  }).catch((error) => {
380
+ const live = controllers.current.get(key) === controller;
367
381
  settle();
368
- attempted.current.delete(value);
382
+ if (live) failed.current.add(value);
369
383
  if (controller.signal.aborted || startEpoch !== epoch.current) return;
370
384
  latest.current.onLoadError?.(error, {
371
385
  parent: null,
@@ -373,10 +387,12 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
373
387
  });
374
388
  });
375
389
  }, [abortKey, remember]);
376
- const cancelAll = React$1.useCallback(() => {
377
- const keys = Array.from(controllers.current.keys());
378
- for (const controller of controllers.current.values()) controller.abort();
379
- controllers.current.clear();
390
+ const cancelPanel = React$1.useCallback(() => {
391
+ const keys = Array.from(controllers.current.keys()).filter((key) => !key.startsWith(RESOLVE_PREFIX));
392
+ for (const key of keys) {
393
+ controllers.current.get(key)?.abort();
394
+ controllers.current.delete(key);
395
+ }
380
396
  inflight.current.clear();
381
397
  const holder = timers.current;
382
398
  if (holder.prefetch) {
@@ -417,6 +433,7 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
417
433
  inflight.current.clear();
418
434
  moreLatch.current.clear();
419
435
  attempted.current.clear();
436
+ failed.current.clear();
420
437
  known.current.clear();
421
438
  const holder = timers.current;
422
439
  if (holder.prefetch) {
@@ -429,18 +446,22 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
429
446
  React$1.useEffect(() => {
430
447
  if (enabled) return;
431
448
  if (controllers.current.size === 0) return;
432
- cancelAll();
433
- }, [enabled, cancelAll]);
449
+ cancelPanel();
450
+ }, [enabled, cancelPanel]);
434
451
  React$1.useEffect(() => {
435
452
  const active = controllers.current;
436
453
  const holder = timers.current;
437
454
  const pending = inflight.current;
438
455
  const ids = requestIds.current;
456
+ const tried = attempted.current;
457
+ const parked = failed.current;
439
458
  return () => {
440
459
  for (const controller of active.values()) controller.abort();
441
460
  active.clear();
442
461
  pending.clear();
443
462
  ids.clear();
463
+ tried.clear();
464
+ parked.clear();
444
465
  if (holder.prefetch) clearTimeout(holder.prefetch);
445
466
  };
446
467
  }, []);
@@ -478,7 +499,12 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
478
499
  runSearch
479
500
  ]);
480
501
  React$1.useEffect(() => {
481
- if (!enabled || !hasResolve) return;
502
+ if (!enabled || failed.current.size === 0) return;
503
+ for (const value of failed.current) attempted.current.delete(value);
504
+ failed.current.clear();
505
+ }, [enabled]);
506
+ React$1.useEffect(() => {
507
+ if (!hasResolve) return;
482
508
  for (const value of values) {
483
509
  if (!value) continue;
484
510
  if (attempted.current.has(value)) continue;
@@ -487,7 +513,6 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
487
513
  runResolve(value);
488
514
  }
489
515
  }, [
490
- enabled,
491
516
  hasResolve,
492
517
  base,
493
518
  runResolve,
@@ -524,6 +549,7 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
524
549
  ensureLevel,
525
550
  loadMore,
526
551
  retryLevel,
552
+ retrySearch,
527
553
  invalidateLevel,
528
554
  prefetchNode
529
555
  }), [
@@ -534,6 +560,7 @@ function useCascaderLoader({ base, getChildren, onSearch, resolveValue, searchDe
534
560
  ensureLevel,
535
561
  loadMore,
536
562
  retryLevel,
563
+ retrySearch,
537
564
  invalidateLevel,
538
565
  prefetchNode
539
566
  ]);
@@ -1 +1 @@
1
- {"version":3,"file":"cascader-async.js","names":["React"],"sources":["../../../../src/components/reui/cascader/cascader-async.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { useCascaderState } from \"./cascader-context\";\nimport { CASCADER_ROOT_KEY, isCascaderMoreNode } from \"./cascader-lib\";\nimport type {\n CascaderIndex,\n CascaderLoadContext,\n CascaderLoadReason,\n CascaderLoadResult,\n CascaderLoadState,\n CascaderNode,\n CascaderSearchContext,\n} from \"./cascader-types\";\n\n/**\n * Async data for the cascader. Loaded pages live in their own store and are\n * MERGED onto the index built from `items`, never folded into that build:\n * `items` changes identity on any parent re-render, and folding would discard\n * every level the user drilled into. Map membership is the load discriminator:\n * no `states` entry means never fetched, while an entry with no `loading`, no\n * `error` and no children means empty for real.\n */\n\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\n/** Fetches one level. `node` is `null` for the root level. */\nexport type CascaderGetChildren<T = unknown> = (\n node: CascaderNode<T> | null,\n context: CascaderLoadContext,\n) => CascaderNode<T>[] | CascaderLoadResult<T> | Promise<CascaderNode<T>[] | CascaderLoadResult<T>>;\n\n/** Server-side search, replacing the local index scan while the query is set. */\nexport type CascaderOnSearch<T = unknown> = (\n query: string,\n context: CascaderSearchContext,\n) => CascaderNode<T>[] | CascaderLoadResult<T> | Promise<CascaderNode<T>[] | CascaderLoadResult<T>>;\n\n/** Resolves a selected value to its ancestor chain, root first, node last. */\nexport type CascaderResolveValue<T = unknown> = (\n value: string,\n context: CascaderLoadContext,\n) => CascaderNode<T>[] | Promise<CascaderNode<T>[]>;\n\nexport interface CascaderLoaderStore<T = unknown> {\n /** Keyed by LEVEL: a parent's value, or `CASCADER_ROOT_KEY` for the root. */\n pages: Map<string, CascaderNode<T>[]>;\n states: Map<string, CascaderLoadState>;\n /** Keyed by node value: search hits and resolved selections, level-less. */\n detached: Map<string, CascaderNode<T>>;\n}\n\nexport interface UseCascaderLoaderOptions<T = unknown> {\n /** The index built from `items`, before any pages are merged in. */\n base: CascaderIndex<T>;\n getChildren?: CascaderGetChildren<T>;\n onSearch?: CascaderOnSearch<T>;\n resolveValue?: CascaderResolveValue<T>;\n /** Milliseconds of quiet before `onSearch` fires. */\n searchDebounce?: number;\n /** Changing this drops every cached page, state and detached node. */\n loadKey?: unknown;\n /** Speculatively fetch a branch's children when it is highlighted. */\n prefetch?: boolean;\n /** Called when a request fails. Never for an aborted or superseded one. */\n onLoadError?: (error: unknown, context: { parent: string | null; reason: string }) => void;\n /** Whether the panel is live: the popup is open, or the cascader is inline. */\n enabled: boolean;\n query: string;\n /** Level keys that are currently on screen. Root is `CASCADER_ROOT_KEY`. */\n levels: string[];\n /** Handed to `onSearch` as its scope and read for nothing else: the\n * navigation path, or `[]` when the search covers the whole tree. */\n path: string[];\n /** Current selection, for `resolveValue`. */\n values: string[];\n}\n\nexport interface CascaderLoader<T = unknown> {\n /** Whether a `getChildren` loader is configured at all. */\n active: boolean;\n store: CascaderLoaderStore<T>;\n states: ReadonlyMap<string, CascaderLoadState>;\n /**\n * Async search hits, `null` when no `onSearch` is running. EMPTY while the\n * first request is in flight, so the level behind is not shown as the answer.\n */\n searchResults: CascaderNode<T>[] | null;\n searchState: CascaderLoadState | null;\n /**\n * Fetches a level's FIRST page. No-ops on a `states` entry (in flight,\n * loaded or failed) or when `items` fills the level; pages are never\n * consulted, so a `resolveValue` chain still fetches. The level effect fires\n * only for on-screen levels, so a branch merely PRESSED is asked for by hand.\n */\n ensureLevel: (parentKey: string, reason: CascaderLoadReason) => void;\n /** Fetches the next page of a level. No-ops unless one is available. */\n loadMore: (parentKey: string) => void;\n /** Refires a failed level. No-ops unless that level is in an error state. */\n retryLevel: (parentKey: string) => void;\n /** Schedules a speculative fetch. Safe to call on every highlight move. */\n prefetchNode: (node: CascaderNode<T> | null | undefined) => void;\n /**\n * Evicts ONE level: aborts its request, drops its `states`/`pages` entries\n * and paging latch, so the level effect refetches it. `null` = root level.\n */\n invalidateLevel: (value: string | null) => void;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Constants */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Highlight dwell before `prefetch` fetches: long enough that holding ArrowDown\n * does not fire a request per row, short enough to beat the ArrowRight press.\n */\nconst PREFETCH_DELAY = 150;\n\n/** Request keys for the two non-level requests. Never collide with a value. */\nconst SEARCH_KEY = \"\\u0000search\";\nconst RESOLVE_PREFIX = \"\\u0000resolve:\";\n\nconst NO_STATE: CascaderLoadState = {\n loading: false,\n error: false,\n hasMore: false,\n};\n\n/** Stable empty result, so an idle search never churns the state context. */\nconst NO_RESULTS: CascaderNode<never>[] = [];\n\nfunction createStore<T>(): CascaderLoaderStore<T> {\n return { pages: new Map(), states: new Map(), detached: new Map() };\n}\n\nfunction sameLoadState(a: CascaderLoadState, b: CascaderLoadState): boolean {\n return (\n a.loading === b.loading &&\n a.error === b.error &&\n a.hasMore === b.hasMore &&\n a.cursor === b.cursor\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Store transitions */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Copy-on-write, and a NO-OP when nothing changed: the merged index is memoised\n * on store identity, so a fresh object for an unchanged state would rebuild it.\n */\nfunction withLoadState<T>(\n store: CascaderLoaderStore<T>,\n key: string,\n update: (state: CascaderLoadState) => CascaderLoadState,\n): CascaderLoaderStore<T> {\n const current = store.states.get(key) ?? NO_STATE;\n const next = update(current);\n if (store.states.has(key) && sameLoadState(current, next)) return store;\n const states = new Map(store.states);\n states.set(key, next);\n return { pages: store.pages, states, detached: store.detached };\n}\n\nfunction withPage<T>(\n store: CascaderLoaderStore<T>,\n key: string,\n items: readonly CascaderNode<T>[],\n options: { append: boolean; hasMore: boolean; cursor?: string },\n): CascaderLoaderStore<T> {\n // A fresh level REPLACES its page so a `resolveValue` stub can be superseded.\n const previous = options.append ? (store.pages.get(key) ?? []) : [];\n const seen = new Set(previous.map((node) => node.value));\n const merged = previous.slice();\n for (const item of items) {\n if (seen.has(item.value)) continue;\n seen.add(item.value);\n merged.push(item);\n }\n\n const pages = new Map(store.pages);\n pages.set(key, merged);\n const states = new Map(store.states);\n states.set(key, {\n loading: false,\n error: false,\n hasMore: options.hasMore,\n cursor: options.cursor,\n });\n return { pages, states, detached: store.detached };\n}\n\nfunction withDetached<T>(\n store: CascaderLoaderStore<T>,\n items: readonly CascaderNode<T>[],\n): CascaderLoaderStore<T> {\n let detached: Map<string, CascaderNode<T>> | null = null;\n for (const item of items) {\n if (store.detached.get(item.value) === item) continue;\n detached = detached ?? new Map(store.detached);\n detached.set(item.value, item);\n }\n if (!detached) return store;\n return { pages: store.pages, states: store.states, detached };\n}\n\n/**\n * Places a resolved ancestor chain into `pages`, root first. Writes no\n * `states`, so those levels still read as unloaded and a drill-in still fetches\n * for real. Mirrored into `detached` so the trigger keeps its label.\n */\nfunction withChain<T>(\n store: CascaderLoaderStore<T>,\n chain: readonly CascaderNode<T>[],\n): CascaderLoaderStore<T> {\n if (chain.length === 0) return store;\n const pages = new Map(store.pages);\n const detached = new Map(store.detached);\n let parentKey = CASCADER_ROOT_KEY;\n\n for (const node of chain) {\n const bucket = pages.get(parentKey);\n if (!bucket) {\n pages.set(parentKey, [node]);\n } else if (!bucket.some((entry) => entry.value === node.value)) {\n pages.set(parentKey, [...bucket, node]);\n }\n detached.set(node.value, node);\n parentKey = node.value;\n }\n\n return { pages, states: store.states, detached };\n}\n\n/* -------------------------------------------------------------------------- */\n/* Hook */\n/* -------------------------------------------------------------------------- */\n\ninterface CascaderLoaderLatest<T> {\n base: CascaderIndex<T>;\n store: CascaderLoaderStore<T>;\n getChildren?: CascaderGetChildren<T>;\n onSearch?: CascaderOnSearch<T>;\n resolveValue?: CascaderResolveValue<T>;\n onLoadError?: (error: unknown, context: { parent: string | null; reason: string }) => void;\n prefetch: boolean;\n path: string[];\n}\n\ninterface CascaderSearchSlice<T> {\n query: string;\n results: CascaderNode<T>[];\n loading: boolean;\n error: boolean;\n}\n\n/**\n * The loader. A SIBLING of the `buildCascaderIndex` memo, never inside it: the\n * build stays pure in `items`, the merge pure in that build plus this store.\n */\nexport function useCascaderLoader<T = unknown>({\n base,\n getChildren,\n onSearch,\n resolveValue,\n searchDebounce = 250,\n loadKey,\n prefetch = false,\n onLoadError,\n enabled,\n query,\n levels,\n path,\n values,\n}: UseCascaderLoaderOptions<T>): CascaderLoader<T> {\n const [store, setStore] = React.useState<CascaderLoaderStore<T>>(createStore);\n const [search, setSearch] = React.useState<CascaderSearchSlice<T> | null>(null);\n\n /**\n * Latest callbacks, WRITTEN IN AN EFFECT: `getChildren` is inline in most\n * consumers, so closing over it would refire every in-flight request per\n * re-render. The ref is what keeps the request machinery `[]`-dep. Declared\n * FIRST, since effects run in declaration order, so the level effect below\n * already sees the current commit.\n */\n const latest = React.useRef<CascaderLoaderLatest<T>>({\n base,\n store,\n getChildren,\n onSearch,\n resolveValue,\n onLoadError,\n prefetch,\n path,\n });\n\n React.useEffect(() => {\n latest.current = {\n base,\n store,\n getChildren,\n onSearch,\n resolveValue,\n onLoadError,\n prefetch,\n path,\n };\n });\n\n /** One AbortController PER KEY: columns mode runs several levels at once. */\n const controllers = React.useRef(new Map<string, AbortController>());\n /** Monotonic per key. The stale guard for out-of-order responses. */\n const requestIds = React.useRef(new Map<string, number>());\n /** In-flight `(level, cursor)` signatures, so a duplicate ask is free. */\n const inflight = React.useRef(new Map<string, string>());\n /**\n * The `(child count, cursor)` signature at the last paging fire, per level.\n * Guards what `hasMore` cannot: a page of zero new items while the server\n * still says `hasMore`. Cursor is IN the signature because an all-duplicates\n * page advances it while the count stands still - real progress, which a\n * count-only latch would brick forever.\n */\n const moreLatch = React.useRef(new Map<string, string>());\n /** Values `resolveValue` has already been asked about, so it asks once. */\n const attempted = React.useRef(new Set<string>());\n /** Every node the loader has seen, so a level key can name its own node. */\n const known = React.useRef(new Map<string, CascaderNode<T>>());\n const timers = React.useRef<{\n prefetch: ReturnType<typeof setTimeout> | null;\n }>({ prefetch: null });\n /** Bumped by a `loadKey` change, so responses from before it are dropped. */\n const epoch = React.useRef(0);\n\n const remember = React.useCallback((nodes: readonly CascaderNode<T>[]) => {\n const map = known.current;\n const walk = (list: readonly CascaderNode<T>[]) => {\n for (const node of list) {\n map.set(node.value, node);\n if (node.children?.length) walk(node.children);\n }\n };\n walk(nodes);\n }, []);\n\n const abortKey = React.useCallback((key: string) => {\n const controller = controllers.current.get(key);\n if (!controller) return;\n controllers.current.delete(key);\n inflight.current.delete(key);\n controller.abort();\n }, []);\n\n /* ------------------------------- level load ------------------------------ */\n\n const runLoad = React.useCallback(\n (key: string, reason: CascaderLoadReason, cursor: string | undefined, append: boolean) => {\n const { getChildren: loader, base: currentBase } = latest.current;\n if (!loader) return;\n\n const signature = `${append ? \"1\" : \"0\"}:${cursor ?? \"\"}`;\n if (inflight.current.get(key) === signature) return;\n\n abortKey(key);\n const controller = new AbortController();\n controllers.current.set(key, controller);\n inflight.current.set(key, signature);\n\n const requestId = (requestIds.current.get(key) ?? 0) + 1;\n requestIds.current.set(key, requestId);\n const startEpoch = epoch.current;\n\n const node =\n key === CASCADER_ROOT_KEY\n ? null\n : (currentBase.byValue.get(key) ?? known.current.get(key) ?? null);\n\n setStore((prev) =>\n withLoadState(prev, key, (state) => ({\n ...state,\n loading: true,\n error: false,\n })),\n );\n\n const settle = () => {\n if (inflight.current.get(key) === signature) inflight.current.delete(key);\n if (controllers.current.get(key) === controller) {\n controllers.current.delete(key);\n }\n };\n\n const stale = () =>\n controller.signal.aborted ||\n startEpoch !== epoch.current ||\n requestId !== requestIds.current.get(key);\n\n // `Promise.resolve().then(...)`, not a direct call: it normalises a\n // SYNCHRONOUS throw into a rejection instead of taking the render down.\n Promise.resolve()\n .then(() => loader(node, { signal: controller.signal, cursor, reason }))\n .then((result) => {\n settle();\n if (stale()) return;\n const items = Array.isArray(result) ? result : result.items;\n const nextCursor = Array.isArray(result) ? undefined : result.nextCursor;\n const hasMore = Array.isArray(result) ? false : (result.hasMore ?? nextCursor != null);\n\n if (!append) moreLatch.current.delete(key);\n remember(items);\n setStore((prev) => withPage(prev, key, items, { append, hasMore, cursor: nextCursor }));\n })\n .catch((error: unknown) => {\n settle();\n if (stale()) return;\n setStore((prev) =>\n withLoadState(prev, key, (state) => ({\n ...state,\n loading: false,\n error: true,\n })),\n );\n // Behind the stale guard: an abort is navigation, not a failure.\n latest.current.onLoadError?.(error, {\n parent: key === CASCADER_ROOT_KEY ? null : key,\n reason,\n });\n });\n },\n [abortKey, remember],\n );\n\n const ensureLevel = React.useCallback(\n (key: string, reason: CascaderLoadReason) => {\n const { getChildren: loader, store: current, base: index } = latest.current;\n if (!loader) return;\n if (current.states.has(key)) return;\n // A level `items` already fills is not the loader's business: that is how\n // a static root plus `getChildren` for the branches works with no flag.\n if (index.childrenOf.has(key)) return;\n runLoad(key, reason, undefined, false);\n },\n [runLoad],\n );\n\n const loadMore = React.useCallback(\n (key: string) => {\n const { getChildren: loader, store: current } = latest.current;\n if (!loader) return;\n const state = current.states.get(key);\n if (!state || state.loading || !state.hasMore) return;\n\n const loaded = current.pages.get(key)?.length ?? 0;\n const signature = `${loaded}:${state.cursor ?? \"\"}`;\n if (moreLatch.current.get(key) === signature) return;\n moreLatch.current.set(key, signature);\n\n runLoad(key, \"more\", state.cursor, true);\n },\n [runLoad],\n );\n\n const retryLevel = React.useCallback(\n (key: string) => {\n const { getChildren: loader, store: current } = latest.current;\n if (!loader) return;\n const state = current.states.get(key);\n if (!state?.error) return;\n\n const loaded = current.pages.get(key)?.length ?? 0;\n // A retry must be able to re-fire the page the latch just blocked.\n moreLatch.current.delete(key);\n runLoad(key, \"retry\", loaded > 0 ? state.cursor : undefined, loaded > 0);\n },\n [runLoad],\n );\n\n /**\n * `detached` is deliberately untouched: chains and search hits belong to no\n * level, and the trigger needs their labels while the new page is in flight.\n */\n const invalidateLevel = React.useCallback(\n (value: string | null) => {\n const key = value ?? CASCADER_ROOT_KEY;\n abortKey(key);\n // Bump the id too: a response past its signal check must still be stale.\n requestIds.current.set(key, (requestIds.current.get(key) ?? 0) + 1);\n moreLatch.current.delete(key);\n setStore((prev) => {\n if (!prev.states.has(key) && !prev.pages.has(key)) return prev;\n const states = new Map(prev.states);\n states.delete(key);\n const pages = new Map(prev.pages);\n pages.delete(key);\n return { pages, states, detached: prev.detached };\n });\n },\n [abortKey],\n );\n\n const prefetchNode = React.useCallback(\n (node: CascaderNode<T> | null | undefined) => {\n const { prefetch: on, getChildren: loader, store: current } = latest.current;\n if (!on || !loader || !node) return;\n if (isCascaderMoreNode(node)) return;\n if (!node.hasChildren) return;\n if (current.states.has(node.value)) return;\n\n const holder = timers.current;\n if (holder.prefetch) clearTimeout(holder.prefetch);\n // A TIMEOUT, not a direct call: `onItemHighlighted` fires from a layout\n // effect, where a synchronous setState is a render-phase cascade.\n holder.prefetch = setTimeout(() => {\n holder.prefetch = null;\n ensureLevel(node.value, \"prefetch\");\n }, PREFETCH_DELAY);\n },\n [ensureLevel],\n );\n\n /* --------------------------------- search -------------------------------- */\n\n const runSearch = React.useCallback(\n (text: string) => {\n const { onSearch: searcher, path: currentPath } = latest.current;\n if (!searcher) return;\n\n abortKey(SEARCH_KEY);\n const controller = new AbortController();\n controllers.current.set(SEARCH_KEY, controller);\n const requestId = (requestIds.current.get(SEARCH_KEY) ?? 0) + 1;\n requestIds.current.set(SEARCH_KEY, requestId);\n const startEpoch = epoch.current;\n\n setSearch((prev) => ({\n query: text,\n results: prev?.results ?? [],\n loading: true,\n error: false,\n }));\n\n const settle = () => {\n if (controllers.current.get(SEARCH_KEY) === controller) {\n controllers.current.delete(SEARCH_KEY);\n }\n };\n const stale = () =>\n controller.signal.aborted ||\n startEpoch !== epoch.current ||\n requestId !== requestIds.current.get(SEARCH_KEY);\n\n Promise.resolve()\n .then(() => searcher(text, { signal: controller.signal, path: currentPath }))\n .then((result) => {\n settle();\n if (stale()) return;\n const items = Array.isArray(result) ? result : result.items;\n remember(items);\n // Search hits go to `detached`, never a level: a hit lives anywhere in\n // the tree, and filing it under the open level would misplace it.\n setStore((prev) => withDetached(prev, items));\n setSearch({\n query: text,\n results: items,\n loading: false,\n error: false,\n });\n })\n .catch((error: unknown) => {\n settle();\n if (stale()) return;\n setSearch((prev) => ({\n query: text,\n results: prev?.results ?? [],\n loading: false,\n error: true,\n }));\n latest.current.onLoadError?.(error, {\n parent: null,\n reason: \"search\",\n });\n });\n },\n [abortKey, remember],\n );\n\n /* --------------------------------- resolve ------------------------------- */\n\n const runResolve = React.useCallback(\n (value: string) => {\n const { resolveValue: resolver } = latest.current;\n if (!resolver) return;\n\n const key = `${RESOLVE_PREFIX}${value}`;\n abortKey(key);\n const controller = new AbortController();\n controllers.current.set(key, controller);\n const startEpoch = epoch.current;\n\n const settle = () => {\n if (controllers.current.get(key) === controller) {\n controllers.current.delete(key);\n }\n };\n\n Promise.resolve()\n .then(() => resolver(value, { signal: controller.signal, reason: \"resolve\" }))\n .then((chain) => {\n settle();\n if (controller.signal.aborted || startEpoch !== epoch.current) return;\n if (!chain?.length) return;\n remember(chain);\n setStore((prev) => withChain(prev, chain));\n })\n .catch((error: unknown) => {\n settle();\n // Un-attempt on failure: `attempted` is written BEFORE the call, so\n // without this a resolver that failed once could never be retried.\n attempted.current.delete(value);\n if (controller.signal.aborted || startEpoch !== epoch.current) return;\n latest.current.onLoadError?.(error, {\n parent: null,\n reason: \"resolve\",\n });\n });\n },\n [abortKey, remember],\n );\n\n /* --------------------------------- resets -------------------------------- */\n\n const cancelAll = React.useCallback(() => {\n const keys = Array.from(controllers.current.keys());\n for (const controller of controllers.current.values()) controller.abort();\n controllers.current.clear();\n inflight.current.clear();\n\n const holder = timers.current;\n if (holder.prefetch) {\n clearTimeout(holder.prefetch);\n holder.prefetch = null;\n }\n if (keys.length === 0) return;\n\n setStore((prev) => {\n let states: Map<string, CascaderLoadState> | null = null;\n for (const key of keys) {\n const state = prev.states.get(key);\n if (!state?.loading) continue;\n states = states ?? new Map(prev.states);\n if ((prev.pages.get(key)?.length ?? 0) > 0) {\n states.set(key, { ...state, loading: false });\n } else {\n // No entry AT ALL: membership is what says \"loaded\", so a stranded\n // `loading: true` would read as loaded-and-empty forever.\n states.delete(key);\n }\n }\n return states ? { ...prev, states } : prev;\n });\n setSearch((prev) => (prev?.loading ? { ...prev, loading: false } : prev));\n }, []);\n\n // A `loadKey` change drops everything. Declared BEFORE the level effect, so\n // a reset always lands before the levels are asked for again.\n const loadKeyRef = React.useRef<{ key: unknown } | null>(null);\n React.useEffect(() => {\n const previous = loadKeyRef.current;\n loadKeyRef.current = { key: loadKey };\n if (!previous || Object.is(previous.key, loadKey)) return;\n\n epoch.current += 1;\n for (const controller of controllers.current.values()) controller.abort();\n controllers.current.clear();\n inflight.current.clear();\n // `requestIds` is deliberately NOT cleared: the ids are stale-response\n // guards, not cache. Reusing an aborted predecessor's id would leave only\n // the epoch bump and the abort to reject the old response; monotonic per\n // key keeps all three guards independent. The unmount cleanup clears them.\n moreLatch.current.clear();\n attempted.current.clear();\n known.current.clear();\n\n const holder = timers.current;\n if (holder.prefetch) {\n clearTimeout(holder.prefetch);\n holder.prefetch = null;\n }\n\n setStore(createStore);\n setSearch(null);\n }, [loadKey]);\n\n // Closing the popup aborts every request but does NOT drop the cache:\n // reopening onto an already-loaded level is the point of keeping it.\n React.useEffect(() => {\n if (enabled) return;\n if (controllers.current.size === 0) return;\n cancelAll();\n }, [enabled, cancelAll]);\n\n React.useEffect(() => {\n const active = controllers.current;\n const holder = timers.current;\n const pending = inflight.current;\n const ids = requestIds.current;\n return () => {\n for (const controller of active.values()) controller.abort();\n active.clear();\n // Cleared WITH the controllers, for StrictMode's dev remount: a stale\n // inflight signature would make `runLoad` skip the refetch forever. The\n // aborted promises are stale-guarded, so emptying the ids is safe.\n pending.clear();\n ids.clear();\n if (holder.prefetch) clearTimeout(holder.prefetch);\n };\n }, []);\n\n /* ------------------------------- the effects ----------------------------- */\n\n const hasLoader = typeof getChildren === \"function\";\n const hasSearch = typeof onSearch === \"function\";\n const hasResolve = typeof resolveValue === \"function\";\n const trimmed = query.trim();\n\n // THE load trigger: one declarative effect on the levels on screen, not a\n // call from `pushLevel`/`navigate`, which a controlled `path` never touches.\n React.useEffect(() => {\n if (!enabled || !hasLoader) return;\n for (const key of levels) ensureLevel(key, \"level\");\n // `levels` enters through `levelsKey`; `store` re-runs after a load lands.\n }, [enabled, hasLoader, ensureLevel, levels]);\n\n React.useEffect(() => {\n if (!hasSearch) return undefined;\n if (!enabled || !trimmed) {\n abortKey(SEARCH_KEY);\n setSearch((prev) => (prev === null ? prev : null));\n return undefined;\n }\n const timer = setTimeout(() => runSearch(trimmed), searchDebounce);\n return () => {\n clearTimeout(timer);\n abortKey(SEARCH_KEY);\n };\n }, [hasSearch, enabled, trimmed, searchDebounce, abortKey, runSearch]);\n\n React.useEffect(() => {\n if (!enabled || !hasResolve) return;\n for (const value of values) {\n if (!value) continue;\n if (attempted.current.has(value)) continue;\n if (base.byValue.has(value) || known.current.has(value)) continue;\n attempted.current.add(value);\n runResolve(value);\n }\n // `values` is depended on through `valuesKey`.\n }, [enabled, hasResolve, base, runResolve, values]);\n\n /* -------------------------------- the value ------------------------------ */\n\n const searchResults = React.useMemo(() => {\n if (!hasSearch || !trimmed) return null;\n if (!search || search.query !== trimmed) {\n return NO_RESULTS as CascaderNode<T>[];\n }\n return search.results;\n }, [hasSearch, trimmed, search]);\n\n const searchState = React.useMemo<CascaderLoadState | null>(() => {\n if (!hasSearch || !trimmed) return null;\n const settled = search?.query === trimmed;\n return {\n loading: !settled || !!search?.loading,\n error: settled && !!search?.error,\n hasMore: false,\n };\n }, [hasSearch, trimmed, search]);\n\n return React.useMemo(\n () => ({\n active: hasLoader,\n store,\n states: store.states,\n searchResults,\n searchState,\n ensureLevel,\n loadMore,\n retryLevel,\n invalidateLevel,\n prefetchNode,\n }),\n [\n hasLoader,\n store,\n searchResults,\n searchState,\n ensureLevel,\n loadMore,\n retryLevel,\n invalidateLevel,\n prefetchNode,\n ],\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Consumers */\n/* -------------------------------------------------------------------------- */\n\n/** One level's load state, `null` when never fetched. Omit for the root. */\nexport function useCascaderLoadState(parent?: string | null): CascaderLoadState | null {\n const { loadStates } = useCascaderState();\n return loadStates.get(parent ?? CASCADER_ROOT_KEY) ?? null;\n}\n"],"mappings":";;;;;;;;;AAwHA,MAAM,iBAAiB;;AAGvB,MAAM,aAAa;AACnB,MAAM,iBAAiB;AAEvB,MAAM,WAA8B;CAClC,SAAS;CACT,OAAO;CACP,SAAS;AACX;;AAGA,MAAM,aAAoC,CAAC;AAE3C,SAAS,cAAyC;CAChD,OAAO;EAAE,uBAAO,IAAI,IAAI;EAAG,wBAAQ,IAAI,IAAI;EAAG,0BAAU,IAAI,IAAI;CAAE;AACpE;AAEA,SAAS,cAAc,GAAsB,GAA+B;CAC1E,OACE,EAAE,YAAY,EAAE,WAChB,EAAE,UAAU,EAAE,SACd,EAAE,YAAY,EAAE,WAChB,EAAE,WAAW,EAAE;AAEnB;;;;;AAUA,SAAS,cACP,OACA,KACA,QACwB;CACxB,MAAM,UAAU,MAAM,OAAO,IAAI,GAAG,KAAK;CACzC,MAAM,OAAO,OAAO,OAAO;CAC3B,IAAI,MAAM,OAAO,IAA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B;CACxC,OAAO,WAAW,IAAI,UAAA,QAA2B,KAAK;AACxD"}
1
+ {"version":3,"file":"cascader-async.js","names":["React"],"sources":["../../../../src/components/reui/cascader/cascader-async.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { useCascaderState } from \"./cascader-context\";\nimport { CASCADER_ROOT_KEY, isCascaderMoreNode } from \"./cascader-lib\";\nimport type {\n CascaderIndex,\n CascaderLoadContext,\n CascaderLoadReason,\n CascaderLoadResult,\n CascaderLoadState,\n CascaderNode,\n CascaderSearchContext,\n} from \"./cascader-types\";\n\n/**\n * Async data for the cascader. Loaded pages live in their own store and are\n * MERGED onto the index built from `items`, never folded into that build:\n * `items` changes identity on any parent re-render, and folding would discard\n * every level the user drilled into. Map membership is the load discriminator:\n * no `states` entry means never fetched, while an entry with no `loading`, no\n * `error` and no children means empty for real.\n */\n\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Fetches one level. `node` is `null` for the root level, and only\n * `{ value, label: value }`, no `data`, for a level on screen whose node has\n * not loaded: a deep link before the level above loads, or a page-loaded\n * level after a `loadKey` change.\n */\nexport type CascaderGetChildren<T = unknown> = (\n node: CascaderNode<T> | null,\n context: CascaderLoadContext,\n) => CascaderNode<T>[] | CascaderLoadResult<T> | Promise<CascaderNode<T>[] | CascaderLoadResult<T>>;\n\n/** Server-side search, replacing the local index scan while the query is set. */\nexport type CascaderOnSearch<T = unknown> = (\n query: string,\n context: CascaderSearchContext,\n) => CascaderNode<T>[] | CascaderLoadResult<T> | Promise<CascaderNode<T>[] | CascaderLoadResult<T>>;\n\n/** Resolves a selected value to its ancestor chain, root first, node last. */\nexport type CascaderResolveValue<T = unknown> = (\n value: string,\n context: CascaderLoadContext,\n) => CascaderNode<T>[] | Promise<CascaderNode<T>[]>;\n\nexport interface CascaderLoaderStore<T = unknown> {\n /** Keyed by LEVEL: a parent's value, or `CASCADER_ROOT_KEY` for the root. */\n pages: Map<string, CascaderNode<T>[]>;\n states: Map<string, CascaderLoadState>;\n /** Keyed by node value: search hits and resolved selections, level-less. */\n detached: Map<string, CascaderNode<T>>;\n /**\n * A resolved chain's parent links, node value to level key. Kept apart from\n * `pages`: a level's first real page replaced a chain stub there, and a node\n * that page left out lost its parent, and the trigger its path.\n */\n links: Map<string, string>;\n}\n\nexport interface UseCascaderLoaderOptions<T = unknown> {\n /** The index built from `items`, before any pages are merged in. */\n base: CascaderIndex<T>;\n getChildren?: CascaderGetChildren<T>;\n onSearch?: CascaderOnSearch<T>;\n resolveValue?: CascaderResolveValue<T>;\n /** Milliseconds of quiet before `onSearch` fires. */\n searchDebounce?: number;\n /** Changing this drops every cached page, state and detached node. */\n loadKey?: unknown;\n /** Speculatively fetch a branch's children when it is highlighted. */\n prefetch?: boolean;\n /** Called when a request fails. Never for an aborted or superseded one. */\n onLoadError?: (error: unknown, context: { parent: string | null; reason: string }) => void;\n /**\n * Whether the panel is live: the popup is open, or the cascader is inline.\n * Gates levels, paging and search. `resolveValue` runs regardless, and\n * retries a failed value when this turns true.\n */\n enabled: boolean;\n query: string;\n /** Level keys that are currently on screen. Root is `CASCADER_ROOT_KEY`. */\n levels: string[];\n /** Handed to `onSearch` as its scope and read for nothing else: the\n * navigation path, or `[]` when the search covers the whole tree. */\n path: string[];\n /** Current selection, for `resolveValue`. */\n values: string[];\n}\n\nexport interface CascaderLoader<T = unknown> {\n /** Whether a `getChildren` loader is configured at all. */\n active: boolean;\n store: CascaderLoaderStore<T>;\n states: ReadonlyMap<string, CascaderLoadState>;\n /**\n * Async search hits, `null` when no `onSearch` is running. EMPTY while the\n * first request is in flight, so the level behind is not shown as the answer.\n */\n searchResults: CascaderNode<T>[] | null;\n searchState: CascaderLoadState | null;\n /**\n * Fetches a level's FIRST page. No-ops on a `states` entry (in flight,\n * loaded or failed) or when `items` fills the level. The level effect fires\n * only for on-screen levels, so a branch merely PRESSED is asked for by hand.\n */\n ensureLevel: (parentKey: string, reason: CascaderLoadReason) => void;\n /** Fetches the next page of a level. No-ops unless one is available. */\n loadMore: (parentKey: string) => void;\n /** Refires a failed level. No-ops unless that level is in an error state. */\n retryLevel: (parentKey: string) => void;\n /** Refires the server search for the current query. No-ops without one. */\n retrySearch: () => void;\n /** Schedules a speculative fetch. Safe to call on every highlight move. */\n prefetchNode: (node: CascaderNode<T> | null | undefined) => void;\n /**\n * Evicts ONE level: aborts its request, drops its `states`/`pages` entries\n * and paging latch, so the level effect refetches it. `null` = root level.\n */\n invalidateLevel: (value: string | null) => void;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Constants */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Highlight dwell before `prefetch` fetches: long enough that holding ArrowDown\n * does not fire a request per row, short enough to beat the ArrowRight press.\n */\nconst PREFETCH_DELAY = 150;\n\n/** Request keys for the two non-level requests. Never collide with a value. */\nconst SEARCH_KEY = \"\\u0000search\";\nconst RESOLVE_PREFIX = \"\\u0000resolve:\";\n\nconst NO_STATE: CascaderLoadState = {\n loading: false,\n error: false,\n hasMore: false,\n};\n\n/** Stable empty result, so an idle search never churns the state context. */\nconst NO_RESULTS: CascaderNode<never>[] = [];\n\nfunction createStore<T>(): CascaderLoaderStore<T> {\n return {\n pages: new Map(),\n states: new Map(),\n detached: new Map(),\n links: new Map(),\n };\n}\n\nfunction sameLoadState(a: CascaderLoadState, b: CascaderLoadState): boolean {\n return (\n a.loading === b.loading &&\n a.error === b.error &&\n a.hasMore === b.hasMore &&\n a.cursor === b.cursor\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Store transitions */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Copy-on-write, and a NO-OP when nothing changed: the merged index is memoised\n * on store identity, so a fresh object for an unchanged state would rebuild it.\n */\nfunction withLoadState<T>(\n store: CascaderLoaderStore<T>,\n key: string,\n update: (state: CascaderLoadState) => CascaderLoadState,\n): CascaderLoaderStore<T> {\n const current = store.states.get(key) ?? NO_STATE;\n const next = update(current);\n if (store.states.has(key) && sameLoadState(current, next)) return store;\n const states = new Map(store.states);\n states.set(key, next);\n return { ...store, states };\n}\n\nfunction withPage<T>(\n store: CascaderLoaderStore<T>,\n key: string,\n items: readonly CascaderNode<T>[],\n options: { append: boolean; hasMore: boolean; cursor?: string },\n): CascaderLoaderStore<T> {\n const previous = options.append ? (store.pages.get(key) ?? []) : [];\n const seen = new Set(previous.map((node) => node.value));\n const merged = previous.slice();\n for (const item of items) {\n if (seen.has(item.value)) continue;\n seen.add(item.value);\n merged.push(item);\n }\n\n const pages = new Map(store.pages);\n pages.set(key, merged);\n const states = new Map(store.states);\n states.set(key, {\n loading: false,\n error: false,\n hasMore: options.hasMore,\n cursor: options.cursor,\n });\n return { ...store, pages, states };\n}\n\nfunction withDetached<T>(\n store: CascaderLoaderStore<T>,\n items: readonly CascaderNode<T>[],\n): CascaderLoaderStore<T> {\n let detached: Map<string, CascaderNode<T>> | null = null;\n for (const item of items) {\n if (store.detached.get(item.value) === item) continue;\n detached = detached ?? new Map(store.detached);\n detached.set(item.value, item);\n }\n if (!detached) return store;\n return { ...store, detached };\n}\n\n/**\n * Records a resolved ancestor chain, root first, as `detached` nodes plus\n * `links`, never as rows in `pages`: a stub there made an unloaded level read\n * as loaded. Writes no `states`, so every level on it still fetches for real.\n */\nfunction withChain<T>(\n store: CascaderLoaderStore<T>,\n chain: readonly CascaderNode<T>[],\n): CascaderLoaderStore<T> {\n if (chain.length === 0) return store;\n const detached = new Map(store.detached);\n const links = new Map(store.links);\n let parentKey = CASCADER_ROOT_KEY;\n\n for (const node of chain) {\n detached.set(node.value, node);\n links.set(node.value, parentKey);\n parentKey = node.value;\n }\n\n return { ...store, detached, links };\n}\n\n/* -------------------------------------------------------------------------- */\n/* Hook */\n/* -------------------------------------------------------------------------- */\n\ninterface CascaderLoaderLatest<T> {\n base: CascaderIndex<T>;\n store: CascaderLoaderStore<T>;\n getChildren?: CascaderGetChildren<T>;\n onSearch?: CascaderOnSearch<T>;\n resolveValue?: CascaderResolveValue<T>;\n onLoadError?: (error: unknown, context: { parent: string | null; reason: string }) => void;\n prefetch: boolean;\n path: string[];\n query: string;\n}\n\ninterface CascaderSearchSlice<T> {\n query: string;\n results: CascaderNode<T>[];\n loading: boolean;\n error: boolean;\n}\n\n/**\n * The loader. A SIBLING of the `buildCascaderIndex` memo, never inside it: the\n * build stays pure in `items`, the merge pure in that build plus this store.\n */\nexport function useCascaderLoader<T = unknown>({\n base,\n getChildren,\n onSearch,\n resolveValue,\n searchDebounce = 250,\n loadKey,\n prefetch = false,\n onLoadError,\n enabled,\n query,\n levels,\n path,\n values,\n}: UseCascaderLoaderOptions<T>): CascaderLoader<T> {\n const [store, setStore] = React.useState<CascaderLoaderStore<T>>(createStore);\n const [search, setSearch] = React.useState<CascaderSearchSlice<T> | null>(null);\n\n /**\n * Latest callbacks, WRITTEN IN AN EFFECT: `getChildren` is inline in most\n * consumers, so closing over it would refire every in-flight request per\n * re-render. The ref is what keeps the request machinery `[]`-dep. Declared\n * FIRST, since effects run in declaration order, so the level effect below\n * already sees the current commit.\n */\n const latest = React.useRef<CascaderLoaderLatest<T>>({\n base,\n store,\n getChildren,\n onSearch,\n resolveValue,\n onLoadError,\n prefetch,\n path,\n query,\n });\n\n React.useEffect(() => {\n latest.current = {\n base,\n store,\n getChildren,\n onSearch,\n resolveValue,\n onLoadError,\n prefetch,\n path,\n query,\n };\n });\n\n /** One AbortController PER KEY: columns mode runs several levels at once. */\n const controllers = React.useRef(new Map<string, AbortController>());\n /** Monotonic per key. The stale guard for out-of-order responses. */\n const requestIds = React.useRef(new Map<string, number>());\n /** In-flight `(level, cursor)` signatures, so a duplicate ask is free. */\n const inflight = React.useRef(new Map<string, string>());\n /**\n * The `(child count, cursor)` signature at the last paging fire, per level.\n * Guards what `hasMore` cannot: a page of zero new items while the server\n * still says `hasMore`. Cursor is IN the signature because an all-duplicates\n * page advances it while the count stands still - real progress, which a\n * count-only latch would brick forever.\n */\n const moreLatch = React.useRef(new Map<string, string>());\n /** Values `resolveValue` has already been asked about, so it asks once. */\n const attempted = React.useRef(new Set<string>());\n /**\n * Values whose resolve failed. They stay `attempted` until the next open\n * rather than the next values pass: with inline `items` every parent render\n * is one, and an `onLoadError` that set parent state looped at network speed.\n */\n const failed = React.useRef(new Set<string>());\n /** Every node the loader has seen, so a level key can name its own node. */\n const known = React.useRef(new Map<string, CascaderNode<T>>());\n const timers = React.useRef<{\n prefetch: ReturnType<typeof setTimeout> | null;\n }>({ prefetch: null });\n /** Bumped by a `loadKey` change, so responses from before it are dropped. */\n const epoch = React.useRef(0);\n\n const remember = React.useCallback((nodes: readonly CascaderNode<T>[]) => {\n const map = known.current;\n const walk = (list: readonly CascaderNode<T>[]) => {\n for (const node of list) {\n map.set(node.value, node);\n if (node.children?.length) walk(node.children);\n }\n };\n walk(nodes);\n }, []);\n\n const abortKey = React.useCallback((key: string) => {\n const controller = controllers.current.get(key);\n if (!controller) return;\n controllers.current.delete(key);\n inflight.current.delete(key);\n controller.abort();\n }, []);\n\n /* ------------------------------- level load ------------------------------ */\n\n const runLoad = React.useCallback(\n (key: string, reason: CascaderLoadReason, cursor: string | undefined, append: boolean) => {\n const { getChildren: loader, base: currentBase } = latest.current;\n if (!loader) return;\n\n const signature = `${append ? \"1\" : \"0\"}:${cursor ?? \"\"}`;\n if (inflight.current.get(key) === signature) return;\n\n abortKey(key);\n const controller = new AbortController();\n controllers.current.set(key, controller);\n inflight.current.set(key, signature);\n\n const requestId = (requestIds.current.get(key) ?? 0) + 1;\n requestIds.current.set(key, requestId);\n const startEpoch = epoch.current;\n\n // A deep link (`path`, `expanded`) can put a level on screen before the\n // level above it loads, and a `loadKey` reset forgets every node. `null`\n // is the ROOT's argument, and a loader answered it with the root rows,\n // so the level gets its value instead.\n const node =\n key === CASCADER_ROOT_KEY\n ? null\n : (currentBase.byValue.get(key) ?? known.current.get(key) ?? { value: key, label: key });\n\n setStore((prev) =>\n withLoadState(prev, key, (state) => ({\n ...state,\n loading: true,\n error: false,\n })),\n );\n\n const settle = () => {\n if (inflight.current.get(key) === signature) inflight.current.delete(key);\n if (controllers.current.get(key) === controller) {\n controllers.current.delete(key);\n }\n };\n\n const stale = () =>\n controller.signal.aborted ||\n startEpoch !== epoch.current ||\n requestId !== requestIds.current.get(key);\n\n // `Promise.resolve().then(...)`, not a direct call: it normalises a\n // SYNCHRONOUS throw into a rejection instead of taking the render down.\n Promise.resolve()\n .then(() => loader(node, { signal: controller.signal, cursor, reason }))\n .then((result) => {\n settle();\n if (stale()) return;\n const items = Array.isArray(result) ? result : result.items;\n const nextCursor = Array.isArray(result) ? undefined : result.nextCursor;\n const hasMore = Array.isArray(result) ? false : (result.hasMore ?? nextCursor != null);\n\n if (!append) moreLatch.current.delete(key);\n remember(items);\n setStore((prev) => withPage(prev, key, items, { append, hasMore, cursor: nextCursor }));\n })\n .catch((error: unknown) => {\n settle();\n if (stale()) return;\n setStore((prev) =>\n withLoadState(prev, key, (state) => ({\n ...state,\n loading: false,\n error: true,\n })),\n );\n // Behind the stale guard: an abort is navigation, not a failure.\n latest.current.onLoadError?.(error, {\n parent: key === CASCADER_ROOT_KEY ? null : key,\n reason,\n });\n });\n },\n [abortKey, remember],\n );\n\n const ensureLevel = React.useCallback(\n (key: string, reason: CascaderLoadReason) => {\n const { getChildren: loader, store: current, base: index } = latest.current;\n if (!loader) return;\n if (current.states.has(key)) return;\n // A level `items` already fills is not the loader's business: that is how\n // a static root plus `getChildren` for the branches works with no flag.\n if (index.childrenOf.has(key)) return;\n runLoad(key, reason, undefined, false);\n },\n [runLoad],\n );\n\n const loadMore = React.useCallback(\n (key: string) => {\n const { getChildren: loader, store: current } = latest.current;\n if (!loader) return;\n const state = current.states.get(key);\n if (!state || state.loading || !state.hasMore) return;\n\n const loaded = current.pages.get(key)?.length ?? 0;\n const signature = `${loaded}:${state.cursor ?? \"\"}`;\n if (moreLatch.current.get(key) === signature) return;\n moreLatch.current.set(key, signature);\n\n runLoad(key, \"more\", state.cursor, true);\n },\n [runLoad],\n );\n\n const retryLevel = React.useCallback(\n (key: string) => {\n const { getChildren: loader, store: current } = latest.current;\n if (!loader) return;\n const state = current.states.get(key);\n if (!state?.error) return;\n\n const loaded = current.pages.get(key)?.length ?? 0;\n // A retry must be able to re-fire the page the latch just blocked.\n moreLatch.current.delete(key);\n runLoad(key, \"retry\", loaded > 0 ? state.cursor : undefined, loaded > 0);\n },\n [runLoad],\n );\n\n /**\n * `detached` and `links` are deliberately untouched: chains and search hits\n * belong to no level, and the trigger needs their path while the new page is\n * in flight.\n */\n const invalidateLevel = React.useCallback(\n (value: string | null) => {\n const key = value ?? CASCADER_ROOT_KEY;\n abortKey(key);\n // Bump the id too: a response past its signal check must still be stale.\n requestIds.current.set(key, (requestIds.current.get(key) ?? 0) + 1);\n moreLatch.current.delete(key);\n setStore((prev) => {\n if (!prev.states.has(key) && !prev.pages.has(key)) return prev;\n const states = new Map(prev.states);\n states.delete(key);\n const pages = new Map(prev.pages);\n pages.delete(key);\n return { ...prev, pages, states };\n });\n },\n [abortKey],\n );\n\n const prefetchNode = React.useCallback(\n (node: CascaderNode<T> | null | undefined) => {\n const { prefetch: on, getChildren: loader, store: current } = latest.current;\n if (!on || !loader || !node) return;\n if (isCascaderMoreNode(node)) return;\n if (!node.hasChildren) return;\n if (current.states.has(node.value)) return;\n\n const holder = timers.current;\n if (holder.prefetch) clearTimeout(holder.prefetch);\n // A TIMEOUT, not a direct call: `onItemHighlighted` fires from a layout\n // effect, where a synchronous setState is a render-phase cascade.\n holder.prefetch = setTimeout(() => {\n holder.prefetch = null;\n ensureLevel(node.value, \"prefetch\");\n }, PREFETCH_DELAY);\n },\n [ensureLevel],\n );\n\n /* --------------------------------- search -------------------------------- */\n\n const runSearch = React.useCallback(\n (text: string) => {\n const { onSearch: searcher, path: currentPath } = latest.current;\n if (!searcher) return;\n\n abortKey(SEARCH_KEY);\n const controller = new AbortController();\n controllers.current.set(SEARCH_KEY, controller);\n const requestId = (requestIds.current.get(SEARCH_KEY) ?? 0) + 1;\n requestIds.current.set(SEARCH_KEY, requestId);\n const startEpoch = epoch.current;\n\n setSearch((prev) => ({\n query: text,\n results: prev?.results ?? [],\n loading: true,\n error: false,\n }));\n\n const settle = () => {\n if (controllers.current.get(SEARCH_KEY) === controller) {\n controllers.current.delete(SEARCH_KEY);\n }\n };\n const stale = () =>\n controller.signal.aborted ||\n startEpoch !== epoch.current ||\n requestId !== requestIds.current.get(SEARCH_KEY);\n\n Promise.resolve()\n .then(() => searcher(text, { signal: controller.signal, path: currentPath }))\n .then((result) => {\n settle();\n if (stale()) return;\n const items = Array.isArray(result) ? result : result.items;\n remember(items);\n // Search hits go to `detached`, never a level: a hit lives anywhere in\n // the tree, and filing it under the open level would misplace it.\n setStore((prev) => withDetached(prev, items));\n setSearch({\n query: text,\n results: items,\n loading: false,\n error: false,\n });\n })\n .catch((error: unknown) => {\n settle();\n if (stale()) return;\n setSearch((prev) => ({\n query: text,\n results: prev?.results ?? [],\n loading: false,\n error: true,\n }));\n latest.current.onLoadError?.(error, {\n parent: null,\n reason: \"search\",\n });\n });\n },\n [abortKey, remember],\n );\n\n const retrySearch = React.useCallback(() => {\n const text = latest.current.query.trim();\n if (text) runSearch(text);\n }, [runSearch]);\n\n /* --------------------------------- resolve ------------------------------- */\n\n const runResolve = React.useCallback(\n (value: string) => {\n const { resolveValue: resolver } = latest.current;\n if (!resolver) return;\n\n const key = `${RESOLVE_PREFIX}${value}`;\n abortKey(key);\n const controller = new AbortController();\n controllers.current.set(key, controller);\n const startEpoch = epoch.current;\n\n const settle = () => {\n if (controllers.current.get(key) === controller) {\n controllers.current.delete(key);\n }\n };\n\n Promise.resolve()\n .then(() => resolver(value, { signal: controller.signal, reason: \"resolve\" }))\n .then((chain) => {\n settle();\n if (controller.signal.aborted || startEpoch !== epoch.current) return;\n if (!chain?.length) return;\n remember(chain);\n setStore((prev) => withChain(prev, chain));\n })\n .catch((error: unknown) => {\n // Read BEFORE `settle`. A newer ask or a reset that replaced this\n // request owns the value's retry, so only a live failure is parked.\n const live = controllers.current.get(key) === controller;\n settle();\n if (live) failed.current.add(value);\n if (controller.signal.aborted || startEpoch !== epoch.current) return;\n latest.current.onLoadError?.(error, {\n parent: null,\n reason: \"resolve\",\n });\n });\n },\n [abortKey, remember],\n );\n\n /* --------------------------------- resets -------------------------------- */\n\n // Aborts what the PANEL asked for. A resolve keeps running: it feeds the\n // trigger, which shows with the popup closed.\n const cancelPanel = React.useCallback(() => {\n const keys = Array.from(controllers.current.keys()).filter(\n (key) => !key.startsWith(RESOLVE_PREFIX),\n );\n for (const key of keys) {\n controllers.current.get(key)?.abort();\n controllers.current.delete(key);\n }\n inflight.current.clear();\n\n const holder = timers.current;\n if (holder.prefetch) {\n clearTimeout(holder.prefetch);\n holder.prefetch = null;\n }\n if (keys.length === 0) return;\n\n setStore((prev) => {\n let states: Map<string, CascaderLoadState> | null = null;\n for (const key of keys) {\n const state = prev.states.get(key);\n if (!state?.loading) continue;\n states = states ?? new Map(prev.states);\n if ((prev.pages.get(key)?.length ?? 0) > 0) {\n states.set(key, { ...state, loading: false });\n } else {\n // No entry AT ALL: membership is what says \"loaded\", so a stranded\n // `loading: true` would read as loaded-and-empty forever.\n states.delete(key);\n }\n }\n return states ? { ...prev, states } : prev;\n });\n setSearch((prev) => (prev?.loading ? { ...prev, loading: false } : prev));\n }, []);\n\n // A `loadKey` change drops everything. Declared BEFORE the level effect, so\n // a reset always lands before the levels are asked for again.\n const loadKeyRef = React.useRef<{ key: unknown } | null>(null);\n React.useEffect(() => {\n const previous = loadKeyRef.current;\n loadKeyRef.current = { key: loadKey };\n if (!previous || Object.is(previous.key, loadKey)) return;\n\n epoch.current += 1;\n for (const controller of controllers.current.values()) controller.abort();\n controllers.current.clear();\n inflight.current.clear();\n // `requestIds` is deliberately NOT cleared: the ids are stale-response\n // guards, not cache. Reusing an aborted predecessor's id would leave only\n // the epoch bump and the abort to reject the old response; monotonic per\n // key keeps all three guards independent. The unmount cleanup clears them.\n moreLatch.current.clear();\n attempted.current.clear();\n failed.current.clear();\n known.current.clear();\n\n const holder = timers.current;\n if (holder.prefetch) {\n clearTimeout(holder.prefetch);\n holder.prefetch = null;\n }\n\n setStore(createStore);\n setSearch(null);\n }, [loadKey]);\n\n // Closing the popup aborts the panel's requests but does NOT drop the cache:\n // reopening onto an already-loaded level is the point of keeping it.\n React.useEffect(() => {\n if (enabled) return;\n if (controllers.current.size === 0) return;\n cancelPanel();\n }, [enabled, cancelPanel]);\n\n React.useEffect(() => {\n const active = controllers.current;\n const holder = timers.current;\n const pending = inflight.current;\n const ids = requestIds.current;\n const tried = attempted.current;\n const parked = failed.current;\n return () => {\n for (const controller of active.values()) controller.abort();\n active.clear();\n // Cleared WITH the controllers, for StrictMode's dev remount: a stale\n // inflight signature would make `runLoad` skip the refetch forever, and\n // a value still marked as asked would never be resolved again. The\n // aborted promises are stale-guarded, so emptying the ids is safe.\n pending.clear();\n ids.clear();\n tried.clear();\n parked.clear();\n if (holder.prefetch) clearTimeout(holder.prefetch);\n };\n }, []);\n\n /* ------------------------------- the effects ----------------------------- */\n\n const hasLoader = typeof getChildren === \"function\";\n const hasSearch = typeof onSearch === \"function\";\n const hasResolve = typeof resolveValue === \"function\";\n const trimmed = query.trim();\n\n // THE load trigger: one declarative effect on the levels on screen, not a\n // call from `pushLevel`/`navigate`, which a controlled `path` never touches.\n React.useEffect(() => {\n if (!enabled || !hasLoader) return;\n for (const key of levels) ensureLevel(key, \"level\");\n // `levels` enters through `levelsKey`; `store` re-runs after a load lands.\n }, [enabled, hasLoader, ensureLevel, levels]);\n\n React.useEffect(() => {\n if (!hasSearch) return undefined;\n if (!enabled || !trimmed) {\n abortKey(SEARCH_KEY);\n setSearch((prev) => (prev === null ? prev : null));\n return undefined;\n }\n const timer = setTimeout(() => runSearch(trimmed), searchDebounce);\n return () => {\n clearTimeout(timer);\n abortKey(SEARCH_KEY);\n };\n }, [hasSearch, enabled, trimmed, searchDebounce, abortKey, runSearch]);\n\n // Opening is the retry point for a failed resolve: un-ask it here, and the\n // values pass below, which also re-runs on `enabled`, asks again.\n React.useEffect(() => {\n if (!enabled || failed.current.size === 0) return;\n for (const value of failed.current) attempted.current.delete(value);\n failed.current.clear();\n }, [enabled]);\n\n // NOT gated on `enabled`: the trigger shows the selection with the popup\n // closed, so a saved value is pathed on load, not on the first open.\n // `loadKey` re-runs it, because the reset dropped every resolved chain.\n React.useEffect(() => {\n if (!hasResolve) return;\n for (const value of values) {\n if (!value) continue;\n if (attempted.current.has(value)) continue;\n if (base.byValue.has(value) || known.current.has(value)) continue;\n attempted.current.add(value);\n runResolve(value);\n }\n // `values` is depended on through `valuesKey`.\n }, [hasResolve, base, runResolve, values]);\n\n /* -------------------------------- the value ------------------------------ */\n\n const searchResults = React.useMemo(() => {\n if (!hasSearch || !trimmed) return null;\n if (!search || search.query !== trimmed) {\n return NO_RESULTS as CascaderNode<T>[];\n }\n return search.results;\n }, [hasSearch, trimmed, search]);\n\n const searchState = React.useMemo<CascaderLoadState | null>(() => {\n if (!hasSearch || !trimmed) return null;\n const settled = search?.query === trimmed;\n return {\n loading: !settled || !!search?.loading,\n error: settled && !!search?.error,\n hasMore: false,\n };\n }, [hasSearch, trimmed, search]);\n\n return React.useMemo(\n () => ({\n active: hasLoader,\n store,\n states: store.states,\n searchResults,\n searchState,\n ensureLevel,\n loadMore,\n retryLevel,\n retrySearch,\n invalidateLevel,\n prefetchNode,\n }),\n [\n hasLoader,\n store,\n searchResults,\n searchState,\n ensureLevel,\n loadMore,\n retryLevel,\n retrySearch,\n invalidateLevel,\n prefetchNode,\n ],\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Consumers */\n/* -------------------------------------------------------------------------- */\n\n/** One level's load state, `null` when never fetched. Omit for the root. */\nexport function useCascaderLoadState(parent?: string | null): CascaderLoadState | null {\n const { loadStates } = useCascaderState();\n return loadStates.get(parent ?? CASCADER_ROOT_KEY) ?? null;\n}\n"],"mappings":";;;;;;;;;AAwIA,MAAM,iBAAiB;;AAGvB,MAAM,aAAa;AACnB,MAAM,i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AAM,SAAS,QAAQ;GAC1B,IAAI,CAAC,OAAO;GACZ,IAAI,UAAU,QAAQ,IAAI,KAAK,GAAG;GAClC,IAAI,KAAK,QAAQ,IAAI,KAAK,KAAK,MAAM,QAAQ,IAAI,KAAK,GAAG;GACzD,UAAU,QAAQ,IAAI,KAAK;GAC3B,WAAW,KAAK;EAClB;CAEF,GAAG;EAAC;EAAY;EAAM;EAAY;CAAM,CAAC;CAIzC,MAAM,gBAAgBA,QAAM,cAAc;EACxC,IAAI,CAAC,aAAa,CAAC,SAAS,OAAO;EACnC,IAAI,CAAC,UAAU,OAAO,UAAU,SAC9B,OAAO;EAET,OAAO,OAAO;CAChB,GAAG;EAAC;EAAW;EAAS;CAAM,CAAC;CAE/B,MAAM,cAAcA,QAAM,cAAwC;EAChE,IAAI,CAAC,aAAa,CAAC,SAAS,OAAO;EACnC,MAAM,UAAU,QAAQ,UAAU;EAClC,OAAO;GACL,SAAS,CAAC,WAAW,CAAC,CAAC,QAAQ;GAC/B,OAAO,WAAW,CAAC,CAAC,QAAQ;GAC5B,SAAS;EACX;CACF,GAAG;EAAC;EAAW;EAAS;CAAM,CAAC;CAE/B,OAAOA,QAAM,eACJ;EACL,QAAQ;EACR;EACA,QAAQ,MAAM;EACd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;AACF;;AAOA,SAAgB,qBAAqB,QAAkD;CACrF,MAAM,EAAE,eAAe,iBAAiB;CACxC,OAAO,WAAW,IAAI,UAAA,QAA2B,KAAK;AACxD"}
@@ -1 +1 @@
1
- {"version":3,"file":"cascader-columns.d.ts","names":["React"],"sources":["../../../../src/components/reui/cascader/cascader-columns.tsx"],"mappings":";;;iBAoBiB,6BAA6B,KAAKA,QAAM;;EAEvD;;EAEA;;EAEA,YAAY,QAAQ,mBAAmBA,QAAM;;;;;;;;iBAStC,kBACP,WACA,aACA,WAAW,eACX,aACG,SACF,uBAAoBA,QAAA,IAAA;iBA8DN;EACf,QAAQ;;EAER,WAAWA,QAAM;;EAEjB;;iBAGO,sBAAsB,QAAQ,UAAU,eAAe,2BAAwBA,QAAA,IAAA"}
1
+ {"version":3,"file":"cascader-columns.d.ts","names":["React"],"sources":["../../../../src/components/reui/cascader/cascader-columns.tsx"],"mappings":";;;iBAqBiB,6BAA6B,KAAKA,QAAM;;EAEvD;;EAEA;;EAEA,YAAY,QAAQ,mBAAmBA,QAAM;;;;;;;;iBAStC,kBACP,WACA,aACA,WAAW,eACX,aACG,SACF,uBAAoBA,QAAA,IAAA;iBA8DN;EACf,QAAQ;;EAER,WAAWA,QAAM;;EAEjB;;iBAGO,sBAAsB,QAAQ,UAAU,eAAe,2BAAwBA,QAAA,IAAA"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { ScrollArea } from "../../ui/scroll-area.js";
3
3
  import { useCascaderActions, useCascaderState } from "./cascader-context.js";
4
- import { CASCADER_LIST_HEIGHT_CLASS, CASCADER_LIST_PAD_CLASS, CASCADER_ROWS_CLASS, CASCADER_SCROLL_CLASS, warnCascaderOnce } from "./cascader-lib.js";
4
+ import { CASCADER_LIST_HEIGHT_CLASS, CASCADER_LIST_PAD_CLASS, CASCADER_ROWS_CLASS, CASCADER_SCROLL_CLASS, focusCascaderHome, warnCascaderOnce } from "./cascader-lib.js";
5
5
  import { CascaderItem, getCascaderMoreProps } from "./cascader-item.js";
6
6
  import * as React$1 from "react";
7
7
  import { cn } from "@kumix/utils";
@@ -59,7 +59,10 @@ function CascaderColumnPanel({ column, children, virtualized }) {
59
59
  /* @__PURE__ */ jsx("button", {
60
60
  type: "button",
61
61
  "data-slot": "cascader-retry",
62
- onClick: () => retryLevel(columnKey),
62
+ onClick: (event) => {
63
+ focusCascaderHome(event.currentTarget);
64
+ retryLevel(columnKey);
65
+ },
63
66
  className: "rounded-md px-1 font-medium text-foreground outline-hidden transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50",
64
67
  children: labels.retry
65
68
  })
@@ -1 +1 @@
1
- {"version":3,"file":"cascader-columns.js","names":["React","ComboboxPrimitive"],"sources":["../../../../src/components/reui/cascader/cascader-columns.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react\";\nimport { LoaderCircleIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { ScrollArea } from \"../../ui/scroll-area\";\nimport type { CascaderColumn } from \"./cascader-context\";\nimport { useCascaderActions, useCascaderState } from \"./cascader-context\";\nimport { CascaderItem, getCascaderMoreProps } from \"./cascader-item\";\nimport {\n CASCADER_LIST_HEIGHT_CLASS,\n CASCADER_LIST_PAD_CLASS,\n CASCADER_ROOT_KEY,\n CASCADER_ROWS_CLASS,\n CASCADER_SCROLL_CLASS,\n warnCascaderOnce,\n} from \"./cascader-lib\";\n\nexport interface CascaderColumnsProps extends Omit<React.ComponentProps<\"div\">, \"children\"> {\n /** Width of each column. */\n columnWidth?: number | string;\n /** Height CAP per column. Falls back to the root `maxHeight`, then 24rem. */\n maxHeight?: number | string;\n /** Replaces the default panel; the seam a windowed column plugs into. */\n children?: (column: CascaderColumn) => React.ReactNode;\n}\n\n/**\n * Miller columns: the open trail side by side, one panel per level. Only the\n * DEEPEST column is a real listbox (Base UI owns exactly one list); the trail\n * behind is plain buttons, which keeps one state machine instead of a second,\n * 2D one. `CascaderInput` moves between columns with ArrowLeft/ArrowRight.\n */\nfunction CascaderColumns({\n className,\n columnWidth = 220,\n maxHeight: maxHeightProp,\n children,\n ...props\n}: CascaderColumnsProps) {\n const { maxHeight, mode, labels } = useCascaderActions();\n const { columns } = useCascaderState();\n\n // Before the early return, so the hook count is the same in both modes.\n React.useEffect(() => {\n if (process.env.NODE_ENV === \"production\") return;\n if (mode === \"columns\") return;\n warnCascaderOnce(\n `columns-outside-columns-mode:${mode}`,\n `\\`CascaderColumns\\` renders nothing in \\`mode=\"${mode}\"\\`, so \\`columnWidth\\` and everything else on it does nothing. Set \\`mode=\"columns\"\\` on the root, or render \\`CascaderList\\` instead.`,\n );\n }, [mode]);\n\n if (mode !== \"columns\") return null;\n\n const height = maxHeightProp ?? maxHeight;\n const toCss = (value: number | string) => (typeof value === \"number\" ? `${value}px` : value);\n\n return (\n <div\n data-slot=\"cascader-columns\"\n role=\"group\"\n aria-label={labels.columnsLabel}\n style={\n {\n \"--cascader-column-width\": toCss(columnWidth),\n /* Set only from an EXPLICIT cap: unset means \"24rem or what the\n viewport leaves\", via the `min()` fallback on the panel. A `?? 280`\n default here ignored short viewports and wasted tall ones. */\n ...(height != null ? { \"--cascader-max-height\": toCss(height) } : null),\n } as React.CSSProperties\n }\n className={cn(\n /* `max-h-full` with `min-h-0`: the trail is the panel's shrinking\n child, and the columns inside it size against this box. */\n \"flex max-h-full min-h-0 items-stretch overflow-x-auto overscroll-x-contain\",\n CASCADER_LIST_PAD_CLASS,\n className,\n )}\n {...props}\n >\n {columns.map((column) =>\n children ? (\n <React.Fragment key={column.depth}>{children(column)}</React.Fragment>\n ) : (\n <CascaderColumnPanel key={column.depth} column={column} />\n ),\n )}\n </div>\n );\n}\n\n/**\n * One column's box. `columnWidth` is the width of the LIST, not the box: under\n * `border-box` the 1px inline-start divider on every column but the first would\n * come out of the rows, so bordered columns are widened by that pixel. The box\n * is also the BOUND, the same `min(--available-height, cap)` the single list\n * uses, and the `ScrollArea` inside scrolls, so every column shows a thumb.\n */\nconst PANEL_CLASS = `flex w-(--cascader-column-width) shrink-0 flex-col overscroll-contain not-first:w-[calc(var(--cascader-column-width)_+_1px)] not-first:border-border/60 not-first:border-s ${CASCADER_LIST_HEIGHT_CLASS}`;\n\nexport interface CascaderColumnPanelProps {\n column: CascaderColumn;\n /** Replaces the panel's rows; the empty state still wins on an empty column. */\n children?: React.ReactNode;\n /** Containing block for the windowed column's absolutely positioned rows. */\n virtualized?: boolean;\n}\n\nfunction CascaderColumnPanel({ column, children, virtualized }: CascaderColumnPanelProps) {\n const {\n labels,\n baseId,\n isBranch,\n isSelectable,\n isSelected,\n isIndeterminate,\n retryLevel,\n searchScope,\n } = useCascaderActions();\n const { loadStates, deepResults } = useCascaderState();\n\n // Keyed per level, not one global flag: columns load and land independently.\n const columnKey = column.parent?.value ?? CASCADER_ROOT_KEY;\n const loadState = loadStates.get(columnKey);\n\n let emptyBody: React.ReactNode = labels.empty;\n if (loadState?.error) {\n emptyBody = (\n <>\n {labels.error}{\" \"}\n <button\n type=\"button\"\n data-slot=\"cascader-retry\"\n onClick={() => retryLevel(columnKey)}\n className=\"rounded-md px-1 font-medium text-foreground outline-hidden transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50\"\n >\n {labels.retry}\n </button>\n </>\n );\n } else if (loadState?.loading) {\n emptyBody = (\n <span className=\"flex items-center gap-1.5\">\n <LoaderCircleIcon className=\"size-3.5 animate-spin\" aria-hidden />\n {labels.loading}\n </span>\n );\n }\n\n const rows =\n column.items.length === 0 ? (\n <p\n data-slot=\"cascader-column-empty\"\n data-state={loadState?.error ? \"error\" : loadState?.loading ? \"loading\" : \"empty\"}\n className=\"px-2 py-1.5 text-muted-foreground text-sm\"\n >\n {emptyBody}\n </p>\n ) : (\n (children ??\n column.items.map((node, i) => {\n const open = node.value === column.activeValue;\n return (\n <CascaderItem\n key={node.value}\n node={node}\n /* A trail row must not compete for `aria-activedescendant`. */\n as={column.active ? \"option\" : \"button\"}\n depth={column.depth}\n /* Answered here, not in the row: the trail rows are memoised too. */\n branch={isBranch(node)}\n selectable={isSelectable(node)}\n selected={isSelected(node)}\n indeterminate={isIndeterminate(node)}\n {...getCascaderMoreProps(node, loadStates)}\n data-open={open || undefined}\n className={open ? \"bg-accent/60 text-accent-foreground\" : undefined}\n /* Set metadata is option-only; a trail row is a `role=\"button\"`. */\n {...(column.active\n ? {\n \"aria-setsize\": column.items.length,\n \"aria-posinset\": i + 1,\n }\n : null)}\n {...(!column.active && open\n ? {\n \"aria-expanded\": true,\n \"aria-controls\": `${baseId}-column-${column.depth + 1}`,\n }\n : null)}\n />\n );\n }))\n );\n\n const shared = {\n \"data-slot\": \"cascader-column\",\n \"data-active\": column.active || undefined,\n \"data-depth\": column.depth,\n // Addressable so the opening trail row can point `aria-controls` here, and\n // named even at the root, which has no parent label to borrow.\n id: `${baseId}-column-${column.depth}`,\n // Global hits come from the whole tree, so the parent would understate them.\n \"aria-label\":\n column.active && searchScope === \"global\" && deepResults\n ? labels.rootLevel\n : (column.parent?.label ?? labels.rootLevel),\n // Conditional spread, never an explicit `undefined`: the active column is a\n // Base UI element, and its `mergeProps` iterates own keys.\n ...(virtualized ? { \"data-virtualized\": true } : null),\n };\n\n // A windowed row is absolutely positioned, so the ROWS' box is the containing\n // block, not the scrollport: it carries the padding the geometry is measured\n // against.\n const rowsClass = cn(CASCADER_ROWS_CLASS, virtualized && \"relative\");\n\n // The active column IS the Combobox list: only rows inside `Combobox.List`\n // reach the CompositeList, arrow-key navigation and `aria-activedescendant`.\n const body = column.active ? (\n <ComboboxPrimitive.List {...shared} className={rowsClass}>\n {rows}\n </ComboboxPrimitive.List>\n ) : (\n // A named `group`, not a second listbox competing with the active column.\n <div {...shared} role=\"group\" className={rowsClass}>\n {rows}\n </div>\n );\n\n return (\n <div\n data-slot=\"cascader-column-bounds\"\n /* Repeated from `shared`: this box, not the semantic element, owns the\n width, the divider and the height, so style hooks must reach it, and\n `:first-child` on the semantic element no longer means \"first column\"\n (it is its own scrollport's only child). */\n data-active={column.active || undefined}\n data-depth={column.depth}\n className={PANEL_CLASS}\n >\n <ScrollArea className={CASCADER_SCROLL_CLASS}>{body}</ScrollArea>\n </div>\n );\n}\n\nexport { CascaderColumnPanel, CascaderColumns };\n"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,SAAS,gBAAgB,EACvB,WACA,cAAc,KACd,WAAW,eACX,UACA,GAAG,SACoB;CACvB,MAAM,EAAE,WAAW,MAAM,WAAW,mBAAmB;CACvD,MAAM,EAAE,YAAY,iBAAiB;CAGr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AAQ,WAAW;EACtC,UAAA;CACE,CAAA;CAGP,OACE,oBAAC,OAAD;EACE,aAAU;EAKV,eAAa,OAAO,UAAU,KAAA;EAC9B,cAAY,OAAO;EACnB,WAAW;EAEX,UAAA,oBAAC,YAAD;GAAY,WAAW;GAAwB,UAAA;EAAiB,CAAA;CAC7D,CAAA;AAET"}
1
+ {"version":3,"file":"cascader-columns.js","names":["React","ComboboxPrimitive"],"sources":["../../../../src/components/reui/cascader/cascader-columns.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react\";\nimport { LoaderCircleIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { ScrollArea } from \"../../ui/scroll-area\";\nimport type { CascaderColumn } from \"./cascader-context\";\nimport { useCascaderActions, useCascaderState } from \"./cascader-context\";\nimport { CascaderItem, getCascaderMoreProps } from \"./cascader-item\";\nimport {\n CASCADER_LIST_HEIGHT_CLASS,\n CASCADER_LIST_PAD_CLASS,\n CASCADER_ROOT_KEY,\n CASCADER_ROWS_CLASS,\n CASCADER_SCROLL_CLASS,\n focusCascaderHome,\n warnCascaderOnce,\n} from \"./cascader-lib\";\n\nexport interface CascaderColumnsProps extends Omit<React.ComponentProps<\"div\">, \"children\"> {\n /** Width of each column. */\n columnWidth?: number | string;\n /** Height CAP per column. Falls back to the root `maxHeight`, then 24rem. */\n maxHeight?: number | string;\n /** Replaces the default panel; the seam a windowed column plugs into. */\n children?: (column: CascaderColumn) => React.ReactNode;\n}\n\n/**\n * Miller columns: the open trail side by side, one panel per level. Only the\n * DEEPEST column is a real listbox (Base UI owns exactly one list); the trail\n * behind is plain buttons, which keeps one state machine instead of a second,\n * 2D one. `CascaderInput` moves between columns with ArrowLeft/ArrowRight.\n */\nfunction CascaderColumns({\n className,\n columnWidth = 220,\n maxHeight: maxHeightProp,\n children,\n ...props\n}: CascaderColumnsProps) {\n const { maxHeight, mode, labels } = useCascaderActions();\n const { columns } = useCascaderState();\n\n // Before the early return, so the hook count is the same in both modes.\n React.useEffect(() => {\n if (process.env.NODE_ENV === \"production\") return;\n if (mode === \"columns\") return;\n warnCascaderOnce(\n `columns-outside-columns-mode:${mode}`,\n `\\`CascaderColumns\\` renders nothing in \\`mode=\"${mode}\"\\`, so \\`columnWidth\\` and everything else on it does nothing. Set \\`mode=\"columns\"\\` on the root, or render \\`CascaderList\\` instead.`,\n );\n }, [mode]);\n\n if (mode !== \"columns\") return null;\n\n const height = maxHeightProp ?? maxHeight;\n const toCss = (value: number | string) => (typeof value === \"number\" ? `${value}px` : value);\n\n return (\n <div\n data-slot=\"cascader-columns\"\n role=\"group\"\n aria-label={labels.columnsLabel}\n style={\n {\n \"--cascader-column-width\": toCss(columnWidth),\n /* Set only from an EXPLICIT cap: unset means \"24rem or what the\n viewport leaves\", via the `min()` fallback on the panel. A `?? 280`\n default here ignored short viewports and wasted tall ones. */\n ...(height != null ? { \"--cascader-max-height\": toCss(height) } : null),\n } as React.CSSProperties\n }\n className={cn(\n /* `max-h-full` with `min-h-0`: the trail is the panel's shrinking\n child, and the columns inside it size against this box. */\n \"flex max-h-full min-h-0 items-stretch overflow-x-auto overscroll-x-contain\",\n CASCADER_LIST_PAD_CLASS,\n className,\n )}\n {...props}\n >\n {columns.map((column) =>\n children ? (\n <React.Fragment key={column.depth}>{children(column)}</React.Fragment>\n ) : (\n <CascaderColumnPanel key={column.depth} column={column} />\n ),\n )}\n </div>\n );\n}\n\n/**\n * One column's box. `columnWidth` is the width of the LIST, not the box: under\n * `border-box` the 1px inline-start divider on every column but the first would\n * come out of the rows, so bordered columns are widened by that pixel. The box\n * is also the BOUND, the same `min(--available-height, cap)` the single list\n * uses, and the `ScrollArea` inside scrolls, so every column shows a thumb.\n */\nconst PANEL_CLASS = `flex w-(--cascader-column-width) shrink-0 flex-col overscroll-contain not-first:w-[calc(var(--cascader-column-width)_+_1px)] not-first:border-border/60 not-first:border-s ${CASCADER_LIST_HEIGHT_CLASS}`;\n\nexport interface CascaderColumnPanelProps {\n column: CascaderColumn;\n /** Replaces the panel's rows; the empty state still wins on an empty column. */\n children?: React.ReactNode;\n /** Containing block for the windowed column's absolutely positioned rows. */\n virtualized?: boolean;\n}\n\nfunction CascaderColumnPanel({ column, children, virtualized }: CascaderColumnPanelProps) {\n const {\n labels,\n baseId,\n isBranch,\n isSelectable,\n isSelected,\n isIndeterminate,\n retryLevel,\n searchScope,\n } = useCascaderActions();\n const { loadStates, deepResults } = useCascaderState();\n\n // Keyed per level, not one global flag: columns load and land independently.\n const columnKey = column.parent?.value ?? CASCADER_ROOT_KEY;\n const loadState = loadStates.get(columnKey);\n\n let emptyBody: React.ReactNode = labels.empty;\n if (loadState?.error) {\n emptyBody = (\n <>\n {labels.error}{\" \"}\n <button\n type=\"button\"\n data-slot=\"cascader-retry\"\n onClick={(event) => {\n // Same hand-off as the panel's Retry: a trail column, or an\n // inline one, can hold focus, and the loading state unmounts this.\n focusCascaderHome(event.currentTarget);\n retryLevel(columnKey);\n }}\n className=\"rounded-md px-1 font-medium text-foreground outline-hidden transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50\"\n >\n {labels.retry}\n </button>\n </>\n );\n } else if (loadState?.loading) {\n emptyBody = (\n <span className=\"flex items-center gap-1.5\">\n <LoaderCircleIcon className=\"size-3.5 animate-spin\" aria-hidden />\n {labels.loading}\n </span>\n );\n }\n\n const rows =\n column.items.length === 0 ? (\n <p\n data-slot=\"cascader-column-empty\"\n data-state={loadState?.error ? \"error\" : loadState?.loading ? \"loading\" : \"empty\"}\n className=\"px-2 py-1.5 text-muted-foreground text-sm\"\n >\n {emptyBody}\n </p>\n ) : (\n (children ??\n column.items.map((node, i) => {\n const open = node.value === column.activeValue;\n return (\n <CascaderItem\n key={node.value}\n node={node}\n /* A trail row must not compete for `aria-activedescendant`. */\n as={column.active ? \"option\" : \"button\"}\n depth={column.depth}\n /* Answered here, not in the row: the trail rows are memoised too. */\n branch={isBranch(node)}\n selectable={isSelectable(node)}\n selected={isSelected(node)}\n indeterminate={isIndeterminate(node)}\n {...getCascaderMoreProps(node, loadStates)}\n data-open={open || undefined}\n className={open ? \"bg-accent/60 text-accent-foreground\" : undefined}\n /* Set metadata is option-only; a trail row is a `role=\"button\"`. */\n {...(column.active\n ? {\n \"aria-setsize\": column.items.length,\n \"aria-posinset\": i + 1,\n }\n : null)}\n {...(!column.active && open\n ? {\n \"aria-expanded\": true,\n \"aria-controls\": `${baseId}-column-${column.depth + 1}`,\n }\n : null)}\n />\n );\n }))\n );\n\n const shared = {\n \"data-slot\": \"cascader-column\",\n \"data-active\": column.active || undefined,\n \"data-depth\": column.depth,\n // Addressable so the opening trail row can point `aria-controls` here, and\n // named even at the root, which has no parent label to borrow.\n id: `${baseId}-column-${column.depth}`,\n // Global hits come from the whole tree, so the parent would understate them.\n \"aria-label\":\n column.active && searchScope === \"global\" && deepResults\n ? labels.rootLevel\n : (column.parent?.label ?? labels.rootLevel),\n // Conditional spread, never an explicit `undefined`: the active column is a\n // Base UI element, and its `mergeProps` iterates own keys.\n ...(virtualized ? { \"data-virtualized\": true } : null),\n };\n\n // A windowed row is absolutely positioned, so the ROWS' box is the containing\n // block, not the scrollport: it carries the padding the geometry is measured\n // against.\n const rowsClass = cn(CASCADER_ROWS_CLASS, virtualized && \"relative\");\n\n // The active column IS the Combobox list: only rows inside `Combobox.List`\n // reach the CompositeList, arrow-key navigation and `aria-activedescendant`.\n const body = column.active ? (\n <ComboboxPrimitive.List {...shared} className={rowsClass}>\n {rows}\n </ComboboxPrimitive.List>\n ) : (\n // A named `group`, not a second listbox competing with the active column.\n <div {...shared} role=\"group\" className={rowsClass}>\n {rows}\n </div>\n );\n\n return (\n <div\n data-slot=\"cascader-column-bounds\"\n /* Repeated from `shared`: this box, not the semantic element, owns the\n width, the divider and the height, so style hooks must reach it, and\n `:first-child` on the semantic element no longer means \"first column\"\n (it is its own scrollport's only child). */\n data-active={column.active || undefined}\n data-depth={column.depth}\n className={PANEL_CLASS}\n >\n <ScrollArea className={CASCADER_SCROLL_CLASS}>{body}</ScrollArea>\n </div>\n );\n}\n\nexport { CascaderColumnPanel, CascaderColumns };\n"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,SAAS,gBAAgB,EACvB,WACA,cAAc,KACd,WAAW,eACX,UACA,GAAG,SACoB;CACvB,MAAM,EAAE,WAAW,MAAM,WAAW,mBAAmB;CACvD,MAAM,EAAE,YAAY,iBAAiB;CAGrC,QAAM,gBAAgB;EACpB,IAAI,QAAQ,IAAI,aAAa,cAAc;EAC3C,IAAI,SAAS,WAAW;EACxB,iBACE,gCAAgC,QAChC,kDAAkD,KAAK,wIACzD;CACF,GAAG,CAAC,IAAI,CAAC;CAET,IAAI,SAAS,WAAW,OAAO;CAE/B,MAAM,SAAS,iBAAiB;CAChC,MAAM,SAAS,UAA4B,OAAO,UAAU,WAAW,GAAG,MAAM,MAAM;CAEtF,OACE,oBAAC,OAAD;EACE,aAAU;EACV,MAAK;EACL,cAAY,OAAO;EACnB,OACE;GACE,2BAA2B,MAAM,WAAW;GAI5C,GAAI,UAAU,OAAO,EAAE,yBAAyB,MAAM,MAAM,EAAE,IAAI;EACpE;EAEF,WAAW,GAGT,8EACA,yBACA,SACF;EACA,GAAI;EAEH,UAAA,QAAQ,KAAK,WACZ,WACE,oBAACA,QAAM,UAAP,EAAA,UAAoC,SAAS,MAAM,EAAkB,GAAhD,OAAO,KAAyC,IAErE,oBAAC,qBAAD,EAAgD,OAAS,GAA/B,OAAO,KAAwB,CAE7D;CACG,CAAA;AAET;;;;;;;;AASA,MAAM,cAAc,8KAA8K;AAUlM,SAAS,oBAAoB,EAAE,QAAQ,UAAU,eAAyC;CACxF,MAAM,EACJ,QACA,QACA,UACA,cACA,YACA,iBACA,YACA,gBACE,mBAAmB;CACvB,MAAM,EAAE,YAAY,gBAAgB,iBAAiB;CAGrD,MAAM,YAAY,OAAO,QAAQ,SAAA;CACjC,MAAM,YAAY,WAAW,IAAI,SAAS;CAE1C,IA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EAE/B,cACE,OAAO,UAAU,gBAAgB,YAAY,cACzC,OAAO,YACN,OAAO,QAAQ,SAAS,OAAO;EAGtC,GAAI,cAAc,EAAE,oBAAoB,KAAK,IAAI;CACnD;CAKA,MAAM,YAAY,GAAG,qBAAqB,eAAe,UAAU;CAInE,MAAM,OAAO,OAAO,SAClB,oBAACC,SAAkB,MAAnB;EAAwB,GAAI;EAAQ,WAAW;EAC5C,UAAA;CACqB,CAAA,IAGxB,oBAAC,OAAD;EAAK,GAAI;EAAQ,MAAK;EAAQ,WAAW;EACtC,UAAA;CACE,CAAA;CAGP,OACE,oBAAC,OAAD;EACE,aAAU;EAKV,eAAa,OAAO,UAAU,KAAA;EAC9B,cAAY,OAAO;EACnB,WAAW;EAEX,UAAA,oBAAC,YAAD;GAAY,WAAW;GAAwB,UAAA;EAAiB,CAAA;CAC7D,CAAA;AAET"}
@@ -1,4 +1,4 @@
1
- import { a as CascaderFlatNode, d as CascaderLoadState, f as CascaderMode, g as CascaderSearchScope, o as CascaderIndex, p as CascaderNode, r as CascaderChangeReason, s as CascaderLabels, t as CascaderActionItem } from "../../../cascader-types-DVT-znZ-.js";
1
+ import { a as CascaderFlatNode, d as CascaderLoadState, f as CascaderMode, g as CascaderSearchScope, o as CascaderIndex, p as CascaderNode, r as CascaderChangeReason, s as CascaderLabels, t as CascaderActionItem } from "../../../cascader-types-zhnUQ4sP.js";
2
2
  import * as React$1 from "react";
3
3
  //#region src/components/reui/cascader/cascader-context.d.ts
4
4
  /**
@@ -110,6 +110,8 @@ export interface CascaderActionsContextValue<T = unknown> {
110
110
  /** Next page of a level. Latched: a page with nothing new is not re-asked. */
111
111
  loadMore: (parentKey: string) => void;
112
112
  retryLevel: (parentKey: string) => void;
113
+ /** Re-runs a failed server search (`onSearch`) for the current query. */
114
+ retrySearch: () => void;
113
115
  /**
114
116
  * Evicts one level's async cache, `null` for the root, so membership reads
115
117
  * never-loaded. A level that is on screen when evicted refetches at once.
@@ -1 +1 @@
1
- {"version":3,"file":"cascader-context.d.ts","names":["React"],"sources":["../../../../src/components/reui/cascader/cascader-context.tsx"],"mappings":";;;;;;;;;iBA2BiB,eAAe;EAC9B,QAAQ,aAAa;EACrB,OAAO,aAAa;EACpB;;EAEA;;EAEA;;iBAGe,kBAAkB;EACjC;EACA;;EAEA;EACA;EACA;;EAEA,MAAM,aAAa;;;;;;iBAWJ,0BAA0B;;EAEzC,OAAO,cAAc;EACrB;EACA,UAAU;EACV;EACA,eAAe,aAAa;;EAE5B,YAAY,aAAa;EACzB,aAAa,aAAa;;EAE1B,eAAe,aAAa;EAC5B,SAAS,eAAe;EACxB,UAAU,iBAAiB;EAC3B;;EAEA,qBAAqB;;;;;;EAMrB,YAAY,oBAAoB;;EAEhC,aAAa;EACb;;cAGI,sBAAoBA,QAAA,QAAA;;;;;wBAMV,iBAAiB,gBAAgB,0BAA0B;;;;;;;iBAkB1D,4BAA4B;EAC3C,OAAO,cAAc;EACrB,MAAM;EACN;;EAEA;;EAEA;;EAEA;EACA;EACA,SAAS;EACT,aAAa;EACb;EACA;EACA;;;;;;EAMA;EACA,QAAQ;;;;;;EAOR;;EAEA;;EAEA;EACA;EACA;EACA;;EAGA;;EAEA,WAAW;EACX,aAAa;;;;;EAKb,kBAAkB;;EAGlB,gBAAgB,cAAc;EAC9B,gBAAgB,0BAA0B;;EAE1C,sBAAsB,aAAa;EAEnC,UAAU,mBAAmB;EAC7B,YAAY;EACZ;EACA,YAAY;EACZ,iBAAiB;;;;;;;EAOjB,gBAAgB,aAAa;EAC7B;EACA,WAAW;;;;;EAKX,eAAe,kBAAkB,SAAS;;EAE1C,SAAS,MAAM,aAAa;EAC5B,WAAW,MAAM,aAAa;;EAE9B,aAAa,MAAM,aAAa,IAAI;;EAEpC,cAAc,kBAAkB,aAAa;EAC7C,WAAW,MAAM,aAAa;EAC9B,eAAe,MAAM,aAAa;;;;;;;EAOlC,aAAa,MAAM,aAAa;EAChC,aAAa,MAAM,aAAa;;EAEhC,kBAAkB,MAAM,aAAa;;;;;EAKrC,0BAA0B,MAAM,aAAa;;cAGzC,wBAAsBA,QAAA,QAAA;wBAIZ,mBAAmB,gBAAgB,4BAA4B;;;;;;iBAiB9D,2BAA2B;EAC1C,cAAc,MAAM,aAAa,IAAI,OAAO,kBAAkB,OAAOA,QAAM;EAC3E,eAAe,MAAM,aAAa,IAAI,OAAO,kBAAkB,OAAOA,QAAM;;cAGxE,uBAAqBA,QAAA,QAAA;wBAEX,kBAAkB,gBAAgB,2BAA2B;iBAQ5D;EACf;EACA;;;;;;;;iBASe;EACf,YAAY;EACZ,mBAAmB;EACnB,MAAM,MAAM;;wBAKE,gCAAgC;cA0B1C,0BAAwBA,QAAA,QAAA;;wBAId,wBAAwB"}
1
+ {"version":3,"file":"cascader-context.d.ts","names":["React"],"sources":["../../../../src/components/reui/cascader/cascader-context.tsx"],"mappings":";;;;;;;;;iBA2BiB,eAAe;EAC9B,QAAQ,aAAa;EACrB,OAAO,aAAa;EACpB;;EAEA;;EAEA;;iBAGe,kBAAkB;EACjC;EACA;;EAEA;EACA;EACA;;EAEA,MAAM,aAAa;;;;;;iBAWJ,0BAA0B;;EAEzC,OAAO,cAAc;EACrB;EACA,UAAU;EACV;EACA,eAAe,aAAa;;EAE5B,YAAY,aAAa;EACzB,aAAa,aAAa;;EAE1B,eAAe,aAAa;EAC5B,SAAS,eAAe;EACxB,UAAU,iBAAiB;EAC3B;;EAEA,qBAAqB;;;;;;EAMrB,YAAY,oBAAoB;;EAEhC,aAAa;EACb;;cAGI,sBAAoBA,QAAA,QAAA;;;;;wBAMV,iBAAiB,gBAAgB,0BAA0B;;;;;;;iBAkB1D,4BAA4B;EAC3C,OAAO,cAAc;EACrB,MAAM;EACN;;EAEA;;EAEA;;EAEA;EACA;EACA,SAAS;EACT,aAAa;EACb;EACA;EACA;;;;;;EAMA;EACA,QAAQ;;;;;;EAOR;;EAEA;;EAEA;EACA;EACA;EACA;;EAGA;;EAEA,WAAW;EACX,aAAa;;EAEb;;;;;EAKA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