@mui/material 6.0.0-alpha.4 → 6.0.0-alpha.6
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/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 +86 -0
- package/Checkbox/Checkbox.js +3 -1
- package/Chip/chipClasses.d.ts +28 -26
- package/Chip/chipClasses.js +1 -1
- 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 +21 -14
- package/FormControlLabel/FormControlLabel.js +22 -4
- 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 +26 -14
- package/PaginationItem/PaginationItem.js +64 -20
- 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/SvgIcon/SvgIcon.js +73 -21
- 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 +2 -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/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 +22 -4
- 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 +64 -20
- 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/SvgIcon/SvgIcon.js +73 -21
- 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/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 +23 -5
- 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 +65 -20
- 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/SvgIcon/SvgIcon.js +79 -24
- 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 +2777 -1334
- package/umd/material-ui.production.min.js +4 -4
package/Typography/Typography.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
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";
|
|
5
|
-
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
+
const _excluded = ["color"],
|
|
6
|
+
_excluded2 = ["align", "className", "component", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"];
|
|
6
7
|
import * as React from 'react';
|
|
7
8
|
import PropTypes from 'prop-types';
|
|
8
9
|
import clsx from 'clsx';
|
|
9
10
|
import { extendSxProp } from '@mui/system/styleFunctionSx';
|
|
10
11
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
|
-
import styled from '../
|
|
12
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
12
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
13
13
|
import capitalize from '../utils/capitalize';
|
|
14
14
|
import { getTypographyUtilityClass } from './typographyClasses';
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
const useThemeProps = createUseThemeProps('MuiTypography');
|
|
16
17
|
const useUtilityClasses = ownerState => {
|
|
17
18
|
const {
|
|
18
19
|
align,
|
|
@@ -37,25 +38,62 @@ export const TypographyRoot = styled('span', {
|
|
|
37
38
|
return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== 'inherit' && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom, ownerState.paragraph && styles.paragraph];
|
|
38
39
|
}
|
|
39
40
|
})(({
|
|
40
|
-
theme
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
41
|
+
theme
|
|
42
|
+
}) => ({
|
|
43
|
+
margin: 0,
|
|
44
|
+
variants: [{
|
|
45
|
+
props: {
|
|
46
|
+
variant: 'inherit'
|
|
47
|
+
},
|
|
48
|
+
style: {
|
|
49
|
+
// Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
|
|
50
|
+
font: 'inherit',
|
|
51
|
+
lineHeight: 'inherit',
|
|
52
|
+
letterSpacing: 'inherit'
|
|
53
|
+
}
|
|
54
|
+
}, ...Object.entries(theme.typography).filter(([variant, value]) => variant !== 'inherit' && value && typeof value === 'object').map(([variant, value]) => ({
|
|
55
|
+
props: {
|
|
56
|
+
variant
|
|
57
|
+
},
|
|
58
|
+
style: value
|
|
59
|
+
})), ...Object.entries(theme.palette).filter(([, value]) => value.main).map(([color]) => ({
|
|
60
|
+
props: {
|
|
61
|
+
color
|
|
62
|
+
},
|
|
63
|
+
style: {
|
|
64
|
+
color: (theme.vars || theme).palette[color].main
|
|
65
|
+
}
|
|
66
|
+
})), {
|
|
67
|
+
props: ({
|
|
68
|
+
ownerState
|
|
69
|
+
}) => ownerState.align !== 'inherit',
|
|
70
|
+
style: {
|
|
71
|
+
textAlign: 'var(--Typography-textAlign)'
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
props: ({
|
|
75
|
+
ownerState
|
|
76
|
+
}) => ownerState.noWrap,
|
|
77
|
+
style: {
|
|
78
|
+
overflow: 'hidden',
|
|
79
|
+
textOverflow: 'ellipsis',
|
|
80
|
+
whiteSpace: 'nowrap'
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
props: ({
|
|
84
|
+
ownerState
|
|
85
|
+
}) => ownerState.gutterBottom,
|
|
86
|
+
style: {
|
|
87
|
+
marginBottom: '0.35em'
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
props: ({
|
|
91
|
+
ownerState
|
|
92
|
+
}) => ownerState.paragraph,
|
|
93
|
+
style: {
|
|
94
|
+
marginBottom: 16
|
|
95
|
+
}
|
|
96
|
+
}]
|
|
59
97
|
}));
|
|
60
98
|
const defaultVariantMapping = {
|
|
61
99
|
h1: 'h1',
|
|
@@ -71,25 +109,30 @@ const defaultVariantMapping = {
|
|
|
71
109
|
inherit: 'p'
|
|
72
110
|
};
|
|
73
111
|
|
|
74
|
-
// TODO
|
|
112
|
+
// TODO v7: remove this transformation and `extendSxProp`
|
|
75
113
|
const colorTransformations = {
|
|
76
|
-
primary: 'primary.main',
|
|
77
114
|
textPrimary: 'text.primary',
|
|
78
|
-
secondary: 'secondary.main',
|
|
79
115
|
textSecondary: 'text.secondary',
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
116
|
+
// For the main palette, the color will be applied by the `...Object.entries(theme.palette)` clause in the TypographyRoot's styles
|
|
117
|
+
primary: null,
|
|
118
|
+
secondary: null,
|
|
119
|
+
error: null,
|
|
120
|
+
info: null,
|
|
121
|
+
success: null,
|
|
122
|
+
warning: null
|
|
84
123
|
};
|
|
85
124
|
const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, ref) {
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
125
|
+
const _useThemeProps = useThemeProps({
|
|
126
|
+
props: inProps,
|
|
127
|
+
name: 'MuiTypography'
|
|
128
|
+
}),
|
|
129
|
+
{
|
|
130
|
+
color
|
|
131
|
+
} = _useThemeProps,
|
|
132
|
+
themeProps = _objectWithoutPropertiesLoose(_useThemeProps, _excluded);
|
|
133
|
+
const textColor = colorTransformations[color];
|
|
134
|
+
const props = extendSxProp(_extends({}, themeProps, textColor !== null && {
|
|
135
|
+
color: textColor || color
|
|
93
136
|
}));
|
|
94
137
|
const {
|
|
95
138
|
align = 'inherit',
|
|
@@ -101,7 +144,7 @@ const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, re
|
|
|
101
144
|
variant = 'body1',
|
|
102
145
|
variantMapping = defaultVariantMapping
|
|
103
146
|
} = props,
|
|
104
|
-
other = _objectWithoutPropertiesLoose(props,
|
|
147
|
+
other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
105
148
|
const ownerState = _extends({}, props, {
|
|
106
149
|
align,
|
|
107
150
|
color,
|
|
@@ -120,7 +163,10 @@ const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, re
|
|
|
120
163
|
ref: ref,
|
|
121
164
|
className: clsx(classes.root, className)
|
|
122
165
|
}, other, {
|
|
123
|
-
ownerState: ownerState
|
|
166
|
+
ownerState: ownerState,
|
|
167
|
+
style: _extends({}, align !== 'inherit' && {
|
|
168
|
+
'--Typography-textAlign': align
|
|
169
|
+
}, other.style)
|
|
124
170
|
}));
|
|
125
171
|
});
|
|
126
172
|
process.env.NODE_ENV !== "production" ? Typography.propTypes /* remove-proptypes */ = {
|
|
@@ -168,6 +214,10 @@ process.env.NODE_ENV !== "production" ? Typography.propTypes /* remove-proptypes
|
|
|
168
214
|
* @default false
|
|
169
215
|
*/
|
|
170
216
|
paragraph: PropTypes.bool,
|
|
217
|
+
/**
|
|
218
|
+
* @ignore
|
|
219
|
+
*/
|
|
220
|
+
style: PropTypes.object,
|
|
171
221
|
/**
|
|
172
222
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
173
223
|
*/
|
package/index.js
CHANGED
package/internal/SwitchBase.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 = ["autoFocus", "checked", "checkedIcon", "className", "defaultChecked", "disabled", "disableFocusRipple", "edge", "icon", "id", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "readOnly", "required", "tabIndex", "type", "value"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -9,7 +9,8 @@ import clsx from 'clsx';
|
|
|
9
9
|
import refType from '@mui/utils/refType';
|
|
10
10
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
11
|
import capitalize from '../utils/capitalize';
|
|
12
|
-
import
|
|
12
|
+
import rootShouldForwardProp from '../styles/rootShouldForwardProp';
|
|
13
|
+
import { styled } from '../zero-styled';
|
|
13
14
|
import useControlled from '../utils/useControlled';
|
|
14
15
|
import useFormControl from '../FormControl/useFormControl';
|
|
15
16
|
import ButtonBase from '../ButtonBase';
|
|
@@ -28,16 +29,43 @@ const useUtilityClasses = ownerState => {
|
|
|
28
29
|
};
|
|
29
30
|
return composeClasses(slots, getSwitchBaseUtilityClass, classes);
|
|
30
31
|
};
|
|
31
|
-
const SwitchBaseRoot = styled(ButtonBase)(
|
|
32
|
-
ownerState
|
|
33
|
-
}) => _extends({
|
|
32
|
+
const SwitchBaseRoot = styled(ButtonBase)({
|
|
34
33
|
padding: 9,
|
|
35
|
-
borderRadius: '50%'
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
34
|
+
borderRadius: '50%',
|
|
35
|
+
variants: [{
|
|
36
|
+
props: {
|
|
37
|
+
edge: 'start',
|
|
38
|
+
size: 'small'
|
|
39
|
+
},
|
|
40
|
+
style: {
|
|
41
|
+
marginLeft: -3
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
props: ({
|
|
45
|
+
edge,
|
|
46
|
+
ownerState
|
|
47
|
+
}) => edge === 'start' && ownerState.size !== 'small',
|
|
48
|
+
style: {
|
|
49
|
+
marginLeft: -12
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
props: {
|
|
53
|
+
edge: 'end',
|
|
54
|
+
size: 'small'
|
|
55
|
+
},
|
|
56
|
+
style: {
|
|
57
|
+
marginRight: -3
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
props: ({
|
|
61
|
+
edge,
|
|
62
|
+
ownerState
|
|
63
|
+
}) => edge === 'end' && ownerState.size !== 'small',
|
|
64
|
+
style: {
|
|
65
|
+
marginRight: -12
|
|
66
|
+
}
|
|
67
|
+
}]
|
|
68
|
+
});
|
|
41
69
|
const SwitchBaseInput = styled('input', {
|
|
42
70
|
shouldForwardProp: rootShouldForwardProp
|
|
43
71
|
})({
|
|
@@ -282,13 +282,13 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
|
|
|
282
282
|
/**
|
|
283
283
|
* The component used for the transition.
|
|
284
284
|
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
285
|
-
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. [
|
|
285
|
+
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
286
286
|
*/
|
|
287
287
|
TransitionComponent: PropTypes.elementType,
|
|
288
288
|
/**
|
|
289
289
|
* Props applied to the transition element.
|
|
290
290
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
291
|
-
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. [
|
|
291
|
+
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
292
292
|
*/
|
|
293
293
|
TransitionProps: PropTypes.object
|
|
294
294
|
} : void 0;
|
package/modern/Alert/Alert.js
CHANGED
|
@@ -264,7 +264,7 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes /* remove-proptypes */ =
|
|
|
264
264
|
/**
|
|
265
265
|
* The components used for each slot inside.
|
|
266
266
|
*
|
|
267
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [
|
|
267
|
+
* @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.
|
|
268
268
|
*
|
|
269
269
|
* @default {}
|
|
270
270
|
*/
|
|
@@ -276,7 +276,7 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes /* remove-proptypes */ =
|
|
|
276
276
|
* The extra props for the slot components.
|
|
277
277
|
* You can override the existing props or add new ones.
|
|
278
278
|
*
|
|
279
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [
|
|
279
|
+
* @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.
|
|
280
280
|
*
|
|
281
281
|
* @default {}
|
|
282
282
|
*/
|
package/modern/Avatar/Avatar.js
CHANGED
|
@@ -246,7 +246,7 @@ process.env.NODE_ENV !== "production" ? Avatar.propTypes /* remove-proptypes */
|
|
|
246
246
|
/**
|
|
247
247
|
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes) applied to the `img` element if the component is used to display an image.
|
|
248
248
|
* It can be used to listen for the loading error event.
|
|
249
|
-
* @deprecated Use `slotProps.img` instead. This prop will be removed in v7. [
|
|
249
|
+
* @deprecated Use `slotProps.img` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
250
250
|
*/
|
|
251
251
|
imgProps: PropTypes.object,
|
|
252
252
|
/**
|
|
@@ -189,7 +189,7 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes /* remove-proptypes *
|
|
|
189
189
|
* The component used for the transition.
|
|
190
190
|
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
191
191
|
* @default Fade
|
|
192
|
-
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. [
|
|
192
|
+
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
193
193
|
*/
|
|
194
194
|
TransitionComponent: PropTypes.elementType,
|
|
195
195
|
/**
|
package/modern/Badge/Badge.js
CHANGED
|
@@ -351,7 +351,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
|
|
|
351
351
|
/**
|
|
352
352
|
* The components used for each slot inside.
|
|
353
353
|
*
|
|
354
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [
|
|
354
|
+
* @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.
|
|
355
355
|
*
|
|
356
356
|
* @default {}
|
|
357
357
|
*/
|
|
@@ -363,7 +363,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
|
|
|
363
363
|
* The extra props for the slot components.
|
|
364
364
|
* You can override the existing props or add new ones.
|
|
365
365
|
*
|
|
366
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [
|
|
366
|
+
* @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.
|
|
367
367
|
*
|
|
368
368
|
* @default {}
|
|
369
369
|
*/
|
|
@@ -6,7 +6,7 @@ const _excluded = ["slots", "slotProps"];
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { emphasize } from '@mui/system/colorManipulator';
|
|
9
|
-
import styled from '../
|
|
9
|
+
import { styled } from '../zero-styled';
|
|
10
10
|
import MoreHorizIcon from '../internal/svg-icons/MoreHoriz';
|
|
11
11
|
import ButtonBase from '../ButtonBase';
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
package/modern/Button/Button.js
CHANGED
|
@@ -9,7 +9,7 @@ import clsx from 'clsx';
|
|
|
9
9
|
import resolveProps from '@mui/utils/resolveProps';
|
|
10
10
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
11
|
import { alpha } from '@mui/system/colorManipulator';
|
|
12
|
-
import
|
|
12
|
+
import rootShouldForwardProp from '../styles/rootShouldForwardProp';
|
|
13
13
|
import { styled, createUseThemeProps } from '../zero-styled';
|
|
14
14
|
import ButtonBase from '../ButtonBase';
|
|
15
15
|
import capitalize from '../utils/capitalize';
|
|
@@ -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 = ["checkedIcon", "color", "icon", "indeterminate", "indeterminateIcon", "inputProps", "size", "className"];
|
|
5
|
+
const _excluded = ["checkedIcon", "color", "icon", "indeterminate", "indeterminateIcon", "inputProps", "size", "disableRipple", "className"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
@@ -109,12 +109,14 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(inProps, ref) {
|
|
|
109
109
|
indeterminateIcon: indeterminateIconProp = defaultIndeterminateIcon,
|
|
110
110
|
inputProps,
|
|
111
111
|
size = 'medium',
|
|
112
|
+
disableRipple = false,
|
|
112
113
|
className
|
|
113
114
|
} = props,
|
|
114
115
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
115
116
|
const icon = indeterminate ? indeterminateIconProp : iconProp;
|
|
116
117
|
const indeterminateIcon = indeterminate ? indeterminateIconProp : checkedIcon;
|
|
117
118
|
const ownerState = _extends({}, props, {
|
|
119
|
+
disableRipple,
|
|
118
120
|
color,
|
|
119
121
|
indeterminate,
|
|
120
122
|
size
|
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
|
3
3
|
export function getChipUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiChip', slot);
|
|
5
5
|
}
|
|
6
|
-
const chipClasses = generateUtilityClasses('MuiChip', ['root', 'sizeSmall', 'sizeMedium', 'colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'disabled', 'clickable', 'clickableColorPrimary', 'clickableColorSecondary', 'deletable', 'deletableColorPrimary', 'deletableColorSecondary', 'outlined', 'filled', 'outlinedPrimary', 'outlinedSecondary', 'filledPrimary', 'filledSecondary', 'avatar', 'avatarSmall', 'avatarMedium', 'avatarColorPrimary', 'avatarColorSecondary', 'icon', 'iconSmall', 'iconMedium', 'iconColorPrimary', 'iconColorSecondary', 'label', 'labelSmall', 'labelMedium', 'deleteIcon', 'deleteIconSmall', 'deleteIconMedium', 'deleteIconColorPrimary', 'deleteIconColorSecondary', 'deleteIconOutlinedColorPrimary', 'deleteIconOutlinedColorSecondary', 'deleteIconFilledColorPrimary', 'deleteIconFilledColorSecondary', 'focusVisible']);
|
|
6
|
+
const chipClasses = generateUtilityClasses('MuiChip', ['root', 'sizeSmall', 'sizeMedium', 'colorDefault', 'colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'disabled', 'clickable', 'clickableColorPrimary', 'clickableColorSecondary', 'deletable', 'deletableColorPrimary', 'deletableColorSecondary', 'outlined', 'filled', 'outlinedPrimary', 'outlinedSecondary', 'filledPrimary', 'filledSecondary', 'avatar', 'avatarSmall', 'avatarMedium', 'avatarColorPrimary', 'avatarColorSecondary', 'icon', 'iconSmall', 'iconMedium', 'iconColorPrimary', 'iconColorSecondary', 'label', 'labelSmall', 'labelMedium', 'deleteIcon', 'deleteIconSmall', 'deleteIconMedium', 'deleteIconColorPrimary', 'deleteIconColorSecondary', 'deleteIconOutlinedColorPrimary', 'deleteIconOutlinedColorSecondary', 'deleteIconFilledColorPrimary', 'deleteIconFilledColorSecondary', 'focusVisible']);
|
|
7
7
|
export default chipClasses;
|
|
@@ -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 = ["addEndListener", "children", "className", "collapsedSize", "component", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "orientation", "style", "timeout", "TransitionComponent"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import clsx from 'clsx';
|
|
@@ -10,14 +10,14 @@ import { Transition } from 'react-transition-group';
|
|
|
10
10
|
import useTimeout from '@mui/utils/useTimeout';
|
|
11
11
|
import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
|
|
12
12
|
import composeClasses from '@mui/utils/composeClasses';
|
|
13
|
-
import styled from '../
|
|
14
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
13
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
15
14
|
import { duration } from '../styles/createTransitions';
|
|
16
15
|
import { getTransitionProps } from '../transitions/utils';
|
|
17
16
|
import useTheme from '../styles/useTheme';
|
|
18
17
|
import { useForkRef } from '../utils';
|
|
19
18
|
import { getCollapseUtilityClass } from './collapseClasses';
|
|
20
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
const useThemeProps = createUseThemeProps('MuiCollapse');
|
|
21
21
|
const useUtilityClasses = ownerState => {
|
|
22
22
|
const {
|
|
23
23
|
orientation,
|
|
@@ -42,50 +42,79 @@ const CollapseRoot = styled('div', {
|
|
|
42
42
|
return [styles.root, styles[ownerState.orientation], ownerState.state === 'entered' && styles.entered, ownerState.state === 'exited' && !ownerState.in && ownerState.collapsedSize === '0px' && styles.hidden];
|
|
43
43
|
}
|
|
44
44
|
})(({
|
|
45
|
-
theme
|
|
46
|
-
|
|
47
|
-
}) => _extends({
|
|
45
|
+
theme
|
|
46
|
+
}) => ({
|
|
48
47
|
height: 0,
|
|
49
48
|
overflow: 'hidden',
|
|
50
|
-
transition: theme.transitions.create('height')
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
49
|
+
transition: theme.transitions.create('height'),
|
|
50
|
+
variants: [{
|
|
51
|
+
props: {
|
|
52
|
+
orientation: 'horizontal'
|
|
53
|
+
},
|
|
54
|
+
style: {
|
|
55
|
+
height: 'auto',
|
|
56
|
+
width: 0,
|
|
57
|
+
transition: theme.transitions.create('width')
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
props: {
|
|
61
|
+
state: 'entered'
|
|
62
|
+
},
|
|
63
|
+
style: {
|
|
64
|
+
height: 'auto',
|
|
65
|
+
overflow: 'visible'
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
props: {
|
|
69
|
+
state: 'entered',
|
|
70
|
+
orientation: 'horizontal'
|
|
71
|
+
},
|
|
72
|
+
style: {
|
|
73
|
+
width: 'auto'
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
props: ({
|
|
77
|
+
ownerState
|
|
78
|
+
}) => ownerState.state === 'exited' && !ownerState.in && ownerState.collapsedSize === '0px',
|
|
79
|
+
style: {
|
|
80
|
+
visibility: 'hidden'
|
|
81
|
+
}
|
|
82
|
+
}]
|
|
62
83
|
}));
|
|
63
84
|
const CollapseWrapper = styled('div', {
|
|
64
85
|
name: 'MuiCollapse',
|
|
65
86
|
slot: 'Wrapper',
|
|
66
87
|
overridesResolver: (props, styles) => styles.wrapper
|
|
67
|
-
})(
|
|
68
|
-
ownerState
|
|
69
|
-
}) => _extends({
|
|
88
|
+
})({
|
|
70
89
|
// Hack to get children with a negative margin to not falsify the height computation.
|
|
71
90
|
display: 'flex',
|
|
72
|
-
width: '100%'
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
91
|
+
width: '100%',
|
|
92
|
+
variants: [{
|
|
93
|
+
props: {
|
|
94
|
+
orientation: 'horizontal'
|
|
95
|
+
},
|
|
96
|
+
style: {
|
|
97
|
+
width: 'auto',
|
|
98
|
+
height: '100%'
|
|
99
|
+
}
|
|
100
|
+
}]
|
|
101
|
+
});
|
|
77
102
|
const CollapseWrapperInner = styled('div', {
|
|
78
103
|
name: 'MuiCollapse',
|
|
79
104
|
slot: 'WrapperInner',
|
|
80
105
|
overridesResolver: (props, styles) => styles.wrapperInner
|
|
81
|
-
})(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
106
|
+
})({
|
|
107
|
+
width: '100%',
|
|
108
|
+
variants: [{
|
|
109
|
+
props: {
|
|
110
|
+
orientation: 'horizontal'
|
|
111
|
+
},
|
|
112
|
+
style: {
|
|
113
|
+
width: 'auto',
|
|
114
|
+
height: '100%'
|
|
115
|
+
}
|
|
116
|
+
}]
|
|
117
|
+
});
|
|
89
118
|
|
|
90
119
|
/**
|
|
91
120
|
* The Collapse transition is used by the
|
|
@@ -373,5 +402,7 @@ process.env.NODE_ENV !== "production" ? Collapse.propTypes /* remove-proptypes *
|
|
|
373
402
|
exit: PropTypes.number
|
|
374
403
|
})])
|
|
375
404
|
} : void 0;
|
|
376
|
-
Collapse
|
|
405
|
+
if (Collapse) {
|
|
406
|
+
Collapse.muiSupportAuto = true;
|
|
407
|
+
}
|
|
377
408
|
export default Collapse;
|