@mui/material 7.3.9 → 7.3.11

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 (395) hide show
  1. package/Accordion/Accordion.d.ts +3 -3
  2. package/AccordionActions/AccordionActions.d.ts +2 -2
  3. package/AccordionDetails/AccordionDetails.d.ts +2 -2
  4. package/AccordionSummary/AccordionSummary.d.ts +3 -3
  5. package/Alert/Alert.d.ts +3 -3
  6. package/AlertTitle/AlertTitle.d.ts +3 -3
  7. package/AppBar/AppBar.d.ts +3 -3
  8. package/Autocomplete/Autocomplete.d.ts +18 -2
  9. package/Autocomplete/Autocomplete.js +111 -37
  10. package/Avatar/Avatar.d.ts +2 -2
  11. package/AvatarGroup/AvatarGroup.d.ts +2 -2
  12. package/Backdrop/Backdrop.d.ts +3 -3
  13. package/Badge/Badge.d.ts +3 -3
  14. package/BottomNavigation/BottomNavigation.d.ts +2 -2
  15. package/BottomNavigationAction/BottomNavigationAction.d.ts +3 -3
  16. package/Box/Box.d.ts +3 -2
  17. package/Breadcrumbs/Breadcrumbs.d.ts +3 -3
  18. package/Button/Button.d.ts +6 -5
  19. package/Button/Button.js +18 -1
  20. package/ButtonBase/ButtonBase.d.ts +2 -2
  21. package/ButtonBase/ButtonBase.js +8 -2
  22. package/ButtonGroup/ButtonGroup.d.ts +2 -2
  23. package/CHANGELOG.md +82 -0
  24. package/Card/Card.d.ts +3 -3
  25. package/CardActionArea/CardActionArea.d.ts +3 -3
  26. package/CardActions/CardActions.d.ts +2 -2
  27. package/CardContent/CardContent.d.ts +2 -2
  28. package/CardHeader/CardHeader.d.ts +2 -2
  29. package/CardHeader/CardHeader.js +5 -1
  30. package/CardMedia/CardMedia.d.ts +2 -2
  31. package/Checkbox/Checkbox.d.ts +4 -4
  32. package/Checkbox/Checkbox.js +2 -1
  33. package/Chip/Chip.d.ts +2 -2
  34. package/CircularProgress/CircularProgress.d.ts +2 -2
  35. package/ClickAwayListener/ClickAwayListener.d.ts +3 -3
  36. package/ClickAwayListener/ClickAwayListener.js +5 -8
  37. package/Collapse/Collapse.d.ts +5 -5
  38. package/Collapse/Collapse.js +6 -18
  39. package/Container/Container.d.ts +2 -2
  40. package/CssBaseline/CssBaseline.d.ts +2 -2
  41. package/Dialog/Dialog.d.ts +10 -3
  42. package/Dialog/Dialog.js +19 -6
  43. package/DialogActions/DialogActions.d.ts +2 -2
  44. package/DialogContent/DialogContent.d.ts +2 -2
  45. package/DialogContentText/DialogContentText.d.ts +3 -3
  46. package/DialogTitle/DialogTitle.d.ts +3 -3
  47. package/Divider/Divider.d.ts +4 -3
  48. package/Drawer/Drawer.d.ts +3 -3
  49. package/Drawer/Drawer.js +18 -4
  50. package/Fab/Fab.d.ts +3 -3
  51. package/Fab/Fab.js +7 -1
  52. package/Fade/Fade.d.ts +3 -3
  53. package/Fade/Fade.js +28 -32
  54. package/FilledInput/FilledInput.d.ts +3 -3
  55. package/FilledInput/FilledInput.js +1 -1
  56. package/FormControl/FormControl.d.ts +7 -7
  57. package/FormControlLabel/FormControlLabel.d.ts +4 -4
  58. package/FormGroup/FormGroup.d.ts +3 -3
  59. package/FormHelperText/FormHelperText.d.ts +3 -3
  60. package/FormLabel/FormLabel.d.ts +5 -5
  61. package/GlobalStyles/GlobalStyles.d.ts +2 -2
  62. package/Grid/Grid.d.ts +2 -2
  63. package/Grid/Grid.js +2 -2
  64. package/GridLegacy/GridLegacy.d.ts +2 -2
  65. package/Grow/Grow.d.ts +5 -5
  66. package/Grow/Grow.js +30 -38
  67. package/Icon/Icon.d.ts +3 -3
  68. package/IconButton/IconButton.d.ts +5 -5
  69. package/ImageList/ImageList.d.ts +2 -2
  70. package/ImageListItem/ImageListItem.d.ts +2 -2
  71. package/ImageListItemBar/ImageListItemBar.d.ts +2 -2
  72. package/InitColorSchemeScript/InitColorSchemeScript.d.ts +2 -2
  73. package/InitColorSchemeScript/InitColorSchemeScript.js +2 -2
  74. package/Input/Input.d.ts +3 -3
  75. package/Input/Input.js +1 -1
  76. package/InputAdornment/InputAdornment.d.ts +2 -2
  77. package/InputBase/InputBase.d.ts +2 -2
  78. package/InputBase/InputBase.js +39 -7
  79. package/InputLabel/InputLabel.d.ts +4 -4
  80. package/LinearProgress/LinearProgress.d.ts +2 -2
  81. package/Link/Link.d.ts +4 -4
  82. package/List/List.d.ts +4 -3
  83. package/ListItem/ListItem.d.ts +3 -3
  84. package/ListItemAvatar/ListItemAvatar.d.ts +2 -2
  85. package/ListItemButton/ListItemButton.d.ts +4 -3
  86. package/ListItemButton/ListItemButton.js +7 -1
  87. package/ListItemIcon/ListItemIcon.d.ts +3 -2
  88. package/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +2 -2
  89. package/ListItemText/ListItemText.d.ts +3 -2
  90. package/ListItemText/ListItemText.js +5 -1
  91. package/ListSubheader/ListSubheader.d.ts +3 -2
  92. package/Menu/Menu.d.ts +4 -4
  93. package/MenuItem/MenuItem.d.ts +3 -3
  94. package/MenuItem/MenuItem.js +27 -2
  95. package/MenuList/MenuList.d.ts +4 -4
  96. package/MobileStepper/MobileStepper.d.ts +3 -3
  97. package/Modal/Modal.d.ts +7 -7
  98. package/NativeSelect/NativeSelect.d.ts +3 -3
  99. package/NoSsr/NoSsr.d.ts +2 -2
  100. package/NoSsr/NoSsr.js +2 -2
  101. package/OutlinedInput/OutlinedInput.d.ts +4 -4
  102. package/Pagination/Pagination.d.ts +2 -2
  103. package/PaginationItem/PaginationItem.d.ts +3 -3
  104. package/Paper/Paper.d.ts +4 -3
  105. package/PigmentContainer/PigmentContainer.d.ts +2 -2
  106. package/PigmentContainer/PigmentContainer.js +2 -3
  107. package/PigmentGrid/PigmentGrid.d.ts +2 -2
  108. package/PigmentGrid/PigmentGrid.js +2 -3
  109. package/PigmentStack/PigmentStack.d.ts +2 -2
  110. package/PigmentStack/PigmentStack.js +2 -3
  111. package/Popover/Popover.d.ts +4 -4
  112. package/Popper/BasePopper.js +23 -1
  113. package/Popper/Popper.d.ts +4 -4
  114. package/Popper/Popper.js +4 -4
  115. package/Popper/index.d.ts +1 -0
  116. package/Popper/index.js +11 -2
  117. package/Portal/Portal.d.ts +2 -2
  118. package/Portal/Portal.js +2 -2
  119. package/README.md +2 -2
  120. package/Radio/Radio.d.ts +3 -3
  121. package/RadioGroup/RadioGroup.d.ts +3 -3
  122. package/Rating/Rating.d.ts +2 -2
  123. package/ScopedCssBaseline/ScopedCssBaseline.d.ts +2 -2
  124. package/Select/Select.d.ts +3 -3
  125. package/Select/SelectInput.js +46 -47
  126. package/Select/index.d.ts +1 -0
  127. package/Select/index.js +12 -0
  128. package/Select/utils/SelectFocusSourceContext.d.ts +4 -0
  129. package/Select/utils/SelectFocusSourceContext.js +19 -0
  130. package/Select/utils/areEqualValues.d.ts +1 -0
  131. package/Select/utils/areEqualValues.js +14 -0
  132. package/Select/utils/getOpenInteractionType.d.ts +1 -0
  133. package/Select/utils/getOpenInteractionType.js +18 -0
  134. package/Select/utils/index.d.ts +4 -0
  135. package/Select/utils/index.js +40 -0
  136. package/Select/utils/isEmpty.d.ts +1 -0
  137. package/Select/utils/isEmpty.js +9 -0
  138. package/Skeleton/Skeleton.d.ts +2 -2
  139. package/Slide/Slide.d.ts +4 -4
  140. package/Slide/Slide.js +43 -42
  141. package/Slider/Slider.d.ts +7 -7
  142. package/Slider/useSlider.js +6 -3
  143. package/Snackbar/Snackbar.d.ts +2 -2
  144. package/SnackbarContent/SnackbarContent.d.ts +3 -3
  145. package/SpeedDial/SpeedDial.d.ts +2 -2
  146. package/SpeedDialAction/SpeedDialAction.d.ts +3 -3
  147. package/SpeedDialIcon/SpeedDialIcon.d.ts +2 -2
  148. package/Stack/Stack.d.ts +2 -2
  149. package/Step/Step.d.ts +2 -2
  150. package/StepButton/StepButton.d.ts +3 -3
  151. package/StepConnector/StepConnector.d.ts +2 -2
  152. package/StepContent/StepContent.d.ts +2 -2
  153. package/StepIcon/StepIcon.d.ts +3 -3
  154. package/StepLabel/StepLabel.d.ts +2 -2
  155. package/Stepper/Stepper.d.ts +2 -2
  156. package/SvgIcon/SvgIcon.d.ts +3 -3
  157. package/SwipeableDrawer/SwipeableDrawer.d.ts +3 -3
  158. package/SwipeableDrawer/SwipeableDrawer.js +5 -7
  159. package/Switch/Switch.d.ts +4 -4
  160. package/Switch/Switch.js +7 -4
  161. package/Tab/Tab.d.ts +3 -3
  162. package/TabScrollButton/TabScrollButton.d.ts +2 -2
  163. package/Table/Table.d.ts +2 -2
  164. package/TableBody/TableBody.d.ts +2 -2
  165. package/TableCell/TableCell.d.ts +2 -2
  166. package/TableContainer/TableContainer.d.ts +2 -2
  167. package/TableFooter/TableFooter.d.ts +2 -2
  168. package/TableHead/TableHead.d.ts +2 -2
  169. package/TablePagination/TablePagination.d.ts +4 -4
  170. package/TablePaginationActions/TablePaginationActions.d.ts +2 -2
  171. package/TableRow/TableRow.d.ts +2 -2
  172. package/TableSortLabel/TableSortLabel.d.ts +3 -3
  173. package/Tabs/Tabs.d.ts +2 -2
  174. package/TextField/TextField.d.ts +10 -10
  175. package/TextareaAutosize/TextareaAutosize.d.ts +2 -2
  176. package/TextareaAutosize/TextareaAutosize.js +2 -2
  177. package/ToggleButton/ToggleButton.d.ts +3 -3
  178. package/ToggleButtonGroup/ToggleButtonGroup.d.ts +2 -2
  179. package/Toolbar/Toolbar.d.ts +2 -2
  180. package/Tooltip/Tooltip.d.ts +2 -2
  181. package/Typography/Typography.d.ts +4 -3
  182. package/Unstable_TrapFocus/FocusTrap.js +15 -5
  183. package/Zoom/Zoom.d.ts +3 -3
  184. package/Zoom/Zoom.js +24 -30
  185. package/esm/Accordion/Accordion.d.ts +3 -3
  186. package/esm/AccordionActions/AccordionActions.d.ts +2 -2
  187. package/esm/AccordionDetails/AccordionDetails.d.ts +2 -2
  188. package/esm/AccordionSummary/AccordionSummary.d.ts +3 -3
  189. package/esm/Alert/Alert.d.ts +3 -3
  190. package/esm/AlertTitle/AlertTitle.d.ts +3 -3
  191. package/esm/AppBar/AppBar.d.ts +3 -3
  192. package/esm/Autocomplete/Autocomplete.d.ts +18 -2
  193. package/esm/Autocomplete/Autocomplete.js +111 -37
  194. package/esm/Avatar/Avatar.d.ts +2 -2
  195. package/esm/AvatarGroup/AvatarGroup.d.ts +2 -2
  196. package/esm/Backdrop/Backdrop.d.ts +3 -3
  197. package/esm/Badge/Badge.d.ts +3 -3
  198. package/esm/BottomNavigation/BottomNavigation.d.ts +2 -2
  199. package/esm/BottomNavigationAction/BottomNavigationAction.d.ts +3 -3
  200. package/esm/Box/Box.d.ts +3 -2
  201. package/esm/Breadcrumbs/Breadcrumbs.d.ts +3 -3
  202. package/esm/Button/Button.d.ts +6 -5
  203. package/esm/Button/Button.js +18 -1
  204. package/esm/ButtonBase/ButtonBase.d.ts +2 -2
  205. package/esm/ButtonBase/ButtonBase.js +8 -2
  206. package/esm/ButtonGroup/ButtonGroup.d.ts +2 -2
  207. package/esm/Card/Card.d.ts +3 -3
  208. package/esm/CardActionArea/CardActionArea.d.ts +3 -3
  209. package/esm/CardActions/CardActions.d.ts +2 -2
  210. package/esm/CardContent/CardContent.d.ts +2 -2
  211. package/esm/CardHeader/CardHeader.d.ts +2 -2
  212. package/esm/CardHeader/CardHeader.js +5 -1
  213. package/esm/CardMedia/CardMedia.d.ts +2 -2
  214. package/esm/Checkbox/Checkbox.d.ts +4 -4
  215. package/esm/Checkbox/Checkbox.js +2 -1
  216. package/esm/Chip/Chip.d.ts +2 -2
  217. package/esm/CircularProgress/CircularProgress.d.ts +2 -2
  218. package/esm/ClickAwayListener/ClickAwayListener.d.ts +3 -3
  219. package/esm/ClickAwayListener/ClickAwayListener.js +5 -8
  220. package/esm/Collapse/Collapse.d.ts +5 -5
  221. package/esm/Collapse/Collapse.js +7 -19
  222. package/esm/Container/Container.d.ts +2 -2
  223. package/esm/CssBaseline/CssBaseline.d.ts +2 -2
  224. package/esm/Dialog/Dialog.d.ts +10 -3
  225. package/esm/Dialog/Dialog.js +19 -6
  226. package/esm/DialogActions/DialogActions.d.ts +2 -2
  227. package/esm/DialogContent/DialogContent.d.ts +2 -2
  228. package/esm/DialogContentText/DialogContentText.d.ts +3 -3
  229. package/esm/DialogTitle/DialogTitle.d.ts +3 -3
  230. package/esm/Divider/Divider.d.ts +4 -3
  231. package/esm/Drawer/Drawer.d.ts +3 -3
  232. package/esm/Drawer/Drawer.js +18 -4
  233. package/esm/Fab/Fab.d.ts +3 -3
  234. package/esm/Fab/Fab.js +7 -1
  235. package/esm/Fade/Fade.d.ts +3 -3
  236. package/esm/Fade/Fade.js +29 -33
  237. package/esm/FilledInput/FilledInput.d.ts +3 -3
  238. package/esm/FilledInput/FilledInput.js +1 -1
  239. package/esm/FormControl/FormControl.d.ts +7 -7
  240. package/esm/FormControlLabel/FormControlLabel.d.ts +4 -4
  241. package/esm/FormGroup/FormGroup.d.ts +3 -3
  242. package/esm/FormHelperText/FormHelperText.d.ts +3 -3
  243. package/esm/FormLabel/FormLabel.d.ts +5 -5
  244. package/esm/GlobalStyles/GlobalStyles.d.ts +2 -2
  245. package/esm/Grid/Grid.d.ts +2 -2
  246. package/esm/Grid/Grid.js +2 -2
  247. package/esm/GridLegacy/GridLegacy.d.ts +2 -2
  248. package/esm/Grow/Grow.d.ts +5 -5
  249. package/esm/Grow/Grow.js +31 -39
  250. package/esm/Icon/Icon.d.ts +3 -3
  251. package/esm/IconButton/IconButton.d.ts +5 -5
  252. package/esm/ImageList/ImageList.d.ts +2 -2
  253. package/esm/ImageListItem/ImageListItem.d.ts +2 -2
  254. package/esm/ImageListItemBar/ImageListItemBar.d.ts +2 -2
  255. package/esm/InitColorSchemeScript/InitColorSchemeScript.d.ts +2 -2
  256. package/esm/InitColorSchemeScript/InitColorSchemeScript.js +2 -2
  257. package/esm/Input/Input.d.ts +3 -3
  258. package/esm/Input/Input.js +1 -1
  259. package/esm/InputAdornment/InputAdornment.d.ts +2 -2
  260. package/esm/InputBase/InputBase.d.ts +2 -2
  261. package/esm/InputBase/InputBase.js +39 -7
  262. package/esm/InputLabel/InputLabel.d.ts +4 -4
  263. package/esm/LinearProgress/LinearProgress.d.ts +2 -2
  264. package/esm/Link/Link.d.ts +4 -4
  265. package/esm/List/List.d.ts +4 -3
  266. package/esm/ListItem/ListItem.d.ts +3 -3
  267. package/esm/ListItemAvatar/ListItemAvatar.d.ts +2 -2
  268. package/esm/ListItemButton/ListItemButton.d.ts +4 -3
  269. package/esm/ListItemButton/ListItemButton.js +7 -1
  270. package/esm/ListItemIcon/ListItemIcon.d.ts +3 -2
  271. package/esm/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +2 -2
  272. package/esm/ListItemText/ListItemText.d.ts +3 -2
  273. package/esm/ListItemText/ListItemText.js +5 -1
  274. package/esm/ListSubheader/ListSubheader.d.ts +3 -2
  275. package/esm/Menu/Menu.d.ts +4 -4
  276. package/esm/MenuItem/MenuItem.d.ts +3 -3
  277. package/esm/MenuItem/MenuItem.js +29 -2
  278. package/esm/MenuList/MenuList.d.ts +4 -4
  279. package/esm/MobileStepper/MobileStepper.d.ts +3 -3
  280. package/esm/Modal/Modal.d.ts +7 -7
  281. package/esm/NativeSelect/NativeSelect.d.ts +3 -3
  282. package/esm/NoSsr/NoSsr.d.ts +2 -2
  283. package/esm/NoSsr/NoSsr.js +2 -2
  284. package/esm/OutlinedInput/OutlinedInput.d.ts +4 -4
  285. package/esm/Pagination/Pagination.d.ts +2 -2
  286. package/esm/PaginationItem/PaginationItem.d.ts +3 -3
  287. package/esm/Paper/Paper.d.ts +4 -3
  288. package/esm/PigmentContainer/PigmentContainer.d.ts +2 -2
  289. package/esm/PigmentContainer/PigmentContainer.js +2 -4
  290. package/esm/PigmentGrid/PigmentGrid.d.ts +2 -2
  291. package/esm/PigmentGrid/PigmentGrid.js +2 -4
  292. package/esm/PigmentStack/PigmentStack.d.ts +2 -2
  293. package/esm/PigmentStack/PigmentStack.js +2 -4
  294. package/esm/Popover/Popover.d.ts +4 -4
  295. package/esm/Popper/BasePopper.js +23 -1
  296. package/esm/Popper/Popper.d.ts +4 -4
  297. package/esm/Popper/Popper.js +4 -4
  298. package/esm/Popper/index.d.ts +1 -0
  299. package/esm/Popper/index.js +1 -0
  300. package/esm/Portal/Portal.d.ts +2 -2
  301. package/esm/Portal/Portal.js +2 -2
  302. package/esm/Radio/Radio.d.ts +3 -3
  303. package/esm/RadioGroup/RadioGroup.d.ts +3 -3
  304. package/esm/Rating/Rating.d.ts +2 -2
  305. package/esm/ScopedCssBaseline/ScopedCssBaseline.d.ts +2 -2
  306. package/esm/Select/Select.d.ts +3 -3
  307. package/esm/Select/SelectInput.js +43 -44
  308. package/esm/Select/index.d.ts +1 -0
  309. package/esm/Select/index.js +1 -0
  310. package/esm/Select/utils/SelectFocusSourceContext.d.ts +4 -0
  311. package/esm/Select/utils/SelectFocusSourceContext.js +13 -0
  312. package/esm/Select/utils/areEqualValues.d.ts +1 -0
  313. package/esm/Select/utils/areEqualValues.js +8 -0
  314. package/esm/Select/utils/getOpenInteractionType.d.ts +1 -0
  315. package/esm/Select/utils/getOpenInteractionType.js +12 -0
  316. package/esm/Select/utils/index.d.ts +4 -0
  317. package/esm/Select/utils/index.js +4 -0
  318. package/esm/Select/utils/isEmpty.d.ts +1 -0
  319. package/esm/Select/utils/isEmpty.js +3 -0
  320. package/esm/Skeleton/Skeleton.d.ts +2 -2
  321. package/esm/Slide/Slide.d.ts +4 -4
  322. package/esm/Slide/Slide.js +44 -44
  323. package/esm/Slider/Slider.d.ts +7 -7
  324. package/esm/Slider/useSlider.js +6 -3
  325. package/esm/Snackbar/Snackbar.d.ts +2 -2
  326. package/esm/SnackbarContent/SnackbarContent.d.ts +3 -3
  327. package/esm/SpeedDial/SpeedDial.d.ts +2 -2
  328. package/esm/SpeedDialAction/SpeedDialAction.d.ts +3 -3
  329. package/esm/SpeedDialIcon/SpeedDialIcon.d.ts +2 -2
  330. package/esm/Stack/Stack.d.ts +2 -2
  331. package/esm/Step/Step.d.ts +2 -2
  332. package/esm/StepButton/StepButton.d.ts +3 -3
  333. package/esm/StepConnector/StepConnector.d.ts +2 -2
  334. package/esm/StepContent/StepContent.d.ts +2 -2
  335. package/esm/StepIcon/StepIcon.d.ts +3 -3
  336. package/esm/StepLabel/StepLabel.d.ts +2 -2
  337. package/esm/Stepper/Stepper.d.ts +2 -2
  338. package/esm/SvgIcon/SvgIcon.d.ts +3 -3
  339. package/esm/SwipeableDrawer/SwipeableDrawer.d.ts +3 -3
  340. package/esm/SwipeableDrawer/SwipeableDrawer.js +5 -7
  341. package/esm/Switch/Switch.d.ts +4 -4
  342. package/esm/Switch/Switch.js +7 -4
  343. package/esm/Tab/Tab.d.ts +3 -3
  344. package/esm/TabScrollButton/TabScrollButton.d.ts +2 -2
  345. package/esm/Table/Table.d.ts +2 -2
  346. package/esm/TableBody/TableBody.d.ts +2 -2
  347. package/esm/TableCell/TableCell.d.ts +2 -2
  348. package/esm/TableContainer/TableContainer.d.ts +2 -2
  349. package/esm/TableFooter/TableFooter.d.ts +2 -2
  350. package/esm/TableHead/TableHead.d.ts +2 -2
  351. package/esm/TablePagination/TablePagination.d.ts +4 -4
  352. package/esm/TablePaginationActions/TablePaginationActions.d.ts +2 -2
  353. package/esm/TableRow/TableRow.d.ts +2 -2
  354. package/esm/TableSortLabel/TableSortLabel.d.ts +3 -3
  355. package/esm/Tabs/Tabs.d.ts +2 -2
  356. package/esm/TextField/TextField.d.ts +10 -10
  357. package/esm/TextareaAutosize/TextareaAutosize.d.ts +2 -2
  358. package/esm/TextareaAutosize/TextareaAutosize.js +2 -2
  359. package/esm/ToggleButton/ToggleButton.d.ts +3 -3
  360. package/esm/ToggleButtonGroup/ToggleButtonGroup.d.ts +2 -2
  361. package/esm/Toolbar/Toolbar.d.ts +2 -2
  362. package/esm/Tooltip/Tooltip.d.ts +2 -2
  363. package/esm/Typography/Typography.d.ts +4 -3
  364. package/esm/Unstable_TrapFocus/FocusTrap.js +15 -5
  365. package/esm/Zoom/Zoom.d.ts +3 -3
  366. package/esm/Zoom/Zoom.js +25 -31
  367. package/esm/index.js +1 -1
  368. package/esm/styles/createThemeNoVars.js +1 -1
  369. package/esm/styles/createThemeWithVars.js +9 -9
  370. package/esm/transitions/utils.d.ts +7 -0
  371. package/esm/transitions/utils.js +25 -0
  372. package/esm/useAutocomplete/useAutocomplete.d.ts +4 -5
  373. package/esm/useAutocomplete/useAutocomplete.js +211 -47
  374. package/esm/utils/contains.d.ts +2 -0
  375. package/esm/utils/contains.js +2 -0
  376. package/esm/utils/focusable.d.ts +7 -0
  377. package/esm/utils/focusable.js +13 -0
  378. package/esm/utils/getEventTarget.d.ts +2 -0
  379. package/esm/utils/getEventTarget.js +2 -0
  380. package/esm/version/index.js +2 -2
  381. package/index.js +1 -1
  382. package/package.json +5 -5
  383. package/styles/createThemeNoVars.js +1 -1
  384. package/styles/createThemeWithVars.js +9 -9
  385. package/transitions/utils.d.ts +7 -0
  386. package/transitions/utils.js +27 -0
  387. package/useAutocomplete/useAutocomplete.d.ts +4 -5
  388. package/useAutocomplete/useAutocomplete.js +211 -47
  389. package/utils/contains.d.ts +2 -0
  390. package/utils/contains.js +9 -0
  391. package/utils/focusable.d.ts +7 -0
  392. package/utils/focusable.js +20 -0
  393. package/utils/getEventTarget.d.ts +2 -0
  394. package/utils/getEventTarget.js +9 -0
  395. package/version/index.js +2 -2
@@ -329,21 +329,21 @@ export default function createThemeWithVars(options = {}, ...args) {
329
329
  setColor(palette.TableCell, 'border', colorMix(safeDarken, safeAlpha(nativeColor ? getCssVar('palette-divider') : palette.divider, 1), 0.68));
330
330
  setColor(palette.Tooltip, 'bg', colorMix(safeAlpha, nativeColor ? getCssVar('palette-grey-700') : palette.grey[700], 0.92));
331
331
  }
332
+ if (!nativeColor) {
333
+ setColorChannel(palette.background, 'default');
332
334
 
333
- // MUI X - DataGrid needs this token.
334
- setColorChannel(palette.background, 'default');
335
-
336
- // added for consistency with the `background.default` token
337
- setColorChannel(palette.background, 'paper');
338
- setColorChannel(palette.common, 'background');
339
- setColorChannel(palette.common, 'onBackground');
340
- setColorChannel(palette, 'divider');
335
+ // added for consistency with the `background.default` token
336
+ setColorChannel(palette.background, 'paper');
337
+ setColorChannel(palette.common, 'background');
338
+ setColorChannel(palette.common, 'onBackground');
339
+ setColorChannel(palette, 'divider');
340
+ }
341
341
  Object.keys(palette).forEach(color => {
342
342
  const colors = palette[color];
343
343
 
344
344
  // The default palettes (primary, secondary, error, info, success, and warning) errors are handled by the above `createTheme(...)`.
345
345
 
346
- if (color !== 'tonalOffset' && colors && typeof colors === 'object') {
346
+ if (color !== 'tonalOffset' && !nativeColor && colors && typeof colors === 'object') {
347
347
  // Silent the error for custom palettes.
348
348
  if (colors.main) {
349
349
  setColor(palette[color], 'mainChannel', safeColorChannel(toRgb(colors.main)));
@@ -19,5 +19,12 @@ interface TransitionProps {
19
19
  easing: string | undefined;
20
20
  delay: string | undefined;
21
21
  }
22
+ export declare function normalizedTransitionCallback(nodeRef: React.RefObject<HTMLElement | null>, callback: ((node: HTMLElement, isAppearing?: boolean) => void) | undefined): (maybeIsAppearing?: boolean) => void;
23
+ type TransitionState = 'entering' | 'entered' | 'exiting' | 'exited';
24
+ /**
25
+ * Computes the child style for a transition component, reusing existing
26
+ * references when possible to preserve referential equality for React.memo.
27
+ */
28
+ export declare function getTransitionChildStyle(state: TransitionState, inProp: boolean | undefined, baseStyles: Record<string, React.CSSProperties>, hiddenStyles: React.CSSProperties, styleProp: React.CSSProperties | undefined, childStyle: React.CSSProperties | undefined): React.CSSProperties | undefined;
22
29
  export declare function getTransitionProps(props: ComponentProps, options: Options): TransitionProps;
23
30
  export {};
@@ -1,4 +1,29 @@
1
1
  export const reflow = node => node.scrollTop;
2
+ export function normalizedTransitionCallback(nodeRef, callback) {
3
+ return maybeIsAppearing => {
4
+ if (callback) {
5
+ const node = nodeRef.current;
6
+ // onEnterXxx and onExitXxx callbacks have a different arguments.length value.
7
+ if (maybeIsAppearing === undefined) {
8
+ callback(node);
9
+ } else {
10
+ callback(node, maybeIsAppearing);
11
+ }
12
+ }
13
+ };
14
+ }
15
+ /**
16
+ * Computes the child style for a transition component, reusing existing
17
+ * references when possible to preserve referential equality for React.memo.
18
+ */
19
+ export function getTransitionChildStyle(state, inProp, baseStyles, hiddenStyles, styleProp, childStyle) {
20
+ const base = state === 'exited' && !inProp ? hiddenStyles : baseStyles[state] || baseStyles.exited;
21
+ return styleProp || childStyle ? {
22
+ ...base,
23
+ ...styleProp,
24
+ ...childStyle
25
+ } : base;
26
+ }
2
27
  export function getTransitionProps(props, options) {
3
28
  const {
4
29
  timeout,
@@ -46,12 +46,11 @@ export interface UseAutocompleteProps<Value, Multiple extends boolean | undefine
46
46
  */
47
47
  autoHighlight?: boolean | undefined;
48
48
  /**
49
- * If `true`, the selected option becomes the value of the input
50
- * when the Autocomplete loses focus unless the user chooses
51
- * a different option or changes the character string in the input.
49
+ * If `true`, the value is updated when the input loses focus under one of these conditions:
52
50
  *
53
- * When using the `freeSolo` mode, the typed value will be the input value
54
- * if the Autocomplete loses focus without highlighting an option.
51
+ * - An option highlighted via keyboard navigation or `autoHighlight` is selected.
52
+ * Hover and touch highlights are ignored.
53
+ * - Otherwise, in `freeSolo` mode, the typed text becomes the value.
55
54
  * @default false
56
55
  */
57
56
  autoSelect?: boolean | undefined;
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import * as React from 'react';
4
+ import contains from '@mui/utils/contains';
4
5
  import setRef from '@mui/utils/setRef';
5
6
  import useEventCallback from '@mui/utils/useEventCallback';
6
7
  import useControlled from '@mui/utils/useControlled';
@@ -55,7 +56,8 @@ const defaultFilterOptions = createFilterOptions();
55
56
 
56
57
  // Number of options to jump in list box when `Page Up` and `Page Down` keys are used.
57
58
  const pageSize = 5;
58
- const defaultIsActiveElementInListbox = listboxRef => listboxRef.current !== null && listboxRef.current.parentElement?.contains(document.activeElement);
59
+ const defaultIsActiveElementInListbox = listboxRef => listboxRef.current !== null && contains(listboxRef.current.parentElement, document.activeElement);
60
+ const defaultIsOptionEqualToValue = (option, value) => option === value;
59
61
  const MULTIPLE_DEFAULT_VALUE = [];
60
62
  function getInputValue(value, multiple, getOptionLabel, renderValue) {
61
63
  if (multiple || value == null || renderValue) {
@@ -94,7 +96,7 @@ function useAutocomplete(props) {
94
96
  id: idProp,
95
97
  includeInputInList = false,
96
98
  inputValue: inputValueProp,
97
- isOptionEqualToValue = (option, value) => option === value,
99
+ isOptionEqualToValue = defaultIsOptionEqualToValue,
98
100
  multiple = false,
99
101
  onChange,
100
102
  onClose,
@@ -126,11 +128,26 @@ function useAutocomplete(props) {
126
128
  const firstFocus = React.useRef(true);
127
129
  const inputRef = React.useRef(null);
128
130
  const listboxRef = React.useRef(null);
131
+ const windowLostFocus = React.useRef(false);
129
132
  const [anchorEl, setAnchorEl] = React.useState(null);
130
133
  const [focusedItem, setFocusedItem] = React.useState(-1);
131
134
  const defaultHighlighted = autoHighlight ? 0 : -1;
132
135
  const highlightedIndexRef = React.useRef(defaultHighlighted);
133
136
 
137
+ // Tracks how the current highlight was set:
138
+ // - 'keyboard' — arrow keys, Home/End, PageUp/PageDown
139
+ // - 'mouse' — handleOptionMouseMove
140
+ // - 'touch' — handleOptionTouchStart
141
+ // - null — programmatic (autoHighlight, value sync)
142
+ //
143
+ // This lets handleBlur and the Enter handler distinguish intentional
144
+ // interactions from incidental ones — e.g. autoSelect should not commit
145
+ // a highlight that came from a casual mouse hover.
146
+ /** @type {React.RefObject<AutocompleteHighlightChangeReason | null>} */
147
+ const highlightReasonRef = React.useRef(null);
148
+ const touchScrolledRef = React.useRef(false);
149
+ const isTouchRef = React.useRef(false);
150
+
134
151
  // Calculate the initial inputValue on mount only.
135
152
  // useRef ensures it doesn't update dynamically with defaultValue or value props.
136
153
  const initialInputValue = React.useRef(getInputValue(defaultValue ?? valueProp, multiple, getOptionLabel)).current;
@@ -171,8 +188,30 @@ function useAutocomplete(props) {
171
188
  const [inputPristine, setInputPristine] = React.useState(true);
172
189
  const inputValueIsSelectedValue = !multiple && value != null && inputValue === getOptionLabel(value);
173
190
  const popupOpen = open && !readOnly;
191
+ const selectedValues = React.useMemo(() => {
192
+ if (multiple) {
193
+ return value;
194
+ }
195
+ if (value != null) {
196
+ return [value];
197
+ }
198
+ return [];
199
+ }, [multiple, value]);
200
+ const selectedValuesSet = React.useMemo(() => {
201
+ // Fast path for the default strict equality comparator to avoid O(n^2) option checks.
202
+ if (isOptionEqualToValue !== defaultIsOptionEqualToValue || selectedValues.length === 0) {
203
+ return null;
204
+ }
205
+ return new Set(selectedValues);
206
+ }, [isOptionEqualToValue, selectedValues]);
207
+ const isOptionSelected = React.useCallback(option => {
208
+ if (selectedValuesSet) {
209
+ return selectedValuesSet.has(option);
210
+ }
211
+ return selectedValues.some(value2 => value2 != null && isOptionEqualToValue(option, value2));
212
+ }, [isOptionEqualToValue, selectedValues, selectedValuesSet]);
174
213
  const filteredOptions = popupOpen ? filterOptions(options.filter(option => {
175
- if (filterSelectedOptions && (multiple ? value : [value]).some(value2 => value2 !== null && isOptionEqualToValue(option, value2))) {
214
+ if (filterSelectedOptions && isOptionSelected(option)) {
176
215
  return false;
177
216
  }
178
217
  return true;
@@ -248,22 +287,17 @@ function useAutocomplete(props) {
248
287
  }
249
288
  }
250
289
  }
251
- const setHighlightedIndex = useEventCallback(({
252
- event,
290
+ const syncHighlightedIndexToDOM = useEventCallback(({
253
291
  index,
254
- reason
292
+ reason,
293
+ preserveScroll = false
255
294
  }) => {
256
- highlightedIndexRef.current = index;
257
-
258
295
  // does the index exist?
259
296
  if (index === -1) {
260
297
  inputRef.current.removeAttribute('aria-activedescendant');
261
298
  } else {
262
299
  inputRef.current.setAttribute('aria-activedescendant', `${id}-option-${index}`);
263
300
  }
264
- if (onHighlightChange && ['mouse', 'keyboard', 'touch'].includes(reason)) {
265
- onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
266
- }
267
301
  if (!listboxRef.current) {
268
302
  return;
269
303
  }
@@ -282,7 +316,9 @@ function useAutocomplete(props) {
282
316
  return;
283
317
  }
284
318
  if (index === -1) {
285
- listboxNode.scrollTop = 0;
319
+ if (!preserveScroll) {
320
+ listboxNode.scrollTop = 0;
321
+ }
286
322
  return;
287
323
  }
288
324
  const option = listboxRef.current.querySelector(`[data-option-index="${index}"]`);
@@ -310,15 +346,46 @@ function useAutocomplete(props) {
310
346
  }
311
347
  }
312
348
  });
349
+ const setHighlightedIndex = useEventCallback(({
350
+ event,
351
+ index,
352
+ reason,
353
+ preserveScroll = false
354
+ }) => {
355
+ highlightedIndexRef.current = index;
356
+ highlightReasonRef.current = reason ?? null;
357
+ if (onHighlightChange && ['mouse', 'keyboard', 'touch'].includes(reason)) {
358
+ onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
359
+ }
360
+ syncHighlightedIndexToDOM({
361
+ index,
362
+ reason,
363
+ preserveScroll
364
+ });
365
+ });
366
+ const setHighlightedIndexFromSync = useEventCallback(({
367
+ index
368
+ }) => {
369
+ highlightedIndexRef.current = index;
370
+ syncHighlightedIndexToDOM({
371
+ index,
372
+ reason: highlightReasonRef.current
373
+ });
374
+ });
313
375
  const changeHighlightedIndex = useEventCallback(({
314
376
  event,
315
377
  diff,
316
378
  direction = 'next',
317
- reason
379
+ reason,
380
+ preserveScroll
318
381
  }) => {
319
382
  if (!popupOpen) {
320
383
  return;
321
384
  }
385
+ if (reason === 'keyboard') {
386
+ touchScrolledRef.current = false;
387
+ isTouchRef.current = false;
388
+ }
322
389
  const getNextIndex = () => {
323
390
  const maxIndex = filteredOptions.length - 1;
324
391
  if (diff === 'reset') {
@@ -355,7 +422,8 @@ function useAutocomplete(props) {
355
422
  setHighlightedIndex({
356
423
  index: nextIndex,
357
424
  reason,
358
- event
425
+ event,
426
+ preserveScroll
359
427
  });
360
428
 
361
429
  // Sync the content of the input with the highlighted option.
@@ -409,15 +477,24 @@ function useAutocomplete(props) {
409
477
  // If it exists and the value and the inputValue haven't changed, just update its index, otherwise continue execution
410
478
  const previousHighlightedOptionIndex = getPreviousHighlightedOptionIndex();
411
479
  if (previousHighlightedOptionIndex !== -1) {
412
- highlightedIndexRef.current = previousHighlightedOptionIndex;
480
+ // Keep the original highlight reason while re-syncing the DOM state.
481
+ // The highlighted option still exists after the filteredOptions array changed
482
+ // (e.g. async fetch returns new options while the user is mid-navigation),
483
+ // so the original interaction reason (keyboard, mouse, etc.) still applies.
484
+ setHighlightedIndexFromSync({
485
+ index: previousHighlightedOptionIndex
486
+ });
413
487
  return;
414
488
  }
415
489
  const valueItem = multiple ? value[0] : value;
416
490
 
417
491
  // The popup is empty, reset
418
492
  if (filteredOptions.length === 0 || valueItem == null) {
493
+ // Preserve scroll when new options are appended without changing the current filter.
494
+ const isAppendOnly = filteredOptionsChanged && previousProps.inputValue === inputValue && previousProps.filteredOptions?.length > 0 && filteredOptions.length > previousProps.filteredOptions.length && previousProps.filteredOptions.every((option, index) => getOptionLabel(option) === getOptionLabel(filteredOptions[index]));
419
495
  changeHighlightedIndex({
420
- diff: 'reset'
496
+ diff: 'reset',
497
+ preserveScroll: isAppendOnly
421
498
  });
422
499
  return;
423
500
  }
@@ -429,8 +506,12 @@ function useAutocomplete(props) {
429
506
  if (valueItem != null) {
430
507
  const currentOption = filteredOptions[highlightedIndexRef.current];
431
508
 
432
- // Keep the current highlighted index if possible
433
- if (multiple && currentOption && value.findIndex(val => isOptionEqualToValue(currentOption, val)) !== -1) {
509
+ // Keep the current selected highlight while the popup stays open;
510
+ // on reopen, resync from the selected value.
511
+ if (multiple && currentOption && value.findIndex(val => isOptionEqualToValue(currentOption, val)) !== -1 && previousProps.filteredOptions?.length > 0) {
512
+ setHighlightedIndexFromSync({
513
+ index: highlightedIndexRef.current
514
+ });
434
515
  return;
435
516
  }
436
517
  const itemIndex = filteredOptions.findIndex(optionItem => isOptionEqualToValue(optionItem, valueItem));
@@ -465,7 +546,7 @@ function useAutocomplete(props) {
465
546
  filteredOptions.length,
466
547
  // Don't sync the highlighted index with the value when multiple
467
548
  // eslint-disable-next-line react-hooks/exhaustive-deps
468
- multiple ? false : value, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]);
549
+ multiple ? false : value, changeHighlightedIndex, setHighlightedIndex, setHighlightedIndexFromSync, popupOpen, inputValue, multiple]);
469
550
  const handleListboxRef = useEventCallback(node => {
470
551
  setRef(listboxRef, node);
471
552
  if (!node) {
@@ -490,12 +571,28 @@ function useAutocomplete(props) {
490
571
  syncHighlightedIndex();
491
572
  }
492
573
  }, [syncHighlightedIndex, filteredOptionsChanged, popupOpen, disableCloseOnSelect]);
574
+
575
+ // Listen for browser window blur to detect when the user switches tabs or windows.
576
+ // This helps prevent the popup from reopening automatically when the window regains focus.
577
+ React.useEffect(() => {
578
+ if (typeof window === 'undefined') {
579
+ return undefined;
580
+ }
581
+ const handleWindowBlur = () => {
582
+ windowLostFocus.current = true;
583
+ };
584
+ window.addEventListener('blur', handleWindowBlur);
585
+ return () => {
586
+ window.removeEventListener('blur', handleWindowBlur);
587
+ };
588
+ }, []);
493
589
  const handleOpen = event => {
494
590
  if (open) {
495
591
  return;
496
592
  }
497
593
  setOpenState(true);
498
594
  setInputPristine(true);
595
+ isTouchRef.current = false;
499
596
  if (onOpen) {
500
597
  onOpen(event);
501
598
  }
@@ -505,6 +602,8 @@ function useAutocomplete(props) {
505
602
  return;
506
603
  }
507
604
  setOpenState(false);
605
+ touchScrolledRef.current = false;
606
+ highlightReasonRef.current = null;
508
607
  if (onClose) {
509
608
  onClose(event, reason);
510
609
  }
@@ -522,7 +621,6 @@ function useAutocomplete(props) {
522
621
  }
523
622
  setValueState(newValue);
524
623
  };
525
- const isTouch = React.useRef(false);
526
624
  const selectNewValue = (event, option, reasonProp = 'selectOption', origin = 'options') => {
527
625
  let reason = reasonProp;
528
626
  let newValue = option;
@@ -549,7 +647,7 @@ function useAutocomplete(props) {
549
647
  if (!disableCloseOnSelect && (!event || !event.ctrlKey && !event.metaKey)) {
550
648
  handleClose(event, reason);
551
649
  }
552
- if (blurOnSelect === true || blurOnSelect === 'touch' && isTouch.current || blurOnSelect === 'mouse' && !isTouch.current) {
650
+ if (blurOnSelect === true || blurOnSelect === 'touch' && isTouchRef.current || blurOnSelect === 'mouse' && !isTouchRef.current) {
553
651
  inputRef.current.blur();
554
652
  }
555
653
  };
@@ -738,29 +836,47 @@ function useAutocomplete(props) {
738
836
  }
739
837
  break;
740
838
  case 'Enter':
741
- if (highlightedIndexRef.current !== -1 && popupOpen) {
742
- const option = filteredOptions[highlightedIndexRef.current];
743
- const disabled = getOptionDisabled ? getOptionDisabled(option) : false;
839
+ {
840
+ // In freeSolo, only select the highlighted option if the user hasn't
841
+ // typed new text (inputPristine) or explicitly interacted with an option
842
+ // (keyboard, mouse, or touch — any non-null reason). This lets typed
843
+ // text win over a programmatic highlight (reason=null, e.g. from
844
+ // syncHighlightedIndex matching a previous value) while still honoring
845
+ // deliberate user interactions like hovering a suggestion then pressing Enter.
846
+ const shouldSelectHighlighted = !freeSolo || inputPristine || highlightReasonRef.current !== null;
847
+ if (highlightedIndexRef.current !== -1 && popupOpen && shouldSelectHighlighted &&
848
+ // After a touch-scroll the highlight is stale (the user scrolled
849
+ // past it), so skip selection until the next deliberate interaction.
850
+ !touchScrolledRef.current) {
851
+ const option = filteredOptions[highlightedIndexRef.current];
852
+ const disabled = getOptionDisabled ? getOptionDisabled(option) : false;
744
853
 
745
- // Avoid early form validation, let the end-users continue filling the form.
746
- event.preventDefault();
747
- if (disabled) {
748
- return;
749
- }
750
- selectNewValue(event, option, 'selectOption');
854
+ // Avoid early form validation, let the end-users continue filling the form.
855
+ event.preventDefault();
856
+ if (disabled) {
857
+ return;
858
+ }
859
+ selectNewValue(event, option, 'selectOption');
751
860
 
752
- // Move the selection to the end.
753
- if (autoComplete) {
754
- inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);
755
- }
756
- } else if (freeSolo && inputValue !== '' && inputValueIsSelectedValue === false) {
757
- if (multiple) {
758
- // Allow people to add new values before they submit the form.
861
+ // Move the selection to the end.
862
+ if (autoComplete) {
863
+ inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);
864
+ }
865
+ } else if (freeSolo && inputValue !== '' && inputValueIsSelectedValue === false) {
866
+ if (multiple) {
867
+ // Allow people to add new values before they submit the form.
868
+ event.preventDefault();
869
+ }
870
+ selectNewValue(event, inputValue, 'createOption', 'freeSolo');
871
+ } else if (popupOpen && touchScrolledRef.current) {
872
+ // The highlight is stale from a touch-scroll - close without selecting.
759
873
  event.preventDefault();
874
+ // This happens on Enter, but re-using "escape" as the closest `AutocompleteCloseReason`
875
+ // to avoid creating a new reason
876
+ handleClose(event, 'escape');
760
877
  }
761
- selectNewValue(event, inputValue, 'createOption', 'freeSolo');
878
+ break;
762
879
  }
763
- break;
764
880
  case 'Escape':
765
881
  if (popupOpen) {
766
882
  // Avoid Opera to exit fullscreen mode.
@@ -825,6 +941,14 @@ function useAutocomplete(props) {
825
941
  // Ensure DOM focus lands on the input
826
942
  focusItem(-1);
827
943
  }
944
+
945
+ // If the window previously lost focus while the popup was open,
946
+ // ignore this focus event to prevent unintended reopening.
947
+ // Reset the flag so normal focus behavior resumes.
948
+ if (windowLostFocus.current) {
949
+ windowLostFocus.current = false;
950
+ return;
951
+ }
828
952
  if (openOnFocus && !ignoreFocus.current) {
829
953
  handleOpen(event);
830
954
  }
@@ -838,7 +962,12 @@ function useAutocomplete(props) {
838
962
  setFocused(false);
839
963
  firstFocus.current = true;
840
964
  ignoreFocus.current = false;
841
- if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen) {
965
+
966
+ // Auto-select the highlighted option on blur, but only if the highlight
967
+ // came from keyboard navigation or was set programmatically (autoHighlight).
968
+ // Mouse hover and touch should not trigger selection — the user may have
969
+ // moved the pointer over an option without intending to commit to it.
970
+ if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen && highlightReasonRef.current !== 'mouse' && highlightReasonRef.current !== 'touch') {
842
971
  selectNewValue(event, filteredOptions[highlightedIndexRef.current], 'blur');
843
972
  } else if (autoSelect && freeSolo && inputValue !== '') {
844
973
  selectNewValue(event, inputValue, 'blur', 'freeSolo');
@@ -849,9 +978,10 @@ function useAutocomplete(props) {
849
978
  };
850
979
  const handleInputChange = event => {
851
980
  const newValue = event.target.value;
852
- if (inputValue !== newValue) {
981
+ const valueChanged = inputValue !== newValue;
982
+ if (valueChanged) {
853
983
  setInputValueState(newValue);
854
- setInputPristine(false);
984
+ touchScrolledRef.current = false;
855
985
  if (onInputChange) {
856
986
  onInputChange(event, newValue, 'input');
857
987
  }
@@ -865,6 +995,12 @@ function useAutocomplete(props) {
865
995
  } else {
866
996
  handleOpen(event);
867
997
  }
998
+
999
+ // Called after handleOpen so it overrides handleOpen's setInputPristine(true)
1000
+ // when the first keystroke also opens the popup.
1001
+ if (valueChanged) {
1002
+ setInputPristine(false);
1003
+ }
868
1004
  };
869
1005
  const handleOptionMouseMove = event => {
870
1006
  const index = Number(event.currentTarget.getAttribute('data-option-index'));
@@ -874,20 +1010,35 @@ function useAutocomplete(props) {
874
1010
  index,
875
1011
  reason: 'mouse'
876
1012
  });
1013
+ } else {
1014
+ // The option is already highlighted (e.g. programmatically via autoHighlight),
1015
+ // but the user moved the mouse over it — mark as mouse-initiated so
1016
+ // autoSelect on blur correctly treats this as incidental hover.
1017
+ highlightReasonRef.current = 'mouse';
1018
+ }
1019
+ // Don't clear the touch-scroll guard while touch state is still latched.
1020
+ // After a touch gesture, browsers may fire compatibility mousemove
1021
+ // events; if those cleared the guard immediately, later compat events in
1022
+ // the same sequence could be misclassified as a real mouse interaction.
1023
+ // Touch state is cleared by the next deliberate interaction
1024
+ // (keyboard nav, handleOptionClick, or handleOpen).
1025
+ if (!isTouchRef.current) {
1026
+ touchScrolledRef.current = false;
877
1027
  }
878
1028
  };
879
1029
  const handleOptionTouchStart = event => {
1030
+ touchScrolledRef.current = false;
880
1031
  setHighlightedIndex({
881
1032
  event,
882
1033
  index: Number(event.currentTarget.getAttribute('data-option-index')),
883
1034
  reason: 'touch'
884
1035
  });
885
- isTouch.current = true;
1036
+ isTouchRef.current = true;
886
1037
  };
887
1038
  const handleOptionClick = event => {
888
1039
  const index = Number(event.currentTarget.getAttribute('data-option-index'));
889
1040
  selectNewValue(event, filteredOptions[index], 'selectOption');
890
- isTouch.current = false;
1041
+ isTouchRef.current = false;
891
1042
  };
892
1043
  const handleItemDelete = index => event => {
893
1044
  const newValue = value.slice();
@@ -912,7 +1063,11 @@ function useAutocomplete(props) {
912
1063
  // Prevent input blur when interacting with the combobox
913
1064
  const handleMouseDown = event => {
914
1065
  // Prevent focusing the input if click is anywhere outside the Autocomplete
915
- if (!event.currentTarget.contains(event.target)) {
1066
+ if (!contains(event.currentTarget, event.target)) {
1067
+ return;
1068
+ }
1069
+ // Don't interfere with interactions outside the input area (e.g. helper text)
1070
+ if (anchorEl && !contains(anchorEl, event.target)) {
916
1071
  return;
917
1072
  }
918
1073
  if (event.target.getAttribute('id') !== id) {
@@ -923,7 +1078,11 @@ function useAutocomplete(props) {
923
1078
  // Focus the input when interacting with the combobox
924
1079
  const handleClick = event => {
925
1080
  // Prevent focusing the input if click is anywhere outside the Autocomplete
926
- if (!event.currentTarget.contains(event.target)) {
1081
+ if (!contains(event.currentTarget, event.target)) {
1082
+ return;
1083
+ }
1084
+ // Don't interfere with interactions outside the input area (e.g. helper text)
1085
+ if (anchorEl && !contains(anchorEl, event.target)) {
927
1086
  return;
928
1087
  }
929
1088
  inputRef.current.focus();
@@ -1048,13 +1207,18 @@ function useAutocomplete(props) {
1048
1207
  onMouseDown: event => {
1049
1208
  // Prevent blur
1050
1209
  event.preventDefault();
1210
+ },
1211
+ onScroll: () => {
1212
+ if (isTouchRef.current) {
1213
+ touchScrolledRef.current = true;
1214
+ }
1051
1215
  }
1052
1216
  }),
1053
1217
  getOptionProps: ({
1054
1218
  index,
1055
1219
  option
1056
1220
  }) => {
1057
- const selected = (multiple ? value : [value]).some(value2 => value2 != null && isOptionEqualToValue(option, value2));
1221
+ const selected = isOptionSelected(option);
1058
1222
  const disabled = getOptionDisabled ? getOptionDisabled(option) : false;
1059
1223
  return {
1060
1224
  key: getOptionKey?.(option) ?? getOptionLabel(option),
@@ -0,0 +1,2 @@
1
+ import contains from '@mui/utils/contains';
2
+ export default contains;
@@ -0,0 +1,2 @@
1
+ import contains from '@mui/utils/contains';
2
+ export default contains;
@@ -0,0 +1,7 @@
1
+ export declare const FOCUSABLE_ATTRIBUTE = "data-mui-focusable";
2
+ /**
3
+ * Returns the element marked as the initial focus target inside a focus trap.
4
+ * The root element takes precedence over marked descendants so components can
5
+ * opt into focusing their own root surface directly.
6
+ */
7
+ export declare function getFocusTarget(rootElement: HTMLElement | null | undefined): HTMLElement | null;
@@ -0,0 +1,13 @@
1
+ export const FOCUSABLE_ATTRIBUTE = 'data-mui-focusable';
2
+
3
+ /**
4
+ * Returns the element marked as the initial focus target inside a focus trap.
5
+ * The root element takes precedence over marked descendants so components can
6
+ * opt into focusing their own root surface directly.
7
+ */
8
+ export function getFocusTarget(rootElement) {
9
+ if (!rootElement) {
10
+ return null;
11
+ }
12
+ return rootElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? rootElement : rootElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`);
13
+ }
@@ -0,0 +1,2 @@
1
+ import getEventTarget from '@mui/utils/getEventTarget';
2
+ export default getEventTarget;
@@ -0,0 +1,2 @@
1
+ import getEventTarget from '@mui/utils/getEventTarget';
2
+ export default getEventTarget;
@@ -1,6 +1,6 @@
1
- export const version = "7.3.9";
1
+ export const version = "7.3.11";
2
2
  export const major = Number("7");
3
3
  export const minor = Number("3");
4
- export const patch = Number("9");
4
+ export const patch = Number("11");
5
5
  export const prerelease = undefined;
6
6
  export default version;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v7.3.9
2
+ * @mui/material v7.3.11
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "7.3.9",
3
+ "version": "7.3.11",
4
4
  "author": "MUI Team",
5
5
  "description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
6
6
  "keywords": [
@@ -33,10 +33,10 @@
33
33
  "prop-types": "^15.8.1",
34
34
  "react-is": "^19.2.3",
35
35
  "react-transition-group": "^4.4.5",
36
- "@mui/core-downloads-tracker": "^7.3.9",
37
- "@mui/system": "^7.3.9",
36
+ "@mui/core-downloads-tracker": "^7.3.11",
37
+ "@mui/utils": "^7.3.11",
38
38
  "@mui/types": "^7.4.12",
39
- "@mui/utils": "^7.3.9"
39
+ "@mui/system": "^7.3.11"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@emotion/react": "^11.5.0",
@@ -44,7 +44,7 @@
44
44
  "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
45
45
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
46
46
  "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
47
- "@mui/material-pigment-css": "^7.3.9"
47
+ "@mui/material-pigment-css": "^7.3.11"
48
48
  },
49
49
  "peerDependenciesMeta": {
50
50
  "@types/react": {