@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
@@ -16,9 +16,9 @@ var _utils = require("@mui/base/utils");
16
16
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
17
17
  var _useSlider = require("@mui/base/useSlider");
18
18
  var _colorManipulator = require("@mui/system/colorManipulator");
19
- var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
20
- var _styled = _interopRequireWildcard(require("../styles/styled"));
21
- var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
19
+ var _RtlProvider = require("@mui/system/RtlProvider");
20
+ var _zeroStyled = require("../zero-styled");
21
+ var _slotShouldForwardProp = _interopRequireDefault(require("../styles/slotShouldForwardProp"));
22
22
  var _shouldSpreadAdditionalProps = _interopRequireDefault(require("../utils/shouldSpreadAdditionalProps"));
23
23
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
24
24
  var _SliderValueLabel = _interopRequireDefault(require("./SliderValueLabel"));
@@ -27,10 +27,11 @@ var _jsxRuntime = require("react/jsx-runtime");
27
27
  const _excluded = ["aria-label", "aria-valuetext", "aria-labelledby", "component", "components", "componentsProps", "color", "classes", "className", "disableSwap", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "orientation", "shiftStep", "size", "step", "scale", "slotProps", "slots", "tabIndex", "track", "value", "valueLabelDisplay", "valueLabelFormat"];
28
28
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
29
29
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
30
+ const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiSlider');
30
31
  function Identity(x) {
31
32
  return x;
32
33
  }
33
- const SliderRoot = exports.SliderRoot = (0, _styled.default)('span', {
34
+ const SliderRoot = exports.SliderRoot = (0, _zeroStyled.styled)('span', {
34
35
  name: 'MuiSlider',
35
36
  slot: 'Root',
36
37
  overridesResolver: (props, styles) => {
@@ -40,95 +41,151 @@ const SliderRoot = exports.SliderRoot = (0, _styled.default)('span', {
40
41
  return [styles.root, styles[`color${(0, _capitalize.default)(ownerState.color)}`], ownerState.size !== 'medium' && styles[`size${(0, _capitalize.default)(ownerState.size)}`], ownerState.marked && styles.marked, ownerState.orientation === 'vertical' && styles.vertical, ownerState.track === 'inverted' && styles.trackInverted, ownerState.track === false && styles.trackFalse];
41
42
  }
42
43
  })(({
43
- theme,
44
- ownerState
45
- }) => (0, _extends2.default)({
46
- borderRadius: 12,
47
- boxSizing: 'content-box',
48
- display: 'inline-block',
49
- position: 'relative',
50
- cursor: 'pointer',
51
- touchAction: 'none',
52
- color: (theme.vars || theme).palette[ownerState.color].main,
53
- WebkitTapHighlightColor: 'transparent'
54
- }, ownerState.orientation === 'horizontal' && (0, _extends2.default)({
55
- height: 4,
56
- width: '100%',
57
- padding: '13px 0',
58
- // The primary input mechanism of the device includes a pointing device of limited accuracy.
59
- '@media (pointer: coarse)': {
60
- // Reach 42px touch target, about ~8mm on screen.
61
- padding: '20px 0'
62
- }
63
- }, ownerState.size === 'small' && {
64
- height: 2
65
- }, ownerState.marked && {
66
- marginBottom: 20
67
- }), ownerState.orientation === 'vertical' && (0, _extends2.default)({
68
- height: '100%',
69
- width: 4,
70
- padding: '0 13px',
71
- // The primary input mechanism of the device includes a pointing device of limited accuracy.
72
- '@media (pointer: coarse)': {
73
- // Reach 42px touch target, about ~8mm on screen.
74
- padding: '0 20px'
75
- }
76
- }, ownerState.size === 'small' && {
77
- width: 2
78
- }, ownerState.marked && {
79
- marginRight: 44
80
- }), {
81
- '@media print': {
82
- colorAdjust: 'exact'
83
- },
84
- [`&.${_sliderClasses.default.disabled}`]: {
85
- pointerEvents: 'none',
86
- cursor: 'default',
87
- color: (theme.vars || theme).palette.grey[400]
88
- },
89
- [`&.${_sliderClasses.default.dragging}`]: {
90
- [`& .${_sliderClasses.default.thumb}, & .${_sliderClasses.default.track}`]: {
91
- transition: 'none'
92
- }
93
- }
94
- }));
95
- const SliderRail = exports.SliderRail = (0, _styled.default)('span', {
44
+ theme
45
+ }) => {
46
+ var _theme$vars;
47
+ return {
48
+ borderRadius: 12,
49
+ boxSizing: 'content-box',
50
+ display: 'inline-block',
51
+ position: 'relative',
52
+ cursor: 'pointer',
53
+ touchAction: 'none',
54
+ WebkitTapHighlightColor: 'transparent',
55
+ '@media print': {
56
+ colorAdjust: 'exact'
57
+ },
58
+ [`&.${_sliderClasses.default.disabled}`]: {
59
+ pointerEvents: 'none',
60
+ cursor: 'default',
61
+ color: (theme.vars || theme).palette.grey[400]
62
+ },
63
+ [`&.${_sliderClasses.default.dragging}`]: {
64
+ [`& .${_sliderClasses.default.thumb}, & .${_sliderClasses.default.track}`]: {
65
+ transition: 'none'
66
+ }
67
+ },
68
+ variants: [...Object.keys(((_theme$vars = theme.vars) != null ? _theme$vars : theme).palette).filter(key => {
69
+ var _theme$vars2;
70
+ return ((_theme$vars2 = theme.vars) != null ? _theme$vars2 : theme).palette[key].main;
71
+ }).map(color => ({
72
+ props: {
73
+ color
74
+ },
75
+ style: {
76
+ color: (theme.vars || theme).palette[color].main
77
+ }
78
+ })), {
79
+ props: {
80
+ orientation: 'horizontal'
81
+ },
82
+ style: {
83
+ height: 4,
84
+ width: '100%',
85
+ padding: '13px 0',
86
+ // The primary input mechanism of the device includes a pointing device of limited accuracy.
87
+ '@media (pointer: coarse)': {
88
+ // Reach 42px touch target, about ~8mm on screen.
89
+ padding: '20px 0'
90
+ }
91
+ }
92
+ }, {
93
+ props: {
94
+ orientation: 'horizontal',
95
+ size: 'small'
96
+ },
97
+ style: {
98
+ height: 2
99
+ }
100
+ }, {
101
+ props: {
102
+ orientation: 'horizontal',
103
+ marked: true
104
+ },
105
+ style: {
106
+ marginBottom: 20
107
+ }
108
+ }, {
109
+ props: {
110
+ orientation: 'vertical'
111
+ },
112
+ style: {
113
+ height: '100%',
114
+ width: 4,
115
+ padding: '0 13px',
116
+ // The primary input mechanism of the device includes a pointing device of limited accuracy.
117
+ '@media (pointer: coarse)': {
118
+ // Reach 42px touch target, about ~8mm on screen.
119
+ padding: '0 20px'
120
+ }
121
+ }
122
+ }, {
123
+ props: {
124
+ orientation: 'vertical',
125
+ size: 'small'
126
+ },
127
+ style: {
128
+ width: 2
129
+ }
130
+ }, {
131
+ props: {
132
+ orientation: 'vertical',
133
+ marked: true
134
+ },
135
+ style: {
136
+ marginRight: 44
137
+ }
138
+ }]
139
+ };
140
+ });
141
+ const SliderRail = exports.SliderRail = (0, _zeroStyled.styled)('span', {
96
142
  name: 'MuiSlider',
97
143
  slot: 'Rail',
98
144
  overridesResolver: (props, styles) => styles.rail
99
- })(({
100
- ownerState
101
- }) => (0, _extends2.default)({
145
+ })({
102
146
  display: 'block',
103
147
  position: 'absolute',
104
148
  borderRadius: 'inherit',
105
149
  backgroundColor: 'currentColor',
106
- opacity: 0.38
107
- }, ownerState.orientation === 'horizontal' && {
108
- width: '100%',
109
- height: 'inherit',
110
- top: '50%',
111
- transform: 'translateY(-50%)'
112
- }, ownerState.orientation === 'vertical' && {
113
- height: '100%',
114
- width: 'inherit',
115
- left: '50%',
116
- transform: 'translateX(-50%)'
117
- }, ownerState.track === 'inverted' && {
118
- opacity: 1
119
- }));
120
- const SliderTrack = exports.SliderTrack = (0, _styled.default)('span', {
150
+ opacity: 0.38,
151
+ variants: [{
152
+ props: {
153
+ orientation: 'horizontal'
154
+ },
155
+ style: {
156
+ width: '100%',
157
+ height: 'inherit',
158
+ top: '50%',
159
+ transform: 'translateY(-50%)'
160
+ }
161
+ }, {
162
+ props: {
163
+ orientation: 'vertical'
164
+ },
165
+ style: {
166
+ height: '100%',
167
+ width: 'inherit',
168
+ left: '50%',
169
+ transform: 'translateX(-50%)'
170
+ }
171
+ }, {
172
+ props: {
173
+ track: 'inverted'
174
+ },
175
+ style: {
176
+ opacity: 1
177
+ }
178
+ }]
179
+ });
180
+ const SliderTrack = exports.SliderTrack = (0, _zeroStyled.styled)('span', {
121
181
  name: 'MuiSlider',
122
182
  slot: 'Track',
123
183
  overridesResolver: (props, styles) => styles.track
124
184
  })(({
125
- theme,
126
- ownerState
185
+ theme
127
186
  }) => {
128
- const color =
129
- // Same logic as the LinearProgress track color
130
- theme.palette.mode === 'light' ? (0, _colorManipulator.lighten)(theme.palette[ownerState.color].main, 0.62) : (0, _colorManipulator.darken)(theme.palette[ownerState.color].main, 0.5);
131
- return (0, _extends2.default)({
187
+ var _theme$vars3;
188
+ return {
132
189
  display: 'block',
133
190
  position: 'absolute',
134
191
  borderRadius: 'inherit',
@@ -136,25 +193,62 @@ const SliderTrack = exports.SliderTrack = (0, _styled.default)('span', {
136
193
  backgroundColor: 'currentColor',
137
194
  transition: theme.transitions.create(['left', 'width', 'bottom', 'height'], {
138
195
  duration: theme.transitions.duration.shortest
139
- })
140
- }, ownerState.size === 'small' && {
141
- border: 'none'
142
- }, ownerState.orientation === 'horizontal' && {
143
- height: 'inherit',
144
- top: '50%',
145
- transform: 'translateY(-50%)'
146
- }, ownerState.orientation === 'vertical' && {
147
- width: 'inherit',
148
- left: '50%',
149
- transform: 'translateX(-50%)'
150
- }, ownerState.track === false && {
151
- display: 'none'
152
- }, ownerState.track === 'inverted' && {
153
- backgroundColor: theme.vars ? theme.vars.palette.Slider[`${ownerState.color}Track`] : color,
154
- borderColor: theme.vars ? theme.vars.palette.Slider[`${ownerState.color}Track`] : color
155
- });
196
+ }),
197
+ variants: [{
198
+ props: {
199
+ size: 'small'
200
+ },
201
+ style: {
202
+ border: 'none'
203
+ }
204
+ }, {
205
+ props: {
206
+ orientation: 'horizontal'
207
+ },
208
+ style: {
209
+ height: 'inherit',
210
+ top: '50%',
211
+ transform: 'translateY(-50%)'
212
+ }
213
+ }, {
214
+ props: {
215
+ orientation: 'vertical'
216
+ },
217
+ style: {
218
+ width: 'inherit',
219
+ left: '50%',
220
+ transform: 'translateX(-50%)'
221
+ }
222
+ }, {
223
+ props: {
224
+ track: false
225
+ },
226
+ style: {
227
+ display: 'none'
228
+ }
229
+ }, ...Object.keys(((_theme$vars3 = theme.vars) != null ? _theme$vars3 : theme).palette).filter(key => {
230
+ var _theme$vars4;
231
+ return ((_theme$vars4 = theme.vars) != null ? _theme$vars4 : theme).palette[key].main;
232
+ }).map(color => ({
233
+ props: {
234
+ color,
235
+ track: 'inverted'
236
+ },
237
+ style: (0, _extends2.default)({}, theme.vars ? {
238
+ backgroundColor: theme.vars.palette.Slider[`${color}Track`],
239
+ borderColor: theme.vars.palette.Slider[`${color}Track`]
240
+ } : (0, _extends2.default)({
241
+ backgroundColor: (0, _colorManipulator.lighten)(theme.palette[color].main, 0.62),
242
+ borderColor: (0, _colorManipulator.lighten)(theme.palette[color].main, 0.62)
243
+ }, theme.applyStyles('dark', {
244
+ backgroundColor: (0, _colorManipulator.darken)(theme.palette[color].main, 0.5)
245
+ }), theme.applyStyles('dark', {
246
+ borderColor: (0, _colorManipulator.darken)(theme.palette[color].main, 0.5)
247
+ })))
248
+ }))]
249
+ };
156
250
  });
157
- const SliderThumb = exports.SliderThumb = (0, _styled.default)('span', {
251
+ const SliderThumb = exports.SliderThumb = (0, _zeroStyled.styled)('span', {
158
252
  name: 'MuiSlider',
159
253
  slot: 'Thumb',
160
254
  overridesResolver: (props, styles) => {
@@ -164,79 +258,107 @@ const SliderThumb = exports.SliderThumb = (0, _styled.default)('span', {
164
258
  return [styles.thumb, styles[`thumbColor${(0, _capitalize.default)(ownerState.color)}`], ownerState.size !== 'medium' && styles[`thumbSize${(0, _capitalize.default)(ownerState.size)}`]];
165
259
  }
166
260
  })(({
167
- theme,
168
- ownerState
169
- }) => (0, _extends2.default)({
170
- position: 'absolute',
171
- width: 20,
172
- height: 20,
173
- boxSizing: 'border-box',
174
- borderRadius: '50%',
175
- outline: 0,
176
- backgroundColor: 'currentColor',
177
- display: 'flex',
178
- alignItems: 'center',
179
- justifyContent: 'center',
180
- transition: theme.transitions.create(['box-shadow', 'left', 'bottom'], {
181
- duration: theme.transitions.duration.shortest
182
- })
183
- }, ownerState.size === 'small' && {
184
- width: 12,
185
- height: 12
186
- }, ownerState.orientation === 'horizontal' && {
187
- top: '50%',
188
- transform: 'translate(-50%, -50%)'
189
- }, ownerState.orientation === 'vertical' && {
190
- left: '50%',
191
- transform: 'translate(-50%, 50%)'
192
- }, {
193
- '&::before': (0, _extends2.default)({
194
- position: 'absolute',
195
- content: '""',
196
- borderRadius: 'inherit',
197
- width: '100%',
198
- height: '100%',
199
- boxShadow: (theme.vars || theme).shadows[2]
200
- }, ownerState.size === 'small' && {
201
- boxShadow: 'none'
202
- }),
203
- '&::after': {
261
+ theme
262
+ }) => {
263
+ var _theme$vars5;
264
+ return {
204
265
  position: 'absolute',
205
- content: '""',
266
+ width: 20,
267
+ height: 20,
268
+ boxSizing: 'border-box',
206
269
  borderRadius: '50%',
207
- // 42px is the hit target
208
- width: 42,
209
- height: 42,
210
- top: '50%',
211
- left: '50%',
212
- transform: 'translate(-50%, -50%)'
213
- },
214
- [`&:hover, &.${_sliderClasses.default.focusVisible}`]: {
215
- boxShadow: `0px 0px 0px 8px ${theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.16)` : (0, _colorManipulator.alpha)(theme.palette[ownerState.color].main, 0.16)}`,
216
- '@media (hover: none)': {
217
- boxShadow: 'none'
218
- }
219
- },
220
- [`&.${_sliderClasses.default.active}`]: {
221
- boxShadow: `0px 0px 0px 14px ${theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.16)` : (0, _colorManipulator.alpha)(theme.palette[ownerState.color].main, 0.16)}`
222
- },
223
- [`&.${_sliderClasses.default.disabled}`]: {
224
- '&:hover': {
225
- boxShadow: 'none'
226
- }
227
- }
228
- }));
229
- const SliderValueLabel = exports.SliderValueLabel = (0, _styled.default)(_SliderValueLabel.default, {
270
+ outline: 0,
271
+ backgroundColor: 'currentColor',
272
+ display: 'flex',
273
+ alignItems: 'center',
274
+ justifyContent: 'center',
275
+ transition: theme.transitions.create(['box-shadow', 'left', 'bottom'], {
276
+ duration: theme.transitions.duration.shortest
277
+ }),
278
+ '&::before': {
279
+ position: 'absolute',
280
+ content: '""',
281
+ borderRadius: 'inherit',
282
+ width: '100%',
283
+ height: '100%',
284
+ boxShadow: (theme.vars || theme).shadows[2]
285
+ },
286
+ '&::after': {
287
+ position: 'absolute',
288
+ content: '""',
289
+ borderRadius: '50%',
290
+ // 42px is the hit target
291
+ width: 42,
292
+ height: 42,
293
+ top: '50%',
294
+ left: '50%',
295
+ transform: 'translate(-50%, -50%)'
296
+ },
297
+ [`&.${_sliderClasses.default.disabled}`]: {
298
+ '&:hover': {
299
+ boxShadow: 'none'
300
+ }
301
+ },
302
+ variants: [...Object.keys(((_theme$vars5 = theme.vars) != null ? _theme$vars5 : theme).palette).filter(key => {
303
+ var _theme$vars6;
304
+ return ((_theme$vars6 = theme.vars) != null ? _theme$vars6 : theme).palette[key].main;
305
+ }).map(color => ({
306
+ props: {
307
+ color
308
+ },
309
+ style: {
310
+ [`&:hover, &.${_sliderClasses.default.focusVisible}`]: (0, _extends2.default)({}, theme.vars ? {
311
+ boxShadow: `0px 0px 0px 8px rgba(${theme.vars.palette[color].mainChannel} / 0.16)`
312
+ } : {
313
+ boxShadow: `0px 0px 0px 8px ${(0, _colorManipulator.alpha)(theme.palette[color].main, 0.16)}`
314
+ }, {
315
+ '@media (hover: none)': {
316
+ boxShadow: 'none'
317
+ }
318
+ }),
319
+ [`&.${_sliderClasses.default.active}`]: (0, _extends2.default)({}, theme.vars ? {
320
+ boxShadow: `0px 0px 0px 14px rgba(${theme.vars.palette[color].mainChannel} / 0.16)}`
321
+ } : {
322
+ boxShadow: `0px 0px 0px 14px ${(0, _colorManipulator.alpha)(theme.palette[color].main, 0.16)}`
323
+ })
324
+ }
325
+ })), {
326
+ props: {
327
+ size: 'small'
328
+ },
329
+ style: {
330
+ width: 12,
331
+ height: 12,
332
+ '&::before': {
333
+ boxShadow: 'none'
334
+ }
335
+ }
336
+ }, {
337
+ props: {
338
+ orientation: 'horizontal'
339
+ },
340
+ style: {
341
+ top: '50%',
342
+ transform: 'translate(-50%, -50%)'
343
+ }
344
+ }, {
345
+ props: {
346
+ orientation: 'vertical'
347
+ },
348
+ style: {
349
+ left: '50%',
350
+ transform: 'translate(-50%, 50%)'
351
+ }
352
+ }]
353
+ };
354
+ });
355
+ const SliderValueLabel = exports.SliderValueLabel = (0, _zeroStyled.styled)(_SliderValueLabel.default, {
230
356
  name: 'MuiSlider',
231
357
  slot: 'ValueLabel',
232
358
  overridesResolver: (props, styles) => styles.valueLabel
233
359
  })(({
234
- theme,
235
- ownerState
360
+ theme
236
361
  }) => (0, _extends2.default)({
237
- [`&.${_sliderClasses.default.valueLabelOpen}`]: {
238
- transform: `${ownerState.orientation === 'vertical' ? 'translateY(-50%)' : 'translateY(-100%)'} scale(1)`
239
- },
240
362
  zIndex: 1,
241
363
  whiteSpace: 'nowrap'
242
364
  }, theme.typography.body2, {
@@ -244,7 +366,6 @@ const SliderValueLabel = exports.SliderValueLabel = (0, _styled.default)(_Slider
244
366
  transition: theme.transitions.create(['transform'], {
245
367
  duration: theme.transitions.duration.shortest
246
368
  }),
247
- transform: `${ownerState.orientation === 'vertical' ? 'translateY(-50%)' : 'translateY(-100%)'} scale(0)`,
248
369
  position: 'absolute',
249
370
  backgroundColor: (theme.vars || theme).palette.grey[600],
250
371
  borderRadius: 2,
@@ -252,42 +373,74 @@ const SliderValueLabel = exports.SliderValueLabel = (0, _styled.default)(_Slider
252
373
  display: 'flex',
253
374
  alignItems: 'center',
254
375
  justifyContent: 'center',
255
- padding: '0.25rem 0.75rem'
256
- }, ownerState.orientation === 'horizontal' && {
257
- top: '-10px',
258
- transformOrigin: 'bottom center',
259
- '&::before': {
260
- position: 'absolute',
261
- content: '""',
262
- width: 8,
263
- height: 8,
264
- transform: 'translate(-50%, 50%) rotate(45deg)',
265
- backgroundColor: 'inherit',
266
- bottom: 0,
267
- left: '50%'
268
- }
269
- }, ownerState.orientation === 'vertical' && {
270
- right: ownerState.size === 'small' ? '20px' : '30px',
271
- top: '50%',
272
- transformOrigin: 'right center',
273
- '&::before': {
274
- position: 'absolute',
275
- content: '""',
276
- width: 8,
277
- height: 8,
278
- transform: 'translate(-50%, -50%) rotate(45deg)',
279
- backgroundColor: 'inherit',
280
- right: -8,
281
- top: '50%'
282
- }
283
- }, ownerState.size === 'small' && {
284
- fontSize: theme.typography.pxToRem(12),
285
- padding: '0.25rem 0.5rem'
376
+ padding: '0.25rem 0.75rem',
377
+ variants: [{
378
+ props: {
379
+ orientation: 'horizontal'
380
+ },
381
+ style: {
382
+ transform: 'translateY(-100%) scale(0)',
383
+ top: '-10px',
384
+ transformOrigin: 'bottom center',
385
+ '&::before': {
386
+ position: 'absolute',
387
+ content: '""',
388
+ width: 8,
389
+ height: 8,
390
+ transform: 'translate(-50%, 50%) rotate(45deg)',
391
+ backgroundColor: 'inherit',
392
+ bottom: 0,
393
+ left: '50%'
394
+ },
395
+ [`&.${_sliderClasses.default.valueLabelOpen}`]: {
396
+ transform: 'translateY(-100%) scale(1)'
397
+ }
398
+ }
399
+ }, {
400
+ props: {
401
+ orientation: 'vertical'
402
+ },
403
+ style: {
404
+ transform: 'translateY(-50%) scale(0)',
405
+ right: '30px',
406
+ top: '50%',
407
+ transformOrigin: 'right center',
408
+ '&::before': {
409
+ position: 'absolute',
410
+ content: '""',
411
+ width: 8,
412
+ height: 8,
413
+ transform: 'translate(-50%, -50%) rotate(45deg)',
414
+ backgroundColor: 'inherit',
415
+ right: -8,
416
+ top: '50%'
417
+ },
418
+ [`&.${_sliderClasses.default.valueLabelOpen}`]: {
419
+ transform: 'translateY(-50%) scale(1)'
420
+ }
421
+ }
422
+ }, {
423
+ props: {
424
+ size: 'small'
425
+ },
426
+ style: {
427
+ fontSize: theme.typography.pxToRem(12),
428
+ padding: '0.25rem 0.5rem'
429
+ }
430
+ }, {
431
+ props: {
432
+ orientation: 'vertical',
433
+ size: 'small'
434
+ },
435
+ style: {
436
+ right: '20px'
437
+ }
438
+ }]
286
439
  }));
287
- const SliderMark = exports.SliderMark = (0, _styled.default)('span', {
440
+ const SliderMark = exports.SliderMark = (0, _zeroStyled.styled)('span', {
288
441
  name: 'MuiSlider',
289
442
  slot: 'Mark',
290
- shouldForwardProp: prop => (0, _styled.slotShouldForwardProp)(prop) && prop !== 'markActive',
443
+ shouldForwardProp: prop => (0, _slotShouldForwardProp.default)(prop) && prop !== 'markActive',
291
444
  overridesResolver: (props, styles) => {
292
445
  const {
293
446
  markActive
@@ -295,52 +448,80 @@ const SliderMark = exports.SliderMark = (0, _styled.default)('span', {
295
448
  return [styles.mark, markActive && styles.markActive];
296
449
  }
297
450
  })(({
298
- theme,
299
- ownerState,
300
- markActive
301
- }) => (0, _extends2.default)({
451
+ theme
452
+ }) => ({
302
453
  position: 'absolute',
303
454
  width: 2,
304
455
  height: 2,
305
456
  borderRadius: 1,
306
- backgroundColor: 'currentColor'
307
- }, ownerState.orientation === 'horizontal' && {
308
- top: '50%',
309
- transform: 'translate(-1px, -50%)'
310
- }, ownerState.orientation === 'vertical' && {
311
- left: '50%',
312
- transform: 'translate(-50%, 1px)'
313
- }, markActive && {
314
- backgroundColor: (theme.vars || theme).palette.background.paper,
315
- opacity: 0.8
457
+ backgroundColor: 'currentColor',
458
+ variants: [{
459
+ props: {
460
+ orientation: 'horizontal'
461
+ },
462
+ style: {
463
+ top: '50%',
464
+ transform: 'translate(-1px, -50%)'
465
+ }
466
+ }, {
467
+ props: {
468
+ orientation: 'vertical'
469
+ },
470
+ style: {
471
+ left: '50%',
472
+ transform: 'translate(-50%, 1px)'
473
+ }
474
+ }, {
475
+ props: {
476
+ markActive: true
477
+ },
478
+ style: {
479
+ backgroundColor: (theme.vars || theme).palette.background.paper,
480
+ opacity: 0.8
481
+ }
482
+ }]
316
483
  }));
317
- const SliderMarkLabel = exports.SliderMarkLabel = (0, _styled.default)('span', {
484
+ const SliderMarkLabel = exports.SliderMarkLabel = (0, _zeroStyled.styled)('span', {
318
485
  name: 'MuiSlider',
319
486
  slot: 'MarkLabel',
320
- shouldForwardProp: prop => (0, _styled.slotShouldForwardProp)(prop) && prop !== 'markLabelActive',
487
+ shouldForwardProp: prop => (0, _slotShouldForwardProp.default)(prop) && prop !== 'markLabelActive',
321
488
  overridesResolver: (props, styles) => styles.markLabel
322
489
  })(({
323
- theme,
324
- ownerState,
325
- markLabelActive
490
+ theme
326
491
  }) => (0, _extends2.default)({}, theme.typography.body2, {
327
492
  color: (theme.vars || theme).palette.text.secondary,
328
493
  position: 'absolute',
329
- whiteSpace: 'nowrap'
330
- }, ownerState.orientation === 'horizontal' && {
331
- top: 30,
332
- transform: 'translateX(-50%)',
333
- '@media (pointer: coarse)': {
334
- top: 40
335
- }
336
- }, ownerState.orientation === 'vertical' && {
337
- left: 36,
338
- transform: 'translateY(50%)',
339
- '@media (pointer: coarse)': {
340
- left: 44
341
- }
342
- }, markLabelActive && {
343
- color: (theme.vars || theme).palette.text.primary
494
+ whiteSpace: 'nowrap',
495
+ variants: [{
496
+ props: {
497
+ orientation: 'horizontal'
498
+ },
499
+ style: {
500
+ top: 30,
501
+ transform: 'translateX(-50%)',
502
+ '@media (pointer: coarse)': {
503
+ top: 40
504
+ }
505
+ }
506
+ }, {
507
+ props: {
508
+ orientation: 'vertical'
509
+ },
510
+ style: {
511
+ left: 36,
512
+ transform: 'translateY(50%)',
513
+ '@media (pointer: coarse)': {
514
+ left: 44
515
+ }
516
+ }
517
+ }, {
518
+ props: {
519
+ markLabelActive: true
520
+ },
521
+ style: {
522
+ color: (theme.vars || theme).palette.text.primary
523
+ }
524
+ }]
344
525
  }));
345
526
  const useUtilityClasses = ownerState => {
346
527
  const {
@@ -374,12 +555,11 @@ const Forward = ({
374
555
  }) => children;
375
556
  const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
376
557
  var _ref, _slots$root, _ref2, _slots$rail, _ref3, _slots$track, _ref4, _slots$thumb, _ref5, _slots$valueLabel, _ref6, _slots$mark, _ref7, _slots$markLabel, _ref8, _slots$input, _slotProps$root, _slotProps$rail, _slotProps$track, _slotProps$thumb, _slotProps$valueLabel, _slotProps$mark, _slotProps$markLabel, _slotProps$input;
377
- const props = (0, _useThemeProps.default)({
558
+ const props = useThemeProps({
378
559
  props: inputProps,
379
560
  name: 'MuiSlider'
380
561
  });
381
- const theme = (0, _useTheme.default)();
382
- const isRtl = theme.direction === 'rtl';
562
+ const isRtl = (0, _RtlProvider.useRtl)();
383
563
  const {
384
564
  'aria-label': ariaLabel,
385
565
  'aria-valuetext': ariaValuetext,