@mui/material 5.15.12 → 5.15.14

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 (121) hide show
  1. package/Accordion/Accordion.js +30 -23
  2. package/AccordionActions/AccordionActions.js +14 -12
  3. package/AccordionDetails/AccordionDetails.js +2 -2
  4. package/AccordionSummary/AccordionSummary.js +29 -23
  5. package/Alert/Alert.d.ts +2 -2
  6. package/Autocomplete/Autocomplete.d.ts +1 -1
  7. package/Autocomplete/Autocomplete.js +117 -82
  8. package/Autocomplete/autocompleteClasses.d.ts +3 -3
  9. package/CHANGELOG.md +203 -51
  10. package/CircularProgress/CircularProgress.d.ts +1 -1
  11. package/CircularProgress/CircularProgress.js +1 -1
  12. package/Drawer/Drawer.js +9 -3
  13. package/Icon/Icon.d.ts +1 -1
  14. package/Icon/Icon.js +1 -1
  15. package/LinearProgress/LinearProgress.js +4 -4
  16. package/Menu/Menu.js +5 -4
  17. package/MenuList/MenuList.js +4 -2
  18. package/OverridableComponent.d.ts +1 -1
  19. package/PaginationItem/PaginationItem.js +3 -3
  20. package/Popper/Popper.d.ts +3 -26
  21. package/README.md +2 -2
  22. package/Rating/Rating.js +3 -3
  23. package/Select/Select.d.ts +8 -20
  24. package/Slider/Slider.js +406 -226
  25. package/SvgIcon/SvgIcon.js +1 -1
  26. package/Switch/Switch.js +61 -41
  27. package/TabScrollButton/TabScrollButton.js +2 -3
  28. package/TablePagination/TablePaginationActions.js +14 -14
  29. package/Tabs/Tabs.js +3 -2
  30. package/Tooltip/Tooltip.js +5 -4
  31. package/index.js +1 -1
  32. package/legacy/Accordion/Accordion.js +33 -22
  33. package/legacy/AccordionActions/AccordionActions.js +17 -14
  34. package/legacy/AccordionDetails/AccordionDetails.js +2 -2
  35. package/legacy/AccordionSummary/AccordionSummary.js +31 -22
  36. package/legacy/Autocomplete/Autocomplete.js +194 -164
  37. package/legacy/CircularProgress/CircularProgress.js +1 -1
  38. package/legacy/Drawer/Drawer.js +8 -3
  39. package/legacy/Icon/Icon.js +1 -1
  40. package/legacy/LinearProgress/LinearProgress.js +4 -4
  41. package/legacy/Menu/Menu.js +5 -4
  42. package/legacy/MenuList/MenuList.js +3 -2
  43. package/legacy/PaginationItem/PaginationItem.js +3 -3
  44. package/legacy/Rating/Rating.js +3 -3
  45. package/legacy/Slider/Slider.js +375 -194
  46. package/legacy/SvgIcon/SvgIcon.js +1 -1
  47. package/legacy/Switch/Switch.js +88 -59
  48. package/legacy/TabScrollButton/TabScrollButton.js +2 -3
  49. package/legacy/TablePagination/TablePaginationActions.js +14 -14
  50. package/legacy/Tabs/Tabs.js +3 -2
  51. package/legacy/Tooltip/Tooltip.js +7 -3
  52. package/legacy/index.js +1 -1
  53. package/legacy/styles/experimental_extendTheme.js +4 -1
  54. package/legacy/styles/rootShouldForwardProp.js +5 -0
  55. package/legacy/styles/slotShouldForwardProp.js +5 -0
  56. package/legacy/styles/styled.js +4 -5
  57. package/legacy/usePagination/usePagination.js +1 -1
  58. package/modern/Accordion/Accordion.js +30 -23
  59. package/modern/AccordionActions/AccordionActions.js +14 -12
  60. package/modern/AccordionDetails/AccordionDetails.js +2 -2
  61. package/modern/AccordionSummary/AccordionSummary.js +29 -23
  62. package/modern/Autocomplete/Autocomplete.js +117 -82
  63. package/modern/CircularProgress/CircularProgress.js +1 -1
  64. package/modern/Drawer/Drawer.js +9 -3
  65. package/modern/Icon/Icon.js +1 -1
  66. package/modern/LinearProgress/LinearProgress.js +4 -4
  67. package/modern/Menu/Menu.js +5 -4
  68. package/modern/MenuList/MenuList.js +4 -2
  69. package/modern/PaginationItem/PaginationItem.js +3 -3
  70. package/modern/Rating/Rating.js +3 -3
  71. package/modern/Slider/Slider.js +339 -175
  72. package/modern/SvgIcon/SvgIcon.js +1 -1
  73. package/modern/Switch/Switch.js +61 -41
  74. package/modern/TabScrollButton/TabScrollButton.js +2 -3
  75. package/modern/TablePagination/TablePaginationActions.js +14 -14
  76. package/modern/Tabs/Tabs.js +3 -2
  77. package/modern/Tooltip/Tooltip.js +5 -4
  78. package/modern/index.js +1 -1
  79. package/modern/styles/experimental_extendTheme.js +4 -1
  80. package/modern/styles/rootShouldForwardProp.js +3 -0
  81. package/modern/styles/slotShouldForwardProp.js +5 -0
  82. package/modern/styles/styled.js +4 -3
  83. package/modern/usePagination/usePagination.js +1 -1
  84. package/node/Accordion/Accordion.js +32 -25
  85. package/node/AccordionActions/AccordionActions.js +16 -14
  86. package/node/AccordionDetails/AccordionDetails.js +4 -4
  87. package/node/AccordionSummary/AccordionSummary.js +33 -27
  88. package/node/Autocomplete/Autocomplete.js +129 -94
  89. package/node/CircularProgress/CircularProgress.js +1 -1
  90. package/node/Drawer/Drawer.js +9 -3
  91. package/node/Icon/Icon.js +1 -1
  92. package/node/LinearProgress/LinearProgress.js +4 -4
  93. package/node/Menu/Menu.js +5 -4
  94. package/node/MenuList/MenuList.js +4 -2
  95. package/node/PaginationItem/PaginationItem.js +3 -3
  96. package/node/Rating/Rating.js +3 -3
  97. package/node/Slider/Slider.js +416 -236
  98. package/node/SvgIcon/SvgIcon.js +1 -1
  99. package/node/Switch/Switch.js +66 -46
  100. package/node/TabScrollButton/TabScrollButton.js +2 -3
  101. package/node/TablePagination/TablePaginationActions.js +14 -14
  102. package/node/Tabs/Tabs.js +3 -2
  103. package/node/Tooltip/Tooltip.js +5 -4
  104. package/node/index.js +1 -1
  105. package/node/styles/experimental_extendTheme.js +4 -1
  106. package/node/styles/rootShouldForwardProp.js +10 -0
  107. package/node/styles/slotShouldForwardProp.js +11 -0
  108. package/node/styles/styled.js +17 -8
  109. package/node/usePagination/usePagination.js +1 -1
  110. package/package.json +6 -6
  111. package/styles/experimental_extendTheme.d.ts +1 -0
  112. package/styles/experimental_extendTheme.js +4 -1
  113. package/styles/rootShouldForwardProp.d.ts +2 -0
  114. package/styles/rootShouldForwardProp.js +3 -0
  115. package/styles/slotShouldForwardProp.d.ts +2 -0
  116. package/styles/slotShouldForwardProp.js +5 -0
  117. package/styles/styled.d.ts +2 -3
  118. package/styles/styled.js +4 -3
  119. package/umd/material-ui.development.js +1048 -738
  120. package/umd/material-ui.production.min.js +2 -2
  121. package/usePagination/usePagination.js +1 -1
@@ -38,7 +38,7 @@ var SvgIconRoot = styled('svg', {
38
38
  height: '1em',
39
39
  display: 'inline-block',
40
40
  // the <svg> will define the property that has `currentColor`
41
- // e.g. heroicons uses fill="none" and stroke="currentColor"
41
+ // for example heroicons uses fill="none" and stroke="currentColor"
42
42
  fill: ownerState.hasSvgAsChild ? undefined : 'currentColor',
43
43
  flexShrink: 0,
44
44
  transition: (_theme$transitions = theme.transitions) == null || (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {
@@ -2,6 +2,8 @@
2
2
 
3
3
  // @inheritedComponent IconButton
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
7
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
8
  import _extends from "@babel/runtime/helpers/esm/extends";
7
9
  import * as React from 'react';
@@ -12,11 +14,11 @@ import composeClasses from '@mui/utils/composeClasses';
12
14
  import { alpha, darken, lighten } from '@mui/system/colorManipulator';
13
15
  import capitalize from '../utils/capitalize';
14
16
  import SwitchBase from '../internal/SwitchBase';
15
- import useThemeProps from '../styles/useThemeProps';
16
- import styled from '../styles/styled';
17
+ import { styled, createUseThemeProps } from '../zero-styled';
17
18
  import switchClasses, { getSwitchUtilityClass } from './switchClasses';
18
19
  import { jsx as _jsx } from "react/jsx-runtime";
19
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
21
+ var useThemeProps = createUseThemeProps('MuiSwitch');
20
22
  var useUtilityClasses = function useUtilityClasses(ownerState) {
21
23
  var classes = ownerState.classes,
22
24
  edge = ownerState.edge,
@@ -41,40 +43,53 @@ var SwitchRoot = styled('span', {
41
43
  var ownerState = props.ownerState;
42
44
  return [styles.root, ownerState.edge && styles["edge".concat(capitalize(ownerState.edge))], styles["size".concat(capitalize(ownerState.size))]];
43
45
  }
44
- })(function (_ref) {
45
- var ownerState = _ref.ownerState;
46
- return _extends({
47
- display: 'inline-flex',
48
- width: 34 + 12 * 2,
49
- height: 14 + 12 * 2,
50
- overflow: 'hidden',
51
- padding: 12,
52
- boxSizing: 'border-box',
53
- position: 'relative',
54
- flexShrink: 0,
55
- zIndex: 0,
56
- // Reset the stacking context.
57
- verticalAlign: 'middle',
58
- // For correct alignment with the text.
59
- '@media print': {
60
- colorAdjust: 'exact'
46
+ })({
47
+ display: 'inline-flex',
48
+ width: 34 + 12 * 2,
49
+ height: 14 + 12 * 2,
50
+ overflow: 'hidden',
51
+ padding: 12,
52
+ boxSizing: 'border-box',
53
+ position: 'relative',
54
+ flexShrink: 0,
55
+ zIndex: 0,
56
+ // Reset the stacking context.
57
+ verticalAlign: 'middle',
58
+ // For correct alignment with the text.
59
+ '@media print': {
60
+ colorAdjust: 'exact'
61
+ },
62
+ variants: [{
63
+ props: {
64
+ edge: 'start'
65
+ },
66
+ style: {
67
+ marginLeft: -8
61
68
  }
62
- }, ownerState.edge === 'start' && {
63
- marginLeft: -8
64
- }, ownerState.edge === 'end' && {
65
- marginRight: -8
66
- }, ownerState.size === 'small' && _defineProperty(_defineProperty({
67
- width: 40,
68
- height: 24,
69
- padding: 7
70
- }, "& .".concat(switchClasses.thumb), {
71
- width: 16,
72
- height: 16
73
- }), "& .".concat(switchClasses.switchBase), _defineProperty({
74
- padding: 4
75
- }, "&.".concat(switchClasses.checked), {
76
- transform: 'translateX(16px)'
77
- })));
69
+ }, {
70
+ props: {
71
+ edge: 'end'
72
+ },
73
+ style: {
74
+ marginRight: -8
75
+ }
76
+ }, {
77
+ props: {
78
+ size: 'small'
79
+ },
80
+ style: _defineProperty(_defineProperty({
81
+ width: 40,
82
+ height: 24,
83
+ padding: 7
84
+ }, "& .".concat(switchClasses.thumb), {
85
+ width: 16,
86
+ height: 16
87
+ }), "& .".concat(switchClasses.switchBase), _defineProperty({
88
+ padding: 4
89
+ }, "&.".concat(switchClasses.checked), {
90
+ transform: 'translateX(16px)'
91
+ }))
92
+ }]
78
93
  });
79
94
  var SwitchSwitchBase = styled(SwitchBase, {
80
95
  name: 'MuiSwitch',
@@ -83,8 +98,8 @@ var SwitchSwitchBase = styled(SwitchBase, {
83
98
  var ownerState = props.ownerState;
84
99
  return [styles.switchBase, _defineProperty({}, "& .".concat(switchClasses.input), styles.input), ownerState.color !== 'default' && styles["color".concat(capitalize(ownerState.color))]];
85
100
  }
86
- })(function (_ref4) {
87
- var theme = _ref4.theme;
101
+ })(function (_ref2) {
102
+ var theme = _ref2.theme;
88
103
  return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
89
104
  position: 'absolute',
90
105
  top: 0,
@@ -107,30 +122,44 @@ var SwitchSwitchBase = styled(SwitchBase, {
107
122
  left: '-100%',
108
123
  width: '300%'
109
124
  });
110
- }, function (_ref6) {
111
- var theme = _ref6.theme,
112
- ownerState = _ref6.ownerState;
113
- return _extends({
125
+ }, function (_ref4) {
126
+ var theme = _ref4.theme;
127
+ return {
114
128
  '&:hover': {
115
129
  backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette.action.activeChannel, " / ").concat(theme.vars.palette.action.hoverOpacity, ")") : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),
116
130
  // Reset on touch devices, it doesn't add specificity
117
131
  '@media (hover: none)': {
118
132
  backgroundColor: 'transparent'
119
133
  }
120
- }
121
- }, ownerState.color !== 'default' && _defineProperty(_defineProperty({}, "&.".concat(switchClasses.checked), _defineProperty({
122
- color: (theme.vars || theme).palette[ownerState.color].main,
123
- '&:hover': {
124
- backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette[ownerState.color].mainChannel, " / ").concat(theme.vars.palette.action.hoverOpacity, ")") : alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
125
- '@media (hover: none)': {
126
- backgroundColor: 'transparent'
127
- }
128
- }
129
- }, "&.".concat(switchClasses.disabled), {
130
- color: theme.vars ? theme.vars.palette.Switch["".concat(ownerState.color, "DisabledColor")] : "".concat(theme.palette.mode === 'light' ? lighten(theme.palette[ownerState.color].main, 0.62) : darken(theme.palette[ownerState.color].main, 0.55))
131
- })), "&.".concat(switchClasses.checked, " + .").concat(switchClasses.track), {
132
- backgroundColor: (theme.vars || theme).palette[ownerState.color].main
133
- }));
134
+ },
135
+ variants: _toConsumableArray(Object.entries(theme.palette).filter(function (_ref5) {
136
+ var _ref6 = _slicedToArray(_ref5, 2),
137
+ value = _ref6[1];
138
+ return value.main && value.light;
139
+ }) // check all the used fields in the style below
140
+ .map(function (_ref7) {
141
+ var _ref8 = _slicedToArray(_ref7, 1),
142
+ color = _ref8[0];
143
+ return {
144
+ props: {
145
+ color: color
146
+ },
147
+ style: _defineProperty(_defineProperty({}, "&.".concat(switchClasses.checked), _defineProperty({
148
+ color: (theme.vars || theme).palette[color].main,
149
+ '&:hover': {
150
+ backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette[color].mainChannel, " / ").concat(theme.vars.palette.action.hoverOpacity, ")") : alpha(theme.palette[color].main, theme.palette.action.hoverOpacity),
151
+ '@media (hover: none)': {
152
+ backgroundColor: 'transparent'
153
+ }
154
+ }
155
+ }, "&.".concat(switchClasses.disabled), {
156
+ color: theme.vars ? theme.vars.palette.Switch["".concat(color, "DisabledColor")] : "".concat(theme.palette.mode === 'light' ? lighten(theme.palette[color].main, 0.62) : darken(theme.palette[color].main, 0.55))
157
+ })), "&.".concat(switchClasses.checked, " + .").concat(switchClasses.track), {
158
+ backgroundColor: (theme.vars || theme).palette[color].main
159
+ })
160
+ };
161
+ }))
162
+ };
134
163
  });
135
164
  var SwitchTrack = styled('span', {
136
165
  name: 'MuiSwitch',
@@ -138,8 +167,8 @@ var SwitchTrack = styled('span', {
138
167
  overridesResolver: function overridesResolver(props, styles) {
139
168
  return styles.track;
140
169
  }
141
- })(function (_ref8) {
142
- var theme = _ref8.theme;
170
+ })(function (_ref9) {
171
+ var theme = _ref9.theme;
143
172
  return {
144
173
  height: '100%',
145
174
  width: '100%',
@@ -158,8 +187,8 @@ var SwitchThumb = styled('span', {
158
187
  overridesResolver: function overridesResolver(props, styles) {
159
188
  return styles.thumb;
160
189
  }
161
- })(function (_ref9) {
162
- var theme = _ref9.theme;
190
+ })(function (_ref10) {
191
+ var theme = _ref10.theme;
163
192
  return {
164
193
  boxShadow: (theme.vars || theme).shadows[1],
165
194
  backgroundColor: 'currentColor',
@@ -9,10 +9,10 @@ import PropTypes from 'prop-types';
9
9
  import clsx from 'clsx';
10
10
  import { useSlotProps } from '@mui/base/utils';
11
11
  import composeClasses from '@mui/utils/composeClasses';
12
+ import { useRtl } from '@mui/system/RtlProvider';
12
13
  import KeyboardArrowLeft from '../internal/svg-icons/KeyboardArrowLeft';
13
14
  import KeyboardArrowRight from '../internal/svg-icons/KeyboardArrowRight';
14
15
  import ButtonBase from '../ButtonBase';
15
- import useTheme from '../styles/useTheme';
16
16
  import useThemeProps from '../styles/useThemeProps';
17
17
  import styled from '../styles/styled';
18
18
  import tabScrollButtonClasses, { getTabScrollButtonUtilityClass } from './tabScrollButtonClasses';
@@ -64,8 +64,7 @@ var TabScrollButton = /*#__PURE__*/React.forwardRef(function TabScrollButton(inP
64
64
  orientation = props.orientation,
65
65
  disabled = props.disabled,
66
66
  other = _objectWithoutProperties(props, ["className", "slots", "slotProps", "direction", "orientation", "disabled"]);
67
- var theme = useTheme();
68
- var isRtl = theme.direction === 'rtl';
67
+ var isRtl = useRtl();
69
68
  var ownerState = _extends({
70
69
  isRtl: isRtl
71
70
  }, props);
@@ -4,9 +4,9 @@ import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
+ import { useRtl } from '@mui/system/RtlProvider';
7
8
  import KeyboardArrowLeft from '../internal/svg-icons/KeyboardArrowLeft';
8
9
  import KeyboardArrowRight from '../internal/svg-icons/KeyboardArrowRight';
9
- import useTheme from '../styles/useTheme';
10
10
  import IconButton from '../IconButton';
11
11
  import LastPageIconDefault from '../internal/svg-icons/LastPage';
12
12
  import FirstPageIconDefault from '../internal/svg-icons/FirstPage';
@@ -34,7 +34,7 @@ var TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginat
34
34
  _props$slotProps = props.slotProps,
35
35
  slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
36
36
  other = _objectWithoutProperties(props, ["backIconButtonProps", "count", "disabled", "getItemAriaLabel", "nextIconButtonProps", "onPageChange", "page", "rowsPerPage", "showFirstButton", "showLastButton", "slots", "slotProps"]);
37
- var theme = useTheme();
37
+ var isRtl = useRtl();
38
38
  var handleFirstPageButtonClick = function handleFirstPageButtonClick(event) {
39
39
  onPageChange(event, 0);
40
40
  };
@@ -55,14 +55,14 @@ var TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginat
55
55
  var LastButtonIcon = (_slots$lastButtonIcon = slots.lastButtonIcon) != null ? _slots$lastButtonIcon : LastPageIconDefault;
56
56
  var NextButtonIcon = (_slots$nextButtonIcon = slots.nextButtonIcon) != null ? _slots$nextButtonIcon : KeyboardArrowRight;
57
57
  var PreviousButtonIcon = (_slots$previousButton2 = slots.previousButtonIcon) != null ? _slots$previousButton2 : KeyboardArrowLeft;
58
- var FirstButtonSlot = theme.direction === 'rtl' ? LastButton : FirstButton;
59
- var PreviousButtonSlot = theme.direction === 'rtl' ? NextButton : PreviousButton;
60
- var NextButtonSlot = theme.direction === 'rtl' ? PreviousButton : NextButton;
61
- var LastButtonSlot = theme.direction === 'rtl' ? FirstButton : LastButton;
62
- var firstButtonSlotProps = theme.direction === 'rtl' ? slotProps.lastButton : slotProps.firstButton;
63
- var previousButtonSlotProps = theme.direction === 'rtl' ? slotProps.nextButton : slotProps.previousButton;
64
- var nextButtonSlotProps = theme.direction === 'rtl' ? slotProps.previousButton : slotProps.nextButton;
65
- var lastButtonSlotProps = theme.direction === 'rtl' ? slotProps.firstButton : slotProps.lastButton;
58
+ var FirstButtonSlot = isRtl ? LastButton : FirstButton;
59
+ var PreviousButtonSlot = isRtl ? NextButton : PreviousButton;
60
+ var NextButtonSlot = isRtl ? PreviousButton : NextButton;
61
+ var LastButtonSlot = isRtl ? FirstButton : LastButton;
62
+ var firstButtonSlotProps = isRtl ? slotProps.lastButton : slotProps.firstButton;
63
+ var previousButtonSlotProps = isRtl ? slotProps.nextButton : slotProps.previousButton;
64
+ var nextButtonSlotProps = isRtl ? slotProps.previousButton : slotProps.nextButton;
65
+ var lastButtonSlotProps = isRtl ? slotProps.firstButton : slotProps.lastButton;
66
66
  return /*#__PURE__*/_jsxs("div", _extends({
67
67
  ref: ref
68
68
  }, other, {
@@ -72,7 +72,7 @@ var TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginat
72
72
  "aria-label": getItemAriaLabel('first', page),
73
73
  title: getItemAriaLabel('first', page)
74
74
  }, firstButtonSlotProps, {
75
- children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(LastButtonIcon, _extends({}, slotProps.lastButtonIcon)) : /*#__PURE__*/_jsx(FirstButtonIcon, _extends({}, slotProps.firstButtonIcon))
75
+ children: isRtl ? /*#__PURE__*/_jsx(LastButtonIcon, _extends({}, slotProps.lastButtonIcon)) : /*#__PURE__*/_jsx(FirstButtonIcon, _extends({}, slotProps.firstButtonIcon))
76
76
  })), /*#__PURE__*/_jsx(PreviousButtonSlot, _extends({
77
77
  onClick: handleBackButtonClick,
78
78
  disabled: disabled || page === 0,
@@ -80,7 +80,7 @@ var TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginat
80
80
  "aria-label": getItemAriaLabel('previous', page),
81
81
  title: getItemAriaLabel('previous', page)
82
82
  }, previousButtonSlotProps != null ? previousButtonSlotProps : backIconButtonProps, {
83
- children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(NextButtonIcon, _extends({}, slotProps.nextButtonIcon)) : /*#__PURE__*/_jsx(PreviousButtonIcon, _extends({}, slotProps.previousButtonIcon))
83
+ children: isRtl ? /*#__PURE__*/_jsx(NextButtonIcon, _extends({}, slotProps.nextButtonIcon)) : /*#__PURE__*/_jsx(PreviousButtonIcon, _extends({}, slotProps.previousButtonIcon))
84
84
  })), /*#__PURE__*/_jsx(NextButtonSlot, _extends({
85
85
  onClick: handleNextButtonClick,
86
86
  disabled: disabled || (count !== -1 ? page >= Math.ceil(count / rowsPerPage) - 1 : false),
@@ -88,14 +88,14 @@ var TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginat
88
88
  "aria-label": getItemAriaLabel('next', page),
89
89
  title: getItemAriaLabel('next', page)
90
90
  }, nextButtonSlotProps != null ? nextButtonSlotProps : nextIconButtonProps, {
91
- children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(PreviousButtonIcon, _extends({}, slotProps.previousButtonIcon)) : /*#__PURE__*/_jsx(NextButtonIcon, _extends({}, slotProps.nextButtonIcon))
91
+ children: isRtl ? /*#__PURE__*/_jsx(PreviousButtonIcon, _extends({}, slotProps.previousButtonIcon)) : /*#__PURE__*/_jsx(NextButtonIcon, _extends({}, slotProps.nextButtonIcon))
92
92
  })), showLastButton && /*#__PURE__*/_jsx(LastButtonSlot, _extends({
93
93
  onClick: handleLastPageButtonClick,
94
94
  disabled: disabled || page >= Math.ceil(count / rowsPerPage) - 1,
95
95
  "aria-label": getItemAriaLabel('last', page),
96
96
  title: getItemAriaLabel('last', page)
97
97
  }, lastButtonSlotProps, {
98
- children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(FirstButtonIcon, _extends({}, slotProps.firstButtonIcon)) : /*#__PURE__*/_jsx(LastButtonIcon, _extends({}, slotProps.lastButtonIcon))
98
+ children: isRtl ? /*#__PURE__*/_jsx(FirstButtonIcon, _extends({}, slotProps.firstButtonIcon)) : /*#__PURE__*/_jsx(LastButtonIcon, _extends({}, slotProps.lastButtonIcon))
99
99
  }))]
100
100
  }));
101
101
  });
@@ -10,6 +10,7 @@ import clsx from 'clsx';
10
10
  import refType from '@mui/utils/refType';
11
11
  import { useSlotProps } from '@mui/base/utils';
12
12
  import composeClasses from '@mui/utils/composeClasses';
13
+ import { useRtl } from '@mui/system/RtlProvider';
13
14
  import styled from '../styles/styled';
14
15
  import useThemeProps from '../styles/useThemeProps';
15
16
  import useTheme from '../styles/useTheme';
@@ -199,7 +200,7 @@ var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
199
200
  name: 'MuiTabs'
200
201
  });
201
202
  var theme = useTheme();
202
- var isRtl = theme.direction === 'rtl';
203
+ var isRtl = useRtl();
203
204
  var ariaLabel = props['aria-label'],
204
205
  ariaLabelledBy = props['aria-labelledby'],
205
206
  action = props.action,
@@ -311,7 +312,7 @@ var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
311
312
  clientWidth: tabsNode.clientWidth,
312
313
  scrollLeft: tabsNode.scrollLeft,
313
314
  scrollTop: tabsNode.scrollTop,
314
- scrollLeftNormalized: getNormalizedScrollLeft(tabsNode, theme.direction),
315
+ scrollLeftNormalized: getNormalizedScrollLeft(tabsNode, isRtl ? 'rtl' : 'ltr'),
315
316
  scrollWidth: tabsNode.scrollWidth,
316
317
  top: rect.top,
317
318
  bottom: rect.bottom,
@@ -12,6 +12,7 @@ import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
12
12
  import { appendOwnerState } from '@mui/base/utils';
13
13
  import composeClasses from '@mui/utils/composeClasses';
14
14
  import { alpha } from '@mui/system/colorManipulator';
15
+ import { useRtl } from '@mui/system/RtlProvider';
15
16
  import styled from '../styles/styled';
16
17
  import useTheme from '../styles/useTheme';
17
18
  import useThemeProps from '../styles/useThemeProps';
@@ -197,10 +198,13 @@ export function testReset() {
197
198
  }
198
199
  function composeEventHandler(handler, eventHandler) {
199
200
  return function (event) {
201
+ for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
202
+ params[_key - 1] = arguments[_key];
203
+ }
200
204
  if (eventHandler) {
201
- eventHandler(event);
205
+ eventHandler.apply(void 0, [event].concat(params));
202
206
  }
203
- handler(event);
207
+ handler.apply(void 0, [event].concat(params));
204
208
  };
205
209
  }
206
210
 
@@ -263,7 +267,7 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
263
267
  children: childrenProp
264
268
  });
265
269
  var theme = useTheme();
266
- var isRtl = theme.direction === 'rtl';
270
+ var isRtl = useRtl();
267
271
  var _React$useState = React.useState(),
268
272
  childNode = _React$useState[0],
269
273
  setChildNode = _React$useState[1];
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.15.12
2
+ * @mui/material v5.15.14
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -38,7 +38,7 @@ function setColorChannel(obj, key) {
38
38
  if (!("".concat(key, "Channel") in obj)) {
39
39
  // custom channel token is not provided, generate one.
40
40
  // if channel token can't be generated, show a warning.
41
- 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."));
41
+ 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, for example \"12 12 12\") or undefined if you want to remove the channel token."));
42
42
  }
43
43
  }
44
44
  var silent = function silent(fn) {
@@ -267,6 +267,9 @@ export default function extendTheme() {
267
267
 
268
268
  // MUI X - DataGrid needs this token.
269
269
  setColorChannel(palette.background, 'default');
270
+
271
+ // added for consistency with the `background.default` token
272
+ setColorChannel(palette.background, 'paper');
270
273
  setColorChannel(palette.common, 'background');
271
274
  setColorChannel(palette.common, 'onBackground');
272
275
  setColorChannel(palette, 'divider');
@@ -0,0 +1,5 @@
1
+ import slotShouldForwardProp from './slotShouldForwardProp';
2
+ var rootShouldForwardProp = function rootShouldForwardProp(prop) {
3
+ return slotShouldForwardProp(prop) && prop !== 'classes';
4
+ };
5
+ export default rootShouldForwardProp;
@@ -0,0 +1,5 @@
1
+ // copied from @mui/system/createStyled
2
+ function slotShouldForwardProp(prop) {
3
+ return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';
4
+ }
5
+ export default slotShouldForwardProp;
@@ -1,12 +1,11 @@
1
1
  'use client';
2
2
 
3
- import createStyled, { shouldForwardProp } from '@mui/system/createStyled';
3
+ import createStyled from '@mui/system/createStyled';
4
4
  import defaultTheme from './defaultTheme';
5
5
  import THEME_ID from './identifier';
6
- export var rootShouldForwardProp = function rootShouldForwardProp(prop) {
7
- return shouldForwardProp(prop) && prop !== 'classes';
8
- };
9
- export var slotShouldForwardProp = shouldForwardProp;
6
+ import rootShouldForwardProp from './rootShouldForwardProp';
7
+ export { default as slotShouldForwardProp } from './slotShouldForwardProp';
8
+ export { default as rootShouldForwardProp } from './rootShouldForwardProp';
10
9
  var styled = createStyled({
11
10
  themeId: THEME_ID,
12
11
  defaultTheme: defaultTheme,
@@ -76,7 +76,7 @@ export default function usePagination() {
76
76
  endPages.length > 0 ? endPages[0] - 2 : count - 1);
77
77
 
78
78
  // Basic list of items to render
79
- // e.g. itemList = ['first', 'previous', 1, 'ellipsis', 4, 5, 6, 'ellipsis', 10, 'next', 'last']
79
+ // for example itemList = ['first', 'previous', 1, 'ellipsis', 4, 5, 6, 'ellipsis', 10, 'next', 'last']
80
80
  var itemList = [].concat(_toConsumableArray(showFirstButton ? ['first'] : []), _toConsumableArray(hidePrevButton ? [] : ['previous']), _toConsumableArray(startPages), _toConsumableArray(siblingsStart > boundaryCount + 2 ? ['start-ellipsis'] : boundaryCount + 1 < count - boundaryCount ? [boundaryCount + 1] : []), _toConsumableArray(range(siblingsStart, siblingsEnd)), _toConsumableArray(siblingsEnd < count - boundaryCount - 1 ? ['end-ellipsis'] : count - boundaryCount > boundaryCount ? [count - boundaryCount] : []), _toConsumableArray(endPages), _toConsumableArray(hideNextButton ? [] : ['next']), _toConsumableArray(showLastButton ? ['last'] : []));
81
81
 
82
82
  // Map the button type to its page number
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["children", "className", "defaultExpanded", "disabled", "disableGutters", "expanded", "onChange", "square", "slots", "slotProps", "TransitionComponent", "TransitionProps"];
6
6
  import * as React from 'react';
7
7
  import { isFragment } from 'react-is';
@@ -9,8 +9,7 @@ import PropTypes from 'prop-types';
9
9
  import clsx from 'clsx';
10
10
  import chainPropTypes from '@mui/utils/chainPropTypes';
11
11
  import composeClasses from '@mui/utils/composeClasses';
12
- import styled from '../styles/styled';
13
- import useThemeProps from '../styles/useThemeProps';
12
+ import { styled, createUseThemeProps } from '../zero-styled';
14
13
  import Collapse from '../Collapse';
15
14
  import Paper from '../Paper';
16
15
  import AccordionContext from './AccordionContext';
@@ -19,6 +18,7 @@ import useSlot from '../utils/useSlot';
19
18
  import accordionClasses, { getAccordionUtilityClass } from './accordionClasses';
20
19
  import { jsx as _jsx } from "react/jsx-runtime";
21
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
21
+ const useThemeProps = createUseThemeProps('MuiAccordion');
22
22
  const useUtilityClasses = ownerState => {
23
23
  const {
24
24
  classes,
@@ -92,27 +92,34 @@ const AccordionRoot = styled(Paper, {
92
92
  }
93
93
  };
94
94
  }, ({
95
- theme,
96
- ownerState
97
- }) => _extends({}, !ownerState.square && {
98
- borderRadius: 0,
99
- '&:first-of-type': {
100
- borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,
101
- borderTopRightRadius: (theme.vars || theme).shape.borderRadius
102
- },
103
- '&:last-of-type': {
104
- borderBottomLeftRadius: (theme.vars || theme).shape.borderRadius,
105
- borderBottomRightRadius: (theme.vars || theme).shape.borderRadius,
106
- // Fix a rendering issue on Edge
107
- '@supports (-ms-ime-align: auto)': {
108
- borderBottomLeftRadius: 0,
109
- borderBottomRightRadius: 0
95
+ theme
96
+ }) => ({
97
+ variants: [{
98
+ props: props => !props.square,
99
+ style: {
100
+ borderRadius: 0,
101
+ '&:first-of-type': {
102
+ borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,
103
+ borderTopRightRadius: (theme.vars || theme).shape.borderRadius
104
+ },
105
+ '&:last-of-type': {
106
+ borderBottomLeftRadius: (theme.vars || theme).shape.borderRadius,
107
+ borderBottomRightRadius: (theme.vars || theme).shape.borderRadius,
108
+ // Fix a rendering issue on Edge
109
+ '@supports (-ms-ime-align: auto)': {
110
+ borderBottomLeftRadius: 0,
111
+ borderBottomRightRadius: 0
112
+ }
113
+ }
110
114
  }
111
- }
112
- }, !ownerState.disableGutters && {
113
- [`&.${accordionClasses.expanded}`]: {
114
- margin: '16px 0'
115
- }
115
+ }, {
116
+ props: props => !props.disableGutters,
117
+ style: {
118
+ [`&.${accordionClasses.expanded}`]: {
119
+ margin: '16px 0'
120
+ }
121
+ }
122
+ }]
116
123
  }));
117
124
  const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
118
125
  const props = useThemeProps({
@@ -1,16 +1,16 @@
1
1
  'use client';
2
2
 
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["className", "disableSpacing"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
- import styled from '../styles/styled';
11
- import useThemeProps from '../styles/useThemeProps';
10
+ import { styled, createUseThemeProps } from '../zero-styled';
12
11
  import { getAccordionActionsUtilityClass } from './accordionActionsClasses';
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ const useThemeProps = createUseThemeProps('MuiAccordionActions');
14
14
  const useUtilityClasses = ownerState => {
15
15
  const {
16
16
  classes,
@@ -30,18 +30,20 @@ const AccordionActionsRoot = styled('div', {
30
30
  } = props;
31
31
  return [styles.root, !ownerState.disableSpacing && styles.spacing];
32
32
  }
33
- })(({
34
- ownerState
35
- }) => _extends({
33
+ })({
36
34
  display: 'flex',
37
35
  alignItems: 'center',
38
36
  padding: 8,
39
- justifyContent: 'flex-end'
40
- }, !ownerState.disableSpacing && {
41
- '& > :not(style) ~ :not(style)': {
42
- marginLeft: 8
43
- }
44
- }));
37
+ justifyContent: 'flex-end',
38
+ variants: [{
39
+ props: props => !props.disableSpacing,
40
+ style: {
41
+ '& > :not(style) ~ :not(style)': {
42
+ marginLeft: 8
43
+ }
44
+ }
45
+ }]
46
+ });
45
47
  const AccordionActions = /*#__PURE__*/React.forwardRef(function AccordionActions(inProps, ref) {
46
48
  const props = useThemeProps({
47
49
  props: inProps,
@@ -7,10 +7,10 @@ import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
- import styled from '../styles/styled';
11
- import useThemeProps from '../styles/useThemeProps';
10
+ import { styled, createUseThemeProps } from '../zero-styled';
12
11
  import { getAccordionDetailsUtilityClass } from './accordionDetailsClasses';
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ const useThemeProps = createUseThemeProps('MuiAccordionDetails');
14
14
  const useUtilityClasses = ownerState => {
15
15
  const {
16
16
  classes