@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-nav.js","names":["React","ComboboxPrimitive"],"sources":["../../../../src/components/reui/cascader/cascader-nav.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react\";\nimport { useDirection } from \"@base-ui/react/direction-provider\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useCascaderActions, useCascaderState } from \"./cascader-context\";\nimport { resolveCascaderSearchLabel } from \"./cascader-i18n\";\nimport {\n collapseCascaderPath,\n getCascaderFooterStops,\n getCascaderPath,\n isCascaderRtl,\n} from \"./cascader-lib\";\nimport type { CascaderCollapse, CascaderNode, CascaderValueDisplay } from \"./cascader-types\";\n\n/* -------------------------------------------------------------------------- */\n/* Separator */\n/* -------------------------------------------------------------------------- */\n\nfunction PathChevron() {\n return <ChevronRightIcon className=\"size-3 shrink-0 opacity-50 rtl:-scale-x-100\" />;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Nav */\n/* -------------------------------------------------------------------------- */\n\nexport type CascaderNavProps = useRender.ComponentProps<\"div\">;\n\n/**\n * Header: back control, search input, and the separator under them. The\n * breadcrumb belongs with the list below: it describes the rows, not the field.\n */\nfunction CascaderNav({ className, ...props }: CascaderNavProps) {\n const defaultProps = {\n \"data-slot\": \"cascader-nav\",\n className: cn(\n // `py-1`, not `py-1.5`: the row inside sets its own per-style height, so\n // even padding read too tall. 6px beside the field, 4px above and below.\n \"flex shrink-0 flex-col gap-1 border-border/60 border-b px-1.5 py-1\",\n className,\n ),\n };\n\n return useRender({\n defaultTagName: \"div\",\n render: props.render,\n props: mergeProps<\"div\">(defaultProps, props),\n });\n}\n\n/* -------------------------------------------------------------------------- */\n/* Back */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderBackProps extends Omit<useRender.ComponentProps<\"button\">, \"children\"> {\n children?: React.ReactNode;\n}\n\n/** Pops one level. Renders nothing at the root, so no dead header space. */\nfunction CascaderBack({ className, children, ...props }: CascaderBackProps) {\n const { popLevel, labels, mode } = useCascaderActions();\n const { path } = useCascaderState();\n\n // Checked after `useRender`, never before it: an early return would change\n // the hook count between the root level and any deeper one.\n const hidden = mode !== \"drill\" || path.length === 0;\n\n const defaultProps = {\n \"data-slot\": \"cascader-back\",\n type: \"button\" as const,\n \"aria-label\": labels.back,\n onClick: () => popLevel(),\n className: cn(\n \"flex shrink-0 items-center justify-center rounded-md text-muted-foreground outline-hidden transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring/50\",\n // A notch under the row height: an affordance, not a second field.\n \"size-6\",\n className,\n ),\n children: children ?? <ChevronLeftIcon className=\"size-4 rtl:-scale-x-100\" />,\n };\n\n const element = useRender({\n defaultTagName: \"button\",\n render: props.render,\n props: mergeProps<\"button\">(defaultProps, props),\n });\n\n return hidden ? null : element;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Breadcrumb */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderBreadcrumbProps extends Omit<useRender.ComponentProps<\"nav\">, \"children\"> {\n /** Maximum visible node segments before the middle collapses. */\n maxSegments?: number;\n collapse?: CascaderCollapse;\n /** Clicking a segment navigates back to that level. Defaults to true. */\n interactive?: boolean;\n}\n\n/**\n * Compact trail of the current level AND its ancestors, collapsed by the same\n * helper as `CascaderValue` so panel and trigger cannot disagree. The current\n * level IS the last crumb: dropping it read as a rendering bug, a trail naming\n * only the places you are not.\n */\nfunction CascaderBreadcrumb({\n className,\n maxSegments = 3,\n collapse = \"middle\",\n interactive = true,\n ...props\n}: CascaderBreadcrumbProps) {\n const { goToDepth, mode, labels } = useCascaderActions();\n const { path, index } = useCascaderState();\n\n // The WHOLE path, current level included; unresolvable entries drop out.\n const nodes = path.map((value) => index.byValue.get(value)).filter(Boolean) as CascaderNode[];\n const segments = collapseCascaderPath(nodes, { maxSegments, collapse });\n // `collapseCascaderPath` never collapses the last node away, so this is\n // always the final segment - derived rather than assumed, so a `collapse`\n // mode that ever changes that cannot mark an ancestor as the current page.\n const currentValue = nodes.length ? nodes[nodes.length - 1].value : null;\n\n // See `CascaderBack`: the hide check must not short-circuit past `useRender`.\n const hidden = mode !== \"drill\" || nodes.length === 0;\n\n const goTo = (node: CascaderNode) => {\n const depth = path.indexOf(node.value);\n if (depth < 0) return;\n // `goToDepth`, not a bare `setPath`: it reports `reason: \"breadcrumb\"`,\n // clears the query and drops any pending navigation.\n goToDepth(depth + 1);\n };\n\n const defaultProps = {\n \"data-slot\": \"cascader-breadcrumb\",\n \"aria-label\": labels.breadcrumbLabel,\n className: cn(\n \"flex min-w-0 shrink-0 items-center gap-0.5 pt-1.5 pb-0.5 text-muted-foreground text-xs\",\n // Lines up with the ROWS, not the header: each style's list padding plus\n // its row inset. vega/mira/rhea `p-1`+`pl-2`, nova `p-1`+`pl-1.5`, maia\n // `p-1`+`pl-3`, lyra `pl-2`, luma/sera `p-1.5`+`pl-3`, per style-*.css.\n \"px-2.5\",\n className,\n ),\n children: segments.map((segment, i) => (\n <React.Fragment key={segment.type === \"node\" ? segment.node.value : `gap-${i}`}>\n {i > 0 ? <PathChevron /> : null}\n {segment.type === \"ellipsis\" ? (\n <span\n data-slot=\"cascader-breadcrumb-ellipsis\"\n title={segment.hidden.map((n) => n.label).join(` ${labels.pathSeparator} `)}\n className=\"shrink-0\"\n >\n &hellip;\n </span>\n ) : interactive && segment.node.value !== currentValue ? (\n <button\n type=\"button\"\n data-slot=\"cascader-breadcrumb-item\"\n onClick={() => goTo(segment.node)}\n className=\"max-w-32 truncate rounded-sm outline-hidden transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50\"\n >\n {segment.node.label}\n </button>\n ) : (\n <span\n data-slot=\"cascader-breadcrumb-item\"\n /* The level on screen: a span because it goes nowhere, plus\n `aria-current=\"page\"` so it is not read as one of a flat list. */\n {...(segment.node.value === currentValue ? { \"aria-current\": \"page\" as const } : null)}\n className={cn(\n \"max-w-32 truncate\",\n segment.node.value === currentValue && \"font-medium text-foreground\",\n )}\n >\n {segment.node.label}\n </span>\n )}\n </React.Fragment>\n )),\n };\n\n const element = useRender({\n defaultTagName: \"nav\",\n render: props.render,\n props: mergeProps<\"nav\">(defaultProps, props),\n });\n\n return hidden ? null : element;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Input */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderInputProps extends ComboboxPrimitive.Input.Props {\n /** Renders the back control inline, before the field. Defaults to true. */\n showBack?: boolean;\n}\n\n/** Base UI hands its input handlers an event carrying the veto hook. */\ntype CascaderInputKeyEvent = Parameters<NonNullable<ComboboxPrimitive.Input.Props[\"onKeyDown\"]>>[0];\n\n/**\n * Search field. MUST render inside the positioner: only there does Base UI skip\n * the refill from the committed selection that would fight every level swap.\n */\nfunction CascaderInput({\n className,\n showBack = true,\n placeholder,\n onKeyDown,\n \"aria-describedby\": ariaDescribedBy,\n ...props\n}: CascaderInputProps) {\n const {\n labels,\n popLevel,\n mode,\n getHighlighted,\n isBranch,\n navigate,\n index,\n toggleExpanded,\n inline,\n invalid,\n baseId,\n } = useCascaderActions();\n const direction = useDirection();\n const { currentParent, query, path, renderedItems, treeRows } = useCascaderState();\n\n const resolvedPlaceholder =\n placeholder ?? resolveCascaderSearchLabel(labels, currentParent?.label);\n\n // Not `showBack`: `CascaderBack` renders nothing at the root or outside\n // drill mode, where the field's own leading `px-1.5` is wanted. Beside the\n // button it stacks with the row's `gap-1` into a 10px hole, hence `ps-0`.\n const backVisible = showBack && mode === \"drill\" && path.length > 0;\n\n const hintId = `${baseId}-hint`;\n // Base UI names no list while inline; columns mode moves the real listbox to\n // the deepest panel, which is the `path.length` one.\n const listId = `${baseId}-column-${mode === \"columns\" ? path.length : 0}`;\n\n // The direction the HINT is worded for. `handleKeyDown` re-reads\n // `isCascaderRtl` per keystroke; this is text on screen before any key, so\n // the same check runs once against the mounted DOM (on the hint span, so no\n // second ref into Base UI's input). SSR renders the \"ltr\" default and\n // corrects on hydration. `direction` is the only dep: a `dir` attribute and\n // the stylesheet are declarations, not state, so nothing to resubscribe to.\n const hintRef = React.useRef<HTMLSpanElement>(null);\n const [hintDir, setHintDir] = React.useState<\"ltr\" | \"rtl\">(\"ltr\");\n React.useLayoutEffect(() => {\n const hint = hintRef.current;\n if (!hint) return;\n setHintDir(isCascaderRtl(hint, direction) ? \"rtl\" : \"ltr\");\n }, [direction]);\n\n /**\n * Moves the highlight to `targetIndex` in `treeRows`. Base UI has no\n * imperative setter (`actionsRef` is `{ unmount }`), so the move is arrow\n * presses, sound only because `useListNavigation` fires `onItemHighlighted`\n * SYNCHRONOUSLY per keydown. A press that fails to close the gap ends it.\n */\n const moveHighlightTo = (field: HTMLInputElement, targetIndex: number) => {\n const rowIndex = () => {\n const highlighted = getHighlighted();\n if (!highlighted) return -1;\n return treeRows.findIndex((row) => row.node.value === highlighted.value);\n };\n\n let current = rowIndex();\n for (let step = 0; step < treeRows.length; step += 1) {\n if (current === -1 || current === targetIndex) return;\n const key = current > targetIndex ? \"ArrowUp\" : \"ArrowDown\";\n field.dispatchEvent(new KeyboardEvent(\"keydown\", { key, bubbles: true, cancelable: true }));\n const next = rowIndex();\n const progressed =\n key === \"ArrowUp\"\n ? next < current && next >= targetIndex\n : next > current && next <= targetIndex;\n if (next === -1 || !progressed) return;\n current = next;\n }\n };\n\n /**\n * The tree pattern's two level keys; Base UI leaves both alone (list\n * navigation is vertical-only, the chip handler no-ops without\n * `Combobox.Chips`). Passed in rather than hardcoded because RTL swaps them:\n * APG defines them as \"toward the children\", not as a physical arrow.\n */\n const handleTreeKeyDown = (\n event: CascaderInputKeyEvent,\n field: HTMLInputElement,\n caretAtStart: boolean,\n caretAtEnd: boolean,\n forwardKey: \"ArrowLeft\" | \"ArrowRight\",\n backKey: \"ArrowLeft\" | \"ArrowRight\",\n ) => {\n const forward = event.key === forwardKey;\n if (!forward && event.key !== backKey) return;\n if (forward ? !caretAtEnd : !caretAtStart) return;\n\n const highlighted = getHighlighted();\n if (!highlighted) return;\n const rowIndex = treeRows.findIndex((row) => row.node.value === highlighted.value);\n if (rowIndex < 0) return;\n const row = treeRows[rowIndex];\n\n if (forward) {\n if (!row.branch) return;\n event.preventDefault();\n if (!row.expanded) {\n // `navigate`, not `toggleExpanded`: it waits for an unloaded branch's\n // children, so the keyboard path in matches the expander.\n navigate(row.node);\n return;\n }\n // `flattenCascaderTree` emits children right after their parent, so the\n // first child is the next row. The depth check covers an empty branch.\n const child = treeRows[rowIndex + 1];\n if (child && child.depth === row.depth + 1) {\n moveHighlightTo(field, rowIndex + 1);\n }\n return;\n }\n\n if (row.branch && row.expanded) {\n event.preventDefault();\n toggleExpanded(row.node.value);\n return;\n }\n\n const parentValue = index.parentOf.get(row.node.value);\n if (!parentValue) return;\n const parentIndex = treeRows.findIndex((entry) => entry.node.value === parentValue);\n if (parentIndex < 0) return;\n event.preventDefault();\n moveHighlightTo(field, parentIndex);\n };\n\n const handleKeyDown = (event: CascaderInputKeyEvent) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) return;\n\n const field = event.currentTarget;\n const caretAtStart = field.selectionStart === 0 && field.selectionEnd === 0;\n const caretAtEnd = field.selectionStart === query.length && field.selectionEnd === query.length;\n\n // ArrowDown at the END of the list hands real focus to the pinned footer,\n // the key a combobox is actually navigated with; Tab still works and still\n // skips the scroll area. An EMPTY list hands off at once, and the footer\n // owns the way back. Counted from state, so a windowed list still answers.\n if (event.key === \"ArrowDown\" && !event.altKey) {\n const rowCount = mode === \"tree\" ? treeRows.length : renderedItems.length;\n const lastValue =\n mode === \"tree\" ? treeRows[rowCount - 1]?.node.value : renderedItems[rowCount - 1]?.value;\n const highlighted = getHighlighted();\n const atEnd = rowCount === 0 || (highlighted != null && highlighted.value === lastValue);\n if (atEnd) {\n const panel = field.closest<HTMLElement>('[data-slot=\"cascader-panel\"]');\n const stop = panel ? getCascaderFooterStops(panel)[0] : undefined;\n if (stop) {\n event.preventDefault();\n // Base UI's handler is deliberately NOT vetoed: its wrap's first\n // press CLEARS the highlight, so no stale row stays active behind the\n // focused command, and the emptied highlight completes the ring.\n stop.focus();\n return;\n }\n }\n }\n\n // The level keys are LOGICAL, not physical: in RTL, ArrowLeft opens a\n // branch and ArrowRight goes back. They act only at the caret edge, and\n // those guards do NOT mirror: `selectionStart === 0` is the logical start.\n const rtl = isCascaderRtl(field, direction);\n const forwardKey = rtl ? \"ArrowLeft\" : \"ArrowRight\";\n const backKey = rtl ? \"ArrowRight\" : \"ArrowLeft\";\n\n if (mode === \"tree\") {\n handleTreeKeyDown(event, field, caretAtStart, caretAtEnd, forwardKey, backKey);\n return;\n }\n\n if (event.key === forwardKey && caretAtEnd) {\n const highlighted = getHighlighted();\n if (highlighted && isBranch(highlighted)) {\n event.preventDefault();\n navigate(highlighted);\n return;\n }\n }\n\n // Backspace on an empty query pops a level too, so the keyboard way out of\n // a level is symmetric with typing into it.\n if (\n (event.key === backKey && caretAtStart) ||\n (event.key === \"Backspace\" && query.length === 0)\n ) {\n if (path.length > 0) {\n event.preventDefault();\n popLevel();\n }\n }\n };\n\n return (\n <div\n data-slot=\"cascader-input-row\"\n className={cn(\n \"flex shrink-0 items-center gap-1\",\n /* Each style sizes a combobox search field only as a DIRECT child of\n the popup; this row is nested, so the ladder is mirrored here rather\n than hardcoding one height for all eight styles. */\n \"h-8\",\n )}\n >\n {showBack ? <CascaderBack /> : null}\n <ComboboxPrimitive.Input\n data-slot=\"cascader-input\"\n placeholder={resolvedPlaceholder}\n onKeyDown={handleKeyDown}\n /* Nothing on screen says the level keys exist. */\n aria-describedby={[ariaDescribedBy, hintId].filter(Boolean).join(\" \")}\n /* Conditional: an explicit `undefined` deletes Base UI's own value. */\n {...(mode === \"tree\" ? { \"aria-haspopup\": \"tree\" as const } : null)}\n /* Base UI omits BOTH `aria-expanded` and `aria-controls` while inline,\n and an embedded panel is permanently expanded, so supply both. */\n {...(inline ? { \"aria-expanded\": true, \"aria-controls\": listId } : null)}\n /* No trigger to carry the invalid state in the `inline` case. */\n {...(invalid ? { \"aria-invalid\": true, \"data-invalid\": \"\" } : null)}\n className={cn(\n \"h-full w-full min-w-0 flex-1 bg-transparent px-1.5 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n backVisible && \"ps-0\",\n className,\n )}\n {...props}\n />\n <span id={hintId} ref={hintRef} className=\"sr-only\">\n {/* `hintDir`, not `direction`: the context alone misses an RTL app that\n uses a `dir` attribute instead of `DirectionProvider`. */}\n {labels.keyboardHint(mode, hintDir)}\n </span>\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Value */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderValueProps extends Omit<useRender.ComponentProps<\"span\">, \"children\"> {\n /** `path` shows the full trail, `leaf` only the node, `count` only a total. */\n display?: CascaderValueDisplay;\n maxSegments?: number;\n collapse?: CascaderCollapse;\n separator?: React.ReactNode;\n /** Renders the selected node's icon before the trail. */\n showIcon?: boolean;\n placeholder?: React.ReactNode;\n /** Replaces the whole rendering. Receives the resolved selection and path. */\n children?: (selected: CascaderNode[], path: CascaderNode[]) => React.ReactNode;\n}\n\n/**\n * Trigger display. Defaults to the collapsed selection path rather than a bare\n * leaf label, which in a nested picker is frequently ambiguous.\n */\nfunction CascaderValue({\n className,\n display = \"path\",\n maxSegments = 3,\n collapse = \"middle\",\n separator,\n showIcon = true,\n placeholder,\n children,\n ...props\n}: CascaderValueProps) {\n const { labels, multiple, resolveNode } = useCascaderActions();\n const { index, selectedValues } = useCascaderState();\n\n // `resolveNode`, not `index.byValue`: a selection missing from `items` (async\n // children, a removed item) must still render a label, not an empty trigger.\n const selected = selectedValues.map(resolveNode);\n\n const resolvedPath = selectedValues.length === 1 ? getCascaderPath(index, selectedValues[0]) : [];\n // No ancestor chain: fall back to the node so `display=\"path\"` shows a leaf.\n const path = resolvedPath.length > 0 ? resolvedPath : selected.length === 1 ? selected : [];\n\n let content: React.ReactNode;\n\n if (children) {\n content = children(selected, path);\n } else if (selectedValues.length === 0) {\n content = <span className=\"truncate text-muted-foreground\">{placeholder}</span>;\n } else if (display === \"count\" || (multiple && selectedValues.length > 1)) {\n content = labels.selectedCount(selectedValues.length);\n } else {\n const leaf = path[path.length - 1] ?? selected[0];\n const segments =\n display === \"leaf\"\n ? [{ type: \"node\" as const, node: leaf }]\n : collapseCascaderPath(path, { maxSegments, collapse });\n\n content = (\n <>\n {showIcon && leaf?.icon ? (\n <span\n data-slot=\"cascader-value-icon\"\n className=\"flex shrink-0 items-center text-muted-foreground\"\n >\n {leaf.icon}\n </span>\n ) : null}\n {segments.map((segment, i) => (\n <React.Fragment key={segment.type === \"node\" ? segment.node.value : `gap-${i}`}>\n {i > 0 ? (separator ?? <PathChevron />) : null}\n {segment.type === \"ellipsis\" ? (\n <span\n data-slot=\"cascader-value-ellipsis\"\n title={segment.hidden.map((n) => n.label).join(` ${labels.pathSeparator} `)}\n className=\"shrink-0 text-muted-foreground\"\n >\n &hellip;\n </span>\n ) : (\n <span className={cn(\"truncate\", i < segments.length - 1 && \"text-muted-foreground\")}>\n {segment.node?.label}\n </span>\n )}\n </React.Fragment>\n ))}\n </>\n );\n }\n\n const defaultProps = {\n \"data-slot\": \"cascader-value\",\n className: cn(\"flex min-w-0 items-center gap-1 truncate\", className),\n children: content,\n };\n\n return useRender({\n defaultTagName: \"span\",\n render: props.render,\n props: mergeProps<\"span\">(defaultProps, props),\n });\n}\n\nexport { CascaderBack, CascaderBreadcrumb, CascaderInput, CascaderNav, CascaderValue };\n"],"mappings":";;;;;;;;;;;;;AAwBA,SAAS,cAAc;CACrB,OAAO,oBAAC,kBAAD,EAAkB,WAAU,8CAA+C,CAAA;AACpF;;;;;AAYA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA2B;CAC9D,MAAM,eAAe;EACnB,aAAa;EACb,WAAW,GAGT,sEACA,SACF;CACF;CAEA,OAAO,UAAU;EACf,gBAAgB;EAChB,QAAQ,MAAM;EACd,OAAO,WAAkB,cAAc,KAAK;CAC9C,CAAC;AACH;;AAWA,SAAS,aAAa,EAAE,WAAW,UAAU,GAAG,SAA4B;CAC1E,MAAM,EAAE,UAAU,QAAQ,SAAS,mBAAmB;CACtD,MAAM,EAAE,SAAS,iBAAiB;CAIlC,MAAM,SAAS,SAAS,WAAW,KAAK,WAAW;CAEnD,MAAM,eAAe;EACnB,aAAa;EACb,MAAM;EACN,cAAc,OAAO;EACrB,eAAe,SAAS;EACxB,WAAW,GACT,4MAEA,UACA,SACF;EACA,UAAU,YAAY,oBAAC,iBAAD,EAAiB,WAAU,0BAA2B,CAAA;CAC9E;CAEA,MAAM,UAAU,UAAU;EACxB,gBAAgB;EAChB,QAAQ,MAAM;EACd,OAAO,WAAqB,cAAc,KAAK;CACjD,CAAC;CAED,OAAO,SAAS,OAAO;AACzB;;;;;;;AAoBA,SAAS,mBAAmB,EAC1B,WACA,cAAc,GACd,WAAW,UACX,cAAc,MACd,GAAG,SACuB;CAC1B,MAAM,EAAE,WAAW,M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AAA,KAAK;EACF,CAAA,IACJ,MACH,SAAS,KAAK,SAAS,MACtB,qBAACD,QAAM,UAAP,EAAA,UAAA,CACG,IAAI,IAAK,aAAa,oBAAC,aAAD,CAAc,CAAA,IAAK,MACzC,QAAQ,SAAS,aAChB,oBAAC,QAAD;GACE,aAAU;GACV,OAAO,QAAQ,OAAO,KAAK,MAAM,EAAE,KAAK,CAAC,CAAC,KAAK,IAAI,OAAO,cAAc,EAAE;GAC1E,WAAU;GACX,UAAA;EAEK,CAAA,IAEN,oBAAC,QAAD;GAAM,WAAW,GAAG,YAAY,IAAI,SAAS,SAAS,KAAK,uBAAuB;GAC/E,UAAA,QAAQ,MAAM;EACX,CAAA,CAEM,EAAA,GAfK,QAAQ,SAAS,SAAS,QAAQ,KAAK,QAAQ,OAAO,GAe3D,CACjB,CACD,EAAA,CAAA;CAEN;CAEA,MAAM,eAAe;EACnB,aAAa;EACb,WAAW,GAAG,4CAA4C,SAAS;EACnE,UAAU;CACZ;CAEA,OAAO,UAAU;EACf,gBAAgB;EAChB,QAAQ,MAAM;EACd,OAAO,WAAmB,cAAc,KAAK;CAC/C,CAAC;AACH"}
1
+ {"version":3,"file":"cascader-nav.js","names":["React","ComboboxPrimitive"],"sources":["../../../../src/components/reui/cascader/cascader-nav.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react\";\nimport { useDirection } from \"@base-ui/react/direction-provider\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useCascaderActions, useCascaderState } from \"./cascader-context\";\nimport { resolveCascaderSearchLabel } from \"./cascader-i18n\";\nimport {\n collapseCascaderPath,\n getCascaderFooterStops,\n getCascaderPath,\n isCascaderRtl,\n} from \"./cascader-lib\";\nimport type { CascaderCollapse, CascaderNode, CascaderValueDisplay } from \"./cascader-types\";\n\n/* -------------------------------------------------------------------------- */\n/* Separator */\n/* -------------------------------------------------------------------------- */\n\nfunction PathChevron() {\n return <ChevronRightIcon className=\"size-3 shrink-0 opacity-50 rtl:-scale-x-100\" />;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Nav */\n/* -------------------------------------------------------------------------- */\n\nexport type CascaderNavProps = useRender.ComponentProps<\"div\">;\n\n/**\n * Header: back control, search input, and the separator under them. The\n * breadcrumb belongs with the list below: it describes the rows, not the field.\n */\nfunction CascaderNav({ className, ...props }: CascaderNavProps) {\n const defaultProps = {\n \"data-slot\": \"cascader-nav\",\n className: cn(\n // `py-1`, not `py-1.5`: the row inside sets its own per-style height, so\n // even padding read too tall. 6px beside the field, 4px above and below.\n \"flex shrink-0 flex-col gap-1 border-border/60 border-b px-1.5 py-1\",\n className,\n ),\n };\n\n return useRender({\n defaultTagName: \"div\",\n render: props.render,\n props: mergeProps<\"div\">(defaultProps, props),\n });\n}\n\n/* -------------------------------------------------------------------------- */\n/* Back */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderBackProps extends Omit<useRender.ComponentProps<\"button\">, \"children\"> {\n children?: React.ReactNode;\n}\n\n/** Pops one level. Renders nothing at the root, so no dead header space. */\nfunction CascaderBack({ className, children, ...props }: CascaderBackProps) {\n const { popLevel, labels, mode } = useCascaderActions();\n const { path } = useCascaderState();\n\n // Checked after `useRender`, never before it: an early return would change\n // the hook count between the root level and any deeper one.\n const hidden = mode !== \"drill\" || path.length === 0;\n\n const defaultProps = {\n \"data-slot\": \"cascader-back\",\n type: \"button\" as const,\n \"aria-label\": labels.back,\n onClick: () => popLevel(),\n className: cn(\n \"flex shrink-0 items-center justify-center rounded-md text-muted-foreground outline-hidden transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring/50\",\n // A notch under the row height: an affordance, not a second field.\n \"size-6\",\n className,\n ),\n children: children ?? <ChevronLeftIcon className=\"size-4 rtl:-scale-x-100\" />,\n };\n\n const element = useRender({\n defaultTagName: \"button\",\n render: props.render,\n props: mergeProps<\"button\">(defaultProps, props),\n });\n\n return hidden ? null : element;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Breadcrumb */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderBreadcrumbProps extends Omit<useRender.ComponentProps<\"nav\">, \"children\"> {\n /** Maximum visible node segments before the middle collapses. */\n maxSegments?: number;\n collapse?: CascaderCollapse;\n /** Clicking a segment navigates back to that level. Defaults to true. */\n interactive?: boolean;\n}\n\n/**\n * Compact trail of the current level AND its ancestors, collapsed by the same\n * helper as `CascaderValue` so panel and trigger cannot disagree. The current\n * level IS the last crumb: dropping it read as a rendering bug, a trail naming\n * only the places you are not.\n */\nfunction CascaderBreadcrumb({\n className,\n maxSegments = 3,\n collapse = \"middle\",\n interactive = true,\n ...props\n}: CascaderBreadcrumbProps) {\n const { goToDepth, mode, labels } = useCascaderActions();\n const { path, index } = useCascaderState();\n\n // The WHOLE path, current level included; unresolvable entries drop out.\n const nodes = path.map((value) => index.byValue.get(value)).filter(Boolean) as CascaderNode[];\n const segments = collapseCascaderPath(nodes, { maxSegments, collapse });\n // `collapseCascaderPath` never collapses the last node away, so this is\n // always the final segment - derived rather than assumed, so a `collapse`\n // mode that ever changes that cannot mark an ancestor as the current page.\n const currentValue = nodes.length ? nodes[nodes.length - 1].value : null;\n\n // See `CascaderBack`: the hide check must not short-circuit past `useRender`.\n const hidden = mode !== \"drill\" || nodes.length === 0;\n\n const goTo = (node: CascaderNode) => {\n const depth = path.indexOf(node.value);\n if (depth < 0) return;\n // `goToDepth`, not a bare `setPath`: it reports `reason: \"breadcrumb\"`,\n // clears the query and drops any pending navigation.\n goToDepth(depth + 1);\n };\n\n const defaultProps = {\n \"data-slot\": \"cascader-breadcrumb\",\n \"aria-label\": labels.breadcrumbLabel,\n className: cn(\n \"flex min-w-0 shrink-0 items-center gap-0.5 pt-1.5 pb-0.5 text-muted-foreground text-xs\",\n // Lines up with the ROWS, not the header: each style's list padding plus\n // its row inset. vega/mira/rhea `p-1`+`pl-2`, nova `p-1`+`pl-1.5`, maia\n // `p-1`+`pl-3`, lyra `pl-2`, luma/sera `p-1.5`+`pl-3`, per style-*.css.\n \"px-2.5\",\n className,\n ),\n children: segments.map((segment, i) => (\n <React.Fragment key={segment.type === \"node\" ? segment.node.value : `gap-${i}`}>\n {i > 0 ? <PathChevron /> : null}\n {segment.type === \"ellipsis\" ? (\n <span\n data-slot=\"cascader-breadcrumb-ellipsis\"\n title={segment.hidden.map((n) => n.label).join(` ${labels.pathSeparator} `)}\n className=\"shrink-0\"\n >\n &hellip;\n </span>\n ) : interactive && segment.node.value !== currentValue ? (\n <button\n type=\"button\"\n data-slot=\"cascader-breadcrumb-item\"\n onClick={() => goTo(segment.node)}\n className=\"max-w-32 truncate rounded-sm outline-hidden transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50\"\n >\n {segment.node.label}\n </button>\n ) : (\n <span\n data-slot=\"cascader-breadcrumb-item\"\n /* The level on screen: a span because it goes nowhere, plus\n `aria-current=\"page\"` so it is not read as one of a flat list. */\n {...(segment.node.value === currentValue ? { \"aria-current\": \"page\" as const } : null)}\n className={cn(\n \"max-w-32 truncate\",\n segment.node.value === currentValue && \"font-medium text-foreground\",\n )}\n >\n {segment.node.label}\n </span>\n )}\n </React.Fragment>\n )),\n };\n\n const element = useRender({\n defaultTagName: \"nav\",\n render: props.render,\n props: mergeProps<\"nav\">(defaultProps, props),\n });\n\n return hidden ? null : element;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Input */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderInputProps extends ComboboxPrimitive.Input.Props {\n /** Renders the back control inline, before the field. Defaults to true. */\n showBack?: boolean;\n}\n\n/** Base UI hands its input handlers an event carrying the veto hook. */\ntype CascaderInputKeyEvent = Parameters<NonNullable<ComboboxPrimitive.Input.Props[\"onKeyDown\"]>>[0];\n\n/**\n * Search field. MUST render inside the positioner: only there does Base UI skip\n * the refill from the committed selection that would fight every level swap.\n */\nfunction CascaderInput({\n className,\n showBack = true,\n placeholder,\n onKeyDown,\n \"aria-describedby\": ariaDescribedBy,\n ...props\n}: CascaderInputProps) {\n const {\n labels,\n popLevel,\n mode,\n getHighlighted,\n isBranch,\n isDisabled,\n navigate,\n index,\n toggleExpanded,\n inline,\n invalid,\n baseId,\n searchScope,\n } = useCascaderActions();\n const direction = useDirection();\n const { currentParent, query, path, expanded, renderedItems, treeRows } = useCascaderState();\n\n // Root wording under a global search: naming the level on screen would\n // promise a narrower search than the one that runs.\n const resolvedPlaceholder =\n placeholder ??\n resolveCascaderSearchLabel(labels, searchScope === \"global\" ? undefined : currentParent?.label);\n\n // Not `showBack`: `CascaderBack` renders nothing at the root or outside\n // drill mode, where the field's own leading `px-1.5` is wanted. Beside the\n // button it stacks with the row's `gap-1` into a 10px hole, hence `ps-0`.\n const backVisible = showBack && mode === \"drill\" && path.length > 0;\n\n const hintId = `${baseId}-hint`;\n // Base UI names no list while inline; columns mode moves the real listbox to\n // the deepest panel, which is the `path.length` one.\n const listId = `${baseId}-column-${mode === \"columns\" ? path.length : 0}`;\n\n // The direction the HINT is worded for. `handleKeyDown` re-reads\n // `isCascaderRtl` per keystroke; this is text on screen before any key, so\n // the same check runs once against the mounted DOM (on the hint span, so no\n // second ref into Base UI's input). SSR renders the \"ltr\" default and\n // corrects on hydration. `direction` is the only dep: a `dir` attribute and\n // the stylesheet are declarations, not state, so nothing to resubscribe to.\n const hintRef = React.useRef<HTMLSpanElement>(null);\n const [hintDir, setHintDir] = React.useState<\"ltr\" | \"rtl\">(\"ltr\");\n React.useLayoutEffect(() => {\n const hint = hintRef.current;\n if (!hint) return;\n setHintDir(isCascaderRtl(hint, direction) ? \"rtl\" : \"ltr\");\n }, [direction]);\n\n /**\n * Moves the highlight to `targetIndex` in `treeRows`. Base UI has no\n * imperative setter (`actionsRef` is `{ unmount }`), so the move is arrow\n * presses, sound only because `useListNavigation` fires `onItemHighlighted`\n * SYNCHRONOUSLY per keydown. A press that fails to close the gap ends it.\n */\n const moveHighlightTo = (field: HTMLInputElement, targetIndex: number) => {\n const rowIndex = () => {\n const highlighted = getHighlighted();\n if (!highlighted) return -1;\n return treeRows.findIndex((row) => row.node.value === highlighted.value);\n };\n\n let current = rowIndex();\n for (let step = 0; step < treeRows.length; step += 1) {\n if (current === -1 || current === targetIndex) return;\n const key = current > targetIndex ? \"ArrowUp\" : \"ArrowDown\";\n field.dispatchEvent(new KeyboardEvent(\"keydown\", { key, bubbles: true, cancelable: true }));\n const next = rowIndex();\n const progressed =\n key === \"ArrowUp\"\n ? next < current && next >= targetIndex\n : next > current && next <= targetIndex;\n if (next === -1 || !progressed) return;\n current = next;\n }\n };\n\n /**\n * The tree pattern's two level keys; Base UI leaves both alone (list\n * navigation is vertical-only, the chip handler no-ops without\n * `Combobox.Chips`). Passed in rather than hardcoded because RTL swaps them:\n * APG defines them as \"toward the children\", not as a physical arrow.\n */\n const handleTreeKeyDown = (\n event: CascaderInputKeyEvent,\n field: HTMLInputElement,\n caretAtStart: boolean,\n caretAtEnd: boolean,\n forwardKey: \"ArrowLeft\" | \"ArrowRight\",\n backKey: \"ArrowLeft\" | \"ArrowRight\",\n ) => {\n const forward = event.key === forwardKey;\n if (!forward && event.key !== backKey) return;\n if (forward ? !caretAtEnd : !caretAtStart) return;\n\n const highlighted = getHighlighted();\n if (!highlighted) return;\n const rowIndex = treeRows.findIndex((row) => row.node.value === highlighted.value);\n if (rowIndex < 0) return;\n const row = treeRows[rowIndex];\n\n if (forward) {\n if (!row.branch) return;\n event.preventDefault();\n if (!row.expanded) {\n // `navigate`, not `toggleExpanded`: it waits for an unloaded branch's\n // children, so the keyboard path in matches the expander.\n navigate(row.node);\n return;\n }\n // `flattenCascaderTree` emits children right after their parent, so the\n // first child is the next row. The depth check covers an empty branch.\n const child = treeRows[rowIndex + 1];\n if (child && child.depth === row.depth + 1) {\n moveHighlightTo(field, rowIndex + 1);\n }\n return;\n }\n\n // A query holds every hit's ancestors open without adding them to\n // `expanded`, so the toggle would ADD such a row: it would open a disabled\n // one for good. That row moves to its parent instead, as a closed one does.\n const heldByQuery = isDisabled(row.node) && !expanded.has(row.node.value);\n if (row.branch && row.expanded && !heldByQuery) {\n event.preventDefault();\n toggleExpanded(row.node.value);\n return;\n }\n\n const parentValue = index.parentOf.get(row.node.value);\n if (!parentValue) return;\n const parentIndex = treeRows.findIndex((entry) => entry.node.value === parentValue);\n if (parentIndex < 0) return;\n event.preventDefault();\n moveHighlightTo(field, parentIndex);\n };\n\n const handleKeyDown = (event: CascaderInputKeyEvent) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) return;\n\n const field = event.currentTarget;\n const caretAtStart = field.selectionStart === 0 && field.selectionEnd === 0;\n const caretAtEnd = field.selectionStart === query.length && field.selectionEnd === query.length;\n\n // ArrowDown at the END of the list hands real focus to the pinned footer,\n // the key a combobox is actually navigated with; Tab still works and still\n // skips the scroll area. An EMPTY list hands off at once, and the footer\n // owns the way back. Counted from state, so a windowed list still answers.\n if (event.key === \"ArrowDown\" && !event.altKey) {\n const rowCount = mode === \"tree\" ? treeRows.length : renderedItems.length;\n const lastValue =\n mode === \"tree\" ? treeRows[rowCount - 1]?.node.value : renderedItems[rowCount - 1]?.value;\n const highlighted = getHighlighted();\n const atEnd = rowCount === 0 || (highlighted != null && highlighted.value === lastValue);\n if (atEnd) {\n const panel = field.closest<HTMLElement>('[data-slot=\"cascader-panel\"]');\n const stop = panel ? getCascaderFooterStops(panel)[0] : undefined;\n if (stop) {\n event.preventDefault();\n // Base UI's handler is deliberately NOT vetoed: its wrap's first\n // press CLEARS the highlight, so no stale row stays active behind the\n // focused command, and the emptied highlight completes the ring.\n stop.focus();\n return;\n }\n }\n }\n\n // The level keys are LOGICAL, not physical: in RTL, ArrowLeft opens a\n // branch and ArrowRight goes back. They act only at the caret edge, and\n // those guards do NOT mirror: `selectionStart === 0` is the logical start.\n const rtl = isCascaderRtl(field, direction);\n const forwardKey = rtl ? \"ArrowLeft\" : \"ArrowRight\";\n const backKey = rtl ? \"ArrowRight\" : \"ArrowLeft\";\n\n if (mode === \"tree\") {\n handleTreeKeyDown(event, field, caretAtStart, caretAtEnd, forwardKey, backKey);\n return;\n }\n\n if (event.key === forwardKey && caretAtEnd) {\n const highlighted = getHighlighted();\n if (highlighted && isBranch(highlighted)) {\n event.preventDefault();\n navigate(highlighted);\n return;\n }\n }\n\n // Backspace on an empty query pops a level too, so the keyboard way out of\n // a level is symmetric with typing into it.\n if (\n (event.key === backKey && caretAtStart) ||\n (event.key === \"Backspace\" && query.length === 0)\n ) {\n if (path.length > 0) {\n event.preventDefault();\n popLevel();\n }\n }\n };\n\n return (\n <div\n data-slot=\"cascader-input-row\"\n className={cn(\n \"flex shrink-0 items-center gap-1\",\n /* Each style sizes a combobox search field only as a DIRECT child of\n the popup; this row is nested, so the ladder is mirrored here rather\n than hardcoding one height for all eight styles. */\n \"h-8\",\n )}\n >\n {showBack ? <CascaderBack /> : null}\n <ComboboxPrimitive.Input\n data-slot=\"cascader-input\"\n placeholder={resolvedPlaceholder}\n onKeyDown={handleKeyDown}\n /* Nothing on screen says the level keys exist. */\n aria-describedby={[ariaDescribedBy, hintId].filter(Boolean).join(\" \")}\n /* Conditional: an explicit `undefined` deletes Base UI's own value. */\n {...(mode === \"tree\" ? { \"aria-haspopup\": \"tree\" as const } : null)}\n /* Base UI omits BOTH `aria-expanded` and `aria-controls` while inline,\n and an embedded panel is permanently expanded, so supply both. */\n {...(inline ? { \"aria-expanded\": true, \"aria-controls\": listId } : null)}\n /* No trigger to carry the invalid state in the `inline` case. */\n {...(invalid ? { \"aria-invalid\": true, \"data-invalid\": \"\" } : null)}\n className={cn(\n \"h-full w-full min-w-0 flex-1 bg-transparent px-1.5 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n backVisible && \"ps-0\",\n className,\n )}\n {...props}\n />\n <span id={hintId} ref={hintRef} className=\"sr-only\">\n {/* `hintDir`, not `direction`: the context alone misses an RTL app that\n uses a `dir` attribute instead of `DirectionProvider`. */}\n {labels.keyboardHint(mode, hintDir)}\n </span>\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Value */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderValueProps extends Omit<useRender.ComponentProps<\"span\">, \"children\"> {\n /** `path` shows the full trail, `leaf` only the node, `count` only a total. */\n display?: CascaderValueDisplay;\n maxSegments?: number;\n collapse?: CascaderCollapse;\n separator?: React.ReactNode;\n /** Renders the selected node's icon before the trail. */\n showIcon?: boolean;\n placeholder?: React.ReactNode;\n /** Replaces the whole rendering. Receives the resolved selection and path. */\n children?: (selected: CascaderNode[], path: CascaderNode[]) => React.ReactNode;\n}\n\n/**\n * Trigger display. Defaults to the collapsed selection path rather than a bare\n * leaf label, which in a nested picker is frequently ambiguous.\n */\nfunction CascaderValue({\n className,\n display = \"path\",\n maxSegments = 3,\n collapse = \"middle\",\n separator,\n showIcon = true,\n placeholder,\n children,\n ...props\n}: CascaderValueProps) {\n const { labels, multiple, resolveNode } = useCascaderActions();\n const { index, selectedValues } = useCascaderState();\n\n // `resolveNode`, not `index.byValue`: a selection missing from `items` (async\n // children, a removed item) must still render a label, not an empty trigger.\n const selected = selectedValues.map(resolveNode);\n\n const resolvedPath = selectedValues.length === 1 ? getCascaderPath(index, selectedValues[0]) : [];\n // No ancestor chain: fall back to the node so `display=\"path\"` shows a leaf.\n const path = resolvedPath.length > 0 ? resolvedPath : selected.length === 1 ? selected : [];\n\n let content: React.ReactNode;\n\n if (children) {\n content = children(selected, path);\n } else if (selectedValues.length === 0) {\n content = <span className=\"truncate text-muted-foreground\">{placeholder}</span>;\n } else if (display === \"count\" || (multiple && selectedValues.length > 1)) {\n content = labels.selectedCount(selectedValues.length);\n } else {\n const leaf = path[path.length - 1] ?? selected[0];\n const segments =\n display === \"leaf\"\n ? [{ type: \"node\" as const, node: leaf }]\n : collapseCascaderPath(path, { maxSegments, collapse });\n\n content = (\n <>\n {showIcon && leaf?.icon ? (\n <span\n data-slot=\"cascader-value-icon\"\n className=\"flex shrink-0 items-center text-muted-foreground\"\n >\n {leaf.icon}\n </span>\n ) : null}\n {segments.map((segment, i) => (\n <React.Fragment key={segment.type === \"node\" ? segment.node.value : `gap-${i}`}>\n {i > 0 ? (separator ?? <PathChevron />) : null}\n {segment.type === \"ellipsis\" ? (\n <span\n data-slot=\"cascader-value-ellipsis\"\n title={segment.hidden.map((n) => n.label).join(` ${labels.pathSeparator} `)}\n className=\"shrink-0 text-muted-foreground\"\n >\n &hellip;\n </span>\n ) : (\n <span className={cn(\"truncate\", i < segments.length - 1 && \"text-muted-foreground\")}>\n {segment.node?.label}\n </span>\n )}\n </React.Fragment>\n ))}\n </>\n );\n }\n\n const defaultProps = {\n \"data-slot\": \"cascader-value\",\n className: cn(\"flex min-w-0 items-center gap-1 truncate\", className),\n children: content,\n };\n\n return useRender({\n defaultTagName: \"span\",\n render: props.render,\n props: mergeProps<\"span\">(defaultProps, props),\n });\n}\n\nexport { CascaderBack, CascaderBreadcrumb, CascaderInput, CascaderNav, CascaderValue };\n"],"mappings":";;;;;;;;;;;;;AAwBA,SAAS,cAAc;CACrB,OAAO,oBAAC,kBAAD,EAAkB,WAAU,8CAA+C,CAAA;AACpF;;;;;AAYA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA2B;CAC9D,MAAM,eAAe;EACnB,aAAa;EACb,WAAW,GAGT,sEACA,SACF;CACF;CAEA,OAAO,UAAU;EACf,gBAAgB;EAChB,QAAQ,MAAM;EACd,OAAO,WAAkB,cAAc,KAAK;CAC9C,CAAC;AACH;;AAWA,SAAS,aAAa,EAAE,WAAW,UAAU,GAAG,SAA4B;CAC1E,MAAM,EAAE,UAAU,QAAQ,SAAS,mBAAmB;CACtD,MAAM,EAAE,SAAS,iBAAiB;CAIlC,MAAM,SAAS,SAAS,WAAW,KAAK,WAAW;CAEnD,MAAM,eAAe;EACnB,aAAa;EACb,MAAM;EACN,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
1
- import { _ as CascaderSelectable, a as CascaderFlatNode, c as CascaderLoadContext, d as CascaderLoadState, f as CascaderMode, g as CascaderSearchScope, h as CascaderSearchContext, i as CascaderCollapse, l as CascaderLoadReason, m as CascaderPathSegment, n as CascaderChangeDetails, o as CascaderIndex, p as CascaderNode, r as CascaderChangeReason, s as CascaderLabels, t as CascaderActionItem, u as CascaderLoadResult, v as CascaderValueDisplay } from "../../../cascader-types-BnH6wYD-.js";
1
+ import { _ as CascaderSelectable, a as CascaderFlatNode, c as CascaderLoadContext, d as CascaderLoadState, f as CascaderMode, g as CascaderSearchScope, h as CascaderSearchContext, i as CascaderCollapse, l as CascaderLoadReason, m as CascaderPathSegment, n as CascaderChangeDetails, o as CascaderIndex, p as CascaderNode, r as CascaderChangeReason, s as CascaderLabels, t as CascaderActionItem, u as CascaderLoadResult, v as CascaderValueDisplay } from "../../../cascader-types-DVT-znZ-.js";
2
2
  export { CascaderActionItem, CascaderChangeDetails, CascaderChangeReason, CascaderCollapse, CascaderFlatNode, CascaderIndex, CascaderLabels, CascaderLoadContext, CascaderLoadReason, CascaderLoadResult, CascaderLoadState, CascaderMode, CascaderNode, CascaderPathSegment, CascaderSearchContext, CascaderSearchScope, CascaderSelectable, CascaderValueDisplay };
@@ -1 +1 @@
1
- {"version":3,"file":"cascader-virtual.d.ts","names":["React"],"sources":["../../../../src/components/reui/cascader/cascader-virtual.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;iBAmCiB;EACf;EACA,wBAAwB;EACxB;EACA;;EAEA,aAAa;;EAEb;;YAGU,sBAAsB,YAAY,aAAa;;;;;;;wBAQ3C,yBACd,OACA,kBACA,cACA,UACA,YACA,eACC,gCAAgC;iBAuHlB;;EAEf;;EAEA;;;;;;;;;iBAUO,qBAAqB,OAAO,4BAAyBA,QAAA,IAAA;iBAgG7C,mCAAmC;EAClD,QAAQ;;;;;;;;;iBAUD,wBAAwB,QAAQ,cAAc,YAAY,6BAA0BA,QAAA,IAAA"}
1
+ {"version":3,"file":"cascader-virtual.d.ts","names":["React"],"sources":["../../../../src/components/reui/cascader/cascader-virtual.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;iBAmCiB;EACf;EACA,wBAAwB;EACxB;EACA;;EAEA,aAAa;;EAEb;;YAGU,sBAAsB,YAAY,aAAa;;;;;;;wBAQ3C,yBACd,OACA,kBACA,cACA,UACA,YACA,eACC,gCAAgC;iBAuHlB;;EAEf;;EAEA;;;;;;;;;iBAUO,qBAAqB,OAAO,4BAAyBA,QAAA,IAAA;iBAiG7C,mCAAmC;EAClD,QAAQ;;;;;;;;;iBAUD,wBAAwB,QAAQ,cAAc,YAAY,6BAA0BA,QAAA,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"cascader-virtual.js","names":["React"],"sources":["../../../../src/components/reui/cascader/cascader-virtual.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n defaultRangeExtractor,\n type Range,\n useVirtualizer,\n type Virtualizer,\n} from \"@tanstack/react-virtual\";\n\nimport { CascaderColumnPanel } from \"./cascader-columns\";\nimport type { CascaderColumn } from \"./cascader-context\";\nimport { useCascaderActions, useCascaderHighlight, useCascaderState } from \"./cascader-context\";\nimport { CascaderItem, CascaderItems, getCascaderMoreProps } from \"./cascader-item\";\n\n/**\n * Windowing for the cascader, in its own file so the primitive's own install\n * never pulls `@tanstack/react-virtual` in. Base UI forces three rules:\n *\n * 1. A windowed row MUST carry an explicit `index`; the fallback\n * `findItemIndex` is O(n) per row and returns `-1` on the frame a level swap\n * renders empty, dangling `aria-activedescendant`.\n * 2. That index is DESTRUCTIVE while unvirtualized (`useCompositeListItem`\n * skips registration, `CompositeList` truncates `elementsRef` to zero and\n * the first arrow key highlights nothing), so rows stay plain until the root\n * flips `virtualized`, gated inside `CascaderItem`.\n * 3. No `Combobox.Collection` and no FUNCTION CHILD on `Combobox.List`, which\n * implicitly wraps one in a Collection: a Collection renders every filtered\n * item.\n */\n\n/* -------------------------------------------------------------------------- */\n/* Virtualizer */\n/* -------------------------------------------------------------------------- */\n\nexport interface UseCascaderVirtualizerOptions {\n count: number;\n getScrollElement: () => HTMLElement | null;\n estimateSize?: number;\n overscan?: number;\n /** Key rows by node value, never by index: a tree expand shifts every index. */\n getItemKey: (index: number) => string | number;\n /** Render index of the highlighted row, or `-1`. Pinned into the window. */\n activeIndex?: number;\n}\n\nexport type CascaderVirtualizer = Virtualizer<HTMLElement, HTMLElement>;\n\n/**\n * The cascader's virtualizer: TanStack plus the highlight pinning and\n * scroll-into-view a combobox list needs. `activeIndex` is clamped here, not by\n * the caller: emitted from a layout effect, it can be one commit ahead of a\n * level that just shrank and would otherwise scroll to a row that is gone.\n */\nexport function useCascaderVirtualizer({\n count,\n getScrollElement,\n estimateSize = 32,\n overscan = 8,\n getItemKey,\n activeIndex = -1,\n}: UseCascaderVirtualizerOptions): CascaderVirtualizer {\n const active = activeIndex >= 0 && activeIndex < count ? activeIndex : -1;\n\n // Keeps the highlighted row mounted so `aria-activedescendant` never dangles.\n const rangeExtractor = React.useCallback(\n (range: Range) => {\n const indices = new Set(defaultRangeExtractor(range));\n if (active !== -1) indices.add(active);\n return Array.from(indices).sort((a, b) => a - b);\n },\n [active],\n );\n\n const measureEstimate = React.useCallback(() => estimateSize, [estimateSize]);\n\n // React Compiler bails on `useVirtualizer` HERE, and only here - the bail does not\n // propagate to the components that call this hook. They opt out themselves.\n const virtualizer = useVirtualizer<HTMLElement, HTMLElement>({\n count,\n getScrollElement,\n estimateSize: measureEstimate,\n overscan,\n getItemKey,\n rangeExtractor,\n });\n\n // Base UI's scroll-into-view no-ops on a windowed-out row (empty `listRef`).\n React.useEffect(() => {\n if (active === -1) return;\n virtualizer.scrollToIndex(active, { align: \"auto\" });\n }, [active, virtualizer]);\n\n return virtualizer;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Geometry */\n/* -------------------------------------------------------------------------- */\n\ninterface CascaderVirtualGutter {\n block: number;\n inline: number;\n}\n\nconst NO_GUTTER: CascaderVirtualGutter = { block: 0, inline: 0 };\n\n/**\n * The ROWS' BOX's own padding, never the scrollport's (separate element, reads\n * a flat zero). Measured because every style sets its own: a windowed row is\n * positioned against this box's PADDING box while the scroll-height spacer is\n * an in-flow child of its CONTENT box, so without it rows sit flush.\n */\nfunction useCascaderVirtualGutter(contentElement: HTMLElement | null): CascaderVirtualGutter {\n const [gutter, setGutter] = React.useState<CascaderVirtualGutter>(NO_GUTTER);\n\n React.useLayoutEffect(() => {\n if (!contentElement) return;\n const styles = getComputedStyle(contentElement);\n const block = Number.parseFloat(styles.paddingTop) || 0;\n const inline = Number.parseFloat(styles.paddingInlineStart || styles.paddingLeft) || 0;\n setGutter((previous) =>\n previous.block === block && previous.inline === inline ? previous : { block, inline },\n );\n }, [contentElement]);\n\n return gutter;\n}\n\n/** Logical insets, not `left` / `width`, so RTL needs no second code path. */\nfunction cascaderVirtualRowStyle(\n start: number,\n gutter: CascaderVirtualGutter,\n): React.CSSProperties {\n return {\n position: \"absolute\",\n top: 0,\n insetInlineStart: gutter.inline,\n insetInlineEnd: gutter.inline,\n transform: `translateY(${start + gutter.block}px)`,\n };\n}\n\n/**\n * The element that actually SCROLLS: the `ScrollArea` viewport above the rows'\n * box, not the rows' box itself, which never overflows, so a virtualizer aimed\n * at it would read a full `clientHeight` and render every row. `closest` rather\n * than `parentElement`, plus a fallback to the content element, keeps a\n * hand-written `overflow-y-auto` container working.\n */\nfunction cascaderScrollElement(content: HTMLElement | null): HTMLElement | null {\n if (!content) return null;\n return content.closest<HTMLElement>('[data-slot=\"scroll-area-viewport\"]') ?? content;\n}\n\n/**\n * `role=\"presentation\"` keeps the listbox owning nothing but options, and this\n * node's parent IS the rows' box, saving a ref threaded through `CascaderList`.\n */\nfunction CascaderVirtualSpacer({\n height,\n onContentElement,\n}: {\n height: number;\n onContentElement: (element: HTMLElement | null) => void;\n}) {\n return (\n <div\n ref={(node) => onContentElement(node?.parentElement ?? null)}\n role=\"presentation\"\n data-slot=\"cascader-virtual-spacer\"\n style={{ height }}\n />\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Rows */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderVirtualItemsProps {\n /** Row height before measurement. Defaults to the root `estimateRowSize`. */\n estimateSize?: number;\n /** Rows rendered beyond each edge. Defaults to the root `overscan`. */\n overscan?: number;\n}\n\n/**\n * Windowed replacement for `CascaderItems`, dropped inside `CascaderList`. The\n * registration is a LAYOUT effect because the root derives `virtualized` from\n * it and the flip has to land before the browser paints. Until the root has\n * seen it, this renders exactly what `CascaderItems` does, so no frame carries\n * indexed rows while Base UI still owns the composite list.\n */\nfunction CascaderVirtualItems(props: CascaderVirtualItemsProps) {\n const { virtualized, registerVirtualRenderer } = useCascaderActions();\n\n React.useLayoutEffect(() => registerVirtualRenderer(), [registerVirtualRenderer]);\n\n if (!virtualized) return <CascaderItems />;\n\n return <CascaderVirtualRows {...props} />;\n}\n\nfunction CascaderVirtualRows({ estimateSize, overscan }: CascaderVirtualItemsProps) {\n /* The `useCascaderVirtualizer` bail does NOT reach here: the compiler caches\n `getVirtualItems()` on the virtualizer, whose identity never changes, so the\n window freezes on scroll. Inert where no compiler runs. */\n \"use no memo\";\n\n const {\n estimateRowSize,\n overscan: rootOverscan,\n mode,\n isBranch,\n isSelectable,\n isSelected,\n isIndeterminate,\n } = useCascaderActions();\n const { renderedItems, treeRows, deepResults, loadStates } = useCascaderState();\n // Re-renders on every highlight change, and has to: the pinned row and the\n // scroll target are both derived from it.\n const highlight = useCascaderHighlight();\n\n const [contentElement, setContentElement] = React.useState<HTMLElement | null>(null);\n const gutter = useCascaderVirtualGutter(contentElement);\n\n const tree = mode === \"tree\";\n const count = tree ? treeRows.length : renderedItems.length;\n const showPath = !tree && deepResults !== null;\n\n const getItemKey = React.useCallback(\n (index: number) => (tree ? treeRows[index]?.node.value : renderedItems[index]?.value) ?? index,\n [tree, treeRows, renderedItems],\n );\n\n const virtualizer = useCascaderVirtualizer({\n count,\n getScrollElement: () => cascaderScrollElement(contentElement),\n estimateSize: estimateSize ?? estimateRowSize,\n overscan: overscan ?? rootOverscan,\n getItemKey,\n activeIndex: highlight.index,\n });\n\n return (\n <>\n <CascaderVirtualSpacer\n height={virtualizer.getTotalSize()}\n onContentElement={setContentElement}\n />\n {virtualizer.getVirtualItems().map((row) => {\n const flat = tree ? treeRows[row.index] : undefined;\n const node = tree ? flat?.node : renderedItems[row.index];\n // For one commit after a query narrows the level, the window can name\n // a row it no longer has; the count recomputes on the same tick.\n if (!node) return null;\n\n return (\n <CascaderItem\n key={row.key}\n /* Measured, not estimated: rows are two lines with a `description`\n and three in deep search, and row height is per style. An\n estimate alone would make `scrollToIndex` land on the wrong row. */\n ref={virtualizer.measureElement}\n data-index={row.index}\n style={cascaderVirtualRowStyle(row.start, gutter)}\n node={node}\n index={row.index}\n depth={flat?.depth}\n expanded={flat?.expanded}\n branch={flat ? flat.branch : isBranch(node)}\n selectable={isSelectable(node)}\n selected={isSelected(node)}\n indeterminate={isIndeterminate(node)}\n {...getCascaderMoreProps(node, loadStates)}\n showPath={showPath}\n aria-setsize={flat ? flat.setSize : count}\n aria-posinset={flat ? flat.posInSet : row.index + 1}\n />\n );\n })}\n </>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Column */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderVirtualColumnProps extends CascaderVirtualItemsProps {\n column: CascaderColumn;\n}\n\n/**\n * Windowed replacement for one Miller column, passed through the\n * `CascaderColumns` render slot. One virtualizer PER COLUMN, since columns\n * scroll independently, and only the deepest is Base UI's listbox: the trail\n * behind is `as=\"button\"` rows outside Base UI, so it windows on its own row\n * count rather than waiting for the root to flip.\n */\nfunction CascaderVirtualColumn({ column, estimateSize, overscan }: CascaderVirtualColumnProps) {\n const { virtualized, registerVirtualRenderer, virtualize, virtualizeThreshold } =\n useCascaderActions();\n\n React.useLayoutEffect(() => registerVirtualRenderer(), [registerVirtualRenderer]);\n\n const windowed = column.active\n ? virtualized\n : (virtualize ?? column.items.length >= virtualizeThreshold);\n\n if (!windowed) return <CascaderColumnPanel column={column} />;\n\n return (\n <CascaderColumnPanel column={column} virtualized>\n {column.active ? (\n <CascaderVirtualActiveColumnRows\n column={column}\n estimateSize={estimateSize}\n overscan={overscan}\n />\n ) : (\n <CascaderVirtualColumnRows\n column={column}\n estimateSize={estimateSize}\n overscan={overscan}\n activeIndex={-1}\n />\n )}\n </CascaderColumnPanel>\n );\n}\n\n/** Only the active column subscribes to the highlight; a trail column must not. */\nfunction CascaderVirtualActiveColumnRows(props: CascaderVirtualColumnProps) {\n const highlight = useCascaderHighlight();\n return <CascaderVirtualColumnRows {...props} activeIndex={highlight.index} />;\n}\n\nfunction CascaderVirtualColumnRows({\n column,\n estimateSize,\n overscan,\n activeIndex,\n}: CascaderVirtualColumnProps & { activeIndex: number }) {\n /* The `useCascaderVirtualizer` bail does NOT reach here: the compiler caches\n `getVirtualItems()` on the virtualizer, whose identity never changes, so the\n window freezes on scroll. Inert where no compiler runs. */\n \"use no memo\";\n\n const {\n estimateRowSize,\n overscan: rootOverscan,\n baseId,\n isBranch,\n isSelectable,\n isSelected,\n isIndeterminate,\n } = useCascaderActions();\n const { loadStates } = useCascaderState();\n\n const [contentElement, setContentElement] = React.useState<HTMLElement | null>(null);\n const gutter = useCascaderVirtualGutter(contentElement);\n\n const items = column.items;\n const getItemKey = React.useCallback((index: number) => items[index]?.value ?? index, [items]);\n\n const virtualizer = useCascaderVirtualizer({\n count: items.length,\n getScrollElement: () => cascaderScrollElement(contentElement),\n estimateSize: estimateSize ?? estimateRowSize,\n overscan: overscan ?? rootOverscan,\n getItemKey,\n activeIndex,\n });\n\n return (\n <>\n <CascaderVirtualSpacer\n height={virtualizer.getTotalSize()}\n onContentElement={setContentElement}\n />\n {virtualizer.getVirtualItems().map((row) => {\n const node = items[row.index];\n if (!node) return null;\n const open = node.value === column.activeValue;\n\n return (\n <CascaderItem\n key={row.key}\n ref={virtualizer.measureElement}\n data-index={row.index}\n style={cascaderVirtualRowStyle(row.start, gutter)}\n node={node}\n as={column.active ? \"option\" : \"button\"}\n depth={column.depth}\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 /* Only the listbox column may carry an index or listbox metadata.\n A trail row is a `role=\"button\"`, which allows neither. */\n {...(column.active\n ? {\n index: row.index,\n \"aria-setsize\": items.length,\n \"aria-posinset\": row.index + 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}\n\nexport { CascaderVirtualColumn, CascaderVirtualItems };\n"],"mappings":";;;;;;;;;;;;;;AAsDA,SAAgB,uBAAuB,EACrC,OACA,kBACA,eAAe,IACf,WAAW,GACX,YACA,cAAc,MACuC;CACrD,MAAM,SAAS,eAAe,KAAK,cAAc,QAAQ,cAAc;CAGvE,MAAM,iBAAiBA,QAAM,aAC1B,UAAiB;EAChB,MAAM,UAAU,IAAI,IAAI,sBAAsB,KAAK,CAAC;EACpD,IAAI,WAAW,IAAI,QAAQ,IAAI,MAAM;EACrC,OAAO,MAAM,KAAK,OAAO,CAAC,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC;CACjD,GACA,CAAC,MAAM,CACT;CAEA,MAAM,kBAAkBA,QAAM,kBAAkB,cAAc,CAAC,YAAY,CAAC;CAI5E,MAAM,cAAc,eAAyC;EAC3D;EACA;EACA,cAAc;EACd;EACA;EACA;CACF,CAAC;CAGD,QAAM,gBAAgB;EACpB,IAAI,WAAW,IAAI;EACnB,YAAY,cAAc,QAAQ,EAAE,OAAO,OAAO,CAAC;CACrD,GAAG,CAAC,QAAQ,WAAW,CAAC;CAExB,OAAO;AACT;AAWA,MAAM,YAAmC;CAAE,OAAO;CAAG,QAAQ;AAAE;;;;;;;AAQ/D,S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AY,gBAAgB,CAAC,CAAC,KAAK,QAAQ;EAC1C,MAAM,OAAO,MAAM,IAAI;EACvB,IAAI,CAAC,MAAM,OAAO;EAClB,MAAM,OAAO,KAAK,UAAU,OAAO;EAEnC,OACE,oBAAC,cAAD;GAEE,KAAK,YAAY;GACjB,cAAY,IAAI;GAChB,OAAO,wBAAwB,IAAI,OAAO,MAAM;GAC1C;GACN,IAAI,OAAO,SAAS,WAAW;GAC/B,OAAO,OAAO;GACd,QAAQ,SAAS,IAAI;GACrB,YAAY,aAAa,IAAI;GAC7B,UAAU,WAAW,IAAI;GACzB,eAAe,gBAAgB,IAAI;GACnC,GAAI,qBAAqB,MAAM,UAAU;GACzC,aAAW,QAAQ,KAAA;GACnB,WAAW,OAAO,wCAAwC,KAAA;GAG1D,GAAK,OAAO,SACR;IACE,OAAO,IAAI;IACX,gBAAgB,MAAM;IACtB,iBAAiB,IAAI,QAAQ;GAC/B,IACA;GACJ,GAAK,CAAC,OAAO,UAAU,OACnB;IACE,iBAAiB;IACjB,iBAAiB,GAAG,OAAO,UAAU,OAAO,QAAQ;GACtD,IACA;EACL,GA7BM,IAAI,GA6BV;CAEL,CAAC,CACD,EAAA,CAAA;AAEN"}
1
+ {"version":3,"file":"cascader-virtual.js","names":["React"],"sources":["../../../../src/components/reui/cascader/cascader-virtual.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n defaultRangeExtractor,\n type Range,\n useVirtualizer,\n type Virtualizer,\n} from \"@tanstack/react-virtual\";\n\nimport { CascaderColumnPanel } from \"./cascader-columns\";\nimport type { CascaderColumn } from \"./cascader-context\";\nimport { useCascaderActions, useCascaderHighlight, useCascaderState } from \"./cascader-context\";\nimport { CascaderItem, CascaderItems, getCascaderMoreProps } from \"./cascader-item\";\n\n/**\n * Windowing for the cascader, in its own file so the primitive's own install\n * never pulls `@tanstack/react-virtual` in. Base UI forces three rules:\n *\n * 1. A windowed row MUST carry an explicit `index`; the fallback\n * `findItemIndex` is O(n) per row and returns `-1` on the frame a level swap\n * renders empty, dangling `aria-activedescendant`.\n * 2. That index is DESTRUCTIVE while unvirtualized (`useCompositeListItem`\n * skips registration, `CompositeList` truncates `elementsRef` to zero and\n * the first arrow key highlights nothing), so rows stay plain until the root\n * flips `virtualized`, gated inside `CascaderItem`.\n * 3. No `Combobox.Collection` and no FUNCTION CHILD on `Combobox.List`, which\n * implicitly wraps one in a Collection: a Collection renders every filtered\n * item.\n */\n\n/* -------------------------------------------------------------------------- */\n/* Virtualizer */\n/* -------------------------------------------------------------------------- */\n\nexport interface UseCascaderVirtualizerOptions {\n count: number;\n getScrollElement: () => HTMLElement | null;\n estimateSize?: number;\n overscan?: number;\n /** Key rows by node value, never by index: a tree expand shifts every index. */\n getItemKey: (index: number) => string | number;\n /** Render index of the highlighted row, or `-1`. Pinned into the window. */\n activeIndex?: number;\n}\n\nexport type CascaderVirtualizer = Virtualizer<HTMLElement, HTMLElement>;\n\n/**\n * The cascader's virtualizer: TanStack plus the highlight pinning and\n * scroll-into-view a combobox list needs. `activeIndex` is clamped here, not by\n * the caller: emitted from a layout effect, it can be one commit ahead of a\n * level that just shrank and would otherwise scroll to a row that is gone.\n */\nexport function useCascaderVirtualizer({\n count,\n getScrollElement,\n estimateSize = 32,\n overscan = 8,\n getItemKey,\n activeIndex = -1,\n}: UseCascaderVirtualizerOptions): CascaderVirtualizer {\n const active = activeIndex >= 0 && activeIndex < count ? activeIndex : -1;\n\n // Keeps the highlighted row mounted so `aria-activedescendant` never dangles.\n const rangeExtractor = React.useCallback(\n (range: Range) => {\n const indices = new Set(defaultRangeExtractor(range));\n if (active !== -1) indices.add(active);\n return Array.from(indices).sort((a, b) => a - b);\n },\n [active],\n );\n\n const measureEstimate = React.useCallback(() => estimateSize, [estimateSize]);\n\n // React Compiler bails on `useVirtualizer` HERE, and only here - the bail does not\n // propagate to the components that call this hook. They opt out themselves.\n const virtualizer = useVirtualizer<HTMLElement, HTMLElement>({\n count,\n getScrollElement,\n estimateSize: measureEstimate,\n overscan,\n getItemKey,\n rangeExtractor,\n });\n\n // Base UI's scroll-into-view no-ops on a windowed-out row (empty `listRef`).\n React.useEffect(() => {\n if (active === -1) return;\n virtualizer.scrollToIndex(active, { align: \"auto\" });\n }, [active, virtualizer]);\n\n return virtualizer;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Geometry */\n/* -------------------------------------------------------------------------- */\n\ninterface CascaderVirtualGutter {\n block: number;\n inline: number;\n}\n\nconst NO_GUTTER: CascaderVirtualGutter = { block: 0, inline: 0 };\n\n/**\n * The ROWS' BOX's own padding, never the scrollport's (separate element, reads\n * a flat zero). Measured because every style sets its own: a windowed row is\n * positioned against this box's PADDING box while the scroll-height spacer is\n * an in-flow child of its CONTENT box, so without it rows sit flush.\n */\nfunction useCascaderVirtualGutter(contentElement: HTMLElement | null): CascaderVirtualGutter {\n const [gutter, setGutter] = React.useState<CascaderVirtualGutter>(NO_GUTTER);\n\n React.useLayoutEffect(() => {\n if (!contentElement) return;\n const styles = getComputedStyle(contentElement);\n const block = Number.parseFloat(styles.paddingTop) || 0;\n const inline = Number.parseFloat(styles.paddingInlineStart || styles.paddingLeft) || 0;\n setGutter((previous) =>\n previous.block === block && previous.inline === inline ? previous : { block, inline },\n );\n }, [contentElement]);\n\n return gutter;\n}\n\n/** Logical insets, not `left` / `width`, so RTL needs no second code path. */\nfunction cascaderVirtualRowStyle(\n start: number,\n gutter: CascaderVirtualGutter,\n): React.CSSProperties {\n return {\n position: \"absolute\",\n top: 0,\n insetInlineStart: gutter.inline,\n insetInlineEnd: gutter.inline,\n transform: `translateY(${start + gutter.block}px)`,\n };\n}\n\n/**\n * The element that actually SCROLLS: the `ScrollArea` viewport above the rows'\n * box, not the rows' box itself, which never overflows, so a virtualizer aimed\n * at it would read a full `clientHeight` and render every row. `closest` rather\n * than `parentElement`, plus a fallback to the content element, keeps a\n * hand-written `overflow-y-auto` container working.\n */\nfunction cascaderScrollElement(content: HTMLElement | null): HTMLElement | null {\n if (!content) return null;\n return content.closest<HTMLElement>('[data-slot=\"scroll-area-viewport\"]') ?? content;\n}\n\n/**\n * `role=\"presentation\"` keeps the listbox owning nothing but options, and this\n * node's parent IS the rows' box, saving a ref threaded through `CascaderList`.\n */\nfunction CascaderVirtualSpacer({\n height,\n onContentElement,\n}: {\n height: number;\n onContentElement: (element: HTMLElement | null) => void;\n}) {\n return (\n <div\n ref={(node) => onContentElement(node?.parentElement ?? null)}\n role=\"presentation\"\n data-slot=\"cascader-virtual-spacer\"\n style={{ height }}\n />\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Rows */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderVirtualItemsProps {\n /** Row height before measurement. Defaults to the root `estimateRowSize`. */\n estimateSize?: number;\n /** Rows rendered beyond each edge. Defaults to the root `overscan`. */\n overscan?: number;\n}\n\n/**\n * Windowed replacement for `CascaderItems`, dropped inside `CascaderList`. The\n * registration is a LAYOUT effect because the root derives `virtualized` from\n * it and the flip has to land before the browser paints. Until the root has\n * seen it, this renders exactly what `CascaderItems` does, so no frame carries\n * indexed rows while Base UI still owns the composite list.\n */\nfunction CascaderVirtualItems(props: CascaderVirtualItemsProps) {\n const { virtualized, registerVirtualRenderer } = useCascaderActions();\n\n React.useLayoutEffect(() => registerVirtualRenderer(), [registerVirtualRenderer]);\n\n if (!virtualized) return <CascaderItems />;\n\n return <CascaderVirtualRows {...props} />;\n}\n\nfunction CascaderVirtualRows({ estimateSize, overscan }: CascaderVirtualItemsProps) {\n /* The `useCascaderVirtualizer` bail does NOT reach here: the compiler caches\n `getVirtualItems()` on the virtualizer, whose identity never changes, so the\n window freezes on scroll. Inert where no compiler runs. */\n \"use no memo\";\n\n const {\n estimateRowSize,\n overscan: rootOverscan,\n mode,\n isBranch,\n isSelectable,\n isSelected,\n isIndeterminate,\n } = useCascaderActions();\n const { renderedItems, treeRows, deepResults, loadStates } = useCascaderState();\n // Re-renders on every highlight change, and has to: the pinned row and the\n // scroll target are both derived from it.\n const highlight = useCascaderHighlight();\n\n const [contentElement, setContentElement] = React.useState<HTMLElement | null>(null);\n const gutter = useCascaderVirtualGutter(contentElement);\n\n const tree = mode === \"tree\";\n const count = tree ? treeRows.length : renderedItems.length;\n const showPath = !tree && deepResults !== null;\n\n const getItemKey = React.useCallback(\n (index: number) => (tree ? treeRows[index]?.node.value : renderedItems[index]?.value) ?? index,\n [tree, treeRows, renderedItems],\n );\n\n const virtualizer = useCascaderVirtualizer({\n count,\n getScrollElement: () => cascaderScrollElement(contentElement),\n estimateSize: estimateSize ?? estimateRowSize,\n overscan: overscan ?? rootOverscan,\n getItemKey,\n activeIndex: highlight.index,\n });\n\n return (\n <>\n <CascaderVirtualSpacer\n height={virtualizer.getTotalSize()}\n onContentElement={setContentElement}\n />\n {virtualizer.getVirtualItems().map((row) => {\n const flat = tree ? treeRows[row.index] : undefined;\n const node = tree ? flat?.node : renderedItems[row.index];\n // For one commit after a query narrows the level, the window can name\n // a row it no longer has; the count recomputes on the same tick.\n if (!node) return null;\n\n return (\n <CascaderItem\n key={row.key}\n /* Measured, not estimated: rows are two lines with a `description`\n and three in deep or global search, and row height is per\n style. An estimate alone would make `scrollToIndex` land on the\n wrong row. */\n ref={virtualizer.measureElement}\n data-index={row.index}\n style={cascaderVirtualRowStyle(row.start, gutter)}\n node={node}\n index={row.index}\n depth={flat?.depth}\n expanded={flat?.expanded}\n branch={flat ? flat.branch : isBranch(node)}\n selectable={isSelectable(node)}\n selected={isSelected(node)}\n indeterminate={isIndeterminate(node)}\n {...getCascaderMoreProps(node, loadStates)}\n showPath={showPath}\n aria-setsize={flat ? flat.setSize : count}\n aria-posinset={flat ? flat.posInSet : row.index + 1}\n />\n );\n })}\n </>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Column */\n/* -------------------------------------------------------------------------- */\n\nexport interface CascaderVirtualColumnProps extends CascaderVirtualItemsProps {\n column: CascaderColumn;\n}\n\n/**\n * Windowed replacement for one Miller column, passed through the\n * `CascaderColumns` render slot. One virtualizer PER COLUMN, since columns\n * scroll independently, and only the deepest is Base UI's listbox: the trail\n * behind is `as=\"button\"` rows outside Base UI, so it windows on its own row\n * count rather than waiting for the root to flip.\n */\nfunction CascaderVirtualColumn({ column, estimateSize, overscan }: CascaderVirtualColumnProps) {\n const { virtualized, registerVirtualRenderer, virtualize, virtualizeThreshold } =\n useCascaderActions();\n\n React.useLayoutEffect(() => registerVirtualRenderer(), [registerVirtualRenderer]);\n\n const windowed = column.active\n ? virtualized\n : (virtualize ?? column.items.length >= virtualizeThreshold);\n\n if (!windowed) return <CascaderColumnPanel column={column} />;\n\n return (\n <CascaderColumnPanel column={column} virtualized>\n {column.active ? (\n <CascaderVirtualActiveColumnRows\n column={column}\n estimateSize={estimateSize}\n overscan={overscan}\n />\n ) : (\n <CascaderVirtualColumnRows\n column={column}\n estimateSize={estimateSize}\n overscan={overscan}\n activeIndex={-1}\n />\n )}\n </CascaderColumnPanel>\n );\n}\n\n/** Only the active column subscribes to the highlight; a trail column must not. */\nfunction CascaderVirtualActiveColumnRows(props: CascaderVirtualColumnProps) {\n const highlight = useCascaderHighlight();\n return <CascaderVirtualColumnRows {...props} activeIndex={highlight.index} />;\n}\n\nfunction CascaderVirtualColumnRows({\n column,\n estimateSize,\n overscan,\n activeIndex,\n}: CascaderVirtualColumnProps & { activeIndex: number }) {\n /* The `useCascaderVirtualizer` bail does NOT reach here: the compiler caches\n `getVirtualItems()` on the virtualizer, whose identity never changes, so the\n window freezes on scroll. Inert where no compiler runs. */\n \"use no memo\";\n\n const {\n estimateRowSize,\n overscan: rootOverscan,\n baseId,\n isBranch,\n isSelectable,\n isSelected,\n isIndeterminate,\n } = useCascaderActions();\n const { loadStates } = useCascaderState();\n\n const [contentElement, setContentElement] = React.useState<HTMLElement | null>(null);\n const gutter = useCascaderVirtualGutter(contentElement);\n\n const items = column.items;\n const getItemKey = React.useCallback((index: number) => items[index]?.value ?? index, [items]);\n\n const virtualizer = useCascaderVirtualizer({\n count: items.length,\n getScrollElement: () => cascaderScrollElement(contentElement),\n estimateSize: estimateSize ?? estimateRowSize,\n overscan: overscan ?? rootOverscan,\n getItemKey,\n activeIndex,\n });\n\n return (\n <>\n <CascaderVirtualSpacer\n height={virtualizer.getTotalSize()}\n onContentElement={setContentElement}\n />\n {virtualizer.getVirtualItems().map((row) => {\n const node = items[row.index];\n if (!node) return null;\n const open = node.value === column.activeValue;\n\n return (\n <CascaderItem\n key={row.key}\n ref={virtualizer.measureElement}\n data-index={row.index}\n style={cascaderVirtualRowStyle(row.start, gutter)}\n node={node}\n as={column.active ? \"option\" : \"button\"}\n depth={column.depth}\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 /* Only the listbox column may carry an index or listbox metadata.\n A trail row is a `role=\"button\"`, which allows neither. */\n {...(column.active\n ? {\n index: row.index,\n \"aria-setsize\": items.length,\n \"aria-posinset\": row.index + 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}\n\nexport { CascaderVirtualColumn, CascaderVirtualItems };\n"],"mappings":";;;;;;;;;;;;;;AAsDA,SAAgB,uBAAuB,EACrC,OACA,kBACA,eAAe,IACf,WAAW,GACX,YACA,cAAc,MACuC;CACrD,MAAM,SAAS,eAAe,KAAK,cAAc,QAAQ,cAAc;CAGvE,MAAM,iBAAiBA,QAAM,aAC1B,UAAiB;EAChB,MAAM,UAAU,IAAI,IAAI,sBAAsB,KAAK,CAAC;EACpD,IAAI,WAAW,IAAI,QAAQ,IAAI,MAAM;EACrC,OAAO,MAAM,KAAK,OAAO,CAAC,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC;CACjD,GACA,CAAC,MAAM,CACT;CAEA,MAAM,kBAAkBA,QAAM,kBAA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QAAM,aAAa,UAAkB,MAAM,MAAM,EAAE,SAAS,OAAO,CAAC,KAAK,CAAC;CAE7F,MAAM,cAAc,uBAAuB;EACzC,OAAO,MAAM;EACb,wBAAwB,sBAAsB,cAAc;EAC5D,cAAc,gBAAgB;EAC9B,UAAU,YAAY;EACtB;EACA;CACF,CAAC;CAED,OACE,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,uBAAD;EACE,QAAQ,YAAY,aAAa;EACjC,kBAAkB;CACnB,CAAA,GACA,YAAY,gBAAgB,CAAC,CAAC,KAAK,QAAQ;EAC1C,MAAM,OAAO,MAAM,IAAI;EACvB,IAAI,CAAC,MAAM,OAAO;EAClB,MAAM,OAAO,KAAK,UAAU,OAAO;EAEnC,OACE,oBAAC,cAAD;GAEE,KAAK,YAAY;GACjB,cAAY,IAAI;GAChB,OAAO,wBAAwB,IAAI,OAAO,MAAM;GAC1C;GACN,IAAI,OAAO,SAAS,WAAW;GAC/B,OAAO,OAAO;GACd,QAAQ,SAAS,IAAI;GACrB,YAAY,aAAa,IAAI;GAC7B,UAAU,WAAW,IAAI;GACzB,eAAe,gBAAgB,IAAI;GACnC,GAAI,qBAAqB,MAAM,UAAU;GACzC,aAAW,QAAQ,KAAA;GACnB,WAAW,OAAO,wCAAwC,KAAA;GAG1D,GAAK,OAAO,SACR;IACE,OAAO,IAAI;IACX,gBAAgB,MAAM;IACtB,iBAAiB,IAAI,QAAQ;GAC/B,IACA;GACJ,GAAK,CAAC,OAAO,UAAU,OACnB;IACE,iBAAiB;IACjB,iBAAiB,GAAG,OAAO,UAAU,OAAO,QAAQ;GACtD,IACA;EACL,GA7BM,IAAI,GA6BV;CAEL,CAAC,CACD,EAAA,CAAA;AAEN"}
@@ -1,4 +1,4 @@
1
- import { _ as CascaderSelectable, f as CascaderMode, g as CascaderSearchScope, n as CascaderChangeDetails, p as CascaderNode, s as CascaderLabels, t as CascaderActionItem } from "../../../cascader-types-BnH6wYD-.js";
1
+ import { _ as CascaderSelectable, f as CascaderMode, g as CascaderSearchScope, n as CascaderChangeDetails, p as CascaderNode, s as CascaderLabels, t as CascaderActionItem } from "../../../cascader-types-DVT-znZ-.js";
2
2
  import { CascaderGetChildren, CascaderOnSearch, CascaderResolveValue } from "./cascader-async.js";
3
3
  import { CascaderActionsContextValue, CascaderColumn, CascaderHighlight, CascaderHighlightStore, CascaderItemState, CascaderRenderContextValue, CascaderStateContextValue, createCascaderHighlightStore, useCascaderActions, useCascaderHighlight, useCascaderRender, useCascaderState } from "./cascader-context.js";
4
4
  import { CascaderCheckedStrategy } from "./cascader-lib.js";
@@ -34,7 +34,7 @@ export interface CascaderSelection<T = unknown> {
34
34
  export declare function useCascaderSelection<T = unknown>(): CascaderSelection<T>;
35
35
  /**
36
36
  * Why the navigation path changed.
37
- * - `"drill"`: a branch was entered (row press, level arrow, deep-search hit).
37
+ * - `"drill"`: a branch was entered (row press, level arrow, search hit).
38
38
  * - `"back"`: one level up (back control, Backspace on an empty query).
39
39
  * - `"breadcrumb"`: a jump to an exact depth in the trail.
40
40
  * - `"reveal"`: the reopen navigated to the level holding the selection.
@@ -131,6 +131,10 @@ export interface CascaderBaseProps<T = unknown> {
131
131
  inputValue?: string;
132
132
  defaultInputValue?: string;
133
133
  onInputValueChange?: (value: string) => void;
134
+ /**
135
+ * `"level"` (default) filters the level on screen, `"deep"` also searches
136
+ * below it, `"global"` searches the whole tree from any level.
137
+ */
134
138
  searchScope?: CascaderSearchScope;
135
139
  /** Custom matcher, replacing label + keywords substring matching. */
136
140
  filter?: (node: CascaderNode<T>, normalizedQuery: string) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"cascader.d.ts","names":["React","ComboboxPrimitive"],"sources":["../../../../src/components/reui/cascader/cascader.tsx"],"mappings":";;;;;;;;;iBA2MiB,qBAAqB,qBAC5B,4BAA4B,IAClC,0BAA0B;;;;;;wBAOd,YAAY,gBAAgB,qBAAqB;iBAWhD,kBAAkB;;EAEjC,UAAU,aAAa;;EAEvB,OAAO,aAA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;EAIA;;EAEA,WAAWD,QAAM;;;;;iBAaV,eACP,WACA,MACA,UACA,aACA,YACA,UACA,aACG,SACF,oBAAiBA,QAAA,IAAA;iBAkEH,6BACPC,SAAkB,MAAM;;;;AAI9B,KACEA,SAAkB,WAAW;;AAY/B,KAAKA,SAAkB,OAAO;;;;iBAKzB,kBACP,WACA,MACA,YACA,OACA,aACA,QACA,mBACA,kBACA,QACA,gBACA,WACA,QACG,SACF,uBAAoBD,QAAA,IAAA;YA2EX,qBAAqB,UAAU;;;;;;;;;;;;iBAalC,gBAAgB,cAAc,SAAS,qBAAkBA,QAAA,+BAAAA,QAAA;iBAwCjD,0BAA0B,KAAKC,SAAkB,KAAK;;;;EAIrE,QAAQD,QAAM;;EAEd;;;;;;;;;;;iBAYO,eAAe,WAAW,OAAO,WAAW,kBAAkB,SAAS,oBAAiBA,QAAA,IAAA;iBA+DhF,2BAA2BC,SAAkB,MAAM;;;;EAIlE;;;;;;iBAOO,gBACP,WACA,UAEA,iBACG,SACF,qBAAkBD,QAAA,IAAA;YAkDT,sBAAsBC,SAAkB,OAAO;;;;;;;iBAQlD,iBAAiB,WAAW,aAAa,SAAS,sBAAmBD,QAAA,IAAA"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { ScrollArea } from "../../ui/scroll-area.js";
3
3
  import { CascaderActionsContext, CascaderHighlightContext, CascaderRenderContext, CascaderStateContext, createCascaderHighlightStore, useCascaderActions, useCascaderHighlight, useCascaderRender, useCascaderState } from "./cascader-context.js";
4
- import { CASCADER_LIST_HEIGHT_CLASS, CASCADER_LIST_PAD_CLASS, CASCADER_ROOT_KEY, CASCADER_ROWS_CLASS, CASCADER_SCROLL_CLASS, applyCascadeSelection, buildCascaderIndex, collapseCascaderPath, createCascaderMoreNode, filterCascaderLevel, findAmbiguousCascaderLabels, findCascaderDataIssues, flattenCascaderTree, getCascaderCheckedValues, getCascaderChildren, getCascaderCount, getCascaderIndeterminateFrom, getCascaderPath, getCascaderSelectedDescendants, getCascaderTabTarget, isCascaderBranch, isCascaderMoreNode, isCascaderSelectable, matchesCascaderQuery, mergeCascaderIndex, normalizeCascaderQuery, searchCascaderDeep, warnCascaderOnce } from "./cascader-lib.js";
4
+ import { CASCADER_LIST_HEIGHT_CLASS, CASCADER_LIST_PAD_CLASS, CASCADER_ROOT_KEY, CASCADER_ROWS_CLASS, CASCADER_SCROLL_CLASS, applyCascadeSelection, buildCascaderIndex, collapseCascaderPath, createCascaderMoreNode, filterCascaderLevel, findAmbiguousCascaderLabels, findCascaderDataIssues, flattenCascaderTree, getCascaderCheckedValues, getCascaderChildren, getCascaderCount, getCascaderIndeterminateFrom, getCascaderPath, getCascaderSelectedDescendants, getCascaderTabTarget, isCascaderBranch, isCascaderDisabled, isCascaderMoreNode, isCascaderSelectable, matchesCascaderQuery, mergeCascaderIndex, normalizeCascaderQuery, searchCascaderDeep, warnCascaderOnce } from "./cascader-lib.js";
5
5
  import { useCascaderLoadState, useCascaderLoader } from "./cascader-async.js";
6
6
  import { resolveCascaderLabels } from "./cascader-i18n.js";
7
7
  import * as React$1 from "react";
@@ -17,6 +17,8 @@ const EMPTY = [];
17
17
  /** Stable empty array for the `actions` prop, so a cascader with no footer
18
18
  * does not republish the actions context on every render. */
19
19
  const EMPTY_ACTIONS = [];
20
+ /** The `onSearch` scope of a global search: no path, so the whole tree. */
21
+ const GLOBAL_SEARCH_PATH = [];
20
22
  const ANNOUNCE_MARKER = "⁠";
21
23
  const ANNOUNCE_DEBOUNCE = 150;
22
24
  function useControllable(controlled, defaultValue, onChange, devName) {
@@ -151,6 +153,7 @@ function useCascaderDevWarnings(options) {
151
153
  if (hasExpanded && mode !== "tree") warnCascaderOnce(`expanded-outside-tree:${mode}`, `\`expanded\` only does something in \`mode="tree"\`, and this cascader is in \`mode="${mode}"\`. Drill and columns navigate with \`path\`.`);
152
154
  if (hasPath && mode === "tree") warnCascaderOnce("path-in-tree", "`path` does nothing in `mode=\"tree\"`: branches expand in place rather than replacing the level. Use `expanded`.");
153
155
  if (searchScope === "deep" && mode === "tree") warnCascaderOnce("deep-search-in-tree", "`searchScope=\"deep\"` does nothing in `mode=\"tree\"`: a tree query already matches at any depth and auto-expands the ancestors of every hit.");
156
+ if (searchScope === "global" && mode === "tree") warnCascaderOnce("global-search-in-tree", "`searchScope=\"global\"` does nothing in `mode=\"tree\"`: a tree query already searches the whole tree and auto-expands the ancestors of every hit.");
154
157
  if (hasOnSearch && mode === "tree") warnCascaderOnce("onsearch-in-tree", "`onSearch` does nothing in `mode=\"tree\"`: a tree query filters the loaded tree in place, and a server hit belongs to no visible branch, so its results would never render. The request is not fired. Filter the tree locally, or use drill or columns for server search.");
155
158
  }, [
156
159
  mode,
@@ -229,7 +232,7 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
229
232
  enabled: open || !!inline,
230
233
  query,
231
234
  levels,
232
- path,
235
+ path: searchScope === "global" ? GLOBAL_SEARCH_PATH : path,
233
236
  values: selectedValues
234
237
  });
235
238
  const loadStates = loader.states;
@@ -277,18 +280,19 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
277
280
  const currentParentValue = path.length ? path[path.length - 1] : null;
278
281
  const currentParent = currentParentValue ? index.byValue.get(currentParentValue) ?? null : null;
279
282
  const currentLevelKey = currentParentValue ?? "\0root";
280
- const isDeepSearching = searchScope === "deep" && query.trim().length > 0 && mode !== "tree";
283
+ const isDeepSearching = (searchScope === "deep" || searchScope === "global") && query.trim().length > 0 && mode !== "tree";
284
+ const deepSearchWithin = searchScope === "global" ? null : currentParentValue;
281
285
  const localDeepResults = React$1.useMemo(() => {
282
286
  if (!isDeepSearching) return null;
283
287
  return searchCascaderDeep(index, query, {
284
- within: currentParentValue,
288
+ within: deepSearchWithin,
285
289
  matches: filter
286
290
  });
287
291
  }, [
288
292
  isDeepSearching,
289
293
  index,
290
294
  query,
291
- currentParentValue,
295
+ deepSearchWithin,
292
296
  filter
293
297
  ]);
294
298
  const deepResults = loader.searchResults ?? localDeepResults;
@@ -403,6 +407,12 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
403
407
  active: false
404
408
  }));
405
409
  }, [swap.active]);
410
+ const resetHighlight = React$1.useCallback(() => {
411
+ setSwap((prev) => prev.active ? prev : {
412
+ ...prev,
413
+ active: true
414
+ });
415
+ }, []);
406
416
  const [virtualRenderers, setVirtualRenderers] = React$1.useState(0);
407
417
  const registerVirtualRenderer = React$1.useCallback(() => {
408
418
  setVirtualRenderers((count) => count + 1);
@@ -531,6 +541,7 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
531
541
  }, [setExpandedList, bumpAnnouncement]);
532
542
  const isBranch = React$1.useCallback((node) => isCascaderBranch(index, node), [index]);
533
543
  const isSelectable = React$1.useCallback((node) => isCascaderSelectable(index, node, selectable), [index, selectable]);
544
+ const isDisabled = React$1.useCallback((node) => isCascaderDisabled(index, node), [index]);
534
545
  const branchesSelectable = selectable !== "leaf";
535
546
  const openFlyoutsRef = React$1.useRef(/* @__PURE__ */ new Set());
536
547
  const setFlyoutOpen = React$1.useCallback((key, open) => {
@@ -725,7 +736,20 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
725
736
  setQuery,
726
737
  bumpAnnouncement
727
738
  ]);
739
+ const goToTrail = React$1.useCallback((trail) => {
740
+ const { path: current } = latest.current.state;
741
+ if (trail.length === current.length && trail.every((entry, i) => entry === current[i])) resetHighlight();
742
+ else setPathWithReason(trail, "drill");
743
+ setQuery("");
744
+ bumpAnnouncement(null);
745
+ }, [
746
+ setPathWithReason,
747
+ resetHighlight,
748
+ setQuery,
749
+ bumpAnnouncement
750
+ ]);
728
751
  const navigateAt = React$1.useCallback((node, depth) => {
752
+ if (isCascaderDisabled(latest.current.index, node)) return;
729
753
  if (latest.current.mode === "tree") {
730
754
  toggleExpanded(node.value);
731
755
  return;
@@ -746,6 +770,7 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
746
770
  ]);
747
771
  const navigate = React$1.useCallback((node) => {
748
772
  const { mode: currentMode, deepResults: currentDeepResults, index: currentIndex, expanded: currentExpanded, needsChildren: pending } = latest.current;
773
+ if (isCascaderDisabled(currentIndex, node)) return;
749
774
  if (currentMode === "tree") {
750
775
  if (!currentExpanded.has(node.value) && pending(node)) {
751
776
  requestChildren(node, {
@@ -759,19 +784,16 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
759
784
  return;
760
785
  }
761
786
  if (currentDeepResults) {
787
+ const trail = getCascaderPath(currentIndex, node.value).map((entry) => entry.value);
762
788
  if (pending(node)) {
763
- const ancestors = getCascaderPath(currentIndex, node.value);
764
789
  requestChildren(node, {
765
790
  value: node.value,
766
- kind: "at",
767
- depth: Math.max(0, ancestors.length - 1)
791
+ kind: "trail",
792
+ trail
768
793
  });
769
794
  return;
770
795
  }
771
- const ancestors = getCascaderPath(currentIndex, node.value);
772
- setPathWithReason(ancestors.map((entry) => entry.value), "drill");
773
- setQuery("");
774
- bumpAnnouncement(null);
796
+ goToTrail(trail);
775
797
  return;
776
798
  }
777
799
  if (pending(node)) {
@@ -785,10 +807,8 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
785
807
  pushLevel(node.value);
786
808
  }, [
787
809
  toggleExpanded,
788
- setPathWithReason,
789
- setQuery,
810
+ goToTrail,
790
811
  pushLevel,
791
- bumpAnnouncement,
792
812
  requestChildren
793
813
  ]);
794
814
  /**
@@ -804,10 +824,16 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
804
824
  const state = loadStates.get(pendingNavigation.value);
805
825
  if (!state || state.loading || state.error) return;
806
826
  setPendingNavigation(null);
827
+ const target = index.byValue.get(pendingNavigation.value);
828
+ if (target && isDisabled(target)) return;
807
829
  if (pendingNavigation.kind === "expand") {
808
830
  toggleExpanded(pendingNavigation.value);
809
831
  return;
810
832
  }
833
+ if (pendingNavigation.kind === "trail") {
834
+ goToTrail(pendingNavigation.trail);
835
+ return;
836
+ }
811
837
  if (pendingNavigation.kind === "at") {
812
838
  goToLevelAt(pendingNavigation.value, pendingNavigation.depth);
813
839
  return;
@@ -816,7 +842,10 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
816
842
  }, [
817
843
  pendingNavigation,
818
844
  loadStates,
845
+ index,
846
+ isDisabled,
819
847
  toggleExpanded,
848
+ goToTrail,
820
849
  goToLevelAt,
821
850
  pushLevel
822
851
  ]);
@@ -859,6 +888,8 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
859
888
  }, [emitSelection]);
860
889
  const commit = React$1.useCallback((node) => {
861
890
  const { multiple: currentMultiple, cascade: currentCascade, selectedValues: current, max: currentMax, index: currentIndex, isSelectable: currentIsSelectable, labels: currentLabels, closeOnSelect: currentCloseOnSelect } = latest.current;
891
+ const selecting = !currentMultiple || !current.includes(node.value);
892
+ if (selecting && isCascaderDisabled(currentIndex, node)) return;
862
893
  if (!currentMultiple) {
863
894
  emitSelection([node.value], node, "select");
864
895
  if (currentCloseOnSelect) {
@@ -868,7 +899,6 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
868
899
  return;
869
900
  }
870
901
  if (currentCascade) {
871
- const selecting = !current.includes(node.value);
872
902
  const next = applyCascadeSelection(currentIndex, current, node.value, selecting, currentIsSelectable);
873
903
  if (selecting && currentMax != null && next.length > currentMax && next.length > current.length) {
874
904
  announceNotice(currentLabels.maxReachedAnnouncement(currentMax));
@@ -906,6 +936,10 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
906
936
  details.cancel();
907
937
  return;
908
938
  }
939
+ if (node && isDisabled(node)) {
940
+ details.cancel();
941
+ return;
942
+ }
909
943
  if (node && !isSelectable(node) && isBranch(node)) {
910
944
  details.cancel();
911
945
  navigate(node);
@@ -920,7 +954,7 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
920
954
  const nextNodes = Array.isArray(next) ? next : [];
921
955
  const before = new Set(selectedValues);
922
956
  const added = nextNodes.find((node) => !before.has(node.value));
923
- if (added && isCascaderMoreNode(added)) {
957
+ if (added && (isCascaderMoreNode(added) || isDisabled(added))) {
924
958
  details.cancel();
925
959
  return;
926
960
  }
@@ -952,6 +986,7 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
952
986
  labels,
953
987
  announceNotice,
954
988
  isSelectable,
989
+ isDisabled,
955
990
  isBranch,
956
991
  navigate,
957
992
  commit,
@@ -1037,6 +1072,7 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
1037
1072
  resolveNode,
1038
1073
  isBranch,
1039
1074
  isSelectable,
1075
+ isDisabled,
1040
1076
  isSelected,
1041
1077
  isIndeterminate,
1042
1078
  selectedDescendantCount
@@ -1083,6 +1119,7 @@ function Cascader({ items, getParent, getChildren, onSearch, searchDebounce, res
1083
1119
  resolveNode,
1084
1120
  isBranch,
1085
1121
  isSelectable,
1122
+ isDisabled,
1086
1123
  isSelected,
1087
1124
  isIndeterminate,
1088
1125
  selectedDescendantCount
@@ -1373,9 +1410,10 @@ function CascaderPanel({ className, ...props }) {
1373
1410
  * live in `cascader-lib.tsx`.
1374
1411
  */
1375
1412
  function CascaderList({ className, style, maxHeight: maxHeightProp, ...props }) {
1376
- const { maxHeight, mode, labels, baseId, virtualized } = useCascaderActions();
1377
- const { currentParent } = useCascaderState();
1413
+ const { maxHeight, mode, labels, baseId, virtualized, searchScope } = useCascaderActions();
1414
+ const { currentParent, deepResults } = useCascaderState();
1378
1415
  const resolved = maxHeightProp ?? maxHeight;
1416
+ const listName = searchScope === "global" && deepResults ? labels.rootLevel : currentParent?.label ?? labels.rootLevel;
1379
1417
  return /* @__PURE__ */ jsx("div", {
1380
1418
  "data-slot": "cascader-list-shell",
1381
1419
  style: resolved != null ? {
@@ -1390,7 +1428,7 @@ function CascaderList({ className, style, maxHeight: maxHeightProp, ...props })
1390
1428
  className: CASCADER_SCROLL_CLASS,
1391
1429
  children: /* @__PURE__ */ jsx(Combobox.List, {
1392
1430
  "data-slot": "cascader-list",
1393
- "aria-label": currentParent?.label ?? labels.rootLevel,
1431
+ "aria-label": listName,
1394
1432
  id: `${baseId}-column-0`,
1395
1433
  ...mode === "tree" ? { role: "tree" } : null,
1396
1434
  ...virtualized ? { "data-virtualized": true } : null,