@fluentui/react-nav 0.0.0-nightly-20250612-0406.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (465) hide show
  1. package/CHANGELOG.md +704 -0
  2. package/LICENSE +15 -0
  3. package/README.md +5 -0
  4. package/dist/index.d.ts +992 -0
  5. package/lib/AppItem.js +1 -0
  6. package/lib/AppItem.js.map +1 -0
  7. package/lib/AppItemStatic.js +1 -0
  8. package/lib/AppItemStatic.js.map +1 -0
  9. package/lib/Hamburger.js +1 -0
  10. package/lib/Hamburger.js.map +1 -0
  11. package/lib/Nav.js +3 -0
  12. package/lib/Nav.js.map +1 -0
  13. package/lib/NavCategory.js +1 -0
  14. package/lib/NavCategory.js.map +1 -0
  15. package/lib/NavDivider.js +1 -0
  16. package/lib/NavDivider.js.map +1 -0
  17. package/lib/NavDrawer.js +1 -0
  18. package/lib/NavDrawer.js.map +1 -0
  19. package/lib/NavDrawerBody.js +1 -0
  20. package/lib/NavDrawerBody.js.map +1 -0
  21. package/lib/NavDrawerFooter.js +1 -0
  22. package/lib/NavDrawerFooter.js.map +1 -0
  23. package/lib/NavDrawerHeader.js +1 -0
  24. package/lib/NavDrawerHeader.js.map +1 -0
  25. package/lib/NavItem.js +1 -0
  26. package/lib/NavItem.js.map +1 -0
  27. package/lib/NavSectionHeader.js +1 -0
  28. package/lib/NavSectionHeader.js.map +1 -0
  29. package/lib/NavSubItem.js +1 -0
  30. package/lib/NavSubItem.js.map +1 -0
  31. package/lib/NavSubItemGroup.js +1 -0
  32. package/lib/NavSubItemGroup.js.map +1 -0
  33. package/lib/SplitNavItem.js +1 -0
  34. package/lib/SplitNavItem.js.map +1 -0
  35. package/lib/components/AppItem/AppItem.js +20 -0
  36. package/lib/components/AppItem/AppItem.js.map +1 -0
  37. package/lib/components/AppItem/AppItem.types.js +3 -0
  38. package/lib/components/AppItem/AppItem.types.js.map +1 -0
  39. package/lib/components/AppItem/index.js +4 -0
  40. package/lib/components/AppItem/index.js.map +1 -0
  41. package/lib/components/AppItem/renderAppItem.js +13 -0
  42. package/lib/components/AppItem/renderAppItem.js.map +1 -0
  43. package/lib/components/AppItem/useAppItem.js +37 -0
  44. package/lib/components/AppItem/useAppItem.js.map +1 -0
  45. package/lib/components/AppItem/useAppItemStyles.styles.js +79 -0
  46. package/lib/components/AppItem/useAppItemStyles.styles.js.map +1 -0
  47. package/lib/components/AppItemStatic/AppItemStatic.js +20 -0
  48. package/lib/components/AppItemStatic/AppItemStatic.js.map +1 -0
  49. package/lib/components/AppItemStatic/AppItemStatic.types.js +3 -0
  50. package/lib/components/AppItemStatic/AppItemStatic.types.js.map +1 -0
  51. package/lib/components/AppItemStatic/index.js +4 -0
  52. package/lib/components/AppItemStatic/index.js.map +1 -0
  53. package/lib/components/AppItemStatic/renderAppItemStatic.js +13 -0
  54. package/lib/components/AppItemStatic/renderAppItemStatic.js.map +1 -0
  55. package/lib/components/AppItemStatic/useAppItemStatic.js +31 -0
  56. package/lib/components/AppItemStatic/useAppItemStatic.js.map +1 -0
  57. package/lib/components/AppItemStatic/useAppItemStaticStyles.styles.js +38 -0
  58. package/lib/components/AppItemStatic/useAppItemStaticStyles.styles.js.map +1 -0
  59. package/lib/components/Hamburger/Hamburger.js +15 -0
  60. package/lib/components/Hamburger/Hamburger.js.map +1 -0
  61. package/lib/components/Hamburger/Hamburger.types.js +3 -0
  62. package/lib/components/Hamburger/Hamburger.types.js.map +1 -0
  63. package/lib/components/Hamburger/index.js +3 -0
  64. package/lib/components/Hamburger/index.js.map +1 -0
  65. package/lib/components/Hamburger/useHamburger.js +15 -0
  66. package/lib/components/Hamburger/useHamburger.js.map +1 -0
  67. package/lib/components/Hamburger/useHamburgerStyles.styles.js +40 -0
  68. package/lib/components/Hamburger/useHamburgerStyles.styles.js.map +1 -0
  69. package/lib/components/Nav/Nav.js +14 -0
  70. package/lib/components/Nav/Nav.js.map +1 -0
  71. package/lib/components/Nav/Nav.types.js +1 -0
  72. package/lib/components/Nav/Nav.types.js.map +1 -0
  73. package/lib/components/Nav/index.js +4 -0
  74. package/lib/components/Nav/index.js.map +1 -0
  75. package/lib/components/Nav/renderNav.js +10 -0
  76. package/lib/components/Nav/renderNav.js.map +1 -0
  77. package/lib/components/Nav/useNav.js +134 -0
  78. package/lib/components/Nav/useNav.js.map +1 -0
  79. package/lib/components/Nav/useNavStyles.styles.js +27 -0
  80. package/lib/components/Nav/useNavStyles.styles.js.map +1 -0
  81. package/lib/components/NavCategory/NavCategory.js +12 -0
  82. package/lib/components/NavCategory/NavCategory.js.map +1 -0
  83. package/lib/components/NavCategory/NavCategory.types.js +1 -0
  84. package/lib/components/NavCategory/NavCategory.types.js.map +1 -0
  85. package/lib/components/NavCategory/index.js +3 -0
  86. package/lib/components/NavCategory/index.js.map +1 -0
  87. package/lib/components/NavCategory/renderNavCategory.js +9 -0
  88. package/lib/components/NavCategory/renderNavCategory.js.map +1 -0
  89. package/lib/components/NavCategory/useNavCategory.js +20 -0
  90. package/lib/components/NavCategory/useNavCategory.js.map +1 -0
  91. package/lib/components/NavCategoryContext.js +11 -0
  92. package/lib/components/NavCategoryContext.js.map +1 -0
  93. package/lib/components/NavCategoryItem/NavCategoryItem.js +18 -0
  94. package/lib/components/NavCategoryItem/NavCategoryItem.js.map +1 -0
  95. package/lib/components/NavCategoryItem/NavCategoryItem.types.js +3 -0
  96. package/lib/components/NavCategoryItem/NavCategoryItem.types.js.map +1 -0
  97. package/lib/components/NavCategoryItem/index.js +4 -0
  98. package/lib/components/NavCategoryItem/index.js.map +1 -0
  99. package/lib/components/NavCategoryItem/renderNavCategoryItem.js +18 -0
  100. package/lib/components/NavCategoryItem/renderNavCategoryItem.js.map +1 -0
  101. package/lib/components/NavCategoryItem/useNavCategoryItem.js +58 -0
  102. package/lib/components/NavCategoryItem/useNavCategoryItem.js.map +1 -0
  103. package/lib/components/NavCategoryItem/useNavCategoryItem.styles.js +60 -0
  104. package/lib/components/NavCategoryItem/useNavCategoryItem.styles.js.map +1 -0
  105. package/lib/components/NavCategoryItemContext.js +10 -0
  106. package/lib/components/NavCategoryItemContext.js.map +1 -0
  107. package/lib/components/NavContext.js +30 -0
  108. package/lib/components/NavContext.js.map +1 -0
  109. package/lib/components/NavContext.types.js +1 -0
  110. package/lib/components/NavContext.types.js.map +1 -0
  111. package/lib/components/NavDivider/NavDivider.js +15 -0
  112. package/lib/components/NavDivider/NavDivider.js.map +1 -0
  113. package/lib/components/NavDivider/NavDivider.types.js +3 -0
  114. package/lib/components/NavDivider/NavDivider.types.js.map +1 -0
  115. package/lib/components/NavDivider/index.js +3 -0
  116. package/lib/components/NavDivider/index.js.map +1 -0
  117. package/lib/components/NavDivider/useNavDivider.js +16 -0
  118. package/lib/components/NavDivider/useNavDivider.js.map +1 -0
  119. package/lib/components/NavDivider/useNavDividerStyles.styles.js +27 -0
  120. package/lib/components/NavDivider/useNavDividerStyles.styles.js.map +1 -0
  121. package/lib/components/NavDrawer/NavDrawer.js +18 -0
  122. package/lib/components/NavDrawer/NavDrawer.js.map +1 -0
  123. package/lib/components/NavDrawer/NavDrawer.types.js +3 -0
  124. package/lib/components/NavDrawer/NavDrawer.types.js.map +1 -0
  125. package/lib/components/NavDrawer/index.js +4 -0
  126. package/lib/components/NavDrawer/index.js.map +1 -0
  127. package/lib/components/NavDrawer/renderNavDrawer.js +10 -0
  128. package/lib/components/NavDrawer/renderNavDrawer.js.map +1 -0
  129. package/lib/components/NavDrawer/useNavDrawer.js +47 -0
  130. package/lib/components/NavDrawer/useNavDrawer.js.map +1 -0
  131. package/lib/components/NavDrawer/useNavDrawerStyles.styles.js +32 -0
  132. package/lib/components/NavDrawer/useNavDrawerStyles.styles.js.map +1 -0
  133. package/lib/components/NavDrawerBody/NavDrawerBody.js +15 -0
  134. package/lib/components/NavDrawerBody/NavDrawerBody.js.map +1 -0
  135. package/lib/components/NavDrawerBody/NavDrawerBody.types.js +3 -0
  136. package/lib/components/NavDrawerBody/NavDrawerBody.types.js.map +1 -0
  137. package/lib/components/NavDrawerBody/index.js +3 -0
  138. package/lib/components/NavDrawerBody/index.js.map +1 -0
  139. package/lib/components/NavDrawerBody/useNavDrawerBody.js +13 -0
  140. package/lib/components/NavDrawerBody/useNavDrawerBody.js.map +1 -0
  141. package/lib/components/NavDrawerBody/useNavDrawerBodyStyles.styles.js +39 -0
  142. package/lib/components/NavDrawerBody/useNavDrawerBodyStyles.styles.js.map +1 -0
  143. package/lib/components/NavDrawerFooter/NavDrawerFooter.js +15 -0
  144. package/lib/components/NavDrawerFooter/NavDrawerFooter.js.map +1 -0
  145. package/lib/components/NavDrawerFooter/NavDrawerFooter.types.js +3 -0
  146. package/lib/components/NavDrawerFooter/NavDrawerFooter.types.js.map +1 -0
  147. package/lib/components/NavDrawerFooter/index.js +3 -0
  148. package/lib/components/NavDrawerFooter/index.js.map +1 -0
  149. package/lib/components/NavDrawerFooter/useNavDrawerFooter.js +13 -0
  150. package/lib/components/NavDrawerFooter/useNavDrawerFooter.js.map +1 -0
  151. package/lib/components/NavDrawerFooter/useNavDrawerFooterStyles.styles.js +36 -0
  152. package/lib/components/NavDrawerFooter/useNavDrawerFooterStyles.styles.js.map +1 -0
  153. package/lib/components/NavDrawerHeader/NavDrawerHeader.js +15 -0
  154. package/lib/components/NavDrawerHeader/NavDrawerHeader.js.map +1 -0
  155. package/lib/components/NavDrawerHeader/NavDrawerHeader.types.js +3 -0
  156. package/lib/components/NavDrawerHeader/NavDrawerHeader.types.js.map +1 -0
  157. package/lib/components/NavDrawerHeader/index.js +3 -0
  158. package/lib/components/NavDrawerHeader/index.js.map +1 -0
  159. package/lib/components/NavDrawerHeader/useNavDrawerHeader.js +13 -0
  160. package/lib/components/NavDrawerHeader/useNavDrawerHeader.js.map +1 -0
  161. package/lib/components/NavDrawerHeader/useNavDrawerHeaderStyles.styles.js +38 -0
  162. package/lib/components/NavDrawerHeader/useNavDrawerHeaderStyles.styles.js.map +1 -0
  163. package/lib/components/NavItem/NavItem.js +16 -0
  164. package/lib/components/NavItem/NavItem.js.map +1 -0
  165. package/lib/components/NavItem/NavItem.types.js +3 -0
  166. package/lib/components/NavItem/NavItem.types.js.map +1 -0
  167. package/lib/components/NavItem/index.js +4 -0
  168. package/lib/components/NavItem/index.js.map +1 -0
  169. package/lib/components/NavItem/renderNavItem.js +13 -0
  170. package/lib/components/NavItem/renderNavItem.js.map +1 -0
  171. package/lib/components/NavItem/useNavItem.js +70 -0
  172. package/lib/components/NavItem/useNavItem.js.map +1 -0
  173. package/lib/components/NavItem/useNavItemStyles.styles.js +27 -0
  174. package/lib/components/NavItem/useNavItemStyles.styles.js.map +1 -0
  175. package/lib/components/NavSectionHeader/NavSectionHeader.js +15 -0
  176. package/lib/components/NavSectionHeader/NavSectionHeader.js.map +1 -0
  177. package/lib/components/NavSectionHeader/NavSectionHeader.types.js +4 -0
  178. package/lib/components/NavSectionHeader/NavSectionHeader.types.js.map +1 -0
  179. package/lib/components/NavSectionHeader/index.js +4 -0
  180. package/lib/components/NavSectionHeader/index.js.map +1 -0
  181. package/lib/components/NavSectionHeader/renderNavSectionHeader.js +8 -0
  182. package/lib/components/NavSectionHeader/renderNavSectionHeader.js.map +1 -0
  183. package/lib/components/NavSectionHeader/useNavSectionHeader.js +23 -0
  184. package/lib/components/NavSectionHeader/useNavSectionHeader.js.map +1 -0
  185. package/lib/components/NavSectionHeader/useNavSectionHeaderStyles.styles.js +34 -0
  186. package/lib/components/NavSectionHeader/useNavSectionHeaderStyles.styles.js.map +1 -0
  187. package/lib/components/NavSubItem/NavSubItem.js +16 -0
  188. package/lib/components/NavSubItem/NavSubItem.js.map +1 -0
  189. package/lib/components/NavSubItem/NavSubItem.types.js +3 -0
  190. package/lib/components/NavSubItem/NavSubItem.types.js.map +1 -0
  191. package/lib/components/NavSubItem/index.js +4 -0
  192. package/lib/components/NavSubItem/index.js.map +1 -0
  193. package/lib/components/NavSubItem/renderNavSubItem.js +8 -0
  194. package/lib/components/NavSubItem/renderNavSubItem.js.map +1 -0
  195. package/lib/components/NavSubItem/useNavSubItem.js +69 -0
  196. package/lib/components/NavSubItem/useNavSubItem.js.map +1 -0
  197. package/lib/components/NavSubItem/useNavSubItemStyles.styles.js +39 -0
  198. package/lib/components/NavSubItem/useNavSubItemStyles.styles.js.map +1 -0
  199. package/lib/components/NavSubItemContext.js +11 -0
  200. package/lib/components/NavSubItemContext.js.map +1 -0
  201. package/lib/components/NavSubItemGroup/NavSubItemGroup.js +16 -0
  202. package/lib/components/NavSubItemGroup/NavSubItemGroup.js.map +1 -0
  203. package/lib/components/NavSubItemGroup/NavSubItemGroup.types.js +3 -0
  204. package/lib/components/NavSubItemGroup/NavSubItemGroup.types.js.map +1 -0
  205. package/lib/components/NavSubItemGroup/index.js +4 -0
  206. package/lib/components/NavSubItemGroup/index.js.map +1 -0
  207. package/lib/components/NavSubItemGroup/renderNavSubItemGroup.js +10 -0
  208. package/lib/components/NavSubItemGroup/renderNavSubItemGroup.js.map +1 -0
  209. package/lib/components/NavSubItemGroup/useNavSubItemGroup.js +29 -0
  210. package/lib/components/NavSubItemGroup/useNavSubItemGroup.js.map +1 -0
  211. package/lib/components/NavSubItemGroup/useNavSubItemGroupStyles.styles.js +22 -0
  212. package/lib/components/NavSubItemGroup/useNavSubItemGroupStyles.styles.js.map +1 -0
  213. package/lib/components/SplitNavItem/SplitNavItem.js +20 -0
  214. package/lib/components/SplitNavItem/SplitNavItem.js.map +1 -0
  215. package/lib/components/SplitNavItem/SplitNavItem.types.js +3 -0
  216. package/lib/components/SplitNavItem/SplitNavItem.types.js.map +1 -0
  217. package/lib/components/SplitNavItem/index.js +4 -0
  218. package/lib/components/SplitNavItem/index.js.map +1 -0
  219. package/lib/components/SplitNavItem/renderSplitNavItem.js +24 -0
  220. package/lib/components/SplitNavItem/renderSplitNavItem.js.map +1 -0
  221. package/lib/components/SplitNavItem/useSplitNavItem.js +101 -0
  222. package/lib/components/SplitNavItem/useSplitNavItem.js.map +1 -0
  223. package/lib/components/SplitNavItem/useSplitNavItemStyles.styles.js +98 -0
  224. package/lib/components/SplitNavItem/useSplitNavItemStyles.styles.js.map +1 -0
  225. package/lib/components/sharedNavStyles.styles.js +147 -0
  226. package/lib/components/sharedNavStyles.styles.js.map +1 -0
  227. package/lib/components/useNavCategoryContextValues_unstable.js +14 -0
  228. package/lib/components/useNavCategoryContextValues_unstable.js.map +1 -0
  229. package/lib/components/useNavCategoryItemContextValues_unstable.js +14 -0
  230. package/lib/components/useNavCategoryItemContextValues_unstable.js.map +1 -0
  231. package/lib/components/useNavContextValues.js +30 -0
  232. package/lib/components/useNavContextValues.js.map +1 -0
  233. package/lib/index.js +22 -0
  234. package/lib/index.js.map +1 -0
  235. package/lib-commonjs/AppItem.js +31 -0
  236. package/lib-commonjs/AppItem.js.map +1 -0
  237. package/lib-commonjs/AppItemStatic.js +28 -0
  238. package/lib-commonjs/AppItemStatic.js.map +1 -0
  239. package/lib-commonjs/Hamburger.js +25 -0
  240. package/lib-commonjs/Hamburger.js.map +1 -0
  241. package/lib-commonjs/Nav.js +51 -0
  242. package/lib-commonjs/Nav.js.map +1 -0
  243. package/lib-commonjs/NavCategory.js +22 -0
  244. package/lib-commonjs/NavCategory.js.map +1 -0
  245. package/lib-commonjs/NavDivider.js +25 -0
  246. package/lib-commonjs/NavDivider.js.map +1 -0
  247. package/lib-commonjs/NavDrawer.js +28 -0
  248. package/lib-commonjs/NavDrawer.js.map +1 -0
  249. package/lib-commonjs/NavDrawerBody.js +25 -0
  250. package/lib-commonjs/NavDrawerBody.js.map +1 -0
  251. package/lib-commonjs/NavDrawerFooter.js +25 -0
  252. package/lib-commonjs/NavDrawerFooter.js.map +1 -0
  253. package/lib-commonjs/NavDrawerHeader.js +25 -0
  254. package/lib-commonjs/NavDrawerHeader.js.map +1 -0
  255. package/lib-commonjs/NavItem.js +28 -0
  256. package/lib-commonjs/NavItem.js.map +1 -0
  257. package/lib-commonjs/NavSectionHeader.js +28 -0
  258. package/lib-commonjs/NavSectionHeader.js.map +1 -0
  259. package/lib-commonjs/NavSubItem.js +28 -0
  260. package/lib-commonjs/NavSubItem.js.map +1 -0
  261. package/lib-commonjs/NavSubItemGroup.js +28 -0
  262. package/lib-commonjs/NavSubItemGroup.js.map +1 -0
  263. package/lib-commonjs/SplitNavItem.js +28 -0
  264. package/lib-commonjs/SplitNavItem.js.map +1 -0
  265. package/lib-commonjs/components/AppItem/AppItem.js +29 -0
  266. package/lib-commonjs/components/AppItem/AppItem.js.map +1 -0
  267. package/lib-commonjs/components/AppItem/AppItem.types.js +6 -0
  268. package/lib-commonjs/components/AppItem/AppItem.types.js.map +1 -0
  269. package/lib-commonjs/components/AppItem/index.js +34 -0
  270. package/lib-commonjs/components/AppItem/index.js.map +1 -0
  271. package/lib-commonjs/components/AppItem/renderAppItem.js +21 -0
  272. package/lib-commonjs/components/AppItem/renderAppItem.js.map +1 -0
  273. package/lib-commonjs/components/AppItem/useAppItem.js +40 -0
  274. package/lib-commonjs/components/AppItem/useAppItem.js.map +1 -0
  275. package/lib-commonjs/components/AppItem/useAppItemStyles.styles.js +133 -0
  276. package/lib-commonjs/components/AppItem/useAppItemStyles.styles.js.map +1 -0
  277. package/lib-commonjs/components/AppItemStatic/AppItemStatic.js +29 -0
  278. package/lib-commonjs/components/AppItemStatic/AppItemStatic.js.map +1 -0
  279. package/lib-commonjs/components/AppItemStatic/AppItemStatic.types.js +6 -0
  280. package/lib-commonjs/components/AppItemStatic/AppItemStatic.types.js.map +1 -0
  281. package/lib-commonjs/components/AppItemStatic/index.js +31 -0
  282. package/lib-commonjs/components/AppItemStatic/index.js.map +1 -0
  283. package/lib-commonjs/components/AppItemStatic/renderAppItemStatic.js +21 -0
  284. package/lib-commonjs/components/AppItemStatic/renderAppItemStatic.js.map +1 -0
  285. package/lib-commonjs/components/AppItemStatic/useAppItemStatic.js +34 -0
  286. package/lib-commonjs/components/AppItemStatic/useAppItemStatic.js.map +1 -0
  287. package/lib-commonjs/components/AppItemStatic/useAppItemStaticStyles.styles.js +55 -0
  288. package/lib-commonjs/components/AppItemStatic/useAppItemStaticStyles.styles.js.map +1 -0
  289. package/lib-commonjs/components/Hamburger/Hamburger.js +24 -0
  290. package/lib-commonjs/components/Hamburger/Hamburger.js.map +1 -0
  291. package/lib-commonjs/components/Hamburger/Hamburger.types.js +6 -0
  292. package/lib-commonjs/components/Hamburger/Hamburger.types.js.map +1 -0
  293. package/lib-commonjs/components/Hamburger/index.js +27 -0
  294. package/lib-commonjs/components/Hamburger/index.js.map +1 -0
  295. package/lib-commonjs/components/Hamburger/useHamburger.js +21 -0
  296. package/lib-commonjs/components/Hamburger/useHamburger.js.map +1 -0
  297. package/lib-commonjs/components/Hamburger/useHamburgerStyles.styles.js +69 -0
  298. package/lib-commonjs/components/Hamburger/useHamburgerStyles.styles.js.map +1 -0
  299. package/lib-commonjs/components/Nav/Nav.js +23 -0
  300. package/lib-commonjs/components/Nav/Nav.js.map +1 -0
  301. package/lib-commonjs/components/Nav/Nav.types.js +6 -0
  302. package/lib-commonjs/components/Nav/Nav.types.js.map +1 -0
  303. package/lib-commonjs/components/Nav/index.js +31 -0
  304. package/lib-commonjs/components/Nav/index.js.map +1 -0
  305. package/lib-commonjs/components/Nav/renderNav.js +20 -0
  306. package/lib-commonjs/components/Nav/renderNav.js.map +1 -0
  307. package/lib-commonjs/components/Nav/useNav.js +137 -0
  308. package/lib-commonjs/components/Nav/useNav.js.map +1 -0
  309. package/lib-commonjs/components/Nav/useNavStyles.styles.js +43 -0
  310. package/lib-commonjs/components/Nav/useNavStyles.styles.js.map +1 -0
  311. package/lib-commonjs/components/NavCategory/NavCategory.js +21 -0
  312. package/lib-commonjs/components/NavCategory/NavCategory.js.map +1 -0
  313. package/lib-commonjs/components/NavCategory/NavCategory.types.js +6 -0
  314. package/lib-commonjs/components/NavCategory/NavCategory.types.js.map +1 -0
  315. package/lib-commonjs/components/NavCategory/index.js +24 -0
  316. package/lib-commonjs/components/NavCategory/index.js.map +1 -0
  317. package/lib-commonjs/components/NavCategory/renderNavCategory.js +18 -0
  318. package/lib-commonjs/components/NavCategory/renderNavCategory.js.map +1 -0
  319. package/lib-commonjs/components/NavCategory/useNavCategory.js +23 -0
  320. package/lib-commonjs/components/NavCategory/useNavCategory.js.map +1 -0
  321. package/lib-commonjs/components/NavCategoryContext.js +30 -0
  322. package/lib-commonjs/components/NavCategoryContext.js.map +1 -0
  323. package/lib-commonjs/components/NavCategoryItem/NavCategoryItem.js +25 -0
  324. package/lib-commonjs/components/NavCategoryItem/NavCategoryItem.js.map +1 -0
  325. package/lib-commonjs/components/NavCategoryItem/NavCategoryItem.types.js +6 -0
  326. package/lib-commonjs/components/NavCategoryItem/NavCategoryItem.types.js.map +1 -0
  327. package/lib-commonjs/components/NavCategoryItem/index.js +31 -0
  328. package/lib-commonjs/components/NavCategoryItem/index.js.map +1 -0
  329. package/lib-commonjs/components/NavCategoryItem/renderNavCategoryItem.js +26 -0
  330. package/lib-commonjs/components/NavCategoryItem/renderNavCategoryItem.js.map +1 -0
  331. package/lib-commonjs/components/NavCategoryItem/useNavCategoryItem.js +61 -0
  332. package/lib-commonjs/components/NavCategoryItem/useNavCategoryItem.js.map +1 -0
  333. package/lib-commonjs/components/NavCategoryItem/useNavCategoryItem.styles.js +83 -0
  334. package/lib-commonjs/components/NavCategoryItem/useNavCategoryItem.styles.js.map +1 -0
  335. package/lib-commonjs/components/NavCategoryItemContext.js +29 -0
  336. package/lib-commonjs/components/NavCategoryItemContext.js.map +1 -0
  337. package/lib-commonjs/components/NavContext.js +49 -0
  338. package/lib-commonjs/components/NavContext.js.map +1 -0
  339. package/lib-commonjs/components/NavContext.types.js +6 -0
  340. package/lib-commonjs/components/NavContext.types.js.map +1 -0
  341. package/lib-commonjs/components/NavDivider/NavDivider.js +24 -0
  342. package/lib-commonjs/components/NavDivider/NavDivider.js.map +1 -0
  343. package/lib-commonjs/components/NavDivider/NavDivider.types.js +6 -0
  344. package/lib-commonjs/components/NavDivider/NavDivider.types.js.map +1 -0
  345. package/lib-commonjs/components/NavDivider/index.js +27 -0
  346. package/lib-commonjs/components/NavDivider/index.js.map +1 -0
  347. package/lib-commonjs/components/NavDivider/useNavDivider.js +19 -0
  348. package/lib-commonjs/components/NavDivider/useNavDivider.js.map +1 -0
  349. package/lib-commonjs/components/NavDivider/useNavDividerStyles.styles.js +45 -0
  350. package/lib-commonjs/components/NavDivider/useNavDividerStyles.styles.js.map +1 -0
  351. package/lib-commonjs/components/NavDrawer/NavDrawer.js +26 -0
  352. package/lib-commonjs/components/NavDrawer/NavDrawer.js.map +1 -0
  353. package/lib-commonjs/components/NavDrawer/NavDrawer.types.js +6 -0
  354. package/lib-commonjs/components/NavDrawer/NavDrawer.types.js.map +1 -0
  355. package/lib-commonjs/components/NavDrawer/index.js +31 -0
  356. package/lib-commonjs/components/NavDrawer/index.js.map +1 -0
  357. package/lib-commonjs/components/NavDrawer/renderNavDrawer.js +20 -0
  358. package/lib-commonjs/components/NavDrawer/renderNavDrawer.js.map +1 -0
  359. package/lib-commonjs/components/NavDrawer/useNavDrawer.js +50 -0
  360. package/lib-commonjs/components/NavDrawer/useNavDrawer.js.map +1 -0
  361. package/lib-commonjs/components/NavDrawer/useNavDrawerStyles.styles.js +46 -0
  362. package/lib-commonjs/components/NavDrawer/useNavDrawerStyles.styles.js.map +1 -0
  363. package/lib-commonjs/components/NavDrawerBody/NavDrawerBody.js +24 -0
  364. package/lib-commonjs/components/NavDrawerBody/NavDrawerBody.js.map +1 -0
  365. package/lib-commonjs/components/NavDrawerBody/NavDrawerBody.types.js +6 -0
  366. package/lib-commonjs/components/NavDrawerBody/NavDrawerBody.types.js.map +1 -0
  367. package/lib-commonjs/components/NavDrawerBody/index.js +27 -0
  368. package/lib-commonjs/components/NavDrawerBody/index.js.map +1 -0
  369. package/lib-commonjs/components/NavDrawerBody/useNavDrawerBody.js +16 -0
  370. package/lib-commonjs/components/NavDrawerBody/useNavDrawerBody.js.map +1 -0
  371. package/lib-commonjs/components/NavDrawerBody/useNavDrawerBodyStyles.styles.js +67 -0
  372. package/lib-commonjs/components/NavDrawerBody/useNavDrawerBodyStyles.styles.js.map +1 -0
  373. package/lib-commonjs/components/NavDrawerFooter/NavDrawerFooter.js +24 -0
  374. package/lib-commonjs/components/NavDrawerFooter/NavDrawerFooter.js.map +1 -0
  375. package/lib-commonjs/components/NavDrawerFooter/NavDrawerFooter.types.js +6 -0
  376. package/lib-commonjs/components/NavDrawerFooter/NavDrawerFooter.types.js.map +1 -0
  377. package/lib-commonjs/components/NavDrawerFooter/index.js +27 -0
  378. package/lib-commonjs/components/NavDrawerFooter/index.js.map +1 -0
  379. package/lib-commonjs/components/NavDrawerFooter/useNavDrawerFooter.js +16 -0
  380. package/lib-commonjs/components/NavDrawerFooter/useNavDrawerFooter.js.map +1 -0
  381. package/lib-commonjs/components/NavDrawerFooter/useNavDrawerFooterStyles.styles.js +56 -0
  382. package/lib-commonjs/components/NavDrawerFooter/useNavDrawerFooterStyles.styles.js.map +1 -0
  383. package/lib-commonjs/components/NavDrawerHeader/NavDrawerHeader.js +24 -0
  384. package/lib-commonjs/components/NavDrawerHeader/NavDrawerHeader.js.map +1 -0
  385. package/lib-commonjs/components/NavDrawerHeader/NavDrawerHeader.types.js +6 -0
  386. package/lib-commonjs/components/NavDrawerHeader/NavDrawerHeader.types.js.map +1 -0
  387. package/lib-commonjs/components/NavDrawerHeader/index.js +27 -0
  388. package/lib-commonjs/components/NavDrawerHeader/index.js.map +1 -0
  389. package/lib-commonjs/components/NavDrawerHeader/useNavDrawerHeader.js +16 -0
  390. package/lib-commonjs/components/NavDrawerHeader/useNavDrawerHeader.js.map +1 -0
  391. package/lib-commonjs/components/NavDrawerHeader/useNavDrawerHeaderStyles.styles.js +61 -0
  392. package/lib-commonjs/components/NavDrawerHeader/useNavDrawerHeaderStyles.styles.js.map +1 -0
  393. package/lib-commonjs/components/NavItem/NavItem.js +24 -0
  394. package/lib-commonjs/components/NavItem/NavItem.js.map +1 -0
  395. package/lib-commonjs/components/NavItem/NavItem.types.js +6 -0
  396. package/lib-commonjs/components/NavItem/NavItem.types.js.map +1 -0
  397. package/lib-commonjs/components/NavItem/index.js +31 -0
  398. package/lib-commonjs/components/NavItem/index.js.map +1 -0
  399. package/lib-commonjs/components/NavItem/renderNavItem.js +21 -0
  400. package/lib-commonjs/components/NavItem/renderNavItem.js.map +1 -0
  401. package/lib-commonjs/components/NavItem/useNavItem.js +73 -0
  402. package/lib-commonjs/components/NavItem/useNavItem.js.map +1 -0
  403. package/lib-commonjs/components/NavItem/useNavItemStyles.styles.js +38 -0
  404. package/lib-commonjs/components/NavItem/useNavItemStyles.styles.js.map +1 -0
  405. package/lib-commonjs/components/NavSectionHeader/NavSectionHeader.js +24 -0
  406. package/lib-commonjs/components/NavSectionHeader/NavSectionHeader.js.map +1 -0
  407. package/lib-commonjs/components/NavSectionHeader/NavSectionHeader.types.js +8 -0
  408. package/lib-commonjs/components/NavSectionHeader/NavSectionHeader.types.js.map +1 -0
  409. package/lib-commonjs/components/NavSectionHeader/index.js +31 -0
  410. package/lib-commonjs/components/NavSectionHeader/index.js.map +1 -0
  411. package/lib-commonjs/components/NavSectionHeader/renderNavSectionHeader.js +16 -0
  412. package/lib-commonjs/components/NavSectionHeader/renderNavSectionHeader.js.map +1 -0
  413. package/lib-commonjs/components/NavSectionHeader/useNavSectionHeader.js +26 -0
  414. package/lib-commonjs/components/NavSectionHeader/useNavSectionHeader.js.map +1 -0
  415. package/lib-commonjs/components/NavSectionHeader/useNavSectionHeaderStyles.styles.js +56 -0
  416. package/lib-commonjs/components/NavSectionHeader/useNavSectionHeaderStyles.styles.js.map +1 -0
  417. package/lib-commonjs/components/NavSubItem/NavSubItem.js +24 -0
  418. package/lib-commonjs/components/NavSubItem/NavSubItem.js.map +1 -0
  419. package/lib-commonjs/components/NavSubItem/NavSubItem.types.js +6 -0
  420. package/lib-commonjs/components/NavSubItem/NavSubItem.types.js.map +1 -0
  421. package/lib-commonjs/components/NavSubItem/index.js +31 -0
  422. package/lib-commonjs/components/NavSubItem/index.js.map +1 -0
  423. package/lib-commonjs/components/NavSubItem/renderNavSubItem.js +16 -0
  424. package/lib-commonjs/components/NavSubItem/renderNavSubItem.js.map +1 -0
  425. package/lib-commonjs/components/NavSubItem/useNavSubItem.js +72 -0
  426. package/lib-commonjs/components/NavSubItem/useNavSubItem.js.map +1 -0
  427. package/lib-commonjs/components/NavSubItem/useNavSubItemStyles.styles.js +53 -0
  428. package/lib-commonjs/components/NavSubItem/useNavSubItemStyles.styles.js.map +1 -0
  429. package/lib-commonjs/components/NavSubItemContext.js +30 -0
  430. package/lib-commonjs/components/NavSubItemContext.js.map +1 -0
  431. package/lib-commonjs/components/NavSubItemGroup/NavSubItemGroup.js +24 -0
  432. package/lib-commonjs/components/NavSubItemGroup/NavSubItemGroup.js.map +1 -0
  433. package/lib-commonjs/components/NavSubItemGroup/NavSubItemGroup.types.js +6 -0
  434. package/lib-commonjs/components/NavSubItemGroup/NavSubItemGroup.types.js.map +1 -0
  435. package/lib-commonjs/components/NavSubItemGroup/index.js +31 -0
  436. package/lib-commonjs/components/NavSubItemGroup/index.js.map +1 -0
  437. package/lib-commonjs/components/NavSubItemGroup/renderNavSubItemGroup.js +18 -0
  438. package/lib-commonjs/components/NavSubItemGroup/renderNavSubItemGroup.js.map +1 -0
  439. package/lib-commonjs/components/NavSubItemGroup/useNavSubItemGroup.js +32 -0
  440. package/lib-commonjs/components/NavSubItemGroup/useNavSubItemGroup.js.map +1 -0
  441. package/lib-commonjs/components/NavSubItemGroup/useNavSubItemGroupStyles.styles.js +35 -0
  442. package/lib-commonjs/components/NavSubItemGroup/useNavSubItemGroupStyles.styles.js.map +1 -0
  443. package/lib-commonjs/components/SplitNavItem/SplitNavItem.js +29 -0
  444. package/lib-commonjs/components/SplitNavItem/SplitNavItem.js.map +1 -0
  445. package/lib-commonjs/components/SplitNavItem/SplitNavItem.types.js +6 -0
  446. package/lib-commonjs/components/SplitNavItem/SplitNavItem.types.js.map +1 -0
  447. package/lib-commonjs/components/SplitNavItem/index.js +31 -0
  448. package/lib-commonjs/components/SplitNavItem/index.js.map +1 -0
  449. package/lib-commonjs/components/SplitNavItem/renderSplitNavItem.js +32 -0
  450. package/lib-commonjs/components/SplitNavItem/renderSplitNavItem.js.map +1 -0
  451. package/lib-commonjs/components/SplitNavItem/useSplitNavItem.js +104 -0
  452. package/lib-commonjs/components/SplitNavItem/useSplitNavItem.js.map +1 -0
  453. package/lib-commonjs/components/SplitNavItem/useSplitNavItemStyles.styles.js +149 -0
  454. package/lib-commonjs/components/SplitNavItem/useSplitNavItemStyles.styles.js.map +1 -0
  455. package/lib-commonjs/components/sharedNavStyles.styles.js +242 -0
  456. package/lib-commonjs/components/sharedNavStyles.styles.js.map +1 -0
  457. package/lib-commonjs/components/useNavCategoryContextValues_unstable.js +25 -0
  458. package/lib-commonjs/components/useNavCategoryContextValues_unstable.js.map +1 -0
  459. package/lib-commonjs/components/useNavCategoryItemContextValues_unstable.js +25 -0
  460. package/lib-commonjs/components/useNavCategoryItemContextValues_unstable.js.map +1 -0
  461. package/lib-commonjs/components/useNavContextValues.js +41 -0
  462. package/lib-commonjs/components/useNavContextValues.js.map +1 -0
  463. package/lib-commonjs/index.js +280 -0
  464. package/lib-commonjs/index.js.map +1 -0
  465. package/package.json +58 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__styles","mergeClasses","shorthands","useButtonStyles_unstable","navItemTokens","hamburgerClassNames","root","icon","useStyles","w71qe1","De3pzq","icvyot","vrafjx","oivjwe","wvpqe5","Jwef8y","ecr2s2","d","h","a","useHamburgerStyles_unstable","state","styles","className"],"sources":["useHamburgerStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { useButtonStyles_unstable } from '@fluentui/react-button';\nimport { navItemTokens } from '../sharedNavStyles.styles';\nexport const hamburgerClassNames = {\n root: 'fui-Hamburger',\n icon: 'fui-Hamburger__icon'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n textDecorationLine: 'none',\n backgroundColor: navItemTokens.backgroundColor,\n ...shorthands.border('none'),\n ':hover': {\n backgroundColor: navItemTokens.backgroundColorHover\n },\n ':active': {\n backgroundColor: navItemTokens.backgroundColorPressed\n }\n }\n});\n/**\n * Apply styling to the Hamburger slots based on the state\n */ export const useHamburgerStyles_unstable = (state)=>{\n 'use no memo';\n useButtonStyles_unstable(state);\n const styles = useStyles();\n state.root.className = mergeClasses(hamburgerClassNames.root, styles.root, state.root.className);\n if (state.icon) {\n state.icon.className = mergeClasses(hamburgerClassNames.icon, state.icon.className);\n }\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,aAAa,QAAQ,2BAA2B;AACzD,OAAO,MAAMC,mBAAmB,GAAG;EAC/BC,IAAI,EAAE,eAAe;EACrBC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGR,QAAA;EAAAM,IAAA;IAAAG,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;EAAAC,CAAA;EAAAC,CAAA;AAAA,CAYrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,2BAA2B,GAAIC,KAAK,IAAG;EACpD,aAAa;;EACblB,wBAAwB,CAACkB,KAAK,CAAC;EAC/B,MAAMC,MAAM,GAAGd,SAAS,CAAC,CAAC;EAC1Ba,KAAK,CAACf,IAAI,CAACiB,SAAS,GAAGtB,YAAY,CAACI,mBAAmB,CAACC,IAAI,EAAEgB,MAAM,CAAChB,IAAI,EAAEe,KAAK,CAACf,IAAI,CAACiB,SAAS,CAAC;EAChG,IAAIF,KAAK,CAACd,IAAI,EAAE;IACZc,KAAK,CAACd,IAAI,CAACgB,SAAS,GAAGtB,YAAY,CAACI,mBAAmB,CAACE,IAAI,EAAEc,KAAK,CAACd,IAAI,CAACgB,SAAS,CAAC;EACvF;EACA,OAAOF,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { useNav_unstable } from './useNav';
3
+ import { renderNav_unstable } from './renderNav';
4
+ import { useNavStyles_unstable } from './useNavStyles.styles';
5
+ import { useNavContextValues_unstable } from '../useNavContextValues';
6
+ /**
7
+ * Nav - A component that provides up to two levels of nesting for navigation.
8
+ */ export const Nav = /*#__PURE__*/ React.forwardRef((props, ref)=>{
9
+ const state = useNav_unstable(props, ref);
10
+ const contextValues = useNavContextValues_unstable(state);
11
+ useNavStyles_unstable(state);
12
+ return renderNav_unstable(state, contextValues);
13
+ });
14
+ Nav.displayName = 'Nav';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Nav/Nav.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useNav_unstable } from './useNav';\nimport { renderNav_unstable } from './renderNav';\nimport { useNavStyles_unstable } from './useNavStyles.styles';\nimport { useNavContextValues_unstable } from '../useNavContextValues';\nimport type { NavProps } from './Nav.types';\n\n/**\n * Nav - A component that provides up to two levels of nesting for navigation.\n */\nexport const Nav: ForwardRefComponent<NavProps> = React.forwardRef((props, ref) => {\n const state = useNav_unstable(props, ref);\n\n const contextValues = useNavContextValues_unstable(state);\n\n useNavStyles_unstable(state);\n return renderNav_unstable(state, contextValues);\n});\n\nNav.displayName = 'Nav';\n"],"names":["React","useNav_unstable","renderNav_unstable","useNavStyles_unstable","useNavContextValues_unstable","Nav","forwardRef","props","ref","state","contextValues","displayName"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,eAAe,QAAQ,WAAW;AAC3C,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,qBAAqB,QAAQ,wBAAwB;AAC9D,SAASC,4BAA4B,QAAQ,yBAAyB;AAGtE;;CAEC,GACD,OAAO,MAAMC,oBAAqCL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACzE,MAAMC,QAAQR,gBAAgBM,OAAOC;IAErC,MAAME,gBAAgBN,6BAA6BK;IAEnDN,sBAAsBM;IACtB,OAAOP,mBAAmBO,OAAOC;AACnC,GAAG;AAEHL,IAAIM,WAAW,GAAG"}
@@ -0,0 +1 @@
1
+ import * as React from 'react';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Nav/Nav.types.ts"],"sourcesContent":["import * as React from 'react';\n\nimport type { ComponentProps, ComponentState, EventData, EventHandler, Slot } from '@fluentui/react-utilities';\nimport type { NavContextValue, NavItemValue } from '../NavContext.types';\n\nexport type NavSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\n/***\n * Indicates the vertical density of the Nav content.\n * This does not affect horizontal spacing.\n */\nexport type NavDensity = 'small' | 'medium';\n\n/**\n * Nav Props\n */\nexport type NavProps = ComponentProps<NavSlots> & {\n /**\n * The value of the navItem to be selected by default.\n * Typically useful when the selectedValue is uncontrolled.\n * Mutually exclusive with selectedValue.\n * Empty string indicates no selection.\n */\n defaultSelectedValue?: NavItemValue;\n\n /**\n * The value of the navCategory to be selected by default.\n * Typically useful when the selectedValue is uncontrolled.\n * Mutually exclusive with selectedValue.\n * Empty string indicates no selection.\n */\n defaultSelectedCategoryValue?: NavItemValue;\n\n /**\n * Set of categories that are opened by default.\n * Typically useful when the openCategories is uncontrolled.\n */\n defaultOpenCategories?: NavItemValue[];\n\n /**\n * Controls the open categories.\n * For use in controlled scenarios.\n */\n openCategories?: NavItemValue[];\n\n /**\n * Raised when a navItem is selected.\n * If the navItem is child of a category, the categoryValue will be provided\n */\n onNavItemSelect?: EventHandler<OnNavItemSelectData>;\n\n /**\n * The value of the currently selected navItem.\n * Mutually exclusive with defaultSelectedValue.\n * @default undefined\n */\n selectedValue?: NavItemValue;\n\n /**\n * Indicates a category that has a selected child\n * Will show the category as selected if it is closed.\n * @default undefined\n */\n selectedCategoryValue?: NavItemValue;\n\n /**\n * Indicates if Nav supports multiple open Categories at the same time.\n * @default true, indicating that multiple categories can be open at the same time.\n */\n multiple?: boolean;\n\n /**\n * Callback raised when a NavCategoryItem is toggled.\n */\n onNavCategoryItemToggle?: EventHandler<OnNavItemSelectData>;\n\n /**\n * The vertical density of the Nav and it's children\n * @default 'medium'\n */\n density?: NavDensity;\n};\n\nexport type OnNavItemSelectData = EventData<'click', React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>> & {\n /**\n * The value of the selected navItem.\n * In the case of a category selection, this will be the value of the selected category.\n */\n value: NavItemValue;\n\n /**\n * The parent value of the selected navSubItem\n * Null if not a child of a category\n */\n categoryValue?: NavItemValue;\n};\n\n/**\n * State used in rendering Nav\n */\nexport type NavState = ComponentState<NavSlots> & NavContextValue;\n"],"names":["React"],"rangeMappings":"","mappings":"AAAA,YAAYA,WAAW,QAAQ"}
@@ -0,0 +1,4 @@
1
+ export { Nav } from './Nav';
2
+ export { renderNav_unstable } from './renderNav';
3
+ export { useNav_unstable } from './useNav';
4
+ export { useNavStyles_unstable, navClassNames } from './useNavStyles.styles';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Nav/index.ts"],"sourcesContent":["export { Nav } from './Nav';\nexport type { NavSlots, NavProps, OnNavItemSelectData, NavState, NavDensity } from './Nav.types';\nexport { renderNav_unstable } from './renderNav';\nexport { useNav_unstable } from './useNav';\nexport { useNavStyles_unstable, navClassNames } from './useNavStyles.styles';\n"],"names":["Nav","renderNav_unstable","useNav_unstable","useNavStyles_unstable","navClassNames"],"rangeMappings":";;;","mappings":"AAAA,SAASA,GAAG,QAAQ,QAAQ;AAE5B,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,eAAe,QAAQ,WAAW;AAC3C,SAASC,qBAAqB,EAAEC,aAAa,QAAQ,wBAAwB"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
+ import { assertSlots } from '@fluentui/react-utilities';
3
+ import { NavProvider } from '../NavContext';
4
+ export const renderNav_unstable = (state, contextValues)=>{
5
+ assertSlots(state);
6
+ return /*#__PURE__*/ _jsx(NavProvider, {
7
+ value: contextValues.nav,
8
+ children: /*#__PURE__*/ _jsx(state.root, {})
9
+ });
10
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Nav/renderNav.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { NavProvider } from '../NavContext';\nimport type { NavState, NavSlots } from './Nav.types';\nimport type { NavContextValues } from '../NavContext.types';\n\nexport const renderNav_unstable = (state: NavState, contextValues: NavContextValues) => {\n assertSlots<NavSlots>(state);\n\n return (\n <NavProvider value={contextValues.nav}>\n <state.root />\n </NavProvider>\n );\n};\n"],"names":["assertSlots","NavProvider","renderNav_unstable","state","contextValues","value","nav","root"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,SAASC,WAAW,QAAQ,gBAAgB;AAI5C,OAAO,MAAMC,qBAAqB,CAACC,OAAiBC;IAClDJ,YAAsBG;IAEtB,qBACE,KAACF;QAAYI,OAAOD,cAAcE,GAAG;kBACnC,cAAA,KAACH,MAAMI,IAAI;;AAGjB,EAAE"}
@@ -0,0 +1,134 @@
1
+ import * as React from 'react';
2
+ import { useControllableState, useEventCallback, useMergedRefs, slot, getIntrinsicElementProps } from '@fluentui/react-utilities';
3
+ /**
4
+ * Initial value for the uncontrolled case of the list of open indexes
5
+ */ function initializeUncontrolledOpenCategories({ defaultOpenCategories, multiple }) {
6
+ if (defaultOpenCategories !== undefined) {
7
+ if (Array.isArray(defaultOpenCategories)) {
8
+ return multiple ? defaultOpenCategories : [
9
+ defaultOpenCategories[0]
10
+ ];
11
+ }
12
+ return [
13
+ defaultOpenCategories
14
+ ];
15
+ }
16
+ return undefined;
17
+ }
18
+ /**
19
+ * Updates the list of open indexes based on an index that changes
20
+ * @param value - the index that will change
21
+ * @param previousOpenItems - list of current open indexes
22
+ * @param multiple - if Nav supports open categories at the same time
23
+ */ const updateOpenCategories = (value, previousOpenItems, multiple)=>{
24
+ if (multiple) {
25
+ if (previousOpenItems.includes(value)) {
26
+ return previousOpenItems.filter((i)=>i !== value);
27
+ } else {
28
+ return [
29
+ ...previousOpenItems,
30
+ value
31
+ ];
32
+ }
33
+ }
34
+ return previousOpenItems[0] === value ? [] : [
35
+ value
36
+ ];
37
+ };
38
+ /**
39
+ * Create the state required to render Nav.
40
+ *
41
+ * The returned state can be modified with hooks such as useNavStyles,
42
+ * before being passed to renderNav.
43
+ *
44
+ * @param props - props from this instance of Nav
45
+ * @param ref - reference to root HTMLDivElement of Nav
46
+ */ export const useNav_unstable = (props, ref)=>{
47
+ const { onNavItemSelect, onNavCategoryItemToggle, multiple = true, density = 'medium', openCategories: controlledOpenCategoryItems, selectedCategoryValue: controlledSelectedCategoryValue, selectedValue: controlledSelectedValue, defaultOpenCategories, defaultSelectedValue, defaultSelectedCategoryValue } = props;
48
+ const innerRef = React.useRef(null);
49
+ const [openCategories, setOpenCategories] = useControllableState({
50
+ state: controlledOpenCategoryItems,
51
+ defaultState: initializeUncontrolledOpenCategories({
52
+ defaultOpenCategories,
53
+ multiple
54
+ }),
55
+ initialState: []
56
+ });
57
+ const [selectedCategoryValue, setSelectedCategoryValue] = useControllableState({
58
+ state: controlledSelectedCategoryValue,
59
+ defaultState: defaultSelectedCategoryValue,
60
+ initialState: undefined
61
+ });
62
+ const [selectedValue, setSelectedValue] = useControllableState({
63
+ state: controlledSelectedValue,
64
+ defaultState: defaultSelectedValue,
65
+ initialState: undefined
66
+ });
67
+ // considered usePrevious, but it is sensitive to re-renders
68
+ // this could cause the previous to move to current in the case where the navItem list re-renders.
69
+ // these refs avoid getRegisteredNavItems changing when selectedValue changes and causing
70
+ // renders for navItems that have not changed.
71
+ const currentSelectedValue = React.useRef(undefined);
72
+ const previousSelectedValue = React.useRef(undefined);
73
+ const currentSelectedCategoryValue = React.useRef(undefined);
74
+ const previousSelectedCategoryValue = React.useRef(undefined);
75
+ if (currentSelectedValue.current !== selectedValue) {
76
+ previousSelectedValue.current = currentSelectedValue.current;
77
+ currentSelectedValue.current = selectedValue;
78
+ }
79
+ if (currentSelectedCategoryValue.current !== selectedCategoryValue) {
80
+ previousSelectedCategoryValue.current = currentSelectedCategoryValue.current;
81
+ currentSelectedCategoryValue.current = selectedCategoryValue;
82
+ }
83
+ // used for NavItems and NavSubItems
84
+ const onSelect = useEventCallback((event, data)=>{
85
+ setSelectedValue(data.value);
86
+ setSelectedCategoryValue(data.categoryValue ? data.categoryValue : '');
87
+ onNavItemSelect === null || onNavItemSelect === void 0 ? void 0 : onNavItemSelect(event, data);
88
+ });
89
+ // used for NavCategoryItems
90
+ const onRequestNavCategoryItemToggle = useEventCallback((event, data)=>{
91
+ if (data.categoryValue !== undefined) {
92
+ const nextOpenCategories = updateOpenCategories(data.categoryValue, openCategories !== null && openCategories !== void 0 ? openCategories : [], multiple);
93
+ onNavCategoryItemToggle === null || onNavCategoryItemToggle === void 0 ? void 0 : onNavCategoryItemToggle(event, data);
94
+ setOpenCategories(nextOpenCategories);
95
+ }
96
+ });
97
+ const registeredNavItems = React.useRef({});
98
+ const onRegister = React.useCallback((data)=>{
99
+ registeredNavItems.current[JSON.stringify(data.value)] = data;
100
+ }, []);
101
+ const onUnregister = React.useCallback((data)=>{
102
+ delete registeredNavItems.current[JSON.stringify(data.value)];
103
+ }, []);
104
+ const getRegisteredNavItems = React.useCallback(()=>{
105
+ return {
106
+ selectedValue: currentSelectedValue.current,
107
+ previousSelectedValue: previousSelectedValue.current,
108
+ selectedCategoryValue: currentSelectedCategoryValue.current,
109
+ previousSelectedCategoryValue: previousSelectedCategoryValue.current,
110
+ registeredNavItems: registeredNavItems.current
111
+ };
112
+ }, []);
113
+ return {
114
+ components: {
115
+ root: 'div'
116
+ },
117
+ root: slot.always(getIntrinsicElementProps('div', {
118
+ ref: useMergedRefs(ref, innerRef),
119
+ ...props
120
+ }), {
121
+ elementType: 'div'
122
+ }),
123
+ openCategories,
124
+ selectedValue,
125
+ selectedCategoryValue,
126
+ onRegister,
127
+ onUnregister,
128
+ onSelect,
129
+ getRegisteredNavItems,
130
+ onRequestNavCategoryItemToggle,
131
+ multiple,
132
+ density
133
+ };
134
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Nav/useNav.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n useControllableState,\n useEventCallback,\n useMergedRefs,\n slot,\n getIntrinsicElementProps,\n EventHandler,\n} from '@fluentui/react-utilities';\n\nimport type { NavProps, NavState, OnNavItemSelectData } from './Nav.types';\nimport type { NavItemRegisterData, NavItemValue } from '../NavContext.types';\n\n/**\n * Initial value for the uncontrolled case of the list of open indexes\n */\nfunction initializeUncontrolledOpenCategories({\n defaultOpenCategories,\n multiple,\n}: Pick<NavProps, 'defaultOpenCategories' | 'multiple'>): NavItemValue[] | undefined {\n if (defaultOpenCategories !== undefined) {\n if (Array.isArray(defaultOpenCategories)) {\n return multiple ? defaultOpenCategories : [defaultOpenCategories[0]];\n }\n return [defaultOpenCategories];\n }\n return undefined;\n}\n\n/**\n * Updates the list of open indexes based on an index that changes\n * @param value - the index that will change\n * @param previousOpenItems - list of current open indexes\n * @param multiple - if Nav supports open categories at the same time\n */\nconst updateOpenCategories = (value: NavItemValue, previousOpenItems: NavItemValue[], multiple: boolean) => {\n if (multiple) {\n if (previousOpenItems.includes(value)) {\n return previousOpenItems.filter(i => i !== value);\n } else {\n return [...previousOpenItems, value];\n }\n }\n\n return previousOpenItems[0] === value ? [] : [value];\n};\n\n/**\n * Create the state required to render Nav.\n *\n * The returned state can be modified with hooks such as useNavStyles,\n * before being passed to renderNav.\n *\n * @param props - props from this instance of Nav\n * @param ref - reference to root HTMLDivElement of Nav\n */\nexport const useNav_unstable = (props: NavProps, ref: React.Ref<HTMLDivElement>): NavState => {\n const {\n onNavItemSelect,\n onNavCategoryItemToggle,\n multiple = true,\n density = 'medium',\n openCategories: controlledOpenCategoryItems,\n selectedCategoryValue: controlledSelectedCategoryValue,\n selectedValue: controlledSelectedValue,\n defaultOpenCategories,\n defaultSelectedValue,\n defaultSelectedCategoryValue,\n } = props;\n\n const innerRef = React.useRef<HTMLElement>(null);\n\n const [openCategories, setOpenCategories] = useControllableState({\n state: controlledOpenCategoryItems,\n defaultState: initializeUncontrolledOpenCategories({ defaultOpenCategories, multiple }),\n initialState: [],\n });\n\n const [selectedCategoryValue, setSelectedCategoryValue] = useControllableState({\n state: controlledSelectedCategoryValue,\n defaultState: defaultSelectedCategoryValue,\n initialState: undefined,\n });\n\n const [selectedValue, setSelectedValue] = useControllableState({\n state: controlledSelectedValue,\n defaultState: defaultSelectedValue,\n initialState: undefined,\n });\n\n // considered usePrevious, but it is sensitive to re-renders\n // this could cause the previous to move to current in the case where the navItem list re-renders.\n // these refs avoid getRegisteredNavItems changing when selectedValue changes and causing\n // renders for navItems that have not changed.\n const currentSelectedValue = React.useRef<NavItemValue | undefined>(undefined);\n const previousSelectedValue = React.useRef<NavItemValue | undefined>(undefined);\n\n const currentSelectedCategoryValue = React.useRef<NavItemValue | undefined>(undefined);\n const previousSelectedCategoryValue = React.useRef<NavItemValue | undefined>(undefined);\n\n if (currentSelectedValue.current !== selectedValue) {\n previousSelectedValue.current = currentSelectedValue.current;\n currentSelectedValue.current = selectedValue;\n }\n\n if (currentSelectedCategoryValue.current !== selectedCategoryValue) {\n previousSelectedCategoryValue.current = currentSelectedCategoryValue.current;\n currentSelectedCategoryValue.current = selectedCategoryValue;\n }\n\n // used for NavItems and NavSubItems\n const onSelect: EventHandler<OnNavItemSelectData> = useEventCallback((event, data) => {\n setSelectedValue(data.value);\n setSelectedCategoryValue(data.categoryValue ? data.categoryValue : '');\n onNavItemSelect?.(event, data);\n });\n\n // used for NavCategoryItems\n const onRequestNavCategoryItemToggle: EventHandler<OnNavItemSelectData> = useEventCallback((event, data) => {\n if (data.categoryValue !== undefined) {\n const nextOpenCategories = updateOpenCategories(data.categoryValue, openCategories ?? [], multiple);\n onNavCategoryItemToggle?.(event, data);\n setOpenCategories(nextOpenCategories);\n }\n });\n\n const registeredNavItems = React.useRef<Record<string, NavItemRegisterData>>({});\n\n const onRegister = React.useCallback((data: NavItemRegisterData) => {\n registeredNavItems.current[JSON.stringify(data.value)] = data;\n }, []);\n\n const onUnregister = React.useCallback((data: NavItemRegisterData) => {\n delete registeredNavItems.current[JSON.stringify(data.value)];\n }, []);\n\n const getRegisteredNavItems = React.useCallback(() => {\n return {\n selectedValue: currentSelectedValue.current,\n previousSelectedValue: previousSelectedValue.current,\n selectedCategoryValue: currentSelectedCategoryValue.current,\n previousSelectedCategoryValue: previousSelectedCategoryValue.current,\n registeredNavItems: registeredNavItems.current,\n };\n }, []);\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref: useMergedRefs(ref, innerRef) as React.Ref<HTMLDivElement>,\n ...props,\n }),\n { elementType: 'div' },\n ),\n openCategories,\n selectedValue,\n selectedCategoryValue,\n onRegister,\n onUnregister,\n onSelect,\n getRegisteredNavItems,\n onRequestNavCategoryItemToggle,\n multiple,\n density,\n };\n};\n"],"names":["React","useControllableState","useEventCallback","useMergedRefs","slot","getIntrinsicElementProps","initializeUncontrolledOpenCategories","defaultOpenCategories","multiple","undefined","Array","isArray","updateOpenCategories","value","previousOpenItems","includes","filter","i","useNav_unstable","props","ref","onNavItemSelect","onNavCategoryItemToggle","density","openCategories","controlledOpenCategoryItems","selectedCategoryValue","controlledSelectedCategoryValue","selectedValue","controlledSelectedValue","defaultSelectedValue","defaultSelectedCategoryValue","innerRef","useRef","setOpenCategories","state","defaultState","initialState","setSelectedCategoryValue","setSelectedValue","currentSelectedValue","previousSelectedValue","currentSelectedCategoryValue","previousSelectedCategoryValue","current","onSelect","event","data","categoryValue","onRequestNavCategoryItemToggle","nextOpenCategories","registeredNavItems","onRegister","useCallback","JSON","stringify","onUnregister","getRegisteredNavItems","components","root","always","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,oBAAoB,EACpBC,gBAAgB,EAChBC,aAAa,EACbC,IAAI,EACJC,wBAAwB,QAEnB,4BAA4B;AAKnC;;CAEC,GACD,SAASC,qCAAqC,EAC5CC,qBAAqB,EACrBC,QAAQ,EAC6C;IACrD,IAAID,0BAA0BE,WAAW;QACvC,IAAIC,MAAMC,OAAO,CAACJ,wBAAwB;YACxC,OAAOC,WAAWD,wBAAwB;gBAACA,qBAAqB,CAAC,EAAE;aAAC;QACtE;QACA,OAAO;YAACA;SAAsB;IAChC;IACA,OAAOE;AACT;AAEA;;;;;CAKC,GACD,MAAMG,uBAAuB,CAACC,OAAqBC,mBAAmCN;IACpF,IAAIA,UAAU;QACZ,IAAIM,kBAAkBC,QAAQ,CAACF,QAAQ;YACrC,OAAOC,kBAAkBE,MAAM,CAACC,CAAAA,IAAKA,MAAMJ;QAC7C,OAAO;YACL,OAAO;mBAAIC;gBAAmBD;aAAM;QACtC;IACF;IAEA,OAAOC,iBAAiB,CAAC,EAAE,KAAKD,QAAQ,EAAE,GAAG;QAACA;KAAM;AACtD;AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMK,kBAAkB,CAACC,OAAiBC;IAC/C,MAAM,EACJC,eAAe,EACfC,uBAAuB,EACvBd,WAAW,IAAI,EACfe,UAAU,QAAQ,EAClBC,gBAAgBC,2BAA2B,EAC3CC,uBAAuBC,+BAA+B,EACtDC,eAAeC,uBAAuB,EACtCtB,qBAAqB,EACrBuB,oBAAoB,EACpBC,4BAA4B,EAC7B,GAAGZ;IAEJ,MAAMa,WAAWhC,MAAMiC,MAAM,CAAc;IAE3C,MAAM,CAACT,gBAAgBU,kBAAkB,GAAGjC,qBAAqB;QAC/DkC,OAAOV;QACPW,cAAc9B,qCAAqC;YAAEC;YAAuBC;QAAS;QACrF6B,cAAc,EAAE;IAClB;IAEA,MAAM,CAACX,uBAAuBY,yBAAyB,GAAGrC,qBAAqB;QAC7EkC,OAAOR;QACPS,cAAcL;QACdM,cAAc5B;IAChB;IAEA,MAAM,CAACmB,eAAeW,iBAAiB,GAAGtC,qBAAqB;QAC7DkC,OAAON;QACPO,cAAcN;QACdO,cAAc5B;IAChB;IAEA,4DAA4D;IAC5D,kGAAkG;IAClG,yFAAyF;IACzF,8CAA8C;IAC9C,MAAM+B,uBAAuBxC,MAAMiC,MAAM,CAA2BxB;IACpE,MAAMgC,wBAAwBzC,MAAMiC,MAAM,CAA2BxB;IAErE,MAAMiC,+BAA+B1C,MAAMiC,MAAM,CAA2BxB;IAC5E,MAAMkC,gCAAgC3C,MAAMiC,MAAM,CAA2BxB;IAE7E,IAAI+B,qBAAqBI,OAAO,KAAKhB,eAAe;QAClDa,sBAAsBG,OAAO,GAAGJ,qBAAqBI,OAAO;QAC5DJ,qBAAqBI,OAAO,GAAGhB;IACjC;IAEA,IAAIc,6BAA6BE,OAAO,KAAKlB,uBAAuB;QAClEiB,8BAA8BC,OAAO,GAAGF,6BAA6BE,OAAO;QAC5EF,6BAA6BE,OAAO,GAAGlB;IACzC;IAEA,oCAAoC;IACpC,MAAMmB,WAA8C3C,iBAAiB,CAAC4C,OAAOC;QAC3ER,iBAAiBQ,KAAKlC,KAAK;QAC3ByB,yBAAyBS,KAAKC,aAAa,GAAGD,KAAKC,aAAa,GAAG;QACnE3B,4BAAAA,sCAAAA,gBAAkByB,OAAOC;IAC3B;IAEA,4BAA4B;IAC5B,MAAME,iCAAoE/C,iBAAiB,CAAC4C,OAAOC;QACjG,IAAIA,KAAKC,aAAa,KAAKvC,WAAW;YACpC,MAAMyC,qBAAqBtC,qBAAqBmC,KAAKC,aAAa,EAAExB,2BAAAA,4BAAAA,iBAAkB,EAAE,EAAEhB;YAC1Fc,oCAAAA,8CAAAA,wBAA0BwB,OAAOC;YACjCb,kBAAkBgB;QACpB;IACF;IAEA,MAAMC,qBAAqBnD,MAAMiC,MAAM,CAAsC,CAAC;IAE9E,MAAMmB,aAAapD,MAAMqD,WAAW,CAAC,CAACN;QACpCI,mBAAmBP,OAAO,CAACU,KAAKC,SAAS,CAACR,KAAKlC,KAAK,EAAE,GAAGkC;IAC3D,GAAG,EAAE;IAEL,MAAMS,eAAexD,MAAMqD,WAAW,CAAC,CAACN;QACtC,OAAOI,mBAAmBP,OAAO,CAACU,KAAKC,SAAS,CAACR,KAAKlC,KAAK,EAAE;IAC/D,GAAG,EAAE;IAEL,MAAM4C,wBAAwBzD,MAAMqD,WAAW,CAAC;QAC9C,OAAO;YACLzB,eAAeY,qBAAqBI,OAAO;YAC3CH,uBAAuBA,sBAAsBG,OAAO;YACpDlB,uBAAuBgB,6BAA6BE,OAAO;YAC3DD,+BAA+BA,8BAA8BC,OAAO;YACpEO,oBAAoBA,mBAAmBP,OAAO;QAChD;IACF,GAAG,EAAE;IAEL,OAAO;QACLc,YAAY;YACVC,MAAM;QACR;QACAA,MAAMvD,KAAKwD,MAAM,CACfvD,yBAAyB,OAAO;YAC9Be,KAAKjB,cAAciB,KAAKY;YACxB,GAAGb,KAAK;QACV,IACA;YAAE0C,aAAa;QAAM;QAEvBrC;QACAI;QACAF;QACA0B;QACAI;QACAX;QACAY;QACAR;QACAzC;QACAe;IACF;AACF,EAAE"}
@@ -0,0 +1,27 @@
1
+ import { __styles, mergeClasses } from '@griffel/react';
2
+ export const navClassNames = {
3
+ root: 'fui-Nav'
4
+ };
5
+ /**
6
+ * Styles for the root slot
7
+ */
8
+ const useStyles = /*#__PURE__*/__styles({
9
+ root: {
10
+ mc9l5x: "f22iagw",
11
+ Beiy3e4: "f1vx9l62"
12
+ }
13
+ }, {
14
+ d: [".f22iagw{display:flex;}", ".f1vx9l62{flex-direction:column;}"]
15
+ });
16
+ /**
17
+ * Apply styling to the Nav slots based on the state
18
+ */
19
+ export const useNavStyles_unstable = state => {
20
+ 'use no memo';
21
+
22
+ const styles = useStyles();
23
+ state.root.className = mergeClasses(navClassNames.root, styles.root, state.root.className);
24
+ // TODO Add class names to slots, for example:
25
+ // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);
26
+ return state;
27
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__styles","mergeClasses","navClassNames","root","useStyles","mc9l5x","Beiy3e4","d","useNavStyles_unstable","state","styles","className"],"sources":["useNavStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nexport const navClassNames = {\n root: 'fui-Nav'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column'\n }\n});\n/**\n * Apply styling to the Nav slots based on the state\n */ export const useNavStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n state.root.className = mergeClasses(navClassNames.root, styles.root, state.root.className);\n // TODO Add class names to slots, for example:\n // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,OAAO,MAAMC,aAAa,GAAG;EACzBC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGJ,QAAA;EAAAG,IAAA;IAAAE,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAKrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,qBAAqB,GAAIC,KAAK,IAAG;EAC9C,aAAa;;EACb,MAAMC,MAAM,GAAGN,SAAS,CAAC,CAAC;EAC1BK,KAAK,CAACN,IAAI,CAACQ,SAAS,GAAGV,YAAY,CAACC,aAAa,CAACC,IAAI,EAAEO,MAAM,CAACP,IAAI,EAAEM,KAAK,CAACN,IAAI,CAACQ,SAAS,CAAC;EAC1F;EACA;EACA,OAAOF,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { useNavCategory_unstable } from './useNavCategory';
3
+ import { renderNavCategory_unstable } from './renderNavCategory';
4
+ import { useNavCategoryContextValues_unstable } from '../useNavCategoryContextValues_unstable';
5
+ /**
6
+ * NavCategory component - TODO: add more docs
7
+ */ export const NavCategory = /*#__PURE__*/ React.forwardRef((props, ref)=>{
8
+ const state = useNavCategory_unstable(props, ref);
9
+ const contextValues = useNavCategoryContextValues_unstable(state);
10
+ return renderNavCategory_unstable(state, contextValues);
11
+ });
12
+ NavCategory.displayName = 'NavCategory';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/NavCategory/NavCategory.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { NavCategoryProps } from './NavCategory.types';\n\nimport { useNavCategory_unstable } from './useNavCategory';\nimport { renderNavCategory_unstable } from './renderNavCategory';\nimport { useNavCategoryContextValues_unstable } from '../useNavCategoryContextValues_unstable';\n\n/**\n * NavCategory component - TODO: add more docs\n */\nexport const NavCategory: ForwardRefComponent<NavCategoryProps> = React.forwardRef((props, ref) => {\n const state = useNavCategory_unstable(props, ref);\n const contextValues = useNavCategoryContextValues_unstable(state);\n\n return renderNavCategory_unstable(state, contextValues);\n});\n\nNavCategory.displayName = 'NavCategory';\n"],"names":["React","useNavCategory_unstable","renderNavCategory_unstable","useNavCategoryContextValues_unstable","NavCategory","forwardRef","props","ref","state","contextValues","displayName"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAK/B,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,oCAAoC,QAAQ,0CAA0C;AAE/F;;CAEC,GACD,OAAO,MAAMC,4BAAqDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQP,wBAAwBK,OAAOC;IAC7C,MAAME,gBAAgBN,qCAAqCK;IAE3D,OAAON,2BAA2BM,OAAOC;AAC3C,GAAG;AAEHL,YAAYM,WAAW,GAAG"}
@@ -0,0 +1 @@
1
+ import * as React from 'react';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/NavCategory/NavCategory.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { NavItemValue } from '../NavContext.types';\nimport { NavCategoryContextValue } from '../NavCategoryContext';\n\n/**\n * NavCategory Props\n */\nexport type NavCategoryProps = {\n /**\n * Required value that identifies this item inside an Nav component.\n */\n value: NavItemValue;\n\n /**\n * Children of the NavCategory\n */\n children?: React.ReactNode | null;\n};\n\n/**\n * State used in rendering NavCategory\n */\nexport type NavCategoryState = NavCategoryContextValue & Required<NavCategoryProps>;\n"],"names":["React"],"rangeMappings":"","mappings":"AAAA,YAAYA,WAAW,QAAQ"}
@@ -0,0 +1,3 @@
1
+ export { NavCategory } from './NavCategory';
2
+ export { renderNavCategory_unstable } from './renderNavCategory';
3
+ export { useNavCategory_unstable } from './useNavCategory';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/NavCategory/index.ts"],"sourcesContent":["export { NavCategory } from './NavCategory';\nexport type { NavCategoryProps, NavCategoryState } from './NavCategory.types';\nexport { renderNavCategory_unstable } from './renderNavCategory';\nexport { useNavCategory_unstable } from './useNavCategory';\n"],"names":["NavCategory","renderNavCategory_unstable","useNavCategory_unstable"],"rangeMappings":";;","mappings":"AAAA,SAASA,WAAW,QAAQ,gBAAgB;AAE5C,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,uBAAuB,QAAQ,mBAAmB"}
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { NavCategoryProvider } from '../NavCategoryContext';
3
+ /**
4
+ * Render the final JSX of NavCategory
5
+ */ export const renderNavCategory_unstable = (state, contextValues)=>{
6
+ return /*#__PURE__*/ React.createElement(NavCategoryProvider, {
7
+ value: contextValues.categoryValue
8
+ }, state.children);
9
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/NavCategory/renderNavCategory.tsx"],"sourcesContent":["import * as React from 'react';\nimport { NavCategoryContextValues, NavCategoryProvider } from '../NavCategoryContext';\n\nimport type { NavCategoryState } from './NavCategory.types';\n\n/**\n * Render the final JSX of NavCategory\n */\nexport const renderNavCategory_unstable = (state: NavCategoryState, contextValues: NavCategoryContextValues) => {\n return <NavCategoryProvider value={contextValues.categoryValue}>{state.children}</NavCategoryProvider>;\n};\n"],"names":["React","NavCategoryProvider","renderNavCategory_unstable","state","contextValues","value","categoryValue","children"],"rangeMappings":";;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAAmCC,mBAAmB,QAAQ,wBAAwB;AAItF;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC,OAAyBC;IAClE,qBAAO,oBAACH;QAAoBI,OAAOD,cAAcE,aAAa;OAAGH,MAAMI,QAAQ;AACjF,EAAE"}
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { useNavContext_unstable } from '../NavContext';
3
+ /**
4
+ * Create the state required to render NavCategory.
5
+ *
6
+ * The returned state can be modified with hooks such as useNavCategoryStyles_unstable,
7
+ * before being passed to renderNavCategory_unstable.
8
+ *
9
+ * @param props - props from this instance of NavCategory
10
+ * @param ref - reference to root HTMLDivElement of NavCategory
11
+ */ export const useNavCategory_unstable = (props, ref)=>{
12
+ const { value, children } = props;
13
+ const { openCategories } = useNavContext_unstable();
14
+ const open = openCategories === null || openCategories === void 0 ? void 0 : openCategories.includes(value);
15
+ return {
16
+ open,
17
+ value,
18
+ children: children !== null && children !== void 0 ? children : null
19
+ };
20
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/NavCategory/useNavCategory.ts"],"sourcesContent":["import * as React from 'react';\nimport { useNavContext_unstable } from '../NavContext';\n\nimport type { NavCategoryProps, NavCategoryState } from './NavCategory.types';\n\n/**\n * Create the state required to render NavCategory.\n *\n * The returned state can be modified with hooks such as useNavCategoryStyles_unstable,\n * before being passed to renderNavCategory_unstable.\n *\n * @param props - props from this instance of NavCategory\n * @param ref - reference to root HTMLDivElement of NavCategory\n */\nexport const useNavCategory_unstable = (props: NavCategoryProps, ref: React.Ref<HTMLDivElement>): NavCategoryState => {\n const { value, children } = props;\n\n const { openCategories } = useNavContext_unstable();\n\n const open: boolean = openCategories?.includes(value);\n\n return {\n open,\n value,\n children: children ?? null,\n };\n};\n"],"names":["React","useNavContext_unstable","useNavCategory_unstable","props","ref","value","children","openCategories","open","includes"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsB,QAAQ,gBAAgB;AAIvD;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CAACC,OAAyBC;IAC/D,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGH;IAE5B,MAAM,EAAEI,cAAc,EAAE,GAAGN;IAE3B,MAAMO,OAAgBD,2BAAAA,qCAAAA,eAAgBE,QAAQ,CAACJ;IAE/C,OAAO;QACLG;QACAH;QACAC,UAAUA,qBAAAA,sBAAAA,WAAY;IACxB;AACF,EAAE"}
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ const NavCategoryContext = React.createContext(undefined);
3
+ const navCategoryContextDefaultValue = {
4
+ open: false,
5
+ value: ''
6
+ };
7
+ export const { Provider: NavCategoryProvider } = NavCategoryContext;
8
+ export const useNavCategoryContext_unstable = ()=>{
9
+ var _React_useContext;
10
+ return (_React_useContext = React.useContext(NavCategoryContext)) !== null && _React_useContext !== void 0 ? _React_useContext : navCategoryContextDefaultValue;
11
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/NavCategoryContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { NavItemValue } from './NavContext.types';\n\n// This context is analogous to AccordionItemContext\n\nexport type NavCategoryContextValues = {\n categoryValue: NavCategoryContextValue;\n};\n\nexport type NavCategoryContextValue = {\n open: boolean;\n value: NavItemValue;\n};\n\nconst NavCategoryContext = React.createContext<NavCategoryContextValue | undefined>(\n undefined,\n) as React.Context<NavCategoryContextValue>;\n\nconst navCategoryContextDefaultValue: NavCategoryContextValue = {\n open: false,\n value: '',\n};\n\nexport const { Provider: NavCategoryProvider } = NavCategoryContext;\n\nexport const useNavCategoryContext_unstable = () => {\n return React.useContext(NavCategoryContext) ?? navCategoryContextDefaultValue;\n};\n"],"names":["React","NavCategoryContext","createContext","undefined","navCategoryContextDefaultValue","open","value","Provider","NavCategoryProvider","useNavCategoryContext_unstable","useContext"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAc/B,MAAMC,qBAAqBD,MAAME,aAAa,CAC5CC;AAGF,MAAMC,iCAA0D;IAC9DC,MAAM;IACNC,OAAO;AACT;AAEA,OAAO,MAAM,EAAEC,UAAUC,mBAAmB,EAAE,GAAGP,mBAAmB;AAEpE,OAAO,MAAMQ,iCAAiC;QACrCT;IAAP,OAAOA,CAAAA,oBAAAA,MAAMU,UAAU,CAACT,iCAAjBD,+BAAAA,oBAAwCI;AACjD,EAAE"}
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import { useNavCategoryItem_unstable } from './useNavCategoryItem';
3
+ import { renderNavCategoryItem_unstable } from './renderNavCategoryItem';
4
+ import { useNavCategoryItemStyles_unstable } from './useNavCategoryItem.styles';
5
+ import { useNavCategoryItemContextValues_unstable } from '../useNavCategoryItemContextValues_unstable';
6
+ // import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
7
+ /**
8
+ * A Nav Category Item provides provides a clickable accordion like header that exposes
9
+ * a list of NavSubItems to take users to a new destination.
10
+ */ export const NavCategoryItem = /*#__PURE__*/ React.forwardRef((props, ref)=>{
11
+ const state = useNavCategoryItem_unstable(props, ref);
12
+ const contextValues = useNavCategoryItemContextValues_unstable(state);
13
+ useNavCategoryItemStyles_unstable(state);
14
+ // todo: add custom style hook
15
+ // useCustomStyleHook_unstable('useNavCategoryItemStyles')(state);
16
+ return renderNavCategoryItem_unstable(state, contextValues);
17
+ });
18
+ NavCategoryItem.displayName = 'NavCategoryItem';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/NavCategoryItem/NavCategoryItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useNavCategoryItem_unstable } from './useNavCategoryItem';\nimport { renderNavCategoryItem_unstable } from './renderNavCategoryItem';\nimport type { NavCategoryItemProps } from './NavCategoryItem.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useNavCategoryItemStyles_unstable } from './useNavCategoryItem.styles';\nimport { useNavCategoryItemContextValues_unstable } from '../useNavCategoryItemContextValues_unstable';\n// import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A Nav Category Item provides provides a clickable accordion like header that exposes\n * a list of NavSubItems to take users to a new destination.\n */\nexport const NavCategoryItem: ForwardRefComponent<NavCategoryItemProps> = React.forwardRef((props, ref) => {\n const state = useNavCategoryItem_unstable(props, ref);\n const contextValues = useNavCategoryItemContextValues_unstable(state);\n\n useNavCategoryItemStyles_unstable(state);\n\n // todo: add custom style hook\n // useCustomStyleHook_unstable('useNavCategoryItemStyles')(state);\n\n return renderNavCategoryItem_unstable(state, contextValues);\n});\n\nNavCategoryItem.displayName = 'NavCategoryItem';\n"],"names":["React","useNavCategoryItem_unstable","renderNavCategoryItem_unstable","useNavCategoryItemStyles_unstable","useNavCategoryItemContextValues_unstable","NavCategoryItem","forwardRef","props","ref","state","contextValues","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,0BAA0B;AAGzE,SAASC,iCAAiC,QAAQ,8BAA8B;AAChF,SAASC,wCAAwC,QAAQ,8CAA8C;AACvG,iFAAiF;AAEjF;;;CAGC,GACD,OAAO,MAAMC,gCAA6DL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,QAAQR,4BAA4BM,OAAOC;IACjD,MAAME,gBAAgBN,yCAAyCK;IAE/DN,kCAAkCM;IAElC,8BAA8B;IAC9B,kEAAkE;IAElE,OAAOP,+BAA+BO,OAAOC;AAC/C,GAAG;AAEHL,gBAAgBM,WAAW,GAAG"}
@@ -0,0 +1,3 @@
1
+ /**
2
+ * State used in rendering NavCategoryItem
3
+ */ export { };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/NavCategoryItem/NavCategoryItem.types.ts"],"sourcesContent":["import { NavDensity } from '../Nav/Nav.types';\nimport { NavCategoryItemContextValue } from '../NavCategoryItemContext';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type NavCategoryItemContextValues = {\n navCategoryItem: NavCategoryItemContextValue;\n};\n\nexport type NavCategoryItemSlots = {\n /**\n * The root element\n */\n root: NonNullable<Slot<'button'>>;\n\n /**\n * Icon that renders before the content.\n * Should be specific to each Category\n */\n icon?: Slot<'span'>;\n\n /**\n * Expand icon slot rendered after the content to indicate an open and closed state.\n */\n expandIcon: NonNullable<Slot<'span'>>;\n};\n\n/**\n * navCategoryItem Props\n */\nexport type NavCategoryItemProps = ComponentProps<Partial<NavCategoryItemSlots>>;\n\n/**\n * State used in rendering NavCategoryItem\n */\nexport type NavCategoryItemState = ComponentState<NavCategoryItemSlots> &\n NavCategoryItemContextValue & {\n /**\n * If this navCategoryItem is selected\n */\n selected: boolean;\n /**\n * The density of the NavItem\n *\n * @default 'medium'\n */\n density: NavDensity;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AA+BA;;CAEC,GACD,WAYI"}
@@ -0,0 +1,4 @@
1
+ export { NavCategoryItem } from './NavCategoryItem';
2
+ export { renderNavCategoryItem_unstable } from './renderNavCategoryItem';
3
+ export { useNavCategoryItem_unstable } from './useNavCategoryItem';
4
+ export { useNavCategoryItemStyles_unstable, navCategoryItemClassNames } from './useNavCategoryItem.styles';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/NavCategoryItem/index.ts"],"sourcesContent":["export { NavCategoryItem } from './NavCategoryItem';\nexport type { NavCategoryItemSlots, NavCategoryItemProps, NavCategoryItemState } from './NavCategoryItem.types';\nexport { renderNavCategoryItem_unstable } from './renderNavCategoryItem';\nexport { useNavCategoryItem_unstable } from './useNavCategoryItem';\nexport { useNavCategoryItemStyles_unstable, navCategoryItemClassNames } from './useNavCategoryItem.styles';\n"],"names":["NavCategoryItem","renderNavCategoryItem_unstable","useNavCategoryItem_unstable","useNavCategoryItemStyles_unstable","navCategoryItemClassNames"],"rangeMappings":";;;","mappings":"AAAA,SAASA,eAAe,QAAQ,oBAAoB;AAEpD,SAASC,8BAA8B,QAAQ,0BAA0B;AACzE,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,iCAAiC,EAAEC,yBAAyB,QAAQ,8BAA8B"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
+ import { assertSlots } from '@fluentui/react-utilities';
3
+ import { NavCategoryItemProvider } from '../NavCategoryItemContext';
4
+ /**
5
+ * Render the final JSX of NavCategoryItem
6
+ */ export const renderNavCategoryItem_unstable = (state, contextValues)=>{
7
+ assertSlots(state);
8
+ return /*#__PURE__*/ _jsx(NavCategoryItemProvider, {
9
+ value: contextValues.navCategoryItem,
10
+ children: /*#__PURE__*/ _jsxs(state.root, {
11
+ children: [
12
+ state.icon && /*#__PURE__*/ _jsx(state.icon, {}),
13
+ state.root.children,
14
+ state.expandIcon && /*#__PURE__*/ _jsx(state.expandIcon, {})
15
+ ]
16
+ })
17
+ });
18
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/NavCategoryItem/renderNavCategoryItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { NavCategoryItemState, NavCategoryItemSlots, NavCategoryItemContextValues } from './NavCategoryItem.types';\nimport { NavCategoryItemProvider } from '../NavCategoryItemContext';\n\n/**\n * Render the final JSX of NavCategoryItem\n */\nexport const renderNavCategoryItem_unstable = (\n state: NavCategoryItemState,\n contextValues: NavCategoryItemContextValues,\n) => {\n assertSlots<NavCategoryItemSlots>(state);\n\n return (\n <NavCategoryItemProvider value={contextValues.navCategoryItem}>\n <state.root>\n {state.icon && <state.icon />}\n {state.root.children}\n {state.expandIcon && <state.expandIcon />}\n </state.root>\n </NavCategoryItemProvider>\n );\n};\n"],"names":["assertSlots","NavCategoryItemProvider","renderNavCategoryItem_unstable","state","contextValues","value","navCategoryItem","root","icon","children","expandIcon"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,uBAAuB,QAAQ,4BAA4B;AAEpE;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAC5CC,OACAC;IAEAJ,YAAkCG;IAElC,qBACE,KAACF;QAAwBI,OAAOD,cAAcE,eAAe;kBAC3D,cAAA,MAACH,MAAMI,IAAI;;gBACRJ,MAAMK,IAAI,kBAAI,KAACL,MAAMK,IAAI;gBACzBL,MAAMI,IAAI,CAACE,QAAQ;gBACnBN,MAAMO,UAAU,kBAAI,KAACP,MAAMO,UAAU;;;;AAI9C,EAAE"}
@@ -0,0 +1,58 @@
1
+ import * as React from 'react';
2
+ import { getIntrinsicElementProps, mergeCallbacks, slot, useEventCallback } from '@fluentui/react-utilities';
3
+ import { ChevronRight20Regular } from '@fluentui/react-icons';
4
+ import { useNavCategoryContext_unstable } from '../NavCategoryContext';
5
+ import { useNavContext_unstable } from '../NavContext';
6
+ /**
7
+ * Create the state required to render NavCategoryItem.
8
+ *
9
+ * The returned state can be modified with hooks such as useNavCategoryItemStyles,
10
+ * before being passed to renderNavCategoryItem.
11
+ *
12
+ * @param props - props from this instance of NavCategoryItem
13
+ * @param ref - reference to root HTMLButtonElement of NavCategoryItem
14
+ */ export const useNavCategoryItem_unstable = (props, ref)=>{
15
+ const { onClick, expandIcon, icon } = props;
16
+ const { open, value } = useNavCategoryContext_unstable();
17
+ const { onRequestNavCategoryItemToggle, selectedCategoryValue, density = 'medium' } = useNavContext_unstable();
18
+ const onNavCategoryItemClick = useEventCallback(mergeCallbacks(onClick, (event)=>onRequestNavCategoryItemToggle(event, {
19
+ type: 'click',
20
+ event,
21
+ value: '',
22
+ categoryValue: value
23
+ })));
24
+ // don't fill the icon when it's open
25
+ const selected = selectedCategoryValue === value && !open;
26
+ // there's more than 2 possible values for aria-current, but this is the only one that's used in this component
27
+ const validAriaCurrent = selected && !open ? 'page' : 'false';
28
+ return {
29
+ open,
30
+ value,
31
+ selected,
32
+ components: {
33
+ root: 'button',
34
+ icon: 'span',
35
+ expandIcon: 'span'
36
+ },
37
+ root: slot.always(getIntrinsicElementProps('button', {
38
+ ref,
39
+ 'aria-current': validAriaCurrent,
40
+ 'aria-expanded': open,
41
+ ...props,
42
+ onClick: onNavCategoryItemClick
43
+ }), {
44
+ elementType: 'button'
45
+ }),
46
+ expandIcon: slot.always(expandIcon, {
47
+ defaultProps: {
48
+ children: /*#__PURE__*/ React.createElement(ChevronRight20Regular, null),
49
+ 'aria-hidden': true
50
+ },
51
+ elementType: 'span'
52
+ }),
53
+ icon: slot.optional(icon, {
54
+ elementType: 'span'
55
+ }),
56
+ density
57
+ };
58
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/NavCategoryItem/useNavCategoryItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, mergeCallbacks, slot, useEventCallback } from '@fluentui/react-utilities';\nimport { ChevronRight20Regular } from '@fluentui/react-icons';\nimport { NavCategoryItemProps, NavCategoryItemState } from './NavCategoryItem.types';\nimport { useNavCategoryContext_unstable } from '../NavCategoryContext';\nimport { useNavContext_unstable } from '../NavContext';\n\n/**\n * Create the state required to render NavCategoryItem.\n *\n * The returned state can be modified with hooks such as useNavCategoryItemStyles,\n * before being passed to renderNavCategoryItem.\n *\n * @param props - props from this instance of NavCategoryItem\n * @param ref - reference to root HTMLButtonElement of NavCategoryItem\n */\nexport const useNavCategoryItem_unstable = (\n props: NavCategoryItemProps,\n ref: React.Ref<HTMLButtonElement>,\n): NavCategoryItemState => {\n const { onClick, expandIcon, icon } = props;\n\n const { open, value } = useNavCategoryContext_unstable();\n\n const { onRequestNavCategoryItemToggle, selectedCategoryValue, density = 'medium' } = useNavContext_unstable();\n\n const onNavCategoryItemClick = useEventCallback(\n mergeCallbacks(onClick, event =>\n onRequestNavCategoryItemToggle(event, { type: 'click', event, value: '', categoryValue: value }),\n ),\n );\n\n // don't fill the icon when it's open\n const selected = selectedCategoryValue === value && !open;\n // there's more than 2 possible values for aria-current, but this is the only one that's used in this component\n const validAriaCurrent: 'page' | 'false' = selected && !open ? 'page' : 'false';\n\n return {\n open,\n value,\n selected,\n components: {\n root: 'button',\n icon: 'span',\n expandIcon: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n 'aria-current': validAriaCurrent,\n 'aria-expanded': open,\n ...props,\n onClick: onNavCategoryItemClick,\n }),\n { elementType: 'button' },\n ),\n expandIcon: slot.always(expandIcon, {\n defaultProps: {\n children: <ChevronRight20Regular />,\n 'aria-hidden': true,\n },\n elementType: 'span',\n }),\n icon: slot.optional(icon, {\n elementType: 'span',\n }),\n density,\n };\n};\n"],"names":["React","getIntrinsicElementProps","mergeCallbacks","slot","useEventCallback","ChevronRight20Regular","useNavCategoryContext_unstable","useNavContext_unstable","useNavCategoryItem_unstable","props","ref","onClick","expandIcon","icon","open","value","onRequestNavCategoryItemToggle","selectedCategoryValue","density","onNavCategoryItemClick","event","type","categoryValue","selected","validAriaCurrent","components","root","always","elementType","defaultProps","children","optional"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,cAAc,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,4BAA4B;AAC7G,SAASC,qBAAqB,QAAQ,wBAAwB;AAE9D,SAASC,8BAA8B,QAAQ,wBAAwB;AACvE,SAASC,sBAAsB,QAAQ,gBAAgB;AAEvD;;;;;;;;CAQC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EAAEC,OAAO,EAAEC,UAAU,EAAEC,IAAI,EAAE,GAAGJ;IAEtC,MAAM,EAAEK,IAAI,EAAEC,KAAK,EAAE,GAAGT;IAExB,MAAM,EAAEU,8BAA8B,EAAEC,qBAAqB,EAAEC,UAAU,QAAQ,EAAE,GAAGX;IAEtF,MAAMY,yBAAyBf,iBAC7BF,eAAeS,SAASS,CAAAA,QACtBJ,+BAA+BI,OAAO;YAAEC,MAAM;YAASD;YAAOL,OAAO;YAAIO,eAAeP;QAAM;IAIlG,qCAAqC;IACrC,MAAMQ,WAAWN,0BAA0BF,SAAS,CAACD;IACrD,+GAA+G;IAC/G,MAAMU,mBAAqCD,YAAY,CAACT,OAAO,SAAS;IAExE,OAAO;QACLA;QACAC;QACAQ;QACAE,YAAY;YACVC,MAAM;YACNb,MAAM;YACND,YAAY;QACd;QACAc,MAAMvB,KAAKwB,MAAM,CACf1B,yBAAyB,UAAU;YACjCS;YACA,gBAAgBc;YAChB,iBAAiBV;YACjB,GAAGL,KAAK;YACRE,SAASQ;QACX,IACA;YAAES,aAAa;QAAS;QAE1BhB,YAAYT,KAAKwB,MAAM,CAACf,YAAY;YAClCiB,cAAc;gBACZC,wBAAU,oBAACzB;gBACX,eAAe;YACjB;YACAuB,aAAa;QACf;QACAf,MAAMV,KAAK4B,QAAQ,CAAClB,MAAM;YACxBe,aAAa;QACf;QACAV;IACF;AACF,EAAE"}
@@ -0,0 +1,60 @@
1
+ import { __styles, mergeClasses } from '@griffel/react';
2
+ import { typographyStyles } from '@fluentui/react-theme';
3
+ import { useContentStyles, useIconStyles, useIndicatorStyles, useRootDefaultClassName, useSmallStyles } from '../sharedNavStyles.styles';
4
+ export const navCategoryItemClassNames = {
5
+ root: 'fui-NavCategoryItem',
6
+ icon: 'fui-NavCategoryItem__icon',
7
+ expandIcon: 'fui-NavCategoryItem__expandIcon'
8
+ };
9
+ const useExpandIconStyles = /*#__PURE__*/__styles({
10
+ base: {
11
+ Jyy4pa: "f1lfeew",
12
+ Bqenvij: "fjamq6b"
13
+ },
14
+ open: {
15
+ Bz10aip: ["f93bgaf", "fcxki7x"]
16
+ },
17
+ selected: {
18
+ Bahqtrf: "fk6fouc",
19
+ Be2twd7: "fkhj508",
20
+ Bhrd7zp: "fl43uef",
21
+ Bg96gwp: "f1i3iumi"
22
+ }
23
+ }, {
24
+ d: [".f1lfeew{-webkit-margin-start:auto;margin-inline-start:auto;}", ".fjamq6b{height:20px;}", ".f93bgaf{transform:rotate(90deg);}", ".fcxki7x{transform:rotate(-90deg);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"]
25
+ });
26
+ /**
27
+ * Styles for the root slot
28
+ */
29
+ export const useRootStyles = /*#__PURE__*/__styles({
30
+ base: {
31
+ a9b677: "fly5x3f"
32
+ }
33
+ }, {
34
+ d: [".fly5x3f{width:100%;}"]
35
+ });
36
+ /**
37
+ * Apply styling to the NavCategoryItem slots based on the state
38
+ */
39
+ export const useNavCategoryItemStyles_unstable = state => {
40
+ 'use no memo';
41
+
42
+ const rootStyles = useRootStyles();
43
+ const smallStyles = useSmallStyles();
44
+ const defaultRootClassName = useRootDefaultClassName();
45
+ const contentStyles = useContentStyles();
46
+ const indicatorStyles = useIndicatorStyles();
47
+ const iconStyles = useIconStyles();
48
+ const expandIconStyles = useExpandIconStyles();
49
+ const {
50
+ selected,
51
+ open,
52
+ density
53
+ } = state;
54
+ state.root.className = mergeClasses(navCategoryItemClassNames.root, defaultRootClassName, rootStyles.base, density === 'small' && smallStyles.root, selected && open === false && indicatorStyles.base, selected && open === false && contentStyles.selected, state.root.className);
55
+ state.expandIcon.className = mergeClasses(navCategoryItemClassNames.expandIcon, expandIconStyles.base, state.open && expandIconStyles.open, state.expandIcon.className);
56
+ if (state.icon) {
57
+ state.icon.className = mergeClasses(navCategoryItemClassNames.icon, iconStyles.base, selected && iconStyles.selected, state.icon.className);
58
+ }
59
+ return state;
60
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__styles","mergeClasses","typographyStyles","useContentStyles","useIconStyles","useIndicatorStyles","useRootDefaultClassName","useSmallStyles","navCategoryItemClassNames","root","icon","expandIcon","useExpandIconStyles","base","Jyy4pa","Bqenvij","open","Bz10aip","selected","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","d","useRootStyles","a9b677","useNavCategoryItemStyles_unstable","state","rootStyles","smallStyles","defaultRootClassName","contentStyles","indicatorStyles","iconStyles","expandIconStyles","density","className"],"sources":["useNavCategoryItem.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport { useContentStyles, useIconStyles, useIndicatorStyles, useRootDefaultClassName, useSmallStyles } from '../sharedNavStyles.styles';\nexport const navCategoryItemClassNames = {\n root: 'fui-NavCategoryItem',\n icon: 'fui-NavCategoryItem__icon',\n expandIcon: 'fui-NavCategoryItem__expandIcon'\n};\nconst useExpandIconStyles = makeStyles({\n base: {\n marginInlineStart: 'auto',\n height: '20px'\n },\n open: {\n transform: 'rotate(90deg)'\n },\n selected: typographyStyles.body1Strong\n});\n/**\n * Styles for the root slot\n */ export const useRootStyles = makeStyles({\n base: {\n width: '100%'\n }\n});\n/**\n * Apply styling to the NavCategoryItem slots based on the state\n */ export const useNavCategoryItemStyles_unstable = (state)=>{\n 'use no memo';\n const rootStyles = useRootStyles();\n const smallStyles = useSmallStyles();\n const defaultRootClassName = useRootDefaultClassName();\n const contentStyles = useContentStyles();\n const indicatorStyles = useIndicatorStyles();\n const iconStyles = useIconStyles();\n const expandIconStyles = useExpandIconStyles();\n const { selected, open, density } = state;\n state.root.className = mergeClasses(navCategoryItemClassNames.root, defaultRootClassName, rootStyles.base, density === 'small' && smallStyles.root, selected && open === false && indicatorStyles.base, selected && open === false && contentStyles.selected, state.root.className);\n state.expandIcon.className = mergeClasses(navCategoryItemClassNames.expandIcon, expandIconStyles.base, state.open && expandIconStyles.open, state.expandIcon.className);\n if (state.icon) {\n state.icon.className = mergeClasses(navCategoryItemClassNames.icon, iconStyles.base, selected && iconStyles.selected, state.icon.className);\n }\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,gBAAgB,EAAEC,aAAa,EAAEC,kBAAkB,EAAEC,uBAAuB,EAAEC,cAAc,QAAQ,2BAA2B;AACxI,OAAO,MAAMC,yBAAyB,GAAG;EACrCC,IAAI,EAAE,qBAAqB;EAC3BC,IAAI,EAAE,2BAA2B;EACjCC,UAAU,EAAE;AAChB,CAAC;AACD,MAAMC,mBAAmB,gBAAGZ,QAAA;EAAAa,IAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,IAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAS3B,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,aAAa,gBAAGxB,QAAA;EAAAa,IAAA;IAAAY,MAAA;EAAA;AAAA;EAAAF,CAAA;AAAA,CAIhC,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMG,iCAAiC,GAAIC,KAAK,IAAG;EAC1D,aAAa;;EACb,MAAMC,UAAU,GAAGJ,aAAa,CAAC,CAAC;EAClC,MAAMK,WAAW,GAAGtB,cAAc,CAAC,CAAC;EACpC,MAAMuB,oBAAoB,GAAGxB,uBAAuB,CAAC,CAAC;EACtD,MAAMyB,aAAa,GAAG5B,gBAAgB,CAAC,CAAC;EACxC,MAAM6B,eAAe,GAAG3B,kBAAkB,CAAC,CAAC;EAC5C,MAAM4B,UAAU,GAAG7B,aAAa,CAAC,CAAC;EAClC,MAAM8B,gBAAgB,GAAGtB,mBAAmB,CAAC,CAAC;EAC9C,MAAM;IAAEM,QAAQ;IAAEF,IAAI;IAAEmB;EAAQ,CAAC,GAAGR,KAAK;EACzCA,KAAK,CAAClB,IAAI,CAAC2B,SAAS,GAAGnC,YAAY,CAACO,yBAAyB,CAACC,IAAI,EAAEqB,oBAAoB,EAAEF,UAAU,CAACf,IAAI,EAAEsB,OAAO,KAAK,OAAO,IAAIN,WAAW,CAACpB,IAAI,EAAES,QAAQ,IAAIF,IAAI,KAAK,KAAK,IAAIgB,eAAe,CAACnB,IAAI,EAAEK,QAAQ,IAAIF,IAAI,KAAK,KAAK,IAAIe,aAAa,CAACb,QAAQ,EAAES,KAAK,CAAClB,IAAI,CAAC2B,SAAS,CAAC;EACnRT,KAAK,CAAChB,UAAU,CAACyB,SAAS,GAAGnC,YAAY,CAACO,yBAAyB,CAACG,UAAU,EAAEuB,gBAAgB,CAACrB,IAAI,EAAEc,KAAK,CAACX,IAAI,IAAIkB,gBAAgB,CAAClB,IAAI,EAAEW,KAAK,CAAChB,UAAU,CAACyB,SAAS,CAAC;EACvK,IAAIT,KAAK,CAACjB,IAAI,EAAE;IACZiB,KAAK,CAACjB,IAAI,CAAC0B,SAAS,GAAGnC,YAAY,CAACO,yBAAyB,CAACE,IAAI,EAAEuB,UAAU,CAACpB,IAAI,EAAEK,QAAQ,IAAIe,UAAU,CAACf,QAAQ,EAAES,KAAK,CAACjB,IAAI,CAAC0B,SAAS,CAAC;EAC/I;EACA,OAAOT,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ const NavCategoryItemContext = React.createContext(undefined);
3
+ const NavCategoryItemContextDefaultValues = {
4
+ open: false
5
+ };
6
+ export const { Provider: NavCategoryItemProvider } = NavCategoryItemContext;
7
+ export const useNavCategoryItemContext_unstable = ()=>{
8
+ var _React_useContext;
9
+ return (_React_useContext = React.useContext(NavCategoryItemContext)) !== null && _React_useContext !== void 0 ? _React_useContext : NavCategoryItemContextDefaultValues;
10
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/NavCategoryItemContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { NavItemValue } from './NavContext.types';\n\n// This context is analogous to AccordionHeaderContext\n\nexport type NavCategoryItemContextValue = {\n open: boolean;\n value: NavItemValue;\n};\n\nconst NavCategoryItemContext = React.createContext<NavCategoryItemContextValue | undefined>(\n undefined,\n) as React.Context<NavCategoryItemContextValue>;\n\nconst NavCategoryItemContextDefaultValues = {\n open: false,\n};\n\nexport const { Provider: NavCategoryItemProvider } = NavCategoryItemContext;\n\nexport const useNavCategoryItemContext_unstable = () =>\n React.useContext(NavCategoryItemContext) ?? NavCategoryItemContextDefaultValues;\n"],"names":["React","NavCategoryItemContext","createContext","undefined","NavCategoryItemContextDefaultValues","open","Provider","NavCategoryItemProvider","useNavCategoryItemContext_unstable","useContext"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAU/B,MAAMC,yBAAyBD,MAAME,aAAa,CAChDC;AAGF,MAAMC,sCAAsC;IAC1CC,MAAM;AACR;AAEA,OAAO,MAAM,EAAEC,UAAUC,uBAAuB,EAAE,GAAGN,uBAAuB;AAE5E,OAAO,MAAMO,qCAAqC;QAChDR;WAAAA,CAAAA,oBAAAA,MAAMS,UAAU,CAACR,qCAAjBD,+BAAAA,oBAA4CI;AAAkC,EAAE"}