@mui/material 9.0.0-alpha.4 → 9.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/Accordion/Accordion.d.mts +1 -1
  2. package/Accordion/Accordion.d.ts +1 -1
  3. package/AccordionSummary/AccordionSummary.js +1 -0
  4. package/AccordionSummary/AccordionSummary.mjs +1 -0
  5. package/Backdrop/Backdrop.d.mts +1 -1
  6. package/Backdrop/Backdrop.d.ts +1 -1
  7. package/BottomNavigationAction/BottomNavigationAction.js +1 -0
  8. package/BottomNavigationAction/BottomNavigationAction.mjs +1 -0
  9. package/Breadcrumbs/BreadcrumbCollapsed.js +5 -1
  10. package/Breadcrumbs/BreadcrumbCollapsed.mjs +5 -1
  11. package/Button/Button.js +1 -0
  12. package/Button/Button.mjs +1 -0
  13. package/ButtonBase/ButtonBase.d.mts +5 -0
  14. package/ButtonBase/ButtonBase.d.ts +5 -0
  15. package/ButtonBase/ButtonBase.js +84 -85
  16. package/ButtonBase/ButtonBase.mjs +84 -85
  17. package/ButtonBase/useButtonBase.d.mts +91 -0
  18. package/ButtonBase/useButtonBase.d.ts +91 -0
  19. package/ButtonBase/useButtonBase.js +174 -0
  20. package/ButtonBase/useButtonBase.mjs +167 -0
  21. package/ButtonGroup/ButtonGroup.js +1 -9
  22. package/ButtonGroup/ButtonGroup.mjs +1 -9
  23. package/ButtonGroup/buttonGroupClasses.d.mts +0 -68
  24. package/ButtonGroup/buttonGroupClasses.d.ts +0 -68
  25. package/ButtonGroup/buttonGroupClasses.js +1 -1
  26. package/ButtonGroup/buttonGroupClasses.mjs +1 -1
  27. package/CHANGELOG.md +119 -4
  28. package/CardActionArea/CardActionArea.js +1 -0
  29. package/CardActionArea/CardActionArea.mjs +1 -0
  30. package/CardHeader/CardHeader.d.mts +13 -21
  31. package/CardHeader/CardHeader.d.ts +13 -21
  32. package/CardHeader/CardHeader.js +3 -21
  33. package/CardHeader/CardHeader.mjs +3 -21
  34. package/Checkbox/Checkbox.js +1 -7
  35. package/Checkbox/Checkbox.mjs +1 -7
  36. package/Chip/Chip.d.mts +7 -0
  37. package/Chip/Chip.d.ts +7 -0
  38. package/Chip/Chip.js +66 -55
  39. package/Chip/Chip.mjs +66 -55
  40. package/Chip/chipClasses.d.mts +0 -104
  41. package/Chip/chipClasses.d.ts +0 -104
  42. package/Chip/chipClasses.js +1 -1
  43. package/Chip/chipClasses.mjs +1 -1
  44. package/Dialog/Dialog.d.mts +8 -22
  45. package/Dialog/Dialog.d.ts +8 -22
  46. package/Dialog/Dialog.js +43 -72
  47. package/Dialog/Dialog.mjs +43 -72
  48. package/Dialog/dialogClasses.d.mts +0 -8
  49. package/Dialog/dialogClasses.d.ts +0 -8
  50. package/Dialog/dialogClasses.js +1 -1
  51. package/Dialog/dialogClasses.mjs +1 -1
  52. package/Divider/Divider.js +2 -10
  53. package/Divider/Divider.mjs +2 -10
  54. package/Divider/dividerClasses.d.mts +0 -4
  55. package/Divider/dividerClasses.d.ts +0 -4
  56. package/Divider/dividerClasses.js +1 -1
  57. package/Divider/dividerClasses.mjs +1 -1
  58. package/Drawer/Drawer.d.mts +1 -13
  59. package/Drawer/Drawer.d.ts +1 -13
  60. package/Drawer/Drawer.js +6 -40
  61. package/Drawer/Drawer.mjs +6 -40
  62. package/Drawer/drawerClasses.d.mts +0 -32
  63. package/Drawer/drawerClasses.d.ts +0 -32
  64. package/Drawer/drawerClasses.js +1 -1
  65. package/Drawer/drawerClasses.mjs +1 -1
  66. package/Fab/Fab.js +1 -0
  67. package/Fab/Fab.mjs +1 -0
  68. package/FilledInput/FilledInput.js +4 -33
  69. package/FilledInput/FilledInput.mjs +4 -33
  70. package/Grid/Grid.d.mts +8 -3
  71. package/Grid/Grid.d.ts +8 -3
  72. package/Grid/Grid.js +8 -3
  73. package/Grid/Grid.mjs +8 -3
  74. package/Grid/gridClasses.js +1 -1
  75. package/Grid/gridClasses.mjs +1 -1
  76. package/IconButton/IconButton.js +1 -0
  77. package/IconButton/IconButton.mjs +1 -0
  78. package/ImageListItemBar/ImageListItemBar.js +4 -17
  79. package/ImageListItemBar/ImageListItemBar.mjs +4 -17
  80. package/ImageListItemBar/imageListItemBarClasses.d.mts +0 -16
  81. package/ImageListItemBar/imageListItemBarClasses.d.ts +0 -16
  82. package/ImageListItemBar/imageListItemBarClasses.js +1 -1
  83. package/ImageListItemBar/imageListItemBarClasses.mjs +1 -1
  84. package/Input/Input.js +4 -33
  85. package/Input/Input.mjs +4 -33
  86. package/Input/inputClasses.d.mts +0 -16
  87. package/Input/inputClasses.d.ts +0 -16
  88. package/InputAdornment/inputAdornmentClasses.d.mts +2 -2
  89. package/InputAdornment/inputAdornmentClasses.d.ts +2 -2
  90. package/InputBase/InputBase.d.mts +0 -27
  91. package/InputBase/InputBase.d.ts +0 -27
  92. package/InputBase/InputBase.js +6 -35
  93. package/InputBase/InputBase.mjs +6 -35
  94. package/InputBase/inputBaseClasses.d.mts +0 -20
  95. package/InputBase/inputBaseClasses.d.ts +0 -20
  96. package/InputBase/inputBaseClasses.js +1 -1
  97. package/InputBase/inputBaseClasses.mjs +1 -1
  98. package/InputLabel/InputLabel.js +1 -1
  99. package/InputLabel/InputLabel.mjs +1 -1
  100. package/LinearProgress/LinearProgress.js +6 -18
  101. package/LinearProgress/LinearProgress.mjs +6 -18
  102. package/LinearProgress/linearProgressClasses.d.mts +0 -36
  103. package/LinearProgress/linearProgressClasses.d.ts +0 -36
  104. package/LinearProgress/linearProgressClasses.js +1 -1
  105. package/LinearProgress/linearProgressClasses.mjs +1 -1
  106. package/Link/Link.d.mts +1 -1
  107. package/Link/Link.d.ts +1 -1
  108. package/ListItem/ListItem.d.mts +2 -36
  109. package/ListItem/ListItem.d.ts +2 -36
  110. package/ListItem/ListItem.js +27 -152
  111. package/ListItem/ListItem.mjs +27 -152
  112. package/ListItem/listItemClasses.d.mts +2 -4
  113. package/ListItem/listItemClasses.d.ts +2 -4
  114. package/ListItem/listItemClasses.js +1 -1
  115. package/ListItem/listItemClasses.mjs +1 -1
  116. package/ListItemButton/ListItemButton.d.mts +1 -2
  117. package/ListItemButton/ListItemButton.d.ts +1 -2
  118. package/ListItemButton/ListItemButton.js +2 -2
  119. package/ListItemButton/ListItemButton.mjs +2 -2
  120. package/ListItemIcon/ListItemIcon.js +1 -1
  121. package/ListItemIcon/ListItemIcon.mjs +1 -1
  122. package/ListItemSecondaryAction/ListItemSecondaryAction.d.mts +10 -6
  123. package/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +10 -6
  124. package/ListItemSecondaryAction/ListItemSecondaryAction.js +7 -2
  125. package/ListItemSecondaryAction/ListItemSecondaryAction.mjs +7 -2
  126. package/ListItemText/ListItemText.d.mts +12 -20
  127. package/ListItemText/ListItemText.d.ts +12 -20
  128. package/ListItemText/ListItemText.js +2 -20
  129. package/ListItemText/ListItemText.mjs +2 -20
  130. package/ListSubheader/ListSubheader.js +0 -3
  131. package/ListSubheader/ListSubheader.mjs +0 -3
  132. package/Menu/Menu.d.mts +1 -1
  133. package/Menu/Menu.d.ts +1 -1
  134. package/Menu/Menu.js +15 -32
  135. package/Menu/Menu.mjs +15 -32
  136. package/MenuItem/MenuItem.js +36 -26
  137. package/MenuItem/MenuItem.mjs +34 -26
  138. package/MenuList/MenuList.js +136 -101
  139. package/MenuList/MenuList.mjs +135 -100
  140. package/MenuList/MenuListContext.d.mts +11 -0
  141. package/MenuList/MenuListContext.d.ts +11 -0
  142. package/MenuList/MenuListContext.js +25 -0
  143. package/MenuList/MenuListContext.mjs +19 -0
  144. package/Modal/Modal.d.mts +1 -41
  145. package/Modal/Modal.d.ts +1 -41
  146. package/Modal/Modal.js +5 -58
  147. package/Modal/Modal.mjs +5 -58
  148. package/OutlinedInput/OutlinedInput.js +2 -14
  149. package/OutlinedInput/OutlinedInput.mjs +2 -14
  150. package/OutlinedInput/outlinedInputClasses.d.mts +0 -16
  151. package/OutlinedInput/outlinedInputClasses.d.ts +0 -16
  152. package/PaginationItem/PaginationItem.d.mts +5 -15
  153. package/PaginationItem/PaginationItem.d.ts +5 -15
  154. package/PaginationItem/PaginationItem.js +9 -24
  155. package/PaginationItem/PaginationItem.mjs +9 -24
  156. package/PaginationItem/paginationItemClasses.d.mts +0 -16
  157. package/PaginationItem/paginationItemClasses.d.ts +0 -16
  158. package/PaginationItem/paginationItemClasses.js +1 -1
  159. package/PaginationItem/paginationItemClasses.mjs +1 -1
  160. package/PigmentGrid/PigmentGrid.d.mts +1 -1
  161. package/PigmentGrid/PigmentGrid.d.ts +1 -1
  162. package/PigmentGrid/PigmentGrid.js +1 -1
  163. package/PigmentGrid/PigmentGrid.mjs +1 -1
  164. package/Popover/Popover.d.mts +1 -1
  165. package/Popover/Popover.d.ts +1 -1
  166. package/Popover/Popover.js +19 -7
  167. package/Popover/Popover.mjs +18 -6
  168. package/Radio/Radio.js +1 -13
  169. package/Radio/Radio.mjs +1 -13
  170. package/Rating/Rating.d.mts +0 -9
  171. package/Rating/Rating.d.ts +0 -9
  172. package/Rating/Rating.js +1 -17
  173. package/Rating/Rating.mjs +1 -17
  174. package/Select/SelectInput.js +2 -3
  175. package/Select/SelectInput.mjs +2 -3
  176. package/Select/selectClasses.d.mts +0 -12
  177. package/Select/selectClasses.d.ts +0 -12
  178. package/Select/selectClasses.js +1 -1
  179. package/Select/selectClasses.mjs +1 -1
  180. package/Slider/Slider.d.mts +0 -5
  181. package/Slider/Slider.d.ts +0 -5
  182. package/Slider/Slider.js +2 -8
  183. package/Slider/Slider.mjs +2 -8
  184. package/Slider/sliderClasses.d.mts +0 -28
  185. package/Slider/sliderClasses.d.ts +0 -28
  186. package/Slider/sliderClasses.js +1 -1
  187. package/Slider/sliderClasses.mjs +1 -1
  188. package/Snackbar/Snackbar.d.mts +1 -1
  189. package/Snackbar/Snackbar.d.ts +1 -1
  190. package/SpeedDial/SpeedDial.d.mts +1 -1
  191. package/SpeedDial/SpeedDial.d.ts +1 -1
  192. package/Stack/Stack.d.mts +2 -2
  193. package/Stack/Stack.d.ts +2 -2
  194. package/StepButton/StepButton.js +44 -14
  195. package/StepButton/StepButton.mjs +44 -14
  196. package/StepConnector/StepConnector.js +2 -8
  197. package/StepConnector/StepConnector.mjs +2 -8
  198. package/StepConnector/stepConnectorClasses.d.mts +0 -8
  199. package/StepConnector/stepConnectorClasses.d.ts +0 -8
  200. package/StepConnector/stepConnectorClasses.js +1 -1
  201. package/StepConnector/stepConnectorClasses.mjs +1 -1
  202. package/StepContent/StepContent.d.mts +2 -17
  203. package/StepContent/StepContent.d.ts +2 -17
  204. package/StepContent/StepContent.js +3 -22
  205. package/StepContent/StepContent.mjs +3 -22
  206. package/StepLabel/StepLabel.d.mts +0 -22
  207. package/StepLabel/StepLabel.d.ts +0 -22
  208. package/StepLabel/StepLabel.js +2 -31
  209. package/StepLabel/StepLabel.mjs +2 -31
  210. package/Stepper/Stepper.js +54 -22
  211. package/Stepper/Stepper.mjs +54 -22
  212. package/Stepper/StepperContext.d.mts +0 -5
  213. package/Stepper/StepperContext.d.ts +0 -5
  214. package/Stepper/StepperContext.js +1 -2
  215. package/Stepper/StepperContext.mjs +0 -1
  216. package/SvgIcon/createSvgIcon.d.mts +2 -0
  217. package/SvgIcon/createSvgIcon.d.ts +2 -0
  218. package/SvgIcon/createSvgIcon.js +31 -0
  219. package/SvgIcon/createSvgIcon.mjs +26 -0
  220. package/SvgIcon/index.d.mts +1 -0
  221. package/SvgIcon/index.d.ts +1 -0
  222. package/SvgIcon/index.js +8 -0
  223. package/SvgIcon/index.mjs +1 -0
  224. package/SwipeableDrawer/SwipeableDrawer.d.mts +0 -5
  225. package/SwipeableDrawer/SwipeableDrawer.d.ts +0 -5
  226. package/SwipeableDrawer/SwipeableDrawer.js +6 -37
  227. package/SwipeableDrawer/SwipeableDrawer.mjs +6 -37
  228. package/Switch/Switch.js +0 -11
  229. package/Switch/Switch.mjs +0 -11
  230. package/Tab/Tab.js +18 -4
  231. package/Tab/Tab.mjs +18 -4
  232. package/Tab/tabClasses.d.mts +0 -4
  233. package/Tab/tabClasses.d.ts +0 -4
  234. package/Tab/tabClasses.js +1 -1
  235. package/Tab/tabClasses.mjs +1 -1
  236. package/TabScrollButton/TabScrollButton.d.mts +1 -1
  237. package/TabScrollButton/TabScrollButton.d.ts +1 -1
  238. package/TabScrollButton/TabScrollButton.js +6 -2
  239. package/TabScrollButton/TabScrollButton.mjs +6 -2
  240. package/TablePagination/TablePagination.d.mts +0 -24
  241. package/TablePagination/TablePagination.d.ts +0 -24
  242. package/TablePagination/TablePagination.js +1 -29
  243. package/TablePagination/TablePagination.mjs +1 -29
  244. package/TablePaginationActions/TablePaginationActions.d.mts +0 -10
  245. package/TablePaginationActions/TablePaginationActions.d.ts +0 -10
  246. package/TablePaginationActions/TablePaginationActions.js +2 -14
  247. package/TablePaginationActions/TablePaginationActions.mjs +2 -14
  248. package/TableSortLabel/TableSortLabel.js +6 -8
  249. package/TableSortLabel/TableSortLabel.mjs +6 -8
  250. package/TableSortLabel/tableSortLabelClasses.d.mts +0 -8
  251. package/TableSortLabel/tableSortLabelClasses.d.ts +0 -8
  252. package/TableSortLabel/tableSortLabelClasses.js +1 -1
  253. package/TableSortLabel/tableSortLabelClasses.mjs +1 -1
  254. package/Tabs/Tabs.js +33 -24
  255. package/Tabs/Tabs.mjs +32 -23
  256. package/Tabs/tabsClasses.d.mts +0 -6
  257. package/Tabs/tabsClasses.d.ts +0 -6
  258. package/Tabs/tabsClasses.js +1 -1
  259. package/Tabs/tabsClasses.mjs +1 -1
  260. package/ToggleButton/ToggleButton.js +1 -0
  261. package/ToggleButton/ToggleButton.mjs +1 -0
  262. package/ToggleButtonGroup/ToggleButtonGroup.js +1 -4
  263. package/ToggleButtonGroup/ToggleButtonGroup.mjs +1 -4
  264. package/ToggleButtonGroup/toggleButtonGroupClasses.d.mts +0 -8
  265. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +0 -8
  266. package/ToggleButtonGroup/toggleButtonGroupClasses.js +1 -1
  267. package/ToggleButtonGroup/toggleButtonGroupClasses.mjs +1 -1
  268. package/Tooltip/Tooltip.d.mts +1 -1
  269. package/Tooltip/Tooltip.d.ts +1 -1
  270. package/Typography/Typography.d.mts +3 -3
  271. package/Typography/Typography.d.ts +3 -3
  272. package/Typography/Typography.js +2 -24
  273. package/Typography/Typography.mjs +3 -25
  274. package/index.js +1 -1
  275. package/index.mjs +1 -1
  276. package/internal/SwitchBase.d.mts +2 -12
  277. package/internal/SwitchBase.d.ts +2 -12
  278. package/internal/SwitchBase.js +6 -17
  279. package/internal/SwitchBase.mjs +6 -17
  280. package/locale/psAF.js +1 -1
  281. package/locale/psAF.mjs +1 -1
  282. package/package.json +7 -7
  283. package/styles/createThemeWithVars.js +10 -9
  284. package/styles/createThemeWithVars.mjs +10 -9
  285. package/styles/stringifyTheme.js +1 -1
  286. package/styles/stringifyTheme.mjs +1 -1
  287. package/useAutocomplete/useAutocomplete.js +8 -0
  288. package/useAutocomplete/useAutocomplete.mjs +8 -0
  289. package/utils/createSvgIcon.d.mts +4 -2
  290. package/utils/createSvgIcon.d.ts +4 -2
  291. package/utils/createSvgIcon.js +6 -24
  292. package/utils/createSvgIcon.mjs +2 -24
  293. package/utils/focusWithVisible.js +24 -0
  294. package/utils/focusWithVisible.mjs +19 -0
  295. package/utils/index.d.mts +0 -1
  296. package/utils/index.d.ts +0 -1
  297. package/utils/index.js +0 -7
  298. package/utils/index.mjs +0 -1
  299. package/utils/useFocusableWhenDisabled.d.mts +30 -0
  300. package/utils/useFocusableWhenDisabled.d.ts +30 -0
  301. package/utils/useFocusableWhenDisabled.js +47 -0
  302. package/utils/useFocusableWhenDisabled.mjs +41 -0
  303. package/utils/useRovingTabIndex.d.mts +1 -2
  304. package/utils/useRovingTabIndex.d.ts +1 -2
  305. package/utils/useRovingTabIndex.js +25 -4
  306. package/utils/useRovingTabIndex.mjs +1 -2
  307. package/version/index.js +2 -2
  308. package/version/index.mjs +2 -2
@@ -1,26 +1,41 @@
1
1
  'use client';
2
2
 
3
3
  import * as React from 'react';
4
- import { isFragment } from 'react-is';
5
4
  import PropTypes from 'prop-types';
6
- import useRovingTabIndex from "../utils/useRovingTabIndex.mjs";
5
+ import { isItemFocusable } from '@mui/utils/useRovingTabIndex';
7
6
  import ownerDocument from "../utils/ownerDocument.mjs";
8
- import List from "../List/index.mjs";
9
7
  import getActiveElement from "../utils/getActiveElement.mjs";
10
8
  import getScrollbarSize from "../utils/getScrollbarSize.mjs";
9
+ import focusWithVisible from "../utils/focusWithVisible.mjs";
10
+ import useEventCallback from "../utils/useEventCallback.mjs";
11
11
  import useForkRef from "../utils/useForkRef.mjs";
12
12
  import useEnhancedEffect from "../utils/useEnhancedEffect.mjs";
13
- import { ownerWindow } from "../utils/index.mjs";
13
+ import { RovingTabIndexContext, useRovingTabIndexRoot } from "../utils/useRovingTabIndex.mjs";
14
+ import ownerWindow from "../utils/ownerWindow.mjs";
15
+ import List from "../List/index.mjs";
16
+ import { useSelectFocusSource } from "../Select/utils/index.mjs";
17
+ import { MenuListContext } from "./MenuListContext.mjs";
14
18
  import { jsx as _jsx } from "react/jsx-runtime";
15
- function textCriteriaMatches(nextFocus, textCriteria) {
16
- if (textCriteria === undefined) {
17
- return true;
19
+ function getItemText(itemOrElement) {
20
+ const element = itemOrElement?.element ?? itemOrElement;
21
+ if (!element) {
22
+ return '';
18
23
  }
19
- let text = nextFocus.innerText;
24
+ if (itemOrElement?.textValue !== undefined) {
25
+ return itemOrElement.textValue;
26
+ }
27
+ let text = element.innerText;
20
28
  if (text === undefined) {
21
29
  // jsdom doesn't support innerText
22
- text = nextFocus.textContent;
30
+ text = element.textContent;
23
31
  }
32
+ return text ?? '';
33
+ }
34
+ function textCriteriaMatches(itemOrElement, textCriteria) {
35
+ if (textCriteria === undefined) {
36
+ return true;
37
+ }
38
+ let text = getItemText(itemOrElement);
24
39
  text = text.trim().toLowerCase();
25
40
  if (text.length === 0) {
26
41
  return false;
@@ -30,20 +45,17 @@ function textCriteriaMatches(nextFocus, textCriteria) {
30
45
  }
31
46
  return text.startsWith(textCriteria.keys.join(''));
32
47
  }
33
- function shouldFocusWithTextCriteria(element, criteria, disabledItemsFocusable) {
34
- if (!textCriteriaMatches(element, criteria)) {
48
+ function isItemFocusableWithTextCriteria(item, criteria) {
49
+ if (!textCriteriaMatches(item, criteria)) {
35
50
  return false;
36
51
  }
37
- return shouldFocus(element, disabledItemsFocusable);
52
+ return isItemFocusable(item);
38
53
  }
39
- function shouldFocus(element, disabledItemsFocusable) {
40
- if (!element || !element.hasAttribute('tabindex')) {
41
- return false;
42
- }
43
- if (disabledItemsFocusable) {
44
- return true;
45
- }
46
- return !element.disabled && element.getAttribute('aria-disabled') !== 'true';
54
+
55
+ // Menu auto-focus is not always keyboard-driven. On open we often move focus to the
56
+ // active item programmatically so arrow-key navigation starts from the right place.
57
+ function focusInitialItem(element, focusSource) {
58
+ focusWithVisible(element, focusSource);
47
59
  }
48
60
 
49
61
  /**
@@ -57,8 +69,8 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
57
69
  // private
58
70
  // eslint-disable-next-line react/prop-types
59
71
  actions,
60
- autoFocus = false,
61
- autoFocusItem = false,
72
+ autoFocus: autoFocusList = false,
73
+ autoFocusItem: autoFocusActiveItem = false,
62
74
  children,
63
75
  className,
64
76
  disabledItemsFocusable = false,
@@ -68,17 +80,85 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
68
80
  ...other
69
81
  } = props;
70
82
  const listRef = React.useRef(null);
83
+ const hasFocusedInitialTargetRef = React.useRef(false);
84
+ // Escape hatch for <Menu variant="menu"> (items have no selection state). When opened with
85
+ // mouse/pointer, the initial focused item should still receive DOM focus, but ButtonBase
86
+ // should suppress its focus-visible state for that one initial handoff.
87
+ const [suppressInitialFocusVisible, setSuppressInitialFocusVisible] = React.useState(false);
88
+ // Current anchored <Menu>s cannot receive a `openInteractionType` signal from a trigger
89
+ // the API only receives `open` and `anchorEl`. When <MenuList> is used in <Select>, the
90
+ // internal <SelectInput> is able to achieve this via `useSelectFocusSource`.
91
+ const focusSource = useSelectFocusSource();
71
92
  const textCriteriaRef = React.useRef({
72
93
  keys: [],
73
94
  repeating: true,
74
95
  previousKeyMatched: true,
75
96
  lastTime: null
76
97
  });
77
- useEnhancedEffect(() => {
78
- if (autoFocus) {
98
+ const getDefaultActiveItemId = React.useCallback(items => {
99
+ if (variant === 'selectedMenu') {
100
+ return items.find(item => item.selected && isItemFocusable(item))?.id ?? items.find(item => isItemFocusable(item))?.id ?? null;
101
+ }
102
+ return items.find(item => isItemFocusable(item))?.id ?? null;
103
+ }, [variant]);
104
+ const rovingContainer = useRovingTabIndexRoot({
105
+ activeItemId: undefined,
106
+ getDefaultActiveItemId,
107
+ orientation: 'vertical',
108
+ wrap: !disableListWrap
109
+ });
110
+ const {
111
+ activeItemId,
112
+ focusNext,
113
+ getActiveItem,
114
+ getContainerProps,
115
+ getItemMap
116
+ } = rovingContainer;
117
+ const focusInitialTarget = useEventCallback((force = false) => {
118
+ // `force` is used by the imperative action when `Menu` asks `MenuList` to restore its
119
+ // initial focus target after the popover finishes entering, even if this list already
120
+ // completed its normal one-time initial-focus path on an earlier render.
121
+ if (!listRef.current || !force && hasFocusedInitialTargetRef.current) {
122
+ return null;
123
+ }
124
+ if (autoFocusActiveItem) {
125
+ const activeItem = getActiveItem();
126
+ if (activeItem?.element) {
127
+ const hasSelectedItem = Array.from(getItemMap().values()).some(item => item.selected);
128
+ const shouldSuppressInitialFocusVisible = variant === 'menu' && hasSelectedItem && !activeItem.selected && focusSource == null;
129
+ setSuppressInitialFocusVisible(shouldSuppressInitialFocusVisible);
130
+ focusInitialItem(activeItem.element, focusSource);
131
+ hasFocusedInitialTargetRef.current = true;
132
+ return activeItem.element;
133
+ }
134
+ if (!autoFocusList) {
135
+ return null;
136
+ }
137
+
138
+ // Keep the list container focusable while waiting for items to register,
139
+ // or when there is no focusable item to move to.
140
+ setSuppressInitialFocusVisible(false);
79
141
  listRef.current.focus();
142
+ return listRef.current;
80
143
  }
81
- }, [autoFocus]);
144
+ if (!autoFocusList) {
145
+ setSuppressInitialFocusVisible(false);
146
+ return null;
147
+ }
148
+ setSuppressInitialFocusVisible(false);
149
+ listRef.current.focus();
150
+ hasFocusedInitialTargetRef.current = true;
151
+ return listRef.current;
152
+ });
153
+ useEnhancedEffect(() => {
154
+ if (!autoFocusList && !autoFocusActiveItem) {
155
+ hasFocusedInitialTargetRef.current = false;
156
+ setSuppressInitialFocusVisible(false);
157
+ return undefined;
158
+ }
159
+ focusInitialTarget();
160
+ return undefined;
161
+ }, [activeItemId, autoFocusActiveItem, autoFocusList, focusInitialTarget]);
82
162
  React.useImperativeHandle(actions, () => ({
83
163
  adjustStyleForScrollbar: (containerElement, {
84
164
  direction
@@ -92,86 +172,35 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
92
172
  listRef.current.style.width = `calc(100% + ${scrollbarSize})`;
93
173
  }
94
174
  return listRef.current;
95
- }
96
- }), []);
97
-
98
- /**
99
- * the index of the item should receive focus
100
- * in a `variant="selectedMenu"` it's the first `selected` item
101
- * otherwise it's the very first item.
102
- */
103
- let activeItemIndex = -1;
104
- // since we inject focus related props into children we have to do a lookahead
105
- // to check if there is a `selected` item. We're looking for the last `selected`
106
- // item and use the first valid item as a fallback
107
- React.Children.forEach(children, (child, index) => {
108
- if (! /*#__PURE__*/React.isValidElement(child)) {
109
- if (activeItemIndex === index) {
110
- activeItemIndex += 1;
111
- if (activeItemIndex >= children.length) {
112
- // there are no focusable items within the list.
113
- activeItemIndex = -1;
114
- }
115
- }
116
- return;
117
- }
118
- if (process.env.NODE_ENV !== 'production') {
119
- if (isFragment(child)) {
120
- console.error(["MUI: The Menu component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
121
- }
122
- }
123
- if (!child.props.disabled) {
124
- if (variant === 'selectedMenu' && child.props.selected) {
125
- activeItemIndex = index;
126
- } else if (activeItemIndex === -1) {
127
- activeItemIndex = index;
175
+ },
176
+ focusInitialTarget: () => {
177
+ if (!listRef.current) {
178
+ return null;
128
179
  }
129
- }
130
- if (activeItemIndex === index && (child.props.disabled || child.props.muiSkipListHighlight || child.type.muiSkipListHighlight)) {
131
- activeItemIndex += 1;
132
- if (activeItemIndex >= children.length) {
133
- // there are no focusable items within the list.
134
- activeItemIndex = -1;
180
+ const currentFocus = getActiveElement(ownerDocument(listRef.current));
181
+ if (currentFocus && listRef.current.contains(currentFocus)) {
182
+ return currentFocus;
135
183
  }
184
+ return focusInitialTarget(true);
136
185
  }
137
- });
138
- const {
139
- focusNext,
140
- getContainerProps,
141
- getItemProps
142
- } = useRovingTabIndex({
143
- focusableIndex: activeItemIndex,
144
- orientation: 'vertical',
145
- shouldWrap: !disableListWrap,
146
- shouldFocus: element => shouldFocus(element, disabledItemsFocusable)
147
- });
148
- const rovingTabIndexContainerProps = getContainerProps();
149
- const handleRef = useForkRef(listRef, rovingTabIndexContainerProps.ref, ref);
150
- let focusableIndex = 0;
151
- const items = React.Children.map(children, (child, index) => {
152
- if (! /*#__PURE__*/React.isValidElement(child) || child.props.muiSkipListHighlight || child.type.muiSkipListHighlight) {
153
- return child;
154
- }
155
- const rovingTabIndexItemProps = getItemProps(focusableIndex, child.ref);
156
- const newChildProps = {
157
- ref: rovingTabIndexItemProps.ref
158
- };
159
- if (child.props.tabIndex === undefined && variant === 'selectedMenu') {
160
- newChildProps.tabIndex = rovingTabIndexItemProps.tabIndex;
186
+ }), [focusInitialTarget]);
187
+ const rovingContainerProps = getContainerProps();
188
+ const handleRef = useForkRef(listRef, rovingContainerProps.ref, ref);
189
+ const menuListContextValue = React.useMemo(() => ({
190
+ itemsFocusableWhenDisabled: disabledItemsFocusable,
191
+ suppressInitialFocusVisible,
192
+ variant
193
+ }), [disabledItemsFocusable, suppressInitialFocusVisible, variant]);
194
+ const handleKeyDown = useEventCallback(event => {
195
+ if (suppressInitialFocusVisible) {
196
+ setSuppressInitialFocusVisible(false);
161
197
  }
162
- if (index === activeItemIndex && autoFocusItem) {
163
- newChildProps.autoFocus = true;
164
- }
165
- focusableIndex += 1;
166
- return /*#__PURE__*/React.cloneElement(child, newChildProps);
167
- });
168
- const handleKeyDown = event => {
169
198
  const isModifierKeyPressed = event.ctrlKey || event.metaKey || event.altKey;
170
199
  if (isModifierKeyPressed && onKeyDown) {
171
200
  onKeyDown(event);
172
201
  return;
173
202
  }
174
- rovingTabIndexContainerProps.onKeyDown(event);
203
+ rovingContainerProps.onKeyDown(event);
175
204
  if (event.key.length === 1) {
176
205
  const criteria = textCriteriaRef.current;
177
206
  const lowerKey = event.key.toLowerCase();
@@ -190,7 +219,7 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
190
219
  criteria.keys.push(lowerKey);
191
220
  const currentFocus = getActiveElement(ownerDocument(listRef.current));
192
221
  const keepFocusOnCurrent = currentFocus && !criteria.repeating && textCriteriaMatches(currentFocus, criteria);
193
- if (criteria.previousKeyMatched && (keepFocusOnCurrent || focusNext(element => shouldFocusWithTextCriteria(element, criteria, disabledItemsFocusable)) !== -1)) {
222
+ if (criteria.previousKeyMatched && (keepFocusOnCurrent || focusNext(item => isItemFocusableWithTextCriteria(item, criteria)) != null)) {
194
223
  event.preventDefault();
195
224
  } else {
196
225
  criteria.previousKeyMatched = false;
@@ -199,16 +228,22 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
199
228
  if (onKeyDown) {
200
229
  onKeyDown(event);
201
230
  }
202
- };
231
+ });
203
232
  return /*#__PURE__*/_jsx(List, {
204
233
  role: "menu",
205
234
  ref: handleRef,
206
235
  className: className,
207
236
  onKeyDown: handleKeyDown,
208
- onFocus: rovingTabIndexContainerProps.onFocus,
237
+ onFocus: rovingContainerProps.onFocus,
209
238
  tabIndex: -1,
210
239
  ...other,
211
- children: items
240
+ children: /*#__PURE__*/_jsx(MenuListContext.Provider, {
241
+ value: menuListContextValue,
242
+ children: /*#__PURE__*/_jsx(RovingTabIndexContext.Provider, {
243
+ value: rovingContainer,
244
+ children: children
245
+ })
246
+ })
212
247
  });
213
248
  });
214
249
  process.env.NODE_ENV !== "production" ? MenuList.propTypes /* remove-proptypes */ = {
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * @ignore - internal component.
4
+ */
5
+ export interface MenuListContextValue {
6
+ itemsFocusableWhenDisabled: boolean;
7
+ suppressInitialFocusVisible: boolean;
8
+ variant: 'menu' | 'selectedMenu';
9
+ }
10
+ export declare const MenuListContext: React.Context<MenuListContextValue | undefined>;
11
+ export declare function useMenuListContext(): MenuListContextValue;
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * @ignore - internal component.
4
+ */
5
+ export interface MenuListContextValue {
6
+ itemsFocusableWhenDisabled: boolean;
7
+ suppressInitialFocusVisible: boolean;
8
+ variant: 'menu' | 'selectedMenu';
9
+ }
10
+ export declare const MenuListContext: React.Context<MenuListContextValue | undefined>;
11
+ export declare function useMenuListContext(): MenuListContextValue;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.MenuListContext = void 0;
9
+ exports.useMenuListContext = useMenuListContext;
10
+ var React = _interopRequireWildcard(require("react"));
11
+ /**
12
+ * @ignore - internal component.
13
+ */
14
+
15
+ const MenuListContext = exports.MenuListContext = /*#__PURE__*/React.createContext(undefined);
16
+ if (process.env.NODE_ENV !== 'production') {
17
+ MenuListContext.displayName = 'MenuListContext';
18
+ }
19
+ function useMenuListContext() {
20
+ const context = React.useContext(MenuListContext);
21
+ if (context === undefined) {
22
+ throw new Error('MUI: MenuListContext is missing. MenuItems must be placed within Menu or MenuList.');
23
+ }
24
+ return context;
25
+ }
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+
5
+ /**
6
+ * @ignore - internal component.
7
+ */
8
+
9
+ export const MenuListContext = /*#__PURE__*/React.createContext(undefined);
10
+ if (process.env.NODE_ENV !== 'production') {
11
+ MenuListContext.displayName = 'MenuListContext';
12
+ }
13
+ export function useMenuListContext() {
14
+ const context = React.useContext(MenuListContext);
15
+ if (context === undefined) {
16
+ throw new Error('MUI: MenuListContext is missing. MenuItems must be placed within Menu or MenuList.');
17
+ }
18
+ return context;
19
+ }
package/Modal/Modal.d.mts CHANGED
@@ -4,7 +4,7 @@ import { OverrideProps } from '@mui/types';
4
4
  import { SlotComponentProps } from "../utils/types.mjs";
5
5
  import { PortalProps } from "../Portal/index.mjs";
6
6
  import { Theme } from "../styles/index.mjs";
7
- import Backdrop, { BackdropProps } from "../Backdrop/index.mjs";
7
+ import Backdrop from "../Backdrop/index.mjs";
8
8
  import { OverridableComponent } from "../OverridableComponent/index.mjs";
9
9
  import { ModalClasses } from "./modalClasses.mjs";
10
10
  export interface ModalComponentsPropsOverrides {}
@@ -23,23 +23,6 @@ export interface ModalSlots {
23
23
  backdrop?: React.ElementType | undefined;
24
24
  }
25
25
  export interface ModalOwnProps {
26
- /**
27
- * A backdrop component. This prop enables custom backdrop rendering.
28
- * @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
29
- * Use the `slots.backdrop` prop to make your application ready for the next version of Material UI.
30
- * @default styled(Backdrop, {
31
- * name: 'MuiModal',
32
- * slot: 'Backdrop',
33
- * })({
34
- * zIndex: -1,
35
- * })
36
- */
37
- BackdropComponent?: React.ElementType<BackdropProps> | undefined;
38
- /**
39
- * Props applied to the [`Backdrop`](https://mui.com/material-ui/api/backdrop/) element.
40
- * @deprecated Use `slotProps.backdrop` instead.
41
- */
42
- BackdropProps?: Partial<BackdropProps> | undefined;
43
26
  /**
44
27
  * A single child content element.
45
28
  */
@@ -57,29 +40,6 @@ export interface ModalOwnProps {
57
40
  * @default false
58
41
  */
59
42
  closeAfterTransition?: boolean | undefined;
60
- /**
61
- * The components used for each slot inside.
62
- *
63
- * @deprecated Use the `slots` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
64
- *
65
- * @default {}
66
- */
67
- components?: {
68
- Root?: React.ElementType | undefined;
69
- Backdrop?: React.ElementType | undefined;
70
- } | undefined;
71
- /**
72
- * The extra props for the slot components.
73
- * You can override the existing props or add new ones.
74
- *
75
- * @deprecated Use the `slotProps` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
76
- *
77
- * @default {}
78
- */
79
- componentsProps?: {
80
- root?: SlotComponentProps<'div', ModalComponentsPropsOverrides, ModalOwnerState> | undefined;
81
- backdrop?: SlotComponentProps<typeof Backdrop, ModalComponentsPropsOverrides, ModalOwnerState> | undefined;
82
- } | undefined;
83
43
  /**
84
44
  * An HTML element or function that returns one.
85
45
  * The `container` will have the portal children appended to it.
package/Modal/Modal.d.ts CHANGED
@@ -4,7 +4,7 @@ import { OverrideProps } from '@mui/types';
4
4
  import { SlotComponentProps } from "../utils/types.js";
5
5
  import { PortalProps } from "../Portal/index.js";
6
6
  import { Theme } from "../styles/index.js";
7
- import Backdrop, { BackdropProps } from "../Backdrop/index.js";
7
+ import Backdrop from "../Backdrop/index.js";
8
8
  import { OverridableComponent } from "../OverridableComponent/index.js";
9
9
  import { ModalClasses } from "./modalClasses.js";
10
10
  export interface ModalComponentsPropsOverrides {}
@@ -23,23 +23,6 @@ export interface ModalSlots {
23
23
  backdrop?: React.ElementType | undefined;
24
24
  }
25
25
  export interface ModalOwnProps {
26
- /**
27
- * A backdrop component. This prop enables custom backdrop rendering.
28
- * @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
29
- * Use the `slots.backdrop` prop to make your application ready for the next version of Material UI.
30
- * @default styled(Backdrop, {
31
- * name: 'MuiModal',
32
- * slot: 'Backdrop',
33
- * })({
34
- * zIndex: -1,
35
- * })
36
- */
37
- BackdropComponent?: React.ElementType<BackdropProps> | undefined;
38
- /**
39
- * Props applied to the [`Backdrop`](https://mui.com/material-ui/api/backdrop/) element.
40
- * @deprecated Use `slotProps.backdrop` instead.
41
- */
42
- BackdropProps?: Partial<BackdropProps> | undefined;
43
26
  /**
44
27
  * A single child content element.
45
28
  */
@@ -57,29 +40,6 @@ export interface ModalOwnProps {
57
40
  * @default false
58
41
  */
59
42
  closeAfterTransition?: boolean | undefined;
60
- /**
61
- * The components used for each slot inside.
62
- *
63
- * @deprecated Use the `slots` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
64
- *
65
- * @default {}
66
- */
67
- components?: {
68
- Root?: React.ElementType | undefined;
69
- Backdrop?: React.ElementType | undefined;
70
- } | undefined;
71
- /**
72
- * The extra props for the slot components.
73
- * You can override the existing props or add new ones.
74
- *
75
- * @deprecated Use the `slotProps` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
76
- *
77
- * @default {}
78
- */
79
- componentsProps?: {
80
- root?: SlotComponentProps<'div', ModalComponentsPropsOverrides, ModalOwnerState> | undefined;
81
- backdrop?: SlotComponentProps<typeof Backdrop, ModalComponentsPropsOverrides, ModalOwnerState> | undefined;
82
- } | undefined;
83
43
  /**
84
44
  * An HTML element or function that returns one.
85
45
  * The `container` will have the portal children appended to it.
package/Modal/Modal.js CHANGED
@@ -88,16 +88,12 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
88
88
  props: inProps
89
89
  });
90
90
  const {
91
- BackdropComponent = ModalBackdrop,
92
- BackdropProps,
93
91
  classes: classesProp,
94
92
  className,
95
93
  closeAfterTransition = false,
96
94
  children,
97
95
  container,
98
96
  component,
99
- components = {},
100
- componentsProps = {},
101
97
  disableAutoFocus = false,
102
98
  disableEnforceFocus = false,
103
99
  disablePortal = false,
@@ -158,15 +154,8 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
158
154
  childProps.onExited = onExited;
159
155
  }
160
156
  const externalForwardedProps = {
161
- slots: {
162
- root: components.Root,
163
- backdrop: components.Backdrop,
164
- ...slots
165
- },
166
- slotProps: {
167
- ...componentsProps,
168
- ...slotProps
169
- }
157
+ slots,
158
+ slotProps
170
159
  };
171
160
  const [RootSlot, rootProps] = (0, _useSlot.default)('root', {
172
161
  ref,
@@ -181,11 +170,9 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
181
170
  className: (0, _clsx.default)(className, classes?.root, !ownerState.open && ownerState.exited && classes?.hidden)
182
171
  });
183
172
  const [BackdropSlot, backdropProps] = (0, _useSlot.default)('backdrop', {
184
- ref: BackdropProps?.ref,
185
- elementType: BackdropComponent,
173
+ elementType: ModalBackdrop,
186
174
  externalForwardedProps,
187
175
  shouldForwardComponentProp: true,
188
- additionalProps: BackdropProps,
189
176
  getSlotProps: otherHandlers => {
190
177
  return getBackdropProps({
191
178
  ...otherHandlers,
@@ -196,7 +183,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
196
183
  }
197
184
  });
198
185
  },
199
- className: (0, _clsx.default)(BackdropProps?.className, classes?.backdrop),
186
+ className: classes?.backdrop,
200
187
  ownerState
201
188
  });
202
189
  if (!keepMounted && !open && (!hasTransition || exited)) {
@@ -208,7 +195,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
208
195
  disablePortal: disablePortal,
209
196
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
210
197
  ...rootProps,
211
- children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(BackdropSlot, {
198
+ children: [!hideBackdrop ? /*#__PURE__*/(0, _jsxRuntime.jsx)(BackdropSlot, {
212
199
  ...backdropProps
213
200
  }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Unstable_TrapFocus.default, {
214
201
  disableEnforceFocus: disableEnforceFocus,
@@ -226,23 +213,6 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes /* remove-proptypes */ =
226
213
  // │ These PropTypes are generated from the TypeScript type definitions. │
227
214
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
228
215
  // └─────────────────────────────────────────────────────────────────────┘
229
- /**
230
- * A backdrop component. This prop enables custom backdrop rendering.
231
- * @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
232
- * Use the `slots.backdrop` prop to make your application ready for the next version of Material UI.
233
- * @default styled(Backdrop, {
234
- * name: 'MuiModal',
235
- * slot: 'Backdrop',
236
- * })({
237
- * zIndex: -1,
238
- * })
239
- */
240
- BackdropComponent: _propTypes.default.elementType,
241
- /**
242
- * Props applied to the [`Backdrop`](https://mui.com/material-ui/api/backdrop/) element.
243
- * @deprecated Use `slotProps.backdrop` instead.
244
- */
245
- BackdropProps: _propTypes.default.object,
246
216
  /**
247
217
  * A single child content element.
248
218
  */
@@ -265,29 +235,6 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes /* remove-proptypes */ =
265
235
  * Either a string to use a HTML element or a component.
266
236
  */
267
237
  component: _propTypes.default.elementType,
268
- /**
269
- * The components used for each slot inside.
270
- *
271
- * @deprecated Use the `slots` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
272
- *
273
- * @default {}
274
- */
275
- components: _propTypes.default.shape({
276
- Backdrop: _propTypes.default.elementType,
277
- Root: _propTypes.default.elementType
278
- }),
279
- /**
280
- * The extra props for the slot components.
281
- * You can override the existing props or add new ones.
282
- *
283
- * @deprecated Use the `slotProps` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
284
- *
285
- * @default {}
286
- */
287
- componentsProps: _propTypes.default.shape({
288
- backdrop: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
289
- root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
290
- }),
291
238
  /**
292
239
  * An HTML element or function that returns one.
293
240
  * The `container` will have the portal children appended to it.