@mui/material 5.2.7 → 5.4.0
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 +22 -10
- package/Backdrop/Backdrop.js +3 -1
- package/Badge/Badge.js +6 -7
- package/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/Button/buttonClasses.d.ts +1 -1
- package/ButtonBase/TouchRipple.js +1 -2
- package/CHANGELOG.md +284 -33
- package/FilledInput/FilledInput.js +4 -1
- package/FormControlLabel/FormControlLabel.js +14 -4
- 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/Input/Input.js +4 -1
- package/InputAdornment/InputAdornment.js +6 -9
- package/InputBase/InputBase.js +4 -1
- package/InputLabel/InputLabel.js +4 -0
- package/ListItem/ListItem.js +3 -1
- package/Modal/Modal.js +3 -1
- package/OutlinedInput/NotchedOutline.js +14 -16
- package/OutlinedInput/OutlinedInput.js +1 -1
- package/README.md +5 -4
- package/Radio/RadioButtonIcon.js +2 -6
- package/Select/Select.d.ts +9 -1
- package/Select/Select.js +10 -1
- package/Select/SelectInput.d.ts +1 -0
- package/Select/SelectInput.js +32 -13
- package/Slider/Slider.d.ts +2 -0
- package/Slider/Slider.js +126 -53
- package/StepLabel/StepLabel.js +3 -1
- package/SvgIcon/SvgIcon.js +9 -9
- package/SwipeableDrawer/SwipeArea.js +1 -3
- package/TextField/TextField.d.ts +1 -0
- package/TextField/TextField.js +2 -1
- package/Tooltip/Tooltip.js +6 -1
- package/index.d.ts +7 -2
- package/index.js +6 -3
- package/internal/SwitchBase.js +2 -6
- package/legacy/Autocomplete/Autocomplete.js +23 -10
- package/legacy/Backdrop/Backdrop.js +3 -1
- package/legacy/Badge/Badge.js +6 -7
- package/legacy/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/legacy/ButtonBase/TouchRipple.js +1 -2
- package/legacy/FilledInput/FilledInput.js +4 -1
- package/legacy/FormControlLabel/FormControlLabel.js +14 -4
- 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/Input/Input.js +4 -1
- package/legacy/InputAdornment/InputAdornment.js +6 -9
- package/legacy/InputBase/InputBase.js +4 -1
- package/legacy/InputLabel/InputLabel.js +4 -0
- package/legacy/ListItem/ListItem.js +3 -1
- package/legacy/Modal/Modal.js +3 -1
- package/legacy/OutlinedInput/NotchedOutline.js +14 -16
- package/legacy/OutlinedInput/OutlinedInput.js +1 -1
- package/legacy/Radio/RadioButtonIcon.js +2 -6
- package/legacy/Select/Select.js +11 -1
- package/legacy/Select/SelectInput.js +36 -16
- package/legacy/Slider/Slider.js +127 -54
- package/legacy/StepLabel/StepLabel.js +3 -1
- package/legacy/SvgIcon/SvgIcon.js +9 -9
- package/legacy/SwipeableDrawer/SwipeArea.js +1 -3
- package/legacy/TextField/TextField.js +2 -1
- package/legacy/Tooltip/Tooltip.js +6 -1
- package/legacy/index.js +6 -3
- package/legacy/internal/SwitchBase.js +2 -6
- package/legacy/useMediaQuery/useMediaQuery.js +86 -31
- package/legacy/utils/shouldSpreadAdditionalProps.js +7 -0
- package/modern/Autocomplete/Autocomplete.js +21 -9
- package/modern/Backdrop/Backdrop.js +3 -1
- package/modern/Badge/Badge.js +6 -7
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/modern/ButtonBase/TouchRipple.js +1 -2
- package/modern/FilledInput/FilledInput.js +4 -1
- package/modern/FormControlLabel/FormControlLabel.js +14 -4
- 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/Input/Input.js +4 -1
- package/modern/InputAdornment/InputAdornment.js +6 -9
- package/modern/InputBase/InputBase.js +4 -1
- package/modern/InputLabel/InputLabel.js +4 -0
- package/modern/ListItem/ListItem.js +3 -1
- package/modern/Modal/Modal.js +3 -1
- package/modern/OutlinedInput/NotchedOutline.js +14 -16
- package/modern/OutlinedInput/OutlinedInput.js +1 -1
- package/modern/Radio/RadioButtonIcon.js +2 -6
- package/modern/Select/Select.js +10 -1
- package/modern/Select/SelectInput.js +32 -13
- package/modern/Slider/Slider.js +126 -53
- package/modern/StepLabel/StepLabel.js +3 -1
- package/modern/SvgIcon/SvgIcon.js +8 -8
- package/modern/SwipeableDrawer/SwipeArea.js +1 -3
- package/modern/TextField/TextField.js +2 -1
- package/modern/Tooltip/Tooltip.js +6 -1
- package/modern/index.js +6 -3
- package/modern/internal/SwitchBase.js +2 -6
- package/modern/useMediaQuery/useMediaQuery.js +68 -26
- package/modern/utils/shouldSpreadAdditionalProps.js +7 -0
- package/node/Autocomplete/Autocomplete.js +22 -10
- package/node/Backdrop/Backdrop.js +3 -1
- package/node/Badge/Badge.js +8 -8
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/node/ButtonBase/TouchRipple.js +1 -2
- package/node/FilledInput/FilledInput.js +4 -1
- package/node/FormControlLabel/FormControlLabel.js +15 -4
- 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/Input/Input.js +4 -1
- package/node/InputAdornment/InputAdornment.js +5 -9
- package/node/InputBase/InputBase.js +4 -1
- package/node/InputLabel/InputLabel.js +4 -0
- package/node/ListItem/ListItem.js +3 -1
- package/node/Modal/Modal.js +3 -1
- package/node/OutlinedInput/NotchedOutline.js +12 -16
- package/node/OutlinedInput/OutlinedInput.js +1 -1
- package/node/Radio/RadioButtonIcon.js +2 -6
- package/node/Select/Select.js +10 -1
- package/node/Select/SelectInput.js +31 -13
- package/node/Slider/Slider.js +112 -45
- package/node/StepLabel/StepLabel.js +3 -1
- package/node/SvgIcon/SvgIcon.js +9 -9
- package/node/SwipeableDrawer/SwipeArea.js +1 -3
- package/node/TextField/TextField.js +2 -1
- package/node/Tooltip/Tooltip.js +6 -1
- package/node/index.js +41 -16
- package/node/internal/SwitchBase.js +2 -6
- package/node/useMediaQuery/useMediaQuery.js +68 -26
- package/node/utils/shouldSpreadAdditionalProps.js +15 -0
- package/package.json +7 -7
- package/styles/ThemeProvider.d.ts +1 -1
- package/styles/components.d.ts +452 -113
- package/styles/createTheme.d.ts +12 -6
- package/styles/overrides.d.ts +16 -4
- package/styles/useThemeProps.d.ts +2 -1
- package/umd/material-ui.development.js +2988 -4926
- package/umd/material-ui.production.min.js +21 -21
- package/useMediaQuery/useMediaQuery.d.ts +4 -0
- package/useMediaQuery/useMediaQuery.js +68 -26
- 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,10 +436,6 @@ var extendUtilityClasses = function extendUtilityClasses(ownerState) {
|
|
|
380
436
|
});
|
|
381
437
|
};
|
|
382
438
|
|
|
383
|
-
var shouldSpreadOwnerState = function shouldSpreadOwnerState(Component) {
|
|
384
|
-
return !Component || !isHostComponent(Component);
|
|
385
|
-
};
|
|
386
|
-
|
|
387
439
|
var Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
388
440
|
var _componentsProps$root, _componentsProps$thum, _componentsProps$trac, _componentsProps$valu;
|
|
389
441
|
|
|
@@ -394,7 +446,9 @@ var Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
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(inputProps, 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(inputProps, 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
|
|
@@ -514,6 +569,7 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
514
569
|
* @default {}
|
|
515
570
|
*/
|
|
516
571
|
components: PropTypes.shape({
|
|
572
|
+
Input: PropTypes.elementType,
|
|
517
573
|
Mark: PropTypes.elementType,
|
|
518
574
|
MarkLabel: PropTypes.elementType,
|
|
519
575
|
Rail: PropTypes.elementType,
|
|
@@ -527,7 +583,24 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
527
583
|
* The props used for each slot inside the Slider.
|
|
528
584
|
* @default {}
|
|
529
585
|
*/
|
|
530
|
-
componentsProps: PropTypes.
|
|
586
|
+
componentsProps: PropTypes.shape({
|
|
587
|
+
input: PropTypes.object,
|
|
588
|
+
mark: PropTypes.object,
|
|
589
|
+
markLabel: PropTypes.object,
|
|
590
|
+
rail: PropTypes.object,
|
|
591
|
+
root: PropTypes.object,
|
|
592
|
+
thumb: PropTypes.object,
|
|
593
|
+
track: PropTypes.object,
|
|
594
|
+
valueLabel: PropTypes.shape({
|
|
595
|
+
className: PropTypes.string,
|
|
596
|
+
components: PropTypes.shape({
|
|
597
|
+
Root: PropTypes.elementType
|
|
598
|
+
}),
|
|
599
|
+
style: PropTypes.object,
|
|
600
|
+
value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
|
|
601
|
+
valueLabelDisplay: PropTypes.oneOf(['auto', 'off', 'on'])
|
|
602
|
+
})
|
|
603
|
+
}),
|
|
531
604
|
|
|
532
605
|
/**
|
|
533
606
|
* The default value. Use when the component is not controlled.
|
|
@@ -209,7 +209,9 @@ process.env.NODE_ENV !== "production" ? StepLabel.propTypes
|
|
|
209
209
|
* The props used for each slot inside.
|
|
210
210
|
* @default {}
|
|
211
211
|
*/
|
|
212
|
-
componentsProps: PropTypes.
|
|
212
|
+
componentsProps: PropTypes.shape({
|
|
213
|
+
label: PropTypes.object
|
|
214
|
+
}),
|
|
213
215
|
|
|
214
216
|
/**
|
|
215
217
|
* If `true`, the step is marked as failed.
|
|
@@ -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, {
|
|
@@ -302,6 +302,7 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes
|
|
|
302
302
|
|
|
303
303
|
/**
|
|
304
304
|
* Props applied to the [`InputLabel`](/api/input-label/) element.
|
|
305
|
+
* Pointer events like `onClick` are enabled if and only if `shrink` is `true`.
|
|
305
306
|
*/
|
|
306
307
|
InputLabelProps: PropTypes.object,
|
|
307
308
|
|
|
@@ -705,7 +705,12 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
|
|
|
705
705
|
* and `componentsProps.transition` prop values win over `TransitionProps` if both are applied.
|
|
706
706
|
* @default {}
|
|
707
707
|
*/
|
|
708
|
-
componentsProps: PropTypes.
|
|
708
|
+
componentsProps: PropTypes.shape({
|
|
709
|
+
arrow: PropTypes.object,
|
|
710
|
+
popper: PropTypes.object,
|
|
711
|
+
tooltip: PropTypes.object,
|
|
712
|
+
transition: PropTypes.object
|
|
713
|
+
}),
|
|
709
714
|
|
|
710
715
|
/**
|
|
711
716
|
* Set to `true` if the `title` acts as an accessible description.
|
package/legacy/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.4.0
|
|
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,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;
|
|
@@ -73,13 +45,96 @@ export default function useMediaQuery(queryInput) {
|
|
|
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
|