@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
@@ -3,7 +3,7 @@
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
- var _ClearIcon, _ArrowDropDownIcon;
6
+ var _styled, _ClearIcon, _ArrowDropDownIcon;
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import clsx from 'clsx';
@@ -23,14 +23,14 @@ import outlinedInputClasses from '../OutlinedInput/outlinedInputClasses';
23
23
  import filledInputClasses from '../FilledInput/filledInputClasses';
24
24
  import ClearIcon from '../internal/svg-icons/Close';
25
25
  import ArrowDropDownIcon from '../internal/svg-icons/ArrowDropDown';
26
- import useThemeProps from '../styles/useThemeProps';
27
- import styled from '../styles/styled';
26
+ import { styled, createUseThemeProps } from '../zero-styled';
28
27
  import autocompleteClasses, { getAutocompleteUtilityClass } from './autocompleteClasses';
29
28
  import capitalize from '../utils/capitalize';
30
29
  import useForkRef from '../utils/useForkRef';
31
30
  import { jsx as _jsx } from "react/jsx-runtime";
32
31
  import { jsxs as _jsxs } from "react/jsx-runtime";
33
32
  import { createElement as _createElement } from "react";
33
+ var useThemeProps = createUseThemeProps('MuiAutocomplete');
34
34
  var useUtilityClasses = function useUtilityClasses(ownerState) {
35
35
  var classes = ownerState.classes,
36
36
  disablePortal = ownerState.disablePortal,
@@ -73,89 +73,100 @@ var AutocompleteRoot = styled('div', {
73
73
  size = ownerState.size;
74
74
  return [_defineProperty({}, "& .".concat(autocompleteClasses.tag), styles.tag), _defineProperty({}, "& .".concat(autocompleteClasses.tag), styles["tagSize".concat(capitalize(size))]), _defineProperty({}, "& .".concat(autocompleteClasses.inputRoot), styles.inputRoot), _defineProperty({}, "& .".concat(autocompleteClasses.input), styles.input), _defineProperty({}, "& .".concat(autocompleteClasses.input), inputFocused && styles.inputFocused), styles.root, fullWidth && styles.fullWidth, hasPopupIcon && styles.hasPopupIcon, hasClearIcon && styles.hasClearIcon];
75
75
  }
76
- })(function (_ref6) {
77
- var _extends3;
78
- var ownerState = _ref6.ownerState;
79
- return _extends(_defineProperty(_defineProperty({}, "&.".concat(autocompleteClasses.focused, " .").concat(autocompleteClasses.clearIndicator), {
80
- visibility: 'visible'
81
- }), '@media (pointer: fine)', _defineProperty({}, "&:hover .".concat(autocompleteClasses.clearIndicator), {
82
- visibility: 'visible'
83
- })), ownerState.fullWidth && {
76
+ })((_styled = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_styled, "&.".concat(autocompleteClasses.focused, " .").concat(autocompleteClasses.clearIndicator), {
77
+ visibility: 'visible'
78
+ }), '@media (pointer: fine)', _defineProperty({}, "&:hover .".concat(autocompleteClasses.clearIndicator), {
79
+ visibility: 'visible'
80
+ })), "& .".concat(autocompleteClasses.tag), {
81
+ margin: 3,
82
+ maxWidth: 'calc(100% - 6px)'
83
+ }), "& .".concat(autocompleteClasses.inputRoot), _defineProperty(_defineProperty(_defineProperty({
84
+ flexWrap: 'wrap'
85
+ }, ".".concat(autocompleteClasses.hasPopupIcon, "&, .").concat(autocompleteClasses.hasClearIcon, "&"), {
86
+ paddingRight: 26 + 4
87
+ }), ".".concat(autocompleteClasses.hasPopupIcon, ".").concat(autocompleteClasses.hasClearIcon, "&"), {
88
+ paddingRight: 52 + 4
89
+ }), "& .".concat(autocompleteClasses.input), {
90
+ width: 0,
91
+ minWidth: 30
92
+ })), "& .".concat(inputClasses.root), {
93
+ paddingBottom: 1,
94
+ '& .MuiInput-input': {
95
+ padding: '4px 4px 4px 0px'
96
+ }
97
+ }), "& .".concat(inputClasses.root, ".").concat(inputBaseClasses.sizeSmall), _defineProperty({}, "& .".concat(inputClasses.input), {
98
+ padding: '2px 4px 3px 0'
99
+ })), "& .".concat(outlinedInputClasses.root), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
100
+ padding: 9
101
+ }, ".".concat(autocompleteClasses.hasPopupIcon, "&, .").concat(autocompleteClasses.hasClearIcon, "&"), {
102
+ paddingRight: 26 + 4 + 9
103
+ }), ".".concat(autocompleteClasses.hasPopupIcon, ".").concat(autocompleteClasses.hasClearIcon, "&"), {
104
+ paddingRight: 52 + 4 + 9
105
+ }), "& .".concat(autocompleteClasses.input), {
106
+ padding: '7.5px 4px 7.5px 5px'
107
+ }), "& .".concat(autocompleteClasses.endAdornment), {
108
+ right: 9
109
+ })), "& .".concat(outlinedInputClasses.root, ".").concat(inputBaseClasses.sizeSmall), _defineProperty({
110
+ // Don't specify paddingRight, as it overrides the default value set when there is only
111
+ // one of the popup or clear icon as the specificity is equal so the latter one wins
112
+ paddingTop: 6,
113
+ paddingBottom: 6,
114
+ paddingLeft: 6
115
+ }, "& .".concat(autocompleteClasses.input), {
116
+ padding: '2.5px 4px 2.5px 8px'
117
+ })), "& .".concat(filledInputClasses.root), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
118
+ paddingTop: 19,
119
+ paddingLeft: 8
120
+ }, ".".concat(autocompleteClasses.hasPopupIcon, "&, .").concat(autocompleteClasses.hasClearIcon, "&"), {
121
+ paddingRight: 26 + 4 + 9
122
+ }), ".".concat(autocompleteClasses.hasPopupIcon, ".").concat(autocompleteClasses.hasClearIcon, "&"), {
123
+ paddingRight: 52 + 4 + 9
124
+ }), "& .".concat(filledInputClasses.input), {
125
+ padding: '7px 4px'
126
+ }), "& .".concat(autocompleteClasses.endAdornment), {
127
+ right: 9
128
+ })), "& .".concat(filledInputClasses.root, ".").concat(inputBaseClasses.sizeSmall), _defineProperty({
129
+ paddingBottom: 1
130
+ }, "& .".concat(filledInputClasses.input), {
131
+ padding: '2.5px 4px'
132
+ })), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_styled, "& .".concat(inputBaseClasses.hiddenLabel), {
133
+ paddingTop: 8
134
+ }), "& .".concat(filledInputClasses.root, ".").concat(inputBaseClasses.hiddenLabel), _defineProperty({
135
+ paddingTop: 0,
136
+ paddingBottom: 0
137
+ }, "& .".concat(autocompleteClasses.input), {
138
+ paddingTop: 16,
139
+ paddingBottom: 17
140
+ })), "& .".concat(filledInputClasses.root, ".").concat(inputBaseClasses.hiddenLabel, ".").concat(inputBaseClasses.sizeSmall), _defineProperty({}, "& .".concat(autocompleteClasses.input), {
141
+ paddingTop: 8,
142
+ paddingBottom: 9
143
+ })), "& .".concat(autocompleteClasses.input), {
144
+ flexGrow: 1,
145
+ textOverflow: 'ellipsis',
146
+ opacity: 0
147
+ }), "variants", [{
148
+ props: {
149
+ fullWidth: true
150
+ },
151
+ style: {
84
152
  width: '100%'
85
- }, (_extends3 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_extends3, "& .".concat(autocompleteClasses.tag), _extends({
86
- margin: 3,
87
- maxWidth: 'calc(100% - 6px)'
88
- }, ownerState.size === 'small' && {
153
+ }
154
+ }, {
155
+ props: {
156
+ size: 'small'
157
+ },
158
+ style: _defineProperty({}, "& .".concat(autocompleteClasses.tag), {
89
159
  margin: 2,
90
160
  maxWidth: 'calc(100% - 4px)'
91
- })), "& .".concat(autocompleteClasses.inputRoot), _defineProperty(_defineProperty(_defineProperty({
92
- flexWrap: 'wrap'
93
- }, ".".concat(autocompleteClasses.hasPopupIcon, "&, .").concat(autocompleteClasses.hasClearIcon, "&"), {
94
- paddingRight: 26 + 4
95
- }), ".".concat(autocompleteClasses.hasPopupIcon, ".").concat(autocompleteClasses.hasClearIcon, "&"), {
96
- paddingRight: 52 + 4
97
- }), "& .".concat(autocompleteClasses.input), {
98
- width: 0,
99
- minWidth: 30
100
- })), "& .".concat(inputClasses.root), {
101
- paddingBottom: 1,
102
- '& .MuiInput-input': {
103
- padding: '4px 4px 4px 0px'
104
- }
105
- }), "& .".concat(inputClasses.root, ".").concat(inputBaseClasses.sizeSmall), _defineProperty({}, "& .".concat(inputClasses.input), {
106
- padding: '2px 4px 3px 0'
107
- })), "& .".concat(outlinedInputClasses.root), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
108
- padding: 9
109
- }, ".".concat(autocompleteClasses.hasPopupIcon, "&, .").concat(autocompleteClasses.hasClearIcon, "&"), {
110
- paddingRight: 26 + 4 + 9
111
- }), ".".concat(autocompleteClasses.hasPopupIcon, ".").concat(autocompleteClasses.hasClearIcon, "&"), {
112
- paddingRight: 52 + 4 + 9
113
- }), "& .".concat(autocompleteClasses.input), {
114
- padding: '7.5px 4px 7.5px 5px'
115
- }), "& .".concat(autocompleteClasses.endAdornment), {
116
- right: 9
117
- })), "& .".concat(outlinedInputClasses.root, ".").concat(inputBaseClasses.sizeSmall), _defineProperty({
118
- // Don't specify paddingRight, as it overrides the default value set when there is only
119
- // one of the popup or clear icon as the specificity is equal so the latter one wins
120
- paddingTop: 6,
121
- paddingBottom: 6,
122
- paddingLeft: 6
123
- }, "& .".concat(autocompleteClasses.input), {
124
- padding: '2.5px 4px 2.5px 8px'
125
- })), "& .".concat(filledInputClasses.root), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
126
- paddingTop: 19,
127
- paddingLeft: 8
128
- }, ".".concat(autocompleteClasses.hasPopupIcon, "&, .").concat(autocompleteClasses.hasClearIcon, "&"), {
129
- paddingRight: 26 + 4 + 9
130
- }), ".".concat(autocompleteClasses.hasPopupIcon, ".").concat(autocompleteClasses.hasClearIcon, "&"), {
131
- paddingRight: 52 + 4 + 9
132
- }), "& .".concat(filledInputClasses.input), {
133
- padding: '7px 4px'
134
- }), "& .".concat(autocompleteClasses.endAdornment), {
135
- right: 9
136
- })), "& .".concat(filledInputClasses.root, ".").concat(inputBaseClasses.sizeSmall), _defineProperty({
137
- paddingBottom: 1
138
- }, "& .".concat(filledInputClasses.input), {
139
- padding: '2.5px 4px'
140
- })), "& .".concat(inputBaseClasses.hiddenLabel), {
141
- paddingTop: 8
142
- }), "& .".concat(filledInputClasses.root, ".").concat(inputBaseClasses.hiddenLabel), _defineProperty({
143
- paddingTop: 0,
144
- paddingBottom: 0
145
- }, "& .".concat(autocompleteClasses.input), {
146
- paddingTop: 16,
147
- paddingBottom: 17
148
- })), _defineProperty(_defineProperty(_extends3, "& .".concat(filledInputClasses.root, ".").concat(inputBaseClasses.hiddenLabel, ".").concat(inputBaseClasses.sizeSmall), _defineProperty({}, "& .".concat(autocompleteClasses.input), {
149
- paddingTop: 8,
150
- paddingBottom: 9
151
- })), "& .".concat(autocompleteClasses.input), _extends({
152
- flexGrow: 1,
153
- textOverflow: 'ellipsis',
154
- opacity: 0
155
- }, ownerState.inputFocused && {
161
+ })
162
+ }, {
163
+ props: {
164
+ inputFocused: true
165
+ },
166
+ style: _defineProperty({}, "& .".concat(autocompleteClasses.input), {
156
167
  opacity: 1
157
- }))));
158
- });
168
+ })
169
+ }])));
159
170
  var AutocompleteEndAdornment = styled('div', {
160
171
  name: 'MuiAutocomplete',
161
172
  slot: 'EndAdornment',
@@ -183,18 +194,21 @@ var AutocompleteClearIndicator = styled(IconButton, {
183
194
  var AutocompletePopupIndicator = styled(IconButton, {
184
195
  name: 'MuiAutocomplete',
185
196
  slot: 'PopupIndicator',
186
- overridesResolver: function overridesResolver(_ref7, styles) {
187
- var ownerState = _ref7.ownerState;
197
+ overridesResolver: function overridesResolver(_ref6, styles) {
198
+ var ownerState = _ref6.ownerState;
188
199
  return _extends({}, styles.popupIndicator, ownerState.popupOpen && styles.popupIndicatorOpen);
189
200
  }
190
- })(function (_ref8) {
191
- var ownerState = _ref8.ownerState;
192
- return _extends({
193
- padding: 2,
194
- marginRight: -2
195
- }, ownerState.popupOpen && {
196
- transform: 'rotate(180deg)'
197
- });
201
+ })({
202
+ padding: 2,
203
+ marginRight: -2,
204
+ variants: [{
205
+ props: {
206
+ popupOpen: true
207
+ },
208
+ style: {
209
+ transform: 'rotate(180deg)'
210
+ }
211
+ }]
198
212
  });
199
213
  var AutocompletePopper = styled(Popper, {
200
214
  name: 'MuiAutocomplete',
@@ -203,14 +217,19 @@ var AutocompletePopper = styled(Popper, {
203
217
  var ownerState = props.ownerState;
204
218
  return [_defineProperty({}, "& .".concat(autocompleteClasses.option), styles.option), styles.popper, ownerState.disablePortal && styles.popperDisablePortal];
205
219
  }
206
- })(function (_ref10) {
207
- var theme = _ref10.theme,
208
- ownerState = _ref10.ownerState;
209
- return _extends({
210
- zIndex: (theme.vars || theme).zIndex.modal
211
- }, ownerState.disablePortal && {
212
- position: 'absolute'
213
- });
220
+ })(function (_ref8) {
221
+ var theme = _ref8.theme;
222
+ return {
223
+ zIndex: (theme.vars || theme).zIndex.modal,
224
+ variants: [{
225
+ props: {
226
+ disablePortal: true
227
+ },
228
+ style: {
229
+ position: 'absolute'
230
+ }
231
+ }]
232
+ };
214
233
  });
215
234
  var AutocompletePaper = styled(Paper, {
216
235
  name: 'MuiAutocomplete',
@@ -218,8 +237,8 @@ var AutocompletePaper = styled(Paper, {
218
237
  overridesResolver: function overridesResolver(props, styles) {
219
238
  return styles.paper;
220
239
  }
221
- })(function (_ref11) {
222
- var theme = _ref11.theme;
240
+ })(function (_ref9) {
241
+ var theme = _ref9.theme;
223
242
  return _extends({}, theme.typography.body1, {
224
243
  overflow: 'auto'
225
244
  });
@@ -230,8 +249,8 @@ var AutocompleteLoading = styled('div', {
230
249
  overridesResolver: function overridesResolver(props, styles) {
231
250
  return styles.loading;
232
251
  }
233
- })(function (_ref12) {
234
- var theme = _ref12.theme;
252
+ })(function (_ref10) {
253
+ var theme = _ref10.theme;
235
254
  return {
236
255
  color: (theme.vars || theme).palette.text.secondary,
237
256
  padding: '14px 16px'
@@ -243,8 +262,8 @@ var AutocompleteNoOptions = styled('div', {
243
262
  overridesResolver: function overridesResolver(props, styles) {
244
263
  return styles.noOptions;
245
264
  }
246
- })(function (_ref13) {
247
- var theme = _ref13.theme;
265
+ })(function (_ref11) {
266
+ var theme = _ref11.theme;
248
267
  return {
249
268
  color: (theme.vars || theme).palette.text.secondary,
250
269
  padding: '14px 16px'
@@ -256,8 +275,8 @@ var AutocompleteListbox = styled('div', {
256
275
  overridesResolver: function overridesResolver(props, styles) {
257
276
  return styles.listbox;
258
277
  }
259
- })(function (_ref14) {
260
- var theme = _ref14.theme;
278
+ })(function (_ref12) {
279
+ var theme = _ref12.theme;
261
280
  return _defineProperty({
262
281
  listStyle: 'none',
263
282
  margin: 0,
@@ -310,8 +329,8 @@ var AutocompleteGroupLabel = styled(ListSubheader, {
310
329
  overridesResolver: function overridesResolver(props, styles) {
311
330
  return styles.groupLabel;
312
331
  }
313
- })(function (_ref16) {
314
- var theme = _ref16.theme;
332
+ })(function (_ref14) {
333
+ var theme = _ref14.theme;
315
334
  return {
316
335
  backgroundColor: (theme.vars || theme).palette.background.paper,
317
336
  top: -8
@@ -470,8 +489,8 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
470
489
  var hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
471
490
  var _getInputProps = getInputProps(),
472
491
  handleInputMouseDown = _getInputProps.onMouseDown;
473
- var _ref17 = ListboxProps != null ? ListboxProps : {},
474
- externalListboxRef = _ref17.ref;
492
+ var _ref15 = ListboxProps != null ? ListboxProps : {},
493
+ externalListboxRef = _ref15.ref;
475
494
  var _getListboxProps = getListboxProps(),
476
495
  listboxRef = _getListboxProps.ref,
477
496
  otherListboxProps = _objectWithoutProperties(_getListboxProps, ["ref"]);
@@ -566,6 +585,67 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
566
585
  var paperSlotProps = (_slotProps$paper = slotProps.paper) != null ? _slotProps$paper : componentsProps.paper;
567
586
  var popperSlotProps = (_slotProps$popper = slotProps.popper) != null ? _slotProps$popper : componentsProps.popper;
568
587
  var popupIndicatorSlotProps = (_slotProps$popupIndic = slotProps.popupIndicator) != null ? _slotProps$popupIndic : componentsProps.popupIndicator;
588
+ var renderAutocompletePopperChildren = function renderAutocompletePopperChildren(children) {
589
+ return /*#__PURE__*/_jsx(AutocompletePopper, _extends({
590
+ as: PopperComponent,
591
+ disablePortal: disablePortal,
592
+ style: {
593
+ width: anchorEl ? anchorEl.clientWidth : null
594
+ },
595
+ ownerState: ownerState,
596
+ role: "presentation",
597
+ anchorEl: anchorEl,
598
+ open: popupOpen
599
+ }, popperSlotProps, {
600
+ className: clsx(classes.popper, popperSlotProps == null ? void 0 : popperSlotProps.className),
601
+ children: /*#__PURE__*/_jsx(AutocompletePaper, _extends({
602
+ ownerState: ownerState,
603
+ as: PaperComponent
604
+ }, paperSlotProps, {
605
+ className: clsx(classes.paper, paperSlotProps == null ? void 0 : paperSlotProps.className),
606
+ children: children
607
+ }))
608
+ }));
609
+ };
610
+ var autocompletePopper = null;
611
+ if (!loading && groupedOptions.length > 0) {
612
+ autocompletePopper = renderAutocompletePopperChildren( /*#__PURE__*/_jsx(AutocompleteListbox, _extends({
613
+ as: ListboxComponent,
614
+ className: classes.listbox,
615
+ ownerState: ownerState
616
+ }, otherListboxProps, ListboxProps, {
617
+ ref: combinedListboxRef,
618
+ children: groupedOptions.map(function (option, index) {
619
+ if (groupBy) {
620
+ return renderGroup({
621
+ key: option.key,
622
+ group: option.group,
623
+ children: option.options.map(function (option2, index2) {
624
+ return renderListOption(option2, option.index + index2);
625
+ })
626
+ });
627
+ }
628
+ return renderListOption(option, index);
629
+ })
630
+ })));
631
+ } else if (loading && groupedOptions.length === 0) {
632
+ autocompletePopper = renderAutocompletePopperChildren( /*#__PURE__*/_jsx(AutocompleteLoading, {
633
+ className: classes.loading,
634
+ ownerState: ownerState,
635
+ children: loadingText
636
+ }));
637
+ } else if (groupedOptions.length === 0 && !freeSolo && !loading) {
638
+ autocompletePopper = renderAutocompletePopperChildren( /*#__PURE__*/_jsx(AutocompleteNoOptions, {
639
+ className: classes.noOptions,
640
+ ownerState: ownerState,
641
+ role: "presentation",
642
+ onMouseDown: function onMouseDown(event) {
643
+ // Prevent input blur when interacting with the "no options" content
644
+ event.preventDefault();
645
+ },
646
+ children: noOptionsText
647
+ }));
648
+ }
569
649
  return /*#__PURE__*/_jsxs(React.Fragment, {
570
650
  children: [/*#__PURE__*/_jsx(AutocompleteRoot, _extends({
571
651
  ref: ref,
@@ -615,57 +695,7 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
615
695
  readOnly: readOnly
616
696
  }, getInputProps())
617
697
  })
618
- })), anchorEl ? /*#__PURE__*/_jsx(AutocompletePopper, _extends({
619
- as: PopperComponent,
620
- disablePortal: disablePortal,
621
- style: {
622
- width: anchorEl ? anchorEl.clientWidth : null
623
- },
624
- ownerState: ownerState,
625
- role: "presentation",
626
- anchorEl: anchorEl,
627
- open: popupOpen
628
- }, popperSlotProps, {
629
- className: clsx(classes.popper, popperSlotProps == null ? void 0 : popperSlotProps.className),
630
- children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
631
- ownerState: ownerState,
632
- as: PaperComponent
633
- }, paperSlotProps, {
634
- className: clsx(classes.paper, paperSlotProps == null ? void 0 : paperSlotProps.className),
635
- children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
636
- className: classes.loading,
637
- ownerState: ownerState,
638
- children: loadingText
639
- }) : null, groupedOptions.length === 0 && !freeSolo && !loading ? /*#__PURE__*/_jsx(AutocompleteNoOptions, {
640
- className: classes.noOptions,
641
- ownerState: ownerState,
642
- role: "presentation",
643
- onMouseDown: function onMouseDown(event) {
644
- // Prevent input blur when interacting with the "no options" content
645
- event.preventDefault();
646
- },
647
- children: noOptionsText
648
- }) : null, groupedOptions.length > 0 ? /*#__PURE__*/_jsx(AutocompleteListbox, _extends({
649
- as: ListboxComponent,
650
- className: classes.listbox,
651
- ownerState: ownerState
652
- }, otherListboxProps, ListboxProps, {
653
- ref: combinedListboxRef,
654
- children: groupedOptions.map(function (option, index) {
655
- if (groupBy) {
656
- return renderGroup({
657
- key: option.key,
658
- group: option.group,
659
- children: option.options.map(function (option2, index2) {
660
- return renderListOption(option2, option.index + index2);
661
- })
662
- });
663
- }
664
- return renderListOption(option, index);
665
- })
666
- })) : null]
667
- }))
668
- })) : null]
698
+ })), anchorEl ? autocompletePopper : null]
669
699
  });
670
700
  });
671
701
  process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptypes */ = {
@@ -917,7 +947,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
917
947
  ListboxProps: PropTypes.object,
918
948
  /**
919
949
  * If `true`, the component is in a loading state.
920
- * This shows the `loadingText` in place of suggestions (only if there are no suggestions to show, e.g. `options` are empty).
950
+ * This shows the `loadingText` in place of suggestions (only if there are no suggestions to show, for example `options` are empty).
921
951
  * @default false
922
952
  */
923
953
  loading: PropTypes.bool,
@@ -191,7 +191,7 @@ process.env.NODE_ENV !== "production" ? CircularProgress.propTypes /* remove-pro
191
191
  /**
192
192
  * The size of the component.
193
193
  * If using a number, the pixel unit is assumed.
194
- * If using a string, you need to provide the CSS unit, e.g. '3rem'.
194
+ * If using a string, you need to provide the CSS unit, for example '3rem'.
195
195
  * @default 40
196
196
  */
197
197
  size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -7,6 +7,7 @@ import PropTypes from 'prop-types';
7
7
  import clsx from 'clsx';
8
8
  import integerPropType from '@mui/utils/integerPropType';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
+ import { useRtl } from '@mui/system/RtlProvider';
10
11
  import Modal from '../Modal';
11
12
  import Slide from '../Slide';
12
13
  import Paper from '../Paper';
@@ -113,8 +114,9 @@ var oppositeDirection = {
113
114
  export function isHorizontal(anchor) {
114
115
  return ['left', 'right'].indexOf(anchor) !== -1;
115
116
  }
116
- export function getAnchor(theme, anchor) {
117
- return theme.direction === 'rtl' && isHorizontal(anchor) ? oppositeDirection[anchor] : anchor;
117
+ export function getAnchor(_ref3, anchor) {
118
+ var direction = _ref3.direction;
119
+ return direction === 'rtl' && isHorizontal(anchor) ? oppositeDirection[anchor] : anchor;
118
120
  }
119
121
 
120
122
  /**
@@ -127,6 +129,7 @@ var Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
127
129
  name: 'MuiDrawer'
128
130
  });
129
131
  var theme = useTheme();
132
+ var isRtl = useRtl();
130
133
  var defaultTransitionDuration = {
131
134
  enter: theme.transitions.duration.enteringScreen,
132
135
  exit: theme.transitions.duration.leavingScreen
@@ -163,7 +166,9 @@ var Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
163
166
  React.useEffect(function () {
164
167
  mounted.current = true;
165
168
  }, []);
166
- var anchorInvariant = getAnchor(theme, anchorProp);
169
+ var anchorInvariant = getAnchor({
170
+ direction: isRtl ? 'rtl' : 'ltr'
171
+ }, anchorProp);
167
172
  var anchor = anchorProp;
168
173
  var ownerState = _extends({}, props, {
169
174
  anchor: anchor,
@@ -102,7 +102,7 @@ process.env.NODE_ENV !== "production" ? Icon.propTypes /* remove-proptypes */ =
102
102
  // └─────────────────────────────────────────────────────────────────────┘
103
103
  /**
104
104
  * The base class applied to the icon. Defaults to 'material-icons', but can be changed to any
105
- * other base class that suits the icon font you're using (e.g. material-icons-rounded, fas, etc).
105
+ * other base class that suits the icon font you're using (for example material-icons-rounded, fas, etc).
106
106
  * @default 'material-icons'
107
107
  */
108
108
  baseClassName: PropTypes.string,
@@ -10,8 +10,8 @@ import clsx from 'clsx';
10
10
  import composeClasses from '@mui/utils/composeClasses';
11
11
  import { keyframes, css } from '@mui/system';
12
12
  import { darken, lighten } from '@mui/system/colorManipulator';
13
+ import { useRtl } from '@mui/system/RtlProvider';
13
14
  import capitalize from '../utils/capitalize';
14
- import useTheme from '../styles/useTheme';
15
15
  import styled from '../styles/styled';
16
16
  import useThemeProps from '../styles/useThemeProps';
17
17
  import { getLinearProgressUtilityClass } from './linearProgressClasses';
@@ -190,7 +190,7 @@ var LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inPro
190
190
  variant: variant
191
191
  });
192
192
  var classes = useUtilityClasses(ownerState);
193
- var theme = useTheme();
193
+ var isRtl = useRtl();
194
194
  var rootProps = {};
195
195
  var inlineStyles = {
196
196
  bar1: {},
@@ -202,7 +202,7 @@ var LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inPro
202
202
  rootProps['aria-valuemin'] = 0;
203
203
  rootProps['aria-valuemax'] = 100;
204
204
  var transform = value - 100;
205
- if (theme.direction === 'rtl') {
205
+ if (isRtl) {
206
206
  transform = -transform;
207
207
  }
208
208
  inlineStyles.bar1.transform = "translateX(".concat(transform, "%)");
@@ -213,7 +213,7 @@ var LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inPro
213
213
  if (variant === 'buffer') {
214
214
  if (valueBuffer !== undefined) {
215
215
  var _transform = (valueBuffer || 0) - 100;
216
- if (theme.direction === 'rtl') {
216
+ if (isRtl) {
217
217
  _transform = -_transform;
218
218
  }
219
219
  inlineStyles.bar2.transform = "translateX(".concat(_transform, "%)");
@@ -9,10 +9,10 @@ import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import { useSlotProps } from '@mui/base/utils';
11
11
  import HTMLElementType from '@mui/utils/HTMLElementType';
12
+ import { useRtl } from '@mui/system/RtlProvider';
12
13
  import MenuList from '../MenuList';
13
14
  import Popover, { PopoverPaper } from '../Popover';
14
15
  import styled, { rootShouldForwardProp } from '../styles/styled';
15
- import useTheme from '../styles/useTheme';
16
16
  import useThemeProps from '../styles/useThemeProps';
17
17
  import { getMenuUtilityClass } from './menuClasses';
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -99,8 +99,7 @@ var Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
99
99
  _props$slotProps = props.slotProps,
100
100
  slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
101
101
  other = _objectWithoutProperties(props, ["autoFocus", "children", "className", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant", "slots", "slotProps"]);
102
- var theme = useTheme();
103
- var isRtl = theme.direction === 'rtl';
102
+ var isRtl = useRtl();
104
103
  var ownerState = _extends({}, props, {
105
104
  autoFocus: autoFocus,
106
105
  disableAutoFocusItem: disableAutoFocusItem,
@@ -116,7 +115,9 @@ var Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
116
115
  var menuListActionsRef = React.useRef(null);
117
116
  var handleEntering = function handleEntering(element, isAppearing) {
118
117
  if (menuListActionsRef.current) {
119
- menuListActionsRef.current.adjustStyleForScrollbar(element, theme);
118
+ menuListActionsRef.current.adjustStyleForScrollbar(element, {
119
+ direction: isRtl ? 'rtl' : 'ltr'
120
+ });
120
121
  }
121
122
  if (onEntering) {
122
123
  onEntering(element, isAppearing);
@@ -108,13 +108,14 @@ var MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
108
108
  }, [autoFocus]);
109
109
  React.useImperativeHandle(actions, function () {
110
110
  return {
111
- adjustStyleForScrollbar: function adjustStyleForScrollbar(containerElement, theme) {
111
+ adjustStyleForScrollbar: function adjustStyleForScrollbar(containerElement, _ref) {
112
+ var direction = _ref.direction;
112
113
  // Let's ignore that piece of logic if users are already overriding the width
113
114
  // of the menu.
114
115
  var noExplicitWidth = !listRef.current.style.width;
115
116
  if (containerElement.clientHeight < listRef.current.clientHeight && noExplicitWidth) {
116
117
  var scrollbarSize = "".concat(getScrollbarSize(ownerDocument(containerElement)), "px");
117
- listRef.current.style[theme.direction === 'rtl' ? 'paddingLeft' : 'paddingRight'] = scrollbarSize;
118
+ listRef.current.style[direction === 'rtl' ? 'paddingLeft' : 'paddingRight'] = scrollbarSize;
118
119
  listRef.current.style.width = "calc(100% + ".concat(scrollbarSize, ")");
119
120
  }
120
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';
@@ -226,9 +226,9 @@ var PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inPro
226
226
  type: type,
227
227
  variant: variant
228
228
  });
229
- var theme = useTheme();
229
+ var isRtl = useRtl();
230
230
  var classes = useUtilityClasses(ownerState);
231
- var normalizedIcons = theme.direction === 'rtl' ? {
231
+ var normalizedIcons = isRtl ? {
232
232
  previous: slots.next || components.next || NavigateNextIcon,
233
233
  next: slots.previous || components.previous || NavigateBeforeIcon,
234
234
  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';
@@ -306,7 +306,7 @@ var Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
306
306
  valueDerived = _useControlled2[0],
307
307
  setValueState = _useControlled2[1];
308
308
  var valueRounded = roundValueToPrecision(valueDerived, precision);
309
- var theme = useTheme();
309
+ var isRtl = useRtl();
310
310
  var _React$useState = React.useState({
311
311
  hover: -1,
312
312
  focus: -1
@@ -342,7 +342,7 @@ var Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
342
342
  left = _rootNode$getBounding.left,
343
343
  containerWidth = _rootNode$getBounding.width;
344
344
  var percent;
345
- if (theme.direction === 'rtl') {
345
+ if (isRtl) {
346
346
  percent = (right - event.clientX) / containerWidth;
347
347
  } else {
348
348
  percent = (event.clientX - left) / containerWidth;