@mui/material 5.0.0-rc.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/Accordion.d.ts +4 -4
- package/Accordion/Accordion.js +3 -3
- package/Accordion/AccordionContext.js +1 -1
- package/AccordionActions/AccordionActions.d.ts +2 -2
- package/AccordionDetails/AccordionDetails.d.ts +2 -2
- package/AccordionSummary/AccordionSummary.d.ts +3 -3
- package/Alert/Alert.d.ts +3 -3
- package/AlertTitle/AlertTitle.d.ts +2 -2
- package/AppBar/AppBar.d.ts +3 -3
- package/Autocomplete/Autocomplete.d.ts +2 -2
- package/Autocomplete/Autocomplete.js +2 -2
- package/Avatar/Avatar.d.ts +2 -2
- package/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/AvatarGroup/AvatarGroup.js +2 -2
- package/Backdrop/Backdrop.d.ts +3 -3
- package/Badge/Badge.d.ts +4 -4
- package/BottomNavigation/BottomNavigation.d.ts +2 -2
- package/BottomNavigation/BottomNavigation.js +1 -1
- package/BottomNavigationAction/BottomNavigationAction.d.ts +3 -3
- package/Box/Box.d.ts +4 -4
- package/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/Breadcrumbs/Breadcrumbs.js +2 -2
- package/Button/Button.d.ts +4 -4
- package/ButtonBase/ButtonBase.d.ts +2 -2
- package/ButtonBase/ButtonBase.js +200 -30
- package/ButtonGroup/ButtonGroup.d.ts +2 -2
- package/ButtonGroup/ButtonGroup.js +1 -1
- package/CHANGELOG.md +119 -39
- package/Card/Card.d.ts +3 -3
- package/Card/Card.js +1 -1
- package/CardActionArea/CardActionArea.d.ts +3 -3
- package/CardActions/CardActions.d.ts +2 -2
- package/CardContent/CardContent.d.ts +2 -2
- package/CardHeader/CardHeader.d.ts +2 -2
- package/CardMedia/CardMedia.d.ts +2 -2
- package/CardMedia/CardMedia.js +1 -1
- package/Checkbox/Checkbox.d.ts +4 -4
- package/Checkbox/Checkbox.js +1 -1
- package/Chip/Chip.d.ts +2 -2
- package/Chip/Chip.js +1 -1
- package/CircularProgress/CircularProgress.d.ts +2 -2
- package/CircularProgress/CircularProgress.js +1 -1
- package/ClickAwayListener/ClickAwayListener.d.ts +3 -3
- package/ClickAwayListener/ClickAwayListener.js +3 -3
- package/Collapse/Collapse.d.ts +5 -5
- package/Container/Container.d.ts +2 -2
- package/CssBaseline/CssBaseline.d.ts +2 -2
- package/Dialog/Dialog.d.ts +4 -4
- package/Dialog/Dialog.js +1 -1
- package/DialogActions/DialogActions.d.ts +2 -2
- package/DialogContent/DialogContent.d.ts +2 -2
- package/DialogContentText/DialogContentText.d.ts +3 -3
- package/DialogTitle/DialogTitle.d.ts +2 -2
- package/Divider/Divider.d.ts +3 -3
- package/Drawer/Drawer.d.ts +3 -3
- package/Fab/Fab.d.ts +3 -3
- package/Fade/Fade.d.ts +3 -3
- package/FilledInput/FilledInput.d.ts +3 -3
- package/FormControl/FormControl.d.ts +6 -6
- package/FormControl/FormControl.js +1 -1
- package/FormControlLabel/FormControlLabel.d.ts +4 -4
- package/FormGroup/FormGroup.d.ts +3 -3
- package/FormHelperText/FormHelperText.d.ts +2 -2
- package/FormLabel/FormLabel.d.ts +4 -4
- package/GlobalStyles/GlobalStyles.d.ts +2 -2
- package/Grid/Grid.d.ts +2 -2
- package/Grow/Grow.d.ts +5 -5
- package/Hidden/Hidden.d.ts +2 -2
- package/Hidden/HiddenCss.js +1 -1
- package/Icon/Icon.d.ts +3 -3
- package/IconButton/IconButton.d.ts +4 -4
- package/IconButton/IconButton.js +1 -1
- package/ImageList/ImageList.d.ts +2 -2
- package/ImageList/ImageList.js +2 -4
- package/ImageListItem/ImageListItem.d.ts +2 -2
- package/ImageListItem/ImageListItem.js +1 -1
- package/ImageListItemBar/ImageListItemBar.d.ts +2 -2
- package/Input/Input.d.ts +3 -3
- package/InputAdornment/InputAdornment.d.ts +2 -2
- package/InputAdornment/InputAdornment.js +1 -1
- package/InputBase/InputBase.d.ts +2 -2
- package/InputBase/InputBase.js +3 -3
- package/InputLabel/InputLabel.d.ts +3 -3
- package/LinearProgress/LinearProgress.d.ts +2 -2
- package/LinearProgress/LinearProgress.js +2 -2
- package/Link/Link.d.ts +4 -4
- package/List/List.d.ts +3 -3
- package/ListItem/ListItem.d.ts +3 -3
- package/ListItem/ListItem.js +2 -2
- package/ListItemAvatar/ListItemAvatar.d.ts +2 -2
- package/ListItemButton/ListItemButton.d.ts +3 -3
- package/ListItemButton/ListItemButton.js +1 -1
- package/ListItemIcon/ListItemIcon.d.ts +2 -2
- package/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +2 -2
- package/ListItemText/ListItemText.d.ts +2 -2
- package/ListSubheader/ListSubheader.d.ts +2 -2
- package/Menu/Menu.d.ts +5 -5
- package/Menu/Menu.js +2 -2
- package/MenuItem/MenuItem.d.ts +3 -3
- package/MenuItem/MenuItem.js +1 -1
- package/MenuList/MenuList.d.ts +4 -4
- package/MenuList/MenuList.js +1 -1
- package/MobileStepper/MobileStepper.d.ts +3 -3
- package/Modal/Modal.d.ts +7 -7
- package/NativeSelect/NativeSelect.d.ts +3 -3
- package/OutlinedInput/OutlinedInput.d.ts +3 -3
- package/Pagination/Pagination.d.ts +2 -2
- package/PaginationItem/PaginationItem.d.ts +2 -2
- package/Paper/Paper.d.ts +3 -3
- package/Paper/Paper.js +2 -2
- package/Popover/Popover.d.ts +5 -5
- package/Popover/Popover.js +6 -6
- package/Popper/Popper.d.ts +4 -4
- package/Popper/Popper.js +3 -3
- package/README.md +24 -35
- package/Radio/Radio.d.ts +3 -3
- package/RadioGroup/RadioGroup.d.ts +3 -3
- package/Rating/Rating.d.ts +2 -2
- package/Rating/Rating.js +1 -1
- package/ScopedCssBaseline/ScopedCssBaseline.d.ts +4 -4
- package/Select/Select.d.ts +3 -3
- package/Select/SelectInput.js +3 -3
- package/Skeleton/Skeleton.d.ts +2 -2
- package/Slide/Slide.d.ts +4 -4
- package/Slide/Slide.js +2 -2
- package/Slider/Slider.d.ts +3 -3
- package/Slider/Slider.js +2 -2
- package/Snackbar/Snackbar.d.ts +3 -3
- package/Snackbar/Snackbar.js +1 -1
- package/SnackbarContent/SnackbarContent.d.ts +3 -3
- package/SpeedDial/SpeedDial.d.ts +3 -3
- package/SpeedDial/SpeedDial.js +2 -2
- package/SpeedDialAction/SpeedDialAction.d.ts +3 -3
- package/SpeedDialIcon/SpeedDialIcon.d.ts +2 -2
- package/Stack/Stack.d.ts +2 -2
- package/Step/Step.d.ts +2 -2
- package/StepButton/StepButton.d.ts +3 -3
- package/StepConnector/StepConnector.d.ts +2 -2
- package/StepContent/StepContent.d.ts +3 -3
- package/StepContent/StepContent.js +2 -2
- package/StepIcon/StepIcon.d.ts +2 -2
- package/StepLabel/StepLabel.d.ts +2 -2
- package/Stepper/Stepper.d.ts +2 -2
- package/SvgIcon/SvgIcon.d.ts +3 -3
- package/SwipeableDrawer/SwipeableDrawer.d.ts +3 -3
- package/Switch/Switch.d.ts +4 -4
- package/Tab/Tab.d.ts +3 -3
- package/TabScrollButton/TabScrollButton.d.ts +2 -2
- package/Table/Table.d.ts +2 -2
- package/TableBody/TableBody.d.ts +2 -2
- package/TableCell/TableCell.d.ts +2 -2
- package/TableContainer/TableContainer.d.ts +2 -2
- package/TableFooter/TableFooter.d.ts +2 -2
- package/TableHead/TableHead.d.ts +2 -2
- package/TablePagination/TablePagination.d.ts +3 -3
- package/TablePagination/TablePagination.js +1 -1
- package/TableRow/TableRow.d.ts +2 -2
- package/TableSortLabel/TableSortLabel.d.ts +3 -3
- package/Tabs/Tabs.d.ts +2 -2
- package/Tabs/Tabs.js +4 -4
- package/TextField/TextField.d.ts +11 -11
- package/TextField/TextField.js +4 -2
- package/TextareaAutosize/TextareaAutosize.d.ts +2 -2
- package/TextareaAutosize/TextareaAutosize.js +1 -1
- package/ToggleButton/ToggleButton.d.ts +3 -3
- package/ToggleButtonGroup/ToggleButtonGroup.d.ts +2 -2
- package/ToggleButtonGroup/ToggleButtonGroup.js +1 -1
- package/Toolbar/Toolbar.d.ts +2 -2
- package/Tooltip/Tooltip.d.ts +3 -3
- package/Tooltip/Tooltip.js +5 -5
- package/Typography/Typography.d.ts +3 -3
- package/Zoom/Zoom.d.ts +3 -3
- package/colors/amber.d.ts +15 -15
- package/colors/blue.d.ts +15 -15
- package/colors/blueGrey.d.ts +15 -15
- package/colors/brown.d.ts +15 -15
- package/colors/common.d.ts +3 -3
- package/colors/cyan.d.ts +15 -15
- package/colors/deepOrange.d.ts +15 -15
- package/colors/deepPurple.d.ts +15 -15
- package/colors/green.d.ts +15 -15
- package/colors/grey.d.ts +15 -15
- package/colors/indigo.d.ts +15 -15
- package/colors/lightBlue.d.ts +15 -15
- package/colors/lightGreen.d.ts +15 -15
- package/colors/lime.d.ts +15 -15
- package/colors/orange.d.ts +15 -15
- package/colors/pink.d.ts +15 -15
- package/colors/purple.d.ts +15 -15
- package/colors/red.d.ts +15 -15
- package/colors/teal.d.ts +15 -15
- package/colors/yellow.d.ts +15 -15
- package/index.js +1 -1
- package/legacy/Accordion/Accordion.js +3 -3
- package/legacy/Accordion/AccordionContext.js +1 -1
- package/legacy/Autocomplete/Autocomplete.js +2 -2
- package/legacy/AvatarGroup/AvatarGroup.js +2 -2
- package/legacy/BottomNavigation/BottomNavigation.js +1 -1
- package/legacy/Breadcrumbs/Breadcrumbs.js +2 -2
- package/legacy/ButtonBase/ButtonBase.js +191 -28
- package/legacy/ButtonGroup/ButtonGroup.js +1 -1
- package/legacy/Card/Card.js +1 -1
- package/legacy/CardMedia/CardMedia.js +1 -1
- package/legacy/Checkbox/Checkbox.js +1 -1
- package/legacy/Chip/Chip.js +1 -1
- package/legacy/CircularProgress/CircularProgress.js +1 -1
- package/legacy/ClickAwayListener/ClickAwayListener.js +3 -3
- package/legacy/Dialog/Dialog.js +1 -1
- package/legacy/FormControl/FormControl.js +1 -1
- package/legacy/Hidden/HiddenCss.js +1 -1
- package/legacy/IconButton/IconButton.js +1 -1
- package/legacy/ImageList/ImageList.js +2 -4
- package/legacy/ImageListItem/ImageListItem.js +1 -1
- package/legacy/InputAdornment/InputAdornment.js +1 -1
- package/legacy/InputBase/InputBase.js +3 -3
- package/legacy/LinearProgress/LinearProgress.js +2 -2
- package/legacy/ListItem/ListItem.js +2 -2
- package/legacy/ListItemButton/ListItemButton.js +1 -1
- package/legacy/Menu/Menu.js +2 -2
- package/legacy/MenuItem/MenuItem.js +1 -1
- package/legacy/MenuList/MenuList.js +1 -1
- package/legacy/Paper/Paper.js +2 -2
- package/legacy/Popover/Popover.js +6 -6
- package/legacy/Popper/Popper.js +3 -3
- package/legacy/Rating/Rating.js +1 -1
- package/legacy/Select/SelectInput.js +3 -3
- package/legacy/Slide/Slide.js +2 -2
- package/legacy/Slider/Slider.js +2 -2
- package/legacy/Snackbar/Snackbar.js +1 -1
- package/legacy/SpeedDial/SpeedDial.js +2 -2
- package/legacy/StepContent/StepContent.js +2 -2
- package/legacy/TablePagination/TablePagination.js +1 -1
- package/legacy/Tabs/Tabs.js +4 -4
- package/legacy/TextField/TextField.js +4 -2
- package/legacy/TextareaAutosize/TextareaAutosize.js +1 -1
- package/legacy/ToggleButtonGroup/ToggleButtonGroup.js +1 -1
- package/legacy/Tooltip/Tooltip.js +5 -5
- package/legacy/index.js +1 -1
- package/legacy/styles/adaptV4Theme.js +1 -1
- package/legacy/styles/createPalette.js +4 -4
- package/legacy/styles/createStyles.js +1 -1
- package/legacy/styles/createTheme.js +3 -3
- package/legacy/styles/createTransitions.js +5 -5
- package/legacy/styles/createTypography.js +2 -2
- package/legacy/styles/makeStyles.js +1 -1
- package/legacy/styles/responsiveFontSizes.js +1 -1
- package/legacy/styles/withStyles.js +1 -1
- package/legacy/styles/withTheme.js +1 -1
- package/legacy/useMediaQuery/useMediaQuery.js +2 -2
- package/modern/Accordion/Accordion.js +3 -3
- package/modern/Accordion/AccordionContext.js +1 -1
- package/modern/Autocomplete/Autocomplete.js +2 -2
- package/modern/AvatarGroup/AvatarGroup.js +2 -2
- package/modern/BottomNavigation/BottomNavigation.js +1 -1
- package/modern/Breadcrumbs/Breadcrumbs.js +2 -2
- package/modern/ButtonBase/ButtonBase.js +200 -30
- package/modern/ButtonGroup/ButtonGroup.js +1 -1
- package/modern/Card/Card.js +1 -1
- package/modern/CardMedia/CardMedia.js +1 -1
- package/modern/Checkbox/Checkbox.js +1 -1
- package/modern/Chip/Chip.js +1 -1
- package/modern/CircularProgress/CircularProgress.js +1 -1
- package/modern/ClickAwayListener/ClickAwayListener.js +3 -3
- package/modern/Dialog/Dialog.js +1 -1
- package/modern/FormControl/FormControl.js +1 -1
- package/modern/Hidden/HiddenCss.js +1 -1
- package/modern/IconButton/IconButton.js +1 -1
- package/modern/ImageList/ImageList.js +2 -4
- package/modern/ImageListItem/ImageListItem.js +1 -1
- package/modern/InputAdornment/InputAdornment.js +1 -1
- package/modern/InputBase/InputBase.js +3 -3
- package/modern/LinearProgress/LinearProgress.js +2 -2
- package/modern/ListItem/ListItem.js +2 -2
- package/modern/ListItemButton/ListItemButton.js +1 -1
- package/modern/Menu/Menu.js +2 -2
- package/modern/MenuItem/MenuItem.js +1 -1
- package/modern/MenuList/MenuList.js +1 -1
- package/modern/Paper/Paper.js +2 -2
- package/modern/Popover/Popover.js +6 -6
- package/modern/Popper/Popper.js +3 -3
- package/modern/Rating/Rating.js +1 -1
- package/modern/Select/SelectInput.js +3 -3
- package/modern/Slide/Slide.js +2 -2
- package/modern/Slider/Slider.js +2 -2
- package/modern/Snackbar/Snackbar.js +1 -1
- package/modern/SpeedDial/SpeedDial.js +2 -2
- package/modern/StepContent/StepContent.js +2 -2
- package/modern/TablePagination/TablePagination.js +1 -1
- package/modern/Tabs/Tabs.js +4 -4
- package/modern/TextField/TextField.js +4 -2
- package/modern/TextareaAutosize/TextareaAutosize.js +1 -1
- package/modern/ToggleButtonGroup/ToggleButtonGroup.js +1 -1
- package/modern/Tooltip/Tooltip.js +5 -5
- package/modern/index.js +1 -1
- package/modern/styles/adaptV4Theme.js +1 -1
- package/modern/styles/createPalette.js +4 -4
- package/modern/styles/createStyles.js +1 -1
- package/modern/styles/createTheme.js +3 -3
- package/modern/styles/createTransitions.js +5 -5
- package/modern/styles/createTypography.js +3 -3
- package/modern/styles/makeStyles.js +2 -2
- package/modern/styles/responsiveFontSizes.js +1 -1
- package/modern/styles/withStyles.js +2 -2
- package/modern/styles/withTheme.js +2 -2
- package/modern/useMediaQuery/useMediaQuery.js +2 -2
- package/node/Accordion/Accordion.js +3 -3
- package/node/Accordion/AccordionContext.js +1 -1
- package/node/Autocomplete/Autocomplete.js +2 -2
- package/node/AvatarGroup/AvatarGroup.js +2 -2
- package/node/BottomNavigation/BottomNavigation.js +1 -1
- package/node/Breadcrumbs/Breadcrumbs.js +2 -2
- package/node/ButtonBase/ButtonBase.js +202 -32
- package/node/ButtonGroup/ButtonGroup.js +1 -1
- package/node/Card/Card.js +1 -1
- package/node/CardMedia/CardMedia.js +1 -1
- package/node/Checkbox/Checkbox.js +1 -1
- package/node/Chip/Chip.js +1 -1
- package/node/CircularProgress/CircularProgress.js +1 -1
- package/node/ClickAwayListener/ClickAwayListener.js +3 -3
- package/node/Dialog/Dialog.js +1 -1
- package/node/FormControl/FormControl.js +1 -1
- package/node/Hidden/HiddenCss.js +1 -1
- package/node/IconButton/IconButton.js +1 -1
- package/node/ImageList/ImageList.js +2 -4
- package/node/ImageListItem/ImageListItem.js +1 -1
- package/node/InputAdornment/InputAdornment.js +1 -1
- package/node/InputBase/InputBase.js +3 -3
- package/node/LinearProgress/LinearProgress.js +2 -2
- package/node/ListItem/ListItem.js +2 -2
- package/node/ListItemButton/ListItemButton.js +1 -1
- package/node/Menu/Menu.js +2 -2
- package/node/MenuItem/MenuItem.js +1 -1
- package/node/MenuList/MenuList.js +1 -1
- package/node/Paper/Paper.js +2 -2
- package/node/Popover/Popover.js +6 -6
- package/node/Popper/Popper.js +3 -3
- package/node/Rating/Rating.js +1 -1
- package/node/Select/SelectInput.js +3 -3
- package/node/Slide/Slide.js +2 -2
- package/node/Slider/Slider.js +2 -2
- package/node/Snackbar/Snackbar.js +1 -1
- package/node/SpeedDial/SpeedDial.js +2 -2
- package/node/StepContent/StepContent.js +2 -2
- package/node/TablePagination/TablePagination.js +1 -1
- package/node/Tabs/Tabs.js +4 -4
- package/node/TextField/TextField.js +4 -2
- package/node/TextareaAutosize/TextareaAutosize.js +1 -1
- package/node/ToggleButtonGroup/ToggleButtonGroup.js +1 -1
- package/node/Tooltip/Tooltip.js +5 -5
- package/node/index.js +1 -1
- package/node/styles/adaptV4Theme.js +1 -1
- package/node/styles/createPalette.js +4 -4
- package/node/styles/createStyles.js +1 -1
- package/node/styles/createTheme.js +3 -3
- package/node/styles/createTransitions.js +5 -5
- package/node/styles/createTypography.js +3 -3
- package/node/styles/makeStyles.js +2 -2
- package/node/styles/responsiveFontSizes.js +1 -1
- package/node/styles/withStyles.js +2 -2
- package/node/styles/withTheme.js +2 -2
- package/node/useMediaQuery/useMediaQuery.js +2 -2
- package/package.json +10 -10
- package/styles/ThemeProvider.d.ts +1 -1
- package/styles/adaptV4Theme.d.ts +2 -2
- package/styles/adaptV4Theme.js +1 -1
- package/styles/createPalette.js +4 -4
- package/styles/createStyles.js +1 -1
- package/styles/createTheme.d.ts +2 -2
- package/styles/createTheme.js +3 -3
- package/styles/createTransitions.js +5 -5
- package/styles/createTypography.js +3 -3
- package/styles/makeStyles.js +2 -2
- package/styles/responsiveFontSizes.js +1 -1
- package/styles/withStyles.js +2 -2
- package/styles/withTheme.js +2 -2
- package/umd/material-ui.development.js +787 -364
- package/umd/material-ui.production.min.js +21 -21
- package/useMediaQuery/useMediaQuery.js +2 -2
|
@@ -81,7 +81,7 @@ var StepContent = /*#__PURE__*/React.forwardRef(function StepContent(inProps, re
|
|
|
81
81
|
|
|
82
82
|
if (process.env.NODE_ENV !== 'production') {
|
|
83
83
|
if (orientation !== 'vertical') {
|
|
84
|
-
console.error('
|
|
84
|
+
console.error('MUI: <StepContent /> is only designed for use with the vertical stepper.');
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -158,7 +158,7 @@ process.env.NODE_ENV !== "production" ? StepContent.propTypes
|
|
|
158
158
|
|
|
159
159
|
/**
|
|
160
160
|
* Props applied to the transition element.
|
|
161
|
-
* By default, the element is based on this [`Transition`](
|
|
161
|
+
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition) component.
|
|
162
162
|
*/
|
|
163
163
|
TransitionProps: PropTypes.object
|
|
164
164
|
} : void 0;
|
|
@@ -389,7 +389,7 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes
|
|
|
389
389
|
var newLastPage = Math.max(0, Math.ceil(count / rowsPerPage) - 1);
|
|
390
390
|
|
|
391
391
|
if (page < 0 || page > newLastPage) {
|
|
392
|
-
return new Error('
|
|
392
|
+
return new Error('MUI: The page prop of a TablePagination is out of range ' + "(0 to ".concat(newLastPage, ", but page is ").concat(page, ")."));
|
|
393
393
|
}
|
|
394
394
|
|
|
395
395
|
return null;
|
package/legacy/Tabs/Tabs.js
CHANGED
|
@@ -279,7 +279,7 @@ var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
279
279
|
|
|
280
280
|
if (process.env.NODE_ENV !== 'production') {
|
|
281
281
|
if (centered && scrollable) {
|
|
282
|
-
console.error('
|
|
282
|
+
console.error('MUI: You can not use the `centered={true}` and `variant="scrollable"` properties ' + 'at the same time on a `Tabs` component.');
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
|
|
@@ -339,7 +339,7 @@ var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
339
339
|
|
|
340
340
|
if (process.env.NODE_ENV !== 'production') {
|
|
341
341
|
if (!tab) {
|
|
342
|
-
console.error(["
|
|
342
|
+
console.error(["MUI: The `value` provided to the Tabs component is invalid.", "None of the Tabs' children match with \"".concat(value, "\"."), valueToIndex.keys ? "You can provide one of the following values: ".concat(Array.from(valueToIndex.keys()).join(', '), ".") : null].join('\n'));
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
|
|
@@ -348,7 +348,7 @@ var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
348
348
|
if (process.env.NODE_ENV !== 'production') {
|
|
349
349
|
if (process.env.NODE_ENV !== 'test' && !warnedOnceTabPresent && tabMeta && tabMeta.width === 0 && tabMeta.height === 0) {
|
|
350
350
|
tabsMeta = null;
|
|
351
|
-
console.error(['
|
|
351
|
+
console.error(['MUI: The `value` provided to the Tabs component is invalid.', "The Tab with this `value` (\"".concat(value, "\") is not part of the document layout."), "Make sure the tab item is present in the document or that it's not `display: none`."].join('\n'));
|
|
352
352
|
warnedOnceTabPresent = true;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
@@ -611,7 +611,7 @@ var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
611
611
|
|
|
612
612
|
if (process.env.NODE_ENV !== 'production') {
|
|
613
613
|
if (isFragment(child)) {
|
|
614
|
-
console.error(["
|
|
614
|
+
console.error(["MUI: The Tabs component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
|
|
@@ -136,7 +136,7 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {
|
|
|
136
136
|
|
|
137
137
|
if (process.env.NODE_ENV !== 'production') {
|
|
138
138
|
if (select && !children) {
|
|
139
|
-
console.error('
|
|
139
|
+
console.error('MUI: `children` must be passed when using the `TextField` component with `select`.');
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -422,7 +422,9 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes
|
|
|
422
422
|
/**
|
|
423
423
|
* Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
|
|
424
424
|
*/
|
|
425
|
-
type: PropTypes
|
|
425
|
+
type: PropTypes
|
|
426
|
+
/* @typescript-to-proptypes-ignore */
|
|
427
|
+
.string,
|
|
426
428
|
|
|
427
429
|
/**
|
|
428
430
|
* The value of the `input` element, required for a controlled component.
|
|
@@ -105,7 +105,7 @@ var TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize(p
|
|
|
105
105
|
|
|
106
106
|
if (process.env.NODE_ENV !== 'production') {
|
|
107
107
|
if (renders.current === 20) {
|
|
108
|
-
console.error(['
|
|
108
|
+
console.error(['MUI: Too many re-renders. The layout is unstable.', 'TextareaAutosize limits the number of renders to prevent an infinite loop.'].join('\n'));
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -144,7 +144,7 @@ var ToggleButtonGroup = /*#__PURE__*/React.forwardRef(function ToggleButtonGroup
|
|
|
144
144
|
|
|
145
145
|
if (process.env.NODE_ENV !== 'production') {
|
|
146
146
|
if (isFragment(child)) {
|
|
147
|
-
console.error(["
|
|
147
|
+
console.error(["MUI: The ToggleButtonGroup component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -293,7 +293,7 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
293
293
|
|
|
294
294
|
React.useEffect(function () {
|
|
295
295
|
if (childNode && childNode.disabled && !isControlled && title !== '' && childNode.tagName.toLowerCase() === 'button') {
|
|
296
|
-
console.error(['
|
|
296
|
+
console.error(['MUI: You are providing a disabled `button` child to the Tooltip component.', 'A disabled element does not fire events.', "Tooltip needs to listen to the child element's events to display the title.", '', 'Add a simple wrapper element, such as a `span`.'].join('\n'));
|
|
297
297
|
}
|
|
298
298
|
}, [title, childNode, isControlled]);
|
|
299
299
|
}
|
|
@@ -450,7 +450,7 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
450
450
|
children.props.onTouchEnd(event);
|
|
451
451
|
}
|
|
452
452
|
|
|
453
|
-
|
|
453
|
+
stopTouchInteraction();
|
|
454
454
|
clearTimeout(leaveTimer.current);
|
|
455
455
|
leaveTimer.current = setTimeout(function () {
|
|
456
456
|
handleClose(event);
|
|
@@ -533,7 +533,7 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
533
533
|
|
|
534
534
|
React.useEffect(function () {
|
|
535
535
|
if (childNode && !childNode.getAttribute('data-mui-internal-clone-element')) {
|
|
536
|
-
console.error(['
|
|
536
|
+
console.error(['MUI: The `children` component of the Tooltip is not forwarding its props correctly.', 'Please make sure that props are spread on the same element that the ref is applied to.'].join('\n'));
|
|
537
537
|
}
|
|
538
538
|
}, [childNode]);
|
|
539
539
|
}
|
|
@@ -567,7 +567,7 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
567
567
|
|
|
568
568
|
if (process.env.NODE_ENV !== 'production') {
|
|
569
569
|
if (children.props.title) {
|
|
570
|
-
console.error(['
|
|
570
|
+
console.error(['MUI: You have provided a `title` prop to the child of <Tooltip />.', "Remove this title prop `".concat(children.props.title, "` or the Tooltip component.")].join('\n'));
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
|
|
@@ -808,7 +808,7 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
|
|
|
808
808
|
|
|
809
809
|
/**
|
|
810
810
|
* Props applied to the transition element.
|
|
811
|
-
* By default, the element is based on this [`Transition`](
|
|
811
|
+
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition) component.
|
|
812
812
|
*/
|
|
813
813
|
TransitionProps: PropTypes.object
|
|
814
814
|
} : void 0;
|
package/legacy/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
4
4
|
import { createBreakpoints, createSpacing } from '@mui/system';
|
|
5
5
|
export default function adaptV4Theme(inputTheme) {
|
|
6
6
|
if (process.env.NODE_ENV !== 'production') {
|
|
7
|
-
console.warn(['
|
|
7
|
+
console.warn(['MUI: adaptV4Theme() is deprecated.', 'Follow the upgrade guide on https://mui.com/r/migration-v4#theme.'].join('\n'));
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
var _inputTheme$defaultPr = inputTheme.defaultProps,
|
|
@@ -225,7 +225,7 @@ export default function createPalette(palette) {
|
|
|
225
225
|
var contrast = getContrastRatio(background, contrastText);
|
|
226
226
|
|
|
227
227
|
if (contrast < 3) {
|
|
228
|
-
console.error(["
|
|
228
|
+
console.error(["MUI: The contrast ratio of ".concat(contrast, ":1 for ").concat(contrastText, " on ").concat(background), 'falls below the WCAG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\n'));
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
|
|
@@ -248,11 +248,11 @@ export default function createPalette(palette) {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
if (!color.hasOwnProperty('main')) {
|
|
251
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "
|
|
251
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: The color".concat(name ? " (".concat(name, ")") : '', " provided to augmentColor(color) is invalid.\nThe color object needs to have a `main` property or a `").concat(mainShade, "` property.") : _formatMuiErrorMessage(11, name ? " (".concat(name, ")") : '', mainShade));
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
if (typeof color.main !== 'string') {
|
|
255
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "
|
|
255
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: The color".concat(name ? " (".concat(name, ")") : '', " provided to augmentColor(color) is invalid.\n`color.main` should be a string, but `").concat(JSON.stringify(color.main), "` was provided instead.\n\nDid you intend to use one of the following approaches?\n\nimport { green } from \"@mui/material/colors\";\n\nconst theme1 = createTheme({ palette: {\n primary: green,\n} });\n\nconst theme2 = createTheme({ palette: {\n primary: { main: green[500] },\n} });") : _formatMuiErrorMessage(12, name ? " (".concat(name, ")") : '', JSON.stringify(color.main)));
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
addLightOrDark(color, 'light', lightShade, tonalOffset);
|
|
@@ -272,7 +272,7 @@ export default function createPalette(palette) {
|
|
|
272
272
|
|
|
273
273
|
if (process.env.NODE_ENV !== 'production') {
|
|
274
274
|
if (!modes[mode]) {
|
|
275
|
-
console.error("
|
|
275
|
+
console.error("MUI: The palette mode `".concat(mode, "` is not supported."));
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
|
|
@@ -2,7 +2,7 @@ var warnedOnce = false; // To remove in v6
|
|
|
2
2
|
|
|
3
3
|
export default function createStyles(styles) {
|
|
4
4
|
if (!warnedOnce) {
|
|
5
|
-
console.warn(['
|
|
5
|
+
console.warn(['MUI: createStyles from @mui/material/styles is deprecated.', 'Please use @mui/styles/createStyles'].join('\n'));
|
|
6
6
|
warnedOnce = true;
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -60,9 +60,9 @@ function createTheme() {
|
|
|
60
60
|
if (stateClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {
|
|
61
61
|
if (process.env.NODE_ENV !== 'production') {
|
|
62
62
|
var stateClass = generateUtilityClass('', key);
|
|
63
|
-
console.error(["
|
|
63
|
+
console.error(["MUI: The `".concat(component, "` component increases ") + "the CSS specificity of the `".concat(key, "` internal state."), 'You can not override it like this: ', JSON.stringify(node, null, 2), '', "Instead, you need to use the '&.".concat(stateClass, "' syntax:"), JSON.stringify({
|
|
64
64
|
root: _defineProperty({}, "&.".concat(stateClass), child)
|
|
65
|
-
}, null, 2), '', 'https://
|
|
65
|
+
}, null, 2), '', 'https://mui.com/r/state-classes-guide'].join('\n'));
|
|
66
66
|
} // Remove the style to prevent global conflicts.
|
|
67
67
|
|
|
68
68
|
|
|
@@ -88,7 +88,7 @@ export function createMuiTheme() {
|
|
|
88
88
|
if (process.env.NODE_ENV !== 'production') {
|
|
89
89
|
if (!warnedOnce) {
|
|
90
90
|
warnedOnce = true;
|
|
91
|
-
console.error(['
|
|
91
|
+
console.error(['MUI: the createMuiTheme function was renamed to createTheme.', '', "You should use `import { createTheme } from '@mui/material/styles'`"].join('\n'));
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -72,23 +72,23 @@ export default function createTransitions(inputTransitions) {
|
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
if (!isString(props) && !Array.isArray(props)) {
|
|
75
|
-
console.error('
|
|
75
|
+
console.error('MUI: Argument "props" must be a string or Array.');
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
if (!isNumber(durationOption) && !isString(durationOption)) {
|
|
79
|
-
console.error("
|
|
79
|
+
console.error("MUI: Argument \"duration\" must be a number or a string but found ".concat(durationOption, "."));
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
if (!isString(easingOption)) {
|
|
83
|
-
console.error('
|
|
83
|
+
console.error('MUI: Argument "easing" must be a string.');
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
if (!isNumber(delay) && !isString(delay)) {
|
|
87
|
-
console.error('
|
|
87
|
+
console.error('MUI: Argument "delay" must be a number or a string.');
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
if (Object.keys(other).length !== 0) {
|
|
91
|
-
console.error("
|
|
91
|
+
console.error("MUI: Unrecognized argument(s) [".concat(Object.keys(other).join(','), "]."));
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -37,11 +37,11 @@ export default function createTypography(palette, typography) {
|
|
|
37
37
|
|
|
38
38
|
if (process.env.NODE_ENV !== 'production') {
|
|
39
39
|
if (typeof fontSize !== 'number') {
|
|
40
|
-
console.error('
|
|
40
|
+
console.error('MUI: `fontSize` is required to be a number.');
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
if (typeof htmlFontSize !== 'number') {
|
|
44
|
-
console.error('
|
|
44
|
+
console.error('MUI: `htmlFontSize` is required to be a number.');
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
2
2
|
export default function makeStyles() {
|
|
3
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "
|
|
3
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: makeStyles is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#material-ui-core-styles for more details." : _formatMuiErrorMessage(14));
|
|
4
4
|
}
|
|
@@ -35,7 +35,7 @@ export default function responsiveFontSizes(themeInput) {
|
|
|
35
35
|
var lineHeight = style.lineHeight;
|
|
36
36
|
|
|
37
37
|
if (!isUnitless(lineHeight) && !disableAlign) {
|
|
38
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "
|
|
38
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: Unsupported non-unitless line height with grid alignment.\nUse unitless line heights instead." : _formatMuiErrorMessage(6));
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
if (!isUnitless(lineHeight)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
2
2
|
export default function withStyles() {
|
|
3
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "
|
|
3
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: withStyles is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#material-ui-core-styles for more details." : _formatMuiErrorMessage(15));
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
2
2
|
export default function withTheme() {
|
|
3
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "
|
|
3
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: withTheme is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#material-ui-core-styles for more details." : _formatMuiErrorMessage(16));
|
|
4
4
|
}
|
|
@@ -13,13 +13,13 @@ export default function useMediaQuery(queryInput) {
|
|
|
13
13
|
|
|
14
14
|
if (process.env.NODE_ENV !== 'production') {
|
|
15
15
|
if (typeof queryInput === 'function' && theme === null) {
|
|
16
|
-
console.error(['
|
|
16
|
+
console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
var query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
|
|
21
21
|
query = query.replace(/^@media( ?)/m, ''); // Wait for jsdom to support the match media feature.
|
|
22
|
-
// All the browsers
|
|
22
|
+
// All the browsers MUI support have this built-in.
|
|
23
23
|
// This defensive check is here for simplicity.
|
|
24
24
|
// Most of the time, the match media logic isn't central to people tests.
|
|
25
25
|
|
|
@@ -200,11 +200,11 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes
|
|
|
200
200
|
const summary = React.Children.toArray(props.children)[0];
|
|
201
201
|
|
|
202
202
|
if (isFragment(summary)) {
|
|
203
|
-
return new Error("
|
|
203
|
+
return new Error("MUI: The Accordion doesn't accept a Fragment as a child. " + 'Consider providing an array instead.');
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
if (! /*#__PURE__*/React.isValidElement(summary)) {
|
|
207
|
-
return new Error('
|
|
207
|
+
return new Error('MUI: Expected the first child of Accordion to be a valid element.');
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
return null;
|
|
@@ -272,7 +272,7 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes
|
|
|
272
272
|
|
|
273
273
|
/**
|
|
274
274
|
* Props applied to the transition element.
|
|
275
|
-
* By default, the element is based on this [`Transition`](
|
|
275
|
+
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition) component.
|
|
276
276
|
*/
|
|
277
277
|
TransitionProps: PropTypes.object
|
|
278
278
|
} : void 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* @ignore - internal component.
|
|
4
|
-
* @type {React.Context<{} | {expanded: boolean, disabled: boolean,
|
|
4
|
+
* @type {React.Context<{} | {expanded: boolean, disabled: boolean, toggle: () => void}>}
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const AccordionContext = /*#__PURE__*/React.createContext({});
|
|
@@ -700,7 +700,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
700
700
|
*/
|
|
701
701
|
defaultValue: chainPropTypes(PropTypes.any, props => {
|
|
702
702
|
if (props.multiple && props.defaultValue !== undefined && !Array.isArray(props.defaultValue)) {
|
|
703
|
-
return new Error(['
|
|
703
|
+
return new Error(['MUI: The Autocomplete expects the `defaultValue` prop to be an array when `multiple={true}` or undefined.', `However, ${props.defaultValue} was provided.`].join('\n'));
|
|
704
704
|
}
|
|
705
705
|
|
|
706
706
|
return null;
|
|
@@ -1043,7 +1043,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
1043
1043
|
*/
|
|
1044
1044
|
value: chainPropTypes(PropTypes.any, props => {
|
|
1045
1045
|
if (props.multiple && props.value !== undefined && !Array.isArray(props.value)) {
|
|
1046
|
-
return new Error(['
|
|
1046
|
+
return new Error(['MUI: The Autocomplete expects the `value` prop to be an array when `multiple={true}` or undefined.', `However, ${props.value} was provided.`].join('\n'));
|
|
1047
1047
|
}
|
|
1048
1048
|
|
|
1049
1049
|
return null;
|
|
@@ -89,7 +89,7 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
89
89
|
const children = React.Children.toArray(childrenProp).filter(child => {
|
|
90
90
|
if (process.env.NODE_ENV !== 'production') {
|
|
91
91
|
if (isFragment(child)) {
|
|
92
|
-
console.error(["
|
|
92
|
+
console.error(["MUI: The AvatarGroup component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -150,7 +150,7 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
|
|
|
150
150
|
*/
|
|
151
151
|
max: chainPropTypes(PropTypes.number, props => {
|
|
152
152
|
if (props.max < 2) {
|
|
153
|
-
return new Error(['
|
|
153
|
+
return new Error(['MUI: The prop `max` should be equal to 2 or above.', 'A value below is clamped to 2.'].join('\n'));
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
return null;
|
|
@@ -68,7 +68,7 @@ const BottomNavigation = /*#__PURE__*/React.forwardRef(function BottomNavigation
|
|
|
68
68
|
|
|
69
69
|
if (process.env.NODE_ENV !== 'production') {
|
|
70
70
|
if (isFragment(child)) {
|
|
71
|
-
console.error(["
|
|
71
|
+
console.error(["MUI: The BottomNavigation component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -127,7 +127,7 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef(function Breadcrumbs(inProps,
|
|
|
127
127
|
|
|
128
128
|
if (itemsBeforeCollapse + itemsAfterCollapse >= allItems.length) {
|
|
129
129
|
if (process.env.NODE_ENV !== 'production') {
|
|
130
|
-
console.error(['
|
|
130
|
+
console.error(['MUI: You have provided an invalid combination of props to the Breadcrumbs.', `itemsAfterCollapse={${itemsAfterCollapse}} + itemsBeforeCollapse={${itemsBeforeCollapse}} >= maxItems={${maxItems}}`].join('\n'));
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
return allItems;
|
|
@@ -142,7 +142,7 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef(function Breadcrumbs(inProps,
|
|
|
142
142
|
const allItems = React.Children.toArray(children).filter(child => {
|
|
143
143
|
if (process.env.NODE_ENV !== 'production') {
|
|
144
144
|
if (isFragment(child)) {
|
|
145
|
-
console.error(["
|
|
145
|
+
console.error(["MUI: The Breadcrumbs component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
@@ -5,14 +5,14 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { elementTypeAcceptingRef, refType } from '@mui/utils';
|
|
8
|
-
import { useButton } from '@mui/core/ButtonUnstyled';
|
|
9
8
|
import composeClasses from '@mui/core/composeClasses';
|
|
10
9
|
import styled from '../styles/styled';
|
|
11
10
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
11
|
import useForkRef from '../utils/useForkRef';
|
|
12
|
+
import useEventCallback from '../utils/useEventCallback';
|
|
13
|
+
import useIsFocusVisible from '../utils/useIsFocusVisible';
|
|
13
14
|
import TouchRipple from './TouchRipple';
|
|
14
15
|
import buttonBaseClasses, { getButtonBaseUtilityClass } from './buttonBaseClasses';
|
|
15
|
-
import useTouchRipple from '../useTouchRipple';
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
|
|
@@ -102,51 +102,205 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
102
102
|
disableTouchRipple = false,
|
|
103
103
|
focusRipple = false,
|
|
104
104
|
LinkComponent = 'a',
|
|
105
|
+
onBlur,
|
|
106
|
+
onClick,
|
|
107
|
+
onContextMenu,
|
|
108
|
+
onDragLeave,
|
|
109
|
+
onFocus,
|
|
110
|
+
onFocusVisible,
|
|
111
|
+
onKeyDown,
|
|
112
|
+
onKeyUp,
|
|
113
|
+
onMouseDown,
|
|
114
|
+
onMouseLeave,
|
|
115
|
+
onMouseUp,
|
|
116
|
+
onTouchEnd,
|
|
117
|
+
onTouchMove,
|
|
118
|
+
onTouchStart,
|
|
105
119
|
tabIndex = 0,
|
|
106
|
-
TouchRippleProps
|
|
120
|
+
TouchRippleProps,
|
|
121
|
+
type
|
|
107
122
|
} = props,
|
|
108
123
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
109
124
|
|
|
110
125
|
const buttonRef = React.useRef(null);
|
|
111
|
-
const handleRef = useForkRef(buttonRef, ref);
|
|
112
126
|
const rippleRef = React.useRef(null);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
127
|
+
const {
|
|
128
|
+
isFocusVisibleRef,
|
|
129
|
+
onFocus: handleFocusVisible,
|
|
130
|
+
onBlur: handleBlurVisible,
|
|
131
|
+
ref: focusVisibleRef
|
|
132
|
+
} = useIsFocusVisible();
|
|
133
|
+
const [focusVisible, setFocusVisible] = React.useState(false);
|
|
134
|
+
|
|
135
|
+
if (disabled && focusVisible) {
|
|
136
|
+
setFocusVisible(false);
|
|
117
137
|
}
|
|
118
138
|
|
|
119
|
-
const {
|
|
120
|
-
focusVisible,
|
|
121
|
-
setFocusVisible,
|
|
122
|
-
getRootProps
|
|
123
|
-
} = useButton(_extends({}, props, {
|
|
124
|
-
component: ComponentProp,
|
|
125
|
-
ref: handleRef
|
|
126
|
-
}));
|
|
127
139
|
React.useImperativeHandle(action, () => ({
|
|
128
140
|
focusVisible: () => {
|
|
129
141
|
setFocusVisible(true);
|
|
130
142
|
buttonRef.current.focus();
|
|
131
143
|
}
|
|
132
|
-
}), [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
}), []);
|
|
145
|
+
React.useEffect(() => {
|
|
146
|
+
if (focusVisible && focusRipple && !disableRipple) {
|
|
147
|
+
rippleRef.current.pulsate();
|
|
148
|
+
}
|
|
149
|
+
}, [disableRipple, focusRipple, focusVisible]);
|
|
150
|
+
|
|
151
|
+
function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {
|
|
152
|
+
return useEventCallback(event => {
|
|
153
|
+
if (eventCallback) {
|
|
154
|
+
eventCallback(event);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const ignore = skipRippleAction;
|
|
158
|
+
|
|
159
|
+
if (!ignore && rippleRef.current) {
|
|
160
|
+
rippleRef.current[rippleAction](event);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return true;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const handleMouseDown = useRippleHandler('start', onMouseDown);
|
|
168
|
+
const handleContextMenu = useRippleHandler('stop', onContextMenu);
|
|
169
|
+
const handleDragLeave = useRippleHandler('stop', onDragLeave);
|
|
170
|
+
const handleMouseUp = useRippleHandler('stop', onMouseUp);
|
|
171
|
+
const handleMouseLeave = useRippleHandler('stop', event => {
|
|
172
|
+
if (focusVisible) {
|
|
173
|
+
event.preventDefault();
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (onMouseLeave) {
|
|
177
|
+
onMouseLeave(event);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
const handleTouchStart = useRippleHandler('start', onTouchStart);
|
|
181
|
+
const handleTouchEnd = useRippleHandler('stop', onTouchEnd);
|
|
182
|
+
const handleTouchMove = useRippleHandler('stop', onTouchMove);
|
|
183
|
+
const handleBlur = useRippleHandler('stop', event => {
|
|
184
|
+
handleBlurVisible(event);
|
|
185
|
+
|
|
186
|
+
if (isFocusVisibleRef.current === false) {
|
|
187
|
+
setFocusVisible(false);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (onBlur) {
|
|
191
|
+
onBlur(event);
|
|
192
|
+
}
|
|
193
|
+
}, false);
|
|
194
|
+
const handleFocus = useEventCallback(event => {
|
|
195
|
+
// Fix for https://github.com/facebook/react/issues/7769
|
|
196
|
+
if (!buttonRef.current) {
|
|
197
|
+
buttonRef.current = event.currentTarget;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
handleFocusVisible(event);
|
|
201
|
+
|
|
202
|
+
if (isFocusVisibleRef.current === true) {
|
|
203
|
+
setFocusVisible(true);
|
|
204
|
+
|
|
205
|
+
if (onFocusVisible) {
|
|
206
|
+
onFocusVisible(event);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (onFocus) {
|
|
211
|
+
onFocus(event);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
const isNonNativeButton = () => {
|
|
216
|
+
const button = buttonRef.current;
|
|
217
|
+
return component && component !== 'button' && !(button.tagName === 'A' && button.href);
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* IE11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat
|
|
221
|
+
*/
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
const keydownRef = React.useRef(false);
|
|
225
|
+
const handleKeyDown = useEventCallback(event => {
|
|
226
|
+
// Check if key is already down to avoid repeats being counted as multiple activations
|
|
227
|
+
if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {
|
|
228
|
+
keydownRef.current = true;
|
|
229
|
+
rippleRef.current.stop(event, () => {
|
|
230
|
+
rippleRef.current.start(event);
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {
|
|
235
|
+
event.preventDefault();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (onKeyDown) {
|
|
239
|
+
onKeyDown(event);
|
|
240
|
+
} // Keyboard accessibility for non interactive elements
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {
|
|
244
|
+
event.preventDefault();
|
|
245
|
+
|
|
246
|
+
if (onClick) {
|
|
247
|
+
onClick(event);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
143
250
|
});
|
|
251
|
+
const handleKeyUp = useEventCallback(event => {
|
|
252
|
+
// calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
|
|
253
|
+
// https://codesandbox.io/s/button-keyup-preventdefault-dn7f0
|
|
254
|
+
if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) {
|
|
255
|
+
keydownRef.current = false;
|
|
256
|
+
rippleRef.current.stop(event, () => {
|
|
257
|
+
rippleRef.current.pulsate(event);
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (onKeyUp) {
|
|
262
|
+
onKeyUp(event);
|
|
263
|
+
} // Keyboard accessibility for non interactive elements
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === ' ' && !event.defaultPrevented) {
|
|
267
|
+
onClick(event);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
let ComponentProp = component;
|
|
271
|
+
|
|
272
|
+
if (ComponentProp === 'button' && (other.href || other.to)) {
|
|
273
|
+
ComponentProp = LinkComponent;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const buttonProps = {};
|
|
277
|
+
|
|
278
|
+
if (ComponentProp === 'button') {
|
|
279
|
+
buttonProps.type = type === undefined ? 'button' : type;
|
|
280
|
+
buttonProps.disabled = disabled;
|
|
281
|
+
} else {
|
|
282
|
+
if (!other.href && !other.to) {
|
|
283
|
+
buttonProps.role = 'button';
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (disabled) {
|
|
287
|
+
buttonProps['aria-disabled'] = disabled;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const handleOwnRef = useForkRef(focusVisibleRef, buttonRef);
|
|
292
|
+
const handleRef = useForkRef(ref, handleOwnRef);
|
|
293
|
+
const [mountedState, setMountedState] = React.useState(false);
|
|
294
|
+
React.useEffect(() => {
|
|
295
|
+
setMountedState(true);
|
|
296
|
+
}, []);
|
|
297
|
+
const enableTouchRipple = mountedState && !disableRipple && !disabled;
|
|
144
298
|
|
|
145
299
|
if (process.env.NODE_ENV !== 'production') {
|
|
146
300
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
147
301
|
React.useEffect(() => {
|
|
148
302
|
if (enableTouchRipple && !rippleRef.current) {
|
|
149
|
-
console.error(['
|
|
303
|
+
console.error(['MUI: The `component` prop provided to ButtonBase is invalid.', 'Please make sure the children prop is rendered in this custom component.'].join('\n'));
|
|
150
304
|
}
|
|
151
305
|
}, [enableTouchRipple]);
|
|
152
306
|
}
|
|
@@ -166,8 +320,24 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
166
320
|
return /*#__PURE__*/_jsxs(ButtonBaseRoot, _extends({
|
|
167
321
|
as: ComponentProp,
|
|
168
322
|
className: clsx(classes.root, className),
|
|
169
|
-
ownerState: ownerState
|
|
170
|
-
|
|
323
|
+
ownerState: ownerState,
|
|
324
|
+
onBlur: handleBlur,
|
|
325
|
+
onClick: onClick,
|
|
326
|
+
onContextMenu: handleContextMenu,
|
|
327
|
+
onFocus: handleFocus,
|
|
328
|
+
onKeyDown: handleKeyDown,
|
|
329
|
+
onKeyUp: handleKeyUp,
|
|
330
|
+
onMouseDown: handleMouseDown,
|
|
331
|
+
onMouseLeave: handleMouseLeave,
|
|
332
|
+
onMouseUp: handleMouseUp,
|
|
333
|
+
onDragLeave: handleDragLeave,
|
|
334
|
+
onTouchEnd: handleTouchEnd,
|
|
335
|
+
onTouchMove: handleTouchMove,
|
|
336
|
+
onTouchStart: handleTouchStart,
|
|
337
|
+
ref: handleRef,
|
|
338
|
+
tabIndex: disabled ? -1 : tabIndex,
|
|
339
|
+
type: type
|
|
340
|
+
}, buttonProps, other, {
|
|
171
341
|
children: [children, enableTouchRipple ?
|
|
172
342
|
/*#__PURE__*/
|
|
173
343
|
|