@mui/material 7.0.0 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/Accordion.d.ts +2 -2
- package/Accordion/Accordion.js +2 -2
- package/Alert/Alert.d.ts +2 -2
- package/Alert/Alert.js +2 -2
- package/Autocomplete/Autocomplete.d.ts +40 -10
- package/Autocomplete/Autocomplete.js +45 -33
- package/Avatar/Avatar.d.ts +1 -1
- package/Avatar/Avatar.js +1 -1
- package/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/AvatarGroup/AvatarGroup.js +11 -3
- package/Backdrop/Backdrop.d.ts +3 -3
- package/Backdrop/Backdrop.js +3 -3
- package/Badge/Badge.d.ts +2 -2
- package/Badge/Badge.js +2 -2
- package/Button/Button.js +1 -1
- package/CHANGELOG.md +100 -0
- package/CardHeader/CardHeader.d.ts +2 -2
- package/CardHeader/CardHeader.js +2 -2
- package/Checkbox/Checkbox.js +1 -1
- package/Dialog/Dialog.d.ts +3 -3
- package/Dialog/Dialog.js +3 -3
- package/Dialog/dialogClasses.d.ts +6 -2
- package/Drawer/Drawer.d.ts +2 -2
- package/Drawer/Drawer.js +2 -2
- package/Fab/Fab.js +1 -1
- package/FilledInput/FilledInput.js +2 -2
- package/FormControlLabel/FormControlLabel.d.ts +1 -1
- package/FormControlLabel/FormControlLabel.js +1 -1
- package/IconButton/IconButton.js +1 -1
- package/Input/Input.js +2 -2
- package/InputBase/InputBase.d.ts +2 -2
- package/InputBase/InputBase.js +2 -2
- package/ListItem/ListItem.d.ts +4 -4
- package/ListItem/ListItem.js +6 -6
- package/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +1 -1
- package/ListItemSecondaryAction/ListItemSecondaryAction.js +1 -1
- package/ListItemText/ListItemText.d.ts +2 -2
- package/ListItemText/ListItemText.js +2 -2
- package/Menu/Menu.d.ts +2 -2
- package/Menu/Menu.js +2 -2
- package/MobileStepper/MobileStepper.d.ts +1 -1
- package/MobileStepper/MobileStepper.js +1 -1
- package/Modal/Modal.d.ts +2 -2
- package/Modal/Modal.js +2 -2
- package/OutlinedInput/OutlinedInput.js +1 -1
- package/PaginationItem/PaginationItem.d.ts +1 -1
- package/PaginationItem/PaginationItem.js +1 -1
- package/Popover/Popover.d.ts +5 -5
- package/Popover/Popover.js +5 -5
- package/Popper/Popper.d.ts +2 -2
- package/Popper/Popper.js +2 -2
- package/Radio/Radio.js +2 -2
- package/Rating/Rating.d.ts +1 -1
- package/Rating/Rating.js +1 -1
- package/Slider/Slider.d.ts +2 -2
- package/Slider/Slider.js +2 -2
- package/Snackbar/Snackbar.d.ts +4 -4
- package/Snackbar/Snackbar.js +4 -4
- package/SpeedDial/SpeedDial.d.ts +2 -2
- package/SpeedDial/SpeedDial.js +2 -2
- package/SpeedDialAction/SpeedDialAction.d.ts +5 -5
- package/SpeedDialAction/SpeedDialAction.js +5 -5
- package/StepContent/StepContent.d.ts +2 -2
- package/StepContent/StepContent.js +2 -2
- package/StepLabel/StepLabel.d.ts +3 -3
- package/StepLabel/StepLabel.js +3 -3
- package/SvgIcon/SvgIcon.d.ts +1 -1
- package/SvgIcon/SvgIcon.js +1 -1
- package/SwipeableDrawer/SwipeableDrawer.d.ts +1 -1
- package/SwipeableDrawer/SwipeableDrawer.js +1 -1
- package/Switch/Switch.js +2 -2
- package/Tabs/Tabs.d.ts +3 -3
- package/Tabs/Tabs.js +3 -3
- package/TextField/TextField.d.ts +7 -7
- package/TextField/TextField.js +5 -5
- package/Tooltip/Tooltip.d.ts +7 -7
- package/Tooltip/Tooltip.js +6 -6
- package/Typography/Typography.d.ts +1 -1
- package/Typography/Typography.js +1 -1
- package/esm/Accordion/Accordion.d.ts +2 -2
- package/esm/Accordion/Accordion.js +2 -2
- package/esm/Alert/Alert.d.ts +2 -2
- package/esm/Alert/Alert.js +2 -2
- package/esm/Autocomplete/Autocomplete.d.ts +40 -10
- package/esm/Autocomplete/Autocomplete.js +45 -33
- package/esm/Avatar/Avatar.d.ts +1 -1
- package/esm/Avatar/Avatar.js +1 -1
- package/esm/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/esm/AvatarGroup/AvatarGroup.js +11 -3
- package/esm/Backdrop/Backdrop.d.ts +3 -3
- package/esm/Backdrop/Backdrop.js +3 -3
- package/esm/Badge/Badge.d.ts +2 -2
- package/esm/Badge/Badge.js +2 -2
- package/esm/Button/Button.js +1 -1
- package/esm/CardHeader/CardHeader.d.ts +2 -2
- package/esm/CardHeader/CardHeader.js +2 -2
- package/esm/Checkbox/Checkbox.js +1 -1
- package/esm/Dialog/Dialog.d.ts +3 -3
- package/esm/Dialog/Dialog.js +3 -3
- package/esm/Dialog/dialogClasses.d.ts +6 -2
- package/esm/Drawer/Drawer.d.ts +2 -2
- package/esm/Drawer/Drawer.js +2 -2
- package/esm/Fab/Fab.js +1 -1
- package/esm/FilledInput/FilledInput.js +2 -2
- package/esm/FormControlLabel/FormControlLabel.d.ts +1 -1
- package/esm/FormControlLabel/FormControlLabel.js +1 -1
- package/esm/IconButton/IconButton.js +1 -1
- package/esm/Input/Input.js +2 -2
- package/esm/InputBase/InputBase.d.ts +2 -2
- package/esm/InputBase/InputBase.js +2 -2
- package/esm/ListItem/ListItem.d.ts +4 -4
- package/esm/ListItem/ListItem.js +6 -6
- package/esm/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +1 -1
- package/esm/ListItemSecondaryAction/ListItemSecondaryAction.js +1 -1
- package/esm/ListItemText/ListItemText.d.ts +2 -2
- package/esm/ListItemText/ListItemText.js +2 -2
- package/esm/Menu/Menu.d.ts +2 -2
- package/esm/Menu/Menu.js +2 -2
- package/esm/MobileStepper/MobileStepper.d.ts +1 -1
- package/esm/MobileStepper/MobileStepper.js +1 -1
- package/esm/Modal/Modal.d.ts +2 -2
- package/esm/Modal/Modal.js +2 -2
- package/esm/OutlinedInput/OutlinedInput.js +1 -1
- package/esm/PaginationItem/PaginationItem.d.ts +1 -1
- package/esm/PaginationItem/PaginationItem.js +1 -1
- package/esm/Popover/Popover.d.ts +5 -5
- package/esm/Popover/Popover.js +5 -5
- package/esm/Popper/Popper.d.ts +2 -2
- package/esm/Popper/Popper.js +2 -2
- package/esm/Radio/Radio.js +2 -2
- package/esm/Rating/Rating.d.ts +1 -1
- package/esm/Rating/Rating.js +1 -1
- package/esm/Slider/Slider.d.ts +2 -2
- package/esm/Slider/Slider.js +2 -2
- package/esm/Snackbar/Snackbar.d.ts +4 -4
- package/esm/Snackbar/Snackbar.js +4 -4
- package/esm/SpeedDial/SpeedDial.d.ts +2 -2
- package/esm/SpeedDial/SpeedDial.js +2 -2
- package/esm/SpeedDialAction/SpeedDialAction.d.ts +5 -5
- package/esm/SpeedDialAction/SpeedDialAction.js +5 -5
- package/esm/StepContent/StepContent.d.ts +2 -2
- package/esm/StepContent/StepContent.js +2 -2
- package/esm/StepLabel/StepLabel.d.ts +3 -3
- package/esm/StepLabel/StepLabel.js +3 -3
- package/esm/SvgIcon/SvgIcon.d.ts +1 -1
- package/esm/SvgIcon/SvgIcon.js +1 -1
- package/esm/SwipeableDrawer/SwipeableDrawer.d.ts +1 -1
- package/esm/SwipeableDrawer/SwipeableDrawer.js +1 -1
- package/esm/Switch/Switch.js +2 -2
- package/esm/Tabs/Tabs.d.ts +3 -3
- package/esm/Tabs/Tabs.js +3 -3
- package/esm/TextField/TextField.d.ts +7 -7
- package/esm/TextField/TextField.js +5 -5
- package/esm/Tooltip/Tooltip.d.ts +7 -7
- package/esm/Tooltip/Tooltip.js +6 -6
- package/esm/Typography/Typography.d.ts +1 -1
- package/esm/Typography/Typography.js +1 -1
- package/esm/index.d.ts +0 -1
- package/esm/index.js +1 -1
- package/esm/internal/SwitchBase.d.ts +2 -2
- package/esm/styles/createTypography.d.ts +1 -23
- package/esm/styles/cssUtils.d.ts +1 -1
- package/esm/styles/index.d.ts +2 -2
- package/esm/useAutocomplete/useAutocomplete.d.ts +26 -0
- package/esm/useAutocomplete/useAutocomplete.js +88 -42
- package/esm/utils/memoTheme.d.ts +1 -1
- package/esm/version/index.js +2 -2
- package/index.d.ts +0 -1
- package/index.js +1 -1
- package/internal/SwitchBase.d.ts +2 -2
- package/modern/Accordion/Accordion.d.ts +2 -2
- package/modern/Alert/Alert.d.ts +2 -2
- package/modern/Autocomplete/Autocomplete.d.ts +40 -10
- package/modern/Avatar/Avatar.d.ts +1 -1
- package/modern/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/modern/Backdrop/Backdrop.d.ts +3 -3
- package/modern/Badge/Badge.d.ts +2 -2
- package/modern/CardHeader/CardHeader.d.ts +2 -2
- package/modern/Dialog/Dialog.d.ts +3 -3
- package/modern/Dialog/dialogClasses.d.ts +6 -2
- package/modern/Drawer/Drawer.d.ts +2 -2
- package/modern/FormControlLabel/FormControlLabel.d.ts +1 -1
- package/modern/InputBase/InputBase.d.ts +2 -2
- package/modern/ListItem/ListItem.d.ts +4 -4
- package/modern/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +1 -1
- package/modern/ListItemText/ListItemText.d.ts +2 -2
- package/modern/Menu/Menu.d.ts +2 -2
- package/modern/MobileStepper/MobileStepper.d.ts +1 -1
- package/modern/Modal/Modal.d.ts +2 -2
- package/modern/PaginationItem/PaginationItem.d.ts +1 -1
- package/modern/Popover/Popover.d.ts +5 -5
- package/modern/Popper/Popper.d.ts +2 -2
- package/modern/Rating/Rating.d.ts +1 -1
- package/modern/Slider/Slider.d.ts +2 -2
- package/modern/Snackbar/Snackbar.d.ts +4 -4
- package/modern/SpeedDial/SpeedDial.d.ts +2 -2
- package/modern/SpeedDialAction/SpeedDialAction.d.ts +5 -5
- package/modern/StepContent/StepContent.d.ts +2 -2
- package/modern/StepLabel/StepLabel.d.ts +3 -3
- package/modern/SvgIcon/SvgIcon.d.ts +1 -1
- package/modern/SwipeableDrawer/SwipeableDrawer.d.ts +1 -1
- package/modern/Tabs/Tabs.d.ts +3 -3
- package/modern/TextField/TextField.d.ts +7 -7
- package/modern/Tooltip/Tooltip.d.ts +7 -7
- package/modern/Typography/Typography.d.ts +1 -1
- package/modern/index.d.ts +0 -1
- package/modern/internal/SwitchBase.d.ts +2 -2
- package/modern/styles/createTypography.d.ts +1 -23
- package/modern/styles/cssUtils.d.ts +1 -1
- package/modern/styles/index.d.ts +2 -2
- package/modern/useAutocomplete/useAutocomplete.d.ts +26 -0
- package/modern/utils/memoTheme.d.ts +1 -1
- package/package.json +8 -20
- package/styles/createTypography.d.ts +1 -23
- package/styles/cssUtils.d.ts +1 -1
- package/styles/index.d.ts +2 -2
- package/useAutocomplete/useAutocomplete.d.ts +26 -0
- package/useAutocomplete/useAutocomplete.js +88 -42
- package/utils/memoTheme.d.ts +1 -1
- package/version/index.js +2 -2
- package/modern/Accordion/Accordion.js +0 -328
- package/modern/Accordion/AccordionContext.js +0 -13
- package/modern/Accordion/accordionClasses.js +0 -7
- package/modern/Accordion/index.js +0 -3
- package/modern/AccordionActions/AccordionActions.js +0 -93
- package/modern/AccordionActions/accordionActionsClasses.js +0 -7
- package/modern/AccordionActions/index.js +0 -3
- package/modern/AccordionDetails/AccordionDetails.js +0 -70
- package/modern/AccordionDetails/accordionDetailsClasses.js +0 -7
- package/modern/AccordionDetails/index.js +0 -3
- package/modern/AccordionSummary/AccordionSummary.js +0 -250
- package/modern/AccordionSummary/accordionSummaryClasses.js +0 -7
- package/modern/AccordionSummary/index.js +0 -3
- package/modern/Alert/Alert.js +0 -386
- package/modern/Alert/alertClasses.js +0 -7
- package/modern/Alert/index.js +0 -3
- package/modern/AlertTitle/AlertTitle.js +0 -76
- package/modern/AlertTitle/alertTitleClasses.js +0 -7
- package/modern/AlertTitle/index.js +0 -3
- package/modern/AppBar/AppBar.js +0 -227
- package/modern/AppBar/appBarClasses.js +0 -7
- package/modern/AppBar/index.js +0 -3
- package/modern/Autocomplete/Autocomplete.js +0 -1186
- package/modern/Autocomplete/autocompleteClasses.js +0 -7
- package/modern/Autocomplete/index.js +0 -3
- package/modern/Avatar/Avatar.js +0 -299
- package/modern/Avatar/avatarClasses.js +0 -7
- package/modern/Avatar/index.js +0 -3
- package/modern/AvatarGroup/AvatarGroup.js +0 -223
- package/modern/AvatarGroup/avatarGroupClasses.js +0 -7
- package/modern/AvatarGroup/index.js +0 -3
- package/modern/Backdrop/Backdrop.js +0 -205
- package/modern/Backdrop/backdropClasses.js +0 -7
- package/modern/Backdrop/index.js +0 -3
- package/modern/Badge/Badge.js +0 -428
- package/modern/Badge/badgeClasses.js +0 -9
- package/modern/Badge/index.js +0 -3
- package/modern/Badge/useBadge.js +0 -41
- package/modern/Badge/useBadge.types.js +0 -1
- package/modern/BottomNavigation/BottomNavigation.js +0 -123
- package/modern/BottomNavigation/bottomNavigationClasses.js +0 -7
- package/modern/BottomNavigation/index.js +0 -3
- package/modern/BottomNavigationAction/BottomNavigationAction.js +0 -187
- package/modern/BottomNavigationAction/bottomNavigationActionClasses.js +0 -7
- package/modern/BottomNavigationAction/index.js +0 -3
- package/modern/Box/Box.js +0 -35
- package/modern/Box/boxClasses.js +0 -3
- package/modern/Box/index.js +0 -3
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +0 -90
- package/modern/Breadcrumbs/Breadcrumbs.js +0 -240
- package/modern/Breadcrumbs/breadcrumbsClasses.js +0 -7
- package/modern/Breadcrumbs/index.js +0 -3
- package/modern/Button/Button.js +0 -688
- package/modern/Button/buttonClasses.js +0 -7
- package/modern/Button/index.js +0 -3
- package/modern/ButtonBase/ButtonBase.js +0 -447
- package/modern/ButtonBase/Ripple.js +0 -88
- package/modern/ButtonBase/TouchRipple.js +0 -324
- package/modern/ButtonBase/buttonBaseClasses.js +0 -7
- package/modern/ButtonBase/index.js +0 -5
- package/modern/ButtonBase/touchRippleClasses.js +0 -7
- package/modern/ButtonGroup/ButtonGroup.js +0 -390
- package/modern/ButtonGroup/ButtonGroupButtonContext.js +0 -11
- package/modern/ButtonGroup/ButtonGroupContext.js +0 -11
- package/modern/ButtonGroup/buttonGroupClasses.js +0 -7
- package/modern/ButtonGroup/index.js +0 -5
- package/modern/Card/Card.js +0 -84
- package/modern/Card/cardClasses.js +0 -7
- package/modern/Card/index.js +0 -3
- package/modern/CardActionArea/CardActionArea.js +0 -117
- package/modern/CardActionArea/cardActionAreaClasses.js +0 -7
- package/modern/CardActionArea/index.js +0 -3
- package/modern/CardActions/CardActions.js +0 -94
- package/modern/CardActions/cardActionsClasses.js +0 -7
- package/modern/CardActions/index.js +0 -3
- package/modern/CardContent/CardContent.js +0 -80
- package/modern/CardContent/cardContentClasses.js +0 -7
- package/modern/CardContent/index.js +0 -3
- package/modern/CardHeader/CardHeader.js +0 -267
- package/modern/CardHeader/cardHeaderClasses.js +0 -7
- package/modern/CardHeader/index.js +0 -3
- package/modern/CardMedia/CardMedia.js +0 -145
- package/modern/CardMedia/cardMediaClasses.js +0 -7
- package/modern/CardMedia/index.js +0 -3
- package/modern/Checkbox/Checkbox.js +0 -280
- package/modern/Checkbox/checkboxClasses.js +0 -7
- package/modern/Checkbox/index.js +0 -3
- package/modern/Chip/Chip.js +0 -576
- package/modern/Chip/chipClasses.js +0 -7
- package/modern/Chip/index.js +0 -3
- package/modern/CircularProgress/CircularProgress.js +0 -285
- package/modern/CircularProgress/circularProgressClasses.js +0 -7
- package/modern/CircularProgress/index.js +0 -3
- package/modern/ClickAwayListener/ClickAwayListener.js +0 -174
- package/modern/ClickAwayListener/index.js +0 -1
- package/modern/Collapse/Collapse.js +0 -411
- package/modern/Collapse/collapseClasses.js +0 -7
- package/modern/Collapse/index.js +0 -3
- package/modern/Container/Container.js +0 -67
- package/modern/Container/containerClasses.js +0 -7
- package/modern/Container/index.js +0 -3
- package/modern/CssBaseline/CssBaseline.js +0 -161
- package/modern/CssBaseline/index.js +0 -1
- package/modern/DefaultPropsProvider/DefaultPropsProvider.js +0 -29
- package/modern/DefaultPropsProvider/index.js +0 -1
- package/modern/Dialog/Dialog.js +0 -513
- package/modern/Dialog/DialogContext.js +0 -8
- package/modern/Dialog/dialogClasses.js +0 -7
- package/modern/Dialog/index.js +0 -3
- package/modern/DialogActions/DialogActions.js +0 -96
- package/modern/DialogActions/dialogActionsClasses.js +0 -7
- package/modern/DialogActions/index.js +0 -3
- package/modern/DialogContent/DialogContent.js +0 -109
- package/modern/DialogContent/dialogContentClasses.js +0 -7
- package/modern/DialogContent/index.js +0 -3
- package/modern/DialogContentText/DialogContentText.js +0 -77
- package/modern/DialogContentText/dialogContentTextClasses.js +0 -7
- package/modern/DialogContentText/index.js +0 -3
- package/modern/DialogTitle/DialogTitle.js +0 -81
- package/modern/DialogTitle/dialogTitleClasses.js +0 -7
- package/modern/DialogTitle/index.js +0 -3
- package/modern/Divider/Divider.js +0 -314
- package/modern/Divider/dividerClasses.js +0 -7
- package/modern/Divider/index.js +0 -3
- package/modern/Drawer/Drawer.js +0 -434
- package/modern/Drawer/drawerClasses.js +0 -7
- package/modern/Drawer/index.js +0 -3
- package/modern/Fab/Fab.js +0 -271
- package/modern/Fab/fabClasses.js +0 -7
- package/modern/Fab/index.js +0 -3
- package/modern/Fade/Fade.js +0 -210
- package/modern/Fade/index.js +0 -1
- package/modern/FilledInput/FilledInput.js +0 -516
- package/modern/FilledInput/filledInputClasses.js +0 -11
- package/modern/FilledInput/index.js +0 -3
- package/modern/FormControl/FormControl.js +0 -305
- package/modern/FormControl/FormControlContext.js +0 -11
- package/modern/FormControl/formControlClasses.js +0 -7
- package/modern/FormControl/formControlState.js +0 -15
- package/modern/FormControl/index.js +0 -4
- package/modern/FormControl/useFormControl.js +0 -7
- package/modern/FormControlLabel/FormControlLabel.js +0 -283
- package/modern/FormControlLabel/formControlLabelClasses.js +0 -7
- package/modern/FormControlLabel/index.js +0 -3
- package/modern/FormGroup/FormGroup.js +0 -108
- package/modern/FormGroup/formGroupClasses.js +0 -7
- package/modern/FormGroup/index.js +0 -3
- package/modern/FormHelperText/FormHelperText.js +0 -186
- package/modern/FormHelperText/formHelperTextClasses.js +0 -7
- package/modern/FormHelperText/index.js +0 -3
- package/modern/FormLabel/FormLabel.js +0 -182
- package/modern/FormLabel/formLabelClasses.js +0 -7
- package/modern/FormLabel/index.js +0 -4
- package/modern/GlobalStyles/GlobalStyles.js +0 -26
- package/modern/GlobalStyles/index.js +0 -1
- package/modern/Grid/Grid.js +0 -138
- package/modern/Grid/gridClasses.js +0 -19
- package/modern/Grid/index.js +0 -4
- package/modern/GridLegacy/GridLegacy.js +0 -588
- package/modern/GridLegacy/GridLegacyContext.js +0 -12
- package/modern/GridLegacy/gridLegacyClasses.js +0 -19
- package/modern/GridLegacy/index.js +0 -3
- package/modern/Grow/Grow.js +0 -262
- package/modern/Grow/index.js +0 -1
- package/modern/Icon/Icon.js +0 -185
- package/modern/Icon/iconClasses.js +0 -7
- package/modern/Icon/index.js +0 -3
- package/modern/IconButton/IconButton.js +0 -322
- package/modern/IconButton/iconButtonClasses.js +0 -7
- package/modern/IconButton/index.js +0 -3
- package/modern/ImageList/ImageList.js +0 -150
- package/modern/ImageList/ImageListContext.js +0 -13
- package/modern/ImageList/imageListClasses.js +0 -7
- package/modern/ImageList/index.js +0 -3
- package/modern/ImageListItem/ImageListItem.js +0 -188
- package/modern/ImageListItem/imageListItemClasses.js +0 -7
- package/modern/ImageListItem/index.js +0 -3
- package/modern/ImageListItemBar/ImageListItemBar.js +0 -253
- package/modern/ImageListItemBar/imageListItemBarClasses.js +0 -7
- package/modern/ImageListItemBar/index.js +0 -3
- package/modern/InitColorSchemeScript/InitColorSchemeScript.js +0 -16
- package/modern/InitColorSchemeScript/index.js +0 -1
- package/modern/Input/Input.js +0 -361
- package/modern/Input/index.js +0 -3
- package/modern/Input/inputClasses.js +0 -11
- package/modern/InputAdornment/InputAdornment.js +0 -186
- package/modern/InputAdornment/index.js +0 -3
- package/modern/InputAdornment/inputAdornmentClasses.js +0 -7
- package/modern/InputBase/InputBase.js +0 -749
- package/modern/InputBase/index.js +0 -3
- package/modern/InputBase/inputBaseClasses.js +0 -7
- package/modern/InputBase/utils.js +0 -30
- package/modern/InputLabel/InputLabel.js +0 -283
- package/modern/InputLabel/index.js +0 -3
- package/modern/InputLabel/inputLabelClasses.js +0 -7
- package/modern/LinearProgress/LinearProgress.js +0 -455
- package/modern/LinearProgress/index.js +0 -3
- package/modern/LinearProgress/linearProgressClasses.js +0 -7
- package/modern/Link/Link.js +0 -283
- package/modern/Link/getTextDecoration.js +0 -16
- package/modern/Link/index.js +0 -3
- package/modern/Link/linkClasses.js +0 -7
- package/modern/List/List.js +0 -134
- package/modern/List/ListContext.js +0 -12
- package/modern/List/index.js +0 -3
- package/modern/List/listClasses.js +0 -7
- package/modern/ListItem/ListItem.js +0 -388
- package/modern/ListItem/index.js +0 -3
- package/modern/ListItem/listItemClasses.js +0 -7
- package/modern/ListItemAvatar/ListItemAvatar.js +0 -91
- package/modern/ListItemAvatar/index.js +0 -3
- package/modern/ListItemAvatar/listItemAvatarClasses.js +0 -7
- package/modern/ListItemButton/ListItemButton.js +0 -264
- package/modern/ListItemButton/index.js +0 -3
- package/modern/ListItemButton/listItemButtonClasses.js +0 -7
- package/modern/ListItemIcon/ListItemIcon.js +0 -97
- package/modern/ListItemIcon/index.js +0 -3
- package/modern/ListItemIcon/listItemIconClasses.js +0 -7
- package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +0 -96
- package/modern/ListItemSecondaryAction/index.js +0 -3
- package/modern/ListItemSecondaryAction/listItemSecondaryActionClasses.js +0 -7
- package/modern/ListItemText/ListItemText.js +0 -227
- package/modern/ListItemText/index.js +0 -3
- package/modern/ListItemText/listItemTextClasses.js +0 -7
- package/modern/ListSubheader/ListSubheader.js +0 -167
- package/modern/ListSubheader/index.js +0 -3
- package/modern/ListSubheader/listSubheaderClasses.js +0 -7
- package/modern/Menu/Menu.js +0 -341
- package/modern/Menu/index.js +0 -3
- package/modern/Menu/menuClasses.js +0 -7
- package/modern/MenuItem/MenuItem.js +0 -283
- package/modern/MenuItem/index.js +0 -3
- package/modern/MenuItem/menuItemClasses.js +0 -7
- package/modern/MenuList/MenuList.js +0 -290
- package/modern/MenuList/index.js +0 -1
- package/modern/MobileStepper/MobileStepper.js +0 -306
- package/modern/MobileStepper/index.js +0 -3
- package/modern/MobileStepper/mobileStepperClasses.js +0 -7
- package/modern/Modal/Modal.js +0 -396
- package/modern/Modal/ModalManager.js +0 -211
- package/modern/Modal/index.js +0 -4
- package/modern/Modal/modalClasses.js +0 -7
- package/modern/Modal/useModal.js +0 -200
- package/modern/Modal/useModal.types.js +0 -1
- package/modern/NativeSelect/NativeSelect.js +0 -133
- package/modern/NativeSelect/NativeSelectInput.js +0 -240
- package/modern/NativeSelect/index.js +0 -3
- package/modern/NativeSelect/nativeSelectClasses.js +0 -7
- package/modern/NoSsr/NoSsr.js +0 -70
- package/modern/NoSsr/NoSsr.types.js +0 -1
- package/modern/NoSsr/index.js +0 -1
- package/modern/OutlinedInput/NotchedOutline.js +0 -154
- package/modern/OutlinedInput/OutlinedInput.js +0 -410
- package/modern/OutlinedInput/index.js +0 -3
- package/modern/OutlinedInput/outlinedInputClasses.js +0 -11
- package/modern/OverridableComponent/index.js +0 -1
- package/modern/Pagination/Pagination.js +0 -245
- package/modern/Pagination/index.js +0 -3
- package/modern/Pagination/paginationClasses.js +0 -7
- package/modern/PaginationItem/PaginationItem.js +0 -472
- package/modern/PaginationItem/index.js +0 -3
- package/modern/PaginationItem/paginationItemClasses.js +0 -7
- package/modern/Paper/Paper.js +0 -170
- package/modern/Paper/index.js +0 -3
- package/modern/Paper/paperClasses.js +0 -7
- package/modern/PigmentContainer/PigmentContainer.js +0 -98
- package/modern/PigmentContainer/index.js +0 -3
- package/modern/PigmentGrid/PigmentGrid.js +0 -126
- package/modern/PigmentGrid/index.js +0 -3
- package/modern/PigmentStack/PigmentStack.js +0 -81
- package/modern/PigmentStack/index.js +0 -3
- package/modern/Popover/Popover.js +0 -583
- package/modern/Popover/index.js +0 -4
- package/modern/Popover/popoverClasses.js +0 -7
- package/modern/Popper/BasePopper.js +0 -370
- package/modern/Popper/BasePopper.types.js +0 -1
- package/modern/Popper/Popper.js +0 -210
- package/modern/Popper/index.js +0 -2
- package/modern/Popper/popperClasses.js +0 -7
- package/modern/Portal/Portal.js +0 -86
- package/modern/Portal/Portal.types.js +0 -1
- package/modern/Portal/index.js +0 -1
- package/modern/Radio/Radio.js +0 -309
- package/modern/Radio/RadioButtonIcon.js +0 -87
- package/modern/Radio/index.js +0 -3
- package/modern/Radio/radioClasses.js +0 -7
- package/modern/RadioGroup/RadioGroup.js +0 -114
- package/modern/RadioGroup/RadioGroupContext.js +0 -11
- package/modern/RadioGroup/index.js +0 -4
- package/modern/RadioGroup/radioGroupClasses.js +0 -7
- package/modern/RadioGroup/useRadioGroup.js +0 -7
- package/modern/Rating/Rating.js +0 -777
- package/modern/Rating/index.js +0 -3
- package/modern/Rating/ratingClasses.js +0 -7
- package/modern/ScopedCssBaseline/ScopedCssBaseline.js +0 -120
- package/modern/ScopedCssBaseline/index.js +0 -3
- package/modern/ScopedCssBaseline/scopedCssBaselineClasses.js +0 -7
- package/modern/Select/Select.js +0 -300
- package/modern/Select/SelectInput.js +0 -673
- package/modern/Select/index.js +0 -3
- package/modern/Select/selectClasses.js +0 -7
- package/modern/Skeleton/Skeleton.js +0 -269
- package/modern/Skeleton/index.js +0 -3
- package/modern/Skeleton/skeletonClasses.js +0 -7
- package/modern/Slide/Slide.js +0 -338
- package/modern/Slide/index.js +0 -1
- package/modern/Slider/Slider.js +0 -1095
- package/modern/Slider/SliderValueLabel.js +0 -53
- package/modern/Slider/SliderValueLabel.types.js +0 -1
- package/modern/Slider/index.js +0 -4
- package/modern/Slider/sliderClasses.js +0 -7
- package/modern/Slider/useSlider.js +0 -704
- package/modern/Slider/useSlider.types.js +0 -1
- package/modern/Snackbar/Snackbar.js +0 -426
- package/modern/Snackbar/index.js +0 -3
- package/modern/Snackbar/snackbarClasses.js +0 -7
- package/modern/Snackbar/useSnackbar.js +0 -133
- package/modern/Snackbar/useSnackbar.types.js +0 -1
- package/modern/SnackbarContent/SnackbarContent.js +0 -132
- package/modern/SnackbarContent/index.js +0 -3
- package/modern/SnackbarContent/snackbarContentClasses.js +0 -7
- package/modern/SpeedDial/SpeedDial.js +0 -579
- package/modern/SpeedDial/index.js +0 -3
- package/modern/SpeedDial/speedDialClasses.js +0 -7
- package/modern/SpeedDialAction/SpeedDialAction.js +0 -351
- package/modern/SpeedDialAction/index.js +0 -3
- package/modern/SpeedDialAction/speedDialActionClasses.js +0 -7
- package/modern/SpeedDialIcon/SpeedDialIcon.js +0 -156
- package/modern/SpeedDialIcon/index.js +0 -3
- package/modern/SpeedDialIcon/speedDialIconClasses.js +0 -7
- package/modern/Stack/Stack.js +0 -62
- package/modern/Stack/index.js +0 -2
- package/modern/Stack/stackClasses.js +0 -7
- package/modern/Step/Step.js +0 -176
- package/modern/Step/StepContext.js +0 -19
- package/modern/Step/index.js +0 -5
- package/modern/Step/stepClasses.js +0 -7
- package/modern/StepButton/StepButton.js +0 -133
- package/modern/StepButton/index.js +0 -3
- package/modern/StepButton/stepButtonClasses.js +0 -7
- package/modern/StepConnector/StepConnector.js +0 -152
- package/modern/StepConnector/index.js +0 -3
- package/modern/StepConnector/stepConnectorClasses.js +0 -7
- package/modern/StepContent/StepContent.js +0 -187
- package/modern/StepContent/index.js +0 -3
- package/modern/StepContent/stepContentClasses.js +0 -7
- package/modern/StepIcon/StepIcon.js +0 -161
- package/modern/StepIcon/index.js +0 -3
- package/modern/StepIcon/stepIconClasses.js +0 -7
- package/modern/StepLabel/StepLabel.js +0 -280
- package/modern/StepLabel/index.js +0 -3
- package/modern/StepLabel/stepLabelClasses.js +0 -7
- package/modern/Stepper/Stepper.js +0 -167
- package/modern/Stepper/StepperContext.js +0 -19
- package/modern/Stepper/index.js +0 -5
- package/modern/Stepper/stepperClasses.js +0 -7
- package/modern/SvgIcon/SvgIcon.js +0 -234
- package/modern/SvgIcon/index.js +0 -3
- package/modern/SvgIcon/svgIconClasses.js +0 -7
- package/modern/SwipeableDrawer/SwipeArea.js +0 -104
- package/modern/SwipeableDrawer/SwipeableDrawer.js +0 -661
- package/modern/SwipeableDrawer/index.js +0 -1
- package/modern/Switch/Switch.js +0 -407
- package/modern/Switch/index.js +0 -3
- package/modern/Switch/switchClasses.js +0 -7
- package/modern/Tab/Tab.js +0 -338
- package/modern/Tab/index.js +0 -3
- package/modern/Tab/tabClasses.js +0 -7
- package/modern/TabScrollButton/TabScrollButton.js +0 -172
- package/modern/TabScrollButton/index.js +0 -3
- package/modern/TabScrollButton/tabScrollButtonClasses.js +0 -7
- package/modern/Table/Table.js +0 -136
- package/modern/Table/TableContext.js +0 -12
- package/modern/Table/Tablelvl2Context.js +0 -12
- package/modern/Table/index.js +0 -3
- package/modern/Table/tableClasses.js +0 -7
- package/modern/TableBody/TableBody.js +0 -86
- package/modern/TableBody/index.js +0 -3
- package/modern/TableBody/tableBodyClasses.js +0 -7
- package/modern/TableCell/TableCell.js +0 -270
- package/modern/TableCell/index.js +0 -3
- package/modern/TableCell/tableCellClasses.js +0 -7
- package/modern/TableContainer/TableContainer.js +0 -78
- package/modern/TableContainer/index.js +0 -3
- package/modern/TableContainer/tableContainerClasses.js +0 -7
- package/modern/TableFooter/TableFooter.js +0 -86
- package/modern/TableFooter/index.js +0 -3
- package/modern/TableFooter/tableFooterClasses.js +0 -7
- package/modern/TableHead/TableHead.js +0 -86
- package/modern/TableHead/index.js +0 -3
- package/modern/TableHead/tableHeadClasses.js +0 -7
- package/modern/TablePagination/TablePagination.js +0 -505
- package/modern/TablePagination/TablePaginationActions.js +0 -194
- package/modern/TablePagination/index.js +0 -3
- package/modern/TablePagination/tablePaginationClasses.js +0 -7
- package/modern/TableRow/TableRow.js +0 -127
- package/modern/TableRow/index.js +0 -3
- package/modern/TableRow/tableRowClasses.js +0 -7
- package/modern/TableSortLabel/TableSortLabel.js +0 -212
- package/modern/TableSortLabel/index.js +0 -3
- package/modern/TableSortLabel/tableSortLabelClasses.js +0 -7
- package/modern/Tabs/ScrollbarSize.js +0 -58
- package/modern/Tabs/Tabs.js +0 -956
- package/modern/Tabs/index.js +0 -3
- package/modern/Tabs/tabsClasses.js +0 -7
- package/modern/TextField/TextField.js +0 -457
- package/modern/TextField/index.js +0 -3
- package/modern/TextField/textFieldClasses.js +0 -7
- package/modern/TextareaAutosize/TextareaAutosize.js +0 -243
- package/modern/TextareaAutosize/TextareaAutosize.types.js +0 -1
- package/modern/TextareaAutosize/index.js +0 -1
- package/modern/ToggleButton/ToggleButton.js +0 -268
- package/modern/ToggleButton/index.js +0 -3
- package/modern/ToggleButton/toggleButtonClasses.js +0 -7
- package/modern/ToggleButtonGroup/ToggleButtonGroup.js +0 -281
- package/modern/ToggleButtonGroup/ToggleButtonGroupButtonContext.js +0 -11
- package/modern/ToggleButtonGroup/ToggleButtonGroupContext.js +0 -11
- package/modern/ToggleButtonGroup/index.js +0 -3
- package/modern/ToggleButtonGroup/isValueSelected.js +0 -11
- package/modern/ToggleButtonGroup/toggleButtonGroupClasses.js +0 -7
- package/modern/Toolbar/Toolbar.js +0 -129
- package/modern/Toolbar/index.js +0 -3
- package/modern/Toolbar/toolbarClasses.js +0 -7
- package/modern/Tooltip/Tooltip.js +0 -898
- package/modern/Tooltip/index.js +0 -3
- package/modern/Tooltip/tooltipClasses.js +0 -7
- package/modern/Typography/Typography.js +0 -268
- package/modern/Typography/index.js +0 -3
- package/modern/Typography/typographyClasses.js +0 -7
- package/modern/Unstable_TrapFocus/FocusTrap.js +0 -329
- package/modern/Unstable_TrapFocus/FocusTrap.types.js +0 -1
- package/modern/Unstable_TrapFocus/index.js +0 -1
- package/modern/Zoom/Zoom.js +0 -210
- package/modern/Zoom/index.js +0 -1
- package/modern/className/index.js +0 -2
- package/modern/colors/amber.js +0 -17
- package/modern/colors/blue.js +0 -17
- package/modern/colors/blueGrey.js +0 -17
- package/modern/colors/brown.js +0 -17
- package/modern/colors/common.js +0 -5
- package/modern/colors/cyan.js +0 -17
- package/modern/colors/deepOrange.js +0 -17
- package/modern/colors/deepPurple.js +0 -17
- package/modern/colors/green.js +0 -17
- package/modern/colors/grey.js +0 -17
- package/modern/colors/index.js +0 -20
- package/modern/colors/indigo.js +0 -17
- package/modern/colors/lightBlue.js +0 -17
- package/modern/colors/lightGreen.js +0 -17
- package/modern/colors/lime.js +0 -17
- package/modern/colors/orange.js +0 -17
- package/modern/colors/pink.js +0 -17
- package/modern/colors/purple.js +0 -17
- package/modern/colors/red.js +0 -17
- package/modern/colors/teal.js +0 -17
- package/modern/colors/yellow.js +0 -17
- package/modern/darkScrollbar/index.js +0 -32
- package/modern/generateUtilityClass/index.js +0 -1
- package/modern/generateUtilityClasses/index.js +0 -1
- package/modern/index.js +0 -286
- package/modern/internal/SwitchBase.js +0 -355
- package/modern/internal/animate.js +0 -39
- package/modern/internal/svg-icons/Add.js +0 -12
- package/modern/internal/svg-icons/ArrowDownward.js +0 -12
- package/modern/internal/svg-icons/ArrowDropDown.js +0 -12
- package/modern/internal/svg-icons/Cancel.js +0 -12
- package/modern/internal/svg-icons/CheckBox.js +0 -12
- package/modern/internal/svg-icons/CheckBoxOutlineBlank.js +0 -12
- package/modern/internal/svg-icons/CheckCircle.js +0 -12
- package/modern/internal/svg-icons/Close.js +0 -14
- package/modern/internal/svg-icons/ErrorOutline.js +0 -12
- package/modern/internal/svg-icons/FirstPage.js +0 -12
- package/modern/internal/svg-icons/IndeterminateCheckBox.js +0 -12
- package/modern/internal/svg-icons/InfoOutlined.js +0 -12
- package/modern/internal/svg-icons/KeyboardArrowLeft.js +0 -12
- package/modern/internal/svg-icons/KeyboardArrowRight.js +0 -12
- package/modern/internal/svg-icons/LastPage.js +0 -12
- package/modern/internal/svg-icons/MoreHoriz.js +0 -12
- package/modern/internal/svg-icons/NavigateBefore.js +0 -12
- package/modern/internal/svg-icons/NavigateNext.js +0 -12
- package/modern/internal/svg-icons/Person.js +0 -12
- package/modern/internal/svg-icons/RadioButtonChecked.js +0 -12
- package/modern/internal/svg-icons/RadioButtonUnchecked.js +0 -12
- package/modern/internal/svg-icons/ReportProblemOutlined.js +0 -12
- package/modern/internal/svg-icons/Star.js +0 -12
- package/modern/internal/svg-icons/StarBorder.js +0 -12
- package/modern/internal/svg-icons/SuccessOutlined.js +0 -12
- package/modern/internal/svg-icons/Warning.js +0 -12
- package/modern/internal/switchBaseClasses.js +0 -7
- package/modern/locale/index.js +0 -4324
- package/modern/package.json +0 -1
- package/modern/styles/ThemeProvider.js +0 -40
- package/modern/styles/ThemeProviderNoVars.js +0 -17
- package/modern/styles/ThemeProviderWithVars.js +0 -91
- package/modern/styles/adaptV4Theme.js +0 -83
- package/modern/styles/components.js +0 -1
- package/modern/styles/createColorScheme.js +0 -41
- package/modern/styles/createGetSelector.js +0 -60
- package/modern/styles/createMixins.js +0 -16
- package/modern/styles/createMuiStrictModeTheme.js +0 -7
- package/modern/styles/createPalette.js +0 -302
- package/modern/styles/createStyles.js +0 -10
- package/modern/styles/createTheme.js +0 -98
- package/modern/styles/createThemeNoVars.js +0 -91
- package/modern/styles/createThemeWithVars.js +0 -386
- package/modern/styles/createTransitions.js +0 -89
- package/modern/styles/createTypography.js +0 -92
- package/modern/styles/cssUtils.js +0 -125
- package/modern/styles/defaultTheme.js +0 -5
- package/modern/styles/excludeVariablesFromRoot.js +0 -5
- package/modern/styles/experimental_extendTheme.js +0 -9
- package/modern/styles/getOverlayAlpha.js +0 -10
- package/modern/styles/identifier.js +0 -1
- package/modern/styles/index.js +0 -37
- package/modern/styles/makeStyles.js +0 -4
- package/modern/styles/overrides.js +0 -1
- package/modern/styles/props.js +0 -1
- package/modern/styles/responsiveFontSizes.js +0 -67
- package/modern/styles/rootShouldForwardProp.js +0 -3
- package/modern/styles/shadows.js +0 -10
- package/modern/styles/shouldSkipGeneratingVar.js +0 -5
- package/modern/styles/slotShouldForwardProp.js +0 -5
- package/modern/styles/stringifyTheme.js +0 -54
- package/modern/styles/styled.js +0 -14
- package/modern/styles/useTheme.js +0 -15
- package/modern/styles/useThemeProps.js +0 -16
- package/modern/styles/variants.js +0 -1
- package/modern/styles/withStyles.js +0 -4
- package/modern/styles/withTheme.js +0 -4
- package/modern/styles/zIndex.js +0 -13
- package/modern/transitions/index.js +0 -1
- package/modern/transitions/transition.js +0 -1
- package/modern/transitions/utils.js +0 -13
- package/modern/types/OverridableComponentAugmentation.js +0 -1
- package/modern/useAutocomplete/index.js +0 -1
- package/modern/useAutocomplete/useAutocomplete.js +0 -973
- package/modern/useLazyRipple/index.js +0 -3
- package/modern/useLazyRipple/useLazyRipple.js +0 -85
- package/modern/useMediaQuery/index.js +0 -6
- package/modern/usePagination/index.js +0 -1
- package/modern/usePagination/usePagination.js +0 -113
- package/modern/useScrollTrigger/index.js +0 -1
- package/modern/useScrollTrigger/useScrollTrigger.js +0 -55
- package/modern/utils/PolymorphicComponent.js +0 -1
- package/modern/utils/areArraysEqual.js +0 -4
- package/modern/utils/capitalize.js +0 -2
- package/modern/utils/createChainedFunction.js +0 -2
- package/modern/utils/createSimplePaletteValueFilter.js +0 -41
- package/modern/utils/createSvgIcon.js +0 -26
- package/modern/utils/debounce.js +0 -2
- package/modern/utils/deprecatedPropType.js +0 -2
- package/modern/utils/getScrollbarSize.js +0 -2
- package/modern/utils/index.js +0 -31
- package/modern/utils/isHostComponent.js +0 -7
- package/modern/utils/isMuiElement.js +0 -2
- package/modern/utils/memoTheme.js +0 -3
- package/modern/utils/mergeSlotProps.js +0 -75
- package/modern/utils/omitEventHandlers.js +0 -18
- package/modern/utils/ownerDocument.js +0 -2
- package/modern/utils/ownerWindow.js +0 -2
- package/modern/utils/requirePropFactory.js +0 -2
- package/modern/utils/setRef.js +0 -2
- package/modern/utils/shouldSpreadAdditionalProps.js +0 -5
- package/modern/utils/types.js +0 -1
- package/modern/utils/unsupportedProp.js +0 -2
- package/modern/utils/useControlled.js +0 -4
- package/modern/utils/useEnhancedEffect.js +0 -4
- package/modern/utils/useEventCallback.js +0 -4
- package/modern/utils/useForkRef.js +0 -4
- package/modern/utils/useId.js +0 -4
- package/modern/utils/useSlot.js +0 -80
- package/modern/version/index.js +0 -6
- package/modern/zero-styled/index.js +0 -27
- package/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import useLazyRef from '@mui/utils/useLazyRef';
|
|
5
|
-
/**
|
|
6
|
-
* Lazy initialization container for the Ripple instance. This improves
|
|
7
|
-
* performance by delaying mounting the ripple until it's needed.
|
|
8
|
-
*/
|
|
9
|
-
export class LazyRipple {
|
|
10
|
-
/** React ref to the ripple instance */
|
|
11
|
-
|
|
12
|
-
/** If the ripple component should be mounted */
|
|
13
|
-
|
|
14
|
-
/** Promise that resolves when the ripple component is mounted */
|
|
15
|
-
|
|
16
|
-
/** If the ripple component has been mounted */
|
|
17
|
-
|
|
18
|
-
/** React state hook setter */
|
|
19
|
-
|
|
20
|
-
static create() {
|
|
21
|
-
return new LazyRipple();
|
|
22
|
-
}
|
|
23
|
-
static use() {
|
|
24
|
-
/* eslint-disable */
|
|
25
|
-
const ripple = useLazyRef(LazyRipple.create).current;
|
|
26
|
-
const [shouldMount, setShouldMount] = React.useState(false);
|
|
27
|
-
ripple.shouldMount = shouldMount;
|
|
28
|
-
ripple.setShouldMount = setShouldMount;
|
|
29
|
-
React.useEffect(ripple.mountEffect, [shouldMount]);
|
|
30
|
-
/* eslint-enable */
|
|
31
|
-
|
|
32
|
-
return ripple;
|
|
33
|
-
}
|
|
34
|
-
constructor() {
|
|
35
|
-
this.ref = {
|
|
36
|
-
current: null
|
|
37
|
-
};
|
|
38
|
-
this.mounted = null;
|
|
39
|
-
this.didMount = false;
|
|
40
|
-
this.shouldMount = false;
|
|
41
|
-
this.setShouldMount = null;
|
|
42
|
-
}
|
|
43
|
-
mount() {
|
|
44
|
-
if (!this.mounted) {
|
|
45
|
-
this.mounted = createControlledPromise();
|
|
46
|
-
this.shouldMount = true;
|
|
47
|
-
this.setShouldMount(this.shouldMount);
|
|
48
|
-
}
|
|
49
|
-
return this.mounted;
|
|
50
|
-
}
|
|
51
|
-
mountEffect = () => {
|
|
52
|
-
if (this.shouldMount && !this.didMount) {
|
|
53
|
-
if (this.ref.current !== null) {
|
|
54
|
-
this.didMount = true;
|
|
55
|
-
this.mounted.resolve();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/* Ripple API */
|
|
61
|
-
|
|
62
|
-
start(...args) {
|
|
63
|
-
this.mount().then(() => this.ref.current?.start(...args));
|
|
64
|
-
}
|
|
65
|
-
stop(...args) {
|
|
66
|
-
this.mount().then(() => this.ref.current?.stop(...args));
|
|
67
|
-
}
|
|
68
|
-
pulsate(...args) {
|
|
69
|
-
this.mount().then(() => this.ref.current?.pulsate(...args));
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
export default function useLazyRipple() {
|
|
73
|
-
return LazyRipple.use();
|
|
74
|
-
}
|
|
75
|
-
function createControlledPromise() {
|
|
76
|
-
let resolve;
|
|
77
|
-
let reject;
|
|
78
|
-
const p = new Promise((resolveFn, rejectFn) => {
|
|
79
|
-
resolve = resolveFn;
|
|
80
|
-
reject = rejectFn;
|
|
81
|
-
});
|
|
82
|
-
p.resolve = resolve;
|
|
83
|
-
p.reject = reject;
|
|
84
|
-
return p;
|
|
85
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./usePagination.js";
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import useControlled from '@mui/utils/useControlled';
|
|
4
|
-
export default function usePagination(props = {}) {
|
|
5
|
-
// keep default values in sync with @default tags in Pagination.propTypes
|
|
6
|
-
const {
|
|
7
|
-
boundaryCount = 1,
|
|
8
|
-
componentName = 'usePagination',
|
|
9
|
-
count = 1,
|
|
10
|
-
defaultPage = 1,
|
|
11
|
-
disabled = false,
|
|
12
|
-
hideNextButton = false,
|
|
13
|
-
hidePrevButton = false,
|
|
14
|
-
onChange: handleChange,
|
|
15
|
-
page: pageProp,
|
|
16
|
-
showFirstButton = false,
|
|
17
|
-
showLastButton = false,
|
|
18
|
-
siblingCount = 1,
|
|
19
|
-
...other
|
|
20
|
-
} = props;
|
|
21
|
-
const [page, setPageState] = useControlled({
|
|
22
|
-
controlled: pageProp,
|
|
23
|
-
default: defaultPage,
|
|
24
|
-
name: componentName,
|
|
25
|
-
state: 'page'
|
|
26
|
-
});
|
|
27
|
-
const handleClick = (event, value) => {
|
|
28
|
-
if (!pageProp) {
|
|
29
|
-
setPageState(value);
|
|
30
|
-
}
|
|
31
|
-
if (handleChange) {
|
|
32
|
-
handleChange(event, value);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// https://dev.to/namirsab/comment/2050
|
|
37
|
-
const range = (start, end) => {
|
|
38
|
-
const length = end - start + 1;
|
|
39
|
-
return Array.from({
|
|
40
|
-
length
|
|
41
|
-
}, (_, i) => start + i);
|
|
42
|
-
};
|
|
43
|
-
const startPages = range(1, Math.min(boundaryCount, count));
|
|
44
|
-
const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count);
|
|
45
|
-
const siblingsStart = Math.max(Math.min(
|
|
46
|
-
// Natural start
|
|
47
|
-
page - siblingCount,
|
|
48
|
-
// Lower boundary when page is high
|
|
49
|
-
count - boundaryCount - siblingCount * 2 - 1),
|
|
50
|
-
// Greater than startPages
|
|
51
|
-
boundaryCount + 2);
|
|
52
|
-
const siblingsEnd = Math.min(Math.max(
|
|
53
|
-
// Natural end
|
|
54
|
-
page + siblingCount,
|
|
55
|
-
// Upper boundary when page is low
|
|
56
|
-
boundaryCount + siblingCount * 2 + 2),
|
|
57
|
-
// Less than endPages
|
|
58
|
-
count - boundaryCount - 1);
|
|
59
|
-
|
|
60
|
-
// Basic list of items to render
|
|
61
|
-
// for example itemList = ['first', 'previous', 1, 'ellipsis', 4, 5, 6, 'ellipsis', 10, 'next', 'last']
|
|
62
|
-
const itemList = [...(showFirstButton ? ['first'] : []), ...(hidePrevButton ? [] : ['previous']), ...startPages,
|
|
63
|
-
// Start ellipsis
|
|
64
|
-
// eslint-disable-next-line no-nested-ternary
|
|
65
|
-
...(siblingsStart > boundaryCount + 2 ? ['start-ellipsis'] : boundaryCount + 1 < count - boundaryCount ? [boundaryCount + 1] : []),
|
|
66
|
-
// Sibling pages
|
|
67
|
-
...range(siblingsStart, siblingsEnd),
|
|
68
|
-
// End ellipsis
|
|
69
|
-
// eslint-disable-next-line no-nested-ternary
|
|
70
|
-
...(siblingsEnd < count - boundaryCount - 1 ? ['end-ellipsis'] : count - boundaryCount > boundaryCount ? [count - boundaryCount] : []), ...endPages, ...(hideNextButton ? [] : ['next']), ...(showLastButton ? ['last'] : [])];
|
|
71
|
-
|
|
72
|
-
// Map the button type to its page number
|
|
73
|
-
const buttonPage = type => {
|
|
74
|
-
switch (type) {
|
|
75
|
-
case 'first':
|
|
76
|
-
return 1;
|
|
77
|
-
case 'previous':
|
|
78
|
-
return page - 1;
|
|
79
|
-
case 'next':
|
|
80
|
-
return page + 1;
|
|
81
|
-
case 'last':
|
|
82
|
-
return count;
|
|
83
|
-
default:
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// Convert the basic item list to PaginationItem props objects
|
|
89
|
-
const items = itemList.map(item => {
|
|
90
|
-
return typeof item === 'number' ? {
|
|
91
|
-
onClick: event => {
|
|
92
|
-
handleClick(event, item);
|
|
93
|
-
},
|
|
94
|
-
type: 'page',
|
|
95
|
-
page: item,
|
|
96
|
-
selected: item === page,
|
|
97
|
-
disabled,
|
|
98
|
-
'aria-current': item === page ? 'page' : undefined
|
|
99
|
-
} : {
|
|
100
|
-
onClick: event => {
|
|
101
|
-
handleClick(event, buttonPage(item));
|
|
102
|
-
},
|
|
103
|
-
type: item,
|
|
104
|
-
page: buttonPage(item),
|
|
105
|
-
selected: false,
|
|
106
|
-
disabled: disabled || !item.includes('ellipsis') && (item === 'next' || item === 'last' ? page >= count : page <= 1)
|
|
107
|
-
};
|
|
108
|
-
});
|
|
109
|
-
return {
|
|
110
|
-
items,
|
|
111
|
-
...other
|
|
112
|
-
};
|
|
113
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./useScrollTrigger.js";
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
function defaultTrigger(store, options) {
|
|
5
|
-
const {
|
|
6
|
-
disableHysteresis = false,
|
|
7
|
-
threshold = 100,
|
|
8
|
-
target
|
|
9
|
-
} = options;
|
|
10
|
-
const previous = store.current;
|
|
11
|
-
if (target) {
|
|
12
|
-
// Get vertical scroll
|
|
13
|
-
store.current = target.pageYOffset !== undefined ? target.pageYOffset : target.scrollTop;
|
|
14
|
-
}
|
|
15
|
-
if (!disableHysteresis && previous !== undefined) {
|
|
16
|
-
if (store.current < previous) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return store.current > threshold;
|
|
21
|
-
}
|
|
22
|
-
const defaultTarget = typeof window !== 'undefined' ? window : null;
|
|
23
|
-
export default function useScrollTrigger(options = {}) {
|
|
24
|
-
const {
|
|
25
|
-
getTrigger = defaultTrigger,
|
|
26
|
-
target = defaultTarget,
|
|
27
|
-
...other
|
|
28
|
-
} = options;
|
|
29
|
-
const store = React.useRef();
|
|
30
|
-
const [trigger, setTrigger] = React.useState(() => getTrigger(store, other));
|
|
31
|
-
React.useEffect(() => {
|
|
32
|
-
if (target === null) {
|
|
33
|
-
return setTrigger(false);
|
|
34
|
-
}
|
|
35
|
-
const handleScroll = () => {
|
|
36
|
-
setTrigger(getTrigger(store, {
|
|
37
|
-
target,
|
|
38
|
-
...other
|
|
39
|
-
}));
|
|
40
|
-
};
|
|
41
|
-
handleScroll(); // Re-evaluate trigger when dependencies change
|
|
42
|
-
target.addEventListener('scroll', handleScroll, {
|
|
43
|
-
passive: true
|
|
44
|
-
});
|
|
45
|
-
return () => {
|
|
46
|
-
target.removeEventListener('scroll', handleScroll, {
|
|
47
|
-
passive: true
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
// See Option 3. https://github.com/facebook/react/issues/14476#issuecomment-471199055
|
|
51
|
-
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
52
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
|
-
}, [target, getTrigger, JSON.stringify(other)]);
|
|
54
|
-
return trigger;
|
|
55
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type guard to check if the object has a "main" property of type string.
|
|
3
|
-
*
|
|
4
|
-
* @param obj - the object to check
|
|
5
|
-
* @returns boolean
|
|
6
|
-
*/
|
|
7
|
-
function hasCorrectMainProperty(obj) {
|
|
8
|
-
return typeof obj.main === 'string';
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Checks if the object conforms to the SimplePaletteColorOptions type.
|
|
12
|
-
* The minimum requirement is that the object has a "main" property of type string, this is always checked.
|
|
13
|
-
* Optionally, you can pass additional properties to check.
|
|
14
|
-
*
|
|
15
|
-
* @param obj - The object to check
|
|
16
|
-
* @param additionalPropertiesToCheck - Array containing "light", "dark", and/or "contrastText"
|
|
17
|
-
* @returns boolean
|
|
18
|
-
*/
|
|
19
|
-
function checkSimplePaletteColorValues(obj, additionalPropertiesToCheck = []) {
|
|
20
|
-
if (!hasCorrectMainProperty(obj)) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
for (const value of additionalPropertiesToCheck) {
|
|
24
|
-
if (!obj.hasOwnProperty(value) || typeof obj[value] !== 'string') {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Creates a filter function used to filter simple palette color options.
|
|
33
|
-
* The minimum requirement is that the object has a "main" property of type string, this is always checked.
|
|
34
|
-
* Optionally, you can pass additional properties to check.
|
|
35
|
-
*
|
|
36
|
-
* @param additionalPropertiesToCheck - Array containing "light", "dark", and/or "contrastText"
|
|
37
|
-
* @returns ([, value]: [any, PaletteColorOptions]) => boolean
|
|
38
|
-
*/
|
|
39
|
-
export default function createSimplePaletteValueFilter(additionalPropertiesToCheck = []) {
|
|
40
|
-
return ([, value]) => value && checkSimplePaletteColorValues(value, additionalPropertiesToCheck);
|
|
41
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import SvgIcon from "../SvgIcon/index.js";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Private module reserved for @mui packages.
|
|
8
|
-
*/
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
export default function createSvgIcon(path, displayName) {
|
|
11
|
-
function Component(props, ref) {
|
|
12
|
-
return /*#__PURE__*/_jsx(SvgIcon, {
|
|
13
|
-
"data-testid": process.env.NODE_ENV !== 'production' ? `${displayName}Icon` : undefined,
|
|
14
|
-
ref: ref,
|
|
15
|
-
...props,
|
|
16
|
-
children: path
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
20
|
-
// Need to set `displayName` on the inner component for React.memo.
|
|
21
|
-
// React prior to 16.14 ignores `displayName` on the wrapper.
|
|
22
|
-
Component.displayName = `${displayName}Icon`;
|
|
23
|
-
}
|
|
24
|
-
Component.muiName = SvgIcon.muiName;
|
|
25
|
-
return /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(Component));
|
|
26
|
-
}
|
package/modern/utils/debounce.js
DELETED
package/modern/utils/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/utils';
|
|
4
|
-
export { default as capitalize } from "./capitalize.js";
|
|
5
|
-
export { default as createChainedFunction } from "./createChainedFunction.js";
|
|
6
|
-
export { default as createSvgIcon } from "./createSvgIcon.js";
|
|
7
|
-
export { default as debounce } from "./debounce.js";
|
|
8
|
-
export { default as deprecatedPropType } from "./deprecatedPropType.js";
|
|
9
|
-
export { default as isMuiElement } from "./isMuiElement.js";
|
|
10
|
-
export { default as unstable_memoTheme } from "./memoTheme.js";
|
|
11
|
-
export { default as ownerDocument } from "./ownerDocument.js";
|
|
12
|
-
export { default as ownerWindow } from "./ownerWindow.js";
|
|
13
|
-
export { default as requirePropFactory } from "./requirePropFactory.js";
|
|
14
|
-
export { default as setRef } from "./setRef.js";
|
|
15
|
-
export { default as unstable_useEnhancedEffect } from "./useEnhancedEffect.js";
|
|
16
|
-
export { default as unstable_useId } from "./useId.js";
|
|
17
|
-
export { default as unsupportedProp } from "./unsupportedProp.js";
|
|
18
|
-
export { default as useControlled } from "./useControlled.js";
|
|
19
|
-
export { default as useEventCallback } from "./useEventCallback.js";
|
|
20
|
-
export { default as useForkRef } from "./useForkRef.js";
|
|
21
|
-
export { default as mergeSlotProps } from "./mergeSlotProps.js";
|
|
22
|
-
// TODO: remove this export once ClassNameGenerator is stable
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
24
|
-
export const unstable_ClassNameGenerator = {
|
|
25
|
-
configure: generator => {
|
|
26
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
27
|
-
console.warn(['MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.', '', "You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead", '', 'The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401', '', 'The updated documentation: https://mui.com/guides/classname-generator/'].join('\n'));
|
|
28
|
-
}
|
|
29
|
-
ClassNameGenerator.configure(generator);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import clsx from 'clsx';
|
|
2
|
-
|
|
3
|
-
// Brought from [Base UI](https://github.com/mui/base-ui/blob/master/packages/react/src/merge-props/mergeProps.ts#L119)
|
|
4
|
-
// Use it directly from Base UI once it's a package dependency.
|
|
5
|
-
function isEventHandler(key, value) {
|
|
6
|
-
// This approach is more efficient than using a regex.
|
|
7
|
-
const thirdCharCode = key.charCodeAt(2);
|
|
8
|
-
return key[0] === 'o' && key[1] === 'n' && thirdCharCode >= 65 /* A */ && thirdCharCode <= 90 /* Z */ && typeof value === 'function';
|
|
9
|
-
}
|
|
10
|
-
export default function mergeSlotProps(externalSlotProps, defaultSlotProps) {
|
|
11
|
-
if (!externalSlotProps) {
|
|
12
|
-
return defaultSlotProps;
|
|
13
|
-
}
|
|
14
|
-
function extractHandlers(externalSlotPropsValue, defaultSlotPropsValue) {
|
|
15
|
-
const handlers = {};
|
|
16
|
-
Object.keys(defaultSlotPropsValue).forEach(key => {
|
|
17
|
-
if (isEventHandler(key, defaultSlotPropsValue[key]) && typeof externalSlotPropsValue[key] === 'function') {
|
|
18
|
-
// only compose the handlers if both default and external slot props match the event handler
|
|
19
|
-
handlers[key] = (...args) => {
|
|
20
|
-
externalSlotPropsValue[key](...args);
|
|
21
|
-
defaultSlotPropsValue[key](...args);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
return handlers;
|
|
26
|
-
}
|
|
27
|
-
if (typeof externalSlotProps === 'function' || typeof defaultSlotProps === 'function') {
|
|
28
|
-
return ownerState => {
|
|
29
|
-
const defaultSlotPropsValue = typeof defaultSlotProps === 'function' ? defaultSlotProps(ownerState) : defaultSlotProps;
|
|
30
|
-
const externalSlotPropsValue = typeof externalSlotProps === 'function' ? externalSlotProps({
|
|
31
|
-
...ownerState,
|
|
32
|
-
...defaultSlotPropsValue
|
|
33
|
-
}) : externalSlotProps;
|
|
34
|
-
const className = clsx(ownerState?.className, defaultSlotPropsValue?.className, externalSlotPropsValue?.className);
|
|
35
|
-
const handlers = extractHandlers(externalSlotPropsValue, defaultSlotPropsValue);
|
|
36
|
-
return {
|
|
37
|
-
...defaultSlotPropsValue,
|
|
38
|
-
...externalSlotPropsValue,
|
|
39
|
-
...handlers,
|
|
40
|
-
...(!!className && {
|
|
41
|
-
className
|
|
42
|
-
}),
|
|
43
|
-
...(defaultSlotPropsValue?.style && externalSlotPropsValue?.style && {
|
|
44
|
-
style: {
|
|
45
|
-
...defaultSlotPropsValue.style,
|
|
46
|
-
...externalSlotPropsValue.style
|
|
47
|
-
}
|
|
48
|
-
}),
|
|
49
|
-
...(defaultSlotPropsValue?.sx && externalSlotPropsValue?.sx && {
|
|
50
|
-
sx: [...(Array.isArray(defaultSlotPropsValue.sx) ? defaultSlotPropsValue.sx : [defaultSlotPropsValue.sx]), ...(Array.isArray(externalSlotPropsValue.sx) ? externalSlotPropsValue.sx : [externalSlotPropsValue.sx])]
|
|
51
|
-
})
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
const typedDefaultSlotProps = defaultSlotProps;
|
|
56
|
-
const handlers = extractHandlers(externalSlotProps, typedDefaultSlotProps);
|
|
57
|
-
const className = clsx(typedDefaultSlotProps?.className, externalSlotProps?.className);
|
|
58
|
-
return {
|
|
59
|
-
...defaultSlotProps,
|
|
60
|
-
...externalSlotProps,
|
|
61
|
-
...handlers,
|
|
62
|
-
...(!!className && {
|
|
63
|
-
className
|
|
64
|
-
}),
|
|
65
|
-
...(typedDefaultSlotProps?.style && externalSlotProps?.style && {
|
|
66
|
-
style: {
|
|
67
|
-
...typedDefaultSlotProps.style,
|
|
68
|
-
...externalSlotProps.style
|
|
69
|
-
}
|
|
70
|
-
}),
|
|
71
|
-
...(typedDefaultSlotProps?.sx && externalSlotProps?.sx && {
|
|
72
|
-
sx: [...(Array.isArray(typedDefaultSlotProps.sx) ? typedDefaultSlotProps.sx : [typedDefaultSlotProps.sx]), ...(Array.isArray(externalSlotProps.sx) ? externalSlotProps.sx : [externalSlotProps.sx])]
|
|
73
|
-
})
|
|
74
|
-
};
|
|
75
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Removes event handlers from the given object.
|
|
3
|
-
* A field is considered an event handler if it is a function with a name beginning with `on`.
|
|
4
|
-
*
|
|
5
|
-
* @param object Object to remove event handlers from.
|
|
6
|
-
* @returns Object with event handlers removed.
|
|
7
|
-
*/
|
|
8
|
-
function omitEventHandlers(object) {
|
|
9
|
-
if (object === undefined) {
|
|
10
|
-
return {};
|
|
11
|
-
}
|
|
12
|
-
const result = {};
|
|
13
|
-
Object.keys(object).filter(prop => !(prop.match(/^on[A-Z]/) && typeof object[prop] === 'function')).forEach(prop => {
|
|
14
|
-
result[prop] = object[prop];
|
|
15
|
-
});
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
export default omitEventHandlers;
|
package/modern/utils/setRef.js
DELETED
package/modern/utils/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/modern/utils/useId.js
DELETED
package/modern/utils/useSlot.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import useForkRef from '@mui/utils/useForkRef';
|
|
4
|
-
import appendOwnerState from '@mui/utils/appendOwnerState';
|
|
5
|
-
import resolveComponentProps from '@mui/utils/resolveComponentProps';
|
|
6
|
-
import mergeSlotProps from '@mui/utils/mergeSlotProps';
|
|
7
|
-
/**
|
|
8
|
-
* An internal function to create a Material UI slot.
|
|
9
|
-
*
|
|
10
|
-
* This is an advanced version of Base UI `useSlotProps` because Material UI allows leaf component to be customized via `component` prop
|
|
11
|
-
* while Base UI does not need to support leaf component customization.
|
|
12
|
-
*
|
|
13
|
-
* @param {string} name: name of the slot
|
|
14
|
-
* @param {object} parameters
|
|
15
|
-
* @returns {[Slot, slotProps]} The slot's React component and the slot's props
|
|
16
|
-
*
|
|
17
|
-
* Note: the returned slot's props
|
|
18
|
-
* - will never contain `component` prop.
|
|
19
|
-
* - might contain `as` prop.
|
|
20
|
-
*/
|
|
21
|
-
export default function useSlot(
|
|
22
|
-
/**
|
|
23
|
-
* The slot's name. All Material UI components should have `root` slot.
|
|
24
|
-
*
|
|
25
|
-
* If the name is `root`, the logic behaves differently from other slots,
|
|
26
|
-
* e.g. the `externalForwardedProps` are spread to `root` slot but not other slots.
|
|
27
|
-
*/
|
|
28
|
-
name, parameters) {
|
|
29
|
-
const {
|
|
30
|
-
className,
|
|
31
|
-
elementType: initialElementType,
|
|
32
|
-
ownerState,
|
|
33
|
-
externalForwardedProps,
|
|
34
|
-
internalForwardedProps,
|
|
35
|
-
shouldForwardComponentProp = false,
|
|
36
|
-
...useSlotPropsParams
|
|
37
|
-
} = parameters;
|
|
38
|
-
const {
|
|
39
|
-
component: rootComponent,
|
|
40
|
-
slots = {
|
|
41
|
-
[name]: undefined
|
|
42
|
-
},
|
|
43
|
-
slotProps = {
|
|
44
|
-
[name]: undefined
|
|
45
|
-
},
|
|
46
|
-
...other
|
|
47
|
-
} = externalForwardedProps;
|
|
48
|
-
const elementType = slots[name] || initialElementType;
|
|
49
|
-
|
|
50
|
-
// `slotProps[name]` can be a callback that receives the component's ownerState.
|
|
51
|
-
// `resolvedComponentsProps` is always a plain object.
|
|
52
|
-
const resolvedComponentsProps = resolveComponentProps(slotProps[name], ownerState);
|
|
53
|
-
const {
|
|
54
|
-
props: {
|
|
55
|
-
component: slotComponent,
|
|
56
|
-
...mergedProps
|
|
57
|
-
},
|
|
58
|
-
internalRef
|
|
59
|
-
} = mergeSlotProps({
|
|
60
|
-
className,
|
|
61
|
-
...useSlotPropsParams,
|
|
62
|
-
externalForwardedProps: name === 'root' ? other : undefined,
|
|
63
|
-
externalSlotProps: resolvedComponentsProps
|
|
64
|
-
});
|
|
65
|
-
const ref = useForkRef(internalRef, resolvedComponentsProps?.ref, parameters.ref);
|
|
66
|
-
const LeafComponent = name === 'root' ? slotComponent || rootComponent : slotComponent;
|
|
67
|
-
const props = appendOwnerState(elementType, {
|
|
68
|
-
...(name === 'root' && !rootComponent && !slots[name] && internalForwardedProps),
|
|
69
|
-
...(name !== 'root' && !slots[name] && internalForwardedProps),
|
|
70
|
-
...mergedProps,
|
|
71
|
-
...(LeafComponent && !shouldForwardComponentProp && {
|
|
72
|
-
as: LeafComponent
|
|
73
|
-
}),
|
|
74
|
-
...(LeafComponent && shouldForwardComponentProp && {
|
|
75
|
-
component: LeafComponent
|
|
76
|
-
}),
|
|
77
|
-
ref
|
|
78
|
-
}, ownerState);
|
|
79
|
-
return [elementType, props];
|
|
80
|
-
}
|