@mui/material 5.10.6 → 5.10.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.
Files changed (82) hide show
  1. package/Button/Button.js +3 -10
  2. package/CHANGELOG.md +78 -0
  3. package/Checkbox/Checkbox.js +12 -3
  4. package/Chip/chipClasses.d.ts +8 -0
  5. package/Chip/chipClasses.js +1 -1
  6. package/DialogContentText/DialogContentText.js +14 -3
  7. package/Fab/Fab.js +5 -2
  8. package/FormControlLabel/FormControlLabel.d.ts +1 -1
  9. package/InputLabel/InputLabel.js +12 -3
  10. package/ListItemButton/ListItemButton.js +10 -3
  11. package/MenuItem/MenuItem.js +10 -3
  12. package/Popover/Popover.js +1 -0
  13. package/Radio/Radio.js +12 -3
  14. package/StepLabel/StepLabel.js +5 -3
  15. package/SvgIcon/SvgIcon.js +2 -2
  16. package/SvgIcon/svgIconClasses.d.ts +2 -0
  17. package/Tooltip/Tooltip.d.ts +2 -2
  18. package/Tooltip/Tooltip.js +3 -5
  19. package/Unstable_TrapFocus/index.d.ts +2 -2
  20. package/Unstable_TrapFocus/index.js +2 -2
  21. package/esm/Button/Button.js +3 -8
  22. package/esm/Checkbox/Checkbox.js +11 -3
  23. package/esm/Chip/chipClasses.js +1 -1
  24. package/esm/DialogContentText/DialogContentText.js +13 -3
  25. package/esm/Fab/Fab.js +5 -2
  26. package/esm/InputLabel/InputLabel.js +11 -3
  27. package/esm/ListItemButton/ListItemButton.js +10 -3
  28. package/esm/MenuItem/MenuItem.js +10 -3
  29. package/esm/Popover/Popover.js +1 -0
  30. package/esm/Radio/Radio.js +11 -3
  31. package/esm/StepLabel/StepLabel.js +5 -3
  32. package/esm/SvgIcon/SvgIcon.js +2 -2
  33. package/esm/Tooltip/Tooltip.js +3 -5
  34. package/esm/Unstable_TrapFocus/index.js +1 -1
  35. package/esm/locale/index.js +81 -1
  36. package/esm/styles/CssVarsProvider.js +3 -1
  37. package/esm/styles/excludeVariablesFromRoot.js +6 -0
  38. package/index.js +1 -1
  39. package/legacy/Button/Button.js +2 -4
  40. package/legacy/Checkbox/Checkbox.js +10 -2
  41. package/legacy/Chip/chipClasses.js +1 -1
  42. package/legacy/DialogContentText/DialogContentText.js +10 -2
  43. package/legacy/Fab/Fab.js +7 -2
  44. package/legacy/InputLabel/InputLabel.js +10 -2
  45. package/legacy/ListItemButton/ListItemButton.js +9 -2
  46. package/legacy/MenuItem/MenuItem.js +9 -2
  47. package/legacy/Popover/Popover.js +1 -0
  48. package/legacy/Radio/Radio.js +10 -2
  49. package/legacy/StepLabel/StepLabel.js +5 -4
  50. package/legacy/SvgIcon/SvgIcon.js +2 -2
  51. package/legacy/Tooltip/Tooltip.js +3 -5
  52. package/legacy/Unstable_TrapFocus/index.js +1 -1
  53. package/legacy/index.js +1 -1
  54. package/legacy/locale/index.js +224 -141
  55. package/legacy/styles/CssVarsProvider.js +3 -1
  56. package/legacy/styles/excludeVariablesFromRoot.js +12 -0
  57. package/locale/index.d.ts +1 -0
  58. package/locale/index.js +83 -2
  59. package/modern/Button/Button.js +3 -8
  60. package/modern/Checkbox/Checkbox.js +11 -3
  61. package/modern/Chip/chipClasses.js +1 -1
  62. package/modern/DialogContentText/DialogContentText.js +13 -3
  63. package/modern/Fab/Fab.js +5 -2
  64. package/modern/InputLabel/InputLabel.js +11 -3
  65. package/modern/ListItemButton/ListItemButton.js +10 -3
  66. package/modern/MenuItem/MenuItem.js +10 -3
  67. package/modern/Popover/Popover.js +1 -0
  68. package/modern/Radio/Radio.js +11 -3
  69. package/modern/StepLabel/StepLabel.js +5 -3
  70. package/modern/SvgIcon/SvgIcon.js +2 -2
  71. package/modern/Tooltip/Tooltip.js +3 -5
  72. package/modern/Unstable_TrapFocus/index.js +1 -1
  73. package/modern/index.js +1 -1
  74. package/modern/locale/index.js +81 -1
  75. package/modern/styles/CssVarsProvider.js +3 -1
  76. package/modern/styles/excludeVariablesFromRoot.js +6 -0
  77. package/package.json +5 -5
  78. package/styles/CssVarsProvider.js +4 -1
  79. package/styles/excludeVariablesFromRoot.d.ts +5 -0
  80. package/styles/excludeVariablesFromRoot.js +14 -0
  81. package/umd/material-ui.development.js +485 -431
  82. package/umd/material-ui.production.min.js +9 -9
package/legacy/Fab/Fab.js CHANGED
@@ -9,7 +9,7 @@ import ButtonBase from '../ButtonBase';
9
9
  import capitalize from '../utils/capitalize';
10
10
  import useThemeProps from '../styles/useThemeProps';
11
11
  import fabClasses, { getFabUtilityClass } from './fabClasses';
12
- import styled from '../styles/styled';
12
+ import styled, { rootShouldForwardProp } from '../styles/styled';
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
 
15
15
  var useUtilityClasses = function useUtilityClasses(ownerState) {
@@ -20,12 +20,16 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
20
20
  var slots = {
21
21
  root: ['root', variant, "size".concat(capitalize(size)), color === 'inherit' ? 'colorInherit' : color]
22
22
  };
23
- return composeClasses(slots, getFabUtilityClass, classes);
23
+ var composedClasses = composeClasses(slots, getFabUtilityClass, classes);
24
+ return _extends({}, classes, composedClasses);
24
25
  };
25
26
 
26
27
  var FabRoot = styled(ButtonBase, {
27
28
  name: 'MuiFab',
28
29
  slot: 'Root',
30
+ shouldForwardProp: function shouldForwardProp(prop) {
31
+ return rootShouldForwardProp(prop) || prop === 'classes';
32
+ },
29
33
  overridesResolver: function overridesResolver(props, styles) {
30
34
  var ownerState = props.ownerState;
31
35
  return [styles.root, styles[ownerState.variant], styles["size".concat(capitalize(ownerState.size))], ownerState.color === 'inherit' && styles.colorInherit, styles[capitalize(ownerState.size)], styles[ownerState.color]];
@@ -151,6 +155,7 @@ var Fab = /*#__PURE__*/React.forwardRef(function Fab(inProps, ref) {
151
155
  ownerState: ownerState,
152
156
  ref: ref
153
157
  }, other, {
158
+ classes: classes,
154
159
  children: children
155
160
  }));
156
161
  });
@@ -4,6 +4,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_composeClasses as composeClasses } from '@mui/base';
7
+ import clsx from 'clsx';
7
8
  import formControlState from '../FormControl/formControlState';
8
9
  import useFormControl from '../FormControl/useFormControl';
9
10
  import FormLabel, { formLabelClasses } from '../FormLabel';
@@ -110,7 +111,8 @@ var InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, ref)
110
111
  margin = props.margin,
111
112
  shrinkProp = props.shrink,
112
113
  variant = props.variant,
113
- other = _objectWithoutProperties(props, ["disableAnimation", "margin", "shrink", "variant"]);
114
+ className = props.className,
115
+ other = _objectWithoutProperties(props, ["disableAnimation", "margin", "shrink", "variant", "className"]);
114
116
 
115
117
  var muiFormControl = useFormControl();
116
118
  var shrink = shrinkProp;
@@ -138,7 +140,8 @@ var InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, ref)
138
140
  return /*#__PURE__*/_jsx(InputLabelRoot, _extends({
139
141
  "data-shrink": shrink,
140
142
  ownerState: ownerState,
141
- ref: ref
143
+ ref: ref,
144
+ className: clsx(classes.root, className)
142
145
  }, other, {
143
146
  classes: classes
144
147
  }));
@@ -161,6 +164,11 @@ process.env.NODE_ENV !== "production" ? InputLabel.propTypes
161
164
  */
162
165
  classes: PropTypes.object,
163
166
 
167
+ /**
168
+ * @ignore
169
+ */
170
+ className: PropTypes.string,
171
+
164
172
  /**
165
173
  * The color of the component.
166
174
  * It supports both default and custom theme colors, which can be added as shown in the
@@ -118,7 +118,8 @@ var ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inPro
118
118
  focusVisibleClassName = props.focusVisibleClassName,
119
119
  _props$selected = props.selected,
120
120
  selected = _props$selected === void 0 ? false : _props$selected,
121
- other = _objectWithoutProperties(props, ["alignItems", "autoFocus", "component", "children", "dense", "disableGutters", "divider", "focusVisibleClassName", "selected"]);
121
+ className = props.className,
122
+ other = _objectWithoutProperties(props, ["alignItems", "autoFocus", "component", "children", "dense", "disableGutters", "divider", "focusVisibleClassName", "selected", "className"]);
122
123
 
123
124
  var context = React.useContext(ListContext);
124
125
  var childContext = {
@@ -154,7 +155,8 @@ var ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inPro
154
155
  href: other.href || other.to,
155
156
  component: (other.href || other.to) && component === 'div' ? 'a' : component,
156
157
  focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),
157
- ownerState: ownerState
158
+ ownerState: ownerState,
159
+ className: clsx(classes.root, className)
158
160
  }, other, {
159
161
  classes: classes,
160
162
  children: children
@@ -193,6 +195,11 @@ process.env.NODE_ENV !== "production" ? ListItemButton.propTypes
193
195
  */
194
196
  classes: PropTypes.object,
195
197
 
198
+ /**
199
+ * @ignore
200
+ */
201
+ className: PropTypes.string,
202
+
196
203
  /**
197
204
  * The component used for the root node.
198
205
  * Either a string to use a HTML element or a component.
@@ -131,7 +131,8 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
131
131
  _props$role = props.role,
132
132
  role = _props$role === void 0 ? 'menuitem' : _props$role,
133
133
  tabIndexProp = props.tabIndex,
134
- other = _objectWithoutProperties(props, ["autoFocus", "component", "dense", "divider", "disableGutters", "focusVisibleClassName", "role", "tabIndex"]);
134
+ className = props.className,
135
+ other = _objectWithoutProperties(props, ["autoFocus", "component", "dense", "divider", "disableGutters", "focusVisibleClassName", "role", "tabIndex", "className"]);
135
136
 
136
137
  var context = React.useContext(ListContext);
137
138
  var childContext = {
@@ -170,7 +171,8 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
170
171
  role: role,
171
172
  tabIndex: tabIndex,
172
173
  component: component,
173
- focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName)
174
+ focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),
175
+ className: clsx(classes.root, className)
174
176
  }, other, {
175
177
  ownerState: ownerState,
176
178
  classes: classes
@@ -202,6 +204,11 @@ process.env.NODE_ENV !== "production" ? MenuItem.propTypes
202
204
  */
203
205
  classes: PropTypes.object,
204
206
 
207
+ /**
208
+ * @ignore
209
+ */
210
+ className: PropTypes.string,
211
+
205
212
  /**
206
213
  * The component used for the root node.
207
214
  * Either a string to use a HTML element or a component.
@@ -334,6 +334,7 @@ var Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
334
334
  }, PaperProps, {
335
335
  ref: handlePaperRef,
336
336
  className: clsx(classes.paper, PaperProps.className),
337
+ ownerState: ownerState,
337
338
  children: children
338
339
  }))
339
340
  }))
@@ -4,6 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
+ import clsx from 'clsx';
7
8
  import { refType } from '@mui/utils';
8
9
  import { unstable_composeClasses as composeClasses } from '@mui/base';
9
10
  import { alpha } from '@mui/system';
@@ -89,7 +90,8 @@ var Radio = /*#__PURE__*/React.forwardRef(function Radio(inProps, ref) {
89
90
  onChangeProp = props.onChange,
90
91
  _props$size = props.size,
91
92
  size = _props$size === void 0 ? 'medium' : _props$size,
92
- other = _objectWithoutProperties(props, ["checked", "checkedIcon", "color", "icon", "name", "onChange", "size"]);
93
+ className = props.className,
94
+ other = _objectWithoutProperties(props, ["checked", "checkedIcon", "color", "icon", "name", "onChange", "size", "className"]);
93
95
 
94
96
  var ownerState = _extends({}, props, {
95
97
  color: color,
@@ -125,7 +127,8 @@ var Radio = /*#__PURE__*/React.forwardRef(function Radio(inProps, ref) {
125
127
  name: name,
126
128
  checked: checked,
127
129
  onChange: onChange,
128
- ref: ref
130
+ ref: ref,
131
+ className: clsx(classes.root, className)
129
132
  }, other));
130
133
  });
131
134
  process.env.NODE_ENV !== "production" ? Radio.propTypes
@@ -152,6 +155,11 @@ process.env.NODE_ENV !== "production" ? Radio.propTypes
152
155
  */
153
156
  classes: PropTypes.object,
154
157
 
158
+ /**
159
+ * @ignore
160
+ */
161
+ className: PropTypes.string,
162
+
155
163
  /**
156
164
  * The color of the component.
157
165
  * It supports both default and custom theme colors, which can be added as shown in the
@@ -26,7 +26,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
26
26
  root: ['root', orientation, error && 'error', disabled && 'disabled', alternativeLabel && 'alternativeLabel'],
27
27
  label: ['label', active && 'active', completed && 'completed', error && 'error', disabled && 'disabled', alternativeLabel && 'alternativeLabel'],
28
28
  iconContainer: ['iconContainer', active && 'active', completed && 'completed', error && 'error', disabled && 'disabled', alternativeLabel && 'alternativeLabel'],
29
- labelContainer: ['labelContainer']
29
+ labelContainer: ['labelContainer', alternativeLabel && 'alternativeLabel']
30
30
  };
31
31
  return composeClasses(slots, getStepLabelUtilityClass, classes);
32
32
  };
@@ -76,7 +76,6 @@ var StepLabelLabel = styled('span', {
76
76
  color: (theme.vars || theme).palette.text.primary,
77
77
  fontWeight: 500
78
78
  }), _defineProperty(_extends3, "&.".concat(stepLabelClasses.alternativeLabel), {
79
- textAlign: 'center',
80
79
  marginTop: 16
81
80
  }), _defineProperty(_extends3, "&.".concat(stepLabelClasses.error), {
82
81
  color: (theme.vars || theme).palette.error.main
@@ -106,10 +105,12 @@ var StepLabelLabelContainer = styled('span', {
106
105
  }
107
106
  })(function (_ref4) {
108
107
  var theme = _ref4.theme;
109
- return {
108
+ return _defineProperty({
110
109
  width: '100%',
111
110
  color: (theme.vars || theme).palette.text.secondary
112
- };
111
+ }, "&.".concat(stepLabelClasses.alternativeLabel), {
112
+ textAlign: 'center'
113
+ });
113
114
  });
114
115
  var StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref) {
115
116
  var props = useThemeProps({
@@ -47,7 +47,7 @@ var SvgIconRoot = styled('svg', {
47
47
  inherit: 'inherit',
48
48
  small: ((_theme$typography = theme.typography) == null ? void 0 : (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',
49
49
  medium: ((_theme$typography2 = theme.typography) == null ? void 0 : (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',
50
- large: ((_theme$typography3 = theme.typography) == null ? void 0 : (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875'
50
+ large: ((_theme$typography3 = theme.typography) == null ? void 0 : (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875rem'
51
51
  }[ownerState.fontSize],
52
52
  // TODO v5 deprecate, v6 remove for sx
53
53
  color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null ? void 0 : (_palette$ownerState$c2 = _palette[ownerState.color]) == null ? void 0 : _palette$ownerState$c2.main) != null ? _palette$ownerState$c : {
@@ -98,13 +98,13 @@ var SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
98
98
  return /*#__PURE__*/_jsxs(SvgIconRoot, _extends({
99
99
  as: component,
100
100
  className: clsx(classes.root, className),
101
- ownerState: ownerState,
102
101
  focusable: "false",
103
102
  color: htmlColor,
104
103
  "aria-hidden": titleAccess ? undefined : true,
105
104
  role: titleAccess ? 'img' : undefined,
106
105
  ref: ref
107
106
  }, more, other, {
107
+ ownerState: ownerState,
108
108
  children: [children, titleAccess ? /*#__PURE__*/_jsx("title", {
109
109
  children: titleAccess
110
110
  }) : null]
@@ -488,7 +488,7 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
488
488
  var handleFocusRef = useForkRef(focusVisibleRef, handleUseRef);
489
489
  var handleRef = useForkRef(children.ref, handleFocusRef); // There is no point in displaying an empty tooltip.
490
490
 
491
- if (title === '') {
491
+ if (typeof title !== 'number' && !title) {
492
492
  open = false;
493
493
  }
494
494
 
@@ -831,11 +831,9 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
831
831
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
832
832
 
833
833
  /**
834
- * Tooltip title. Zero-length titles string are never displayed.
834
+ * Tooltip title. Zero-length titles string, undefined, null and false are never displayed.
835
835
  */
836
- title: PropTypes
837
- /* @typescript-to-proptypes-ignore */
838
- .node.isRequired,
836
+ title: PropTypes.node,
839
837
 
840
838
  /**
841
839
  * The component used for the transition.
@@ -1 +1 @@
1
- export { default } from '@mui/base/TrapFocus';
1
+ export { default } from '@mui/base/FocusTrap';
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.10.6
1
+ /** @license MUI v5.10.8
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.