@mui/material 5.11.9 → 5.11.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Autocomplete/Autocomplete.d.ts +3 -1
- package/Avatar/Avatar.js +1 -0
- package/Backdrop/Backdrop.d.ts +8 -0
- package/Backdrop/Backdrop.js +10 -5
- package/Badge/Badge.d.ts +0 -1
- package/Badge/Badge.js +47 -47
- package/CHANGELOG.md +135 -1
- package/Container/Container.js +0 -1
- package/Dialog/DialogContext.d.ts +2 -2
- package/Dialog/DialogContext.js +2 -2
- package/InputBase/InputBase.js +2 -2
- package/InputLabel/InputLabel.js +3 -1
- package/ListSubheader/ListSubheader.js +1 -0
- package/MenuList/MenuList.js +7 -0
- package/Modal/Modal.d.ts +9 -1
- package/Modal/Modal.js +14 -9
- package/OutlinedInput/OutlinedInput.js +1 -1
- package/README.md +0 -2
- package/Rating/Rating.js +2 -2
- package/Select/SelectInput.js +2 -22
- package/Slider/Slider.d.ts +5 -1
- package/Slider/Slider.js +16 -11
- package/Snackbar/Snackbar.js +21 -125
- package/Stack/Stack.d.ts +0 -1
- package/Stack/Stack.js +9 -120
- package/Stack/index.d.ts +3 -0
- package/Stack/index.js +2 -1
- package/Stack/stackClasses.d.ts +6 -0
- package/Stack/stackClasses.js +7 -0
- package/SwipeableDrawer/SwipeableDrawer.js +3 -3
- package/Unstable_Grid2/Grid2.js +2 -3
- package/index.js +1 -1
- package/internal/SwitchBase.js +1 -1
- package/legacy/Avatar/Avatar.js +1 -0
- package/legacy/Backdrop/Backdrop.js +9 -3
- package/legacy/Badge/Badge.js +48 -48
- package/legacy/Container/Container.js +0 -1
- package/legacy/Dialog/DialogContext.js +2 -2
- package/legacy/InputBase/InputBase.js +2 -2
- package/legacy/InputLabel/InputLabel.js +3 -1
- package/legacy/ListSubheader/ListSubheader.js +1 -0
- package/legacy/MenuList/MenuList.js +7 -0
- package/legacy/Modal/Modal.js +14 -9
- package/legacy/OutlinedInput/OutlinedInput.js +1 -1
- package/legacy/Rating/Rating.js +2 -2
- package/legacy/Select/SelectInput.js +2 -22
- package/legacy/Slider/Slider.js +16 -12
- package/legacy/Snackbar/Snackbar.js +20 -119
- package/legacy/Stack/Stack.js +13 -122
- package/legacy/Stack/index.js +2 -1
- package/legacy/Stack/stackClasses.js +7 -0
- package/legacy/SwipeableDrawer/SwipeableDrawer.js +3 -3
- package/legacy/Unstable_Grid2/Grid2.js +2 -3
- package/legacy/index.js +1 -1
- package/legacy/internal/SwitchBase.js +1 -1
- package/legacy/styles/createTheme.js +1 -0
- package/legacy/useAutocomplete/useAutocomplete.js +2 -2
- package/legacy/useMediaQuery/useMediaQuery.js +12 -7
- package/modern/Avatar/Avatar.js +1 -0
- package/modern/Backdrop/Backdrop.js +10 -5
- package/modern/Badge/Badge.js +47 -47
- package/modern/Container/Container.js +0 -1
- package/modern/Dialog/DialogContext.js +2 -2
- package/modern/InputBase/InputBase.js +2 -2
- package/modern/InputLabel/InputLabel.js +3 -1
- package/modern/ListSubheader/ListSubheader.js +1 -0
- package/modern/MenuList/MenuList.js +7 -0
- package/modern/Modal/Modal.js +14 -9
- package/modern/OutlinedInput/OutlinedInput.js +1 -1
- package/modern/Rating/Rating.js +2 -2
- package/modern/Select/SelectInput.js +2 -18
- package/modern/Slider/Slider.js +16 -11
- package/modern/Snackbar/Snackbar.js +21 -125
- package/modern/Stack/Stack.js +9 -120
- package/modern/Stack/index.js +2 -1
- package/modern/Stack/stackClasses.js +7 -0
- package/modern/SwipeableDrawer/SwipeableDrawer.js +3 -3
- package/modern/Unstable_Grid2/Grid2.js +2 -3
- package/modern/index.js +1 -1
- package/modern/internal/SwitchBase.js +1 -1
- package/modern/styles/createTheme.js +1 -0
- package/modern/useAutocomplete/useAutocomplete.js +2 -2
- package/modern/useMediaQuery/useMediaQuery.js +9 -7
- package/node/Avatar/Avatar.js +1 -0
- package/node/Backdrop/Backdrop.js +10 -5
- package/node/Badge/Badge.js +46 -47
- package/node/Container/Container.js +0 -2
- package/node/Dialog/DialogContext.js +4 -2
- package/node/InputBase/InputBase.js +2 -2
- package/node/InputLabel/InputLabel.js +3 -1
- package/node/ListSubheader/ListSubheader.js +1 -0
- package/node/MenuList/MenuList.js +7 -0
- package/node/Modal/Modal.js +14 -9
- package/node/OutlinedInput/OutlinedInput.js +1 -1
- package/node/Rating/Rating.js +2 -2
- package/node/Select/SelectInput.js +2 -22
- package/node/Slider/Slider.js +19 -14
- package/node/Snackbar/Snackbar.js +20 -124
- package/node/Stack/Stack.js +9 -122
- package/node/Stack/index.js +8 -1
- package/node/Stack/stackClasses.js +16 -0
- package/node/SwipeableDrawer/SwipeableDrawer.js +3 -3
- package/node/Unstable_Grid2/Grid2.js +0 -1
- package/node/index.js +1 -1
- package/node/internal/SwitchBase.js +1 -1
- package/node/styles/createTheme.js +1 -0
- package/node/useAutocomplete/useAutocomplete.js +8 -6
- package/node/useMediaQuery/useMediaQuery.js +9 -7
- package/package.json +6 -6
- package/styles/createTheme.js +1 -0
- package/styles/props.d.ts +2 -2
- package/umd/material-ui.development.js +4209 -4241
- package/umd/material-ui.production.min.js +21 -21
- package/useAutocomplete/useAutocomplete.d.ts +2 -2
- package/useAutocomplete/useAutocomplete.js +2 -2
- package/useMediaQuery/useMediaQuery.d.ts +19 -4
- package/useMediaQuery/useMediaQuery.js +9 -7
|
@@ -160,7 +160,9 @@ export interface AutocompleteProps<
|
|
|
160
160
|
/**
|
|
161
161
|
* Props applied to the Listbox element.
|
|
162
162
|
*/
|
|
163
|
-
ListboxProps?: ReturnType<ReturnType<typeof useAutocomplete>['getListboxProps']
|
|
163
|
+
ListboxProps?: ReturnType<ReturnType<typeof useAutocomplete>['getListboxProps']> & {
|
|
164
|
+
sx?: SxProps<Theme>;
|
|
165
|
+
};
|
|
164
166
|
/**
|
|
165
167
|
* If `true`, the component is in a loading state.
|
|
166
168
|
* This shows the `loadingText` in place of suggestions (only if there are no suggestions to show, e.g. `options` are empty).
|
package/Avatar/Avatar.js
CHANGED
package/Backdrop/Backdrop.d.ts
CHANGED
|
@@ -83,6 +83,14 @@ export interface BackdropTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
|
83
83
|
* You may specify a single timeout for all transitions, or individually with an object.
|
|
84
84
|
*/
|
|
85
85
|
transitionDuration?: TransitionProps['timeout'];
|
|
86
|
+
/**
|
|
87
|
+
* The component used for the transition.
|
|
88
|
+
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
89
|
+
* @default Fade
|
|
90
|
+
*/
|
|
91
|
+
TransitionComponent?: React.JSXElementConstructor<
|
|
92
|
+
TransitionProps & { children: React.ReactElement<any, any> }
|
|
93
|
+
>;
|
|
86
94
|
};
|
|
87
95
|
defaultComponent: D;
|
|
88
96
|
}
|
package/Backdrop/Backdrop.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["children", "
|
|
3
|
+
const _excluded = ["children", "className", "component", "components", "componentsProps", "invisible", "open", "slotProps", "slots", "TransitionComponent", "transitionDuration"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -53,17 +53,16 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
|
|
|
53
53
|
});
|
|
54
54
|
const {
|
|
55
55
|
children,
|
|
56
|
+
className,
|
|
56
57
|
component = 'div',
|
|
57
58
|
components = {},
|
|
58
59
|
componentsProps = {},
|
|
59
|
-
className,
|
|
60
60
|
invisible = false,
|
|
61
61
|
open,
|
|
62
62
|
slotProps = {},
|
|
63
63
|
slots = {},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
TransitionComponent = Fade
|
|
64
|
+
TransitionComponent = Fade,
|
|
65
|
+
transitionDuration
|
|
67
66
|
} = props,
|
|
68
67
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
69
68
|
const ownerState = _extends({}, props, {
|
|
@@ -168,6 +167,12 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes /* remove-proptypes *
|
|
|
168
167
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
169
168
|
*/
|
|
170
169
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
170
|
+
/**
|
|
171
|
+
* The component used for the transition.
|
|
172
|
+
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
173
|
+
* @default Fade
|
|
174
|
+
*/
|
|
175
|
+
TransitionComponent: PropTypes.elementType,
|
|
171
176
|
/**
|
|
172
177
|
* The duration for the transition, in milliseconds.
|
|
173
178
|
* You may specify a single timeout for all transitions, or individually with an object.
|
package/Badge/Badge.d.ts
CHANGED
|
@@ -102,7 +102,6 @@ export declare const BadgeMark: React.FC<BadgeBadgeProps>;
|
|
|
102
102
|
* API:
|
|
103
103
|
*
|
|
104
104
|
* - [Badge API](https://mui.com/material-ui/api/badge/)
|
|
105
|
-
* - inherits [BadgeUnstyled API](https://mui.com/base/api/badge-unstyled/)
|
|
106
105
|
*/
|
|
107
106
|
declare const Badge: OverridableComponent<BadgeTypeMap>;
|
|
108
107
|
|
package/Badge/Badge.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["anchorOrigin", "className", "component", "components", "componentsProps", "overlap", "color", "invisible", "max", "badgeContent", "slots", "slotProps", "showZero", "variant"];
|
|
3
|
+
const _excluded = ["anchorOrigin", "className", "classes", "component", "components", "componentsProps", "children", "overlap", "color", "invisible", "max", "badgeContent", "slots", "slotProps", "showZero", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { usePreviousProps } from '@mui/utils';
|
|
8
8
|
import composeClasses from '@mui/base/composeClasses';
|
|
9
|
-
import
|
|
9
|
+
import useBadge from '@mui/base/useBadge';
|
|
10
|
+
import { useSlotProps } from '@mui/base';
|
|
10
11
|
import styled from '../styles/styled';
|
|
11
12
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
|
-
import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
|
|
13
13
|
import capitalize from '../utils/capitalize';
|
|
14
14
|
import badgeClasses, { getBadgeUtilityClass } from './badgeClasses';
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
17
|
const RADIUS_STANDARD = 10;
|
|
17
18
|
const RADIUS_DOT = 4;
|
|
18
19
|
const useUtilityClasses = ownerState => {
|
|
@@ -166,13 +167,14 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
166
167
|
horizontal: 'right'
|
|
167
168
|
},
|
|
168
169
|
className,
|
|
169
|
-
component
|
|
170
|
+
component,
|
|
170
171
|
components = {},
|
|
171
172
|
componentsProps = {},
|
|
173
|
+
children,
|
|
172
174
|
overlap: overlapProp = 'rectangular',
|
|
173
175
|
color: colorProp = 'default',
|
|
174
176
|
invisible: invisibleProp = false,
|
|
175
|
-
max,
|
|
177
|
+
max: maxProp = 99,
|
|
176
178
|
badgeContent: badgeContentProp,
|
|
177
179
|
slots,
|
|
178
180
|
slotProps,
|
|
@@ -180,73 +182,71 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
180
182
|
variant: variantProp = 'standard'
|
|
181
183
|
} = props,
|
|
182
184
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
185
|
+
const {
|
|
186
|
+
badgeContent,
|
|
187
|
+
invisible: invisibleFromHook,
|
|
188
|
+
max,
|
|
189
|
+
displayValue: displayValueFromHook
|
|
190
|
+
} = useBadge({
|
|
191
|
+
max: maxProp,
|
|
192
|
+
invisible: invisibleProp,
|
|
193
|
+
badgeContent: badgeContentProp,
|
|
194
|
+
showZero
|
|
195
|
+
});
|
|
183
196
|
const prevProps = usePreviousProps({
|
|
184
197
|
anchorOrigin: anchorOriginProp,
|
|
185
198
|
color: colorProp,
|
|
186
199
|
overlap: overlapProp,
|
|
187
|
-
variant: variantProp
|
|
200
|
+
variant: variantProp,
|
|
201
|
+
badgeContent: badgeContentProp
|
|
188
202
|
});
|
|
189
|
-
|
|
190
|
-
if (invisibleProp === false && (badgeContentProp === 0 && !showZero || badgeContentProp == null && variantProp !== 'dot')) {
|
|
191
|
-
invisible = true;
|
|
192
|
-
}
|
|
203
|
+
const invisible = invisibleFromHook || badgeContent == null && variantProp !== 'dot';
|
|
193
204
|
const {
|
|
194
205
|
color = colorProp,
|
|
195
206
|
overlap = overlapProp,
|
|
196
207
|
anchorOrigin = anchorOriginProp,
|
|
197
208
|
variant = variantProp
|
|
198
209
|
} = invisible ? prevProps : props;
|
|
210
|
+
const displayValue = variant !== 'dot' ? displayValueFromHook : undefined;
|
|
199
211
|
const ownerState = _extends({}, props, {
|
|
200
|
-
|
|
212
|
+
badgeContent,
|
|
201
213
|
invisible,
|
|
214
|
+
max,
|
|
215
|
+
displayValue,
|
|
216
|
+
showZero,
|
|
217
|
+
anchorOrigin,
|
|
202
218
|
color,
|
|
203
219
|
overlap,
|
|
204
220
|
variant
|
|
205
221
|
});
|
|
206
222
|
const classes = useUtilityClasses(ownerState);
|
|
207
|
-
let displayValue;
|
|
208
|
-
if (variant !== 'dot') {
|
|
209
|
-
displayValue = badgeContentProp && Number(badgeContentProp) > max ? `${max}+` : badgeContentProp;
|
|
210
|
-
}
|
|
211
223
|
|
|
212
224
|
// support both `slots` and `components` for backward compatibility
|
|
213
225
|
const RootSlot = (_ref = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components.Root) != null ? _ref : BadgeRoot;
|
|
214
226
|
const BadgeSlot = (_ref2 = (_slots$badge = slots == null ? void 0 : slots.badge) != null ? _slots$badge : components.Badge) != null ? _ref2 : BadgeBadge;
|
|
215
227
|
const rootSlotProps = (_slotProps$root = slotProps == null ? void 0 : slotProps.root) != null ? _slotProps$root : componentsProps.root;
|
|
216
228
|
const badgeSlotProps = (_slotProps$badge = slotProps == null ? void 0 : slotProps.badge) != null ? _slotProps$badge : componentsProps.badge;
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
root: RootSlot,
|
|
225
|
-
badge: BadgeSlot
|
|
226
|
-
},
|
|
227
|
-
className: clsx(rootSlotProps == null ? void 0 : rootSlotProps.className, classes.root, className),
|
|
228
|
-
slotProps: {
|
|
229
|
-
root: _extends({}, rootSlotProps, shouldSpreadAdditionalProps(RootSlot) && {
|
|
230
|
-
as: component,
|
|
231
|
-
ownerState: _extends({}, rootSlotProps == null ? void 0 : rootSlotProps.ownerState, {
|
|
232
|
-
anchorOrigin,
|
|
233
|
-
color,
|
|
234
|
-
overlap,
|
|
235
|
-
variant
|
|
236
|
-
})
|
|
237
|
-
}),
|
|
238
|
-
badge: _extends({}, badgeSlotProps, {
|
|
239
|
-
className: clsx(classes.badge, badgeSlotProps == null ? void 0 : badgeSlotProps.className)
|
|
240
|
-
}, shouldSpreadAdditionalProps(BadgeSlot) && {
|
|
241
|
-
ownerState: _extends({}, badgeSlotProps == null ? void 0 : badgeSlotProps.ownerState, {
|
|
242
|
-
anchorOrigin,
|
|
243
|
-
color,
|
|
244
|
-
overlap,
|
|
245
|
-
variant
|
|
246
|
-
})
|
|
247
|
-
})
|
|
229
|
+
const rootProps = useSlotProps({
|
|
230
|
+
elementType: RootSlot,
|
|
231
|
+
externalSlotProps: rootSlotProps,
|
|
232
|
+
externalForwardedProps: other,
|
|
233
|
+
additionalProps: {
|
|
234
|
+
ref,
|
|
235
|
+
as: component
|
|
248
236
|
},
|
|
249
|
-
|
|
237
|
+
ownerState,
|
|
238
|
+
className: clsx(rootSlotProps == null ? void 0 : rootSlotProps.className, classes.root, className)
|
|
239
|
+
});
|
|
240
|
+
const badgeProps = useSlotProps({
|
|
241
|
+
elementType: BadgeSlot,
|
|
242
|
+
externalSlotProps: badgeSlotProps,
|
|
243
|
+
ownerState,
|
|
244
|
+
className: clsx(classes.badge, badgeSlotProps == null ? void 0 : badgeSlotProps.className)
|
|
245
|
+
});
|
|
246
|
+
return /*#__PURE__*/_jsxs(RootSlot, _extends({}, rootProps, {
|
|
247
|
+
children: [children, /*#__PURE__*/_jsx(BadgeSlot, _extends({}, badgeProps, {
|
|
248
|
+
children: displayValue
|
|
249
|
+
}))]
|
|
250
250
|
}));
|
|
251
251
|
});
|
|
252
252
|
process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ = {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,139 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 5.11.11
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.11.10..master -->
|
|
6
|
+
|
|
7
|
+
_Feb 27, 2023_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- 📚 added API documentation for the slots in MUI Base and Joy UI by @hbjORbj, for e.g. [SliderUnstyled API](https://mui.com/base/api/slider-unstyled/#slots)
|
|
12
|
+
- other 🐛 bug fixes and 📚 documentation improvements.
|
|
13
|
+
|
|
14
|
+
### `@mui/material@5.11.11`
|
|
15
|
+
|
|
16
|
+
- ​<!-- 30 -->[Autocomplete] Adds `sx` prop to `ListboxProps` type (#36243) @sai6855
|
|
17
|
+
- ​<!-- 11 -->[material] Add global CSS class for `readOnly` prop (#32822) @jrparish
|
|
18
|
+
- ​<!-- 10 -->[Stack][material] Use createStack from the system (#33795) @mnajdova
|
|
19
|
+
- ​<!-- 07 -->[Select] Fix incorrect selecting of first element (#36024) @michaldudak
|
|
20
|
+
- ​<!-- 06 -->[Slider] Miscellaneous improvements (#35941) @ZeeshanTamboli
|
|
21
|
+
- ​<!-- 05 -->[Slider] Remove unnecessary `data-focusvisible` attribute (#36091) @ZeeshanTamboli
|
|
22
|
+
- ​<!-- 04 -->[Snackbar] Replace component logic with `useSnackbar` hook (#36272) @ZeeshanTamboli
|
|
23
|
+
- ​<!-- 03 -->[TextField] Fix floating label position (#36246) @oliviertassinari
|
|
24
|
+
- ​<!-- 13 -->[TextField] Fix floating label position (#36288) @oliviertassinari
|
|
25
|
+
|
|
26
|
+
### `@mui/base@5.0.0-alpha.119`
|
|
27
|
+
|
|
28
|
+
#### Breaking changes
|
|
29
|
+
|
|
30
|
+
- ​<!-- 29 -->[base] Remove `classes` prop from the Base components that have it (#36157) @hbjORbj
|
|
31
|
+
These are the components affected by this change: ModalUnstyled, SliderUnstyled, TablePaginationUnstyled and TablePaginationActionsUnstyled.
|
|
32
|
+
You can replace the `classes` prop by providing the class name prop directly to the prop via `slotProps`. Below is an example of how the migration should look like:
|
|
33
|
+
|
|
34
|
+
```diff
|
|
35
|
+
<TablePaginationUnstyled
|
|
36
|
+
- classes={{ toolbar: 'toolbar-classname', menuItem: 'menuItem-classname' }}
|
|
37
|
+
+ slotProps={{ toolbar: { className: 'toolbar-classname' }, menuItem: { className: 'menuItem-classname'}}}
|
|
38
|
+
/>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- ​<!-- 28 -->[base] Move hooks to their own directories (#36235) @hbjORbj
|
|
42
|
+
Base hooks (e.g., `useSelect`) are no longer exported from `{Component}Unstyled` directories and instead they have their own directories.
|
|
43
|
+
Below is an example of how the migration should look like:
|
|
44
|
+
|
|
45
|
+
```diff
|
|
46
|
+
-import { useBadge } from '@mui/base/BadgeUnstyled';
|
|
47
|
+
+import useBadge from '@mui/base/useBadge';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
You can use this [codemod](https://github.com/mui/material-ui/blob/master/packages/mui-codemod/README.md#base-hook-imports) to help with the migration.
|
|
51
|
+
|
|
52
|
+
#### Changes
|
|
53
|
+
|
|
54
|
+
- ​<!-- 31 -->[Autocomplete] Add docs interface for the hook (#36242) @HeVictor
|
|
55
|
+
- ​<!-- 09 -->[MenuUnstyled] Remove extra useMemo (#36265) @ivp-dev
|
|
56
|
+
- ​<!-- 31 -->[base] Export all slot prop overrides interfaces (#36323) @michaldudak
|
|
57
|
+
|
|
58
|
+
### `@mui/codemod@5.11.11`
|
|
59
|
+
|
|
60
|
+
- ​<!-- 35 -->[base] Codemod for hook directory migration (#36295) @hbjORbj
|
|
61
|
+
|
|
62
|
+
### `@mui/joy@5.0.0-alpha.69`
|
|
63
|
+
|
|
64
|
+
- ​<!-- 15 -->[Joy] Able to remove default tokens from theme types (#36006) @siriwatknp
|
|
65
|
+
- ​<!-- 14 -->[Joy] Fix modal dialog overflow viewport (#36103) @siriwatknp
|
|
66
|
+
- ​<!-- 13 -->[Joy] Select popup should have max-height (#36156) @Vivek-Prajapatii
|
|
67
|
+
- ​<!-- 12 -->[Joy] Fix `ListDivider` to change semantic based on `List` (#36266) @siriwatknp
|
|
68
|
+
|
|
69
|
+
### Docs
|
|
70
|
+
|
|
71
|
+
- ​<!-- 27 -->[docs][base] List slots in API documentation (#36104) @hbjORbj
|
|
72
|
+
- ​<!-- 26 -->[docs] Add missing sandbox adapter deps resolving (#36291) @LukasTy
|
|
73
|
+
- ​<!-- 25 -->[docs] Allow to pass navigation bar banner from outside (#36299) @MBilalShafi
|
|
74
|
+
- ​<!-- 24 -->[docs] Fix code on the Working with Tailwind CSS guide (#36090) @mnajdova
|
|
75
|
+
- ​<!-- 23 -->[docs] Remove See Slots Section text from Material UI slots description (#36284) @hbjORbj
|
|
76
|
+
- ​<!-- 22 -->[docs] Fix emotion warning `:first-child` (#36263) @siriwatknp
|
|
77
|
+
- ​<!-- 21 -->[docs][joy] Improve the descriptions of props in API docs (#36307) @hbjORbj
|
|
78
|
+
- ​<!-- 20 -->[docs][joy] List slots in API documentation (#36271) @hbjORbj
|
|
79
|
+
- ​<!-- 19 -->[docs][joy] Build API documentations (#36008) @hbjORbj
|
|
80
|
+
- ​<!-- 18 -->[examples] Update Next.js examples to use built-in font (#36315) @Juneezee
|
|
81
|
+
- ​<!-- 17 -->[examples] Update curl link in `material-next-ts-v4-v5-migration` example README (#36321) @ZeeshanTamboli
|
|
82
|
+
- ​<!-- 16 -->[examples] Convert Next.js \_document class components to function components (#36109) @ossan-engineer
|
|
83
|
+
|
|
84
|
+
### Core
|
|
85
|
+
|
|
86
|
+
- ​<!-- 08 -->[Rating] Add a comment in Rating component to use `readOnly` state class (#36357) @ZeeshanTamboli
|
|
87
|
+
- ​<!-- 02 -->[website] Fix broken links to role levels (#36333) @oliviertassinari
|
|
88
|
+
- ​<!-- 01 -->[website] Sync gold sponsors (#36312) @oliviertassinari
|
|
89
|
+
|
|
90
|
+
All contributors of this release in alphabetical order: @hbjORbj, @HeVictor, @ivp-dev, @jrparish, @Juneezee, @LukasTy, @MBilalShafi, @michaldudak, @mnajdova, @oliviertassinari, @ossan-engineer, @sai6855, @siriwatknp, @Vivek-Prajapatii, @ZeeshanTamboli
|
|
91
|
+
|
|
92
|
+
## 5.11.10
|
|
93
|
+
|
|
94
|
+
<!-- generated comparing v5.11.9..master -->
|
|
95
|
+
|
|
96
|
+
_Feb 20, 2023_
|
|
97
|
+
|
|
98
|
+
A big thanks to the 11 contributors who made this release possible.
|
|
99
|
+
This release was mostly about 🐛 bug fixes and 📚 documentation improvements.
|
|
100
|
+
|
|
101
|
+
### `@mui/material@5.11.10`
|
|
102
|
+
|
|
103
|
+
- ​<!-- 22 -->[Avatar] Fix ownerState usage with styleOverrides when fallback is used (#36228) @sai6855
|
|
104
|
+
- ​<!-- 21 -->[Badge][material] Replace `BadgeUnstyled` with `useBadge` hook (#36158) @hbjORbj
|
|
105
|
+
- ​<!-- 03 -->[Switch] Fix DOM warning when `type` isn't `checkbox` or `radio` (#36170) @dani-mp
|
|
106
|
+
- ​<!-- 02 -->[TextareaAutosize] Convert code to TypeScript (#35862) @sai6855
|
|
107
|
+
- ​<!-- 01 -->[useMediaQuery] Fix behavior of noSsr with React 18 (#36056) @oliviertassinari
|
|
108
|
+
|
|
109
|
+
### `@mui/joy@5.0.0-alpha.68`
|
|
110
|
+
|
|
111
|
+
- ​<!-- 05 -->[Joy] Add `zIndex` to theme (#36236) @siriwatknp
|
|
112
|
+
- ​<!-- 04 -->[Joy] Remove transition from all components (#35952) @hbjORbj
|
|
113
|
+
|
|
114
|
+
### Docs
|
|
115
|
+
|
|
116
|
+
- ​<!-- 20 -->[docs][base] Fix base Input demos for Safari (#36213) @mj12albert
|
|
117
|
+
- ​<!-- 16 -->[docs] Fix 301 links @oliviertassinari
|
|
118
|
+
- ​<!-- 15 -->[docs] Fix modal transition demos (#36137) @oliviertassinari
|
|
119
|
+
- ​<!-- 14 -->[docs] Update links to pt examples (#36237) @Aleff13
|
|
120
|
+
- ​<!-- 13 -->[docs] Update custom Typography variants example (#36185) @mj12albert
|
|
121
|
+
- ​<!-- 12 -->[docs] Change markdown numbering syntax (#36187) @mj12albert
|
|
122
|
+
- ​<!-- 11 -->[docs] Fix switch alignment in `Disabled tree items` section in Tree View docs (#36217) @PunitSoniME
|
|
123
|
+
- ​<!-- 10 -->[docs] Standardize example names (#36112) @samuelsycamore
|
|
124
|
+
- ​<!-- 09 -->[docs] Fix typo @oliviertassinari
|
|
125
|
+
- ​<!-- 08 -->[docs] Fix markdown table alignments (#36136) @oliviertassinari
|
|
126
|
+
- ​<!-- 07 -->[docs] Small color tweaks to the docs search bar (#36160) @danilo-leal
|
|
127
|
+
- ​<!-- 06 -->[docs][joy] Update class name prefixes in the `Anatomy` section (#36210) @ZeeshanTamboli
|
|
128
|
+
|
|
129
|
+
### Core
|
|
130
|
+
|
|
131
|
+
- ​<!-- 19 -->[core] Migrate nprogress to emotion (#36181) @siriwatknp
|
|
132
|
+
- ​<!-- 18 -->[core] Enforce namespace import for ReactDOM (#36208) @mj12albert
|
|
133
|
+
- ​<!-- 17 -->[core] Fix deploy preview links (#36203) @siriwatknp
|
|
134
|
+
|
|
135
|
+
All contributors of this release in alphabetical order: @Aleff13, @dani-mp, @danilo-leal, @hbjORbj, @mj12albert, @oliviertassinari, @PunitSoniME, @sai6855, @samuelsycamore, @siriwatknp, @ZeeshanTamboli
|
|
136
|
+
|
|
3
137
|
## 5.11.9
|
|
4
138
|
|
|
5
139
|
<!-- generated comparing v5.11.8..master -->
|
|
@@ -3514,7 +3648,7 @@ _Feb 1, 2022_
|
|
|
3514
3648
|
|
|
3515
3649
|
A big thanks to the 22 contributors who made this release possible. Here are some highlights ✨:
|
|
3516
3650
|
|
|
3517
|
-
- 🛠 @goncalovf added an example project using [
|
|
3651
|
+
- 🛠 @goncalovf added an example project using [Material UI with Vite.js](https://github.com/mui/material-ui/tree/master/examples/material-vite) (#28241)
|
|
3518
3652
|
- Number of 🐛 bug fixes and 📚 documentation improvements.
|
|
3519
3653
|
|
|
3520
3654
|
### `@mui/material@5.4.0`
|
package/Container/Container.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
interface DialogContextValue {
|
|
3
3
|
titleId?: string;
|
|
4
4
|
}
|
|
5
|
-
declare const DialogContext:
|
|
5
|
+
declare const DialogContext: React.Context<DialogContextValue>;
|
|
6
6
|
export default DialogContext;
|
package/Dialog/DialogContext.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const DialogContext = /*#__PURE__*/createContext({});
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
const DialogContext = /*#__PURE__*/React.createContext({});
|
|
3
3
|
if (process.env.NODE_ENV !== 'production') {
|
|
4
4
|
DialogContext.displayName = 'DialogContext';
|
|
5
5
|
}
|
package/InputBase/InputBase.js
CHANGED
|
@@ -436,7 +436,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
436
436
|
ref: ref,
|
|
437
437
|
onClick: handleClick
|
|
438
438
|
}, other, {
|
|
439
|
-
className: clsx(classes.root, rootProps.className, className),
|
|
439
|
+
className: clsx(classes.root, rootProps.className, className, readOnly && 'MuiInputBase-readOnly'),
|
|
440
440
|
children: [startAdornment, /*#__PURE__*/_jsx(FormControlContext.Provider, {
|
|
441
441
|
value: null,
|
|
442
442
|
children: /*#__PURE__*/_jsx(Input, _extends({
|
|
@@ -463,7 +463,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
463
463
|
ownerState: _extends({}, ownerState, inputProps.ownerState)
|
|
464
464
|
}, {
|
|
465
465
|
ref: handleInputRef,
|
|
466
|
-
className: clsx(classes.input, inputProps.className),
|
|
466
|
+
className: clsx(classes.input, inputProps.className, readOnly && 'MuiInputBase-readOnly'),
|
|
467
467
|
onBlur: handleBlur,
|
|
468
468
|
onChange: handleChange,
|
|
469
469
|
onFocus: handleFocus
|
package/InputLabel/InputLabel.js
CHANGED
|
@@ -98,7 +98,9 @@ const InputLabelRoot = styled(FormLabel, {
|
|
|
98
98
|
}, ownerState.shrink && {
|
|
99
99
|
userSelect: 'none',
|
|
100
100
|
pointerEvents: 'auto',
|
|
101
|
-
|
|
101
|
+
// Theoretically, we should have (8+5)*2/0.75 = 34px
|
|
102
|
+
// but it feels a better when it bleeds a bit on the left, so 32px.
|
|
103
|
+
maxWidth: 'calc(133% - 32px)',
|
|
102
104
|
transform: 'translate(14px, -9px) scale(0.75)'
|
|
103
105
|
})));
|
|
104
106
|
const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, ref) {
|
|
@@ -87,6 +87,7 @@ const ListSubheader = /*#__PURE__*/React.forwardRef(function ListSubheader(inPro
|
|
|
87
87
|
ownerState: ownerState
|
|
88
88
|
}, other));
|
|
89
89
|
});
|
|
90
|
+
ListSubheader.muiSkipListHighlight = true;
|
|
90
91
|
process.env.NODE_ENV !== "production" ? ListSubheader.propTypes /* remove-proptypes */ = {
|
|
91
92
|
// ----------------------------- Warning --------------------------------
|
|
92
93
|
// | These PropTypes are generated from the TypeScript type definitions |
|
package/MenuList/MenuList.js
CHANGED
|
@@ -194,6 +194,13 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
|
|
|
194
194
|
activeItemIndex = index;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
+
if (activeItemIndex === index && (child.props.disabled || child.props.muiSkipListHighlight || child.type.muiSkipListHighlight)) {
|
|
198
|
+
activeItemIndex += 1;
|
|
199
|
+
if (activeItemIndex >= children.length) {
|
|
200
|
+
// there are no focusable items within the list.
|
|
201
|
+
activeItemIndex = -1;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
197
204
|
});
|
|
198
205
|
const items = React.Children.map(children, (child, index) => {
|
|
199
206
|
if (index === activeItemIndex) {
|
package/Modal/Modal.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
3
|
import { OverrideProps } from '@mui/types';
|
|
4
4
|
import { SlotComponentProps } from '@mui/base';
|
|
5
|
-
import { ModalUnstyledTypeMap } from '@mui/base/ModalUnstyled';
|
|
5
|
+
import { ModalUnstyledTypeMap, ModalUnstyledClasses } from '@mui/base/ModalUnstyled';
|
|
6
6
|
import { Theme } from '../styles';
|
|
7
7
|
import Backdrop, { BackdropProps } from '../Backdrop';
|
|
8
8
|
import { OverridableComponent } from '../OverridableComponent';
|
|
@@ -35,6 +35,14 @@ export interface ModalTypeMap<D extends React.ElementType = 'div', P = {}> {
|
|
|
35
35
|
* @deprecated Use `slotProps.backdrop` instead.
|
|
36
36
|
*/
|
|
37
37
|
BackdropProps?: Partial<BackdropProps>;
|
|
38
|
+
/**
|
|
39
|
+
* Override or extend the styles applied to the component.
|
|
40
|
+
*/
|
|
41
|
+
classes?: Partial<ModalUnstyledClasses>;
|
|
42
|
+
/**
|
|
43
|
+
* @ignore
|
|
44
|
+
*/
|
|
45
|
+
className?: string;
|
|
38
46
|
/**
|
|
39
47
|
* The components used for each slot inside.
|
|
40
48
|
*
|
package/Modal/Modal.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["BackdropComponent", "BackdropProps", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "slotProps", "slots", "theme"];
|
|
3
|
+
const _excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "slotProps", "slots", "theme"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import clsx from 'clsx';
|
|
6
7
|
import ModalUnstyled, { modalUnstyledClasses } from '@mui/base/ModalUnstyled';
|
|
7
8
|
import { isHostComponent, resolveComponentProps } from '@mui/base/utils';
|
|
8
9
|
import { elementAcceptingRef, HTMLElementType } from '@mui/utils';
|
|
@@ -11,9 +12,6 @@ import useThemeProps from '../styles/useThemeProps';
|
|
|
11
12
|
import Backdrop from '../Backdrop';
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
export const modalClasses = modalUnstyledClasses;
|
|
14
|
-
const extendUtilityClasses = ownerState => {
|
|
15
|
-
return ownerState.classes;
|
|
16
|
-
};
|
|
17
15
|
const ModalRoot = styled('div', {
|
|
18
16
|
name: 'MuiModal',
|
|
19
17
|
slot: 'Root',
|
|
@@ -68,6 +66,8 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
68
66
|
const {
|
|
69
67
|
BackdropComponent = ModalBackdrop,
|
|
70
68
|
BackdropProps,
|
|
69
|
+
classes,
|
|
70
|
+
className,
|
|
71
71
|
closeAfterTransition = false,
|
|
72
72
|
children,
|
|
73
73
|
component,
|
|
@@ -102,7 +102,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
102
102
|
const ownerState = _extends({}, props, commonProps, {
|
|
103
103
|
exited
|
|
104
104
|
});
|
|
105
|
-
const classes = extendUtilityClasses(ownerState);
|
|
106
105
|
const RootSlot = (_ref = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components.Root) != null ? _ref : ModalRoot;
|
|
107
106
|
const BackdropSlot = (_ref2 = (_slots$backdrop = slots == null ? void 0 : slots.backdrop) != null ? _slots$backdrop : components.Backdrop) != null ? _ref2 : BackdropComponent;
|
|
108
107
|
const rootSlotProps = (_slotProps$root = slotProps == null ? void 0 : slotProps.root) != null ? _slotProps$root : componentsProps.root;
|
|
@@ -116,15 +115,17 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
116
115
|
root: () => _extends({}, resolveComponentProps(rootSlotProps, ownerState), !isHostComponent(RootSlot) && {
|
|
117
116
|
as: component,
|
|
118
117
|
theme
|
|
118
|
+
}, {
|
|
119
|
+
className: clsx(className, rootSlotProps == null ? void 0 : rootSlotProps.className, classes == null ? void 0 : classes.root, !ownerState.open && ownerState.exited && (classes == null ? void 0 : classes.hidden))
|
|
119
120
|
}),
|
|
120
|
-
backdrop: () => _extends({}, BackdropProps, resolveComponentProps(backdropSlotProps, ownerState)
|
|
121
|
+
backdrop: () => _extends({}, BackdropProps, resolveComponentProps(backdropSlotProps, ownerState), {
|
|
122
|
+
className: clsx(backdropSlotProps == null ? void 0 : backdropSlotProps.className, classes == null ? void 0 : classes.backdrop)
|
|
123
|
+
})
|
|
121
124
|
},
|
|
122
125
|
onTransitionEnter: () => setExited(false),
|
|
123
126
|
onTransitionExited: () => setExited(true),
|
|
124
127
|
ref: ref
|
|
125
|
-
}, other, {
|
|
126
|
-
classes: classes
|
|
127
|
-
}, commonProps, {
|
|
128
|
+
}, other, commonProps, {
|
|
128
129
|
children: children
|
|
129
130
|
}));
|
|
130
131
|
});
|
|
@@ -161,6 +162,10 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes /* remove-proptypes */ =
|
|
|
161
162
|
* Override or extend the styles applied to the component.
|
|
162
163
|
*/
|
|
163
164
|
classes: PropTypes.object,
|
|
165
|
+
/**
|
|
166
|
+
* @ignore
|
|
167
|
+
*/
|
|
168
|
+
className: PropTypes.string,
|
|
164
169
|
/**
|
|
165
170
|
* When set to true the Modal waits until a nested Transition is completed before closing.
|
|
166
171
|
* @default false
|
|
@@ -163,7 +163,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
163
163
|
ownerState: ownerState,
|
|
164
164
|
className: classes.notchedOutline,
|
|
165
165
|
label: label != null && label !== '' && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
166
|
-
children: [label, "\
|
|
166
|
+
children: [label, "\u2009", '*']
|
|
167
167
|
})) : label,
|
|
168
168
|
notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
|
|
169
169
|
}),
|
package/README.md
CHANGED
|
@@ -132,9 +132,7 @@ via [OpenCollective](https://opencollective.com/mui) or via [Patreon](https://ww
|
|
|
132
132
|
|
|
133
133
|
<p>
|
|
134
134
|
<a href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://avatars.githubusercontent.com/u/30204434?s=192" alt="tidelift.com" title="Enterprise-ready open-source software" loading="lazy" /></a>
|
|
135
|
-
<a href="https://bit.dev/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank" style="margin-rig ht: 16px;"><img height="96" width="96" src="https://avatars.githubusercontent.com/u/24789812?s=192" alt="bit.dev" title="The fastest way to share code" loading="lazy" /></a>
|
|
136
135
|
<a href="https://www.text-em-all.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img src="https://avatars.githubusercontent.com/u/1262264?s=192" alt="text-em-all.com" title="Mass Text Messaging & Automated Calling" height="96" width="96" loading="lazy"></a>
|
|
137
|
-
<a href="https://netticasinohex.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/netticasinohex-com/71d7417/logo/192.png" alt="netticasinohex.com" title="A real giant among casino guides" loading="lazy" /></a>
|
|
138
136
|
<a href="https://megafamous.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://mui.com/static/sponsors/megafamous.png" alt="megafamous.com" title="The best place to buy Instagram followers & likes." loading="lazy" /></a>
|
|
139
137
|
<a href="https://www.dialmycalls.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/dialmycalls/f5ae9ab/avatar/192.png" alt="dialmycalls.com" title="Send text messages, calls & emails to thousands with ease." loading="lazy" /></a>
|
|
140
138
|
<a href="https://goread.io/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/goread_io/eb6337d/logo/192.png" alt="goread.io" title="Instagram followers, likes, power likes, views, comments, saves in minutes." loading="lazy" /></a>
|
package/Rating/Rating.js
CHANGED
|
@@ -46,7 +46,7 @@ const useUtilityClasses = ownerState => {
|
|
|
46
46
|
focusVisible
|
|
47
47
|
} = ownerState;
|
|
48
48
|
const slots = {
|
|
49
|
-
root: ['root', `size${capitalize(size)}`, disabled && 'disabled', focusVisible && 'focusVisible', readOnly && '
|
|
49
|
+
root: ['root', `size${capitalize(size)}`, disabled && 'disabled', focusVisible && 'focusVisible', readOnly && 'readOnly'],
|
|
50
50
|
label: ['label', 'pristine'],
|
|
51
51
|
labelEmptyValue: [emptyValueFocused && 'labelEmptyValueActive'],
|
|
52
52
|
icon: ['icon'],
|
|
@@ -444,7 +444,7 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
|
|
|
444
444
|
ref: handleRef,
|
|
445
445
|
onMouseMove: handleMouseMove,
|
|
446
446
|
onMouseLeave: handleMouseLeave,
|
|
447
|
-
className: clsx(classes.root, className),
|
|
447
|
+
className: clsx(classes.root, className, readOnly && 'MuiRating-readOnly'),
|
|
448
448
|
ownerState: ownerState,
|
|
449
449
|
role: readOnly ? 'img' : null,
|
|
450
450
|
"aria-label": readOnly ? getLabelText(value) : null
|