@mui/material 5.15.13 → 5.15.15

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