@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
|
@@ -84,7 +84,7 @@ const StepContent = /*#__PURE__*/React.forwardRef(function StepContent(inProps,
|
|
|
84
84
|
|
|
85
85
|
if (process.env.NODE_ENV !== 'production') {
|
|
86
86
|
if (orientation !== 'vertical') {
|
|
87
|
-
console.error('
|
|
87
|
+
console.error('MUI: <StepContent /> is only designed for use with the vertical stepper.');
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -161,7 +161,7 @@ process.env.NODE_ENV !== "production" ? StepContent.propTypes
|
|
|
161
161
|
|
|
162
162
|
/**
|
|
163
163
|
* Props applied to the transition element.
|
|
164
|
-
* By default, the element is based on this [`Transition`](
|
|
164
|
+
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition) component.
|
|
165
165
|
*/
|
|
166
166
|
TransitionProps: PropTypes.object
|
|
167
167
|
} : void 0;
|
|
@@ -372,7 +372,7 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes
|
|
|
372
372
|
const newLastPage = Math.max(0, Math.ceil(count / rowsPerPage) - 1);
|
|
373
373
|
|
|
374
374
|
if (page < 0 || page > newLastPage) {
|
|
375
|
-
return new Error('
|
|
375
|
+
return new Error('MUI: The page prop of a TablePagination is out of range ' + `(0 to ${newLastPage}, but page is ${page}).`);
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
return null;
|
package/modern/Tabs/Tabs.js
CHANGED
|
@@ -279,7 +279,7 @@ const 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
|
|
|
@@ -327,7 +327,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
327
327
|
|
|
328
328
|
if (process.env.NODE_ENV !== 'production') {
|
|
329
329
|
if (!tab) {
|
|
330
|
-
console.error([`
|
|
330
|
+
console.error([`MUI: The \`value\` provided to the Tabs component is invalid.`, `None of the Tabs' children match with "${value}".`, valueToIndex.keys ? `You can provide one of the following values: ${Array.from(valueToIndex.keys()).join(', ')}.` : null].join('\n'));
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
|
|
@@ -336,7 +336,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
336
336
|
if (process.env.NODE_ENV !== 'production') {
|
|
337
337
|
if (process.env.NODE_ENV !== 'test' && !warnedOnceTabPresent && tabMeta && tabMeta.width === 0 && tabMeta.height === 0) {
|
|
338
338
|
tabsMeta = null;
|
|
339
|
-
console.error(['
|
|
339
|
+
console.error(['MUI: The `value` provided to the Tabs component is invalid.', `The Tab with this \`value\` ("${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'));
|
|
340
340
|
warnedOnceTabPresent = true;
|
|
341
341
|
}
|
|
342
342
|
}
|
|
@@ -596,7 +596,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
596
596
|
|
|
597
597
|
if (process.env.NODE_ENV !== 'production') {
|
|
598
598
|
if (isFragment(child)) {
|
|
599
|
-
console.error(["
|
|
599
|
+
console.error(["MUI: The Tabs component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
|
|
@@ -130,7 +130,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
130
130
|
|
|
131
131
|
if (process.env.NODE_ENV !== 'production') {
|
|
132
132
|
if (select && !children) {
|
|
133
|
-
console.error('
|
|
133
|
+
console.error('MUI: `children` must be passed when using the `TextField` component with `select`.');
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -414,7 +414,9 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes
|
|
|
414
414
|
/**
|
|
415
415
|
* 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).
|
|
416
416
|
*/
|
|
417
|
-
type: PropTypes
|
|
417
|
+
type: PropTypes
|
|
418
|
+
/* @typescript-to-proptypes-ignore */
|
|
419
|
+
.string,
|
|
418
420
|
|
|
419
421
|
/**
|
|
420
422
|
* The value of the `input` element, required for a controlled component.
|
|
@@ -103,7 +103,7 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
|
|
|
103
103
|
|
|
104
104
|
if (process.env.NODE_ENV !== 'production') {
|
|
105
105
|
if (renders.current === 20) {
|
|
106
|
-
console.error(['
|
|
106
|
+
console.error(['MUI: Too many re-renders. The layout is unstable.', 'TextareaAutosize limits the number of renders to prevent an infinite loop.'].join('\n'));
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -151,7 +151,7 @@ const ToggleButtonGroup = /*#__PURE__*/React.forwardRef(function ToggleButtonGro
|
|
|
151
151
|
|
|
152
152
|
if (process.env.NODE_ENV !== 'production') {
|
|
153
153
|
if (isFragment(child)) {
|
|
154
|
-
console.error(["
|
|
154
|
+
console.error(["MUI: The ToggleButtonGroup component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
|
|
@@ -272,7 +272,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
272
272
|
|
|
273
273
|
React.useEffect(() => {
|
|
274
274
|
if (childNode && childNode.disabled && !isControlled && title !== '' && childNode.tagName.toLowerCase() === 'button') {
|
|
275
|
-
console.error(['
|
|
275
|
+
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'));
|
|
276
276
|
}
|
|
277
277
|
}, [title, childNode, isControlled]);
|
|
278
278
|
}
|
|
@@ -428,7 +428,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
428
428
|
children.props.onTouchEnd(event);
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
-
|
|
431
|
+
stopTouchInteraction();
|
|
432
432
|
clearTimeout(leaveTimer.current);
|
|
433
433
|
leaveTimer.current = setTimeout(() => {
|
|
434
434
|
handleClose(event);
|
|
@@ -511,7 +511,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
511
511
|
|
|
512
512
|
React.useEffect(() => {
|
|
513
513
|
if (childNode && !childNode.getAttribute('data-mui-internal-clone-element')) {
|
|
514
|
-
console.error(['
|
|
514
|
+
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'));
|
|
515
515
|
}
|
|
516
516
|
}, [childNode]);
|
|
517
517
|
}
|
|
@@ -545,7 +545,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
545
545
|
|
|
546
546
|
if (process.env.NODE_ENV !== 'production') {
|
|
547
547
|
if (children.props.title) {
|
|
548
|
-
console.error(['
|
|
548
|
+
console.error(['MUI: You have provided a `title` prop to the child of <Tooltip />.', `Remove this title prop \`${children.props.title}\` or the Tooltip component.`].join('\n'));
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
551
|
|
|
@@ -781,7 +781,7 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
|
|
|
781
781
|
|
|
782
782
|
/**
|
|
783
783
|
* Props applied to the transition element.
|
|
784
|
-
* By default, the element is based on this [`Transition`](
|
|
784
|
+
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition) component.
|
|
785
785
|
*/
|
|
786
786
|
TransitionProps: PropTypes.object
|
|
787
787
|
} : void 0;
|
package/modern/index.js
CHANGED
|
@@ -5,7 +5,7 @@ const _excluded = ["defaultProps", "mixins", "overrides", "palette", "props", "s
|
|
|
5
5
|
import { createBreakpoints, createSpacing } from '@mui/system';
|
|
6
6
|
export default function adaptV4Theme(inputTheme) {
|
|
7
7
|
if (process.env.NODE_ENV !== 'production') {
|
|
8
|
-
console.warn(['
|
|
8
|
+
console.warn(['MUI: adaptV4Theme() is deprecated.', 'Follow the upgrade guide on https://mui.com/r/migration-v4#theme.'].join('\n'));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const {
|
|
@@ -213,7 +213,7 @@ export default function createPalette(palette) {
|
|
|
213
213
|
const contrast = getContrastRatio(background, contrastText);
|
|
214
214
|
|
|
215
215
|
if (contrast < 3) {
|
|
216
|
-
console.error([`
|
|
216
|
+
console.error([`MUI: The contrast ratio of ${contrast}:1 for ${contrastText} on ${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'));
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
|
|
@@ -234,12 +234,12 @@ export default function createPalette(palette) {
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
if (!color.hasOwnProperty('main')) {
|
|
237
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `
|
|
237
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
|
|
238
238
|
The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
if (typeof color.main !== 'string') {
|
|
242
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `
|
|
242
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
|
|
243
243
|
\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.
|
|
244
244
|
|
|
245
245
|
Did you intend to use one of the following approaches?
|
|
@@ -272,7 +272,7 @@ const theme2 = createTheme({ 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 \`${mode}\` is not supported.`);
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
|
|
@@ -2,7 +2,7 @@ let 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
|
|
|
@@ -46,11 +46,11 @@ function createTheme(options = {}, ...args) {
|
|
|
46
46
|
if (stateClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {
|
|
47
47
|
if (process.env.NODE_ENV !== 'production') {
|
|
48
48
|
const stateClass = generateUtilityClass('', key);
|
|
49
|
-
console.error([`
|
|
49
|
+
console.error([`MUI: The \`${component}\` component increases ` + `the CSS specificity of the \`${key}\` internal state.`, 'You can not override it like this: ', JSON.stringify(node, null, 2), '', `Instead, you need to use the '&.${stateClass}' syntax:`, JSON.stringify({
|
|
50
50
|
root: {
|
|
51
51
|
[`&.${stateClass}`]: child
|
|
52
52
|
}
|
|
53
|
-
}, null, 2), '', 'https://
|
|
53
|
+
}, null, 2), '', 'https://mui.com/r/state-classes-guide'].join('\n'));
|
|
54
54
|
} // Remove the style to prevent global conflicts.
|
|
55
55
|
|
|
56
56
|
|
|
@@ -76,7 +76,7 @@ export function createMuiTheme(...args) {
|
|
|
76
76
|
if (process.env.NODE_ENV !== 'production') {
|
|
77
77
|
if (!warnedOnce) {
|
|
78
78
|
warnedOnce = true;
|
|
79
|
-
console.error(['
|
|
79
|
+
console.error(['MUI: the createMuiTheme function was renamed to createTheme.', '', "You should use `import { createTheme } from '@mui/material/styles'`"].join('\n'));
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -65,23 +65,23 @@ export default function createTransitions(inputTransitions) {
|
|
|
65
65
|
const isNumber = value => !isNaN(parseFloat(value));
|
|
66
66
|
|
|
67
67
|
if (!isString(props) && !Array.isArray(props)) {
|
|
68
|
-
console.error('
|
|
68
|
+
console.error('MUI: Argument "props" must be a string or Array.');
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
if (!isNumber(durationOption) && !isString(durationOption)) {
|
|
72
|
-
console.error(`
|
|
72
|
+
console.error(`MUI: Argument "duration" must be a number or a string but found ${durationOption}.`);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
if (!isString(easingOption)) {
|
|
76
|
-
console.error('
|
|
76
|
+
console.error('MUI: Argument "easing" must be a string.');
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
if (!isNumber(delay) && !isString(delay)) {
|
|
80
|
-
console.error('
|
|
80
|
+
console.error('MUI: Argument "delay" must be a number or a string.');
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
if (Object.keys(other).length !== 0) {
|
|
84
|
-
console.error(`
|
|
84
|
+
console.error(`MUI: Unrecognized argument(s) [${Object.keys(other).join(',')}].`);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -27,7 +27,7 @@ export default function createTypography(palette, typography) {
|
|
|
27
27
|
fontWeightRegular = 400,
|
|
28
28
|
fontWeightMedium = 500,
|
|
29
29
|
fontWeightBold = 700,
|
|
30
|
-
// Tell
|
|
30
|
+
// Tell MUI what's the font-size on the html element.
|
|
31
31
|
// 16px is the default font-size used by browsers.
|
|
32
32
|
htmlFontSize = 16,
|
|
33
33
|
// Apply the CSS properties to all the variants.
|
|
@@ -38,11 +38,11 @@ export default function createTypography(palette, typography) {
|
|
|
38
38
|
|
|
39
39
|
if (process.env.NODE_ENV !== 'production') {
|
|
40
40
|
if (typeof fontSize !== 'number') {
|
|
41
|
-
console.error('
|
|
41
|
+
console.error('MUI: `fontSize` is required to be a number.');
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
if (typeof htmlFontSize !== 'number') {
|
|
45
|
-
console.error('
|
|
45
|
+
console.error('MUI: `htmlFontSize` is required to be a number.');
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -1,6 +1,6 @@
|
|
|
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.
|
|
4
4
|
You have to import it from @mui/styles.
|
|
5
|
-
See https://
|
|
5
|
+
See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` : _formatMuiErrorMessage(14));
|
|
6
6
|
}
|
|
@@ -32,7 +32,7 @@ export default function responsiveFontSizes(themeInput, options = {}) {
|
|
|
32
32
|
} = style;
|
|
33
33
|
|
|
34
34
|
if (!isUnitless(lineHeight) && !disableAlign) {
|
|
35
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `
|
|
35
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: Unsupported non-unitless line height with grid alignment.
|
|
36
36
|
Use unitless line heights instead.` : _formatMuiErrorMessage(6));
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -1,6 +1,6 @@
|
|
|
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.
|
|
4
4
|
You have to import it from @mui/styles.
|
|
5
|
-
See https://
|
|
5
|
+
See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` : _formatMuiErrorMessage(15));
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
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.
|
|
4
4
|
You have to import it from @mui/styles.
|
|
5
|
-
See https://
|
|
5
|
+
See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` : _formatMuiErrorMessage(16));
|
|
6
6
|
}
|
|
@@ -12,13 +12,13 @@ export default function useMediaQuery(queryInput, options = {}) {
|
|
|
12
12
|
|
|
13
13
|
if (process.env.NODE_ENV !== 'production') {
|
|
14
14
|
if (typeof queryInput === 'function' && theme === null) {
|
|
15
|
-
console.error(['
|
|
15
|
+
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'));
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
|
|
20
20
|
query = query.replace(/^@media( ?)/m, ''); // Wait for jsdom to support the match media feature.
|
|
21
|
-
// All the browsers
|
|
21
|
+
// All the browsers MUI support have this built-in.
|
|
22
22
|
// This defensive check is here for simplicity.
|
|
23
23
|
// Most of the time, the match media logic isn't central to people tests.
|
|
24
24
|
|
|
@@ -224,11 +224,11 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes
|
|
|
224
224
|
const summary = React.Children.toArray(props.children)[0];
|
|
225
225
|
|
|
226
226
|
if ((0, _reactIs.isFragment)(summary)) {
|
|
227
|
-
return new Error("
|
|
227
|
+
return new Error("MUI: The Accordion doesn't accept a Fragment as a child. " + 'Consider providing an array instead.');
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
if (! /*#__PURE__*/React.isValidElement(summary)) {
|
|
231
|
-
return new Error('
|
|
231
|
+
return new Error('MUI: Expected the first child of Accordion to be a valid element.');
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
return null;
|
|
@@ -296,7 +296,7 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes
|
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
298
|
* Props applied to the transition element.
|
|
299
|
-
* By default, the element is based on this [`Transition`](
|
|
299
|
+
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition) component.
|
|
300
300
|
*/
|
|
301
301
|
TransitionProps: _propTypes.default.object
|
|
302
302
|
} : void 0;
|
|
@@ -13,7 +13,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @ignore - internal component.
|
|
16
|
-
* @type {React.Context<{} | {expanded: boolean, disabled: boolean,
|
|
16
|
+
* @type {React.Context<{} | {expanded: boolean, disabled: boolean, toggle: () => void}>}
|
|
17
17
|
*/
|
|
18
18
|
const AccordionContext = /*#__PURE__*/React.createContext({});
|
|
19
19
|
|
|
@@ -739,7 +739,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
739
739
|
*/
|
|
740
740
|
defaultValue: (0, _utils.chainPropTypes)(_propTypes.default.any, props => {
|
|
741
741
|
if (props.multiple && props.defaultValue !== undefined && !Array.isArray(props.defaultValue)) {
|
|
742
|
-
return new Error(['
|
|
742
|
+
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'));
|
|
743
743
|
}
|
|
744
744
|
|
|
745
745
|
return null;
|
|
@@ -1082,7 +1082,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
1082
1082
|
*/
|
|
1083
1083
|
value: (0, _utils.chainPropTypes)(_propTypes.default.any, props => {
|
|
1084
1084
|
if (props.multiple && props.value !== undefined && !Array.isArray(props.value)) {
|
|
1085
|
-
return new Error(['
|
|
1085
|
+
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'));
|
|
1086
1086
|
}
|
|
1087
1087
|
|
|
1088
1088
|
return null;
|
|
@@ -112,7 +112,7 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
112
112
|
const children = React.Children.toArray(childrenProp).filter(child => {
|
|
113
113
|
if (process.env.NODE_ENV !== 'production') {
|
|
114
114
|
if ((0, _reactIs.isFragment)(child)) {
|
|
115
|
-
console.error(["
|
|
115
|
+
console.error(["MUI: The AvatarGroup component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -173,7 +173,7 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
|
|
|
173
173
|
*/
|
|
174
174
|
max: (0, _utils.chainPropTypes)(_propTypes.default.number, props => {
|
|
175
175
|
if (props.max < 2) {
|
|
176
|
-
return new Error(['
|
|
176
|
+
return new Error(['MUI: The prop `max` should be equal to 2 or above.', 'A value below is clamped to 2.'].join('\n'));
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
return null;
|
|
@@ -89,7 +89,7 @@ const BottomNavigation = /*#__PURE__*/React.forwardRef(function BottomNavigation
|
|
|
89
89
|
|
|
90
90
|
if (process.env.NODE_ENV !== 'production') {
|
|
91
91
|
if ((0, _reactIs.isFragment)(child)) {
|
|
92
|
-
console.error(["
|
|
92
|
+
console.error(["MUI: The BottomNavigation 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 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef(function Breadcrumbs(inProps,
|
|
|
150
150
|
|
|
151
151
|
if (itemsBeforeCollapse + itemsAfterCollapse >= allItems.length) {
|
|
152
152
|
if (process.env.NODE_ENV !== 'production') {
|
|
153
|
-
console.error(['
|
|
153
|
+
console.error(['MUI: You have provided an invalid combination of props to the Breadcrumbs.', `itemsAfterCollapse={${itemsAfterCollapse}} + itemsBeforeCollapse={${itemsBeforeCollapse}} >= maxItems={${maxItems}}`].join('\n'));
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
return allItems;
|
|
@@ -165,7 +165,7 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef(function Breadcrumbs(inProps,
|
|
|
165
165
|
const allItems = React.Children.toArray(children).filter(child => {
|
|
166
166
|
if (process.env.NODE_ENV !== 'production') {
|
|
167
167
|
if ((0, _reactIs.isFragment)(child)) {
|
|
168
|
-
console.error(["
|
|
168
|
+
console.error(["MUI: The Breadcrumbs component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
@@ -19,8 +19,6 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
19
19
|
|
|
20
20
|
var _utils = require("@mui/utils");
|
|
21
21
|
|
|
22
|
-
var _ButtonUnstyled = require("@mui/core/ButtonUnstyled");
|
|
23
|
-
|
|
24
22
|
var _composeClasses = _interopRequireDefault(require("@mui/core/composeClasses"));
|
|
25
23
|
|
|
26
24
|
var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
@@ -29,12 +27,14 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
|
29
27
|
|
|
30
28
|
var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
|
|
31
29
|
|
|
30
|
+
var _useEventCallback = _interopRequireDefault(require("../utils/useEventCallback"));
|
|
31
|
+
|
|
32
|
+
var _useIsFocusVisible = _interopRequireDefault(require("../utils/useIsFocusVisible"));
|
|
33
|
+
|
|
32
34
|
var _TouchRipple = _interopRequireDefault(require("./TouchRipple"));
|
|
33
35
|
|
|
34
36
|
var _buttonBaseClasses = _interopRequireWildcard(require("./buttonBaseClasses"));
|
|
35
37
|
|
|
36
|
-
var _useTouchRipple = _interopRequireDefault(require("../useTouchRipple"));
|
|
37
|
-
|
|
38
38
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
39
39
|
|
|
40
40
|
const _excluded = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "type"];
|
|
@@ -129,50 +129,204 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
129
129
|
disableTouchRipple = false,
|
|
130
130
|
focusRipple = false,
|
|
131
131
|
LinkComponent = 'a',
|
|
132
|
+
onBlur,
|
|
133
|
+
onClick,
|
|
134
|
+
onContextMenu,
|
|
135
|
+
onDragLeave,
|
|
136
|
+
onFocus,
|
|
137
|
+
onFocusVisible,
|
|
138
|
+
onKeyDown,
|
|
139
|
+
onKeyUp,
|
|
140
|
+
onMouseDown,
|
|
141
|
+
onMouseLeave,
|
|
142
|
+
onMouseUp,
|
|
143
|
+
onTouchEnd,
|
|
144
|
+
onTouchMove,
|
|
145
|
+
onTouchStart,
|
|
132
146
|
tabIndex = 0,
|
|
133
|
-
TouchRippleProps
|
|
147
|
+
TouchRippleProps,
|
|
148
|
+
type
|
|
134
149
|
} = props,
|
|
135
150
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
136
151
|
const buttonRef = React.useRef(null);
|
|
137
|
-
const handleRef = (0, _useForkRef.default)(buttonRef, ref);
|
|
138
152
|
const rippleRef = React.useRef(null);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
153
|
+
const {
|
|
154
|
+
isFocusVisibleRef,
|
|
155
|
+
onFocus: handleFocusVisible,
|
|
156
|
+
onBlur: handleBlurVisible,
|
|
157
|
+
ref: focusVisibleRef
|
|
158
|
+
} = (0, _useIsFocusVisible.default)();
|
|
159
|
+
const [focusVisible, setFocusVisible] = React.useState(false);
|
|
160
|
+
|
|
161
|
+
if (disabled && focusVisible) {
|
|
162
|
+
setFocusVisible(false);
|
|
143
163
|
}
|
|
144
164
|
|
|
145
|
-
const {
|
|
146
|
-
focusVisible,
|
|
147
|
-
setFocusVisible,
|
|
148
|
-
getRootProps
|
|
149
|
-
} = (0, _ButtonUnstyled.useButton)((0, _extends2.default)({}, props, {
|
|
150
|
-
component: ComponentProp,
|
|
151
|
-
ref: handleRef
|
|
152
|
-
}));
|
|
153
165
|
React.useImperativeHandle(action, () => ({
|
|
154
166
|
focusVisible: () => {
|
|
155
167
|
setFocusVisible(true);
|
|
156
168
|
buttonRef.current.focus();
|
|
157
169
|
}
|
|
158
|
-
}), [
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
170
|
+
}), []);
|
|
171
|
+
React.useEffect(() => {
|
|
172
|
+
if (focusVisible && focusRipple && !disableRipple) {
|
|
173
|
+
rippleRef.current.pulsate();
|
|
174
|
+
}
|
|
175
|
+
}, [disableRipple, focusRipple, focusVisible]);
|
|
176
|
+
|
|
177
|
+
function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {
|
|
178
|
+
return (0, _useEventCallback.default)(event => {
|
|
179
|
+
if (eventCallback) {
|
|
180
|
+
eventCallback(event);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const ignore = skipRippleAction;
|
|
184
|
+
|
|
185
|
+
if (!ignore && rippleRef.current) {
|
|
186
|
+
rippleRef.current[rippleAction](event);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return true;
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const handleMouseDown = useRippleHandler('start', onMouseDown);
|
|
194
|
+
const handleContextMenu = useRippleHandler('stop', onContextMenu);
|
|
195
|
+
const handleDragLeave = useRippleHandler('stop', onDragLeave);
|
|
196
|
+
const handleMouseUp = useRippleHandler('stop', onMouseUp);
|
|
197
|
+
const handleMouseLeave = useRippleHandler('stop', event => {
|
|
198
|
+
if (focusVisible) {
|
|
199
|
+
event.preventDefault();
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (onMouseLeave) {
|
|
203
|
+
onMouseLeave(event);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
const handleTouchStart = useRippleHandler('start', onTouchStart);
|
|
207
|
+
const handleTouchEnd = useRippleHandler('stop', onTouchEnd);
|
|
208
|
+
const handleTouchMove = useRippleHandler('stop', onTouchMove);
|
|
209
|
+
const handleBlur = useRippleHandler('stop', event => {
|
|
210
|
+
handleBlurVisible(event);
|
|
211
|
+
|
|
212
|
+
if (isFocusVisibleRef.current === false) {
|
|
213
|
+
setFocusVisible(false);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (onBlur) {
|
|
217
|
+
onBlur(event);
|
|
218
|
+
}
|
|
219
|
+
}, false);
|
|
220
|
+
const handleFocus = (0, _useEventCallback.default)(event => {
|
|
221
|
+
// Fix for https://github.com/facebook/react/issues/7769
|
|
222
|
+
if (!buttonRef.current) {
|
|
223
|
+
buttonRef.current = event.currentTarget;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
handleFocusVisible(event);
|
|
227
|
+
|
|
228
|
+
if (isFocusVisibleRef.current === true) {
|
|
229
|
+
setFocusVisible(true);
|
|
230
|
+
|
|
231
|
+
if (onFocusVisible) {
|
|
232
|
+
onFocusVisible(event);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (onFocus) {
|
|
237
|
+
onFocus(event);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
const isNonNativeButton = () => {
|
|
242
|
+
const button = buttonRef.current;
|
|
243
|
+
return component && component !== 'button' && !(button.tagName === 'A' && button.href);
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* IE11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat
|
|
247
|
+
*/
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
const keydownRef = React.useRef(false);
|
|
251
|
+
const handleKeyDown = (0, _useEventCallback.default)(event => {
|
|
252
|
+
// Check if key is already down to avoid repeats being counted as multiple activations
|
|
253
|
+
if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {
|
|
254
|
+
keydownRef.current = true;
|
|
255
|
+
rippleRef.current.stop(event, () => {
|
|
256
|
+
rippleRef.current.start(event);
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {
|
|
261
|
+
event.preventDefault();
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (onKeyDown) {
|
|
265
|
+
onKeyDown(event);
|
|
266
|
+
} // Keyboard accessibility for non interactive elements
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {
|
|
270
|
+
event.preventDefault();
|
|
271
|
+
|
|
272
|
+
if (onClick) {
|
|
273
|
+
onClick(event);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
const handleKeyUp = (0, _useEventCallback.default)(event => {
|
|
278
|
+
// calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
|
|
279
|
+
// https://codesandbox.io/s/button-keyup-preventdefault-dn7f0
|
|
280
|
+
if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) {
|
|
281
|
+
keydownRef.current = false;
|
|
282
|
+
rippleRef.current.stop(event, () => {
|
|
283
|
+
rippleRef.current.pulsate(event);
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (onKeyUp) {
|
|
288
|
+
onKeyUp(event);
|
|
289
|
+
} // Keyboard accessibility for non interactive elements
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === ' ' && !event.defaultPrevented) {
|
|
293
|
+
onClick(event);
|
|
294
|
+
}
|
|
169
295
|
});
|
|
296
|
+
let ComponentProp = component;
|
|
297
|
+
|
|
298
|
+
if (ComponentProp === 'button' && (other.href || other.to)) {
|
|
299
|
+
ComponentProp = LinkComponent;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const buttonProps = {};
|
|
303
|
+
|
|
304
|
+
if (ComponentProp === 'button') {
|
|
305
|
+
buttonProps.type = type === undefined ? 'button' : type;
|
|
306
|
+
buttonProps.disabled = disabled;
|
|
307
|
+
} else {
|
|
308
|
+
if (!other.href && !other.to) {
|
|
309
|
+
buttonProps.role = 'button';
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
if (disabled) {
|
|
313
|
+
buttonProps['aria-disabled'] = disabled;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const handleOwnRef = (0, _useForkRef.default)(focusVisibleRef, buttonRef);
|
|
318
|
+
const handleRef = (0, _useForkRef.default)(ref, handleOwnRef);
|
|
319
|
+
const [mountedState, setMountedState] = React.useState(false);
|
|
320
|
+
React.useEffect(() => {
|
|
321
|
+
setMountedState(true);
|
|
322
|
+
}, []);
|
|
323
|
+
const enableTouchRipple = mountedState && !disableRipple && !disabled;
|
|
170
324
|
|
|
171
325
|
if (process.env.NODE_ENV !== 'production') {
|
|
172
326
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
173
327
|
React.useEffect(() => {
|
|
174
328
|
if (enableTouchRipple && !rippleRef.current) {
|
|
175
|
-
console.error(['
|
|
329
|
+
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'));
|
|
176
330
|
}
|
|
177
331
|
}, [enableTouchRipple]);
|
|
178
332
|
}
|
|
@@ -191,8 +345,24 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
191
345
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ButtonBaseRoot, (0, _extends2.default)({
|
|
192
346
|
as: ComponentProp,
|
|
193
347
|
className: (0, _clsx.default)(classes.root, className),
|
|
194
|
-
ownerState: ownerState
|
|
195
|
-
|
|
348
|
+
ownerState: ownerState,
|
|
349
|
+
onBlur: handleBlur,
|
|
350
|
+
onClick: onClick,
|
|
351
|
+
onContextMenu: handleContextMenu,
|
|
352
|
+
onFocus: handleFocus,
|
|
353
|
+
onKeyDown: handleKeyDown,
|
|
354
|
+
onKeyUp: handleKeyUp,
|
|
355
|
+
onMouseDown: handleMouseDown,
|
|
356
|
+
onMouseLeave: handleMouseLeave,
|
|
357
|
+
onMouseUp: handleMouseUp,
|
|
358
|
+
onDragLeave: handleDragLeave,
|
|
359
|
+
onTouchEnd: handleTouchEnd,
|
|
360
|
+
onTouchMove: handleTouchMove,
|
|
361
|
+
onTouchStart: handleTouchStart,
|
|
362
|
+
ref: handleRef,
|
|
363
|
+
tabIndex: disabled ? -1 : tabIndex,
|
|
364
|
+
type: type
|
|
365
|
+
}, buttonProps, other, {
|
|
196
366
|
children: [children, enableTouchRipple ?
|
|
197
367
|
/*#__PURE__*/
|
|
198
368
|
|