@mui/material 6.2.1 → 6.3.0

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 (59) hide show
  1. package/AccordionSummary/AccordionSummary.js +4 -3
  2. package/Autocomplete/Autocomplete.js +1 -1
  3. package/Backdrop/Backdrop.js +1 -9
  4. package/CHANGELOG.md +41 -0
  5. package/Collapse/Collapse.js +5 -4
  6. package/Fade/Fade.js +5 -2
  7. package/FilledInput/FilledInput.js +1 -3
  8. package/Grow/Grow.js +5 -2
  9. package/Icon/Icon.js +1 -3
  10. package/Input/Input.js +1 -3
  11. package/OutlinedInput/OutlinedInput.js +1 -3
  12. package/Slide/Slide.js +5 -2
  13. package/StepContent/StepContent.d.ts +31 -2
  14. package/StepContent/StepContent.js +39 -7
  15. package/StepLabel/StepLabel.js +1 -3
  16. package/SvgIcon/SvgIcon.js +1 -3
  17. package/TablePagination/TablePagination.d.ts +134 -18
  18. package/TablePagination/TablePagination.js +89 -33
  19. package/Zoom/Zoom.js +5 -2
  20. package/index.js +1 -1
  21. package/modern/AccordionSummary/AccordionSummary.js +4 -3
  22. package/modern/Autocomplete/Autocomplete.js +1 -1
  23. package/modern/Backdrop/Backdrop.js +1 -9
  24. package/modern/Collapse/Collapse.js +5 -4
  25. package/modern/Fade/Fade.js +5 -2
  26. package/modern/FilledInput/FilledInput.js +1 -3
  27. package/modern/Grow/Grow.js +5 -2
  28. package/modern/Icon/Icon.js +1 -3
  29. package/modern/Input/Input.js +1 -3
  30. package/modern/OutlinedInput/OutlinedInput.js +1 -3
  31. package/modern/Slide/Slide.js +5 -2
  32. package/modern/StepContent/StepContent.js +39 -7
  33. package/modern/StepLabel/StepLabel.js +1 -3
  34. package/modern/SvgIcon/SvgIcon.js +1 -3
  35. package/modern/TablePagination/TablePagination.js +89 -33
  36. package/modern/Zoom/Zoom.js +5 -2
  37. package/modern/index.js +1 -1
  38. package/modern/version/index.js +3 -3
  39. package/node/AccordionSummary/AccordionSummary.js +4 -3
  40. package/node/Autocomplete/Autocomplete.js +1 -1
  41. package/node/Backdrop/Backdrop.js +1 -9
  42. package/node/Collapse/Collapse.js +5 -4
  43. package/node/Fade/Fade.js +5 -2
  44. package/node/FilledInput/FilledInput.js +1 -3
  45. package/node/Grow/Grow.js +5 -2
  46. package/node/Icon/Icon.js +1 -3
  47. package/node/Input/Input.js +1 -3
  48. package/node/OutlinedInput/OutlinedInput.js +1 -3
  49. package/node/Slide/Slide.js +5 -2
  50. package/node/StepContent/StepContent.js +39 -7
  51. package/node/StepLabel/StepLabel.js +1 -3
  52. package/node/SvgIcon/SvgIcon.js +1 -3
  53. package/node/TablePagination/TablePagination.js +89 -33
  54. package/node/Zoom/Zoom.js +5 -2
  55. package/node/index.js +1 -1
  56. package/node/version/index.js +3 -3
  57. package/package.json +5 -5
  58. package/useAutocomplete/useAutocomplete.d.ts +20 -5
  59. package/version/index.js +3 -3
@@ -14,7 +14,6 @@ var _clsx = _interopRequireDefault(require("clsx"));
14
14
  var _integerPropType = _interopRequireDefault(require("@mui/utils/integerPropType"));
15
15
  var _chainPropTypes = _interopRequireDefault(require("@mui/utils/chainPropTypes"));
16
16
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
17
- var _isHostComponent = _interopRequireDefault(require("../utils/isHostComponent"));
18
17
  var _zeroStyled = require("../zero-styled");
19
18
  var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
20
19
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
@@ -26,6 +25,7 @@ var _Toolbar = _interopRequireDefault(require("../Toolbar"));
26
25
  var _TablePaginationActions = _interopRequireDefault(require("./TablePaginationActions"));
27
26
  var _useId = _interopRequireDefault(require("../utils/useId"));
28
27
  var _tablePaginationClasses = _interopRequireWildcard(require("./tablePaginationClasses"));
28
+ var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
29
29
  var _jsxRuntime = require("react/jsx-runtime");
30
30
  var _InputBase;
31
31
  const TablePaginationRoot = (0, _zeroStyled.styled)(_TableCell.default, {
@@ -161,7 +161,6 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
161
161
  const {
162
162
  ActionsComponent = _TablePaginationActions.default,
163
163
  backIconButtonProps,
164
- className,
165
164
  colSpan: colSpanProp,
166
165
  component = _TableCell.default,
167
166
  count,
@@ -198,22 +197,73 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
198
197
  }
199
198
  return rowsPerPage === -1 ? count : Math.min(count, (page + 1) * rowsPerPage);
200
199
  };
201
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(TablePaginationRoot, {
202
- colSpan: colSpan,
203
- ref: ref,
204
- as: component,
205
- ownerState: ownerState,
206
- className: (0, _clsx.default)(classes.root, className),
207
- ...other,
208
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(TablePaginationToolbar, {
209
- className: classes.toolbar,
210
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(TablePaginationSpacer, {
211
- className: classes.spacer
212
- }), rowsPerPageOptions.length > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(TablePaginationSelectLabel, {
213
- className: classes.selectLabel,
214
- id: labelId,
200
+ const externalForwardedProps = {
201
+ slots,
202
+ slotProps
203
+ };
204
+ const [RootSlot, rootSlotProps] = (0, _useSlot.default)('root', {
205
+ ref,
206
+ className: classes.root,
207
+ elementType: TablePaginationRoot,
208
+ externalForwardedProps: {
209
+ ...externalForwardedProps,
210
+ component,
211
+ ...other
212
+ },
213
+ ownerState,
214
+ additionalProps: {
215
+ colSpan
216
+ }
217
+ });
218
+ const [ToolbarSlot, toolbarSlotProps] = (0, _useSlot.default)('toolbar', {
219
+ className: classes.toolbar,
220
+ elementType: TablePaginationToolbar,
221
+ externalForwardedProps,
222
+ ownerState
223
+ });
224
+ const [SpacerSlot, spacerSlotProps] = (0, _useSlot.default)('spacer', {
225
+ className: classes.spacer,
226
+ elementType: TablePaginationSpacer,
227
+ externalForwardedProps,
228
+ ownerState
229
+ });
230
+ const [SelectLabelSlot, selectLabelSlotProps] = (0, _useSlot.default)('selectLabel', {
231
+ className: classes.selectLabel,
232
+ elementType: TablePaginationSelectLabel,
233
+ externalForwardedProps,
234
+ ownerState,
235
+ additionalProps: {
236
+ id: labelId
237
+ }
238
+ });
239
+ const [SelectSlot, selectSlotProps] = (0, _useSlot.default)('select', {
240
+ className: classes.select,
241
+ elementType: TablePaginationSelect,
242
+ externalForwardedProps,
243
+ ownerState
244
+ });
245
+ const [MenuItemSlot, menuItemSlotProps] = (0, _useSlot.default)('menuItem', {
246
+ className: classes.menuItem,
247
+ elementType: MenuItemComponent,
248
+ externalForwardedProps,
249
+ ownerState
250
+ });
251
+ const [DisplayedRows, displayedRowsProps] = (0, _useSlot.default)('displayedRows', {
252
+ className: classes.displayedRows,
253
+ elementType: TablePaginationDisplayedRows,
254
+ externalForwardedProps,
255
+ ownerState
256
+ });
257
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(RootSlot, {
258
+ ...rootSlotProps,
259
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(ToolbarSlot, {
260
+ ...toolbarSlotProps,
261
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SpacerSlot, {
262
+ ...spacerSlotProps
263
+ }), rowsPerPageOptions.length > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectLabelSlot, {
264
+ ...selectLabelSlotProps,
215
265
  children: labelRowsPerPage
216
- }), rowsPerPageOptions.length > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(TablePaginationSelect, {
266
+ }), rowsPerPageOptions.length > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectSlot, {
217
267
  variant: "standard",
218
268
  ...(!selectProps.variant && {
219
269
  input: _InputBase || (_InputBase = /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputBase2.default, {}))
@@ -232,16 +282,14 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
232
282
  icon: (0, _clsx.default)(classes.selectIcon, (selectProps.classes || {}).icon)
233
283
  },
234
284
  disabled: disabled,
235
- children: rowsPerPageOptions.map(rowsPerPageOption => /*#__PURE__*/(0, _react.createElement)(MenuItemComponent, {
236
- ...(!(0, _isHostComponent.default)(MenuItemComponent) && {
237
- ownerState
238
- }),
239
- className: classes.menuItem,
285
+ ...selectSlotProps,
286
+ children: rowsPerPageOptions.map(rowsPerPageOption => /*#__PURE__*/(0, _react.createElement)(MenuItemSlot, {
287
+ ...menuItemSlotProps,
240
288
  key: rowsPerPageOption.label ? rowsPerPageOption.label : rowsPerPageOption,
241
289
  value: rowsPerPageOption.value ? rowsPerPageOption.value : rowsPerPageOption
242
290
  }, rowsPerPageOption.label ? rowsPerPageOption.label : rowsPerPageOption))
243
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(TablePaginationDisplayedRows, {
244
- className: classes.displayedRows,
291
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(DisplayedRows, {
292
+ ...displayedRowsProps,
245
293
  children: labelDisplayedRows({
246
294
  from: count === 0 ? 0 : page * rowsPerPage + 1,
247
295
  to: getLabelDisplayedRowsTo(),
@@ -288,10 +336,6 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
288
336
  * Override or extend the styles applied to the component.
289
337
  */
290
338
  classes: _propTypes.default.object,
291
- /**
292
- * @ignore
293
- */
294
- className: _propTypes.default.string,
295
339
  /**
296
340
  * @ignore
297
341
  */
@@ -415,7 +459,7 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
415
459
  */
416
460
  showLastButton: _propTypes.default.bool,
417
461
  /**
418
- * The props used for each slot inside the TablePagination.
462
+ * The props used for each slot inside.
419
463
  * @default {}
420
464
  */
421
465
  slotProps: _propTypes.default.shape({
@@ -429,11 +473,16 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
429
473
  previousButton: _propTypes.default.object,
430
474
  previousButtonIcon: _propTypes.default.object
431
475
  }),
432
- select: _propTypes.default.object
476
+ displayedRows: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
477
+ menuItem: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
478
+ root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
479
+ select: _propTypes.default.object,
480
+ selectLabel: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
481
+ spacer: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
482
+ toolbar: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
433
483
  }),
434
484
  /**
435
- * The components used for each slot inside the TablePagination.
436
- * Either a string to use a HTML element or a component.
485
+ * The components used for each slot inside.
437
486
  * @default {}
438
487
  */
439
488
  slots: _propTypes.default.shape({
@@ -446,7 +495,14 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
446
495
  nextButtonIcon: _propTypes.default.elementType,
447
496
  previousButton: _propTypes.default.elementType,
448
497
  previousButtonIcon: _propTypes.default.elementType
449
- })
498
+ }),
499
+ displayedRows: _propTypes.default.elementType,
500
+ menuItem: _propTypes.default.elementType,
501
+ root: _propTypes.default.elementType,
502
+ select: _propTypes.default.elementType,
503
+ selectLabel: _propTypes.default.elementType,
504
+ spacer: _propTypes.default.elementType,
505
+ toolbar: _propTypes.default.elementType
450
506
  }),
451
507
  /**
452
508
  * The system prop that allows defining system overrides as well as additional CSS styles.
package/node/Zoom/Zoom.js CHANGED
@@ -121,7 +121,10 @@ const Zoom = /*#__PURE__*/React.forwardRef(function Zoom(props, ref) {
121
121
  addEndListener: handleAddEndListener,
122
122
  timeout: timeout,
123
123
  ...other,
124
- children: (state, childProps) => {
124
+ children: (state, {
125
+ ownerState,
126
+ ...restChildProps
127
+ }) => {
125
128
  return /*#__PURE__*/React.cloneElement(children, {
126
129
  style: {
127
130
  transform: 'scale(0)',
@@ -131,7 +134,7 @@ const Zoom = /*#__PURE__*/React.forwardRef(function Zoom(props, ref) {
131
134
  ...children.props.style
132
135
  },
133
136
  ref: handleRef,
134
- ...childProps
137
+ ...restChildProps
135
138
  });
136
139
  }
137
140
  });
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.2.1
2
+ * @mui/material v6.3.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -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.2.1";
7
+ const version = exports.version = "6.3.0";
8
8
  const major = exports.major = Number("6");
9
- const minor = exports.minor = Number("2");
10
- const patch = exports.patch = Number("1");
9
+ const minor = exports.minor = Number("3");
10
+ const patch = exports.patch = Number("0");
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.2.1",
3
+ "version": "6.3.0",
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.2.1",
39
- "@mui/utils": "^6.2.1",
40
38
  "@mui/types": "^7.2.20",
41
- "@mui/system": "^6.2.1"
39
+ "@mui/utils": "^6.3.0",
40
+ "@mui/system": "^6.3.0",
41
+ "@mui/core-downloads-tracker": "^6.3.0"
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.2.1"
49
+ "@mui/material-pigment-css": "^6.3.0"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "@types/react": {
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { PartiallyRequired } from '@mui/types';
2
3
 
3
4
  export interface CreateFilterOptionsConfig<Value> {
4
5
  ignoreAccents?: boolean;
@@ -178,7 +179,7 @@ export interface UseAutocompleteProps<
178
179
  * If provided, the options will be grouped under the returned string.
179
180
  * The groupBy value is also used as the text for group headings when `renderGroup` is not provided.
180
181
  *
181
- * @param {Value} options The options to group.
182
+ * @param {Value} option The Autocomplete option.
182
183
  * @returns {string}
183
184
  */
184
185
  groupBy?: (option: Value) => string;
@@ -359,8 +360,19 @@ export function useAutocomplete<
359
360
  DisableClearable extends boolean | undefined = false,
360
361
  FreeSolo extends boolean | undefined = false,
361
362
  >(
362
- props: UseAutocompleteProps<Value, Multiple, DisableClearable, FreeSolo>,
363
- ): UseAutocompleteReturnValue<Value, Multiple, DisableClearable, FreeSolo>;
363
+ props: PartiallyRequired<
364
+ UseAutocompleteProps<Value, Multiple, DisableClearable, FreeSolo>,
365
+ 'groupBy'
366
+ >,
367
+ ): UseAutocompleteReturnValue<Value, Multiple, DisableClearable, FreeSolo, true>;
368
+ export function useAutocomplete<
369
+ Value,
370
+ Multiple extends boolean | undefined = false,
371
+ DisableClearable extends boolean | undefined = false,
372
+ FreeSolo extends boolean | undefined = false,
373
+ >(
374
+ props: Omit<UseAutocompleteProps<Value, Multiple, DisableClearable, FreeSolo>, 'groupBy'>,
375
+ ): UseAutocompleteReturnValue<Value, Multiple, DisableClearable, FreeSolo, false>;
364
376
 
365
377
  export interface UseAutocompleteRenderedOption<Value> {
366
378
  option: Value;
@@ -372,6 +384,7 @@ export interface UseAutocompleteReturnValue<
372
384
  Multiple extends boolean | undefined = false,
373
385
  DisableClearable extends boolean | undefined = false,
374
386
  FreeSolo extends boolean | undefined = false,
387
+ HasGroupBy extends boolean = false,
375
388
  > {
376
389
  /**
377
390
  * Resolver for the root slot's props.
@@ -460,9 +473,11 @@ export interface UseAutocompleteReturnValue<
460
473
  */
461
474
  focusedTag: number;
462
475
  /**
463
- * The options to render. It's either `Value[]` or `AutocompleteGroupedOption<Value>[]` if the groupBy prop is provided.
476
+ * The options to render.
477
+ * - If `groupBy` is provided, the options are grouped and represented as `AutocompleteGroupedOption<Value>[]`.
478
+ * - Otherwise, the options are represented as a flat array of `Value[]`.
464
479
  */
465
- groupedOptions: Value[] | Array<AutocompleteGroupedOption<Value>>;
480
+ groupedOptions: HasGroupBy extends true ? AutocompleteGroupedOption<Value>[] : Value[];
466
481
  }
467
482
 
468
483
  export default useAutocomplete;
package/version/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export const version = "6.2.1";
1
+ export const version = "6.3.0";
2
2
  export const major = Number("6");
3
- export const minor = Number("2");
4
- export const patch = Number("1");
3
+ export const minor = Number("3");
4
+ export const patch = Number("0");
5
5
  export const prerelease = undefined;
6
6
  export default version;