@mui/material 6.4.10 → 6.4.12

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.
@@ -17,6 +17,7 @@ var _DefaultPropsProvider = require("../DefaultPropsProvider");
17
17
  var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
18
18
  var _unsupportedProp = _interopRequireDefault(require("../utils/unsupportedProp"));
19
19
  var _bottomNavigationActionClasses = _interopRequireWildcard(require("./bottomNavigationActionClasses"));
20
+ var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
20
21
  var _jsxRuntime = require("react/jsx-runtime");
21
22
  const useUtilityClasses = ownerState => {
22
23
  const {
@@ -114,6 +115,8 @@ const BottomNavigationAction = /*#__PURE__*/React.forwardRef(function BottomNavi
114
115
  selected,
115
116
  showLabel,
116
117
  value,
118
+ slots = {},
119
+ slotProps = {},
117
120
  ...other
118
121
  } = props;
119
122
  const ownerState = props;
@@ -126,16 +129,41 @@ const BottomNavigationAction = /*#__PURE__*/React.forwardRef(function BottomNavi
126
129
  onClick(event);
127
130
  }
128
131
  };
129
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(BottomNavigationActionRoot, {
130
- ref: ref,
132
+ const externalForwardedProps = {
133
+ slots,
134
+ slotProps
135
+ };
136
+ const [RootSlot, rootProps] = (0, _useSlot.default)('root', {
137
+ elementType: BottomNavigationActionRoot,
138
+ externalForwardedProps: {
139
+ ...externalForwardedProps,
140
+ ...other
141
+ },
142
+ shouldForwardComponentProp: true,
143
+ ownerState,
144
+ ref,
131
145
  className: (0, _clsx.default)(classes.root, className),
132
- focusRipple: true,
133
- onClick: handleChange,
134
- ownerState: ownerState,
135
- ...other,
136
- children: [icon, /*#__PURE__*/(0, _jsxRuntime.jsx)(BottomNavigationActionLabel, {
137
- className: classes.label,
138
- ownerState: ownerState,
146
+ additionalProps: {
147
+ focusRipple: true
148
+ },
149
+ getSlotProps: handlers => ({
150
+ ...handlers,
151
+ onClick: event => {
152
+ handlers.onClick?.(event);
153
+ handleChange(event);
154
+ }
155
+ })
156
+ });
157
+ const [LabelSlot, labelProps] = (0, _useSlot.default)('label', {
158
+ elementType: BottomNavigationActionLabel,
159
+ externalForwardedProps,
160
+ ownerState,
161
+ className: classes.label
162
+ });
163
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
164
+ ...rootProps,
165
+ children: [icon, /*#__PURE__*/(0, _jsxRuntime.jsx)(LabelSlot, {
166
+ ...labelProps,
139
167
  children: label
140
168
  })]
141
169
  });
@@ -182,6 +210,22 @@ process.env.NODE_ENV !== "production" ? BottomNavigationAction.propTypes /* remo
182
210
  * The prop defaults to the value (`false`) inherited from the parent BottomNavigation component.
183
211
  */
184
212
  showLabel: _propTypes.default.bool,
213
+ /**
214
+ * The props used for each slot inside.
215
+ * @default {}
216
+ */
217
+ slotProps: _propTypes.default.shape({
218
+ label: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
219
+ root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
220
+ }),
221
+ /**
222
+ * The components used for each slot inside.
223
+ * @default {}
224
+ */
225
+ slots: _propTypes.default.shape({
226
+ label: _propTypes.default.elementType,
227
+ root: _propTypes.default.elementType
228
+ }),
185
229
  /**
186
230
  * The system prop that allows defining system overrides as well as additional CSS styles.
187
231
  */
@@ -16,6 +16,7 @@ var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
16
16
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
17
17
  var _cardActionAreaClasses = _interopRequireWildcard(require("./cardActionAreaClasses"));
18
18
  var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
19
+ var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
19
20
  var _jsxRuntime = require("react/jsx-runtime");
20
21
  const useUtilityClasses = ownerState => {
21
22
  const {
@@ -79,19 +80,41 @@ const CardActionArea = /*#__PURE__*/React.forwardRef(function CardActionArea(inP
79
80
  children,
80
81
  className,
81
82
  focusVisibleClassName,
83
+ slots = {},
84
+ slotProps = {},
82
85
  ...other
83
86
  } = props;
84
87
  const ownerState = props;
85
88
  const classes = useUtilityClasses(ownerState);
86
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardActionAreaRoot, {
89
+ const externalForwardedProps = {
90
+ slots,
91
+ slotProps
92
+ };
93
+ const [RootSlot, rootProps] = (0, _useSlot.default)('root', {
94
+ elementType: CardActionAreaRoot,
95
+ externalForwardedProps: {
96
+ ...externalForwardedProps,
97
+ ...other
98
+ },
99
+ shouldForwardComponentProp: true,
100
+ ownerState,
101
+ ref,
87
102
  className: (0, _clsx.default)(classes.root, className),
88
- focusVisibleClassName: (0, _clsx.default)(focusVisibleClassName, classes.focusVisible),
89
- ref: ref,
90
- ownerState: ownerState,
91
- ...other,
92
- children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(CardActionAreaFocusHighlight, {
93
- className: classes.focusHighlight,
94
- ownerState: ownerState
103
+ additionalProps: {
104
+ focusVisibleClassName: (0, _clsx.default)(focusVisibleClassName, classes.focusVisible)
105
+ }
106
+ });
107
+ const [FocusHighlightSlot, focusHighlightProps] = (0, _useSlot.default)('focusHighlight', {
108
+ elementType: CardActionAreaFocusHighlight,
109
+ externalForwardedProps,
110
+ ownerState,
111
+ ref,
112
+ className: classes.focusHighlight
113
+ });
114
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
115
+ ...rootProps,
116
+ children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(FocusHighlightSlot, {
117
+ ...focusHighlightProps
95
118
  })]
96
119
  });
97
120
  });
@@ -116,6 +139,22 @@ process.env.NODE_ENV !== "production" ? CardActionArea.propTypes /* remove-propt
116
139
  * @ignore
117
140
  */
118
141
  focusVisibleClassName: _propTypes.default.string,
142
+ /**
143
+ * The props used for each slot inside.
144
+ * @default {}
145
+ */
146
+ slotProps: _propTypes.default.shape({
147
+ focusHighlight: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
148
+ root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
149
+ }),
150
+ /**
151
+ * The components used for each slot inside.
152
+ * @default {}
153
+ */
154
+ slots: _propTypes.default.shape({
155
+ focusHighlight: _propTypes.default.elementType,
156
+ root: _propTypes.default.elementType
157
+ }),
119
158
  /**
120
159
  * The system prop that allows defining system overrides as well as additional CSS styles.
121
160
  */
@@ -21,6 +21,7 @@ var _createSimplePaletteValueFilter = _interopRequireDefault(require("../utils/c
21
21
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
22
22
  var _outlinedInputClasses = _interopRequireWildcard(require("./outlinedInputClasses"));
23
23
  var _InputBase = _interopRequireWildcard(require("../InputBase/InputBase"));
24
+ var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
24
25
  var _jsxRuntime = require("react/jsx-runtime");
25
26
  const useUtilityClasses = ownerState => {
26
27
  const {
@@ -185,7 +186,6 @@ const OutlinedInputInput = (0, _zeroStyled.styled)(_InputBase.InputBaseInput, {
185
186
  }]
186
187
  })));
187
188
  const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps, ref) {
188
- var _React$Fragment;
189
189
  const props = (0, _DefaultPropsProvider.useDefaultProps)({
190
190
  props: inProps,
191
191
  name: 'MuiOutlinedInput'
@@ -198,6 +198,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
198
198
  multiline = false,
199
199
  notched,
200
200
  slots = {},
201
+ slotProps = {},
201
202
  type = 'text',
202
203
  ...other
203
204
  } = props;
@@ -223,17 +224,29 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
223
224
  };
224
225
  const RootSlot = slots.root ?? components.Root ?? OutlinedInputRoot;
225
226
  const InputSlot = slots.input ?? components.Input ?? OutlinedInputInput;
227
+ const [NotchedSlot, notchedProps] = (0, _useSlot.default)('notchedOutline', {
228
+ elementType: NotchedOutlineRoot,
229
+ className: classes.notchedOutline,
230
+ shouldForwardComponentProp: true,
231
+ ownerState,
232
+ externalForwardedProps: {
233
+ slots,
234
+ slotProps
235
+ },
236
+ additionalProps: {
237
+ label: label != null && label !== '' && fcs.required ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
238
+ children: [label, "\u2009", '*']
239
+ }) : label
240
+ }
241
+ });
226
242
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputBase.default, {
227
243
  slots: {
228
244
  root: RootSlot,
229
245
  input: InputSlot
230
246
  },
231
- renderSuffix: state => /*#__PURE__*/(0, _jsxRuntime.jsx)(NotchedOutlineRoot, {
232
- ownerState: ownerState,
233
- className: classes.notchedOutline,
234
- label: label != null && label !== '' && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
235
- children: [label, "\u2009", '*']
236
- })) : label,
247
+ slotProps: slotProps,
248
+ renderSuffix: state => /*#__PURE__*/(0, _jsxRuntime.jsx)(NotchedSlot, {
249
+ ...notchedProps,
237
250
  notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
238
251
  }),
239
252
  fullWidth: fullWidth,
@@ -384,15 +397,22 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes /* remove-propty
384
397
  * Number of rows to display when multiline option is set to true.
385
398
  */
386
399
  rows: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
400
+ /**
401
+ * The props used for each slot inside.
402
+ * @default {}
403
+ */
404
+ slotProps: _propTypes.default.shape({
405
+ input: _propTypes.default.object,
406
+ notchedOutline: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
407
+ root: _propTypes.default.object
408
+ }),
387
409
  /**
388
410
  * The components used for each slot inside.
389
- *
390
- * This prop is an alias for the `components` prop, which will be deprecated in the future.
391
- *
392
411
  * @default {}
393
412
  */
394
413
  slots: _propTypes.default.shape({
395
414
  input: _propTypes.default.elementType,
415
+ notchedOutline: _propTypes.default.elementType,
396
416
  root: _propTypes.default.elementType
397
417
  }),
398
418
  /**
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.4.10
2
+ * @mui/material v6.4.12
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -16,27 +16,27 @@ function ThemeProvider({
16
16
  theme,
17
17
  ...props
18
18
  }) {
19
- if (typeof theme === 'function') {
20
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeProviderNoVars.default, {
21
- theme: theme,
22
- ...props
23
- });
24
- }
25
- const muiTheme = _identifier.default in theme ? theme[_identifier.default] : theme;
26
- if (!('colorSchemes' in muiTheme)) {
27
- if (!('vars' in muiTheme)) {
28
- // For non-CSS variables themes, set `vars` to null to prevent theme inheritance from the upper theme.
29
- // The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
30
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeProviderNoVars.default, {
31
- theme: {
19
+ const noVarsTheme = React.useMemo(() => {
20
+ if (typeof theme === 'function') {
21
+ return theme;
22
+ }
23
+ const muiTheme = _identifier.default in theme ? theme[_identifier.default] : theme;
24
+ if (!('colorSchemes' in muiTheme)) {
25
+ if (!('vars' in muiTheme)) {
26
+ // For non-CSS variables themes, set `vars` to null to prevent theme inheritance from the upper theme.
27
+ // The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
28
+ return {
32
29
  ...theme,
33
30
  vars: null
34
- },
35
- ...props
36
- });
31
+ };
32
+ }
33
+ return theme;
37
34
  }
35
+ return null;
36
+ }, [theme]);
37
+ if (noVarsTheme) {
38
38
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeProviderNoVars.default, {
39
- theme: theme,
39
+ theme: noVarsTheme,
40
40
  ...props
41
41
  });
42
42
  }
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = exports.prerelease = exports.patch = exports.minor = exports.major = exports.default = void 0;
7
- const version = exports.version = "6.4.10";
7
+ const version = exports.version = "6.4.12";
8
8
  const major = exports.major = Number("6");
9
9
  const minor = exports.minor = Number("4");
10
- const patch = exports.patch = Number("10");
10
+ const patch = exports.patch = Number("12");
11
11
  const prerelease = exports.prerelease = undefined;
12
12
  var _default = exports.default = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "6.4.10",
3
+ "version": "6.4.12",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
@@ -35,10 +35,10 @@
35
35
  "prop-types": "^15.8.1",
36
36
  "react-is": "^19.0.0",
37
37
  "react-transition-group": "^4.4.5",
38
- "@mui/core-downloads-tracker": "^6.4.10",
39
- "@mui/utils": "^6.4.9",
40
- "@mui/system": "^6.4.10",
41
- "@mui/types": "~7.2.24"
38
+ "@mui/system": "^6.4.12",
39
+ "@mui/core-downloads-tracker": "^6.4.12",
40
+ "@mui/types": "~7.2.24",
41
+ "@mui/utils": "^6.4.9"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@emotion/react": "^11.5.0",
@@ -46,7 +46,7 @@
46
46
  "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
47
47
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
48
48
  "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
49
- "@mui/material-pigment-css": "^6.4.10"
49
+ "@mui/material-pigment-css": "^6.4.12"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "@types/react": {
@@ -9,27 +9,27 @@ export default function ThemeProvider({
9
9
  theme,
10
10
  ...props
11
11
  }) {
12
- if (typeof theme === 'function') {
13
- return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
14
- theme: theme,
15
- ...props
16
- });
17
- }
18
- const muiTheme = THEME_ID in theme ? theme[THEME_ID] : theme;
19
- if (!('colorSchemes' in muiTheme)) {
20
- if (!('vars' in muiTheme)) {
21
- // For non-CSS variables themes, set `vars` to null to prevent theme inheritance from the upper theme.
22
- // The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
23
- return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
24
- theme: {
12
+ const noVarsTheme = React.useMemo(() => {
13
+ if (typeof theme === 'function') {
14
+ return theme;
15
+ }
16
+ const muiTheme = THEME_ID in theme ? theme[THEME_ID] : theme;
17
+ if (!('colorSchemes' in muiTheme)) {
18
+ if (!('vars' in muiTheme)) {
19
+ // For non-CSS variables themes, set `vars` to null to prevent theme inheritance from the upper theme.
20
+ // The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
21
+ return {
25
22
  ...theme,
26
23
  vars: null
27
- },
28
- ...props
29
- });
24
+ };
25
+ }
26
+ return theme;
30
27
  }
28
+ return null;
29
+ }, [theme]);
30
+ if (noVarsTheme) {
31
31
  return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
32
- theme: theme,
32
+ theme: noVarsTheme,
33
33
  ...props
34
34
  });
35
35
  }
package/version/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export const version = "6.4.10";
1
+ export const version = "6.4.12";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("4");
4
- export const patch = Number("10");
4
+ export const patch = Number("12");
5
5
  export const prerelease = undefined;
6
6
  export default version;