@fluentui/react-tree 9.16.4 → 9.16.5

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 (274) hide show
  1. package/CHANGELOG.md +25 -2
  2. package/dist/index.d.cts +941 -0
  3. package/lib/FlatTree.js +1 -1
  4. package/lib/FlatTree.js.map +1 -1
  5. package/lib/FlatTreeItem.js +1 -1
  6. package/lib/FlatTreeItem.js.map +1 -1
  7. package/lib/Tree.js +1 -1
  8. package/lib/Tree.js.map +1 -1
  9. package/lib/TreeItem.js +1 -1
  10. package/lib/TreeItem.js.map +1 -1
  11. package/lib/TreeItemLayout.js +1 -1
  12. package/lib/TreeItemLayout.js.map +1 -1
  13. package/lib/TreeItemPersonaLayout.js +1 -1
  14. package/lib/TreeItemPersonaLayout.js.map +1 -1
  15. package/lib/components/FlatTree/FlatTree.js +6 -6
  16. package/lib/components/FlatTree/FlatTree.js.map +1 -1
  17. package/lib/components/FlatTree/index.js +6 -6
  18. package/lib/components/FlatTree/index.js.map +1 -1
  19. package/lib/components/FlatTree/renderFlatTree.js +1 -1
  20. package/lib/components/FlatTree/renderFlatTree.js.map +1 -1
  21. package/lib/components/FlatTree/useFlatControllableCheckedItems.js +4 -4
  22. package/lib/components/FlatTree/useFlatControllableCheckedItems.js.map +1 -1
  23. package/lib/components/FlatTree/useFlatTree.js +8 -8
  24. package/lib/components/FlatTree/useFlatTree.js.map +1 -1
  25. package/lib/components/FlatTree/useFlatTreeContextValues.js +1 -1
  26. package/lib/components/FlatTree/useFlatTreeStyles.styles.js +2 -2
  27. package/lib/components/FlatTree/useFlatTreeStyles.styles.js.map +1 -1
  28. package/lib/components/FlatTree/useFlatTreeStyles.styles.raw.js +2 -2
  29. package/lib/components/FlatTree/useHeadlessFlatTree.js +10 -10
  30. package/lib/components/FlatTree/useHeadlessFlatTree.js.map +1 -1
  31. package/lib/components/FlatTreeItem/FlatTreeItem.js +1 -1
  32. package/lib/components/FlatTreeItem/FlatTreeItem.js.map +1 -1
  33. package/lib/components/FlatTreeItem/index.js +1 -1
  34. package/lib/components/FlatTreeItem/index.js.map +1 -1
  35. package/lib/components/Tree/Tree.js +6 -6
  36. package/lib/components/Tree/Tree.js.map +1 -1
  37. package/lib/components/Tree/index.js +5 -5
  38. package/lib/components/Tree/index.js.map +1 -1
  39. package/lib/components/Tree/renderTree.js +2 -2
  40. package/lib/components/Tree/renderTree.js.map +1 -1
  41. package/lib/components/Tree/useNestedControllableCheckedItems.js +3 -3
  42. package/lib/components/Tree/useNestedControllableCheckedItems.js.map +1 -1
  43. package/lib/components/Tree/useTree.js +11 -11
  44. package/lib/components/Tree/useTree.js.map +1 -1
  45. package/lib/components/Tree/useTreeContextValues.js +1 -1
  46. package/lib/components/Tree/useTreeStyles.styles.js +2 -2
  47. package/lib/components/Tree/useTreeStyles.styles.js.map +1 -1
  48. package/lib/components/Tree/useTreeStyles.styles.raw.js +2 -2
  49. package/lib/components/TreeItem/TreeItem.js +6 -6
  50. package/lib/components/TreeItem/TreeItem.js.map +1 -1
  51. package/lib/components/TreeItem/index.js +5 -5
  52. package/lib/components/TreeItem/index.js.map +1 -1
  53. package/lib/components/TreeItem/renderTreeItem.js +2 -2
  54. package/lib/components/TreeItem/renderTreeItem.js.map +1 -1
  55. package/lib/components/TreeItem/useTreeItem.js +9 -9
  56. package/lib/components/TreeItem/useTreeItem.js.map +1 -1
  57. package/lib/components/TreeItem/useTreeItemContextValues.js +1 -1
  58. package/lib/components/TreeItem/useTreeItemStyles.styles.js +6 -6
  59. package/lib/components/TreeItem/useTreeItemStyles.styles.js.map +1 -1
  60. package/lib/components/TreeItem/useTreeItemStyles.styles.raw.js +6 -6
  61. package/lib/components/TreeItem/useTreeItemStyles.styles.raw.js.map +1 -1
  62. package/lib/components/TreeItemChevron.js +5 -5
  63. package/lib/components/TreeItemChevron.js.map +1 -1
  64. package/lib/components/TreeItemLayout/TreeItemLayout.js +5 -5
  65. package/lib/components/TreeItemLayout/TreeItemLayout.js.map +1 -1
  66. package/lib/components/TreeItemLayout/index.js +4 -4
  67. package/lib/components/TreeItemLayout/index.js.map +1 -1
  68. package/lib/components/TreeItemLayout/renderTreeItemLayout.js +2 -2
  69. package/lib/components/TreeItemLayout/useTreeItemLayout.js +8 -8
  70. package/lib/components/TreeItemLayout/useTreeItemLayout.js.map +1 -1
  71. package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.styles.js +5 -5
  72. package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.styles.js.map +1 -1
  73. package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.styles.raw.js +5 -5
  74. package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.styles.raw.js.map +1 -1
  75. package/lib/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js +6 -6
  76. package/lib/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js.map +1 -1
  77. package/lib/components/TreeItemPersonaLayout/index.js +4 -4
  78. package/lib/components/TreeItemPersonaLayout/index.js.map +1 -1
  79. package/lib/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js +3 -3
  80. package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js +6 -6
  81. package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js.map +1 -1
  82. package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutContextValues.js +1 -1
  83. package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.styles.js +5 -5
  84. package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.styles.js.map +1 -1
  85. package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.styles.raw.js +5 -5
  86. package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.styles.raw.js.map +1 -1
  87. package/lib/components/TreeProvider.js +2 -2
  88. package/lib/components/TreeProvider.js.map +1 -1
  89. package/lib/contexts/index.js +3 -3
  90. package/lib/contexts/index.js.map +1 -1
  91. package/lib/contexts/subtreeContext.js +1 -1
  92. package/lib/contexts/treeContext.js +3 -3
  93. package/lib/contexts/treeContext.js.map +1 -1
  94. package/lib/contexts/treeItemContext.js +3 -3
  95. package/lib/contexts/treeItemContext.js.map +1 -1
  96. package/lib/hooks/useControllableOpenItems.js +3 -3
  97. package/lib/hooks/useControllableOpenItems.js.map +1 -1
  98. package/lib/hooks/useFlatTreeNavigation.js +9 -9
  99. package/lib/hooks/useFlatTreeNavigation.js.map +1 -1
  100. package/lib/hooks/useHTMLElementWalkerRef.js +4 -4
  101. package/lib/hooks/useHTMLElementWalkerRef.js.map +1 -1
  102. package/lib/hooks/useRootTree.js +8 -8
  103. package/lib/hooks/useRootTree.js.map +1 -1
  104. package/lib/hooks/useRovingTabIndexes.js +3 -3
  105. package/lib/hooks/useSubtree.js +4 -4
  106. package/lib/hooks/useSubtree.js.map +1 -1
  107. package/lib/hooks/useTreeNavigation.js +8 -8
  108. package/lib/hooks/useTreeNavigation.js.map +1 -1
  109. package/lib/index.js +12 -12
  110. package/lib/index.js.map +1 -1
  111. package/lib/utils/createCheckedItems.js +1 -1
  112. package/lib/utils/createCheckedItems.js.map +1 -1
  113. package/lib/utils/createHTMLElementWalker.js +1 -1
  114. package/lib/utils/tokens.js +1 -1
  115. package/lib-commonjs/{FlatTree.js → FlatTree.cjs} +1 -1
  116. package/lib-commonjs/{FlatTree.js.map → FlatTree.cjs.map} +1 -1
  117. package/lib-commonjs/{FlatTreeItem.js → FlatTreeItem.cjs} +1 -1
  118. package/lib-commonjs/{FlatTreeItem.js.map → FlatTreeItem.cjs.map} +1 -1
  119. package/lib-commonjs/{Tree.js → Tree.cjs} +1 -1
  120. package/lib-commonjs/{Tree.js.map → Tree.cjs.map} +1 -1
  121. package/lib-commonjs/{TreeItem.js → TreeItem.cjs} +1 -1
  122. package/lib-commonjs/{TreeItem.js.map → TreeItem.cjs.map} +1 -1
  123. package/lib-commonjs/{TreeItemLayout.js → TreeItemLayout.cjs} +1 -1
  124. package/lib-commonjs/{TreeItemLayout.js.map → TreeItemLayout.cjs.map} +1 -1
  125. package/lib-commonjs/{TreeItemPersonaLayout.js → TreeItemPersonaLayout.cjs} +1 -1
  126. package/lib-commonjs/{TreeItemPersonaLayout.js.map → TreeItemPersonaLayout.cjs.map} +1 -1
  127. package/lib-commonjs/components/FlatTree/{FlatTree.js → FlatTree.cjs} +4 -4
  128. package/lib-commonjs/components/FlatTree/{FlatTree.js.map → FlatTree.cjs.map} +1 -1
  129. package/lib-commonjs/components/FlatTree/{index.js → index.cjs} +6 -6
  130. package/lib-commonjs/components/FlatTree/{index.js.map → index.cjs.map} +1 -1
  131. package/lib-commonjs/components/FlatTree/{renderFlatTree.js → renderFlatTree.cjs} +1 -1
  132. package/lib-commonjs/components/FlatTree/{renderFlatTree.js.map → renderFlatTree.cjs.map} +1 -1
  133. package/lib-commonjs/components/FlatTree/{useFlatControllableCheckedItems.js → useFlatControllableCheckedItems.cjs} +2 -2
  134. package/lib-commonjs/components/FlatTree/{useFlatControllableCheckedItems.js.map → useFlatControllableCheckedItems.cjs.map} +1 -1
  135. package/lib-commonjs/components/FlatTree/{useFlatTree.js → useFlatTree.cjs} +6 -6
  136. package/lib-commonjs/components/FlatTree/{useFlatTree.js.map → useFlatTree.cjs.map} +1 -1
  137. package/lib-commonjs/components/FlatTree/useFlatTreeStyles.styles.cjs.map +1 -0
  138. package/lib-commonjs/components/FlatTree/{useHeadlessFlatTree.js → useHeadlessFlatTree.cjs} +8 -8
  139. package/lib-commonjs/components/FlatTree/{useHeadlessFlatTree.js.map → useHeadlessFlatTree.cjs.map} +1 -1
  140. package/lib-commonjs/components/FlatTreeItem/{FlatTreeItem.js → FlatTreeItem.cjs} +1 -1
  141. package/lib-commonjs/components/FlatTreeItem/{FlatTreeItem.js.map → FlatTreeItem.cjs.map} +1 -1
  142. package/lib-commonjs/components/FlatTreeItem/{index.js → index.cjs} +1 -1
  143. package/lib-commonjs/components/FlatTreeItem/{index.js.map → index.cjs.map} +1 -1
  144. package/lib-commonjs/components/Tree/{Tree.js → Tree.cjs} +4 -4
  145. package/lib-commonjs/components/Tree/{Tree.js.map → Tree.cjs.map} +1 -1
  146. package/lib-commonjs/components/Tree/{index.js → index.cjs} +5 -5
  147. package/lib-commonjs/components/Tree/{index.js.map → index.cjs.map} +1 -1
  148. package/lib-commonjs/components/Tree/{renderTree.js → renderTree.cjs} +1 -1
  149. package/lib-commonjs/components/Tree/{renderTree.js.map → renderTree.cjs.map} +1 -1
  150. package/lib-commonjs/components/Tree/{useNestedControllableCheckedItems.js → useNestedControllableCheckedItems.cjs} +2 -2
  151. package/lib-commonjs/components/Tree/{useNestedControllableCheckedItems.js.map → useNestedControllableCheckedItems.cjs.map} +1 -1
  152. package/lib-commonjs/components/Tree/{useTree.js → useTree.cjs} +9 -9
  153. package/lib-commonjs/components/Tree/{useTree.js.map → useTree.cjs.map} +1 -1
  154. package/lib-commonjs/components/Tree/useTreeStyles.styles.cjs.map +1 -0
  155. package/lib-commonjs/components/TreeItem/{TreeItem.js → TreeItem.cjs} +4 -4
  156. package/lib-commonjs/components/TreeItem/{TreeItem.js.map → TreeItem.cjs.map} +1 -1
  157. package/lib-commonjs/components/TreeItem/{index.js → index.cjs} +5 -5
  158. package/lib-commonjs/components/TreeItem/{index.js.map → index.cjs.map} +1 -1
  159. package/lib-commonjs/components/TreeItem/{renderTreeItem.js → renderTreeItem.cjs} +2 -2
  160. package/lib-commonjs/components/TreeItem/{renderTreeItem.js.map → renderTreeItem.cjs.map} +1 -1
  161. package/lib-commonjs/components/TreeItem/{useTreeItem.js → useTreeItem.cjs} +14 -14
  162. package/lib-commonjs/components/TreeItem/{useTreeItem.js.map → useTreeItem.cjs.map} +1 -1
  163. package/lib-commonjs/components/TreeItem/{useTreeItemStyles.styles.js → useTreeItemStyles.styles.cjs} +1 -1
  164. package/lib-commonjs/components/TreeItem/useTreeItemStyles.styles.cjs.map +1 -0
  165. package/lib-commonjs/components/TreeItem/{useTreeItemStyles.styles.raw.js → useTreeItemStyles.styles.raw.cjs} +3 -3
  166. package/lib-commonjs/components/TreeItem/{useTreeItemStyles.styles.raw.js.map → useTreeItemStyles.styles.raw.cjs.map} +1 -1
  167. package/lib-commonjs/components/{TreeItemChevron.js → TreeItemChevron.cjs} +1 -1
  168. package/lib-commonjs/components/{TreeItemChevron.js.map → TreeItemChevron.cjs.map} +1 -1
  169. package/lib-commonjs/components/TreeItemLayout/{TreeItemLayout.js → TreeItemLayout.cjs} +3 -3
  170. package/lib-commonjs/components/TreeItemLayout/{TreeItemLayout.js.map → TreeItemLayout.cjs.map} +1 -1
  171. package/lib-commonjs/components/TreeItemLayout/{index.js → index.cjs} +4 -4
  172. package/lib-commonjs/components/TreeItemLayout/{index.js.map → index.cjs.map} +1 -1
  173. package/lib-commonjs/components/TreeItemLayout/{useTreeItemLayout.js → useTreeItemLayout.cjs} +12 -12
  174. package/lib-commonjs/components/TreeItemLayout/{useTreeItemLayout.js.map → useTreeItemLayout.cjs.map} +1 -1
  175. package/lib-commonjs/components/TreeItemLayout/{useTreeItemLayoutStyles.styles.js → useTreeItemLayoutStyles.styles.cjs} +2 -2
  176. package/lib-commonjs/components/TreeItemLayout/useTreeItemLayoutStyles.styles.cjs.map +1 -0
  177. package/lib-commonjs/components/TreeItemLayout/{useTreeItemLayoutStyles.styles.raw.js → useTreeItemLayoutStyles.styles.raw.cjs} +3 -3
  178. package/lib-commonjs/components/TreeItemLayout/{useTreeItemLayoutStyles.styles.raw.js.map → useTreeItemLayoutStyles.styles.raw.cjs.map} +1 -1
  179. package/lib-commonjs/components/TreeItemPersonaLayout/{TreeItemPersonaLayout.js → TreeItemPersonaLayout.cjs} +4 -4
  180. package/lib-commonjs/components/TreeItemPersonaLayout/{TreeItemPersonaLayout.js.map → TreeItemPersonaLayout.cjs.map} +1 -1
  181. package/lib-commonjs/components/TreeItemPersonaLayout/{index.js → index.cjs} +4 -4
  182. package/lib-commonjs/components/TreeItemPersonaLayout/{index.js.map → index.cjs.map} +1 -1
  183. package/lib-commonjs/components/TreeItemPersonaLayout/{useTreeItemPersonaLayout.js → useTreeItemPersonaLayout.cjs} +5 -5
  184. package/lib-commonjs/components/TreeItemPersonaLayout/{useTreeItemPersonaLayout.js.map → useTreeItemPersonaLayout.cjs.map} +1 -1
  185. package/lib-commonjs/components/TreeItemPersonaLayout/{useTreeItemPersonaLayoutStyles.styles.js → useTreeItemPersonaLayoutStyles.styles.cjs} +2 -2
  186. package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.styles.cjs.map +1 -0
  187. package/lib-commonjs/components/TreeItemPersonaLayout/{useTreeItemPersonaLayoutStyles.styles.raw.js → useTreeItemPersonaLayoutStyles.styles.raw.cjs} +3 -3
  188. package/lib-commonjs/components/TreeItemPersonaLayout/{useTreeItemPersonaLayoutStyles.styles.raw.js.map → useTreeItemPersonaLayoutStyles.styles.raw.cjs.map} +1 -1
  189. package/lib-commonjs/components/{TreeProvider.js → TreeProvider.cjs} +5 -5
  190. package/lib-commonjs/components/{TreeProvider.js.map → TreeProvider.cjs.map} +1 -1
  191. package/lib-commonjs/contexts/{index.js → index.cjs} +3 -3
  192. package/lib-commonjs/contexts/{index.js.map → index.cjs.map} +1 -1
  193. package/lib-commonjs/contexts/{treeContext.js → treeContext.cjs} +2 -2
  194. package/lib-commonjs/contexts/{treeContext.js.map → treeContext.cjs.map} +1 -1
  195. package/lib-commonjs/contexts/{treeItemContext.js → treeItemContext.cjs} +1 -1
  196. package/lib-commonjs/contexts/{treeItemContext.js.map → treeItemContext.cjs.map} +1 -1
  197. package/lib-commonjs/hooks/{useControllableOpenItems.js → useControllableOpenItems.cjs} +1 -1
  198. package/lib-commonjs/hooks/{useControllableOpenItems.js.map → useControllableOpenItems.cjs.map} +1 -1
  199. package/lib-commonjs/hooks/{useFlatTreeNavigation.js → useFlatTreeNavigation.cjs} +6 -6
  200. package/lib-commonjs/hooks/{useFlatTreeNavigation.js.map → useFlatTreeNavigation.cjs.map} +1 -1
  201. package/lib-commonjs/hooks/{useHTMLElementWalkerRef.js → useHTMLElementWalkerRef.cjs} +2 -2
  202. package/lib-commonjs/hooks/{useHTMLElementWalkerRef.js.map → useHTMLElementWalkerRef.cjs.map} +1 -1
  203. package/lib-commonjs/hooks/{useRootTree.js → useRootTree.cjs} +5 -5
  204. package/lib-commonjs/hooks/{useRootTree.js.map → useRootTree.cjs.map} +1 -1
  205. package/lib-commonjs/hooks/{useSubtree.js → useSubtree.cjs} +1 -1
  206. package/lib-commonjs/hooks/{useSubtree.js.map → useSubtree.cjs.map} +1 -1
  207. package/lib-commonjs/hooks/{useTreeNavigation.js → useTreeNavigation.cjs} +5 -5
  208. package/lib-commonjs/hooks/{useTreeNavigation.js.map → useTreeNavigation.cjs.map} +1 -1
  209. package/lib-commonjs/{index.js → index.cjs} +16 -16
  210. package/lib-commonjs/{index.js.map → index.cjs.map} +1 -1
  211. package/lib-commonjs/utils/{createCheckedItems.js → createCheckedItems.cjs} +1 -1
  212. package/lib-commonjs/utils/{createCheckedItems.js.map → createCheckedItems.cjs.map} +1 -1
  213. package/package.json +27 -21
  214. package/lib-commonjs/components/FlatTree/useFlatTreeStyles.styles.js.map +0 -1
  215. package/lib-commonjs/components/Tree/useTreeStyles.styles.js.map +0 -1
  216. package/lib-commonjs/components/TreeItem/useTreeItemStyles.styles.js.map +0 -1
  217. package/lib-commonjs/components/TreeItemLayout/useTreeItemLayoutStyles.styles.js.map +0 -1
  218. package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.styles.js.map +0 -1
  219. /package/lib-commonjs/components/FlatTree/{FlatTree.types.js → FlatTree.types.cjs} +0 -0
  220. /package/lib-commonjs/components/FlatTree/{FlatTree.types.js.map → FlatTree.types.cjs.map} +0 -0
  221. /package/lib-commonjs/components/FlatTree/{useFlatTreeContextValues.js → useFlatTreeContextValues.cjs} +0 -0
  222. /package/lib-commonjs/components/FlatTree/{useFlatTreeContextValues.js.map → useFlatTreeContextValues.cjs.map} +0 -0
  223. /package/lib-commonjs/components/FlatTree/{useFlatTreeStyles.styles.js → useFlatTreeStyles.styles.cjs} +0 -0
  224. /package/lib-commonjs/components/FlatTree/{useFlatTreeStyles.styles.raw.js → useFlatTreeStyles.styles.raw.cjs} +0 -0
  225. /package/lib-commonjs/components/FlatTree/{useFlatTreeStyles.styles.raw.js.map → useFlatTreeStyles.styles.raw.cjs.map} +0 -0
  226. /package/lib-commonjs/components/FlatTreeItem/{FlatTreeItem.types.js → FlatTreeItem.types.cjs} +0 -0
  227. /package/lib-commonjs/components/FlatTreeItem/{FlatTreeItem.types.js.map → FlatTreeItem.types.cjs.map} +0 -0
  228. /package/lib-commonjs/components/Tree/{Tree.types.js → Tree.types.cjs} +0 -0
  229. /package/lib-commonjs/components/Tree/{Tree.types.js.map → Tree.types.cjs.map} +0 -0
  230. /package/lib-commonjs/components/Tree/{useTreeContextValues.js → useTreeContextValues.cjs} +0 -0
  231. /package/lib-commonjs/components/Tree/{useTreeContextValues.js.map → useTreeContextValues.cjs.map} +0 -0
  232. /package/lib-commonjs/components/Tree/{useTreeStyles.styles.js → useTreeStyles.styles.cjs} +0 -0
  233. /package/lib-commonjs/components/Tree/{useTreeStyles.styles.raw.js → useTreeStyles.styles.raw.cjs} +0 -0
  234. /package/lib-commonjs/components/Tree/{useTreeStyles.styles.raw.js.map → useTreeStyles.styles.raw.cjs.map} +0 -0
  235. /package/lib-commonjs/components/TreeItem/{TreeItem.types.js → TreeItem.types.cjs} +0 -0
  236. /package/lib-commonjs/components/TreeItem/{TreeItem.types.js.map → TreeItem.types.cjs.map} +0 -0
  237. /package/lib-commonjs/components/TreeItem/{useTreeItemContextValues.js → useTreeItemContextValues.cjs} +0 -0
  238. /package/lib-commonjs/components/TreeItem/{useTreeItemContextValues.js.map → useTreeItemContextValues.cjs.map} +0 -0
  239. /package/lib-commonjs/components/TreeItemLayout/{TreeItemLayout.types.js → TreeItemLayout.types.cjs} +0 -0
  240. /package/lib-commonjs/components/TreeItemLayout/{TreeItemLayout.types.js.map → TreeItemLayout.types.cjs.map} +0 -0
  241. /package/lib-commonjs/components/TreeItemLayout/{renderTreeItemLayout.js → renderTreeItemLayout.cjs} +0 -0
  242. /package/lib-commonjs/components/TreeItemLayout/{renderTreeItemLayout.js.map → renderTreeItemLayout.cjs.map} +0 -0
  243. /package/lib-commonjs/components/TreeItemPersonaLayout/{TreeItemPersonaLayout.types.js → TreeItemPersonaLayout.types.cjs} +0 -0
  244. /package/lib-commonjs/components/TreeItemPersonaLayout/{TreeItemPersonaLayout.types.js.map → TreeItemPersonaLayout.types.cjs.map} +0 -0
  245. /package/lib-commonjs/components/TreeItemPersonaLayout/{renderTreeItemPersonaLayout.js → renderTreeItemPersonaLayout.cjs} +0 -0
  246. /package/lib-commonjs/components/TreeItemPersonaLayout/{renderTreeItemPersonaLayout.js.map → renderTreeItemPersonaLayout.cjs.map} +0 -0
  247. /package/lib-commonjs/components/TreeItemPersonaLayout/{useTreeItemPersonaLayoutContextValues.js → useTreeItemPersonaLayoutContextValues.cjs} +0 -0
  248. /package/lib-commonjs/components/TreeItemPersonaLayout/{useTreeItemPersonaLayoutContextValues.js.map → useTreeItemPersonaLayoutContextValues.cjs.map} +0 -0
  249. /package/lib-commonjs/contexts/{subtreeContext.js → subtreeContext.cjs} +0 -0
  250. /package/lib-commonjs/contexts/{subtreeContext.js.map → subtreeContext.cjs.map} +0 -0
  251. /package/lib-commonjs/hooks/{useRovingTabIndexes.js → useRovingTabIndexes.cjs} +0 -0
  252. /package/lib-commonjs/hooks/{useRovingTabIndexes.js.map → useRovingTabIndexes.cjs.map} +0 -0
  253. /package/lib-commonjs/utils/{ImmutableMap.js → ImmutableMap.cjs} +0 -0
  254. /package/lib-commonjs/utils/{ImmutableMap.js.map → ImmutableMap.cjs.map} +0 -0
  255. /package/lib-commonjs/utils/{ImmutableSet.js → ImmutableSet.cjs} +0 -0
  256. /package/lib-commonjs/utils/{ImmutableSet.js.map → ImmutableSet.cjs.map} +0 -0
  257. /package/lib-commonjs/utils/{assert.js → assert.cjs} +0 -0
  258. /package/lib-commonjs/utils/{assert.js.map → assert.cjs.map} +0 -0
  259. /package/lib-commonjs/utils/{createHTMLElementWalker.js → createHTMLElementWalker.cjs} +0 -0
  260. /package/lib-commonjs/utils/{createHTMLElementWalker.js.map → createHTMLElementWalker.cjs.map} +0 -0
  261. /package/lib-commonjs/utils/{createHeadlessTree.js → createHeadlessTree.cjs} +0 -0
  262. /package/lib-commonjs/utils/{createHeadlessTree.js.map → createHeadlessTree.cjs.map} +0 -0
  263. /package/lib-commonjs/utils/{flattenTree.js → flattenTree.cjs} +0 -0
  264. /package/lib-commonjs/utils/{flattenTree.js.map → flattenTree.cjs.map} +0 -0
  265. /package/lib-commonjs/utils/{getTreeItemValueFromElement.js → getTreeItemValueFromElement.cjs} +0 -0
  266. /package/lib-commonjs/utils/{getTreeItemValueFromElement.js.map → getTreeItemValueFromElement.cjs.map} +0 -0
  267. /package/lib-commonjs/utils/{nextTypeAheadElement.js → nextTypeAheadElement.cjs} +0 -0
  268. /package/lib-commonjs/utils/{nextTypeAheadElement.js.map → nextTypeAheadElement.cjs.map} +0 -0
  269. /package/lib-commonjs/utils/{normalizeOpenItems.js → normalizeOpenItems.cjs} +0 -0
  270. /package/lib-commonjs/utils/{normalizeOpenItems.js.map → normalizeOpenItems.cjs.map} +0 -0
  271. /package/lib-commonjs/utils/{tokens.js → tokens.cjs} +0 -0
  272. /package/lib-commonjs/utils/{tokens.js.map → tokens.cjs.map} +0 -0
  273. /package/lib-commonjs/utils/{treeItemFilter.js → treeItemFilter.cjs} +0 -0
  274. /package/lib-commonjs/utils/{treeItemFilter.js.map → treeItemFilter.cjs.map} +0 -0
@@ -0,0 +1,941 @@
1
+ import type { ArrowDown } from '@fluentui/keyboard-keys';
2
+ import type { ArrowLeft } from '@fluentui/keyboard-keys';
3
+ import type { ArrowRight } from '@fluentui/keyboard-keys';
4
+ import type { ArrowUp } from '@fluentui/keyboard-keys';
5
+ import type { AvatarContextValue } from '@fluentui/react-avatar';
6
+ import type { AvatarSize } from '@fluentui/react-avatar';
7
+ import type { ButtonContextValue } from '@fluentui/react-button';
8
+ import type { Checkbox } from '@fluentui/react-checkbox';
9
+ import type { CheckboxProps } from '@fluentui/react-checkbox';
10
+ import type { CollapseParams } from '@fluentui/react-motion-components-preview';
11
+ import type { ComponentProps } from '@fluentui/react-utilities';
12
+ import type { ComponentState } from '@fluentui/react-utilities';
13
+ import type { ContextSelector } from '@fluentui/react-context-selector';
14
+ import type { DistributiveOmit } from '@fluentui/react-utilities';
15
+ import type { End } from '@fluentui/keyboard-keys';
16
+ import type { Enter } from '@fluentui/keyboard-keys';
17
+ import type { EventData } from '@fluentui/react-utilities';
18
+ import type { EventHandler } from '@fluentui/react-utilities';
19
+ import type { ExtractSlotProps } from '@fluentui/react-utilities';
20
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
21
+ import type { Home } from '@fluentui/keyboard-keys';
22
+ import type { JSXElement } from '@fluentui/react-utilities';
23
+ import type { PresenceMotionSlotProps } from '@fluentui/react-motion';
24
+ import type { Radio } from '@fluentui/react-radio';
25
+ import type { RadioProps } from '@fluentui/react-radio';
26
+ import * as React_2 from 'react';
27
+ import type { SelectionMode as SelectionMode_2 } from '@fluentui/react-utilities';
28
+ import type { Slot } from '@fluentui/react-utilities';
29
+ import type { SlotClassNames } from '@fluentui/react-utilities';
30
+
31
+ declare type FlattenedTreeItem<Props extends TreeItemProps> = HeadlessFlatTreeItemProps & Props;
32
+
33
+ /**
34
+ * Converts a nested structure to a flat one which can be consumed by `useFlatTreeItems`
35
+ * @example
36
+ * ```tsx
37
+ * const defaultItems = flattenTree_unstable([
38
+ * {
39
+ * children: <TreeItemLayout>level 1, item 1</TreeItemLayout>,
40
+ * subtree: [
41
+ * {
42
+ * children: <TreeItemLayout>level 2, item 1</TreeItemLayout>,
43
+ * },
44
+ * {
45
+ * children: <TreeItemLayout>level 2, item 2</TreeItemLayout>,
46
+ * },
47
+ * {
48
+ * children: <TreeItemLayout>level 2, item 3</TreeItemLayout>,
49
+ * },
50
+ * ],
51
+ * },
52
+ * {
53
+ * children: <TreeItemLayout>level 1, item 2</TreeItemLayout>,
54
+ * subtree: [
55
+ * {
56
+ * children: <TreeItemLayout>level 2, item 1</TreeItemLayout>,
57
+ * subtree: [
58
+ * {
59
+ * children: <TreeItemLayout>level 3, item 1</TreeItemLayout>,
60
+ * subtree: [
61
+ * {
62
+ * children: <TreeItemLayout>level 4, item 1</TreeItemLayout>,
63
+ * },
64
+ * ],
65
+ * },
66
+ * ],
67
+ * },
68
+ * ],
69
+ * },
70
+ * ]);
71
+ * ```
72
+ */
73
+ export declare const flattenTree_unstable: <Props extends TreeItemProps>(items: FlattenTreeItem<Props>[]) => FlattenedTreeItem<Props>[];
74
+
75
+ export declare type FlattenTreeItem<Props extends TreeItemProps> = Omit<Props, 'subtree' | 'itemType'> & {
76
+ value: TreeItemValue;
77
+ subtree?: FlattenTreeItem<Props>[];
78
+ };
79
+
80
+ /**
81
+ * The `FlatTree` component is a variation of the `Tree` component that deals with a flattened data structure.
82
+ *
83
+ * It should be used on cases where more complex interactions with a Tree is required.
84
+ * On simple scenarios it is advised to simply use a nested structure instead.
85
+ */
86
+ export declare const FlatTree: ForwardRefComponent<FlatTreeProps>;
87
+
88
+ export declare const flatTreeClassNames: SlotClassNames<Omit<FlatTreeSlots, 'collapseMotion'>>;
89
+
90
+ declare type FlatTreeContextValues = {
91
+ tree: TreeContextValue;
92
+ };
93
+
94
+ /**
95
+ * The `FlatTreeItem` component represents a single item in a flat tree.
96
+ */
97
+ export declare const FlatTreeItem: ForwardRefComponent<FlatTreeItemProps>;
98
+
99
+ /**
100
+ * FlatTreeItem Props
101
+ */
102
+ export declare type FlatTreeItemProps = TreeItemProps & {
103
+ value: TreeItemValue;
104
+ 'aria-level': number;
105
+ 'aria-setsize': number;
106
+ 'aria-posinset': number;
107
+ };
108
+
109
+ export declare type FlatTreeProps = ComponentProps<TreeSlots> & {
110
+ /**
111
+ * Indicates how navigation between a treeitem and its actions work
112
+ * - 'tree' (default): The default navigation, pressing right arrow key navigates inward the first inner children of a branch treeitem
113
+ * - 'treegrid': Pressing right arrow key navigate towards the actions of a treeitem
114
+ * @default 'tree'
115
+ */
116
+ navigationMode?: 'tree' | 'treegrid';
117
+ /**
118
+ * A tree item can have various appearances:
119
+ * - 'subtle' (default): The default tree item styles.
120
+ * - 'subtle-alpha': Minimizes emphasis on hovered or focused states.
121
+ * - 'transparent': Removes background color.
122
+ * @default 'subtle'
123
+ */
124
+ appearance?: 'subtle' | 'subtle-alpha' | 'transparent';
125
+ /**
126
+ * Size of the tree item.
127
+ * @default 'medium'
128
+ */
129
+ size?: 'small' | 'medium';
130
+ /**
131
+ * This refers to a list of ids of opened tree items.
132
+ * Controls the state of the open tree items.
133
+ * These property is ignored for subtrees.
134
+ */
135
+ openItems?: Iterable<TreeItemValue>;
136
+ /**
137
+ * Callback fired when the component changes value from open state.
138
+ * These property is ignored for subtrees.
139
+ *
140
+ * @param event - a React's Synthetic event
141
+ * @param data - A data object with relevant information,
142
+ * such as open value and type of interaction that created the event.
143
+ */
144
+ onOpenChange?(event: TreeOpenChangeEvent, data: TreeOpenChangeData): void;
145
+ /**
146
+ * Callback fired when navigation happens inside the component.
147
+ * These property is ignored for subtrees.
148
+ *
149
+ * FIXME: This method is not ideal, as navigation should be handled internally by tabster.
150
+ *
151
+ * @param event - a React's Synthetic event
152
+ * @param data - A data object with relevant information,
153
+ */
154
+ onNavigation?(event: TreeNavigationEvent_unstable, data: TreeNavigationData_unstable): void;
155
+ /**
156
+ * This refers to the selection mode of the tree.
157
+ * - undefined: No selection can be done.
158
+ * - 'single': Only one tree item can be selected, radio buttons are rendered.
159
+ * - 'multiselect': Multiple tree items can be selected, checkboxes are rendered.
160
+ *
161
+ * @default undefined
162
+ */
163
+ selectionMode?: SelectionMode_2;
164
+ /**
165
+ * This refers to a list of ids of checked tree items, or a list of tuples of ids and checked state.
166
+ * Controls the state of the checked tree items.
167
+ * These property is ignored for subtrees.
168
+ */
169
+ checkedItems?: Iterable<TreeItemValue | [TreeItemValue, TreeSelectionValue]>;
170
+ /**
171
+ * Callback fired when the component changes value from checked state.
172
+ * These property is ignored for subtrees.
173
+ *
174
+ * @param event - a React's Synthetic event
175
+ * @param data - A data object with relevant information,
176
+ * such as checked value and type of interaction that created the event.
177
+ */
178
+ onCheckedChange?(event: TreeCheckedChangeEvent, data: TreeCheckedChangeData): void;
179
+ };
180
+
181
+ export declare type FlatTreeSlots = TreeSlots;
182
+
183
+ export declare type FlatTreeState = ComponentState<FlatTreeSlots> & TreeContextValue & {
184
+ open: boolean;
185
+ };
186
+
187
+ /**
188
+ * FlatTree API to manage all required mechanisms to convert a list of items into renderable TreeItems
189
+ * in multiple scenarios including virtualization.
190
+ *
191
+ * !!A flat tree is an unofficial spec for tree!!
192
+ *
193
+ * It should be used on cases where more complex interactions with a Tree is required.
194
+ *
195
+ * On simple scenarios it is advised to simply use a nested structure instead.
196
+ */
197
+ export declare type HeadlessFlatTree<Props extends HeadlessFlatTreeItemProps> = {
198
+ /**
199
+ * returns the properties required for the Tree component to work properly.
200
+ * That includes:
201
+ * `openItems`, `onOpenChange`, `onNavigation_unstable` and `ref`
202
+ */
203
+ getTreeProps(): Required<Pick<FlatTreeProps, 'openItems' | 'onOpenChange' | 'onNavigation' | 'checkedItems' | 'onCheckedChange'>> & {
204
+ ref: React_2.Ref<HTMLDivElement>;
205
+ openItems: ImmutableSet<TreeItemValue>;
206
+ };
207
+ /**
208
+ * internal method used to react to an `onNavigation` event.
209
+ * This method ensures proper navigation on keyboard and mouse interaction.
210
+ * In case of virtualization it might be required to cancel default provided `onNavigation`
211
+ * event and then call this method manually.
212
+ *
213
+ * @example
214
+ * ```ts
215
+ * // react-window
216
+ * const handleNavigation = (event, data) => {
217
+ * event.preventDefault();
218
+ * const nextItem = tree.getNextNavigableItem(data);
219
+ * // scroll to item using virtualization scroll mechanism
220
+ * if (nextItem && tree.getElementFromItem(nextItem)) {
221
+ * listRef.current.scrollToItem(nextItem.index);
222
+ * }
223
+ * // wait for scrolling to happen and then invoke navigate method
224
+ * requestAnimationFrame(() => {
225
+ * tree.navigate(data);
226
+ * });
227
+ * };
228
+ *```
229
+ */
230
+ navigate(data: TreeNavigationData_unstable): void;
231
+ /**
232
+ * returns next item to be focused on a navigation.
233
+ * This method is provided to decouple the element that needs to be focused from
234
+ * the action of focusing it itself.
235
+ *
236
+ * On the case of TypeAhead navigation this method returns the current item.
237
+ */
238
+ getNextNavigableItem(visibleItems: HeadlessTreeItem<Props>[], data: TreeNavigationData_unstable): HeadlessTreeItem<Props> | undefined;
239
+ /**
240
+ * similar to getElementById but for FlatTreeItems
241
+ */
242
+ getElementFromItem(item: HeadlessTreeItem<Props>): HTMLElement | null;
243
+ /**
244
+ * an iterable containing all visually available flat tree items
245
+ */
246
+ items(): IterableIterator<HeadlessTreeItem<Props>>;
247
+ };
248
+
249
+ export declare type HeadlessFlatTreeItem<Props extends HeadlessFlatTreeItemProps> = HeadlessTreeItem<Props>;
250
+
251
+ export declare type HeadlessFlatTreeItemProps = HeadlessTreeItemProps;
252
+
253
+ export declare type HeadlessFlatTreeOptions = Pick<FlatTreeProps, 'onOpenChange' | 'onNavigation' | 'selectionMode' | 'onCheckedChange'> & Pick<TreeProps, 'defaultOpenItems' | 'openItems' | 'checkedItems'> & {
254
+ defaultCheckedItems?: TreeProps['checkedItems'];
255
+ };
256
+
257
+ /**
258
+ * @internal
259
+ */
260
+ declare type HeadlessFlatTreeReturn<Props extends HeadlessFlatTreeItemProps> = HeadlessFlatTree<Props> & {
261
+ getItem(value: TreeItemValue): HeadlessTreeItem<Props> | undefined;
262
+ };
263
+
264
+ /**
265
+ * The item that is returned by `createHeadlessTree`, it represents a wrapper around the properties provided to
266
+ * `createHeadlessTree` but with extra information that might be useful on virtual tree scenarios
267
+ */
268
+ declare type HeadlessTreeItem<Props extends HeadlessTreeItemProps> = {
269
+ level: number;
270
+ index: number;
271
+ position: number;
272
+ childrenValues: TreeItemValue[];
273
+ value: TreeItemValue;
274
+ parentValue: TreeItemValue | undefined;
275
+ itemType: TreeItemType;
276
+ getTreeItemProps(): Required<Pick<Props, 'value' | 'aria-setsize' | 'aria-level' | 'aria-posinset' | 'itemType'>> & Props;
277
+ };
278
+
279
+ declare type HeadlessTreeItemProps = Omit<TreeItemProps, 'itemType' | 'value'> & {
280
+ value: TreeItemValue;
281
+ itemType?: TreeItemType;
282
+ parentValue?: TreeItemValue;
283
+ };
284
+
285
+ declare class ImmutableMap<Key, Value> implements Iterable<[Key, Value]> {
286
+ static empty: ImmutableMap<never, never>;
287
+ readonly size: number;
288
+ private [internalMapSymbol];
289
+ static dangerouslyGetInternalMap<Key, Value>(immutableMap: ImmutableMap<Key, Value>): Map<Key, Value>;
290
+ static copy<Key, Value>(immutableMap: ImmutableMap<Key, Value>): ImmutableMap<Key, Value>;
291
+ /**
292
+ * Creates a new {@link ImmutableMap} from an iterable.
293
+ * If the iterable is undefined, {@link ImmutableMap.empty} will be returned.
294
+ * If the iterable is already an {@link ImmutableMap}, it will be returned as is no copy will be made.
295
+ */
296
+ static from<T extends [unknown, unknown]>(iterable?: Iterable<T>): ImmutableMap<T[0], T[1]>;
297
+ /**
298
+ * Creates a new {@link ImmutableMap} from an iterable with an auxiliary map function to modify the iterable.
299
+ * If the iterable is undefined, {@link ImmutableMap.empty} will be returned.
300
+ * If the iterable is already an {@link ImmutableMap}, it will be returned as is no copy will be made.
301
+ * The map function will be called for each element in the iterable.
302
+ */
303
+ static from<T, U extends [unknown, unknown]>(iterable: Iterable<T> | undefined, mapFn: (value: T) => U): ImmutableMap<U[0], U[1]>;
304
+ static [Symbol.hasInstance](instance: unknown): boolean;
305
+ /**
306
+ * Do not use this constructor directly, use {@link ImmutableMap.from} instead.
307
+ * {@link ImmutableMap.from} handles instance verification (which might be problematic on {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms | multiple realms}),
308
+ * avoid unnecessary copies, supports iterables and ensures that the internal map is never exposed.
309
+ *
310
+ *⚠️⚠️ _By using this constructor directly, you might end up with a mutable map, as it is not guaranteed that the internal map is not exposed._ ⚠️⚠️
311
+ */
312
+ constructor(internalMap: Map<Key, Value>);
313
+ delete(key: Key): ImmutableMap<Key, Value>;
314
+ get(key: Key): Value | undefined;
315
+ has(key: Key): boolean;
316
+ set(key: Key, value: Value): ImmutableMap<Key, Value>;
317
+ [Symbol.iterator](): Iterator<[Key, Value]>;
318
+ }
319
+
320
+ /**
321
+ * Small immutable wrapper around the native Set implementation.
322
+ * Every operation that would modify the set returns a new copy instance.
323
+ *
324
+ * @public
325
+ */
326
+ declare class ImmutableSet<T> implements Iterable<T> {
327
+ static empty: ImmutableSet<never>;
328
+ readonly size: number;
329
+ private [internalSetSymbol];
330
+ static dangerouslyGetInternalSet<Value>(set: ImmutableSet<Value>): Set<Value>;
331
+ static copy<T>(immutableSet: ImmutableSet<T>): ImmutableSet<T>;
332
+ /**
333
+ * Creates a new {@link ImmutableSet} from an iterable.
334
+ * If the iterable is undefined, {@link ImmutableSet.empty} will be returned.
335
+ * If the iterable is already an {@link ImmutableSet}, it will be returned as is no copy will be made.
336
+ */
337
+ static from<Value>(iterable?: Iterable<Value>): ImmutableSet<Value>;
338
+ static [Symbol.hasInstance](instance: unknown): boolean;
339
+ /**
340
+ * Do not use this constructor directly, use {@link ImmutableSet.from} instead.
341
+ * {@link ImmutableSet.from} handles instance verification (which might be problematic on {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms | multiple realms}),
342
+ * avoid unnecessary copies, supports iterables and ensures that the internal set is never exposed.
343
+ *
344
+ *⚠️⚠️ _By using this constructor directly, you might end up with a mutable set, as it is not guaranteed that the internal set is not exposed._ ⚠️⚠️
345
+ */
346
+ constructor(internalSet: Set<T>);
347
+ add(value: T): ImmutableSet<T>;
348
+ delete(value: T): ImmutableSet<T>;
349
+ has(value: T): boolean;
350
+ [Symbol.iterator](): Iterator<T>;
351
+ }
352
+
353
+ declare const internalMapSymbol: unique symbol;
354
+
355
+ declare const internalSetSymbol: unique symbol;
356
+
357
+ declare type MultiSelectValue = NonNullable<CheckboxProps['checked']>;
358
+
359
+ export declare const renderFlatTree_unstable: (state: FlatTreeState, contextValues: FlatTreeContextValues) => JSXElement;
360
+
361
+ export declare const renderTree_unstable: (state: TreeState, contextValues: TreeContextValues) => JSXElement;
362
+
363
+ /**
364
+ * Render the final JSX of TreeItem
365
+ */
366
+ export declare const renderTreeItem_unstable: (state: TreeItemState, contextValues: TreeItemContextValues) => JSXElement;
367
+
368
+ /**
369
+ * Render the final JSX of TreeItemLayout
370
+ */
371
+ export declare const renderTreeItemLayout_unstable: (state: TreeItemLayoutState) => JSXElement;
372
+
373
+ /**
374
+ * Render the final JSX of TreeItemPersonaLayout
375
+ */
376
+ export declare const renderTreeItemPersonaLayout_unstable: (state: TreeItemPersonaLayoutState, contextValues: TreeItemPersonaLayoutContextValues) => JSXElement;
377
+
378
+ declare type SingleSelectValue = NonNullable<RadioProps['checked']>;
379
+
380
+ export declare type SubtreeContextValue = {
381
+ contextType: 'subtree';
382
+ level: number;
383
+ };
384
+
385
+ /**
386
+ * The `Tree` component renders nested items in a hierarchical structure.
387
+ * Use it with `TreeItem` component and layouts components `TreeItemLayout` or `TreeItemPersonaLayout`.
388
+ */
389
+ export declare const Tree: ForwardRefComponent<TreeProps>;
390
+
391
+ export declare type TreeCheckedChangeData = {
392
+ value: TreeItemValue;
393
+ checkedItems: Map<TreeItemValue, TreeSelectionValue>;
394
+ target: HTMLElement;
395
+ event: React_2.ChangeEvent<HTMLElement>;
396
+ type: 'Change';
397
+ } & ({
398
+ selectionMode: 'multiselect';
399
+ checked: MultiSelectValue;
400
+ } | {
401
+ selectionMode: 'single';
402
+ checked: SingleSelectValue;
403
+ });
404
+
405
+ export declare type TreeCheckedChangeEvent = TreeCheckedChangeData['event'];
406
+
407
+ export declare const treeClassNames: SlotClassNames<Omit<TreeSlots, 'collapseMotion'>>;
408
+
409
+ export declare type TreeContextValue = {
410
+ contextType?: 'root';
411
+ level: number;
412
+ treeType: 'nested' | 'flat';
413
+ selectionMode: 'none' | SelectionMode_2;
414
+ appearance: 'subtle' | 'subtle-alpha' | 'transparent';
415
+ size: 'small' | 'medium';
416
+ openItems: ImmutableSet<TreeItemValue>;
417
+ checkedItems: ImmutableMap<TreeItemValue, 'mixed' | boolean>;
418
+ /**
419
+ * requests root Tree component to respond to some tree item event,
420
+ */
421
+ requestTreeResponse(request: TreeItemRequest): void;
422
+ forceUpdateRovingTabIndex?(): void;
423
+ navigationMode?: 'tree' | 'treegrid';
424
+ };
425
+
426
+ export declare type TreeContextValues = {
427
+ tree: TreeContextValue | SubtreeContextValue;
428
+ };
429
+
430
+ /**
431
+ * The `TreeItem` component represents a single item in a tree.
432
+ * It expects a certain order of children to work properly: the first child should be the node itself,
433
+ * and the second child should be a nested subtree in the form of another Tree component or a standalone TreeItem.
434
+ * This order follows the same order as document traversal for the TreeWalker API in JavaScript:
435
+ * https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker.
436
+ * The content and layout of a TreeItem can be defined using the TreeItemLayout or TreeItemPersonaLayout component,
437
+ * which should be used as a direct child of TreeItem.
438
+ *
439
+ * When a TreeItem has nested child subtree, an expand/collapse control is displayed,
440
+ * allowing the user to show or hide the children.
441
+ */
442
+ export declare const TreeItem: ForwardRefComponent<TreeItemProps>;
443
+
444
+ export declare const treeItemClassNames: SlotClassNames<TreeItemSlots>;
445
+
446
+ export declare type TreeItemContextValue = {
447
+ /**
448
+ * @deprecated - this value is irrelevant for the tree item
449
+ */
450
+ isActionsVisible: boolean;
451
+ /**
452
+ * @deprecated - this value is irrelevant for the tree item
453
+ */
454
+ isAsideVisible: boolean;
455
+ selectionRef: React_2.Ref<HTMLInputElement>;
456
+ actionsRef: React_2.Ref<HTMLDivElement>;
457
+ expandIconRef: React_2.Ref<HTMLDivElement>;
458
+ layoutRef: React_2.Ref<HTMLDivElement>;
459
+ subtreeRef: React_2.Ref<HTMLDivElement>;
460
+ treeItemRef?: React_2.RefObject<HTMLDivElement | null>;
461
+ itemType: TreeItemType;
462
+ value: TreeItemValue;
463
+ open: boolean;
464
+ checked: TreeSelectionValue;
465
+ };
466
+
467
+ declare type TreeItemContextValues = {
468
+ treeItem: TreeItemContextValue;
469
+ };
470
+
471
+ export declare type TreeItemCSSProperties = React_2.CSSProperties & {
472
+ [treeItemLevelToken]?: string | number;
473
+ };
474
+
475
+ /**
476
+ * The `TreeItemLayout` component is used as a child of `TreeItem` to define the content and layout of a tree item.
477
+ * It provides a consistent visual structure for tree items in a `Tree` component.
478
+ * This component should only be used as a direct child of `TreeItem`.
479
+ */
480
+ export declare const TreeItemLayout: ForwardRefComponent<TreeItemLayoutProps>;
481
+
482
+ declare type TreeItemLayoutActionSlotProps = ExtractSlotProps<Slot<'div'> & {
483
+ /**
484
+ * Forces visibility of the aside/action content
485
+ */
486
+ visible?: boolean;
487
+ onVisibilityChange?: EventHandler<TreeItemLayoutActionVisibilityChangeData>;
488
+ }>;
489
+
490
+ declare type TreeItemLayoutActionVisibilityChangeData = (EventData<'mouseover' | 'mouseout', MouseEvent> | EventData<'focus' | 'blur', FocusEvent> | EventData<'blur', React_2.FocusEvent>) & {
491
+ visible: boolean;
492
+ };
493
+
494
+ export declare const treeItemLayoutClassNames: SlotClassNames<TreeItemLayoutSlots>;
495
+
496
+ /**
497
+ * TreeItemLayout Props
498
+ */
499
+ export declare type TreeItemLayoutProps = ComponentProps<Partial<TreeItemLayoutSlots>>;
500
+
501
+ export declare type TreeItemLayoutSlots = {
502
+ root: Slot<'div'>;
503
+ /**
504
+ * Content. Children of the root slot are automatically rendered here
505
+ */
506
+ main: NonNullable<Slot<'div'>>;
507
+ /**
508
+ * Icon slot that renders right before main content
509
+ */
510
+ iconBefore?: Slot<'div'>;
511
+ /**
512
+ * Icon slot that renders right after main content
513
+ */
514
+ iconAfter?: Slot<'div'>;
515
+ /**
516
+ * Expand icon slot,
517
+ * by default renders a chevron icon to indicate opening and closing
518
+ */
519
+ expandIcon?: Slot<'div'>;
520
+ /**
521
+ * Aside content is normally used to render a badge or other non-actionable content
522
+ */
523
+ aside?: Slot<'div'>;
524
+ /**
525
+ * Actionable elements are normally buttons, menus, or other focusable elements.
526
+ * Those elements are only visibly available if the given tree item is currently active.
527
+ *
528
+ * `actions` and `aside` slots are positioned on the exact same spot,
529
+ * so they won't be visible at the same time.
530
+ * `aside` slot is visible by default meanwhile `actions` slot are only visible when the tree item is active.
531
+ *
532
+ * `actions` slot supports a `visible` prop to force visibility of the actions.
533
+ */
534
+ actions?: Slot<TreeItemLayoutActionSlotProps>;
535
+ selector?: Slot<typeof Checkbox> | Slot<typeof Radio>;
536
+ };
537
+
538
+ /**
539
+ * State used in rendering TreeItemLayout
540
+ */
541
+ export declare type TreeItemLayoutState = ComponentState<TreeItemLayoutSlots> & {
542
+ buttonContextValue: ButtonContextValue;
543
+ };
544
+
545
+ export declare const treeItemLevelToken: "--fluent-TreeItem--level";
546
+
547
+ export declare type TreeItemOpenChangeData = {
548
+ open: boolean;
549
+ value: TreeItemValue;
550
+ target: HTMLElement;
551
+ } & ({
552
+ event: React_2.MouseEvent<HTMLElement>;
553
+ type: 'ExpandIconClick';
554
+ } | {
555
+ event: React_2.MouseEvent<HTMLElement>;
556
+ type: 'Click';
557
+ } | {
558
+ event: React_2.KeyboardEvent<HTMLElement>;
559
+ type: typeof Enter;
560
+ } | {
561
+ event: React_2.KeyboardEvent<HTMLElement>;
562
+ type: typeof ArrowRight;
563
+ } | {
564
+ event: React_2.KeyboardEvent<HTMLElement>;
565
+ type: typeof ArrowLeft;
566
+ });
567
+
568
+ export declare type TreeItemOpenChangeEvent = TreeItemOpenChangeData['event'];
569
+
570
+ /**
571
+ * The `TreeItemPersonaLayout` component is used as a child of `TreeItem` to display a `TreeItem` with a media (typically an avatar) and a description.
572
+ * It provides a more visually appealing representation of a `TreeItem` and is typically used to display a list of people or topics.
573
+ * This component should only be used as a direct child of `TreeItem`.
574
+ */
575
+ export declare const TreeItemPersonaLayout: ForwardRefComponent<TreeItemPersonaLayoutProps>;
576
+
577
+ export declare const treeItemPersonaLayoutClassNames: SlotClassNames<TreeItemPersonaLayoutSlots>;
578
+
579
+ declare type TreeItemPersonaLayoutContextValues = {
580
+ avatar: AvatarContextValue;
581
+ };
582
+
583
+ /**
584
+ * TreeItemPersonaLayout Props
585
+ */
586
+ export declare type TreeItemPersonaLayoutProps = ComponentProps<Partial<TreeItemPersonaLayoutSlots>>;
587
+
588
+ export declare type TreeItemPersonaLayoutSlots = Pick<TreeItemLayoutSlots, 'actions' | 'aside' | 'expandIcon' | 'selector'> & {
589
+ root: NonNullable<Slot<'div'>>;
590
+ /**
591
+ * Avatar to display.
592
+ */
593
+ media: NonNullable<Slot<'div'>>;
594
+ /**
595
+ * Content. Children of the root slot are automatically rendered here
596
+ */
597
+ main: NonNullable<Slot<'div'>>;
598
+ /**
599
+ * Secondary text that describes or complements the content
600
+ */
601
+ description?: Slot<'div'>;
602
+ };
603
+
604
+ /**
605
+ * State used in rendering TreeItemPersonaLayout
606
+ */
607
+ export declare type TreeItemPersonaLayoutState = ComponentState<TreeItemPersonaLayoutSlots> & {
608
+ avatarSize: AvatarSize;
609
+ buttonContextValue: ButtonContextValue;
610
+ };
611
+
612
+ /**
613
+ * TreeItem Props
614
+ */
615
+ export declare type TreeItemProps = ComponentProps<Partial<TreeItemSlots>> & {
616
+ /**
617
+ * A tree item can be a leaf or a branch
618
+ */
619
+ itemType: TreeItemType;
620
+ /**
621
+ * A tree item should have a well defined value, in case one is not provided by the user by this prop
622
+ * one will be inferred internally.
623
+ */
624
+ value?: TreeItemValue;
625
+ /**
626
+ * Whether the tree item is in an open state
627
+ *
628
+ * This overrides the open value provided by the root tree,
629
+ * and ensure control of the visibility of the tree item per tree item.
630
+ *
631
+ * NOTE: controlling the open state of a tree item will not affect the open state of its children
632
+ */
633
+ open?: boolean;
634
+ onOpenChange?: (e: TreeItemOpenChangeEvent, data: TreeItemOpenChangeData) => void;
635
+ /**
636
+ * This property is inferred through context on a nested tree, and required for a flat tree.
637
+ */
638
+ parentValue?: TreeItemValue;
639
+ };
640
+
641
+ export declare const TreeItemProvider: React_2.Provider<TreeItemContextValue | undefined> & React_2.FC<React_2.ProviderProps<TreeItemContextValue | undefined>>;
642
+
643
+ declare type TreeItemRequest = {
644
+ itemType: TreeItemType;
645
+ } & ((DistributiveOmit<TreeOpenChangeData, 'openItems'> & {
646
+ requestType: 'open';
647
+ }) | (TreeNavigationData_unstable & {
648
+ requestType: 'navigate';
649
+ }) | (DistributiveOmit<TreeCheckedChangeData, 'selectionMode' | 'checkedItems'> & {
650
+ requestType: 'selection';
651
+ }));
652
+
653
+ export declare type TreeItemSlots = {
654
+ root: Slot<ExtractSlotProps<Slot<'div'> & {
655
+ style?: TreeItemCSSProperties;
656
+ }>>;
657
+ };
658
+
659
+ /**
660
+ * State used in rendering TreeItem
661
+ */
662
+ export declare type TreeItemState = ComponentState<TreeItemSlots> & TreeItemContextValue & {
663
+ level: number;
664
+ itemType: TreeItemType;
665
+ };
666
+
667
+ export declare type TreeItemType = 'leaf' | 'branch';
668
+
669
+ export declare type TreeItemValue = string | number;
670
+
671
+ export declare type TreeNavigationData_unstable = {
672
+ target: HTMLElement;
673
+ value: TreeItemValue;
674
+ parentValue: TreeItemValue | undefined;
675
+ } & ({
676
+ event: React_2.MouseEvent<HTMLElement>;
677
+ type: 'Click';
678
+ } | {
679
+ event: React_2.KeyboardEvent<HTMLElement>;
680
+ type: 'TypeAhead';
681
+ } | {
682
+ event: React_2.KeyboardEvent<HTMLElement>;
683
+ type: typeof ArrowRight;
684
+ } | {
685
+ event: React_2.KeyboardEvent<HTMLElement>;
686
+ type: typeof ArrowLeft;
687
+ } | {
688
+ event: React_2.KeyboardEvent<HTMLElement>;
689
+ type: typeof ArrowUp;
690
+ } | {
691
+ event: React_2.KeyboardEvent<HTMLElement>;
692
+ type: typeof ArrowDown;
693
+ } | {
694
+ event: React_2.KeyboardEvent<HTMLElement>;
695
+ type: typeof Home;
696
+ } | {
697
+ event: React_2.KeyboardEvent<HTMLElement>;
698
+ type: typeof End;
699
+ });
700
+
701
+ /**
702
+ * To avoid breaking changes on TreeNavigationData
703
+ * we are creating a new type that extends the old one
704
+ * and adds the new methods
705
+ */
706
+ export declare type TreeNavigationDataParam = TreeNavigationData_unstable & {
707
+ preventScroll(): void;
708
+ isScrollPrevented(): boolean;
709
+ };
710
+
711
+ export declare type TreeNavigationEvent_unstable = TreeNavigationData_unstable['event'];
712
+
713
+ export declare type TreeNavigationMode = 'tree' | 'treegrid';
714
+
715
+ export declare type TreeOpenChangeData = {
716
+ open: boolean;
717
+ openItems: Set<TreeItemValue>;
718
+ value: TreeItemValue;
719
+ target: HTMLElement;
720
+ } & ({
721
+ event: React_2.MouseEvent<HTMLElement>;
722
+ type: 'ExpandIconClick';
723
+ } | {
724
+ event: React_2.MouseEvent<HTMLElement>;
725
+ type: 'Click';
726
+ }
727
+ /**
728
+ * @deprecated
729
+ * Use `type: 'Click'` instead of Enter,
730
+ * an enter press will trigger a click event, which will trigger an open change,
731
+ * so there is no need to have a separate type for it.
732
+ */
733
+ | {
734
+ event: React_2.KeyboardEvent<HTMLElement>;
735
+ type: typeof Enter;
736
+ } | {
737
+ event: React_2.KeyboardEvent<HTMLElement>;
738
+ type: typeof ArrowRight;
739
+ } | {
740
+ event: React_2.KeyboardEvent<HTMLElement>;
741
+ type: typeof ArrowLeft;
742
+ });
743
+
744
+ export declare type TreeOpenChangeEvent = TreeOpenChangeData['event'];
745
+
746
+ export declare type TreeProps = ComponentProps<TreeSlots> & {
747
+ /**
748
+ * Indicates how navigation between a treeitem and its actions work
749
+ * - 'tree' (default): The default navigation, pressing right arrow key navigates inward the first inner children of a branch treeitem
750
+ * - 'treegrid': Pressing right arrow key navigate towards the actions of a treeitem
751
+ * @default 'tree'
752
+ */
753
+ navigationMode?: TreeNavigationMode;
754
+ /**
755
+ * A tree item can have various appearances:
756
+ * - 'subtle' (default): The default tree item styles.
757
+ * - 'subtle-alpha': Minimizes emphasis on hovered or focused states.
758
+ * - 'transparent': Removes background color.
759
+ * @default 'subtle'
760
+ */
761
+ appearance?: 'subtle' | 'subtle-alpha' | 'transparent';
762
+ /**
763
+ * Size of the tree item.
764
+ * @default 'medium'
765
+ */
766
+ size?: 'small' | 'medium';
767
+ /**
768
+ * This refers to a list of ids of opened tree items.
769
+ * Controls the state of the open tree items.
770
+ * These property is ignored for subtrees.
771
+ */
772
+ openItems?: Iterable<TreeItemValue>;
773
+ /**
774
+ * This refers to a list of ids of default opened items.
775
+ * This property is ignored for subtrees.
776
+ */
777
+ defaultOpenItems?: Iterable<TreeItemValue>;
778
+ /**
779
+ * Callback fired when the component changes value from open state.
780
+ * These property is ignored for subtrees.
781
+ *
782
+ * @param event - a React's Synthetic event
783
+ * @param data - A data object with relevant information,
784
+ * such as open value and type of interaction that created the event.
785
+ */
786
+ onOpenChange?(event: TreeOpenChangeEvent, data: TreeOpenChangeData): void;
787
+ /**
788
+ * Callback fired when navigation happens inside the component.
789
+ * These property is ignored for subtrees.
790
+ *
791
+ * FIXME: This method is not ideal, as navigation should be handled internally by tabster.
792
+ *
793
+ * @param event - a React's Synthetic event
794
+ * @param data - A data object with relevant information,
795
+ */
796
+ onNavigation?(event: TreeNavigationEvent_unstable, data: TreeNavigationDataParam): void;
797
+ /**
798
+ * This refers to the selection mode of the tree.
799
+ * - undefined: No selection can be done.
800
+ * - 'single': Only one tree item can be selected, radio buttons are rendered.
801
+ * - 'multiselect': Multiple tree items can be selected, checkboxes are rendered.
802
+ *
803
+ * @default undefined
804
+ */
805
+ selectionMode?: SelectionMode_2;
806
+ /**
807
+ * This refers to a list of ids of checked tree items, or a list of tuples of ids and checked state.
808
+ * Controls the state of the checked tree items.
809
+ * These property is ignored for subtrees.
810
+ */
811
+ checkedItems?: Iterable<TreeItemValue | [TreeItemValue, TreeSelectionValue]>;
812
+ /**
813
+ * Callback fired when the component changes value from checked state.
814
+ * These property is ignored for subtrees.
815
+ *
816
+ * @param event - a React's Synthetic event
817
+ * @param data - A data object with relevant information,
818
+ * such as checked value and type of interaction that created the event.
819
+ */
820
+ onCheckedChange?(event: TreeCheckedChangeEvent, data: TreeCheckedChangeData): void;
821
+ };
822
+
823
+ export declare const TreeProvider: {
824
+ (props: React_2.ProviderProps<TreeContextValue | SubtreeContextValue>): JSXElement;
825
+ displayName: string;
826
+ };
827
+
828
+ export declare const TreeRootReset: (props: TreeRootResetProps) => JSXElement;
829
+
830
+ declare type TreeRootResetProps = {
831
+ children?: React_2.ReactNode;
832
+ };
833
+
834
+ export declare type TreeSelectionValue = MultiSelectValue | SingleSelectValue;
835
+
836
+ export declare type TreeSlots = {
837
+ root: Slot<'div'>;
838
+ collapseMotion?: Slot<PresenceMotionSlotProps<CollapseParams>>;
839
+ };
840
+
841
+ /**
842
+ * State used in rendering Tree
843
+ */
844
+ export declare type TreeState = ComponentState<TreeSlots> & {
845
+ open: boolean;
846
+ } & (TreeContextValue | SubtreeContextValue);
847
+
848
+ export declare const useFlatTree_unstable: (props: FlatTreeProps, ref: React_2.Ref<HTMLElement>) => FlatTreeState;
849
+
850
+ export declare const useFlatTreeContextValues_unstable: (state: FlatTreeState) => FlatTreeContextValues;
851
+
852
+ export declare const useFlatTreeStyles_unstable: (state: FlatTreeState) => FlatTreeState;
853
+
854
+ /**
855
+ * this hook provides FlatTree API to manage all required mechanisms to convert a list of items into renderable TreeItems
856
+ * in multiple scenarios including virtualization.
857
+ *
858
+ * !!A flat tree is an unofficial spec for tree!!
859
+ *
860
+ * It should be used on cases where more complex interactions with a Tree is required.
861
+ * On simple scenarios it is advised to simply use a nested structure instead.
862
+ *
863
+ * @param props - a list of tree items
864
+ * @param options - in case control over the internal openItems is required
865
+ */
866
+ export declare function useHeadlessFlatTree_unstable<Props extends HeadlessTreeItemProps>(props: Props[], options?: HeadlessFlatTreeOptions): HeadlessFlatTreeReturn<Props>;
867
+
868
+ export declare const useSubtreeContext_unstable: () => SubtreeContextValue;
869
+
870
+ export declare const useTree_unstable: (props: TreeProps, ref: React_2.Ref<HTMLElement>) => TreeState;
871
+
872
+ export declare const useTreeContext_unstable: <T>(selector: ContextSelector<TreeContextValue, T>) => T;
873
+
874
+ export declare function useTreeContextValues_unstable(state: TreeState): TreeContextValues;
875
+
876
+ /**
877
+ * Create the state required to render TreeItem.
878
+ *
879
+ * The returned state can be modified with hooks such as useTreeItemStyles_unstable,
880
+ * before being passed to renderTreeItem_unstable.
881
+ *
882
+ * @param props - props from this instance of TreeItem
883
+ * @param ref - reference to root HTMLElement of TreeItem
884
+ */
885
+ export declare function useTreeItem_unstable(props: TreeItemProps, ref: React_2.Ref<HTMLDivElement>): TreeItemState;
886
+
887
+ export declare const useTreeItemContext_unstable: <T>(selector: ContextSelector<TreeItemContextValue, T>) => T;
888
+
889
+ export declare function useTreeItemContextValues_unstable(state: TreeItemState): TreeItemContextValues;
890
+
891
+ /**
892
+ * Create the state required to render TreeItemLayout.
893
+ *
894
+ * The returned state can be modified with hooks such as useTreeItemLayoutStyles_unstable,
895
+ * before being passed to renderTreeItemLayout_unstable.
896
+ *
897
+ * @param props - props from this instance of TreeItemLayout
898
+ * @param ref - reference to root HTMLElement of TreeItemLayout
899
+ */
900
+ export declare const useTreeItemLayout_unstable: (props: TreeItemLayoutProps, ref: React_2.Ref<HTMLElement>) => TreeItemLayoutState;
901
+
902
+ /**
903
+ * Apply styling to the TreeItemLayout slots based on the state
904
+ */
905
+ export declare const useTreeItemLayoutStyles_unstable: (state: TreeItemLayoutState) => TreeItemLayoutState;
906
+
907
+ /**
908
+ * Create the state required to render TreeItemPersonaLayout.
909
+ *
910
+ * The returned state can be modified with hooks such as useTreeItemPersonaLayoutStyles_unstable,
911
+ * before being passed to renderTreeItemPersonaLayout_unstable.
912
+ *
913
+ * @param props - props from this instance of TreeItemPersonaLayout
914
+ * @param ref - reference to root HTMLElement of TreeItemPersonaLayout
915
+ */
916
+ export declare const useTreeItemPersonaLayout_unstable: (props: TreeItemPersonaLayoutProps, ref: React_2.Ref<HTMLSpanElement>) => TreeItemPersonaLayoutState;
917
+
918
+ /**
919
+ * Apply styling to the TreeItemPersonaLayout slots based on the state
920
+ */
921
+ export declare const useTreeItemPersonaLayoutStyles_unstable: (state: TreeItemPersonaLayoutState) => TreeItemPersonaLayoutState;
922
+
923
+ /**
924
+ * Apply styling to the TreeItem slots based on the state
925
+ */
926
+ export declare const useTreeItemStyles_unstable: (state: TreeItemState) => TreeItemState;
927
+
928
+ /***
929
+ * Hook used to manage navigation in the tree.
930
+ *
931
+ * @param navigationMode - the navigation mode of the tree, 'tree' (default) or 'treegrid'
932
+ */
933
+ export declare function useTreeNavigation(navigationMode?: TreeNavigationMode): {
934
+ navigate: (data: TreeNavigationData_unstable, focusOptions?: FocusOptions) => HTMLElement | null;
935
+ treeRef: React_2.RefCallback<HTMLElement>;
936
+ forceUpdateRovingTabIndex: () => void;
937
+ };
938
+
939
+ export declare const useTreeStyles_unstable: (state: TreeState) => TreeState;
940
+
941
+ export { }