@mui/material 6.0.0-alpha.5 → 6.0.0-alpha.7
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 +2 -2
- package/Accordion/Accordion.js +2 -2
- package/AccordionSummary/accordionSummaryClasses.d.ts +1 -1
- package/Alert/Alert.d.ts +2 -2
- package/Alert/Alert.js +2 -2
- package/Alert/alertClasses.d.ts +12 -12
- package/Autocomplete/Autocomplete.d.ts +78 -12
- package/Autocomplete/Autocomplete.js +120 -59
- package/Avatar/Avatar.d.ts +1 -1
- package/Avatar/Avatar.js +1 -1
- package/Backdrop/Backdrop.d.ts +1 -1
- package/Backdrop/Backdrop.js +1 -1
- package/Badge/Badge.d.ts +2 -2
- package/Badge/Badge.js +2 -2
- package/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
- package/Button/Button.js +1 -1
- package/Button/buttonClasses.d.ts +33 -33
- package/ButtonGroup/buttonGroupClasses.d.ts +17 -17
- package/CHANGELOG.md +95 -0
- package/Checkbox/Checkbox.js +3 -1
- package/Chip/chipClasses.d.ts +28 -26
- package/Chip/chipClasses.js +1 -1
- package/CircularProgress/circularProgressClasses.d.ts +6 -2
- package/Collapse/Collapse.js +66 -35
- package/Dialog/Dialog.js +105 -61
- package/DialogActions/DialogActions.js +16 -12
- package/DialogContent/DialogContent.js +25 -15
- package/DialogContentText/DialogContentText.js +3 -2
- package/DialogTitle/DialogTitle.js +2 -2
- package/Divider/Divider.d.ts +1 -1
- package/Divider/Divider.js +1 -1
- package/Drawer/Drawer.js +73 -32
- package/Fab/Fab.js +1 -1
- package/FilledInput/FilledInput.d.ts +1 -0
- package/FilledInput/FilledInput.js +170 -87
- package/FormControlLabel/FormControlLabel.d.ts +1 -1
- package/FormControlLabel/FormControlLabel.js +1 -1
- package/FormHelperText/FormHelperText.js +2 -2
- package/FormLabel/FormLabel.js +23 -13
- package/Grow/Grow.js +3 -1
- package/Icon/Icon.js +63 -23
- package/ImageList/ImageList.js +2 -2
- package/ImageListItem/ImageListItem.js +2 -2
- package/ImageListItemBar/ImageListItemBar.js +2 -2
- package/Input/Input.d.ts +1 -0
- package/Input/Input.js +84 -61
- package/InputAdornment/InputAdornment.js +37 -21
- package/InputBase/InputBase.js +58 -28
- package/InputLabel/InputLabel.js +120 -58
- package/Link/Link.js +99 -54
- package/Link/getTextDecoration.d.ts +2 -8
- package/Link/getTextDecoration.js +16 -8
- package/List/List.js +22 -13
- package/ListItem/ListItem.js +2 -2
- package/ListItemAvatar/ListItemAvatar.js +2 -2
- package/ListItemButton/ListItemButton.js +3 -2
- package/ListItemIcon/ListItemIcon.js +14 -9
- package/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
- package/ListItemText/ListItemText.js +2 -2
- package/ListSubheader/ListSubheader.js +5 -3
- package/Menu/Menu.js +3 -2
- package/MenuItem/MenuItem.js +47 -27
- package/NativeSelect/NativeSelectInput.js +78 -49
- package/OutlinedInput/NotchedOutline.js +60 -43
- package/OutlinedInput/OutlinedInput.js +97 -39
- package/Pagination/Pagination.js +2 -2
- package/PaginationItem/PaginationItem.d.ts +1 -1
- package/PaginationItem/PaginationItem.js +1 -1
- package/PaginationItem/paginationItemClasses.d.ts +4 -4
- package/Paper/Paper.js +44 -21
- package/Radio/Radio.js +5 -3
- package/Radio/RadioButtonIcon.js +1 -1
- package/Rating/Rating.js +3 -2
- package/Select/Select.js +2 -1
- package/Select/SelectInput.js +8 -6
- package/Skeleton/Skeleton.js +109 -61
- package/Slider/Slider.d.ts +2 -2
- package/Slider/Slider.js +2 -2
- package/Snackbar/Snackbar.js +66 -40
- package/SnackbarContent/SnackbarContent.js +2 -2
- package/SpeedDial/SpeedDial.d.ts +28 -1
- package/SpeedDial/SpeedDial.js +107 -49
- package/SpeedDialAction/SpeedDialAction.js +50 -24
- package/SpeedDialIcon/SpeedDialIcon.js +37 -16
- package/StepConnector/stepConnectorClasses.d.ts +2 -2
- package/StepLabel/StepLabel.d.ts +3 -3
- package/StepLabel/StepLabel.js +3 -3
- package/SwipeableDrawer/SwipeArea.js +39 -18
- package/Tab/Tab.js +127 -55
- package/TabScrollButton/TabScrollButton.js +27 -15
- package/Table/Table.js +2 -2
- package/TableBody/TableBody.js +2 -2
- package/TableCell/TableCell.js +2 -2
- package/TableContainer/TableContainer.js +2 -2
- package/TableFooter/TableFooter.js +2 -2
- package/TableHead/TableHead.js +2 -2
- package/TablePagination/TablePagination.js +2 -2
- package/TableRow/TableRow.js +2 -2
- package/TableSortLabel/TableSortLabel.js +2 -2
- package/Tabs/Tabs.js +107 -54
- package/TextField/TextField.js +2 -2
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +4 -2
- package/Toolbar/Toolbar.js +3 -7
- package/Tooltip/Tooltip.js +185 -88
- package/Typography/Typography.js +89 -39
- package/index.js +1 -1
- package/internal/SwitchBase.js +39 -11
- package/modern/Accordion/Accordion.js +2 -2
- package/modern/Alert/Alert.js +2 -2
- package/modern/Autocomplete/Autocomplete.js +120 -59
- package/modern/Avatar/Avatar.js +1 -1
- package/modern/Backdrop/Backdrop.js +1 -1
- package/modern/Badge/Badge.js +2 -2
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
- package/modern/Button/Button.js +1 -1
- package/modern/Checkbox/Checkbox.js +3 -1
- package/modern/Chip/chipClasses.js +1 -1
- package/modern/Collapse/Collapse.js +66 -35
- package/modern/Dialog/Dialog.js +105 -61
- package/modern/DialogActions/DialogActions.js +16 -12
- package/modern/DialogContent/DialogContent.js +25 -15
- package/modern/DialogContentText/DialogContentText.js +3 -2
- package/modern/DialogTitle/DialogTitle.js +2 -2
- package/modern/Divider/Divider.js +1 -1
- package/modern/Drawer/Drawer.js +73 -32
- package/modern/Fab/Fab.js +1 -1
- package/modern/FilledInput/FilledInput.js +170 -87
- package/modern/FormControlLabel/FormControlLabel.js +1 -1
- package/modern/FormHelperText/FormHelperText.js +2 -2
- package/modern/FormLabel/FormLabel.js +23 -13
- package/modern/Grow/Grow.js +3 -1
- package/modern/Icon/Icon.js +63 -23
- package/modern/ImageList/ImageList.js +2 -2
- package/modern/ImageListItem/ImageListItem.js +2 -2
- package/modern/ImageListItemBar/ImageListItemBar.js +2 -2
- package/modern/Input/Input.js +84 -61
- package/modern/InputAdornment/InputAdornment.js +37 -21
- package/modern/InputBase/InputBase.js +58 -28
- package/modern/InputLabel/InputLabel.js +120 -58
- package/modern/Link/Link.js +99 -54
- package/modern/Link/getTextDecoration.js +16 -8
- package/modern/List/List.js +22 -13
- package/modern/ListItem/ListItem.js +2 -2
- package/modern/ListItemAvatar/ListItemAvatar.js +2 -2
- package/modern/ListItemButton/ListItemButton.js +3 -2
- package/modern/ListItemIcon/ListItemIcon.js +14 -9
- package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
- package/modern/ListItemText/ListItemText.js +2 -2
- package/modern/ListSubheader/ListSubheader.js +5 -3
- package/modern/Menu/Menu.js +3 -2
- package/modern/MenuItem/MenuItem.js +47 -27
- package/modern/NativeSelect/NativeSelectInput.js +78 -49
- package/modern/OutlinedInput/NotchedOutline.js +60 -43
- package/modern/OutlinedInput/OutlinedInput.js +97 -39
- package/modern/Pagination/Pagination.js +2 -2
- package/modern/PaginationItem/PaginationItem.js +1 -1
- package/modern/Paper/Paper.js +44 -21
- package/modern/Radio/Radio.js +5 -3
- package/modern/Radio/RadioButtonIcon.js +1 -1
- package/modern/Rating/Rating.js +3 -2
- package/modern/Select/Select.js +2 -1
- package/modern/Select/SelectInput.js +8 -6
- package/modern/Skeleton/Skeleton.js +109 -61
- package/modern/Slider/Slider.js +2 -2
- package/modern/Snackbar/Snackbar.js +66 -40
- package/modern/SnackbarContent/SnackbarContent.js +2 -2
- package/modern/SpeedDial/SpeedDial.js +107 -49
- package/modern/SpeedDialAction/SpeedDialAction.js +50 -24
- package/modern/SpeedDialIcon/SpeedDialIcon.js +37 -16
- package/modern/StepLabel/StepLabel.js +3 -3
- package/modern/SwipeableDrawer/SwipeArea.js +39 -18
- package/modern/Tab/Tab.js +127 -55
- package/modern/TabScrollButton/TabScrollButton.js +27 -15
- package/modern/Table/Table.js +2 -2
- package/modern/TableBody/TableBody.js +2 -2
- package/modern/TableCell/TableCell.js +2 -2
- package/modern/TableContainer/TableContainer.js +2 -2
- package/modern/TableFooter/TableFooter.js +2 -2
- package/modern/TableHead/TableHead.js +2 -2
- package/modern/TablePagination/TablePagination.js +2 -2
- package/modern/TableRow/TableRow.js +2 -2
- package/modern/TableSortLabel/TableSortLabel.js +2 -2
- package/modern/Tabs/Tabs.js +107 -54
- package/modern/TextField/TextField.js +2 -2
- package/modern/Toolbar/Toolbar.js +3 -7
- package/modern/Tooltip/Tooltip.js +185 -88
- package/modern/Typography/Typography.js +89 -39
- package/modern/index.js +1 -1
- package/modern/internal/SwitchBase.js +39 -11
- package/node/Accordion/Accordion.js +2 -2
- package/node/Alert/Alert.js +2 -2
- package/node/Autocomplete/Autocomplete.js +120 -60
- package/node/Avatar/Avatar.js +1 -1
- package/node/Backdrop/Backdrop.js +1 -1
- package/node/Badge/Badge.js +2 -2
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +3 -3
- package/node/Button/Button.js +2 -2
- package/node/Checkbox/Checkbox.js +3 -1
- package/node/Chip/chipClasses.js +1 -1
- package/node/Collapse/Collapse.js +70 -39
- package/node/Dialog/Dialog.js +110 -66
- package/node/DialogActions/DialogActions.js +18 -14
- package/node/DialogContent/DialogContent.js +27 -17
- package/node/DialogContentText/DialogContentText.js +6 -5
- package/node/DialogTitle/DialogTitle.js +4 -4
- package/node/Divider/Divider.js +1 -1
- package/node/Drawer/Drawer.js +78 -37
- package/node/Fab/Fab.js +2 -2
- package/node/FilledInput/FilledInput.js +176 -91
- package/node/FormControlLabel/FormControlLabel.js +1 -1
- package/node/FormHelperText/FormHelperText.js +4 -4
- package/node/FormLabel/FormLabel.js +26 -16
- package/node/Grow/Grow.js +3 -1
- package/node/Icon/Icon.js +65 -25
- package/node/ImageList/ImageList.js +4 -4
- package/node/ImageListItem/ImageListItem.js +4 -4
- package/node/ImageListItemBar/ImageListItemBar.js +8 -8
- package/node/Input/Input.js +87 -64
- package/node/InputAdornment/InputAdornment.js +39 -23
- package/node/InputBase/InputBase.js +61 -31
- package/node/InputLabel/InputLabel.js +123 -61
- package/node/Link/Link.js +101 -56
- package/node/Link/getTextDecoration.js +18 -10
- package/node/List/List.js +24 -15
- package/node/ListItem/ListItem.js +5 -5
- package/node/ListItemAvatar/ListItemAvatar.js +4 -4
- package/node/ListItemButton/ListItemButton.js +6 -5
- package/node/ListItemIcon/ListItemIcon.js +16 -11
- package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +4 -4
- package/node/ListItemText/ListItemText.js +4 -4
- package/node/ListSubheader/ListSubheader.js +7 -5
- package/node/Menu/Menu.js +8 -7
- package/node/MenuItem/MenuItem.js +50 -30
- package/node/NativeSelect/NativeSelectInput.js +80 -53
- package/node/OutlinedInput/NotchedOutline.js +64 -47
- package/node/OutlinedInput/OutlinedInput.js +101 -43
- package/node/Pagination/Pagination.js +5 -5
- package/node/PaginationItem/PaginationItem.js +1 -1
- package/node/Paper/Paper.js +49 -28
- package/node/Radio/Radio.js +6 -4
- package/node/Radio/RadioButtonIcon.js +2 -2
- package/node/Rating/Rating.js +9 -8
- package/node/Select/Select.js +6 -5
- package/node/Select/SelectInput.js +9 -7
- package/node/Skeleton/Skeleton.js +113 -65
- package/node/Slider/Slider.js +2 -2
- package/node/Snackbar/Snackbar.js +68 -42
- package/node/SnackbarContent/SnackbarContent.js +6 -6
- package/node/SpeedDial/SpeedDial.js +111 -53
- package/node/SpeedDialAction/SpeedDialAction.js +54 -28
- package/node/SpeedDialIcon/SpeedDialIcon.js +39 -18
- package/node/StepLabel/StepLabel.js +3 -3
- package/node/SwipeableDrawer/SwipeArea.js +41 -20
- package/node/Tab/Tab.js +129 -57
- package/node/TabScrollButton/TabScrollButton.js +29 -17
- package/node/Table/Table.js +4 -4
- package/node/TableBody/TableBody.js +4 -4
- package/node/TableCell/TableCell.js +4 -4
- package/node/TableContainer/TableContainer.js +4 -4
- package/node/TableFooter/TableFooter.js +4 -4
- package/node/TableHead/TableHead.js +4 -4
- package/node/TablePagination/TablePagination.js +10 -10
- package/node/TableRow/TableRow.js +4 -4
- package/node/TableSortLabel/TableSortLabel.js +5 -5
- package/node/Tabs/Tabs.js +113 -60
- package/node/TextField/TextField.js +4 -4
- package/node/Toolbar/Toolbar.js +5 -9
- package/node/Tooltip/Tooltip.js +189 -92
- package/node/Typography/Typography.js +90 -40
- package/node/index.js +1 -1
- package/node/internal/SwitchBase.js +41 -13
- package/package.json +6 -6
- package/umd/material-ui.development.js +2705 -1353
- package/umd/material-ui.production.min.js +4 -4
|
@@ -399,7 +399,7 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-propt
|
|
|
399
399
|
* It's recommended to use the `slots` prop instead.
|
|
400
400
|
*
|
|
401
401
|
* @default {}
|
|
402
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [
|
|
402
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
403
403
|
*/
|
|
404
404
|
components: PropTypes.shape({
|
|
405
405
|
first: PropTypes.elementType,
|
|
@@ -10,21 +10,21 @@ export interface PaginationItemClasses {
|
|
|
10
10
|
/** Styles applied to the root element if `variant="text"`. */
|
|
11
11
|
text: string;
|
|
12
12
|
/** Styles applied to the root element if `variant="text"` and `color="primary"`.
|
|
13
|
-
* @deprecated Combine the [.MuiPaginationItem-text](/material-ui/api/pagination-item/#pagination-item-classes-text) and [.MuiPaginationItem-colorPrimary](/material-ui/api/pagination-item/#pagination-item-classes-colorPrimary) classes instead. [
|
|
13
|
+
* @deprecated Combine the [.MuiPaginationItem-text](/material-ui/api/pagination-item/#pagination-item-classes-text) and [.MuiPaginationItem-colorPrimary](/material-ui/api/pagination-item/#pagination-item-classes-colorPrimary) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
14
14
|
*/
|
|
15
15
|
textPrimary: string;
|
|
16
16
|
/** Styles applied to the root element if `variant="text"` and `color="secondary"`.
|
|
17
|
-
* @deprecated Combine the [.MuiPaginationItem-text](/material-ui/api/pagination-item/#pagination-item-classes-text) and [.MuiPaginationItem-colorSecondary](/material-ui/api/pagination-item/#pagination-item-classes-colorSecondary) classes instead. [
|
|
17
|
+
* @deprecated Combine the [.MuiPaginationItem-text](/material-ui/api/pagination-item/#pagination-item-classes-text) and [.MuiPaginationItem-colorSecondary](/material-ui/api/pagination-item/#pagination-item-classes-colorSecondary) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
18
18
|
*/
|
|
19
19
|
textSecondary: string;
|
|
20
20
|
/** Styles applied to the root element if `variant="outlined"`. */
|
|
21
21
|
outlined: string;
|
|
22
22
|
/** Styles applied to the root element if `variant="outlined"` and `color="primary"`.
|
|
23
|
-
* @deprecated Combine the [.MuiPaginationItem-outlined](/material-ui/api/pagination-item/#pagination-item-classes-outlined) and [.MuiPaginationItem-colorPrimary](/material-ui/api/pagination-item/#pagination-item-classes-colorPrimary) classes instead. [
|
|
23
|
+
* @deprecated Combine the [.MuiPaginationItem-outlined](/material-ui/api/pagination-item/#pagination-item-classes-outlined) and [.MuiPaginationItem-colorPrimary](/material-ui/api/pagination-item/#pagination-item-classes-colorPrimary) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
24
24
|
*/
|
|
25
25
|
outlinedPrimary: string;
|
|
26
26
|
/** Styles applied to the root element if `variant="outlined"` and `color="secondary"`.
|
|
27
|
-
* @deprecated Combine the [.MuiPaginationItem-outlined](/material-ui/api/pagination-item/#pagination-item-classes-outlined) and [.MuiPaginationItem-colorSecondary](/material-ui/api/pagination-item/#pagination-item-classes-colorSecondary) classes instead. [
|
|
27
|
+
* @deprecated Combine the [.MuiPaginationItem-outlined](/material-ui/api/pagination-item/#pagination-item-classes-outlined) and [.MuiPaginationItem-colorSecondary](/material-ui/api/pagination-item/#pagination-item-classes-colorSecondary) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
28
28
|
*/
|
|
29
29
|
outlinedSecondary: string;
|
|
30
30
|
/** Styles applied to the root element if `rounded="true"`. */
|
package/Paper/Paper.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["className", "component", "elevation", "square", "variant"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -10,12 +10,12 @@ import integerPropType from '@mui/utils/integerPropType';
|
|
|
10
10
|
import chainPropTypes from '@mui/utils/chainPropTypes';
|
|
11
11
|
import composeClasses from '@mui/utils/composeClasses';
|
|
12
12
|
import { alpha } from '@mui/system/colorManipulator';
|
|
13
|
-
import styled from '../
|
|
13
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
14
14
|
import getOverlayAlpha from '../styles/getOverlayAlpha';
|
|
15
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
16
15
|
import useTheme from '../styles/useTheme';
|
|
17
16
|
import { getPaperUtilityClass } from './paperClasses';
|
|
18
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
const useThemeProps = createUseThemeProps('MuiPaper');
|
|
19
19
|
const useUtilityClasses = ownerState => {
|
|
20
20
|
const {
|
|
21
21
|
square,
|
|
@@ -38,28 +38,41 @@ const PaperRoot = styled('div', {
|
|
|
38
38
|
return [styles.root, styles[ownerState.variant], !ownerState.square && styles.rounded, ownerState.variant === 'elevation' && styles[`elevation${ownerState.elevation}`]];
|
|
39
39
|
}
|
|
40
40
|
})(({
|
|
41
|
-
theme
|
|
42
|
-
|
|
43
|
-
}) => _extends({
|
|
41
|
+
theme
|
|
42
|
+
}) => ({
|
|
44
43
|
backgroundColor: (theme.vars || theme).palette.background.paper,
|
|
45
44
|
color: (theme.vars || theme).palette.text.primary,
|
|
46
|
-
transition: theme.transitions.create('box-shadow')
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
45
|
+
transition: theme.transitions.create('box-shadow'),
|
|
46
|
+
variants: [{
|
|
47
|
+
props: ({
|
|
48
|
+
ownerState
|
|
49
|
+
}) => !ownerState.square,
|
|
50
|
+
style: {
|
|
51
|
+
borderRadius: theme.shape.borderRadius
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
props: {
|
|
55
|
+
variant: 'outlined'
|
|
56
|
+
},
|
|
57
|
+
style: {
|
|
58
|
+
border: `1px solid ${(theme.vars || theme).palette.divider}`
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
props: {
|
|
62
|
+
variant: 'elevation'
|
|
63
|
+
},
|
|
64
|
+
style: {
|
|
65
|
+
boxShadow: 'var(--Paper-shadow)',
|
|
66
|
+
backgroundImage: 'var(--Paper-overlay)'
|
|
67
|
+
}
|
|
68
|
+
}]
|
|
69
|
+
}));
|
|
58
70
|
const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
|
|
59
71
|
const props = useThemeProps({
|
|
60
72
|
props: inProps,
|
|
61
73
|
name: 'MuiPaper'
|
|
62
74
|
});
|
|
75
|
+
const theme = useTheme();
|
|
63
76
|
const {
|
|
64
77
|
className,
|
|
65
78
|
component = 'div',
|
|
@@ -76,8 +89,6 @@ const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
|
|
|
76
89
|
});
|
|
77
90
|
const classes = useUtilityClasses(ownerState);
|
|
78
91
|
if (process.env.NODE_ENV !== 'production') {
|
|
79
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
80
|
-
const theme = useTheme();
|
|
81
92
|
if (theme.shadows[elevation] === undefined) {
|
|
82
93
|
console.error([`MUI: The elevation provided <Paper elevation={${elevation}}> is not available in the theme.`, `Please make sure that \`theme.shadows[${elevation}]\` is defined.`].join('\n'));
|
|
83
94
|
}
|
|
@@ -87,7 +98,15 @@ const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
|
|
|
87
98
|
ownerState: ownerState,
|
|
88
99
|
className: clsx(classes.root, className),
|
|
89
100
|
ref: ref
|
|
90
|
-
}, other
|
|
101
|
+
}, other, {
|
|
102
|
+
style: _extends({}, variant === 'elevation' && _extends({
|
|
103
|
+
'--Paper-shadow': (theme.vars || theme).shadows[elevation]
|
|
104
|
+
}, theme.vars && {
|
|
105
|
+
'--Paper-overlay': theme.overlays?.[elevation]
|
|
106
|
+
}, !theme.vars && theme.palette.mode === 'dark' && {
|
|
107
|
+
'--Paper-overlay': `linear-gradient(${alpha('#fff', getOverlayAlpha(elevation))}, ${alpha('#fff', getOverlayAlpha(elevation))})`
|
|
108
|
+
}), other.style)
|
|
109
|
+
}));
|
|
91
110
|
});
|
|
92
111
|
process.env.NODE_ENV !== "production" ? Paper.propTypes /* remove-proptypes */ = {
|
|
93
112
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -131,6 +150,10 @@ process.env.NODE_ENV !== "production" ? Paper.propTypes /* remove-proptypes */ =
|
|
|
131
150
|
* @default false
|
|
132
151
|
*/
|
|
133
152
|
square: PropTypes.bool,
|
|
153
|
+
/**
|
|
154
|
+
* @ignore
|
|
155
|
+
*/
|
|
156
|
+
style: PropTypes.object,
|
|
134
157
|
/**
|
|
135
158
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
136
159
|
*/
|
package/Radio/Radio.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["checked", "checkedIcon", "color", "icon", "name", "onChange", "size", "className"];
|
|
5
|
+
const _excluded = ["checked", "checkedIcon", "color", "icon", "name", "onChange", "size", "className", "disableRipple"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
@@ -15,7 +15,7 @@ import capitalize from '../utils/capitalize';
|
|
|
15
15
|
import createChainedFunction from '../utils/createChainedFunction';
|
|
16
16
|
import useRadioGroup from '../RadioGroup/useRadioGroup';
|
|
17
17
|
import radioClasses, { getRadioUtilityClass } from './radioClasses';
|
|
18
|
-
import
|
|
18
|
+
import rootShouldForwardProp from '../styles/rootShouldForwardProp';
|
|
19
19
|
import { styled, createUseThemeProps } from '../zero-styled';
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
21
|
const useThemeProps = createUseThemeProps('MuiRadio');
|
|
@@ -116,10 +116,12 @@ const Radio = /*#__PURE__*/React.forwardRef(function Radio(inProps, ref) {
|
|
|
116
116
|
name: nameProp,
|
|
117
117
|
onChange: onChangeProp,
|
|
118
118
|
size = 'medium',
|
|
119
|
-
className
|
|
119
|
+
className,
|
|
120
|
+
disableRipple = false
|
|
120
121
|
} = props,
|
|
121
122
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
122
123
|
const ownerState = _extends({}, props, {
|
|
124
|
+
disableRipple,
|
|
123
125
|
color,
|
|
124
126
|
size
|
|
125
127
|
});
|
package/Radio/RadioButtonIcon.js
CHANGED
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import RadioButtonUncheckedIcon from '../internal/svg-icons/RadioButtonUnchecked';
|
|
7
7
|
import RadioButtonCheckedIcon from '../internal/svg-icons/RadioButtonChecked';
|
|
8
|
-
import
|
|
8
|
+
import rootShouldForwardProp from '../styles/rootShouldForwardProp';
|
|
9
9
|
import { styled } from '../zero-styled';
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
const RadioButtonIconRoot = styled('span', {
|
package/Rating/Rating.js
CHANGED
|
@@ -15,10 +15,11 @@ import { useRtl } from '@mui/system/RtlProvider';
|
|
|
15
15
|
import { capitalize, useForkRef, useIsFocusVisible, useControlled, unstable_useId as useId } from '../utils';
|
|
16
16
|
import Star from '../internal/svg-icons/Star';
|
|
17
17
|
import StarBorder from '../internal/svg-icons/StarBorder';
|
|
18
|
-
import
|
|
19
|
-
import
|
|
18
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
19
|
+
import slotShouldForwardProp from '../styles/slotShouldForwardProp';
|
|
20
20
|
import ratingClasses, { getRatingUtilityClass } from './ratingClasses';
|
|
21
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
const useThemeProps = createUseThemeProps('MuiRating');
|
|
22
23
|
function getDecimalPrecision(num) {
|
|
23
24
|
const decimalPart = num.toString().split('.')[1];
|
|
24
25
|
return decimalPart ? decimalPart.length : 0;
|
package/Select/Select.js
CHANGED
|
@@ -18,7 +18,8 @@ import FilledInput from '../FilledInput';
|
|
|
18
18
|
import OutlinedInput from '../OutlinedInput';
|
|
19
19
|
import useThemeProps from '../styles/useThemeProps';
|
|
20
20
|
import useForkRef from '../utils/useForkRef';
|
|
21
|
-
import
|
|
21
|
+
import { styled } from '../zero-styled';
|
|
22
|
+
import rootShouldForwardProp from '../styles/rootShouldForwardProp';
|
|
22
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
24
|
const useUtilityClasses = ownerState => {
|
|
24
25
|
const {
|
package/Select/SelectInput.js
CHANGED
|
@@ -15,14 +15,15 @@ import refType from '@mui/utils/refType';
|
|
|
15
15
|
import ownerDocument from '../utils/ownerDocument';
|
|
16
16
|
import capitalize from '../utils/capitalize';
|
|
17
17
|
import Menu from '../Menu/Menu';
|
|
18
|
-
import {
|
|
18
|
+
import { StyledSelectSelect, StyledSelectIcon } from '../NativeSelect/NativeSelectInput';
|
|
19
19
|
import { isFilled } from '../InputBase/utils';
|
|
20
|
-
import
|
|
20
|
+
import { styled } from '../zero-styled';
|
|
21
|
+
import slotShouldForwardProp from '../styles/slotShouldForwardProp';
|
|
21
22
|
import useForkRef from '../utils/useForkRef';
|
|
22
23
|
import useControlled from '../utils/useControlled';
|
|
23
24
|
import selectClasses, { getSelectUtilityClasses } from './selectClasses';
|
|
24
25
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
-
const SelectSelect = styled(
|
|
26
|
+
const SelectSelect = styled(StyledSelectSelect, {
|
|
26
27
|
name: 'MuiSelect',
|
|
27
28
|
slot: 'Select',
|
|
28
29
|
overridesResolver: (props, styles) => {
|
|
@@ -41,7 +42,7 @@ const SelectSelect = styled('div', {
|
|
|
41
42
|
[`&.${selectClasses.multiple}`]: styles.multiple
|
|
42
43
|
}];
|
|
43
44
|
}
|
|
44
|
-
})(
|
|
45
|
+
})({
|
|
45
46
|
// Win specificity over the input base
|
|
46
47
|
[`&.${selectClasses.select}`]: {
|
|
47
48
|
height: 'auto',
|
|
@@ -53,7 +54,7 @@ const SelectSelect = styled('div', {
|
|
|
53
54
|
overflow: 'hidden'
|
|
54
55
|
}
|
|
55
56
|
});
|
|
56
|
-
const SelectIcon = styled(
|
|
57
|
+
const SelectIcon = styled(StyledSelectIcon, {
|
|
57
58
|
name: 'MuiSelect',
|
|
58
59
|
slot: 'Icon',
|
|
59
60
|
overridesResolver: (props, styles) => {
|
|
@@ -62,7 +63,7 @@ const SelectIcon = styled('svg', {
|
|
|
62
63
|
} = props;
|
|
63
64
|
return [styles.icon, ownerState.variant && styles[`icon${capitalize(ownerState.variant)}`], ownerState.open && styles.iconOpen];
|
|
64
65
|
}
|
|
65
|
-
})(
|
|
66
|
+
})({});
|
|
66
67
|
const SelectNativeInput = styled('input', {
|
|
67
68
|
shouldForwardProp: prop => slotShouldForwardProp(prop) && prop !== 'classes',
|
|
68
69
|
name: 'MuiSelect',
|
|
@@ -435,6 +436,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
435
436
|
const listboxId = useId();
|
|
436
437
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
437
438
|
children: [/*#__PURE__*/_jsx(SelectSelect, _extends({
|
|
439
|
+
as: "div",
|
|
438
440
|
ref: handleDisplayRef,
|
|
439
441
|
tabIndex: tabIndex,
|
|
440
442
|
role: "combobox",
|
package/Skeleton/Skeleton.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["animation", "className", "component", "height", "style", "variant", "width"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
|
-
import { keyframes, css } from '@mui/system';
|
|
10
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
10
|
import { alpha, unstable_getUnit as getUnit, unstable_toUnitless as toUnitless } from '../styles';
|
|
12
|
-
import styled from '../
|
|
13
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
11
|
+
import { keyframes, css, createUseThemeProps, styled } from '../zero-styled';
|
|
14
12
|
import { getSkeletonUtilityClass } from './skeletonClasses';
|
|
15
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const useThemeProps = createUseThemeProps('MuiSkeleton');
|
|
16
15
|
const useUtilityClasses = ownerState => {
|
|
17
16
|
const {
|
|
18
17
|
classes,
|
|
@@ -54,6 +53,16 @@ const waveKeyframe = keyframes`
|
|
|
54
53
|
transform: translateX(100%);
|
|
55
54
|
}
|
|
56
55
|
`;
|
|
56
|
+
|
|
57
|
+
// This implementation is for supporting both Styled-components v4+ and Pigment CSS.
|
|
58
|
+
// A global animation has to be created here for Styled-components v4+ (https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#12).
|
|
59
|
+
// which can be done by checking typeof indeterminate1Keyframe !== 'string' (at runtime, Pigment CSS transform keyframes`` to a string).
|
|
60
|
+
const pulseAnimation = typeof pulseKeyframe !== 'string' ? css`
|
|
61
|
+
animation: ${pulseKeyframe} 2s ease-in-out 0.5s infinite;
|
|
62
|
+
` : null;
|
|
63
|
+
const waveAnimation = typeof waveKeyframe !== 'string' ? css`
|
|
64
|
+
animation: ${waveKeyframe} 2s linear 0.5s infinite;
|
|
65
|
+
` : null;
|
|
57
66
|
const SkeletonRoot = styled('span', {
|
|
58
67
|
name: 'MuiSkeleton',
|
|
59
68
|
slot: 'Root',
|
|
@@ -64,70 +73,109 @@ const SkeletonRoot = styled('span', {
|
|
|
64
73
|
return [styles.root, styles[ownerState.variant], ownerState.animation !== false && styles[ownerState.animation], ownerState.hasChildren && styles.withChildren, ownerState.hasChildren && !ownerState.width && styles.fitContent, ownerState.hasChildren && !ownerState.height && styles.heightAuto];
|
|
65
74
|
}
|
|
66
75
|
})(({
|
|
67
|
-
theme
|
|
68
|
-
ownerState
|
|
76
|
+
theme
|
|
69
77
|
}) => {
|
|
70
78
|
const radiusUnit = getUnit(theme.shape.borderRadius) || 'px';
|
|
71
79
|
const radiusValue = toUnitless(theme.shape.borderRadius);
|
|
72
|
-
return
|
|
80
|
+
return {
|
|
73
81
|
display: 'block',
|
|
74
82
|
// Create a "on paper" color with sufficient contrast retaining the color
|
|
75
83
|
backgroundColor: theme.vars ? theme.vars.palette.Skeleton.bg : alpha(theme.palette.text.primary, theme.palette.mode === 'light' ? 0.11 : 0.13),
|
|
76
|
-
height: '1.2em'
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}, ownerState.hasChildren && {
|
|
92
|
-
'& > *': {
|
|
93
|
-
visibility: 'hidden'
|
|
94
|
-
}
|
|
95
|
-
}, ownerState.hasChildren && !ownerState.width && {
|
|
96
|
-
maxWidth: 'fit-content'
|
|
97
|
-
}, ownerState.hasChildren && !ownerState.height && {
|
|
98
|
-
height: 'auto'
|
|
99
|
-
});
|
|
100
|
-
}, ({
|
|
101
|
-
ownerState
|
|
102
|
-
}) => ownerState.animation === 'pulse' && css`
|
|
103
|
-
animation: ${pulseKeyframe} 2s ease-in-out 0.5s infinite;
|
|
104
|
-
`, ({
|
|
105
|
-
ownerState,
|
|
106
|
-
theme
|
|
107
|
-
}) => ownerState.animation === 'wave' && css`
|
|
108
|
-
position: relative;
|
|
109
|
-
overflow: hidden;
|
|
110
|
-
|
|
111
|
-
/* Fix bug in Safari https://bugs.webkit.org/show_bug.cgi?id=68196 */
|
|
112
|
-
-webkit-mask-image: -webkit-radial-gradient(white, black);
|
|
113
|
-
|
|
114
|
-
&::after {
|
|
115
|
-
animation: ${waveKeyframe} 2s linear 0.5s infinite;
|
|
116
|
-
background: linear-gradient(
|
|
117
|
-
90deg,
|
|
118
|
-
transparent,
|
|
119
|
-
${(theme.vars || theme).palette.action.hover},
|
|
120
|
-
transparent
|
|
121
|
-
);
|
|
122
|
-
content: '';
|
|
123
|
-
position: absolute;
|
|
124
|
-
transform: translateX(-100%); /* Avoid flash during server-side hydration */
|
|
125
|
-
bottom: 0;
|
|
126
|
-
left: 0;
|
|
127
|
-
right: 0;
|
|
128
|
-
top: 0;
|
|
84
|
+
height: '1.2em',
|
|
85
|
+
variants: [{
|
|
86
|
+
props: {
|
|
87
|
+
variant: 'text'
|
|
88
|
+
},
|
|
89
|
+
style: {
|
|
90
|
+
marginTop: 0,
|
|
91
|
+
marginBottom: 0,
|
|
92
|
+
height: 'auto',
|
|
93
|
+
transformOrigin: '0 55%',
|
|
94
|
+
transform: 'scale(1, 0.60)',
|
|
95
|
+
borderRadius: `${radiusValue}${radiusUnit}/${Math.round(radiusValue / 0.6 * 10) / 10}${radiusUnit}`,
|
|
96
|
+
'&:empty:before': {
|
|
97
|
+
content: '"\\00a0"'
|
|
98
|
+
}
|
|
129
99
|
}
|
|
130
|
-
|
|
100
|
+
}, {
|
|
101
|
+
props: {
|
|
102
|
+
variant: 'circular'
|
|
103
|
+
},
|
|
104
|
+
style: {
|
|
105
|
+
borderRadius: '50%'
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
props: {
|
|
109
|
+
variant: 'rounded'
|
|
110
|
+
},
|
|
111
|
+
style: {
|
|
112
|
+
borderRadius: (theme.vars || theme).shape.borderRadius
|
|
113
|
+
}
|
|
114
|
+
}, {
|
|
115
|
+
props: ({
|
|
116
|
+
ownerState
|
|
117
|
+
}) => ownerState.hasChildren,
|
|
118
|
+
style: {
|
|
119
|
+
'& > *': {
|
|
120
|
+
visibility: 'hidden'
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}, {
|
|
124
|
+
props: ({
|
|
125
|
+
ownerState
|
|
126
|
+
}) => ownerState.hasChildren && !ownerState.width,
|
|
127
|
+
style: {
|
|
128
|
+
maxWidth: 'fit-content'
|
|
129
|
+
}
|
|
130
|
+
}, {
|
|
131
|
+
props: ({
|
|
132
|
+
ownerState
|
|
133
|
+
}) => ownerState.hasChildren && !ownerState.height,
|
|
134
|
+
style: {
|
|
135
|
+
height: 'auto'
|
|
136
|
+
}
|
|
137
|
+
}, {
|
|
138
|
+
props: {
|
|
139
|
+
animation: 'pulse'
|
|
140
|
+
},
|
|
141
|
+
style: pulseAnimation || {
|
|
142
|
+
animation: `${pulseKeyframe} 2s ease-in-out 0.5s infinite`
|
|
143
|
+
}
|
|
144
|
+
}, {
|
|
145
|
+
props: {
|
|
146
|
+
animation: 'wave'
|
|
147
|
+
},
|
|
148
|
+
style: {
|
|
149
|
+
position: 'relative',
|
|
150
|
+
overflow: 'hidden',
|
|
151
|
+
/* Fix bug in Safari https://bugs.webkit.org/show_bug.cgi?id=68196 */
|
|
152
|
+
WebkitMaskImage: '-webkit-radial-gradient(white, black)',
|
|
153
|
+
'&::after': {
|
|
154
|
+
background: `linear-gradient(
|
|
155
|
+
90deg,
|
|
156
|
+
transparent,
|
|
157
|
+
${(theme.vars || theme).palette.action.hover},
|
|
158
|
+
transparent
|
|
159
|
+
)`,
|
|
160
|
+
content: '""',
|
|
161
|
+
position: 'absolute',
|
|
162
|
+
transform: 'translateX(-100%)' /* Avoid flash during server-side hydration */,
|
|
163
|
+
bottom: 0,
|
|
164
|
+
left: 0,
|
|
165
|
+
right: 0,
|
|
166
|
+
top: 0
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}, {
|
|
170
|
+
props: {
|
|
171
|
+
animation: 'wave'
|
|
172
|
+
},
|
|
173
|
+
style: waveAnimation || {
|
|
174
|
+
animation: `${waveKeyframe} 2s linear 0.5s infinite`
|
|
175
|
+
}
|
|
176
|
+
}]
|
|
177
|
+
};
|
|
178
|
+
});
|
|
131
179
|
const Skeleton = /*#__PURE__*/React.forwardRef(function Skeleton(inProps, ref) {
|
|
132
180
|
const props = useThemeProps({
|
|
133
181
|
props: inProps,
|
package/Slider/Slider.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export interface SliderOwnProps {
|
|
|
46
46
|
/**
|
|
47
47
|
* The components used for each slot inside.
|
|
48
48
|
*
|
|
49
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [
|
|
49
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
50
50
|
*
|
|
51
51
|
* @default {}
|
|
52
52
|
*/
|
|
@@ -64,7 +64,7 @@ export interface SliderOwnProps {
|
|
|
64
64
|
* The extra props for the slot components.
|
|
65
65
|
* You can override the existing props or add new ones.
|
|
66
66
|
*
|
|
67
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [
|
|
67
|
+
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
68
68
|
*
|
|
69
69
|
* @default {}
|
|
70
70
|
*/
|
package/Slider/Slider.js
CHANGED
|
@@ -795,7 +795,7 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
|
|
|
795
795
|
/**
|
|
796
796
|
* The components used for each slot inside.
|
|
797
797
|
*
|
|
798
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [
|
|
798
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
799
799
|
*
|
|
800
800
|
* @default {}
|
|
801
801
|
*/
|
|
@@ -813,7 +813,7 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
|
|
|
813
813
|
* The extra props for the slot components.
|
|
814
814
|
* You can override the existing props or add new ones.
|
|
815
815
|
*
|
|
816
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [
|
|
816
|
+
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
817
817
|
*
|
|
818
818
|
* @default {}
|
|
819
819
|
*/
|
package/Snackbar/Snackbar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["onEnter", "onExited"],
|
|
6
6
|
_excluded2 = ["action", "anchorOrigin", "autoHideDuration", "children", "className", "ClickAwayListenerProps", "ContentProps", "disableWindowBlurListener", "message", "onBlur", "onClose", "onFocus", "onMouseEnter", "onMouseLeave", "open", "resumeHideDuration", "TransitionComponent", "transitionDuration", "TransitionProps"];
|
|
7
7
|
import * as React from 'react';
|
|
@@ -10,14 +10,14 @@ import { useSlotProps } from '@mui/base/utils';
|
|
|
10
10
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
11
|
import { ClickAwayListener } from '@mui/base/ClickAwayListener';
|
|
12
12
|
import { useSnackbar } from '@mui/base/useSnackbar';
|
|
13
|
-
import styled from '../
|
|
13
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
14
14
|
import useTheme from '../styles/useTheme';
|
|
15
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
16
15
|
import capitalize from '../utils/capitalize';
|
|
17
16
|
import Grow from '../Grow';
|
|
18
17
|
import SnackbarContent from '../SnackbarContent';
|
|
19
18
|
import { getSnackbarUtilityClass } from './snackbarClasses';
|
|
20
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
const useThemeProps = createUseThemeProps('MuiSnackbar');
|
|
21
21
|
const useUtilityClasses = ownerState => {
|
|
22
22
|
const {
|
|
23
23
|
classes,
|
|
@@ -38,44 +38,70 @@ const SnackbarRoot = styled('div', {
|
|
|
38
38
|
return [styles.root, styles[`anchorOrigin${capitalize(ownerState.anchorOrigin.vertical)}${capitalize(ownerState.anchorOrigin.horizontal)}`]];
|
|
39
39
|
}
|
|
40
40
|
})(({
|
|
41
|
-
theme
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
bottom: 8
|
|
61
|
-
}, ownerState.anchorOrigin.horizontal === 'left' && {
|
|
62
|
-
justifyContent: 'flex-start'
|
|
63
|
-
}, ownerState.anchorOrigin.horizontal === 'right' && {
|
|
64
|
-
justifyContent: 'flex-end'
|
|
41
|
+
theme
|
|
42
|
+
}) => ({
|
|
43
|
+
zIndex: (theme.vars || theme).zIndex.snackbar,
|
|
44
|
+
position: 'fixed',
|
|
45
|
+
display: 'flex',
|
|
46
|
+
left: 8,
|
|
47
|
+
right: 8,
|
|
48
|
+
justifyContent: 'center',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
variants: [{
|
|
51
|
+
props: ({
|
|
52
|
+
ownerState
|
|
53
|
+
}) => ownerState.anchorOrigin.vertical === 'top',
|
|
54
|
+
style: {
|
|
55
|
+
top: 8,
|
|
56
|
+
[theme.breakpoints.up('sm')]: {
|
|
57
|
+
top: 24
|
|
58
|
+
}
|
|
59
|
+
}
|
|
65
60
|
}, {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
})
|
|
61
|
+
props: ({
|
|
62
|
+
ownerState
|
|
63
|
+
}) => ownerState.anchorOrigin.vertical !== 'top',
|
|
64
|
+
style: {
|
|
65
|
+
bottom: 8,
|
|
66
|
+
[theme.breakpoints.up('sm')]: {
|
|
67
|
+
bottom: 24
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
props: ({
|
|
72
|
+
ownerState
|
|
73
|
+
}) => ownerState.anchorOrigin.horizontal === 'left',
|
|
74
|
+
style: {
|
|
75
|
+
justifyContent: 'flex-start',
|
|
76
|
+
[theme.breakpoints.up('sm')]: {
|
|
77
|
+
left: 24,
|
|
78
|
+
right: 'auto'
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
props: ({
|
|
83
|
+
ownerState
|
|
84
|
+
}) => ownerState.anchorOrigin.horizontal === 'right',
|
|
85
|
+
style: {
|
|
86
|
+
justifyContent: 'flex-end',
|
|
87
|
+
[theme.breakpoints.up('sm')]: {
|
|
88
|
+
right: 24,
|
|
89
|
+
left: 'auto'
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
props: ({
|
|
94
|
+
ownerState
|
|
95
|
+
}) => ownerState.anchorOrigin.horizontal === 'center',
|
|
96
|
+
style: {
|
|
97
|
+
[theme.breakpoints.up('sm')]: {
|
|
98
|
+
left: '50%',
|
|
99
|
+
right: 'auto',
|
|
100
|
+
transform: 'translateX(-50%)'
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}]
|
|
104
|
+
}));
|
|
79
105
|
const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
80
106
|
const props = useThemeProps({
|
|
81
107
|
props: inProps,
|