@mui/material 9.0.0-alpha.3 → 9.0.0-alpha.4

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 (302) hide show
  1. package/Accordion/Accordion.d.mts +0 -14
  2. package/Accordion/Accordion.d.ts +0 -14
  3. package/Accordion/Accordion.js +3 -25
  4. package/Accordion/Accordion.mjs +3 -25
  5. package/AccordionSummary/AccordionSummary.js +1 -1
  6. package/AccordionSummary/AccordionSummary.mjs +1 -1
  7. package/AccordionSummary/accordionSummaryClasses.d.mts +0 -5
  8. package/AccordionSummary/accordionSummaryClasses.d.ts +0 -5
  9. package/AccordionSummary/accordionSummaryClasses.js +1 -1
  10. package/AccordionSummary/accordionSummaryClasses.mjs +1 -1
  11. package/Alert/Alert.d.mts +0 -23
  12. package/Alert/Alert.d.ts +0 -23
  13. package/Alert/Alert.js +4 -36
  14. package/Alert/Alert.mjs +4 -36
  15. package/Alert/alertClasses.d.mts +0 -72
  16. package/Alert/alertClasses.d.ts +0 -72
  17. package/Alert/alertClasses.js +1 -1
  18. package/Alert/alertClasses.mjs +1 -1
  19. package/Autocomplete/Autocomplete.d.mts +10 -60
  20. package/Autocomplete/Autocomplete.d.ts +10 -60
  21. package/Autocomplete/Autocomplete.js +33 -99
  22. package/Autocomplete/Autocomplete.mjs +33 -99
  23. package/Avatar/Avatar.d.mts +0 -8
  24. package/Avatar/Avatar.d.ts +0 -8
  25. package/Avatar/Avatar.js +13 -35
  26. package/Avatar/Avatar.mjs +13 -35
  27. package/AvatarGroup/AvatarGroup.d.mts +0 -15
  28. package/AvatarGroup/AvatarGroup.d.ts +0 -15
  29. package/AvatarGroup/AvatarGroup.js +1 -18
  30. package/AvatarGroup/AvatarGroup.mjs +1 -18
  31. package/Backdrop/Backdrop.d.mts +1 -31
  32. package/Backdrop/Backdrop.d.ts +1 -31
  33. package/Backdrop/Backdrop.js +2 -42
  34. package/Backdrop/Backdrop.mjs +2 -42
  35. package/Badge/Badge.d.mts +0 -20
  36. package/Badge/Badge.d.ts +0 -20
  37. package/Badge/Badge.js +2 -35
  38. package/Badge/Badge.mjs +2 -35
  39. package/Button/Button.js +6 -6
  40. package/Button/Button.mjs +6 -6
  41. package/Button/buttonClasses.d.mts +0 -132
  42. package/Button/buttonClasses.d.ts +0 -132
  43. package/Button/buttonClasses.js +1 -1
  44. package/Button/buttonClasses.mjs +1 -1
  45. package/ButtonBase/ButtonBase.js +16 -2
  46. package/ButtonBase/ButtonBase.mjs +16 -2
  47. package/CHANGELOG.md +154 -0
  48. package/CircularProgress/CircularProgress.js +2 -2
  49. package/CircularProgress/CircularProgress.mjs +2 -2
  50. package/CircularProgress/circularProgressClasses.d.mts +0 -8
  51. package/CircularProgress/circularProgressClasses.d.ts +0 -8
  52. package/CircularProgress/circularProgressClasses.js +1 -1
  53. package/CircularProgress/circularProgressClasses.mjs +1 -1
  54. package/Divider/Divider.d.mts +0 -6
  55. package/Divider/Divider.d.ts +0 -6
  56. package/Divider/Divider.js +2 -18
  57. package/Divider/Divider.mjs +2 -18
  58. package/Divider/dividerClasses.d.mts +0 -4
  59. package/Divider/dividerClasses.d.ts +0 -4
  60. package/Divider/dividerClasses.js +1 -1
  61. package/Divider/dividerClasses.mjs +1 -1
  62. package/FormControlLabel/FormControlLabel.d.mts +1 -14
  63. package/FormControlLabel/FormControlLabel.d.ts +1 -14
  64. package/FormControlLabel/FormControlLabel.js +1 -13
  65. package/FormControlLabel/FormControlLabel.mjs +1 -13
  66. package/Input/Input.js +2 -1
  67. package/Input/Input.mjs +2 -1
  68. package/Menu/Menu.d.mts +0 -13
  69. package/Menu/Menu.d.ts +0 -13
  70. package/Menu/Menu.js +5 -44
  71. package/Menu/Menu.mjs +5 -44
  72. package/MenuItem/MenuItem.js +21 -1
  73. package/MenuItem/MenuItem.mjs +23 -1
  74. package/MenuList/MenuList.js +2 -4
  75. package/MenuList/MenuList.mjs +2 -4
  76. package/MobileStepper/MobileStepper.d.mts +0 -5
  77. package/MobileStepper/MobileStepper.d.ts +0 -5
  78. package/MobileStepper/MobileStepper.js +1 -10
  79. package/MobileStepper/MobileStepper.mjs +1 -10
  80. package/Popover/Popover.d.mts +4 -48
  81. package/Popover/Popover.d.ts +4 -48
  82. package/Popover/Popover.js +4 -64
  83. package/Popover/Popover.mjs +4 -64
  84. package/Popper/Popper.d.mts +0 -17
  85. package/Popper/Popper.d.ts +0 -17
  86. package/Popper/Popper.js +2 -26
  87. package/Popper/Popper.mjs +2 -26
  88. package/Popper/index.d.mts +1 -0
  89. package/Popper/index.d.ts +1 -0
  90. package/Popper/index.js +11 -2
  91. package/Popper/index.mjs +1 -0
  92. package/Select/SelectInput.js +50 -55
  93. package/Select/SelectInput.mjs +47 -52
  94. package/Select/index.d.mts +1 -0
  95. package/Select/index.d.ts +1 -0
  96. package/Select/index.js +12 -0
  97. package/Select/index.mjs +1 -0
  98. package/Select/utils/SelectFocusSourceContext.d.mts +4 -0
  99. package/Select/utils/SelectFocusSourceContext.d.ts +4 -0
  100. package/Select/utils/SelectFocusSourceContext.js +19 -0
  101. package/Select/utils/SelectFocusSourceContext.mjs +13 -0
  102. package/Select/utils/areEqualValues.d.mts +1 -0
  103. package/Select/utils/areEqualValues.d.ts +1 -0
  104. package/Select/utils/areEqualValues.js +14 -0
  105. package/Select/utils/areEqualValues.mjs +8 -0
  106. package/Select/utils/getOpenInteractionType.d.mts +1 -0
  107. package/Select/utils/getOpenInteractionType.d.ts +1 -0
  108. package/Select/utils/getOpenInteractionType.js +18 -0
  109. package/Select/utils/getOpenInteractionType.mjs +12 -0
  110. package/Select/utils/index.d.mts +4 -0
  111. package/Select/utils/index.d.ts +4 -0
  112. package/Select/utils/index.js +40 -0
  113. package/Select/utils/index.mjs +4 -0
  114. package/Select/utils/isEmpty.d.mts +1 -0
  115. package/Select/utils/isEmpty.d.ts +1 -0
  116. package/Select/utils/isEmpty.js +9 -0
  117. package/Select/utils/isEmpty.mjs +3 -0
  118. package/Slider/Slider.d.mts +109 -77
  119. package/Slider/Slider.d.ts +109 -77
  120. package/Slider/Slider.js +42 -119
  121. package/Slider/Slider.mjs +42 -119
  122. package/Slider/sliderClasses.d.mts +7 -7
  123. package/Slider/sliderClasses.d.ts +7 -7
  124. package/Slider/useSlider.js +50 -14
  125. package/Slider/useSlider.mjs +50 -14
  126. package/Snackbar/Snackbar.d.mts +1 -27
  127. package/Snackbar/Snackbar.d.ts +1 -27
  128. package/Snackbar/Snackbar.js +5 -58
  129. package/Snackbar/Snackbar.mjs +5 -58
  130. package/SpeedDial/SpeedDial.d.mts +0 -13
  131. package/SpeedDial/SpeedDial.d.ts +0 -13
  132. package/SpeedDial/SpeedDial.js +15 -40
  133. package/SpeedDial/SpeedDial.mjs +15 -40
  134. package/SpeedDialAction/SpeedDialAction.d.mts +0 -28
  135. package/SpeedDialAction/SpeedDialAction.d.ts +0 -28
  136. package/SpeedDialAction/SpeedDialAction.js +5 -46
  137. package/SpeedDialAction/SpeedDialAction.mjs +5 -46
  138. package/TablePagination/TablePagination.d.mts +1 -1
  139. package/TablePagination/TablePagination.d.ts +1 -1
  140. package/TablePagination/TablePagination.js +4 -2
  141. package/TablePagination/TablePagination.mjs +4 -2
  142. package/Tabs/Tabs.d.mts +2 -33
  143. package/Tabs/Tabs.d.ts +2 -33
  144. package/Tabs/Tabs.js +8 -38
  145. package/Tabs/Tabs.mjs +8 -38
  146. package/TextField/TextField.d.mts +6 -49
  147. package/TextField/TextField.d.ts +6 -49
  148. package/TextField/TextField.js +18 -53
  149. package/TextField/TextField.mjs +18 -53
  150. package/Tooltip/Tooltip.d.mts +1 -55
  151. package/Tooltip/Tooltip.d.ts +1 -55
  152. package/Tooltip/Tooltip.js +9 -87
  153. package/Tooltip/Tooltip.mjs +9 -87
  154. package/Typography/Typography.d.mts +0 -6
  155. package/Typography/Typography.d.ts +0 -6
  156. package/Typography/Typography.js +3 -19
  157. package/Typography/Typography.mjs +3 -19
  158. package/Typography/typographyClasses.d.mts +0 -5
  159. package/Typography/typographyClasses.d.ts +0 -5
  160. package/Typography/typographyClasses.js +1 -1
  161. package/Typography/typographyClasses.mjs +1 -1
  162. package/index.d.mts +0 -2
  163. package/index.d.ts +0 -2
  164. package/index.js +1 -9
  165. package/index.mjs +1 -2
  166. package/locale/amET.js +4 -1
  167. package/locale/amET.mjs +3 -1
  168. package/locale/arEG.js +4 -1
  169. package/locale/arEG.mjs +3 -1
  170. package/locale/arSA.js +4 -1
  171. package/locale/arSA.mjs +3 -1
  172. package/locale/arSD.js +4 -1
  173. package/locale/arSD.mjs +3 -1
  174. package/locale/beBY.js +4 -1
  175. package/locale/beBY.mjs +3 -1
  176. package/locale/bnBD.js +4 -1
  177. package/locale/bnBD.mjs +3 -1
  178. package/locale/caES.js +4 -1
  179. package/locale/caES.mjs +3 -1
  180. package/locale/csCZ.js +4 -1
  181. package/locale/csCZ.mjs +3 -1
  182. package/locale/daDK.js +4 -1
  183. package/locale/daDK.mjs +3 -1
  184. package/locale/deDE.js +4 -1
  185. package/locale/deDE.mjs +3 -1
  186. package/locale/elGR.js +4 -1
  187. package/locale/elGR.mjs +3 -1
  188. package/locale/esES.js +4 -1
  189. package/locale/esES.mjs +3 -1
  190. package/locale/etEE.js +4 -1
  191. package/locale/etEE.mjs +3 -1
  192. package/locale/faIR.js +4 -1
  193. package/locale/faIR.mjs +3 -1
  194. package/locale/fiFI.js +4 -1
  195. package/locale/fiFI.mjs +3 -1
  196. package/locale/frFR.js +4 -1
  197. package/locale/frFR.mjs +3 -1
  198. package/locale/heIL.js +4 -1
  199. package/locale/heIL.mjs +3 -1
  200. package/locale/hiIN.js +4 -1
  201. package/locale/hiIN.mjs +3 -1
  202. package/locale/hrHR.js +5 -1
  203. package/locale/hrHR.mjs +4 -1
  204. package/locale/isIS.js +4 -1
  205. package/locale/isIS.mjs +3 -1
  206. package/locale/itIT.js +4 -1
  207. package/locale/itIT.mjs +3 -1
  208. package/locale/jaJP.js +4 -1
  209. package/locale/jaJP.mjs +3 -1
  210. package/locale/khKH.js +4 -1
  211. package/locale/khKH.mjs +3 -1
  212. package/locale/kkKZ.js +4 -1
  213. package/locale/kkKZ.mjs +3 -1
  214. package/locale/koKR.js +4 -1
  215. package/locale/koKR.mjs +3 -1
  216. package/locale/kuCKB.js +4 -1
  217. package/locale/kuCKB.mjs +3 -1
  218. package/locale/kuLatn.js +4 -1
  219. package/locale/kuLatn.mjs +3 -1
  220. package/locale/mkMK.js +5 -1
  221. package/locale/mkMK.mjs +4 -1
  222. package/locale/msMS.js +5 -1
  223. package/locale/msMS.mjs +4 -1
  224. package/locale/myMY.js +5 -1
  225. package/locale/myMY.mjs +4 -1
  226. package/locale/nbNO.js +4 -1
  227. package/locale/nbNO.mjs +3 -1
  228. package/locale/neNP.js +5 -1
  229. package/locale/neNP.mjs +4 -1
  230. package/locale/nlNL.js +4 -1
  231. package/locale/nlNL.mjs +3 -1
  232. package/locale/nnNO.js +4 -1
  233. package/locale/nnNO.mjs +3 -1
  234. package/locale/plPL.js +4 -1
  235. package/locale/plPL.mjs +3 -1
  236. package/locale/psAF.js +4 -1
  237. package/locale/psAF.mjs +3 -1
  238. package/locale/ptBR.js +4 -1
  239. package/locale/ptBR.mjs +3 -1
  240. package/locale/ptPT.js +4 -1
  241. package/locale/ptPT.mjs +3 -1
  242. package/locale/roRO.js +4 -1
  243. package/locale/roRO.mjs +3 -1
  244. package/locale/ruRU.js +4 -1
  245. package/locale/ruRU.mjs +3 -1
  246. package/locale/siLK.js +4 -1
  247. package/locale/siLK.mjs +3 -1
  248. package/locale/skSK.js +4 -1
  249. package/locale/skSK.mjs +3 -1
  250. package/locale/srRS.js +5 -1
  251. package/locale/srRS.mjs +4 -1
  252. package/locale/svSE.js +4 -1
  253. package/locale/svSE.mjs +3 -1
  254. package/locale/thTH.js +4 -1
  255. package/locale/thTH.mjs +3 -1
  256. package/locale/tlTL.js +5 -1
  257. package/locale/tlTL.mjs +4 -1
  258. package/locale/trTR.js +4 -1
  259. package/locale/trTR.mjs +3 -1
  260. package/locale/ukUA.js +4 -1
  261. package/locale/ukUA.mjs +3 -1
  262. package/locale/urPK.js +4 -1
  263. package/locale/urPK.mjs +3 -1
  264. package/locale/utils/buildFormatNumber.d.mts +2 -0
  265. package/locale/utils/buildFormatNumber.d.ts +2 -0
  266. package/locale/utils/buildFormatNumber.js +23 -0
  267. package/locale/utils/buildFormatNumber.mjs +17 -0
  268. package/locale/viVN.js +4 -1
  269. package/locale/viVN.mjs +3 -1
  270. package/locale/zhCN.js +4 -1
  271. package/locale/zhCN.mjs +3 -1
  272. package/locale/zhHK.js +4 -1
  273. package/locale/zhHK.mjs +3 -1
  274. package/locale/zhTW.js +4 -1
  275. package/locale/zhTW.mjs +3 -1
  276. package/package.json +6 -20
  277. package/styles/components.d.mts +0 -5
  278. package/styles/components.d.ts +0 -5
  279. package/styles/overrides.d.mts +0 -2
  280. package/styles/overrides.d.ts +0 -2
  281. package/styles/props.d.mts +0 -2
  282. package/styles/props.d.ts +0 -2
  283. package/useAutocomplete/useAutocomplete.d.mts +0 -12
  284. package/useAutocomplete/useAutocomplete.d.ts +0 -12
  285. package/useAutocomplete/useAutocomplete.js +29 -28
  286. package/useAutocomplete/useAutocomplete.mjs +29 -28
  287. package/version/index.js +2 -2
  288. package/version/index.mjs +2 -2
  289. package/GridLegacy/GridLegacy.d.mts +0 -160
  290. package/GridLegacy/GridLegacy.d.ts +0 -160
  291. package/GridLegacy/GridLegacy.js +0 -601
  292. package/GridLegacy/GridLegacy.mjs +0 -588
  293. package/GridLegacy/GridLegacyContext.js +0 -17
  294. package/GridLegacy/GridLegacyContext.mjs +0 -12
  295. package/GridLegacy/gridLegacyClasses.d.mts +0 -48
  296. package/GridLegacy/gridLegacyClasses.d.ts +0 -48
  297. package/GridLegacy/gridLegacyClasses.js +0 -27
  298. package/GridLegacy/gridLegacyClasses.mjs +0 -19
  299. package/GridLegacy/index.d.mts +0 -4
  300. package/GridLegacy/index.d.ts +0 -4
  301. package/GridLegacy/index.js +0 -35
  302. package/GridLegacy/index.mjs +0 -3
@@ -15,13 +15,12 @@ const useUtilityClasses = ownerState => {
15
15
  children,
16
16
  classes,
17
17
  flexItem,
18
- light,
19
18
  orientation,
20
19
  textAlign,
21
20
  variant
22
21
  } = ownerState;
23
22
  const slots = {
24
- root: ['root', absolute && 'absolute', variant, light && 'light', orientation === 'vertical' && 'vertical', flexItem && 'flexItem', children && 'withChildren', children && orientation === 'vertical' && 'withChildrenVertical', textAlign === 'right' && orientation !== 'vertical' && 'textAlignRight', textAlign === 'left' && orientation !== 'vertical' && 'textAlignLeft'],
23
+ root: ['root', absolute && 'absolute', variant, orientation === 'vertical' && 'vertical', flexItem && 'flexItem', children && 'withChildren', children && orientation === 'vertical' && 'withChildrenVertical', textAlign === 'right' && orientation !== 'vertical' && 'textAlignRight', textAlign === 'left' && orientation !== 'vertical' && 'textAlignLeft'],
25
24
  wrapper: ['wrapper', orientation === 'vertical' && 'wrapperVertical']
26
25
  };
27
26
  return composeClasses(slots, getDividerUtilityClass, classes);
@@ -33,7 +32,7 @@ const DividerRoot = styled('div', {
33
32
  const {
34
33
  ownerState
35
34
  } = props;
36
- return [styles.root, ownerState.absolute && styles.absolute, styles[ownerState.variant], ownerState.light && styles.light, ownerState.orientation === 'vertical' && styles.vertical, ownerState.flexItem && styles.flexItem, ownerState.children && styles.withChildren, ownerState.children && ownerState.orientation === 'vertical' && styles.withChildrenVertical, ownerState.textAlign === 'right' && ownerState.orientation !== 'vertical' && styles.textAlignRight, ownerState.textAlign === 'left' && ownerState.orientation !== 'vertical' && styles.textAlignLeft];
35
+ return [styles.root, ownerState.absolute && styles.absolute, styles[ownerState.variant], ownerState.orientation === 'vertical' && styles.vertical, ownerState.flexItem && styles.flexItem, ownerState.children && styles.withChildren, ownerState.children && ownerState.orientation === 'vertical' && styles.withChildrenVertical, ownerState.textAlign === 'right' && ownerState.orientation !== 'vertical' && styles.textAlignRight, ownerState.textAlign === 'left' && ownerState.orientation !== 'vertical' && styles.textAlignLeft];
37
36
  }
38
37
  })(memoTheme(({
39
38
  theme
@@ -55,13 +54,6 @@ const DividerRoot = styled('div', {
55
54
  left: 0,
56
55
  width: '100%'
57
56
  }
58
- }, {
59
- props: {
60
- light: true
61
- },
62
- style: {
63
- borderColor: theme.alpha((theme.vars || theme).palette.divider, 0.08)
64
- }
65
57
  }, {
66
58
  props: {
67
59
  variant: 'inset'
@@ -206,7 +198,6 @@ const Divider = /*#__PURE__*/React.forwardRef(function Divider(inProps, ref) {
206
198
  orientation = 'horizontal',
207
199
  component = children || orientation === 'vertical' ? 'div' : 'hr',
208
200
  flexItem = false,
209
- light = false,
210
201
  role = component !== 'hr' ? 'separator' : undefined,
211
202
  textAlign = 'center',
212
203
  variant = 'fullWidth',
@@ -217,7 +208,6 @@ const Divider = /*#__PURE__*/React.forwardRef(function Divider(inProps, ref) {
217
208
  absolute,
218
209
  component,
219
210
  flexItem,
220
- light,
221
211
  orientation,
222
212
  role,
223
213
  textAlign,
@@ -280,12 +270,6 @@ process.env.NODE_ENV !== "production" ? Divider.propTypes /* remove-proptypes */
280
270
  * @default false
281
271
  */
282
272
  flexItem: PropTypes.bool,
283
- /**
284
- * If `true`, the divider will have a lighter color.
285
- * @default false
286
- * @deprecated Use <Divider sx={{ opacity: 0.6 }} /> (or any opacity or color) instead. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
287
- */
288
- light: PropTypes.bool,
289
273
  /**
290
274
  * The component orientation.
291
275
  * @default 'horizontal'
@@ -7,10 +7,6 @@ export interface DividerClasses {
7
7
  inset: string;
8
8
  /** Styles applied to the root element if `variant="fullWidth"`. */
9
9
  fullWidth: string;
10
- /** Styles applied to the root element if `light={true}`.
11
- * @deprecated
12
- */
13
- light: string;
14
10
  /** Styles applied to the root element if `variant="middle"`. */
15
11
  middle: string;
16
12
  /** Styles applied to the root element if `orientation="vertical"`. */
@@ -7,10 +7,6 @@ export interface DividerClasses {
7
7
  inset: string;
8
8
  /** Styles applied to the root element if `variant="fullWidth"`. */
9
9
  fullWidth: string;
10
- /** Styles applied to the root element if `light={true}`.
11
- * @deprecated
12
- */
13
- light: string;
14
10
  /** Styles applied to the root element if `variant="middle"`. */
15
11
  middle: string;
16
12
  /** Styles applied to the root element if `orientation="vertical"`. */
@@ -11,5 +11,5 @@ var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateU
11
11
  function getDividerUtilityClass(slot) {
12
12
  return (0, _generateUtilityClass.default)('MuiDivider', slot);
13
13
  }
14
- const dividerClasses = (0, _generateUtilityClasses.default)('MuiDivider', ['root', 'absolute', 'fullWidth', 'inset', 'middle', 'flexItem', 'light', 'vertical', 'withChildren', 'withChildrenVertical', 'textAlignRight', 'textAlignLeft', 'wrapper', 'wrapperVertical']);
14
+ const dividerClasses = (0, _generateUtilityClasses.default)('MuiDivider', ['root', 'absolute', 'fullWidth', 'inset', 'middle', 'flexItem', 'vertical', 'withChildren', 'withChildrenVertical', 'textAlignRight', 'textAlignLeft', 'wrapper', 'wrapperVertical']);
15
15
  var _default = exports.default = dividerClasses;
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
3
3
  export function getDividerUtilityClass(slot) {
4
4
  return generateUtilityClass('MuiDivider', slot);
5
5
  }
6
- const dividerClasses = generateUtilityClasses('MuiDivider', ['root', 'absolute', 'fullWidth', 'inset', 'middle', 'flexItem', 'light', 'vertical', 'withChildren', 'withChildrenVertical', 'textAlignRight', 'textAlignLeft', 'wrapper', 'wrapperVertical']);
6
+ const dividerClasses = generateUtilityClasses('MuiDivider', ['root', 'absolute', 'fullWidth', 'inset', 'middle', 'flexItem', 'vertical', 'withChildren', 'withChildrenVertical', 'textAlignRight', 'textAlignLeft', 'wrapper', 'wrapperVertical']);
7
7
  export default dividerClasses;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { SxProps } from '@mui/system';
3
3
  import { Theme } from "../styles/index.mjs";
4
4
  import { InternalStandardProps as StandardProps } from "../internal/index.mjs";
5
- import Typography, { TypographyProps } from "../Typography/index.mjs";
5
+ import Typography from "../Typography/index.mjs";
6
6
  import { FormControlLabelClasses } from "./formControlLabelClasses.mjs";
7
7
  import { CreateSlotsAndSlotProps, SlotProps } from "../utils/types.mjs";
8
8
  export interface FormControlLabelSlots {
@@ -25,19 +25,6 @@ export interface FormControlLabelProps extends StandardProps<React.LabelHTMLAttr
25
25
  * Override or extend the styles applied to the component.
26
26
  */
27
27
  classes?: Partial<FormControlLabelClasses> | undefined;
28
- /**
29
- * The props used for each slot inside.
30
- * @default {}
31
- * @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.
32
- */
33
- componentsProps?: {
34
- /**
35
- * Props applied to the Typography wrapper of the passed label.
36
- * This is unused if disableTypography is true.
37
- * @default {}
38
- */
39
- typography?: TypographyProps | undefined;
40
- } | undefined;
41
28
  /**
42
29
  * A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`.
43
30
  */
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { SxProps } from '@mui/system';
3
3
  import { Theme } from "../styles/index.js";
4
4
  import { InternalStandardProps as StandardProps } from "../internal/index.js";
5
- import Typography, { TypographyProps } from "../Typography/index.js";
5
+ import Typography from "../Typography/index.js";
6
6
  import { FormControlLabelClasses } from "./formControlLabelClasses.js";
7
7
  import { CreateSlotsAndSlotProps, SlotProps } from "../utils/types.js";
8
8
  export interface FormControlLabelSlots {
@@ -25,19 +25,6 @@ export interface FormControlLabelProps extends StandardProps<React.LabelHTMLAttr
25
25
  * Override or extend the styles applied to the component.
26
26
  */
27
27
  classes?: Partial<FormControlLabelClasses> | undefined;
28
- /**
29
- * The props used for each slot inside.
30
- * @default {}
31
- * @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.
32
- */
33
- componentsProps?: {
34
- /**
35
- * Props applied to the Typography wrapper of the passed label.
36
- * This is unused if disableTypography is true.
37
- * @default {}
38
- */
39
- typography?: TypographyProps | undefined;
40
- } | undefined;
41
28
  /**
42
29
  * A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`.
43
30
  */
@@ -122,7 +122,6 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
122
122
  const {
123
123
  checked,
124
124
  className,
125
- componentsProps = {},
126
125
  control,
127
126
  disabled: disabledProp,
128
127
  disableTypography,
@@ -164,10 +163,7 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
164
163
  const classes = useUtilityClasses(ownerState);
165
164
  const externalForwardedProps = {
166
165
  slots,
167
- slotProps: {
168
- ...componentsProps,
169
- ...slotProps
170
- }
166
+ slotProps
171
167
  };
172
168
  const [TypographySlot, typographySlotProps] = (0, _useSlot.default)('typography', {
173
169
  elementType: _Typography.default,
@@ -215,14 +211,6 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-pro
215
211
  * @ignore
216
212
  */
217
213
  className: _propTypes.default.string,
218
- /**
219
- * The props used for each slot inside.
220
- * @default {}
221
- * @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.
222
- */
223
- componentsProps: _propTypes.default.shape({
224
- typography: _propTypes.default.object
225
- }),
226
214
  /**
227
215
  * A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`.
228
216
  */
@@ -115,7 +115,6 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
115
115
  const {
116
116
  checked,
117
117
  className,
118
- componentsProps = {},
119
118
  control,
120
119
  disabled: disabledProp,
121
120
  disableTypography,
@@ -157,10 +156,7 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
157
156
  const classes = useUtilityClasses(ownerState);
158
157
  const externalForwardedProps = {
159
158
  slots,
160
- slotProps: {
161
- ...componentsProps,
162
- ...slotProps
163
- }
159
+ slotProps
164
160
  };
165
161
  const [TypographySlot, typographySlotProps] = useSlot('typography', {
166
162
  elementType: Typography,
@@ -208,14 +204,6 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-pro
208
204
  * @ignore
209
205
  */
210
206
  className: PropTypes.string,
211
- /**
212
- * The props used for each slot inside.
213
- * @default {}
214
- * @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.
215
- */
216
- componentsProps: PropTypes.shape({
217
- typography: PropTypes.object
218
- }),
219
207
  /**
220
208
  * A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`.
221
209
  */
package/Input/Input.js CHANGED
@@ -18,6 +18,7 @@ var _zeroStyled = require("../zero-styled");
18
18
  var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
19
19
  var _createSimplePaletteValueFilter = _interopRequireDefault(require("../utils/createSimplePaletteValueFilter"));
20
20
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
21
+ var _inputLabelClasses = _interopRequireDefault(require("../InputLabel/inputLabelClasses"));
21
22
  var _inputClasses = _interopRequireWildcard(require("./inputClasses"));
22
23
  var _InputBase2 = require("../InputBase/InputBase");
23
24
  var _jsxRuntime = require("react/jsx-runtime");
@@ -62,7 +63,7 @@ const InputRoot = (0, _zeroStyled.styled)(_InputBase2.InputBaseRoot, {
62
63
  ownerState
63
64
  }) => ownerState.formControl,
64
65
  style: {
65
- 'label + &': {
66
+ [`label + &, .${_inputLabelClasses.default.root} + &`]: {
66
67
  marginTop: 16
67
68
  }
68
69
  }
package/Input/Input.mjs CHANGED
@@ -11,6 +11,7 @@ import { styled } from "../zero-styled/index.mjs";
11
11
  import memoTheme from "../utils/memoTheme.mjs";
12
12
  import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.mjs";
13
13
  import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
14
+ import inputLabelClasses from "../InputLabel/inputLabelClasses.mjs";
14
15
  import inputClasses, { getInputUtilityClass } from "./inputClasses.mjs";
15
16
  import { rootOverridesResolver as inputBaseRootOverridesResolver, inputOverridesResolver as inputBaseInputOverridesResolver, InputBaseRoot, InputBaseInput } from "../InputBase/InputBase.mjs";
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -55,7 +56,7 @@ const InputRoot = styled(InputBaseRoot, {
55
56
  ownerState
56
57
  }) => ownerState.formControl,
57
58
  style: {
58
- 'label + &': {
59
+ [`label + &, .${inputLabelClasses.root} + &`]: {
59
60
  marginTop: 16
60
61
  }
61
62
  }
package/Menu/Menu.d.mts CHANGED
@@ -101,12 +101,6 @@ export interface MenuProps extends StandardProps<Omit<PopoverProps, 'slots' | 's
101
101
  * @default false
102
102
  */
103
103
  disableAutoFocusItem?: boolean | undefined;
104
- /**
105
- * Props applied to the [`MenuList`](https://mui.com/material-ui/api/menu-list/) element.
106
- * @deprecated use the `slotProps.list` 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.
107
- * @default {}
108
- */
109
- MenuListProps?: Partial<MenuListProps> | undefined;
110
104
  /**
111
105
  * Callback fired when the component requests to be closed.
112
106
  *
@@ -131,13 +125,6 @@ export interface MenuProps extends StandardProps<Omit<PopoverProps, 'slots' | 's
131
125
  * @default 'auto'
132
126
  */
133
127
  transitionDuration?: TransitionProps['timeout'] | 'auto' | undefined;
134
- /**
135
- * Props applied to the transition element.
136
- * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
137
- * @deprecated use the `slotProps.transition` 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.
138
- * @default {}
139
- */
140
- TransitionProps?: TransitionProps | undefined;
141
128
  /**
142
129
  * The variant to use. Use `menu` to prevent selected items from impacting the initial focus.
143
130
  * @default 'selectedMenu'
package/Menu/Menu.d.ts CHANGED
@@ -101,12 +101,6 @@ export interface MenuProps extends StandardProps<Omit<PopoverProps, 'slots' | 's
101
101
  * @default false
102
102
  */
103
103
  disableAutoFocusItem?: boolean | undefined;
104
- /**
105
- * Props applied to the [`MenuList`](https://mui.com/material-ui/api/menu-list/) element.
106
- * @deprecated use the `slotProps.list` 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.
107
- * @default {}
108
- */
109
- MenuListProps?: Partial<MenuListProps> | undefined;
110
104
  /**
111
105
  * Callback fired when the component requests to be closed.
112
106
  *
@@ -131,13 +125,6 @@ export interface MenuProps extends StandardProps<Omit<PopoverProps, 'slots' | 's
131
125
  * @default 'auto'
132
126
  */
133
127
  transitionDuration?: TransitionProps['timeout'] | 'auto' | undefined;
134
- /**
135
- * Props applied to the transition element.
136
- * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
137
- * @deprecated use the `slotProps.transition` 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.
138
- * @default {}
139
- */
140
- TransitionProps?: TransitionProps | undefined;
141
128
  /**
142
129
  * The variant to use. Use `menu` to prevent selected items from impacting the initial focus.
143
130
  * @default 'selectedMenu'
package/Menu/Menu.js CHANGED
@@ -10,7 +10,6 @@ exports.default = exports.MenuPaper = void 0;
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _reactIs = require("react-is");
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
- var _clsx = _interopRequireDefault(require("clsx"));
14
13
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
15
14
  var _HTMLElementType = _interopRequireDefault(require("@mui/utils/HTMLElementType"));
16
15
  var _RtlProvider = require("@mui/system/RtlProvider");
@@ -75,16 +74,10 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
75
74
  children,
76
75
  className,
77
76
  disableAutoFocusItem = false,
78
- MenuListProps = {},
79
77
  onClose,
80
78
  open,
81
- PaperProps = {},
82
79
  PopoverClasses,
83
80
  transitionDuration = 'auto',
84
- TransitionProps: {
85
- onEntering,
86
- ...TransitionProps
87
- } = {},
88
81
  variant = 'selectedMenu',
89
82
  slots = {},
90
83
  slotProps = {},
@@ -95,25 +88,18 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
95
88
  ...props,
96
89
  autoFocus,
97
90
  disableAutoFocusItem,
98
- MenuListProps,
99
- onEntering,
100
- PaperProps,
101
91
  transitionDuration,
102
- TransitionProps,
103
92
  variant
104
93
  };
105
94
  const classes = useUtilityClasses(ownerState);
106
95
  const autoFocusItem = autoFocus && !disableAutoFocusItem && open;
107
96
  const menuListActionsRef = React.useRef(null);
108
- const handleEntering = (element, isAppearing) => {
97
+ const handleEntering = (element, _isAppearing) => {
109
98
  if (menuListActionsRef.current) {
110
99
  menuListActionsRef.current.adjustStyleForScrollbar(element, {
111
100
  direction: isRtl ? 'rtl' : 'ltr'
112
101
  });
113
102
  }
114
- if (onEntering) {
115
- onEntering(element, isAppearing);
116
- }
117
103
  };
118
104
  const handleListKeyDown = event => {
119
105
  if (event.key === 'Tab') {
@@ -152,12 +138,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
152
138
  });
153
139
  const externalForwardedProps = {
154
140
  slots,
155
- slotProps: {
156
- list: MenuListProps,
157
- transition: TransitionProps,
158
- paper: PaperProps,
159
- ...slotProps
160
- }
141
+ slotProps
161
142
  };
162
143
  const rootSlotProps = (0, _useSlotProps.default)({
163
144
  elementType: slots.root,
@@ -173,7 +154,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
173
154
  ownerState
174
155
  });
175
156
  const [ListSlot, listSlotProps] = (0, _useSlot.default)('list', {
176
- className: (0, _clsx.default)(classes.list, MenuListProps.className),
157
+ className: classes.list,
177
158
  elementType: MenuMenuList,
178
159
  shouldForwardComponentProp: true,
179
160
  externalForwardedProps,
@@ -186,7 +167,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
186
167
  }),
187
168
  ownerState
188
169
  });
189
- const resolvedTransitionProps = typeof externalForwardedProps.slotProps.transition === 'function' ? externalForwardedProps.slotProps.transition(ownerState) : externalForwardedProps.slotProps.transition;
170
+ const resolvedTransitionProps = typeof slotProps.transition === 'function' ? slotProps.transition(ownerState) : slotProps.transition;
190
171
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(MenuRoot, {
191
172
  onClose: onClose,
192
173
  anchorOrigin: {
@@ -198,10 +179,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
198
179
  root: slots.root,
199
180
  paper: PaperSlot,
200
181
  backdrop: slots.backdrop,
201
- ...(slots.transition && {
202
- // TODO: pass `slots.transition` directly once `TransitionComponent` is removed from Popover
203
- transition: slots.transition
204
- })
182
+ transition: slots.transition
205
183
  },
206
184
  slotProps: {
207
185
  root: rootSlotProps,
@@ -269,12 +247,6 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
269
247
  * @default false
270
248
  */
271
249
  disableAutoFocusItem: _propTypes.default.bool,
272
- /**
273
- * Props applied to the [`MenuList`](https://mui.com/material-ui/api/menu-list/) element.
274
- * @deprecated use the `slotProps.list` 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.
275
- * @default {}
276
- */
277
- MenuListProps: _propTypes.default.object,
278
250
  /**
279
251
  * Callback fired when the component requests to be closed.
280
252
  *
@@ -286,10 +258,6 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
286
258
  * If `true`, the component is shown.
287
259
  */
288
260
  open: _propTypes.default.bool.isRequired,
289
- /**
290
- * @ignore
291
- */
292
- PaperProps: _propTypes.default.object,
293
261
  /**
294
262
  * `classes` prop applied to the [`Popover`](https://mui.com/material-ui/api/popover/) element.
295
263
  */
@@ -329,13 +297,6 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
329
297
  enter: _propTypes.default.number,
330
298
  exit: _propTypes.default.number
331
299
  })]),
332
- /**
333
- * Props applied to the transition element.
334
- * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
335
- * @deprecated use the `slotProps.transition` 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.
336
- * @default {}
337
- */
338
- TransitionProps: _propTypes.default.object,
339
300
  /**
340
301
  * The variant to use. Use `menu` to prevent selected items from impacting the initial focus.
341
302
  * @default 'selectedMenu'
package/Menu/Menu.mjs CHANGED
@@ -3,7 +3,6 @@
3
3
  import * as React from 'react';
4
4
  import { isFragment } from 'react-is';
5
5
  import PropTypes from 'prop-types';
6
- import clsx from 'clsx';
7
6
  import composeClasses from '@mui/utils/composeClasses';
8
7
  import HTMLElementType from '@mui/utils/HTMLElementType';
9
8
  import { useRtl } from '@mui/system/RtlProvider';
@@ -68,16 +67,10 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
68
67
  children,
69
68
  className,
70
69
  disableAutoFocusItem = false,
71
- MenuListProps = {},
72
70
  onClose,
73
71
  open,
74
- PaperProps = {},
75
72
  PopoverClasses,
76
73
  transitionDuration = 'auto',
77
- TransitionProps: {
78
- onEntering,
79
- ...TransitionProps
80
- } = {},
81
74
  variant = 'selectedMenu',
82
75
  slots = {},
83
76
  slotProps = {},
@@ -88,25 +81,18 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
88
81
  ...props,
89
82
  autoFocus,
90
83
  disableAutoFocusItem,
91
- MenuListProps,
92
- onEntering,
93
- PaperProps,
94
84
  transitionDuration,
95
- TransitionProps,
96
85
  variant
97
86
  };
98
87
  const classes = useUtilityClasses(ownerState);
99
88
  const autoFocusItem = autoFocus && !disableAutoFocusItem && open;
100
89
  const menuListActionsRef = React.useRef(null);
101
- const handleEntering = (element, isAppearing) => {
90
+ const handleEntering = (element, _isAppearing) => {
102
91
  if (menuListActionsRef.current) {
103
92
  menuListActionsRef.current.adjustStyleForScrollbar(element, {
104
93
  direction: isRtl ? 'rtl' : 'ltr'
105
94
  });
106
95
  }
107
- if (onEntering) {
108
- onEntering(element, isAppearing);
109
- }
110
96
  };
111
97
  const handleListKeyDown = event => {
112
98
  if (event.key === 'Tab') {
@@ -145,12 +131,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
145
131
  });
146
132
  const externalForwardedProps = {
147
133
  slots,
148
- slotProps: {
149
- list: MenuListProps,
150
- transition: TransitionProps,
151
- paper: PaperProps,
152
- ...slotProps
153
- }
134
+ slotProps
154
135
  };
155
136
  const rootSlotProps = useSlotProps({
156
137
  elementType: slots.root,
@@ -166,7 +147,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
166
147
  ownerState
167
148
  });
168
149
  const [ListSlot, listSlotProps] = useSlot('list', {
169
- className: clsx(classes.list, MenuListProps.className),
150
+ className: classes.list,
170
151
  elementType: MenuMenuList,
171
152
  shouldForwardComponentProp: true,
172
153
  externalForwardedProps,
@@ -179,7 +160,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
179
160
  }),
180
161
  ownerState
181
162
  });
182
- const resolvedTransitionProps = typeof externalForwardedProps.slotProps.transition === 'function' ? externalForwardedProps.slotProps.transition(ownerState) : externalForwardedProps.slotProps.transition;
163
+ const resolvedTransitionProps = typeof slotProps.transition === 'function' ? slotProps.transition(ownerState) : slotProps.transition;
183
164
  return /*#__PURE__*/_jsx(MenuRoot, {
184
165
  onClose: onClose,
185
166
  anchorOrigin: {
@@ -191,10 +172,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
191
172
  root: slots.root,
192
173
  paper: PaperSlot,
193
174
  backdrop: slots.backdrop,
194
- ...(slots.transition && {
195
- // TODO: pass `slots.transition` directly once `TransitionComponent` is removed from Popover
196
- transition: slots.transition
197
- })
175
+ transition: slots.transition
198
176
  },
199
177
  slotProps: {
200
178
  root: rootSlotProps,
@@ -262,12 +240,6 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
262
240
  * @default false
263
241
  */
264
242
  disableAutoFocusItem: PropTypes.bool,
265
- /**
266
- * Props applied to the [`MenuList`](https://mui.com/material-ui/api/menu-list/) element.
267
- * @deprecated use the `slotProps.list` 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.
268
- * @default {}
269
- */
270
- MenuListProps: PropTypes.object,
271
243
  /**
272
244
  * Callback fired when the component requests to be closed.
273
245
  *
@@ -279,10 +251,6 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
279
251
  * If `true`, the component is shown.
280
252
  */
281
253
  open: PropTypes.bool.isRequired,
282
- /**
283
- * @ignore
284
- */
285
- PaperProps: PropTypes.object,
286
254
  /**
287
255
  * `classes` prop applied to the [`Popover`](https://mui.com/material-ui/api/popover/) element.
288
256
  */
@@ -322,13 +290,6 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
322
290
  enter: PropTypes.number,
323
291
  exit: PropTypes.number
324
292
  })]),
325
- /**
326
- * Props applied to the transition element.
327
- * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
328
- * @deprecated use the `slotProps.transition` 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.
329
- * @default {}
330
- */
331
- TransitionProps: PropTypes.object,
332
293
  /**
333
294
  * The variant to use. Use `menu` to prevent selected items from impacting the initial focus.
334
295
  * @default 'selectedMenu'
@@ -23,7 +23,25 @@ var _Divider = require("../Divider");
23
23
  var _ListItemIcon = require("../ListItemIcon");
24
24
  var _ListItemText = require("../ListItemText");
25
25
  var _menuItemClasses = _interopRequireWildcard(require("./menuItemClasses"));
26
+ var _Select = require("../Select");
26
27
  var _jsxRuntime = require("react/jsx-runtime");
28
+ /**
29
+ * If autoFocus is an object, it will attempt to call `element.focus()` with the options argument.
30
+ * If the browser doesn't support the options argument, it will fall back to a simple `element.focus()` call.
31
+ */function focusWithVisible(element, focusSource) {
32
+ if (focusSource == null) {
33
+ element.focus();
34
+ return;
35
+ }
36
+ try {
37
+ element.focus({
38
+ focusVisible: focusSource === 'keyboard'
39
+ });
40
+ } catch (error) {
41
+ // If the browser doesn't support the focus options argument, fall back to a simple focus call.
42
+ element.focus();
43
+ }
44
+ }
27
45
  const overridesResolver = (props, styles) => {
28
46
  const {
29
47
  ownerState
@@ -170,6 +188,7 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
170
188
  className,
171
189
  ...other
172
190
  } = props;
191
+ const focusSource = (0, _Select.useSelectFocusSource)();
173
192
  const context = React.useContext(_ListContext.default);
174
193
  const childContext = React.useMemo(() => ({
175
194
  dense: dense || context.dense || false,
@@ -179,11 +198,12 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
179
198
  (0, _useEnhancedEffect.default)(() => {
180
199
  if (autoFocus) {
181
200
  if (menuItemRef.current) {
182
- menuItemRef.current.focus();
201
+ focusWithVisible(menuItemRef.current, focusSource);
183
202
  } else if (process.env.NODE_ENV !== 'production') {
184
203
  console.error('MUI: Unable to set focus to a MenuItem whose component has not been rendered.');
185
204
  }
186
205
  }
206
+ // eslint-disable-next-line react-hooks/exhaustive-deps
187
207
  }, [autoFocus]);
188
208
  const ownerState = {
189
209
  ...props,