@mui/material 5.2.8 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Autocomplete/Autocomplete.d.ts +7 -0
- package/Autocomplete/Autocomplete.js +20 -10
- package/AvatarGroup/AvatarGroup.d.ts +10 -0
- package/AvatarGroup/AvatarGroup.js +19 -7
- package/Badge/Badge.js +5 -8
- package/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/Button/buttonClasses.d.ts +1 -1
- package/ButtonBase/ButtonBase.d.ts +5 -1
- package/ButtonBase/ButtonBase.js +15 -2
- package/ButtonBase/TouchRipple.js +1 -2
- package/CHANGELOG.md +308 -28
- package/Fab/Fab.d.ts +4 -1
- package/Fab/Fab.js +8 -20
- package/Fab/fabClasses.js +1 -1
- package/FormControlLabel/FormControlLabel.js +11 -3
- package/FormControlLabel/formControlLabelClasses.d.ts +2 -0
- package/FormControlLabel/formControlLabelClasses.js +1 -1
- package/FormGroup/FormGroup.js +14 -3
- package/FormGroup/formGroupClasses.d.ts +2 -0
- package/FormGroup/formGroupClasses.js +1 -1
- package/FormHelperText/FormHelperText.js +7 -9
- package/Grid/Grid.js +2 -4
- package/ImageList/ImageList.js +3 -1
- package/InputAdornment/InputAdornment.js +6 -9
- package/Modal/Modal.js +1 -1
- package/OutlinedInput/NotchedOutline.js +14 -16
- package/OutlinedInput/OutlinedInput.js +1 -1
- package/README.md +9 -9
- package/Radio/RadioButtonIcon.js +2 -6
- package/Rating/Rating.js +1 -1
- package/Select/Select.d.ts +9 -1
- package/Select/Select.js +10 -1
- package/Select/SelectInput.d.ts +1 -0
- package/Select/SelectInput.js +37 -14
- package/Slider/Slider.js +112 -55
- package/Snackbar/Snackbar.js +4 -1
- package/SvgIcon/SvgIcon.js +9 -9
- package/SwipeableDrawer/SwipeArea.js +1 -3
- package/TextField/TextField.js +1 -1
- package/index.d.ts +8 -3
- package/index.js +6 -3
- package/internal/SwitchBase.js +2 -6
- package/legacy/Autocomplete/Autocomplete.js +21 -10
- package/legacy/AvatarGroup/AvatarGroup.js +20 -7
- package/legacy/Badge/Badge.js +6 -8
- package/legacy/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/legacy/ButtonBase/ButtonBase.js +15 -2
- package/legacy/ButtonBase/TouchRipple.js +1 -2
- package/legacy/Fab/Fab.js +8 -20
- package/legacy/Fab/fabClasses.js +1 -1
- package/legacy/FormControlLabel/FormControlLabel.js +11 -3
- package/legacy/FormControlLabel/formControlLabelClasses.js +1 -1
- package/legacy/FormGroup/FormGroup.js +14 -3
- package/legacy/FormGroup/formGroupClasses.js +1 -1
- package/legacy/FormHelperText/FormHelperText.js +7 -9
- package/legacy/Grid/Grid.js +2 -4
- package/legacy/ImageList/ImageList.js +3 -1
- package/legacy/InputAdornment/InputAdornment.js +6 -9
- package/legacy/Modal/Modal.js +1 -1
- package/legacy/OutlinedInput/NotchedOutline.js +14 -16
- package/legacy/OutlinedInput/OutlinedInput.js +1 -1
- package/legacy/Radio/RadioButtonIcon.js +2 -6
- package/legacy/Rating/Rating.js +1 -1
- package/legacy/Select/Select.js +11 -1
- package/legacy/Select/SelectInput.js +41 -17
- package/legacy/Slider/Slider.js +113 -56
- package/legacy/Snackbar/Snackbar.js +4 -1
- package/legacy/SvgIcon/SvgIcon.js +9 -9
- package/legacy/SwipeableDrawer/SwipeArea.js +1 -3
- package/legacy/TextField/TextField.js +1 -1
- package/legacy/index.js +6 -3
- package/legacy/internal/SwitchBase.js +2 -6
- package/legacy/styles/makeStyles.js +1 -1
- package/legacy/styles/withStyles.js +1 -1
- package/legacy/styles/withTheme.js +1 -1
- package/legacy/useMediaQuery/useMediaQuery.js +87 -32
- package/legacy/utils/shouldSpreadAdditionalProps.js +7 -0
- package/modern/Autocomplete/Autocomplete.js +19 -9
- package/modern/AvatarGroup/AvatarGroup.js +17 -7
- package/modern/Badge/Badge.js +5 -8
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/modern/ButtonBase/ButtonBase.js +15 -2
- package/modern/ButtonBase/TouchRipple.js +1 -2
- package/modern/Fab/Fab.js +8 -20
- package/modern/Fab/fabClasses.js +1 -1
- package/modern/FormControlLabel/FormControlLabel.js +11 -3
- package/modern/FormControlLabel/formControlLabelClasses.js +1 -1
- package/modern/FormGroup/FormGroup.js +14 -3
- package/modern/FormGroup/formGroupClasses.js +1 -1
- package/modern/FormHelperText/FormHelperText.js +7 -9
- package/modern/Grid/Grid.js +2 -4
- package/modern/ImageList/ImageList.js +3 -1
- package/modern/InputAdornment/InputAdornment.js +6 -9
- package/modern/Modal/Modal.js +1 -1
- package/modern/OutlinedInput/NotchedOutline.js +14 -16
- package/modern/OutlinedInput/OutlinedInput.js +1 -1
- package/modern/Radio/RadioButtonIcon.js +2 -6
- package/modern/Rating/Rating.js +1 -1
- package/modern/Select/Select.js +10 -1
- package/modern/Select/SelectInput.js +37 -14
- package/modern/Slider/Slider.js +112 -55
- package/modern/Snackbar/Snackbar.js +4 -1
- package/modern/SvgIcon/SvgIcon.js +8 -8
- package/modern/SwipeableDrawer/SwipeArea.js +1 -3
- package/modern/TextField/TextField.js +1 -1
- package/modern/index.js +6 -3
- package/modern/internal/SwitchBase.js +2 -6
- package/modern/styles/makeStyles.js +1 -1
- package/modern/styles/withStyles.js +1 -1
- package/modern/styles/withTheme.js +1 -1
- package/modern/useMediaQuery/useMediaQuery.js +69 -27
- package/modern/utils/shouldSpreadAdditionalProps.js +7 -0
- package/node/Autocomplete/Autocomplete.js +20 -10
- package/node/AvatarGroup/AvatarGroup.js +19 -7
- package/node/Badge/Badge.js +7 -9
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/node/ButtonBase/ButtonBase.js +15 -2
- package/node/ButtonBase/TouchRipple.js +1 -2
- package/node/Fab/Fab.js +8 -20
- package/node/Fab/fabClasses.js +1 -1
- package/node/FormControlLabel/FormControlLabel.js +12 -3
- package/node/FormControlLabel/formControlLabelClasses.js +1 -1
- package/node/FormGroup/FormGroup.js +15 -3
- package/node/FormGroup/formGroupClasses.js +1 -1
- package/node/FormHelperText/FormHelperText.js +6 -9
- package/node/Grid/Grid.js +2 -4
- package/node/ImageList/ImageList.js +3 -1
- package/node/InputAdornment/InputAdornment.js +5 -9
- package/node/Modal/Modal.js +1 -1
- package/node/OutlinedInput/NotchedOutline.js +12 -16
- package/node/OutlinedInput/OutlinedInput.js +1 -1
- package/node/Radio/RadioButtonIcon.js +2 -6
- package/node/Rating/Rating.js +1 -1
- package/node/Select/Select.js +10 -1
- package/node/Select/SelectInput.js +36 -14
- package/node/Slider/Slider.js +98 -47
- package/node/Snackbar/Snackbar.js +4 -1
- package/node/SvgIcon/SvgIcon.js +9 -9
- package/node/SwipeableDrawer/SwipeArea.js +1 -3
- package/node/TextField/TextField.js +1 -1
- package/node/index.js +41 -16
- package/node/internal/SwitchBase.js +2 -6
- package/node/styles/makeStyles.js +1 -1
- package/node/styles/withStyles.js +1 -1
- package/node/styles/withTheme.js +1 -1
- package/node/useMediaQuery/useMediaQuery.js +69 -27
- package/node/utils/shouldSpreadAdditionalProps.js +15 -0
- package/package.json +10 -10
- package/styles/ThemeProvider.d.ts +1 -1
- package/styles/components.d.ts +452 -113
- package/styles/createTheme.d.ts +12 -6
- package/styles/makeStyles.js +1 -1
- package/styles/overrides.d.ts +16 -4
- package/styles/useThemeProps.d.ts +2 -1
- package/styles/withStyles.js +1 -1
- package/styles/withTheme.js +1 -1
- package/umd/material-ui.development.js +5099 -7092
- package/umd/material-ui.production.min.js +21 -21
- package/useMediaQuery/useMediaQuery.d.ts +4 -0
- package/useMediaQuery/useMediaQuery.js +69 -27
- package/utils/shouldSpreadAdditionalProps.js +7 -0
package/legacy/Slider/Slider.js
CHANGED
|
@@ -6,16 +6,17 @@ import * as React from 'react';
|
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import { chainPropTypes } from '@mui/utils';
|
|
9
|
-
import { generateUtilityClasses
|
|
9
|
+
import { generateUtilityClasses } from '@mui/base';
|
|
10
10
|
import SliderUnstyled, { SliderValueLabelUnstyled, sliderUnstyledClasses, getSliderUtilityClass } from '@mui/base/SliderUnstyled';
|
|
11
11
|
import { alpha, lighten, darken } from '@mui/system';
|
|
12
12
|
import useThemeProps from '../styles/useThemeProps';
|
|
13
13
|
import styled, { slotShouldForwardProp } from '../styles/styled';
|
|
14
14
|
import useTheme from '../styles/useTheme';
|
|
15
|
+
import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
|
|
15
16
|
import capitalize from '../utils/capitalize';
|
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
18
|
export var sliderClasses = _extends({}, sliderUnstyledClasses, generateUtilityClasses('MuiSlider', ['colorPrimary', 'colorSecondary', 'thumbColorPrimary', 'thumbColorSecondary', 'sizeSmall', 'thumbSizeSmall']));
|
|
18
|
-
|
|
19
|
+
var SliderRoot = styled('span', {
|
|
19
20
|
name: 'MuiSlider',
|
|
20
21
|
slot: 'Root',
|
|
21
22
|
overridesResolver: function overridesResolver(props, styles) {
|
|
@@ -82,7 +83,21 @@ export var SliderRoot = styled('span', {
|
|
|
82
83
|
transition: 'none'
|
|
83
84
|
})), _extends2));
|
|
84
85
|
});
|
|
85
|
-
|
|
86
|
+
process.env.NODE_ENV !== "production" ? SliderRoot.propTypes
|
|
87
|
+
/* remove-proptypes */
|
|
88
|
+
= {
|
|
89
|
+
// ----------------------------- Warning --------------------------------
|
|
90
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
91
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
92
|
+
// ----------------------------------------------------------------------
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @ignore
|
|
96
|
+
*/
|
|
97
|
+
children: PropTypes.node
|
|
98
|
+
} : void 0;
|
|
99
|
+
export { SliderRoot };
|
|
100
|
+
var SliderRail = styled('span', {
|
|
86
101
|
name: 'MuiSlider',
|
|
87
102
|
slot: 'Rail',
|
|
88
103
|
overridesResolver: function overridesResolver(props, styles) {
|
|
@@ -110,7 +125,21 @@ export var SliderRail = styled('span', {
|
|
|
110
125
|
opacity: 1
|
|
111
126
|
});
|
|
112
127
|
});
|
|
113
|
-
|
|
128
|
+
process.env.NODE_ENV !== "production" ? SliderRail.propTypes
|
|
129
|
+
/* remove-proptypes */
|
|
130
|
+
= {
|
|
131
|
+
// ----------------------------- Warning --------------------------------
|
|
132
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
133
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
134
|
+
// ----------------------------------------------------------------------
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @ignore
|
|
138
|
+
*/
|
|
139
|
+
children: PropTypes.node
|
|
140
|
+
} : void 0;
|
|
141
|
+
export { SliderRail };
|
|
142
|
+
var SliderTrack = styled('span', {
|
|
114
143
|
name: 'MuiSlider',
|
|
115
144
|
slot: 'Track',
|
|
116
145
|
overridesResolver: function overridesResolver(props, styles) {
|
|
@@ -147,7 +176,21 @@ export var SliderTrack = styled('span', {
|
|
|
147
176
|
borderColor: color
|
|
148
177
|
});
|
|
149
178
|
});
|
|
150
|
-
|
|
179
|
+
process.env.NODE_ENV !== "production" ? SliderTrack.propTypes
|
|
180
|
+
/* remove-proptypes */
|
|
181
|
+
= {
|
|
182
|
+
// ----------------------------- Warning --------------------------------
|
|
183
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
184
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
185
|
+
// ----------------------------------------------------------------------
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @ignore
|
|
189
|
+
*/
|
|
190
|
+
children: PropTypes.node
|
|
191
|
+
} : void 0;
|
|
192
|
+
export { SliderTrack };
|
|
193
|
+
var SliderThumb = styled('span', {
|
|
151
194
|
name: 'MuiSlider',
|
|
152
195
|
slot: 'Thumb',
|
|
153
196
|
overridesResolver: function overridesResolver(props, styles) {
|
|
@@ -217,7 +260,21 @@ export var SliderThumb = styled('span', {
|
|
|
217
260
|
}
|
|
218
261
|
}), _extends3));
|
|
219
262
|
});
|
|
220
|
-
|
|
263
|
+
process.env.NODE_ENV !== "production" ? SliderThumb.propTypes
|
|
264
|
+
/* remove-proptypes */
|
|
265
|
+
= {
|
|
266
|
+
// ----------------------------- Warning --------------------------------
|
|
267
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
268
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
269
|
+
// ----------------------------------------------------------------------
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* @ignore
|
|
273
|
+
*/
|
|
274
|
+
children: PropTypes.node
|
|
275
|
+
} : void 0;
|
|
276
|
+
export { SliderThumb };
|
|
277
|
+
var SliderValueLabel = styled(SliderValueLabelUnstyled, {
|
|
221
278
|
name: 'MuiSlider',
|
|
222
279
|
slot: 'ValueLabel',
|
|
223
280
|
overridesResolver: function overridesResolver(props, styles) {
|
|
@@ -262,7 +319,21 @@ export var SliderValueLabel = styled(SliderValueLabelUnstyled, {
|
|
|
262
319
|
}
|
|
263
320
|
});
|
|
264
321
|
});
|
|
265
|
-
|
|
322
|
+
process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes
|
|
323
|
+
/* remove-proptypes */
|
|
324
|
+
= {
|
|
325
|
+
// ----------------------------- Warning --------------------------------
|
|
326
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
327
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
328
|
+
// ----------------------------------------------------------------------
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* @ignore
|
|
332
|
+
*/
|
|
333
|
+
children: PropTypes.node
|
|
334
|
+
} : void 0;
|
|
335
|
+
export { SliderValueLabel };
|
|
336
|
+
var SliderMark = styled('span', {
|
|
266
337
|
name: 'MuiSlider',
|
|
267
338
|
slot: 'Mark',
|
|
268
339
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
@@ -292,7 +363,21 @@ export var SliderMark = styled('span', {
|
|
|
292
363
|
opacity: 0.8
|
|
293
364
|
});
|
|
294
365
|
});
|
|
295
|
-
|
|
366
|
+
process.env.NODE_ENV !== "production" ? SliderMark.propTypes
|
|
367
|
+
/* remove-proptypes */
|
|
368
|
+
= {
|
|
369
|
+
// ----------------------------- Warning --------------------------------
|
|
370
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
371
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
372
|
+
// ----------------------------------------------------------------------
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* @ignore
|
|
376
|
+
*/
|
|
377
|
+
children: PropTypes.node
|
|
378
|
+
} : void 0;
|
|
379
|
+
export { SliderMark };
|
|
380
|
+
var SliderMarkLabel = styled('span', {
|
|
296
381
|
name: 'MuiSlider',
|
|
297
382
|
slot: 'MarkLabel',
|
|
298
383
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
@@ -325,7 +410,9 @@ export var SliderMarkLabel = styled('span', {
|
|
|
325
410
|
color: theme.palette.text.primary
|
|
326
411
|
});
|
|
327
412
|
});
|
|
328
|
-
|
|
413
|
+
process.env.NODE_ENV !== "production" ? SliderMarkLabel.propTypes
|
|
414
|
+
/* remove-proptypes */
|
|
415
|
+
= {
|
|
329
416
|
// ----------------------------- Warning --------------------------------
|
|
330
417
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
331
418
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
@@ -334,40 +421,9 @@ SliderRoot.propTypes = {
|
|
|
334
421
|
/**
|
|
335
422
|
* @ignore
|
|
336
423
|
*/
|
|
337
|
-
children: PropTypes.node
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
* @ignore
|
|
341
|
-
*/
|
|
342
|
-
ownerState: PropTypes.shape({
|
|
343
|
-
'aria-label': PropTypes.string,
|
|
344
|
-
'aria-labelledby': PropTypes.string,
|
|
345
|
-
'aria-valuetext': PropTypes.string,
|
|
346
|
-
classes: PropTypes.object,
|
|
347
|
-
color: PropTypes.oneOf(['primary', 'secondary']),
|
|
348
|
-
defaultValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
|
|
349
|
-
disabled: PropTypes.bool,
|
|
350
|
-
getAriaLabel: PropTypes.func,
|
|
351
|
-
getAriaValueText: PropTypes.func,
|
|
352
|
-
isRtl: PropTypes.bool,
|
|
353
|
-
marks: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.shape({
|
|
354
|
-
label: PropTypes.node,
|
|
355
|
-
value: PropTypes.number.isRequired
|
|
356
|
-
})), PropTypes.bool]),
|
|
357
|
-
max: PropTypes.number,
|
|
358
|
-
min: PropTypes.number,
|
|
359
|
-
name: PropTypes.string,
|
|
360
|
-
onChange: PropTypes.func,
|
|
361
|
-
onChangeCommitted: PropTypes.func,
|
|
362
|
-
orientation: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
363
|
-
scale: PropTypes.func,
|
|
364
|
-
step: PropTypes.number,
|
|
365
|
-
track: PropTypes.oneOf(['inverted', 'normal', false]),
|
|
366
|
-
value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
|
|
367
|
-
valueLabelDisplay: PropTypes.oneOf(['auto', 'off', 'on']),
|
|
368
|
-
valueLabelFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
369
|
-
})
|
|
370
|
-
};
|
|
424
|
+
children: PropTypes.node
|
|
425
|
+
} : void 0;
|
|
426
|
+
export { SliderMarkLabel };
|
|
371
427
|
|
|
372
428
|
var extendUtilityClasses = function extendUtilityClasses(ownerState) {
|
|
373
429
|
var color = ownerState.color,
|
|
@@ -380,21 +436,19 @@ var extendUtilityClasses = function extendUtilityClasses(ownerState) {
|
|
|
380
436
|
});
|
|
381
437
|
};
|
|
382
438
|
|
|
383
|
-
var
|
|
384
|
-
return !Component || !isHostComponent(Component);
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
var Slider = /*#__PURE__*/React.forwardRef(function Slider(sliderProps, ref) {
|
|
439
|
+
var Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
388
440
|
var _componentsProps$root, _componentsProps$thum, _componentsProps$trac, _componentsProps$valu;
|
|
389
441
|
|
|
390
442
|
var props = useThemeProps({
|
|
391
|
-
props:
|
|
443
|
+
props: inputProps,
|
|
392
444
|
name: 'MuiSlider'
|
|
393
445
|
});
|
|
394
446
|
var theme = useTheme();
|
|
395
447
|
var isRtl = theme.direction === 'rtl';
|
|
396
448
|
|
|
397
|
-
var _props$
|
|
449
|
+
var _props$component = props.component,
|
|
450
|
+
component = _props$component === void 0 ? 'span' : _props$component,
|
|
451
|
+
_props$components = props.components,
|
|
398
452
|
components = _props$components === void 0 ? {} : _props$components,
|
|
399
453
|
_props$componentsProp = props.componentsProps,
|
|
400
454
|
componentsProps = _props$componentsProp === void 0 ? {} : _props$componentsProp,
|
|
@@ -402,7 +456,7 @@ var Slider = /*#__PURE__*/React.forwardRef(function Slider(sliderProps, ref) {
|
|
|
402
456
|
color = _props$color === void 0 ? 'primary' : _props$color,
|
|
403
457
|
_props$size = props.size,
|
|
404
458
|
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
405
|
-
other = _objectWithoutProperties(props, ["components", "componentsProps", "color", "size"]);
|
|
459
|
+
other = _objectWithoutProperties(props, ["component", "components", "componentsProps", "color", "size"]);
|
|
406
460
|
|
|
407
461
|
var ownerState = _extends({}, props, {
|
|
408
462
|
color: color,
|
|
@@ -422,25 +476,26 @@ var Slider = /*#__PURE__*/React.forwardRef(function Slider(sliderProps, ref) {
|
|
|
422
476
|
MarkLabel: SliderMarkLabel
|
|
423
477
|
}, components),
|
|
424
478
|
componentsProps: _extends({}, componentsProps, {
|
|
425
|
-
root: _extends({}, componentsProps.root,
|
|
479
|
+
root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
|
|
480
|
+
as: component,
|
|
426
481
|
ownerState: _extends({}, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.ownerState, {
|
|
427
482
|
color: color,
|
|
428
483
|
size: size
|
|
429
484
|
})
|
|
430
485
|
}),
|
|
431
|
-
thumb: _extends({}, componentsProps.thumb,
|
|
486
|
+
thumb: _extends({}, componentsProps.thumb, shouldSpreadAdditionalProps(components.Thumb) && {
|
|
432
487
|
ownerState: _extends({}, (_componentsProps$thum = componentsProps.thumb) == null ? void 0 : _componentsProps$thum.ownerState, {
|
|
433
488
|
color: color,
|
|
434
489
|
size: size
|
|
435
490
|
})
|
|
436
491
|
}),
|
|
437
|
-
track: _extends({}, componentsProps.track,
|
|
492
|
+
track: _extends({}, componentsProps.track, shouldSpreadAdditionalProps(components.Track) && {
|
|
438
493
|
ownerState: _extends({}, (_componentsProps$trac = componentsProps.track) == null ? void 0 : _componentsProps$trac.ownerState, {
|
|
439
494
|
color: color,
|
|
440
495
|
size: size
|
|
441
496
|
})
|
|
442
497
|
}),
|
|
443
|
-
valueLabel: _extends({}, componentsProps.valueLabel,
|
|
498
|
+
valueLabel: _extends({}, componentsProps.valueLabel, shouldSpreadAdditionalProps(components.ValueLabel) && {
|
|
444
499
|
ownerState: _extends({}, (_componentsProps$valu = componentsProps.valueLabel) == null ? void 0 : _componentsProps$valu.ownerState, {
|
|
445
500
|
color: color,
|
|
446
501
|
size: size
|
|
@@ -652,7 +707,9 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
652
707
|
* The size of the slider.
|
|
653
708
|
* @default 'medium'
|
|
654
709
|
*/
|
|
655
|
-
size: PropTypes
|
|
710
|
+
size: PropTypes
|
|
711
|
+
/* @typescript-to-proptypes-ignore */
|
|
712
|
+
.oneOfType([PropTypes.oneOf(['small', 'medium']), PropTypes.string]),
|
|
656
713
|
|
|
657
714
|
/**
|
|
658
715
|
* The granularity with which the slider can step through values. (A "discrete" slider.)
|
|
@@ -289,7 +289,10 @@ var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
289
289
|
onMouseEnter: handleMouseEnter,
|
|
290
290
|
onMouseLeave: handleMouseLeave,
|
|
291
291
|
ownerState: ownerState,
|
|
292
|
-
ref: ref
|
|
292
|
+
ref: ref // ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
|
|
293
|
+
// See https://github.com/mui-org/material-ui/issues/29080
|
|
294
|
+
,
|
|
295
|
+
role: "presentation"
|
|
293
296
|
}, other, {
|
|
294
297
|
children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
|
|
295
298
|
appear: true,
|
|
@@ -29,7 +29,7 @@ var SvgIconRoot = styled('svg', {
|
|
|
29
29
|
return [styles.root, ownerState.color !== 'inherit' && styles["color".concat(capitalize(ownerState.color))], styles["fontSize".concat(capitalize(ownerState.fontSize))]];
|
|
30
30
|
}
|
|
31
31
|
})(function (_ref) {
|
|
32
|
-
var _theme$palette$ownerS, _theme$palette$ownerS2;
|
|
32
|
+
var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$transitions2$d, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _theme$palette$ownerS, _theme$palette, _theme$palette$ownerS2, _theme$palette2, _theme$palette2$actio, _theme$palette3, _theme$palette3$actio;
|
|
33
33
|
|
|
34
34
|
var theme = _ref.theme,
|
|
35
35
|
ownerState = _ref.ownerState;
|
|
@@ -40,19 +40,19 @@ var SvgIconRoot = styled('svg', {
|
|
|
40
40
|
display: 'inline-block',
|
|
41
41
|
fill: 'currentColor',
|
|
42
42
|
flexShrink: 0,
|
|
43
|
-
transition: theme.transitions.create('fill', {
|
|
44
|
-
duration: theme.transitions.duration.shorter
|
|
43
|
+
transition: (_theme$transitions = theme.transitions) == null ? void 0 : (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {
|
|
44
|
+
duration: (_theme$transitions2 = theme.transitions) == null ? void 0 : (_theme$transitions2$d = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2$d.shorter
|
|
45
45
|
}),
|
|
46
46
|
fontSize: {
|
|
47
47
|
inherit: 'inherit',
|
|
48
|
-
small: theme.typography.pxToRem(20),
|
|
49
|
-
medium: theme.typography.pxToRem(24),
|
|
50
|
-
large: theme.typography.pxToRem(35)
|
|
48
|
+
small: ((_theme$typography = theme.typography) == null ? void 0 : (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',
|
|
49
|
+
medium: ((_theme$typography2 = theme.typography) == null ? void 0 : (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',
|
|
50
|
+
large: ((_theme$typography3 = theme.typography) == null ? void 0 : (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875'
|
|
51
51
|
}[ownerState.fontSize],
|
|
52
52
|
// TODO v5 deprecate, v6 remove for sx
|
|
53
|
-
color: (_theme$palette$ownerS = (_theme$palette
|
|
54
|
-
action: theme.palette.action.active,
|
|
55
|
-
disabled: theme.palette.action.disabled,
|
|
53
|
+
color: (_theme$palette$ownerS = (_theme$palette = theme.palette) == null ? void 0 : (_theme$palette$ownerS2 = _theme$palette[ownerState.color]) == null ? void 0 : _theme$palette$ownerS2.main) != null ? _theme$palette$ownerS : {
|
|
54
|
+
action: (_theme$palette2 = theme.palette) == null ? void 0 : (_theme$palette2$actio = _theme$palette2.action) == null ? void 0 : _theme$palette2$actio.active,
|
|
55
|
+
disabled: (_theme$palette3 = theme.palette) == null ? void 0 : (_theme$palette3$actio = _theme$palette3.action) == null ? void 0 : _theme$palette3$actio.disabled,
|
|
56
56
|
inherit: undefined
|
|
57
57
|
}[ownerState.color]
|
|
58
58
|
};
|
|
@@ -8,9 +8,7 @@ import styled from '../styles/styled';
|
|
|
8
8
|
import capitalize from '../utils/capitalize';
|
|
9
9
|
import { isHorizontal } from '../Drawer/Drawer';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
var SwipeAreaRoot = styled('div'
|
|
12
|
-
skipSx: true
|
|
13
|
-
})(function (_ref) {
|
|
11
|
+
var SwipeAreaRoot = styled('div')(function (_ref) {
|
|
14
12
|
var theme = _ref.theme,
|
|
15
13
|
ownerState = _ref.ownerState;
|
|
16
14
|
return _extends({
|
|
@@ -197,7 +197,7 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {
|
|
|
197
197
|
variant: variant,
|
|
198
198
|
ownerState: ownerState
|
|
199
199
|
}, other, {
|
|
200
|
-
children: [label && /*#__PURE__*/_jsx(InputLabel, _extends({
|
|
200
|
+
children: [label != null && label !== '' && /*#__PURE__*/_jsx(InputLabel, _extends({
|
|
201
201
|
htmlFor: id,
|
|
202
202
|
id: inputLabelId
|
|
203
203
|
}, InputLabelProps, {
|
package/legacy/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.4.1
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -8,7 +8,6 @@ import * as colors from './colors';
|
|
|
8
8
|
export { colors };
|
|
9
9
|
export * from './styles';
|
|
10
10
|
export * from './utils';
|
|
11
|
-
export * from '@mui/base';
|
|
12
11
|
export { default as Accordion } from './Accordion';
|
|
13
12
|
export * from './Accordion';
|
|
14
13
|
export { default as AccordionActions } from './AccordionActions';
|
|
@@ -273,4 +272,8 @@ export * from './Zoom'; // createFilterOptions is exported from Autocomplete
|
|
|
273
272
|
export { default as useAutocomplete } from './useAutocomplete';
|
|
274
273
|
export { default as GlobalStyles } from './GlobalStyles';
|
|
275
274
|
export * from './GlobalStyles';
|
|
276
|
-
export { StyledEngineProvider } from './styles';
|
|
275
|
+
export { StyledEngineProvider } from './styles';
|
|
276
|
+
export { default as unstable_composeClasses } from '@mui/base/composeClasses';
|
|
277
|
+
export { default as generateUtilityClass } from '@mui/base/generateUtilityClass';
|
|
278
|
+
export * from '@mui/base/generateUtilityClass';
|
|
279
|
+
export { default as generateUtilityClasses } from '@mui/base/generateUtilityClasses';
|
|
@@ -27,9 +27,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
27
27
|
return composeClasses(slots, getSwitchBaseUtilityClass, classes);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
var SwitchBaseRoot = styled(ButtonBase
|
|
31
|
-
skipSx: true
|
|
32
|
-
})(function (_ref) {
|
|
30
|
+
var SwitchBaseRoot = styled(ButtonBase)(function (_ref) {
|
|
33
31
|
var ownerState = _ref.ownerState;
|
|
34
32
|
return _extends({
|
|
35
33
|
padding: 9,
|
|
@@ -40,9 +38,7 @@ var SwitchBaseRoot = styled(ButtonBase, {
|
|
|
40
38
|
marginRight: ownerState.size === 'small' ? -3 : -12
|
|
41
39
|
});
|
|
42
40
|
});
|
|
43
|
-
var SwitchBaseInput = styled('input'
|
|
44
|
-
skipSx: true
|
|
45
|
-
})({
|
|
41
|
+
var SwitchBaseInput = styled('input')({
|
|
46
42
|
cursor: 'inherit',
|
|
47
43
|
position: 'absolute',
|
|
48
44
|
opacity: 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
2
2
|
export default function makeStyles() {
|
|
3
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: makeStyles is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#material-
|
|
3
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: makeStyles is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#mui-material-styles for more details." : _formatMuiErrorMessage(14));
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
2
2
|
export default function withStyles() {
|
|
3
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: withStyles is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#material-
|
|
3
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: withStyles is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#mui-material-styles for more details." : _formatMuiErrorMessage(15));
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
2
2
|
export default function withTheme() {
|
|
3
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: withTheme is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#material-
|
|
3
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: withTheme is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#mui-material-styles for more details." : _formatMuiErrorMessage(16));
|
|
4
4
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { getThemeProps, useThemeWithoutDefault as useTheme } from '@mui/system';
|
|
3
4
|
import useEnhancedEffect from '../utils/useEnhancedEffect';
|
|
@@ -5,38 +6,9 @@ import useEnhancedEffect from '../utils/useEnhancedEffect';
|
|
|
5
6
|
* @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.
|
|
6
7
|
*/
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10
|
-
var theme = useTheme(); // Wait for jsdom to support the match media feature.
|
|
11
|
-
// All the browsers MUI support have this built-in.
|
|
12
|
-
// This defensive check is here for simplicity.
|
|
13
|
-
// Most of the time, the match media logic isn't central to people tests.
|
|
14
|
-
|
|
9
|
+
function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
|
|
15
10
|
var supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
|
|
16
11
|
|
|
17
|
-
var _getThemeProps = getThemeProps({
|
|
18
|
-
name: 'MuiUseMediaQuery',
|
|
19
|
-
props: options,
|
|
20
|
-
theme: theme
|
|
21
|
-
}),
|
|
22
|
-
_getThemeProps$defaul = _getThemeProps.defaultMatches,
|
|
23
|
-
defaultMatches = _getThemeProps$defaul === void 0 ? false : _getThemeProps$defaul,
|
|
24
|
-
_getThemeProps$matchM = _getThemeProps.matchMedia,
|
|
25
|
-
matchMedia = _getThemeProps$matchM === void 0 ? supportMatchMedia ? window.matchMedia : null : _getThemeProps$matchM,
|
|
26
|
-
_getThemeProps$noSsr = _getThemeProps.noSsr,
|
|
27
|
-
noSsr = _getThemeProps$noSsr === void 0 ? false : _getThemeProps$noSsr,
|
|
28
|
-
_getThemeProps$ssrMat = _getThemeProps.ssrMatchMedia,
|
|
29
|
-
ssrMatchMedia = _getThemeProps$ssrMat === void 0 ? null : _getThemeProps$ssrMat;
|
|
30
|
-
|
|
31
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
32
|
-
if (typeof queryInput === 'function' && theme === null) {
|
|
33
|
-
console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
var query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
|
|
38
|
-
query = query.replace(/^@media( ?)/m, '');
|
|
39
|
-
|
|
40
12
|
var _React$useState = React.useState(function () {
|
|
41
13
|
if (noSsr && supportMatchMedia) {
|
|
42
14
|
return matchMedia(query).matches;
|
|
@@ -67,19 +39,102 @@ export default function useMediaQuery(queryInput) {
|
|
|
67
39
|
var updateMatch = function updateMatch() {
|
|
68
40
|
// Workaround Safari wrong implementation of matchMedia
|
|
69
41
|
// TODO can we remove it?
|
|
70
|
-
// https://github.com/mui
|
|
42
|
+
// https://github.com/mui/material-ui/pull/17315#issuecomment-528286677
|
|
71
43
|
if (active) {
|
|
72
44
|
setMatch(queryList.matches);
|
|
73
45
|
}
|
|
74
46
|
};
|
|
75
47
|
|
|
76
|
-
updateMatch();
|
|
48
|
+
updateMatch(); // TODO: Use `addEventListener` once support for Safari < 14 is dropped
|
|
49
|
+
|
|
77
50
|
queryList.addListener(updateMatch);
|
|
78
51
|
return function () {
|
|
79
52
|
active = false;
|
|
80
53
|
queryList.removeListener(updateMatch);
|
|
81
54
|
};
|
|
82
55
|
}, [query, matchMedia, supportMatchMedia]);
|
|
56
|
+
return match;
|
|
57
|
+
} // eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
var maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];
|
|
61
|
+
|
|
62
|
+
function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
|
|
63
|
+
var getDefaultSnapshot = React.useCallback(function () {
|
|
64
|
+
return defaultMatches;
|
|
65
|
+
}, [defaultMatches]);
|
|
66
|
+
var getServerSnapshot = React.useMemo(function () {
|
|
67
|
+
if (ssrMatchMedia !== null) {
|
|
68
|
+
var _ssrMatchMedia = ssrMatchMedia(query),
|
|
69
|
+
matches = _ssrMatchMedia.matches;
|
|
70
|
+
|
|
71
|
+
return function () {
|
|
72
|
+
return matches;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return getDefaultSnapshot;
|
|
77
|
+
}, [getDefaultSnapshot, query, ssrMatchMedia]);
|
|
78
|
+
|
|
79
|
+
var _React$useMemo = React.useMemo(function () {
|
|
80
|
+
if (matchMedia === null) {
|
|
81
|
+
return [getDefaultSnapshot, function () {
|
|
82
|
+
return function () {};
|
|
83
|
+
}];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
var mediaQueryList = matchMedia(query);
|
|
87
|
+
return [function () {
|
|
88
|
+
return mediaQueryList.matches;
|
|
89
|
+
}, function (notify) {
|
|
90
|
+
// TODO: Use `addEventListener` once support for Safari < 14 is dropped
|
|
91
|
+
mediaQueryList.addListener(notify);
|
|
92
|
+
return function () {
|
|
93
|
+
mediaQueryList.removeListener(notify);
|
|
94
|
+
};
|
|
95
|
+
}];
|
|
96
|
+
}, [getDefaultSnapshot, matchMedia, query]),
|
|
97
|
+
_React$useMemo2 = _slicedToArray(_React$useMemo, 2),
|
|
98
|
+
getSnapshot = _React$useMemo2[0],
|
|
99
|
+
subscribe = _React$useMemo2[1];
|
|
100
|
+
|
|
101
|
+
var match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
102
|
+
return match;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export default function useMediaQuery(queryInput) {
|
|
106
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
107
|
+
var theme = useTheme(); // Wait for jsdom to support the match media feature.
|
|
108
|
+
// All the browsers MUI support have this built-in.
|
|
109
|
+
// This defensive check is here for simplicity.
|
|
110
|
+
// Most of the time, the match media logic isn't central to people tests.
|
|
111
|
+
|
|
112
|
+
var supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
|
|
113
|
+
|
|
114
|
+
var _getThemeProps = getThemeProps({
|
|
115
|
+
name: 'MuiUseMediaQuery',
|
|
116
|
+
props: options,
|
|
117
|
+
theme: theme
|
|
118
|
+
}),
|
|
119
|
+
_getThemeProps$defaul = _getThemeProps.defaultMatches,
|
|
120
|
+
defaultMatches = _getThemeProps$defaul === void 0 ? false : _getThemeProps$defaul,
|
|
121
|
+
_getThemeProps$matchM = _getThemeProps.matchMedia,
|
|
122
|
+
matchMedia = _getThemeProps$matchM === void 0 ? supportMatchMedia ? window.matchMedia : null : _getThemeProps$matchM,
|
|
123
|
+
_getThemeProps$ssrMat = _getThemeProps.ssrMatchMedia,
|
|
124
|
+
ssrMatchMedia = _getThemeProps$ssrMat === void 0 ? null : _getThemeProps$ssrMat,
|
|
125
|
+
noSsr = _getThemeProps.noSsr;
|
|
126
|
+
|
|
127
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
128
|
+
if (typeof queryInput === 'function' && theme === null) {
|
|
129
|
+
console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
var query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
|
|
134
|
+
query = query.replace(/^@media( ?)/m, ''); // TODO: Drop `useMediaQueryOld` and use `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable
|
|
135
|
+
|
|
136
|
+
var useMediaQueryImplementation = maybeReactUseSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;
|
|
137
|
+
var match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);
|
|
83
138
|
|
|
84
139
|
if (process.env.NODE_ENV !== 'production') {
|
|
85
140
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|