@mui/material 7.1.2 → 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/Backdrop/Backdrop.js +1 -0
- package/Breadcrumbs/BreadcrumbCollapsed.js +3 -1
- package/Button/Button.js +5 -6
- package/ButtonGroup/ButtonGroup.js +3 -4
- package/CHANGELOG.md +141 -0
- package/Checkbox/Checkbox.js +2 -3
- package/Chip/Chip.js +11 -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/Input/inputClasses.d.ts +12 -4
- 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/NativeSelect/NativeSelectInput.js +6 -2
- package/OutlinedInput/NotchedOutline.js +2 -0
- package/OutlinedInput/OutlinedInput.js +2 -2
- package/OutlinedInput/outlinedInputClasses.d.ts +12 -4
- package/PaginationItem/PaginationItem.js +7 -8
- package/Radio/Radio.js +2 -3
- package/Radio/RadioButtonIcon.js +7 -2
- package/Select/SelectInput.js +69 -20
- 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/SwipeableDrawer/SwipeArea.js +1 -0
- 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/Backdrop/Backdrop.js +1 -0
- package/esm/Breadcrumbs/BreadcrumbCollapsed.js +3 -1
- 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 +11 -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/Input/inputClasses.d.ts +12 -4
- 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/NativeSelect/NativeSelectInput.js +6 -2
- package/esm/OutlinedInput/NotchedOutline.js +2 -0
- package/esm/OutlinedInput/OutlinedInput.js +2 -2
- package/esm/OutlinedInput/outlinedInputClasses.d.ts +12 -4
- package/esm/PaginationItem/PaginationItem.js +7 -8
- package/esm/Radio/Radio.js +2 -3
- package/esm/Radio/RadioButtonIcon.js +7 -2
- package/esm/Select/SelectInput.js +69 -20
- 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/SwipeableDrawer/SwipeArea.js +1 -0
- 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/internal/SwitchBase.js +4 -1
- package/esm/locale/index.js +6 -3
- package/esm/styles/components.d.ts +5 -0
- 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 +4 -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/styles/shouldSkipGeneratingVar.js +1 -1
- package/esm/useAutocomplete/useAutocomplete.d.ts +1 -0
- package/esm/useAutocomplete/useAutocomplete.js +21 -3
- package/esm/version/index.js +3 -3
- package/index.js +1 -1
- package/internal/SwitchBase.js +4 -1
- package/locale/index.js +6 -3
- package/package.json +9 -11
- package/styles/components.d.ts +5 -0
- 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 +4 -0
- package/styles/createThemeNoVars.js +59 -1
- package/styles/createThemeWithVars.d.ts +4 -0
- package/styles/createThemeWithVars.js +98 -69
- package/styles/shouldSkipGeneratingVar.js +1 -1
- package/useAutocomplete/useAutocomplete.d.ts +1 -0
- package/useAutocomplete/useAutocomplete.js +22 -3
- package/version/index.js +3 -3
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}`]: {
|
|
@@ -25,7 +25,9 @@ const useUtilityClasses = ownerState => {
|
|
|
25
25
|
};
|
|
26
26
|
return composeClasses(slots, getNativeSelectUtilityClasses, classes);
|
|
27
27
|
};
|
|
28
|
-
export const StyledSelectSelect = styled('select'
|
|
28
|
+
export const StyledSelectSelect = styled('select', {
|
|
29
|
+
name: 'MuiNativeSelect'
|
|
30
|
+
})(({
|
|
29
31
|
theme
|
|
30
32
|
}) => ({
|
|
31
33
|
// Reset
|
|
@@ -99,7 +101,9 @@ const NativeSelectSelect = styled(StyledSelectSelect, {
|
|
|
99
101
|
}];
|
|
100
102
|
}
|
|
101
103
|
})({});
|
|
102
|
-
export const StyledSelectIcon = styled('svg'
|
|
104
|
+
export const StyledSelectIcon = styled('svg', {
|
|
105
|
+
name: 'MuiNativeSelect'
|
|
106
|
+
})(({
|
|
103
107
|
theme
|
|
104
108
|
}) => ({
|
|
105
109
|
// We use a position absolute over a flexbox in order to forward the pointer events
|
|
@@ -8,6 +8,7 @@ import { styled } from "../zero-styled/index.js";
|
|
|
8
8
|
import memoTheme from "../utils/memoTheme.js";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
const NotchedOutlineRoot = styled('fieldset', {
|
|
11
|
+
name: 'MuiNotchedOutlined',
|
|
11
12
|
shouldForwardProp: rootShouldForwardProp
|
|
12
13
|
})({
|
|
13
14
|
textAlign: 'left',
|
|
@@ -26,6 +27,7 @@ const NotchedOutlineRoot = styled('fieldset', {
|
|
|
26
27
|
minWidth: '0%'
|
|
27
28
|
});
|
|
28
29
|
const NotchedOutlineLegend = styled('legend', {
|
|
30
|
+
name: 'MuiNotchedOutlined',
|
|
29
31
|
shouldForwardProp: rootShouldForwardProp
|
|
30
32
|
})(memoTheme(({
|
|
31
33
|
theme
|
|
@@ -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, {
|
|
@@ -21,13 +21,21 @@ export interface OutlinedInputClasses {
|
|
|
21
21
|
notchedOutline: string;
|
|
22
22
|
/** Styles applied to the input element. */
|
|
23
23
|
input: string;
|
|
24
|
-
/** Styles applied to the input element if `size="small"`.
|
|
24
|
+
/** Styles applied to the input element if `size="small"`.
|
|
25
|
+
* @deprecated Combine the [.MuiInputBase-input](/material-ui/api/input-base/#inputbase-classes-input) and [.MuiInputBase-sizeSmall](/material-ui/api/input-base/#inputbase-classes-sizeSmall) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
26
|
+
*/
|
|
25
27
|
inputSizeSmall: string;
|
|
26
|
-
/** Styles applied to the input element if `multiline={true}`.
|
|
28
|
+
/** Styles applied to the input element if `multiline={true}`.
|
|
29
|
+
* @deprecated Combine the [.MuiInputBase-input](/material-ui/api/input-base/#inputbase-classes-input) and [.MuiInputBase-multiline](/material-ui/api/input-base/#inputbase-classes-multiline) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
30
|
+
*/
|
|
27
31
|
inputMultiline: string;
|
|
28
|
-
/** Styles applied to the input element if `startAdornment` is provided.
|
|
32
|
+
/** Styles applied to the input element if `startAdornment` is provided.
|
|
33
|
+
* @deprecated Combine the [.MuiInputBase-input](/material-ui/api/input-base/#inputbase-classes-input) and [.MuiInputBase-adornedStart](/material-ui/api/input-base/#inputbase-classes-adornedStart) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
34
|
+
*/
|
|
29
35
|
inputAdornedStart: string;
|
|
30
|
-
/** Styles applied to the input element if `endAdornment` is provided.
|
|
36
|
+
/** Styles applied to the input element if `endAdornment` is provided.
|
|
37
|
+
* @deprecated Combine the [.MuiInputBase-input](/material-ui/api/input-base/#inputbase-classes-input) and [.MuiInputBase-adornedEnd](/material-ui/api/input-base/#inputbase-classes-adornedEnd) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
38
|
+
*/
|
|
31
39
|
inputAdornedEnd: string;
|
|
32
40
|
/** Styles applied to the input element if `type="search"`. */
|
|
33
41
|
inputTypeSearch: string;
|
|
@@ -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]) => ({
|
|
@@ -9,16 +9,21 @@ import { styled } from "../zero-styled/index.js";
|
|
|
9
9
|
import memoTheme from "../utils/memoTheme.js";
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
const RadioButtonIconRoot = styled('span', {
|
|
12
|
+
name: 'MuiRadioButtonIcon',
|
|
12
13
|
shouldForwardProp: rootShouldForwardProp
|
|
13
14
|
})({
|
|
14
15
|
position: 'relative',
|
|
15
16
|
display: 'flex'
|
|
16
17
|
});
|
|
17
|
-
const RadioButtonIconBackground = styled(RadioButtonUncheckedIcon
|
|
18
|
+
const RadioButtonIconBackground = styled(RadioButtonUncheckedIcon, {
|
|
19
|
+
name: 'MuiRadioButtonIcon'
|
|
20
|
+
})({
|
|
18
21
|
// Scale applied to prevent dot misalignment in Safari
|
|
19
22
|
transform: 'scale(1)'
|
|
20
23
|
});
|
|
21
|
-
const RadioButtonIconDot = styled(RadioButtonCheckedIcon
|
|
24
|
+
const RadioButtonIconDot = styled(RadioButtonCheckedIcon, {
|
|
25
|
+
name: 'MuiRadioButtonIcon'
|
|
26
|
+
})(memoTheme(({
|
|
22
27
|
theme
|
|
23
28
|
}) => ({
|
|
24
29
|
left: 0,
|
|
@@ -153,12 +153,27 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
153
153
|
});
|
|
154
154
|
const inputRef = React.useRef(null);
|
|
155
155
|
const displayRef = React.useRef(null);
|
|
156
|
+
const paperRef = React.useRef(null);
|
|
157
|
+
const didPointerDownRef = React.useRef(false);
|
|
156
158
|
const [displayNode, setDisplayNode] = React.useState(null);
|
|
157
159
|
const {
|
|
158
160
|
current: isOpenControlled
|
|
159
161
|
} = React.useRef(openProp != null);
|
|
160
162
|
const [menuMinWidthState, setMenuMinWidthState] = React.useState();
|
|
163
|
+
const open = displayNode !== null && openState;
|
|
164
|
+
const ownerState = {
|
|
165
|
+
...props,
|
|
166
|
+
variant,
|
|
167
|
+
value,
|
|
168
|
+
open,
|
|
169
|
+
error
|
|
170
|
+
};
|
|
171
|
+
const paperProps = {
|
|
172
|
+
...MenuProps.PaperProps,
|
|
173
|
+
...(typeof MenuProps.slotProps?.paper === 'function' ? MenuProps.slotProps.paper(ownerState) : MenuProps.slotProps?.paper)
|
|
174
|
+
};
|
|
161
175
|
const handleRef = useForkRef(ref, inputRefProp);
|
|
176
|
+
const handlePaperRef = useForkRef(paperProps.ref, paperRef);
|
|
162
177
|
const handleDisplayRef = React.useCallback(node => {
|
|
163
178
|
displayRef.current = node;
|
|
164
179
|
if (node) {
|
|
@@ -208,8 +223,8 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
208
223
|
}
|
|
209
224
|
return undefined;
|
|
210
225
|
}, [labelId]);
|
|
211
|
-
const update = (
|
|
212
|
-
if (
|
|
226
|
+
const update = (openParam, event) => {
|
|
227
|
+
if (openParam) {
|
|
213
228
|
if (onOpen) {
|
|
214
229
|
onOpen(event);
|
|
215
230
|
}
|
|
@@ -218,7 +233,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
218
233
|
}
|
|
219
234
|
if (!isOpenControlled) {
|
|
220
235
|
setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
|
|
221
|
-
setOpenState(
|
|
236
|
+
setOpenState(openParam);
|
|
222
237
|
}
|
|
223
238
|
};
|
|
224
239
|
const handleMouseDown = event => {
|
|
@@ -229,6 +244,31 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
229
244
|
// Hijack the default focus behavior.
|
|
230
245
|
event.preventDefault();
|
|
231
246
|
displayRef.current.focus();
|
|
247
|
+
const doc = ownerDocument(event.currentTarget);
|
|
248
|
+
function handleMouseUp(mouseEvent) {
|
|
249
|
+
if (!displayRef.current) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// mouse is over the options/menuitem, don't close the menu
|
|
254
|
+
if (paperRef.current.contains(mouseEvent.target)) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
const triggerElement = displayRef.current.getBoundingClientRect();
|
|
258
|
+
|
|
259
|
+
// mouse is inside the trigger, don't close the menu
|
|
260
|
+
if (mouseEvent.clientX >= triggerElement.left && mouseEvent.clientX <= triggerElement.right && mouseEvent.clientY >= triggerElement.top && mouseEvent.clientY <= triggerElement.bottom) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// close the menu
|
|
265
|
+
update(false, mouseEvent);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// `{ once: true }` to automatically remove the listener, see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#once
|
|
269
|
+
doc.addEventListener('mouseup', handleMouseUp, {
|
|
270
|
+
once: true
|
|
271
|
+
});
|
|
232
272
|
update(true, event);
|
|
233
273
|
};
|
|
234
274
|
const handleClose = event => {
|
|
@@ -247,7 +287,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
247
287
|
onChange(event, child);
|
|
248
288
|
}
|
|
249
289
|
};
|
|
250
|
-
const
|
|
290
|
+
const handleItemSelect = child => event => {
|
|
251
291
|
let newValue;
|
|
252
292
|
|
|
253
293
|
// We use the tabindex attribute to signal the available options.
|
|
@@ -265,9 +305,6 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
265
305
|
} else {
|
|
266
306
|
newValue = child.props.value;
|
|
267
307
|
}
|
|
268
|
-
if (child.props.onClick) {
|
|
269
|
-
child.props.onClick(event);
|
|
270
|
-
}
|
|
271
308
|
if (value !== newValue) {
|
|
272
309
|
setValueState(newValue);
|
|
273
310
|
if (onChange) {
|
|
@@ -303,7 +340,6 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
303
340
|
}
|
|
304
341
|
}
|
|
305
342
|
};
|
|
306
|
-
const open = displayNode !== null && openState;
|
|
307
343
|
const handleBlur = event => {
|
|
308
344
|
// if open event.stopImmediatePropagation
|
|
309
345
|
if (!open && onBlur) {
|
|
@@ -364,7 +400,26 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
364
400
|
}
|
|
365
401
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
366
402
|
'aria-selected': selected ? 'true' : 'false',
|
|
367
|
-
|
|
403
|
+
onPointerDown: () => {
|
|
404
|
+
didPointerDownRef.current = true;
|
|
405
|
+
},
|
|
406
|
+
onClick: event => {
|
|
407
|
+
didPointerDownRef.current = false;
|
|
408
|
+
if (child.props.onClick) {
|
|
409
|
+
child.props.onClick(event);
|
|
410
|
+
}
|
|
411
|
+
handleItemSelect(child)(event);
|
|
412
|
+
},
|
|
413
|
+
onMouseUp: event => {
|
|
414
|
+
if (didPointerDownRef.current) {
|
|
415
|
+
didPointerDownRef.current = false;
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
if (child.props.onMouseUp) {
|
|
419
|
+
child.props.onMouseUp(event);
|
|
420
|
+
}
|
|
421
|
+
handleItemSelect(child)(event);
|
|
422
|
+
},
|
|
368
423
|
onKeyUp: event => {
|
|
369
424
|
if (event.key === ' ') {
|
|
370
425
|
// otherwise our MenuItems dispatches a click event
|
|
@@ -423,17 +478,10 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
423
478
|
tabIndex = disabled ? null : 0;
|
|
424
479
|
}
|
|
425
480
|
const buttonId = SelectDisplayProps.id || (name ? `mui-component-select-${name}` : undefined);
|
|
426
|
-
const ownerState = {
|
|
427
|
-
...props,
|
|
428
|
-
variant,
|
|
429
|
-
value,
|
|
430
|
-
open,
|
|
431
|
-
error
|
|
432
|
-
};
|
|
433
481
|
const classes = useUtilityClasses(ownerState);
|
|
434
|
-
const
|
|
435
|
-
...MenuProps.
|
|
436
|
-
...MenuProps.slotProps?.
|
|
482
|
+
const listProps = {
|
|
483
|
+
...MenuProps.MenuListProps,
|
|
484
|
+
...(typeof MenuProps.slotProps?.list === 'function' ? MenuProps.slotProps.list(ownerState) : MenuProps.slotProps?.list)
|
|
437
485
|
};
|
|
438
486
|
const listboxId = useId();
|
|
439
487
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
@@ -507,10 +555,11 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
507
555
|
'aria-multiselectable': multiple ? 'true' : undefined,
|
|
508
556
|
disableListWrap: true,
|
|
509
557
|
id: listboxId,
|
|
510
|
-
...
|
|
558
|
+
...listProps
|
|
511
559
|
},
|
|
512
560
|
paper: {
|
|
513
561
|
...paperProps,
|
|
562
|
+
ref: handlePaperRef,
|
|
514
563
|
style: {
|
|
515
564
|
minWidth: menuMinWidth,
|
|
516
565
|
...(paperProps != null ? paperProps.style : null)
|
package/esm/Skeleton/Skeleton.js
CHANGED
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import {
|
|
7
|
+
import { unstable_getUnit as getUnit, unstable_toUnitless as toUnitless } from "../styles/index.js";
|
|
8
8
|
import { keyframes, css, styled } from "../zero-styled/index.js";
|
|
9
9
|
import memoTheme from "../utils/memoTheme.js";
|
|
10
10
|
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
@@ -80,7 +80,7 @@ const SkeletonRoot = styled('span', {
|
|
|
80
80
|
return {
|
|
81
81
|
display: 'block',
|
|
82
82
|
// Create a "on paper" color with sufficient contrast retaining the color
|
|
83
|
-
backgroundColor: theme.vars ? theme.vars.palette.Skeleton.bg : alpha(theme.palette.text.primary, theme.palette.mode === 'light' ? 0.11 : 0.13),
|
|
83
|
+
backgroundColor: theme.vars ? theme.vars.palette.Skeleton.bg : theme.alpha(theme.palette.text.primary, theme.palette.mode === 'light' ? 0.11 : 0.13),
|
|
84
84
|
height: '1.2em',
|
|
85
85
|
variants: [{
|
|
86
86
|
props: {
|
package/esm/Slider/Slider.js
CHANGED
|
@@ -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, lighten, darken } from '@mui/system/colorManipulator';
|
|
9
8
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
10
9
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
11
10
|
import { useSlider, valueToPercent } from "./useSlider.js";
|
|
@@ -219,13 +218,13 @@ export const SliderTrack = styled('span', {
|
|
|
219
218
|
backgroundColor: theme.vars.palette.Slider[`${color}Track`],
|
|
220
219
|
borderColor: theme.vars.palette.Slider[`${color}Track`]
|
|
221
220
|
} : {
|
|
222
|
-
backgroundColor: lighten(theme.palette[color].main, 0.62),
|
|
223
|
-
borderColor: lighten(theme.palette[color].main, 0.62),
|
|
221
|
+
backgroundColor: theme.lighten(theme.palette[color].main, 0.62),
|
|
222
|
+
borderColor: theme.lighten(theme.palette[color].main, 0.62),
|
|
224
223
|
...theme.applyStyles('dark', {
|
|
225
|
-
backgroundColor: darken(theme.palette[color].main, 0.5)
|
|
224
|
+
backgroundColor: theme.darken(theme.palette[color].main, 0.5)
|
|
226
225
|
}),
|
|
227
226
|
...theme.applyStyles('dark', {
|
|
228
|
-
borderColor: darken(theme.palette[color].main, 0.5)
|
|
227
|
+
borderColor: theme.darken(theme.palette[color].main, 0.5)
|
|
229
228
|
})
|
|
230
229
|
})
|
|
231
230
|
}
|
|
@@ -314,21 +313,13 @@ export const SliderThumb = styled('span', {
|
|
|
314
313
|
},
|
|
315
314
|
style: {
|
|
316
315
|
[`&:hover, &.${sliderClasses.focusVisible}`]: {
|
|
317
|
-
|
|
318
|
-
boxShadow: `0px 0px 0px 8px rgba(${theme.vars.palette[color].mainChannel} / 0.16)`
|
|
319
|
-
} : {
|
|
320
|
-
boxShadow: `0px 0px 0px 8px ${alpha(theme.palette[color].main, 0.16)}`
|
|
321
|
-
}),
|
|
316
|
+
boxShadow: `0px 0px 0px 8px ${theme.alpha((theme.vars || theme).palette[color].main, 0.16)}`,
|
|
322
317
|
'@media (hover: none)': {
|
|
323
318
|
boxShadow: 'none'
|
|
324
319
|
}
|
|
325
320
|
},
|
|
326
321
|
[`&.${sliderClasses.active}`]: {
|
|
327
|
-
|
|
328
|
-
boxShadow: `0px 0px 0px 14px rgba(${theme.vars.palette[color].mainChannel} / 0.16)`
|
|
329
|
-
} : {
|
|
330
|
-
boxShadow: `0px 0px 0px 14px ${alpha(theme.palette[color].main, 0.16)}`
|
|
331
|
-
})
|
|
322
|
+
boxShadow: `0px 0px 0px 14px ${theme.alpha((theme.vars || theme).palette[color].main, 0.16)}`
|
|
332
323
|
}
|
|
333
324
|
}
|
|
334
325
|
}))]
|
package/esm/Snackbar/Snackbar.js
CHANGED
|
@@ -373,14 +373,8 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
|
|
|
373
373
|
* The props used for each slot inside.
|
|
374
374
|
* @default {}
|
|
375
375
|
*/
|
|
376
|
-
slotProps: PropTypes
|
|
377
|
-
clickAwayListener: PropTypes.oneOfType([PropTypes.func, PropTypes.
|
|
378
|
-
children: PropTypes.element.isRequired,
|
|
379
|
-
disableReactTree: PropTypes.bool,
|
|
380
|
-
mouseEvent: PropTypes.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]),
|
|
381
|
-
onClickAway: PropTypes.func,
|
|
382
|
-
touchEvent: PropTypes.oneOf(['onTouchEnd', 'onTouchStart', false])
|
|
383
|
-
})]),
|
|
376
|
+
slotProps: PropTypes /* @typescript-to-proptypes-ignore */.shape({
|
|
377
|
+
clickAwayListener: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
384
378
|
content: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
385
379
|
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
386
380
|
transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
@@ -220,13 +220,17 @@ const SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref)
|
|
|
220
220
|
*
|
|
221
221
|
* @param dialActionIndex {number}
|
|
222
222
|
* @param origButtonRef {React.RefObject?}
|
|
223
|
+
* @param fabSlotOrigButtonRef {React.RefObject?}
|
|
223
224
|
*/
|
|
224
|
-
const createHandleSpeedDialActionButtonRef = (dialActionIndex, origButtonRef) => {
|
|
225
|
+
const createHandleSpeedDialActionButtonRef = (dialActionIndex, origButtonRef, fabSlotOrigButtonRef) => {
|
|
225
226
|
return buttonRef => {
|
|
226
227
|
actions.current[dialActionIndex + 1] = buttonRef;
|
|
227
228
|
if (origButtonRef) {
|
|
228
229
|
origButtonRef(buttonRef);
|
|
229
230
|
}
|
|
231
|
+
if (fabSlotOrigButtonRef) {
|
|
232
|
+
fabSlotOrigButtonRef(buttonRef);
|
|
233
|
+
}
|
|
230
234
|
};
|
|
231
235
|
};
|
|
232
236
|
const handleKeyDown = event => {
|
|
@@ -342,16 +346,26 @@ const SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref)
|
|
|
342
346
|
const children = allItems.map((child, index) => {
|
|
343
347
|
const {
|
|
344
348
|
FabProps: {
|
|
345
|
-
ref: origButtonRef
|
|
346
|
-
...ChildFabProps
|
|
349
|
+
ref: origButtonRef
|
|
347
350
|
} = {},
|
|
351
|
+
slotProps: childSlotProps = {},
|
|
348
352
|
tooltipPlacement: tooltipPlacementProp
|
|
349
353
|
} = child.props;
|
|
354
|
+
const {
|
|
355
|
+
fab: {
|
|
356
|
+
ref: fabSlotOrigButtonRef,
|
|
357
|
+
...fabSlotProps
|
|
358
|
+
} = {},
|
|
359
|
+
...restOfSlotProps
|
|
360
|
+
} = childSlotProps;
|
|
350
361
|
const tooltipPlacement = tooltipPlacementProp || (getOrientation(direction) === 'vertical' ? 'left' : 'top');
|
|
351
362
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
363
|
+
slotProps: {
|
|
364
|
+
fab: {
|
|
365
|
+
...fabSlotProps,
|
|
366
|
+
ref: createHandleSpeedDialActionButtonRef(index, origButtonRef, fabSlotOrigButtonRef)
|
|
367
|
+
},
|
|
368
|
+
...restOfSlotProps
|
|
355
369
|
},
|
|
356
370
|
delay: 30 * (open ? index : allItems.length - index),
|
|
357
371
|
open,
|
|
@@ -10,6 +10,7 @@ import capitalize from "../utils/capitalize.js";
|
|
|
10
10
|
import { isHorizontal } from "../Drawer/Drawer.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
const SwipeAreaRoot = styled('div', {
|
|
13
|
+
name: 'MuiSwipeArea',
|
|
13
14
|
shouldForwardProp: rootShouldForwardProp
|
|
14
15
|
})(memoTheme(({
|
|
15
16
|
theme
|