@mui/material 5.2.5 → 5.3.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 +2 -0
- package/Autocomplete/Autocomplete.js +10 -6
- package/Avatar/Avatar.d.ts +3 -1
- package/Backdrop/Backdrop.js +3 -1
- package/Badge/Badge.d.ts +25 -0
- package/Badge/Badge.js +31 -15
- package/ButtonGroup/ButtonGroupContext.d.ts +1 -1
- package/CHANGELOG.md +245 -32
- package/FilledInput/FilledInput.js +4 -1
- package/FormControlLabel/FormControlLabel.js +3 -1
- package/Input/Input.js +4 -1
- 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/README.md +19 -24
- package/Select/Select.d.ts +9 -1
- package/Select/Select.js +10 -1
- package/Select/SelectInput.d.ts +1 -0
- package/Select/SelectInput.js +25 -4
- package/Slider/Slider.d.ts +2 -0
- package/Slider/Slider.js +126 -53
- package/StepLabel/StepLabel.js +3 -1
- package/SvgIcon/SvgIcon.d.ts +8 -0
- package/SvgIcon/SvgIcon.js +19 -3
- package/TextField/TextField.d.ts +1 -0
- package/TextField/TextField.js +1 -0
- package/Tooltip/Tooltip.js +6 -1
- package/index.js +1 -1
- package/legacy/Autocomplete/Autocomplete.js +10 -6
- package/legacy/Backdrop/Backdrop.js +3 -1
- package/legacy/Badge/Badge.js +36 -16
- package/legacy/FilledInput/FilledInput.js +4 -1
- package/legacy/FormControlLabel/FormControlLabel.js +3 -1
- package/legacy/Input/Input.js +4 -1
- 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/Select/Select.js +11 -1
- package/legacy/Select/SelectInput.js +29 -7
- package/legacy/Slider/Slider.js +127 -54
- package/legacy/StepLabel/StepLabel.js +3 -1
- package/legacy/SvgIcon/SvgIcon.js +20 -3
- package/legacy/TextField/TextField.js +1 -0
- package/legacy/Tooltip/Tooltip.js +6 -1
- package/legacy/index.js +1 -1
- package/legacy/locale/index.js +224 -130
- package/legacy/utils/shouldSpreadAdditionalProps.js +7 -0
- package/locale/index.d.ts +1 -0
- package/locale/index.js +140 -50
- package/modern/Autocomplete/Autocomplete.js +9 -5
- package/modern/Backdrop/Backdrop.js +3 -1
- package/modern/Badge/Badge.js +31 -15
- package/modern/FilledInput/FilledInput.js +4 -1
- package/modern/FormControlLabel/FormControlLabel.js +3 -1
- package/modern/Input/Input.js +4 -1
- 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/Select/Select.js +10 -1
- package/modern/Select/SelectInput.js +25 -4
- package/modern/Slider/Slider.js +126 -53
- package/modern/StepLabel/StepLabel.js +3 -1
- package/modern/SvgIcon/SvgIcon.js +19 -3
- package/modern/TextField/TextField.js +1 -0
- package/modern/Tooltip/Tooltip.js +6 -1
- package/modern/index.js +1 -1
- package/modern/locale/index.js +140 -50
- package/modern/utils/shouldSpreadAdditionalProps.js +7 -0
- package/node/Autocomplete/Autocomplete.js +10 -6
- package/node/Backdrop/Backdrop.js +3 -1
- package/node/Badge/Badge.js +33 -16
- package/node/FilledInput/FilledInput.js +4 -1
- package/node/FormControlLabel/FormControlLabel.js +3 -1
- package/node/Input/Input.js +4 -1
- 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/Select/Select.js +10 -1
- package/node/Select/SelectInput.js +25 -4
- package/node/Slider/Slider.js +112 -45
- package/node/StepLabel/StepLabel.js +3 -1
- package/node/SvgIcon/SvgIcon.js +19 -3
- package/node/TextField/TextField.js +1 -0
- package/node/Tooltip/Tooltip.js +6 -1
- package/node/index.js +1 -1
- package/node/locale/index.js +142 -51
- package/node/utils/shouldSpreadAdditionalProps.js +15 -0
- package/package.json +7 -7
- 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 +703 -332
- package/umd/material-ui.production.min.js +21 -21
- 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.
|
|
@@ -72,30 +72,38 @@ var SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
72
72
|
_props$fontSize = props.fontSize,
|
|
73
73
|
fontSize = _props$fontSize === void 0 ? 'medium' : _props$fontSize,
|
|
74
74
|
htmlColor = props.htmlColor,
|
|
75
|
+
_props$inheritViewBox = props.inheritViewBox,
|
|
76
|
+
inheritViewBox = _props$inheritViewBox === void 0 ? false : _props$inheritViewBox,
|
|
75
77
|
titleAccess = props.titleAccess,
|
|
76
78
|
_props$viewBox = props.viewBox,
|
|
77
79
|
viewBox = _props$viewBox === void 0 ? '0 0 24 24' : _props$viewBox,
|
|
78
|
-
other = _objectWithoutProperties(props, ["children", "className", "color", "component", "fontSize", "htmlColor", "titleAccess", "viewBox"]);
|
|
80
|
+
other = _objectWithoutProperties(props, ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"]);
|
|
79
81
|
|
|
80
82
|
var ownerState = _extends({}, props, {
|
|
81
83
|
color: color,
|
|
82
84
|
component: component,
|
|
83
85
|
fontSize: fontSize,
|
|
86
|
+
inheritViewBox: inheritViewBox,
|
|
84
87
|
viewBox: viewBox
|
|
85
88
|
});
|
|
86
89
|
|
|
90
|
+
var more = {};
|
|
91
|
+
|
|
92
|
+
if (!inheritViewBox) {
|
|
93
|
+
more.viewBox = viewBox;
|
|
94
|
+
}
|
|
95
|
+
|
|
87
96
|
var classes = useUtilityClasses(ownerState);
|
|
88
97
|
return /*#__PURE__*/_jsxs(SvgIconRoot, _extends({
|
|
89
98
|
as: component,
|
|
90
99
|
className: clsx(classes.root, className),
|
|
91
100
|
ownerState: ownerState,
|
|
92
101
|
focusable: "false",
|
|
93
|
-
viewBox: viewBox,
|
|
94
102
|
color: htmlColor,
|
|
95
103
|
"aria-hidden": titleAccess ? undefined : true,
|
|
96
104
|
role: titleAccess ? 'img' : undefined,
|
|
97
105
|
ref: ref
|
|
98
|
-
}, other, {
|
|
106
|
+
}, more, other, {
|
|
99
107
|
children: [children, titleAccess ? /*#__PURE__*/_jsx("title", {
|
|
100
108
|
children: titleAccess
|
|
101
109
|
}) : null]
|
|
@@ -152,6 +160,15 @@ process.env.NODE_ENV !== "production" ? SvgIcon.propTypes
|
|
|
152
160
|
*/
|
|
153
161
|
htmlColor: PropTypes.string,
|
|
154
162
|
|
|
163
|
+
/**
|
|
164
|
+
* If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`
|
|
165
|
+
* prop will be ignored.
|
|
166
|
+
* Useful when you want to reference a custom `component` and have `SvgIcon` pass that
|
|
167
|
+
* `component`'s viewBox to the root node.
|
|
168
|
+
* @default false
|
|
169
|
+
*/
|
|
170
|
+
inheritViewBox: PropTypes.bool,
|
|
171
|
+
|
|
155
172
|
/**
|
|
156
173
|
* The shape-rendering attribute. The behavior of the different options is described on the
|
|
157
174
|
* [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering).
|
|
@@ -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