@mui/material 5.14.20 → 5.15.1

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 (106) hide show
  1. package/AccordionActions/AccordionActions.js +1 -1
  2. package/Autocomplete/Autocomplete.js +4 -5
  3. package/ButtonBase/ButtonBase.js +1 -2
  4. package/ButtonGroup/index.d.ts +2 -0
  5. package/ButtonGroup/index.js +3 -1
  6. package/CHANGELOG.md +102 -2
  7. package/CardActions/CardActions.js +1 -1
  8. package/CircularProgress/CircularProgress.js +0 -1
  9. package/FilledInput/FilledInput.js +0 -2
  10. package/Input/Input.js +0 -2
  11. package/InputBase/InputBase.js +0 -2
  12. package/InputLabel/InputLabel.js +1 -5
  13. package/Link/Link.js +0 -1
  14. package/NativeSelect/NativeSelectInput.js +0 -2
  15. package/Select/SelectInput.js +1 -3
  16. package/TablePagination/TablePagination.d.ts +8 -0
  17. package/TablePagination/TablePagination.js +27 -6
  18. package/TablePagination/TablePaginationActions.d.ts +49 -0
  19. package/TablePagination/TablePaginationActions.js +54 -19
  20. package/Tabs/Tabs.js +0 -1
  21. package/colors/amber.d.ts +0 -1
  22. package/colors/blue.d.ts +0 -1
  23. package/colors/blueGrey.d.ts +0 -1
  24. package/colors/brown.d.ts +0 -1
  25. package/colors/common.d.ts +0 -1
  26. package/colors/cyan.d.ts +0 -1
  27. package/colors/deepOrange.d.ts +0 -1
  28. package/colors/deepPurple.d.ts +0 -1
  29. package/colors/green.d.ts +0 -1
  30. package/colors/grey.d.ts +0 -1
  31. package/colors/indigo.d.ts +0 -1
  32. package/colors/lightBlue.d.ts +0 -1
  33. package/colors/lightGreen.d.ts +0 -1
  34. package/colors/lime.d.ts +0 -1
  35. package/colors/orange.d.ts +0 -1
  36. package/colors/pink.d.ts +0 -1
  37. package/colors/purple.d.ts +0 -1
  38. package/colors/red.d.ts +0 -1
  39. package/colors/teal.d.ts +0 -1
  40. package/colors/yellow.d.ts +0 -1
  41. package/index.js +1 -1
  42. package/legacy/AccordionActions/AccordionActions.js +1 -1
  43. package/legacy/Autocomplete/Autocomplete.js +4 -5
  44. package/legacy/ButtonBase/ButtonBase.js +1 -1
  45. package/legacy/ButtonGroup/index.js +3 -1
  46. package/legacy/CardActions/CardActions.js +1 -1
  47. package/legacy/CircularProgress/CircularProgress.js +0 -1
  48. package/legacy/InputLabel/InputLabel.js +1 -5
  49. package/legacy/NativeSelect/NativeSelectInput.js +0 -2
  50. package/legacy/Select/SelectInput.js +1 -3
  51. package/legacy/TablePagination/TablePagination.js +29 -6
  52. package/legacy/TablePagination/TablePaginationActions.js +56 -19
  53. package/legacy/Tabs/Tabs.js +0 -1
  54. package/legacy/index.js +1 -1
  55. package/legacy/locale/index.js +0 -11
  56. package/legacy/styles/experimental_extendTheme.js +12 -6
  57. package/legacy/useTouchRipple/useTouchRipple.js +1 -1
  58. package/locale/index.js +0 -11
  59. package/modern/AccordionActions/AccordionActions.js +1 -1
  60. package/modern/Autocomplete/Autocomplete.js +4 -5
  61. package/modern/ButtonBase/ButtonBase.js +1 -2
  62. package/modern/ButtonGroup/index.js +3 -1
  63. package/modern/CardActions/CardActions.js +1 -1
  64. package/modern/CircularProgress/CircularProgress.js +0 -1
  65. package/modern/FilledInput/FilledInput.js +0 -2
  66. package/modern/Input/Input.js +0 -2
  67. package/modern/InputBase/InputBase.js +0 -2
  68. package/modern/InputLabel/InputLabel.js +1 -5
  69. package/modern/Link/Link.js +0 -1
  70. package/modern/NativeSelect/NativeSelectInput.js +0 -2
  71. package/modern/Select/SelectInput.js +1 -3
  72. package/modern/TablePagination/TablePagination.js +27 -6
  73. package/modern/TablePagination/TablePaginationActions.js +53 -18
  74. package/modern/Tabs/Tabs.js +0 -1
  75. package/modern/index.js +1 -1
  76. package/modern/locale/index.js +0 -11
  77. package/modern/styles/experimental_extendTheme.js +12 -6
  78. package/modern/useTouchRipple/useTouchRipple.js +1 -1
  79. package/node/AccordionActions/AccordionActions.js +1 -1
  80. package/node/Autocomplete/Autocomplete.js +4 -5
  81. package/node/ButtonBase/ButtonBase.js +1 -2
  82. package/node/ButtonGroup/index.js +17 -1
  83. package/node/CardActions/CardActions.js +1 -1
  84. package/node/CircularProgress/CircularProgress.js +0 -1
  85. package/node/FilledInput/FilledInput.js +0 -2
  86. package/node/Input/Input.js +0 -2
  87. package/node/InputBase/InputBase.js +0 -2
  88. package/node/InputLabel/InputLabel.js +1 -5
  89. package/node/Link/Link.js +0 -1
  90. package/node/NativeSelect/NativeSelectInput.js +0 -2
  91. package/node/Select/SelectInput.js +1 -3
  92. package/node/TablePagination/TablePagination.js +27 -6
  93. package/node/TablePagination/TablePaginationActions.js +54 -19
  94. package/node/Tabs/Tabs.js +0 -1
  95. package/node/index.js +1 -1
  96. package/node/locale/index.js +0 -11
  97. package/node/styles/experimental_extendTheme.js +11 -5
  98. package/node/styles/index.js +1 -0
  99. package/node/useTouchRipple/useTouchRipple.js +1 -1
  100. package/package.json +8 -8
  101. package/styles/components.d.ts +115 -115
  102. package/styles/experimental_extendTheme.js +12 -6
  103. package/styles/variants.d.ts +1 -2
  104. package/umd/material-ui.development.js +111 -73
  105. package/umd/material-ui.production.min.js +20 -20
  106. package/useTouchRipple/useTouchRipple.js +1 -1
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
5
  import { deepmerge } from '@mui/utils';
6
- import { private_safeColorChannel as safeColorChannel, private_safeAlpha as safeAlpha, private_safeDarken as safeDarken, private_safeLighten as safeLighten, private_safeEmphasize as safeEmphasize, unstable_createGetCssVar as systemCreateGetCssVar, unstable_defaultSxConfig as defaultSxConfig, unstable_styleFunctionSx as styleFunctionSx, unstable_prepareCssVars as prepareCssVars } from '@mui/system';
6
+ import { private_safeColorChannel as safeColorChannel, private_safeAlpha as safeAlpha, private_safeDarken as safeDarken, private_safeLighten as safeLighten, private_safeEmphasize as safeEmphasize, unstable_createGetCssVar as systemCreateGetCssVar, unstable_defaultSxConfig as defaultSxConfig, unstable_styleFunctionSx as styleFunctionSx, unstable_prepareCssVars as prepareCssVars, hslToRgb } from '@mui/system';
7
7
  import defaultShouldSkipGeneratingVar from './shouldSkipGeneratingVar';
8
8
  import createThemeWithoutVars from './createTheme';
9
9
  import getOverlayAlpha from './getOverlayAlpha';
@@ -26,11 +26,17 @@ function setColor(obj, key, defaultValue) {
26
26
  obj[key] = defaultValue;
27
27
  }
28
28
  }
29
+ function toRgb(color) {
30
+ if (!color || !color.startsWith('hsl')) {
31
+ return color;
32
+ }
33
+ return hslToRgb(color);
34
+ }
29
35
  function setColorChannel(obj, key) {
30
36
  if (!("".concat(key, "Channel") in obj)) {
31
37
  // custom channel token is not provided, generate one.
32
38
  // if channel token can't be generated, show a warning.
33
- obj["".concat(key, "Channel")] = safeColorChannel(obj[key], "MUI: Can't create `palette.".concat(key, "Channel` because `palette.").concat(key, "` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().") + '\n' + "To suppress this warning, you need to explicitly provide the `palette.".concat(key, "Channel` as a string (in rgb format, e.g. \"12 12 12\") or undefined if you want to remove the channel token."));
39
+ obj["".concat(key, "Channel")] = safeColorChannel(toRgb(obj[key]), "MUI: Can't create `palette.".concat(key, "Channel` because `palette.").concat(key, "` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().") + '\n' + "To suppress this warning, you need to explicitly provide the `palette.".concat(key, "Channel` as a string (in rgb format, e.g. \"12 12 12\") or undefined if you want to remove the channel token."));
34
40
  }
35
41
  }
36
42
  var silent = function silent(fn) {
@@ -270,16 +276,16 @@ export default function extendTheme() {
270
276
  if (colors && _typeof(colors) === 'object') {
271
277
  // Silent the error for custom palettes.
272
278
  if (colors.main) {
273
- setColor(palette[color], 'mainChannel', safeColorChannel(colors.main));
279
+ setColor(palette[color], 'mainChannel', safeColorChannel(toRgb(colors.main)));
274
280
  }
275
281
  if (colors.light) {
276
- setColor(palette[color], 'lightChannel', safeColorChannel(colors.light));
282
+ setColor(palette[color], 'lightChannel', safeColorChannel(toRgb(colors.light)));
277
283
  }
278
284
  if (colors.dark) {
279
- setColor(palette[color], 'darkChannel', safeColorChannel(colors.dark));
285
+ setColor(palette[color], 'darkChannel', safeColorChannel(toRgb(colors.dark)));
280
286
  }
281
287
  if (colors.contrastText) {
282
- setColor(palette[color], 'contrastTextChannel', safeColorChannel(colors.contrastText));
288
+ setColor(palette[color], 'contrastTextChannel', safeColorChannel(toRgb(colors.contrastText)));
283
289
  }
284
290
  if (color === 'text') {
285
291
  // Text colors: text.primary, text.secondary
@@ -36,7 +36,7 @@ var useTouchRipple = function useTouchRipple(props) {
36
36
  });
37
37
  var handleKeyUp = useEventCallback(function (event) {
38
38
  // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
39
- // https://codesandbox.io/s/button-keyup-preventdefault-dn7f0
39
+ // https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0
40
40
  if (!disableFocusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) {
41
41
  keydownRef.current = false;
42
42
  rippleRef.current.stop(event, function () {
package/locale/index.js CHANGED
@@ -317,7 +317,6 @@ export const azAZ = {
317
317
  // `${from}–${to} dən ${count !== -1 ? count : `more than ${to}`}`,
318
318
  }
319
319
  },
320
-
321
320
  MuiRating: {
322
321
  defaultProps: {
323
322
  getLabelText: value => {
@@ -553,7 +552,6 @@ export const bgBG = {
553
552
  // `${from}–${to} от ${count !== -1 ? count : `more than ${to}`}`,
554
553
  }
555
554
  },
556
-
557
555
  MuiRating: {
558
556
  defaultProps: {
559
557
  getLabelText: value => `${value} Звезд${value !== 1 ? 'и' : 'а'}`,
@@ -624,7 +622,6 @@ export const caES = {
624
622
  // `${from}–${to} de ${count !== -1 ? count : `more than ${to}`}`,
625
623
  }
626
624
  },
627
-
628
625
  MuiRating: {
629
626
  defaultProps: {
630
627
  getLabelText: value => `${value} ${value !== 1 ? 'Estrelles' : 'Estrella'}`,
@@ -668,7 +665,6 @@ export const caES = {
668
665
  // },
669
666
  }
670
667
  };
671
-
672
668
  export const csCZ = {
673
669
  components: {
674
670
  MuiBreadcrumbs: {
@@ -1658,7 +1654,6 @@ export const huHU = {
1658
1654
  // `${from}–${to} / ${count !== -1 ? count : `more than ${to}`}`,
1659
1655
  }
1660
1656
  },
1661
-
1662
1657
  MuiRating: {
1663
1658
  defaultProps: {
1664
1659
  getLabelText: value => `${value} Csillag`,
@@ -1729,7 +1724,6 @@ export const hyAM = {
1729
1724
  // `${from}–${to} / ${count !== -1 ? count : `more than ${to}`}`,
1730
1725
  }
1731
1726
  },
1732
-
1733
1727
  MuiRating: {
1734
1728
  defaultProps: {
1735
1729
  getLabelText: value => `${value} Աստղ`,
@@ -1773,7 +1767,6 @@ export const hyAM = {
1773
1767
  // },
1774
1768
  }
1775
1769
  };
1776
-
1777
1770
  export const idID = {
1778
1771
  components: {
1779
1772
  // MuiBreadcrumbs: {
@@ -1801,14 +1794,12 @@ export const idID = {
1801
1794
  // `${from}–${to} dari ${count !== -1 ? count : `more than ${to}`}`,
1802
1795
  }
1803
1796
  },
1804
-
1805
1797
  MuiRating: {
1806
1798
  defaultProps: {
1807
1799
  getLabelText: value => `${value} Bintang`
1808
1800
  // emptyLabelText: 'Empty',
1809
1801
  }
1810
1802
  },
1811
-
1812
1803
  MuiAutocomplete: {
1813
1804
  defaultProps: {
1814
1805
  clearText: 'Hapus',
@@ -1846,7 +1837,6 @@ export const idID = {
1846
1837
  // },
1847
1838
  }
1848
1839
  };
1849
-
1850
1840
  export const isIS = {
1851
1841
  components: {
1852
1842
  MuiBreadcrumbs: {
@@ -3220,7 +3210,6 @@ export const roRO = {
3220
3210
  // `${from}–${to} din ${count !== -1 ? count : `more than ${to}`}`,
3221
3211
  }
3222
3212
  },
3223
-
3224
3213
  MuiRating: {
3225
3214
  defaultProps: {
3226
3215
  getLabelText: value => `${value} St${value !== 1 ? 'ele' : 'ea'}`,
@@ -38,7 +38,7 @@ const AccordionActionsRoot = styled('div', {
38
38
  padding: 8,
39
39
  justifyContent: 'flex-end'
40
40
  }, !ownerState.disableSpacing && {
41
- '& > :not(:first-of-type)': {
41
+ '& > :not(style) ~ :not(style)': {
42
42
  marginLeft: 8
43
43
  }
44
44
  }));
@@ -216,7 +216,6 @@ const AutocompleteEndAdornment = styled('div', {
216
216
  right: 0,
217
217
  top: 'calc(50% - 14px)' // Center vertically
218
218
  });
219
-
220
219
  const AutocompleteClearIndicator = styled(IconButton, {
221
220
  name: 'MuiAutocomplete',
222
221
  slot: 'ClearIndicator',
@@ -657,7 +656,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
657
656
  // | To update them edit the d.ts file and run "yarn proptypes" |
658
657
  // ----------------------------------------------------------------------
659
658
  /**
660
- * If `true`, the portion of the selected suggestion that has not been typed by the user,
659
+ * If `true`, the portion of the selected suggestion that the user hasn't typed,
661
660
  * known as the completion string, appears inline after the input cursor in the textbox.
662
661
  * The inline completion string is visually highlighted and has a selected state.
663
662
  * @default false
@@ -673,7 +672,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
673
672
  * when the Autocomplete loses focus unless the user chooses
674
673
  * a different option or changes the character string in the input.
675
674
  *
676
- * When using `freeSolo` mode, the typed value will be the input value
675
+ * When using the `freeSolo` mode, the typed value will be the input value
677
676
  * if the Autocomplete loses focus without highlighting an option.
678
677
  * @default false
679
678
  */
@@ -708,8 +707,8 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
708
707
  /**
709
708
  * If `true`, the input's text is cleared on blur if no value is selected.
710
709
  *
711
- * Set to `true` if you want to help the user enter a new value.
712
- * Set to `false` if you want to help the user resume their search.
710
+ * Set it to `true` if you want to help the user enter a new value.
711
+ * Set it to `false` if you want to help the user resume their search.
713
712
  * @default !props.freeSolo
714
713
  */
715
714
  clearOnBlur: PropTypes.bool,
@@ -67,7 +67,6 @@ export const ButtonBaseRoot = styled('button', {
67
67
  '&::-moz-focus-inner': {
68
68
  borderStyle: 'none' // Remove Firefox dotted outline.
69
69
  },
70
-
71
70
  [`&.${buttonBaseClasses.disabled}`]: {
72
71
  pointerEvents: 'none',
73
72
  // Disable link interactions
@@ -234,7 +233,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
234
233
  });
235
234
  const handleKeyUp = useEventCallback(event => {
236
235
  // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
237
- // https://codesandbox.io/s/button-keyup-preventdefault-dn7f0
236
+ // https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0
238
237
  if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) {
239
238
  keydownRef.current = false;
240
239
  rippleRef.current.stop(event, () => {
@@ -2,4 +2,6 @@
2
2
 
3
3
  export { default } from './ButtonGroup';
4
4
  export { default as buttonGroupClasses } from './buttonGroupClasses';
5
- export * from './buttonGroupClasses';
5
+ export * from './buttonGroupClasses';
6
+ export { default as ButtonGroupContext } from './ButtonGroupContext';
7
+ export { default as ButtonGroupButtonContext } from './ButtonGroupButtonContext';
@@ -37,7 +37,7 @@ const CardActionsRoot = styled('div', {
37
37
  alignItems: 'center',
38
38
  padding: 8
39
39
  }, !ownerState.disableSpacing && {
40
- '& > :not(:first-of-type)': {
40
+ '& > :not(style) ~ :not(style)': {
41
41
  marginLeft: 8
42
42
  }
43
43
  }));
@@ -84,7 +84,6 @@ const CircularProgressSVG = styled('svg', {
84
84
  })({
85
85
  display: 'block' // Keeps the progress centered
86
86
  });
87
-
88
87
  const CircularProgressCircle = styled('circle', {
89
88
  name: 'MuiCircularProgress',
90
89
  slot: 'Circle',
@@ -82,7 +82,6 @@ const FilledInputRoot = styled(InputBaseRoot, {
82
82
  }),
83
83
  pointerEvents: 'none' // Transparent to the hover style.
84
84
  },
85
-
86
85
  [`&.${filledInputClasses.focused}:after`]: {
87
86
  // translateX(0) is a workaround for Safari transform scale bug
88
87
  // See https://github.com/mui/material-ui/issues/31766
@@ -106,7 +105,6 @@ const FilledInputRoot = styled(InputBaseRoot, {
106
105
  }),
107
106
  pointerEvents: 'none' // Transparent to the hover style.
108
107
  },
109
-
110
108
  [`&:hover:not(.${filledInputClasses.disabled}, .${filledInputClasses.error}):before`]: {
111
109
  borderBottom: `1px solid ${(theme.vars || theme).palette.text.primary}`
112
110
  },
@@ -66,7 +66,6 @@ const InputRoot = styled(InputBaseRoot, {
66
66
  }),
67
67
  pointerEvents: 'none' // Transparent to the hover style.
68
68
  },
69
-
70
69
  [`&.${inputClasses.focused}:after`]: {
71
70
  // translateX(0) is a workaround for Safari transform scale bug
72
71
  // See https://github.com/mui/material-ui/issues/31766
@@ -90,7 +89,6 @@ const InputRoot = styled(InputBaseRoot, {
90
89
  }),
91
90
  pointerEvents: 'none' // Transparent to the hover style.
92
91
  },
93
-
94
92
  [`&:hover:not(.${inputClasses.disabled}, .${inputClasses.error}):before`]: {
95
93
  borderBottom: `2px solid ${(theme.vars || theme).palette.text.primary}`,
96
94
  // Reset on touch devices, it doesn't add specificity
@@ -167,13 +167,11 @@ export const InputBaseComponent = styled('input', {
167
167
  // IE11
168
168
  '&:focus::-ms-input-placeholder': placeholderVisible // Edge
169
169
  },
170
-
171
170
  [`&.${inputBaseClasses.disabled}`]: {
172
171
  opacity: 1,
173
172
  // Reset iOS opacity
174
173
  WebkitTextFillColor: (theme.vars || theme).palette.text.disabled // Fix opacity Safari bug
175
174
  },
176
-
177
175
  '&:-webkit-autofill': {
178
176
  animationDuration: '5000s',
179
177
  animationName: 'mui-auto-fill'
@@ -105,11 +105,7 @@ const InputLabelRoot = styled(FormLabel, {
105
105
  // but it feels a better when it bleeds a bit on the left, so 32px.
106
106
  maxWidth: 'calc(133% - 32px)',
107
107
  transform: 'translate(14px, -9px) scale(0.75)'
108
- }), ownerState.variant === 'standard' && {
109
- '&:not(label) + div': {
110
- marginTop: 16
111
- }
112
- }));
108
+ })));
113
109
  const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, ref) {
114
110
  const props = useThemeProps({
115
111
  name: 'MuiInputLabel',
@@ -83,7 +83,6 @@ const LinkRoot = styled(Typography, {
83
83
  '&::-moz-focus-inner': {
84
84
  borderStyle: 'none' // Remove Firefox dotted outline.
85
85
  },
86
-
87
86
  [`&.${linkClasses.focusVisible}`]: {
88
87
  outline: 'auto'
89
88
  }
@@ -49,7 +49,6 @@ export const nativeSelectSelectStyles = ({
49
49
  }, {
50
50
  borderRadius: 0 // Reset Chrome style
51
51
  }),
52
-
53
52
  // Remove IE11 arrow
54
53
  '&::-ms-expand': {
55
54
  display: 'none'
@@ -77,7 +76,6 @@ export const nativeSelectSelectStyles = ({
77
76
  '&:focus': {
78
77
  borderRadius: (theme.vars || theme).shape.borderRadius // Reset the reset for Chrome style
79
78
  },
80
-
81
79
  '&&&': {
82
80
  paddingRight: 32
83
81
  }
@@ -385,7 +385,6 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
385
385
  'data-value': child.props.value // Instead, we provide it as a data attribute.
386
386
  });
387
387
  });
388
-
389
388
  if (process.env.NODE_ENV !== 'production') {
390
389
  // eslint-disable-next-line react-hooks/rules-of-hooks
391
390
  React.useEffect(() => {
@@ -434,7 +433,6 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
434
433
  const classes = useUtilityClasses(ownerState);
435
434
  const paperProps = _extends({}, MenuProps.PaperProps, MenuProps.slotProps?.paper);
436
435
  const listboxId = useId();
437
- const hiddenInputId = useId();
438
436
  return /*#__PURE__*/_jsxs(React.Fragment, {
439
437
  children: [/*#__PURE__*/_jsx(SelectSelect, _extends({
440
438
  ref: handleDisplayRef,
@@ -465,7 +463,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
465
463
  })), /*#__PURE__*/_jsx(SelectNativeInput, _extends({
466
464
  "aria-invalid": error,
467
465
  value: Array.isArray(value) ? value.join(',') : value,
468
- name: name ?? hiddenInputId,
466
+ name: name,
469
467
  ref: inputRef,
470
468
  "aria-hidden": true,
471
469
  onChange: handleChange,
@@ -3,7 +3,7 @@
3
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  var _InputBase;
6
- const _excluded = ["ActionsComponent", "backIconButtonProps", "className", "colSpan", "component", "count", "disabled", "getItemAriaLabel", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "onPageChange", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps", "showFirstButton", "showLastButton", "slotProps"];
6
+ const _excluded = ["ActionsComponent", "backIconButtonProps", "className", "colSpan", "component", "count", "disabled", "getItemAriaLabel", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "onPageChange", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps", "showFirstButton", "showLastButton", "slotProps", "slots"];
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import clsx from 'clsx';
@@ -96,7 +96,6 @@ const TablePaginationSelect = styled(Select, {
96
96
  textAlignLast: 'right' // Align <select> on Chrome.
97
97
  }
98
98
  });
99
-
100
99
  const TablePaginationMenuItem = styled(MenuItem, {
101
100
  name: 'MuiTablePagination',
102
101
  slot: 'MenuItem',
@@ -168,7 +167,8 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
168
167
  SelectProps = {},
169
168
  showFirstButton = false,
170
169
  showLastButton = false,
171
- slotProps
170
+ slotProps = {},
171
+ slots = {}
172
172
  } = props,
173
173
  other = _objectWithoutPropertiesLoose(props, _excluded);
174
174
  const ownerState = props;
@@ -179,7 +179,6 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
179
179
  if (component === TableCell || component === 'td') {
180
180
  colSpan = colSpanProp || 1000; // col-span over everything
181
181
  }
182
-
183
182
  const selectId = useId(selectProps.id);
184
183
  const labelId = useId(selectProps.labelId);
185
184
  const getLabelDisplayedRowsTo = () => {
@@ -246,7 +245,8 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
246
245
  rowsPerPage: rowsPerPage,
247
246
  showFirstButton: showFirstButton,
248
247
  showLastButton: showLastButton,
249
- slotProps: slotProps?.actions,
248
+ slotProps: slotProps.actions,
249
+ slots: slots.actions,
250
250
  getItemAriaLabel: getItemAriaLabel,
251
251
  disabled: disabled
252
252
  })]
@@ -408,12 +408,33 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
408
408
  slotProps: PropTypes.shape({
409
409
  actions: PropTypes.shape({
410
410
  firstButton: PropTypes.object,
411
+ firstButtonIcon: PropTypes.object,
411
412
  lastButton: PropTypes.object,
413
+ lastButtonIcon: PropTypes.object,
412
414
  nextButton: PropTypes.object,
413
- previousButton: PropTypes.object
415
+ nextButtonIcon: PropTypes.object,
416
+ previousButton: PropTypes.object,
417
+ previousButtonIcon: PropTypes.object
414
418
  }),
415
419
  select: PropTypes.object
416
420
  }),
421
+ /**
422
+ * The components used for each slot inside the TablePagination.
423
+ * Either a string to use a HTML element or a component.
424
+ * @default {}
425
+ */
426
+ slots: PropTypes.shape({
427
+ actions: PropTypes.shape({
428
+ firstButton: PropTypes.elementType,
429
+ firstButtonIcon: PropTypes.elementType,
430
+ lastButton: PropTypes.elementType,
431
+ lastButtonIcon: PropTypes.elementType,
432
+ nextButton: PropTypes.elementType,
433
+ nextButtonIcon: PropTypes.elementType,
434
+ previousButton: PropTypes.elementType,
435
+ previousButtonIcon: PropTypes.elementType
436
+ })
437
+ }),
417
438
  /**
418
439
  * The system prop that allows defining system overrides as well as additional CSS styles.
419
440
  */
@@ -2,16 +2,15 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- var _LastPageIcon, _FirstPageIcon, _KeyboardArrowRight, _KeyboardArrowLeft, _KeyboardArrowLeft2, _KeyboardArrowRight2, _FirstPageIcon2, _LastPageIcon2;
6
- const _excluded = ["backIconButtonProps", "count", "disabled", "getItemAriaLabel", "nextIconButtonProps", "onPageChange", "page", "rowsPerPage", "showFirstButton", "showLastButton", "slotProps"];
5
+ const _excluded = ["backIconButtonProps", "count", "disabled", "getItemAriaLabel", "nextIconButtonProps", "onPageChange", "page", "rowsPerPage", "showFirstButton", "showLastButton", "slots", "slotProps"];
7
6
  import * as React from 'react';
8
7
  import PropTypes from 'prop-types';
9
8
  import KeyboardArrowLeft from '../internal/svg-icons/KeyboardArrowLeft';
10
9
  import KeyboardArrowRight from '../internal/svg-icons/KeyboardArrowRight';
11
10
  import useTheme from '../styles/useTheme';
12
11
  import IconButton from '../IconButton';
13
- import LastPageIcon from '../internal/svg-icons/LastPage';
14
- import FirstPageIcon from '../internal/svg-icons/FirstPage';
12
+ import LastPageIconDefault from '../internal/svg-icons/LastPage';
13
+ import FirstPageIconDefault from '../internal/svg-icons/FirstPage';
15
14
 
16
15
  /**
17
16
  * @ignore - internal component.
@@ -30,7 +29,8 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
30
29
  rowsPerPage,
31
30
  showFirstButton,
32
31
  showLastButton,
33
- slotProps
32
+ slots = {},
33
+ slotProps = {}
34
34
  } = props,
35
35
  other = _objectWithoutPropertiesLoose(props, _excluded);
36
36
  const theme = useTheme();
@@ -46,39 +46,55 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
46
46
  const handleLastPageButtonClick = event => {
47
47
  onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));
48
48
  };
49
+ const FirstButton = slots.firstButton ?? IconButton;
50
+ const LastButton = slots.lastButton ?? IconButton;
51
+ const NextButton = slots.nextButton ?? IconButton;
52
+ const PreviousButton = slots.previousButton ?? IconButton;
53
+ const FirstButtonIcon = slots.firstButtonIcon ?? FirstPageIconDefault;
54
+ const LastButtonIcon = slots.lastButtonIcon ?? LastPageIconDefault;
55
+ const NextButtonIcon = slots.nextButtonIcon ?? KeyboardArrowRight;
56
+ const PreviousButtonIcon = slots.previousButtonIcon ?? KeyboardArrowLeft;
57
+ const FirstButtonSlot = theme.direction === 'rtl' ? LastButton : FirstButton;
58
+ const PreviousButtonSlot = theme.direction === 'rtl' ? NextButton : PreviousButton;
59
+ const NextButtonSlot = theme.direction === 'rtl' ? PreviousButton : NextButton;
60
+ const LastButtonSlot = theme.direction === 'rtl' ? FirstButton : LastButton;
61
+ const firstButtonSlotProps = theme.direction === 'rtl' ? slotProps.lastButton : slotProps.firstButton;
62
+ const previousButtonSlotProps = theme.direction === 'rtl' ? slotProps.nextButton : slotProps.previousButton;
63
+ const nextButtonSlotProps = theme.direction === 'rtl' ? slotProps.previousButton : slotProps.nextButton;
64
+ const lastButtonSlotProps = theme.direction === 'rtl' ? slotProps.firstButton : slotProps.lastButton;
49
65
  return /*#__PURE__*/_jsxs("div", _extends({
50
66
  ref: ref
51
67
  }, other, {
52
- children: [showFirstButton && /*#__PURE__*/_jsx(IconButton, _extends({
68
+ children: [showFirstButton && /*#__PURE__*/_jsx(FirstButtonSlot, _extends({
53
69
  onClick: handleFirstPageButtonClick,
54
70
  disabled: disabled || page === 0,
55
71
  "aria-label": getItemAriaLabel('first', page),
56
72
  title: getItemAriaLabel('first', page)
57
- }, slotProps?.firstButton ?? {}, {
58
- children: theme.direction === 'rtl' ? _LastPageIcon || (_LastPageIcon = /*#__PURE__*/_jsx(LastPageIcon, {})) : _FirstPageIcon || (_FirstPageIcon = /*#__PURE__*/_jsx(FirstPageIcon, {}))
59
- })), /*#__PURE__*/_jsx(IconButton, _extends({
73
+ }, firstButtonSlotProps, {
74
+ children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(LastButtonIcon, _extends({}, slotProps.lastButtonIcon)) : /*#__PURE__*/_jsx(FirstButtonIcon, _extends({}, slotProps.firstButtonIcon))
75
+ })), /*#__PURE__*/_jsx(PreviousButtonSlot, _extends({
60
76
  onClick: handleBackButtonClick,
61
77
  disabled: disabled || page === 0,
62
78
  color: "inherit",
63
79
  "aria-label": getItemAriaLabel('previous', page),
64
80
  title: getItemAriaLabel('previous', page)
65
- }, slotProps?.previousButton ?? backIconButtonProps, {
66
- children: theme.direction === 'rtl' ? _KeyboardArrowRight || (_KeyboardArrowRight = /*#__PURE__*/_jsx(KeyboardArrowRight, {})) : _KeyboardArrowLeft || (_KeyboardArrowLeft = /*#__PURE__*/_jsx(KeyboardArrowLeft, {}))
67
- })), /*#__PURE__*/_jsx(IconButton, _extends({
81
+ }, previousButtonSlotProps ?? backIconButtonProps, {
82
+ children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(NextButtonIcon, _extends({}, slotProps.nextButtonIcon)) : /*#__PURE__*/_jsx(PreviousButtonIcon, _extends({}, slotProps.previousButtonIcon))
83
+ })), /*#__PURE__*/_jsx(NextButtonSlot, _extends({
68
84
  onClick: handleNextButtonClick,
69
85
  disabled: disabled || (count !== -1 ? page >= Math.ceil(count / rowsPerPage) - 1 : false),
70
86
  color: "inherit",
71
87
  "aria-label": getItemAriaLabel('next', page),
72
88
  title: getItemAriaLabel('next', page)
73
- }, slotProps?.nextButton ?? nextIconButtonProps, {
74
- children: theme.direction === 'rtl' ? _KeyboardArrowLeft2 || (_KeyboardArrowLeft2 = /*#__PURE__*/_jsx(KeyboardArrowLeft, {})) : _KeyboardArrowRight2 || (_KeyboardArrowRight2 = /*#__PURE__*/_jsx(KeyboardArrowRight, {}))
75
- })), showLastButton && /*#__PURE__*/_jsx(IconButton, _extends({
89
+ }, nextButtonSlotProps ?? nextIconButtonProps, {
90
+ children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(PreviousButtonIcon, _extends({}, slotProps.previousButtonIcon)) : /*#__PURE__*/_jsx(NextButtonIcon, _extends({}, slotProps.nextButtonIcon))
91
+ })), showLastButton && /*#__PURE__*/_jsx(LastButtonSlot, _extends({
76
92
  onClick: handleLastPageButtonClick,
77
93
  disabled: disabled || page >= Math.ceil(count / rowsPerPage) - 1,
78
94
  "aria-label": getItemAriaLabel('last', page),
79
95
  title: getItemAriaLabel('last', page)
80
- }, slotProps?.lastButton ?? {}, {
81
- children: theme.direction === 'rtl' ? _FirstPageIcon2 || (_FirstPageIcon2 = /*#__PURE__*/_jsx(FirstPageIcon, {})) : _LastPageIcon2 || (_LastPageIcon2 = /*#__PURE__*/_jsx(LastPageIcon, {}))
96
+ }, lastButtonSlotProps, {
97
+ children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(FirstButtonIcon, _extends({}, slotProps.firstButtonIcon)) : /*#__PURE__*/_jsx(LastButtonIcon, _extends({}, slotProps.lastButtonIcon))
82
98
  }))]
83
99
  }));
84
100
  });
@@ -139,9 +155,28 @@ process.env.NODE_ENV !== "production" ? TablePaginationActions.propTypes = {
139
155
  */
140
156
  slotProps: PropTypes.shape({
141
157
  firstButton: PropTypes.object,
158
+ firstButtonIcon: PropTypes.object,
142
159
  lastButton: PropTypes.object,
160
+ lastButtonIcon: PropTypes.object,
143
161
  nextButton: PropTypes.object,
144
- previousButton: PropTypes.object
162
+ nextButtonIcon: PropTypes.object,
163
+ previousButton: PropTypes.object,
164
+ previousButtonIcon: PropTypes.object
165
+ }),
166
+ /**
167
+ * The components used for each slot inside the TablePaginationActions.
168
+ * Either a string to use a HTML element or a component.
169
+ * @default {}
170
+ */
171
+ slots: PropTypes.shape({
172
+ firstButton: PropTypes.elementType,
173
+ firstButtonIcon: PropTypes.elementType,
174
+ lastButton: PropTypes.elementType,
175
+ lastButtonIcon: PropTypes.elementType,
176
+ nextButton: PropTypes.elementType,
177
+ nextButtonIcon: PropTypes.elementType,
178
+ previousButton: PropTypes.elementType,
179
+ previousButtonIcon: PropTypes.elementType
145
180
  })
146
181
  } : void 0;
147
182
  export default TablePaginationActions;
@@ -200,7 +200,6 @@ const TabsScrollbarSize = styled(ScrollbarSize)({
200
200
  display: 'none' // Safari + Chrome
201
201
  }
202
202
  });
203
-
204
203
  const defaultIndicatorStyle = {};
205
204
  let warnedOnceTabPresent = false;
206
205
  const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.14.20
2
+ * @mui/material v5.15.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the