@mui/material 7.2.0 → 7.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/Accordion/Accordion.d.ts +11 -0
- package/Accordion/Accordion.js +19 -5
- package/Alert/Alert.js +2 -3
- package/Autocomplete/Autocomplete.js +4 -4
- package/Button/Button.js +5 -6
- package/ButtonGroup/ButtonGroup.js +3 -4
- package/CHANGELOG.md +76 -0
- package/Checkbox/Checkbox.js +2 -3
- package/Chip/Chip.js +10 -11
- package/Divider/Divider.js +1 -2
- package/FilledInput/FilledInput.js +1 -1
- package/IconButton/IconButton.js +2 -3
- package/Input/Input.js +1 -1
- package/LinearProgress/LinearProgress.js +1 -2
- package/Link/Link.js +11 -4
- package/Link/getTextDecoration.js +5 -0
- package/ListItemButton/ListItemButton.js +4 -5
- package/MenuItem/MenuItem.js +4 -5
- package/OutlinedInput/OutlinedInput.js +2 -2
- package/PaginationItem/PaginationItem.js +7 -8
- package/Radio/Radio.js +2 -3
- package/Select/SelectInput.js +66 -21
- package/Skeleton/Skeleton.js +1 -1
- package/Slider/Slider.js +6 -15
- package/Snackbar/Snackbar.js +2 -8
- package/SpeedDial/SpeedDial.js +20 -6
- package/Switch/Switch.js +6 -4
- package/TableCell/TableCell.js +1 -2
- package/TableRow/TableRow.js +2 -3
- package/ToggleButton/ToggleButton.js +7 -8
- package/Tooltip/Tooltip.js +2 -3
- package/esm/Accordion/Accordion.d.ts +11 -0
- package/esm/Accordion/Accordion.js +19 -5
- package/esm/Alert/Alert.js +2 -3
- package/esm/Autocomplete/Autocomplete.js +4 -4
- package/esm/Button/Button.js +5 -6
- package/esm/ButtonGroup/ButtonGroup.js +3 -4
- package/esm/Checkbox/Checkbox.js +2 -3
- package/esm/Chip/Chip.js +10 -11
- package/esm/Divider/Divider.js +1 -2
- package/esm/FilledInput/FilledInput.js +1 -1
- package/esm/IconButton/IconButton.js +2 -3
- package/esm/Input/Input.js +1 -1
- package/esm/LinearProgress/LinearProgress.js +1 -2
- package/esm/Link/Link.js +11 -4
- package/esm/Link/getTextDecoration.js +5 -0
- package/esm/ListItemButton/ListItemButton.js +4 -5
- package/esm/MenuItem/MenuItem.js +4 -5
- package/esm/OutlinedInput/OutlinedInput.js +2 -2
- package/esm/PaginationItem/PaginationItem.js +7 -8
- package/esm/Radio/Radio.js +2 -3
- package/esm/Select/SelectInput.js +66 -21
- package/esm/Skeleton/Skeleton.js +2 -2
- package/esm/Slider/Slider.js +6 -15
- package/esm/Snackbar/Snackbar.js +2 -8
- package/esm/SpeedDial/SpeedDial.js +20 -6
- package/esm/Switch/Switch.js +6 -4
- package/esm/TableCell/TableCell.js +1 -2
- package/esm/TableRow/TableRow.js +2 -3
- package/esm/ToggleButton/ToggleButton.js +7 -8
- package/esm/Tooltip/Tooltip.js +2 -3
- package/esm/index.js +1 -1
- package/esm/styles/createColorScheme.d.ts +3 -1
- package/esm/styles/createColorScheme.js +6 -1
- package/esm/styles/createPalette.js +29 -2
- package/esm/styles/createTheme.d.ts +1 -1
- package/esm/styles/createThemeNoVars.d.ts +3 -0
- package/esm/styles/createThemeNoVars.js +59 -1
- package/esm/styles/createThemeWithVars.d.ts +4 -0
- package/esm/styles/createThemeWithVars.js +98 -69
- package/esm/useAutocomplete/useAutocomplete.d.ts +1 -0
- package/esm/useAutocomplete/useAutocomplete.js +21 -3
- package/esm/version/index.js +2 -2
- package/index.js +1 -1
- package/package.json +9 -11
- package/styles/createColorScheme.d.ts +3 -1
- package/styles/createColorScheme.js +6 -1
- package/styles/createPalette.js +30 -2
- package/styles/createTheme.d.ts +1 -1
- package/styles/createThemeNoVars.d.ts +3 -0
- package/styles/createThemeNoVars.js +59 -1
- package/styles/createThemeWithVars.d.ts +4 -0
- package/styles/createThemeWithVars.js +98 -69
- package/useAutocomplete/useAutocomplete.d.ts +1 -0
- package/useAutocomplete/useAutocomplete.js +22 -3
- package/version/index.js +2 -2
|
@@ -125,6 +125,10 @@ const AccordionHeading = styled('h3', {
|
|
|
125
125
|
})({
|
|
126
126
|
all: 'unset'
|
|
127
127
|
});
|
|
128
|
+
const AccordionRegion = styled('div', {
|
|
129
|
+
name: 'MuiAccordion',
|
|
130
|
+
slot: 'Region'
|
|
131
|
+
})({});
|
|
128
132
|
const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
|
|
129
133
|
const props = useDefaultProps({
|
|
130
134
|
props: inProps,
|
|
@@ -209,6 +213,17 @@ const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref)
|
|
|
209
213
|
externalForwardedProps,
|
|
210
214
|
ownerState
|
|
211
215
|
});
|
|
216
|
+
const [AccordionRegionSlot, accordionRegionProps] = useSlot('region', {
|
|
217
|
+
elementType: AccordionRegion,
|
|
218
|
+
externalForwardedProps,
|
|
219
|
+
ownerState,
|
|
220
|
+
className: classes.region,
|
|
221
|
+
additionalProps: {
|
|
222
|
+
'aria-labelledby': summary.props.id,
|
|
223
|
+
id: summary.props['aria-controls'],
|
|
224
|
+
role: 'region'
|
|
225
|
+
}
|
|
226
|
+
});
|
|
212
227
|
return /*#__PURE__*/_jsxs(RootSlot, {
|
|
213
228
|
...rootProps,
|
|
214
229
|
children: [/*#__PURE__*/_jsx(AccordionHeadingSlot, {
|
|
@@ -221,11 +236,8 @@ const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref)
|
|
|
221
236
|
in: expanded,
|
|
222
237
|
timeout: "auto",
|
|
223
238
|
...transitionProps,
|
|
224
|
-
children: /*#__PURE__*/_jsx(
|
|
225
|
-
|
|
226
|
-
id: summary.props['aria-controls'],
|
|
227
|
-
role: "region",
|
|
228
|
-
className: classes.region,
|
|
239
|
+
children: /*#__PURE__*/_jsx(AccordionRegionSlot, {
|
|
240
|
+
...accordionRegionProps,
|
|
229
241
|
children: children
|
|
230
242
|
})
|
|
231
243
|
})]
|
|
@@ -290,6 +302,7 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
|
|
|
290
302
|
*/
|
|
291
303
|
slotProps: PropTypes.shape({
|
|
292
304
|
heading: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
305
|
+
region: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
293
306
|
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
294
307
|
transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
295
308
|
}),
|
|
@@ -299,6 +312,7 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
|
|
|
299
312
|
*/
|
|
300
313
|
slots: PropTypes.shape({
|
|
301
314
|
heading: PropTypes.elementType,
|
|
315
|
+
region: PropTypes.elementType,
|
|
302
316
|
root: PropTypes.elementType,
|
|
303
317
|
transition: PropTypes.elementType
|
|
304
318
|
}),
|
package/esm/Alert/Alert.js
CHANGED
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import { darken, lighten } from '@mui/system/colorManipulator';
|
|
8
7
|
import { styled } from "../zero-styled/index.js";
|
|
9
8
|
import memoTheme from "../utils/memoTheme.js";
|
|
10
9
|
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
@@ -47,8 +46,8 @@ const AlertRoot = styled(Paper, {
|
|
|
47
46
|
})(memoTheme(({
|
|
48
47
|
theme
|
|
49
48
|
}) => {
|
|
50
|
-
const getColor = theme.palette.mode === 'light' ? darken : lighten;
|
|
51
|
-
const getBackgroundColor = theme.palette.mode === 'light' ? lighten : darken;
|
|
49
|
+
const getColor = theme.palette.mode === 'light' ? theme.darken : theme.lighten;
|
|
50
|
+
const getBackgroundColor = theme.palette.mode === 'light' ? theme.lighten : theme.darken;
|
|
52
51
|
return {
|
|
53
52
|
...theme.typography.body2,
|
|
54
53
|
backgroundColor: 'transparent',
|
|
@@ -7,7 +7,6 @@ import clsx from 'clsx';
|
|
|
7
7
|
import integerPropType from '@mui/utils/integerPropType';
|
|
8
8
|
import chainPropTypes from '@mui/utils/chainPropTypes';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
-
import { alpha } from '@mui/system/colorManipulator';
|
|
11
10
|
import useAutocomplete, { createFilterOptions } from "../useAutocomplete/index.js";
|
|
12
11
|
import Popper from "../Popper/index.js";
|
|
13
12
|
import ListSubheader from "../ListSubheader/index.js";
|
|
@@ -362,16 +361,16 @@ const AutocompleteListbox = styled('ul', {
|
|
|
362
361
|
backgroundColor: (theme.vars || theme).palette.action.focus
|
|
363
362
|
},
|
|
364
363
|
'&[aria-selected="true"]': {
|
|
365
|
-
backgroundColor: theme.
|
|
364
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.selectedOpacity),
|
|
366
365
|
[`&.${autocompleteClasses.focused}`]: {
|
|
367
|
-
backgroundColor: theme.vars
|
|
366
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.hoverOpacity}`),
|
|
368
367
|
// Reset on touch devices, it doesn't add specificity
|
|
369
368
|
'@media (hover: none)': {
|
|
370
369
|
backgroundColor: (theme.vars || theme).palette.action.selected
|
|
371
370
|
}
|
|
372
371
|
},
|
|
373
372
|
[`&.${autocompleteClasses.focusVisible}`]: {
|
|
374
|
-
backgroundColor: theme.vars
|
|
373
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.focusOpacity}`)
|
|
375
374
|
}
|
|
376
375
|
}
|
|
377
376
|
}
|
|
@@ -912,6 +911,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
912
911
|
* Used to determine the disabled state for a given option.
|
|
913
912
|
*
|
|
914
913
|
* @param {Value} option The option to test.
|
|
914
|
+
* @template Value The option shape. Will be the same shape as an item of the options.
|
|
915
915
|
* @returns {boolean}
|
|
916
916
|
*/
|
|
917
917
|
getOptionDisabled: PropTypes.func,
|
package/esm/Button/Button.js
CHANGED
|
@@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import resolveProps from '@mui/utils/resolveProps';
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
|
-
import { alpha } from '@mui/system/colorManipulator';
|
|
9
8
|
import { unstable_useId as useId } from "../utils/index.js";
|
|
10
9
|
import rootShouldForwardProp from "../styles/rootShouldForwardProp.js";
|
|
11
10
|
import { styled } from "../zero-styled/index.js";
|
|
@@ -159,15 +158,15 @@ const ButtonRoot = styled(ButtonBase, {
|
|
|
159
158
|
style: {
|
|
160
159
|
'--variant-textColor': (theme.vars || theme).palette[color].main,
|
|
161
160
|
'--variant-outlinedColor': (theme.vars || theme).palette[color].main,
|
|
162
|
-
'--variant-outlinedBorder': theme.
|
|
161
|
+
'--variant-outlinedBorder': theme.alpha((theme.vars || theme).palette[color].main, 0.5),
|
|
163
162
|
'--variant-containedColor': (theme.vars || theme).palette[color].contrastText,
|
|
164
163
|
'--variant-containedBg': (theme.vars || theme).palette[color].main,
|
|
165
164
|
'@media (hover: hover)': {
|
|
166
165
|
'&:hover': {
|
|
167
166
|
'--variant-containedBg': (theme.vars || theme).palette[color].dark,
|
|
168
|
-
'--variant-textBg': theme.
|
|
167
|
+
'--variant-textBg': theme.alpha((theme.vars || theme).palette[color].main, (theme.vars || theme).palette.action.hoverOpacity),
|
|
169
168
|
'--variant-outlinedBorder': (theme.vars || theme).palette[color].main,
|
|
170
|
-
'--variant-outlinedBg': theme.
|
|
169
|
+
'--variant-outlinedBg': theme.alpha((theme.vars || theme).palette[color].main, (theme.vars || theme).palette.action.hoverOpacity)
|
|
171
170
|
}
|
|
172
171
|
}
|
|
173
172
|
}
|
|
@@ -182,8 +181,8 @@ const ButtonRoot = styled(ButtonBase, {
|
|
|
182
181
|
'@media (hover: hover)': {
|
|
183
182
|
'&:hover': {
|
|
184
183
|
'--variant-containedBg': theme.vars ? theme.vars.palette.Button.inheritContainedHoverBg : inheritContainedHoverBackgroundColor,
|
|
185
|
-
'--variant-textBg': theme.
|
|
186
|
-
'--variant-outlinedBg': theme.
|
|
184
|
+
'--variant-textBg': theme.alpha((theme.vars || theme).palette.text.primary, (theme.vars || theme).palette.action.hoverOpacity),
|
|
185
|
+
'--variant-outlinedBg': theme.alpha((theme.vars || theme).palette.text.primary, (theme.vars || theme).palette.action.hoverOpacity)
|
|
187
186
|
}
|
|
188
187
|
}
|
|
189
188
|
}
|
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import { alpha } from '@mui/system/colorManipulator';
|
|
8
7
|
import getValidReactChildren from '@mui/utils/getValidReactChildren';
|
|
9
8
|
import capitalize from "../utils/capitalize.js";
|
|
10
9
|
import { styled } from "../zero-styled/index.js";
|
|
@@ -122,7 +121,7 @@ const ButtonGroupRoot = styled('div', {
|
|
|
122
121
|
},
|
|
123
122
|
style: {
|
|
124
123
|
[`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
|
|
125
|
-
borderRight: theme.vars ? `1px solid
|
|
124
|
+
borderRight: theme.vars ? `1px solid ${theme.alpha(theme.vars.palette.common.onBackground, 0.23)}` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`,
|
|
126
125
|
[`&.${buttonGroupClasses.disabled}`]: {
|
|
127
126
|
borderRight: `1px solid ${(theme.vars || theme).palette.action.disabled}`
|
|
128
127
|
}
|
|
@@ -135,7 +134,7 @@ const ButtonGroupRoot = styled('div', {
|
|
|
135
134
|
},
|
|
136
135
|
style: {
|
|
137
136
|
[`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
|
|
138
|
-
borderBottom: theme.vars ? `1px solid
|
|
137
|
+
borderBottom: theme.vars ? `1px solid ${theme.alpha(theme.vars.palette.common.onBackground, 0.23)}` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`,
|
|
139
138
|
[`&.${buttonGroupClasses.disabled}`]: {
|
|
140
139
|
borderBottom: `1px solid ${(theme.vars || theme).palette.action.disabled}`
|
|
141
140
|
}
|
|
@@ -148,7 +147,7 @@ const ButtonGroupRoot = styled('div', {
|
|
|
148
147
|
},
|
|
149
148
|
style: {
|
|
150
149
|
[`& .${buttonGroupClasses.firstButton},& .${buttonGroupClasses.middleButton}`]: {
|
|
151
|
-
borderColor: theme.
|
|
150
|
+
borderColor: theme.alpha((theme.vars || theme).palette[color].main, 0.5)
|
|
152
151
|
}
|
|
153
152
|
}
|
|
154
153
|
}]), {
|
package/esm/Checkbox/Checkbox.js
CHANGED
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import { alpha } from '@mui/system/colorManipulator';
|
|
8
7
|
import SwitchBase from "../internal/SwitchBase.js";
|
|
9
8
|
import CheckBoxOutlineBlankIcon from "../internal/svg-icons/CheckBoxOutlineBlank.js";
|
|
10
9
|
import CheckBoxIcon from "../internal/svg-icons/CheckBox.js";
|
|
@@ -57,7 +56,7 @@ const CheckboxRoot = styled(SwitchBase, {
|
|
|
57
56
|
},
|
|
58
57
|
style: {
|
|
59
58
|
'&:hover': {
|
|
60
|
-
backgroundColor: theme.
|
|
59
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.action.active, (theme.vars || theme).palette.action.hoverOpacity)
|
|
61
60
|
}
|
|
62
61
|
}
|
|
63
62
|
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
|
|
@@ -67,7 +66,7 @@ const CheckboxRoot = styled(SwitchBase, {
|
|
|
67
66
|
},
|
|
68
67
|
style: {
|
|
69
68
|
'&:hover': {
|
|
70
|
-
backgroundColor: theme.
|
|
69
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette[color].main, (theme.vars || theme).palette.action.hoverOpacity)
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
72
|
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
|
package/esm/Chip/Chip.js
CHANGED
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import { alpha } from '@mui/system/colorManipulator';
|
|
8
7
|
import CancelIcon from "../internal/svg-icons/Cancel.js";
|
|
9
8
|
import useForkRef from "../utils/useForkRef.js";
|
|
10
9
|
import unsupportedProp from "../utils/unsupportedProp.js";
|
|
@@ -136,12 +135,12 @@ const ChipRoot = styled('div', {
|
|
|
136
135
|
},
|
|
137
136
|
[`& .${chipClasses.deleteIcon}`]: {
|
|
138
137
|
WebkitTapHighlightColor: 'transparent',
|
|
139
|
-
color: theme.
|
|
138
|
+
color: theme.alpha((theme.vars || theme).palette.text.primary, 0.26),
|
|
140
139
|
fontSize: 22,
|
|
141
140
|
cursor: 'pointer',
|
|
142
141
|
margin: '0 5px 0 -6px',
|
|
143
142
|
'&:hover': {
|
|
144
|
-
color: theme.
|
|
143
|
+
color: theme.alpha((theme.vars || theme).palette.text.primary, 0.4)
|
|
145
144
|
}
|
|
146
145
|
},
|
|
147
146
|
variants: [{
|
|
@@ -170,7 +169,7 @@ const ChipRoot = styled('div', {
|
|
|
170
169
|
backgroundColor: (theme.vars || theme).palette[color].main,
|
|
171
170
|
color: (theme.vars || theme).palette[color].contrastText,
|
|
172
171
|
[`& .${chipClasses.deleteIcon}`]: {
|
|
173
|
-
color: theme.
|
|
172
|
+
color: theme.alpha((theme.vars || theme).palette[color].contrastText, 0.7),
|
|
174
173
|
'&:hover, &:active': {
|
|
175
174
|
color: (theme.vars || theme).palette[color].contrastText
|
|
176
175
|
}
|
|
@@ -197,7 +196,7 @@ const ChipRoot = styled('div', {
|
|
|
197
196
|
},
|
|
198
197
|
style: {
|
|
199
198
|
[`&.${chipClasses.focusVisible}`]: {
|
|
200
|
-
backgroundColor: theme.vars
|
|
199
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.action.selected, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.focusOpacity}`)
|
|
201
200
|
}
|
|
202
201
|
}
|
|
203
202
|
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['dark'])).map(([color]) => {
|
|
@@ -221,10 +220,10 @@ const ChipRoot = styled('div', {
|
|
|
221
220
|
WebkitTapHighlightColor: 'transparent',
|
|
222
221
|
cursor: 'pointer',
|
|
223
222
|
'&:hover': {
|
|
224
|
-
backgroundColor: theme.vars
|
|
223
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.action.selected, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.hoverOpacity}`)
|
|
225
224
|
},
|
|
226
225
|
[`&.${chipClasses.focusVisible}`]: {
|
|
227
|
-
backgroundColor: theme.vars
|
|
226
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.action.selected, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.focusOpacity}`)
|
|
228
227
|
},
|
|
229
228
|
'&:active': {
|
|
230
229
|
boxShadow: (theme.vars || theme).shadows[1]
|
|
@@ -280,15 +279,15 @@ const ChipRoot = styled('div', {
|
|
|
280
279
|
},
|
|
281
280
|
style: {
|
|
282
281
|
color: (theme.vars || theme).palette[color].main,
|
|
283
|
-
border: `1px solid ${theme.
|
|
282
|
+
border: `1px solid ${theme.alpha((theme.vars || theme).palette[color].main, 0.7)}`,
|
|
284
283
|
[`&.${chipClasses.clickable}:hover`]: {
|
|
285
|
-
backgroundColor: theme.
|
|
284
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette[color].main, (theme.vars || theme).palette.action.hoverOpacity)
|
|
286
285
|
},
|
|
287
286
|
[`&.${chipClasses.focusVisible}`]: {
|
|
288
|
-
backgroundColor: theme.
|
|
287
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette[color].main, (theme.vars || theme).palette.action.focusOpacity)
|
|
289
288
|
},
|
|
290
289
|
[`& .${chipClasses.deleteIcon}`]: {
|
|
291
|
-
color: theme.
|
|
290
|
+
color: theme.alpha((theme.vars || theme).palette[color].main, 0.7),
|
|
292
291
|
'&:hover, &:active': {
|
|
293
292
|
color: (theme.vars || theme).palette[color].main
|
|
294
293
|
}
|
package/esm/Divider/Divider.js
CHANGED
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import { alpha } from '@mui/system/colorManipulator';
|
|
8
7
|
import { styled } from "../zero-styled/index.js";
|
|
9
8
|
import memoTheme from "../utils/memoTheme.js";
|
|
10
9
|
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
@@ -61,7 +60,7 @@ const DividerRoot = styled('div', {
|
|
|
61
60
|
light: true
|
|
62
61
|
},
|
|
63
62
|
style: {
|
|
64
|
-
borderColor: theme.
|
|
63
|
+
borderColor: theme.alpha((theme.vars || theme).palette.divider, 0.08)
|
|
65
64
|
}
|
|
66
65
|
}, {
|
|
67
66
|
props: {
|
|
@@ -105,7 +105,7 @@ const FilledInputRoot = styled(InputBaseRoot, {
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
'&::before': {
|
|
108
|
-
borderBottom: `1px solid ${theme.vars ?
|
|
108
|
+
borderBottom: `1px solid ${theme.vars ? theme.alpha(theme.vars.palette.common.onBackground, theme.vars.opacity.inputUnderline) : bottomLineColor}`,
|
|
109
109
|
left: 0,
|
|
110
110
|
bottom: 0,
|
|
111
111
|
content: '"\\00a0"',
|
|
@@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import chainPropTypes from '@mui/utils/chainPropTypes';
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
|
-
import { alpha } from '@mui/system/colorManipulator';
|
|
9
8
|
import { unstable_useId as useId } from "../utils/index.js";
|
|
10
9
|
import { styled } from "../zero-styled/index.js";
|
|
11
10
|
import memoTheme from "../utils/memoTheme.js";
|
|
@@ -56,7 +55,7 @@ const IconButtonRoot = styled(ButtonBase, {
|
|
|
56
55
|
variants: [{
|
|
57
56
|
props: props => !props.disableRipple,
|
|
58
57
|
style: {
|
|
59
|
-
'--IconButton-hoverBg': theme.
|
|
58
|
+
'--IconButton-hoverBg': theme.alpha((theme.vars || theme).palette.action.active, (theme.vars || theme).palette.action.hoverOpacity),
|
|
60
59
|
'&:hover': {
|
|
61
60
|
backgroundColor: 'var(--IconButton-hoverBg)',
|
|
62
61
|
// Reset on touch devices, it doesn't add specificity
|
|
@@ -120,7 +119,7 @@ const IconButtonRoot = styled(ButtonBase, {
|
|
|
120
119
|
color
|
|
121
120
|
},
|
|
122
121
|
style: {
|
|
123
|
-
'--IconButton-hoverBg': theme.
|
|
122
|
+
'--IconButton-hoverBg': theme.alpha((theme.vars || theme).palette[color].main, (theme.vars || theme).palette.action.hoverOpacity)
|
|
124
123
|
}
|
|
125
124
|
})), {
|
|
126
125
|
props: {
|
package/esm/Input/Input.js
CHANGED
|
@@ -46,7 +46,7 @@ const InputRoot = styled(InputBaseRoot, {
|
|
|
46
46
|
const light = theme.palette.mode === 'light';
|
|
47
47
|
let bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';
|
|
48
48
|
if (theme.vars) {
|
|
49
|
-
bottomLineColor =
|
|
49
|
+
bottomLineColor = theme.alpha(theme.vars.palette.common.onBackground, theme.vars.opacity.inputUnderline);
|
|
50
50
|
}
|
|
51
51
|
return {
|
|
52
52
|
position: 'relative',
|
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import { darken, lighten } from '@mui/system/colorManipulator';
|
|
8
7
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
9
8
|
import { keyframes, css, styled } from "../zero-styled/index.js";
|
|
10
9
|
import memoTheme from "../utils/memoTheme.js";
|
|
@@ -93,7 +92,7 @@ const getColorShade = (theme, color) => {
|
|
|
93
92
|
if (theme.vars) {
|
|
94
93
|
return theme.vars.palette.LinearProgress[`${color}Bg`];
|
|
95
94
|
}
|
|
96
|
-
return theme.palette.mode === 'light' ? lighten(theme.palette[color].main, 0.62) : darken(theme.palette[color].main, 0.5);
|
|
95
|
+
return theme.palette.mode === 'light' ? theme.lighten(theme.palette[color].main, 0.62) : theme.darken(theme.palette[color].main, 0.5);
|
|
97
96
|
};
|
|
98
97
|
const LinearProgressRoot = styled('span', {
|
|
99
98
|
name: 'MuiLinearProgress',
|
package/esm/Link/Link.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { alpha } from '@mui/system/colorManipulator';
|
|
7
6
|
import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
|
|
8
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
8
|
import isFocusVisible from '@mui/utils/isFocusVisible';
|
|
@@ -87,13 +86,21 @@ const LinkRoot = styled(Typography, {
|
|
|
87
86
|
style: {
|
|
88
87
|
textDecorationColor: 'var(--Link-underlineColor)'
|
|
89
88
|
}
|
|
89
|
+
}, {
|
|
90
|
+
props: ({
|
|
91
|
+
underline,
|
|
92
|
+
ownerState
|
|
93
|
+
}) => underline === 'always' && ownerState.color === 'inherit',
|
|
94
|
+
style: theme.colorSpace ? {
|
|
95
|
+
textDecorationColor: theme.alpha('currentColor', 0.4)
|
|
96
|
+
} : null
|
|
90
97
|
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
|
|
91
98
|
props: {
|
|
92
99
|
underline: 'always',
|
|
93
100
|
color
|
|
94
101
|
},
|
|
95
102
|
style: {
|
|
96
|
-
'--Link-underlineColor': theme.
|
|
103
|
+
'--Link-underlineColor': theme.alpha((theme.vars || theme).palette[color].main, 0.4)
|
|
97
104
|
}
|
|
98
105
|
})), {
|
|
99
106
|
props: {
|
|
@@ -101,7 +108,7 @@ const LinkRoot = styled(Typography, {
|
|
|
101
108
|
color: 'textPrimary'
|
|
102
109
|
},
|
|
103
110
|
style: {
|
|
104
|
-
'--Link-underlineColor': theme.
|
|
111
|
+
'--Link-underlineColor': theme.alpha((theme.vars || theme).palette.text.primary, 0.4)
|
|
105
112
|
}
|
|
106
113
|
}, {
|
|
107
114
|
props: {
|
|
@@ -109,7 +116,7 @@ const LinkRoot = styled(Typography, {
|
|
|
109
116
|
color: 'textSecondary'
|
|
110
117
|
},
|
|
111
118
|
style: {
|
|
112
|
-
'--Link-underlineColor': theme.
|
|
119
|
+
'--Link-underlineColor': theme.alpha((theme.vars || theme).palette.text.secondary, 0.4)
|
|
113
120
|
}
|
|
114
121
|
}, {
|
|
115
122
|
props: {
|
|
@@ -5,6 +5,11 @@ const getTextDecoration = ({
|
|
|
5
5
|
ownerState
|
|
6
6
|
}) => {
|
|
7
7
|
const transformedColor = ownerState.color;
|
|
8
|
+
if ('colorSpace' in theme && theme.colorSpace) {
|
|
9
|
+
const color = getPath(theme, `palette.${transformedColor}.main`) || getPath(theme, `palette.${transformedColor}`) || ownerState.color;
|
|
10
|
+
return theme.alpha(color, 0.4);
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
// check the `main` color first for a custom palette, then fallback to the color itself
|
|
9
14
|
const color = getPath(theme, `palette.${transformedColor}.main`, false) || getPath(theme, `palette.${transformedColor}`, false) || ownerState.color;
|
|
10
15
|
const channelColor = getPath(theme, `palette.${transformedColor}.mainChannel`) || getPath(theme, `palette.${transformedColor}Channel`);
|
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import { alpha } from '@mui/system/colorManipulator';
|
|
8
7
|
import { styled } from "../zero-styled/index.js";
|
|
9
8
|
import memoTheme from "../utils/memoTheme.js";
|
|
10
9
|
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
@@ -71,16 +70,16 @@ const ListItemButtonRoot = styled(ButtonBase, {
|
|
|
71
70
|
}
|
|
72
71
|
},
|
|
73
72
|
[`&.${listItemButtonClasses.selected}`]: {
|
|
74
|
-
backgroundColor: theme.
|
|
73
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.selectedOpacity),
|
|
75
74
|
[`&.${listItemButtonClasses.focusVisible}`]: {
|
|
76
|
-
backgroundColor: theme.vars
|
|
75
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.focusOpacity}`)
|
|
77
76
|
}
|
|
78
77
|
},
|
|
79
78
|
[`&.${listItemButtonClasses.selected}:hover`]: {
|
|
80
|
-
backgroundColor: theme.vars
|
|
79
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.hoverOpacity}`),
|
|
81
80
|
// Reset on touch devices, it doesn't add specificity
|
|
82
81
|
'@media (hover: none)': {
|
|
83
|
-
backgroundColor: theme.
|
|
82
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.selectedOpacity)
|
|
84
83
|
}
|
|
85
84
|
},
|
|
86
85
|
[`&.${listItemButtonClasses.focusVisible}`]: {
|
package/esm/MenuItem/MenuItem.js
CHANGED
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import { alpha } from '@mui/system/colorManipulator';
|
|
8
7
|
import rootShouldForwardProp from "../styles/rootShouldForwardProp.js";
|
|
9
8
|
import { styled } from "../zero-styled/index.js";
|
|
10
9
|
import memoTheme from "../utils/memoTheme.js";
|
|
@@ -70,16 +69,16 @@ const MenuItemRoot = styled(ButtonBase, {
|
|
|
70
69
|
}
|
|
71
70
|
},
|
|
72
71
|
[`&.${menuItemClasses.selected}`]: {
|
|
73
|
-
backgroundColor: theme.
|
|
72
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.selectedOpacity),
|
|
74
73
|
[`&.${menuItemClasses.focusVisible}`]: {
|
|
75
|
-
backgroundColor: theme.vars
|
|
74
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.focusOpacity}`)
|
|
76
75
|
}
|
|
77
76
|
},
|
|
78
77
|
[`&.${menuItemClasses.selected}:hover`]: {
|
|
79
|
-
backgroundColor: theme.vars
|
|
78
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.hoverOpacity}`),
|
|
80
79
|
// Reset on touch devices, it doesn't add specificity
|
|
81
80
|
'@media (hover: none)': {
|
|
82
|
-
backgroundColor: theme.
|
|
81
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.selectedOpacity)
|
|
83
82
|
}
|
|
84
83
|
},
|
|
85
84
|
[`&.${menuItemClasses.focusVisible}`]: {
|
|
@@ -50,7 +50,7 @@ const OutlinedInputRoot = styled(InputBaseRoot, {
|
|
|
50
50
|
// Reset on touch devices, it doesn't add specificity
|
|
51
51
|
'@media (hover: none)': {
|
|
52
52
|
[`&:hover .${outlinedInputClasses.notchedOutline}`]: {
|
|
53
|
-
borderColor: theme.vars ?
|
|
53
|
+
borderColor: theme.vars ? theme.alpha(theme.vars.palette.common.onBackground, 0.23) : borderColor
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
[`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]: {
|
|
@@ -116,7 +116,7 @@ const NotchedOutlineRoot = styled(NotchedOutline, {
|
|
|
116
116
|
}) => {
|
|
117
117
|
const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
|
|
118
118
|
return {
|
|
119
|
-
borderColor: theme.vars ?
|
|
119
|
+
borderColor: theme.vars ? theme.alpha(theme.vars.palette.common.onBackground, 0.23) : borderColor
|
|
120
120
|
};
|
|
121
121
|
}));
|
|
122
122
|
const OutlinedInputInput = styled(InputBaseInput, {
|
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import { alpha } from '@mui/system/colorManipulator';
|
|
8
7
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
9
8
|
import paginationItemClasses, { getPaginationItemUtilityClass } from "./paginationItemClasses.js";
|
|
10
9
|
import ButtonBase from "../ButtonBase/index.js";
|
|
@@ -126,14 +125,14 @@ const PaginationItemPage = styled(ButtonBase, {
|
|
|
126
125
|
[`&.${paginationItemClasses.selected}`]: {
|
|
127
126
|
backgroundColor: (theme.vars || theme).palette.action.selected,
|
|
128
127
|
'&:hover': {
|
|
129
|
-
backgroundColor: theme.vars
|
|
128
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.action.selected, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.hoverOpacity}`),
|
|
130
129
|
// Reset on touch devices, it doesn't add specificity
|
|
131
130
|
'@media (hover: none)': {
|
|
132
131
|
backgroundColor: (theme.vars || theme).palette.action.selected
|
|
133
132
|
}
|
|
134
133
|
},
|
|
135
134
|
[`&.${paginationItemClasses.focusVisible}`]: {
|
|
136
|
-
backgroundColor: theme.vars
|
|
135
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.action.selected, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.focusOpacity}`)
|
|
137
136
|
},
|
|
138
137
|
[`&.${paginationItemClasses.disabled}`]: {
|
|
139
138
|
opacity: 1,
|
|
@@ -175,7 +174,7 @@ const PaginationItemPage = styled(ButtonBase, {
|
|
|
175
174
|
variant: 'outlined'
|
|
176
175
|
},
|
|
177
176
|
style: {
|
|
178
|
-
border: theme.vars ? `1px solid
|
|
177
|
+
border: theme.vars ? `1px solid ${theme.alpha(theme.vars.palette.common.onBackground, 0.23)}` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`,
|
|
179
178
|
[`&.${paginationItemClasses.selected}`]: {
|
|
180
179
|
[`&.${paginationItemClasses.disabled}`]: {
|
|
181
180
|
borderColor: (theme.vars || theme).palette.action.disabledBackground,
|
|
@@ -226,17 +225,17 @@ const PaginationItemPage = styled(ButtonBase, {
|
|
|
226
225
|
style: {
|
|
227
226
|
[`&.${paginationItemClasses.selected}`]: {
|
|
228
227
|
color: (theme.vars || theme).palette[color].main,
|
|
229
|
-
border: `1px solid ${theme.
|
|
230
|
-
backgroundColor: theme.
|
|
228
|
+
border: `1px solid ${theme.alpha((theme.vars || theme).palette[color].main, 0.5)}`,
|
|
229
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette[color].main, (theme.vars || theme).palette.action.activatedOpacity),
|
|
231
230
|
'&:hover': {
|
|
232
|
-
backgroundColor: theme.vars
|
|
231
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette[color].main, `${(theme.vars || theme).palette.action.activatedOpacity} + ${(theme.vars || theme).palette.action.focusOpacity}`),
|
|
233
232
|
// Reset on touch devices, it doesn't add specificity
|
|
234
233
|
'@media (hover: none)': {
|
|
235
234
|
backgroundColor: 'transparent'
|
|
236
235
|
}
|
|
237
236
|
},
|
|
238
237
|
[`&.${paginationItemClasses.focusVisible}`]: {
|
|
239
|
-
backgroundColor: theme.vars
|
|
238
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette[color].main, `${(theme.vars || theme).palette.action.activatedOpacity} + ${(theme.vars || theme).palette.action.focusOpacity}`)
|
|
240
239
|
}
|
|
241
240
|
}
|
|
242
241
|
}
|
package/esm/Radio/Radio.js
CHANGED
|
@@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import refType from '@mui/utils/refType';
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
|
-
import { alpha } from '@mui/system/colorManipulator';
|
|
9
8
|
import SwitchBase from "../internal/SwitchBase.js";
|
|
10
9
|
import RadioButtonIcon from "./RadioButtonIcon.js";
|
|
11
10
|
import capitalize from "../utils/capitalize.js";
|
|
@@ -59,7 +58,7 @@ const RadioRoot = styled(SwitchBase, {
|
|
|
59
58
|
},
|
|
60
59
|
style: {
|
|
61
60
|
'&:hover': {
|
|
62
|
-
backgroundColor: theme.
|
|
61
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.action.active, (theme.vars || theme).palette.action.hoverOpacity)
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
64
|
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
|
|
@@ -70,7 +69,7 @@ const RadioRoot = styled(SwitchBase, {
|
|
|
70
69
|
},
|
|
71
70
|
style: {
|
|
72
71
|
'&:hover': {
|
|
73
|
-
backgroundColor: theme.
|
|
72
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette[color].main, (theme.vars || theme).palette.action.hoverOpacity)
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
|