@mui/material 5.15.12 → 5.15.14

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 (121) hide show
  1. package/Accordion/Accordion.js +30 -23
  2. package/AccordionActions/AccordionActions.js +14 -12
  3. package/AccordionDetails/AccordionDetails.js +2 -2
  4. package/AccordionSummary/AccordionSummary.js +29 -23
  5. package/Alert/Alert.d.ts +2 -2
  6. package/Autocomplete/Autocomplete.d.ts +1 -1
  7. package/Autocomplete/Autocomplete.js +117 -82
  8. package/Autocomplete/autocompleteClasses.d.ts +3 -3
  9. package/CHANGELOG.md +203 -51
  10. package/CircularProgress/CircularProgress.d.ts +1 -1
  11. package/CircularProgress/CircularProgress.js +1 -1
  12. package/Drawer/Drawer.js +9 -3
  13. package/Icon/Icon.d.ts +1 -1
  14. package/Icon/Icon.js +1 -1
  15. package/LinearProgress/LinearProgress.js +4 -4
  16. package/Menu/Menu.js +5 -4
  17. package/MenuList/MenuList.js +4 -2
  18. package/OverridableComponent.d.ts +1 -1
  19. package/PaginationItem/PaginationItem.js +3 -3
  20. package/Popper/Popper.d.ts +3 -26
  21. package/README.md +2 -2
  22. package/Rating/Rating.js +3 -3
  23. package/Select/Select.d.ts +8 -20
  24. package/Slider/Slider.js +406 -226
  25. package/SvgIcon/SvgIcon.js +1 -1
  26. package/Switch/Switch.js +61 -41
  27. package/TabScrollButton/TabScrollButton.js +2 -3
  28. package/TablePagination/TablePaginationActions.js +14 -14
  29. package/Tabs/Tabs.js +3 -2
  30. package/Tooltip/Tooltip.js +5 -4
  31. package/index.js +1 -1
  32. package/legacy/Accordion/Accordion.js +33 -22
  33. package/legacy/AccordionActions/AccordionActions.js +17 -14
  34. package/legacy/AccordionDetails/AccordionDetails.js +2 -2
  35. package/legacy/AccordionSummary/AccordionSummary.js +31 -22
  36. package/legacy/Autocomplete/Autocomplete.js +194 -164
  37. package/legacy/CircularProgress/CircularProgress.js +1 -1
  38. package/legacy/Drawer/Drawer.js +8 -3
  39. package/legacy/Icon/Icon.js +1 -1
  40. package/legacy/LinearProgress/LinearProgress.js +4 -4
  41. package/legacy/Menu/Menu.js +5 -4
  42. package/legacy/MenuList/MenuList.js +3 -2
  43. package/legacy/PaginationItem/PaginationItem.js +3 -3
  44. package/legacy/Rating/Rating.js +3 -3
  45. package/legacy/Slider/Slider.js +375 -194
  46. package/legacy/SvgIcon/SvgIcon.js +1 -1
  47. package/legacy/Switch/Switch.js +88 -59
  48. package/legacy/TabScrollButton/TabScrollButton.js +2 -3
  49. package/legacy/TablePagination/TablePaginationActions.js +14 -14
  50. package/legacy/Tabs/Tabs.js +3 -2
  51. package/legacy/Tooltip/Tooltip.js +7 -3
  52. package/legacy/index.js +1 -1
  53. package/legacy/styles/experimental_extendTheme.js +4 -1
  54. package/legacy/styles/rootShouldForwardProp.js +5 -0
  55. package/legacy/styles/slotShouldForwardProp.js +5 -0
  56. package/legacy/styles/styled.js +4 -5
  57. package/legacy/usePagination/usePagination.js +1 -1
  58. package/modern/Accordion/Accordion.js +30 -23
  59. package/modern/AccordionActions/AccordionActions.js +14 -12
  60. package/modern/AccordionDetails/AccordionDetails.js +2 -2
  61. package/modern/AccordionSummary/AccordionSummary.js +29 -23
  62. package/modern/Autocomplete/Autocomplete.js +117 -82
  63. package/modern/CircularProgress/CircularProgress.js +1 -1
  64. package/modern/Drawer/Drawer.js +9 -3
  65. package/modern/Icon/Icon.js +1 -1
  66. package/modern/LinearProgress/LinearProgress.js +4 -4
  67. package/modern/Menu/Menu.js +5 -4
  68. package/modern/MenuList/MenuList.js +4 -2
  69. package/modern/PaginationItem/PaginationItem.js +3 -3
  70. package/modern/Rating/Rating.js +3 -3
  71. package/modern/Slider/Slider.js +339 -175
  72. package/modern/SvgIcon/SvgIcon.js +1 -1
  73. package/modern/Switch/Switch.js +61 -41
  74. package/modern/TabScrollButton/TabScrollButton.js +2 -3
  75. package/modern/TablePagination/TablePaginationActions.js +14 -14
  76. package/modern/Tabs/Tabs.js +3 -2
  77. package/modern/Tooltip/Tooltip.js +5 -4
  78. package/modern/index.js +1 -1
  79. package/modern/styles/experimental_extendTheme.js +4 -1
  80. package/modern/styles/rootShouldForwardProp.js +3 -0
  81. package/modern/styles/slotShouldForwardProp.js +5 -0
  82. package/modern/styles/styled.js +4 -3
  83. package/modern/usePagination/usePagination.js +1 -1
  84. package/node/Accordion/Accordion.js +32 -25
  85. package/node/AccordionActions/AccordionActions.js +16 -14
  86. package/node/AccordionDetails/AccordionDetails.js +4 -4
  87. package/node/AccordionSummary/AccordionSummary.js +33 -27
  88. package/node/Autocomplete/Autocomplete.js +129 -94
  89. package/node/CircularProgress/CircularProgress.js +1 -1
  90. package/node/Drawer/Drawer.js +9 -3
  91. package/node/Icon/Icon.js +1 -1
  92. package/node/LinearProgress/LinearProgress.js +4 -4
  93. package/node/Menu/Menu.js +5 -4
  94. package/node/MenuList/MenuList.js +4 -2
  95. package/node/PaginationItem/PaginationItem.js +3 -3
  96. package/node/Rating/Rating.js +3 -3
  97. package/node/Slider/Slider.js +416 -236
  98. package/node/SvgIcon/SvgIcon.js +1 -1
  99. package/node/Switch/Switch.js +66 -46
  100. package/node/TabScrollButton/TabScrollButton.js +2 -3
  101. package/node/TablePagination/TablePaginationActions.js +14 -14
  102. package/node/Tabs/Tabs.js +3 -2
  103. package/node/Tooltip/Tooltip.js +5 -4
  104. package/node/index.js +1 -1
  105. package/node/styles/experimental_extendTheme.js +4 -1
  106. package/node/styles/rootShouldForwardProp.js +10 -0
  107. package/node/styles/slotShouldForwardProp.js +11 -0
  108. package/node/styles/styled.js +17 -8
  109. package/node/usePagination/usePagination.js +1 -1
  110. package/package.json +6 -6
  111. package/styles/experimental_extendTheme.d.ts +1 -0
  112. package/styles/experimental_extendTheme.js +4 -1
  113. package/styles/rootShouldForwardProp.d.ts +2 -0
  114. package/styles/rootShouldForwardProp.js +3 -0
  115. package/styles/slotShouldForwardProp.d.ts +2 -0
  116. package/styles/slotShouldForwardProp.js +5 -0
  117. package/styles/styled.d.ts +2 -3
  118. package/styles/styled.js +4 -3
  119. package/umd/material-ui.development.js +1048 -738
  120. package/umd/material-ui.production.min.js +2 -2
  121. package/usePagination/usePagination.js +1 -1
@@ -1,19 +1,19 @@
1
1
  'use client';
2
2
 
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["children", "className", "expandIcon", "focusVisibleClassName", "onClick"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
- import styled from '../styles/styled';
11
- import useThemeProps from '../styles/useThemeProps';
10
+ import { styled, createUseThemeProps } from '../zero-styled';
12
11
  import ButtonBase from '../ButtonBase';
13
12
  import AccordionContext from '../Accordion/AccordionContext';
14
13
  import accordionSummaryClasses, { getAccordionSummaryUtilityClass } from './accordionSummaryClasses';
15
14
  import { jsx as _jsx } from "react/jsx-runtime";
16
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
+ const useThemeProps = createUseThemeProps('MuiAccordionSummary');
17
17
  const useUtilityClasses = ownerState => {
18
18
  const {
19
19
  classes,
@@ -34,13 +34,12 @@ const AccordionSummaryRoot = styled(ButtonBase, {
34
34
  slot: 'Root',
35
35
  overridesResolver: (props, styles) => styles.root
36
36
  })(({
37
- theme,
38
- ownerState
37
+ theme
39
38
  }) => {
40
39
  const transition = {
41
40
  duration: theme.transitions.duration.shortest
42
41
  };
43
- return _extends({
42
+ return {
44
43
  display: 'flex',
45
44
  minHeight: 48,
46
45
  padding: theme.spacing(0, 2),
@@ -53,31 +52,38 @@ const AccordionSummaryRoot = styled(ButtonBase, {
53
52
  },
54
53
  [`&:hover:not(.${accordionSummaryClasses.disabled})`]: {
55
54
  cursor: 'pointer'
56
- }
57
- }, !ownerState.disableGutters && {
58
- [`&.${accordionSummaryClasses.expanded}`]: {
59
- minHeight: 64
60
- }
61
- });
55
+ },
56
+ variants: [{
57
+ props: props => !props.disableGutters,
58
+ style: {
59
+ [`&.${accordionSummaryClasses.expanded}`]: {
60
+ minHeight: 64
61
+ }
62
+ }
63
+ }]
64
+ };
62
65
  });
63
66
  const AccordionSummaryContent = styled('div', {
64
67
  name: 'MuiAccordionSummary',
65
68
  slot: 'Content',
66
69
  overridesResolver: (props, styles) => styles.content
67
70
  })(({
68
- theme,
69
- ownerState
70
- }) => _extends({
71
+ theme
72
+ }) => ({
71
73
  display: 'flex',
72
74
  flexGrow: 1,
73
- margin: '12px 0'
74
- }, !ownerState.disableGutters && {
75
- transition: theme.transitions.create(['margin'], {
76
- duration: theme.transitions.duration.shortest
77
- }),
78
- [`&.${accordionSummaryClasses.expanded}`]: {
79
- margin: '20px 0'
80
- }
75
+ margin: '12px 0',
76
+ variants: [{
77
+ props: props => !props.disableGutters,
78
+ style: {
79
+ transition: theme.transitions.create(['margin'], {
80
+ duration: theme.transitions.duration.shortest
81
+ }),
82
+ [`&.${accordionSummaryClasses.expanded}`]: {
83
+ margin: '20px 0'
84
+ }
85
+ }
86
+ }]
81
87
  }));
82
88
  const AccordionSummaryExpandIconWrapper = styled('div', {
83
89
  name: 'MuiAccordionSummary',
@@ -24,14 +24,14 @@ import outlinedInputClasses from '../OutlinedInput/outlinedInputClasses';
24
24
  import filledInputClasses from '../FilledInput/filledInputClasses';
25
25
  import ClearIcon from '../internal/svg-icons/Close';
26
26
  import ArrowDropDownIcon from '../internal/svg-icons/ArrowDropDown';
27
- import useThemeProps from '../styles/useThemeProps';
28
- import styled from '../styles/styled';
27
+ import { styled, createUseThemeProps } from '../zero-styled';
29
28
  import autocompleteClasses, { getAutocompleteUtilityClass } from './autocompleteClasses';
30
29
  import capitalize from '../utils/capitalize';
31
30
  import useForkRef from '../utils/useForkRef';
32
31
  import { jsx as _jsx } from "react/jsx-runtime";
33
32
  import { jsxs as _jsxs } from "react/jsx-runtime";
34
33
  import { createElement as _createElement } from "react";
34
+ const useThemeProps = createUseThemeProps('MuiAutocomplete');
35
35
  const useUtilityClasses = ownerState => {
36
36
  const {
37
37
  classes,
@@ -90,9 +90,7 @@ const AutocompleteRoot = styled('div', {
90
90
  [`& .${autocompleteClasses.input}`]: inputFocused && styles.inputFocused
91
91
  }, styles.root, fullWidth && styles.fullWidth, hasPopupIcon && styles.hasPopupIcon, hasClearIcon && styles.hasClearIcon];
92
92
  }
93
- })(({
94
- ownerState
95
- }) => _extends({
93
+ })({
96
94
  [`&.${autocompleteClasses.focused} .${autocompleteClasses.clearIndicator}`]: {
97
95
  visibility: 'visible'
98
96
  },
@@ -101,17 +99,11 @@ const AutocompleteRoot = styled('div', {
101
99
  [`&:hover .${autocompleteClasses.clearIndicator}`]: {
102
100
  visibility: 'visible'
103
101
  }
104
- }
105
- }, ownerState.fullWidth && {
106
- width: '100%'
107
- }, {
108
- [`& .${autocompleteClasses.tag}`]: _extends({
102
+ },
103
+ [`& .${autocompleteClasses.tag}`]: {
109
104
  margin: 3,
110
105
  maxWidth: 'calc(100% - 6px)'
111
- }, ownerState.size === 'small' && {
112
- margin: 2,
113
- maxWidth: 'calc(100% - 4px)'
114
- }),
106
+ },
115
107
  [`& .${autocompleteClasses.inputRoot}`]: {
116
108
  flexWrap: 'wrap',
117
109
  [`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]: {
@@ -200,14 +192,39 @@ const AutocompleteRoot = styled('div', {
200
192
  paddingBottom: 9
201
193
  }
202
194
  },
203
- [`& .${autocompleteClasses.input}`]: _extends({
195
+ [`& .${autocompleteClasses.input}`]: {
204
196
  flexGrow: 1,
205
197
  textOverflow: 'ellipsis',
206
198
  opacity: 0
207
- }, ownerState.inputFocused && {
208
- opacity: 1
209
- })
210
- }));
199
+ },
200
+ variants: [{
201
+ props: {
202
+ fullWidth: true
203
+ },
204
+ style: {
205
+ width: '100%'
206
+ }
207
+ }, {
208
+ props: {
209
+ size: 'small'
210
+ },
211
+ style: {
212
+ [`& .${autocompleteClasses.tag}`]: {
213
+ margin: 2,
214
+ maxWidth: 'calc(100% - 4px)'
215
+ }
216
+ }
217
+ }, {
218
+ props: {
219
+ inputFocused: true
220
+ },
221
+ style: {
222
+ [`& .${autocompleteClasses.input}`]: {
223
+ opacity: 1
224
+ }
225
+ }
226
+ }]
227
+ });
211
228
  const AutocompleteEndAdornment = styled('div', {
212
229
  name: 'MuiAutocomplete',
213
230
  slot: 'EndAdornment',
@@ -234,14 +251,18 @@ const AutocompletePopupIndicator = styled(IconButton, {
234
251
  overridesResolver: ({
235
252
  ownerState
236
253
  }, styles) => _extends({}, styles.popupIndicator, ownerState.popupOpen && styles.popupIndicatorOpen)
237
- })(({
238
- ownerState
239
- }) => _extends({
254
+ })({
240
255
  padding: 2,
241
- marginRight: -2
242
- }, ownerState.popupOpen && {
243
- transform: 'rotate(180deg)'
244
- }));
256
+ marginRight: -2,
257
+ variants: [{
258
+ props: {
259
+ popupOpen: true
260
+ },
261
+ style: {
262
+ transform: 'rotate(180deg)'
263
+ }
264
+ }]
265
+ });
245
266
  const AutocompletePopper = styled(Popper, {
246
267
  name: 'MuiAutocomplete',
247
268
  slot: 'Popper',
@@ -254,12 +275,17 @@ const AutocompletePopper = styled(Popper, {
254
275
  }, styles.popper, ownerState.disablePortal && styles.popperDisablePortal];
255
276
  }
256
277
  })(({
257
- theme,
258
- ownerState
259
- }) => _extends({
260
- zIndex: (theme.vars || theme).zIndex.modal
261
- }, ownerState.disablePortal && {
262
- position: 'absolute'
278
+ theme
279
+ }) => ({
280
+ zIndex: (theme.vars || theme).zIndex.modal,
281
+ variants: [{
282
+ props: {
283
+ disablePortal: true
284
+ },
285
+ style: {
286
+ position: 'absolute'
287
+ }
288
+ }]
263
289
  }));
264
290
  const AutocompletePaper = styled(Paper, {
265
291
  name: 'MuiAutocomplete',
@@ -550,6 +576,63 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
550
576
  const paperSlotProps = slotProps.paper ?? componentsProps.paper;
551
577
  const popperSlotProps = slotProps.popper ?? componentsProps.popper;
552
578
  const popupIndicatorSlotProps = slotProps.popupIndicator ?? componentsProps.popupIndicator;
579
+ const renderAutocompletePopperChildren = children => /*#__PURE__*/_jsx(AutocompletePopper, _extends({
580
+ as: PopperComponent,
581
+ disablePortal: disablePortal,
582
+ style: {
583
+ width: anchorEl ? anchorEl.clientWidth : null
584
+ },
585
+ ownerState: ownerState,
586
+ role: "presentation",
587
+ anchorEl: anchorEl,
588
+ open: popupOpen
589
+ }, popperSlotProps, {
590
+ className: clsx(classes.popper, popperSlotProps?.className),
591
+ children: /*#__PURE__*/_jsx(AutocompletePaper, _extends({
592
+ ownerState: ownerState,
593
+ as: PaperComponent
594
+ }, paperSlotProps, {
595
+ className: clsx(classes.paper, paperSlotProps?.className),
596
+ children: children
597
+ }))
598
+ }));
599
+ let autocompletePopper = null;
600
+ if (!loading && groupedOptions.length > 0) {
601
+ autocompletePopper = renderAutocompletePopperChildren( /*#__PURE__*/_jsx(AutocompleteListbox, _extends({
602
+ as: ListboxComponent,
603
+ className: classes.listbox,
604
+ ownerState: ownerState
605
+ }, otherListboxProps, ListboxProps, {
606
+ ref: combinedListboxRef,
607
+ children: groupedOptions.map((option, index) => {
608
+ if (groupBy) {
609
+ return renderGroup({
610
+ key: option.key,
611
+ group: option.group,
612
+ children: option.options.map((option2, index2) => renderListOption(option2, option.index + index2))
613
+ });
614
+ }
615
+ return renderListOption(option, index);
616
+ })
617
+ })));
618
+ } else if (loading && groupedOptions.length === 0) {
619
+ autocompletePopper = renderAutocompletePopperChildren( /*#__PURE__*/_jsx(AutocompleteLoading, {
620
+ className: classes.loading,
621
+ ownerState: ownerState,
622
+ children: loadingText
623
+ }));
624
+ } else if (groupedOptions.length === 0 && !freeSolo && !loading) {
625
+ autocompletePopper = renderAutocompletePopperChildren( /*#__PURE__*/_jsx(AutocompleteNoOptions, {
626
+ className: classes.noOptions,
627
+ ownerState: ownerState,
628
+ role: "presentation",
629
+ onMouseDown: event => {
630
+ // Prevent input blur when interacting with the "no options" content
631
+ event.preventDefault();
632
+ },
633
+ children: noOptionsText
634
+ }));
635
+ }
553
636
  return /*#__PURE__*/_jsxs(React.Fragment, {
554
637
  children: [/*#__PURE__*/_jsx(AutocompleteRoot, _extends({
555
638
  ref: ref,
@@ -599,55 +682,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
599
682
  readOnly
600
683
  }, getInputProps())
601
684
  })
602
- })), anchorEl ? /*#__PURE__*/_jsx(AutocompletePopper, _extends({
603
- as: PopperComponent,
604
- disablePortal: disablePortal,
605
- style: {
606
- width: anchorEl ? anchorEl.clientWidth : null
607
- },
608
- ownerState: ownerState,
609
- role: "presentation",
610
- anchorEl: anchorEl,
611
- open: popupOpen
612
- }, popperSlotProps, {
613
- className: clsx(classes.popper, popperSlotProps?.className),
614
- children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
615
- ownerState: ownerState,
616
- as: PaperComponent
617
- }, paperSlotProps, {
618
- className: clsx(classes.paper, paperSlotProps?.className),
619
- children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
620
- className: classes.loading,
621
- ownerState: ownerState,
622
- children: loadingText
623
- }) : null, groupedOptions.length === 0 && !freeSolo && !loading ? /*#__PURE__*/_jsx(AutocompleteNoOptions, {
624
- className: classes.noOptions,
625
- ownerState: ownerState,
626
- role: "presentation",
627
- onMouseDown: event => {
628
- // Prevent input blur when interacting with the "no options" content
629
- event.preventDefault();
630
- },
631
- children: noOptionsText
632
- }) : null, groupedOptions.length > 0 ? /*#__PURE__*/_jsx(AutocompleteListbox, _extends({
633
- as: ListboxComponent,
634
- className: classes.listbox,
635
- ownerState: ownerState
636
- }, otherListboxProps, ListboxProps, {
637
- ref: combinedListboxRef,
638
- children: groupedOptions.map((option, index) => {
639
- if (groupBy) {
640
- return renderGroup({
641
- key: option.key,
642
- group: option.group,
643
- children: option.options.map((option2, index2) => renderListOption(option2, option.index + index2))
644
- });
645
- }
646
- return renderListOption(option, index);
647
- })
648
- })) : null]
649
- }))
650
- })) : null]
685
+ })), anchorEl ? autocompletePopper : null]
651
686
  });
652
687
  });
653
688
  process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptypes */ = {
@@ -899,7 +934,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
899
934
  ListboxProps: PropTypes.object,
900
935
  /**
901
936
  * If `true`, the component is in a loading state.
902
- * This shows the `loadingText` in place of suggestions (only if there are no suggestions to show, e.g. `options` are empty).
937
+ * This shows the `loadingText` in place of suggestions (only if there are no suggestions to show, for example `options` are empty).
903
938
  * @default false
904
939
  */
905
940
  loading: PropTypes.bool,
@@ -213,7 +213,7 @@ process.env.NODE_ENV !== "production" ? CircularProgress.propTypes /* remove-pro
213
213
  /**
214
214
  * The size of the component.
215
215
  * If using a number, the pixel unit is assumed.
216
- * If using a string, you need to provide the CSS unit, e.g. '3rem'.
216
+ * If using a string, you need to provide the CSS unit, for example '3rem'.
217
217
  * @default 40
218
218
  */
219
219
  size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -9,6 +9,7 @@ import PropTypes from 'prop-types';
9
9
  import clsx from 'clsx';
10
10
  import integerPropType from '@mui/utils/integerPropType';
11
11
  import composeClasses from '@mui/utils/composeClasses';
12
+ import { useRtl } from '@mui/system/RtlProvider';
12
13
  import Modal from '../Modal';
13
14
  import Slide from '../Slide';
14
15
  import Paper from '../Paper';
@@ -119,8 +120,10 @@ const oppositeDirection = {
119
120
  export function isHorizontal(anchor) {
120
121
  return ['left', 'right'].indexOf(anchor) !== -1;
121
122
  }
122
- export function getAnchor(theme, anchor) {
123
- return theme.direction === 'rtl' && isHorizontal(anchor) ? oppositeDirection[anchor] : anchor;
123
+ export function getAnchor({
124
+ direction
125
+ }, anchor) {
126
+ return direction === 'rtl' && isHorizontal(anchor) ? oppositeDirection[anchor] : anchor;
124
127
  }
125
128
 
126
129
  /**
@@ -133,6 +136,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
133
136
  name: 'MuiDrawer'
134
137
  });
135
138
  const theme = useTheme();
139
+ const isRtl = useRtl();
136
140
  const defaultTransitionDuration = {
137
141
  enter: theme.transitions.duration.enteringScreen,
138
142
  exit: theme.transitions.duration.leavingScreen
@@ -166,7 +170,9 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
166
170
  React.useEffect(() => {
167
171
  mounted.current = true;
168
172
  }, []);
169
- const anchorInvariant = getAnchor(theme, anchorProp);
173
+ const anchorInvariant = getAnchor({
174
+ direction: isRtl ? 'rtl' : 'ltr'
175
+ }, anchorProp);
170
176
  const anchor = anchorProp;
171
177
  const ownerState = _extends({}, props, {
172
178
  anchor,
@@ -104,7 +104,7 @@ process.env.NODE_ENV !== "production" ? Icon.propTypes /* remove-proptypes */ =
104
104
  // └─────────────────────────────────────────────────────────────────────┘
105
105
  /**
106
106
  * The base class applied to the icon. Defaults to 'material-icons', but can be changed to any
107
- * other base class that suits the icon font you're using (e.g. material-icons-rounded, fas, etc).
107
+ * other base class that suits the icon font you're using (for example material-icons-rounded, fas, etc).
108
108
  * @default 'material-icons'
109
109
  */
110
110
  baseClassName: PropTypes.string,
@@ -9,8 +9,8 @@ import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import { keyframes, css } from '@mui/system';
11
11
  import { darken, lighten } from '@mui/system/colorManipulator';
12
+ import { useRtl } from '@mui/system/RtlProvider';
12
13
  import capitalize from '../utils/capitalize';
13
- import useTheme from '../styles/useTheme';
14
14
  import styled from '../styles/styled';
15
15
  import useThemeProps from '../styles/useThemeProps';
16
16
  import { getLinearProgressUtilityClass } from './linearProgressClasses';
@@ -248,7 +248,7 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
248
248
  variant
249
249
  });
250
250
  const classes = useUtilityClasses(ownerState);
251
- const theme = useTheme();
251
+ const isRtl = useRtl();
252
252
  const rootProps = {};
253
253
  const inlineStyles = {
254
254
  bar1: {},
@@ -260,7 +260,7 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
260
260
  rootProps['aria-valuemin'] = 0;
261
261
  rootProps['aria-valuemax'] = 100;
262
262
  let transform = value - 100;
263
- if (theme.direction === 'rtl') {
263
+ if (isRtl) {
264
264
  transform = -transform;
265
265
  }
266
266
  inlineStyles.bar1.transform = `translateX(${transform}%)`;
@@ -271,7 +271,7 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
271
271
  if (variant === 'buffer') {
272
272
  if (valueBuffer !== undefined) {
273
273
  let transform = (valueBuffer || 0) - 100;
274
- if (theme.direction === 'rtl') {
274
+ if (isRtl) {
275
275
  transform = -transform;
276
276
  }
277
277
  inlineStyles.bar2.transform = `translateX(${transform}%)`;
@@ -11,10 +11,10 @@ import clsx from 'clsx';
11
11
  import composeClasses from '@mui/utils/composeClasses';
12
12
  import { useSlotProps } from '@mui/base/utils';
13
13
  import HTMLElementType from '@mui/utils/HTMLElementType';
14
+ import { useRtl } from '@mui/system/RtlProvider';
14
15
  import MenuList from '../MenuList';
15
16
  import Popover, { PopoverPaper } from '../Popover';
16
17
  import styled, { rootShouldForwardProp } from '../styles/styled';
17
- import useTheme from '../styles/useTheme';
18
18
  import useThemeProps from '../styles/useThemeProps';
19
19
  import { getMenuUtilityClass } from './menuClasses';
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -88,8 +88,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
88
88
  } = props,
89
89
  TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded),
90
90
  other = _objectWithoutPropertiesLoose(props, _excluded2);
91
- const theme = useTheme();
92
- const isRtl = theme.direction === 'rtl';
91
+ const isRtl = useRtl();
93
92
  const ownerState = _extends({}, props, {
94
93
  autoFocus,
95
94
  disableAutoFocusItem,
@@ -105,7 +104,9 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
105
104
  const menuListActionsRef = React.useRef(null);
106
105
  const handleEntering = (element, isAppearing) => {
107
106
  if (menuListActionsRef.current) {
108
- menuListActionsRef.current.adjustStyleForScrollbar(element, theme);
107
+ menuListActionsRef.current.adjustStyleForScrollbar(element, {
108
+ direction: isRtl ? 'rtl' : 'ltr'
109
+ });
109
110
  }
110
111
  if (onEntering) {
111
112
  onEntering(element, isAppearing);
@@ -107,13 +107,15 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
107
107
  }
108
108
  }, [autoFocus]);
109
109
  React.useImperativeHandle(actions, () => ({
110
- adjustStyleForScrollbar: (containerElement, theme) => {
110
+ adjustStyleForScrollbar: (containerElement, {
111
+ direction
112
+ }) => {
111
113
  // Let's ignore that piece of logic if users are already overriding the width
112
114
  // of the menu.
113
115
  const noExplicitWidth = !listRef.current.style.width;
114
116
  if (containerElement.clientHeight < listRef.current.clientHeight && noExplicitWidth) {
115
117
  const scrollbarSize = `${getScrollbarSize(ownerDocument(containerElement))}px`;
116
- listRef.current.style[theme.direction === 'rtl' ? 'paddingLeft' : 'paddingRight'] = scrollbarSize;
118
+ listRef.current.style[direction === 'rtl' ? 'paddingLeft' : 'paddingRight'] = scrollbarSize;
117
119
  listRef.current.style.width = `calc(100% + ${scrollbarSize})`;
118
120
  }
119
121
  return listRef.current;
@@ -8,9 +8,9 @@ import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import { alpha } from '@mui/system/colorManipulator';
11
+ import { useRtl } from '@mui/system/RtlProvider';
11
12
  import useThemeProps from '../styles/useThemeProps';
12
13
  import paginationItemClasses, { getPaginationItemUtilityClass } from './paginationItemClasses';
13
- import useTheme from '../styles/useTheme';
14
14
  import ButtonBase from '../ButtonBase';
15
15
  import capitalize from '../utils/capitalize';
16
16
  import FirstPageIcon from '../internal/svg-icons/FirstPage';
@@ -234,9 +234,9 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
234
234
  type,
235
235
  variant
236
236
  });
237
- const theme = useTheme();
237
+ const isRtl = useRtl();
238
238
  const classes = useUtilityClasses(ownerState);
239
- const normalizedIcons = theme.direction === 'rtl' ? {
239
+ const normalizedIcons = isRtl ? {
240
240
  previous: slots.next || components.next || NavigateNextIcon,
241
241
  next: slots.previous || components.previous || NavigateBeforeIcon,
242
242
  last: slots.first || components.first || FirstPageIcon,
@@ -11,7 +11,7 @@ import clamp from '@mui/utils/clamp';
11
11
  import visuallyHidden from '@mui/utils/visuallyHidden';
12
12
  import chainPropTypes from '@mui/utils/chainPropTypes';
13
13
  import composeClasses from '@mui/utils/composeClasses';
14
- import useTheme from '../styles/useTheme';
14
+ import { useRtl } from '@mui/system/RtlProvider';
15
15
  import { capitalize, useForkRef, useIsFocusVisible, useControlled, unstable_useId as useId } from '../utils';
16
16
  import Star from '../internal/svg-icons/Star';
17
17
  import StarBorder from '../internal/svg-icons/StarBorder';
@@ -300,7 +300,7 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
300
300
  name: 'Rating'
301
301
  });
302
302
  const valueRounded = roundValueToPrecision(valueDerived, precision);
303
- const theme = useTheme();
303
+ const isRtl = useRtl();
304
304
  const [{
305
305
  hover,
306
306
  focus
@@ -335,7 +335,7 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
335
335
  width: containerWidth
336
336
  } = rootNode.getBoundingClientRect();
337
337
  let percent;
338
- if (theme.direction === 'rtl') {
338
+ if (isRtl) {
339
339
  percent = (right - event.clientX) / containerWidth;
340
340
  } else {
341
341
  percent = (event.clientX - left) / containerWidth;