@mui/material 6.1.3 → 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/CHANGELOG.md +323 -350
- package/Checkbox/Checkbox.js +1 -0
- package/IconButton/IconButton.js +5 -16
- package/PigmentHidden/PigmentHidden.js +1 -0
- package/Slider/Slider.js +52 -33
- package/index.js +1 -1
- package/modern/Checkbox/Checkbox.js +1 -0
- package/modern/IconButton/IconButton.js +5 -16
- package/modern/PigmentHidden/PigmentHidden.js +1 -0
- package/modern/Slider/Slider.js +52 -33
- package/modern/index.js +1 -1
- package/modern/styles/createPalette.js +78 -70
- package/modern/version/index.js +2 -2
- package/node/Checkbox/Checkbox.js +1 -0
- package/node/IconButton/IconButton.js +5 -16
- package/node/PigmentHidden/PigmentHidden.js +1 -0
- package/node/Slider/Slider.js +50 -32
- package/node/index.js +1 -1
- package/node/styles/createPalette.js +78 -70
- package/node/version/index.js +2 -2
- package/package.json +6 -6
- package/styles/createPalette.js +78 -70
- package/version/index.js +2 -2
package/Checkbox/Checkbox.js
CHANGED
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/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
|
@@ -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/modern/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/modern/index.js
CHANGED
|
@@ -9,70 +9,76 @@ import orange from "../colors/orange.js";
|
|
|
9
9
|
import blue from "../colors/blue.js";
|
|
10
10
|
import lightBlue from "../colors/lightBlue.js";
|
|
11
11
|
import green from "../colors/green.js";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
12
|
+
function getLight() {
|
|
13
|
+
return {
|
|
14
|
+
// The colors used to style the text.
|
|
15
|
+
text: {
|
|
16
|
+
// The most important text.
|
|
17
|
+
primary: 'rgba(0, 0, 0, 0.87)',
|
|
18
|
+
// Secondary text.
|
|
19
|
+
secondary: 'rgba(0, 0, 0, 0.6)',
|
|
20
|
+
// Disabled text have even lower visual prominence.
|
|
21
|
+
disabled: 'rgba(0, 0, 0, 0.38)'
|
|
22
|
+
},
|
|
23
|
+
// The color used to divide different elements.
|
|
24
|
+
divider: 'rgba(0, 0, 0, 0.12)',
|
|
25
|
+
// The background colors used to style the surfaces.
|
|
26
|
+
// Consistency between these values is important.
|
|
27
|
+
background: {
|
|
28
|
+
paper: common.white,
|
|
29
|
+
default: common.white
|
|
30
|
+
},
|
|
31
|
+
// The colors used to style the action elements.
|
|
32
|
+
action: {
|
|
33
|
+
// The color of an active action like an icon button.
|
|
34
|
+
active: 'rgba(0, 0, 0, 0.54)',
|
|
35
|
+
// The color of an hovered action.
|
|
36
|
+
hover: 'rgba(0, 0, 0, 0.04)',
|
|
37
|
+
hoverOpacity: 0.04,
|
|
38
|
+
// The color of a selected action.
|
|
39
|
+
selected: 'rgba(0, 0, 0, 0.08)',
|
|
40
|
+
selectedOpacity: 0.08,
|
|
41
|
+
// The color of a disabled action.
|
|
42
|
+
disabled: 'rgba(0, 0, 0, 0.26)',
|
|
43
|
+
// The background color of a disabled action.
|
|
44
|
+
disabledBackground: 'rgba(0, 0, 0, 0.12)',
|
|
45
|
+
disabledOpacity: 0.38,
|
|
46
|
+
focus: 'rgba(0, 0, 0, 0.12)',
|
|
47
|
+
focusOpacity: 0.12,
|
|
48
|
+
activatedOpacity: 0.12
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export const light = getLight();
|
|
53
|
+
function getDark() {
|
|
54
|
+
return {
|
|
55
|
+
text: {
|
|
56
|
+
primary: common.white,
|
|
57
|
+
secondary: 'rgba(255, 255, 255, 0.7)',
|
|
58
|
+
disabled: 'rgba(255, 255, 255, 0.5)',
|
|
59
|
+
icon: 'rgba(255, 255, 255, 0.5)'
|
|
60
|
+
},
|
|
61
|
+
divider: 'rgba(255, 255, 255, 0.12)',
|
|
62
|
+
background: {
|
|
63
|
+
paper: '#121212',
|
|
64
|
+
default: '#121212'
|
|
65
|
+
},
|
|
66
|
+
action: {
|
|
67
|
+
active: common.white,
|
|
68
|
+
hover: 'rgba(255, 255, 255, 0.08)',
|
|
69
|
+
hoverOpacity: 0.08,
|
|
70
|
+
selected: 'rgba(255, 255, 255, 0.16)',
|
|
71
|
+
selectedOpacity: 0.16,
|
|
72
|
+
disabled: 'rgba(255, 255, 255, 0.3)',
|
|
73
|
+
disabledBackground: 'rgba(255, 255, 255, 0.12)',
|
|
74
|
+
disabledOpacity: 0.38,
|
|
75
|
+
focus: 'rgba(255, 255, 255, 0.12)',
|
|
76
|
+
focusOpacity: 0.12,
|
|
77
|
+
activatedOpacity: 0.24
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export const dark = getDark();
|
|
76
82
|
function addLightOrDark(intent, direction, shade, tonalOffset) {
|
|
77
83
|
const tonalOffsetLight = tonalOffset.light || tonalOffset;
|
|
78
84
|
const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
|
|
@@ -224,12 +230,14 @@ export default function createPalette(palette) {
|
|
|
224
230
|
}
|
|
225
231
|
return color;
|
|
226
232
|
};
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
233
|
+
let modeHydrated;
|
|
234
|
+
if (mode === 'light') {
|
|
235
|
+
modeHydrated = getLight();
|
|
236
|
+
} else if (mode === 'dark') {
|
|
237
|
+
modeHydrated = getDark();
|
|
238
|
+
}
|
|
231
239
|
if (process.env.NODE_ENV !== 'production') {
|
|
232
|
-
if (!
|
|
240
|
+
if (!modeHydrated) {
|
|
233
241
|
console.error(`MUI: The palette mode \`${mode}\` is not supported.`);
|
|
234
242
|
}
|
|
235
243
|
}
|
|
@@ -288,7 +296,7 @@ export default function createPalette(palette) {
|
|
|
288
296
|
// E.g., shift from Red 500 to Red 300 or Red 700.
|
|
289
297
|
tonalOffset,
|
|
290
298
|
// The light and dark mode object.
|
|
291
|
-
...
|
|
299
|
+
...modeHydrated
|
|
292
300
|
}, other);
|
|
293
301
|
return paletteOutput;
|
|
294
302
|
}
|
package/modern/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "6.1.
|
|
1
|
+
export const version = "6.1.4";
|
|
2
2
|
export const major = Number("6");
|
|
3
3
|
export const minor = Number("1");
|
|
4
|
-
export const patch = Number("
|
|
4
|
+
export const patch = Number("4");
|
|
5
5
|
export const prerelease = undefined;
|
|
6
6
|
export default version;
|
|
@@ -148,6 +148,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(inProps, ref) {
|
|
|
148
148
|
ownerState: ownerState,
|
|
149
149
|
ref: ref,
|
|
150
150
|
className: (0, _clsx.default)(classes.root, className),
|
|
151
|
+
disableRipple: disableRipple,
|
|
151
152
|
...other,
|
|
152
153
|
classes: classes
|
|
153
154
|
});
|
|
@@ -56,12 +56,11 @@ const IconButtonRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
|
|
|
56
56
|
duration: theme.transitions.duration.shortest
|
|
57
57
|
}),
|
|
58
58
|
variants: [{
|
|
59
|
-
props:
|
|
60
|
-
disableRipple: false
|
|
61
|
-
},
|
|
59
|
+
props: props => !props.disableRipple,
|
|
62
60
|
style: {
|
|
61
|
+
'--IconButton-hoverBg': theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
63
62
|
'&:hover': {
|
|
64
|
-
backgroundColor:
|
|
63
|
+
backgroundColor: 'var(--IconButton-hoverBg)',
|
|
65
64
|
// Reset on touch devices, it doesn't add specificity
|
|
66
65
|
'@media (hover: none)': {
|
|
67
66
|
backgroundColor: 'transparent'
|
|
@@ -120,17 +119,10 @@ const IconButtonRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
|
|
|
120
119
|
})), ...Object.entries(theme.palette).filter((0, _createSimplePaletteValueFilter.default)()) // check all the used fields in the style below
|
|
121
120
|
.map(([color]) => ({
|
|
122
121
|
props: {
|
|
123
|
-
color
|
|
124
|
-
disableRipple: false
|
|
122
|
+
color
|
|
125
123
|
},
|
|
126
124
|
style: {
|
|
127
|
-
'
|
|
128
|
-
backgroundColor: theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity),
|
|
129
|
-
// Reset on touch devices, it doesn't add specificity
|
|
130
|
-
'@media (hover: none)': {
|
|
131
|
-
backgroundColor: 'transparent'
|
|
132
|
-
}
|
|
133
|
-
}
|
|
125
|
+
'--IconButton-hoverBg': theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity)
|
|
134
126
|
}
|
|
135
127
|
})), {
|
|
136
128
|
props: {
|
|
@@ -171,7 +163,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
171
163
|
color = 'default',
|
|
172
164
|
disabled = false,
|
|
173
165
|
disableFocusRipple = false,
|
|
174
|
-
disableRipple = false,
|
|
175
166
|
size = 'medium',
|
|
176
167
|
...other
|
|
177
168
|
} = props;
|
|
@@ -181,7 +172,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
181
172
|
color,
|
|
182
173
|
disabled,
|
|
183
174
|
disableFocusRipple,
|
|
184
|
-
disableRipple,
|
|
185
175
|
size
|
|
186
176
|
};
|
|
187
177
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -190,7 +180,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
190
180
|
centerRipple: true,
|
|
191
181
|
focusRipple: !disableFocusRipple,
|
|
192
182
|
disabled: disabled,
|
|
193
|
-
disableRipple: disableRipple,
|
|
194
183
|
ref: ref,
|
|
195
184
|
...other,
|
|
196
185
|
ownerState: ownerState,
|