@mui/material 5.15.11 → 5.15.13
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/Alert/Alert.d.ts +2 -2
- package/Alert/Alert.js +53 -35
- package/Alert/alertClasses.d.ts +68 -12
- package/Alert/alertClasses.js +1 -1
- package/AlertTitle/AlertTitle.js +2 -2
- package/Autocomplete/Autocomplete.js +58 -49
- package/Avatar/Avatar.js +2 -2
- package/Button/Button.js +3 -3
- package/Button/buttonClasses.d.ts +113 -33
- package/Button/buttonClasses.js +1 -1
- package/CHANGELOG.md +290 -116
- package/Checkbox/Checkbox.d.ts +1 -1
- package/Chip/chipClasses.d.ts +78 -26
- package/Drawer/Drawer.js +9 -3
- package/LinearProgress/LinearProgress.js +4 -4
- package/Menu/Menu.js +5 -4
- package/MenuList/MenuList.js +4 -2
- package/PaginationItem/PaginationItem.js +3 -3
- package/README.md +1 -1
- package/Rating/Rating.js +3 -3
- package/Slider/Slider.d.ts +2 -4
- package/Slider/Slider.js +4 -7
- package/Switch/Switch.js +61 -41
- package/TabScrollButton/TabScrollButton.js +2 -3
- package/TablePagination/TablePaginationActions.js +14 -14
- package/Tabs/Tabs.js +3 -2
- package/Tooltip/Tooltip.js +5 -4
- package/index.js +1 -1
- package/legacy/Alert/Alert.js +77 -34
- package/legacy/Alert/alertClasses.js +1 -1
- package/legacy/AlertTitle/AlertTitle.js +2 -2
- package/legacy/Autocomplete/Autocomplete.js +62 -51
- package/legacy/Avatar/Avatar.js +2 -2
- package/legacy/Button/Button.js +3 -3
- package/legacy/Button/buttonClasses.js +1 -1
- package/legacy/Drawer/Drawer.js +8 -3
- package/legacy/LinearProgress/LinearProgress.js +4 -4
- package/legacy/Menu/Menu.js +5 -4
- package/legacy/MenuList/MenuList.js +3 -2
- package/legacy/PaginationItem/PaginationItem.js +3 -3
- package/legacy/Rating/Rating.js +3 -3
- package/legacy/Slider/Slider.js +4 -7
- package/legacy/Switch/Switch.js +88 -59
- package/legacy/TabScrollButton/TabScrollButton.js +2 -3
- package/legacy/TablePagination/TablePaginationActions.js +14 -14
- package/legacy/Tabs/Tabs.js +3 -2
- package/legacy/Tooltip/Tooltip.js +7 -3
- package/legacy/index.js +1 -1
- package/legacy/styles/experimental_extendTheme.js +3 -0
- package/modern/Alert/Alert.js +53 -35
- package/modern/Alert/alertClasses.js +1 -1
- package/modern/AlertTitle/AlertTitle.js +2 -2
- package/modern/Autocomplete/Autocomplete.js +58 -49
- package/modern/Avatar/Avatar.js +2 -2
- package/modern/Button/Button.js +3 -3
- package/modern/Button/buttonClasses.js +1 -1
- package/modern/Drawer/Drawer.js +9 -3
- package/modern/LinearProgress/LinearProgress.js +4 -4
- package/modern/Menu/Menu.js +5 -4
- package/modern/MenuList/MenuList.js +4 -2
- package/modern/PaginationItem/PaginationItem.js +3 -3
- package/modern/Rating/Rating.js +3 -3
- package/modern/Slider/Slider.js +4 -7
- package/modern/Switch/Switch.js +61 -41
- package/modern/TabScrollButton/TabScrollButton.js +2 -3
- package/modern/TablePagination/TablePaginationActions.js +14 -14
- package/modern/Tabs/Tabs.js +3 -2
- package/modern/Tooltip/Tooltip.js +5 -4
- package/modern/index.js +1 -1
- package/modern/styles/experimental_extendTheme.js +3 -0
- package/node/Alert/Alert.js +61 -43
- package/node/Alert/alertClasses.js +1 -1
- package/node/AlertTitle/AlertTitle.js +4 -4
- package/node/Autocomplete/Autocomplete.js +58 -49
- package/node/Avatar/Avatar.js +6 -6
- package/node/Button/Button.js +3 -3
- package/node/Button/buttonClasses.js +1 -1
- package/node/Drawer/Drawer.js +9 -3
- package/node/LinearProgress/LinearProgress.js +4 -4
- package/node/Menu/Menu.js +5 -4
- package/node/MenuList/MenuList.js +4 -2
- package/node/PaginationItem/PaginationItem.js +3 -3
- package/node/Rating/Rating.js +3 -3
- package/node/Slider/Slider.js +4 -7
- package/node/Switch/Switch.js +66 -46
- package/node/TabScrollButton/TabScrollButton.js +2 -3
- package/node/TablePagination/TablePaginationActions.js +14 -14
- package/node/Tabs/Tabs.js +3 -2
- package/node/Tooltip/Tooltip.js +5 -4
- package/node/index.js +1 -1
- package/node/styles/experimental_extendTheme.js +3 -0
- package/package.json +5 -5
- package/styles/experimental_extendTheme.d.ts +1 -0
- package/styles/experimental_extendTheme.js +3 -0
- package/styles/variants.d.ts +7 -1
- package/umd/material-ui.development.js +6197 -6084
- package/umd/material-ui.production.min.js +2 -2
package/Alert/Alert.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export type AlertSlotsAndSlotProps = CreateSlotsAndSlotProps<
|
|
|
33
33
|
}
|
|
34
34
|
>;
|
|
35
35
|
|
|
36
|
-
export interface AlertProps extends StandardProps<PaperProps, 'variant'
|
|
36
|
+
export interface AlertProps extends StandardProps<PaperProps, 'variant'>, AlertSlotsAndSlotProps {
|
|
37
37
|
/**
|
|
38
38
|
* The action to display. It renders after the message, at the end of the alert.
|
|
39
39
|
*/
|
|
@@ -133,4 +133,4 @@ export interface AlertOwnerState extends AlertProps {}
|
|
|
133
133
|
* - [Alert API](https://mui.com/material-ui/api/alert/)
|
|
134
134
|
* - inherits [Paper API](https://mui.com/material-ui/api/paper/)
|
|
135
135
|
*/
|
|
136
|
-
export default function Alert(props: AlertProps
|
|
136
|
+
export default function Alert(props: AlertProps): JSX.Element;
|
package/Alert/Alert.js
CHANGED
|
@@ -6,10 +6,9 @@ const _excluded = ["action", "children", "className", "closeText", "color", "com
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import
|
|
10
|
-
import { darken, lighten } from '@mui/system';
|
|
11
|
-
import styled from '../
|
|
12
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
9
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
+
import { darken, lighten } from '@mui/system/colorManipulator';
|
|
11
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
13
12
|
import useSlot from '../utils/useSlot';
|
|
14
13
|
import capitalize from '../utils/capitalize';
|
|
15
14
|
import Paper from '../Paper';
|
|
@@ -22,6 +21,7 @@ import InfoOutlinedIcon from '../internal/svg-icons/InfoOutlined';
|
|
|
22
21
|
import CloseIcon from '../internal/svg-icons/Close';
|
|
23
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
23
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
const useThemeProps = createUseThemeProps('MuiAlert');
|
|
25
25
|
const useUtilityClasses = ownerState => {
|
|
26
26
|
const {
|
|
27
27
|
variant,
|
|
@@ -30,7 +30,7 @@ const useUtilityClasses = ownerState => {
|
|
|
30
30
|
classes
|
|
31
31
|
} = ownerState;
|
|
32
32
|
const slots = {
|
|
33
|
-
root: ['root', `${variant}${capitalize(color || severity)}`, `${variant}`],
|
|
33
|
+
root: ['root', `color${capitalize(color || severity)}`, `${variant}${capitalize(color || severity)}`, `${variant}`],
|
|
34
34
|
icon: ['icon'],
|
|
35
35
|
message: ['message'],
|
|
36
36
|
action: ['action']
|
|
@@ -47,41 +47,58 @@ const AlertRoot = styled(Paper, {
|
|
|
47
47
|
return [styles.root, styles[ownerState.variant], styles[`${ownerState.variant}${capitalize(ownerState.color || ownerState.severity)}`]];
|
|
48
48
|
}
|
|
49
49
|
})(({
|
|
50
|
-
theme
|
|
51
|
-
ownerState
|
|
50
|
+
theme
|
|
52
51
|
}) => {
|
|
53
52
|
const getColor = theme.palette.mode === 'light' ? darken : lighten;
|
|
54
53
|
const getBackgroundColor = theme.palette.mode === 'light' ? lighten : darken;
|
|
55
|
-
const color = ownerState.color || ownerState.severity;
|
|
56
54
|
return _extends({}, theme.typography.body2, {
|
|
57
55
|
backgroundColor: 'transparent',
|
|
58
56
|
display: 'flex',
|
|
59
|
-
padding: '6px 16px'
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
57
|
+
padding: '6px 16px',
|
|
58
|
+
variants: [...Object.entries(theme.palette).filter(([, value]) => value.main && value.light).map(([color]) => ({
|
|
59
|
+
props: {
|
|
60
|
+
colorSeverity: color,
|
|
61
|
+
variant: 'standard'
|
|
62
|
+
},
|
|
63
|
+
style: {
|
|
64
|
+
color: theme.vars ? theme.vars.palette.Alert[`${color}Color`] : getColor(theme.palette[color].light, 0.6),
|
|
65
|
+
backgroundColor: theme.vars ? theme.vars.palette.Alert[`${color}StandardBg`] : getBackgroundColor(theme.palette[color].light, 0.9),
|
|
66
|
+
[`& .${alertClasses.icon}`]: theme.vars ? {
|
|
67
|
+
color: theme.vars.palette.Alert[`${color}IconColor`]
|
|
68
|
+
} : {
|
|
69
|
+
color: theme.palette[color].main
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
})), ...Object.entries(theme.palette).filter(([, value]) => value.main && value.light).map(([color]) => ({
|
|
73
|
+
props: {
|
|
74
|
+
colorSeverity: color,
|
|
75
|
+
variant: 'outlined'
|
|
76
|
+
},
|
|
77
|
+
style: {
|
|
78
|
+
color: theme.vars ? theme.vars.palette.Alert[`${color}Color`] : getColor(theme.palette[color].light, 0.6),
|
|
79
|
+
border: `1px solid ${(theme.vars || theme).palette[color].light}`,
|
|
80
|
+
[`& .${alertClasses.icon}`]: theme.vars ? {
|
|
81
|
+
color: theme.vars.palette.Alert[`${color}IconColor`]
|
|
82
|
+
} : {
|
|
83
|
+
color: theme.palette[color].main
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
})), ...Object.entries(theme.palette).filter(([, value]) => value.main && value.dark).map(([color]) => ({
|
|
87
|
+
props: {
|
|
88
|
+
colorSeverity: color,
|
|
89
|
+
variant: 'filled'
|
|
90
|
+
},
|
|
91
|
+
style: _extends({
|
|
92
|
+
fontWeight: theme.typography.fontWeightMedium
|
|
93
|
+
}, theme.vars ? {
|
|
94
|
+
color: theme.vars.palette.Alert[`${color}FilledColor`],
|
|
95
|
+
backgroundColor: theme.vars.palette.Alert[`${color}FilledBg`]
|
|
96
|
+
} : {
|
|
97
|
+
backgroundColor: theme.palette.mode === 'dark' ? theme.palette[color].dark : theme.palette[color].main,
|
|
98
|
+
color: theme.palette.getContrastText(theme.palette[color].main)
|
|
99
|
+
})
|
|
100
|
+
}))]
|
|
101
|
+
});
|
|
85
102
|
});
|
|
86
103
|
const AlertIcon = styled('div', {
|
|
87
104
|
name: 'MuiAlert',
|
|
@@ -154,7 +171,8 @@ const Alert = /*#__PURE__*/React.forwardRef(function Alert(inProps, ref) {
|
|
|
154
171
|
const ownerState = _extends({}, props, {
|
|
155
172
|
color,
|
|
156
173
|
severity,
|
|
157
|
-
variant
|
|
174
|
+
variant,
|
|
175
|
+
colorSeverity: color || severity
|
|
158
176
|
});
|
|
159
177
|
const classes = useUtilityClasses(ownerState);
|
|
160
178
|
const externalForwardedProps = {
|
package/Alert/alertClasses.d.ts
CHANGED
|
@@ -7,29 +7,85 @@ export interface AlertClasses {
|
|
|
7
7
|
outlined: string;
|
|
8
8
|
/** Styles applied to the root element if `variant="standard"`. */
|
|
9
9
|
standard: string;
|
|
10
|
-
/** Styles applied to the root element if `
|
|
10
|
+
/** Styles applied to the root element if `color="success"`. */
|
|
11
|
+
colorSuccess: string;
|
|
12
|
+
/** Styles applied to the root element if `color="info"`. */
|
|
13
|
+
colorInfo: string;
|
|
14
|
+
/** Styles applied to the root element if `color="warning"`. */
|
|
15
|
+
colorWarning: string;
|
|
16
|
+
/** Styles applied to the root element if `color="error"`. */
|
|
17
|
+
colorError: string;
|
|
18
|
+
/** Styles applied to the root element if `variant="standard"` and `color="success"`.
|
|
19
|
+
* @deprecated Combine the [.MuiAlert-standard](/material-ui/api/alert/#alert-classes-standard)
|
|
20
|
+
* and [.MuiAlert-colorSuccess](/material-ui/api/alert/#alert-classes-colorSuccess) classes instead.
|
|
21
|
+
* [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
22
|
+
*/
|
|
11
23
|
standardSuccess: string;
|
|
12
|
-
/** Styles applied to the root element if `variant="standard"` and `color="info"`.
|
|
24
|
+
/** Styles applied to the root element if `variant="standard"` and `color="info"`.
|
|
25
|
+
* @deprecated Combine the [.MuiAlert-standard](/material-ui/api/alert/#alert-classes-standard)
|
|
26
|
+
* and [.MuiAlert-colorInfo](/material-ui/api/alert/#alert-classes-colorInfo) classes instead.
|
|
27
|
+
* [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
28
|
+
*/
|
|
13
29
|
standardInfo: string;
|
|
14
|
-
/** Styles applied to the root element if `variant="standard"` and `color="warning"`.
|
|
30
|
+
/** Styles applied to the root element if `variant="standard"` and `color="warning"`.
|
|
31
|
+
* @deprecated Combine the [.MuiAlert-standard](/material-ui/api/alert/#alert-classes-standard)
|
|
32
|
+
* and [.MuiAlert-colorWarning](/material-ui/api/alert/#alert-classes-colorWarning) classes instead.
|
|
33
|
+
* [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
34
|
+
*/
|
|
15
35
|
standardWarning: string;
|
|
16
|
-
/** Styles applied to the root element if `variant="standard"` and `color="error"`.
|
|
36
|
+
/** Styles applied to the root element if `variant="standard"` and `color="error"`.
|
|
37
|
+
* @deprecated Combine the [.MuiAlert-standard](/material-ui/api/alert/#alert-classes-standard)
|
|
38
|
+
* and [.MuiAlert-colorError](/material-ui/api/alert/#alert-classes-colorError) classes instead.
|
|
39
|
+
* [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
40
|
+
*/
|
|
17
41
|
standardError: string;
|
|
18
|
-
/** Styles applied to the root element if `variant="outlined"` and `color="success"`.
|
|
42
|
+
/** Styles applied to the root element if `variant="outlined"` and `color="success"`.
|
|
43
|
+
* @deprecated Combine the [.MuiAlert-outlined](/material-ui/api/alert/#alert-classes-outlined)
|
|
44
|
+
* and [.MuiAlert-colorSuccess](/material-ui/api/alert/#alert-classes-colorSuccess) classes instead.
|
|
45
|
+
* [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
46
|
+
*/
|
|
19
47
|
outlinedSuccess: string;
|
|
20
|
-
/** Styles applied to the root element if `variant="outlined"` and `color="info"`.
|
|
48
|
+
/** Styles applied to the root element if `variant="outlined"` and `color="info"`.
|
|
49
|
+
* @deprecated Combine the [.MuiAlert-outlined](/material-ui/api/alert/#alert-classes-outlined)
|
|
50
|
+
* and [.MuiAlert-colorInfo](/material-ui/api/alert/#alert-classes-colorInfo) classes instead.
|
|
51
|
+
* [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
52
|
+
*/
|
|
21
53
|
outlinedInfo: string;
|
|
22
|
-
/** Styles applied to the root element if `variant="outlined"` and `color="warning"`.
|
|
54
|
+
/** Styles applied to the root element if `variant="outlined"` and `color="warning"`.
|
|
55
|
+
* @deprecated Combine the [.MuiAlert-outlined](/material-ui/api/alert/#alert-classes-outlined)
|
|
56
|
+
* and [.MuiAlert-colorWarning](/material-ui/api/alert/#alert-classes-colorWarning) classes instead.
|
|
57
|
+
* [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
58
|
+
*/
|
|
23
59
|
outlinedWarning: string;
|
|
24
|
-
/** Styles applied to the root element if `variant="outlined"` and `color="error"`.
|
|
60
|
+
/** Styles applied to the root element if `variant="outlined"` and `color="error"`.
|
|
61
|
+
* @deprecated Combine the [.MuiAlert-outlined](/material-ui/api/alert/#alert-classes-outlined)
|
|
62
|
+
* and [.MuiAlert-colorError](/material-ui/api/alert/#alert-classes-colorError) classes instead.
|
|
63
|
+
* [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
64
|
+
*/
|
|
25
65
|
outlinedError: string;
|
|
26
|
-
/** Styles applied to the root element if `variant="filled"` and `color="success"`.
|
|
66
|
+
/** Styles applied to the root element if `variant="filled"` and `color="success"`.
|
|
67
|
+
* @deprecated Combine the [.MuiAlert-filled](/material-ui/api/alert/#alert-classes-filled)
|
|
68
|
+
* and [.MuiAlert-colorSuccess](/material-ui/api/alert/#alert-classes-colorSuccess) classes instead.
|
|
69
|
+
* [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
70
|
+
*/
|
|
27
71
|
filledSuccess: string;
|
|
28
|
-
/** Styles applied to the root element if `variant="filled"` and `color="info"`.
|
|
72
|
+
/** Styles applied to the root element if `variant="filled"` and `color="info"`.
|
|
73
|
+
* @deprecated Combine the [.MuiAlert-filled](/material-ui/api/alert/#alert-classes-filled)
|
|
74
|
+
* and [.MuiAlert-colorInfo](/material-ui/api/alert/#alert-classes-colorInfo) classes instead.
|
|
75
|
+
* [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
76
|
+
*/
|
|
29
77
|
filledInfo: string;
|
|
30
|
-
/** Styles applied to the root element if `variant="filled"` and `color="warning"
|
|
78
|
+
/** Styles applied to the root element if `variant="filled"` and `color="warning"`
|
|
79
|
+
* @deprecated Combine the [.MuiAlert-filled](/material-ui/api/alert/#alert-classes-filled)
|
|
80
|
+
* and [.MuiAlert-colorWarning](/material-ui/api/alert/#alert-classes-colorWarning) classes instead.
|
|
81
|
+
* [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
82
|
+
*/
|
|
31
83
|
filledWarning: string;
|
|
32
|
-
/** Styles applied to the root element if `variant="filled"` and `color="error"`.
|
|
84
|
+
/** Styles applied to the root element if `variant="filled"` and `color="error"`.
|
|
85
|
+
* @deprecated Combine the [.MuiAlert-filled](/material-ui/api/alert/#alert-classes-filled)
|
|
86
|
+
* and [.MuiAlert-colorError](/material-ui/api/alert/#alert-classes-colorError) classes instead.
|
|
87
|
+
* [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
88
|
+
*/
|
|
33
89
|
filledError: string;
|
|
34
90
|
/** Styles applied to the icon wrapper element. */
|
|
35
91
|
icon: string;
|
package/Alert/alertClasses.js
CHANGED
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
|
3
3
|
export function getAlertUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiAlert', slot);
|
|
5
5
|
}
|
|
6
|
-
const alertClasses = generateUtilityClasses('MuiAlert', ['root', 'action', 'icon', 'message', 'filled', 'filledSuccess', 'filledInfo', 'filledWarning', 'filledError', 'outlined', 'outlinedSuccess', 'outlinedInfo', 'outlinedWarning', 'outlinedError', 'standard', 'standardSuccess', 'standardInfo', 'standardWarning', 'standardError']);
|
|
6
|
+
const alertClasses = generateUtilityClasses('MuiAlert', ['root', 'action', 'icon', 'message', 'filled', 'colorSuccess', 'colorInfo', 'colorWarning', 'colorError', 'filledSuccess', 'filledInfo', 'filledWarning', 'filledError', 'outlined', 'outlinedSuccess', 'outlinedInfo', 'outlinedWarning', 'outlinedError', 'standard', 'standardSuccess', 'standardInfo', 'standardWarning', 'standardError']);
|
|
7
7
|
export default alertClasses;
|
package/AlertTitle/AlertTitle.js
CHANGED
|
@@ -7,11 +7,11 @@ import * as React from 'react';
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
-
import styled from '../
|
|
11
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
10
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
12
11
|
import Typography from '../Typography';
|
|
13
12
|
import { getAlertTitleUtilityClass } from './alertTitleClasses';
|
|
14
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const useThemeProps = createUseThemeProps('MuiAlertTitle');
|
|
15
15
|
const useUtilityClasses = ownerState => {
|
|
16
16
|
const {
|
|
17
17
|
classes
|
|
@@ -554,6 +554,63 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
554
554
|
const paperSlotProps = (_slotProps$paper = slotProps.paper) != null ? _slotProps$paper : componentsProps.paper;
|
|
555
555
|
const popperSlotProps = (_slotProps$popper = slotProps.popper) != null ? _slotProps$popper : componentsProps.popper;
|
|
556
556
|
const popupIndicatorSlotProps = (_slotProps$popupIndic = slotProps.popupIndicator) != null ? _slotProps$popupIndic : componentsProps.popupIndicator;
|
|
557
|
+
const renderAutocompletePopperChildren = children => /*#__PURE__*/_jsx(AutocompletePopper, _extends({
|
|
558
|
+
as: PopperComponent,
|
|
559
|
+
disablePortal: disablePortal,
|
|
560
|
+
style: {
|
|
561
|
+
width: anchorEl ? anchorEl.clientWidth : null
|
|
562
|
+
},
|
|
563
|
+
ownerState: ownerState,
|
|
564
|
+
role: "presentation",
|
|
565
|
+
anchorEl: anchorEl,
|
|
566
|
+
open: popupOpen
|
|
567
|
+
}, popperSlotProps, {
|
|
568
|
+
className: clsx(classes.popper, popperSlotProps == null ? void 0 : popperSlotProps.className),
|
|
569
|
+
children: /*#__PURE__*/_jsx(AutocompletePaper, _extends({
|
|
570
|
+
ownerState: ownerState,
|
|
571
|
+
as: PaperComponent
|
|
572
|
+
}, paperSlotProps, {
|
|
573
|
+
className: clsx(classes.paper, paperSlotProps == null ? void 0 : paperSlotProps.className),
|
|
574
|
+
children: children
|
|
575
|
+
}))
|
|
576
|
+
}));
|
|
577
|
+
let autocompletePopper = null;
|
|
578
|
+
if (!loading && groupedOptions.length > 0) {
|
|
579
|
+
autocompletePopper = renderAutocompletePopperChildren( /*#__PURE__*/_jsx(AutocompleteListbox, _extends({
|
|
580
|
+
as: ListboxComponent,
|
|
581
|
+
className: classes.listbox,
|
|
582
|
+
ownerState: ownerState
|
|
583
|
+
}, otherListboxProps, ListboxProps, {
|
|
584
|
+
ref: combinedListboxRef,
|
|
585
|
+
children: groupedOptions.map((option, index) => {
|
|
586
|
+
if (groupBy) {
|
|
587
|
+
return renderGroup({
|
|
588
|
+
key: option.key,
|
|
589
|
+
group: option.group,
|
|
590
|
+
children: option.options.map((option2, index2) => renderListOption(option2, option.index + index2))
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
return renderListOption(option, index);
|
|
594
|
+
})
|
|
595
|
+
})));
|
|
596
|
+
} else if (loading && groupedOptions.length === 0) {
|
|
597
|
+
autocompletePopper = renderAutocompletePopperChildren( /*#__PURE__*/_jsx(AutocompleteLoading, {
|
|
598
|
+
className: classes.loading,
|
|
599
|
+
ownerState: ownerState,
|
|
600
|
+
children: loadingText
|
|
601
|
+
}));
|
|
602
|
+
} else if (groupedOptions.length === 0 && !freeSolo && !loading) {
|
|
603
|
+
autocompletePopper = renderAutocompletePopperChildren( /*#__PURE__*/_jsx(AutocompleteNoOptions, {
|
|
604
|
+
className: classes.noOptions,
|
|
605
|
+
ownerState: ownerState,
|
|
606
|
+
role: "presentation",
|
|
607
|
+
onMouseDown: event => {
|
|
608
|
+
// Prevent input blur when interacting with the "no options" content
|
|
609
|
+
event.preventDefault();
|
|
610
|
+
},
|
|
611
|
+
children: noOptionsText
|
|
612
|
+
}));
|
|
613
|
+
}
|
|
557
614
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
558
615
|
children: [/*#__PURE__*/_jsx(AutocompleteRoot, _extends({
|
|
559
616
|
ref: ref,
|
|
@@ -603,55 +660,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
603
660
|
readOnly
|
|
604
661
|
}, getInputProps())
|
|
605
662
|
})
|
|
606
|
-
})), anchorEl ?
|
|
607
|
-
as: PopperComponent,
|
|
608
|
-
disablePortal: disablePortal,
|
|
609
|
-
style: {
|
|
610
|
-
width: anchorEl ? anchorEl.clientWidth : null
|
|
611
|
-
},
|
|
612
|
-
ownerState: ownerState,
|
|
613
|
-
role: "presentation",
|
|
614
|
-
anchorEl: anchorEl,
|
|
615
|
-
open: popupOpen
|
|
616
|
-
}, popperSlotProps, {
|
|
617
|
-
className: clsx(classes.popper, popperSlotProps == null ? void 0 : popperSlotProps.className),
|
|
618
|
-
children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
|
|
619
|
-
ownerState: ownerState,
|
|
620
|
-
as: PaperComponent
|
|
621
|
-
}, paperSlotProps, {
|
|
622
|
-
className: clsx(classes.paper, paperSlotProps == null ? void 0 : paperSlotProps.className),
|
|
623
|
-
children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
|
|
624
|
-
className: classes.loading,
|
|
625
|
-
ownerState: ownerState,
|
|
626
|
-
children: loadingText
|
|
627
|
-
}) : null, groupedOptions.length === 0 && !freeSolo && !loading ? /*#__PURE__*/_jsx(AutocompleteNoOptions, {
|
|
628
|
-
className: classes.noOptions,
|
|
629
|
-
ownerState: ownerState,
|
|
630
|
-
role: "presentation",
|
|
631
|
-
onMouseDown: event => {
|
|
632
|
-
// Prevent input blur when interacting with the "no options" content
|
|
633
|
-
event.preventDefault();
|
|
634
|
-
},
|
|
635
|
-
children: noOptionsText
|
|
636
|
-
}) : null, groupedOptions.length > 0 ? /*#__PURE__*/_jsx(AutocompleteListbox, _extends({
|
|
637
|
-
as: ListboxComponent,
|
|
638
|
-
className: classes.listbox,
|
|
639
|
-
ownerState: ownerState
|
|
640
|
-
}, otherListboxProps, ListboxProps, {
|
|
641
|
-
ref: combinedListboxRef,
|
|
642
|
-
children: groupedOptions.map((option, index) => {
|
|
643
|
-
if (groupBy) {
|
|
644
|
-
return renderGroup({
|
|
645
|
-
key: option.key,
|
|
646
|
-
group: option.group,
|
|
647
|
-
children: option.options.map((option2, index2) => renderListOption(option2, option.index + index2))
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
return renderListOption(option, index);
|
|
651
|
-
})
|
|
652
|
-
})) : null]
|
|
653
|
-
}))
|
|
654
|
-
})) : null]
|
|
663
|
+
})), anchorEl ? autocompletePopper : null]
|
|
655
664
|
});
|
|
656
665
|
});
|
|
657
666
|
process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptypes */ = {
|
package/Avatar/Avatar.js
CHANGED
|
@@ -7,12 +7,12 @@ import * as React from 'react';
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
-
import styled from '../
|
|
11
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
10
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
12
11
|
import Person from '../internal/svg-icons/Person';
|
|
13
12
|
import { getAvatarUtilityClass } from './avatarClasses';
|
|
14
13
|
import useSlot from '../utils/useSlot';
|
|
15
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
const useThemeProps = createUseThemeProps('MuiAvatar');
|
|
16
16
|
const useUtilityClasses = ownerState => {
|
|
17
17
|
const {
|
|
18
18
|
classes,
|
package/Button/Button.js
CHANGED
|
@@ -28,10 +28,10 @@ const useUtilityClasses = ownerState => {
|
|
|
28
28
|
classes
|
|
29
29
|
} = ownerState;
|
|
30
30
|
const slots = {
|
|
31
|
-
root: ['root', variant, `${variant}${capitalize(color)}`, `size${capitalize(size)}`, `${variant}Size${capitalize(size)}`, color
|
|
31
|
+
root: ['root', variant, `${variant}${capitalize(color)}`, `size${capitalize(size)}`, `${variant}Size${capitalize(size)}`, `color${capitalize(color)}`, disableElevation && 'disableElevation', fullWidth && 'fullWidth'],
|
|
32
32
|
label: ['label'],
|
|
33
|
-
startIcon: ['startIcon', `iconSize${capitalize(size)}`],
|
|
34
|
-
endIcon: ['endIcon', `iconSize${capitalize(size)}`]
|
|
33
|
+
startIcon: ['icon', 'startIcon', `iconSize${capitalize(size)}`],
|
|
34
|
+
endIcon: ['icon', 'endIcon', `iconSize${capitalize(size)}`]
|
|
35
35
|
};
|
|
36
36
|
const composedClasses = composeClasses(slots, getButtonUtilityClass, classes);
|
|
37
37
|
return _extends({}, classes, composedClasses);
|