@servicetitan/anvil2 3.0.7 → 3.0.9

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 (305) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/{AiMark-BXL0sWIV.js → AiMark-CS6MvraM.js} +5 -4
  3. package/dist/{AiMark-BXL0sWIV.js.map → AiMark-CS6MvraM.js.map} +1 -1
  4. package/dist/AiMark.js +1 -1
  5. package/dist/{Alert-BNH0UD2s.js → Alert-CNDLoh6b.js} +2 -2
  6. package/dist/{Alert-BNH0UD2s.js.map → Alert-CNDLoh6b.js.map} +1 -1
  7. package/dist/Alert.js +1 -1
  8. package/dist/{AnvilProvider-J9DjoJiB.js → AnvilProvider-BFK29dL5.js} +3 -2
  9. package/dist/{AnvilProvider-J9DjoJiB.js.map → AnvilProvider-BFK29dL5.js.map} +1 -1
  10. package/dist/AnvilProvider.js +1 -1
  11. package/dist/{Avatar-FDHyqiCy.js → Avatar-Bl-Dxbhf.js} +7 -2
  12. package/dist/Avatar-Bl-Dxbhf.js.map +1 -0
  13. package/dist/{Avatar-B_cRQqKR.js → Avatar-CdAIJ5VK.js} +2 -2
  14. package/dist/{Avatar-B_cRQqKR.js.map → Avatar-CdAIJ5VK.js.map} +1 -1
  15. package/dist/Avatar.js +2 -2
  16. package/dist/{Breadcrumbs-Bzxbdu-S.js → Breadcrumbs--Xt6l_2L.js} +2 -2
  17. package/dist/{Breadcrumbs-Bzxbdu-S.js.map → Breadcrumbs--Xt6l_2L.js.map} +1 -1
  18. package/dist/Breadcrumbs.js +1 -1
  19. package/dist/{Calendar-DS5eWpGF.js → Calendar-5mAxtdNh.js} +2 -2
  20. package/dist/{Calendar-DS5eWpGF.js.map → Calendar-5mAxtdNh.js.map} +1 -1
  21. package/dist/{Calendar-BYNFAWpZ.js → Calendar-rITorBvD.js} +5 -3
  22. package/dist/{Calendar-BYNFAWpZ.js.map → Calendar-rITorBvD.js.map} +1 -1
  23. package/dist/Calendar.js +2 -2
  24. package/dist/{Checkbox-BeIzx_ZX.js → Checkbox-BYWhkYoK.js} +2 -2
  25. package/dist/{Checkbox-BeIzx_ZX.js.map → Checkbox-BYWhkYoK.js.map} +1 -1
  26. package/dist/{Checkbox-BB3BDJsK.js → Checkbox-DTzoDcJl.js} +3 -3
  27. package/dist/{Checkbox-BB3BDJsK.js.map → Checkbox-DTzoDcJl.js.map} +1 -1
  28. package/dist/Checkbox.js +1 -1
  29. package/dist/{Chip-D2k5X_wX.js → Chip-CyMNyEPR.js} +3 -3
  30. package/dist/{Chip-D2k5X_wX.js.map → Chip-CyMNyEPR.js.map} +1 -1
  31. package/dist/Chip.js +1 -1
  32. package/dist/Combobox.js +1 -1
  33. package/dist/{DataTable-E8z0H8c7.js → DataTable-FG0Kjx0d.js} +1206 -445
  34. package/dist/DataTable-FG0Kjx0d.js.map +1 -0
  35. package/dist/DataTable.css +301 -233
  36. package/dist/{DateFieldRange-BN_uIvHI.js → DateFieldRange-BUug1tUy.js} +4 -4
  37. package/dist/{DateFieldRange-BN_uIvHI.js.map → DateFieldRange-BUug1tUy.js.map} +1 -1
  38. package/dist/DateFieldRange.js +1 -1
  39. package/dist/{DateFieldSingle-h3YkdwPo.js → DateFieldSingle-DR7faQGD.js} +4 -4
  40. package/dist/{DateFieldSingle-h3YkdwPo.js.map → DateFieldSingle-DR7faQGD.js.map} +1 -1
  41. package/dist/DateFieldSingle.js +1 -1
  42. package/dist/{DateFieldYearless-m_Hl2gMY.js → DateFieldYearless-7MFcR7L6.js} +4 -4
  43. package/dist/{DateFieldYearless-m_Hl2gMY.js.map → DateFieldYearless-7MFcR7L6.js.map} +1 -1
  44. package/dist/DateFieldYearless.js +1 -1
  45. package/dist/{DateFieldYearlessRange-DNqSTBDr.js → DateFieldYearlessRange-DGtdyISH.js} +3 -3
  46. package/dist/{DateFieldYearlessRange-DNqSTBDr.js.map → DateFieldYearlessRange-DGtdyISH.js.map} +1 -1
  47. package/dist/DateFieldYearlessRange.js +1 -1
  48. package/dist/{DaysOfTheWeek-D58z_eF3.js → DaysOfTheWeek-C7oN9nIe.js} +3 -3
  49. package/dist/{DaysOfTheWeek-D58z_eF3.js.map → DaysOfTheWeek-C7oN9nIe.js.map} +1 -1
  50. package/dist/DaysOfTheWeek.js +1 -1
  51. package/dist/{Dialog-CvYSMvfD.js → Dialog-dE9c90iR.js} +3 -3
  52. package/dist/{Dialog-CvYSMvfD.js.map → Dialog-dE9c90iR.js.map} +1 -1
  53. package/dist/Dialog.js +1 -1
  54. package/dist/{Divider-CxtTyw8_.js → Divider-Dz27DFuE.js} +17 -17
  55. package/dist/{Divider-CxtTyw8_.js.map → Divider-Dz27DFuE.js.map} +1 -1
  56. package/dist/Divider.css +21 -24
  57. package/dist/Divider.js +1 -1
  58. package/dist/Dnd.js +2 -2
  59. package/dist/{DndHandleButton-CHTOYRlq.js → DndHandleButton-BW9xLWQm.js} +2 -4
  60. package/dist/DndHandleButton-BW9xLWQm.js.map +1 -0
  61. package/dist/DndSort.js +2 -2
  62. package/dist/{Drawer-s2y0xcgV.js → Drawer-Dk0MsaOU.js} +3 -3
  63. package/dist/{Drawer-s2y0xcgV.js.map → Drawer-Dk0MsaOU.js.map} +1 -1
  64. package/dist/Drawer.js +1 -1
  65. package/dist/DrillDown.js +1 -1
  66. package/dist/{EditCard-B25pj0Jx.js → EditCard-DV2N7zWr.js} +2 -2
  67. package/dist/{EditCard-B25pj0Jx.js.map → EditCard-DV2N7zWr.js.map} +1 -1
  68. package/dist/EditCard.js +1 -1
  69. package/dist/{FieldLabel-D1qPAGtB.js → FieldLabel-VVn8GR64.js} +3 -3
  70. package/dist/{FieldLabel-D1qPAGtB.js.map → FieldLabel-VVn8GR64.js.map} +1 -1
  71. package/dist/FieldLabel.js +1 -1
  72. package/dist/{FilterBar-B4ZAs73g.js → FilterBar-B3c_VGDk.js} +6 -5
  73. package/dist/{FilterBar-B4ZAs73g.js.map → FilterBar-B3c_VGDk.js.map} +1 -1
  74. package/dist/FilterBar.js +1 -1
  75. package/dist/{InputMask-BDl09V4u.js → InputMask-VBHWGZGN.js} +3 -3
  76. package/dist/{InputMask-BDl09V4u.js.map → InputMask-VBHWGZGN.js.map} +1 -1
  77. package/dist/InputMask.js +1 -1
  78. package/dist/{ListView-DO5psxd4.js → ListView-BUrfz75g.js} +2 -2
  79. package/dist/{ListView-DO5psxd4.js.map → ListView-BUrfz75g.js.map} +1 -1
  80. package/dist/ListView.js +1 -1
  81. package/dist/{Listbox-CvQHBFWb.js → Listbox-CRY-0BkS.js} +2 -2
  82. package/dist/{Listbox-CvQHBFWb.js.map → Listbox-CRY-0BkS.js.map} +1 -1
  83. package/dist/Listbox.js +1 -1
  84. package/dist/{Menu-W0c-xKdX.js → Menu-DNJ0YqjA.js} +11 -7
  85. package/dist/Menu-DNJ0YqjA.js.map +1 -0
  86. package/dist/Menu.js +1 -1
  87. package/dist/MenuFooter-CrsZdXvN.js +115 -0
  88. package/dist/MenuFooter-CrsZdXvN.js.map +1 -0
  89. package/dist/MultiSelectField.js +1 -1
  90. package/dist/{MultiSelectFieldSync-CXX2F0ru.js → MultiSelectFieldSync-CzHj9Qvy.js} +8 -53
  91. package/dist/MultiSelectFieldSync-CzHj9Qvy.js.map +1 -0
  92. package/dist/MultiSelectMenu.js +1 -1
  93. package/dist/{MultiSelectMenuSync-EKtvlL62.js → MultiSelectMenuSync-BGcrYjby.js} +9 -76
  94. package/dist/MultiSelectMenuSync-BGcrYjby.js.map +1 -0
  95. package/dist/{NumberField-BymFZhIJ.js → NumberField-bgYX7JGs.js} +3 -3
  96. package/dist/{NumberField-BymFZhIJ.js.map → NumberField-bgYX7JGs.js.map} +1 -1
  97. package/dist/NumberField.js +1 -1
  98. package/dist/{Page-C2_Hm27h.js → Page-BSHydn4p.js} +9 -9
  99. package/dist/{Page-C2_Hm27h.js.map → Page-BSHydn4p.js.map} +1 -1
  100. package/dist/Page.js +1 -1
  101. package/dist/{Pagination-Bmd4JORe.js → Pagination-CAeyJ7Pl.js} +192 -26
  102. package/dist/Pagination-CAeyJ7Pl.js.map +1 -0
  103. package/dist/Pagination.css +4 -2
  104. package/dist/Pagination.js +1 -1
  105. package/dist/{Popover-8mTJoMy7.js → Popover-Cq5tirFz.js} +11 -5
  106. package/dist/Popover-Cq5tirFz.js.map +1 -0
  107. package/dist/Popover.js +1 -1
  108. package/dist/{ProgressBar-C1CkQHV5.js → ProgressBar-ByR50ln7.js} +2 -2
  109. package/dist/{ProgressBar-C1CkQHV5.js.map → ProgressBar-ByR50ln7.js.map} +1 -1
  110. package/dist/ProgressBar.js +1 -1
  111. package/dist/{Radio-BcHMk8dD.js → Radio-CPuctRpl.js} +2 -2
  112. package/dist/{Radio-BcHMk8dD.js.map → Radio-CPuctRpl.js.map} +1 -1
  113. package/dist/{Radio-D5WyQN2i.js → Radio-WlsZFRzX.js} +3 -3
  114. package/dist/{Radio-D5WyQN2i.js.map → Radio-WlsZFRzX.js.map} +1 -1
  115. package/dist/Radio.js +1 -1
  116. package/dist/{RichTextEditor-DstVbYch.js → RichTextEditor-FSWAVmTe.js} +80 -44
  117. package/dist/RichTextEditor-FSWAVmTe.js.map +1 -0
  118. package/dist/RichTextEditor.js +1 -1
  119. package/dist/{SavedFiltersButton-2qba2Cgu.js → SavedFiltersButton-Cr829guv.js} +12 -11
  120. package/dist/SavedFiltersButton-Cr829guv.js.map +1 -0
  121. package/dist/SavedFiltersButton.js +1 -1
  122. package/dist/{SelectCard-BN-LI14f.js → SelectCard-DLWLHi_i.js} +3 -3
  123. package/dist/{SelectCard-BN-LI14f.js.map → SelectCard-DLWLHi_i.js.map} +1 -1
  124. package/dist/SelectCard.js +1 -1
  125. package/dist/SelectField.js +1 -1
  126. package/dist/{SelectFieldLabel-UbQT7fDD.js → SelectFieldLabel-vemffdmu.js} +2 -2
  127. package/dist/{SelectFieldLabel-UbQT7fDD.js.map → SelectFieldLabel-vemffdmu.js.map} +1 -1
  128. package/dist/{SelectFieldSync-DykGkR_w.js → SelectFieldSync-C65VFWGm.js} +5 -4
  129. package/dist/{SelectFieldSync-DykGkR_w.js.map → SelectFieldSync-C65VFWGm.js.map} +1 -1
  130. package/dist/SelectMenu.js +1 -1
  131. package/dist/{SelectMenuSync-DTQ8Ofoz.js → SelectMenuSync-CF49L12-.js} +6 -4
  132. package/dist/{SelectMenuSync-DTQ8Ofoz.js.map → SelectMenuSync-CF49L12-.js.map} +1 -1
  133. package/dist/{SelectOptions-DVSOJwRy.js → SelectOptions-C7skDFj2.js} +2 -2
  134. package/dist/{SelectOptions-DVSOJwRy.js.map → SelectOptions-C7skDFj2.js.map} +1 -1
  135. package/dist/{SelectTrigger-CHk0KO-P.js → SelectTrigger-BbneVXMz.js} +3 -3
  136. package/dist/{SelectTrigger-CHk0KO-P.js.map → SelectTrigger-BbneVXMz.js.map} +1 -1
  137. package/dist/SelectTrigger.js +1 -1
  138. package/dist/{SelectTriggerBase-B2S5SOZr.js → SelectTriggerBase-BjIOERXr.js} +3 -3
  139. package/dist/{SelectTriggerBase-B2S5SOZr.js.map → SelectTriggerBase-BjIOERXr.js.map} +1 -1
  140. package/dist/{Switch-onmiKoRd.js → Switch-B6bKmpwN.js} +3 -3
  141. package/dist/{Switch-onmiKoRd.js.map → Switch-B6bKmpwN.js.map} +1 -1
  142. package/dist/Switch.js +1 -1
  143. package/dist/Table.js +1 -1
  144. package/dist/{Text-BTzgTpqu.js → Text-w2gWn4K6.js} +2 -2
  145. package/dist/{Text-BTzgTpqu.js.map → Text-w2gWn4K6.js.map} +1 -1
  146. package/dist/Text.js +1 -1
  147. package/dist/{TextField-WTYZJlX3.js → TextField-BQsCh5Nb.js} +2 -2
  148. package/dist/{TextField-WTYZJlX3.js.map → TextField-BQsCh5Nb.js.map} +1 -1
  149. package/dist/{TextField-rVfctM1E.js → TextField-DJ3gEIP6.js} +3 -3
  150. package/dist/{TextField-rVfctM1E.js.map → TextField-DJ3gEIP6.js.map} +1 -1
  151. package/dist/TextField.js +1 -1
  152. package/dist/{Textarea-PXjppEQ6.js → Textarea-BK4Vf84K.js} +3 -3
  153. package/dist/{Textarea-PXjppEQ6.js.map → Textarea-BK4Vf84K.js.map} +1 -1
  154. package/dist/Textarea.js +1 -1
  155. package/dist/{ThemeProvider-D4KdGCaP.js → ThemeProvider-BC6wbuLU.js} +4 -9
  156. package/dist/{ThemeProvider-D4KdGCaP.js.map → ThemeProvider-BC6wbuLU.js.map} +1 -1
  157. package/dist/ThemeProvider.js +1 -1
  158. package/dist/ThemeProvider.module-D9pNGYjP.js +8 -0
  159. package/dist/ThemeProvider.module-D9pNGYjP.js.map +1 -0
  160. package/dist/{TimeField-BJPXIv6W.js → TimeField-B4IW2B_o.js} +4 -4
  161. package/dist/{TimeField-BJPXIv6W.js.map → TimeField-B4IW2B_o.js.map} +1 -1
  162. package/dist/TimeField.js +1 -1
  163. package/dist/Toast.js +2 -2
  164. package/dist/{Toaster-CoChsMD0.js → Toaster-BGY2IzF5.js} +53 -48
  165. package/dist/Toaster-BGY2IzF5.js.map +1 -0
  166. package/dist/{Toaster-DXLc86VD.js → Toaster-DTF9qnTy.js} +2 -2
  167. package/dist/{Toaster-DXLc86VD.js.map → Toaster-DTF9qnTy.js.map} +1 -1
  168. package/dist/{Toolbar-Bt3kShho.js → Toolbar-DObrJ_S5.js} +5 -4
  169. package/dist/{Toolbar-Bt3kShho.js.map → Toolbar-DObrJ_S5.js.map} +1 -1
  170. package/dist/{Toolbar-DaUKbbsL.js → Toolbar-DRJGKk8D.js} +6 -5
  171. package/dist/{Toolbar-DaUKbbsL.js.map → Toolbar-DRJGKk8D.js.map} +1 -1
  172. package/dist/Toolbar.js +2 -2
  173. package/dist/{ToolbarButtonToggle-BPu81Wuv.js → ToolbarButtonToggle-BCKgA8FE.js} +2 -2
  174. package/dist/{ToolbarButtonToggle-BPu81Wuv.js.map → ToolbarButtonToggle-BCKgA8FE.js.map} +1 -1
  175. package/dist/{Tooltip-yr1D06BE.js → Tooltip-DqS6xDUf.js} +27 -25
  176. package/dist/Tooltip-DqS6xDUf.js.map +1 -0
  177. package/dist/Tooltip.js +1 -1
  178. package/dist/TreeSelectField.d.ts +1 -0
  179. package/dist/TreeSelectField.js +2 -0
  180. package/dist/TreeSelectField.js.map +1 -0
  181. package/dist/TreeSelectFieldSync-Do5ffU0b.js +609 -0
  182. package/dist/TreeSelectFieldSync-Do5ffU0b.js.map +1 -0
  183. package/dist/TreeSelectFieldSync.css +173 -0
  184. package/dist/TreeSelectMenu.d.ts +1 -0
  185. package/dist/TreeSelectMenu.js +2 -0
  186. package/dist/TreeSelectMenu.js.map +1 -0
  187. package/dist/TreeSelectMenuSync-s05Ly6lj.js +413 -0
  188. package/dist/TreeSelectMenuSync-s05Ly6lj.js.map +1 -0
  189. package/dist/{YearlessDateInputWithPicker-BIcVgz-J.js → YearlessDateInputWithPicker-BHfFjCqE.js} +2 -2
  190. package/dist/{YearlessDateInputWithPicker-BIcVgz-J.js.map → YearlessDateInputWithPicker-BHfFjCqE.js.map} +1 -1
  191. package/dist/beta.js +15 -13
  192. package/dist/beta.js.map +1 -1
  193. package/dist/confirmationTypes-CG7xl50f.js +75 -0
  194. package/dist/confirmationTypes-CG7xl50f.js.map +1 -0
  195. package/dist/drag_indicator-BRHAPLSJ.js +6 -0
  196. package/dist/drag_indicator-BRHAPLSJ.js.map +1 -0
  197. package/dist/{filter-state-Bx3aYS1r.js → filter-state-CE8t3-Q7.js} +324 -84
  198. package/dist/filter-state-CE8t3-Q7.js.map +1 -0
  199. package/dist/{floating-ui.react-dom-CHrYz13o.js → floating-ui.react-dom-BIKT960u.js} +2 -2
  200. package/dist/{floating-ui.react-dom-CHrYz13o.js.map → floating-ui.react-dom-BIKT960u.js.map} +1 -1
  201. package/dist/{index-CukEaIHB.js → index-CKdC7x1S.js} +2 -2
  202. package/dist/{index-CukEaIHB.js.map → index-CKdC7x1S.js.map} +1 -1
  203. package/dist/{index-DVYRUKtW.js → index-DN_iqxhF.js} +79 -109
  204. package/dist/{index-DVYRUKtW.js.map → index-DN_iqxhF.js.map} +1 -1
  205. package/dist/index.js +44 -44
  206. package/dist/keyboard_arrow_left-CiE1n99w.js +6 -0
  207. package/dist/keyboard_arrow_left-CiE1n99w.js.map +1 -0
  208. package/dist/keyboard_arrow_right-DMloHg_F.js +6 -0
  209. package/dist/keyboard_arrow_right-DMloHg_F.js.map +1 -0
  210. package/dist/portalScopeClassNames-jlZkdug_.js +7 -0
  211. package/dist/portalScopeClassNames-jlZkdug_.js.map +1 -0
  212. package/dist/src/beta/components/FilterBar/FilterTextInput.d.ts +29 -0
  213. package/dist/src/beta/components/FilterBar/index.d.ts +1 -1
  214. package/dist/src/beta/components/FilterBar/internal/adapters/asyncTree.d.ts +6 -0
  215. package/dist/src/beta/components/FilterBar/internal/adapters/textInput.d.ts +3 -0
  216. package/dist/src/beta/components/FilterBar/internal/adapters/tree.d.ts +6 -0
  217. package/dist/src/beta/components/FilterBar/internal/adapters/types.d.ts +4 -1
  218. package/dist/src/beta/components/FilterBar/internal/types.d.ts +69 -12
  219. package/dist/src/beta/components/FilterBar/internal/utils/test.d.ts +4 -1
  220. package/dist/src/beta/components/Table/DataTable/DataTable.d.ts +8 -31
  221. package/dist/src/beta/components/Table/DataTable/internal/DataTableBody.d.ts +2 -19
  222. package/dist/src/beta/components/Table/DataTable/internal/DataTableBodyRow.d.ts +17 -13
  223. package/dist/src/beta/components/Table/DataTable/internal/context/focus/DTFocusContext.d.ts +1 -11
  224. package/dist/src/beta/components/Table/DataTable/internal/context/focus/useDTFocusDispatchContext.d.ts +0 -2
  225. package/dist/src/beta/components/Table/DataTable/internal/context/surface/DataTableSurfaceCoordinatorContext.d.ts +13 -0
  226. package/dist/src/beta/components/Table/DataTable/internal/context/surface/DataTableSurfaceCoordinatorProvider.d.ts +7 -0
  227. package/dist/src/beta/components/Table/DataTable/internal/context/surface/useDataTableSurfaceCoordinator.d.ts +1 -0
  228. package/dist/src/beta/components/Table/DataTable/internal/editable-cells/useCustomEditHelpers.d.ts +8 -6
  229. package/dist/src/beta/components/Table/DataTable/internal/useColumnOrder.d.ts +1 -0
  230. package/dist/src/beta/components/Table/createColumnHelper.d.ts +4 -2
  231. package/dist/src/beta/components/Table/formatters/htmlFormatter.d.ts +4 -2
  232. package/dist/src/beta/components/Table/formatters/htmlToMarkdown.d.ts +5 -2
  233. package/dist/src/beta/components/Table/formatters/markdownFormatter.d.ts +3 -2
  234. package/dist/src/beta/components/Table/types.d.ts +47 -30
  235. package/dist/src/beta/components/TreeSelectField/TreeSelectField.d.ts +68 -0
  236. package/dist/src/beta/components/TreeSelectField/TreeSelectFieldSync.d.ts +64 -0
  237. package/dist/src/beta/components/TreeSelectField/index.d.ts +3 -0
  238. package/dist/src/beta/components/TreeSelectField/internal/TreeContent.d.ts +31 -0
  239. package/dist/src/beta/components/TreeSelectField/internal/TreePanel.d.ts +56 -0
  240. package/dist/src/beta/components/TreeSelectField/internal/TreeRow.d.ts +56 -0
  241. package/dist/src/beta/components/TreeSelectField/internal/TreeSelectFieldInput.d.ts +82 -0
  242. package/dist/src/beta/components/TreeSelectField/internal/VirtualizedTreePanel.d.ts +57 -0
  243. package/dist/src/beta/components/TreeSelectField/internal/treeSync.d.ts +33 -0
  244. package/dist/src/beta/components/TreeSelectField/internal/treeUtils.d.ts +25 -0
  245. package/dist/src/beta/components/TreeSelectField/internal/types.d.ts +12 -0
  246. package/dist/src/beta/components/TreeSelectField/internal/useTree.d.ts +99 -0
  247. package/dist/src/beta/components/TreeSelectField/internal/useTreeCascade.d.ts +93 -0
  248. package/dist/src/beta/components/TreeSelectField/internal/useTreeKeyboard.d.ts +42 -0
  249. package/dist/src/beta/components/TreeSelectField/internal/useTreeLazyCascade.d.ts +56 -0
  250. package/dist/src/beta/components/TreeSelectField/internal/useTreeLoader.d.ts +58 -0
  251. package/dist/src/beta/components/TreeSelectField/stories/TreeSelectField.stories.data.d.ts +21 -0
  252. package/dist/src/beta/components/TreeSelectField/types.d.ts +124 -0
  253. package/dist/src/beta/components/TreeSelectMenu/TreeSelectMenu.d.ts +29 -0
  254. package/dist/src/beta/components/TreeSelectMenu/TreeSelectMenuSync.d.ts +65 -0
  255. package/dist/src/beta/components/TreeSelectMenu/index.d.ts +4 -0
  256. package/dist/src/beta/components/TreeSelectMenu/types.d.ts +103 -0
  257. package/dist/src/beta/components/index.d.ts +2 -0
  258. package/dist/src/components/Pagination/internal/Pagination.d.ts +1 -0
  259. package/dist/src/components/Pagination/internal/PaginationOverflowMenu.d.ts +12 -1
  260. package/dist/src/internal/components/Surface/Surface.d.ts +4 -0
  261. package/dist/src/internal/components/Surface/surfaceGeometry.d.ts +31 -0
  262. package/dist/src/internal/functions/portalScopeClassNames.d.ts +14 -0
  263. package/dist/src/internal/utils/arrayIdsEqual.d.ts +10 -0
  264. package/dist/src/internal/utils/index.d.ts +1 -0
  265. package/dist/{stripInlineMarkdown-C5DNxxwf.js → stripInlineMarkdown-C0bVmYgG.js} +2 -2
  266. package/dist/{stripInlineMarkdown-C5DNxxwf.js.map → stripInlineMarkdown-C0bVmYgG.js.map} +1 -1
  267. package/dist/{syncFilterUtils-BEKek64h.js → syncFilterUtils-CgHB-l6A.js} +35 -410
  268. package/dist/syncFilterUtils-CgHB-l6A.js.map +1 -0
  269. package/dist/syncFilterUtils.css +0 -180
  270. package/dist/treeSync-Cz3H08cr.js +1453 -0
  271. package/dist/treeSync-Cz3H08cr.js.map +1 -0
  272. package/dist/treeSync.css +40 -0
  273. package/dist/useAdaptiveView-CeYKH0Me.js +386 -0
  274. package/dist/useAdaptiveView-CeYKH0Me.js.map +1 -0
  275. package/dist/useAdaptiveView.css +181 -0
  276. package/dist/useChipLayout-BWZfKDgd.js +51 -0
  277. package/dist/useChipLayout-BWZfKDgd.js.map +1 -0
  278. package/dist/{useDrilldown-KZ9rRsXQ.js → useDrilldown-BJ2dHHKV.js} +2 -2
  279. package/dist/{useDrilldown-KZ9rRsXQ.js.map → useDrilldown-BJ2dHHKV.js.map} +1 -1
  280. package/dist/{useInfiniteCombobox-CknXmqlQ.js → useInfiniteCombobox-BqJm-CdN.js} +24 -24
  281. package/dist/useInfiniteCombobox-BqJm-CdN.js.map +1 -0
  282. package/dist/{useMenuInteraction-CpAOHSJu.js → useMenuInteraction-NEJXUD4I.js} +2 -114
  283. package/dist/useMenuInteraction-NEJXUD4I.js.map +1 -0
  284. package/dist/{useToggleSelection-B-Z80gy2.js → useToggleSelection-BGc5OiZF.js} +2 -2
  285. package/dist/{useToggleSelection-B-Z80gy2.js.map → useToggleSelection-BGc5OiZF.js.map} +1 -1
  286. package/package.json +5 -7
  287. package/dist/Avatar-FDHyqiCy.js.map +0 -1
  288. package/dist/DataTable-E8z0H8c7.js.map +0 -1
  289. package/dist/DndHandleButton-CHTOYRlq.js.map +0 -1
  290. package/dist/Menu-W0c-xKdX.js.map +0 -1
  291. package/dist/MultiSelectFieldSync-CXX2F0ru.js.map +0 -1
  292. package/dist/MultiSelectMenuSync-EKtvlL62.js.map +0 -1
  293. package/dist/Pagination-Bmd4JORe.js.map +0 -1
  294. package/dist/Popover-8mTJoMy7.js.map +0 -1
  295. package/dist/RichTextEditor-DstVbYch.js.map +0 -1
  296. package/dist/SavedFiltersButton-2qba2Cgu.js.map +0 -1
  297. package/dist/Toaster-CoChsMD0.js.map +0 -1
  298. package/dist/Tooltip-yr1D06BE.js.map +0 -1
  299. package/dist/filter-state-Bx3aYS1r.js.map +0 -1
  300. package/dist/keyboard_arrow_right-DZWNVytH.js +0 -8
  301. package/dist/keyboard_arrow_right-DZWNVytH.js.map +0 -1
  302. package/dist/syncFilterUtils-BEKek64h.js.map +0 -1
  303. package/dist/useInfiniteCombobox-CknXmqlQ.js.map +0 -1
  304. package/dist/useMenuInteraction-CpAOHSJu.js.map +0 -1
  305. /package/dist/{useMenuInteraction.css → MenuFooter.css} +0 -0
@@ -0,0 +1,57 @@
1
+ import { TreeSelectFieldNode } from '../types';
2
+ import { VisibleNode } from './types';
3
+ /**
4
+ * Props for the VirtualizedTreePanel component.
5
+ * @property visibleNodes - Flat list of currently visible tree nodes.
6
+ * @property getCheckState - Returns the visual check state for a node ID.
7
+ * @property toggleNode - Toggles selection for the given node ID.
8
+ * @property toggleExpand - Expands or collapses the given branch node ID.
9
+ * @property getTreeItemProps - Returns ARIA props for a given node ID.
10
+ * @property treeProps - ARIA props for the tree container element.
11
+ * @property activeDescendantId - The id attribute of the focused treeitem, for aria-activedescendant.
12
+ * @property branchesSelectable - When true, branch nodes can be selected.
13
+ * @property leavesSelectable - When true, leaf nodes can be selected.
14
+ * @property onLoadChildren - Callback to lazily load children for a node with children===null.
15
+ */
16
+ export type VirtualizedTreePanelProps = {
17
+ visibleNodes: VisibleNode[];
18
+ getCheckState: (id: string | number) => "checked" | "unchecked" | "indeterminate" | "loading";
19
+ toggleNode: (id: string | number) => void;
20
+ toggleExpand: (id: string | number) => void;
21
+ getTreeItemProps: (id: string | number) => Record<string, unknown>;
22
+ treeProps: Record<string, unknown>;
23
+ activeDescendantId: string | undefined;
24
+ branchesSelectable?: boolean;
25
+ leavesSelectable?: boolean;
26
+ emptyBranchesSelectable?: boolean;
27
+ readOnly?: boolean;
28
+ onHover?: (id: string | number) => void;
29
+ onLoadChildren?: (node: TreeSelectFieldNode) => void;
30
+ };
31
+ /**
32
+ * VirtualizedTreePanel renders a virtualized tree list using @tanstack/react-virtual,
33
+ * only mounting DOM nodes for visible rows. Intended for large tree datasets.
34
+ *
35
+ * Features:
36
+ * - Only renders visible rows via @tanstack/react-virtual for performance
37
+ * - Same visual output and interaction model as a non-virtualized tree panel
38
+ * - Supports multi-select checkboxes and single-select modes
39
+ * - Expand/collapse branch nodes with optional lazy loading
40
+ * - Keyboard navigation via onKeyDown handler
41
+ * - Full ARIA tree semantics (role, aria-level, aria-expanded, etc.)
42
+ * - Optional child count display on branch nodes
43
+ * - Breadcrumb display for flattened search results
44
+ *
45
+ * @example
46
+ * <VirtualizedTreePanel
47
+ * visibleNodes={visibleNodes}
48
+ * getCheckState={getCheckState}
49
+ * toggleNode={toggleNode}
50
+ * toggleExpand={toggleExpand}
51
+ * getTreeItemProps={getTreeItemProps}
52
+ * treeProps={treeProps}
53
+ * onKeyDown={onKeyDown}
54
+ * activeDescendantId={activeDescendantId}
55
+ * />
56
+ */
57
+ export declare const VirtualizedTreePanel: import('react').ForwardRefExoticComponent<VirtualizedTreePanelProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,33 @@
1
+ import { MatchSorterOptions } from 'match-sorter';
2
+ import { TreeSelectFieldNode } from '../types';
3
+ /**
4
+ * Filter function for narrowing tree options against a search value.
5
+ * Receives the full options tree and returns the (possibly pruned) tree to display.
6
+ */
7
+ export type TreeSyncFilterFn = (options: TreeSelectFieldNode[], searchValue: string) => TreeSelectFieldNode[];
8
+ /**
9
+ * Recursively populates `childCount` (number of immediate children) on every
10
+ * loaded branch that doesn't already declare one, returning a new tree.
11
+ *
12
+ * This is computed from the full static `options` *before* any search filter
13
+ * runs, so the count reflects the real child set rather than the filtered
14
+ * subset. `computeCheckStates` relies on `childCount` to detect that a branch
15
+ * is only partially represented (e.g. during search) and avoid showing a
16
+ * partially-selected branch as fully checked.
17
+ *
18
+ * @param nodes - The tree nodes to process.
19
+ * @returns A new array of nodes with childCount set on branch nodes.
20
+ */
21
+ export declare function applyChildCounts(nodes: TreeSelectFieldNode[]): TreeSelectFieldNode[];
22
+ /**
23
+ * Default tree-aware filter. Matches on label and searchText, preserving
24
+ * ancestors of matched nodes.
25
+ */
26
+ export declare function defaultTreeSyncFilter(nodes: TreeSelectFieldNode[], searchValue: string): TreeSelectFieldNode[];
27
+ /**
28
+ * Coerces a `TreeSyncFilterFn` or `MatchSorterOptions` into a
29
+ * `TreeSyncFilterFn`. When given options, the resulting filter flattens the
30
+ * tree, runs match-sorter, and prunes the original tree to keep ancestors of
31
+ * matched nodes.
32
+ */
33
+ export declare function toTreeSyncFilterFn(filter: TreeSyncFilterFn | MatchSorterOptions<TreeSelectFieldNode>): TreeSyncFilterFn;
@@ -0,0 +1,25 @@
1
+ import { TreeSelectFieldNode } from '../types';
2
+ /**
3
+ * Recursively finds the first node in the tree matching the given id.
4
+ *
5
+ * @param nodes - The tree nodes to search.
6
+ * @param id - The id of the node to find.
7
+ * @returns The matching node, or undefined if no node has the given id.
8
+ */
9
+ export declare function findNode(nodes: TreeSelectFieldNode[], id: string | number): TreeSelectFieldNode | undefined;
10
+ /**
11
+ * Returns true when the given node or any of its descendants still need to
12
+ * be lazy-loaded (i.e. has `children: null`).
13
+ *
14
+ * @param node - The node to inspect.
15
+ * @returns Whether any descendant branch is still unloaded.
16
+ */
17
+ export declare function hasUnloadedDescendants(node: TreeSelectFieldNode): boolean;
18
+ /**
19
+ * Returns all descendant branches of the given node whose children have not
20
+ * yet been loaded (i.e. `children: null`). The node itself is not included.
21
+ *
22
+ * @param node - The ancestor node to walk.
23
+ * @returns Every descendant branch that still requires lazy loading.
24
+ */
25
+ export declare function findUnloadedDescendants(node: TreeSelectFieldNode): TreeSelectFieldNode[];
@@ -0,0 +1,12 @@
1
+ import { TreeSelectFieldNode } from '../types';
2
+ /**
3
+ * Internal representation of a visible node in the flattened tree.
4
+ */
5
+ export type VisibleNode = {
6
+ node: TreeSelectFieldNode;
7
+ depth: number;
8
+ isExpanded: boolean;
9
+ isBranch: boolean;
10
+ isLoading: boolean;
11
+ isEmptyPlaceholder?: boolean;
12
+ };
@@ -0,0 +1,99 @@
1
+ import { KeyboardEvent } from 'react';
2
+ import { TreeSelectFieldNode, TreeSelectFieldValue, TreeSelectFieldValueConsistsOf } from '../types';
3
+ import { VisibleNode } from './types';
4
+ import { CheckState } from './useTreeCascade';
5
+ /**
6
+ * Options for the useTree hook.
7
+ * @property nodes - The full tree data.
8
+ * @property value - Controlled selected values.
9
+ * @property onSelectedOptionsChange - Callback when selection changes.
10
+ * @property selectionMode - "single", "independent", or "linked" (default).
11
+ * @property valueConsistsOf - Controls which nodes are selectable and how the value is shaped.
12
+ * @property defaultExpandLevel - Initial expand depth. 0 = collapsed, Infinity = all.
13
+ * @property expandedIds - Controlled set of expanded node IDs.
14
+ * @property onExpandedIdsChange - Callback when expanded IDs change (controlled mode).
15
+ * @property searchValue - Filter string applied to the tree.
16
+ * @property ancestry - childId → parentId map from the loader, used to attribute
17
+ * off-screen ("orphan") selections to their ancestor branches.
18
+ * @property loadingChildrenIds - Set of node IDs whose children are currently being fetched.
19
+ */
20
+ export type UseTreeOptions = {
21
+ nodes: TreeSelectFieldNode[];
22
+ value: TreeSelectFieldValue[];
23
+ onSelectedOptionsChange: (nodes: TreeSelectFieldValue[]) => void;
24
+ selectionMode?: "single" | "independent" | "linked";
25
+ valueConsistsOf?: TreeSelectFieldValueConsistsOf;
26
+ defaultExpandLevel?: number;
27
+ expandedIds?: Set<string | number>;
28
+ onExpandedIdsChange?: (ids: Set<string | number>) => void;
29
+ searchValue?: string;
30
+ ancestry?: Map<string | number, string | number>;
31
+ loadingChildrenIds?: Set<string | number>;
32
+ };
33
+ /**
34
+ * ARIA props returned per tree item.
35
+ */
36
+ export type TreeItemProps = {
37
+ id: string;
38
+ role: "treeitem";
39
+ "aria-level": number;
40
+ "aria-setsize": number;
41
+ "aria-posinset": number;
42
+ "aria-expanded"?: boolean;
43
+ "aria-selected": boolean;
44
+ };
45
+ /**
46
+ * ARIA props for the tree container.
47
+ */
48
+ export type TreeContainerProps = {
49
+ role: "tree";
50
+ "aria-activedescendant": string | undefined;
51
+ "aria-multiselectable": boolean;
52
+ };
53
+ /**
54
+ * Return value from the useTree hook.
55
+ * @property visibleNodes - Flat list of currently visible nodes.
56
+ * @property getCheckState - Returns the visual check state for a node ID.
57
+ * @property toggleNode - Toggles selection for the given node ID.
58
+ * @property isExpanded - Returns whether the given node ID is expanded.
59
+ * @property toggleExpand - Expands or collapses the given branch node ID.
60
+ * @property expandAll - Expands all branch nodes.
61
+ * @property collapseAll - Collapses all branch nodes.
62
+ * @property activeDescendantId - The id attribute of the focused treeitem, for aria-activedescendant.
63
+ * @property onKeyDown - Keyboard event handler for the tree container.
64
+ * @property getTreeItemProps - Returns ARIA props for a given node ID.
65
+ * @property treeProps - ARIA props for the tree container element.
66
+ */
67
+ export type UseTreeReturn = {
68
+ nodes: TreeSelectFieldNode[];
69
+ visibleNodes: VisibleNode[];
70
+ getCheckState: (id: string | number) => CheckState;
71
+ toggleNode: (id: string | number) => void;
72
+ isExpanded: (id: string | number) => boolean;
73
+ toggleExpand: (id: string | number) => void;
74
+ expandAll: () => void;
75
+ collapseAll: () => void;
76
+ activeDescendantId: string | undefined;
77
+ setActiveNodeId: (id: string | number) => void;
78
+ onKeyDown: (e: KeyboardEvent) => void;
79
+ getTreeItemProps: (id: string | number) => TreeItemProps;
80
+ treeProps: TreeContainerProps;
81
+ };
82
+ /**
83
+ * Core tree state hook that manages expansion, selection, keyboard navigation,
84
+ * search filtering, and ARIA attributes for a tree widget.
85
+ *
86
+ * Features:
87
+ * - Uncontrolled expansion state by default; fully controlled via expandedIds/onExpandedIdsChange
88
+ * - defaultExpandLevel for initial expansion depth
89
+ * - expandAll / collapseAll helpers
90
+ * - Delegates selection logic to computeCheckStates and toggleNodeSelection from useTreeCascade
91
+ * - valueConsistsOf determines which nodes are selectable
92
+ * - Search filtering that preserves tree structure
93
+ * - Full keyboard navigation (WAI-ARIA tree pattern)
94
+ * - ARIA attribute generation for tree container and tree items
95
+ *
96
+ * @param options - Configuration options for the tree state.
97
+ * @returns Tree state and handlers.
98
+ */
99
+ export declare function useTree(options: UseTreeOptions): UseTreeReturn;
@@ -0,0 +1,93 @@
1
+ import { TreeSelectFieldNode, TreeSelectFieldValue, TreeSelectFieldValueConsistsOf } from '../types';
2
+ import { CheckState } from '../../../../types';
3
+ export type { CheckState };
4
+ /**
5
+ * Computes the visual check state for every node in the tree.
6
+ *
7
+ * In "linked" mode parents reflect the aggregate state of their children:
8
+ * - checked — all non-disabled children are checked
9
+ * - indeterminate — some but not all non-disabled children are checked
10
+ * - unchecked — no children are checked
11
+ *
12
+ * In "independent" / "single" mode (and for BRANCH_ONLY) each node is checked
13
+ * only when its id appears in the value array; no cascade is applied. A node's
14
+ * own selection lives in `value` regardless of what is loaded, so these modes
15
+ * are unaffected by lazy/filtered loading.
16
+ *
17
+ * ## Under-represented branches (lazy / filtered)
18
+ *
19
+ * In linked mode a branch's aggregate state is derived from its children. But
20
+ * the tree passed in is only ever what is currently *loaded* — during search it
21
+ * is the filtered subset, and lazy branches (`children === null`) or partially
22
+ * loaded branches don't expose their full child set. A branch is
23
+ * "under-represented" when its loaded children are known to be fewer than its
24
+ * real children (`children === null`, or `loadedCount < childCount`). For these
25
+ * we infer rather than aggregate:
26
+ * - the branch's own id is checked → `checked`
27
+ * - any *loaded* descendant is checked/indeterminate → `indeterminate`
28
+ * (it can't be fully checked because unknown children exist)
29
+ * - otherwise, if the branch is a known ancestor of an "orphan" selection (a
30
+ * checked id that isn't in the currently-loaded tree — e.g. a descendant of a
31
+ * collapsed lazy branch), via `orphanAncestorIds` → `indeterminate`
32
+ * - otherwise → `unchecked`
33
+ *
34
+ * Orphan attribution is *path-scoped*: only branches on the resolved ancestor
35
+ * path of an orphaned selection are marked, so unrelated collapsed siblings stay
36
+ * `unchecked`. The caller resolves those ancestors (from a value's `path` or the
37
+ * loader's ancestry map) and passes them in `orphanAncestorIds`. An orphan whose
38
+ * ancestry is unknown contributes nothing (its branch shows `unchecked` until
39
+ * its parent loads, then self-corrects).
40
+ *
41
+ * One limitation remains: accurate filtered-branch state requires
42
+ * server-/consumer-provided `childCount` — a partially-loaded branch without a
43
+ * `childCount` falls back to aggregating only its visible children.
44
+ *
45
+ * @param nodes - The currently loaded (possibly filtered) tree.
46
+ * @param value - The current value array.
47
+ * @param selectionMode - "single", "independent", or "linked".
48
+ * @param valueConsistsOf - Strategy used when computing check states.
49
+ * @param orphanAncestorIds - Branch ids that lie on the resolved ancestor path
50
+ * of an orphaned selection. Such under-represented branches render
51
+ * `indeterminate`. Defaults to empty (no orphan inference).
52
+ * @returns A Map from node id to CheckState.
53
+ */
54
+ export declare function computeCheckStates(nodes: TreeSelectFieldNode[], value: TreeSelectFieldValue[], selectionMode: "single" | "independent" | "linked", valueConsistsOf: TreeSelectFieldValueConsistsOf, orphanAncestorIds?: Set<string | number>): Map<string | number, CheckState>;
55
+ /**
56
+ * Given a set of checked node IDs and a value strategy, returns the value
57
+ * array according to the strategy.
58
+ *
59
+ * - "ALL" — every checked node
60
+ * - "BRANCH_PRIORITY" — branch replaces its leaves when all non-disabled
61
+ * children are checked; otherwise individual leaves
62
+ * - "LEAF_PRIORITY" — leaves only, unless the node is a branch with an empty
63
+ * or null children list (leaf-less branch)
64
+ * - "LEAF_ONLY" — strictly leaves; branches are never included
65
+ *
66
+ * @param nodes - The full tree.
67
+ * @param checkedIds - Set of IDs that are checked.
68
+ * @param valueConsistsOf - Strategy to apply.
69
+ * @returns The value array.
70
+ */
71
+ export declare function computeValue(nodes: TreeSelectFieldNode[], checkedIds: Set<string | number>, valueConsistsOf: TreeSelectFieldValueConsistsOf): TreeSelectFieldValue[];
72
+ /**
73
+ * Toggles a node's selection and returns the new value array.
74
+ *
75
+ * In "single" mode:
76
+ * - Replaces the entire selection with the clicked node (or empties if already selected).
77
+ *
78
+ * In "independent" mode:
79
+ * - Only the clicked node is toggled; no cascade.
80
+ *
81
+ * In "linked" mode:
82
+ * - Selecting a branch selects all non-disabled descendants recursively.
83
+ * - Deselecting a branch deselects all non-disabled descendants recursively.
84
+ * - Disabled nodes are never modified.
85
+ *
86
+ * @param nodes - The full tree.
87
+ * @param currentValue - The current value array.
88
+ * @param nodeId - The id of the node to toggle.
89
+ * @param selectionMode - "single", "independent", or "linked".
90
+ * @param valueConsistsOf - Strategy to apply when computing the returned value.
91
+ * @returns The new value array.
92
+ */
93
+ export declare function toggleNodeSelection(nodes: TreeSelectFieldNode[], currentValue: TreeSelectFieldValue[], nodeId: string | number, selectionMode: "single" | "independent" | "linked", valueConsistsOf: TreeSelectFieldValueConsistsOf): TreeSelectFieldValue[];
@@ -0,0 +1,42 @@
1
+ import { KeyboardEvent } from 'react';
2
+ import { VisibleNode } from './types';
3
+ /**
4
+ * Options for the keyboard event handler.
5
+ * @property visibleNodes - The current flat list of visible nodes.
6
+ * @property activeIndex - Index into visibleNodes of the currently focused node, or -1.
7
+ * @property setActiveIndex - Setter for the active index.
8
+ * @property isExpanded - Returns whether a node is expanded.
9
+ * @property toggleExpand - Expands or collapses a branch node.
10
+ * @property toggleNode - Toggles selection for a node.
11
+ */
12
+ export type UseTreeKeyboardOptions = {
13
+ visibleNodes: VisibleNode[];
14
+ activeIndex: number;
15
+ setActiveIndex: (index: number) => void;
16
+ isExpanded: (id: string | number) => boolean;
17
+ toggleExpand: (id: string | number) => void;
18
+ toggleNode: (id: string | number) => void;
19
+ };
20
+ /**
21
+ * Handles keyboard navigation for a tree widget rooted on a combobox input.
22
+ *
23
+ * Focus stays on the input at all times; the tree uses aria-activedescendant
24
+ * to convey the focused node. Returns `true` when the key was handled so the
25
+ * caller can decide whether to let the event propagate (e.g. ArrowLeft/Right
26
+ * falling through to cursor movement inside the input).
27
+ *
28
+ * - ArrowDown: move to next visible node
29
+ * - ArrowUp: move to previous visible node
30
+ * - ArrowRight: expand collapsed branch or move to first child; returns false
31
+ * when there is nothing to do so the cursor can move inside the input
32
+ * - ArrowLeft: collapse expanded branch or move to parent; returns false when
33
+ * there is nothing to do so the cursor can move inside the input
34
+ * - Home: move to first visible node
35
+ * - End: move to last visible node
36
+ * - Enter: toggle selection of focused node
37
+ *
38
+ * @param e - The keyboard event.
39
+ * @param options - The current tree state and callbacks.
40
+ * @returns Whether the key was handled by tree navigation.
41
+ */
42
+ export declare function handleTreeKeyDown(e: KeyboardEvent, options: UseTreeKeyboardOptions): boolean;
@@ -0,0 +1,56 @@
1
+ import { UseTreeReturn } from './useTree';
2
+ import { UseTreeLoaderReturn } from './useTreeLoader';
3
+ /**
4
+ * Options for {@link useTreeLazyCascade}.
5
+ *
6
+ * @property tree - Tree state from useTree, used to read nodes and run toggles.
7
+ * @property loader - Tree loader, used to lazy-load unloaded descendants.
8
+ * @property isSingleSelect - Whether the consumer is in single-select mode; controls auto-close after a successful toggle.
9
+ * @property branchesSelectable - Whether branch nodes can be selected (vs only expanded).
10
+ * @property leavesSelectable - Whether leaf nodes can be selected.
11
+ * @property emptyBranchesSelectable - Whether branches with an empty children array can be selected.
12
+ * @property readOnly - When true, all toggle attempts no-op.
13
+ * @property onCloseAfterSingleSelect - Called after a successful single-select toggle so the consumer can close its menu and restore focus.
14
+ */
15
+ export type UseTreeLazyCascadeOptions = {
16
+ tree: UseTreeReturn;
17
+ loader: UseTreeLoaderReturn;
18
+ isSingleSelect: boolean;
19
+ branchesSelectable: boolean;
20
+ leavesSelectable: boolean;
21
+ emptyBranchesSelectable: boolean;
22
+ readOnly?: boolean;
23
+ onCloseAfterSingleSelect?: () => void;
24
+ };
25
+ /**
26
+ * Return value of {@link useTreeLazyCascade}.
27
+ *
28
+ * @property handleToggleNode - Click/Space handler for a tree row that respects selectability and loads any unloaded descendants before cascading.
29
+ * @property pendingToggleNodeId - The id of the node currently waiting on lazy loads to complete (used to render a loading checkbox), or null.
30
+ * @property reset - Clears any in-flight pending toggle. Call from the consumer's closeMenu so reopening starts clean.
31
+ */
32
+ export type UseTreeLazyCascadeReturn = {
33
+ handleToggleNode: (nodeId: string | number) => void;
34
+ pendingToggleNodeId: string | number | null;
35
+ reset: () => void;
36
+ };
37
+ /**
38
+ * Coordinates "toggle a tree node, but lazy-load any unloaded descendants
39
+ * first" — the bit of orchestration that sits between useTree and
40
+ * useTreeLoader and is shared between TreeSelectField and TreeSelectMenu.
41
+ *
42
+ * When the consumer clicks a branch whose subtree isn't fully loaded, the
43
+ * hook records the pending toggle, kicks off loadChildren for every
44
+ * unloaded descendant, and then — once all loads are complete — fires
45
+ * tree.toggleNode so cascade selection can run against the now-complete
46
+ * subtree. While loads are in flight, pendingToggleNodeId points at the
47
+ * originally-clicked node so the consumer can render a loading state on
48
+ * its checkbox.
49
+ *
50
+ * Non-selectable branches expand instead of toggling; non-selectable
51
+ * leaves no-op. Read-only consumers can pass readOnly to short-circuit.
52
+ *
53
+ * @param options - See {@link UseTreeLazyCascadeOptions}.
54
+ * @returns Toggle handler, current pending node id, and a reset function.
55
+ */
56
+ export declare function useTreeLazyCascade(options: UseTreeLazyCascadeOptions): UseTreeLazyCascadeReturn;
@@ -0,0 +1,58 @@
1
+ import { TreeSelectFieldNode } from '../types';
2
+ /**
3
+ * Options for the useTreeLoader hook.
4
+ * @property loadOptions - Async function to load tree nodes. Called with searchValue and optional parentNode.
5
+ * @property cache - Cache configuration. Enabled by default with maxSize of 15.
6
+ * @property initialLoad - Controls when the initial load occurs. "auto" and "immediate" load on mount, "open" loads on first onOpen() call.
7
+ * @property debounceMs - Debounce delay in milliseconds for search calls. Defaults to 200.
8
+ */
9
+ export type UseTreeLoaderOptions = {
10
+ loadOptions: (searchValue: string, parentNode?: TreeSelectFieldNode) => TreeSelectFieldNode[] | Promise<TreeSelectFieldNode[]>;
11
+ cache?: {
12
+ enabled?: boolean;
13
+ maxSize?: number;
14
+ };
15
+ initialLoad?: "auto" | "immediate" | "open";
16
+ debounceMs?: number;
17
+ };
18
+ /**
19
+ * Return value from the useTreeLoader hook.
20
+ * @property nodes - The currently loaded tree nodes.
21
+ * @property ancestry - Durable childId → parentId map accumulated from lazy
22
+ * children loads; survives tree resets so off-screen selections can be
23
+ * attributed to their ancestors.
24
+ * @property isLoading - Whether a root/search load is in progress.
25
+ * @property isLoadingChildren - Set of node IDs whose children are currently loading.
26
+ * @property loadChildren - Loads children for the given branch node (lazy expansion).
27
+ * @property search - Triggers a search load with the given search value (debounced).
28
+ * @property clearCache - Clears both the search and children caches.
29
+ * @property invalidate - Clears both caches and triggers a fresh load.
30
+ * @property onOpen - Triggers the initial load when initialLoad="open". No-op otherwise or after first open.
31
+ */
32
+ export type UseTreeLoaderReturn = {
33
+ nodes: TreeSelectFieldNode[];
34
+ ancestry: Map<string | number, string | number>;
35
+ isLoading: boolean;
36
+ isLoadingChildren: Set<string | number>;
37
+ loadChildren: (parentNode: TreeSelectFieldNode) => Promise<TreeSelectFieldNode[]>;
38
+ search: (searchValue: string) => void;
39
+ clearCache: () => void;
40
+ invalidate: () => void;
41
+ onOpen: () => void;
42
+ };
43
+ /**
44
+ * Hook that manages async loading and caching for tree data.
45
+ *
46
+ * Features:
47
+ * - Handles root/search loading and lazy branch expansion via a single loadOptions callback
48
+ * - Two separate LRU caches: one for search results, one for lazy-loaded children
49
+ * - Configurable cache size and opt-out support
50
+ * - Debounced search to reduce unnecessary loadOptions calls
51
+ * - initialLoad modes: "immediate"/"auto" load on mount, "open" defers until onOpen() is called
52
+ * - Children are merged into the node tree after loading, updating children: null to the loaded array
53
+ * - invalidate() clears caches and triggers a fresh load of the current view
54
+ *
55
+ * @param options - Configuration options for the tree loader.
56
+ * @returns Current nodes, loading states, and loader control functions.
57
+ */
58
+ export declare function useTreeLoader(options: UseTreeLoaderOptions): UseTreeLoaderReturn;
@@ -0,0 +1,21 @@
1
+ import { TreeSelectFieldNode } from '../types';
2
+ /**
3
+ * Realistic multi-level org chart for stories and tests.
4
+ * 4 levels deep: Company divisions > Departments > Teams > Individuals
5
+ */
6
+ export declare const orgChart: TreeSelectFieldNode[];
7
+ /**
8
+ * Async version: root nodes with children: null (lazy-loaded).
9
+ */
10
+ export declare const asyncOrgChartRoots: TreeSelectFieldNode[];
11
+ /**
12
+ * Simulates an async loadOptions for stories.
13
+ * Supports search filtering on roots and lazy child loading.
14
+ */
15
+ export declare function simulatedLoadOptions(searchValue: string, parentNode?: TreeSelectFieldNode): Promise<TreeSelectFieldNode[]>;
16
+ /**
17
+ * Simulates multi-level lazy loading. Each expansion returns immediate
18
+ * children with branches having children: null (requiring another load).
19
+ * Every level shows a spinner while loading.
20
+ */
21
+ export declare function multiLevelLoadOptions(searchValue: string, parentNode?: TreeSelectFieldNode): Promise<TreeSelectFieldNode[]>;
@@ -0,0 +1,124 @@
1
+ import { CSSProperties, ReactElement, ReactNode } from 'react';
2
+ import { AiMarkWithTooltipOrPopoverProps, LayoutUtilProps, Size } from '../../../types';
3
+ import { OptionContent } from '../../../internal/types/optionContent';
4
+ /**
5
+ * Rich content configuration for a TreeSelectField option row.
6
+ * Controls the avatar, icon, description, and chip display within an option.
7
+ */
8
+ export type TreeSelectFieldOptionContent = OptionContent;
9
+ /**
10
+ * A node in the tree structure.
11
+ * @property id - Unique identifier for the node.
12
+ * @property label - Display text for the node.
13
+ * @property searchText - Additional text to match during search, beyond label.
14
+ * @property disabled - Whether the node is disabled for selection.
15
+ * @property extra - Pass-through data for consumer convenience.
16
+ * @property children - Child nodes. undefined=leaf, []=empty branch, [...]=branch, null=unloaded (lazy).
17
+ * @property childCount - Server-provided count, optionally displayed on branch nodes.
18
+ * @property path - Optional ancestor ids, root→parent. Selection-ancestry
19
+ * metadata, primarily meaningful on value objects: when a selected node lives
20
+ * under branches that aren't currently loaded, `path` lets the field show the
21
+ * correct ancestor check states without a parent-of lookup. The field emits
22
+ * it on selections whose ancestry it knows, and reads it from incoming value
23
+ * so a persisted-then-restored selection resolves exactly. Not a structural
24
+ * tree attribute — omit it on `loadOptions` results.
25
+ */
26
+ export type TreeSelectFieldNode = {
27
+ id: string | number;
28
+ label: string;
29
+ searchText?: string;
30
+ disabled?: boolean;
31
+ extra?: Record<string, unknown>;
32
+ content?: TreeSelectFieldOptionContent;
33
+ children?: TreeSelectFieldNode[] | null;
34
+ childCount?: number;
35
+ path?: (string | number)[];
36
+ };
37
+ /**
38
+ * The value shape stored in the value array. Intentionally slim — just enough to render chips and identify the node.
39
+ * @property id - The node's unique identifier.
40
+ * @property label - The node's display text.
41
+ * @property extra - Pass-through data from the node.
42
+ * @property path - Optional ancestor ids, root→parent. See {@link TreeSelectFieldNode.path}.
43
+ */
44
+ export type TreeSelectFieldValue = Pick<TreeSelectFieldNode, "id" | "label" | "extra" | "path">;
45
+ /**
46
+ * Controls which nodes are selectable and how the value array is shaped.
47
+ * - "ALL" — any node selectable, all checked nodes in value
48
+ * - "BRANCH_PRIORITY" — any node selectable, branches replace leaves when fully checked
49
+ * - "BRANCH_ONLY" — only branches selectable, leaves visible but inert
50
+ * - "LEAF_PRIORITY" — only leaves selectable (branches expand), leaves + childless branches in value
51
+ * - "LEAF_ONLY" — only leaves selectable (branches expand), strictly leaves in value
52
+ */
53
+ export type TreeSelectFieldValueConsistsOf = "ALL" | "BRANCH_PRIORITY" | "BRANCH_ONLY" | "LEAF_PRIORITY" | "LEAF_ONLY";
54
+ /**
55
+ * Imperative handle for the TreeSelectField component.
56
+ * @property clearCache - Clears the options cache.
57
+ * @property invalidate - Clears the cache and triggers a fresh options load.
58
+ * @property expandAll - Expands all tree nodes.
59
+ * @property collapseAll - Collapses all tree nodes.
60
+ */
61
+ export type TreeSelectFieldHandle = {
62
+ clearCache: () => void;
63
+ invalidate: () => void;
64
+ expandAll: () => void;
65
+ collapseAll: () => void;
66
+ };
67
+ /**
68
+ * Props for the TreeSelectField component.
69
+ * @property label - Required label for accessibility.
70
+ * @property value - Controlled value array. Always an array, even in single-select mode.
71
+ * @property onSelectedOptionsChange - Callback when selection changes.
72
+ * @property loadOptions - Async function to load tree nodes. Called with parentNode for lazy branch loading.
73
+ * @property selectionMode - "single": one node at a time. "independent": no cascade. "linked" (default): parent-child cascade.
74
+ * @property valueConsistsOf - Controls which nodes are selectable and how the value is shaped.
75
+ * @property defaultExpandLevel - Initial expand depth. 0=collapsed, Infinity=all.
76
+ * @extends LayoutUtilProps
77
+ */
78
+ export type TreeSelectFieldProps = {
79
+ id?: string;
80
+ label: string;
81
+ labelNode?: ReactNode;
82
+ hideLabel?: boolean;
83
+ placeholder?: string;
84
+ size?: Extract<Size, "small" | "medium" | "large">;
85
+ displayMenuAs?: "auto" | "popover" | "dialog";
86
+ error?: boolean | string | string[] | ReactElement;
87
+ hint?: ReactElement | string;
88
+ /** Additional information to display in a tooltip next to the label. */
89
+ moreInfo?: ReactNode;
90
+ /**
91
+ * AI mark configuration to display next to the label.
92
+ * Can be a boolean to show a simple AI mark, or an object with tooltip/popover configuration.
93
+ */
94
+ labelAiMark?: AiMarkWithTooltipOrPopoverProps["aiMark"];
95
+ description?: ReactElement | string;
96
+ warning?: string | string[];
97
+ required?: boolean;
98
+ disabled?: boolean;
99
+ readOnly?: boolean;
100
+ prefix?: string | ReactElement;
101
+ suffix?: string | ReactElement;
102
+ className?: string;
103
+ style?: CSSProperties;
104
+ disableSearch?: boolean;
105
+ debounceMs?: number;
106
+ searchValue?: string;
107
+ onSearchChange?: (v: string) => void;
108
+ singleRow?: boolean;
109
+ maxChips?: number;
110
+ virtualize?: boolean;
111
+ value: TreeSelectFieldValue[];
112
+ onSelectedOptionsChange: (nodes: TreeSelectFieldValue[]) => void;
113
+ selectionMode?: "single" | "independent" | "linked";
114
+ valueConsistsOf?: TreeSelectFieldValueConsistsOf;
115
+ defaultExpandLevel?: number;
116
+ expandedIds?: Set<string | number>;
117
+ onExpandedIdsChange?: (ids: Set<string | number>) => void;
118
+ loadOptions: (searchValue: string, parentNode?: TreeSelectFieldNode) => TreeSelectFieldNode[] | Promise<TreeSelectFieldNode[]>;
119
+ cache?: {
120
+ enabled?: boolean;
121
+ maxSize?: number;
122
+ };
123
+ initialLoad?: "auto" | "immediate" | "open";
124
+ } & LayoutUtilProps;
@@ -0,0 +1,29 @@
1
+ import { TreeSelectMenuProps } from './types';
2
+ /**
3
+ * TreeSelectMenu component for selecting tree nodes from a dropdown triggered by any element.
4
+ *
5
+ * Features:
6
+ * - Attaches to any trigger element via a render prop
7
+ * - Async tree data loading via loadOptions callback with optional LRU caching
8
+ * - Single-select and multi-select modes with linked/independent cascade
9
+ * - Cascading parent/child selection in linked mode
10
+ * - Search filtering across visible nodes
11
+ * - Lazy branch expansion with on-demand children loading
12
+ * - Virtualized rendering for large trees via the virtualize prop
13
+ * - Full keyboard navigation (ArrowDown/Up, ArrowRight/Left, Enter, Home/End, Escape)
14
+ * - Supports both popover and dialog display modes
15
+ * - Adaptive display based on device (mobile uses dialog)
16
+ * - Configurable popover width
17
+ * - Imperative handle for clearCache, invalidate, expandAll, collapseAll
18
+ * - Full accessibility support with ARIA tree attributes
19
+ *
20
+ * @example
21
+ * <TreeSelectMenu
22
+ * trigger={(props) => <Button {...props}>Select Categories</Button>}
23
+ * label="Categories"
24
+ * value={selected}
25
+ * onSelectedOptionsChange={setSelected}
26
+ * loadOptions={async (search) => fetchCategories(search)}
27
+ * />
28
+ */
29
+ export declare const TreeSelectMenu: import('react').ForwardRefExoticComponent<TreeSelectMenuProps & import('react').RefAttributes<import('..').TreeSelectFieldHandle>>;