@mui/material 6.1.2 → 6.1.4
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/Badge/Badge.d.ts +2 -2
- package/Badge/Badge.js +12 -8
- package/CHANGELOG.md +357 -310
- package/Checkbox/Checkbox.js +1 -0
- package/Grid2/Grid2.d.ts +16 -11
- package/Grid2/Grid2.js +29 -11
- package/IconButton/IconButton.js +5 -16
- package/InputBase/InputBase.js +1 -1
- package/Modal/useModal.js +6 -0
- package/OutlinedInput/OutlinedInput.js +6 -6
- package/PigmentGrid/PigmentGrid.d.ts +0 -23
- package/PigmentGrid/PigmentGrid.js +0 -23
- package/PigmentHidden/PigmentHidden.js +1 -0
- package/Select/SelectInput.js +1 -1
- package/Slider/Slider.js +52 -33
- package/index.js +1 -1
- package/modern/Badge/Badge.js +12 -8
- package/modern/Checkbox/Checkbox.js +1 -0
- package/modern/Grid2/Grid2.js +29 -11
- package/modern/IconButton/IconButton.js +5 -16
- package/modern/InputBase/InputBase.js +1 -1
- package/modern/Modal/useModal.js +6 -0
- package/modern/OutlinedInput/OutlinedInput.js +6 -6
- package/modern/PigmentGrid/PigmentGrid.js +0 -23
- package/modern/PigmentHidden/PigmentHidden.js +1 -0
- package/modern/Select/SelectInput.js +1 -1
- package/modern/Slider/Slider.js +52 -33
- package/modern/index.js +1 -1
- package/modern/styles/createPalette.js +80 -86
- package/modern/styles/createThemeNoVars.js +1 -2
- package/modern/styles/index.js +1 -1
- package/modern/styles/makeStyles.js +1 -3
- package/modern/styles/responsiveFontSizes.js +1 -2
- package/modern/styles/withStyles.js +1 -3
- package/modern/styles/withTheme.js +1 -3
- package/modern/utils/memoTheme.js +3 -24
- package/modern/version/index.js +2 -2
- package/node/Badge/Badge.js +12 -8
- package/node/Checkbox/Checkbox.js +1 -0
- package/node/Grid2/Grid2.js +29 -11
- package/node/IconButton/IconButton.js +5 -16
- package/node/InputBase/InputBase.js +1 -1
- package/node/Modal/useModal.js +6 -0
- package/node/OutlinedInput/OutlinedInput.js +6 -6
- package/node/PigmentGrid/PigmentGrid.js +0 -23
- package/node/PigmentHidden/PigmentHidden.js +1 -0
- package/node/Select/SelectInput.js +1 -1
- package/node/Slider/Slider.js +50 -32
- package/node/index.js +1 -1
- package/node/styles/createPalette.js +80 -86
- package/node/styles/createThemeNoVars.js +1 -2
- package/node/styles/index.js +1 -1
- package/node/styles/makeStyles.js +1 -3
- package/node/styles/responsiveFontSizes.js +1 -2
- package/node/styles/withStyles.js +1 -3
- package/node/styles/withTheme.js +1 -3
- package/node/utils/memoTheme.js +4 -25
- package/node/version/index.js +2 -2
- package/package.json +7 -7
- package/styles/ThemeProviderWithVars.d.ts +1 -1
- package/styles/createPalette.js +80 -86
- package/styles/createThemeNoVars.js +1 -2
- package/styles/index.js +1 -1
- package/styles/makeStyles.js +1 -3
- package/styles/responsiveFontSizes.js +1 -2
- package/styles/withStyles.js +1 -3
- package/styles/withTheme.js +1 -3
- package/utils/memoTheme.d.ts +4 -10
- package/utils/memoTheme.js +3 -24
- package/version/index.js +2 -2
package/Checkbox/Checkbox.js
CHANGED
package/Grid2/Grid2.d.ts
CHANGED
|
@@ -43,24 +43,29 @@ export interface GridBaseProps {
|
|
|
43
43
|
offset?: ResponsiveStyleValue<GridOffset>;
|
|
44
44
|
/**
|
|
45
45
|
* @internal
|
|
46
|
-
* The level of the grid starts from `0`
|
|
47
|
-
*
|
|
46
|
+
* The level of the grid starts from `0` and increases when the grid nests
|
|
47
|
+
* inside another grid. Nesting is defined as a container Grid being a direct
|
|
48
|
+
* child of a container Grid.
|
|
48
49
|
*
|
|
49
50
|
* ```js
|
|
50
|
-
* <Grid> // level 0
|
|
51
|
-
* <Grid> // level 1
|
|
52
|
-
* <Grid> // level 2
|
|
53
|
-
* <Grid> // level 1
|
|
51
|
+
* <Grid container> // level 0
|
|
52
|
+
* <Grid container> // level 1
|
|
53
|
+
* <Grid container> // level 2
|
|
54
54
|
* ```
|
|
55
55
|
*
|
|
56
|
-
* Only consecutive grid is considered nesting.
|
|
57
|
-
*
|
|
56
|
+
* Only consecutive grid is considered nesting. A grid container will start at
|
|
57
|
+
* `0` if there are non-Grid container element above it.
|
|
58
58
|
*
|
|
59
59
|
* ```js
|
|
60
|
-
* <Grid> // level 0
|
|
60
|
+
* <Grid container> // level 0
|
|
61
61
|
* <div>
|
|
62
|
-
* <Grid> // level 0
|
|
63
|
-
*
|
|
62
|
+
* <Grid container> // level 0
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* ```js
|
|
66
|
+
* <Grid container> // level 0
|
|
67
|
+
* <Grid>
|
|
68
|
+
* <Grid container> // level 0
|
|
64
69
|
* ```
|
|
65
70
|
*/
|
|
66
71
|
unstable_level?: number;
|
package/Grid2/Grid2.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { createGrid as createGrid2 } from '@mui/system/Grid';
|
|
5
|
+
import requirePropFactory from "../utils/requirePropFactory.js";
|
|
5
6
|
import { styled, useThemeProps } from "../styles/index.js";
|
|
6
7
|
/**
|
|
7
8
|
*
|
|
@@ -81,24 +82,29 @@ process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ =
|
|
|
81
82
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
82
83
|
/**
|
|
83
84
|
* @internal
|
|
84
|
-
* The level of the grid starts from `0`
|
|
85
|
-
*
|
|
85
|
+
* The level of the grid starts from `0` and increases when the grid nests
|
|
86
|
+
* inside another grid. Nesting is defined as a container Grid being a direct
|
|
87
|
+
* child of a container Grid.
|
|
86
88
|
*
|
|
87
89
|
* ```js
|
|
88
|
-
* <Grid> // level 0
|
|
89
|
-
* <Grid> // level 1
|
|
90
|
-
* <Grid> // level 2
|
|
91
|
-
* <Grid> // level 1
|
|
90
|
+
* <Grid container> // level 0
|
|
91
|
+
* <Grid container> // level 1
|
|
92
|
+
* <Grid container> // level 2
|
|
92
93
|
* ```
|
|
93
94
|
*
|
|
94
|
-
* Only consecutive grid is considered nesting.
|
|
95
|
-
*
|
|
95
|
+
* Only consecutive grid is considered nesting. A grid container will start at
|
|
96
|
+
* `0` if there are non-Grid container element above it.
|
|
96
97
|
*
|
|
97
98
|
* ```js
|
|
98
|
-
* <Grid> // level 0
|
|
99
|
+
* <Grid container> // level 0
|
|
99
100
|
* <div>
|
|
100
|
-
* <Grid> // level 0
|
|
101
|
-
*
|
|
101
|
+
* <Grid container> // level 0
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* ```js
|
|
105
|
+
* <Grid container> // level 0
|
|
106
|
+
* <Grid>
|
|
107
|
+
* <Grid container> // level 0
|
|
102
108
|
* ```
|
|
103
109
|
*/
|
|
104
110
|
unstable_level: PropTypes.number,
|
|
@@ -109,4 +115,16 @@ process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ =
|
|
|
109
115
|
*/
|
|
110
116
|
wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap'])
|
|
111
117
|
} : void 0;
|
|
118
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
119
|
+
const Component = Grid2;
|
|
120
|
+
const requireProp = requirePropFactory('Grid2', Component);
|
|
121
|
+
// eslint-disable-next-line no-useless-concat
|
|
122
|
+
Component['propTypes' + ''] = {
|
|
123
|
+
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
124
|
+
...Component.propTypes,
|
|
125
|
+
direction: requireProp('container'),
|
|
126
|
+
spacing: requireProp('container'),
|
|
127
|
+
wrap: requireProp('container')
|
|
128
|
+
};
|
|
129
|
+
}
|
|
112
130
|
export default Grid2;
|
package/IconButton/IconButton.js
CHANGED
|
@@ -49,12 +49,11 @@ const IconButtonRoot = styled(ButtonBase, {
|
|
|
49
49
|
duration: theme.transitions.duration.shortest
|
|
50
50
|
}),
|
|
51
51
|
variants: [{
|
|
52
|
-
props:
|
|
53
|
-
disableRipple: false
|
|
54
|
-
},
|
|
52
|
+
props: props => !props.disableRipple,
|
|
55
53
|
style: {
|
|
54
|
+
'--IconButton-hoverBg': theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
56
55
|
'&:hover': {
|
|
57
|
-
backgroundColor:
|
|
56
|
+
backgroundColor: 'var(--IconButton-hoverBg)',
|
|
58
57
|
// Reset on touch devices, it doesn't add specificity
|
|
59
58
|
'@media (hover: none)': {
|
|
60
59
|
backgroundColor: 'transparent'
|
|
@@ -113,17 +112,10 @@ const IconButtonRoot = styled(ButtonBase, {
|
|
|
113
112
|
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()) // check all the used fields in the style below
|
|
114
113
|
.map(([color]) => ({
|
|
115
114
|
props: {
|
|
116
|
-
color
|
|
117
|
-
disableRipple: false
|
|
115
|
+
color
|
|
118
116
|
},
|
|
119
117
|
style: {
|
|
120
|
-
'
|
|
121
|
-
backgroundColor: theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity),
|
|
122
|
-
// Reset on touch devices, it doesn't add specificity
|
|
123
|
-
'@media (hover: none)': {
|
|
124
|
-
backgroundColor: 'transparent'
|
|
125
|
-
}
|
|
126
|
-
}
|
|
118
|
+
'--IconButton-hoverBg': theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity)
|
|
127
119
|
}
|
|
128
120
|
})), {
|
|
129
121
|
props: {
|
|
@@ -164,7 +156,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
164
156
|
color = 'default',
|
|
165
157
|
disabled = false,
|
|
166
158
|
disableFocusRipple = false,
|
|
167
|
-
disableRipple = false,
|
|
168
159
|
size = 'medium',
|
|
169
160
|
...other
|
|
170
161
|
} = props;
|
|
@@ -174,7 +165,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
174
165
|
color,
|
|
175
166
|
disabled,
|
|
176
167
|
disableFocusRipple,
|
|
177
|
-
disableRipple,
|
|
178
168
|
size
|
|
179
169
|
};
|
|
180
170
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -183,7 +173,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
183
173
|
centerRipple: true,
|
|
184
174
|
focusRipple: !disableFocusRipple,
|
|
185
175
|
disabled: disabled,
|
|
186
|
-
disableRipple: disableRipple,
|
|
187
176
|
ref: ref,
|
|
188
177
|
...other,
|
|
189
178
|
ownerState: ownerState,
|
package/InputBase/InputBase.js
CHANGED
|
@@ -372,7 +372,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
372
372
|
if (!isControlled) {
|
|
373
373
|
const element = event.target || inputRef.current;
|
|
374
374
|
if (element == null) {
|
|
375
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
375
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: Expected valid input target. ' + 'Did you use a custom `inputComponent` and forget to forward refs? ' + 'See https://mui.com/r/input-component-ref-interface for more info.' : _formatMuiErrorMessage(1));
|
|
376
376
|
}
|
|
377
377
|
checkDirty({
|
|
378
378
|
value: element.value
|
package/Modal/useModal.js
CHANGED
|
@@ -143,6 +143,12 @@ function useModal(parameters) {
|
|
|
143
143
|
...otherHandlers
|
|
144
144
|
};
|
|
145
145
|
return {
|
|
146
|
+
/*
|
|
147
|
+
* Marking an element with the role presentation indicates to assistive technology
|
|
148
|
+
* that this element should be ignored; it exists to support the web application and
|
|
149
|
+
* is not meant for humans to interact with directly.
|
|
150
|
+
* https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md
|
|
151
|
+
*/
|
|
146
152
|
role: 'presentation',
|
|
147
153
|
...externalEventHandlers,
|
|
148
154
|
onKeyDown: createHandleKeyDown(externalEventHandlers),
|
|
@@ -46,6 +46,12 @@ const OutlinedInputRoot = styled(InputBaseRoot, {
|
|
|
46
46
|
[`&:hover .${outlinedInputClasses.notchedOutline}`]: {
|
|
47
47
|
borderColor: (theme.vars || theme).palette.text.primary
|
|
48
48
|
},
|
|
49
|
+
// Reset on touch devices, it doesn't add specificity
|
|
50
|
+
'@media (hover: none)': {
|
|
51
|
+
[`&:hover .${outlinedInputClasses.notchedOutline}`]: {
|
|
52
|
+
borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
|
|
53
|
+
}
|
|
54
|
+
},
|
|
49
55
|
[`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]: {
|
|
50
56
|
borderWidth: 2
|
|
51
57
|
},
|
|
@@ -62,12 +68,6 @@ const OutlinedInputRoot = styled(InputBaseRoot, {
|
|
|
62
68
|
props: {},
|
|
63
69
|
// to overide the above style
|
|
64
70
|
style: {
|
|
65
|
-
// Reset on touch devices, it doesn't add specificity
|
|
66
|
-
'@media (hover: none)': {
|
|
67
|
-
[`&:hover .${outlinedInputClasses.notchedOutline}`]: {
|
|
68
|
-
borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
71
|
[`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]: {
|
|
72
72
|
borderColor: (theme.vars || theme).palette.error.main
|
|
73
73
|
},
|
|
@@ -40,29 +40,6 @@ export interface GridBaseProps {
|
|
|
40
40
|
* Defines the offset of the grid.
|
|
41
41
|
*/
|
|
42
42
|
offset?: ResponsiveStyleValue<number> | undefined;
|
|
43
|
-
/**
|
|
44
|
-
* @internal
|
|
45
|
-
* The level of the grid starts from `0`
|
|
46
|
-
* and increases when the grid nests inside another grid regardless of container or item.
|
|
47
|
-
*
|
|
48
|
-
* ```js
|
|
49
|
-
* <Grid> // level 0
|
|
50
|
-
* <Grid> // level 1
|
|
51
|
-
* <Grid> // level 2
|
|
52
|
-
* <Grid> // level 1
|
|
53
|
-
* ```
|
|
54
|
-
*
|
|
55
|
-
* Only consecutive grid is considered nesting.
|
|
56
|
-
* A grid container will start at `0` if there are non-Grid element above it.
|
|
57
|
-
*
|
|
58
|
-
* ```js
|
|
59
|
-
* <Grid> // level 0
|
|
60
|
-
* <div>
|
|
61
|
-
* <Grid> // level 0
|
|
62
|
-
* <Grid> // level 1
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
unstable_level?: number;
|
|
66
43
|
/**
|
|
67
44
|
* Defines the vertical space between the type `item` components.
|
|
68
45
|
* It overrides the value of the `spacing` prop.
|
|
@@ -113,29 +113,6 @@ process.env.NODE_ENV !== "production" ? PigmentGrid.propTypes /* remove-proptype
|
|
|
113
113
|
* @ignore
|
|
114
114
|
*/
|
|
115
115
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
116
|
-
/**
|
|
117
|
-
* @internal
|
|
118
|
-
* The level of the grid starts from `0`
|
|
119
|
-
* and increases when the grid nests inside another grid regardless of container or item.
|
|
120
|
-
*
|
|
121
|
-
* ```js
|
|
122
|
-
* <Grid> // level 0
|
|
123
|
-
* <Grid> // level 1
|
|
124
|
-
* <Grid> // level 2
|
|
125
|
-
* <Grid> // level 1
|
|
126
|
-
* ```
|
|
127
|
-
*
|
|
128
|
-
* Only consecutive grid is considered nesting.
|
|
129
|
-
* A grid container will start at `0` if there are non-Grid element above it.
|
|
130
|
-
*
|
|
131
|
-
* ```js
|
|
132
|
-
* <Grid> // level 0
|
|
133
|
-
* <div>
|
|
134
|
-
* <Grid> // level 0
|
|
135
|
-
* <Grid> // level 1
|
|
136
|
-
* ```
|
|
137
|
-
*/
|
|
138
|
-
unstable_level: PropTypes.number,
|
|
139
116
|
/**
|
|
140
117
|
* Defines the `flex-wrap` style property.
|
|
141
118
|
* It's applied for all screen sizes.
|
package/Select/SelectInput.js
CHANGED
|
@@ -347,7 +347,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
347
347
|
let selected;
|
|
348
348
|
if (multiple) {
|
|
349
349
|
if (!Array.isArray(value)) {
|
|
350
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
350
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: The `value` prop must be an array ' + 'when using the `Select` component with `multiple`.' : _formatMuiErrorMessage(2));
|
|
351
351
|
}
|
|
352
352
|
selected = value.some(v => areEqualValues(v, child.props.value));
|
|
353
353
|
if (selected && computeDisplay) {
|
package/Slider/Slider.js
CHANGED
|
@@ -335,7 +335,7 @@ export const SliderThumb = styled('span', {
|
|
|
335
335
|
}
|
|
336
336
|
}))]
|
|
337
337
|
})));
|
|
338
|
-
|
|
338
|
+
const SliderValueLabel = styled(BaseSliderValueLabel, {
|
|
339
339
|
name: 'MuiSlider',
|
|
340
340
|
slot: 'ValueLabel',
|
|
341
341
|
overridesResolver: (props, styles) => styles.valueLabel
|
|
@@ -420,6 +420,29 @@ export const SliderValueLabel = styled(BaseSliderValueLabel, {
|
|
|
420
420
|
}
|
|
421
421
|
}]
|
|
422
422
|
})));
|
|
423
|
+
process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes /* remove-proptypes */ = {
|
|
424
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
425
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
426
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
427
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
428
|
+
/**
|
|
429
|
+
* @ignore
|
|
430
|
+
*/
|
|
431
|
+
children: PropTypes.element.isRequired,
|
|
432
|
+
/**
|
|
433
|
+
* @ignore
|
|
434
|
+
*/
|
|
435
|
+
index: PropTypes.number.isRequired,
|
|
436
|
+
/**
|
|
437
|
+
* @ignore
|
|
438
|
+
*/
|
|
439
|
+
open: PropTypes.bool.isRequired,
|
|
440
|
+
/**
|
|
441
|
+
* @ignore
|
|
442
|
+
*/
|
|
443
|
+
value: PropTypes.number.isRequired
|
|
444
|
+
} : void 0;
|
|
445
|
+
export { SliderValueLabel };
|
|
423
446
|
export const SliderMark = styled('span', {
|
|
424
447
|
name: 'MuiSlider',
|
|
425
448
|
slot: 'Mark',
|
|
@@ -759,40 +782,36 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
759
782
|
const percent = valueToPercent(value, min, max);
|
|
760
783
|
const style = axisProps[axis].offset(percent);
|
|
761
784
|
const ValueLabelComponent = valueLabelDisplay === 'off' ? Forward : ValueLabelSlot;
|
|
762
|
-
return (
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
...
|
|
775
|
-
|
|
785
|
+
return /*#__PURE__*/ /* TODO v6: Change component structure. It will help in avoiding the complicated React.cloneElement API added in SliderValueLabel component. Should be: Thumb -> Input, ValueLabel. Follow Joy UI's Slider structure. */_jsx(ValueLabelComponent, {
|
|
786
|
+
...(!isHostComponent(ValueLabelComponent) && {
|
|
787
|
+
valueLabelFormat,
|
|
788
|
+
valueLabelDisplay,
|
|
789
|
+
value: typeof valueLabelFormat === 'function' ? valueLabelFormat(scale(value), index) : valueLabelFormat,
|
|
790
|
+
index,
|
|
791
|
+
open: open === index || active === index || valueLabelDisplay === 'on',
|
|
792
|
+
disabled
|
|
793
|
+
}),
|
|
794
|
+
...valueLabelProps,
|
|
795
|
+
children: /*#__PURE__*/_jsx(ThumbSlot, {
|
|
796
|
+
"data-index": index,
|
|
797
|
+
...thumbProps,
|
|
798
|
+
className: clsx(classes.thumb, thumbProps.className, active === index && classes.active, focusedThumbIndex === index && classes.focusVisible),
|
|
799
|
+
style: {
|
|
800
|
+
...style,
|
|
801
|
+
...getThumbStyle(index),
|
|
802
|
+
...thumbProps.style
|
|
803
|
+
},
|
|
804
|
+
children: /*#__PURE__*/_jsx(InputSlot, {
|
|
776
805
|
"data-index": index,
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
},
|
|
784
|
-
children: /*#__PURE__*/_jsx(InputSlot, {
|
|
785
|
-
"data-index": index,
|
|
786
|
-
"aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
|
|
787
|
-
"aria-valuenow": scale(value),
|
|
788
|
-
"aria-labelledby": ariaLabelledby,
|
|
789
|
-
"aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext,
|
|
790
|
-
value: values[index],
|
|
791
|
-
...inputSliderProps
|
|
792
|
-
})
|
|
806
|
+
"aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
|
|
807
|
+
"aria-valuenow": scale(value),
|
|
808
|
+
"aria-labelledby": ariaLabelledby,
|
|
809
|
+
"aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext,
|
|
810
|
+
value: values[index],
|
|
811
|
+
...inputSliderProps
|
|
793
812
|
})
|
|
794
|
-
}
|
|
795
|
-
);
|
|
813
|
+
})
|
|
814
|
+
}, index);
|
|
796
815
|
})]
|
|
797
816
|
});
|
|
798
817
|
});
|
package/index.js
CHANGED
package/modern/Badge/Badge.js
CHANGED
|
@@ -210,16 +210,19 @@ const BadgeBadge = styled('span', {
|
|
|
210
210
|
}
|
|
211
211
|
}]
|
|
212
212
|
})));
|
|
213
|
+
function getAnchorOrigin(anchorOrigin) {
|
|
214
|
+
return {
|
|
215
|
+
vertical: anchorOrigin?.vertical ?? 'top',
|
|
216
|
+
horizontal: anchorOrigin?.horizontal ?? 'right'
|
|
217
|
+
};
|
|
218
|
+
}
|
|
213
219
|
const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
214
220
|
const props = useDefaultProps({
|
|
215
221
|
props: inProps,
|
|
216
222
|
name: 'MuiBadge'
|
|
217
223
|
});
|
|
218
224
|
const {
|
|
219
|
-
anchorOrigin: anchorOriginProp
|
|
220
|
-
vertical: 'top',
|
|
221
|
-
horizontal: 'right'
|
|
222
|
-
},
|
|
225
|
+
anchorOrigin: anchorOriginProp,
|
|
223
226
|
className,
|
|
224
227
|
classes: classesProp,
|
|
225
228
|
component,
|
|
@@ -249,7 +252,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
249
252
|
showZero
|
|
250
253
|
});
|
|
251
254
|
const prevProps = usePreviousProps({
|
|
252
|
-
anchorOrigin: anchorOriginProp,
|
|
255
|
+
anchorOrigin: getAnchorOrigin(anchorOriginProp),
|
|
253
256
|
color: colorProp,
|
|
254
257
|
overlap: overlapProp,
|
|
255
258
|
variant: variantProp,
|
|
@@ -259,9 +262,10 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
259
262
|
const {
|
|
260
263
|
color = colorProp,
|
|
261
264
|
overlap = overlapProp,
|
|
262
|
-
anchorOrigin
|
|
265
|
+
anchorOrigin: anchorOriginPropProp,
|
|
263
266
|
variant = variantProp
|
|
264
267
|
} = invisible ? prevProps : props;
|
|
268
|
+
const anchorOrigin = getAnchorOrigin(anchorOriginPropProp);
|
|
265
269
|
const displayValue = variant !== 'dot' ? displayValueFromHook : undefined;
|
|
266
270
|
const ownerState = {
|
|
267
271
|
...props,
|
|
@@ -320,8 +324,8 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
|
|
|
320
324
|
* }
|
|
321
325
|
*/
|
|
322
326
|
anchorOrigin: PropTypes.shape({
|
|
323
|
-
horizontal: PropTypes.oneOf(['left', 'right'])
|
|
324
|
-
vertical: PropTypes.oneOf(['bottom', 'top'])
|
|
327
|
+
horizontal: PropTypes.oneOf(['left', 'right']),
|
|
328
|
+
vertical: PropTypes.oneOf(['bottom', 'top'])
|
|
325
329
|
}),
|
|
326
330
|
/**
|
|
327
331
|
* The content rendered within the badge.
|
package/modern/Grid2/Grid2.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { createGrid as createGrid2 } from '@mui/system/Grid';
|
|
5
|
+
import requirePropFactory from "../utils/requirePropFactory.js";
|
|
5
6
|
import { styled, useThemeProps } from "../styles/index.js";
|
|
6
7
|
/**
|
|
7
8
|
*
|
|
@@ -81,24 +82,29 @@ process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ =
|
|
|
81
82
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
82
83
|
/**
|
|
83
84
|
* @internal
|
|
84
|
-
* The level of the grid starts from `0`
|
|
85
|
-
*
|
|
85
|
+
* The level of the grid starts from `0` and increases when the grid nests
|
|
86
|
+
* inside another grid. Nesting is defined as a container Grid being a direct
|
|
87
|
+
* child of a container Grid.
|
|
86
88
|
*
|
|
87
89
|
* ```js
|
|
88
|
-
* <Grid> // level 0
|
|
89
|
-
* <Grid> // level 1
|
|
90
|
-
* <Grid> // level 2
|
|
91
|
-
* <Grid> // level 1
|
|
90
|
+
* <Grid container> // level 0
|
|
91
|
+
* <Grid container> // level 1
|
|
92
|
+
* <Grid container> // level 2
|
|
92
93
|
* ```
|
|
93
94
|
*
|
|
94
|
-
* Only consecutive grid is considered nesting.
|
|
95
|
-
*
|
|
95
|
+
* Only consecutive grid is considered nesting. A grid container will start at
|
|
96
|
+
* `0` if there are non-Grid container element above it.
|
|
96
97
|
*
|
|
97
98
|
* ```js
|
|
98
|
-
* <Grid> // level 0
|
|
99
|
+
* <Grid container> // level 0
|
|
99
100
|
* <div>
|
|
100
|
-
* <Grid> // level 0
|
|
101
|
-
*
|
|
101
|
+
* <Grid container> // level 0
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* ```js
|
|
105
|
+
* <Grid container> // level 0
|
|
106
|
+
* <Grid>
|
|
107
|
+
* <Grid container> // level 0
|
|
102
108
|
* ```
|
|
103
109
|
*/
|
|
104
110
|
unstable_level: PropTypes.number,
|
|
@@ -109,4 +115,16 @@ process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ =
|
|
|
109
115
|
*/
|
|
110
116
|
wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap'])
|
|
111
117
|
} : void 0;
|
|
118
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
119
|
+
const Component = Grid2;
|
|
120
|
+
const requireProp = requirePropFactory('Grid2', Component);
|
|
121
|
+
// eslint-disable-next-line no-useless-concat
|
|
122
|
+
Component['propTypes' + ''] = {
|
|
123
|
+
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
124
|
+
...Component.propTypes,
|
|
125
|
+
direction: requireProp('container'),
|
|
126
|
+
spacing: requireProp('container'),
|
|
127
|
+
wrap: requireProp('container')
|
|
128
|
+
};
|
|
129
|
+
}
|
|
112
130
|
export default Grid2;
|
|
@@ -49,12 +49,11 @@ const IconButtonRoot = styled(ButtonBase, {
|
|
|
49
49
|
duration: theme.transitions.duration.shortest
|
|
50
50
|
}),
|
|
51
51
|
variants: [{
|
|
52
|
-
props:
|
|
53
|
-
disableRipple: false
|
|
54
|
-
},
|
|
52
|
+
props: props => !props.disableRipple,
|
|
55
53
|
style: {
|
|
54
|
+
'--IconButton-hoverBg': theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
56
55
|
'&:hover': {
|
|
57
|
-
backgroundColor:
|
|
56
|
+
backgroundColor: 'var(--IconButton-hoverBg)',
|
|
58
57
|
// Reset on touch devices, it doesn't add specificity
|
|
59
58
|
'@media (hover: none)': {
|
|
60
59
|
backgroundColor: 'transparent'
|
|
@@ -113,17 +112,10 @@ const IconButtonRoot = styled(ButtonBase, {
|
|
|
113
112
|
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()) // check all the used fields in the style below
|
|
114
113
|
.map(([color]) => ({
|
|
115
114
|
props: {
|
|
116
|
-
color
|
|
117
|
-
disableRipple: false
|
|
115
|
+
color
|
|
118
116
|
},
|
|
119
117
|
style: {
|
|
120
|
-
'
|
|
121
|
-
backgroundColor: theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity),
|
|
122
|
-
// Reset on touch devices, it doesn't add specificity
|
|
123
|
-
'@media (hover: none)': {
|
|
124
|
-
backgroundColor: 'transparent'
|
|
125
|
-
}
|
|
126
|
-
}
|
|
118
|
+
'--IconButton-hoverBg': theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity)
|
|
127
119
|
}
|
|
128
120
|
})), {
|
|
129
121
|
props: {
|
|
@@ -164,7 +156,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
164
156
|
color = 'default',
|
|
165
157
|
disabled = false,
|
|
166
158
|
disableFocusRipple = false,
|
|
167
|
-
disableRipple = false,
|
|
168
159
|
size = 'medium',
|
|
169
160
|
...other
|
|
170
161
|
} = props;
|
|
@@ -174,7 +165,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
174
165
|
color,
|
|
175
166
|
disabled,
|
|
176
167
|
disableFocusRipple,
|
|
177
|
-
disableRipple,
|
|
178
168
|
size
|
|
179
169
|
};
|
|
180
170
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -183,7 +173,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
183
173
|
centerRipple: true,
|
|
184
174
|
focusRipple: !disableFocusRipple,
|
|
185
175
|
disabled: disabled,
|
|
186
|
-
disableRipple: disableRipple,
|
|
187
176
|
ref: ref,
|
|
188
177
|
...other,
|
|
189
178
|
ownerState: ownerState,
|
|
@@ -372,7 +372,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
372
372
|
if (!isControlled) {
|
|
373
373
|
const element = event.target || inputRef.current;
|
|
374
374
|
if (element == null) {
|
|
375
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
375
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: Expected valid input target. ' + 'Did you use a custom `inputComponent` and forget to forward refs? ' + 'See https://mui.com/r/input-component-ref-interface for more info.' : _formatMuiErrorMessage(1));
|
|
376
376
|
}
|
|
377
377
|
checkDirty({
|
|
378
378
|
value: element.value
|
package/modern/Modal/useModal.js
CHANGED
|
@@ -143,6 +143,12 @@ function useModal(parameters) {
|
|
|
143
143
|
...otherHandlers
|
|
144
144
|
};
|
|
145
145
|
return {
|
|
146
|
+
/*
|
|
147
|
+
* Marking an element with the role presentation indicates to assistive technology
|
|
148
|
+
* that this element should be ignored; it exists to support the web application and
|
|
149
|
+
* is not meant for humans to interact with directly.
|
|
150
|
+
* https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md
|
|
151
|
+
*/
|
|
146
152
|
role: 'presentation',
|
|
147
153
|
...externalEventHandlers,
|
|
148
154
|
onKeyDown: createHandleKeyDown(externalEventHandlers),
|