@kumix/ui 0.3.18 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (584) hide show
  1. package/README.md +28 -17
  2. package/dist/account-avatar-DILzuuvz.js +23 -0
  3. package/dist/account-avatar-DILzuuvz.js.map +1 -0
  4. package/dist/{cascader-types-BnH6wYD-.d.ts → cascader-types-DVT-znZ-.d.ts} +6 -3
  5. package/dist/cascader-types-DVT-znZ-.d.ts.map +1 -0
  6. package/dist/components/agents/approval-card/index.d.ts +2 -0
  7. package/dist/components/agents/approval-card/index.d.ts.map +1 -1
  8. package/dist/components/agents/approval-card/index.js +2 -0
  9. package/dist/components/agents/approval-card/index.js.map +1 -1
  10. package/dist/components/agents/citations.d.ts +14 -2
  11. package/dist/components/agents/citations.d.ts.map +1 -1
  12. package/dist/components/agents/citations.js +11 -7
  13. package/dist/components/agents/citations.js.map +1 -1
  14. package/dist/components/agents/loading-states/reasoning-text.d.ts.map +1 -1
  15. package/dist/components/agents/loading-states/reasoning-text.js +3 -0
  16. package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
  17. package/dist/components/agents/voice-orb.d.ts +19 -0
  18. package/dist/components/agents/voice-orb.d.ts.map +1 -0
  19. package/dist/components/agents/voice-orb.js +389 -0
  20. package/dist/components/agents/voice-orb.js.map +1 -0
  21. package/dist/components/charts/bump-chart/context.d.ts +2 -0
  22. package/dist/components/charts/bump-chart/context.js +2 -0
  23. package/dist/components/charts/bump-chart/legend.d.ts +6 -0
  24. package/dist/components/charts/bump-chart/legend.d.ts.map +1 -0
  25. package/dist/components/charts/bump-chart/legend.js +60 -0
  26. package/dist/components/charts/bump-chart/legend.js.map +1 -0
  27. package/dist/components/charts/bump-chart/plot.d.ts +6 -0
  28. package/dist/components/charts/bump-chart/plot.d.ts.map +1 -0
  29. package/dist/components/charts/bump-chart/plot.js +2 -0
  30. package/dist/components/charts/bump-chart/point.d.ts +10 -0
  31. package/dist/components/charts/bump-chart/point.d.ts.map +1 -0
  32. package/dist/components/charts/bump-chart/point.js +124 -0
  33. package/dist/components/charts/bump-chart/point.js.map +1 -0
  34. package/dist/components/charts/bump-chart/series.d.ts +12 -0
  35. package/dist/components/charts/bump-chart/series.d.ts.map +1 -0
  36. package/dist/components/charts/bump-chart/series.js +101 -0
  37. package/dist/components/charts/bump-chart/series.js.map +1 -0
  38. package/dist/components/charts/bump-chart.d.ts +10 -0
  39. package/dist/components/charts/bump-chart.d.ts.map +1 -0
  40. package/dist/components/charts/bump-chart.js +23 -0
  41. package/dist/components/charts/bump-chart.js.map +1 -0
  42. package/dist/components/charts/candlestick-chart/context.d.ts +79 -0
  43. package/dist/components/charts/candlestick-chart/context.d.ts.map +1 -0
  44. package/dist/components/charts/candlestick-chart/context.js +69 -0
  45. package/dist/components/charts/candlestick-chart/context.js.map +1 -0
  46. package/dist/components/charts/candlestick-chart/legend.d.ts +12 -0
  47. package/dist/components/charts/candlestick-chart/legend.d.ts.map +1 -0
  48. package/dist/components/charts/candlestick-chart/legend.js +56 -0
  49. package/dist/components/charts/candlestick-chart/legend.js.map +1 -0
  50. package/dist/components/charts/candlestick-chart/plot.d.ts +9 -0
  51. package/dist/components/charts/candlestick-chart/plot.d.ts.map +1 -0
  52. package/dist/components/charts/candlestick-chart/plot.js +218 -0
  53. package/dist/components/charts/candlestick-chart/plot.js.map +1 -0
  54. package/dist/components/charts/candlestick-chart.d.ts +18 -0
  55. package/dist/components/charts/candlestick-chart.d.ts.map +1 -0
  56. package/dist/components/charts/candlestick-chart.js +34 -0
  57. package/dist/components/charts/candlestick-chart.js.map +1 -0
  58. package/dist/components/charts/composition-chart/context.d.ts +2 -0
  59. package/dist/components/charts/composition-chart/context.js +2 -0
  60. package/dist/components/charts/composition-chart/legend.d.ts +6 -0
  61. package/dist/components/charts/composition-chart/legend.d.ts.map +1 -0
  62. package/dist/components/charts/composition-chart/legend.js +51 -0
  63. package/dist/components/charts/composition-chart/legend.js.map +1 -0
  64. package/dist/components/charts/composition-chart/plot.d.ts +6 -0
  65. package/dist/components/charts/composition-chart/plot.d.ts.map +1 -0
  66. package/dist/components/charts/composition-chart/plot.js +174 -0
  67. package/dist/components/charts/composition-chart/plot.js.map +1 -0
  68. package/dist/components/charts/composition-chart/tooltip-content.d.ts +6 -0
  69. package/dist/components/charts/composition-chart/tooltip-content.d.ts.map +1 -0
  70. package/dist/components/charts/composition-chart/tooltip-content.js +63 -0
  71. package/dist/components/charts/composition-chart/tooltip-content.js.map +1 -0
  72. package/dist/components/charts/composition-chart.d.ts +9 -0
  73. package/dist/components/charts/composition-chart.d.ts.map +1 -0
  74. package/dist/components/charts/composition-chart.js +26 -0
  75. package/dist/components/charts/composition-chart.js.map +1 -0
  76. package/dist/components/charts/donut-chart/center.d.ts +16 -0
  77. package/dist/components/charts/donut-chart/center.d.ts.map +1 -0
  78. package/dist/components/charts/donut-chart/center.js +78 -0
  79. package/dist/components/charts/donut-chart/center.js.map +1 -0
  80. package/dist/components/charts/donut-chart/context.d.ts +68 -0
  81. package/dist/components/charts/donut-chart/context.d.ts.map +1 -0
  82. package/dist/components/charts/donut-chart/context.js +2 -0
  83. package/dist/components/charts/donut-chart/legend.d.ts +17 -0
  84. package/dist/components/charts/donut-chart/legend.d.ts.map +1 -0
  85. package/dist/components/charts/donut-chart/legend.js +85 -0
  86. package/dist/components/charts/donut-chart/legend.js.map +1 -0
  87. package/dist/components/charts/donut-chart/plot.d.ts +10 -0
  88. package/dist/components/charts/donut-chart/plot.d.ts.map +1 -0
  89. package/dist/components/charts/donut-chart/plot.js +108 -0
  90. package/dist/components/charts/donut-chart/plot.js.map +1 -0
  91. package/dist/components/charts/donut-chart.d.ts +22 -0
  92. package/dist/components/charts/donut-chart.d.ts.map +1 -0
  93. package/dist/components/charts/donut-chart.js +37 -0
  94. package/dist/components/charts/donut-chart.js.map +1 -0
  95. package/dist/components/charts/funnel-chart.d.ts +50 -0
  96. package/dist/components/charts/funnel-chart.d.ts.map +1 -0
  97. package/dist/components/charts/funnel-chart.js +215 -0
  98. package/dist/components/charts/funnel-chart.js.map +1 -0
  99. package/dist/components/charts/heat-calendar/grid.d.ts +8 -0
  100. package/dist/components/charts/heat-calendar/grid.d.ts.map +1 -0
  101. package/dist/components/charts/heat-calendar/grid.js +127 -0
  102. package/dist/components/charts/heat-calendar/grid.js.map +1 -0
  103. package/dist/components/charts/heat-calendar/legend.d.ts +6 -0
  104. package/dist/components/charts/heat-calendar/legend.d.ts.map +1 -0
  105. package/dist/components/charts/heat-calendar/legend.js +48 -0
  106. package/dist/components/charts/heat-calendar/legend.js.map +1 -0
  107. package/dist/components/charts/heat-calendar/tooltip.d.ts +2 -0
  108. package/dist/components/charts/heat-calendar/tooltip.js +50 -0
  109. package/dist/components/charts/heat-calendar/tooltip.js.map +1 -0
  110. package/dist/components/charts/heat-calendar.d.ts +9 -0
  111. package/dist/components/charts/heat-calendar.d.ts.map +1 -0
  112. package/dist/components/charts/heat-calendar.js +23 -0
  113. package/dist/components/charts/heat-calendar.js.map +1 -0
  114. package/dist/components/charts/liquidity-heatmap.d.ts +51 -0
  115. package/dist/components/charts/liquidity-heatmap.d.ts.map +1 -0
  116. package/dist/components/charts/liquidity-heatmap.js +311 -0
  117. package/dist/components/charts/liquidity-heatmap.js.map +1 -0
  118. package/dist/components/charts/order-book/depth-row.d.ts +19 -0
  119. package/dist/components/charts/order-book/depth-row.d.ts.map +1 -0
  120. package/dist/components/charts/order-book/depth-row.js +107 -0
  121. package/dist/components/charts/order-book/depth-row.js.map +1 -0
  122. package/dist/components/charts/order-book.d.ts +89 -0
  123. package/dist/components/charts/order-book.d.ts.map +1 -0
  124. package/dist/components/charts/order-book.js +282 -0
  125. package/dist/components/charts/order-book.js.map +1 -0
  126. package/dist/components/charts/price-target-fan/header.d.ts +8 -0
  127. package/dist/components/charts/price-target-fan/header.d.ts.map +1 -0
  128. package/dist/components/charts/price-target-fan/header.js +43 -0
  129. package/dist/components/charts/price-target-fan/header.js.map +1 -0
  130. package/dist/components/charts/price-target-fan/plot.d.ts +16 -0
  131. package/dist/components/charts/price-target-fan/plot.d.ts.map +1 -0
  132. package/dist/components/charts/price-target-fan/plot.js +142 -0
  133. package/dist/components/charts/price-target-fan/plot.js.map +1 -0
  134. package/dist/components/charts/price-target-fan/series.d.ts +15 -0
  135. package/dist/components/charts/price-target-fan/series.d.ts.map +1 -0
  136. package/dist/components/charts/price-target-fan/series.js +238 -0
  137. package/dist/components/charts/price-target-fan/series.js.map +1 -0
  138. package/dist/components/charts/price-target-fan/tooltip.d.ts +2 -0
  139. package/dist/components/charts/price-target-fan/tooltip.js +58 -0
  140. package/dist/components/charts/price-target-fan/tooltip.js.map +1 -0
  141. package/dist/components/charts/price-target-fan.d.ts +10 -0
  142. package/dist/components/charts/price-target-fan.d.ts.map +1 -0
  143. package/dist/components/charts/price-target-fan.js +24 -0
  144. package/dist/components/charts/price-target-fan.js.map +1 -0
  145. package/dist/components/charts/returns-calendar/grid.d.ts +8 -0
  146. package/dist/components/charts/returns-calendar/grid.d.ts.map +1 -0
  147. package/dist/components/charts/returns-calendar/grid.js +176 -0
  148. package/dist/components/charts/returns-calendar/grid.js.map +1 -0
  149. package/dist/components/charts/returns-calendar/tooltip.d.ts +2 -0
  150. package/dist/components/charts/returns-calendar/tooltip.js +55 -0
  151. package/dist/components/charts/returns-calendar/tooltip.js.map +1 -0
  152. package/dist/components/charts/returns-calendar.d.ts +48 -0
  153. package/dist/components/charts/returns-calendar.d.ts.map +1 -0
  154. package/dist/components/charts/returns-calendar.js +22 -0
  155. package/dist/components/charts/returns-calendar.js.map +1 -0
  156. package/dist/components/charts/status-bar/legend.d.ts +8 -0
  157. package/dist/components/charts/status-bar/legend.d.ts.map +1 -0
  158. package/dist/components/charts/status-bar/legend.js +37 -0
  159. package/dist/components/charts/status-bar/legend.js.map +1 -0
  160. package/dist/components/charts/status-bar/plot.d.ts +12 -0
  161. package/dist/components/charts/status-bar/plot.d.ts.map +1 -0
  162. package/dist/components/charts/status-bar/plot.js +176 -0
  163. package/dist/components/charts/status-bar/plot.js.map +1 -0
  164. package/dist/components/charts/status-bar/tooltip.d.ts +2 -0
  165. package/dist/components/charts/status-bar/tooltip.js +49 -0
  166. package/dist/components/charts/status-bar/tooltip.js.map +1 -0
  167. package/dist/components/charts/status-bar.d.ts +9 -0
  168. package/dist/components/charts/status-bar.d.ts.map +1 -0
  169. package/dist/components/charts/status-bar.js +64 -0
  170. package/dist/components/charts/status-bar.js.map +1 -0
  171. package/dist/components/charts/treemap/legend.d.ts +8 -0
  172. package/dist/components/charts/treemap/legend.d.ts.map +1 -0
  173. package/dist/components/charts/treemap/legend.js +35 -0
  174. package/dist/components/charts/treemap/legend.js.map +1 -0
  175. package/dist/components/charts/treemap/plot.d.ts +13 -0
  176. package/dist/components/charts/treemap/plot.d.ts.map +1 -0
  177. package/dist/components/charts/treemap/plot.js +123 -0
  178. package/dist/components/charts/treemap/plot.js.map +1 -0
  179. package/dist/components/charts/treemap/tile.d.ts +10 -0
  180. package/dist/components/charts/treemap/tile.d.ts.map +1 -0
  181. package/dist/components/charts/treemap/tile.js +114 -0
  182. package/dist/components/charts/treemap/tile.js.map +1 -0
  183. package/dist/components/charts/treemap/tooltip.d.ts +11 -0
  184. package/dist/components/charts/treemap/tooltip.d.ts.map +1 -0
  185. package/dist/components/charts/treemap/tooltip.js +73 -0
  186. package/dist/components/charts/treemap/tooltip.js.map +1 -0
  187. package/dist/components/charts/treemap.d.ts +56 -0
  188. package/dist/components/charts/treemap.d.ts.map +1 -0
  189. package/dist/components/charts/treemap.js +71 -0
  190. package/dist/components/charts/treemap.js.map +1 -0
  191. package/dist/components/charts/volume-profile/plot.d.ts +12 -0
  192. package/dist/components/charts/volume-profile/plot.d.ts.map +1 -0
  193. package/dist/components/charts/volume-profile/plot.js +211 -0
  194. package/dist/components/charts/volume-profile/plot.js.map +1 -0
  195. package/dist/components/charts/volume-profile/summary.d.ts +6 -0
  196. package/dist/components/charts/volume-profile/summary.d.ts.map +1 -0
  197. package/dist/components/charts/volume-profile/summary.js +76 -0
  198. package/dist/components/charts/volume-profile/summary.js.map +1 -0
  199. package/dist/components/charts/volume-profile/tooltip.d.ts +2 -0
  200. package/dist/components/charts/volume-profile/tooltip.js +84 -0
  201. package/dist/components/charts/volume-profile/tooltip.js.map +1 -0
  202. package/dist/components/charts/volume-profile.d.ts +111 -0
  203. package/dist/components/charts/volume-profile.d.ts.map +1 -0
  204. package/dist/components/charts/volume-profile.js +82 -0
  205. package/dist/components/charts/volume-profile.js.map +1 -0
  206. package/dist/components/custom/confirm-dialog.d.ts +1 -0
  207. package/dist/components/custom/toast.d.ts +1 -0
  208. package/dist/components/motion/action-swap.d.ts.map +1 -1
  209. package/dist/components/motion/action-swap.js +3 -0
  210. package/dist/components/motion/action-swap.js.map +1 -1
  211. package/dist/components/motion/alert.d.ts +40 -0
  212. package/dist/components/motion/alert.d.ts.map +1 -0
  213. package/dist/components/motion/alert.js +247 -0
  214. package/dist/components/motion/alert.js.map +1 -0
  215. package/dist/components/motion/animated-sidebar.d.ts +1 -0
  216. package/dist/components/motion/arc-picker.d.ts +28 -0
  217. package/dist/components/motion/arc-picker.d.ts.map +1 -0
  218. package/dist/components/motion/arc-picker.js +569 -0
  219. package/dist/components/motion/arc-picker.js.map +1 -0
  220. package/dist/components/motion/aspect-ratio.d.ts +23 -0
  221. package/dist/components/motion/aspect-ratio.d.ts.map +1 -0
  222. package/dist/components/motion/aspect-ratio.js +61 -0
  223. package/dist/components/motion/aspect-ratio.js.map +1 -0
  224. package/dist/components/motion/attachment-upload.d.ts.map +1 -1
  225. package/dist/components/motion/attachment-upload.js +1 -2
  226. package/dist/components/motion/attachment-upload.js.map +1 -1
  227. package/dist/components/motion/availability-scheduler/copy-menu.js +1 -2
  228. package/dist/components/motion/availability-scheduler/day-row.js +2 -2
  229. package/dist/components/motion/availability-scheduler/index.js +1 -1
  230. package/dist/components/motion/bloom-menu.d.ts +1 -0
  231. package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
  232. package/dist/components/motion/bounce-sidebar.js +34 -42
  233. package/dist/components/motion/bounce-sidebar.js.map +1 -1
  234. package/dist/components/motion/button/stateful.d.ts.map +1 -1
  235. package/dist/components/motion/button/stateful.js +3 -0
  236. package/dist/components/motion/button/stateful.js.map +1 -1
  237. package/dist/components/motion/card.d.ts +44 -0
  238. package/dist/components/motion/card.d.ts.map +1 -0
  239. package/dist/components/motion/card.js +122 -0
  240. package/dist/components/motion/card.js.map +1 -0
  241. package/dist/components/motion/checkbox.d.ts +3 -1
  242. package/dist/components/motion/checkbox.d.ts.map +1 -1
  243. package/dist/components/motion/checkbox.js +18 -6
  244. package/dist/components/motion/checkbox.js.map +1 -1
  245. package/dist/components/motion/collapsible.d.ts +34 -0
  246. package/dist/components/motion/collapsible.d.ts.map +1 -0
  247. package/dist/components/motion/collapsible.js +237 -0
  248. package/dist/components/motion/collapsible.js.map +1 -0
  249. package/dist/components/motion/color-picker.d.ts +110 -0
  250. package/dist/components/motion/color-picker.d.ts.map +1 -0
  251. package/dist/components/motion/color-picker.js +1053 -0
  252. package/dist/components/motion/color-picker.js.map +1 -0
  253. package/dist/components/motion/color-selector.d.ts.map +1 -1
  254. package/dist/components/motion/color-selector.js +9 -2
  255. package/dist/components/motion/color-selector.js.map +1 -1
  256. package/dist/components/motion/combobox/content.d.ts +1 -0
  257. package/dist/components/motion/command-palette.js +2 -2
  258. package/dist/components/motion/command-palette.js.map +1 -1
  259. package/dist/components/motion/context-menu.d.ts +1 -0
  260. package/dist/components/motion/date-range-picker.d.ts +107 -0
  261. package/dist/components/motion/date-range-picker.d.ts.map +1 -0
  262. package/dist/components/motion/date-range-picker.js +907 -0
  263. package/dist/components/motion/date-range-picker.js.map +1 -0
  264. package/dist/components/motion/digit-swap.d.ts +9 -1
  265. package/dist/components/motion/digit-swap.d.ts.map +1 -1
  266. package/dist/components/motion/digit-swap.js +18 -7
  267. package/dist/components/motion/digit-swap.js.map +1 -1
  268. package/dist/components/motion/expandable-control.d.ts +1 -0
  269. package/dist/components/motion/knockout-bracket.d.ts +190 -0
  270. package/dist/components/motion/knockout-bracket.d.ts.map +1 -0
  271. package/dist/components/motion/knockout-bracket.js +952 -0
  272. package/dist/components/motion/knockout-bracket.js.map +1 -0
  273. package/dist/components/motion/knockout-wheel.d.ts +183 -0
  274. package/dist/components/motion/knockout-wheel.d.ts.map +1 -0
  275. package/dist/components/motion/knockout-wheel.js +1038 -0
  276. package/dist/components/motion/knockout-wheel.js.map +1 -0
  277. package/dist/components/motion/morphing-lightbox.d.ts +67 -0
  278. package/dist/components/motion/morphing-lightbox.d.ts.map +1 -0
  279. package/dist/components/motion/morphing-lightbox.js +499 -0
  280. package/dist/components/motion/morphing-lightbox.js.map +1 -0
  281. package/dist/components/motion/morphing-search-chips.d.ts +54 -0
  282. package/dist/components/motion/morphing-search-chips.d.ts.map +1 -0
  283. package/dist/components/motion/morphing-search-chips.js +599 -0
  284. package/dist/components/motion/morphing-search-chips.js.map +1 -0
  285. package/dist/components/motion/multi-select/content.d.ts +1 -0
  286. package/dist/components/motion/not-found/shared.d.ts +1 -0
  287. package/dist/components/motion/number-ticker.d.ts +6 -1
  288. package/dist/components/motion/number-ticker.d.ts.map +1 -1
  289. package/dist/components/motion/number-ticker.js +19 -9
  290. package/dist/components/motion/number-ticker.js.map +1 -1
  291. package/dist/components/motion/parallax.js.map +1 -1
  292. package/dist/components/motion/popover-morph.d.ts +5 -0
  293. package/dist/components/motion/popover-morph.d.ts.map +1 -1
  294. package/dist/components/motion/popover-morph.js +34 -8
  295. package/dist/components/motion/popover-morph.js.map +1 -1
  296. package/dist/components/motion/popover.d.ts +1 -0
  297. package/dist/components/motion/prediction-market-card.d.ts +37 -0
  298. package/dist/components/motion/prediction-market-card.d.ts.map +1 -0
  299. package/dist/components/motion/prediction-market-card.js +215 -0
  300. package/dist/components/motion/prediction-market-card.js.map +1 -0
  301. package/dist/components/motion/prediction-market.d.ts +49 -0
  302. package/dist/components/motion/prediction-market.d.ts.map +1 -0
  303. package/dist/components/motion/prediction-market.js +440 -0
  304. package/dist/components/motion/prediction-market.js.map +1 -0
  305. package/dist/components/motion/radio.d.ts +3 -1
  306. package/dist/components/motion/radio.d.ts.map +1 -1
  307. package/dist/components/motion/radio.js +17 -5
  308. package/dist/components/motion/radio.js.map +1 -1
  309. package/dist/components/motion/scroll-progress.d.ts +1 -0
  310. package/dist/components/motion/shader-background.d.ts +1 -0
  311. package/dist/components/motion/sortable-list.d.ts +54 -0
  312. package/dist/components/motion/sortable-list.d.ts.map +1 -0
  313. package/dist/components/motion/sortable-list.js +254 -0
  314. package/dist/components/motion/sortable-list.js.map +1 -0
  315. package/dist/components/motion/sortable-stack.d.ts +2 -0
  316. package/dist/components/motion/sortable-stack.js +2 -0
  317. package/dist/components/motion/swap/controls.d.ts +22 -0
  318. package/dist/components/motion/swap/controls.d.ts.map +1 -0
  319. package/dist/components/motion/swap/controls.js +167 -0
  320. package/dist/components/motion/swap/controls.js.map +1 -0
  321. package/dist/components/motion/swap/field.d.ts +14 -0
  322. package/dist/components/motion/swap/field.d.ts.map +1 -0
  323. package/dist/components/motion/swap/field.js +107 -0
  324. package/dist/components/motion/swap/field.js.map +1 -0
  325. package/dist/components/motion/swap/quote-row.d.ts +13 -0
  326. package/dist/components/motion/swap/quote-row.d.ts.map +1 -0
  327. package/dist/components/motion/swap/quote-row.js +55 -0
  328. package/dist/components/motion/swap/quote-row.js.map +1 -0
  329. package/dist/components/motion/swap/token-badges.d.ts +19 -0
  330. package/dist/components/motion/swap/token-badges.d.ts.map +1 -0
  331. package/dist/components/motion/swap/token-badges.js +54 -0
  332. package/dist/components/motion/swap/token-badges.js.map +1 -0
  333. package/dist/components/motion/swap/token-picker.d.ts +14 -0
  334. package/dist/components/motion/swap/token-picker.d.ts.map +1 -0
  335. package/dist/components/motion/swap/token-picker.js +190 -0
  336. package/dist/components/motion/swap/token-picker.js.map +1 -0
  337. package/dist/components/motion/swap.d.ts +14 -0
  338. package/dist/components/motion/swap.d.ts.map +1 -0
  339. package/dist/components/motion/swap.js +378 -0
  340. package/dist/components/motion/swap.js.map +1 -0
  341. package/dist/components/motion/tabs.d.ts +6 -9
  342. package/dist/components/motion/tabs.d.ts.map +1 -1
  343. package/dist/components/motion/tabs.js +13 -4
  344. package/dist/components/motion/tabs.js.map +1 -1
  345. package/dist/components/motion/text-reveal.d.ts +1 -0
  346. package/dist/components/motion/tooltip/positioner.d.ts +8 -26
  347. package/dist/components/motion/tooltip/positioner.d.ts.map +1 -1
  348. package/dist/components/motion/tooltip/positioner.js +1 -2
  349. package/dist/components/motion/tooltip.d.ts +62 -20
  350. package/dist/components/motion/tooltip.d.ts.map +1 -1
  351. package/dist/components/motion/tooltip.js +1 -135
  352. package/dist/components/motion/wallet-card/account-avatar.d.ts +8 -0
  353. package/dist/components/motion/wallet-card/account-avatar.d.ts.map +1 -0
  354. package/dist/components/motion/wallet-card/account-avatar.js +2 -0
  355. package/dist/components/motion/wallet-card/account-switcher.d.ts +14 -0
  356. package/dist/components/motion/wallet-card/account-switcher.d.ts.map +1 -0
  357. package/dist/components/motion/wallet-card/account-switcher.js +153 -0
  358. package/dist/components/motion/wallet-card/account-switcher.js.map +1 -0
  359. package/dist/components/motion/wallet-card/actions.d.ts +12 -0
  360. package/dist/components/motion/wallet-card/actions.d.ts.map +1 -0
  361. package/dist/components/motion/wallet-card/actions.js +58 -0
  362. package/dist/components/motion/wallet-card/actions.js.map +1 -0
  363. package/dist/components/motion/wallet-card/balance-delta.d.ts +12 -0
  364. package/dist/components/motion/wallet-card/balance-delta.d.ts.map +1 -0
  365. package/dist/components/motion/wallet-card/balance-delta.js +72 -0
  366. package/dist/components/motion/wallet-card/balance-delta.js.map +1 -0
  367. package/dist/components/motion/wallet-card/copy-button.d.ts +12 -0
  368. package/dist/components/motion/wallet-card/copy-button.d.ts.map +1 -0
  369. package/dist/components/motion/wallet-card/copy-button.js +41 -0
  370. package/dist/components/motion/wallet-card/copy-button.js.map +1 -0
  371. package/dist/components/motion/wallet-card/index.d.ts +13 -0
  372. package/dist/components/motion/wallet-card/index.d.ts.map +1 -0
  373. package/dist/components/motion/wallet-card/index.js +115 -0
  374. package/dist/components/motion/wallet-card/index.js.map +1 -0
  375. package/dist/components/motion/wallet-card/search-bar.d.ts +17 -0
  376. package/dist/components/motion/wallet-card/search-bar.d.ts.map +1 -0
  377. package/dist/components/motion/wallet-card/search-bar.js +156 -0
  378. package/dist/components/motion/wallet-card/search-bar.js.map +1 -0
  379. package/dist/components/reui/alert.d.ts +1 -1
  380. package/dist/components/reui/autocomplete.d.ts +1 -1
  381. package/dist/components/reui/autocomplete.d.ts.map +1 -1
  382. package/dist/components/reui/autocomplete.js.map +1 -1
  383. package/dist/components/reui/badge.d.ts +2 -2
  384. package/dist/components/reui/cascader/cascader-async.d.ts +3 -2
  385. package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -1
  386. package/dist/components/reui/cascader/cascader-async.js.map +1 -1
  387. package/dist/components/reui/cascader/cascader-columns.js +3 -3
  388. package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
  389. package/dist/components/reui/cascader/cascader-context.d.ts +12 -4
  390. package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -1
  391. package/dist/components/reui/cascader/cascader-context.js.map +1 -1
  392. package/dist/components/reui/cascader/cascader-i18n.d.ts +1 -1
  393. package/dist/components/reui/cascader/cascader-item.d.ts +2 -2
  394. package/dist/components/reui/cascader/cascader-item.d.ts.map +1 -1
  395. package/dist/components/reui/cascader/cascader-item.js +22 -16
  396. package/dist/components/reui/cascader/cascader-item.js.map +1 -1
  397. package/dist/components/reui/cascader/cascader-lib.d.ts +8 -1
  398. package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -1
  399. package/dist/components/reui/cascader/cascader-lib.js +19 -11
  400. package/dist/components/reui/cascader/cascader-lib.js.map +1 -1
  401. package/dist/components/reui/cascader/cascader-nav.d.ts +1 -1
  402. package/dist/components/reui/cascader/cascader-nav.d.ts.map +1 -1
  403. package/dist/components/reui/cascader/cascader-nav.js +5 -4
  404. package/dist/components/reui/cascader/cascader-nav.js.map +1 -1
  405. package/dist/components/reui/cascader/cascader-types.d.ts +1 -1
  406. package/dist/components/reui/cascader/cascader-virtual.d.ts.map +1 -1
  407. package/dist/components/reui/cascader/cascader-virtual.js.map +1 -1
  408. package/dist/components/reui/cascader/cascader.d.ts +6 -2
  409. package/dist/components/reui/cascader/cascader.d.ts.map +1 -1
  410. package/dist/components/reui/cascader/cascader.js +58 -20
  411. package/dist/components/reui/cascader/cascader.js.map +1 -1
  412. package/dist/components/reui/color-picker.d.ts +280 -0
  413. package/dist/components/reui/color-picker.d.ts.map +1 -0
  414. package/dist/components/reui/color-picker.js +2013 -0
  415. package/dist/components/reui/color-picker.js.map +1 -0
  416. package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts.map +1 -1
  417. package/dist/components/reui/data-grid/data-grid-column-filter.js +2 -2
  418. package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
  419. package/dist/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -1
  420. package/dist/components/reui/data-grid/data-grid-column-header.js +59 -33
  421. package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
  422. package/dist/components/reui/data-grid/data-grid-column-visibility.js +1 -1
  423. package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -1
  424. package/dist/components/reui/data-grid/data-grid-pagination.js +2 -2
  425. package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
  426. package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -1
  427. package/dist/components/reui/data-grid/data-grid-scroll-area.js +94 -64
  428. package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
  429. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts +7 -2
  430. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -1
  431. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +74 -41
  432. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
  433. package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts +7 -2
  434. package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -1
  435. package/dist/components/reui/data-grid/data-grid-table-dnd.js +135 -32
  436. package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
  437. package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -1
  438. package/dist/components/reui/data-grid/data-grid-table-virtual.js +36 -42
  439. package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
  440. package/dist/components/reui/data-grid/data-grid-table.d.ts +168 -5
  441. package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
  442. package/dist/components/reui/data-grid/data-grid-table.js +354 -101
  443. package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
  444. package/dist/components/reui/data-grid/data-grid.d.ts +55 -0
  445. package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
  446. package/dist/components/reui/data-grid/data-grid.js +114 -52
  447. package/dist/components/reui/data-grid/data-grid.js.map +1 -1
  448. package/dist/components/reui/date-selector.d.ts +1 -0
  449. package/dist/components/reui/date-selector.js +1 -1
  450. package/dist/components/reui/emoji-picker.d.ts +367 -0
  451. package/dist/components/reui/emoji-picker.d.ts.map +1 -0
  452. package/dist/components/reui/emoji-picker.js +1768 -0
  453. package/dist/components/reui/emoji-picker.js.map +1 -0
  454. package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts.map +1 -1
  455. package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
  456. package/dist/components/reui/file-type.d.ts +496 -0
  457. package/dist/components/reui/file-type.d.ts.map +1 -0
  458. package/dist/components/reui/file-type.js +964 -0
  459. package/dist/components/reui/file-type.js.map +1 -0
  460. package/dist/components/reui/filters/filters-advanced.d.ts +1 -0
  461. package/dist/components/reui/filters/filters-advanced.js +1 -1
  462. package/dist/components/reui/filters/filters-advanced.js.map +1 -1
  463. package/dist/components/reui/filters/filters-builder.d.ts +1 -1
  464. package/dist/components/reui/filters/filters-chip.d.ts +5 -1
  465. package/dist/components/reui/filters/filters-chip.d.ts.map +1 -1
  466. package/dist/components/reui/filters/filters-chip.js +1 -1
  467. package/dist/components/reui/filters/filters-lib.d.ts +1 -1
  468. package/dist/components/reui/filters/filters-lib.d.ts.map +1 -1
  469. package/dist/components/reui/frame.d.ts +2 -2
  470. package/dist/components/reui/frame.d.ts.map +1 -1
  471. package/dist/components/reui/frame.js.map +1 -1
  472. package/dist/components/reui/gantt/gantt-nav.js +1 -1
  473. package/dist/components/reui/icon-tile.d.ts +1 -1
  474. package/dist/components/reui/icon-tile.js +8 -7
  475. package/dist/components/reui/icon-tile.js.map +1 -1
  476. package/dist/components/reui/kanban.d.ts.map +1 -1
  477. package/dist/components/reui/kanban.js +1 -1
  478. package/dist/components/reui/kanban.js.map +1 -1
  479. package/dist/components/reui/number-field.d.ts +3 -3
  480. package/dist/components/reui/number-field.d.ts.map +1 -1
  481. package/dist/components/reui/number-field.js.map +1 -1
  482. package/dist/components/reui/rating.d.ts +1 -1
  483. package/dist/components/reui/scrollspy.d.ts +1 -0
  484. package/dist/components/reui/signature-pad.d.ts +160 -0
  485. package/dist/components/reui/signature-pad.d.ts.map +1 -0
  486. package/dist/components/reui/signature-pad.js +764 -0
  487. package/dist/components/reui/signature-pad.js.map +1 -0
  488. package/dist/components/reui/time-picker.d.ts +202 -0
  489. package/dist/components/reui/time-picker.d.ts.map +1 -0
  490. package/dist/components/reui/time-picker.js +1002 -0
  491. package/dist/components/reui/time-picker.js.map +1 -0
  492. package/dist/components/ui/attachment.d.ts +2 -2
  493. package/dist/components/ui/badge.d.ts +1 -1
  494. package/dist/components/ui/bubble.d.ts +1 -1
  495. package/dist/components/ui/button.d.ts +2 -2
  496. package/dist/components/ui/command.d.ts.map +1 -1
  497. package/dist/components/ui/direction.js +1 -2
  498. package/dist/components/ui/empty.d.ts +1 -1
  499. package/dist/components/ui/field.js +1 -1
  500. package/dist/components/ui/input-group.d.ts +1 -1
  501. package/dist/components/ui/item.d.ts +3 -3
  502. package/dist/components/ui/message-scroller.d.ts.map +1 -1
  503. package/dist/components/ui/questionnaire.d.ts.map +1 -1
  504. package/dist/components/ui/sidebar.d.ts +2 -2
  505. package/dist/components/ui/sidebar.js +1 -1
  506. package/dist/components/ui/tabs.d.ts +1 -1
  507. package/dist/components/ui/toggle.d.ts +2 -2
  508. package/dist/constants-CsKm9sSk.js +30 -0
  509. package/dist/constants-CsKm9sSk.js.map +1 -0
  510. package/dist/context-3_vY1jbv.js +141 -0
  511. package/dist/context-3_vY1jbv.js.map +1 -0
  512. package/dist/context-BE60udRT.js +99 -0
  513. package/dist/context-BE60udRT.js.map +1 -0
  514. package/dist/context-BYXeJQnz.d.ts +150 -0
  515. package/dist/context-BYXeJQnz.d.ts.map +1 -0
  516. package/dist/context-Bc6VC1HA.js +181 -0
  517. package/dist/context-Bc6VC1HA.js.map +1 -0
  518. package/dist/context-BqjZ1Z_w.js +111 -0
  519. package/dist/context-BqjZ1Z_w.js.map +1 -0
  520. package/dist/context-CZfRKkcZ.js +204 -0
  521. package/dist/context-CZfRKkcZ.js.map +1 -0
  522. package/dist/context-Cn-00gfW.js +169 -0
  523. package/dist/context-Cn-00gfW.js.map +1 -0
  524. package/dist/context-Cnlo53sV.d.ts +92 -0
  525. package/dist/context-Cnlo53sV.d.ts.map +1 -0
  526. package/dist/context-Rl5VCYA8.js +257 -0
  527. package/dist/context-Rl5VCYA8.js.map +1 -0
  528. package/dist/context-sD8DQga-.js +122 -0
  529. package/dist/context-sD8DQga-.js.map +1 -0
  530. package/dist/context-tTdLKYNf.js +99 -0
  531. package/dist/context-tTdLKYNf.js.map +1 -0
  532. package/dist/{copy-menu-C5GaT4Z-.js → copy-menu-BXUh52bu.js} +2 -2
  533. package/dist/{copy-menu-C5GaT4Z-.js.map → copy-menu-BXUh52bu.js.map} +1 -1
  534. package/dist/ease-B82HVmio.d.ts +50 -0
  535. package/dist/ease-B82HVmio.d.ts.map +1 -0
  536. package/dist/hooks/use-copy-to-clipboard.d.ts +1 -0
  537. package/dist/hooks/use-hover-gesture.d.ts +1 -0
  538. package/dist/hooks/use-intersection-observer.d.ts +1 -0
  539. package/dist/hooks/use-modal-scope.d.ts +6 -0
  540. package/dist/hooks/use-modal-scope.d.ts.map +1 -0
  541. package/dist/hooks/use-modal-scope.js +83 -0
  542. package/dist/hooks/use-modal-scope.js.map +1 -0
  543. package/dist/hooks/use-scroll-position.d.ts +1 -0
  544. package/dist/hooks/use-slider-input.d.ts +1 -0
  545. package/dist/hooks/use-viewport.d.ts +1 -0
  546. package/dist/lib/ease.d.ts +2 -49
  547. package/dist/lib/tick-sound.d.ts +1 -0
  548. package/dist/model-DlbIqCZg.d.ts +41 -0
  549. package/dist/model-DlbIqCZg.d.ts.map +1 -0
  550. package/dist/model-NSIg2p7a.d.ts +20 -0
  551. package/dist/model-NSIg2p7a.d.ts.map +1 -0
  552. package/dist/model-_mRyI6V9.d.ts +18 -0
  553. package/dist/model-_mRyI6V9.d.ts.map +1 -0
  554. package/dist/plot-CdFTbMI_.js +131 -0
  555. package/dist/plot-CdFTbMI_.js.map +1 -0
  556. package/dist/{positioner-3mCqiebN.js → positioner-3r3cfkqT.js} +97 -33
  557. package/dist/positioner-3r3cfkqT.js.map +1 -0
  558. package/dist/tooltip-Bam5KeYe.js +535 -0
  559. package/dist/tooltip-Bam5KeYe.js.map +1 -0
  560. package/dist/tooltip-BarafYiU.d.ts +67 -0
  561. package/dist/tooltip-BarafYiU.d.ts.map +1 -0
  562. package/dist/tooltip-BqxVD6D-.d.ts +64 -0
  563. package/dist/tooltip-BqxVD6D-.d.ts.map +1 -0
  564. package/dist/tooltip-C01qUgsW.d.ts +133 -0
  565. package/dist/tooltip-C01qUgsW.d.ts.map +1 -0
  566. package/dist/tooltip-C6qUs7px.d.ts +36 -0
  567. package/dist/tooltip-C6qUs7px.d.ts.map +1 -0
  568. package/dist/tooltip-DQ4DXgeu.d.ts +94 -0
  569. package/dist/tooltip-DQ4DXgeu.d.ts.map +1 -0
  570. package/dist/types-B_6p3LXz.d.ts +36 -0
  571. package/dist/types-B_6p3LXz.d.ts.map +1 -0
  572. package/dist/types-D6e3gWOA.d.ts +22 -0
  573. package/dist/types-D6e3gWOA.d.ts.map +1 -0
  574. package/dist/use-geometry-CH0foIo7.d.ts +9 -0
  575. package/dist/use-geometry-CH0foIo7.d.ts.map +1 -0
  576. package/dist/use-position-DOi1gVL0.d.ts +32 -0
  577. package/dist/use-position-DOi1gVL0.d.ts.map +1 -0
  578. package/dist/utils-B3YXTsDI.js +26 -0
  579. package/dist/utils-B3YXTsDI.js.map +1 -0
  580. package/package.json +12 -12
  581. package/dist/cascader-types-BnH6wYD-.d.ts.map +0 -1
  582. package/dist/components/motion/tooltip.js.map +0 -1
  583. package/dist/lib/ease.d.ts.map +0 -1
  584. package/dist/positioner-3mCqiebN.js.map +0 -1
@@ -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 /** The navigation path, handed to `onSearch` as its scope. */\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":";;;;;;;;;AAuHA,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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CACrF,MAAM,EAAE,eAAe,iBAAiB;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/** 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,IAAI,GAAG,KAAK,cAAc,SAAS,IAAI,GAAG,OAAO;CAClE,MAAM,SAAS,IAAI,IAAI,MAAM,MAAM;CACnC,OAAO,IAAI,KAAK,IAAI;CACpB,OAAO;EAAE,OAAO,MAAM;EAAO;EAAQ,UAAU,MAAM;CAAS;AAChE;AAEA,SAAS,SACP,OACA,KACA,OACA,SACwB;CAExB,MAAM,WAAW,QAAQ,SAAU,MAAM,MAAM,IAAI,GAAG,KAAK,CAAC,IAAK,CAAC;CAClE,MAAM,OAAO,IAAI,IAAI,SAAS,KAAK,SAAS,KAAK,KAAK,CAAC;CACvD,MAAM,SAAS,SAAS,MAAM;CAC9B,KAAK,MAAM,QAAQ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,MAAM,QAAQ,IAAI,KAAK,GAAG;GACzD,UAAU,QAAQ,IAAI,KAAK;GAC3B,WAAW,KAAK;EAClB;CAEF,GAAG;EAAC;EAAS;EAAY;EAAM;EAAY;CAAM,CAAC;CAIlD,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;CACF,IACA;EACE;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"}
@@ -48,8 +48,8 @@ function CascaderColumns({ className, columnWidth = 220, maxHeight: maxHeightPro
48
48
  */
49
49
  const 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}`;
50
50
  function CascaderColumnPanel({ column, children, virtualized }) {
51
- const { labels, baseId, isBranch, isSelectable, isSelected, isIndeterminate, retryLevel } = useCascaderActions();
52
- const { loadStates } = useCascaderState();
51
+ const { labels, baseId, isBranch, isSelectable, isSelected, isIndeterminate, retryLevel, searchScope } = useCascaderActions();
52
+ const { loadStates, deepResults } = useCascaderState();
53
53
  const columnKey = column.parent?.value ?? "\0root";
54
54
  const loadState = loadStates.get(columnKey);
55
55
  let emptyBody = labels.empty;
@@ -104,7 +104,7 @@ function CascaderColumnPanel({ column, children, virtualized }) {
104
104
  "data-active": column.active || void 0,
105
105
  "data-depth": column.depth,
106
106
  id: `${baseId}-column-${column.depth}`,
107
- "aria-label": column.parent?.label ?? labels.rootLevel,
107
+ "aria-label": column.active && searchScope === "global" && deepResults ? labels.rootLevel : column.parent?.label ?? labels.rootLevel,
108
108
  ...virtualized ? { "data-virtualized": true } : null
109
109
  };
110
110
  const rowsClass = cn(CASCADER_ROWS_CLASS, virtualized && "relative");
@@ -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 { labels, baseId, isBranch, isSelectable, isSelected, isIndeterminate, retryLevel } =\n useCascaderActions();\n const { loadStates } = 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 \"aria-label\": 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;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,EAAE,QAAQ,QAAQ,UAAU,cAAc,YAAY,iBAAiB,eAC3E,mBAAmB;CACrB,MAAM,EAAE,eAAe,iBAAiB;CAGxC,MAAM,YAAY,OAAO,QAAQ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AU,OAAO;EAC/B,cAAc,OAAO,QAAQ,SAAS,OAAO;EAG7C,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
+ {"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;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;CAC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GA1BM,KAAK,KA0BX;CAEL,CAAC;CAGL,MAAM,SAAS;EACb,aAAa;EACb,eAAe,OAAO,UAAU,KAAA;EAChC,cAAc,OAAO;EAGrB,IAAI,GAAG,OAAO,UAAU,OAAO;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-BnH6wYD-.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-DVT-znZ-.js";
2
2
  import * as React$1 from "react";
3
3
  //#region src/components/reui/cascader/cascader-context.d.ts
4
4
  /**
@@ -19,10 +19,11 @@ export interface CascaderColumn<T = unknown> {
19
19
  export interface CascaderItemState<T = unknown> {
20
20
  branch: boolean;
21
21
  selected: boolean;
22
+ /** The node's own flag or a disabled ancestor's, as `isCascaderDisabled`. */
22
23
  disabled: boolean;
23
24
  depth: number;
24
25
  count: number;
25
- /** Ancestor chain, root first. Populated for deep-search rows. */
26
+ /** Ancestor chain, root first. Populated for deep and global search rows. */
26
27
  path: CascaderNode<T>[];
27
28
  }
28
29
  /**
@@ -64,8 +65,8 @@ declare const CascaderStateContext: React$1.Context<CascaderStateContextValue<un
64
65
  export declare function useCascaderState<T = unknown>(): CascaderStateContextValue<T>;
65
66
  /**
66
67
  * Config and callbacks, slow enough that a memoised row can subscribe: the
67
- * mutators are `[]`-dep callbacks over a latest-props ref. The three predicates
68
- * are the exception, read DURING RENDER where a ref written in an effect would
68
+ * mutators are `[]`-dep callbacks over a latest-props ref. The predicates are
69
+ * the exception, read DURING RENDER where a ref written in an effect would
69
70
  * return the previous commit's answer, so each is memoised on its own input.
70
71
  */
71
72
  export interface CascaderActionsContextValue<T = unknown> {
@@ -147,6 +148,13 @@ export interface CascaderActionsContextValue<T = unknown> {
147
148
  resolveNode: (value: string) => CascaderNode<T>;
148
149
  isBranch: (node: CascaderNode<T>) => boolean;
149
150
  isSelectable: (node: CascaderNode<T>) => boolean;
151
+ /**
152
+ * The node or an ancestor is `disabled`. Rows render it disabled; row
153
+ * presses, keys, `commit`, `navigate`, `navigateAt` and a held navigation
154
+ * refuse it. `pushLevel`, `setPath`, `toggleExpanded` and `setSelection` are
155
+ * raw setters and do not ask.
156
+ */
157
+ isDisabled: (node: CascaderNode<T>) => boolean;
150
158
  isSelected: (node: CascaderNode<T>) => boolean;
151
159
  /** Always `false` without `cascade`: partial selection needs propagation. */
152
160
  isIndeterminate: (node: CascaderNode<T>) => boolean;
@@ -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;EACA;EACA;EACA;;EAEA,MAAM,aAAa;;;;;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AqBA,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;;;;;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 +1 @@
1
- {"version":3,"file":"cascader-context.js","names":["React"],"sources":["../../../../src/components/reui/cascader/cascader-context.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport type {\n CascaderActionItem,\n CascaderChangeReason,\n CascaderFlatNode,\n CascaderIndex,\n CascaderLabels,\n CascaderLoadState,\n CascaderMode,\n CascaderNode,\n CascaderSearchScope,\n} from \"./cascader-types\";\n\n/**\n * Four contexts, not one: actions (config and callbacks, near-stable), state\n * (every keystroke), render (`renderItem` identity) and highlight (every arrow\n * key and pointer move). One combined context re-rendered every row on every\n * keystroke, which is what made `React.memo` on the row worth nothing.\n */\n\n/* -------------------------------------------------------------------------- */\n/* Shared types */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderColumn<T = unknown> {\n parent: CascaderNode<T> | null;\n items: CascaderNode<T>[];\n depth: number;\n /** The node in this column that is drilled into, if any. */\n activeValue: string | null;\n /** Whether this is the deepest column, the one Base UI owns. */\n active: boolean;\n}\n\nexport interface CascaderItemState<T = unknown> {\n branch: boolean;\n selected: boolean;\n disabled: boolean;\n depth: number;\n count: number;\n /** Ancestor chain, root first. Populated for deep-search rows. */\n path: CascaderNode<T>[];\n}\n\n/* -------------------------------------------------------------------------- */\n/* State */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Everything derived from the query, the path and the selection. One keystroke\n * rebuilds most of it, so never subscribe to it from a row.\n */\nexport interface CascaderStateContextValue<T = unknown> {\n /** Same `useMemo` identity as the actions context's `index`. */\n index: CascaderIndex<T>;\n path: string[];\n expanded: ReadonlySet<string>;\n query: string;\n currentParent: CascaderNode<T> | null;\n /** Rows for the current level, already filtered. */\n levelItems: CascaderNode<T>[];\n deepResults: CascaderNode<T>[] | null;\n /** What `Combobox.Root` is currently rendering, in render order. */\n renderedItems: CascaderNode<T>[];\n columns: CascaderColumn<T>[];\n treeRows: CascaderFlatNode<T>[];\n selectedValues: string[];\n /** Selected nodes below each value, at any depth. Absent means zero. */\n selectedDescendants: ReadonlyMap<string, number>;\n /**\n * Per level, keyed by parent value or `CASCADER_ROOT_KEY`. MEMBERSHIP is the\n * discriminator: no entry means never fetched, an entry with no `loading`, no\n * `error` and no children means fetched and genuinely empty.\n */\n loadStates: ReadonlyMap<string, CascaderLoadState>;\n /** Async search, `null` when idle. Separate: a search belongs to no level. */\n searchState: CascaderLoadState | null;\n announcement: string;\n}\n\nconst CascaderStateContext = React.createContext<CascaderStateContextValue | undefined>(undefined);\n\n/**\n * One provider serves every `T`, so the context holds an erased `unknown` value\n * and this cast restores it. The primitive never inspects the payload.\n */\nexport function useCascaderState<T = unknown>(): CascaderStateContextValue<T> {\n const context = React.useContext(CascaderStateContext);\n if (!context) {\n throw new Error(\"useCascaderState must be used within a Cascader\");\n }\n return context as unknown as CascaderStateContextValue<T>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Actions */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Config and callbacks, slow enough that a memoised row can subscribe: the\n * mutators are `[]`-dep callbacks over a latest-props ref. The three predicates\n * are the exception, read DURING RENDER where a ref written in an effect would\n * return the previous commit's answer, so each is memoised on its own input.\n */\nexport interface CascaderActionsContextValue<T = unknown> {\n index: CascaderIndex<T>;\n mode: CascaderMode;\n multiple: boolean;\n /** Multi-select only: a commit propagates over the LOADED subtree. */\n cascade: boolean;\n /** Whether a BRANCH is committable. Per-LIST: the check gutter is a COLUMN. */\n branchesSelectable: boolean;\n /** Draws the SINGLE-SELECT check and its gutter. Ignored in multi-select. */\n indicator: boolean;\n expandTrigger?: \"click\" | \"hover\";\n actions: CascaderActionItem[];\n searchScope: CascaderSearchScope;\n maxHeight?: number | string;\n inline: boolean;\n invalid: boolean;\n /**\n * Id prefix; columns are `${baseId}-column-${depth}`. The SCHEME is contract:\n * the filters primitive's `FilterMenuPinKeeper` restores its highlight across\n * a live re-pin through `${baseId}-column-0` and the `cascader-item` slot.\n */\n baseId: string;\n labels: CascaderLabels;\n\n /**\n * Whether rows are WINDOWED. Also handed to `Combobox.Root`, which is what\n * makes an explicit row `index` legal: forwarding one while this is false\n * makes `aria-activedescendant` resolve to nothing. Latched per level.\n */\n virtualized: boolean;\n /** Mounts a windowing renderer, returns its unregister. LAYOUT effect only. */\n registerVirtualRenderer: () => () => void;\n /** The root's `virtualize` prop. `undefined` means \"decide by count\". */\n virtualize?: boolean;\n virtualizeThreshold: number;\n estimateRowSize: number;\n overscan: number;\n\n /** Tells \"this level is empty\" from \"not fetched yet\" before a load state. */\n hasLoader: boolean;\n /** Next page of a level. Latched: a page with nothing new is not re-asked. */\n loadMore: (parentKey: string) => void;\n retryLevel: (parentKey: string) => void;\n /**\n * Evicts one level's async cache, `null` for the root, so membership reads\n * never-loaded. A level that is on screen when evicted refetches at once.\n */\n invalidateLevel: (value: string | null) => void;\n\n /** Index as of the last commit. Use in the stable callbacks, not `index`. */\n getIndex: () => CascaderIndex<T>;\n getState: () => CascaderStateContextValue<T>;\n /** Highlighted row or null. A getter: the highlight moves per arrow key. */\n getHighlighted: () => CascaderNode<T> | null;\n\n setPath: (next: string[] | ((prev: string[]) => string[])) => void;\n pushLevel: (value: string) => void;\n popLevel: () => void;\n goToDepth: (depth: number) => void;\n toggleExpanded: (value: string) => void;\n /**\n * Registers a footer submenu as open or closed. `Combobox` has no\n * `FloatingTree`, so one Escape would dismiss the flyout AND the cascader;\n * the root's `onOpenChange` guard cancels the close while any is open, from a\n * ref so it reads as of that event without re-rendering the root.\n */\n setFlyoutOpen: (key: string, open: boolean) => void;\n hasOpenFlyout: () => boolean;\n setQuery: (next: string) => void;\n /**\n * Replaces the selection. `onValueChange` diffs it against the current one\n * for its node and reason; pass `reason` only when the caller knows better.\n */\n setSelection: (values: string[], reason?: CascaderChangeReason) => void;\n /** Commits a node, for rows outside the listbox such as ancestor columns. */\n commit: (node: CascaderNode<T>) => void;\n navigate: (node: CascaderNode<T>) => void;\n /** Into `node` as a child of `depth`, replacing anything deeper. */\n navigateAt: (node: CascaderNode<T>, depth: number) => void;\n /** Never undefined: falls back to a remembered label, then a synthetic node. */\n resolveNode: (value: string) => CascaderNode<T>;\n isBranch: (node: CascaderNode<T>) => boolean;\n isSelectable: (node: CascaderNode<T>) => boolean;\n isSelected: (node: CascaderNode<T>) => boolean;\n /** Always `false` without `cascade`: partial selection needs propagation. */\n isIndeterminate: (node: CascaderNode<T>) => boolean;\n /**\n * O(1) read of `selectedDescendants`; a memoised row may not subscribe.\n * Unlike `isIndeterminate` this answers in every mode.\n */\n selectedDescendantCount: (node: CascaderNode<T>) => number;\n}\n\nconst CascaderActionsContext = React.createContext<CascaderActionsContextValue | undefined>(\n undefined,\n);\n\nexport function useCascaderActions<T = unknown>(): CascaderActionsContextValue<T> {\n const context = React.useContext(CascaderActionsContext);\n if (!context) {\n throw new Error(\"useCascaderActions must be used within a Cascader\");\n }\n return context as unknown as CascaderActionsContextValue<T>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Render props */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Their own context, republished every render. They cannot ride on the actions\n * context: an inline closure read off a memoised object is whichever closure\n * that object captured, so the row would call a stale prop over stale state.\n */\nexport interface CascaderRenderContextValue<T = unknown> {\n renderItem?: (node: CascaderNode<T>, state: CascaderItemState<T>) => React.ReactNode;\n renderLabel?: (node: CascaderNode<T>, state: CascaderItemState<T>) => React.ReactNode;\n}\n\nconst CascaderRenderContext = React.createContext<CascaderRenderContextValue>({});\n\nexport function useCascaderRender<T = unknown>(): CascaderRenderContextValue<T> {\n return React.useContext(CascaderRenderContext) as CascaderRenderContextValue<T>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Highlight store */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderHighlight {\n index: number;\n value: string | null;\n}\n\n/**\n * An external store, deliberately NOT React state: `onItemHighlighted` fires on\n * every arrow key AND every pointer move over the list, so `setState` would\n * re-render the whole root at mousemove rate. A store re-renders subscribers\n * only, which inside the primitive is the virtualizer.\n */\nexport interface CascaderHighlightStore {\n subscribe: (onStoreChange: () => void) => () => void;\n getSnapshot: () => CascaderHighlight;\n set: (next: CascaderHighlight) => void;\n}\n\nconst NO_HIGHLIGHT: CascaderHighlight = { index: -1, value: null };\n\nexport function createCascaderHighlightStore(): CascaderHighlightStore {\n let snapshot: CascaderHighlight = NO_HIGHLIGHT;\n const listeners = new Set<() => void>();\n\n return {\n subscribe(onStoreChange) {\n listeners.add(onStoreChange);\n return () => {\n listeners.delete(onStoreChange);\n };\n },\n // The SAME object until something changes; `useSyncExternalStore` needs it.\n getSnapshot() {\n return snapshot;\n },\n set(next) {\n if (next.index === snapshot.index && next.value === snapshot.value) return;\n snapshot = next;\n for (const listener of listeners) listener();\n },\n };\n}\n\n/** Shared and permanently empty, so the hook degrades outside a `Cascader`. */\nconst FALLBACK_HIGHLIGHT_STORE = createCascaderHighlightStore();\n\nconst CascaderHighlightContext =\n React.createContext<CascaderHighlightStore>(FALLBACK_HIGHLIGHT_STORE);\n\n/** Subscribes to the highlight. Re-renders ONLY the calling component. */\nexport function useCascaderHighlight(): CascaderHighlight {\n const store = React.useContext(CascaderHighlightContext);\n return React.useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n}\n\nexport {\n CascaderActionsContext,\n CascaderHighlightContext,\n CascaderRenderContext,\n CascaderStateContext,\n};\n"],"mappings":";;;AAmFA,MAAM,uBAAuBA,QAAM,cAAqD,KAAA,CAAS;;;;;AAMjG,SAAgB,mBAA8D;CAC5E,MAAM,UAAUA,QAAM,WAAW,oBAAoB;CACrD,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,iDAAiD;CAEnE,OAAO;AACT;AAyGA,MAAM,yBAAyBA,QAAM,cACnC,KAAA,CACF;AAEA,SAAgB,qBAAkE;CAChF,MAAM,UAAUA,QAAM,WAAW,sBAAsB;CACvD,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,mDAAmD;CAErE,OAAO;AACT;AAgBA,MAAM,wBAAwBA,QAAM,cAA0C,CAAC,CAAC;AAEhF,SAAgB,oBAAgE;CAC9E,OAAOA,QAAM,WAAW,qBAAqB;AAC/C;AAuBA,MAAM,eAAkC;CAAE,OAAO;CAAI,OAAO;AAAK;AAEjE,SAAgB,+BAAuD;CACrE,IAAI,WAA8B;CAClC,MAAM,4BAAY,IAAI,IAAgB;CAEtC,OAAO;EACL,UAAU,eAAe;GACvB,UAAU,IAAI,aAAa;GAC3B,aAAa;IACX,UAAU,OAAO,aAAa;GAChC;EACF;EAEA,cAAc;GACZ,OAAO;EACT;EACA,IAAI,MAAM;GACR,IAAI,KAAK,UAAU,SAAS,SAAS,KAAK,UAAU,SAAS,OAAO;GACpE,WAAW;GACX,KAAK,MAAM,YAAY,WAAW,SAAS;EAC7C;CACF;AACF;;AAGA,MAAM,2BAA2B,6BAA6B;AAE9D,MAAM,2BACJA,QAAM,cAAsC,wBAAwB;;AAGtE,SAAgB,uBAA0C;CACxD,MAAM,QAAQA,QAAM,WAAW,wBAAwB;CACvD,OAAOA,QAAM,qBAAqB,MAAM,WAAW,MAAM,aAAa,MAAM,WAAW;AACzF"}
1
+ {"version":3,"file":"cascader-context.js","names":["React"],"sources":["../../../../src/components/reui/cascader/cascader-context.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport type {\n CascaderActionItem,\n CascaderChangeReason,\n CascaderFlatNode,\n CascaderIndex,\n CascaderLabels,\n CascaderLoadState,\n CascaderMode,\n CascaderNode,\n CascaderSearchScope,\n} from \"./cascader-types\";\n\n/**\n * Four contexts, not one: actions (config and callbacks, near-stable), state\n * (every keystroke), render (`renderItem` identity) and highlight (every arrow\n * key and pointer move). One combined context re-rendered every row on every\n * keystroke, which is what made `React.memo` on the row worth nothing.\n */\n\n/* -------------------------------------------------------------------------- */\n/* Shared types */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderColumn<T = unknown> {\n parent: CascaderNode<T> | null;\n items: CascaderNode<T>[];\n depth: number;\n /** The node in this column that is drilled into, if any. */\n activeValue: string | null;\n /** Whether this is the deepest column, the one Base UI owns. */\n active: boolean;\n}\n\nexport interface CascaderItemState<T = unknown> {\n branch: boolean;\n selected: boolean;\n /** The node's own flag or a disabled ancestor's, as `isCascaderDisabled`. */\n disabled: boolean;\n depth: number;\n count: number;\n /** Ancestor chain, root first. Populated for deep and global search rows. */\n path: CascaderNode<T>[];\n}\n\n/* -------------------------------------------------------------------------- */\n/* State */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Everything derived from the query, the path and the selection. One keystroke\n * rebuilds most of it, so never subscribe to it from a row.\n */\nexport interface CascaderStateContextValue<T = unknown> {\n /** Same `useMemo` identity as the actions context's `index`. */\n index: CascaderIndex<T>;\n path: string[];\n expanded: ReadonlySet<string>;\n query: string;\n currentParent: CascaderNode<T> | null;\n /** Rows for the current level, already filtered. */\n levelItems: CascaderNode<T>[];\n deepResults: CascaderNode<T>[] | null;\n /** What `Combobox.Root` is currently rendering, in render order. */\n renderedItems: CascaderNode<T>[];\n columns: CascaderColumn<T>[];\n treeRows: CascaderFlatNode<T>[];\n selectedValues: string[];\n /** Selected nodes below each value, at any depth. Absent means zero. */\n selectedDescendants: ReadonlyMap<string, number>;\n /**\n * Per level, keyed by parent value or `CASCADER_ROOT_KEY`. MEMBERSHIP is the\n * discriminator: no entry means never fetched, an entry with no `loading`, no\n * `error` and no children means fetched and genuinely empty.\n */\n loadStates: ReadonlyMap<string, CascaderLoadState>;\n /** Async search, `null` when idle. Separate: a search belongs to no level. */\n searchState: CascaderLoadState | null;\n announcement: string;\n}\n\nconst CascaderStateContext = React.createContext<CascaderStateContextValue | undefined>(undefined);\n\n/**\n * One provider serves every `T`, so the context holds an erased `unknown` value\n * and this cast restores it. The primitive never inspects the payload.\n */\nexport function useCascaderState<T = unknown>(): CascaderStateContextValue<T> {\n const context = React.useContext(CascaderStateContext);\n if (!context) {\n throw new Error(\"useCascaderState must be used within a Cascader\");\n }\n return context as unknown as CascaderStateContextValue<T>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Actions */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Config and callbacks, slow enough that a memoised row can subscribe: the\n * mutators are `[]`-dep callbacks over a latest-props ref. The predicates are\n * the exception, read DURING RENDER where a ref written in an effect would\n * return the previous commit's answer, so each is memoised on its own input.\n */\nexport interface CascaderActionsContextValue<T = unknown> {\n index: CascaderIndex<T>;\n mode: CascaderMode;\n multiple: boolean;\n /** Multi-select only: a commit propagates over the LOADED subtree. */\n cascade: boolean;\n /** Whether a BRANCH is committable. Per-LIST: the check gutter is a COLUMN. */\n branchesSelectable: boolean;\n /** Draws the SINGLE-SELECT check and its gutter. Ignored in multi-select. */\n indicator: boolean;\n expandTrigger?: \"click\" | \"hover\";\n actions: CascaderActionItem[];\n searchScope: CascaderSearchScope;\n maxHeight?: number | string;\n inline: boolean;\n invalid: boolean;\n /**\n * Id prefix; columns are `${baseId}-column-${depth}`. The SCHEME is contract:\n * the filters primitive's `FilterMenuPinKeeper` restores its highlight across\n * a live re-pin through `${baseId}-column-0` and the `cascader-item` slot.\n */\n baseId: string;\n labels: CascaderLabels;\n\n /**\n * Whether rows are WINDOWED. Also handed to `Combobox.Root`, which is what\n * makes an explicit row `index` legal: forwarding one while this is false\n * makes `aria-activedescendant` resolve to nothing. Latched per level.\n */\n virtualized: boolean;\n /** Mounts a windowing renderer, returns its unregister. LAYOUT effect only. */\n registerVirtualRenderer: () => () => void;\n /** The root's `virtualize` prop. `undefined` means \"decide by count\". */\n virtualize?: boolean;\n virtualizeThreshold: number;\n estimateRowSize: number;\n overscan: number;\n\n /** Tells \"this level is empty\" from \"not fetched yet\" before a load state. */\n hasLoader: boolean;\n /** Next page of a level. Latched: a page with nothing new is not re-asked. */\n loadMore: (parentKey: string) => void;\n retryLevel: (parentKey: string) => void;\n /**\n * Evicts one level's async cache, `null` for the root, so membership reads\n * never-loaded. A level that is on screen when evicted refetches at once.\n */\n invalidateLevel: (value: string | null) => void;\n\n /** Index as of the last commit. Use in the stable callbacks, not `index`. */\n getIndex: () => CascaderIndex<T>;\n getState: () => CascaderStateContextValue<T>;\n /** Highlighted row or null. A getter: the highlight moves per arrow key. */\n getHighlighted: () => CascaderNode<T> | null;\n\n setPath: (next: string[] | ((prev: string[]) => string[])) => void;\n pushLevel: (value: string) => void;\n popLevel: () => void;\n goToDepth: (depth: number) => void;\n toggleExpanded: (value: string) => void;\n /**\n * Registers a footer submenu as open or closed. `Combobox` has no\n * `FloatingTree`, so one Escape would dismiss the flyout AND the cascader;\n * the root's `onOpenChange` guard cancels the close while any is open, from a\n * ref so it reads as of that event without re-rendering the root.\n */\n setFlyoutOpen: (key: string, open: boolean) => void;\n hasOpenFlyout: () => boolean;\n setQuery: (next: string) => void;\n /**\n * Replaces the selection. `onValueChange` diffs it against the current one\n * for its node and reason; pass `reason` only when the caller knows better.\n */\n setSelection: (values: string[], reason?: CascaderChangeReason) => void;\n /** Commits a node, for rows outside the listbox such as ancestor columns. */\n commit: (node: CascaderNode<T>) => void;\n navigate: (node: CascaderNode<T>) => void;\n /** Into `node` as a child of `depth`, replacing anything deeper. */\n navigateAt: (node: CascaderNode<T>, depth: number) => void;\n /** Never undefined: falls back to a remembered label, then a synthetic node. */\n resolveNode: (value: string) => CascaderNode<T>;\n isBranch: (node: CascaderNode<T>) => boolean;\n isSelectable: (node: CascaderNode<T>) => boolean;\n /**\n * The node or an ancestor is `disabled`. Rows render it disabled; row\n * presses, keys, `commit`, `navigate`, `navigateAt` and a held navigation\n * refuse it. `pushLevel`, `setPath`, `toggleExpanded` and `setSelection` are\n * raw setters and do not ask.\n */\n isDisabled: (node: CascaderNode<T>) => boolean;\n isSelected: (node: CascaderNode<T>) => boolean;\n /** Always `false` without `cascade`: partial selection needs propagation. */\n isIndeterminate: (node: CascaderNode<T>) => boolean;\n /**\n * O(1) read of `selectedDescendants`; a memoised row may not subscribe.\n * Unlike `isIndeterminate` this answers in every mode.\n */\n selectedDescendantCount: (node: CascaderNode<T>) => number;\n}\n\nconst CascaderActionsContext = React.createContext<CascaderActionsContextValue | undefined>(\n undefined,\n);\n\nexport function useCascaderActions<T = unknown>(): CascaderActionsContextValue<T> {\n const context = React.useContext(CascaderActionsContext);\n if (!context) {\n throw new Error(\"useCascaderActions must be used within a Cascader\");\n }\n return context as unknown as CascaderActionsContextValue<T>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Render props */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Their own context, republished every render. They cannot ride on the actions\n * context: an inline closure read off a memoised object is whichever closure\n * that object captured, so the row would call a stale prop over stale state.\n */\nexport interface CascaderRenderContextValue<T = unknown> {\n renderItem?: (node: CascaderNode<T>, state: CascaderItemState<T>) => React.ReactNode;\n renderLabel?: (node: CascaderNode<T>, state: CascaderItemState<T>) => React.ReactNode;\n}\n\nconst CascaderRenderContext = React.createContext<CascaderRenderContextValue>({});\n\nexport function useCascaderRender<T = unknown>(): CascaderRenderContextValue<T> {\n return React.useContext(CascaderRenderContext) as CascaderRenderContextValue<T>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Highlight store */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderHighlight {\n index: number;\n value: string | null;\n}\n\n/**\n * An external store, deliberately NOT React state: `onItemHighlighted` fires on\n * every arrow key AND every pointer move over the list, so `setState` would\n * re-render the whole root at mousemove rate. A store re-renders subscribers\n * only, which inside the primitive is the virtualizer.\n */\nexport interface CascaderHighlightStore {\n subscribe: (onStoreChange: () => void) => () => void;\n getSnapshot: () => CascaderHighlight;\n set: (next: CascaderHighlight) => void;\n}\n\nconst NO_HIGHLIGHT: CascaderHighlight = { index: -1, value: null };\n\nexport function createCascaderHighlightStore(): CascaderHighlightStore {\n let snapshot: CascaderHighlight = NO_HIGHLIGHT;\n const listeners = new Set<() => void>();\n\n return {\n subscribe(onStoreChange) {\n listeners.add(onStoreChange);\n return () => {\n listeners.delete(onStoreChange);\n };\n },\n // The SAME object until something changes; `useSyncExternalStore` needs it.\n getSnapshot() {\n return snapshot;\n },\n set(next) {\n if (next.index === snapshot.index && next.value === snapshot.value) return;\n snapshot = next;\n for (const listener of listeners) listener();\n },\n };\n}\n\n/** Shared and permanently empty, so the hook degrades outside a `Cascader`. */\nconst FALLBACK_HIGHLIGHT_STORE = createCascaderHighlightStore();\n\nconst CascaderHighlightContext =\n React.createContext<CascaderHighlightStore>(FALLBACK_HIGHLIGHT_STORE);\n\n/** Subscribes to the highlight. Re-renders ONLY the calling component. */\nexport function useCascaderHighlight(): CascaderHighlight {\n const store = React.useContext(CascaderHighlightContext);\n return React.useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n}\n\nexport {\n CascaderActionsContext,\n CascaderHighlightContext,\n CascaderRenderContext,\n CascaderStateContext,\n};\n"],"mappings":";;;AAoFA,MAAM,uBAAuBA,QAAM,cAAqD,KAAA,CAAS;;;;;AAMjG,SAAgB,mBAA8D;CAC5E,MAAM,UAAUA,QAAM,WAAW,oBAAoB;CACrD,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,iDAAiD;CAEnE,OAAO;AACT;AAgHA,MAAM,yBAAyBA,QAAM,cACnC,KAAA,CACF;AAEA,SAAgB,qBAAkE;CAChF,MAAM,UAAUA,QAAM,WAAW,sBAAsB;CACvD,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,mDAAmD;CAErE,OAAO;AACT;AAgBA,MAAM,wBAAwBA,QAAM,cAA0C,CAAC,CAAC;AAEhF,SAAgB,oBAAgE;CAC9E,OAAOA,QAAM,WAAW,qBAAqB;AAC/C;AAuBA,MAAM,eAAkC;CAAE,OAAO;CAAI,OAAO;AAAK;AAEjE,SAAgB,+BAAuD;CACrE,IAAI,WAA8B;CAClC,MAAM,4BAAY,IAAI,IAAgB;CAEtC,OAAO;EACL,UAAU,eAAe;GACvB,UAAU,IAAI,aAAa;GAC3B,aAAa;IACX,UAAU,OAAO,aAAa;GAChC;EACF;EAEA,cAAc;GACZ,OAAO;EACT;EACA,IAAI,MAAM;GACR,IAAI,KAAK,UAAU,SAAS,SAAS,KAAK,UAAU,SAAS,OAAO;GACpE,WAAW;GACX,KAAK,MAAM,YAAY,WAAW,SAAS;EAC7C;CACF;AACF;;AAGA,MAAM,2BAA2B,6BAA6B;AAE9D,MAAM,2BACJA,QAAM,cAAsC,wBAAwB;;AAGtE,SAAgB,uBAA0C;CACxD,MAAM,QAAQA,QAAM,WAAW,wBAAwB;CACvD,OAAOA,QAAM,qBAAqB,MAAM,WAAW,MAAM,aAAa,MAAM,WAAW;AACzF"}
@@ -1,4 +1,4 @@
1
- import { s as CascaderLabels } from "../../../cascader-types-BnH6wYD-.js";
1
+ import { s as CascaderLabels } from "../../../cascader-types-DVT-znZ-.js";
2
2
  //#region src/components/reui/cascader/cascader-i18n.d.ts
3
3
  /**
4
4
  * English defaults. Every string the primitive can render lives here, so a
@@ -1,4 +1,4 @@
1
- import { d as CascaderLoadState, p as CascaderNode } from "../../../cascader-types-BnH6wYD-.js";
1
+ import { d as CascaderLoadState, p as CascaderNode } from "../../../cascader-types-DVT-znZ-.js";
2
2
  import * as React$1 from "react";
3
3
  import { Combobox } from "@base-ui/react";
4
4
  //#region src/components/reui/cascader/cascader-item.d.ts
@@ -28,7 +28,7 @@ export interface CascaderItemProps extends Omit<Combobox.Item.Props, "value" | "
28
28
  index?: number;
29
29
  /** Indentation depth. Drives `--cascader-indent` in tree mode. */
30
30
  depth?: number;
31
- /** Renders the ancestor chain under the label, for deep-search results. */
31
+ /** Renders the ancestor chain under the label, for deep and global search. */
32
32
  showPath?: boolean;
33
33
  /** `option` renders a real `Combobox.Item`; `button` renders identical markup
34
34
  * outside the listbox, for the ancestor columns in columns mode. */
@@ -1 +1 @@
1
- {"version":3,"file":"cascader-item.d.ts","names":["React","ComboboxPrimitive"],"sources":["../../../../src/components/reui/cascader/cascader-item.tsx"],"mappings":";;;;KA0BK;EAAkB;;;;YAIX,mBAAmBA,QAAM,WAAW,eAAe;;;;;;;;qBAsDlD;iBAyBI,0BACP,KACNC,SAAkB,KAAK;;EAIzB;EACA,QAAQD,QAAM;EACd,WAAW,OAAO;EAClB,aAAa,OAAO;EACpB,MAAM;;;EAGN;;EAEA;;EAEA;;;EAGA;;EAEA;;EAEA;;;;EAIA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;EAIA;;;;EAIA;EACA,WAAWA,QAAM;;;;cAKb,cAAYA,QAAA,uBAAA,MAAA,OAAA,OAAA,UAAA,IAAA,UAAA,QAAA,QAAA,YAAA,YAAA,gBAAA,UAAA,cAAA,eAAA,mBAAA,eAAA,mBAAA,SAAA,OAAA,iBAAA,eAAA,WAAA,UAAA,SAAA,WAAA,UAAA,SAuBf,sBAAiBA,QAAA,IAAA;;;;wBAunBJ,qBACd,MAAM,cACN,YAAY,oBAAoB;EAEhC;EACA;EACA;EACA;;iBAqBe;;EAEf,YAAY,MAAM,cAAc,kBAAkBA,QAAM;;;;;;iBAOjD,gBAAgB,YAAY,qBAAkBA,QAAA,IAAA;iBA0EtC,2BAA2B,KAAKC,SAAkB,MAAM;;EAEvE;;;;;;;iBAQO,gBAAgB,cAAc,SAAS,qBAAkBD,QAAA,IAAA;iBAYjD,2BACP,KAAKC,SAAkB,WAAW;;EAE1C;EACA,QAAQD,QAAM;;;;iBA+BP,cAAc,OAAO,qBAAkBA,QAAA,IAAA;iBAK/B,+BACP,KAAKC,SAAkB,UAAU;;EAEzC;;;;;iBAMO,oBAAoB,cAAc,SAAS,yBAAsBD,QAAA,IAAA"}
1
+ {"version":3,"file":"cascader-item.d.ts","names":["React","ComboboxPrimitive"],"sources":["../../../../src/components/reui/cascader/cascader-item.tsx"],"mappings":";;;;KA0BK;EAAkB;;;;YAIX,mBAAmBA,QAAM,WAAW,eAAe;;;;;;;;qBAsDlD;iBAyBI,0BACP,KACNC,SAAkB,KAAK;;EAIzB;EACA,QAAQD,QAAM;EACd,WAAW,OAAO;EAClB,aAAa,OAAO;EACpB,MAAM;;;EAGN;;EAEA;;EAEA;;;EAGA;;EAEA;;EAEA;;;;EAIA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;EAIA;;;;EAIA;EACA,WAAWA,QAAM;;;;cAKb,cAAYA,QAAA,uBAAA,MAAA,OAAA,OAAA,UAAA,IAAA,UAAA,QAAA,QAAA,YAAA,YAAA,gBAAA,UAAA,cAAA,eAAA,mBAAA,eAAA,mBAAA,SAAA,OAAA,iBAAA,eAAA,WAAA,UAAA,SAAA,WAAA,UAAA,SAuBf,sBAAiBA,QAAA,IAAA;;;;wBAqoBJ,qBACd,MAAM,cACN,YAAY,oBAAoB;EAEhC;EACA;EACA;EACA;;iBAqBe;;EAEf,YAAY,MAAM,cAAc,kBAAkBA,QAAM;;;;;;iBAOjD,gBAAgB,YAAY,qBAAkBA,QAAA,IAAA;iBA0EtC,2BAA2B,KAAKC,SAAkB,MAAM;;EAEvE;;;;;;;iBAQO,gBAAgB,cAAc,SAAS,qBAAkBD,QAAA,IAAA;iBAYjD,2BACP,KAAKC,SAAkB,WAAW;;EAE1C;EACA,QAAQD,QAAM;;;;iBA+BP,cAAc,OAAO,qBAAkBA,QAAA,IAAA;iBAK/B,+BACP,KAAKC,SAAkB,UAAU;;EAEzC;;;;;iBAMO,oBAAoB,cAAc,SAAS,yBAAsBD,QAAA,IAAA"}
@@ -44,10 +44,11 @@ const CASCADER_HOVER_EXPAND_DELAY = 150;
44
44
  /** One row. Branch presses navigate instead of selecting, vetoed here with
45
45
  * `preventBaseUIHandler()` on `onClick` (Enter too) and on `onMouseUp`. */
46
46
  const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, showPath = false, as = "option", expanded, indent = 16, branch: branchProp, selectable: selectableProp, selected: selectedProp, indeterminate: indeterminateProp, selectedCount: selectedCountProp, loading, error, childrenLoading = false, childrenError = false, className, children, onClick, onMouseUp, style, ...props }) {
47
- const { index: treeIndex, mode, labels, isBranch, isSelectable, isSelected, isIndeterminate, selectedDescendantCount, multiple, branchesSelectable, indicator: indicatorEnabled, expandTrigger = "click", navigate, navigateAt, toggleExpanded, commit, virtualized, loadMore, retryLevel } = useCascaderActions();
47
+ const { index: treeIndex, mode, labels, isBranch, isSelectable, isDisabled, isSelected, isIndeterminate, selectedDescendantCount, multiple, branchesSelectable, indicator: indicatorEnabled, expandTrigger = "click", navigate, navigateAt, toggleExpanded, commit, getState, virtualized, loadMore, retryLevel } = useCascaderActions();
48
48
  const { renderItem, renderLabel } = useCascaderRender();
49
49
  const branch = branchProp ?? isBranch(node);
50
50
  const selectable = selectableProp ?? isSelectable(node);
51
+ const disabled = isDisabled(node);
51
52
  const selected = selectedProp ?? isSelected(node);
52
53
  const indeterminate = !selected && (indeterminateProp ?? isIndeterminate(node));
53
54
  const count = branch ? getCascaderCount(treeIndex, node) : 0;
@@ -63,7 +64,7 @@ const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, sh
63
64
  }, []);
64
65
  const handleClick = React$1.useCallback((event) => {
65
66
  onClick?.(event);
66
- if (node.disabled) return;
67
+ if (disabled) return;
67
68
  if (branch && !selectable) {
68
69
  veto(event);
69
70
  navigate(node);
@@ -71,6 +72,7 @@ const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, sh
71
72
  }, [
72
73
  onClick,
73
74
  node,
75
+ disabled,
74
76
  branch,
75
77
  selectable,
76
78
  veto,
@@ -78,11 +80,11 @@ const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, sh
78
80
  ]);
79
81
  const handleMouseUp = React$1.useCallback((event) => {
80
82
  onMouseUp?.(event);
81
- if (node.disabled) return;
83
+ if (disabled) return;
82
84
  if (branch && !selectable) veto(event);
83
85
  }, [
84
86
  onMouseUp,
85
- node,
87
+ disabled,
86
88
  branch,
87
89
  selectable,
88
90
  veto
@@ -90,13 +92,15 @@ const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, sh
90
92
  const handleExpanderClick = React$1.useCallback((event) => {
91
93
  event.stopPropagation();
92
94
  veto(event);
93
- if (node.disabled) return;
94
- if (expanded) toggleExpanded(node.value);
95
- else navigate(node);
95
+ if (expanded) {
96
+ if (!disabled || getState().expanded.has(node.value)) toggleExpanded(node.value);
97
+ } else if (!disabled) navigate(node);
96
98
  }, [
97
99
  veto,
98
100
  node,
101
+ disabled,
99
102
  expanded,
103
+ getState,
100
104
  toggleExpanded,
101
105
  navigate
102
106
  ]);
@@ -107,12 +111,13 @@ const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, sh
107
111
  const handleChevronClick = React$1.useCallback((event) => {
108
112
  event.stopPropagation();
109
113
  veto(event);
110
- if (node.disabled) return;
114
+ if (disabled) return;
111
115
  if (as === "button") navigateAt(node, depth ?? 0);
112
116
  else navigate(node);
113
117
  }, [
114
118
  veto,
115
119
  node,
120
+ disabled,
116
121
  as,
117
122
  navigateAt,
118
123
  depth,
@@ -124,7 +129,7 @@ const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, sh
124
129
  }, []);
125
130
  const handleButtonClick = React$1.useCallback((event) => {
126
131
  onClick?.(event);
127
- if (node.disabled) return;
132
+ if (disabled) return;
128
133
  if (branch && !selectable) {
129
134
  navigateAt(node, depth ?? 0);
130
135
  return;
@@ -133,6 +138,7 @@ const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, sh
133
138
  }, [
134
139
  onClick,
135
140
  node,
141
+ disabled,
136
142
  branch,
137
143
  selectable,
138
144
  navigateAt,
@@ -155,7 +161,7 @@ const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, sh
155
161
  retryLevel,
156
162
  loadMore
157
163
  ]);
158
- const hoverNavigates = expandTrigger === "hover" && mode === "columns" && as === "option" && branch && !node.disabled;
164
+ const hoverNavigates = expandTrigger === "hover" && mode === "columns" && as === "option" && branch && !disabled;
159
165
  const hoverTimerRef = React$1.useRef(null);
160
166
  const cancelHoverNavigate = React$1.useCallback(() => {
161
167
  if (hoverTimerRef.current == null) return;
@@ -233,7 +239,7 @@ const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, sh
233
239
  const itemState = {
234
240
  branch,
235
241
  selected,
236
- disabled: !!node.disabled,
242
+ disabled,
237
243
  depth: nodeDepth,
238
244
  count,
239
245
  path: showPath ? getCascaderPath(treeIndex, node.value).slice(0, -1) : []
@@ -269,7 +275,7 @@ const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, sh
269
275
  "data-state": childrenError ? "error" : childrenLoading ? "loading" : "idle",
270
276
  onClick: handleExpanderClick,
271
277
  onMouseUp: handleExpanderMouseUp,
272
- className: cn("-ms-0.5", childrenError ? "text-destructive" : "text-muted-foreground", AFFORDANCE_BOX_CLASS, AFFORDANCE_HOVER_CLASS, childrenLoading && "pointer-events-none"),
278
+ className: cn("-ms-0.5", childrenError ? "text-destructive" : "text-muted-foreground", AFFORDANCE_BOX_CLASS, AFFORDANCE_HOVER_CLASS, disabled && expanded && "pointer-events-auto", childrenLoading && "pointer-events-none"),
273
279
  children: childrenLoading ? /* @__PURE__ */ jsx(Spinner, {
274
280
  "aria-hidden": "true",
275
281
  className: "size-4"
@@ -370,8 +376,8 @@ const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, sh
370
376
  type: "button",
371
377
  ...shared,
372
378
  tabIndex: -1,
373
- disabled: node.disabled,
374
- "aria-disabled": node.disabled || void 0,
379
+ disabled,
380
+ "aria-disabled": disabled || void 0,
375
381
  onClick: handleButtonClick,
376
382
  onMouseDown: handleButtonMouseDown,
377
383
  ...buttonProps,
@@ -382,7 +388,7 @@ const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, sh
382
388
  ...shared,
383
389
  value: node,
384
390
  ...virtualized && index != null ? { index } : null,
385
- disabled: node.disabled,
391
+ disabled,
386
392
  ...mode === "tree" ? {
387
393
  role: "treeitem",
388
394
  "aria-level": nodeDepth + 1,
@@ -399,7 +405,7 @@ const CascaderItem = React$1.memo(function CascaderItem({ node, index, depth, sh
399
405
  children: body
400
406
  });
401
407
  });
402
- /** Ancestor chain under a deep-search result: "Name" alone is ambiguous. */
408
+ /** Ancestor chain under a deep or global hit: "Name" alone is ambiguous. */
403
409
  function CascaderItemPath({ node }) {
404
410
  const { index, labels } = useCascaderActions();
405
411
  const ancestors = getCascaderPath(index, node.value).slice(0, -1);