@react-md/core 1.0.0-next.14 → 1.0.0-next.16

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 (1165) hide show
  1. package/dist/CoreProviders.js.map +1 -1
  2. package/dist/NoSsr.js.map +1 -1
  3. package/dist/RootHtml.d.ts +0 -2
  4. package/dist/RootHtml.js +0 -2
  5. package/dist/RootHtml.js.map +1 -1
  6. package/dist/SsrProvider.js.map +1 -1
  7. package/dist/app-bar/AppBar.d.ts +0 -2
  8. package/dist/app-bar/AppBar.js +0 -2
  9. package/dist/app-bar/AppBar.js.map +1 -1
  10. package/dist/app-bar/AppBarTitle.d.ts +8 -7
  11. package/dist/app-bar/AppBarTitle.js +3 -4
  12. package/dist/app-bar/AppBarTitle.js.map +1 -1
  13. package/dist/autocomplete/Autocomplete.js.map +1 -1
  14. package/dist/autocomplete/AutocompleteCircularProgress.js.map +1 -1
  15. package/dist/autocomplete/AutocompleteDropdownButton.js.map +1 -1
  16. package/dist/autocomplete/FilterAutocompleteOptions.js.map +1 -1
  17. package/dist/autocomplete/autocompleteStyles.js.map +1 -1
  18. package/dist/autocomplete/defaults.d.ts +2 -2
  19. package/dist/autocomplete/defaults.js +3 -3
  20. package/dist/autocomplete/defaults.js.map +1 -1
  21. package/dist/autocomplete/types.js.map +1 -1
  22. package/dist/avatar/Avatar.d.ts +1 -4
  23. package/dist/avatar/Avatar.js +1 -4
  24. package/dist/avatar/Avatar.js.map +1 -1
  25. package/dist/avatar/styles.js.map +1 -1
  26. package/dist/badge/Badge.d.ts +1 -3
  27. package/dist/badge/Badge.js +0 -2
  28. package/dist/badge/Badge.js.map +1 -1
  29. package/dist/box/Box.d.ts +0 -2
  30. package/dist/box/Box.js +0 -2
  31. package/dist/box/Box.js.map +1 -1
  32. package/dist/box/styles.js.map +1 -1
  33. package/dist/button/AsyncButton.js.map +1 -1
  34. package/dist/button/Button.js.map +1 -1
  35. package/dist/button/ButtonUnstyled.d.ts +0 -2
  36. package/dist/button/ButtonUnstyled.js +0 -2
  37. package/dist/button/ButtonUnstyled.js.map +1 -1
  38. package/dist/button/FloatingActionButton.js.map +1 -1
  39. package/dist/button/TooltippedButton.js.map +1 -1
  40. package/dist/button/buttonStyles.js.map +1 -1
  41. package/dist/button/buttonUnstyledStyles.js.map +1 -1
  42. package/dist/card/Card.d.ts +2 -3
  43. package/dist/card/Card.js +0 -2
  44. package/dist/card/Card.js.map +1 -1
  45. package/dist/card/CardContent.d.ts +0 -2
  46. package/dist/card/CardContent.js +0 -2
  47. package/dist/card/CardContent.js.map +1 -1
  48. package/dist/card/CardFooter.d.ts +0 -3
  49. package/dist/card/CardFooter.js +0 -2
  50. package/dist/card/CardFooter.js.map +1 -1
  51. package/dist/card/CardHeader.d.ts +0 -2
  52. package/dist/card/CardHeader.js +0 -2
  53. package/dist/card/CardHeader.js.map +1 -1
  54. package/dist/card/CardSubtitle.d.ts +6 -3
  55. package/dist/card/CardSubtitle.js +2 -3
  56. package/dist/card/CardSubtitle.js.map +1 -1
  57. package/dist/card/CardTitle.d.ts +0 -3
  58. package/dist/card/CardTitle.js +0 -2
  59. package/dist/card/CardTitle.js.map +1 -1
  60. package/dist/card/ClickableCard.js.map +1 -1
  61. package/dist/card/styles.js +2 -4
  62. package/dist/card/styles.js.map +1 -1
  63. package/dist/chip/Chip.d.ts +0 -2
  64. package/dist/chip/Chip.js +0 -2
  65. package/dist/chip/Chip.js.map +1 -1
  66. package/dist/chip/styles.js.map +1 -1
  67. package/dist/cssUtils.d.ts +1 -1
  68. package/dist/cssUtils.js.map +1 -1
  69. package/dist/delegateEvent.js.map +1 -1
  70. package/dist/dialog/Dialog.js.map +1 -1
  71. package/dist/dialog/DialogContainer.d.ts +0 -2
  72. package/dist/dialog/DialogContainer.js +0 -2
  73. package/dist/dialog/DialogContainer.js.map +1 -1
  74. package/dist/dialog/DialogContent.d.ts +3 -3
  75. package/dist/dialog/DialogContent.js +3 -3
  76. package/dist/dialog/DialogContent.js.map +1 -1
  77. package/dist/dialog/DialogFooter.d.ts +2 -3
  78. package/dist/dialog/DialogFooter.js +2 -3
  79. package/dist/dialog/DialogFooter.js.map +1 -1
  80. package/dist/dialog/DialogHeader.d.ts +3 -3
  81. package/dist/dialog/DialogHeader.js +3 -3
  82. package/dist/dialog/DialogHeader.js.map +1 -1
  83. package/dist/dialog/DialogTitle.d.ts +3 -4
  84. package/dist/dialog/DialogTitle.js +3 -3
  85. package/dist/dialog/DialogTitle.js.map +1 -1
  86. package/dist/dialog/FixedDialog.js.map +1 -1
  87. package/dist/dialog/NestedDialogProvider.d.ts +0 -1
  88. package/dist/dialog/NestedDialogProvider.js.map +1 -1
  89. package/dist/dialog/styles.js.map +1 -1
  90. package/dist/divider/Divider.d.ts +0 -2
  91. package/dist/divider/Divider.js +0 -2
  92. package/dist/divider/Divider.js.map +1 -1
  93. package/dist/divider/styles.js.map +1 -1
  94. package/dist/draggable/useDraggable.js.map +1 -1
  95. package/dist/draggable/utils.js.map +1 -1
  96. package/dist/expansion-panel/ExpansionList.d.ts +1 -1
  97. package/dist/expansion-panel/ExpansionList.js +1 -1
  98. package/dist/expansion-panel/ExpansionList.js.map +1 -1
  99. package/dist/expansion-panel/ExpansionPanel.d.ts +8 -24
  100. package/dist/expansion-panel/ExpansionPanel.js +1 -12
  101. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  102. package/dist/expansion-panel/ExpansionPanelHeader.d.ts +0 -1
  103. package/dist/expansion-panel/ExpansionPanelHeader.js +0 -1
  104. package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
  105. package/dist/expansion-panel/expansionPanelStyles.d.ts +19 -0
  106. package/dist/expansion-panel/expansionPanelStyles.js +14 -0
  107. package/dist/expansion-panel/expansionPanelStyles.js.map +1 -0
  108. package/dist/expansion-panel/useExpansionList.js.map +1 -1
  109. package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
  110. package/dist/focus/useFocusContainer.js.map +1 -1
  111. package/dist/focus/utils.js.map +1 -1
  112. package/dist/form/Checkbox.d.ts +0 -1
  113. package/dist/form/Checkbox.js.map +1 -1
  114. package/dist/form/Fieldset.d.ts +0 -2
  115. package/dist/form/Fieldset.js.map +1 -1
  116. package/dist/form/FileInput.js.map +1 -1
  117. package/dist/form/Form.js.map +1 -1
  118. package/dist/form/FormMessage.d.ts +0 -3
  119. package/dist/form/FormMessage.js +0 -2
  120. package/dist/form/FormMessage.js.map +1 -1
  121. package/dist/form/FormMessageContainer.d.ts +0 -1
  122. package/dist/form/FormMessageContainer.js +0 -1
  123. package/dist/form/FormMessageContainer.js.map +1 -1
  124. package/dist/form/FormMessageCounter.d.ts +0 -2
  125. package/dist/form/FormMessageCounter.js +0 -2
  126. package/dist/form/FormMessageCounter.js.map +1 -1
  127. package/dist/form/InputToggle.js.map +1 -1
  128. package/dist/form/InputToggleIcon.d.ts +0 -2
  129. package/dist/form/InputToggleIcon.js +0 -2
  130. package/dist/form/InputToggleIcon.js.map +1 -1
  131. package/dist/form/Label.d.ts +0 -3
  132. package/dist/form/Label.js +0 -2
  133. package/dist/form/Label.js.map +1 -1
  134. package/dist/form/Legend.d.ts +0 -3
  135. package/dist/form/Legend.js +0 -2
  136. package/dist/form/Legend.js.map +1 -1
  137. package/dist/form/MenuItemCheckbox.d.ts +0 -1
  138. package/dist/form/MenuItemCheckbox.js.map +1 -1
  139. package/dist/form/MenuItemFileInput.js.map +1 -1
  140. package/dist/form/MenuItemInputToggle.js.map +1 -1
  141. package/dist/form/MenuItemRadio.d.ts +0 -1
  142. package/dist/form/MenuItemRadio.js.map +1 -1
  143. package/dist/form/MenuItemSwitch.d.ts +0 -1
  144. package/dist/form/MenuItemSwitch.js.map +1 -1
  145. package/dist/form/MenuItemTextField.js.map +1 -1
  146. package/dist/form/NativeSelect.d.ts +0 -2
  147. package/dist/form/NativeSelect.js +0 -2
  148. package/dist/form/NativeSelect.js.map +1 -1
  149. package/dist/form/OptGroup.js.map +1 -1
  150. package/dist/form/Option.js.map +1 -1
  151. package/dist/form/Password.js.map +1 -1
  152. package/dist/form/Radio.d.ts +0 -1
  153. package/dist/form/Radio.js.map +1 -1
  154. package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
  155. package/dist/form/Select.js.map +1 -1
  156. package/dist/form/SelectedOption.d.ts +0 -2
  157. package/dist/form/SelectedOption.js +0 -2
  158. package/dist/form/SelectedOption.js.map +1 -1
  159. package/dist/form/Slider.js.map +1 -1
  160. package/dist/form/SliderContainer.d.ts +0 -2
  161. package/dist/form/SliderContainer.js +0 -2
  162. package/dist/form/SliderContainer.js.map +1 -1
  163. package/dist/form/SliderMark.d.ts +0 -2
  164. package/dist/form/SliderMark.js +0 -2
  165. package/dist/form/SliderMark.js.map +1 -1
  166. package/dist/form/SliderMarkLabel.d.ts +0 -2
  167. package/dist/form/SliderMarkLabel.js +0 -2
  168. package/dist/form/SliderMarkLabel.js.map +1 -1
  169. package/dist/form/SliderThumb.js.map +1 -1
  170. package/dist/form/SliderTrack.d.ts +0 -2
  171. package/dist/form/SliderTrack.js +0 -2
  172. package/dist/form/SliderTrack.js.map +1 -1
  173. package/dist/form/SliderValueMarks.d.ts +0 -2
  174. package/dist/form/SliderValueMarks.js +0 -2
  175. package/dist/form/SliderValueMarks.js.map +1 -1
  176. package/dist/form/SliderValueTooltip.js.map +1 -1
  177. package/dist/form/Switch.d.ts +0 -2
  178. package/dist/form/Switch.js +0 -2
  179. package/dist/form/Switch.js.map +1 -1
  180. package/dist/form/SwitchTrack.d.ts +2 -1
  181. package/dist/form/SwitchTrack.js +2 -1
  182. package/dist/form/SwitchTrack.js.map +1 -1
  183. package/dist/form/TextArea.js.map +1 -1
  184. package/dist/form/TextField.d.ts +0 -2
  185. package/dist/form/TextField.js +0 -2
  186. package/dist/form/TextField.js.map +1 -1
  187. package/dist/form/TextFieldAddon.d.ts +1 -4
  188. package/dist/form/TextFieldAddon.js +1 -3
  189. package/dist/form/TextFieldAddon.js.map +1 -1
  190. package/dist/form/TextFieldContainer.js.map +1 -1
  191. package/dist/form/fileUtils.js.map +1 -1
  192. package/dist/form/formConfig.js.map +1 -1
  193. package/dist/form/formMessageStyles.js.map +1 -1
  194. package/dist/form/inputToggleStyles.js.map +1 -1
  195. package/dist/form/menuItemInputToggleStyles.js.map +1 -1
  196. package/dist/form/nativeSelectStyles.js.map +1 -1
  197. package/dist/form/optionStyles.js.map +1 -1
  198. package/dist/form/passwordStyles.js.map +1 -1
  199. package/dist/form/selectStyles.js.map +1 -1
  200. package/dist/form/selectUtils.js.map +1 -1
  201. package/dist/form/sliderUtils.js.map +1 -1
  202. package/dist/form/switchStyles.js.map +1 -1
  203. package/dist/form/textAreaStyles.js.map +1 -1
  204. package/dist/form/textFieldContainerStyles.js.map +1 -1
  205. package/dist/form/textFieldStyles.js.map +1 -1
  206. package/dist/form/types.js.map +1 -1
  207. package/dist/form/useCheckboxGroup.js.map +1 -1
  208. package/dist/form/useCombobox.js.map +1 -1
  209. package/dist/form/useEditableCombobox.js.map +1 -1
  210. package/dist/form/useFileUpload.js.map +1 -1
  211. package/dist/form/useFormReset.js.map +1 -1
  212. package/dist/form/useListboxProvider.js.map +1 -1
  213. package/dist/form/useNumberField.js.map +1 -1
  214. package/dist/form/useRadioGroup.js.map +1 -1
  215. package/dist/form/useRangeSlider.js.map +1 -1
  216. package/dist/form/useResizingTextArea.js.map +1 -1
  217. package/dist/form/useSelectCombobox.js.map +1 -1
  218. package/dist/form/useSlider.js.map +1 -1
  219. package/dist/form/useTextField.js.map +1 -1
  220. package/dist/form/useTextFieldContainerAddons.js.map +1 -1
  221. package/dist/form/utils.js.map +1 -1
  222. package/dist/form/validation.js.map +1 -1
  223. package/dist/hoverMode/useHoverMode.js.map +1 -1
  224. package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
  225. package/dist/icon/FontIcon.d.ts +10 -8
  226. package/dist/icon/FontIcon.js +1 -7
  227. package/dist/icon/FontIcon.js.map +1 -1
  228. package/dist/icon/IconRotator.d.ts +0 -2
  229. package/dist/icon/IconRotator.js +0 -2
  230. package/dist/icon/IconRotator.js.map +1 -1
  231. package/dist/icon/MaterialIcon.d.ts +18 -3
  232. package/dist/icon/MaterialIcon.js +13 -3
  233. package/dist/icon/MaterialIcon.js.map +1 -1
  234. package/dist/icon/MaterialSymbol.d.ts +0 -1
  235. package/dist/icon/MaterialSymbol.js +0 -1
  236. package/dist/icon/MaterialSymbol.js.map +1 -1
  237. package/dist/icon/SVGIcon.d.ts +3 -2
  238. package/dist/icon/SVGIcon.js +0 -2
  239. package/dist/icon/SVGIcon.js.map +1 -1
  240. package/dist/icon/TextIconSpacing.d.ts +0 -2
  241. package/dist/icon/TextIconSpacing.js +0 -2
  242. package/dist/icon/TextIconSpacing.js.map +1 -1
  243. package/dist/icon/_icon.scss +2 -2
  244. package/dist/icon/iconConfig.d.ts +1 -0
  245. package/dist/icon/iconConfig.js +1 -0
  246. package/dist/icon/iconConfig.js.map +1 -1
  247. package/dist/icon/material.d.ts +1 -1
  248. package/dist/icon/material.js.map +1 -1
  249. package/dist/icon/materialConfig.js.map +1 -1
  250. package/dist/icon/styles.js +1 -1
  251. package/dist/icon/styles.js.map +1 -1
  252. package/dist/interaction/Ripple.js.map +1 -1
  253. package/dist/interaction/RippleContainer.d.ts +0 -2
  254. package/dist/interaction/RippleContainer.js +0 -2
  255. package/dist/interaction/RippleContainer.js.map +1 -1
  256. package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
  257. package/dist/interaction/config.js.map +1 -1
  258. package/dist/interaction/types.js.map +1 -1
  259. package/dist/interaction/useElementInteraction.js.map +1 -1
  260. package/dist/interaction/useHigherContrastChildren.js.map +1 -1
  261. package/dist/interaction/utils.js.map +1 -1
  262. package/dist/layout/LayoutAppBar.d.ts +0 -1
  263. package/dist/layout/LayoutAppBar.js.map +1 -1
  264. package/dist/layout/LayoutNav.js +1 -2
  265. package/dist/layout/LayoutNav.js.map +1 -1
  266. package/dist/layout/LayoutWindowSplitter.d.ts +0 -1
  267. package/dist/layout/LayoutWindowSplitter.js.map +1 -1
  268. package/dist/layout/Main.js.map +1 -1
  269. package/dist/layout/layoutNavStyles.js.map +1 -1
  270. package/dist/layout/layoutWindowSplitterStyles.js.map +1 -1
  271. package/dist/layout/mainStyles.js.map +1 -1
  272. package/dist/layout/useExpandableLayout.js.map +1 -1
  273. package/dist/layout/useHorizontalLayoutTransition.js +1 -1
  274. package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
  275. package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
  276. package/dist/layout/useLayoutTree.d.ts +2 -2
  277. package/dist/layout/useLayoutTree.js.map +1 -1
  278. package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
  279. package/dist/layout/useMainTabIndex.js.map +1 -1
  280. package/dist/layout/useResizableLayout.js.map +1 -1
  281. package/dist/layout/useTemporaryLayout.js.map +1 -1
  282. package/dist/link/Link.d.ts +2 -6
  283. package/dist/link/Link.js +1 -4
  284. package/dist/link/Link.js.map +1 -1
  285. package/dist/link/SkipToMainContent.d.ts +10 -3
  286. package/dist/link/SkipToMainContent.js +4 -1
  287. package/dist/link/SkipToMainContent.js.map +1 -1
  288. package/dist/link/styles.d.ts +2 -2
  289. package/dist/link/styles.js.map +1 -1
  290. package/dist/list/List.d.ts +0 -20
  291. package/dist/list/List.js +1 -14
  292. package/dist/list/List.js.map +1 -1
  293. package/dist/list/ListItem.d.ts +0 -16
  294. package/dist/list/ListItem.js.map +1 -1
  295. package/dist/list/ListItemAddon.d.ts +0 -2
  296. package/dist/list/ListItemAddon.js +0 -2
  297. package/dist/list/ListItemAddon.js.map +1 -1
  298. package/dist/list/ListItemChildren.d.ts +0 -2
  299. package/dist/list/ListItemChildren.js +0 -2
  300. package/dist/list/ListItemChildren.js.map +1 -1
  301. package/dist/list/ListItemLink.js.map +1 -1
  302. package/dist/list/ListItemText.d.ts +0 -2
  303. package/dist/list/ListItemText.js +0 -2
  304. package/dist/list/ListItemText.js.map +1 -1
  305. package/dist/list/ListSubheader.d.ts +3 -2
  306. package/dist/list/ListSubheader.js +0 -2
  307. package/dist/list/ListSubheader.js.map +1 -1
  308. package/dist/list/getListItemHeight.d.ts +2 -2
  309. package/dist/list/getListItemHeight.js +2 -2
  310. package/dist/list/getListItemHeight.js.map +1 -1
  311. package/dist/list/listItemStyles.d.ts +17 -1
  312. package/dist/list/listItemStyles.js.map +1 -1
  313. package/dist/list/listStyles.d.ts +18 -0
  314. package/dist/list/listStyles.js +14 -0
  315. package/dist/list/listStyles.js.map +1 -0
  316. package/dist/list/types.d.ts +9 -3
  317. package/dist/list/types.js +6 -1
  318. package/dist/list/types.js.map +1 -1
  319. package/dist/media-queries/AppSizeProvider.d.ts +8 -0
  320. package/dist/media-queries/AppSizeProvider.js +2 -0
  321. package/dist/media-queries/AppSizeProvider.js.map +1 -1
  322. package/dist/media-queries/appSize.d.ts +5 -5
  323. package/dist/media-queries/appSize.js.map +1 -1
  324. package/dist/media-queries/useMediaQuery.d.ts +1 -1
  325. package/dist/media-queries/useMediaQuery.js +1 -1
  326. package/dist/media-queries/useMediaQuery.js.map +1 -1
  327. package/dist/menu/DropdownMenu.js.map +1 -1
  328. package/dist/menu/Menu.js.map +1 -1
  329. package/dist/menu/MenuBar.d.ts +0 -1
  330. package/dist/menu/MenuBar.js.map +1 -1
  331. package/dist/menu/MenuButton.d.ts +0 -1
  332. package/dist/menu/MenuButton.js.map +1 -1
  333. package/dist/menu/MenuConfigurationProvider.js.map +1 -1
  334. package/dist/menu/MenuItem.d.ts +0 -1
  335. package/dist/menu/MenuItem.js.map +1 -1
  336. package/dist/menu/MenuItemButton.d.ts +0 -1
  337. package/dist/menu/MenuItemButton.js.map +1 -1
  338. package/dist/menu/MenuItemCircularProgress.js.map +1 -1
  339. package/dist/menu/MenuItemGroup.js.map +1 -1
  340. package/dist/menu/MenuItemSeparator.js.map +1 -1
  341. package/dist/menu/MenuSheet.js.map +1 -1
  342. package/dist/menu/MenuVisibilityProvider.js.map +1 -1
  343. package/dist/menu/MenuWidget.js.map +1 -1
  344. package/dist/menu/MenuWidgetKeyboardProvider.js.map +1 -1
  345. package/dist/menu/useContextMenu.js.map +1 -1
  346. package/dist/menu/useMenuBarProvider.d.ts +0 -1
  347. package/dist/menu/useMenuBarProvider.js.map +1 -1
  348. package/dist/menu/utils.js.map +1 -1
  349. package/dist/movement/constants.js.map +1 -1
  350. package/dist/movement/findMatchIndex.js.map +1 -1
  351. package/dist/movement/types.js.map +1 -1
  352. package/dist/movement/useKeyboardMovementProvider.d.ts +0 -1
  353. package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
  354. package/dist/movement/utils.js.map +1 -1
  355. package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
  356. package/dist/navigation/DefaultNavigationRenderer.js.map +1 -1
  357. package/dist/navigation/NavGroup.d.ts +0 -2
  358. package/dist/navigation/NavGroup.js +0 -2
  359. package/dist/navigation/NavGroup.js.map +1 -1
  360. package/dist/navigation/NavItem.d.ts +0 -2
  361. package/dist/navigation/NavItem.js +0 -2
  362. package/dist/navigation/NavItem.js.map +1 -1
  363. package/dist/navigation/NavItemButton.js.map +1 -1
  364. package/dist/navigation/NavItemLink.js.map +1 -1
  365. package/dist/navigation/NavSubheader.d.ts +0 -3
  366. package/dist/navigation/NavSubheader.js +0 -2
  367. package/dist/navigation/NavSubheader.js.map +1 -1
  368. package/dist/navigation/Navigation.js.map +1 -1
  369. package/dist/navigation/getHrefFromParents.js.map +1 -1
  370. package/dist/navigation/navGroupStyles.js.map +1 -1
  371. package/dist/navigation/navItemStyles.js.map +1 -1
  372. package/dist/navigation/types.js.map +1 -1
  373. package/dist/navigation/useActiveHeadingId.js.map +1 -1
  374. package/dist/overlay/Overlay.d.ts +1 -0
  375. package/dist/overlay/Overlay.js.map +1 -1
  376. package/dist/overlay/overlayStyles.js.map +1 -1
  377. package/dist/portal/Portal.d.ts +4 -0
  378. package/dist/portal/Portal.js.map +1 -1
  379. package/dist/portal/PortalContainerProvider.d.ts +8 -3
  380. package/dist/portal/PortalContainerProvider.js +1 -0
  381. package/dist/portal/PortalContainerProvider.js.map +1 -1
  382. package/dist/positioning/constants.js.map +1 -1
  383. package/dist/positioning/createHorizontalPosition.js.map +1 -1
  384. package/dist/positioning/createVerticalPosition.js.map +1 -1
  385. package/dist/positioning/getFixedPosition.js.map +1 -1
  386. package/dist/positioning/types.js.map +1 -1
  387. package/dist/positioning/useFixedPositioning.js.map +1 -1
  388. package/dist/positioning/utils.js.map +1 -1
  389. package/dist/progress/CircularProgress.d.ts +5 -6
  390. package/dist/progress/CircularProgress.js +0 -2
  391. package/dist/progress/CircularProgress.js.map +1 -1
  392. package/dist/progress/LinearProgress.d.ts +0 -2
  393. package/dist/progress/LinearProgress.js +0 -2
  394. package/dist/progress/LinearProgress.js.map +1 -1
  395. package/dist/progress/getProgressA11y.js.map +1 -1
  396. package/dist/progress/types.js.map +1 -1
  397. package/dist/responsive-item/ResponsiveItemContainer.d.ts +0 -2
  398. package/dist/responsive-item/ResponsiveItemContainer.js +0 -2
  399. package/dist/responsive-item/ResponsiveItemContainer.js.map +1 -1
  400. package/dist/responsive-item/ResponsiveItemOverlay.d.ts +0 -2
  401. package/dist/responsive-item/ResponsiveItemOverlay.js +0 -2
  402. package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
  403. package/dist/responsive-item/styles.js.map +1 -1
  404. package/dist/scroll/ScrollLock.js.map +1 -1
  405. package/dist/scroll/getScrollbarWidth.js.map +1 -1
  406. package/dist/scroll/useScrollLock.js.map +1 -1
  407. package/dist/searching/caseInsensitive.js.map +1 -1
  408. package/dist/searching/fuzzy.js.map +1 -1
  409. package/dist/searching/toSearchQuery.js.map +1 -1
  410. package/dist/searching/types.js.map +1 -1
  411. package/dist/searching/useFuzzyMatch.js.map +1 -1
  412. package/dist/searching/utils.js.map +1 -1
  413. package/dist/segmented-button/SegmentedButton.js.map +1 -1
  414. package/dist/segmented-button/SegmentedButtonContainer.d.ts +0 -2
  415. package/dist/segmented-button/SegmentedButtonContainer.js +0 -2
  416. package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
  417. package/dist/segmented-button/segmentedButtonContainerStyles.js.map +1 -1
  418. package/dist/segmented-button/segmentedButtonStyles.js.map +1 -1
  419. package/dist/sheet/Sheet.d.ts +30 -16
  420. package/dist/sheet/Sheet.js +24 -14
  421. package/dist/sheet/Sheet.js.map +1 -1
  422. package/dist/sheet/styles.d.ts +29 -0
  423. package/dist/sheet/styles.js +13 -0
  424. package/dist/sheet/styles.js.map +1 -1
  425. package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
  426. package/dist/snackbar/Snackbar.js.map +1 -1
  427. package/dist/snackbar/Toast.js.map +1 -1
  428. package/dist/snackbar/ToastActionButton.d.ts +0 -1
  429. package/dist/snackbar/ToastActionButton.js.map +1 -1
  430. package/dist/snackbar/ToastCloseButton.d.ts +0 -1
  431. package/dist/snackbar/ToastCloseButton.js.map +1 -1
  432. package/dist/snackbar/ToastContent.js.map +1 -1
  433. package/dist/snackbar/ToastManager.js.map +1 -1
  434. package/dist/snackbar/ToastManagerProvider.js.map +1 -1
  435. package/dist/snackbar/snackbarStyles.js.map +1 -1
  436. package/dist/snackbar/toastContentStyles.js.map +1 -1
  437. package/dist/snackbar/toastStyles.js.map +1 -1
  438. package/dist/snackbar/useCurrentToastActions.d.ts +0 -1
  439. package/dist/snackbar/useCurrentToastActions.js.map +1 -1
  440. package/dist/suspense/CircularProgressSuspense.d.ts +0 -2
  441. package/dist/suspense/CircularProgressSuspense.js +0 -2
  442. package/dist/suspense/CircularProgressSuspense.js.map +1 -1
  443. package/dist/suspense/NullSuspense.d.ts +0 -2
  444. package/dist/suspense/NullSuspense.js +0 -2
  445. package/dist/suspense/NullSuspense.js.map +1 -1
  446. package/dist/table/StickyTableSection.d.ts +23 -0
  447. package/dist/table/StickyTableSection.js +56 -0
  448. package/dist/table/StickyTableSection.js.map +1 -0
  449. package/dist/table/Table.d.ts +1 -1
  450. package/dist/table/Table.js.map +1 -1
  451. package/dist/table/TableBody.d.ts +1 -1
  452. package/dist/table/TableBody.js.map +1 -1
  453. package/dist/table/TableCell.d.ts +3 -2
  454. package/dist/table/TableCell.js.map +1 -1
  455. package/dist/table/TableCellContent.d.ts +1 -5
  456. package/dist/table/TableCellContent.js +0 -3
  457. package/dist/table/TableCellContent.js.map +1 -1
  458. package/dist/table/TableCheckbox.js.map +1 -1
  459. package/dist/table/TableConfigurationProvider.d.ts +1 -74
  460. package/dist/table/TableConfigurationProvider.js.map +1 -1
  461. package/dist/table/TableContainer.js.map +1 -1
  462. package/dist/table/TableContainerProvider.js.map +1 -1
  463. package/dist/table/TableFooter.d.ts +8 -17
  464. package/dist/table/TableFooter.js +17 -80
  465. package/dist/table/TableFooter.js.map +1 -1
  466. package/dist/table/TableHeader.d.ts +8 -17
  467. package/dist/table/TableHeader.js +20 -87
  468. package/dist/table/TableHeader.js.map +1 -1
  469. package/dist/table/TableRadio.js.map +1 -1
  470. package/dist/table/TableRow.d.ts +1 -1
  471. package/dist/table/TableRow.js.map +1 -1
  472. package/dist/table/tableCellStyles.d.ts +1 -1
  473. package/dist/table/tableCellStyles.js.map +1 -1
  474. package/dist/table/tableContainerStyles.js.map +1 -1
  475. package/dist/table/tableFooterStyles.js.map +1 -1
  476. package/dist/table/tableHeaderStyles.js.map +1 -1
  477. package/dist/table/tableRowStyles.js.map +1 -1
  478. package/dist/table/tableStyles.js.map +1 -1
  479. package/dist/table/types.d.ts +89 -9
  480. package/dist/table/types.js.map +1 -1
  481. package/dist/table/useStickyTableSection.d.ts +27 -0
  482. package/dist/table/useStickyTableSection.js +84 -0
  483. package/dist/table/useStickyTableSection.js.map +1 -0
  484. package/dist/table/useTableSectionConfig.d.ts +13 -0
  485. package/dist/table/useTableSectionConfig.js +33 -0
  486. package/dist/table/useTableSectionConfig.js.map +1 -0
  487. package/dist/tabs/Tab.d.ts +3 -0
  488. package/dist/tabs/Tab.js.map +1 -1
  489. package/dist/tabs/TabList.js.map +1 -1
  490. package/dist/tabs/TabListScrollButton.js +5 -1
  491. package/dist/tabs/TabListScrollButton.js.map +1 -1
  492. package/dist/tabs/_tabs.scss +21 -3
  493. package/dist/tabs/tabIndicatorStyles.js.map +1 -1
  494. package/dist/tabs/tabListScrollButtonStyles.d.ts +2 -0
  495. package/dist/tabs/tabListScrollButtonStyles.js +9 -5
  496. package/dist/tabs/tabListScrollButtonStyles.js.map +1 -1
  497. package/dist/tabs/tabListStyles.js.map +1 -1
  498. package/dist/tabs/tabStyles.js.map +1 -1
  499. package/dist/tabs/useTabList.d.ts +2 -0
  500. package/dist/tabs/useTabList.js +4 -2
  501. package/dist/tabs/useTabList.js.map +1 -1
  502. package/dist/tabs/useTabs.d.ts +33 -11
  503. package/dist/tabs/useTabs.js +9 -3
  504. package/dist/tabs/useTabs.js.map +1 -1
  505. package/dist/tabs/utils.js.map +1 -1
  506. package/dist/test-utils/IntersectionObserver.js.map +1 -1
  507. package/dist/test-utils/ResizeObserver.js.map +1 -1
  508. package/dist/test-utils/data-testid.d.ts +0 -1
  509. package/dist/test-utils/data-testid.js.map +1 -1
  510. package/dist/test-utils/index.js.map +1 -1
  511. package/dist/test-utils/jest-setup.js.map +1 -1
  512. package/dist/test-utils/matchMedia.js.map +1 -1
  513. package/dist/test-utils/polyfills/IntersectionObserver.js.map +1 -1
  514. package/dist/test-utils/polyfills/ResizeObserver.js.map +1 -1
  515. package/dist/test-utils/polyfills/TextDecoder.js.map +1 -1
  516. package/dist/test-utils/polyfills/TextEncoder.js.map +1 -1
  517. package/dist/test-utils/polyfills/index.js.map +1 -1
  518. package/dist/test-utils/polyfills/matchMedia.js.map +1 -1
  519. package/dist/test-utils/polyfills/offsetParent.js.map +1 -1
  520. package/dist/test-utils/polyfills/scrollIntoView.js.map +1 -1
  521. package/dist/test-utils/render.js.map +1 -1
  522. package/dist/test-utils/timers.js.map +1 -1
  523. package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
  524. package/dist/theme/ThemeProvider.js.map +1 -1
  525. package/dist/theme/_theme.scss +2 -1
  526. package/dist/theme/colors.js.map +1 -1
  527. package/dist/theme/cssVars.js.map +1 -1
  528. package/dist/theme/types.js.map +1 -1
  529. package/dist/theme/useCSSVariables.js.map +1 -1
  530. package/dist/theme/useColorScheme.d.ts +0 -1
  531. package/dist/theme/useColorScheme.js.map +1 -1
  532. package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
  533. package/dist/theme/useColorSchemeProvider.js.map +1 -1
  534. package/dist/theme/usePrefersColorScheme.js.map +1 -1
  535. package/dist/theme/utils.js.map +1 -1
  536. package/dist/tooltip/Tooltip.d.ts +20 -9
  537. package/dist/tooltip/Tooltip.js.map +1 -1
  538. package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
  539. package/dist/tooltip/constants.js.map +1 -1
  540. package/dist/tooltip/tooltipStyles.js.map +1 -1
  541. package/dist/tooltip/useTooltip.d.ts +30 -16
  542. package/dist/tooltip/useTooltip.js.map +1 -1
  543. package/dist/tooltip/useTooltipPosition.d.ts +2 -4
  544. package/dist/tooltip/useTooltipPosition.js.map +1 -1
  545. package/dist/tooltip/utils.js.map +1 -1
  546. package/dist/transition/CSSTransition.js.map +1 -1
  547. package/dist/transition/Collapse.js.map +1 -1
  548. package/dist/transition/CrossFade.js.map +1 -1
  549. package/dist/transition/ScaleTransition.js.map +1 -1
  550. package/dist/transition/SkeletonPlaceholder.js.map +1 -1
  551. package/dist/transition/Slide.js.map +1 -1
  552. package/dist/transition/SlideContainer.d.ts +2 -48
  553. package/dist/transition/SlideContainer.js +2 -48
  554. package/dist/transition/SlideContainer.js.map +1 -1
  555. package/dist/transition/collapseStyles.js.map +1 -1
  556. package/dist/transition/config.js.map +1 -1
  557. package/dist/transition/maxWidthTransition.js.map +1 -1
  558. package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
  559. package/dist/transition/types.d.ts +19 -24
  560. package/dist/transition/types.js.map +1 -1
  561. package/dist/transition/useCSSTransition.js.map +1 -1
  562. package/dist/transition/useCarousel.js.map +1 -1
  563. package/dist/transition/useCollapseTransition.js.map +1 -1
  564. package/dist/transition/useCrossFadeTransition.js.map +1 -1
  565. package/dist/transition/useMaxWidthTransition.js.map +1 -1
  566. package/dist/transition/useScaleTransition.js.map +1 -1
  567. package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
  568. package/dist/transition/useSlideTransition.js.map +1 -1
  569. package/dist/transition/useTransition.d.ts +1 -0
  570. package/dist/transition/useTransition.js +1 -0
  571. package/dist/transition/useTransition.js.map +1 -1
  572. package/dist/transition/utils.js.map +1 -1
  573. package/dist/tree/DefaultTreeItemRenderer.d.ts +2 -3
  574. package/dist/tree/DefaultTreeItemRenderer.js +1 -1
  575. package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
  576. package/dist/tree/Tree.d.ts +3 -4
  577. package/dist/tree/Tree.js.map +1 -1
  578. package/dist/tree/TreeGroup.js.map +1 -1
  579. package/dist/tree/TreeItem.d.ts +10 -3
  580. package/dist/tree/TreeItem.js +5 -2
  581. package/dist/tree/TreeItem.js.map +1 -1
  582. package/dist/tree/TreeItemExpander.js.map +1 -1
  583. package/dist/tree/TreeProvider.js.map +1 -1
  584. package/dist/tree/styles.js.map +1 -1
  585. package/dist/tree/types.d.ts +11 -6
  586. package/dist/tree/types.js +1 -26
  587. package/dist/tree/types.js.map +1 -1
  588. package/dist/tree/useTree.d.ts +5 -5
  589. package/dist/tree/useTree.js.map +1 -1
  590. package/dist/tree/useTreeExpansion.d.ts +3 -3
  591. package/dist/tree/useTreeExpansion.js.map +1 -1
  592. package/dist/tree/useTreeItems.js.map +1 -1
  593. package/dist/tree/useTreeMovement.js.map +1 -1
  594. package/dist/tree/useTreeSelection.d.ts +3 -3
  595. package/dist/tree/useTreeSelection.js.map +1 -1
  596. package/dist/tree/utils.js.map +1 -1
  597. package/dist/types.js.map +1 -1
  598. package/dist/typography/SrOnly.d.ts +2 -1
  599. package/dist/typography/SrOnly.js +2 -1
  600. package/dist/typography/SrOnly.js.map +1 -1
  601. package/dist/typography/TextContainer.d.ts +4 -2
  602. package/dist/typography/TextContainer.js +2 -2
  603. package/dist/typography/TextContainer.js.map +1 -1
  604. package/dist/typography/Typography.d.ts +10 -2
  605. package/dist/typography/Typography.js +3 -2
  606. package/dist/typography/Typography.js.map +1 -1
  607. package/dist/typography/WritingDirectionProvider.d.ts +2 -2
  608. package/dist/typography/WritingDirectionProvider.js +2 -2
  609. package/dist/typography/WritingDirectionProvider.js.map +1 -1
  610. package/dist/typography/textContainerStyles.js.map +1 -1
  611. package/dist/typography/typographyStyles.js.map +1 -1
  612. package/dist/useAsyncFunction.js.map +1 -1
  613. package/dist/useDebouncedFunction.js.map +1 -1
  614. package/dist/useDropzone.js.map +1 -1
  615. package/dist/useElementSize.js.map +1 -1
  616. package/dist/useEnsuredId.js.map +1 -1
  617. package/dist/useEnsuredRef.js.map +1 -1
  618. package/dist/useEnsuredState.js.map +1 -1
  619. package/dist/useHtmlClassName.js.map +1 -1
  620. package/dist/useIntersectionObserver.js.map +1 -1
  621. package/dist/useIsomorphicLayoutEffect.js.map +1 -1
  622. package/dist/useLocalStorage.js.map +1 -1
  623. package/dist/useMutationObserver.js.map +1 -1
  624. package/dist/useOrientation.js.map +1 -1
  625. package/dist/usePageInactive.js.map +1 -1
  626. package/dist/useResizeListener.d.ts +7 -1
  627. package/dist/useResizeListener.js.map +1 -1
  628. package/dist/useResizeObserver.d.ts +3 -3
  629. package/dist/useResizeObserver.js.map +1 -1
  630. package/dist/useThrottledFunction.js.map +1 -1
  631. package/dist/useToggle.d.ts +4 -4
  632. package/dist/useToggle.js +1 -1
  633. package/dist/useToggle.js.map +1 -1
  634. package/dist/useUnmounted.js.map +1 -1
  635. package/dist/useWindowSize.js.map +1 -1
  636. package/dist/utils/RenderRecursively.js.map +1 -1
  637. package/dist/utils/alphaNumericSort.js.map +1 -1
  638. package/dist/utils/applyRef.js.map +1 -1
  639. package/dist/utils/bem.js.map +1 -1
  640. package/dist/utils/getClientPosition.js.map +1 -1
  641. package/dist/utils/getMiddleOfRange.js.map +1 -1
  642. package/dist/utils/getPercentage.js.map +1 -1
  643. package/dist/utils/getRangeDefaultValue.js.map +1 -1
  644. package/dist/utils/getRangeSteps.js.map +1 -1
  645. package/dist/utils/identity.js.map +1 -1
  646. package/dist/utils/isElementVisible.js.map +1 -1
  647. package/dist/utils/loop.js.map +1 -1
  648. package/dist/utils/nearest.js.map +1 -1
  649. package/dist/utils/parseCssLengthUnit.js.map +1 -1
  650. package/dist/utils/randomInt.js.map +1 -1
  651. package/dist/utils/wait.js.map +1 -1
  652. package/dist/utils/withinRange.js.map +1 -1
  653. package/dist/window-splitter/WindowSplitter.d.ts +2 -2
  654. package/dist/window-splitter/WindowSplitter.js +2 -2
  655. package/dist/window-splitter/WindowSplitter.js.map +1 -1
  656. package/dist/window-splitter/useWindowSplitter.js.map +1 -1
  657. package/package.json +25 -24
  658. package/src/RootHtml.tsx +0 -2
  659. package/src/app-bar/AppBar.tsx +0 -2
  660. package/src/app-bar/AppBarTitle.tsx +8 -6
  661. package/src/autocomplete/defaults.ts +3 -3
  662. package/src/avatar/Avatar.tsx +1 -4
  663. package/src/badge/Badge.tsx +1 -3
  664. package/src/box/Box.tsx +0 -2
  665. package/src/button/ButtonUnstyled.tsx +0 -2
  666. package/src/card/Card.tsx +2 -3
  667. package/src/card/CardContent.tsx +0 -2
  668. package/src/card/CardFooter.tsx +0 -2
  669. package/src/card/CardHeader.tsx +0 -2
  670. package/src/card/CardSubtitle.tsx +9 -2
  671. package/src/card/CardTitle.tsx +0 -2
  672. package/src/card/styles.ts +2 -6
  673. package/src/chip/Chip.tsx +0 -2
  674. package/src/cssUtils.ts +1 -1
  675. package/src/dialog/DialogContainer.tsx +0 -2
  676. package/src/dialog/DialogContent.tsx +3 -3
  677. package/src/dialog/DialogFooter.tsx +2 -3
  678. package/src/dialog/DialogHeader.tsx +3 -3
  679. package/src/dialog/DialogTitle.tsx +3 -3
  680. package/src/divider/Divider.tsx +0 -2
  681. package/src/expansion-panel/ExpansionList.tsx +1 -1
  682. package/src/expansion-panel/ExpansionPanel.tsx +9 -38
  683. package/src/expansion-panel/ExpansionPanelHeader.tsx +0 -1
  684. package/src/expansion-panel/expansionPanelStyles.ts +33 -0
  685. package/src/form/Fieldset.tsx +0 -2
  686. package/src/form/FormMessage.tsx +0 -2
  687. package/src/form/FormMessageContainer.tsx +0 -1
  688. package/src/form/FormMessageCounter.tsx +0 -2
  689. package/src/form/InputToggle.tsx +1 -1
  690. package/src/form/InputToggleIcon.tsx +0 -2
  691. package/src/form/Label.tsx +0 -2
  692. package/src/form/Legend.tsx +0 -2
  693. package/src/form/NativeSelect.tsx +0 -2
  694. package/src/form/Option.tsx +1 -1
  695. package/src/form/SelectedOption.tsx +0 -2
  696. package/src/form/SliderContainer.tsx +0 -2
  697. package/src/form/SliderMark.tsx +0 -2
  698. package/src/form/SliderMarkLabel.tsx +0 -2
  699. package/src/form/SliderTrack.tsx +0 -2
  700. package/src/form/SliderValueMarks.tsx +0 -2
  701. package/src/form/Switch.tsx +0 -2
  702. package/src/form/SwitchTrack.tsx +2 -1
  703. package/src/form/TextField.tsx +0 -2
  704. package/src/form/TextFieldAddon.tsx +1 -3
  705. package/src/icon/FontIcon.tsx +19 -11
  706. package/src/icon/IconRotator.tsx +0 -2
  707. package/src/icon/MaterialIcon.tsx +22 -5
  708. package/src/icon/MaterialSymbol.tsx +0 -1
  709. package/src/icon/SVGIcon.tsx +3 -2
  710. package/src/icon/TextIconSpacing.tsx +0 -2
  711. package/src/icon/iconConfig.tsx +1 -0
  712. package/src/icon/material.ts +276 -19
  713. package/src/icon/styles.ts +1 -1
  714. package/src/interaction/RippleContainer.tsx +0 -2
  715. package/src/layout/LayoutNav.tsx +3 -2
  716. package/src/layout/useHorizontalLayoutTransition.ts +1 -1
  717. package/src/layout/useLayoutTree.ts +2 -2
  718. package/src/link/Link.tsx +2 -6
  719. package/src/link/SkipToMainContent.tsx +11 -4
  720. package/src/link/styles.ts +2 -2
  721. package/src/list/List.tsx +1 -33
  722. package/src/list/ListItem.tsx +0 -17
  723. package/src/list/ListItemAddon.tsx +0 -2
  724. package/src/list/ListItemChildren.tsx +0 -2
  725. package/src/list/ListItemText.tsx +0 -2
  726. package/src/list/ListSubheader.tsx +3 -2
  727. package/src/list/getListItemHeight.ts +2 -2
  728. package/src/list/listItemStyles.ts +21 -4
  729. package/src/list/listStyles.ts +31 -0
  730. package/src/list/types.ts +9 -3
  731. package/src/media-queries/AppSizeProvider.tsx +8 -0
  732. package/src/media-queries/useMediaQuery.ts +1 -1
  733. package/src/menu/MenuConfigurationProvider.tsx +2 -2
  734. package/src/navigation/NavGroup.tsx +0 -2
  735. package/src/navigation/NavItem.tsx +0 -2
  736. package/src/navigation/NavSubheader.tsx +0 -2
  737. package/src/overlay/Overlay.tsx +1 -0
  738. package/src/portal/Portal.tsx +5 -0
  739. package/src/portal/PortalContainerProvider.tsx +16 -7
  740. package/src/progress/CircularProgress.tsx +5 -6
  741. package/src/progress/LinearProgress.tsx +0 -2
  742. package/src/responsive-item/ResponsiveItemContainer.tsx +0 -2
  743. package/src/responsive-item/ResponsiveItemOverlay.tsx +0 -2
  744. package/src/segmented-button/SegmentedButtonContainer.tsx +0 -2
  745. package/src/sheet/Sheet.tsx +36 -33
  746. package/src/sheet/styles.ts +50 -0
  747. package/src/suspense/CircularProgressSuspense.tsx +0 -2
  748. package/src/suspense/NullSuspense.tsx +0 -2
  749. package/src/table/StickyTableSection.tsx +91 -0
  750. package/src/table/Table.tsx +2 -5
  751. package/src/table/TableBody.tsx +1 -2
  752. package/src/table/TableCell.tsx +3 -5
  753. package/src/table/TableCellContent.tsx +1 -6
  754. package/src/table/TableConfigurationProvider.tsx +1 -86
  755. package/src/table/TableFooter.tsx +19 -116
  756. package/src/table/TableHeader.tsx +20 -118
  757. package/src/table/TableRow.tsx +2 -4
  758. package/src/table/tableCellStyles.ts +1 -1
  759. package/src/table/types.ts +105 -10
  760. package/src/table/useStickyTableSection.tsx +126 -0
  761. package/src/table/useTableSectionConfig.ts +45 -0
  762. package/src/tabs/Tab.tsx +3 -0
  763. package/src/tabs/TabListScrollButton.tsx +9 -2
  764. package/src/tabs/tabListScrollButtonStyles.ts +9 -5
  765. package/src/tabs/useTabList.ts +4 -0
  766. package/src/tabs/useTabs.ts +61 -14
  767. package/src/test-utils/IntersectionObserver.ts +1 -1
  768. package/src/tooltip/Tooltip.tsx +24 -8
  769. package/src/tooltip/useTooltip.ts +52 -27
  770. package/src/tooltip/useTooltipPosition.ts +2 -4
  771. package/src/transition/SlideContainer.tsx +2 -48
  772. package/src/transition/types.ts +23 -27
  773. package/src/transition/useTransition.ts +1 -0
  774. package/src/tree/DefaultTreeItemRenderer.tsx +3 -4
  775. package/src/tree/Tree.tsx +4 -6
  776. package/src/tree/TreeItem.tsx +11 -4
  777. package/src/tree/types.ts +16 -6
  778. package/src/tree/useTree.ts +5 -7
  779. package/src/tree/useTreeExpansion.ts +3 -3
  780. package/src/tree/useTreeSelection.ts +3 -3
  781. package/src/typography/SrOnly.tsx +2 -1
  782. package/src/typography/TextContainer.tsx +4 -2
  783. package/src/typography/Typography.tsx +10 -2
  784. package/src/typography/WritingDirectionProvider.tsx +2 -2
  785. package/src/useResizeListener.ts +8 -2
  786. package/src/useResizeObserver.ts +3 -3
  787. package/src/useToggle.ts +4 -4
  788. package/src/window-splitter/WindowSplitter.tsx +2 -2
  789. package/.eslintrc.cjs +0 -26
  790. package/.stylelintrc.json +0 -14
  791. package/.swcrc +0 -17
  792. package/.turbo/turbo-build.log +0 -22
  793. package/.turbo/turbo-lint.log +0 -12
  794. package/.turbo/turbo-test.log +0 -5498
  795. package/.turbo/turbo-typecheck.log +0 -26
  796. package/CHANGELOG.md +0 -310
  797. package/coverage/clover.xml +0 -775
  798. package/coverage/coverage-final.json +0 -5
  799. package/coverage/lcov-report/autocomplete/Autocomplete.tsx.html +0 -967
  800. package/coverage/lcov-report/autocomplete/index.html +0 -116
  801. package/coverage/lcov-report/base.css +0 -224
  802. package/coverage/lcov-report/block-navigation.js +0 -87
  803. package/coverage/lcov-report/button/Button.tsx.html +0 -676
  804. package/coverage/lcov-report/button/index.html +0 -116
  805. package/coverage/lcov-report/createHorizontalPosition.ts.html +0 -1075
  806. package/coverage/lcov-report/createVerticalPosition.ts.html +0 -997
  807. package/coverage/lcov-report/favicon.png +0 -0
  808. package/coverage/lcov-report/index.html +0 -161
  809. package/coverage/lcov-report/prettify.css +0 -1
  810. package/coverage/lcov-report/prettify.js +0 -2
  811. package/coverage/lcov-report/searching/fuzzy.ts.html +0 -607
  812. package/coverage/lcov-report/searching/index.html +0 -116
  813. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  814. package/coverage/lcov-report/sorter.js +0 -196
  815. package/coverage/lcov-report/typography/SrOnly.tsx.html +0 -325
  816. package/coverage/lcov-report/typography/index.html +0 -116
  817. package/coverage/lcov-report/utils.ts.html +0 -1225
  818. package/coverage/lcov.info +0 -836
  819. package/jest.config.ts +0 -68
  820. package/jest.setup.ts +0 -3
  821. package/scripts/copySassFiles.ts +0 -70
  822. package/scripts/tsconfig.json +0 -18
  823. package/src/__tests__/NoSsr.node.tsx +0 -26
  824. package/src/__tests__/NoSsr.tsx +0 -89
  825. package/src/__tests__/RootHtml.node.tsx +0 -46
  826. package/src/__tests__/__snapshots__/RootHtml.node.tsx.snap +0 -19
  827. package/src/__tests__/useAsyncFunction.tsx +0 -124
  828. package/src/__tests__/useDebouncedFunction.tsx +0 -108
  829. package/src/__tests__/useDropzone.tsx +0 -131
  830. package/src/__tests__/useElementSize.tsx +0 -181
  831. package/src/__tests__/useEnsuredId.tsx +0 -25
  832. package/src/__tests__/useEnsuredState.tsx +0 -74
  833. package/src/__tests__/useHtmlClassName.tsx +0 -54
  834. package/src/__tests__/useLocalStorage.tsx +0 -377
  835. package/src/__tests__/useOrientation.node.tsx +0 -20
  836. package/src/__tests__/useOrientation.tsx +0 -63
  837. package/src/__tests__/useResizeObserver.tsx +0 -258
  838. package/src/__tests__/useThrottledFunction.tsx +0 -226
  839. package/src/__tests__/useToggle.tsx +0 -78
  840. package/src/__tests__/useWindowSize.node.tsx +0 -56
  841. package/src/__tests__/useWindowSize.tsx +0 -155
  842. package/src/_box-shadows.scss +0 -219
  843. package/src/_core.scss +0 -432
  844. package/src/_utils.scss +0 -348
  845. package/src/app-bar/__tests__/AppBar.tsx +0 -121
  846. package/src/app-bar/__tests__/AppBarTitle.tsx +0 -39
  847. package/src/app-bar/__tests__/__snapshots__/AppBar.tsx.snap +0 -186
  848. package/src/app-bar/__tests__/__snapshots__/AppBarTitle.tsx.snap +0 -47
  849. package/src/app-bar/_app-bar.scss +0 -248
  850. package/src/autocomplete/__tests__/Autocomplete.tsx +0 -458
  851. package/src/autocomplete/__tests__/__snapshots__/Autocomplete.tsx.snap +0 -144
  852. package/src/autocomplete/_autocomplete.scss +0 -75
  853. package/src/avatar/__tests__/Avatar.tsx +0 -75
  854. package/src/avatar/__tests__/__snapshots__/Avatar.tsx.snap +0 -73
  855. package/src/avatar/_avatar.scss +0 -157
  856. package/src/badge/__tests__/Badge.tsx +0 -42
  857. package/src/badge/__tests__/__snapshots__/Badge.tsx.snap +0 -54
  858. package/src/badge/_badge.scss +0 -145
  859. package/src/box/__tests__/Box.tsx +0 -158
  860. package/src/box/__tests__/__snapshots__/Box.tsx.snap +0 -544
  861. package/src/box/_box.scss +0 -168
  862. package/src/button/__tests__/AsyncButton.tsx +0 -211
  863. package/src/button/__tests__/Button.tsx +0 -198
  864. package/src/button/__tests__/ButtonUnstyled.tsx +0 -37
  865. package/src/button/__tests__/TooltippedButton.tsx +0 -60
  866. package/src/button/__tests__/__snapshots__/AsyncButton.tsx.snap +0 -418
  867. package/src/button/__tests__/__snapshots__/Button.tsx.snap +0 -573
  868. package/src/button/__tests__/__snapshots__/ButtonUnstyled.tsx.snap +0 -22
  869. package/src/button/__tests__/__snapshots__/TooltippedButton.tsx.snap +0 -26
  870. package/src/button/__tests__/__snapshots__/buttonStyles.ts.snap +0 -11
  871. package/src/button/__tests__/buttonStyles.ts +0 -15
  872. package/src/button/_button.scss +0 -330
  873. package/src/card/__tests__/Card.tsx +0 -37
  874. package/src/card/__tests__/CardContent.tsx +0 -40
  875. package/src/card/__tests__/CardFooter.tsx +0 -34
  876. package/src/card/__tests__/CardHeader.tsx +0 -66
  877. package/src/card/__tests__/CardSubtitle.tsx +0 -30
  878. package/src/card/__tests__/CardTitle.tsx +0 -30
  879. package/src/card/__tests__/ClickableCard.tsx +0 -66
  880. package/src/card/__tests__/__snapshots__/Card.tsx.snap +0 -40
  881. package/src/card/__tests__/__snapshots__/CardContent.tsx.snap +0 -50
  882. package/src/card/__tests__/__snapshots__/CardFooter.tsx.snap +0 -30
  883. package/src/card/__tests__/__snapshots__/CardHeader.tsx.snap +0 -74
  884. package/src/card/__tests__/__snapshots__/CardSubtitle.tsx.snap +0 -18
  885. package/src/card/__tests__/__snapshots__/CardTitle.tsx.snap +0 -18
  886. package/src/card/__tests__/__snapshots__/ClickableCard.tsx.snap +0 -20
  887. package/src/card/__tests__/__snapshots__/styles.ts.snap +0 -13
  888. package/src/card/__tests__/styles.ts +0 -45
  889. package/src/card/_card.scss +0 -189
  890. package/src/chip/__tests__/Chip.tsx +0 -327
  891. package/src/chip/__tests__/__snapshots__/Chip.tsx.snap +0 -597
  892. package/src/chip/__tests__/__snapshots__/styles.ts.snap +0 -5
  893. package/src/chip/__tests__/styles.ts +0 -14
  894. package/src/chip/_chip.scss +0 -324
  895. package/src/dialog/__tests__/Dialog.tsx +0 -316
  896. package/src/dialog/__tests__/DialogContent.tsx +0 -53
  897. package/src/dialog/__tests__/DialogFooter.tsx +0 -70
  898. package/src/dialog/__tests__/DialogHeader.tsx +0 -37
  899. package/src/dialog/__tests__/DialogTitle.tsx +0 -41
  900. package/src/dialog/__tests__/__snapshots__/Dialog.tsx.snap +0 -84
  901. package/src/dialog/__tests__/__snapshots__/DialogContent.tsx.snap +0 -36
  902. package/src/dialog/__tests__/__snapshots__/DialogFooter.tsx.snap +0 -186
  903. package/src/dialog/__tests__/__snapshots__/DialogHeader.tsx.snap +0 -18
  904. package/src/dialog/__tests__/__snapshots__/DialogTitle.tsx.snap +0 -26
  905. package/src/dialog/_dialog.scss +0 -273
  906. package/src/divider/__tests__/Divider.tsx +0 -36
  907. package/src/divider/__tests__/__snapshots__/Divider.tsx.snap +0 -26
  908. package/src/divider/_divider.scss +0 -124
  909. package/src/draggable/__tests__/__snapshots__/useDraggable.tsx.snap +0 -49
  910. package/src/draggable/__tests__/useDraggable.tsx +0 -540
  911. package/src/draggable/_draggable.scss +0 -29
  912. package/src/expansion-panel/__tests__/ExpansionPanel.tsx +0 -290
  913. package/src/expansion-panel/__tests__/__snapshots__/ExpansionPanel.tsx.snap +0 -197
  914. package/src/expansion-panel/_expansion-panel.scss +0 -107
  915. package/src/focus/__tests__/useFocusContainer.tsx +0 -280
  916. package/src/form/__tests__/Checkbox.tsx +0 -42
  917. package/src/form/__tests__/Fieldset.tsx +0 -44
  918. package/src/form/__tests__/FileInput.tsx +0 -120
  919. package/src/form/__tests__/Label.tsx +0 -69
  920. package/src/form/__tests__/Legend.tsx +0 -34
  921. package/src/form/__tests__/MenuItemCheckbox.tsx +0 -53
  922. package/src/form/__tests__/MenuItemRadio.tsx +0 -53
  923. package/src/form/__tests__/Radio.tsx +0 -35
  924. package/src/form/__tests__/Select.tsx +0 -439
  925. package/src/form/__tests__/Switch.tsx +0 -152
  926. package/src/form/__tests__/TextArea.tsx +0 -433
  927. package/src/form/__tests__/TextField.tsx +0 -195
  928. package/src/form/__tests__/__snapshots__/Checkbox.tsx.snap +0 -99
  929. package/src/form/__tests__/__snapshots__/Fieldset.tsx.snap +0 -58
  930. package/src/form/__tests__/__snapshots__/FileInput.tsx.snap +0 -612
  931. package/src/form/__tests__/__snapshots__/Label.tsx.snap +0 -140
  932. package/src/form/__tests__/__snapshots__/Legend.tsx.snap +0 -30
  933. package/src/form/__tests__/__snapshots__/MenuItemCheckbox.tsx.snap +0 -96
  934. package/src/form/__tests__/__snapshots__/MenuItemRadio.tsx.snap +0 -96
  935. package/src/form/__tests__/__snapshots__/Radio.tsx.snap +0 -99
  936. package/src/form/__tests__/__snapshots__/Select.tsx.snap +0 -492
  937. package/src/form/__tests__/__snapshots__/Switch.tsx.snap +0 -428
  938. package/src/form/__tests__/__snapshots__/TextArea.tsx.snap +0 -548
  939. package/src/form/__tests__/__snapshots__/TextField.tsx.snap +0 -279
  940. package/src/form/__tests__/__snapshots__/useCheckboxGroup.tsx.snap +0 -481
  941. package/src/form/__tests__/__snapshots__/useRadioGroup.tsx.snap +0 -704
  942. package/src/form/__tests__/useCheckboxGroup.tsx +0 -292
  943. package/src/form/__tests__/useFileUpload.tsx +0 -289
  944. package/src/form/__tests__/useFormReset.tsx +0 -194
  945. package/src/form/__tests__/useRadioGroup.tsx +0 -227
  946. package/src/form/__tests__/utils.ts +0 -247
  947. package/src/form/_form.scss +0 -2190
  948. package/src/icon/__tests__/FontIcon.tsx +0 -45
  949. package/src/icon/__tests__/IconRotator.tsx +0 -120
  950. package/src/icon/__tests__/MaterialIcon.tsx +0 -79
  951. package/src/icon/__tests__/MaterialSymbol.tsx +0 -100
  952. package/src/icon/__tests__/SVGIcon.tsx +0 -40
  953. package/src/icon/__tests__/TextIconSpacing.tsx +0 -108
  954. package/src/icon/__tests__/__snapshots__/FontIcon.tsx.snap +0 -35
  955. package/src/icon/__tests__/__snapshots__/IconRotator.tsx.snap +0 -165
  956. package/src/icon/__tests__/__snapshots__/MaterialIcon.tsx.snap +0 -82
  957. package/src/icon/__tests__/__snapshots__/MaterialSymbol.tsx.snap +0 -42
  958. package/src/icon/__tests__/__snapshots__/SVGIcon.tsx.snap +0 -47
  959. package/src/icon/__tests__/__snapshots__/TextIconSpacing.tsx.snap +0 -101
  960. package/src/icon/__tests__/__snapshots__/styles.ts.snap +0 -29
  961. package/src/icon/__tests__/styles.ts +0 -28
  962. package/src/icon/_icon.scss +0 -213
  963. package/src/interaction/__tests__/UserInteractionModeProvider.tsx +0 -121
  964. package/src/interaction/__tests__/__snapshots__/useHigherContrastChildren.tsx.snap +0 -79
  965. package/src/interaction/__tests__/useHigherContrastChildren.tsx +0 -97
  966. package/src/interaction/_interaction.scss +0 -436
  967. package/src/layout/__tests__/LayoutAppBar.tsx +0 -117
  968. package/src/layout/__tests__/LayoutNav.tsx +0 -78
  969. package/src/layout/__tests__/LayoutWindowSplitter.tsx +0 -63
  970. package/src/layout/__tests__/Main.tsx +0 -51
  971. package/src/layout/__tests__/__snapshots__/LayoutAppBar.tsx.snap +0 -78
  972. package/src/layout/__tests__/__snapshots__/LayoutNav.tsx.snap +0 -31
  973. package/src/layout/__tests__/__snapshots__/LayoutWindowSplitter.tsx.snap +0 -60
  974. package/src/layout/__tests__/__snapshots__/Main.tsx.snap +0 -32
  975. package/src/layout/__tests__/__snapshots__/useExpandableLayout.tsx.snap +0 -116
  976. package/src/layout/__tests__/__snapshots__/useLayoutTree.tsx.snap +0 -676
  977. package/src/layout/__tests__/__snapshots__/useResizableLayout.tsx.snap +0 -95
  978. package/src/layout/__tests__/__snapshots__/useTemporaryLayout.tsx.snap +0 -141
  979. package/src/layout/__tests__/useExpandableLayout.tsx +0 -279
  980. package/src/layout/__tests__/useLayoutTree.tsx +0 -212
  981. package/src/layout/__tests__/useResizableLayout.tsx +0 -170
  982. package/src/layout/__tests__/useTemporaryLayout.tsx +0 -109
  983. package/src/layout/_layout.scss +0 -163
  984. package/src/link/__tests__/Link.tsx +0 -31
  985. package/src/link/__tests__/SkipToMainContent.tsx +0 -125
  986. package/src/link/__tests__/__snapshots__/Link.tsx.snap +0 -20
  987. package/src/link/__tests__/__snapshots__/SkipToMainContent.tsx.snap +0 -22
  988. package/src/link/_link.scss +0 -149
  989. package/src/list/__tests__/List.tsx +0 -58
  990. package/src/list/__tests__/ListItem.tsx +0 -280
  991. package/src/list/__tests__/ListItemLink.tsx +0 -89
  992. package/src/list/__tests__/ListSubheader.tsx +0 -81
  993. package/src/list/__tests__/__snapshots__/List.tsx.snap +0 -41
  994. package/src/list/__tests__/__snapshots__/ListItem.tsx.snap +0 -414
  995. package/src/list/__tests__/__snapshots__/ListItemLink.tsx.snap +0 -73
  996. package/src/list/__tests__/__snapshots__/ListSubheader.tsx.snap +0 -99
  997. package/src/list/__tests__/getListItemHeight.ts +0 -176
  998. package/src/list/_list.scss +0 -322
  999. package/src/media-queries/__tests__/AppSizeProvider.node.tsx +0 -37
  1000. package/src/media-queries/__tests__/AppSizeProvider.tsx +0 -119
  1001. package/src/media-queries/__tests__/useMediaQuery.node.tsx +0 -20
  1002. package/src/media-queries/__tests__/useMediaQuery.tsx +0 -59
  1003. package/src/media-queries/_media-queries.scss +0 -63
  1004. package/src/menu/__tests__/DropdownMenu.tsx +0 -627
  1005. package/src/menu/__tests__/MenuBar.tsx +0 -354
  1006. package/src/menu/__tests__/MenuItemCircularProgress.tsx +0 -39
  1007. package/src/menu/__tests__/MenuVisibilityProvider.tsx +0 -34
  1008. package/src/menu/__tests__/__snapshots__/DropdownMenu.tsx.snap +0 -292
  1009. package/src/menu/__tests__/__snapshots__/MenuBar.tsx.snap +0 -87
  1010. package/src/menu/__tests__/__snapshots__/MenuItemCircularProgress.tsx.snap +0 -68
  1011. package/src/menu/__tests__/__snapshots__/useContextMenu.tsx.snap +0 -54
  1012. package/src/menu/__tests__/useContextMenu.tsx +0 -41
  1013. package/src/menu/__tests__/utils.ts +0 -121
  1014. package/src/menu/_menu.scss +0 -116
  1015. package/src/movement/__tests__/findMatchIndex.ts +0 -244
  1016. package/src/movement/__tests__/utils.ts +0 -710
  1017. package/src/navigation/__tests__/Navigation.tsx +0 -97
  1018. package/src/navigation/__tests__/__snapshots__/Navigation.tsx.snap +0 -165
  1019. package/src/navigation/_navigation.scss +0 -99
  1020. package/src/overlay/__tests__/Overlay.tsx +0 -198
  1021. package/src/overlay/__tests__/__snapshots__/Overlay.tsx.snap +0 -77
  1022. package/src/overlay/_overlay.scss +0 -74
  1023. package/src/portal/__tests__/PortalContainerProvider.node.tsx +0 -26
  1024. package/src/portal/__tests__/PortalContainerProvider.tsx +0 -84
  1025. package/src/positioning/__tests__/__snapshots__/useFixedPositioning.tsx.snap +0 -87
  1026. package/src/positioning/__tests__/createHorizontalPosition.ts +0 -777
  1027. package/src/positioning/__tests__/createVerticalPosition.ts +0 -464
  1028. package/src/positioning/__tests__/useFixedPositioning.tsx +0 -205
  1029. package/src/positioning/__tests__/utils.ts +0 -1311
  1030. package/src/progress/__tests__/CircularProgress.tsx +0 -153
  1031. package/src/progress/__tests__/LinearProgress.tsx +0 -131
  1032. package/src/progress/__tests__/__snapshots__/CircularProgress.tsx.snap +0 -499
  1033. package/src/progress/__tests__/__snapshots__/LinearProgress.tsx.snap +0 -321
  1034. package/src/progress/__tests__/getProgressA11y.ts +0 -16
  1035. package/src/progress/_progress.scss +0 -577
  1036. package/src/responsive-item/__tests__/ResponsiveItemContainer.tsx +0 -56
  1037. package/src/responsive-item/__tests__/ResponsiveItemOverlay.tsx +0 -66
  1038. package/src/responsive-item/__tests__/__snapshots__/ResponsiveItemContainer.tsx.snap +0 -85
  1039. package/src/responsive-item/__tests__/__snapshots__/ResponsiveItemOverlay.tsx.snap +0 -151
  1040. package/src/responsive-item/__tests__/__snapshots__/styles.ts.snap +0 -9
  1041. package/src/responsive-item/__tests__/styles.ts +0 -32
  1042. package/src/responsive-item/_responsive-item.scss +0 -199
  1043. package/src/searching/__tests__/caseInsensitive.ts +0 -165
  1044. package/src/searching/__tests__/fuzzy.ts +0 -169
  1045. package/src/searching/__tests__/toSearchQuery.ts +0 -21
  1046. package/src/searching/__tests__/useFuzzyMatch.tsx +0 -200
  1047. package/src/segmented-button/__tests__/SegmentedButton.tsx +0 -61
  1048. package/src/segmented-button/__tests__/SegmentedButtonContainer.tsx +0 -38
  1049. package/src/segmented-button/__tests__/__snapshots__/SegmentedButton.tsx.snap +0 -116
  1050. package/src/segmented-button/__tests__/__snapshots__/SegmentedButtonContainer.tsx.snap +0 -22
  1051. package/src/segmented-button/_segmented-button.scss +0 -208
  1052. package/src/sheet/_sheet.scss +0 -189
  1053. package/src/snackbar/__tests__/Snackbar.tsx +0 -85
  1054. package/src/snackbar/__tests__/Toast.tsx +0 -105
  1055. package/src/snackbar/__tests__/ToastActionButton.tsx +0 -112
  1056. package/src/snackbar/__tests__/ToastCloseButton.tsx +0 -140
  1057. package/src/snackbar/__tests__/ToastContent.tsx +0 -88
  1058. package/src/snackbar/__tests__/ToastManagerProvider.tsx +0 -852
  1059. package/src/snackbar/__tests__/__snapshots__/Snackbar.tsx.snap +0 -176
  1060. package/src/snackbar/__tests__/__snapshots__/Toast.tsx.snap +0 -52
  1061. package/src/snackbar/__tests__/__snapshots__/ToastActionButton.tsx.snap +0 -36
  1062. package/src/snackbar/__tests__/__snapshots__/ToastCloseButton.tsx.snap +0 -104
  1063. package/src/snackbar/__tests__/__snapshots__/ToastContent.tsx.snap +0 -26
  1064. package/src/snackbar/__tests__/__snapshots__/ToastManagerProvider.tsx.snap +0 -290
  1065. package/src/snackbar/_snackbar.scss +0 -266
  1066. package/src/suspense/__tests__/CircularProgressSuspense.tsx +0 -90
  1067. package/src/suspense/__tests__/NullSuspense.tsx +0 -46
  1068. package/src/suspense/__tests__/__snapshots__/CircularProgressSuspense.tsx.snap +0 -24
  1069. package/src/table/__tests__/Table.tsx +0 -314
  1070. package/src/table/__tests__/TableBody.tsx +0 -52
  1071. package/src/table/__tests__/TableCheckbox.tsx +0 -89
  1072. package/src/table/__tests__/TableContainer.tsx +0 -31
  1073. package/src/table/__tests__/TableRadio.tsx +0 -112
  1074. package/src/table/__tests__/TableRow.tsx +0 -63
  1075. package/src/table/__tests__/__snapshots__/Table.tsx.snap +0 -2426
  1076. package/src/table/__tests__/__snapshots__/TableBody.tsx.snap +0 -54
  1077. package/src/table/__tests__/__snapshots__/TableCheckbox.tsx.snap +0 -142
  1078. package/src/table/__tests__/__snapshots__/TableContainer.tsx.snap +0 -16
  1079. package/src/table/__tests__/__snapshots__/TableRadio.tsx.snap +0 -138
  1080. package/src/table/__tests__/__snapshots__/TableRow.tsx.snap +0 -56
  1081. package/src/table/__tests__/__snapshots__/tableContainerStyles.ts.snap +0 -3
  1082. package/src/table/__tests__/__snapshots__/tableRowStyles.ts.snap +0 -3
  1083. package/src/table/__tests__/__snapshots__/tableStyles.ts.snap +0 -3
  1084. package/src/table/__tests__/tableContainerStyles.ts +0 -8
  1085. package/src/table/__tests__/tableRowStyles.ts +0 -8
  1086. package/src/table/__tests__/tableStyles.ts +0 -8
  1087. package/src/table/_table.scss +0 -447
  1088. package/src/tabs/__tests__/Tab.tsx +0 -51
  1089. package/src/tabs/__tests__/TabList.tsx +0 -640
  1090. package/src/tabs/__tests__/__snapshots__/Tab.tsx.snap +0 -85
  1091. package/src/tabs/__tests__/__snapshots__/TabList.tsx.snap +0 -51
  1092. package/src/tabs/__tests__/useTabs.tsx +0 -212
  1093. package/src/tabs/_tabs.scss +0 -273
  1094. package/src/test-utils/__tests__/ResizeObserver.ts +0 -171
  1095. package/src/theme/__tests__/LocalStorageColorSchemeProvider.tsx +0 -162
  1096. package/src/theme/__tests__/ThemeProvider.tsx +0 -90
  1097. package/src/theme/__tests__/__snapshots__/useCSSVariables.tsx.snap +0 -27
  1098. package/src/theme/__tests__/__snapshots__/useColorSchemeMetaTag.tsx.snap +0 -15
  1099. package/src/theme/__tests__/useCSSVariables.tsx +0 -177
  1100. package/src/theme/__tests__/useColorSchemeMetaTag.tsx +0 -36
  1101. package/src/theme/__tests__/utils.ts +0 -67
  1102. package/src/theme/_a11y.scss +0 -114
  1103. package/src/theme/_colors.scss +0 -1057
  1104. package/src/theme/_theme.scss +0 -519
  1105. package/src/tooltip/__tests__/Tooltip.tsx +0 -501
  1106. package/src/tooltip/__tests__/TooltipHoverModeProvider.tsx +0 -94
  1107. package/src/tooltip/__tests__/__snapshots__/Tooltip.tsx.snap +0 -34
  1108. package/src/tooltip/__tests__/utils.ts +0 -94
  1109. package/src/tooltip/_tooltip.scss +0 -155
  1110. package/src/transition/__tests__/CSSTransition.tsx +0 -182
  1111. package/src/transition/__tests__/Collapse.tsx +0 -209
  1112. package/src/transition/__tests__/CrossFade.tsx +0 -227
  1113. package/src/transition/__tests__/ScaleTransition.tsx +0 -204
  1114. package/src/transition/__tests__/SkeletonPlaceholder.tsx +0 -72
  1115. package/src/transition/__tests__/__snapshots__/CSSTransition.tsx.snap +0 -145
  1116. package/src/transition/__tests__/__snapshots__/Collapse.tsx.snap +0 -224
  1117. package/src/transition/__tests__/__snapshots__/CrossFade.tsx.snap +0 -240
  1118. package/src/transition/__tests__/__snapshots__/ScaleTransition.tsx.snap +0 -239
  1119. package/src/transition/__tests__/__snapshots__/SkeletonPlaceholder.tsx.snap +0 -24
  1120. package/src/transition/__tests__/__snapshots__/useCollapseTransition.tsx.snap +0 -361
  1121. package/src/transition/__tests__/__snapshots__/useCrossFadeTransition.tsx.snap +0 -258
  1122. package/src/transition/__tests__/__snapshots__/useMaxWidthTransition.tsx.snap +0 -68
  1123. package/src/transition/__tests__/__snapshots__/useScaleTransition.tsx.snap +0 -209
  1124. package/src/transition/__tests__/useCSSTransition.tsx +0 -190
  1125. package/src/transition/__tests__/useCollapseTransition.tsx +0 -316
  1126. package/src/transition/__tests__/useCrossFadeTransition.tsx +0 -229
  1127. package/src/transition/__tests__/useMaxWidthTransition.tsx +0 -123
  1128. package/src/transition/__tests__/useScaleTransition.tsx +0 -212
  1129. package/src/transition/__tests__/useTransition.tsx +0 -569
  1130. package/src/transition/__tests__/utils.ts +0 -620
  1131. package/src/transition/_transition.scss +0 -365
  1132. package/src/tree/__tests__/Tree.tsx +0 -735
  1133. package/src/tree/__tests__/TreeGroup.tsx +0 -76
  1134. package/src/tree/__tests__/TreeItemExpander.tsx +0 -74
  1135. package/src/tree/__tests__/__snapshots__/Tree.tsx.snap +0 -3618
  1136. package/src/tree/__tests__/__snapshots__/TreeItemExpander.tsx.snap +0 -11
  1137. package/src/tree/__tests__/utils.ts +0 -98
  1138. package/src/tree/_tree.scss +0 -176
  1139. package/src/typography/__tests__/SrOnly.tsx +0 -43
  1140. package/src/typography/__tests__/TextContainer.tsx +0 -45
  1141. package/src/typography/__tests__/Typography.tsx +0 -87
  1142. package/src/typography/__tests__/WritingDirectionProvider.node.tsx +0 -27
  1143. package/src/typography/__tests__/WritingDirectionProvider.tsx +0 -119
  1144. package/src/typography/__tests__/__snapshots__/SrOnly.tsx.snap +0 -56
  1145. package/src/typography/__tests__/__snapshots__/TextContainer.tsx.snap +0 -29
  1146. package/src/typography/__tests__/__snapshots__/Typography.tsx.snap +0 -112
  1147. package/src/typography/_typography.scss +0 -399
  1148. package/src/utils/__tests__/RenderRecursively.tsx +0 -87
  1149. package/src/utils/__tests__/__snapshots__/RenderRecursively.tsx.snap +0 -80
  1150. package/src/utils/__tests__/applyRef.ts +0 -30
  1151. package/src/utils/__tests__/bem.ts +0 -54
  1152. package/src/utils/__tests__/getMiddleOfRange.ts +0 -12
  1153. package/src/utils/__tests__/getPercentage.ts +0 -104
  1154. package/src/utils/__tests__/getRangeDefaultValue.ts +0 -47
  1155. package/src/utils/__tests__/getRangeSteps.ts +0 -14
  1156. package/src/utils/__tests__/loop.ts +0 -50
  1157. package/src/utils/__tests__/nearest.ts +0 -83
  1158. package/src/utils/__tests__/parseCssLengthUnit.node.ts +0 -28
  1159. package/src/utils/__tests__/parseCssLengthUnit.ts +0 -47
  1160. package/src/utils/__tests__/wait.ts +0 -12
  1161. package/src/utils/__tests__/withinRange.ts +0 -24
  1162. package/src/window-splitter/_window-splitter.scss +0 -143
  1163. package/tsconfig.json +0 -19
  1164. package/tsconfig.types.json +0 -12
  1165. package/tsdoc.json +0 -14
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/DropdownMenu.tsx"],"sourcesContent":["\"use client\";\nimport {\n useCallback,\n useRef,\n type ReactElement,\n type ReactNode,\n type RefObject,\n} from \"react\";\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\nimport { getLastFocusableIndex } from \"../movement/utils.js\";\nimport { type UseStateSetter } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useEnsuredState } from \"../useEnsuredState.js\";\nimport {\n Menu,\n type MenuConvenienceProps,\n type MenuListConvenienceProps,\n} from \"./Menu.js\";\nimport { MenuButton, type MenuButtonProps } from \"./MenuButton.js\";\nimport {\n MenuConfigurationProvider,\n type MenuConfiguration,\n} from \"./MenuConfigurationProvider.js\";\nimport { MenuItemButton, type MenuItemButtonProps } from \"./MenuItemButton.js\";\nimport { type MenuSheetConvenienceProps } from \"./MenuSheet.js\";\nimport { MenuVisibilityProvider } from \"./MenuVisibilityProvider.js\";\nimport { useMenuBarContext } from \"./useMenuBarProvider.js\";\n\nexport interface BaseDropdownMenuProps\n extends MenuConfiguration,\n MenuListConvenienceProps,\n MenuSheetConvenienceProps,\n MenuConvenienceProps {\n buttonChildren: ReactNode;\n}\n\nexport interface DropdownMenuButtonProps\n extends MenuButtonProps,\n BaseDropdownMenuProps {}\n\nexport interface DropdownMenuItemButtonProps\n extends MenuItemButtonProps,\n BaseDropdownMenuProps {}\n\n/**\n * @since 6.0.0\n */\nexport interface DropdownMenuStateProps {\n visible: boolean;\n setVisible: UseStateSetter<boolean>;\n}\n\n/**\n * @since 5.0.0\n * @since 6.0.0 Updated to use an `&` instead of `|` to allow autocompletion to\n * work better by default. It's up to the user to make sure they don't provide\n * incorrect props.\n */\nexport type DropdownMenuProps = DropdownMenuButtonProps &\n DropdownMenuItemButtonProps &\n (DropdownMenuStateProps | { visible?: never; setVisible?: never });\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { DropdownMenu, MenuItem } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <DropdownMenu buttonChildren=\"Dropdown\">\n * <MenuItem onClick={() => console.log('Clicked Item 1')}>\n * Item 1\n * </MenuItem>\n * <MenuItem onClick={() => console.log('Clicked Item 2')}>\n * Item 2\n * </MenuItem>\n * </DropdownMenu>\n * );\n * }\n * ```\n *\n * @example Nested Dropdown Menus\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { DropdownMenu, MenuItem } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <DropdownMenu buttonChildren=\"Dropdown\">\n * <MenuItem onClick={() => console.log('Clicked Item 1')}>\n * Item 1\n * </MenuItem>\n * <MenuItem onClick={() => console.log('Clicked Item 2')}>\n * Item 2\n * </MenuItem>\n * <DropdownMenu buttonChildren=\"Nested Dropdown\">\n * <MenuItem onClick={() => console.log('Clicked Item 1')}>\n * Nested Item 1\n * </MenuItem>\n * <MenuItem onClick={() => console.log('Clicked Item 2')}>\n * Nested Item 2\n * </MenuItem>\n * </DropdownMenu>\n * </DropdownMenu>\n * );\n * }\n * ```\n *\n * @since 5.0.0\n * @since 6.0.0 Updated to use the latest menu API.\n */\nexport function DropdownMenu(props: DropdownMenuProps): ReactElement {\n const {\n id: propId,\n horizontal,\n sheetHeader,\n sheetFooter,\n renderAsSheet,\n sheetPosition,\n sheetVerticalSize,\n buttonChildren,\n iconRotatorProps: propIconRotatorProps,\n disableTransition: propDisableTransition,\n floating,\n anchor,\n vwMargin,\n vhMargin,\n xMargin,\n yMargin,\n initialX,\n initialY,\n width,\n transformOrigin,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n preventScroll,\n closeOnResize,\n closeOnScroll,\n getFixedPositionOptions,\n children,\n temporary,\n disablePortal,\n disableElevation,\n menuProps,\n menuStyle,\n menuClassName,\n sheetProps,\n sheetStyle,\n sheetClassName,\n visible: propVisible,\n setVisible: propSetVisible,\n ...remaining\n } = props;\n\n const fixedTo = useRef<HTMLElement | HTMLButtonElement>(null);\n const defaultFocusIndex = useRef(0);\n const [visible, setVisible] = useEnsuredState({\n value: propVisible,\n setValue: propSetVisible,\n defaultValue: false,\n });\n const { menubar, menuitem, activeIdRef, animatedOnceRef } =\n useMenuBarContext();\n const id = useEnsuredId(propId, `menu${menuitem ? \"item\" : \"button\"}`);\n const mode = useUserInteractionMode();\n const mouse = mode === \"mouse\";\n const keyboard = mode === \"keyboard\";\n const disableTransition =\n propDisableTransition ??\n (animatedOnceRef.current &&\n menubar &&\n !!activeIdRef.current &&\n (mouse || keyboard));\n\n const onRequestClose = useCallback(() => {\n setVisible(false);\n }, [setVisible]);\n\n let iconRotatorProps = propIconRotatorProps;\n if (disableTransition) {\n iconRotatorProps = {\n disableTransition,\n ...propIconRotatorProps,\n };\n }\n\n let toggle: ReactElement;\n if (menuitem) {\n toggle = (\n <MenuItemButton\n {...(remaining as DropdownMenuItemButtonProps)}\n id={id}\n ref={fixedTo as RefObject<HTMLLIElement>}\n iconRotatorProps={iconRotatorProps}\n >\n {buttonChildren}\n </MenuItemButton>\n );\n } else {\n toggle = (\n <MenuButton\n {...(remaining as DropdownMenuButtonProps)}\n id={id}\n ref={fixedTo as RefObject<HTMLButtonElement>}\n floating={floating}\n iconRotatorProps={iconRotatorProps}\n >\n {buttonChildren}\n </MenuButton>\n );\n }\n\n return (\n <MenuVisibilityProvider\n visible={visible}\n setVisible={setVisible}\n defaultFocusIndex={defaultFocusIndex}\n >\n <MenuConfigurationProvider\n horizontal={horizontal}\n renderAsSheet={renderAsSheet}\n sheetFooter={sheetFooter}\n sheetHeader={sheetHeader}\n sheetPosition={sheetPosition}\n sheetVerticalSize={sheetVerticalSize}\n >\n {toggle}\n </MenuConfigurationProvider>\n <Menu\n aria-labelledby={(menuProps?.[\"aria-label\"] ? undefined : id) as string}\n style={menuStyle}\n className={menuClassName}\n sheetProps={sheetProps}\n sheetStyle={sheetStyle}\n sheetClassName={sheetClassName}\n temporary={temporary}\n disablePortal={disablePortal}\n disableElevation={disableElevation}\n disableTransition={disableTransition}\n floating={floating}\n anchor={anchor}\n vwMargin={vwMargin}\n vhMargin={vhMargin}\n xMargin={xMargin}\n yMargin={yMargin}\n initialX={initialX}\n initialY={initialY}\n width={width}\n transformOrigin={transformOrigin}\n preventOverlap={preventOverlap}\n disableSwapping={disableSwapping}\n disableVHBounds={disableVHBounds}\n preventScroll={preventScroll}\n closeOnResize={closeOnResize}\n closeOnScroll={closeOnScroll}\n getFixedPositionOptions={getFixedPositionOptions}\n horizontal={horizontal}\n sheetHeader={sheetHeader}\n sheetFooter={sheetFooter}\n renderAsSheet={renderAsSheet}\n sheetPosition={sheetPosition}\n sheetVerticalSize={sheetVerticalSize}\n {...menuProps}\n fixedTo={fixedTo}\n visible={visible}\n getDefaultFocusedIndex={(options) => {\n const defaultIndex = defaultFocusIndex.current;\n if (defaultIndex < 0) {\n return getLastFocusableIndex(options);\n }\n\n return defaultIndex;\n }}\n onRequestClose={onRequestClose}\n onEntered={(appearing) => {\n menuProps?.onEntered?.(appearing);\n // this will be called before `getDefaultFocusedIndex`\n if (disableTransition) {\n return;\n }\n\n defaultFocusIndex.current = 0;\n }}\n >\n {children}\n </Menu>\n </MenuVisibilityProvider>\n );\n}\n"],"names":["useCallback","useRef","useUserInteractionMode","getLastFocusableIndex","useEnsuredId","useEnsuredState","Menu","MenuButton","MenuConfigurationProvider","MenuItemButton","MenuVisibilityProvider","useMenuBarContext","DropdownMenu","props","id","propId","horizontal","sheetHeader","sheetFooter","renderAsSheet","sheetPosition","sheetVerticalSize","buttonChildren","iconRotatorProps","propIconRotatorProps","disableTransition","propDisableTransition","floating","anchor","vwMargin","vhMargin","xMargin","yMargin","initialX","initialY","width","transformOrigin","preventOverlap","disableSwapping","disableVHBounds","preventScroll","closeOnResize","closeOnScroll","getFixedPositionOptions","children","temporary","disablePortal","disableElevation","menuProps","menuStyle","menuClassName","sheetProps","sheetStyle","sheetClassName","visible","propVisible","setVisible","propSetVisible","remaining","fixedTo","defaultFocusIndex","value","setValue","defaultValue","menubar","menuitem","activeIdRef","animatedOnceRef","mode","mouse","keyboard","current","onRequestClose","toggle","ref","aria-labelledby","undefined","style","className","getDefaultFocusedIndex","options","defaultIndex","onEntered","appearing"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AYA;gBACZC,gBAAgBA;gBAChBR,WAAWA;gBACXC,eAAeA;gBACfC,kBAAkBA;gBAClBtB,mBAAmBA;gBACnBE,UAAUA;gBACVC,QAAQA;gBACRC,UAAUA;gBACVC,UAAUA;gBACVC,SAASA;gBACTC,SAASA;gBACTC,UAAUA;gBACVC,UAAUA;gBACVC,OAAOA;gBACPC,iBAAiBA;gBACjBC,gBAAgBA;gBAChBC,iBAAiBA;gBACjBC,iBAAiBA;gBACjBC,eAAeA;gBACfC,eAAeA;gBACfC,eAAeA;gBACfC,yBAAyBA;gBACzB3B,YAAYA;gBACZC,aAAaA;gBACbC,aAAaA;gBACbC,eAAeA;gBACfC,eAAeA;gBACfC,mBAAmBA;gBAClB,GAAG2B,SAAS;gBACbW,SAASA;gBACTL,SAASA;gBACTyB,wBAAwB,CAACC;oBACvB,MAAMC,eAAerB,kBAAkBW,OAAO;oBAC9C,IAAIU,eAAe,GAAG;wBACpB,OAAO9E,sBAAsB6E;oBAC/B;oBAEA,OAAOC;gBACT;gBACAT,gBAAgBA;gBAChBU,WAAW,CAACC;oBACVnC,WAAWkC,YAAYC;oBACvB,sDAAsD;oBACtD,IAAI1D,mBAAmB;wBACrB;oBACF;oBAEAmC,kBAAkBW,OAAO,GAAG;gBAC9B;0BAEC3B;;;;AAIT"}
1
+ {"version":3,"sources":["../../src/menu/DropdownMenu.tsx"],"sourcesContent":["\"use client\";\nimport {\n useCallback,\n useRef,\n type ReactElement,\n type ReactNode,\n type RefObject,\n} from \"react\";\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\nimport { getLastFocusableIndex } from \"../movement/utils.js\";\nimport { type UseStateSetter } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useEnsuredState } from \"../useEnsuredState.js\";\nimport {\n Menu,\n type MenuConvenienceProps,\n type MenuListConvenienceProps,\n} from \"./Menu.js\";\nimport { MenuButton, type MenuButtonProps } from \"./MenuButton.js\";\nimport {\n MenuConfigurationProvider,\n type MenuConfiguration,\n} from \"./MenuConfigurationProvider.js\";\nimport { MenuItemButton, type MenuItemButtonProps } from \"./MenuItemButton.js\";\nimport { type MenuSheetConvenienceProps } from \"./MenuSheet.js\";\nimport { MenuVisibilityProvider } from \"./MenuVisibilityProvider.js\";\nimport { useMenuBarContext } from \"./useMenuBarProvider.js\";\n\nexport interface BaseDropdownMenuProps\n extends MenuConfiguration,\n MenuListConvenienceProps,\n MenuSheetConvenienceProps,\n MenuConvenienceProps {\n buttonChildren: ReactNode;\n}\n\nexport interface DropdownMenuButtonProps\n extends MenuButtonProps,\n BaseDropdownMenuProps {}\n\nexport interface DropdownMenuItemButtonProps\n extends MenuItemButtonProps,\n BaseDropdownMenuProps {}\n\n/**\n * @since 6.0.0\n */\nexport interface DropdownMenuStateProps {\n visible: boolean;\n setVisible: UseStateSetter<boolean>;\n}\n\n/**\n * @since 5.0.0\n * @since 6.0.0 Updated to use an `&` instead of `|` to allow autocompletion to\n * work better by default. It's up to the user to make sure they don't provide\n * incorrect props.\n */\nexport type DropdownMenuProps = DropdownMenuButtonProps &\n DropdownMenuItemButtonProps &\n (DropdownMenuStateProps | { visible?: never; setVisible?: never });\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { DropdownMenu, MenuItem } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <DropdownMenu buttonChildren=\"Dropdown\">\n * <MenuItem onClick={() => console.log('Clicked Item 1')}>\n * Item 1\n * </MenuItem>\n * <MenuItem onClick={() => console.log('Clicked Item 2')}>\n * Item 2\n * </MenuItem>\n * </DropdownMenu>\n * );\n * }\n * ```\n *\n * @example Nested Dropdown Menus\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { DropdownMenu, MenuItem } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <DropdownMenu buttonChildren=\"Dropdown\">\n * <MenuItem onClick={() => console.log('Clicked Item 1')}>\n * Item 1\n * </MenuItem>\n * <MenuItem onClick={() => console.log('Clicked Item 2')}>\n * Item 2\n * </MenuItem>\n * <DropdownMenu buttonChildren=\"Nested Dropdown\">\n * <MenuItem onClick={() => console.log('Clicked Item 1')}>\n * Nested Item 1\n * </MenuItem>\n * <MenuItem onClick={() => console.log('Clicked Item 2')}>\n * Nested Item 2\n * </MenuItem>\n * </DropdownMenu>\n * </DropdownMenu>\n * );\n * }\n * ```\n *\n * @since 5.0.0\n * @since 6.0.0 Updated to use the latest menu API.\n */\nexport function DropdownMenu(props: DropdownMenuProps): ReactElement {\n const {\n id: propId,\n horizontal,\n sheetHeader,\n sheetFooter,\n renderAsSheet,\n sheetPosition,\n sheetVerticalSize,\n buttonChildren,\n iconRotatorProps: propIconRotatorProps,\n disableTransition: propDisableTransition,\n floating,\n anchor,\n vwMargin,\n vhMargin,\n xMargin,\n yMargin,\n initialX,\n initialY,\n width,\n transformOrigin,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n preventScroll,\n closeOnResize,\n closeOnScroll,\n getFixedPositionOptions,\n children,\n temporary,\n disablePortal,\n disableElevation,\n menuProps,\n menuStyle,\n menuClassName,\n sheetProps,\n sheetStyle,\n sheetClassName,\n visible: propVisible,\n setVisible: propSetVisible,\n ...remaining\n } = props;\n\n const fixedTo = useRef<HTMLElement | HTMLButtonElement>(null);\n const defaultFocusIndex = useRef(0);\n const [visible, setVisible] = useEnsuredState({\n value: propVisible,\n setValue: propSetVisible,\n defaultValue: false,\n });\n const { menubar, menuitem, activeIdRef, animatedOnceRef } =\n useMenuBarContext();\n const id = useEnsuredId(propId, `menu${menuitem ? \"item\" : \"button\"}`);\n const mode = useUserInteractionMode();\n const mouse = mode === \"mouse\";\n const keyboard = mode === \"keyboard\";\n const disableTransition =\n propDisableTransition ??\n (animatedOnceRef.current &&\n menubar &&\n !!activeIdRef.current &&\n (mouse || keyboard));\n\n const onRequestClose = useCallback(() => {\n setVisible(false);\n }, [setVisible]);\n\n let iconRotatorProps = propIconRotatorProps;\n if (disableTransition) {\n iconRotatorProps = {\n disableTransition,\n ...propIconRotatorProps,\n };\n }\n\n let toggle: ReactElement;\n if (menuitem) {\n toggle = (\n <MenuItemButton\n {...(remaining as DropdownMenuItemButtonProps)}\n id={id}\n ref={fixedTo as RefObject<HTMLLIElement>}\n iconRotatorProps={iconRotatorProps}\n >\n {buttonChildren}\n </MenuItemButton>\n );\n } else {\n toggle = (\n <MenuButton\n {...(remaining as DropdownMenuButtonProps)}\n id={id}\n ref={fixedTo as RefObject<HTMLButtonElement>}\n floating={floating}\n iconRotatorProps={iconRotatorProps}\n >\n {buttonChildren}\n </MenuButton>\n );\n }\n\n return (\n <MenuVisibilityProvider\n visible={visible}\n setVisible={setVisible}\n defaultFocusIndex={defaultFocusIndex}\n >\n <MenuConfigurationProvider\n horizontal={horizontal}\n renderAsSheet={renderAsSheet}\n sheetFooter={sheetFooter}\n sheetHeader={sheetHeader}\n sheetPosition={sheetPosition}\n sheetVerticalSize={sheetVerticalSize}\n >\n {toggle}\n </MenuConfigurationProvider>\n <Menu\n aria-labelledby={(menuProps?.[\"aria-label\"] ? undefined : id) as string}\n style={menuStyle}\n className={menuClassName}\n sheetProps={sheetProps}\n sheetStyle={sheetStyle}\n sheetClassName={sheetClassName}\n temporary={temporary}\n disablePortal={disablePortal}\n disableElevation={disableElevation}\n disableTransition={disableTransition}\n floating={floating}\n anchor={anchor}\n vwMargin={vwMargin}\n vhMargin={vhMargin}\n xMargin={xMargin}\n yMargin={yMargin}\n initialX={initialX}\n initialY={initialY}\n width={width}\n transformOrigin={transformOrigin}\n preventOverlap={preventOverlap}\n disableSwapping={disableSwapping}\n disableVHBounds={disableVHBounds}\n preventScroll={preventScroll}\n closeOnResize={closeOnResize}\n closeOnScroll={closeOnScroll}\n getFixedPositionOptions={getFixedPositionOptions}\n horizontal={horizontal}\n sheetHeader={sheetHeader}\n sheetFooter={sheetFooter}\n renderAsSheet={renderAsSheet}\n sheetPosition={sheetPosition}\n sheetVerticalSize={sheetVerticalSize}\n {...menuProps}\n fixedTo={fixedTo}\n visible={visible}\n getDefaultFocusedIndex={(options) => {\n const defaultIndex = defaultFocusIndex.current;\n if (defaultIndex < 0) {\n return getLastFocusableIndex(options);\n }\n\n return defaultIndex;\n }}\n onRequestClose={onRequestClose}\n onEntered={(appearing) => {\n menuProps?.onEntered?.(appearing);\n // this will be called before `getDefaultFocusedIndex`\n if (disableTransition) {\n return;\n }\n\n defaultFocusIndex.current = 0;\n }}\n >\n {children}\n </Menu>\n </MenuVisibilityProvider>\n );\n}\n"],"names":["useCallback","useRef","useUserInteractionMode","getLastFocusableIndex","useEnsuredId","useEnsuredState","Menu","MenuButton","MenuConfigurationProvider","MenuItemButton","MenuVisibilityProvider","useMenuBarContext","DropdownMenu","props","id","propId","horizontal","sheetHeader","sheetFooter","renderAsSheet","sheetPosition","sheetVerticalSize","buttonChildren","iconRotatorProps","propIconRotatorProps","disableTransition","propDisableTransition","floating","anchor","vwMargin","vhMargin","xMargin","yMargin","initialX","initialY","width","transformOrigin","preventOverlap","disableSwapping","disableVHBounds","preventScroll","closeOnResize","closeOnScroll","getFixedPositionOptions","children","temporary","disablePortal","disableElevation","menuProps","menuStyle","menuClassName","sheetProps","sheetStyle","sheetClassName","visible","propVisible","setVisible","propSetVisible","remaining","fixedTo","defaultFocusIndex","value","setValue","defaultValue","menubar","menuitem","activeIdRef","animatedOnceRef","mode","mouse","keyboard","current","onRequestClose","toggle","ref","aria-labelledby","undefined","style","className","getDefaultFocusedIndex","options","defaultIndex","onEntered","appearing"],"mappings":"AAAA;;AACA,SACEA,WAAW,EACXC,MAAM,QAID,QAAQ;AACf,SAASC,sBAAsB,QAAQ,gDAAgD;AACvF,SAASC,qBAAqB,QAAQ,uBAAuB;AAE7D,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,eAAe,QAAQ,wBAAwB;AACxD,SACEC,IAAI,QAGC,YAAY;AACnB,SAASC,UAAU,QAA8B,kBAAkB;AACnE,SACEC,yBAAyB,QAEpB,iCAAiC;A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fC,mBAAmBA;gBAClB,GAAG2B,SAAS;gBACbW,SAASA;gBACTL,SAASA;gBACTyB,wBAAwB,CAACC;oBACvB,MAAMC,eAAerB,kBAAkBW,OAAO;oBAC9C,IAAIU,eAAe,GAAG;wBACpB,OAAO9E,sBAAsB6E;oBAC/B;oBAEA,OAAOC;gBACT;gBACAT,gBAAgBA;gBAChBU,WAAW,CAACC;oBACVnC,WAAWkC,YAAYC;oBACvB,sDAAsD;oBACtD,IAAI1D,mBAAmB;wBACrB;oBACF;oBAEAmC,kBAAkBW,OAAO,GAAG;gBAC9B;0BAEC3B;;;;AAIT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/Menu.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n useEffect,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { type FloatingActionButtonPosition } from \"../button/FloatingActionButton.js\";\nimport { useFocusContainer } from \"../focus/useFocusContainer.js\";\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\nimport { type ListElement, type ListProps } from \"../list/List.js\";\nimport { useAppSize } from \"../media-queries/AppSizeProvider.js\";\nimport { type GetDefaultFocusedIndex } from \"../movement/types.js\";\nimport { Portal } from \"../portal/Portal.js\";\nimport { type CalculateFixedPositionOptions } from \"../positioning/types.js\";\nimport {\n useFixedPositioning,\n type FixedPositioningOptions,\n} from \"../positioning/useFixedPositioning.js\";\nimport { useScrollLock } from \"../scroll/useScrollLock.js\";\nimport {\n useScaleTransition,\n type ScaleTransitionHookOptions,\n} from \"../transition/useScaleTransition.js\";\nimport { type LabelRequiredForA11y, type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useIsomorphicLayoutEffect } from \"../useIsomorphicLayoutEffect.js\";\nimport {\n MenuConfigurationProvider,\n useMenuConfiguration,\n type MenuConfiguration,\n type MenuOrientationProps,\n} from \"./MenuConfigurationProvider.js\";\nimport { MenuSheet, type MenuSheetConvenienceProps } from \"./MenuSheet.js\";\nimport { MenuWidget } from \"./MenuWidget.js\";\nimport { useMenuBarContext } from \"./useMenuBarProvider.js\";\nimport { getDefaultAnchor } from \"./utils.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-menu-background-color\"?: string;\n \"--rmd-menu-color\"?: string;\n \"--rmd-menu-min-width\"?: string | number;\n \"--rmd-menu-spacing\"?: string | number;\n }\n}\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @since 5.0.0 */\nexport type MenuTransitionProps = Omit<\n ScaleTransitionHookOptions<HTMLDivElement>,\n \"transitionIn\" | \"vertical\" | \"nodeRef\"\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface MenuConfigurationProps extends CalculateFixedPositionOptions {\n /**\n * @see {@link ScaleTransitionHookOptions.temporary}\n * @defaultValue `true`\n */\n temporary?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disablePortal?: boolean;\n\n /**\n * Boolean if the menu should not gain the elevation styles and should only be\n * set to `true` when rendering within a `Sheet`.\n *\n * @defaultValue `false`\n */\n disableElevation?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * @see {@link FixedPositioningOptions.transformOrigin}\n * @defaultValue `true`\n */\n transformOrigin?: boolean;\n\n /**\n * Boolean if the menu should close if the page is scrolled. The default\n * behavior is to just update the position of the menu relative to the menu\n * button until it can no longer be visible within the viewport.\n *\n * @defaultValue `false`\n */\n closeOnScroll?: boolean;\n\n /**\n * Boolean if the page should no longer be scrollable while the menu is\n * visible.\n *\n * @defaultValue `false`\n */\n preventScroll?: boolean;\n\n /**\n * Boolean if the menu should close instead of repositioning itself if the\n * browser window is resized.\n *\n * @defaultValue `false`\n */\n closeOnResize?: boolean;\n\n /** @see {@link FixedPositioningOptions.getFixedPositionOptions} */\n getFixedPositionOptions?(): CalculateFixedPositionOptions;\n}\n\n/**\n * @since 5.1.0\n * @since 6.0.0 Renamed from `MenuListProps` to `MenuListConvenienceProps`\n */\nexport interface MenuListConvenienceProps {\n /**\n * An optional style to provide to the `List` component that surrounds the\n * `MenuItem` within a `Menu`.\n */\n listStyle?: CSSProperties;\n\n /**\n * An optional className to provide to the `List` component that surrounds the\n * `MenuItem` within a `Menu`.\n */\n listClassName?: string;\n\n /**\n * Any additional props to pass to the `List` component that surrounds the\n * `Menu`'s `MenuItem`s.\n */\n listProps?: PropsWithRef<Omit<ListProps, \"horizontal\">, ListElement>;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface MenuConvenienceProps extends MenuConfigurationProps {\n /**\n * This can be used to apply additional props to the `Menu` component.\n *\n * Note: You can override the `style` and `className` using\n * {@link menuStyle} and {@link menuClassName} instead for convenience.\n *\n * @example\n * ```tsx\n * <DropdownMenu\n * {...props}\n * menuProps={{\n * style: {\n * // custom inline style\n * },\n * className: \"come-class-name\",\n * getFixedPositionOptions: () => ({\n * preventOverlap: true,\n * }),\n * }}\n * />\n * ```\n */\n menuProps?: PropsWithRef<\n Omit<\n MenuProps,\n | \"children\"\n | \"fixedTo\"\n | \"visible\"\n | \"onRequestClose\"\n | \"getDefaultFocusedIndex\"\n >,\n HTMLDivElement\n >;\n\n /**\n * Convenience prop to apply custom style to the `Menu` component.\n */\n menuStyle?: CSSProperties;\n\n /**\n * Convenience prop to apply custom class name to the `Menu` component.\n */\n menuClassName?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport type MenuFixedPositioningOptions = Omit<\n FixedPositioningOptions<HTMLElement, HTMLDivElement>,\n \"onScroll\" | \"onResize\"\n>;\n\n/**\n * @since 5.0.0\n * @since 6.0.0 Updated to use the latest Menu, Transition, and Portal API.\n */\nexport interface MenuProps\n extends HTMLAttributes<HTMLDivElement>,\n MenuConfiguration,\n MenuConfigurationProps,\n MenuFixedPositioningOptions,\n MenuOrientationProps,\n MenuTransitionProps,\n MenuListConvenienceProps,\n MenuSheetConvenienceProps {\n visible: boolean;\n onRequestClose(): void;\n\n /**\n * @defaultValue `\"menu-\" + useId()`\n */\n id?: string;\n\n /**\n * This is used to set the default focus index when the menu is visible.\n *\n * @internal\n */\n getDefaultFocusedIndex?: GetDefaultFocusedIndex;\n\n /**\n * Custom style that should be applied to the menu only while not rendered\n * within a sheet since the {@link style} would be applied to both versions.\n */\n menuStyle?: CSSProperties;\n\n /**\n * Custom class name that should be applied only while not rendered within a\n * sheet.\n */\n menuClassName?: string;\n\n /**\n * @internal\n *\n * This is only used to update the default anchor when the DropdownMenu's\n * toggle is a floating action button.\n */\n floating?: FloatingActionButtonPosition;\n}\n\n/**\n * **Client Component**\n *\n * This component should generally only be used to implement context menus with\n * the `useContextMenu` hook. Otherwise, the `DropdownMenu` component should be\n * used.\n *\n * @see The `useContextMenu` hook for an example.\n *\n * @since 5.0.0\n * @since 6.0.0 Updated this component to implement all the `Menu`\n * functionality instead of requiring the `useMenu` hook and `MenuWidget`\n * component. In addition, the `renderAsSheet` behavior has been moved into this\n * implementation so that the `MenuRenderer` is no longer required and context\n * menus can appear as a `Sheet`.\n */\nexport const Menu = forwardRef<HTMLDivElement, LabelRequiredForA11y<MenuProps>>(\n function Menu(props, propRef) {\n const {\n id: propId,\n style: propStyle,\n role = \"menu\",\n children,\n horizontal: _horizontal,\n sheetHeader: _sheetHeader,\n sheetFooter: _sheetFooter,\n renderAsSheet: _renderAsSheet,\n sheetPosition: _sheetPosition,\n sheetVerticalSize: _sheetVerticalSize,\n sheetProps,\n sheetStyle,\n sheetClassName,\n menuStyle,\n menuClassName,\n disableElevation = false,\n temporary = true,\n tabIndex = -1,\n fixedTo,\n className,\n classNames,\n timeout,\n appear,\n enter,\n exit,\n onEnter,\n onEntering = noop,\n onEntered = noop,\n onExit,\n onExiting,\n onExited = noop,\n onKeyDown = noop,\n listProps,\n listStyle,\n listClassName,\n visible,\n onRequestClose,\n floating,\n anchor,\n closeOnResize = false,\n closeOnScroll = false,\n preventScroll = false,\n vwMargin,\n vhMargin,\n xMargin,\n yMargin,\n width,\n transformOrigin = true,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n getFixedPositionOptions,\n disablePortal: propDisablePortal,\n disableTransition,\n ...remaining\n } = props;\n const { \"aria-label\": ariaLabel, \"aria-labelledby\": ariaLabelledBy } =\n props;\n\n const id = useEnsuredId(propId, \"menu\");\n const {\n root,\n menubar,\n menuitem,\n activeId,\n animatedOnceRef,\n hoverTimeoutRef,\n disableHoverMode,\n } = useMenuBarContext();\n const {\n horizontal,\n sheetHeader,\n sheetFooter,\n renderAsSheet,\n sheetPosition,\n sheetVerticalSize,\n } = useMenuConfiguration(props);\n const { isPhone } = useAppSize();\n const isSheet =\n renderAsSheet === true || (renderAsSheet === \"phone\" && isPhone);\n\n const entered = useRef(false);\n const cancelUnmountFocus = useRef(false);\n const hideWithoutRefocus = (): void => {\n cancelUnmountFocus.current = true;\n onRequestClose();\n };\n const mode = useUserInteractionMode();\n const mouse = mode === \"mouse\";\n\n const { eventHandlers, transitionOptions } = useFocusContainer({\n nodeRef: propRef,\n activate: visible,\n onKeyDown(event) {\n onKeyDown(event);\n\n // when a menu is within a sheet, it should not trigger the custom\n // keyboard behavior\n if (isSheet) {\n return;\n }\n\n switch (event.key) {\n case \"Escape\":\n // prevent parent components that have an \"Escape\" keypress event\n // from being triggered as well\n event.stopPropagation();\n disableHoverMode();\n onRequestClose();\n break;\n case \"Tab\":\n // since menus are portalled, tab index is kinda broke so just close\n // the menu instead of doing default tab behavior\n event.preventDefault();\n\n if (!menuitem) {\n // pressing the tab key should still cascade close all menus\n event.stopPropagation();\n }\n disableHoverMode();\n onRequestClose();\n break;\n case \"ArrowUp\":\n if (!root && menuitem && horizontal) {\n event.stopPropagation();\n event.preventDefault();\n onRequestClose();\n }\n break;\n case \"ArrowLeft\":\n if (!root && menuitem && !horizontal) {\n event.stopPropagation();\n event.preventDefault();\n onRequestClose();\n }\n break;\n }\n },\n onEntering(appearing) {\n onEntering(appearing);\n entered.current = true;\n },\n onEntered(appearing) {\n onEntered(appearing);\n entered.current = true;\n cancelUnmountFocus.current = false;\n animatedOnceRef.current = true;\n },\n onExited() {\n onExited();\n entered.current = false;\n },\n onExiting,\n disableTransition,\n isFocusTypeDisabled(type) {\n if (role === \"listbox\") {\n return !isSheet;\n }\n\n if (type === \"keyboard\") {\n return isSheet;\n }\n\n const isHoverDisabled = mouse && hoverTimeoutRef.current === 0;\n if (type === \"mount\") {\n return isHoverDisabled;\n }\n\n return (\n isHoverDisabled ||\n cancelUnmountFocus.current ||\n (root && !!activeId && id !== activeId)\n );\n },\n });\n\n const { ref, style, callbacks, updateStyle } = useFixedPositioning({\n ...transitionOptions,\n onEnter,\n style: isSheet ? propStyle : menuStyle,\n fixedTo,\n anchor: getDefaultAnchor({\n anchor,\n menubar,\n floating,\n menuitem: !root && menuitem,\n horizontal,\n }),\n vwMargin,\n vhMargin,\n xMargin,\n yMargin,\n width,\n transformOrigin,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n getFixedPositionOptions,\n onResize: closeOnResize ? hideWithoutRefocus : undefined,\n onScroll(_event, data) {\n if (!data.visible || closeOnScroll) {\n hideWithoutRefocus();\n }\n },\n });\n const { rendered, disablePortal, elementProps } = useScaleTransition({\n nodeRef: ref,\n className: cnb(!isSheet && menuClassName, className),\n transitionIn: visible,\n vertical: !horizontal,\n temporary,\n timeout: isSheet || disableTransition ? 0 : timeout,\n classNames,\n appear,\n enter,\n exit,\n onExit,\n onExiting: transitionOptions.onExiting,\n exitedHidden: true,\n ...callbacks,\n });\n useScrollLock(visible && preventScroll);\n\n // need to make sure that the useEffect does not refire for hiding on click\n // events because of the `window.requestAnimationFrame`. It'll make it so\n // that menu items that update state are unable to close when clicked\n const hide = useRef(onRequestClose);\n useEffect(() => {\n hide.current = onRequestClose;\n });\n useEffect(() => {\n if (!visible) {\n return;\n }\n\n const callback = (event: globalThis.MouseEvent): void => {\n // this is required for when the transition is disabled\n if (!entered.current) {\n return;\n }\n\n // if the user clicks outside of the menu to close it, the toggle button\n // should not be focused. instead the nearest focusable element from the\n // click event should be focused when Tab or Shift + tab is pressed\n cancelUnmountFocus.current =\n !(event.target instanceof HTMLElement) ||\n !event.target.closest(`[role=\"${role}\"]`);\n\n // this won't be called if `event.stopPropagation()` is called\n hide.current();\n disableHoverMode();\n };\n\n // wait an animation frame so the initial click event that caused the menu\n // to become visible does not immediately close the menu\n const frame = window.requestAnimationFrame(() => {\n window.addEventListener(\"click\", callback);\n });\n\n return () => {\n window.cancelAnimationFrame(frame);\n window.removeEventListener(\"click\", callback);\n };\n }, [disableHoverMode, role, visible]);\n useIsomorphicLayoutEffect(() => {\n if (!visible) {\n return;\n }\n\n updateStyle();\n }, [updateStyle, children, visible]);\n\n return (\n <MenuConfigurationProvider\n horizontal={horizontal}\n renderAsSheet={renderAsSheet}\n sheetFooter={sheetFooter}\n sheetHeader={sheetHeader}\n sheetPosition={sheetPosition}\n sheetVerticalSize={sheetVerticalSize}\n >\n <MenuSheet\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy as string}\n header={sheetHeader}\n footer={sheetFooter}\n position={sheetPosition}\n verticalSize={sheetVerticalSize}\n visible={visible}\n enabled={isSheet}\n onRequestClose={onRequestClose}\n style={sheetStyle}\n className={sheetClassName}\n disablePortal={propDisablePortal}\n temporary={temporary}\n disableTransition={disableTransition}\n {...sheetProps}\n >\n <Portal disabled={isSheet || (propDisablePortal ?? disablePortal)}>\n {(rendered || isSheet) && (\n <MenuWidget\n {...remaining}\n {...elementProps}\n {...eventHandlers}\n id={id}\n role={role}\n style={isSheet ? propStyle : style}\n isSheet={isSheet}\n tabIndex={tabIndex}\n horizontal={horizontal}\n listProps={listProps}\n listStyle={listStyle}\n listClassName={listClassName}\n disableElevation={disableElevation}\n cancelUnmountFocus={cancelUnmountFocus}\n >\n {children}\n </MenuWidget>\n )}\n </Portal>\n </MenuSheet>\n </MenuConfigurationProvider>\n );\n }\n);\n"],"names":["cnb","forwardRef","useEffect","useRef","useFocusContainer","useUserInteractionMode","useAppSize","Portal","useFixedPositioning","useScrollLock","useScaleTransition","useEnsuredId","useIsomorphicLayoutEffect","MenuConfigurationProvider","useMenuConfiguration","MenuSheet","MenuWidget","useMenuBarContext","getDefaultAnchor","noop","Menu","props","propRef","id","propId","style","propStyle","role","children","horizontal","_horizontal","sheetHeader","_sheetHeader","sheetFooter","_sheetFooter","renderAsSheet","_renderAsSheet","sheetPosition","_sheetPosition","sheetVerticalSize","_sheetVerticalSize","sheetProps","sheetStyle","sheetClassName","menuStyle","menuClassName","disableElevation","temporary","tabIndex","fixedTo","className","classNames","timeout","appear","enter","exit","onEnter","onEntering","onEntered","onExit","onExiting","onExited","onKeyDown","listProps","listStyle","listClassName","visible","onRequestClose","floating","anchor","closeOnResize","closeOnScroll","preventScroll","vwMargin","vhMargin","xMargin","yMargin","width","transformOrigin","preventOverlap","disableSwapping","disableVHBounds","initialX","initialY","getFixedPositionOptions","disablePortal","propDisablePortal","disableTransition","remaining","ariaLabel","ariaLabelledBy","root","menubar","menuitem","activeId","animatedOnceRef","hoverTimeoutRef","disableHoverMode","isPhone","isSheet","entered","cancelUnmountFocus","hideWithoutRefocus","current","mode","mouse","eventHandlers","transitionOptions","nodeRef","activate","event","key","stopPropagation","preventDefault","appearing","isFocusTypeDisabled","type","isHoverDisabled","ref","callbacks","updateStyle","onResize","undefined","onScroll","_event","data","rendered","elementProps","transitionIn","vertical","exitedHidden","hide","callback","target","HTMLElement","closest","frame","window","requestAnimationFrame","addEventListener","cancelAnimationFrame","removeEventListener","aria-label","aria-labelledby","header","footer","position","verticalSize","enabled","disabled"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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YAC9DwG,KAAK5B,OAAO;YACZN;QACF;QAEA,0EAA0E;QAC1E,wDAAwD;QACxD,MAAMuC,QAAQC,OAAOC,qBAAqB,CAAC;YACzCD,OAAOE,gBAAgB,CAAC,SAASP;QACnC;QAEA,OAAO;YACLK,OAAOG,oBAAoB,CAACJ;YAC5BC,OAAOI,mBAAmB,CAAC,SAAST;QACtC;IACF,GAAG;QAACnC;QAAkBtE;QAAMuC;KAAQ;IACpCtD,0BAA0B;QACxB,IAAI,CAACsD,SAAS;YACZ;QACF;QAEAsD;IACF,GAAG;QAACA;QAAa5F;QAAUsC;KAAQ;IAEnC,qBACE,KAACrD;QACCgB,YAAYA;QACZM,eAAeA;QACfF,aAAaA;QACbF,aAAaA;QACbM,eAAeA;QACfE,mBAAmBA;kBAEnB,cAAA,KAACxB;YACC+H,cAAYrD;YACZsD,mBAAiBrD;YACjBsD,QAAQjH;YACRkH,QAAQhH;YACRiH,UAAU7G;YACV8G,cAAc5G;YACd2B,SAASA;YACTkF,SAASjD;YACThC,gBAAgBA;YAChB1C,OAAOiB;YACPQ,WAAWP;YACX0C,eAAeC;YACfvC,WAAWA;YACXwC,mBAAmBA;YAClB,GAAG9C,UAAU;sBAEd,cAAA,KAAClC;gBAAO8I,UAAUlD,WAAYb,CAAAA,qBAAqBD,aAAY;0BAC5D,AAACyC,CAAAA,YAAY3B,OAAM,mBAClB,KAACnF;oBACE,GAAGwE,SAAS;oBACZ,GAAGuC,YAAY;oBACf,GAAGrB,aAAa;oBACjBnF,IAAIA;oBACJI,MAAMA;oBACNF,OAAO0E,UAAUzE,YAAYD;oBAC7B0E,SAASA;oBACTnD,UAAUA;oBACVnB,YAAYA;oBACZkC,WAAWA;oBACXC,WAAWA;oBACXC,eAAeA;oBACfnB,kBAAkBA;oBAClBuD,oBAAoBA;8BAEnBzE;;;;;AAOf,GACA"}
1
+ {"version":3,"sources":["../../src/menu/Menu.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n useEffect,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { type FloatingActionButtonPosition } from \"../button/FloatingActionButton.js\";\nimport { useFocusContainer } from \"../focus/useFocusContainer.js\";\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\nimport { type ListElement, type ListProps } from \"../list/List.js\";\nimport { useAppSize } from \"../media-queries/AppSizeProvider.js\";\nimport { type GetDefaultFocusedIndex } from \"../movement/types.js\";\nimport { Portal } from \"../portal/Portal.js\";\nimport { type CalculateFixedPositionOptions } from \"../positioning/types.js\";\nimport {\n useFixedPositioning,\n type FixedPositioningOptions,\n} from \"../positioning/useFixedPositioning.js\";\nimport { useScrollLock } from \"../scroll/useScrollLock.js\";\nimport {\n useScaleTransition,\n type ScaleTransitionHookOptions,\n} from \"../transition/useScaleTransition.js\";\nimport { type LabelRequiredForA11y, type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useIsomorphicLayoutEffect } from \"../useIsomorphicLayoutEffect.js\";\nimport {\n MenuConfigurationProvider,\n useMenuConfiguration,\n type MenuConfiguration,\n type MenuOrientationProps,\n} from \"./MenuConfigurationProvider.js\";\nimport { MenuSheet, type MenuSheetConvenienceProps } from \"./MenuSheet.js\";\nimport { MenuWidget } from \"./MenuWidget.js\";\nimport { useMenuBarContext } from \"./useMenuBarProvider.js\";\nimport { getDefaultAnchor } from \"./utils.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-menu-background-color\"?: string;\n \"--rmd-menu-color\"?: string;\n \"--rmd-menu-min-width\"?: string | number;\n \"--rmd-menu-spacing\"?: string | number;\n }\n}\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @since 5.0.0 */\nexport type MenuTransitionProps = Omit<\n ScaleTransitionHookOptions<HTMLDivElement>,\n \"transitionIn\" | \"vertical\" | \"nodeRef\"\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface MenuConfigurationProps extends CalculateFixedPositionOptions {\n /**\n * @see {@link ScaleTransitionHookOptions.temporary}\n * @defaultValue `true`\n */\n temporary?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disablePortal?: boolean;\n\n /**\n * Boolean if the menu should not gain the elevation styles and should only be\n * set to `true` when rendering within a `Sheet`.\n *\n * @defaultValue `false`\n */\n disableElevation?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * @see {@link FixedPositioningOptions.transformOrigin}\n * @defaultValue `true`\n */\n transformOrigin?: boolean;\n\n /**\n * Boolean if the menu should close if the page is scrolled. The default\n * behavior is to just update the position of the menu relative to the menu\n * button until it can no longer be visible within the viewport.\n *\n * @defaultValue `false`\n */\n closeOnScroll?: boolean;\n\n /**\n * Boolean if the page should no longer be scrollable while the menu is\n * visible.\n *\n * @defaultValue `false`\n */\n preventScroll?: boolean;\n\n /**\n * Boolean if the menu should close instead of repositioning itself if the\n * browser window is resized.\n *\n * @defaultValue `false`\n */\n closeOnResize?: boolean;\n\n /** @see {@link FixedPositioningOptions.getFixedPositionOptions} */\n getFixedPositionOptions?(): CalculateFixedPositionOptions;\n}\n\n/**\n * @since 5.1.0\n * @since 6.0.0 Renamed from `MenuListProps` to `MenuListConvenienceProps`\n */\nexport interface MenuListConvenienceProps {\n /**\n * An optional style to provide to the `List` component that surrounds the\n * `MenuItem` within a `Menu`.\n */\n listStyle?: CSSProperties;\n\n /**\n * An optional className to provide to the `List` component that surrounds the\n * `MenuItem` within a `Menu`.\n */\n listClassName?: string;\n\n /**\n * Any additional props to pass to the `List` component that surrounds the\n * `Menu`'s `MenuItem`s.\n */\n listProps?: PropsWithRef<Omit<ListProps, \"horizontal\">, ListElement>;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface MenuConvenienceProps extends MenuConfigurationProps {\n /**\n * This can be used to apply additional props to the `Menu` component.\n *\n * Note: You can override the `style` and `className` using\n * {@link menuStyle} and {@link menuClassName} instead for convenience.\n *\n * @example\n * ```tsx\n * <DropdownMenu\n * {...props}\n * menuProps={{\n * style: {\n * // custom inline style\n * },\n * className: \"come-class-name\",\n * getFixedPositionOptions: () => ({\n * preventOverlap: true,\n * }),\n * }}\n * />\n * ```\n */\n menuProps?: PropsWithRef<\n Omit<\n MenuProps,\n | \"children\"\n | \"fixedTo\"\n | \"visible\"\n | \"onRequestClose\"\n | \"getDefaultFocusedIndex\"\n >,\n HTMLDivElement\n >;\n\n /**\n * Convenience prop to apply custom style to the `Menu` component.\n */\n menuStyle?: CSSProperties;\n\n /**\n * Convenience prop to apply custom class name to the `Menu` component.\n */\n menuClassName?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport type MenuFixedPositioningOptions = Omit<\n FixedPositioningOptions<HTMLElement, HTMLDivElement>,\n \"onScroll\" | \"onResize\"\n>;\n\n/**\n * @since 5.0.0\n * @since 6.0.0 Updated to use the latest Menu, Transition, and Portal API.\n */\nexport interface MenuProps\n extends HTMLAttributes<HTMLDivElement>,\n MenuConfiguration,\n MenuConfigurationProps,\n MenuFixedPositioningOptions,\n MenuOrientationProps,\n MenuTransitionProps,\n MenuListConvenienceProps,\n MenuSheetConvenienceProps {\n visible: boolean;\n onRequestClose(): void;\n\n /**\n * @defaultValue `\"menu-\" + useId()`\n */\n id?: string;\n\n /**\n * This is used to set the default focus index when the menu is visible.\n *\n * @internal\n */\n getDefaultFocusedIndex?: GetDefaultFocusedIndex;\n\n /**\n * Custom style that should be applied to the menu only while not rendered\n * within a sheet since the {@link style} would be applied to both versions.\n */\n menuStyle?: CSSProperties;\n\n /**\n * Custom class name that should be applied only while not rendered within a\n * sheet.\n */\n menuClassName?: string;\n\n /**\n * @internal\n *\n * This is only used to update the default anchor when the DropdownMenu's\n * toggle is a floating action button.\n */\n floating?: FloatingActionButtonPosition;\n}\n\n/**\n * **Client Component**\n *\n * This component should generally only be used to implement context menus with\n * the `useContextMenu` hook. Otherwise, the `DropdownMenu` component should be\n * used.\n *\n * @see The `useContextMenu` hook for an example.\n *\n * @since 5.0.0\n * @since 6.0.0 Updated this component to implement all the `Menu`\n * functionality instead of requiring the `useMenu` hook and `MenuWidget`\n * component. In addition, the `renderAsSheet` behavior has been moved into this\n * implementation so that the `MenuRenderer` is no longer required and context\n * menus can appear as a `Sheet`.\n */\nexport const Menu = forwardRef<HTMLDivElement, LabelRequiredForA11y<MenuProps>>(\n function Menu(props, propRef) {\n const {\n id: propId,\n style: propStyle,\n role = \"menu\",\n children,\n horizontal: _horizontal,\n sheetHeader: _sheetHeader,\n sheetFooter: _sheetFooter,\n renderAsSheet: _renderAsSheet,\n sheetPosition: _sheetPosition,\n sheetVerticalSize: _sheetVerticalSize,\n sheetProps,\n sheetStyle,\n sheetClassName,\n menuStyle,\n menuClassName,\n disableElevation = false,\n temporary = true,\n tabIndex = -1,\n fixedTo,\n className,\n classNames,\n timeout,\n appear,\n enter,\n exit,\n onEnter,\n onEntering = noop,\n onEntered = noop,\n onExit,\n onExiting,\n onExited = noop,\n onKeyDown = noop,\n listProps,\n listStyle,\n listClassName,\n visible,\n onRequestClose,\n floating,\n anchor,\n closeOnResize = false,\n closeOnScroll = false,\n preventScroll = false,\n vwMargin,\n vhMargin,\n xMargin,\n yMargin,\n width,\n transformOrigin = true,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n getFixedPositionOptions,\n disablePortal: propDisablePortal,\n disableTransition,\n ...remaining\n } = props;\n const { \"aria-label\": ariaLabel, \"aria-labelledby\": ariaLabelledBy } =\n props;\n\n const id = useEnsuredId(propId, \"menu\");\n const {\n root,\n menubar,\n menuitem,\n activeId,\n animatedOnceRef,\n hoverTimeoutRef,\n disableHoverMode,\n } = useMenuBarContext();\n const {\n horizontal,\n sheetHeader,\n sheetFooter,\n renderAsSheet,\n sheetPosition,\n sheetVerticalSize,\n } = useMenuConfiguration(props);\n const { isPhone } = useAppSize();\n const isSheet =\n renderAsSheet === true || (renderAsSheet === \"phone\" && isPhone);\n\n const entered = useRef(false);\n const cancelUnmountFocus = useRef(false);\n const hideWithoutRefocus = (): void => {\n cancelUnmountFocus.current = true;\n onRequestClose();\n };\n const mode = useUserInteractionMode();\n const mouse = mode === \"mouse\";\n\n const { eventHandlers, transitionOptions } = useFocusContainer({\n nodeRef: propRef,\n activate: visible,\n onKeyDown(event) {\n onKeyDown(event);\n\n // when a menu is within a sheet, it should not trigger the custom\n // keyboard behavior\n if (isSheet) {\n return;\n }\n\n switch (event.key) {\n case \"Escape\":\n // prevent parent components that have an \"Escape\" keypress event\n // from being triggered as well\n event.stopPropagation();\n disableHoverMode();\n onRequestClose();\n break;\n case \"Tab\":\n // since menus are portalled, tab index is kinda broke so just close\n // the menu instead of doing default tab behavior\n event.preventDefault();\n\n if (!menuitem) {\n // pressing the tab key should still cascade close all menus\n event.stopPropagation();\n }\n disableHoverMode();\n onRequestClose();\n break;\n case \"ArrowUp\":\n if (!root && menuitem && horizontal) {\n event.stopPropagation();\n event.preventDefault();\n onRequestClose();\n }\n break;\n case \"ArrowLeft\":\n if (!root && menuitem && !horizontal) {\n event.stopPropagation();\n event.preventDefault();\n onRequestClose();\n }\n break;\n }\n },\n onEntering(appearing) {\n onEntering(appearing);\n entered.current = true;\n },\n onEntered(appearing) {\n onEntered(appearing);\n entered.current = true;\n cancelUnmountFocus.current = false;\n animatedOnceRef.current = true;\n },\n onExited() {\n onExited();\n entered.current = false;\n },\n onExiting,\n disableTransition,\n isFocusTypeDisabled(type) {\n if (role === \"listbox\") {\n return !isSheet;\n }\n\n if (type === \"keyboard\") {\n return isSheet;\n }\n\n const isHoverDisabled = mouse && hoverTimeoutRef.current === 0;\n if (type === \"mount\") {\n return isHoverDisabled;\n }\n\n return (\n isHoverDisabled ||\n cancelUnmountFocus.current ||\n (root && !!activeId && id !== activeId)\n );\n },\n });\n\n const { ref, style, callbacks, updateStyle } = useFixedPositioning({\n ...transitionOptions,\n onEnter,\n style: isSheet ? propStyle : menuStyle,\n fixedTo,\n anchor: getDefaultAnchor({\n anchor,\n menubar,\n floating,\n menuitem: !root && menuitem,\n horizontal,\n }),\n vwMargin,\n vhMargin,\n xMargin,\n yMargin,\n width,\n transformOrigin,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n getFixedPositionOptions,\n onResize: closeOnResize ? hideWithoutRefocus : undefined,\n onScroll(_event, data) {\n if (!data.visible || closeOnScroll) {\n hideWithoutRefocus();\n }\n },\n });\n const { rendered, disablePortal, elementProps } = useScaleTransition({\n nodeRef: ref,\n className: cnb(!isSheet && menuClassName, className),\n transitionIn: visible,\n vertical: !horizontal,\n temporary,\n timeout: isSheet || disableTransition ? 0 : timeout,\n classNames,\n appear,\n enter,\n exit,\n onExit,\n onExiting: transitionOptions.onExiting,\n exitedHidden: true,\n ...callbacks,\n });\n useScrollLock(visible && preventScroll);\n\n // need to make sure that the useEffect does not refire for hiding on click\n // events because of the `window.requestAnimationFrame`. It'll make it so\n // that menu items that update state are unable to close when clicked\n const hide = useRef(onRequestClose);\n useEffect(() => {\n hide.current = onRequestClose;\n });\n useEffect(() => {\n if (!visible) {\n return;\n }\n\n const callback = (event: globalThis.MouseEvent): void => {\n // this is required for when the transition is disabled\n if (!entered.current) {\n return;\n }\n\n // if the user clicks outside of the menu to close it, the toggle button\n // should not be focused. instead the nearest focusable element from the\n // click event should be focused when Tab or Shift + tab is pressed\n cancelUnmountFocus.current =\n !(event.target instanceof HTMLElement) ||\n !event.target.closest(`[role=\"${role}\"]`);\n\n // this won't be called if `event.stopPropagation()` is called\n hide.current();\n disableHoverMode();\n };\n\n // wait an animation frame so the initial click event that caused the menu\n // to become visible does not immediately close the menu\n const frame = window.requestAnimationFrame(() => {\n window.addEventListener(\"click\", callback);\n });\n\n return () => {\n window.cancelAnimationFrame(frame);\n window.removeEventListener(\"click\", callback);\n };\n }, [disableHoverMode, role, visible]);\n useIsomorphicLayoutEffect(() => {\n if (!visible) {\n return;\n }\n\n updateStyle();\n }, [updateStyle, children, visible]);\n\n return (\n <MenuConfigurationProvider\n horizontal={horizontal}\n renderAsSheet={renderAsSheet}\n sheetFooter={sheetFooter}\n sheetHeader={sheetHeader}\n sheetPosition={sheetPosition}\n sheetVerticalSize={sheetVerticalSize}\n >\n <MenuSheet\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy as string}\n header={sheetHeader}\n footer={sheetFooter}\n position={sheetPosition}\n verticalSize={sheetVerticalSize}\n visible={visible}\n enabled={isSheet}\n onRequestClose={onRequestClose}\n style={sheetStyle}\n className={sheetClassName}\n disablePortal={propDisablePortal}\n temporary={temporary}\n disableTransition={disableTransition}\n {...sheetProps}\n >\n <Portal disabled={isSheet || (propDisablePortal ?? disablePortal)}>\n {(rendered || isSheet) && (\n <MenuWidget\n {...remaining}\n {...elementProps}\n {...eventHandlers}\n id={id}\n role={role}\n style={isSheet ? propStyle : style}\n isSheet={isSheet}\n tabIndex={tabIndex}\n horizontal={horizontal}\n listProps={listProps}\n listStyle={listStyle}\n listClassName={listClassName}\n disableElevation={disableElevation}\n cancelUnmountFocus={cancelUnmountFocus}\n >\n {children}\n </MenuWidget>\n )}\n </Portal>\n </MenuSheet>\n </MenuConfigurationProvider>\n );\n }\n);\n"],"names":["cnb","forwardRef","useEffect","useRef","useFocusContainer","useUserInteractionMode","useAppSize","Portal","useFixedPositioning","useScrollLock","useScaleTransition","useEnsuredId","useIsomorphicLayoutEffect","MenuConfigurationProvider","useMenuConfiguration","MenuSheet","MenuWidget","useMenuBarContext","getDefaultAnchor","noop","Menu","props","propRef","id","propId","style","propStyle","role","children","horizontal","_horizontal","sheetHeader","_sheetHeader","sheetFooter","_sheetFooter","renderAsSheet","_renderAsSheet","sheetPosition","_sheetPosition","sheetVerticalSize","_sheetVerticalSize","sheetProps","sheetStyle","sheetClassName","menuStyle","menuClassName","disableElevation","temporary","tabIndex","fixedTo","className","classNames","timeout","appear","enter","exit","onEnter","onEntering","onEntered","onExit","onExiting","onExited","onKeyDown","listProps","listStyle","listClassName","visible","onRequestClose","floating","anchor","closeOnResize","closeOnScroll","preventScroll","vwMargin","vhMargin","xMargin","yMargin","width","transformOrigin","preventOverlap","disableSwapping","disableVHBounds","initialX","initialY","getFixedPositionOptions","disablePortal","propDisablePortal","disableTransition","remaining","ariaLabel","ariaLabelledBy","root","menubar","menuitem","activeId","animatedOnceRef","hoverTimeoutRef","disableHoverMode","isPhone","isSheet","entered","cancelUnmountFocus","hideWithoutRefocus","current","mode","mouse","eventHandlers","transitionOptions","nodeRef","activate","event","key","stopPropagation","preventDefault","appearing","isFocusTypeDisabled","type","isHoverDisabled","ref","callbacks","updateStyle","onResize","undefined","onScroll","_event","data","rendered","elementProps","transitionIn","vertical","exitedHidden","hide","callback","target","HTMLElement","closest","frame","window","requestAnimationFrame","addEventListener","cancelAnimationFrame","removeEventListener","aria-label","aria-labelledby","header","footer","position","verticalSize","enabled","disabled"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,UAAU,EACVC,SAAS,EACTC,MAAM,QAGD,QAAQ;AAEf,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,sBAAsB,QAAQ,gDAAgD;AAEvF,SAASC,UAAU,QAAQ,sCAAsC;AAEjE,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,SACEC,mBAAmB,QAEd,wCAAwC;AAC/C,SAASC,aAAa,QAAQ,6BAA6B;AAC3D,SACEC,kBAAkB,QAEb,sCAAsC;AAE7C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,yBAAyB,QAAQ,kCAAkC;AAC5E,SACEC,yBAAyB,EACzBC,oBAAoB,QAGf,iCAAiC;AACxC,SAASC,SAAS,QAAwC,iBAAiB;AAC3E,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,gBAAgB,QAAQ,aAAa;AAW9C,MAAMC,OAAO;AACX,aAAa;AACf;AAyMA;;;;;;;;;;;;;;;CAeC,GACD,OAAO,MAAMC,qBAAOnB,WAClB,SAASmB,KAAKC,KAAK,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AC5D,AAACyC,CAAAA,YAAY3B,OAAM,mBAClB,KAACnF;oBACE,GAAGwE,SAAS;oBACZ,GAAGuC,YAAY;oBACf,GAAGrB,aAAa;oBACjBnF,IAAIA;oBACJI,MAAMA;oBACNF,OAAO0E,UAAUzE,YAAYD;oBAC7B0E,SAASA;oBACTnD,UAAUA;oBACVnB,YAAYA;oBACZkC,WAAWA;oBACXC,WAAWA;oBACXC,eAAeA;oBACfnB,kBAAkBA;oBAClBuD,oBAAoBA;8BAEnBzE;;;;;AAOf,GACA"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ListProps } from "../list/List.js";
3
2
  export interface MenuBarProps extends Omit<ListProps, "role"> {
4
3
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/MenuBar.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef } from \"react\";\nimport { List, type ListProps } from \"../list/List.js\";\nimport {\n KeyboardMovementProvider,\n useKeyboardMovementProvider,\n} from \"../movement/useKeyboardMovementProvider.js\";\nimport { MenuBarProvider, useMenuBarProvider } from \"./useMenuBarProvider.js\";\n\nexport interface MenuBarProps extends Omit<ListProps, \"role\"> {\n /**\n * @defaultValue `true`\n */\n horizontal?: boolean;\n\n /**\n * Set this to a number greater than 0 to allow opening dropdown menus within\n * the menubar after hovering for the duration in milliseconds. Once a menu\n * becomes visible within the menubar, all subsequent menus will become\n * visible immediately on hover as well until the hover mode is ended.\n *\n * For example:\n *\n * - `0` - the dropdown menus become visible immediately on hover\n * - `1000` - the first dropdown menu becomes visible after hovering for 1\n * second\n * - `undefined` - the hover mode can only be activate after a click with\n * mouse, touch, or keyboard\n *\n * @defaultValue `undefined`\n */\n hoverTimeout?: number;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import { DropdownMenu, MenuBar, MenuItem } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * export function SimpleExample(): ReactElement {\n * return (\n * <MenuBar>\n * <DropdownMenu buttonChildren=\"Item 1\">\n * <MenuItem>Menu Item 1</MenuItem>\n * <MenuItem>Menu Item 2</MenuItem>\n * <MenuItem>Menu Item 3</MenuItem>\n * </DropdownMenu>\n * <DropdownMenu buttonChildren=\"Item 2\">\n * <MenuItem>Menu Item 1</MenuItem>\n * <MenuItem>Menu Item 2</MenuItem>\n * <MenuItem>Menu Item 3</MenuItem>\n * </DropdownMenu>\n * <DropdownMenu buttonChildren=\"Item 3\">\n * <MenuItem>Menu Item 1</MenuItem>\n * <MenuItem>Menu Item 2</MenuItem>\n * <MenuItem>Menu Item 4</MenuItem>\n * </DropdownMenu>\n * </MenuBar>\n * );\n * }\n * ```\n *\n * @since 5.0.0\n * @since 6.0.0 Combined with the previous `MenuBarWidget`\n */\nexport const MenuBar = forwardRef<HTMLUListElement, MenuBarProps>(\n function MenuBar(props, ref) {\n const {\n onClick,\n onFocus,\n onKeyDown,\n horizontal = true,\n hoverTimeout,\n children,\n ...remaining\n } = props;\n const menuBarContext = useMenuBarProvider({\n root: true,\n menubar: true,\n hoverTimeout,\n });\n const { activeId, enableHoverMode } = menuBarContext;\n const { movementProps, movementContext } = useKeyboardMovementProvider({\n onClick,\n onFocus,\n onKeyDown,\n loopable: true,\n searchable: true,\n horizontal,\n includeDisabled: true,\n tabIndexBehavior: \"roving\",\n onFocusChange(event) {\n if (activeId) {\n enableHoverMode(event.element.id);\n }\n },\n });\n\n return (\n <KeyboardMovementProvider value={movementContext}>\n <MenuBarProvider value={menuBarContext}>\n <List\n {...remaining}\n {...movementProps}\n ref={ref}\n role=\"menubar\"\n horizontal={horizontal}\n >\n {children}\n </List>\n </MenuBarProvider>\n </KeyboardMovementProvider>\n );\n }\n);\n"],"names":["forwardRef","List","KeyboardMovementProvider","useKeyboardMovementProvider","MenuBarProvider","useMenuBarProvider","MenuBar","props","ref","onClick","onFocus","onKeyDown","horizontal","hoverTimeout","children","remaining","menuBarContext","root","menubar","activeId","enableHoverMode","movementProps","movementContext","loopable","searchable","includeDisabled","tabIndexBehavior","onFocusChange","event","element","id","value","role"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,UAAU,QAAQ,QAAQ;AACnC,SAASC,IAAI,QAAwB,kBAAkB;AACvD,SACEC,wBAAwB,EACxBC,2BAA2B,QACtB,6CAA6C;AACpD,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,0BAA0B;AA2B9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCC,GACD,OAAO,MAAMC,wBAAUN,WACrB,SAASM,QAAQC,KAAK,EAAEC,GAAG;IACzB,MAAM,EACJC,OAAO,EACPC,OAAO,EACPC,SAAS,EACTC,aAAa,IAAI,EACjBC,YAAY,EACZC,QAAQ,EACR,GAAGC,WACJ,GAAGR;IACJ,MAAMS,iBAAiBX,mBAAmB;QACxCY,MAAM;QACNC,SAAS;QACTL;IACF;IACA,MAAM,EAAEM,QAAQ,EAAEC,eAAe,EAAE,GAAGJ;IACtC,MAAM,EAAEK,aAAa,EAAEC,eAAe,EAAE,GAAGnB,4BAA4B;QACrEM;QACAC;QACAC;QACAY,UAAU;QACVC,YAAY;QACZZ;QACAa,iBAAiB;QACjBC,kBAAkB;QAClBC,eAAcC,KAAK;YACjB,IAAIT,UAAU;gBACZC,gBAAgBQ,MAAMC,OAAO,CAACC,EAAE;YAClC;QACF;IACF;IAEA,qBACE,KAAC5B;QAAyB6B,OAAOT;kBAC/B,cAAA,KAAClB;YAAgB2B,OAAOf;sBACtB,cAAA,KAACf;gBACE,GAAGc,SAAS;gBACZ,GAAGM,aAAa;gBACjBb,KAAKA;gBACLwB,MAAK;gBACLpB,YAAYA;0BAEXE;;;;AAKX,GACA"}
1
+ {"version":3,"sources":["../../src/menu/MenuBar.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef } from \"react\";\nimport { List, type ListProps } from \"../list/List.js\";\nimport {\n KeyboardMovementProvider,\n useKeyboardMovementProvider,\n} from \"../movement/useKeyboardMovementProvider.js\";\nimport { MenuBarProvider, useMenuBarProvider } from \"./useMenuBarProvider.js\";\n\nexport interface MenuBarProps extends Omit<ListProps, \"role\"> {\n /**\n * @defaultValue `true`\n */\n horizontal?: boolean;\n\n /**\n * Set this to a number greater than 0 to allow opening dropdown menus within\n * the menubar after hovering for the duration in milliseconds. Once a menu\n * becomes visible within the menubar, all subsequent menus will become\n * visible immediately on hover as well until the hover mode is ended.\n *\n * For example:\n *\n * - `0` - the dropdown menus become visible immediately on hover\n * - `1000` - the first dropdown menu becomes visible after hovering for 1\n * second\n * - `undefined` - the hover mode can only be activate after a click with\n * mouse, touch, or keyboard\n *\n * @defaultValue `undefined`\n */\n hoverTimeout?: number;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import { DropdownMenu, MenuBar, MenuItem } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * export function SimpleExample(): ReactElement {\n * return (\n * <MenuBar>\n * <DropdownMenu buttonChildren=\"Item 1\">\n * <MenuItem>Menu Item 1</MenuItem>\n * <MenuItem>Menu Item 2</MenuItem>\n * <MenuItem>Menu Item 3</MenuItem>\n * </DropdownMenu>\n * <DropdownMenu buttonChildren=\"Item 2\">\n * <MenuItem>Menu Item 1</MenuItem>\n * <MenuItem>Menu Item 2</MenuItem>\n * <MenuItem>Menu Item 3</MenuItem>\n * </DropdownMenu>\n * <DropdownMenu buttonChildren=\"Item 3\">\n * <MenuItem>Menu Item 1</MenuItem>\n * <MenuItem>Menu Item 2</MenuItem>\n * <MenuItem>Menu Item 4</MenuItem>\n * </DropdownMenu>\n * </MenuBar>\n * );\n * }\n * ```\n *\n * @since 5.0.0\n * @since 6.0.0 Combined with the previous `MenuBarWidget`\n */\nexport const MenuBar = forwardRef<HTMLUListElement, MenuBarProps>(\n function MenuBar(props, ref) {\n const {\n onClick,\n onFocus,\n onKeyDown,\n horizontal = true,\n hoverTimeout,\n children,\n ...remaining\n } = props;\n const menuBarContext = useMenuBarProvider({\n root: true,\n menubar: true,\n hoverTimeout,\n });\n const { activeId, enableHoverMode } = menuBarContext;\n const { movementProps, movementContext } = useKeyboardMovementProvider({\n onClick,\n onFocus,\n onKeyDown,\n loopable: true,\n searchable: true,\n horizontal,\n includeDisabled: true,\n tabIndexBehavior: \"roving\",\n onFocusChange(event) {\n if (activeId) {\n enableHoverMode(event.element.id);\n }\n },\n });\n\n return (\n <KeyboardMovementProvider value={movementContext}>\n <MenuBarProvider value={menuBarContext}>\n <List\n {...remaining}\n {...movementProps}\n ref={ref}\n role=\"menubar\"\n horizontal={horizontal}\n >\n {children}\n </List>\n </MenuBarProvider>\n </KeyboardMovementProvider>\n );\n }\n);\n"],"names":["forwardRef","List","KeyboardMovementProvider","useKeyboardMovementProvider","MenuBarProvider","useMenuBarProvider","MenuBar","props","ref","onClick","onFocus","onKeyDown","horizontal","hoverTimeout","children","remaining","menuBarContext","root","menubar","activeId","enableHoverMode","movementProps","movementContext","loopable","searchable","includeDisabled","tabIndexBehavior","onFocusChange","event","element","id","value","role"],"mappings":"AAAA;;AACA,SAASA,UAAU,QAAQ,QAAQ;AACnC,SAASC,IAAI,QAAwB,kBAAkB;AACvD,SACEC,wBAAwB,EACxBC,2BAA2B,QACtB,6CAA6C;AACpD,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,0BAA0B;AA2B9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCC,GACD,OAAO,MAAMC,wBAAUN,WACrB,SAASM,QAAQC,KAAK,EAAEC,GAAG;IACzB,MAAM,EACJC,OAAO,EACPC,OAAO,EACPC,SAAS,EACTC,aAAa,IAAI,EACjBC,YAAY,EACZC,QAAQ,EACR,GAAGC,WACJ,GAAGR;IACJ,MAAMS,iBAAiBX,mBAAmB;QACxCY,MAAM;QACNC,SAAS;QACTL;IACF;IACA,MAAM,EAAEM,QAAQ,EAAEC,eAAe,EAAE,GAAGJ;IACtC,MAAM,EAAEK,aAAa,EAAEC,eAAe,EAAE,GAAGnB,4BAA4B;QACrEM;QACAC;QACAC;QACAY,UAAU;QACVC,YAAY;QACZZ;QACAa,iBAAiB;QACjBC,kBAAkB;QAClBC,eAAcC,KAAK;YACjB,IAAIT,UAAU;gBACZC,gBAAgBQ,MAAMC,OAAO,CAACC,EAAE;YAClC;QACF;IACF;IAEA,qBACE,KAAC5B;QAAyB6B,OAAOT;kBAC/B,cAAA,KAAClB;YAAgB2B,OAAOf;sBACtB,cAAA,KAACf;gBACE,GAAGc,SAAS;gBACZ,GAAGM,aAAa;gBACjBb,KAAKA;gBACLwB,MAAK;gBACLpB,YAAYA;0BAEXE;;;;AAKX,GACA"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ButtonProps } from "../button/Button.js";
3
2
  import { type IconRotatorProps } from "../icon/IconRotator.js";
4
3
  import { type TextIconSpacingProps } from "../icon/TextIconSpacing.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/MenuButton.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef } from \"react\";\nimport { Button, type ButtonProps } from \"../button/Button.js\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { IconRotator, type IconRotatorProps } from \"../icon/IconRotator.js\";\nimport { type TextIconSpacingProps } from \"../icon/TextIconSpacing.js\";\nimport { useAppSize } from \"../media-queries/AppSizeProvider.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useMenuConfiguration } from \"./MenuConfigurationProvider.js\";\nimport { useMenuVisibility } from \"./MenuVisibilityProvider.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @since 5.0.0 */\nexport type MenuButtonTextIconSpacingProps = Pick<\n TextIconSpacingProps,\n \"icon\" | \"iconAfter\"\n>;\n\n/** @since 5.0.0 */\nexport type MenuButtonIconRotatorProps = Omit<\n IconRotatorProps,\n \"children\" | \"rotated\"\n>;\n\n/**\n * @since 5.0.0\n * @since 6.0.0 No longer extends the {@link ButtonProps}, no longer\n * requires an `id`, and no longer supports `textIconSpacingProps`.\n */\nexport interface BaseMenuButtonProps extends MenuButtonTextIconSpacingProps {\n /**\n * Any additional props to pass to the {@link IconRotator} component that\n * surrounds the {@link buttonChildren}\n */\n iconRotatorProps?: Readonly<MenuButtonIconRotatorProps>;\n\n /**\n * Boolean if the dropdown icon should be included with the button children.\n *\n * @defaultValue `buttonType === \"icon\"`\n */\n disableDropdownIcon?: boolean;\n}\n\n/**\n * @since 5.0.0\n * @since 6.0.0 See {@link BaseMenuButtonProps} for breaking changes.\n */\nexport interface MenuButtonProps extends ButtonProps, BaseMenuButtonProps {}\n\n/**\n * **Client Component**\n *\n * An internal component that handles rendering a button for the `DropdownMenu`\n * while implementing the correct accessibility and keyboard movement.\n *\n * @since 5.0.0\n * @since 6.0.0 See {@link BaseMenuButtonProps} for breaking changes.\n */\nexport const MenuButton = forwardRef<HTMLButtonElement, MenuButtonProps>(\n function MenuButton(props, ref) {\n const {\n id: propId,\n onClick = noop,\n onKeyDown = noop,\n icon: propIcon,\n iconAfter = true,\n iconRotatorProps,\n floating,\n buttonType = floating ? \"icon\" : \"text\",\n disableDropdownIcon = buttonType === \"icon\",\n children,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"menubutton\");\n const { visible, setVisible, defaultFocusIndex } = useMenuVisibility();\n const { renderAsSheet } = useMenuConfiguration();\n const { isPhone } = useAppSize();\n const isSheet =\n renderAsSheet === true || (renderAsSheet === \"phone\" && isPhone);\n\n const dropdownIcon = getIcon(\"dropdown\", propIcon);\n let icon = propIcon;\n if (!disableDropdownIcon) {\n icon = (\n <IconRotator {...iconRotatorProps} rotated={visible}>\n {dropdownIcon}\n </IconRotator>\n );\n }\n\n return (\n <Button\n {...remaining}\n aria-haspopup={isSheet ? \"dialog\" : \"menu\"}\n aria-expanded={visible || undefined}\n id={id}\n ref={ref}\n floating={floating}\n buttonType={buttonType}\n onClick={(event) => {\n onClick(event);\n\n defaultFocusIndex.current = 0;\n setVisible((prevVisible) => !prevVisible);\n }}\n onKeyDown={(event) => {\n onKeyDown(event);\n\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault();\n event.stopPropagation();\n defaultFocusIndex.current = 0;\n setVisible(true);\n break;\n case \"ArrowUp\":\n event.preventDefault();\n event.stopPropagation();\n defaultFocusIndex.current = -1;\n setVisible(true);\n break;\n }\n }}\n >\n {!iconAfter && icon}\n {children}\n {iconAfter && icon}\n </Button>\n );\n }\n);\n"],"names":["forwardRef","Button","getIcon","IconRotator","useAppSize","useEnsuredId","useMenuConfiguration","useMenuVisibility","noop","MenuButton","props","ref","id","propId","onClick","onKeyDown","icon","propIcon","iconAfter","iconRotatorProps","floating","buttonType","disableDropdownIcon","children","remaining","visible","setVisible","defaultFocusIndex","renderAsSheet","isPhone","isSheet","dropdownIcon","rotated","aria-haspopup","aria-expanded","undefined","event","current","prevVisible","key","preventDefault","stopPropagation"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,UAAU,QAAQ,QAAQ;AACnC,SAASC,MAAM,QAA0B,sBAAsB;AAC/D,SAASC,OAAO,QAAQ,wBAAwB;AAChD,SAASC,WAAW,QAA+B,yBAAyB;AAE5E,SAASC,UAAU,QAAQ,sCAAsC;AACjE,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,oBAAoB,QAAQ,iCAAiC;AACtE,SAASC,iBAAiB,QAAQ,8BAA8B;AAEhE,MAAMC,OAAO;AACX,aAAa;AACf;AAwCA;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAAaT,WACxB,SAASS,WAAWC,KAAK,EAAEC,GAAG;IAC5B,MAAM,EACJC,IAAIC,MAAM,EACVC,UAAUN,IAAI,EACdO,YAAYP,IAAI,EAChBQ,MAAMC,QAAQ,EACdC,YAAY,IAAI,EAChBC,gBAAgB,EAChBC,QAAQ,EACRC,aAAaD,WAAW,SAAS,MAAM,EACvCE,sBAAsBD,eAAe,MAAM,EAC3CE,QAAQ,EACR,GAAGC,WACJ,GAAGd;IACJ,MAAME,KAAKP,aAAaQ,QAAQ;IAChC,MAAM,EAAEY,OAAO,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GAAGpB;IACnD,MAAM,EAAEqB,aAAa,EAAE,GAAGtB;IAC1B,MAAM,EAAEuB,OAAO,EAAE,GAAGzB;IACpB,MAAM0B,UACJF,kBAAkB,QAASA,kBAAkB,WAAWC;IAE1D,MAAME,eAAe7B,QAAQ,YAAYe;IACzC,IAAID,OAAOC;IACX,IAAI,CAACK,qBAAqB;QACxBN,qBACE,KAACb;YAAa,GAAGgB,gBAAgB;YAAEa,SAASP;sBACzCM;;IAGP;IAEA,qBACE,MAAC9B;QACE,GAAGuB,SAAS;QACbS,iBAAeH,UAAU,WAAW;QACpCI,iBAAeT,WAAWU;QAC1BvB,IAAIA;QACJD,KAAKA;QACLS,UAAUA;QACVC,YAAYA;QACZP,SAAS,CAACsB;YACRtB,QAAQsB;YAERT,kBAAkBU,OAAO,GAAG;YAC5BX,WAAW,CAACY,cAAgB,CAACA;QAC/B;QACAvB,WAAW,CAACqB;YACVrB,UAAUqB;YAEV,OAAQA,MAAMG,GAAG;gBACf,KAAK;oBACHH,MAAMI,cAAc;oBACpBJ,MAAMK,eAAe;oBACrBd,kBAAkBU,OAAO,GAAG;oBAC5BX,WAAW;oBACX;gBACF,KAAK;oBACHU,MAAMI,cAAc;oBACpBJ,MAAMK,eAAe;oBACrBd,kBAAkBU,OAAO,GAAG,CAAC;oBAC7BX,WAAW;oBACX;YACJ;QACF;;YAEC,CAACR,aAAaF;YACdO;YACAL,aAAaF;;;AAGpB,GACA"}
1
+ {"version":3,"sources":["../../src/menu/MenuButton.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef } from \"react\";\nimport { Button, type ButtonProps } from \"../button/Button.js\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { IconRotator, type IconRotatorProps } from \"../icon/IconRotator.js\";\nimport { type TextIconSpacingProps } from \"../icon/TextIconSpacing.js\";\nimport { useAppSize } from \"../media-queries/AppSizeProvider.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useMenuConfiguration } from \"./MenuConfigurationProvider.js\";\nimport { useMenuVisibility } from \"./MenuVisibilityProvider.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @since 5.0.0 */\nexport type MenuButtonTextIconSpacingProps = Pick<\n TextIconSpacingProps,\n \"icon\" | \"iconAfter\"\n>;\n\n/** @since 5.0.0 */\nexport type MenuButtonIconRotatorProps = Omit<\n IconRotatorProps,\n \"children\" | \"rotated\"\n>;\n\n/**\n * @since 5.0.0\n * @since 6.0.0 No longer extends the {@link ButtonProps}, no longer\n * requires an `id`, and no longer supports `textIconSpacingProps`.\n */\nexport interface BaseMenuButtonProps extends MenuButtonTextIconSpacingProps {\n /**\n * Any additional props to pass to the {@link IconRotator} component that\n * surrounds the {@link buttonChildren}\n */\n iconRotatorProps?: Readonly<MenuButtonIconRotatorProps>;\n\n /**\n * Boolean if the dropdown icon should be included with the button children.\n *\n * @defaultValue `buttonType === \"icon\"`\n */\n disableDropdownIcon?: boolean;\n}\n\n/**\n * @since 5.0.0\n * @since 6.0.0 See {@link BaseMenuButtonProps} for breaking changes.\n */\nexport interface MenuButtonProps extends ButtonProps, BaseMenuButtonProps {}\n\n/**\n * **Client Component**\n *\n * An internal component that handles rendering a button for the `DropdownMenu`\n * while implementing the correct accessibility and keyboard movement.\n *\n * @since 5.0.0\n * @since 6.0.0 See {@link BaseMenuButtonProps} for breaking changes.\n */\nexport const MenuButton = forwardRef<HTMLButtonElement, MenuButtonProps>(\n function MenuButton(props, ref) {\n const {\n id: propId,\n onClick = noop,\n onKeyDown = noop,\n icon: propIcon,\n iconAfter = true,\n iconRotatorProps,\n floating,\n buttonType = floating ? \"icon\" : \"text\",\n disableDropdownIcon = buttonType === \"icon\",\n children,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"menubutton\");\n const { visible, setVisible, defaultFocusIndex } = useMenuVisibility();\n const { renderAsSheet } = useMenuConfiguration();\n const { isPhone } = useAppSize();\n const isSheet =\n renderAsSheet === true || (renderAsSheet === \"phone\" && isPhone);\n\n const dropdownIcon = getIcon(\"dropdown\", propIcon);\n let icon = propIcon;\n if (!disableDropdownIcon) {\n icon = (\n <IconRotator {...iconRotatorProps} rotated={visible}>\n {dropdownIcon}\n </IconRotator>\n );\n }\n\n return (\n <Button\n {...remaining}\n aria-haspopup={isSheet ? \"dialog\" : \"menu\"}\n aria-expanded={visible || undefined}\n id={id}\n ref={ref}\n floating={floating}\n buttonType={buttonType}\n onClick={(event) => {\n onClick(event);\n\n defaultFocusIndex.current = 0;\n setVisible((prevVisible) => !prevVisible);\n }}\n onKeyDown={(event) => {\n onKeyDown(event);\n\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault();\n event.stopPropagation();\n defaultFocusIndex.current = 0;\n setVisible(true);\n break;\n case \"ArrowUp\":\n event.preventDefault();\n event.stopPropagation();\n defaultFocusIndex.current = -1;\n setVisible(true);\n break;\n }\n }}\n >\n {!iconAfter && icon}\n {children}\n {iconAfter && icon}\n </Button>\n );\n }\n);\n"],"names":["forwardRef","Button","getIcon","IconRotator","useAppSize","useEnsuredId","useMenuConfiguration","useMenuVisibility","noop","MenuButton","props","ref","id","propId","onClick","onKeyDown","icon","propIcon","iconAfter","iconRotatorProps","floating","buttonType","disableDropdownIcon","children","remaining","visible","setVisible","defaultFocusIndex","renderAsSheet","isPhone","isSheet","dropdownIcon","rotated","aria-haspopup","aria-expanded","undefined","event","current","prevVisible","key","preventDefault","stopPropagation"],"mappings":"AAAA;;AACA,SAASA,UAAU,QAAQ,QAAQ;AACnC,SAASC,MAAM,QAA0B,sBAAsB;AAC/D,SAASC,OAAO,QAAQ,wBAAwB;AAChD,SAASC,WAAW,QAA+B,yBAAyB;AAE5E,SAASC,UAAU,QAAQ,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Ae;oBACrBd,kBAAkBU,OAAO,GAAG;oBAC5BX,WAAW;oBACX;gBACF,KAAK;oBACHU,MAAMI,cAAc;oBACpBJ,MAAMK,eAAe;oBACrBd,kBAAkBU,OAAO,GAAG,CAAC;oBAC7BX,WAAW;oBACX;YACJ;QACF;;YAEC,CAACR,aAAaF;YACdO;YACAL,aAAaF;;;AAGpB,GACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/MenuConfigurationProvider.tsx"],"sourcesContent":["\"use client\";\nimport {\n createContext,\n useContext,\n useMemo,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { type SheetPosition, type SheetVerticalSize } from \"../sheet/styles.js\";\n\n/** @since 5.0.0 */\nexport interface MenuOrientationProps {\n /**\n * Boolean if the menu should be rendered horizontally instead of vertically.\n * This will also update the `aria-orientation`.\n *\n * @defaultValue `false`\n */\n horizontal?: boolean;\n}\n\n/**\n * This allows the menu to be conditionally rendered as a `Sheet` instead of a\n * menu.\n *\n * - `false` - always render as a `Menu`\n * - `true` - always render as a `Sheet`\n * - `\"phone\"` - render as a sheet only when the {@link AppSize} is considered\n * phone (`isPhone === true`).\n *\n * @defaultValue `false`\n * @since 5.0.0\n */\nexport type RenderMenuAsSheet = boolean | \"phone\";\n\n/** @since 5.0.0 */\nexport interface MenuConfiguration extends MenuOrientationProps {\n /** {@inheritDoc RenderMenuAsSheet} */\n renderAsSheet?: RenderMenuAsSheet;\n\n /**\n * @see {@link SheetPosition}\n * @defaultValue `\"bottom\"`\n */\n sheetPosition?: SheetPosition;\n\n /**\n * @see {@link SheetVerticalSize}\n * @defaultValue `\"touch\"`\n */\n sheetVerticalSize?: SheetVerticalSize;\n\n /**\n * Any children to render above the sheet's menu implementation. This would\n * normally be something like a `<DialogHeader>` or `AppBar`.\n *\n * @defaultValue `null`\n */\n sheetHeader?: ReactNode;\n\n /**\n * Any children to render below the sheet's menu implementation. This would\n * normally be something like a `<DialogFooter>`.\n *\n * @defaultValue `null`\n */\n sheetFooter?: ReactNode;\n}\n\n/** @since 5.0.0 */\nexport type MenuConfigurationContext = Required<MenuConfiguration>;\n\n/** @since 5.0.0 */\nexport const DEFAULT_MENU_CONFIGURATION: Readonly<MenuConfiguration> = {\n horizontal: false,\n renderAsSheet: false,\n sheetHeader: null,\n sheetFooter: null,\n sheetPosition: \"bottom\",\n sheetVerticalSize: \"touch\",\n};\n\n/**\n * @internal\n * @since 5.0.0\n */\nconst context = createContext<MenuConfigurationContext>({\n horizontal: false,\n renderAsSheet: false,\n sheetHeader: null,\n sheetFooter: null,\n sheetPosition: \"bottom\",\n sheetVerticalSize: \"touch\",\n});\ncontext.displayName = \"MenuConfiguration\";\n\n/**\n * @internal\n * @since 5.0.0\n */\nconst { Provider } = context;\n\n/**\n * This is probably just an internal only hook that allows you to get the\n * {@link MenuConfigurationContext} with optional overrides.\n *\n * @param overrides - An object of {@link MenuConfiguration} that would override\n * the inherited context values if they are not `undefined`.\n * @returns the {@link MenuConfigurationContext} with any overrides that were\n * provided.\n * @since 5.0.0\n */\nexport function useMenuConfiguration(\n overrides: MenuConfiguration = {}\n): Readonly<MenuConfigurationContext> {\n const {\n horizontal,\n renderAsSheet,\n sheetHeader,\n sheetFooter,\n sheetPosition,\n sheetVerticalSize,\n } = overrides;\n const inherited = useContext(context);\n\n return {\n horizontal: horizontal ?? inherited.horizontal,\n renderAsSheet: renderAsSheet ?? inherited.renderAsSheet,\n sheetHeader:\n sheetHeader === null ? null : sheetHeader ?? inherited.sheetHeader,\n sheetFooter:\n sheetFooter === null ? null : sheetFooter ?? inherited.sheetFooter,\n sheetPosition: sheetPosition ?? inherited.sheetPosition,\n sheetVerticalSize: sheetVerticalSize ?? inherited.sheetVerticalSize,\n };\n}\n\n/** @since 5.0.0 */\nexport interface MenuConfigurationProviderProps extends MenuConfiguration {\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * Note: This will always merge values with any parent\n * `MenuConfigurationProvider`s.\n *\n * @since 5.0.0\n */\nexport function MenuConfigurationProvider(\n props: MenuConfigurationProviderProps\n): ReactElement {\n const { children, ...configuration } = props;\n const {\n horizontal,\n renderAsSheet,\n sheetHeader,\n sheetFooter,\n sheetPosition,\n sheetVerticalSize,\n } = useMenuConfiguration(configuration);\n\n const value = useMemo<MenuConfigurationContext>(\n () => ({\n horizontal,\n renderAsSheet,\n sheetHeader,\n sheetFooter,\n sheetPosition,\n sheetVerticalSize,\n }),\n [\n horizontal,\n renderAsSheet,\n sheetFooter,\n sheetHeader,\n sheetPosition,\n sheetVerticalSize,\n ]\n );\n\n return <Provider value={value}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useMemo","DEFAULT_MENU_CONFIGURATION","horizontal","renderAsSheet","sheetHeader","sheetFooter","sheetPosition","sheetVerticalSize","context","displayName","Provider","useMenuConfiguration","overrides","inherited","MenuConfigurationProvider","props","children","configuration","value"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,OAAO,QAGF,QAAQ;AAiEf,iBAAiB,GACjB,OAAO,MAAMC,6BAA0D;IACrEC,YAAY;IACZC,eAAe;IACfC,aAAa;IACbC,aAAa;IACbC,eAAe;IACfC,mBAAmB;AACrB,EAAE;AAEF;;;CAGC,GACD,MAAMC,wBAAUV,cAAwC;IACtDI,YAAY;IACZC,eAAe;IACfC,aAAa;IACbC,aAAa;IACbC,eAAe;IACfC,mBAAmB;AACrB;AACAC,QAAQC,WAAW,GAAG;AAEtB;;;CAGC,GACD,MAAM,EAAEC,QAAQ,EAAE,GAAGF;AAErB;;;;;;;;;CASC,GACD,OAAO,SAASG,qBACdC,YAA+B,CAAC,CAAC;IAEjC,MAAM,EACJV,UAAU,EACVC,aAAa,EACbC,WAAW,EACXC,WAAW,EACXC,aAAa,EACbC,iBAAiB,EAClB,GAAGK;IACJ,MAAMC,YAAYd,WAAWS;IAE7B,OAAO;QACLN,YAAYA,cAAcW,UAAUX,UAAU;QAC9CC,eAAeA,iBAAiBU,UAAUV,aAAa;QACvDC,aACEA,gBAAgB,OAAO,OAAOA,eAAeS,UAAUT,WAAW;QACpEC,aACEA,gBAAgB,OAAO,OAAOA,eAAeQ,UAAUR,WAAW;QACpEC,eAAeA,iBAAiBO,UAAUP,aAAa;QACvDC,mBAAmBA,qBAAqBM,UAAUN,iBAAiB;IACrE;AACF;AAOA;;;;;;;CAOC,GACD,OAAO,SAASO,0BACdC,KAAqC;IAErC,MAAM,EAAEC,QAAQ,EAAE,GAAGC,eAAe,GAAGF;IACvC,MAAM,EACJb,UAAU,EACVC,aAAa,EACbC,WAAW,EACXC,WAAW,EACXC,aAAa,EACbC,iBAAiB,EAClB,GAAGI,qBAAqBM;IAEzB,MAAMC,QAAQlB,QACZ,IAAO,CAAA;YACLE;YACAC;YACAC;YACAC;YACAC;YACAC;QACF,CAAA,GACA;QACEL;QACAC;QACAE;QACAD;QACAE;QACAC;KACD;IAGH,qBAAO,KAACG;QAASQ,OAAOA;kBAAQF;;AAClC"}
1
+ {"version":3,"sources":["../../src/menu/MenuConfigurationProvider.tsx"],"sourcesContent":["\"use client\";\nimport {\n createContext,\n useContext,\n useMemo,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { type SheetPosition, type SheetVerticalSize } from \"../sheet/styles.js\";\n\n/** @since 5.0.0 */\nexport interface MenuOrientationProps {\n /**\n * Boolean if the menu should be rendered horizontally instead of vertically.\n * This will also update the `aria-orientation`.\n *\n * @defaultValue `false`\n */\n horizontal?: boolean;\n}\n\n/**\n * This allows the menu to be conditionally rendered as a `Sheet` instead of a\n * menu.\n *\n * - `false` - always render as a `Menu`\n * - `true` - always render as a `Sheet`\n * - `\"phone\"` - render as a sheet only when the {@link AppSize} is considered\n * phone (`isPhone === true`).\n *\n * @defaultValue `false`\n * @since 5.0.0\n */\nexport type RenderMenuAsSheet = boolean | \"phone\";\n\n/** @since 5.0.0 */\nexport interface MenuConfiguration extends MenuOrientationProps {\n /** {@inheritDoc RenderMenuAsSheet} */\n renderAsSheet?: RenderMenuAsSheet;\n\n /**\n * @see {@link SheetPosition}\n * @defaultValue `\"bottom\"`\n */\n sheetPosition?: SheetPosition;\n\n /**\n * @see {@link SheetVerticalSize}\n * @defaultValue `\"touch\"`\n */\n sheetVerticalSize?: SheetVerticalSize;\n\n /**\n * Any children to render above the sheet's menu implementation. This would\n * normally be something like a `<DialogHeader>` or `AppBar`.\n *\n * @defaultValue `null`\n */\n sheetHeader?: ReactNode;\n\n /**\n * Any children to render below the sheet's menu implementation. This would\n * normally be something like a `<DialogFooter>`.\n *\n * @defaultValue `null`\n */\n sheetFooter?: ReactNode;\n}\n\n/** @since 5.0.0 */\nexport type MenuConfigurationContext = Required<MenuConfiguration>;\n\n/** @since 5.0.0 */\nexport const DEFAULT_MENU_CONFIGURATION: Readonly<MenuConfiguration> = {\n horizontal: false,\n renderAsSheet: false,\n sheetHeader: null,\n sheetFooter: null,\n sheetPosition: \"bottom\",\n sheetVerticalSize: \"touch\",\n};\n\n/**\n * @internal\n * @since 5.0.0\n */\nconst context = createContext<MenuConfigurationContext>({\n horizontal: false,\n renderAsSheet: false,\n sheetHeader: null,\n sheetFooter: null,\n sheetPosition: \"bottom\",\n sheetVerticalSize: \"touch\",\n});\ncontext.displayName = \"MenuConfiguration\";\n\n/**\n * @internal\n * @since 5.0.0\n */\nconst { Provider } = context;\n\n/**\n * This is probably just an internal only hook that allows you to get the\n * {@link MenuConfigurationContext} with optional overrides.\n *\n * @param overrides - An object of {@link MenuConfiguration} that would override\n * the inherited context values if they are not `undefined`.\n * @returns the {@link MenuConfigurationContext} with any overrides that were\n * provided.\n * @since 5.0.0\n */\nexport function useMenuConfiguration(\n overrides: MenuConfiguration = {}\n): Readonly<MenuConfigurationContext> {\n const {\n horizontal,\n renderAsSheet,\n sheetHeader,\n sheetFooter,\n sheetPosition,\n sheetVerticalSize,\n } = overrides;\n const inherited = useContext(context);\n\n return {\n horizontal: horizontal ?? inherited.horizontal,\n renderAsSheet: renderAsSheet ?? inherited.renderAsSheet,\n sheetHeader:\n sheetHeader === null ? null : (sheetHeader ?? inherited.sheetHeader),\n sheetFooter:\n sheetFooter === null ? null : (sheetFooter ?? inherited.sheetFooter),\n sheetPosition: sheetPosition ?? inherited.sheetPosition,\n sheetVerticalSize: sheetVerticalSize ?? inherited.sheetVerticalSize,\n };\n}\n\n/** @since 5.0.0 */\nexport interface MenuConfigurationProviderProps extends MenuConfiguration {\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * Note: This will always merge values with any parent\n * `MenuConfigurationProvider`s.\n *\n * @since 5.0.0\n */\nexport function MenuConfigurationProvider(\n props: MenuConfigurationProviderProps\n): ReactElement {\n const { children, ...configuration } = props;\n const {\n horizontal,\n renderAsSheet,\n sheetHeader,\n sheetFooter,\n sheetPosition,\n sheetVerticalSize,\n } = useMenuConfiguration(configuration);\n\n const value = useMemo<MenuConfigurationContext>(\n () => ({\n horizontal,\n renderAsSheet,\n sheetHeader,\n sheetFooter,\n sheetPosition,\n sheetVerticalSize,\n }),\n [\n horizontal,\n renderAsSheet,\n sheetFooter,\n sheetHeader,\n sheetPosition,\n sheetVerticalSize,\n ]\n );\n\n return <Provider value={value}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useMemo","DEFAULT_MENU_CONFIGURATION","horizontal","renderAsSheet","sheetHeader","sheetFooter","sheetPosition","sheetVerticalSize","context","displayName","Provider","useMenuConfiguration","overrides","inherited","MenuConfigurationProvider","props","children","configuration","value"],"mappings":"AAAA;;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,OAAO,QAGF,QAAQ;AAiEf,iBAAiB,GACjB,OAAO,MAAMC,6BAA0D;IACrEC,YAAY;IACZC,eAAe;IACfC,aAAa;IACbC,aAAa;IACbC,eAAe;IACfC,mBAAmB;AACrB,EAAE;AAEF;;;CAGC,GACD,MAAMC,wBAAUV,cAAwC;IACtDI,YAAY;IACZC,eAAe;IACfC,aAAa;IACbC,aAAa;IACbC,eAAe;IACfC,mBAAmB;AACrB;AACAC,QAAQC,WAAW,GAAG;AAEtB;;;CAGC,GACD,MAAM,EAAEC,QAAQ,EAAE,GAAGF;AAErB;;;;;;;;;CASC,GACD,OAAO,SAASG,qBACdC,YAA+B,CAAC,CAAC;IAEjC,MAAM,EACJV,UAAU,EACVC,aAAa,EACbC,WAAW,EACXC,WAAW,EACXC,aAAa,EACbC,iBAAiB,EAClB,GAAGK;IACJ,MAAMC,YAAYd,WAAWS;IAE7B,OAAO;QACLN,YAAYA,cAAcW,UAAUX,UAAU;QAC9CC,eAAeA,iBAAiBU,UAAUV,aAAa;QACvDC,aACEA,gBAAgB,OAAO,OAAQA,eAAeS,UAAUT,WAAW;QACrEC,aACEA,gBAAgB,OAAO,OAAQA,eAAeQ,UAAUR,WAAW;QACrEC,eAAeA,iBAAiBO,UAAUP,aAAa;QACvDC,mBAAmBA,qBAAqBM,UAAUN,iBAAiB;IACrE;AACF;AAOA;;;;;;;CAOC,GACD,OAAO,SAASO,0BACdC,KAAqC;IAErC,MAAM,EAAEC,QAAQ,EAAE,GAAGC,eAAe,GAAGF;IACvC,MAAM,EACJb,UAAU,EACVC,aAAa,EACbC,WAAW,EACXC,WAAW,EACXC,aAAa,EACbC,iBAAiB,EAClB,GAAGI,qBAAqBM;IAEzB,MAAMC,QAAQlB,QACZ,IAAO,CAAA;YACLE;YACAC;YACAC;YACAC;YACAC;YACAC;QACF,CAAA,GACA;QACEL;QACAC;QACAE;QACAD;QACAE;QACAC;KACD;IAGH,qBAAO,KAACG;QAASQ,OAAOA;kBAAQF;;AAClC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ListItemProps } from "../list/ListItem.js";
3
2
  /**
4
3
  * @since 5.0.0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/MenuItem.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef } from \"react\";\nimport { ListItem, type ListItemProps } from \"../list/ListItem.js\";\nimport { useKeyboardMovementContext } from \"../movement/useKeyboardMovementProvider.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\n\n/**\n * @since 5.0.0\n */\nexport interface MenuItemProps extends Omit<ListItemProps, \"role\"> {\n /**\n * @defaultValue `\"menuitem\"`\n */\n role?: string;\n\n /**\n * @defaultValue `-1`\n */\n tabIndex?: number;\n}\n\n/**\n * **Client Component**\n *\n * This component is used as an \"action\" within a `Menu`/`DropdownMenu` that\n * implements some keyboard focus behavior. This component should generally have\n * an `onClick` event handler.\n *\n * @since 5.0.0\n */\nexport const MenuItem = forwardRef<HTMLLIElement, MenuItemProps>(\n function MenuItem(props, ref) {\n const {\n id: propId,\n role = \"menuitem\",\n tabIndex: propTabIndex,\n children,\n className,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"menuitem\");\n const { tabIndexBehavior, activeDescendantId } =\n useKeyboardMovementContext();\n const focused = id === activeDescendantId;\n let tabIndex = propTabIndex ?? -1;\n if (tabIndexBehavior === \"roving\" && focused) {\n tabIndex = 0;\n }\n\n return (\n <ListItem\n {...remaining}\n id={id}\n ref={ref}\n role={role}\n tabIndex={tabIndex}\n className={cnb(\n \"rmd-menu-item\",\n tabIndexBehavior === \"virtual\" && focused && \"rmd-menu-item--focused\",\n className\n )}\n >\n {children}\n </ListItem>\n );\n }\n);\n"],"names":["cnb","forwardRef","ListItem","useKeyboardMovementContext","useEnsuredId","MenuItem","props","ref","id","propId","role","tabIndex","propTabIndex","children","className","remaining","tabIndexBehavior","activeDescendantId","focused"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAQ,QAAQ;AACnC,SAASC,QAAQ,QAA4B,sBAAsB;AACnE,SAASC,0BAA0B,QAAQ,6CAA6C;AACxF,SAASC,YAAY,QAAQ,qBAAqB;AAiBlD;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAWJ,WACtB,SAASI,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,IAAIC,MAAM,EACVC,OAAO,UAAU,EACjBC,UAAUC,YAAY,EACtBC,QAAQ,EACRC,SAAS,EACT,GAAGC,WACJ,GAAGT;IAEJ,MAAME,KAAKJ,aAAaK,QAAQ;IAChC,MAAM,EAAEO,gBAAgB,EAAEC,kBAAkB,EAAE,GAC5Cd;IACF,MAAMe,UAAUV,OAAOS;IACvB,IAAIN,WAAWC,gBAAgB,CAAC;IAChC,IAAII,qBAAqB,YAAYE,SAAS;QAC5CP,WAAW;IACb;IAEA,qBACE,KAACT;QACE,GAAGa,SAAS;QACbP,IAAIA;QACJD,KAAKA;QACLG,MAAMA;QACNC,UAAUA;QACVG,WAAWd,IACT,iBACAgB,qBAAqB,aAAaE,WAAW,0BAC7CJ;kBAGDD;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/menu/MenuItem.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef } from \"react\";\nimport { ListItem, type ListItemProps } from \"../list/ListItem.js\";\nimport { useKeyboardMovementContext } from \"../movement/useKeyboardMovementProvider.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\n\n/**\n * @since 5.0.0\n */\nexport interface MenuItemProps extends Omit<ListItemProps, \"role\"> {\n /**\n * @defaultValue `\"menuitem\"`\n */\n role?: string;\n\n /**\n * @defaultValue `-1`\n */\n tabIndex?: number;\n}\n\n/**\n * **Client Component**\n *\n * This component is used as an \"action\" within a `Menu`/`DropdownMenu` that\n * implements some keyboard focus behavior. This component should generally have\n * an `onClick` event handler.\n *\n * @since 5.0.0\n */\nexport const MenuItem = forwardRef<HTMLLIElement, MenuItemProps>(\n function MenuItem(props, ref) {\n const {\n id: propId,\n role = \"menuitem\",\n tabIndex: propTabIndex,\n children,\n className,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"menuitem\");\n const { tabIndexBehavior, activeDescendantId } =\n useKeyboardMovementContext();\n const focused = id === activeDescendantId;\n let tabIndex = propTabIndex ?? -1;\n if (tabIndexBehavior === \"roving\" && focused) {\n tabIndex = 0;\n }\n\n return (\n <ListItem\n {...remaining}\n id={id}\n ref={ref}\n role={role}\n tabIndex={tabIndex}\n className={cnb(\n \"rmd-menu-item\",\n tabIndexBehavior === \"virtual\" && focused && \"rmd-menu-item--focused\",\n className\n )}\n >\n {children}\n </ListItem>\n );\n }\n);\n"],"names":["cnb","forwardRef","ListItem","useKeyboardMovementContext","useEnsuredId","MenuItem","props","ref","id","propId","role","tabIndex","propTabIndex","children","className","remaining","tabIndexBehavior","activeDescendantId","focused"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAQ,QAAQ;AACnC,SAASC,QAAQ,QAA4B,sBAAsB;AACnE,SAASC,0BAA0B,QAAQ,6CAA6C;AACxF,SAASC,YAAY,QAAQ,qBAAqB;AAiBlD;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAWJ,WACtB,SAASI,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,IAAIC,MAAM,EACVC,OAAO,UAAU,EACjBC,UAAUC,YAAY,EACtBC,QAAQ,EACRC,SAAS,EACT,GAAGC,WACJ,GAAGT;IAEJ,MAAME,KAAKJ,aAAaK,QAAQ;IAChC,MAAM,EAAEO,gBAAgB,EAAEC,kBAAkB,EAAE,GAC5Cd;IACF,MAAMe,UAAUV,OAAOS;IACvB,IAAIN,WAAWC,gBAAgB,CAAC;IAChC,IAAII,qBAAqB,YAAYE,SAAS;QAC5CP,WAAW;IACb;IAEA,qBACE,KAACT;QACE,GAAGa,SAAS;QACbP,IAAIA;QACJD,KAAKA;QACLG,MAAMA;QACNC,UAAUA;QACVG,WAAWd,IACT,iBACAgB,qBAAqB,aAAaE,WAAW,0BAC7CJ;kBAGDD;;AAGP,GACA"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseMenuButtonProps } from "./MenuButton.js";
3
2
  import { type MenuItemProps } from "./MenuItem.js";
4
3
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/MenuItemButton.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, useEffect } from \"react\";\nimport { useHoverMode } from \"../hoverMode/useHoverMode.js\";\nimport { IconRotator } from \"../icon/IconRotator.js\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\nimport { useAppSize } from \"../media-queries/AppSizeProvider.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { type BaseMenuButtonProps } from \"./MenuButton.js\";\nimport { useMenuConfiguration } from \"./MenuConfigurationProvider.js\";\nimport { MenuItem, type MenuItemProps } from \"./MenuItem.js\";\nimport { useMenuVisibility } from \"./MenuVisibilityProvider.js\";\nimport { useMenuBarContext } from \"./useMenuBarProvider.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @internal\n * @since 5.0.0\n */\nexport interface MenuItemButtonProps\n extends BaseMenuButtonProps,\n MenuItemProps {}\n\n/**\n * **Client Component**\n *\n * This is just an internal component that handles rendering a submenu as a\n * menuitem for a `DropdownMenu` with a conditional dropdown icon.\n *\n * @internal\n * @since 5.0.0\n */\nexport const MenuItemButton = forwardRef<HTMLLIElement, MenuItemButtonProps>(\n function MenuItemButton(props, ref) {\n const {\n id: propId,\n children,\n onClick = noop,\n onKeyDown = noop,\n onMouseEnter = noop,\n onMouseLeave = noop,\n rightAddon: propRightAddon,\n iconRotatorProps,\n disableDropdownIcon = typeof propRightAddon !== \"undefined\",\n ...remaining\n } = props;\n const { disabled } = props;\n\n const id = useEnsuredId(propId, \"menuitem\");\n const mode = useUserInteractionMode();\n const { renderAsSheet } = useMenuConfiguration();\n const { isPhone } = useAppSize();\n const isSheet =\n renderAsSheet === true || (renderAsSheet === \"phone\" && isPhone);\n const {\n root,\n menubar,\n activeId,\n enableHoverMode,\n disableHoverMode,\n startDisableTimer,\n clearDisableTimer,\n leaveTimeoutRef,\n hoverTimeoutRef,\n } = useMenuBarContext();\n const { visible, setVisible, defaultFocusIndex } = useMenuVisibility();\n const { startShowFlow, clearVisibilityTimeout } = useHoverMode({\n setVisible,\n enableHoverMode,\n disableHoverMode,\n startDisableTimer,\n leaveTimeoutRef,\n hoverTimeoutRef,\n clearDisableTimer,\n });\n const { horizontal } = useMenuConfiguration();\n\n useEffect(() => {\n setVisible(id === activeId);\n }, [activeId, defaultFocusIndex, id, menubar, setVisible]);\n\n const dropdownIcon = getIcon(root ? \"dropdown\" : \"forward\");\n let rightAddon = propRightAddon;\n if (!disableDropdownIcon) {\n rightAddon = (\n <IconRotator {...iconRotatorProps} rotated={visible}>\n {dropdownIcon}\n </IconRotator>\n );\n }\n\n const updateVisibility = (nextVisible: boolean, focusIndex = 0): void => {\n defaultFocusIndex.current = focusIndex;\n setVisible(nextVisible);\n if (!menubar) {\n return;\n }\n\n if (nextVisible) {\n enableHoverMode(id);\n } else {\n disableHoverMode();\n }\n };\n\n return (\n <MenuItem\n {...remaining}\n aria-haspopup={isSheet ? \"dialog\" : \"menu\"}\n aria-expanded={visible || undefined}\n id={id}\n ref={ref}\n rightAddon={rightAddon}\n onClick={(event) => {\n onClick(event);\n\n event.stopPropagation();\n updateVisibility(!visible);\n }}\n onKeyDown={(event) => {\n onKeyDown(event);\n\n switch (event.key) {\n case \"ArrowDown\":\n if (horizontal || root) {\n event.preventDefault();\n event.stopPropagation();\n updateVisibility(true);\n }\n break;\n case \"ArrowRight\":\n if (!horizontal && !root) {\n event.preventDefault();\n event.stopPropagation();\n updateVisibility(true);\n }\n break;\n }\n }}\n onMouseEnter={(event) => {\n onMouseEnter(event);\n if (mode === \"touch\" || disabled || !menubar) {\n return;\n }\n\n defaultFocusIndex.current = 0;\n startShowFlow(id);\n }}\n onMouseLeave={(event) => {\n onMouseLeave(event);\n if (mode === \"touch\" || disabled || !menubar) {\n return;\n }\n\n clearVisibilityTimeout();\n }}\n >\n {children}\n </MenuItem>\n );\n }\n);\n"],"names":["forwardRef","useEffect","useHoverMode","IconRotator","getIcon","useUserInteractionMode","useAppSize","useEnsuredId","useMenuConfiguration","MenuItem","useMenuVisibility","useMenuBarContext","noop","MenuItemButton","props","ref","id","propId","children","onClick","onKeyDown","onMouseEnter","onMouseLeave","rightAddon","propRightAddon","iconRotatorProps","disableDropdownIcon","remaining","disabled","mode","renderAsSheet","isPhone","isSheet","root","menubar","activeId","enableHoverMode","disableHoverMode","startDisableTimer","clearDisableTimer","leaveTimeoutRef","hoverTimeoutRef","visible","setVisible","defaultFocusIndex","startShowFlow","clearVisibilityTimeout","horizontal","dropdownIcon","rotated","updateVisibility","nextVisible","focusIndex","current","aria-haspopup","aria-expanded","undefined","event","stopPropagation","key","preventDefault"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,UAAU,EAAEC,SAAS,QAAQ,QAAQ;AAC9C,SAASC,YAAY,QAAQ,+BAA+B;AAC5D,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,OAAO,QAAQ,wBAAwB;AAChD,SAASC,sBAAsB,QAAQ,gDAAgD;AACvF,SAASC,UAAU,QAAQ,sCAAsC;AACjE,SAASC,YAAY,QAAQ,qBAAqB;AAElD,SAASC,oBAAoB,QAAQ,iCAAiC;AACtE,SAASC,QAAQ,QAA4B,gBAAgB;AAC7D,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,iBAAiB,QAAQ,0BAA0B;AAE5D,MAAMC,OAAO;AACX,aAAa;AACf;AAUA;;;;;;;;CAQC,GACD,OAAO,MAAMC,+BAAiBb,WAC5B,SAASa,eAAeC,KAAK,EAAEC,GAAG;IAChC,M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gBAAgBpB;QAClB,OAAO;YACLqB;QACF;IACF;IAEA,qBACE,KAAC5B;QACE,GAAGkB,SAAS;QACb2B,iBAAetB,UAAU,WAAW;QACpCuB,iBAAeb,WAAWc;QAC1BxC,IAAIA;QACJD,KAAKA;QACLQ,YAAYA;QACZJ,SAAS,CAACsC;YACRtC,QAAQsC;YAERA,MAAMC,eAAe;YACrBR,iBAAiB,CAACR;QACpB;QACAtB,WAAW,CAACqC;YACVrC,UAAUqC;YAEV,OAAQA,MAAME,GAAG;gBACf,KAAK;oBACH,IAAIZ,cAAcd,MAAM;wBACtBwB,MAAMG,cAAc;wBACpBH,MAAMC,eAAe;wBACrBR,iBAAiB;oBACnB;oBACA;gBACF,KAAK;oBACH,IAAI,CAACH,cAAc,CAACd,MAAM;wBACxBwB,MAAMG,cAAc;wBACpBH,MAAMC,eAAe;wBACrBR,iBAAiB;oBACnB;oBACA;YACJ;QACF;QACA7B,cAAc,CAACoC;YACbpC,aAAaoC;YACb,IAAI5B,SAAS,WAAWD,YAAY,CAACM,SAAS;gBAC5C;YACF;YAEAU,kBAAkBS,OAAO,GAAG;YAC5BR,cAAc7B;QAChB;QACAM,cAAc,CAACmC;YACbnC,aAAamC;YACb,IAAI5B,SAAS,WAAWD,YAAY,CAACM,SAAS;gBAC5C;YACF;YAEAY;QACF;kBAEC5B;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/menu/MenuItemButton.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, useEffect } from \"react\";\nimport { useHoverMode } from \"../hoverMode/useHoverMode.js\";\nimport { IconRotator } from \"../icon/IconRotator.js\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\nimport { useAppSize } from \"../media-queries/AppSizeProvider.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { type BaseMenuButtonProps } from \"./MenuButton.js\";\nimport { useMenuConfiguration } from \"./MenuConfigurationProvider.js\";\nimport { MenuItem, type MenuItemProps } from \"./MenuItem.js\";\nimport { useMenuVisibility } from \"./MenuVisibilityProvider.js\";\nimport { useMenuBarContext } from \"./useMenuBarProvider.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @internal\n * @since 5.0.0\n */\nexport interface MenuItemButtonProps\n extends BaseMenuButtonProps,\n MenuItemProps {}\n\n/**\n * **Client Component**\n *\n * This is just an internal component that handles rendering a submenu as a\n * menuitem for a `DropdownMenu` with a conditional dropdown icon.\n *\n * @internal\n * @since 5.0.0\n */\nexport const MenuItemButton = forwardRef<HTMLLIElement, MenuItemButtonProps>(\n function MenuItemButton(props, ref) {\n const {\n id: propId,\n children,\n onClick = noop,\n onKeyDown = noop,\n onMouseEnter = noop,\n onMouseLeave = noop,\n rightAddon: propRightAddon,\n iconRotatorProps,\n disableDropdownIcon = typeof propRightAddon !== \"undefined\",\n ...remaining\n } = props;\n const { disabled } = props;\n\n const id = useEnsuredId(propId, \"menuitem\");\n const mode = useUserInteractionMode();\n const { renderAsSheet } = useMenuConfiguration();\n const { isPhone } = useAppSize();\n const isSheet =\n renderAsSheet === true || (renderAsSheet === \"phone\" && isPhone);\n const {\n root,\n menubar,\n activeId,\n enableHoverMode,\n disableHoverMode,\n startDisableTimer,\n clearDisableTimer,\n leaveTimeoutRef,\n hoverTimeoutRef,\n } = useMenuBarContext();\n const { visible, setVisible, defaultFocusIndex } = useMenuVisibility();\n const { startShowFlow, clearVisibilityTimeout } = useHoverMode({\n setVisible,\n enableHoverMode,\n disableHoverMode,\n startDisableTimer,\n leaveTimeoutRef,\n hoverTimeoutRef,\n clearDisableTimer,\n });\n const { horizontal } = useMenuConfiguration();\n\n useEffect(() => {\n setVisible(id === activeId);\n }, [activeId, defaultFocusIndex, id, menubar, setVisible]);\n\n const dropdownIcon = getIcon(root ? \"dropdown\" : \"forward\");\n let rightAddon = propRightAddon;\n if (!disableDropdownIcon) {\n rightAddon = (\n <IconRotator {...iconRotatorProps} rotated={visible}>\n {dropdownIcon}\n </IconRotator>\n );\n }\n\n const updateVisibility = (nextVisible: boolean, focusIndex = 0): void => {\n defaultFocusIndex.current = focusIndex;\n setVisible(nextVisible);\n if (!menubar) {\n return;\n }\n\n if (nextVisible) {\n enableHoverMode(id);\n } else {\n disableHoverMode();\n }\n };\n\n return (\n <MenuItem\n {...remaining}\n aria-haspopup={isSheet ? \"dialog\" : \"menu\"}\n aria-expanded={visible || undefined}\n id={id}\n ref={ref}\n rightAddon={rightAddon}\n onClick={(event) => {\n onClick(event);\n\n event.stopPropagation();\n updateVisibility(!visible);\n }}\n onKeyDown={(event) => {\n onKeyDown(event);\n\n switch (event.key) {\n case \"ArrowDown\":\n if (horizontal || root) {\n event.preventDefault();\n event.stopPropagation();\n updateVisibility(true);\n }\n break;\n case \"ArrowRight\":\n if (!horizontal && !root) {\n event.preventDefault();\n event.stopPropagation();\n updateVisibility(true);\n }\n break;\n }\n }}\n onMouseEnter={(event) => {\n onMouseEnter(event);\n if (mode === \"touch\" || disabled || !menubar) {\n return;\n }\n\n defaultFocusIndex.current = 0;\n startShowFlow(id);\n }}\n onMouseLeave={(event) => {\n onMouseLeave(event);\n if (mode === \"touch\" || disabled || !menubar) {\n return;\n }\n\n clearVisibilityTimeout();\n }}\n >\n {children}\n </MenuItem>\n );\n }\n);\n"],"names":["forwardRef","useEffect","useHoverMode","IconRotator","getIcon","useUserInteractionMode","useAppSize","useEnsuredId","useMenuConfiguration","MenuItem","useMenuVisibility","useMenuBarContext","noop","MenuItemButton","props","ref","id","propId","children","onClick","onKeyDown","onMouseEnter","onMouseLeave","rightAddon","propRightAddon","iconRotatorProps","disableDropdownIcon","remaining","disabled","mode","renderAsSheet","isPhone","isSheet","root","menubar","activeId","enableHoverMode","disableHoverMode","startDisableTimer","clearDisableTimer","leaveTimeoutRef","hoverTimeoutRef","visible","setVisible","defaultFocusIndex","startShowFlow","clearVisibilityTimeout","horizontal","dropdownIcon","rotated","updateVisibility","nextVisible","focusIndex","current","aria-haspopup","aria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ACF;YAEAU,kBAAkBS,OAAO,GAAG;YAC5BR,cAAc7B;QAChB;QACAM,cAAc,CAACmC;YACbnC,aAAamC;YACb,IAAI5B,SAAS,WAAWD,YAAY,CAACM,SAAS;gBAC5C;YACF;YAEAY;QACF;kBAEC5B;;AAGP,GACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/MenuItemCircularProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { ListItemChildren } from \"../list/ListItemChildren.js\";\nimport { listItem } from \"../list/listItemStyles.js\";\nimport {\n type ListItemChildrenProps,\n type ListItemHeight,\n} from \"../list/types.js\";\nimport {\n CircularProgress,\n type CircularProgressProps,\n} from \"../progress/CircularProgress.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface MenuItemCircularProgressProps extends CircularProgressProps {\n /** @defaultValue `\"Loading\"` */\n \"aria-label\"?: string;\n\n /** @defaultValue `\"none\"` */\n role?: string;\n\n /** @defaultValue `true` */\n dense?: boolean;\n\n liProps?: HTMLAttributes<HTMLLIElement>;\n height?: ListItemHeight;\n leftAddon?: ReactNode;\n rightAddon?: ReactNode;\n listItemChildrenProps?: ListItemChildrenProps;\n}\n\n/**\n * @example Simple Example\n * ```tsx\n * \"use client\";\n * import {\n * DropdownMenu,\n * MenuItem,\n * MenuItemCircularProgress,\n * useAsyncFunction,\n * } from \"@react-md/core\";\n *\n * function Example() {\n * const { handleAsync, pending } = useAsyncFunction();\n * const [visible, setVisible] = useState(false);\n *\n * return (\n * <DropdownMenu buttonChildren=\"Options\" visible={visible} setVisible={setVisible}>\n * {pending && <MenuItemCircularProgress />}\n * <MenuItem\n * onClick={handleAsync(async (event) => {\n * // prevent menu from closing until action completes\n * event.stopPropagation()\n *\n * // do something async\n * await ...\n *\n * // close menu once completed\n * setVisible(false)\n * })}\n * >\n * Some Action\n * </MenuItem>\n * </DropdownMenu>\n * )\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport const MenuItemCircularProgress = forwardRef<\n HTMLLIElement,\n MenuItemCircularProgressProps\n>(function MenuItemCircularProgress(props, ref) {\n const {\n \"aria-label\": propAriaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n role = \"none\",\n className,\n height,\n leftAddon,\n rightAddon,\n liProps,\n listItemChildrenProps,\n ...remaining\n } = props;\n let ariaLabel = propAriaLabel;\n if (!ariaLabel && !ariaLabelledBy) {\n ariaLabel = \"Loading\";\n }\n\n return (\n <li\n {...liProps}\n ref={ref}\n role={role}\n className={cnb(listItem({ height, className }), liProps?.className)}\n >\n <ListItemChildren\n {...listItemChildrenProps}\n leftAddon={leftAddon}\n rightAddon={rightAddon}\n >\n <CircularProgress\n aria-label={ariaLabel as string}\n aria-labelledby={ariaLabelledBy}\n dense\n {...remaining}\n />\n </ListItemChildren>\n </li>\n );\n});\n"],"names":["cnb","forwardRef","ListItemChildren","listItem","CircularProgress","MenuItemCircularProgress","props","ref","propAriaLabel","ariaLabelledBy","role","className","height","leftAddon","rightAddon","liProps","listItemChildrenProps","remaining","ariaLabel","li","aria-label","aria-labelledby","dense"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAA6C,QAAQ;AACxE,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,QAAQ,QAAQ,4BAA4B;AAKrD,SACEC,gBAAgB,QAEX,kCAAkC;AAsBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,GACD,OAAO,MAAMC,yCAA2BJ,WAGtC,SAASI,yBAAyBC,KAAK,EAAEC,GAAG;IAC5C,MAAM,EACJ,cAAcC,aAAa,EAC3B,mBAAmBC,cAAc,EACjCC,OAAO,MAAM,EACbC,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,OAAO,EACPC,qBAAqB,EACrB,GAAGC,WACJ,GAAGX;IACJ,IAAIY,YAAYV;IAChB,IAAI,CAACU,aAAa,CAACT,gBAAgB;QACjCS,YAAY;IACd;IAEA,qBACE,KAACC;QACE,GAAGJ,OAAO;QACXR,KAAKA;QACLG,MAAMA;QACNC,WAAWX,IAAIG,SAAS;YAAES;YAAQD;QAAU,IAAII,SAASJ;kBAEzD,cAAA,KAACT;YACE,GAAGc,qBAAqB;YACzBH,WAAWA;YACXC,YAAYA;sBAEZ,cAAA,KAACV;gBACCgB,cAAYF;gBACZG,mBAAiBZ;gBACjBa,KAAK;gBACJ,GAAGL,SAAS;;;;AAKvB,GAAG"}
1
+ {"version":3,"sources":["../../src/menu/MenuItemCircularProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { ListItemChildren } from \"../list/ListItemChildren.js\";\nimport { listItem } from \"../list/listItemStyles.js\";\nimport {\n type ListItemChildrenProps,\n type ListItemHeight,\n} from \"../list/types.js\";\nimport {\n CircularProgress,\n type CircularProgressProps,\n} from \"../progress/CircularProgress.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface MenuItemCircularProgressProps extends CircularProgressProps {\n /** @defaultValue `\"Loading\"` */\n \"aria-label\"?: string;\n\n /** @defaultValue `\"none\"` */\n role?: string;\n\n /** @defaultValue `true` */\n dense?: boolean;\n\n liProps?: HTMLAttributes<HTMLLIElement>;\n height?: ListItemHeight;\n leftAddon?: ReactNode;\n rightAddon?: ReactNode;\n listItemChildrenProps?: ListItemChildrenProps;\n}\n\n/**\n * @example Simple Example\n * ```tsx\n * \"use client\";\n * import {\n * DropdownMenu,\n * MenuItem,\n * MenuItemCircularProgress,\n * useAsyncFunction,\n * } from \"@react-md/core\";\n *\n * function Example() {\n * const { handleAsync, pending } = useAsyncFunction();\n * const [visible, setVisible] = useState(false);\n *\n * return (\n * <DropdownMenu buttonChildren=\"Options\" visible={visible} setVisible={setVisible}>\n * {pending && <MenuItemCircularProgress />}\n * <MenuItem\n * onClick={handleAsync(async (event) => {\n * // prevent menu from closing until action completes\n * event.stopPropagation()\n *\n * // do something async\n * await ...\n *\n * // close menu once completed\n * setVisible(false)\n * })}\n * >\n * Some Action\n * </MenuItem>\n * </DropdownMenu>\n * )\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport const MenuItemCircularProgress = forwardRef<\n HTMLLIElement,\n MenuItemCircularProgressProps\n>(function MenuItemCircularProgress(props, ref) {\n const {\n \"aria-label\": propAriaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n role = \"none\",\n className,\n height,\n leftAddon,\n rightAddon,\n liProps,\n listItemChildrenProps,\n ...remaining\n } = props;\n let ariaLabel = propAriaLabel;\n if (!ariaLabel && !ariaLabelledBy) {\n ariaLabel = \"Loading\";\n }\n\n return (\n <li\n {...liProps}\n ref={ref}\n role={role}\n className={cnb(listItem({ height, className }), liProps?.className)}\n >\n <ListItemChildren\n {...listItemChildrenProps}\n leftAddon={leftAddon}\n rightAddon={rightAddon}\n >\n <CircularProgress\n aria-label={ariaLabel as string}\n aria-labelledby={ariaLabelledBy}\n dense\n {...remaining}\n />\n </ListItemChildren>\n </li>\n );\n});\n"],"names":["cnb","forwardRef","ListItemChildren","listItem","CircularProgress","MenuItemCircularProgress","props","ref","propAriaLabel","ariaLabelledBy","role","className","height","leftAddon","rightAddon","liProps","listItemChildrenProps","remaining","ariaLabel","li","aria-label","aria-labelledby","dense"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAA6C,QAAQ;AACxE,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,QAAQ,QAAQ,4BAA4B;AAKrD,SACEC,gBAAgB,QAEX,kCAAkC;AAsBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,GACD,OAAO,MAAMC,yCAA2BJ,WAGtC,SAASI,yBAAyBC,KAAK,EAAEC,GAAG;IAC5C,MAAM,EACJ,cAAcC,aAAa,EAC3B,mBAAmBC,cAAc,EACjCC,OAAO,MAAM,EACbC,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,OAAO,EACPC,qBAAqB,EACrB,GAAGC,WACJ,GAAGX;IACJ,IAAIY,YAAYV;IAChB,IAAI,CAACU,aAAa,CAACT,gBAAgB;QACjCS,YAAY;IACd;IAEA,qBACE,KAACC;QACE,GAAGJ,OAAO;QACXR,KAAKA;QACLG,MAAMA;QACNC,WAAWX,IAAIG,SAAS;YAAES;YAAQD;QAAU,IAAII,SAASJ;kBAEzD,cAAA,KAACT;YACE,GAAGc,qBAAqB;YACzBH,WAAWA;YACXC,YAAYA;sBAEZ,cAAA,KAACV;gBACCgB,cAAYF;gBACZG,mBAAiBZ;gBACjBa,KAAK;gBACJ,GAAGL,SAAS;;;;AAKvB,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/MenuItemGroup.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { List, type ListElement, type ListProps } from \"../list/List.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { useMenuConfiguration } from \"./MenuConfigurationProvider.js\";\n\n/** @since 5.0.0 */\nexport type MenuItemGroupProps = LabelRequiredForA11y<\n Omit<ListProps, \"role\">\n> & {\n children: ReactNode;\n};\n\n/**\n * **Client Component**\n *\n * If a menu or menubar contains more than one group of menuitemradio elements,\n * or if the menu contains one group and other, unrelated menu items, authors\n * SHOULD nest each set of related menuitemradio elements in an element using\n * the group role, and authors SHOULD delimit the group from other menu items\n * with an element using the separator role.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemradio}\n *\n * @example Simple Example\n * ```tsx\n * import { ReactElement, useState } from \"react\";\n * import {\n * DropdownMenu,\n * MenuItemGroup,\n * MenuItemRadio,\n * MenuItemSeparator,\n * MenuItemSwitch,\n * } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const [value, setValue] = useState(\"value1\");\n * const [checked, setChecked] = useState(false);\n *\n * return (\n * <DropdownMenu id=\"dropdown-menu-id\" buttonChildren=\"Button\">\n * <MenuItemSwitch\n * id=\"switch-id\"\n * checked={checked}\n * onCheckedChange={nextChecked => setChecked(nextChecked)}\n * >\n * Light mode\n * </MenuItemSwitch>\n * <MenuItemSeparator />\n * <MenuItemGroup aria-label=\"My Group Label\">\n * <MenuItemRadio\n * id=\"radio-1\"\n * checked={value === \"value1\"}\n * onCheckedChange={() => setValue(\"value1\")}\n * >\n * Radio 1\n * </MenuItemRadio>\n * <MenuItemRadio\n * id=\"radio-2\"\n * checked={value === \"value2\"}\n * onCheckedChange={() => setValue(\"value2\")}\n * >\n * Radio 2\n * </MenuItemRadio>\n * <MenuItemRadio\n * id=\"radio-3\"\n * checked={value === \"value3\"}\n * onCheckedChange={() => setValue(\"value3\")}\n * >\n * Radio 3\n * </MenuItemRadio>\n * </MenuItemGroup>\n * </DropdownMenu>\n * );\n * }\n * ```\n *\n * @since 5.0.0\n */\nexport const MenuItemGroup = forwardRef<ListElement, MenuItemGroupProps>(\n function MenuItemGroup({ children, className, ...props }, ref) {\n const { horizontal } = useMenuConfiguration(props);\n return (\n <List\n {...props}\n ref={ref}\n role=\"group\"\n className={cnb(\"rmd-menu-item-group\", className)}\n horizontal={horizontal}\n >\n {children}\n </List>\n );\n }\n);\n"],"names":["cnb","forwardRef","List","useMenuConfiguration","MenuItemGroup","children","className","props","ref","horizontal","role"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAwB,QAAQ;AACnD,SAASC,IAAI,QAA0C,kBAAkB;AAEzE,SAASC,oBAAoB,QAAQ,iCAAiC;AAStE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEC,GACD,OAAO,MAAMC,8BAAgBH,WAC3B,SAASG,cAAc,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,OAAO,EAAEC,GAAG;IAC3D,MAAM,EAAEC,UAAU,EAAE,GAAGN,qBAAqBI;IAC5C,qBACE,KAACL;QACE,GAAGK,KAAK;QACTC,KAAKA;QACLE,MAAK;QACLJ,WAAWN,IAAI,uBAAuBM;QACtCG,YAAYA;kBAEXJ;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/menu/MenuItemGroup.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { List, type ListElement, type ListProps } from \"../list/List.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { useMenuConfiguration } from \"./MenuConfigurationProvider.js\";\n\n/** @since 5.0.0 */\nexport type MenuItemGroupProps = LabelRequiredForA11y<\n Omit<ListProps, \"role\">\n> & {\n children: ReactNode;\n};\n\n/**\n * **Client Component**\n *\n * If a menu or menubar contains more than one group of menuitemradio elements,\n * or if the menu contains one group and other, unrelated menu items, authors\n * SHOULD nest each set of related menuitemradio elements in an element using\n * the group role, and authors SHOULD delimit the group from other menu items\n * with an element using the separator role.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemradio}\n *\n * @example Simple Example\n * ```tsx\n * import { ReactElement, useState } from \"react\";\n * import {\n * DropdownMenu,\n * MenuItemGroup,\n * MenuItemRadio,\n * MenuItemSeparator,\n * MenuItemSwitch,\n * } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const [value, setValue] = useState(\"value1\");\n * const [checked, setChecked] = useState(false);\n *\n * return (\n * <DropdownMenu id=\"dropdown-menu-id\" buttonChildren=\"Button\">\n * <MenuItemSwitch\n * id=\"switch-id\"\n * checked={checked}\n * onCheckedChange={nextChecked => setChecked(nextChecked)}\n * >\n * Light mode\n * </MenuItemSwitch>\n * <MenuItemSeparator />\n * <MenuItemGroup aria-label=\"My Group Label\">\n * <MenuItemRadio\n * id=\"radio-1\"\n * checked={value === \"value1\"}\n * onCheckedChange={() => setValue(\"value1\")}\n * >\n * Radio 1\n * </MenuItemRadio>\n * <MenuItemRadio\n * id=\"radio-2\"\n * checked={value === \"value2\"}\n * onCheckedChange={() => setValue(\"value2\")}\n * >\n * Radio 2\n * </MenuItemRadio>\n * <MenuItemRadio\n * id=\"radio-3\"\n * checked={value === \"value3\"}\n * onCheckedChange={() => setValue(\"value3\")}\n * >\n * Radio 3\n * </MenuItemRadio>\n * </MenuItemGroup>\n * </DropdownMenu>\n * );\n * }\n * ```\n *\n * @since 5.0.0\n */\nexport const MenuItemGroup = forwardRef<ListElement, MenuItemGroupProps>(\n function MenuItemGroup({ children, className, ...props }, ref) {\n const { horizontal } = useMenuConfiguration(props);\n return (\n <List\n {...props}\n ref={ref}\n role=\"group\"\n className={cnb(\"rmd-menu-item-group\", className)}\n horizontal={horizontal}\n >\n {children}\n </List>\n );\n }\n);\n"],"names":["cnb","forwardRef","List","useMenuConfiguration","MenuItemGroup","children","className","props","ref","horizontal","role"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAwB,QAAQ;AACnD,SAASC,IAAI,QAA0C,kBAAkB;AAEzE,SAASC,oBAAoB,QAAQ,iCAAiC;AAStE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEC,GACD,OAAO,MAAMC,8BAAgBH,WAC3B,SAASG,cAAc,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,OAAO,EAAEC,GAAG;IAC3D,MAAM,EAAEC,UAAU,EAAE,GAAGN,qBAAqBI;IAC5C,qBACE,KAACL;QACE,GAAGK,KAAK;QACTC,KAAKA;QACLE,MAAK;QACLJ,WAAWN,IAAI,uBAAuBM;QACtCG,YAAYA;kBAEXJ;;AAGP,GACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/MenuItemSeparator.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { type DividerProps } from \"../divider/Divider.js\";\nimport { divider } from \"../divider/styles.js\";\nimport { useMenuConfiguration } from \"./MenuConfigurationProvider.js\";\n\n/** @since 5.0.0 */\nexport interface MenuItemSeparatorProps\n extends HTMLAttributes<HTMLLIElement>,\n Pick<DividerProps, \"inset\" | \"vertical\"> {}\n\n/**\n * **Client Component**\n *\n * This component renders a `<li role=\"separator\">` with the divider styles. It\n * will also automatically render itself vertically instead of horizontally if\n * the menu is rendering horizontally.\n *\n * @since 5.0.0 Renders as an `<li>` instead of a `<div>` or `<hr />`.\n */\nexport const MenuItemSeparator = forwardRef<\n HTMLLIElement,\n MenuItemSeparatorProps\n>(function MenuItemSeparator(props, ref) {\n const {\n className,\n inset,\n vertical: propVertical,\n children,\n ...remaining\n } = props;\n\n const horizontal = useMenuConfiguration().horizontal;\n const vertical = propVertical ?? horizontal;\n\n return (\n <li\n {...remaining}\n aria-orientation={vertical ? \"vertical\" : undefined}\n ref={ref}\n role=\"separator\"\n className={divider({ inset: inset && !vertical, vertical, className })}\n >\n {children}\n </li>\n );\n});\n"],"names":["forwardRef","divider","useMenuConfiguration","MenuItemSeparator","props","ref","className","inset","vertical","propVertical","children","remaining","horizontal","li","aria-orientation","undefined","role"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,UAAU,QAA6B,QAAQ;AAExD,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,oBAAoB,QAAQ,iCAAiC;AAOtE;;;;;;;;CAQC,GACD,OAAO,MAAMC,kCAAoBH,WAG/B,SAASG,kBAAkBC,KAAK,EAAEC,GAAG;IACrC,MAAM,EACJC,SAAS,EACTC,KAAK,EACLC,UAAUC,YAAY,EACtBC,QAAQ,EACR,GAAGC,WACJ,GAAGP;IAEJ,MAAMQ,aAAaV,uBAAuBU,UAAU;IACpD,MAAMJ,WAAWC,gBAAgBG;IAEjC,qBACE,KAACC;QACE,GAAGF,SAAS;QACbG,oBAAkBN,WAAW,aAAaO;QAC1CV,KAAKA;QACLW,MAAK;QACLV,WAAWL,QAAQ;YAAEM,OAAOA,SAAS,CAACC;YAAUA;YAAUF;QAAU;kBAEnEI;;AAGP,GAAG"}
1
+ {"version":3,"sources":["../../src/menu/MenuItemSeparator.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { type DividerProps } from \"../divider/Divider.js\";\nimport { divider } from \"../divider/styles.js\";\nimport { useMenuConfiguration } from \"./MenuConfigurationProvider.js\";\n\n/** @since 5.0.0 */\nexport interface MenuItemSeparatorProps\n extends HTMLAttributes<HTMLLIElement>,\n Pick<DividerProps, \"inset\" | \"vertical\"> {}\n\n/**\n * **Client Component**\n *\n * This component renders a `<li role=\"separator\">` with the divider styles. It\n * will also automatically render itself vertically instead of horizontally if\n * the menu is rendering horizontally.\n *\n * @since 5.0.0 Renders as an `<li>` instead of a `<div>` or `<hr />`.\n */\nexport const MenuItemSeparator = forwardRef<\n HTMLLIElement,\n MenuItemSeparatorProps\n>(function MenuItemSeparator(props, ref) {\n const {\n className,\n inset,\n vertical: propVertical,\n children,\n ...remaining\n } = props;\n\n const horizontal = useMenuConfiguration().horizontal;\n const vertical = propVertical ?? horizontal;\n\n return (\n <li\n {...remaining}\n aria-orientation={vertical ? \"vertical\" : undefined}\n ref={ref}\n role=\"separator\"\n className={divider({ inset: inset && !vertical, vertical, className })}\n >\n {children}\n </li>\n );\n});\n"],"names":["forwardRef","divider","useMenuConfiguration","MenuItemSeparator","props","ref","className","inset","vertical","propVertical","children","remaining","horizontal","li","aria-orientation","undefined","role"],"mappings":"AAAA;;AACA,SAASA,UAAU,QAA6B,QAAQ;AAExD,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,oBAAoB,QAAQ,iCAAiC;AAOtE;;;;;;;;CAQC,GACD,OAAO,MAAMC,kCAAoBH,WAG/B,SAASG,kBAAkBC,KAAK,EAAEC,GAAG;IACrC,MAAM,EACJC,SAAS,EACTC,KAAK,EACLC,UAAUC,YAAY,EACtBC,QAAQ,EACR,GAAGC,WACJ,GAAGP;IAEJ,MAAMQ,aAAaV,uBAAuBU,UAAU;IACpD,MAAMJ,WAAWC,gBAAgBG;IAEjC,qBACE,KAACC;QACE,GAAGF,SAAS;QACbG,oBAAkBN,WAAW,aAAaO;QAC1CV,KAAKA;QACLW,MAAK;QACLV,WAAWL,QAAQ;YAAEM,OAAOA,SAAS,CAACC;YAAUA;YAAUF;QAAU;kBAEnEI;;AAGP,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/MenuSheet.tsx"],"sourcesContent":["\"use client\";\nimport { type CSSProperties, type ReactElement, type ReactNode } from \"react\";\nimport { Sheet, type BaseSheetProps } from \"../sheet/Sheet.js\";\nimport { type LabelRequiredForA11y, type PropsWithRef } from \"../types.js\";\nimport { type RenderMenuAsSheet } from \"./MenuConfigurationProvider.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0\n */\nexport type MenuSheetConfigurableProps = Omit<\n BaseSheetProps,\n \"visible\" | \"onRequestClose\"\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface MenuSheetConvenienceProps {\n /**\n * This can be used to apply additional props to the `Sheet` component when\n * the `Menu` is being rendered as a `Sheet`.\n *\n * Note: You can override the `style` and `className` using\n * {@link sheetStyle} and {@link sheetClassName} instead for convenience.\n *\n * @example\n * ```tsx\n * <Menu\n * {...props}\n * sheetProps={{\n * style: {\n * // custom inline style\n * },\n * className: \"come-class-name\",\n * horizontalSize: \"touch\",\n * }}\n * />\n * ```\n */\n sheetProps?: PropsWithRef<MenuSheetConfigurableProps, HTMLDivElement>;\n\n /**\n * Convenience prop to apply custom style to the `Sheet` component when the\n * `Menu` is being rendered as a `Sheet`.\n */\n sheetStyle?: CSSProperties;\n\n /**\n * Convenience prop to apply custom class name to the `Sheet` component when\n * the `Menu` is being rendered as a `Sheet`.\n */\n sheetClassName?: string;\n}\n\n/**\n * @internal\n * @since 5.0.0\n * @since 6.0.0 Updated to use the latest menu API.\n */\nexport interface MenuSheetProps extends BaseSheetProps {\n /** {@inheritDoc MenuConfiguration.sheetHeader} */\n header?: ReactNode;\n /** {@inheritDoc MenuConfiguration.sheetFooter} */\n footer?: ReactNode;\n children: ReactNode;\n\n /** @since 6.0.0 */\n enabled: RenderMenuAsSheet;\n}\n\n/**\n * **Client Component**\n *\n * Implements a `Menu` using the `Sheet` component that probably shouldn't\n * really be used externally.\n *\n * @internal\n * @since 5.0.0\n * @since 6.0.0 Added the `enabled` prop and does not render a custom `Menu`\n * implementation.\n */\nexport function MenuSheet(\n props: LabelRequiredForA11y<MenuSheetProps>\n): ReactElement {\n const {\n header,\n footer,\n children,\n onClick = noop,\n overlayProps,\n enabled,\n ...remaining\n } = props;\n const { onRequestClose } = props;\n\n if (!enabled) {\n return <>{children}</>;\n }\n\n return (\n <Sheet\n {...remaining}\n onClick={(event) => {\n onClick(event);\n\n // Prevent closing parent sheet/menus if an element in the header or\n // footer is clicked\n if (\n !(event.target instanceof HTMLElement) ||\n event.target\n .closest('.rmd-menu,[role=\"dialog\"]')\n ?.getAttribute(\"role\") === \"dialog\"\n ) {\n event.stopPropagation();\n }\n }}\n overlayProps={{\n ...overlayProps,\n onClick: (event) => {\n overlayProps?.onClick?.(event);\n\n // prevent closing parent menus if the overlay element is clicked.\n event.stopPropagation();\n onRequestClose();\n },\n }}\n >\n {header}\n {children}\n {footer}\n </Sheet>\n );\n}\n"],"names":["Sheet","noop","MenuSheet","props","header","footer","children","onClick","overlayProps","enabled","remaining","onRequestClose","event","target","HTMLElement","closest","getAttribute","stopPropagation"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAEA,SAASA,KAAK,QAA6B,oBAAoB;AAI/D,MAAMC,OAAO;AACX,aAAa;AACf;AAkEA;;;;;;;;;;CAUC,GACD,OAAO,SAASC,UACdC,KAA2C;IAE3C,MAAM,EACJC,MAAM,EACNC,MAAM,EACNC,QAAQ,EACRC,UAAUN,IAAI,EACdO,YAAY,EACZC,OAAO,EACP,GAAGC,WACJ,GAAGP;IACJ,MAAM,EAAEQ,cAAc,EAAE,GAAGR;IAE3B,IAAI,CAACM,SAAS;QACZ,qBAAO;sBAAGH;;IACZ;IAEA,qBACE,MAACN;QACE,GAAGU,SAAS;QACbH,SAAS,CAACK;YACRL,QAAQK;YAER,oEAAoE;YACpE,oBAAoB;YACpB,IACE,CAAEA,CAAAA,MAAMC,MAAM,YAAYC,WAAU,KACpCF,MAAMC,MAAM,CACTE,OAAO,CAAC,8BACPC,aAAa,YAAY,UAC7B;gBACAJ,MAAMK,eAAe;YACvB;QACF;QACAT,cAAc;YACZ,GAAGA,YAAY;YACfD,SAAS,CAACK;gBACRJ,cAAcD,UAAUK;gBAExB,kEAAkE;gBAClEA,MAAMK,eAAe;gBACrBN;YACF;QACF;;YAECP;YACAE;YACAD;;;AAGP"}
1
+ {"version":3,"sources":["../../src/menu/MenuSheet.tsx"],"sourcesContent":["\"use client\";\nimport { type CSSProperties, type ReactElement, type ReactNode } from \"react\";\nimport { Sheet, type BaseSheetProps } from \"../sheet/Sheet.js\";\nimport { type LabelRequiredForA11y, type PropsWithRef } from \"../types.js\";\nimport { type RenderMenuAsSheet } from \"./MenuConfigurationProvider.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0\n */\nexport type MenuSheetConfigurableProps = Omit<\n BaseSheetProps,\n \"visible\" | \"onRequestClose\"\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface MenuSheetConvenienceProps {\n /**\n * This can be used to apply additional props to the `Sheet` component when\n * the `Menu` is being rendered as a `Sheet`.\n *\n * Note: You can override the `style` and `className` using\n * {@link sheetStyle} and {@link sheetClassName} instead for convenience.\n *\n * @example\n * ```tsx\n * <Menu\n * {...props}\n * sheetProps={{\n * style: {\n * // custom inline style\n * },\n * className: \"come-class-name\",\n * horizontalSize: \"touch\",\n * }}\n * />\n * ```\n */\n sheetProps?: PropsWithRef<MenuSheetConfigurableProps, HTMLDivElement>;\n\n /**\n * Convenience prop to apply custom style to the `Sheet` component when the\n * `Menu` is being rendered as a `Sheet`.\n */\n sheetStyle?: CSSProperties;\n\n /**\n * Convenience prop to apply custom class name to the `Sheet` component when\n * the `Menu` is being rendered as a `Sheet`.\n */\n sheetClassName?: string;\n}\n\n/**\n * @internal\n * @since 5.0.0\n * @since 6.0.0 Updated to use the latest menu API.\n */\nexport interface MenuSheetProps extends BaseSheetProps {\n /** {@inheritDoc MenuConfiguration.sheetHeader} */\n header?: ReactNode;\n /** {@inheritDoc MenuConfiguration.sheetFooter} */\n footer?: ReactNode;\n children: ReactNode;\n\n /** @since 6.0.0 */\n enabled: RenderMenuAsSheet;\n}\n\n/**\n * **Client Component**\n *\n * Implements a `Menu` using the `Sheet` component that probably shouldn't\n * really be used externally.\n *\n * @internal\n * @since 5.0.0\n * @since 6.0.0 Added the `enabled` prop and does not render a custom `Menu`\n * implementation.\n */\nexport function MenuSheet(\n props: LabelRequiredForA11y<MenuSheetProps>\n): ReactElement {\n const {\n header,\n footer,\n children,\n onClick = noop,\n overlayProps,\n enabled,\n ...remaining\n } = props;\n const { onRequestClose } = props;\n\n if (!enabled) {\n return <>{children}</>;\n }\n\n return (\n <Sheet\n {...remaining}\n onClick={(event) => {\n onClick(event);\n\n // Prevent closing parent sheet/menus if an element in the header or\n // footer is clicked\n if (\n !(event.target instanceof HTMLElement) ||\n event.target\n .closest('.rmd-menu,[role=\"dialog\"]')\n ?.getAttribute(\"role\") === \"dialog\"\n ) {\n event.stopPropagation();\n }\n }}\n overlayProps={{\n ...overlayProps,\n onClick: (event) => {\n overlayProps?.onClick?.(event);\n\n // prevent closing parent menus if the overlay element is clicked.\n event.stopPropagation();\n onRequestClose();\n },\n }}\n >\n {header}\n {children}\n {footer}\n </Sheet>\n );\n}\n"],"names":["Sheet","noop","MenuSheet","props","header","footer","children","onClick","overlayProps","enabled","remaining","onRequestClose","event","target","HTMLElement","closest","getAttribute","stopPropagation"],"mappings":"AAAA;;AAEA,SAASA,KAAK,QAA6B,oBAAoB;AAI/D,MAAMC,OAAO;AACX,aAAa;AACf;AAkEA;;;;;;;;;;CAUC,GACD,OAAO,SAASC,UACdC,KAA2C;IAE3C,MAAM,EACJC,MAAM,EACNC,MAAM,EACNC,QAAQ,EACRC,UAAUN,IAAI,EACdO,YAAY,EACZC,OAAO,EACP,GAAGC,WACJ,GAAGP;IACJ,MAAM,EAAEQ,cAAc,EAAE,GAAGR;IAE3B,IAAI,CAACM,SAAS;QACZ,qBAAO;sBAAGH;;IACZ;IAEA,qBACE,MAACN;QACE,GAAGU,SAAS;QACbH,SAAS,CAACK;YACRL,QAAQK;YAER,oEAAoE;YACpE,oBAAoB;YACpB,IACE,CAAEA,CAAAA,MAAMC,MAAM,YAAYC,WAAU,KACpCF,MAAMC,MAAM,CACTE,OAAO,CAAC,8BACPC,aAAa,YAAY,UAC7B;gBACAJ,MAAMK,eAAe;YACvB;QACF;QACAT,cAAc;YACZ,GAAGA,YAAY;YACfD,SAAS,CAACK;gBACRJ,cAAcD,UAAUK;gBAExB,kEAAkE;gBAClEA,MAAMK,eAAe;gBACrBN;YACF;QACF;;YAECP;YACAE;YACAD;;;AAGP"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/MenuVisibilityProvider.tsx"],"sourcesContent":["\"use client\";\nimport {\n createContext,\n useContext,\n useMemo,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { type NonNullMutableRef, type UseStateObject } from \"../types.js\";\n\n/**\n * @since 5.0.0\n * @since 6.0.0 Added the `defaultFocusIndex` ref.\n */\nexport interface MenuVisibilityContext\n extends UseStateObject<\"visible\", boolean> {\n defaultFocusIndex: NonNullMutableRef<number>;\n}\n\n/**\n * @internal\n * @since 5.0.0\n */\nconst context = createContext<MenuVisibilityContext>({\n visible: false,\n setVisible() {\n throw new Error('\"MenuVisibilityProvider\" must be a parent component');\n },\n defaultFocusIndex: { current: 0 },\n});\ncontext.displayName = \"MenuVisibility\";\n\n/**\n * @internal\n * @since 5.0.0\n */\nconst { Provider } = context;\n\n/**\n * This hook allows you control the visibility of a parent menu. The main\n * use-case for this hook is adding a custom sheet header/footer.\n *\n * @example Simple Example\n * ```tsx\n * function SheetFooter(): ReactElement {\n * const { setVisible } = useMenuVisibility();\n *\n * return (\n * <DialogFooter>\n * <Button onClick={() => setVisible(false)}>Cancel</Button>\n * </DialogFooter>\n * );\n * }\n * ```\n *\n * @returns the {@link MenuVisibilityContext}\n * @since 5.0.0\n */\nexport function useMenuVisibility(): Readonly<MenuVisibilityContext> {\n return useContext(context);\n}\n\n/**\n * @internal\n * @since 5.0.0\n */\nexport interface MenuVisibilityProviderProps extends MenuVisibilityContext {\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @internal\n * @since 5.0.0\n */\nexport function MenuVisibilityProvider({\n visible,\n setVisible,\n defaultFocusIndex,\n children,\n}: MenuVisibilityProviderProps): ReactElement {\n const value = useMemo<MenuVisibilityContext>(\n () => ({\n visible,\n setVisible,\n defaultFocusIndex,\n }),\n [visible, setVisible, defaultFocusIndex]\n );\n\n return <Provider value={value}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useMemo","context","visible","setVisible","Error","defaultFocusIndex","current","displayName","Provider","useMenuVisibility","MenuVisibilityProvider","children","value"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,OAAO,QAGF,QAAQ;AAYf;;;CAGC,GACD,MAAMC,wBAAUH,cAAqC;IACnDI,SAAS;IACTC;QACE,MAAM,IAAIC,MAAM;IAClB;IACAC,mBAAmB;QAAEC,SAAS;IAAE;AAClC;AACAL,QAAQM,WAAW,GAAG;AAEtB;;;CAGC,GACD,MAAM,EAAEC,QAAQ,EAAE,GAAGP;AAErB;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASQ;IACd,OAAOV,WAAWE;AACpB;AAUA;;;;;CAKC,GACD,OAAO,SAASS,uBAAuB,EACrCR,OAAO,EACPC,UAAU,EACVE,iBAAiB,EACjBM,QAAQ,EACoB;IAC5B,MAAMC,QAAQZ,QACZ,IAAO,CAAA;YACLE;YACAC;YACAE;QACF,CAAA,GACA;QAACH;QAASC;QAAYE;KAAkB;IAG1C,qBAAO,KAACG;QAASI,OAAOA;kBAAQD;;AAClC"}
1
+ {"version":3,"sources":["../../src/menu/MenuVisibilityProvider.tsx"],"sourcesContent":["\"use client\";\nimport {\n createContext,\n useContext,\n useMemo,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { type NonNullMutableRef, type UseStateObject } from \"../types.js\";\n\n/**\n * @since 5.0.0\n * @since 6.0.0 Added the `defaultFocusIndex` ref.\n */\nexport interface MenuVisibilityContext\n extends UseStateObject<\"visible\", boolean> {\n defaultFocusIndex: NonNullMutableRef<number>;\n}\n\n/**\n * @internal\n * @since 5.0.0\n */\nconst context = createContext<MenuVisibilityContext>({\n visible: false,\n setVisible() {\n throw new Error('\"MenuVisibilityProvider\" must be a parent component');\n },\n defaultFocusIndex: { current: 0 },\n});\ncontext.displayName = \"MenuVisibility\";\n\n/**\n * @internal\n * @since 5.0.0\n */\nconst { Provider } = context;\n\n/**\n * This hook allows you control the visibility of a parent menu. The main\n * use-case for this hook is adding a custom sheet header/footer.\n *\n * @example Simple Example\n * ```tsx\n * function SheetFooter(): ReactElement {\n * const { setVisible } = useMenuVisibility();\n *\n * return (\n * <DialogFooter>\n * <Button onClick={() => setVisible(false)}>Cancel</Button>\n * </DialogFooter>\n * );\n * }\n * ```\n *\n * @returns the {@link MenuVisibilityContext}\n * @since 5.0.0\n */\nexport function useMenuVisibility(): Readonly<MenuVisibilityContext> {\n return useContext(context);\n}\n\n/**\n * @internal\n * @since 5.0.0\n */\nexport interface MenuVisibilityProviderProps extends MenuVisibilityContext {\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @internal\n * @since 5.0.0\n */\nexport function MenuVisibilityProvider({\n visible,\n setVisible,\n defaultFocusIndex,\n children,\n}: MenuVisibilityProviderProps): ReactElement {\n const value = useMemo<MenuVisibilityContext>(\n () => ({\n visible,\n setVisible,\n defaultFocusIndex,\n }),\n [visible, setVisible, defaultFocusIndex]\n );\n\n return <Provider value={value}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useMemo","context","visible","setVisible","Error","defaultFocusIndex","current","displayName","Provider","useMenuVisibility","MenuVisibilityProvider","children","value"],"mappings":"AAAA;;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,OAAO,QAGF,QAAQ;AAYf;;;CAGC,GACD,MAAMC,wBAAUH,cAAqC;IACnDI,SAAS;IACTC;QACE,MAAM,IAAIC,MAAM;IAClB;IACAC,mBAAmB;QAAEC,SAAS;IAAE;AAClC;AACAL,QAAQM,WAAW,GAAG;AAEtB;;;CAGC,GACD,MAAM,EAAEC,QAAQ,EAAE,GAAGP;AAErB;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASQ;IACd,OAAOV,WAAWE;AACpB;AAUA;;;;;CAKC,GACD,OAAO,SAASS,uBAAuB,EACrCR,OAAO,EACPC,UAAU,EACVE,iBAAiB,EACjBM,QAAQ,EACoB;IAC5B,MAAMC,QAAQZ,QACZ,IAAO,CAAA;YACLE;YACAC;YACAE;QACF,CAAA,GACA;QAACH;QAASC;QAAYE;KAAkB;IAG1C,qBAAO,KAACG;QAASI,OAAOA;kBAAQD;;AAClC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/MenuWidget.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, useRef, useState, type HTMLAttributes } from \"react\";\nimport { List } from \"../list/List.js\";\nimport { type GetDefaultFocusedIndex } from \"../movement/types.js\";\nimport { useKeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\nimport { type NonNullMutableRef } from \"../types.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { type MenuListConvenienceProps } from \"./Menu.js\";\nimport { MenuWidgetKeyboardProvider } from \"./MenuWidgetKeyboardProvider.js\";\nimport {\n MenuBarProvider,\n useMenuBarContext,\n useMenuBarProvider,\n} from \"./useMenuBarProvider.js\";\n\nconst styles = bem(\"rmd-menu\");\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0\n */\nexport interface MenuClassNameOptions {\n className?: string;\n horizontal?: boolean;\n elevated?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function menu(options: MenuClassNameOptions = {}): string {\n const { className, horizontal, elevated } = options;\n\n return cnb(styles({ horizontal, elevated }), className);\n}\n\n/**\n * @internal\n */\nexport interface MenuWidgetProps\n extends HTMLAttributes<HTMLDivElement>,\n MenuListConvenienceProps {\n isSheet: boolean;\n horizontal: boolean;\n disableElevation?: boolean;\n cancelUnmountFocus: NonNullMutableRef<boolean>;\n getDefaultFocusedIndex?: GetDefaultFocusedIndex;\n}\n\n/**\n * **Client Component**\n *\n * This component was added to support the listbox role and the `useId()` hook.\n * If the `temporary` prop is set, the `MenuItem`'s ids will not be the same the\n * next time the menu opens, so the aria-activedescendant will point to a\n * non-existing id\n *\n * @internal\n */\nexport const MenuWidget = forwardRef<HTMLDivElement, MenuWidgetProps>(\n function MenuWidget(props, ref) {\n const {\n id,\n role = \"menu\",\n className,\n listStyle,\n listClassName,\n listProps,\n children,\n onClick,\n onBlur = noop,\n onFocus = noop,\n onKeyDown = noop,\n tabIndex = -1,\n isSheet,\n horizontal,\n disableElevation,\n cancelUnmountFocus,\n getDefaultFocusedIndex,\n ...remaining\n } = props;\n const isListbox = role === \"listbox\";\n const { menubar } = useMenuBarContext();\n\n // Since there is the possibility of other tab focusable elements within the\n // sheet and the menu items are programmatically focused, the menu's\n // tabIndex needs to be set to `-1` while one of the child menu items are\n // focused. This allows Shift+Tab correctly focuses the previous focusable\n // element within the sheet. Since `onFocus` and `onBlur` will be bubbled up\n // to the menu widget each time a new MenuItem is focused, only disable the\n // focused state if the blur event is fired without another focus event\n // within an animation frame.\n const [sheetMenuFocused, setSheetMenuFocused] = useState(false);\n const sheetBlurredFame = useRef(0);\n const menuBarContext = useMenuBarProvider({\n root: false,\n menubar,\n hoverTimeout: menubar ? 0 : undefined,\n defaultActiveId: id,\n });\n const { movementProps, movementContext } = useKeyboardMovementProvider({\n onClick,\n onFocus(event) {\n onFocus(event);\n\n if (!isSheet) {\n return;\n }\n\n window.cancelAnimationFrame(sheetBlurredFame.current);\n setSheetMenuFocused(true);\n },\n onKeyDown,\n horizontal,\n loopable: true,\n searchable: true,\n programmatic: true,\n includeDisabled: true,\n getDefaultFocusedIndex,\n });\n\n return (\n <MenuWidgetKeyboardProvider disabled={isListbox} value={movementContext}>\n <MenuBarProvider value={menuBarContext}>\n <div\n aria-orientation={horizontal ? \"horizontal\" : undefined}\n {...remaining}\n {...(isListbox ? { onClick, onFocus, onKeyDown } : movementProps)}\n id={id}\n ref={ref}\n role={role}\n className={menu({\n className,\n elevated: !disableElevation && !isSheet,\n horizontal,\n })}\n tabIndex={isSheet && !sheetMenuFocused ? 0 : tabIndex}\n onBlur={(event) => {\n onBlur(event);\n if (!isSheet) {\n return;\n }\n\n sheetBlurredFame.current = window.requestAnimationFrame(() => {\n setSheetMenuFocused(false);\n });\n }}\n >\n <List\n {...listProps}\n style={listStyle ?? listProps?.style}\n className={listClassName || listProps?.className}\n horizontal={horizontal}\n onClick={(event) => {\n listProps?.onClick?.(event);\n\n // this makes it so you can click on the menu/list without\n // closing the menu\n if (event.target === event.currentTarget) {\n event.stopPropagation();\n }\n\n // This might be a test only workaround since clicking links move focus\n // somewhere else\n if (event.target instanceof HTMLElement) {\n cancelUnmountFocus.current = event.currentTarget.contains(\n event.target.closest(\"a\")\n );\n }\n }}\n >\n {children}\n </List>\n </div>\n </MenuBarProvider>\n </MenuWidgetKeyboardProvider>\n );\n }\n);\n"],"names":["cnb","forwardRef","useRef","useState","List","useKeyboardMovementProvider","bem","MenuWidgetKeyboardProvider","MenuBarProvider","useMenuBarContext","useMenuBarProvider","styles","noop","menu","options","className","horizontal","elevated","MenuWidget","props","ref","id","role","listStyle","listClassName","listProps","children","onClick","onBlur","onFocus","onKeyDown","tabIndex","isSheet","disableElevation","cancelUnmountFocus","getDefaultFocusedIndex","remaining","isListbox","menubar","sheetMenuFocused","setSheetMenuFocused","sheetBlurredFame","menuBarContext","root","hoverTimeout","undefined","defaultActiveId","movementProps","movementContext","event","window","cancelAnimationFrame","current","loopable","searchable","programmatic","includeDisabled","disabled","value","div","aria-orientation","requestAnimationFrame","style","target","currentTarget","stopPropagation","HTMLElement","contains","closest"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAA6B,QAAQ;AAC1E,SAASC,IAAI,QAAQ,kBAAkB;AAEvC,SAASC,2BAA2B,QAAQ,6CAA6C;AAEzF,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,SAASC,0BAA0B,QAAQ,kCAAkC;AAC7E,SACEC,eAAe,EACfC,iBAAiB,EACjBC,kBAAkB,QACb,0BAA0B;AAEjC,MAAMC,SAASL,IAAI;AACnB,MAAMM,OAAO;AACX,aAAa;AACf;AAWA;;CAEC,GACD,OAAO,SAASC,KAAKC,UAAgC,CAAC,CAAC;IACrD,MAAM,EAAEC,SAAS,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGH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KAACiB;gBACCC,oBAAkB5C,aAAa,eAAe6B;gBAC7C,GAAGT,SAAS;gBACZ,GAAIC,YAAY;oBAAEV;oBAASE;oBAASC;gBAAU,IAAIiB,aAAa;gBAChE1B,IAAIA;gBACJD,KAAKA;gBACLE,MAAMA;gBACNP,WAAWF,KAAK;oBACdE;oBACAE,UAAU,CAACgB,oBAAoB,CAACD;oBAChChB;gBACF;gBACAe,UAAUC,WAAW,CAACO,mBAAmB,IAAIR;gBAC7CH,QAAQ,CAACqB;oBACPrB,OAAOqB;oBACP,IAAI,CAACjB,SAAS;wBACZ;oBACF;oBAEAS,iBAAiBW,OAAO,GAAGF,OAAOW,qBAAqB,CAAC;wBACtDrB,oBAAoB;oBACtB;gBACF;0BAEA,cAAA,KAACpC;oBACE,GAAGqB,SAAS;oBACbqC,OAAOvC,aAAaE,WAAWqC;oBAC/B/C,WAAWS,iBAAiBC,WAAWV;oBACvCC,YAAYA;oBACZW,SAAS,CAACsB;wBACRxB,WAAWE,UAAUsB;wBAErB,0DAA0D;wBAC1D,mBAAmB;wBACnB,IAAIA,MAAMc,MAAM,KAAKd,MAAMe,aAAa,EAAE;4BACxCf,MAAMgB,eAAe;wBACvB;wBAEA,uEAAuE;wBACvE,iBAAiB;wBACjB,IAAIhB,MAAMc,MAAM,YAAYG,aAAa;4BACvChC,mBAAmBkB,OAAO,GAAGH,MAAMe,aAAa,CAACG,QAAQ,CACvDlB,MAAMc,MAAM,CAACK,OAAO,CAAC;wBAEzB;oBACF;8BAEC1C;;;;;AAMb,GACA"}
1
+ {"version":3,"sources":["../../src/menu/MenuWidget.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, useRef, useState, type HTMLAttributes } from \"react\";\nimport { List } from \"../list/List.js\";\nimport { type GetDefaultFocusedIndex } from \"../movement/types.js\";\nimport { useKeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\nimport { type NonNullMutableRef } from \"../types.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { type MenuListConvenienceProps } from \"./Menu.js\";\nimport { MenuWidgetKeyboardProvider } from \"./MenuWidgetKeyboardProvider.js\";\nimport {\n MenuBarProvider,\n useMenuBarContext,\n useMenuBarProvider,\n} from \"./useMenuBarProvider.js\";\n\nconst styles = bem(\"rmd-menu\");\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0\n */\nexport interface MenuClassNameOptions {\n className?: string;\n horizontal?: boolean;\n elevated?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function menu(options: MenuClassNameOptions = {}): string {\n const { className, horizontal, elevated } = options;\n\n return cnb(styles({ horizontal, elevated }), className);\n}\n\n/**\n * @internal\n */\nexport interface MenuWidgetProps\n extends HTMLAttributes<HTMLDivElement>,\n MenuListConvenienceProps {\n isSheet: boolean;\n horizontal: boolean;\n disableElevation?: boolean;\n cancelUnmountFocus: NonNullMutableRef<boolean>;\n getDefaultFocusedIndex?: GetDefaultFocusedIndex;\n}\n\n/**\n * **Client Component**\n *\n * This component was added to support the listbox role and the `useId()` hook.\n * If the `temporary` prop is set, the `MenuItem`'s ids will not be the same the\n * next time the menu opens, so the aria-activedescendant will point to a\n * non-existing id\n *\n * @internal\n */\nexport const MenuWidget = forwardRef<HTMLDivElement, MenuWidgetProps>(\n function MenuWidget(props, ref) {\n const {\n id,\n role = \"menu\",\n className,\n listStyle,\n listClassName,\n listProps,\n children,\n onClick,\n onBlur = noop,\n onFocus = noop,\n onKeyDown = noop,\n tabIndex = -1,\n isSheet,\n horizontal,\n disableElevation,\n cancelUnmountFocus,\n getDefaultFocusedIndex,\n ...remaining\n } = props;\n const isListbox = role === \"listbox\";\n const { menubar } = useMenuBarContext();\n\n // Since there is the possibility of other tab focusable elements within the\n // sheet and the menu items are programmatically focused, the menu's\n // tabIndex needs to be set to `-1` while one of the child menu items are\n // focused. This allows Shift+Tab correctly focuses the previous focusable\n // element within the sheet. Since `onFocus` and `onBlur` will be bubbled up\n // to the menu widget each time a new MenuItem is focused, only disable the\n // focused state if the blur event is fired without another focus event\n // within an animation frame.\n const [sheetMenuFocused, setSheetMenuFocused] = useState(false);\n const sheetBlurredFame = useRef(0);\n const menuBarContext = useMenuBarProvider({\n root: false,\n menubar,\n hoverTimeout: menubar ? 0 : undefined,\n defaultActiveId: id,\n });\n const { movementProps, movementContext } = useKeyboardMovementProvider({\n onClick,\n onFocus(event) {\n onFocus(event);\n\n if (!isSheet) {\n return;\n }\n\n window.cancelAnimationFrame(sheetBlurredFame.current);\n setSheetMenuFocused(true);\n },\n onKeyDown,\n horizontal,\n loopable: true,\n searchable: true,\n programmatic: true,\n includeDisabled: true,\n getDefaultFocusedIndex,\n });\n\n return (\n <MenuWidgetKeyboardProvider disabled={isListbox} value={movementContext}>\n <MenuBarProvider value={menuBarContext}>\n <div\n aria-orientation={horizontal ? \"horizontal\" : undefined}\n {...remaining}\n {...(isListbox ? { onClick, onFocus, onKeyDown } : movementProps)}\n id={id}\n ref={ref}\n role={role}\n className={menu({\n className,\n elevated: !disableElevation && !isSheet,\n horizontal,\n })}\n tabIndex={isSheet && !sheetMenuFocused ? 0 : tabIndex}\n onBlur={(event) => {\n onBlur(event);\n if (!isSheet) {\n return;\n }\n\n sheetBlurredFame.current = window.requestAnimationFrame(() => {\n setSheetMenuFocused(false);\n });\n }}\n >\n <List\n {...listProps}\n style={listStyle ?? listProps?.style}\n className={listClassName || listProps?.className}\n horizontal={horizontal}\n onClick={(event) => {\n listProps?.onClick?.(event);\n\n // this makes it so you can click on the menu/list without\n // closing the menu\n if (event.target === event.currentTarget) {\n event.stopPropagation();\n }\n\n // This might be a test only workaround since clicking links move focus\n // somewhere else\n if (event.target instanceof HTMLElement) {\n cancelUnmountFocus.current = event.currentTarget.contains(\n event.target.closest(\"a\")\n );\n }\n }}\n >\n {children}\n </List>\n </div>\n </MenuBarProvider>\n </MenuWidgetKeyboardProvider>\n );\n }\n);\n"],"names":["cnb","forwardRef","useRef","useState","List","useKeyboardMovementProvider","bem","MenuWidgetKeyboardProvider","MenuBarProvider","useMenuBarContext","useMenuBarProvider","styles","noop","menu","options","className","horizontal","elevated","MenuWidget","props","ref","id","role","listStyle","listClassName","listProps","children","onClick","onBlur","onFocus","onKeyDown","tabIndex","isSheet","disableElevation","cancelUnmountFocus","getDefaultFocusedIndex","remaining","isListbox","menubar","sheetMenuFocused","setSheetMenuFocused","sheetBlurredFame","menuBarContext","root","hoverTimeout","undefined","defaultActiveId","movementProps","movementContext","event","window","cancelAnimationFrame","current","loopable","searchable","programmatic","includeDisabled","disabled","value","div","aria-orientation","requestAnimationFrame","style","target","currentTarget","stopPropagation","HTMLElement","contains","closest"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAA6B,QAAQ;AAC1E,SAASC,IAAI,QAAQ,kBAAkB;AAEvC,SAASC,2BAA2B,QAAQ,6CAA6C;AAEzF,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,SAASC,0BAA0B,QAAQ,kCAAkC;AAC7E,SACEC,eAAe,EACfC,iBAAiB,EACjBC,kBAAkB,QACb,0BAA0B;AAEjC,MAAMC,SAASL,IAAI;AACnB,MAAMM,OAAO;AACX,aAAa;AACf;AAWA;;CAEC,GACD,OAAO,SAASC,KAAKC,UAAgC,CAAC,CAAC;IACrD,MAAM,EAAEC,SAAS,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGH;IAE5C,OAAOd,IAAIW,OAAO;QAAEK;QAAYC;IAAS,IAAIF;AAC/C;AAeA;;;;;;;;;CASC,GACD,OAAO,MAAMG,2BAAajB,WACxB,SAASiB,WAAWC,KAAK,EAAEC,GAAG;IAC5B,MAAM,EACJC,EAAE,EACFC,OAAO,MAAM,EACbP,SAAS,EACTQ,SAAS,EACTC,aAAa,EACbC,SAAS,EACTC,QAAQ,EACRC,OAAO,EACPC,SAAShB,IAAI,EACbiB,UAAUjB,IAAI,EACdkB,YAAYlB,IAAI,EACh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ACP,IAAI,CAACjB,SAAS;wBACZ;oBACF;oBAEAS,iBAAiBW,OAAO,GAAGF,OAAOW,qBAAqB,CAAC;wBACtDrB,oBAAoB;oBACtB;gBACF;0BAEA,cAAA,KAACpC;oBACE,GAAGqB,SAAS;oBACbqC,OAAOvC,aAAaE,WAAWqC;oBAC/B/C,WAAWS,iBAAiBC,WAAWV;oBACvCC,YAAYA;oBACZW,SAAS,CAACsB;wBACRxB,WAAWE,UAAUsB;wBAErB,0DAA0D;wBAC1D,mBAAmB;wBACnB,IAAIA,MAAMc,MAAM,KAAKd,MAAMe,aAAa,EAAE;4BACxCf,MAAMgB,eAAe;wBACvB;wBAEA,uEAAuE;wBACvE,iBAAiB;wBACjB,IAAIhB,MAAMc,MAAM,YAAYG,aAAa;4BACvChC,mBAAmBkB,OAAO,GAAGH,MAAMe,aAAa,CAACG,QAAQ,CACvDlB,MAAMc,MAAM,CAACK,OAAO,CAAC;wBAEzB;oBACF;8BAEC1C;;;;;AAMb,GACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/menu/MenuWidgetKeyboardProvider.tsx"],"sourcesContent":["\"use client\";\nimport { type ReactElement, type ReactNode } from \"react\";\nimport { type KeyboardMovementContext } from \"../movement/types.js\";\nimport { KeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface MenuWidgetKeyboardProviderProps {\n value: Readonly<KeyboardMovementContext>;\n disabled: boolean;\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @since 6.0.0\n * @internal\n */\nexport function MenuWidgetKeyboardProvider(\n props: MenuWidgetKeyboardProviderProps\n): ReactElement {\n const { value, disabled, children } = props;\n if (disabled) {\n return <>{children}</>;\n }\n\n return (\n <KeyboardMovementProvider value={value}>\n {children}\n </KeyboardMovementProvider>\n );\n}\n"],"names":["KeyboardMovementProvider","MenuWidgetKeyboardProvider","props","value","disabled","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAGA,SAASA,wBAAwB,QAAQ,6CAA6C;AAYtF;;;;;CAKC,GACD,OAAO,SAASC,2BACdC,KAAsC;IAEtC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,GAAGH;IACtC,IAAIE,UAAU;QACZ,qBAAO;sBAAGC;;IACZ;IAEA,qBACE,KAACL;QAAyBG,OAAOA;kBAC9BE;;AAGP"}
1
+ {"version":3,"sources":["../../src/menu/MenuWidgetKeyboardProvider.tsx"],"sourcesContent":["\"use client\";\nimport { type ReactElement, type ReactNode } from \"react\";\nimport { type KeyboardMovementContext } from \"../movement/types.js\";\nimport { KeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface MenuWidgetKeyboardProviderProps {\n value: Readonly<KeyboardMovementContext>;\n disabled: boolean;\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @since 6.0.0\n * @internal\n */\nexport function MenuWidgetKeyboardProvider(\n props: MenuWidgetKeyboardProviderProps\n): ReactElement {\n const { value, disabled, children } = props;\n if (disabled) {\n return <>{children}</>;\n }\n\n return (\n <KeyboardMovementProvider value={value}>\n {children}\n </KeyboardMovementProvider>\n );\n}\n"],"names":["KeyboardMovementProvider","MenuWidgetKeyboardProvider","props","value","disabled","children"],"mappings":"AAAA;;AAGA,SAASA,wBAAwB,QAAQ,6CAA6C;AAYtF;;;;;CAKC,GACD,OAAO,SAASC,2BACdC,KAAsC;IAEtC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,GAAGH;IACtC,IAAIE,UAAU;QACZ,qBAAO;sBAAGC;;IACZ;IAEA,qBACE,KAACL;QAAyBG,OAAOA;kBAC9BE;;AAGP"}