@mui/material 5.2.4 → 5.2.8
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.js +3 -1
- package/Avatar/Avatar.d.ts +3 -1
- package/Backdrop/Backdrop.js +3 -1
- package/Badge/Badge.d.ts +25 -0
- package/Badge/Badge.js +29 -9
- package/ButtonGroup/ButtonGroupContext.d.ts +1 -1
- package/CHANGELOG.md +230 -32
- package/FilledInput/FilledInput.js +4 -1
- package/FormControlLabel/FormControlLabel.js +3 -1
- package/Input/Input.js +4 -1
- package/InputBase/InputBase.js +4 -1
- package/InputLabel/InputLabel.js +4 -0
- package/ListItem/ListItem.js +3 -1
- package/Modal/Modal.js +3 -1
- package/README.md +17 -28
- package/Slider/Slider.d.ts +2 -0
- package/Slider/Slider.js +21 -3
- package/StepLabel/StepLabel.js +3 -1
- package/SvgIcon/SvgIcon.d.ts +8 -0
- package/SvgIcon/SvgIcon.js +19 -3
- package/Tabs/Tabs.d.ts +1 -1
- package/TextField/TextField.d.ts +1 -0
- package/TextField/TextField.js +1 -0
- package/Tooltip/Tooltip.js +6 -1
- package/index.js +1 -1
- package/legacy/Autocomplete/Autocomplete.js +3 -1
- package/legacy/Backdrop/Backdrop.js +3 -1
- package/legacy/Badge/Badge.js +34 -10
- package/legacy/FilledInput/FilledInput.js +4 -1
- package/legacy/FormControlLabel/FormControlLabel.js +3 -1
- package/legacy/Input/Input.js +4 -1
- package/legacy/InputBase/InputBase.js +4 -1
- package/legacy/InputLabel/InputLabel.js +4 -0
- package/legacy/ListItem/ListItem.js +3 -1
- package/legacy/Modal/Modal.js +3 -1
- package/legacy/Slider/Slider.js +21 -3
- package/legacy/StepLabel/StepLabel.js +3 -1
- package/legacy/SvgIcon/SvgIcon.js +20 -3
- package/legacy/TextField/TextField.js +1 -0
- package/legacy/Tooltip/Tooltip.js +6 -1
- package/legacy/index.js +1 -1
- package/legacy/locale/index.js +319 -142
- package/locale/index.d.ts +2 -0
- package/locale/index.js +220 -50
- package/modern/Autocomplete/Autocomplete.js +3 -1
- package/modern/Backdrop/Backdrop.js +3 -1
- package/modern/Badge/Badge.js +29 -9
- package/modern/FilledInput/FilledInput.js +4 -1
- package/modern/FormControlLabel/FormControlLabel.js +3 -1
- package/modern/Input/Input.js +4 -1
- package/modern/InputBase/InputBase.js +4 -1
- package/modern/InputLabel/InputLabel.js +4 -0
- package/modern/ListItem/ListItem.js +3 -1
- package/modern/Modal/Modal.js +3 -1
- package/modern/Slider/Slider.js +21 -3
- package/modern/StepLabel/StepLabel.js +3 -1
- package/modern/SvgIcon/SvgIcon.js +19 -3
- package/modern/TextField/TextField.js +1 -0
- package/modern/Tooltip/Tooltip.js +6 -1
- package/modern/index.js +1 -1
- package/modern/locale/index.js +220 -50
- package/node/Autocomplete/Autocomplete.js +3 -1
- package/node/Backdrop/Backdrop.js +3 -1
- package/node/Badge/Badge.js +29 -9
- package/node/FilledInput/FilledInput.js +4 -1
- package/node/FormControlLabel/FormControlLabel.js +3 -1
- package/node/Input/Input.js +4 -1
- package/node/InputBase/InputBase.js +4 -1
- package/node/InputLabel/InputLabel.js +4 -0
- package/node/ListItem/ListItem.js +3 -1
- package/node/Modal/Modal.js +3 -1
- package/node/Slider/Slider.js +21 -3
- package/node/StepLabel/StepLabel.js +3 -1
- package/node/SvgIcon/SvgIcon.js +19 -3
- package/node/TextField/TextField.js +1 -0
- package/node/Tooltip/Tooltip.js +6 -1
- package/node/index.js +1 -1
- package/node/locale/index.js +223 -51
- package/package.json +3 -3
- package/umd/material-ui.development.js +251 -89
- package/umd/material-ui.production.min.js +21 -21
|
@@ -705,7 +705,9 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
705
705
|
* The props used for each slot inside.
|
|
706
706
|
* @default {}
|
|
707
707
|
*/
|
|
708
|
-
componentsProps: PropTypes.
|
|
708
|
+
componentsProps: PropTypes.shape({
|
|
709
|
+
clearIndicator: PropTypes.object
|
|
710
|
+
}),
|
|
709
711
|
|
|
710
712
|
/**
|
|
711
713
|
* The default value. Use when the component is not controlled.
|
package/Avatar/Avatar.d.ts
CHANGED
|
@@ -27,7 +27,9 @@ export interface AvatarTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
|
27
27
|
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes) applied to the `img` element if the component is used to display an image.
|
|
28
28
|
* It can be used to listen for the loading error event.
|
|
29
29
|
*/
|
|
30
|
-
imgProps?: React.ImgHTMLAttributes<HTMLImageElement
|
|
30
|
+
imgProps?: React.ImgHTMLAttributes<HTMLImageElement> & {
|
|
31
|
+
sx?: SxProps<Theme>;
|
|
32
|
+
};
|
|
31
33
|
/**
|
|
32
34
|
* The `sizes` attribute for the `img` element.
|
|
33
35
|
*/
|
package/Backdrop/Backdrop.js
CHANGED
|
@@ -126,7 +126,9 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
|
|
|
126
126
|
* The props used for each slot inside the Backdrop.
|
|
127
127
|
* @default {}
|
|
128
128
|
*/
|
|
129
|
-
componentsProps: PropTypes.
|
|
129
|
+
componentsProps: PropTypes.shape({
|
|
130
|
+
root: PropTypes.object
|
|
131
|
+
}),
|
|
130
132
|
|
|
131
133
|
/**
|
|
132
134
|
* If `true`, the backdrop is invisible.
|
package/Badge/Badge.d.ts
CHANGED
|
@@ -30,6 +30,26 @@ export type BadgeTypeMap<
|
|
|
30
30
|
colorSuccess?: string;
|
|
31
31
|
/** Styles applied to the badge `span` element if `color="warning"`. */
|
|
32
32
|
colorWarning?: string;
|
|
33
|
+
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'right' }} overlap="rectangular"`. */
|
|
34
|
+
anchorOriginTopRightRectangular?: string;
|
|
35
|
+
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'right' }} overlap="rectangular"`. */
|
|
36
|
+
anchorOriginBottomRightRectangular?: string;
|
|
37
|
+
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'left' }} overlap="rectangular"`. */
|
|
38
|
+
anchorOriginTopLeftRectangular?: string;
|
|
39
|
+
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'left' }} overlap="rectangular"`. */
|
|
40
|
+
anchorOriginBottomLeftRectangular?: string;
|
|
41
|
+
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'right' }} overlap="circular"`. */
|
|
42
|
+
anchorOriginTopRightCircular?: string;
|
|
43
|
+
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'right' }} overlap="circular"`. */
|
|
44
|
+
anchorOriginBottomRightCircular?: string;
|
|
45
|
+
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'left' }} overlap="circular"`. */
|
|
46
|
+
anchorOriginTopLeftCircular?: string;
|
|
47
|
+
/** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'left' }} overlap="circular"`. */
|
|
48
|
+
anchorOriginBottomLeftCircular?: string;
|
|
49
|
+
/** Class name applied to the badge `span` element if `overlap="rectangular"`. */
|
|
50
|
+
overlapRectangular?: string;
|
|
51
|
+
/** Class name applied to the badge `span` element if `overlap="circular"`. */
|
|
52
|
+
overlapCircular?: string;
|
|
33
53
|
};
|
|
34
54
|
/**
|
|
35
55
|
* The color of the component. It supports those theme colors that make sense for this component.
|
|
@@ -39,6 +59,11 @@ export type BadgeTypeMap<
|
|
|
39
59
|
'primary' | 'secondary' | 'default' | 'error' | 'info' | 'success' | 'warning',
|
|
40
60
|
BadgePropsColorOverrides
|
|
41
61
|
>;
|
|
62
|
+
/**
|
|
63
|
+
* Wrapped shape the badge should overlap.
|
|
64
|
+
* @default 'rectangular'
|
|
65
|
+
*/
|
|
66
|
+
overlap?: 'rectangular' | 'circular';
|
|
42
67
|
/**
|
|
43
68
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
44
69
|
*/
|
package/Badge/Badge.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 = ["component", "components", "componentsProps", "color", "invisible", "badgeContent", "showZero", "variant"];
|
|
3
|
+
const _excluded = ["anchorOrigin", "component", "components", "componentsProps", "overlap", "color", "invisible", "badgeContent", "showZero", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -11,17 +11,20 @@ import styled from '../styles/styled';
|
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
12
|
import capitalize from '../utils/capitalize';
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
export const badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning'
|
|
14
|
+
export const badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular', // TODO: v6 remove the overlap value from these class keys
|
|
15
|
+
'anchorOriginTopLeftCircular', 'anchorOriginTopLeftRectangular', 'anchorOriginTopRightCircular', 'anchorOriginTopRightRectangular', 'anchorOriginBottomLeftCircular', 'anchorOriginBottomLeftRectangular', 'anchorOriginBottomRightCircular', 'anchorOriginBottomRightRectangular']));
|
|
15
16
|
const RADIUS_STANDARD = 10;
|
|
16
17
|
const RADIUS_DOT = 4;
|
|
17
18
|
|
|
18
19
|
const extendUtilityClasses = ownerState => {
|
|
19
20
|
const {
|
|
20
21
|
color,
|
|
22
|
+
anchorOrigin,
|
|
23
|
+
overlap,
|
|
21
24
|
classes = {}
|
|
22
25
|
} = ownerState;
|
|
23
26
|
return _extends({}, classes, {
|
|
24
|
-
badge: clsx(classes.badge, color !== 'default' && [getBadgeUtilityClass(`color${capitalize(color)}`), classes[`color${capitalize(color)}`]])
|
|
27
|
+
badge: clsx(classes.badge, getBadgeUtilityClass(`anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}${capitalize(overlap)}`), getBadgeUtilityClass(`overlap${capitalize(overlap)}`), color !== 'default' && [getBadgeUtilityClass(`color${capitalize(color)}`), classes[`color${capitalize(color)}`]])
|
|
25
28
|
});
|
|
26
29
|
};
|
|
27
30
|
|
|
@@ -163,9 +166,14 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
163
166
|
});
|
|
164
167
|
|
|
165
168
|
const {
|
|
169
|
+
anchorOrigin: anchorOriginProp = {
|
|
170
|
+
vertical: 'top',
|
|
171
|
+
horizontal: 'right'
|
|
172
|
+
},
|
|
166
173
|
component = 'span',
|
|
167
174
|
components = {},
|
|
168
175
|
componentsProps = {},
|
|
176
|
+
overlap: overlapProp = 'rectangular',
|
|
169
177
|
color: colorProp = 'default',
|
|
170
178
|
invisible: invisibleProp,
|
|
171
179
|
badgeContent: badgeContentProp,
|
|
@@ -175,7 +183,9 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
175
183
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
176
184
|
|
|
177
185
|
const prevProps = usePreviousProps({
|
|
178
|
-
|
|
186
|
+
anchorOrigin: anchorOriginProp,
|
|
187
|
+
color: colorProp,
|
|
188
|
+
overlap: overlapProp
|
|
179
189
|
});
|
|
180
190
|
let invisible = invisibleProp;
|
|
181
191
|
|
|
@@ -184,16 +194,21 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
184
194
|
}
|
|
185
195
|
|
|
186
196
|
const {
|
|
187
|
-
color = colorProp
|
|
197
|
+
color = colorProp,
|
|
198
|
+
overlap = overlapProp,
|
|
199
|
+
anchorOrigin = anchorOriginProp
|
|
188
200
|
} = invisible ? prevProps : props;
|
|
189
201
|
|
|
190
202
|
const ownerState = _extends({}, props, {
|
|
203
|
+
anchorOrigin,
|
|
191
204
|
invisible,
|
|
192
|
-
color
|
|
205
|
+
color,
|
|
206
|
+
overlap
|
|
193
207
|
});
|
|
194
208
|
|
|
195
209
|
const classes = extendUtilityClasses(ownerState);
|
|
196
210
|
return /*#__PURE__*/_jsx(BadgeUnstyled, _extends({
|
|
211
|
+
anchorOrigin: anchorOrigin,
|
|
197
212
|
invisible: invisibleProp,
|
|
198
213
|
badgeContent: badgeContentProp,
|
|
199
214
|
showZero: showZero,
|
|
@@ -207,12 +222,14 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
207
222
|
root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
|
|
208
223
|
as: component,
|
|
209
224
|
ownerState: _extends({}, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.ownerState, {
|
|
210
|
-
color
|
|
225
|
+
color,
|
|
226
|
+
overlap
|
|
211
227
|
})
|
|
212
228
|
}),
|
|
213
229
|
badge: _extends({}, componentsProps.badge, shouldSpreadAdditionalProps(components.Badge) && {
|
|
214
230
|
ownerState: _extends({}, (_componentsProps$badg = componentsProps.badge) == null ? void 0 : _componentsProps$badg.ownerState, {
|
|
215
|
-
color
|
|
231
|
+
color,
|
|
232
|
+
overlap
|
|
216
233
|
})
|
|
217
234
|
})
|
|
218
235
|
},
|
|
@@ -283,7 +300,10 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
283
300
|
* The props used for each slot inside the Badge.
|
|
284
301
|
* @default {}
|
|
285
302
|
*/
|
|
286
|
-
componentsProps: PropTypes.
|
|
303
|
+
componentsProps: PropTypes.shape({
|
|
304
|
+
badge: PropTypes.object,
|
|
305
|
+
root: PropTypes.object
|
|
306
|
+
}),
|
|
287
307
|
|
|
288
308
|
/**
|
|
289
309
|
* If `true`, the badge is invisible.
|