@kumix/ui 0.3.17 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (534) hide show
  1. package/README.md +30 -18
  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/agent-activity/activity-row.js +1 -1
  7. package/dist/components/agents/agent-activity/index.js +1 -1
  8. package/dist/components/agents/agent-code.js +1 -1
  9. package/dist/components/agents/ai-sidebar.js +1 -1
  10. package/dist/components/agents/approval-card/index.js +1 -1
  11. package/dist/components/agents/citations.js +1 -1
  12. package/dist/components/agents/code-block.js +1 -1
  13. package/dist/components/agents/file-diff.js +1 -1
  14. package/dist/components/agents/image-generation.js +1 -1
  15. package/dist/components/agents/message-bubble.js +1 -1
  16. package/dist/components/agents/prompt-input.js +1 -1
  17. package/dist/components/agents/streaming-response.js +1 -1
  18. package/dist/components/agents/todo-list.js +1 -1
  19. package/dist/components/agents/tool-approval.js +1 -1
  20. package/dist/components/agents/tool-result.js +1 -1
  21. package/dist/components/agents/voice-orb.d.ts +19 -0
  22. package/dist/components/agents/voice-orb.d.ts.map +1 -0
  23. package/dist/components/agents/voice-orb.js +389 -0
  24. package/dist/components/agents/voice-orb.js.map +1 -0
  25. package/dist/components/charts/bump-chart/context.d.ts +2 -0
  26. package/dist/components/charts/bump-chart/context.js +3 -0
  27. package/dist/components/charts/bump-chart/legend.d.ts +6 -0
  28. package/dist/components/charts/bump-chart/legend.d.ts.map +1 -0
  29. package/dist/components/charts/bump-chart/legend.js +60 -0
  30. package/dist/components/charts/bump-chart/legend.js.map +1 -0
  31. package/dist/components/charts/bump-chart/plot.d.ts +6 -0
  32. package/dist/components/charts/bump-chart/plot.d.ts.map +1 -0
  33. package/dist/components/charts/bump-chart/plot.js +3 -0
  34. package/dist/components/charts/bump-chart/point.d.ts +10 -0
  35. package/dist/components/charts/bump-chart/point.d.ts.map +1 -0
  36. package/dist/components/charts/bump-chart/point.js +124 -0
  37. package/dist/components/charts/bump-chart/point.js.map +1 -0
  38. package/dist/components/charts/bump-chart/series.d.ts +11 -0
  39. package/dist/components/charts/bump-chart/series.d.ts.map +1 -0
  40. package/dist/components/charts/bump-chart/series.js +101 -0
  41. package/dist/components/charts/bump-chart/series.js.map +1 -0
  42. package/dist/components/charts/bump-chart.d.ts +10 -0
  43. package/dist/components/charts/bump-chart.d.ts.map +1 -0
  44. package/dist/components/charts/bump-chart.js +23 -0
  45. package/dist/components/charts/bump-chart.js.map +1 -0
  46. package/dist/components/charts/composition-chart/context.d.ts +2 -0
  47. package/dist/components/charts/composition-chart/context.js +3 -0
  48. package/dist/components/charts/composition-chart/legend.d.ts +6 -0
  49. package/dist/components/charts/composition-chart/legend.d.ts.map +1 -0
  50. package/dist/components/charts/composition-chart/legend.js +51 -0
  51. package/dist/components/charts/composition-chart/legend.js.map +1 -0
  52. package/dist/components/charts/composition-chart/plot.d.ts +6 -0
  53. package/dist/components/charts/composition-chart/plot.d.ts.map +1 -0
  54. package/dist/components/charts/composition-chart/plot.js +174 -0
  55. package/dist/components/charts/composition-chart/plot.js.map +1 -0
  56. package/dist/components/charts/composition-chart/tooltip-content.d.ts +6 -0
  57. package/dist/components/charts/composition-chart/tooltip-content.d.ts.map +1 -0
  58. package/dist/components/charts/composition-chart/tooltip-content.js +63 -0
  59. package/dist/components/charts/composition-chart/tooltip-content.js.map +1 -0
  60. package/dist/components/charts/composition-chart.d.ts +9 -0
  61. package/dist/components/charts/composition-chart.d.ts.map +1 -0
  62. package/dist/components/charts/composition-chart.js +26 -0
  63. package/dist/components/charts/composition-chart.js.map +1 -0
  64. package/dist/components/charts/funnel-chart.d.ts +50 -0
  65. package/dist/components/charts/funnel-chart.d.ts.map +1 -0
  66. package/dist/components/charts/funnel-chart.js +216 -0
  67. package/dist/components/charts/funnel-chart.js.map +1 -0
  68. package/dist/components/charts/heat-calendar/grid.d.ts +8 -0
  69. package/dist/components/charts/heat-calendar/grid.d.ts.map +1 -0
  70. package/dist/components/charts/heat-calendar/grid.js +127 -0
  71. package/dist/components/charts/heat-calendar/grid.js.map +1 -0
  72. package/dist/components/charts/heat-calendar/legend.d.ts +6 -0
  73. package/dist/components/charts/heat-calendar/legend.d.ts.map +1 -0
  74. package/dist/components/charts/heat-calendar/legend.js +48 -0
  75. package/dist/components/charts/heat-calendar/legend.js.map +1 -0
  76. package/dist/components/charts/heat-calendar/tooltip.d.ts +2 -0
  77. package/dist/components/charts/heat-calendar/tooltip.js +50 -0
  78. package/dist/components/charts/heat-calendar/tooltip.js.map +1 -0
  79. package/dist/components/charts/heat-calendar.d.ts +9 -0
  80. package/dist/components/charts/heat-calendar.d.ts.map +1 -0
  81. package/dist/components/charts/heat-calendar.js +23 -0
  82. package/dist/components/charts/heat-calendar.js.map +1 -0
  83. package/dist/components/charts/liquidity-heatmap.d.ts +51 -0
  84. package/dist/components/charts/liquidity-heatmap.d.ts.map +1 -0
  85. package/dist/components/charts/liquidity-heatmap.js +311 -0
  86. package/dist/components/charts/liquidity-heatmap.js.map +1 -0
  87. package/dist/components/charts/order-book/depth-row.d.ts +13 -0
  88. package/dist/components/charts/order-book/depth-row.d.ts.map +1 -0
  89. package/dist/components/charts/order-book/depth-row.js +99 -0
  90. package/dist/components/charts/order-book/depth-row.js.map +1 -0
  91. package/dist/components/charts/order-book.d.ts +57 -0
  92. package/dist/components/charts/order-book.d.ts.map +1 -0
  93. package/dist/components/charts/order-book.js +207 -0
  94. package/dist/components/charts/order-book.js.map +1 -0
  95. package/dist/components/charts/price-target-fan/header.d.ts +8 -0
  96. package/dist/components/charts/price-target-fan/header.d.ts.map +1 -0
  97. package/dist/components/charts/price-target-fan/header.js +43 -0
  98. package/dist/components/charts/price-target-fan/header.js.map +1 -0
  99. package/dist/components/charts/price-target-fan/plot.d.ts +16 -0
  100. package/dist/components/charts/price-target-fan/plot.d.ts.map +1 -0
  101. package/dist/components/charts/price-target-fan/plot.js +142 -0
  102. package/dist/components/charts/price-target-fan/plot.js.map +1 -0
  103. package/dist/components/charts/price-target-fan/series.d.ts +15 -0
  104. package/dist/components/charts/price-target-fan/series.d.ts.map +1 -0
  105. package/dist/components/charts/price-target-fan/series.js +238 -0
  106. package/dist/components/charts/price-target-fan/series.js.map +1 -0
  107. package/dist/components/charts/price-target-fan/tooltip.d.ts +2 -0
  108. package/dist/components/charts/price-target-fan/tooltip.js +58 -0
  109. package/dist/components/charts/price-target-fan/tooltip.js.map +1 -0
  110. package/dist/components/charts/price-target-fan.d.ts +10 -0
  111. package/dist/components/charts/price-target-fan.d.ts.map +1 -0
  112. package/dist/components/charts/price-target-fan.js +24 -0
  113. package/dist/components/charts/price-target-fan.js.map +1 -0
  114. package/dist/components/charts/returns-calendar/grid.d.ts +8 -0
  115. package/dist/components/charts/returns-calendar/grid.d.ts.map +1 -0
  116. package/dist/components/charts/returns-calendar/grid.js +176 -0
  117. package/dist/components/charts/returns-calendar/grid.js.map +1 -0
  118. package/dist/components/charts/returns-calendar/tooltip.d.ts +2 -0
  119. package/dist/components/charts/returns-calendar/tooltip.js +55 -0
  120. package/dist/components/charts/returns-calendar/tooltip.js.map +1 -0
  121. package/dist/components/charts/returns-calendar.d.ts +48 -0
  122. package/dist/components/charts/returns-calendar.d.ts.map +1 -0
  123. package/dist/components/charts/returns-calendar.js +22 -0
  124. package/dist/components/charts/returns-calendar.js.map +1 -0
  125. package/dist/components/charts/status-bar/legend.d.ts +8 -0
  126. package/dist/components/charts/status-bar/legend.d.ts.map +1 -0
  127. package/dist/components/charts/status-bar/legend.js +37 -0
  128. package/dist/components/charts/status-bar/legend.js.map +1 -0
  129. package/dist/components/charts/status-bar/plot.d.ts +12 -0
  130. package/dist/components/charts/status-bar/plot.d.ts.map +1 -0
  131. package/dist/components/charts/status-bar/plot.js +176 -0
  132. package/dist/components/charts/status-bar/plot.js.map +1 -0
  133. package/dist/components/charts/status-bar/tooltip.d.ts +2 -0
  134. package/dist/components/charts/status-bar/tooltip.js +49 -0
  135. package/dist/components/charts/status-bar/tooltip.js.map +1 -0
  136. package/dist/components/charts/status-bar.d.ts +9 -0
  137. package/dist/components/charts/status-bar.d.ts.map +1 -0
  138. package/dist/components/charts/status-bar.js +64 -0
  139. package/dist/components/charts/status-bar.js.map +1 -0
  140. package/dist/components/charts/treemap/legend.d.ts +8 -0
  141. package/dist/components/charts/treemap/legend.d.ts.map +1 -0
  142. package/dist/components/charts/treemap/legend.js +35 -0
  143. package/dist/components/charts/treemap/legend.js.map +1 -0
  144. package/dist/components/charts/treemap/plot.d.ts +13 -0
  145. package/dist/components/charts/treemap/plot.d.ts.map +1 -0
  146. package/dist/components/charts/treemap/plot.js +123 -0
  147. package/dist/components/charts/treemap/plot.js.map +1 -0
  148. package/dist/components/charts/treemap/tile.d.ts +10 -0
  149. package/dist/components/charts/treemap/tile.d.ts.map +1 -0
  150. package/dist/components/charts/treemap/tile.js +114 -0
  151. package/dist/components/charts/treemap/tile.js.map +1 -0
  152. package/dist/components/charts/treemap/tooltip.d.ts +11 -0
  153. package/dist/components/charts/treemap/tooltip.d.ts.map +1 -0
  154. package/dist/components/charts/treemap/tooltip.js +73 -0
  155. package/dist/components/charts/treemap/tooltip.js.map +1 -0
  156. package/dist/components/charts/treemap.d.ts +56 -0
  157. package/dist/components/charts/treemap.d.ts.map +1 -0
  158. package/dist/components/charts/treemap.js +71 -0
  159. package/dist/components/charts/treemap.js.map +1 -0
  160. package/dist/components/charts/volume-profile/plot.d.ts +12 -0
  161. package/dist/components/charts/volume-profile/plot.d.ts.map +1 -0
  162. package/dist/components/charts/volume-profile/plot.js +211 -0
  163. package/dist/components/charts/volume-profile/plot.js.map +1 -0
  164. package/dist/components/charts/volume-profile/summary.d.ts +6 -0
  165. package/dist/components/charts/volume-profile/summary.d.ts.map +1 -0
  166. package/dist/components/charts/volume-profile/summary.js +76 -0
  167. package/dist/components/charts/volume-profile/summary.js.map +1 -0
  168. package/dist/components/charts/volume-profile/tooltip.d.ts +2 -0
  169. package/dist/components/charts/volume-profile/tooltip.js +84 -0
  170. package/dist/components/charts/volume-profile/tooltip.js.map +1 -0
  171. package/dist/components/charts/volume-profile.d.ts +111 -0
  172. package/dist/components/charts/volume-profile.d.ts.map +1 -0
  173. package/dist/components/charts/volume-profile.js +82 -0
  174. package/dist/components/charts/volume-profile.js.map +1 -0
  175. package/dist/components/custom/confirm-dialog.js +1 -1
  176. package/dist/components/motion/adaptive-stepper.js +1 -1
  177. package/dist/components/motion/alert.d.ts +40 -0
  178. package/dist/components/motion/alert.d.ts.map +1 -0
  179. package/dist/components/motion/alert.js +247 -0
  180. package/dist/components/motion/alert.js.map +1 -0
  181. package/dist/components/motion/animated-badge.js +1 -1
  182. package/dist/components/motion/animated-sidebar.js +1 -1
  183. package/dist/components/motion/animated-sidebar.js.map +1 -1
  184. package/dist/components/motion/animated-toast-stack.js +1 -1
  185. package/dist/components/motion/arc-picker.d.ts +28 -0
  186. package/dist/components/motion/arc-picker.d.ts.map +1 -0
  187. package/dist/components/motion/arc-picker.js +569 -0
  188. package/dist/components/motion/arc-picker.js.map +1 -0
  189. package/dist/components/motion/aspect-ratio.d.ts +23 -0
  190. package/dist/components/motion/aspect-ratio.d.ts.map +1 -0
  191. package/dist/components/motion/aspect-ratio.js +61 -0
  192. package/dist/components/motion/aspect-ratio.js.map +1 -0
  193. package/dist/components/motion/attachment-upload.d.ts.map +1 -1
  194. package/dist/components/motion/attachment-upload.js +2 -2
  195. package/dist/components/motion/attachment-upload.js.map +1 -1
  196. package/dist/components/motion/availability-scheduler/copy-menu.js +1 -1
  197. package/dist/components/motion/availability-scheduler/day-row.js +2 -2
  198. package/dist/components/motion/availability-scheduler/index.js +1 -1
  199. package/dist/components/motion/bloom-menu.js +1 -1
  200. package/dist/components/motion/bottom-sheet.js.map +1 -1
  201. package/dist/components/motion/bouncy-accordion.js +1 -1
  202. package/dist/components/motion/breadcrumb.d.ts +37 -0
  203. package/dist/components/motion/breadcrumb.d.ts.map +1 -0
  204. package/dist/components/motion/breadcrumb.js +259 -0
  205. package/dist/components/motion/breadcrumb.js.map +1 -0
  206. package/dist/components/motion/button/stateful.js +1 -1
  207. package/dist/components/motion/card-folder.js +1 -1
  208. package/dist/components/motion/center-morph-modal.js +1 -1
  209. package/dist/components/motion/collapsible.d.ts +34 -0
  210. package/dist/components/motion/collapsible.d.ts.map +1 -0
  211. package/dist/components/motion/collapsible.js +237 -0
  212. package/dist/components/motion/collapsible.js.map +1 -0
  213. package/dist/components/motion/color-selector.d.ts +28 -0
  214. package/dist/components/motion/color-selector.d.ts.map +1 -0
  215. package/dist/components/motion/color-selector.js +97 -0
  216. package/dist/components/motion/color-selector.js.map +1 -0
  217. package/dist/components/motion/combobox/list.js +1 -1
  218. package/dist/components/motion/combobox/trigger.js +1 -1
  219. package/dist/components/motion/command-palette.js +1 -1
  220. package/dist/components/motion/command-palette.js.map +1 -1
  221. package/dist/components/motion/context-menu.js +1 -1
  222. package/dist/components/motion/date-range-picker.d.ts +107 -0
  223. package/dist/components/motion/date-range-picker.d.ts.map +1 -0
  224. package/dist/components/motion/date-range-picker.js +907 -0
  225. package/dist/components/motion/date-range-picker.js.map +1 -0
  226. package/dist/components/motion/drawer.js.map +1 -1
  227. package/dist/components/motion/feedback-widget.js +1 -1
  228. package/dist/components/motion/file-tree.js +1 -1
  229. package/dist/components/motion/file-upload.js +1 -1
  230. package/dist/components/motion/infinite-masonry.js +1 -1
  231. package/dist/components/motion/knockout-bracket.d.ts +190 -0
  232. package/dist/components/motion/knockout-bracket.d.ts.map +1 -0
  233. package/dist/components/motion/knockout-bracket.js +952 -0
  234. package/dist/components/motion/knockout-bracket.js.map +1 -0
  235. package/dist/components/motion/knockout-wheel.d.ts +183 -0
  236. package/dist/components/motion/knockout-wheel.d.ts.map +1 -0
  237. package/dist/components/motion/knockout-wheel.js +1039 -0
  238. package/dist/components/motion/knockout-wheel.js.map +1 -0
  239. package/dist/components/motion/morphing-lightbox.d.ts +67 -0
  240. package/dist/components/motion/morphing-lightbox.d.ts.map +1 -0
  241. package/dist/components/motion/morphing-lightbox.js +499 -0
  242. package/dist/components/motion/morphing-lightbox.js.map +1 -0
  243. package/dist/components/motion/morphing-modal.js.map +1 -1
  244. package/dist/components/motion/morphing-search.js +1 -1
  245. package/dist/components/motion/morphing-search.js.map +1 -1
  246. package/dist/components/motion/morphing-tabs.js +1 -1
  247. package/dist/components/motion/multi-select/list.js +1 -1
  248. package/dist/components/motion/multi-select/trigger.js +1 -1
  249. package/dist/components/motion/notification-stack.js +1 -1
  250. package/dist/components/motion/overflow-actions.js +1 -1
  251. package/dist/components/motion/popover-morph.d.ts +5 -1
  252. package/dist/components/motion/popover-morph.d.ts.map +1 -1
  253. package/dist/components/motion/popover-morph.js +78 -27
  254. package/dist/components/motion/popover-morph.js.map +1 -1
  255. package/dist/components/motion/prediction-market-card.d.ts +37 -0
  256. package/dist/components/motion/prediction-market-card.d.ts.map +1 -0
  257. package/dist/components/motion/prediction-market-card.js +216 -0
  258. package/dist/components/motion/prediction-market-card.js.map +1 -0
  259. package/dist/components/motion/prediction-market.d.ts +49 -0
  260. package/dist/components/motion/prediction-market.d.ts.map +1 -0
  261. package/dist/components/motion/prediction-market.js +440 -0
  262. package/dist/components/motion/prediction-market.js.map +1 -0
  263. package/dist/components/motion/project-folder.js +1 -1
  264. package/dist/components/motion/project-folder.js.map +1 -1
  265. package/dist/components/motion/select-morph.js +1 -1
  266. package/dist/components/motion/select.js +1 -1
  267. package/dist/components/motion/signup-form.js +1 -1
  268. package/dist/components/motion/sortable-list.d.ts +53 -0
  269. package/dist/components/motion/sortable-list.d.ts.map +1 -0
  270. package/dist/components/motion/sortable-list.js +254 -0
  271. package/dist/components/motion/sortable-list.js.map +1 -0
  272. package/dist/components/motion/sortable-stack.d.ts +2 -0
  273. package/dist/components/motion/sortable-stack.js +3 -0
  274. package/dist/components/motion/swap/controls.d.ts +22 -0
  275. package/dist/components/motion/swap/controls.d.ts.map +1 -0
  276. package/dist/components/motion/swap/controls.js +167 -0
  277. package/dist/components/motion/swap/controls.js.map +1 -0
  278. package/dist/components/motion/swap/field.d.ts +14 -0
  279. package/dist/components/motion/swap/field.d.ts.map +1 -0
  280. package/dist/components/motion/swap/field.js +107 -0
  281. package/dist/components/motion/swap/field.js.map +1 -0
  282. package/dist/components/motion/swap/quote-row.d.ts +13 -0
  283. package/dist/components/motion/swap/quote-row.d.ts.map +1 -0
  284. package/dist/components/motion/swap/quote-row.js +55 -0
  285. package/dist/components/motion/swap/quote-row.js.map +1 -0
  286. package/dist/components/motion/swap/token-badges.d.ts +19 -0
  287. package/dist/components/motion/swap/token-badges.d.ts.map +1 -0
  288. package/dist/components/motion/swap/token-badges.js +54 -0
  289. package/dist/components/motion/swap/token-badges.js.map +1 -0
  290. package/dist/components/motion/swap/token-picker.d.ts +14 -0
  291. package/dist/components/motion/swap/token-picker.d.ts.map +1 -0
  292. package/dist/components/motion/swap/token-picker.js +190 -0
  293. package/dist/components/motion/swap/token-picker.js.map +1 -0
  294. package/dist/components/motion/swap.d.ts +14 -0
  295. package/dist/components/motion/swap.d.ts.map +1 -0
  296. package/dist/components/motion/swap.js +378 -0
  297. package/dist/components/motion/swap.js.map +1 -0
  298. package/dist/components/motion/table/row-handle.js +1 -1
  299. package/dist/components/motion/table/table-header.js +1 -1
  300. package/dist/components/motion/tabs.d.ts +5 -9
  301. package/dist/components/motion/tabs.d.ts.map +1 -1
  302. package/dist/components/motion/tabs.js +14 -5
  303. package/dist/components/motion/tabs.js.map +1 -1
  304. package/dist/components/motion/theme-toggle.js +1 -1
  305. package/dist/components/motion/tooltip/positioner.d.ts +33 -0
  306. package/dist/components/motion/tooltip/positioner.d.ts.map +1 -0
  307. package/dist/components/motion/tooltip/positioner.js +3 -0
  308. package/dist/components/motion/tooltip-surface.d.ts +5 -4
  309. package/dist/components/motion/tooltip-surface.d.ts.map +1 -1
  310. package/dist/components/motion/tooltip-surface.js +22 -73
  311. package/dist/components/motion/tooltip-surface.js.map +1 -1
  312. package/dist/components/motion/tooltip.d.ts +3 -1
  313. package/dist/components/motion/tooltip.d.ts.map +1 -1
  314. package/dist/components/motion/tooltip.js +54 -103
  315. package/dist/components/motion/tooltip.js.map +1 -1
  316. package/dist/components/motion/wallet-card/account-avatar.d.ts +8 -0
  317. package/dist/components/motion/wallet-card/account-avatar.d.ts.map +1 -0
  318. package/dist/components/motion/wallet-card/account-avatar.js +3 -0
  319. package/dist/components/motion/wallet-card/account-switcher.d.ts +14 -0
  320. package/dist/components/motion/wallet-card/account-switcher.d.ts.map +1 -0
  321. package/dist/components/motion/wallet-card/account-switcher.js +153 -0
  322. package/dist/components/motion/wallet-card/account-switcher.js.map +1 -0
  323. package/dist/components/motion/wallet-card/actions.d.ts +12 -0
  324. package/dist/components/motion/wallet-card/actions.d.ts.map +1 -0
  325. package/dist/components/motion/wallet-card/actions.js +58 -0
  326. package/dist/components/motion/wallet-card/actions.js.map +1 -0
  327. package/dist/components/motion/wallet-card/balance-delta.d.ts +12 -0
  328. package/dist/components/motion/wallet-card/balance-delta.d.ts.map +1 -0
  329. package/dist/components/motion/wallet-card/balance-delta.js +72 -0
  330. package/dist/components/motion/wallet-card/balance-delta.js.map +1 -0
  331. package/dist/components/motion/wallet-card/copy-button.d.ts +12 -0
  332. package/dist/components/motion/wallet-card/copy-button.d.ts.map +1 -0
  333. package/dist/components/motion/wallet-card/copy-button.js +41 -0
  334. package/dist/components/motion/wallet-card/copy-button.js.map +1 -0
  335. package/dist/components/motion/wallet-card/index.d.ts +13 -0
  336. package/dist/components/motion/wallet-card/index.d.ts.map +1 -0
  337. package/dist/components/motion/wallet-card/index.js +115 -0
  338. package/dist/components/motion/wallet-card/index.js.map +1 -0
  339. package/dist/components/motion/wallet-card/search-bar.d.ts +17 -0
  340. package/dist/components/motion/wallet-card/search-bar.d.ts.map +1 -0
  341. package/dist/components/motion/wallet-card/search-bar.js +156 -0
  342. package/dist/components/motion/wallet-card/search-bar.js.map +1 -0
  343. package/dist/components/reui/alert.d.ts +1 -1
  344. package/dist/components/reui/alert.js +1 -1
  345. package/dist/components/reui/autocomplete.js +1 -1
  346. package/dist/components/reui/badge.d.ts +1 -1
  347. package/dist/components/reui/cascader/cascader-async.d.ts +3 -2
  348. package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -1
  349. package/dist/components/reui/cascader/cascader-async.js.map +1 -1
  350. package/dist/components/reui/cascader/cascader-columns.js +4 -4
  351. package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
  352. package/dist/components/reui/cascader/cascader-context.d.ts +12 -4
  353. package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -1
  354. package/dist/components/reui/cascader/cascader-context.js.map +1 -1
  355. package/dist/components/reui/cascader/cascader-footer.js +1 -1
  356. package/dist/components/reui/cascader/cascader-i18n.d.ts +1 -1
  357. package/dist/components/reui/cascader/cascader-item.d.ts +2 -2
  358. package/dist/components/reui/cascader/cascader-item.d.ts.map +1 -1
  359. package/dist/components/reui/cascader/cascader-item.js +23 -17
  360. package/dist/components/reui/cascader/cascader-item.js.map +1 -1
  361. package/dist/components/reui/cascader/cascader-lib.d.ts +8 -1
  362. package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -1
  363. package/dist/components/reui/cascader/cascader-lib.js +19 -11
  364. package/dist/components/reui/cascader/cascader-lib.js.map +1 -1
  365. package/dist/components/reui/cascader/cascader-nav.d.ts +1 -1
  366. package/dist/components/reui/cascader/cascader-nav.d.ts.map +1 -1
  367. package/dist/components/reui/cascader/cascader-nav.js +6 -5
  368. package/dist/components/reui/cascader/cascader-nav.js.map +1 -1
  369. package/dist/components/reui/cascader/cascader-types.d.ts +1 -1
  370. package/dist/components/reui/cascader/cascader-virtual.d.ts.map +1 -1
  371. package/dist/components/reui/cascader/cascader-virtual.js.map +1 -1
  372. package/dist/components/reui/cascader/cascader.d.ts +6 -2
  373. package/dist/components/reui/cascader/cascader.d.ts.map +1 -1
  374. package/dist/components/reui/cascader/cascader.js +59 -21
  375. package/dist/components/reui/cascader/cascader.js.map +1 -1
  376. package/dist/components/reui/data-grid/data-grid-column-filter.js +3 -3
  377. package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
  378. package/dist/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -1
  379. package/dist/components/reui/data-grid/data-grid-column-header.js +18 -14
  380. package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
  381. package/dist/components/reui/data-grid/data-grid-column-visibility.js +1 -1
  382. package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -1
  383. package/dist/components/reui/data-grid/data-grid-pagination.js +2 -2
  384. package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
  385. package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -1
  386. package/dist/components/reui/data-grid/data-grid-scroll-area.js +85 -61
  387. package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
  388. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts +7 -2
  389. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -1
  390. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +68 -39
  391. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
  392. package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts +7 -2
  393. package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -1
  394. package/dist/components/reui/data-grid/data-grid-table-dnd.js +90 -26
  395. package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
  396. package/dist/components/reui/data-grid/data-grid-table-virtual.js +1 -1
  397. package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
  398. package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
  399. package/dist/components/reui/data-grid/data-grid-table.js +157 -38
  400. package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
  401. package/dist/components/reui/data-grid/data-grid.d.ts +16 -0
  402. package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
  403. package/dist/components/reui/data-grid/data-grid.js +81 -51
  404. package/dist/components/reui/data-grid/data-grid.js.map +1 -1
  405. package/dist/components/reui/date-selector.js +1 -1
  406. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +1 -1
  407. package/dist/components/reui/event-calendar/event-calendar-event.js +1 -1
  408. package/dist/components/reui/event-calendar/event-calendar-month-view.js +1 -1
  409. package/dist/components/reui/event-calendar/event-calendar-nav.js +2 -2
  410. package/dist/components/reui/filters/filters-advanced.js +2 -2
  411. package/dist/components/reui/filters/filters-advanced.js.map +1 -1
  412. package/dist/components/reui/filters/filters-builder.d.ts +1 -1
  413. package/dist/components/reui/filters/filters-builder.js +1 -1
  414. package/dist/components/reui/filters/filters-chip.js +2 -2
  415. package/dist/components/reui/filters/filters-editors.js +1 -1
  416. package/dist/components/reui/filters/filters-lib.d.ts +1 -1
  417. package/dist/components/reui/filters/filters.js +1 -1
  418. package/dist/components/reui/frame.js +1 -1
  419. package/dist/components/reui/gantt/gantt-bar.js +1 -1
  420. package/dist/components/reui/gantt/gantt-nav.js +2 -2
  421. package/dist/components/reui/gantt/gantt-view.js +1 -1
  422. package/dist/components/reui/kanban.d.ts.map +1 -1
  423. package/dist/components/reui/kanban.js +30 -1
  424. package/dist/components/reui/kanban.js.map +1 -1
  425. package/dist/components/reui/number-field.js +1 -1
  426. package/dist/components/reui/phone-input.js +1 -1
  427. package/dist/components/reui/rating.js +1 -1
  428. package/dist/components/reui/signature-pad.d.ts +160 -0
  429. package/dist/components/reui/signature-pad.d.ts.map +1 -0
  430. package/dist/components/reui/signature-pad.js +764 -0
  431. package/dist/components/reui/signature-pad.js.map +1 -0
  432. package/dist/components/reui/time-picker.d.ts +202 -0
  433. package/dist/components/reui/time-picker.d.ts.map +1 -0
  434. package/dist/components/reui/time-picker.js +1002 -0
  435. package/dist/components/reui/time-picker.js.map +1 -0
  436. package/dist/components/reui/tree.js +1 -1
  437. package/dist/components/ui/accordion.js +1 -1
  438. package/dist/components/ui/alert-dialog.js +1 -1
  439. package/dist/components/ui/alert.js +1 -1
  440. package/dist/components/ui/attachment.js +1 -1
  441. package/dist/components/ui/breadcrumb.js +1 -1
  442. package/dist/components/ui/bubble.js +1 -1
  443. package/dist/components/ui/button-group.js +1 -1
  444. package/dist/components/ui/button.d.ts +1 -1
  445. package/dist/components/ui/button.js +1 -1
  446. package/dist/components/ui/calendar.js +1 -1
  447. package/dist/components/ui/carousel.js +1 -1
  448. package/dist/components/ui/checkbox.js +1 -1
  449. package/dist/components/ui/combobox.js +1 -1
  450. package/dist/components/ui/command.js +1 -1
  451. package/dist/components/ui/context-menu.js +1 -1
  452. package/dist/components/ui/dialog.js +1 -1
  453. package/dist/components/ui/dropdown-menu.js +1 -1
  454. package/dist/components/ui/empty.js +1 -1
  455. package/dist/components/ui/field.js +1 -1
  456. package/dist/components/ui/input-group.d.ts +1 -1
  457. package/dist/components/ui/input-group.js +1 -1
  458. package/dist/components/ui/input-otp.js +1 -1
  459. package/dist/components/ui/item.js +1 -1
  460. package/dist/components/ui/marker.d.ts +1 -1
  461. package/dist/components/ui/marker.js +1 -1
  462. package/dist/components/ui/menubar.js +1 -1
  463. package/dist/components/ui/message-scroller.js +1 -1
  464. package/dist/components/ui/native-select.js +1 -1
  465. package/dist/components/ui/navigation-menu.js +1 -1
  466. package/dist/components/ui/pagination.js +1 -1
  467. package/dist/components/ui/questionnaire.js +1 -1
  468. package/dist/components/ui/select.js +1 -1
  469. package/dist/components/ui/sheet.js +1 -1
  470. package/dist/components/ui/sidebar.js +1 -1
  471. package/dist/components/ui/spinner.js +1 -1
  472. package/dist/components/ui/tabs.js +1 -1
  473. package/dist/components/ui/toast.js +1 -1
  474. package/dist/components/ui/toggle.js +1 -1
  475. package/dist/constants-CsKm9sSk.js +30 -0
  476. package/dist/constants-CsKm9sSk.js.map +1 -0
  477. package/dist/context-3_vY1jbv.js +141 -0
  478. package/dist/context-3_vY1jbv.js.map +1 -0
  479. package/dist/context-BE60udRT.js +99 -0
  480. package/dist/context-BE60udRT.js.map +1 -0
  481. package/dist/context-BYXeJQnz.d.ts +150 -0
  482. package/dist/context-BYXeJQnz.d.ts.map +1 -0
  483. package/dist/context-Bc6VC1HA.js +181 -0
  484. package/dist/context-Bc6VC1HA.js.map +1 -0
  485. package/dist/context-BqjZ1Z_w.js +111 -0
  486. package/dist/context-BqjZ1Z_w.js.map +1 -0
  487. package/dist/context-CZfRKkcZ.js +204 -0
  488. package/dist/context-CZfRKkcZ.js.map +1 -0
  489. package/dist/context-Cn-00gfW.js +169 -0
  490. package/dist/context-Cn-00gfW.js.map +1 -0
  491. package/dist/context-Cnlo53sV.d.ts +92 -0
  492. package/dist/context-Cnlo53sV.d.ts.map +1 -0
  493. package/dist/context-Rl5VCYA8.js +257 -0
  494. package/dist/context-Rl5VCYA8.js.map +1 -0
  495. package/dist/context-sD8DQga-.js +122 -0
  496. package/dist/context-sD8DQga-.js.map +1 -0
  497. package/dist/{copy-menu-TIKvPaAZ.js → copy-menu-C5GaT4Z-.js} +2 -2
  498. package/dist/{copy-menu-TIKvPaAZ.js.map → copy-menu-C5GaT4Z-.js.map} +1 -1
  499. package/dist/ease-B82HVmio.d.ts +50 -0
  500. package/dist/ease-B82HVmio.d.ts.map +1 -0
  501. package/dist/hooks/use-modal-scope.d.ts +6 -0
  502. package/dist/hooks/use-modal-scope.d.ts.map +1 -0
  503. package/dist/hooks/use-modal-scope.js +83 -0
  504. package/dist/hooks/use-modal-scope.js.map +1 -0
  505. package/dist/lib/ease.d.ts +2 -49
  506. package/dist/model-DfeFradZ.d.ts +9 -0
  507. package/dist/model-DfeFradZ.d.ts.map +1 -0
  508. package/dist/model-DlbIqCZg.d.ts +41 -0
  509. package/dist/model-DlbIqCZg.d.ts.map +1 -0
  510. package/dist/plot-CdFTbMI_.js +131 -0
  511. package/dist/plot-CdFTbMI_.js.map +1 -0
  512. package/dist/positioner-3mCqiebN.js +204 -0
  513. package/dist/positioner-3mCqiebN.js.map +1 -0
  514. package/dist/tooltip-BarafYiU.d.ts +67 -0
  515. package/dist/tooltip-BarafYiU.d.ts.map +1 -0
  516. package/dist/tooltip-BqxVD6D-.d.ts +64 -0
  517. package/dist/tooltip-BqxVD6D-.d.ts.map +1 -0
  518. package/dist/tooltip-C01qUgsW.d.ts +133 -0
  519. package/dist/tooltip-C01qUgsW.d.ts.map +1 -0
  520. package/dist/tooltip-C6qUs7px.d.ts +36 -0
  521. package/dist/tooltip-C6qUs7px.d.ts.map +1 -0
  522. package/dist/tooltip-DQ4DXgeu.d.ts +94 -0
  523. package/dist/tooltip-DQ4DXgeu.d.ts.map +1 -0
  524. package/dist/types-B_6p3LXz.d.ts +36 -0
  525. package/dist/types-B_6p3LXz.d.ts.map +1 -0
  526. package/dist/types-D6e3gWOA.d.ts +22 -0
  527. package/dist/types-D6e3gWOA.d.ts.map +1 -0
  528. package/dist/use-geometry-CH0foIo7.d.ts +9 -0
  529. package/dist/use-geometry-CH0foIo7.d.ts.map +1 -0
  530. package/dist/utils-B3YXTsDI.js +26 -0
  531. package/dist/utils-B3YXTsDI.js.map +1 -0
  532. package/package.json +14 -9
  533. package/dist/cascader-types-BnH6wYD-.d.ts.map +0 -1
  534. package/dist/lib/ease.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"cascader-lib.js","names":[],"sources":["../../../../src/components/reui/cascader/cascader-lib.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n CascaderCollapse,\n CascaderFlatNode,\n CascaderIndex,\n CascaderNode,\n CascaderPathSegment,\n CascaderSelectable,\n} from \"./cascader-types\";\n\n/** Root level key in `childrenOf`. NUL-prefixed so no real value collides. */\nexport const CASCADER_ROOT_KEY = \"\\u0000root\";\n\n/**\n * Paging pseudo-node prefix. Written as an escape sequence, not a raw 0x00\n * byte: a literal NUL makes this module read as binary and `grep -I` skips it.\n */\nexport const CASCADER_MORE_PREFIX = \"\\u0000more:\";\n\n/* -------------------------------------------------------------------------- */\n/* Scroll layout */\n/* -------------------------------------------------------------------------- */\n\n/**\n * The four scroll classes. In the lib because `cascader-columns.tsx` needs them\n * too and must not import `cascader.tsx`. Shell > bound > scrollport > rows.\n */\n\n/**\n * The bound. `min()` over an undefined custom property is an INVALID\n * declaration that drops the whole max-height, hence the `100vh` fallback: an\n * inline panel has no positioner, so no `--available-height`. `24rem` is the\n * default cap, so the common case sets no variable at all.\n */\nexport const CASCADER_LIST_HEIGHT_CLASS =\n \"max-h-[min(var(--available-height,100vh),var(--cascader-max-height,24rem))]\";\n\n/**\n * Each style's list padding: rows take it as `padding`, the scrollport as\n * `scroll-padding` floored at 4px so lyra's `0` does not strand a row.\n * Mirrored per style from `registry/styles/style-*.css`; keep them in step.\n */\nexport const CASCADER_LIST_PAD_CLASS = \"[--cascader-list-pad:4px]\";\n\n/** The scrollport: a `max-h-*` on the ScrollArea ROOT bounds nothing. */\nexport const CASCADER_SCROLL_CLASS =\n \"size-full min-h-0 **:data-[slot=scroll-area-viewport]:h-full **:data-[slot=scroll-area-viewport]:overscroll-contain **:data-[slot=scroll-area-viewport]:scroll-py-[max(var(--cascader-list-pad,4px),4px)]\";\n\n/** The rows' box; `data-empty:p-0` keeps an empty state from double inset. */\nexport const CASCADER_ROWS_CLASS = \"p-(--cascader-list-pad,4px) data-empty:p-0\";\n\n/* -------------------------------------------------------------------------- */\n/* Tab order */\n/* -------------------------------------------------------------------------- */\n\n/**\n * What counts as a keyboard stop. Base UI's ScrollArea viewport makes ITSELF\n * tabbable when content overflows (`hiddenState.x && hiddenState.y ? -1 : 0`),\n * an unnamed stop per level that `ui/scroll-area.tsx` will not let us suppress.\n */\nconst CASCADER_TAB_STOP_SELECTOR =\n 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])';\n\n/** The stop to step over: nothing here focuses the scrollport on purpose. */\nconst CASCADER_TAB_SKIP_SELECTOR = '[data-slot=\"scroll-area-viewport\"]';\n\n/** Out of the tab order whatever they contain; layout is never consulted. */\nconst CASCADER_TAB_HIDDEN_SELECTOR = \"[hidden],[inert],[aria-hidden='true']\";\n\n/** The panel's real keyboard stops, in DOM order. */\nfunction getCascaderTabStops(panel: HTMLElement): HTMLElement[] {\n const stops = Array.from(panel.querySelectorAll<HTMLElement>(CASCADER_TAB_STOP_SELECTOR));\n return stops.filter(\n (stop) =>\n // Option and trail rows are real `<button>`s with `tabindex=\"-1\"`.\n stop.getAttribute(\"tabindex\") !== \"-1\" &&\n !stop.matches(CASCADER_TAB_SKIP_SELECTOR) &&\n !stop.closest(CASCADER_TAB_HIDDEN_SELECTOR),\n );\n}\n\n/** The footer's own stops; an `aria-disabled` command still counts as one. */\nexport function getCascaderFooterStops(scope: HTMLElement): HTMLElement[] {\n const footer = scope.matches('[data-slot=\"cascader-footer\"]')\n ? scope\n : scope.querySelector<HTMLElement>('[data-slot=\"cascader-footer\"]');\n if (!footer) return [];\n return getCascaderTabStops(footer);\n}\n\n/** Where Tab lands, or `null` to let the browser out: focus is never trapped. */\nexport function getCascaderTabTarget(\n panel: HTMLElement,\n from: Element | null,\n backwards: boolean,\n): HTMLElement | null {\n const stops = getCascaderTabStops(panel);\n if (stops.length === 0 || !from) return null;\n\n const index = stops.indexOf(from as HTMLElement);\n if (index !== -1) return stops[index + (backwards ? -1 : 1)] ?? null;\n\n if (backwards) {\n for (let i = stops.length - 1; i >= 0; i -= 1) {\n const position = from.compareDocumentPosition(stops[i]);\n if (position & Node.DOCUMENT_POSITION_PRECEDING) return stops[i];\n }\n return null;\n }\n\n for (const stop of stops) {\n const position = from.compareDocumentPosition(stop);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) return stop;\n }\n return null;\n}\n\n/**\n * The writing direction at `element`. `DirectionProvider` may only vote yes:\n * unmounted it answers `\"ltr\"`, which would override a real `<html dir=\"rtl\">`.\n */\nexport function isCascaderRtl(element: Element, provided: string): boolean {\n if (provided === \"rtl\") return true;\n const explicit = element.closest(\"[dir]\")?.getAttribute(\"dir\")?.toLowerCase();\n if (explicit === \"rtl\") return true;\n if (explicit === \"ltr\") return false;\n return element.ownerDocument?.defaultView?.getComputedStyle(element).direction === \"rtl\";\n}\n\n/**\n * The paging row as a REAL node, not a DOM-only row after the list: every index\n * Base UI hands out indexes the RENDERED array, so a DOM-only row shifts them.\n */\nexport function createCascaderMoreNode<T = unknown>(\n parentKey: string,\n loadedCount = 0,\n): CascaderNode<T> {\n return {\n value: `${CASCADER_MORE_PREFIX}${parentKey}`,\n // Empty on purpose: a typeahead letter must never reach the paging row.\n label: \"\",\n // Feeds the row's \"Loading more...\" wording, with no second prop to thread.\n count: loadedCount,\n };\n}\n\nexport function isCascaderMoreNode<T>(node: CascaderNode<T>): boolean {\n return node.value.startsWith(CASCADER_MORE_PREFIX);\n}\n\n/** The level key a paging pseudo-node belongs to, or `null` for a real node. */\nexport function getCascaderMoreParent<T>(node: CascaderNode<T>): string | null {\n if (!isCascaderMoreNode(node)) return null;\n return node.value.slice(CASCADER_MORE_PREFIX.length);\n}\n\n/** Either input shape into one index. Cycle-guarded depths; first wins. */\nexport function buildCascaderIndex<T = unknown>(\n items: readonly CascaderNode<T>[] | undefined,\n getParent?: (node: CascaderNode<T>) => string | null | undefined,\n): CascaderIndex<T> {\n const byValue = new Map<string, CascaderNode<T>>();\n const childrenOf = new Map<string, CascaderNode<T>[]>();\n const parentOf = new Map<string, string | null>();\n const depthOf = new Map<string, number>();\n const all: CascaderNode<T>[] = [];\n\n const push = (parentKey: string, node: CascaderNode<T>) => {\n const bucket = childrenOf.get(parentKey);\n if (bucket) {\n bucket.push(node);\n } else {\n childrenOf.set(parentKey, [node]);\n }\n };\n\n if (getParent) {\n for (const node of items ?? []) {\n // A nullish entry is a data bug: skip it like a duplicate, say so in dev.\n if (node == null) {\n if (process.env.NODE_ENV !== \"production\") {\n warnCascaderOnce(\n \"nullish-entry\",\n \"Ignored a null or undefined entry in `items` or `children`. Check the arrays you pass in.\",\n );\n }\n continue;\n }\n if (byValue.has(node.value)) continue;\n byValue.set(node.value, node);\n all.push(node);\n }\n\n for (const node of all) {\n const rawParent = getParent(node);\n // An unknown parent makes the node a root rather than dropping the row.\n const parent = rawParent != null && byValue.has(rawParent) ? rawParent : null;\n parentOf.set(node.value, parent);\n push(parent ?? CASCADER_ROOT_KEY, node);\n }\n\n for (const node of all) {\n let depth = 0;\n let cursor = parentOf.get(node.value) ?? null;\n const seen = new Set<string>([node.value]);\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n depth += 1;\n cursor = parentOf.get(cursor) ?? null;\n }\n depthOf.set(node.value, depth);\n }\n } else {\n const walk = (\n nodes: readonly CascaderNode<T>[] | undefined,\n parent: string | null,\n depth: number,\n ) => {\n for (const node of nodes ?? []) {\n // Same degradation as the flat path above.\n if (node == null) {\n if (process.env.NODE_ENV !== \"production\") {\n warnCascaderOnce(\n \"nullish-entry\",\n \"Ignored a null or undefined entry in `items` or `children`. Check the arrays you pass in.\",\n );\n }\n continue;\n }\n if (byValue.has(node.value)) continue;\n byValue.set(node.value, node);\n parentOf.set(node.value, parent);\n depthOf.set(node.value, depth);\n all.push(node);\n push(parent ?? CASCADER_ROOT_KEY, node);\n if (node.children?.length) walk(node.children, node.value, depth + 1);\n }\n };\n walk(items, null, 0);\n }\n\n return {\n byValue,\n childrenOf,\n parentOf,\n depthOf,\n roots: childrenOf.get(CASCADER_ROOT_KEY) ?? [],\n all,\n };\n}\n\n/**\n * Folds loaded pages into an index built from `items`, so a re-render with a\n * new `items` array keeps what the user drilled into. Static `items` wins;\n * `detached` is `byValue` ONLY, or deep search doubles it and `childrenOf` lies.\n */\nexport function mergeCascaderIndex<T = unknown>(\n base: CascaderIndex<T>,\n pages: ReadonlyMap<string, readonly CascaderNode<T>[]>,\n detached?: ReadonlyMap<string, CascaderNode<T>>,\n): CascaderIndex<T> {\n // Identity stability: every downstream `useMemo` is keyed on this index.\n if (pages.size === 0 && !detached?.size) return base;\n\n const byValue = new Map(base.byValue);\n const childrenOf = new Map(base.childrenOf);\n const parentOf = new Map(base.parentOf);\n const depthOf = new Map(base.depthOf);\n\n // Copy-on-write per bucket: only levels that got a page pay for a new array.\n const copied = new Set<string>();\n const append = (parentKey: string, node: CascaderNode<T>) => {\n let bucket = childrenOf.get(parentKey);\n if (!copied.has(parentKey)) {\n bucket = bucket ? bucket.slice() : [];\n childrenOf.set(parentKey, bucket);\n copied.add(parentKey);\n }\n bucket!.push(node);\n };\n\n const insert = (parentKey: string, nodes: readonly CascaderNode<T>[]) => {\n for (const node of nodes) {\n if (byValue.has(node.value)) continue;\n byValue.set(node.value, node);\n parentOf.set(node.value, parentKey === CASCADER_ROOT_KEY ? null : parentKey);\n append(parentKey, node);\n if (node.children?.length) insert(node.value, node.children);\n }\n };\n\n for (const [parentKey, nodes] of pages) insert(parentKey, nodes);\n\n for (const value of byValue.keys()) {\n if (depthOf.has(value)) continue;\n let depth = 0;\n let cursor = parentOf.get(value) ?? null;\n const seen = new Set<string>([value]);\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n depth += 1;\n cursor = parentOf.get(cursor) ?? null;\n }\n depthOf.set(value, depth);\n }\n\n const roots = childrenOf.get(CASCADER_ROOT_KEY) ?? [];\n\n // Depth first over the MERGED tree, so `all` keeps document order.\n const all: CascaderNode<T>[] = [];\n const visited = new Set<string>();\n const walk = (nodes: readonly CascaderNode<T>[]) => {\n for (const node of nodes) {\n if (visited.has(node.value)) continue;\n visited.add(node.value);\n all.push(node);\n const children = childrenOf.get(node.value);\n if (children?.length) walk(children);\n }\n };\n walk(roots);\n\n // A page whose parent never arrived stays searchable rather than vanishing.\n for (const [value, node] of byValue) {\n if (visited.has(value)) continue;\n visited.add(value);\n all.push(node);\n }\n\n if (detached) {\n for (const [value, node] of detached) {\n if (byValue.has(value)) continue;\n byValue.set(value, node);\n }\n }\n\n return { byValue, childrenOf, parentOf, depthOf, roots, all };\n}\n\n/** Children of `parent`, or the root level when `parent` is nullish. */\nexport function getCascaderChildren<T>(\n index: CascaderIndex<T>,\n parent?: string | null,\n): CascaderNode<T>[] {\n return index.childrenOf.get(parent ?? CASCADER_ROOT_KEY) ?? [];\n}\n\n/** A branch has known children, or `hasChildren` for an unfetched level. */\nexport function isCascaderBranch<T>(index: CascaderIndex<T>, node: CascaderNode<T>): boolean {\n if (node.hasChildren) return true;\n return (index.childrenOf.get(node.value)?.length ?? 0) > 0;\n}\n\n/** Trailing count for the default row. Explicit `count` wins over the tree. */\nexport function getCascaderCount<T>(index: CascaderIndex<T>, node: CascaderNode<T>): number {\n if (typeof node.count === \"number\") return node.count;\n return index.childrenOf.get(node.value)?.length ?? 0;\n}\n\n/** Whether a node may be committed as a selection. */\nexport function isCascaderSelectable<T>(\n index: CascaderIndex<T>,\n node: CascaderNode<T>,\n selectable: CascaderSelectable<T>,\n): boolean {\n // Before the branches a consumer controls: `selectable=\"any\"` says yes to\n // every node, and committing the paging row would select a level's name.\n if (isCascaderMoreNode(node)) return false;\n if (node.disabled) return false;\n // A disabled ANCESTOR refuses the whole subtree: `searchCascaderDeep` still\n // surfaces children of a branch the UI will not let anyone open.\n {\n const seen = new Set<string>([node.value]);\n let cursor = index.parentOf.get(node.value) ?? null;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n if (index.byValue.get(cursor)?.disabled) return false;\n cursor = index.parentOf.get(cursor) ?? null;\n }\n }\n if (typeof selectable === \"function\") return selectable(node);\n if (selectable === \"any\") return true;\n return !isCascaderBranch(index, node);\n}\n\n/** Ancestor chain for `value`, root first. Empty while async data loads. */\nexport function getCascaderPath<T>(\n index: CascaderIndex<T>,\n value: string | null | undefined,\n): CascaderNode<T>[] {\n if (value == null) return [];\n const chain: CascaderNode<T>[] = [];\n const seen = new Set<string>();\n let cursor: string | null | undefined = value;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n const node = index.byValue.get(cursor);\n if (!node) break;\n chain.push(node);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n return chain.reverse();\n}\n\n/**\n * `toLocaleLowerCase`, not `toLowerCase`: the invariant mapping turns Turkish\n * \"I\" into \"i\" not \"ı\", so \"ışık\" would never match \"IŞIK\". Both sides fold here.\n */\nexport function foldCascaderText(text: string): string {\n return text.toLocaleLowerCase();\n}\n\n/** Folds once so callers can hoist the cost out of a per-node loop. */\nexport function normalizeCascaderQuery(query: string): string {\n return foldCascaderText(query.trim());\n}\n\n/** Case-insensitive substring over label and keywords; pre-fold the query. */\nexport function matchesCascaderQuery<T>(node: CascaderNode<T>, normalized: string): boolean {\n if (!normalized) return true;\n // Coerced, not trusted: a label-less node is malformed data, not a crash.\n if (foldCascaderText(node.label ?? \"\").includes(normalized)) return true;\n if (node.keywords) {\n for (const keyword of node.keywords) {\n if (foldCascaderText(keyword).includes(normalized)) return true;\n }\n }\n return false;\n}\n\n/** Filters one level in place-order. Returns the input when the query is empty. */\nexport function filterCascaderLevel<T>(\n nodes: readonly CascaderNode<T>[],\n query: string,\n matches: (node: CascaderNode<T>, normalized: string) => boolean = matchesCascaderQuery,\n): CascaderNode<T>[] {\n const normalized = normalizeCascaderQuery(query);\n if (!normalized) return nodes as CascaderNode<T>[];\n return nodes.filter((node) => matches(node, normalized));\n}\n\n/** Searches every node, optionally under `within`, in one pass over `all`. */\nexport function searchCascaderDeep<T>(\n index: CascaderIndex<T>,\n query: string,\n options: {\n within?: string | null;\n limit?: number;\n matches?: (node: CascaderNode<T>, normalized: string) => boolean;\n } = {},\n): CascaderNode<T>[] {\n const normalized = normalizeCascaderQuery(query);\n if (!normalized) return [];\n\n const { within, limit = 200, matches = matchesCascaderQuery } = options;\n const results: CascaderNode<T>[] = [];\n\n // One memoised ancestry map per query. The provisional `false` written on the\n // way up doubles as the cycle guard; the trail is promoted once `within` hits.\n const ancestry = within == null ? null : new Map<string, boolean>();\n const isWithin = (node: CascaderNode<T>) => {\n if (within == null || !ancestry) return true;\n const trail: string[] = [];\n let answer = false;\n let cursor: string | null | undefined = index.parentOf.get(node.value);\n while (cursor != null) {\n if (cursor === within) {\n answer = true;\n break;\n }\n const cached = ancestry.get(cursor);\n if (cached !== undefined) {\n answer = cached;\n break;\n }\n ancestry.set(cursor, false);\n trail.push(cursor);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n if (answer) for (const value of trail) ancestry.set(value, true);\n return answer;\n };\n\n for (const node of index.all) {\n if (results.length >= limit) break;\n if (!matches(node, normalized)) continue;\n if (!isWithin(node)) continue;\n results.push(node);\n }\n\n return results;\n}\n\n/**\n * Flattens the tree into tree mode's visible rows. A `sentinels` paging row\n * COUNTS as a sibling in `aria-setsize`: it holds an index of its own.\n */\nexport function flattenCascaderTree<T>(\n index: CascaderIndex<T>,\n expanded: ReadonlySet<string>,\n sentinels?: ReadonlySet<string>,\n): CascaderFlatNode<T>[] {\n const rows: CascaderFlatNode<T>[] = [];\n\n const walk = (nodes: readonly CascaderNode<T>[], parentKey: string, depth: number) => {\n const sentinel = sentinels?.has(parentKey) ?? false;\n const setSize = nodes.length + (sentinel ? 1 : 0);\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n const branch = isCascaderBranch(index, node);\n const isExpanded = branch && expanded.has(node.value);\n rows.push({\n node,\n depth,\n branch,\n expanded: isExpanded,\n setSize,\n posInSet: i + 1,\n });\n if (isExpanded) {\n walk(index.childrenOf.get(node.value) ?? [], node.value, depth + 1);\n }\n }\n if (sentinel) {\n rows.push({\n node: createCascaderMoreNode<T>(parentKey, nodes.length),\n depth,\n branch: false,\n expanded: false,\n setSize,\n posInSet: setSize,\n });\n }\n };\n\n walk(index.roots, CASCADER_ROOT_KEY, 0);\n return rows;\n}\n\n/** Shortens a path; the ellipsis segment still carries the hidden nodes. */\nexport function collapseCascaderPath<T>(\n path: readonly CascaderNode<T>[],\n options: { maxSegments?: number; collapse?: CascaderCollapse } = {},\n): CascaderPathSegment<T>[] {\n const { maxSegments = 3, collapse = \"middle\" } = options;\n\n const asNodes = (nodes: readonly CascaderNode<T>[]): CascaderPathSegment<T>[] =>\n nodes.map((node) => ({ type: \"node\" as const, node }));\n\n if (collapse === \"none\" || maxSegments <= 0 || path.length <= maxSegments) {\n return asNodes(path);\n }\n\n if (collapse === \"start\") {\n const tail = path.slice(path.length - maxSegments);\n return [\n { type: \"ellipsis\", hidden: path.slice(0, path.length - maxSegments) },\n ...asNodes(tail),\n ];\n }\n\n // \"middle\": keep the root for orientation and as much of the tail as fits.\n const head = path.slice(0, 1);\n const tailCount = maxSegments - 1;\n const tail = path.slice(path.length - tailCount);\n const hidden = path.slice(1, path.length - tailCount);\n\n if (hidden.length === 0) return asNodes(path);\n\n return [...asNodes(head), { type: \"ellipsis\", hidden }, ...asNodes(tail)];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Cascade selection */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Every LOADED node under `value`, root first. Reaching an unfetched descendant\n * would mean a network request per level of the subtree on every selection.\n */\nexport function collectCascaderSubtree<T>(\n index: CascaderIndex<T>,\n value: string,\n): CascaderNode<T>[] {\n const root = index.byValue.get(value);\n if (!root) return [];\n\n const out: CascaderNode<T>[] = [];\n const seen = new Set<string>();\n const walk = (node: CascaderNode<T>) => {\n if (seen.has(node.value)) return;\n seen.add(node.value);\n out.push(node);\n const children = index.childrenOf.get(node.value);\n if (children) for (const child of children) walk(child);\n };\n walk(root);\n return out;\n}\n\n/**\n * Toggles `value` with its loaded subtree, then reconciles ancestors. One flat\n * array, no hidden \"checked\" state: a branch is in the selection exactly when\n * every selectable loaded child of it is, which keeps a row's checked state an\n * O(1) lookup. Nodes `isSelectable` rejects are skipped down AND ignored up,\n * the pressed node excepted.\n */\nexport function applyCascadeSelection<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n value: string,\n select: boolean,\n isSelectable: (node: CascaderNode<T>) => boolean = () => true,\n): string[] {\n const next = new Set(selected);\n const subtree = collectCascaderSubtree(index, value);\n\n // An unknown value still toggles itself, so an early async selection lands.\n if (subtree.length === 0) {\n if (select) next.add(value);\n else next.delete(value);\n }\n\n for (const node of subtree) {\n // The pressed node is exempt: it was committed, so it is selectable.\n if (node.value !== value && !isSelectable(node)) continue;\n if (select) next.add(node.value);\n else next.delete(node.value);\n }\n\n // Bottom up: a parent can only answer once its children have.\n const seen = new Set<string>([value]);\n let cursor = index.parentOf.get(value) ?? null;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n const parent = index.byValue.get(cursor);\n const children = index.childrenOf.get(cursor) ?? [];\n const selectable = children.filter((child) => isSelectable(child));\n const full =\n selectable.length > 0 &&\n selectable.every((child) => next.has(child.value)) &&\n // Never promote a node the consumer said may not be committed. Under\n // `selectable=\"leaf\"` no branch qualifies, hence the `cascade` warning.\n !!parent &&\n isSelectable(parent);\n if (full) next.add(cursor);\n else next.delete(cursor);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n\n return Array.from(next);\n}\n\n/**\n * How many selected nodes each value has BELOW it, itself excluded. Walks UP\n * from each selection: a per-row subtree scan would be quadratic and re-paid.\n */\nexport function getCascaderSelectedDescendants<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n): Map<string, number> {\n const counts = new Map<string, number>();\n\n for (const value of selected) {\n const seen = new Set<string>([value]);\n let cursor = index.parentOf.get(value) ?? null;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n counts.set(cursor, (counts.get(cursor) ?? 0) + 1);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n }\n\n return counts;\n}\n\n/** The PARTIALLY selected values, read off counts the caller already holds. */\nexport function getCascaderIndeterminateFrom(\n counts: ReadonlyMap<string, number>,\n selected: readonly string[],\n): Set<string> {\n const selectedSet = new Set(selected);\n const partial = new Set<string>();\n\n for (const [value, count] of counts) {\n if (count > 0 && !selectedSet.has(value)) partial.add(value);\n }\n\n return partial;\n}\n\n/** The one-call form; the root uses the two halves above and its own counts. */\nexport function getCascaderIndeterminate<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n): Set<string> {\n return getCascaderIndeterminateFrom(getCascaderSelectedDescendants(index, selected), selected);\n}\n\n/** How `getCascaderCheckedValues` condenses a full-closure selection. */\nexport type CascaderCheckedStrategy = \"all\" | \"parent\" | \"child\";\n\n/**\n * The cascade selection under a reporting strategy. DERIVED OUTPUT ONLY: the\n * STORED value stays the full closure, which keeps a checked state an O(1)\n * lookup. `\"all\"` is the closure; `\"parent\"` drops a value whose parent is\n * selected; `\"child\"` drops one with a selected child.\n */\nexport function getCascaderCheckedValues<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n strategy: CascaderCheckedStrategy,\n): readonly string[] {\n if (strategy === \"all\") return selected;\n\n const set = new Set(selected);\n if (strategy === \"parent\") {\n return selected.filter((value) => {\n const parent = index.parentOf.get(value);\n return parent == null || !set.has(parent);\n });\n }\n\n return selected.filter((value) => {\n const children = index.childrenOf.get(value);\n if (!children?.length) return true;\n return !children.some((child) => set.has(child.value));\n });\n}\n\n/** Values in `nodes` whose label collides, so the chip must show its path. */\nexport function findAmbiguousCascaderLabels<T>(nodes: readonly CascaderNode<T>[]): Set<string> {\n const firstByLabel = new Map<string, string>();\n const ambiguous = new Set<string>();\n\n for (const node of nodes) {\n const first = firstByLabel.get(node.label);\n if (first === undefined) {\n firstByLabel.set(node.label, node.value);\n continue;\n }\n ambiguous.add(node.value);\n ambiguous.add(first);\n }\n\n return ambiguous;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Development only */\n/* -------------------------------------------------------------------------- */\n\n/** Warnings already emitted. Module scoped, or they repeat once per render. */\nconst CASCADER_WARNED = new Set<string>();\n\n/** Warns once per `key`, never in production, never by throwing. */\nexport function warnCascaderOnce(key: string, message: string): void {\n if (process.env.NODE_ENV === \"production\") return;\n if (CASCADER_WARNED.has(key)) return;\n CASCADER_WARNED.add(key);\n console.warn(`[Cascader] ${message}`);\n}\n\n/** Empties the ledger. Tests only; a warning is meant to be seen once. */\nexport function resetCascaderWarnings(): void {\n CASCADER_WARNED.clear();\n}\n\n/** What a dev-time scan of the consumer's `items` found wrong with it. */\nexport interface CascaderDataIssues {\n /** Values appearing more than once. First wins, so a duplicate drops a row. */\n duplicates: string[];\n /** Values on a `getParent` cycle. Depth is clamped, so the tree reads wrong. */\n cycles: string[];\n}\n\n/** Dev-time scan, kept out of `buildCascaderIndex` so the build stays hot. */\nexport function findCascaderDataIssues<T>(\n items: readonly CascaderNode<T>[] | undefined,\n getParent?: (node: CascaderNode<T>) => string | null | undefined,\n): CascaderDataIssues {\n const seen = new Set<string>();\n const duplicates = new Set<string>();\n const flat: CascaderNode<T>[] = [];\n\n const visit = (nodes: readonly CascaderNode<T>[] | undefined) => {\n for (const node of nodes ?? []) {\n // The build skips a nullish entry, and this runs BEFORE its warning.\n if (node == null) continue;\n if (seen.has(node.value)) duplicates.add(node.value);\n else seen.add(node.value);\n flat.push(node);\n // Flat mode walks them too: BOTH `children` and `getParent` is a bug.\n if (node.children?.length) visit(node.children);\n }\n };\n visit(items);\n\n const cycles: string[] = [];\n if (getParent) {\n const parentOf = new Map<string, string | null>();\n for (const node of flat) {\n if (parentOf.has(node.value)) continue;\n const raw = getParent(node);\n parentOf.set(node.value, raw != null && seen.has(raw) ? raw : null);\n }\n for (const node of flat) {\n const walked = new Set<string>([node.value]);\n let cursor = parentOf.get(node.value) ?? null;\n while (cursor != null) {\n if (walked.has(cursor)) {\n cycles.push(node.value);\n break;\n }\n walked.add(cursor);\n cursor = parentOf.get(cursor) ?? null;\n }\n }\n }\n\n return { duplicates: Array.from(duplicates), cycles };\n}\n"],"mappings":";;;AAYA,MAAa,oBAAoB;;;;;AAMjC,MAAa,uBAAuB;;;;;;;;;;;AAiBpC,MAAa,6BACX;;;;;;AAOF,MAAa,0BAA0B;;AAGvC,MAAa,wBACX;;AAGF,MAAa,sBAAsB;;;;;;AAWnC,MAAM,6BACJ;;AAGF,MAAM,6BAA6B;;AAGnC,MAAM,+BAA+B;;AAGrC,SAAS,oBAAoB,OAAmC;CAE9D,OADc,MAAM,KAAK,MAAM,iBAA8B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IACF;IACA,OAAO,IAAI,MAAM;IACjB,SAAS,SAAS,IAAI,MAAM,KAAK;GACnC;EACF;CACF;CAEA,OAAO;EAAE,YAAY,MAAM,KAAK,UAAU;EAAG;CAAO;AACtD"}
1
+ {"version":3,"file":"cascader-lib.js","names":[],"sources":["../../../../src/components/reui/cascader/cascader-lib.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n CascaderCollapse,\n CascaderFlatNode,\n CascaderIndex,\n CascaderNode,\n CascaderPathSegment,\n CascaderSelectable,\n} from \"./cascader-types\";\n\n/** Root level key in `childrenOf`. NUL-prefixed so no real value collides. */\nexport const CASCADER_ROOT_KEY = \"\\u0000root\";\n\n/**\n * Paging pseudo-node prefix. Written as an escape sequence, not a raw 0x00\n * byte: a literal NUL makes this module read as binary and `grep -I` skips it.\n */\nexport const CASCADER_MORE_PREFIX = \"\\u0000more:\";\n\n/* -------------------------------------------------------------------------- */\n/* Scroll layout */\n/* -------------------------------------------------------------------------- */\n\n/**\n * The four scroll classes. In the lib because `cascader-columns.tsx` needs them\n * too and must not import `cascader.tsx`. Shell > bound > scrollport > rows.\n */\n\n/**\n * The bound. `min()` over an undefined custom property is an INVALID\n * declaration that drops the whole max-height, hence the `100vh` fallback: an\n * inline panel has no positioner, so no `--available-height`. `24rem` is the\n * default cap, so the common case sets no variable at all.\n */\nexport const CASCADER_LIST_HEIGHT_CLASS =\n \"max-h-[min(var(--available-height,100vh),var(--cascader-max-height,24rem))]\";\n\n/**\n * Each style's list padding: rows take it as `padding`, the scrollport as\n * `scroll-padding` floored at 4px so lyra's `0` does not strand a row.\n * Mirrored per style from `registry/styles/style-*.css`; keep them in step.\n */\nexport const CASCADER_LIST_PAD_CLASS = \"[--cascader-list-pad:4px]\";\n\n/** The scrollport: a `max-h-*` on the ScrollArea ROOT bounds nothing. */\nexport const CASCADER_SCROLL_CLASS =\n \"size-full min-h-0 **:data-[slot=scroll-area-viewport]:h-full **:data-[slot=scroll-area-viewport]:overscroll-contain **:data-[slot=scroll-area-viewport]:scroll-py-[max(var(--cascader-list-pad,4px),4px)]\";\n\n/** The rows' box; `data-empty:p-0` keeps an empty state from double inset. */\nexport const CASCADER_ROWS_CLASS = \"p-(--cascader-list-pad,4px) data-empty:p-0\";\n\n/* -------------------------------------------------------------------------- */\n/* Tab order */\n/* -------------------------------------------------------------------------- */\n\n/**\n * What counts as a keyboard stop. Base UI's ScrollArea viewport makes ITSELF\n * tabbable when content overflows (`hiddenState.x && hiddenState.y ? -1 : 0`),\n * an unnamed stop per level that `ui/scroll-area.tsx` will not let us suppress.\n */\nconst CASCADER_TAB_STOP_SELECTOR =\n 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])';\n\n/** The stop to step over: nothing here focuses the scrollport on purpose. */\nconst CASCADER_TAB_SKIP_SELECTOR = '[data-slot=\"scroll-area-viewport\"]';\n\n/** Out of the tab order whatever they contain; layout is never consulted. */\nconst CASCADER_TAB_HIDDEN_SELECTOR = \"[hidden],[inert],[aria-hidden='true']\";\n\n/** The panel's real keyboard stops, in DOM order. */\nfunction getCascaderTabStops(panel: HTMLElement): HTMLElement[] {\n const stops = Array.from(panel.querySelectorAll<HTMLElement>(CASCADER_TAB_STOP_SELECTOR));\n return stops.filter(\n (stop) =>\n // Option and trail rows are real `<button>`s with `tabindex=\"-1\"`.\n stop.getAttribute(\"tabindex\") !== \"-1\" &&\n !stop.matches(CASCADER_TAB_SKIP_SELECTOR) &&\n !stop.closest(CASCADER_TAB_HIDDEN_SELECTOR),\n );\n}\n\n/** The footer's own stops; an `aria-disabled` command still counts as one. */\nexport function getCascaderFooterStops(scope: HTMLElement): HTMLElement[] {\n const footer = scope.matches('[data-slot=\"cascader-footer\"]')\n ? scope\n : scope.querySelector<HTMLElement>('[data-slot=\"cascader-footer\"]');\n if (!footer) return [];\n return getCascaderTabStops(footer);\n}\n\n/** Where Tab lands, or `null` to let the browser out: focus is never trapped. */\nexport function getCascaderTabTarget(\n panel: HTMLElement,\n from: Element | null,\n backwards: boolean,\n): HTMLElement | null {\n const stops = getCascaderTabStops(panel);\n if (stops.length === 0 || !from) return null;\n\n const index = stops.indexOf(from as HTMLElement);\n if (index !== -1) return stops[index + (backwards ? -1 : 1)] ?? null;\n\n if (backwards) {\n for (let i = stops.length - 1; i >= 0; i -= 1) {\n const position = from.compareDocumentPosition(stops[i]);\n if (position & Node.DOCUMENT_POSITION_PRECEDING) return stops[i];\n }\n return null;\n }\n\n for (const stop of stops) {\n const position = from.compareDocumentPosition(stop);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) return stop;\n }\n return null;\n}\n\n/**\n * The writing direction at `element`. `DirectionProvider` may only vote yes:\n * unmounted it answers `\"ltr\"`, which would override a real `<html dir=\"rtl\">`.\n */\nexport function isCascaderRtl(element: Element, provided: string): boolean {\n if (provided === \"rtl\") return true;\n const explicit = element.closest(\"[dir]\")?.getAttribute(\"dir\")?.toLowerCase();\n if (explicit === \"rtl\") return true;\n if (explicit === \"ltr\") return false;\n return element.ownerDocument?.defaultView?.getComputedStyle(element).direction === \"rtl\";\n}\n\n/**\n * The paging row as a REAL node, not a DOM-only row after the list: every index\n * Base UI hands out indexes the RENDERED array, so a DOM-only row shifts them.\n */\nexport function createCascaderMoreNode<T = unknown>(\n parentKey: string,\n loadedCount = 0,\n): CascaderNode<T> {\n return {\n value: `${CASCADER_MORE_PREFIX}${parentKey}`,\n // Empty on purpose: a typeahead letter must never reach the paging row.\n label: \"\",\n // Feeds the row's \"Loading more...\" wording, with no second prop to thread.\n count: loadedCount,\n };\n}\n\nexport function isCascaderMoreNode<T>(node: CascaderNode<T>): boolean {\n return node.value.startsWith(CASCADER_MORE_PREFIX);\n}\n\n/** The level key a paging pseudo-node belongs to, or `null` for a real node. */\nexport function getCascaderMoreParent<T>(node: CascaderNode<T>): string | null {\n if (!isCascaderMoreNode(node)) return null;\n return node.value.slice(CASCADER_MORE_PREFIX.length);\n}\n\n/** Either input shape into one index. Cycle-guarded depths; first wins. */\nexport function buildCascaderIndex<T = unknown>(\n items: readonly CascaderNode<T>[] | undefined,\n getParent?: (node: CascaderNode<T>) => string | null | undefined,\n): CascaderIndex<T> {\n const byValue = new Map<string, CascaderNode<T>>();\n const childrenOf = new Map<string, CascaderNode<T>[]>();\n const parentOf = new Map<string, string | null>();\n const depthOf = new Map<string, number>();\n const all: CascaderNode<T>[] = [];\n\n const push = (parentKey: string, node: CascaderNode<T>) => {\n const bucket = childrenOf.get(parentKey);\n if (bucket) {\n bucket.push(node);\n } else {\n childrenOf.set(parentKey, [node]);\n }\n };\n\n if (getParent) {\n for (const node of items ?? []) {\n // A nullish entry is a data bug: skip it like a duplicate, say so in dev.\n if (node == null) {\n if (process.env.NODE_ENV !== \"production\") {\n warnCascaderOnce(\n \"nullish-entry\",\n \"Ignored a null or undefined entry in `items` or `children`. Check the arrays you pass in.\",\n );\n }\n continue;\n }\n if (byValue.has(node.value)) continue;\n byValue.set(node.value, node);\n all.push(node);\n }\n\n for (const node of all) {\n const rawParent = getParent(node);\n // An unknown parent makes the node a root rather than dropping the row.\n const parent = rawParent != null && byValue.has(rawParent) ? rawParent : null;\n parentOf.set(node.value, parent);\n push(parent ?? CASCADER_ROOT_KEY, node);\n }\n\n for (const node of all) {\n let depth = 0;\n let cursor = parentOf.get(node.value) ?? null;\n const seen = new Set<string>([node.value]);\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n depth += 1;\n cursor = parentOf.get(cursor) ?? null;\n }\n depthOf.set(node.value, depth);\n }\n } else {\n const walk = (\n nodes: readonly CascaderNode<T>[] | undefined,\n parent: string | null,\n depth: number,\n ) => {\n for (const node of nodes ?? []) {\n // Same degradation as the flat path above.\n if (node == null) {\n if (process.env.NODE_ENV !== \"production\") {\n warnCascaderOnce(\n \"nullish-entry\",\n \"Ignored a null or undefined entry in `items` or `children`. Check the arrays you pass in.\",\n );\n }\n continue;\n }\n if (byValue.has(node.value)) continue;\n byValue.set(node.value, node);\n parentOf.set(node.value, parent);\n depthOf.set(node.value, depth);\n all.push(node);\n push(parent ?? CASCADER_ROOT_KEY, node);\n if (node.children?.length) walk(node.children, node.value, depth + 1);\n }\n };\n walk(items, null, 0);\n }\n\n return {\n byValue,\n childrenOf,\n parentOf,\n depthOf,\n roots: childrenOf.get(CASCADER_ROOT_KEY) ?? [],\n all,\n };\n}\n\n/**\n * Folds loaded pages into an index built from `items`, so a re-render with a\n * new `items` array keeps what the user drilled into. Static `items` wins;\n * `detached` is `byValue` ONLY, or deep search doubles it and `childrenOf` lies.\n */\nexport function mergeCascaderIndex<T = unknown>(\n base: CascaderIndex<T>,\n pages: ReadonlyMap<string, readonly CascaderNode<T>[]>,\n detached?: ReadonlyMap<string, CascaderNode<T>>,\n): CascaderIndex<T> {\n // Identity stability: every downstream `useMemo` is keyed on this index.\n if (pages.size === 0 && !detached?.size) return base;\n\n const byValue = new Map(base.byValue);\n const childrenOf = new Map(base.childrenOf);\n const parentOf = new Map(base.parentOf);\n const depthOf = new Map(base.depthOf);\n\n // Copy-on-write per bucket: only levels that got a page pay for a new array.\n const copied = new Set<string>();\n const append = (parentKey: string, node: CascaderNode<T>) => {\n let bucket = childrenOf.get(parentKey);\n if (!copied.has(parentKey)) {\n bucket = bucket ? bucket.slice() : [];\n childrenOf.set(parentKey, bucket);\n copied.add(parentKey);\n }\n bucket!.push(node);\n };\n\n const insert = (parentKey: string, nodes: readonly CascaderNode<T>[]) => {\n for (const node of nodes) {\n if (byValue.has(node.value)) continue;\n byValue.set(node.value, node);\n parentOf.set(node.value, parentKey === CASCADER_ROOT_KEY ? null : parentKey);\n append(parentKey, node);\n if (node.children?.length) insert(node.value, node.children);\n }\n };\n\n for (const [parentKey, nodes] of pages) insert(parentKey, nodes);\n\n for (const value of byValue.keys()) {\n if (depthOf.has(value)) continue;\n let depth = 0;\n let cursor = parentOf.get(value) ?? null;\n const seen = new Set<string>([value]);\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n depth += 1;\n cursor = parentOf.get(cursor) ?? null;\n }\n depthOf.set(value, depth);\n }\n\n const roots = childrenOf.get(CASCADER_ROOT_KEY) ?? [];\n\n // Depth first over the MERGED tree, so `all` keeps document order.\n const all: CascaderNode<T>[] = [];\n const visited = new Set<string>();\n const walk = (nodes: readonly CascaderNode<T>[]) => {\n for (const node of nodes) {\n if (visited.has(node.value)) continue;\n visited.add(node.value);\n all.push(node);\n const children = childrenOf.get(node.value);\n if (children?.length) walk(children);\n }\n };\n walk(roots);\n\n // A page whose parent never arrived stays searchable rather than vanishing.\n for (const [value, node] of byValue) {\n if (visited.has(value)) continue;\n visited.add(value);\n all.push(node);\n }\n\n if (detached) {\n for (const [value, node] of detached) {\n if (byValue.has(value)) continue;\n byValue.set(value, node);\n }\n }\n\n return { byValue, childrenOf, parentOf, depthOf, roots, all };\n}\n\n/** Children of `parent`, or the root level when `parent` is nullish. */\nexport function getCascaderChildren<T>(\n index: CascaderIndex<T>,\n parent?: string | null,\n): CascaderNode<T>[] {\n return index.childrenOf.get(parent ?? CASCADER_ROOT_KEY) ?? [];\n}\n\n/** A branch has known children, or `hasChildren` for an unfetched level. */\nexport function isCascaderBranch<T>(index: CascaderIndex<T>, node: CascaderNode<T>): boolean {\n if (node.hasChildren) return true;\n return (index.childrenOf.get(node.value)?.length ?? 0) > 0;\n}\n\n/** Trailing count for the default row. Explicit `count` wins over the tree. */\nexport function getCascaderCount<T>(index: CascaderIndex<T>, node: CascaderNode<T>): number {\n if (typeof node.count === \"number\") return node.count;\n return index.childrenOf.get(node.value)?.length ?? 0;\n}\n\n/**\n * Whether a node is disabled: its own flag, or any ancestor's, since a disabled\n * branch keeps its whole subtree shut. The index's copy counts as its own, so a\n * server hit that omits the flag `items` sets is still caught. Ancestry is\n * `parentOf`: a detached hit the index has never placed answers for itself.\n */\nexport function isCascaderDisabled<T>(index: CascaderIndex<T>, node: CascaderNode<T>): boolean {\n if (node.disabled || index.byValue.get(node.value)?.disabled) return true;\n const seen = new Set<string>([node.value]);\n let cursor = index.parentOf.get(node.value) ?? null;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n if (index.byValue.get(cursor)?.disabled) return true;\n cursor = index.parentOf.get(cursor) ?? null;\n }\n return false;\n}\n\n/** Whether a node may be committed as a selection. */\nexport function isCascaderSelectable<T>(\n index: CascaderIndex<T>,\n node: CascaderNode<T>,\n selectable: CascaderSelectable<T>,\n): boolean {\n // Before the branches a consumer controls: `selectable=\"any\"` says yes to\n // every node, and committing the paging row would select a level's name.\n if (isCascaderMoreNode(node)) return false;\n // Rows render this answer and their presses, keys, `commit`, `navigate` and\n // `navigateAt` check it, so a search lists a disabled subtree none of them\n // opens. The raw setters (`pushLevel`, `setPath`, `toggleExpanded`,\n // `setSelection`) do not ask.\n if (isCascaderDisabled(index, node)) return false;\n if (typeof selectable === \"function\") return selectable(node);\n if (selectable === \"any\") return true;\n return !isCascaderBranch(index, node);\n}\n\n/** Ancestor chain for `value`, root first. Empty while async data loads. */\nexport function getCascaderPath<T>(\n index: CascaderIndex<T>,\n value: string | null | undefined,\n): CascaderNode<T>[] {\n if (value == null) return [];\n const chain: CascaderNode<T>[] = [];\n const seen = new Set<string>();\n let cursor: string | null | undefined = value;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n const node = index.byValue.get(cursor);\n if (!node) break;\n chain.push(node);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n return chain.reverse();\n}\n\n/**\n * `toLocaleLowerCase`, not `toLowerCase`: the invariant mapping turns Turkish\n * \"I\" into \"i\" not \"ı\", so \"ışık\" would never match \"IŞIK\". Both sides fold here.\n */\nexport function foldCascaderText(text: string): string {\n return text.toLocaleLowerCase();\n}\n\n/** Folds once so callers can hoist the cost out of a per-node loop. */\nexport function normalizeCascaderQuery(query: string): string {\n return foldCascaderText(query.trim());\n}\n\n/** Case-insensitive substring over label and keywords; pre-fold the query. */\nexport function matchesCascaderQuery<T>(node: CascaderNode<T>, normalized: string): boolean {\n if (!normalized) return true;\n // Coerced, not trusted: a label-less node is malformed data, not a crash.\n if (foldCascaderText(node.label ?? \"\").includes(normalized)) return true;\n if (node.keywords) {\n for (const keyword of node.keywords) {\n if (foldCascaderText(keyword).includes(normalized)) return true;\n }\n }\n return false;\n}\n\n/** Filters one level in place-order. Returns the input when the query is empty. */\nexport function filterCascaderLevel<T>(\n nodes: readonly CascaderNode<T>[],\n query: string,\n matches: (node: CascaderNode<T>, normalized: string) => boolean = matchesCascaderQuery,\n): CascaderNode<T>[] {\n const normalized = normalizeCascaderQuery(query);\n if (!normalized) return nodes as CascaderNode<T>[];\n return nodes.filter((node) => matches(node, normalized));\n}\n\n/** Searches every node, optionally under `within`, in one pass over `all`. */\nexport function searchCascaderDeep<T>(\n index: CascaderIndex<T>,\n query: string,\n options: {\n within?: string | null;\n limit?: number;\n matches?: (node: CascaderNode<T>, normalized: string) => boolean;\n } = {},\n): CascaderNode<T>[] {\n const normalized = normalizeCascaderQuery(query);\n if (!normalized) return [];\n\n const { within, limit = 200, matches = matchesCascaderQuery } = options;\n const results: CascaderNode<T>[] = [];\n\n // One memoised ancestry map per query. The provisional `false` written on the\n // way up doubles as the cycle guard; the trail is promoted once `within` hits.\n const ancestry = within == null ? null : new Map<string, boolean>();\n const isWithin = (node: CascaderNode<T>) => {\n if (within == null || !ancestry) return true;\n const trail: string[] = [];\n let answer = false;\n let cursor: string | null | undefined = index.parentOf.get(node.value);\n while (cursor != null) {\n if (cursor === within) {\n answer = true;\n break;\n }\n const cached = ancestry.get(cursor);\n if (cached !== undefined) {\n answer = cached;\n break;\n }\n ancestry.set(cursor, false);\n trail.push(cursor);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n if (answer) for (const value of trail) ancestry.set(value, true);\n return answer;\n };\n\n for (const node of index.all) {\n if (results.length >= limit) break;\n if (!matches(node, normalized)) continue;\n if (!isWithin(node)) continue;\n results.push(node);\n }\n\n return results;\n}\n\n/**\n * Flattens the tree into tree mode's visible rows. A `sentinels` paging row\n * COUNTS as a sibling in `aria-setsize`: it holds an index of its own.\n */\nexport function flattenCascaderTree<T>(\n index: CascaderIndex<T>,\n expanded: ReadonlySet<string>,\n sentinels?: ReadonlySet<string>,\n): CascaderFlatNode<T>[] {\n const rows: CascaderFlatNode<T>[] = [];\n\n const walk = (nodes: readonly CascaderNode<T>[], parentKey: string, depth: number) => {\n const sentinel = sentinels?.has(parentKey) ?? false;\n const setSize = nodes.length + (sentinel ? 1 : 0);\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n const branch = isCascaderBranch(index, node);\n const isExpanded = branch && expanded.has(node.value);\n rows.push({\n node,\n depth,\n branch,\n expanded: isExpanded,\n setSize,\n posInSet: i + 1,\n });\n if (isExpanded) {\n walk(index.childrenOf.get(node.value) ?? [], node.value, depth + 1);\n }\n }\n if (sentinel) {\n rows.push({\n node: createCascaderMoreNode<T>(parentKey, nodes.length),\n depth,\n branch: false,\n expanded: false,\n setSize,\n posInSet: setSize,\n });\n }\n };\n\n walk(index.roots, CASCADER_ROOT_KEY, 0);\n return rows;\n}\n\n/** Shortens a path; the ellipsis segment still carries the hidden nodes. */\nexport function collapseCascaderPath<T>(\n path: readonly CascaderNode<T>[],\n options: { maxSegments?: number; collapse?: CascaderCollapse } = {},\n): CascaderPathSegment<T>[] {\n const { maxSegments = 3, collapse = \"middle\" } = options;\n\n const asNodes = (nodes: readonly CascaderNode<T>[]): CascaderPathSegment<T>[] =>\n nodes.map((node) => ({ type: \"node\" as const, node }));\n\n if (collapse === \"none\" || maxSegments <= 0 || path.length <= maxSegments) {\n return asNodes(path);\n }\n\n if (collapse === \"start\") {\n const tail = path.slice(path.length - maxSegments);\n return [\n { type: \"ellipsis\", hidden: path.slice(0, path.length - maxSegments) },\n ...asNodes(tail),\n ];\n }\n\n // \"middle\": keep the root for orientation and as much of the tail as fits.\n const head = path.slice(0, 1);\n const tailCount = maxSegments - 1;\n const tail = path.slice(path.length - tailCount);\n const hidden = path.slice(1, path.length - tailCount);\n\n if (hidden.length === 0) return asNodes(path);\n\n return [...asNodes(head), { type: \"ellipsis\", hidden }, ...asNodes(tail)];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Cascade selection */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Every LOADED node under `value`, root first. Reaching an unfetched descendant\n * would mean a network request per level of the subtree on every selection.\n */\nexport function collectCascaderSubtree<T>(\n index: CascaderIndex<T>,\n value: string,\n): CascaderNode<T>[] {\n const root = index.byValue.get(value);\n if (!root) return [];\n\n const out: CascaderNode<T>[] = [];\n const seen = new Set<string>();\n const walk = (node: CascaderNode<T>) => {\n if (seen.has(node.value)) return;\n seen.add(node.value);\n out.push(node);\n const children = index.childrenOf.get(node.value);\n if (children) for (const child of children) walk(child);\n };\n walk(root);\n return out;\n}\n\n/**\n * Toggles `value` with its loaded subtree, then reconciles ancestors. One flat\n * array, no hidden \"checked\" state: a branch is in the selection exactly when\n * every selectable loaded child of it is, which keeps a row's checked state an\n * O(1) lookup. Nodes `isSelectable` rejects are skipped down AND ignored up,\n * the pressed node excepted.\n */\nexport function applyCascadeSelection<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n value: string,\n select: boolean,\n isSelectable: (node: CascaderNode<T>) => boolean = () => true,\n): string[] {\n const next = new Set(selected);\n const subtree = collectCascaderSubtree(index, value);\n\n // An unknown value still toggles itself, so an early async selection lands.\n if (subtree.length === 0) {\n if (select) next.add(value);\n else next.delete(value);\n }\n\n for (const node of subtree) {\n // The pressed node is exempt: it was committed, so it is selectable.\n if (node.value !== value && !isSelectable(node)) continue;\n if (select) next.add(node.value);\n else next.delete(node.value);\n }\n\n // Bottom up: a parent can only answer once its children have.\n const seen = new Set<string>([value]);\n let cursor = index.parentOf.get(value) ?? null;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n const parent = index.byValue.get(cursor);\n const children = index.childrenOf.get(cursor) ?? [];\n const selectable = children.filter((child) => isSelectable(child));\n const full =\n selectable.length > 0 &&\n selectable.every((child) => next.has(child.value)) &&\n // Never promote a node the consumer said may not be committed. Under\n // `selectable=\"leaf\"` no branch qualifies, hence the `cascade` warning.\n !!parent &&\n isSelectable(parent);\n if (full) next.add(cursor);\n else next.delete(cursor);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n\n return Array.from(next);\n}\n\n/**\n * How many selected nodes each value has BELOW it, itself excluded. Walks UP\n * from each selection: a per-row subtree scan would be quadratic and re-paid.\n */\nexport function getCascaderSelectedDescendants<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n): Map<string, number> {\n const counts = new Map<string, number>();\n\n for (const value of selected) {\n const seen = new Set<string>([value]);\n let cursor = index.parentOf.get(value) ?? null;\n while (cursor != null && !seen.has(cursor)) {\n seen.add(cursor);\n counts.set(cursor, (counts.get(cursor) ?? 0) + 1);\n cursor = index.parentOf.get(cursor) ?? null;\n }\n }\n\n return counts;\n}\n\n/** The PARTIALLY selected values, read off counts the caller already holds. */\nexport function getCascaderIndeterminateFrom(\n counts: ReadonlyMap<string, number>,\n selected: readonly string[],\n): Set<string> {\n const selectedSet = new Set(selected);\n const partial = new Set<string>();\n\n for (const [value, count] of counts) {\n if (count > 0 && !selectedSet.has(value)) partial.add(value);\n }\n\n return partial;\n}\n\n/** The one-call form; the root uses the two halves above and its own counts. */\nexport function getCascaderIndeterminate<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n): Set<string> {\n return getCascaderIndeterminateFrom(getCascaderSelectedDescendants(index, selected), selected);\n}\n\n/** How `getCascaderCheckedValues` condenses a full-closure selection. */\nexport type CascaderCheckedStrategy = \"all\" | \"parent\" | \"child\";\n\n/**\n * The cascade selection under a reporting strategy. DERIVED OUTPUT ONLY: the\n * STORED value stays the full closure, which keeps a checked state an O(1)\n * lookup. `\"all\"` is the closure; `\"parent\"` drops a value whose parent is\n * selected; `\"child\"` drops one with a selected child.\n */\nexport function getCascaderCheckedValues<T>(\n index: CascaderIndex<T>,\n selected: readonly string[],\n strategy: CascaderCheckedStrategy,\n): readonly string[] {\n if (strategy === \"all\") return selected;\n\n const set = new Set(selected);\n if (strategy === \"parent\") {\n return selected.filter((value) => {\n const parent = index.parentOf.get(value);\n return parent == null || !set.has(parent);\n });\n }\n\n return selected.filter((value) => {\n const children = index.childrenOf.get(value);\n if (!children?.length) return true;\n return !children.some((child) => set.has(child.value));\n });\n}\n\n/** Values in `nodes` whose label collides, so the chip must show its path. */\nexport function findAmbiguousCascaderLabels<T>(nodes: readonly CascaderNode<T>[]): Set<string> {\n const firstByLabel = new Map<string, string>();\n const ambiguous = new Set<string>();\n\n for (const node of nodes) {\n const first = firstByLabel.get(node.label);\n if (first === undefined) {\n firstByLabel.set(node.label, node.value);\n continue;\n }\n ambiguous.add(node.value);\n ambiguous.add(first);\n }\n\n return ambiguous;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Development only */\n/* -------------------------------------------------------------------------- */\n\n/** Warnings already emitted. Module scoped, or they repeat once per render. */\nconst CASCADER_WARNED = new Set<string>();\n\n/** Warns once per `key`, never in production, never by throwing. */\nexport function warnCascaderOnce(key: string, message: string): void {\n if (process.env.NODE_ENV === \"production\") return;\n if (CASCADER_WARNED.has(key)) return;\n CASCADER_WARNED.add(key);\n console.warn(`[Cascader] ${message}`);\n}\n\n/** Empties the ledger. Tests only; a warning is meant to be seen once. */\nexport function resetCascaderWarnings(): void {\n CASCADER_WARNED.clear();\n}\n\n/** What a dev-time scan of the consumer's `items` found wrong with it. */\nexport interface CascaderDataIssues {\n /** Values appearing more than once. First wins, so a duplicate drops a row. */\n duplicates: string[];\n /** Values on a `getParent` cycle. Depth is clamped, so the tree reads wrong. */\n cycles: string[];\n}\n\n/** Dev-time scan, kept out of `buildCascaderIndex` so the build stays hot. */\nexport function findCascaderDataIssues<T>(\n items: readonly CascaderNode<T>[] | undefined,\n getParent?: (node: CascaderNode<T>) => string | null | undefined,\n): CascaderDataIssues {\n const seen = new Set<string>();\n const duplicates = new Set<string>();\n const flat: CascaderNode<T>[] = [];\n\n const visit = (nodes: readonly CascaderNode<T>[] | undefined) => {\n for (const node of nodes ?? []) {\n // The build skips a nullish entry, and this runs BEFORE its warning.\n if (node == null) continue;\n if (seen.has(node.value)) duplicates.add(node.value);\n else seen.add(node.value);\n flat.push(node);\n // Flat mode walks them too: BOTH `children` and `getParent` is a bug.\n if (node.children?.length) visit(node.children);\n }\n };\n visit(items);\n\n const cycles: string[] = [];\n if (getParent) {\n const parentOf = new Map<string, string | null>();\n for (const node of flat) {\n if (parentOf.has(node.value)) continue;\n const raw = getParent(node);\n parentOf.set(node.value, raw != null && seen.has(raw) ? raw : null);\n }\n for (const node of flat) {\n const walked = new Set<string>([node.value]);\n let cursor = parentOf.get(node.value) ?? null;\n while (cursor != null) {\n if (walked.has(cursor)) {\n cycles.push(node.value);\n break;\n }\n walked.add(cursor);\n cursor = parentOf.get(cursor) ?? null;\n }\n }\n }\n\n return { duplicates: Array.from(duplicates), cycles };\n}\n"],"mappings":";;;AAYA,MAAa,oBAAoB;;;;;AAMjC,MAAa,uBAAuB;;;;;;;;;;;AAiBpC,MAAa,6BACX;;;;;;AAOF,MAAa,0BAA0B;;AAGvC,MAAa,wBACX;;AAGF,MAAa,sBAAsB;;;;;;AAWnC,MAAM,6BACJ;;AAGF,MAAM,6BAA6B;;AAGnC,MAAM,+BAA+B;;AAGrC,SAAS,oBAAoB,OAAmC;CAE9D,OADc,MAAM,KAAK,MAAM,iBAA8B,0BAA0B,CAC5E,CAAC,CAAC,QACV,SAEC,KAAK,aAAa,UAAU,MAAM,QAClC,CAAC,KAAK,QAAQ,0BAA0B,KACxC,CAAC,KAAK,QAAQ,4BAA4B,CAC9C;AACF;;AAGA,SAAgB,uBAAuB,OAAmC;CACxE,MAAM,SAAS,MAAM,QAAQ,iCAA+B,IACxD,QACA,MAAM,cAA2B,iCAA+B;CACpE,IAAI,CAAC,QAAQ,OAAO,CAAC;CACrB,OAAO,oBAAoB,MAAM;AACnC;;AAGA,SAAgB,qBACd,OACA,MACA,WACoB;CACpB,MAAM,QAAQ,oBAAoB,KAAK;CAC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{ i as CascaderCollapse, p as CascaderNode, v as CascaderValueDisplay } from "../../../cascader-types-DVT-znZ-.js";
2
2
  import * as React$1 from "react";
3
3
  import { useRender } from "@base-ui/react/use-render";
4
4
  import { Combobox } from "@base-ui/react";
@@ -1 +1 @@
1
- {"version":3,"file":"cascader-nav.d.ts","names":["React","ComboboxPrimitive"],"sources":["../../../../src/components/reui/cascader/cascader-nav.tsx"],"mappings":";;;;;YAgCY,mBAAmB,UAAU;;;;;iBAMhC,cAAc,cAAc,SAAS,mBAAgBA,QAAA,+BAAAA,QAAA;iBAsB7C,0BAA0B,KAAK,UAAU;EACxD,WAAWA,QAAM;;;iBAIV,eAAe,WAAW,aAAa,SAAS,oBAAiBA,QAAA,+BAAAA,QAAA;iBAmCzD,gCAAgC,KAAK,UAAU;;EAE9D;EACA,WAAW;;EAEX;;;;;;;;iBASO,qBACP,WACA,aACA,UACA,gBACG,SACF,0BAAuBA,QAAA,+BAAAA,QAAA;iBAqFT,2BAA2BC,SAAkB,MAAM;;EAElE;;;;;;iBAUO,gBACP,WACA,UACA,aACA,+BACoB,oBACjB,SACF,qBAAkBD,QAAA,IAAA;iBA+OJ,2BAA2B,KAAK,UAAU;;EAEzD,UAAU;EACV;EACA,WAAW;EACX,YAAYA,QAAM;;EAElB;EACA,cAAcA,QAAM;;EAEpB,YAAY,UAAU,gBAAgB,MAAM,mBAAmBA,QAAM;;;;;;iBAO9D,gBACP,WACA,SACA,aACA,UACA,WACA,UACA,aACA,aACG,SACF,qBAAkBA,QAAA,+BAAAA,QAAA"}
1
+ {"version":3,"file":"cascader-nav.d.ts","names":["React","ComboboxPrimitive"],"sources":["../../../../src/components/reui/cascader/cascader-nav.tsx"],"mappings":";;;;;YAgCY,mBAAmB,UAAU;;;;;iBAMhC,cAAc,cAAc,SAAS,mBAAgBA,QAAA,+BAAAA,QAAA;iBAsB7C,0BAA0B,KAAK,UAAU;EACxD,WAAWA,QAAM;;;iBAIV,eAAe,WAAW,aAAa,SAAS,oBAAiBA,QAAA,+BAAAA,QAAA;iBAmCzD,gCAAgC,KAAK,UAAU;;EAE9D;EACA,WAAW;;EAEX;;;;;;;;iBASO,qBACP,WACA,aACA,UACA,gBACG,SACF,0BAAuBA,QAAA,+BAAAA,QAAA;iBAqFT,2BAA2BC,SAAkB,MAAM;;EAElE;;;;;;iBAUO,gBACP,WACA,UACA,aACA,+BACoB,oBACjB,SACF,qBAAkBD,QAAA,IAAA;iBAwPJ,2BAA2B,KAAK,UAAU;;EAEzD,UAAU;EACV;EACA,WAAW;EACX,YAAYA,QAAM;;EAElB;EACA,cAAcA,QAAM;;EAEpB,YAAY,UAAU,gBAAgB,MAAM,mBAAmBA,QAAM;;;;;;iBAO9D,gBACP,WACA,SACA,aACA,UACA,WACA,UACA,aACA,aACG,SACF,qBAAkBA,QAAA,+BAAAA,QAAA"}
@@ -4,8 +4,8 @@ import { collapseCascaderPath, getCascaderFooterStops, getCascaderPath, isCascad
4
4
  import { resolveCascaderSearchLabel } from "./cascader-i18n.js";
5
5
  import * as React$1 from "react";
6
6
  import { cn } from "@kumix/utils";
7
- import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
8
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
+ import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
9
9
  import { mergeProps } from "@base-ui/react/merge-props";
10
10
  import { useRender } from "@base-ui/react/use-render";
11
11
  import { Combobox } from "@base-ui/react";
@@ -104,10 +104,10 @@ function CascaderBreadcrumb({ className, maxSegments = 3, collapse = "middle", i
104
104
  * the refill from the committed selection that would fight every level swap.
105
105
  */
106
106
  function CascaderInput({ className, showBack = true, placeholder, onKeyDown, "aria-describedby": ariaDescribedBy, ...props }) {
107
- const { labels, popLevel, mode, getHighlighted, isBranch, navigate, index, toggleExpanded, inline, invalid, baseId } = useCascaderActions();
107
+ const { labels, popLevel, mode, getHighlighted, isBranch, isDisabled, navigate, index, toggleExpanded, inline, invalid, baseId, searchScope } = useCascaderActions();
108
108
  const direction = useDirection();
109
- const { currentParent, query, path, renderedItems, treeRows } = useCascaderState();
110
- const resolvedPlaceholder = placeholder ?? resolveCascaderSearchLabel(labels, currentParent?.label);
109
+ const { currentParent, query, path, expanded, renderedItems, treeRows } = useCascaderState();
110
+ const resolvedPlaceholder = placeholder ?? resolveCascaderSearchLabel(labels, searchScope === "global" ? void 0 : currentParent?.label);
111
111
  const backVisible = showBack && mode === "drill" && path.length > 0;
112
112
  const hintId = `${baseId}-hint`;
113
113
  const listId = `${baseId}-column-${mode === "columns" ? path.length : 0}`;
@@ -170,7 +170,8 @@ function CascaderInput({ className, showBack = true, placeholder, onKeyDown, "ar
170
170
  if (child && child.depth === row.depth + 1) moveHighlightTo(field, rowIndex + 1);
171
171
  return;
172
172
  }
173
- if (row.branch && row.expanded) {
173
+ const heldByQuery = isDisabled(row.node) && !expanded.has(row.node.value);
174
+ if (row.branch && row.expanded && !heldByQuery) {
174
175
  event.preventDefault();
175
176
  toggleExpanded(row.node.value);
176
177
  return;
@@ -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,WAC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AA,UAAA,CACG,YAAY,MAAM,OACjB,oBAAC,QAAD;GACE,aAAU;GACV,WAAU;GAET,UAAA,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,SAA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AAM;EACd,OAAO,WAAmB,cAAc,KAAK;CAC/C,CAAC;AACH"}
@@ -1,2 +1,2 @@
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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,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
+ {"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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,MAAM,SAAS,yBAAyB,cAAc;CAEtD,MAAM,QAAQ,OAAO;CACrB,MAAM,aAAaA,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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