@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
package/modern/Tooltip/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
2
|
-
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
3
|
-
export function getTooltipUtilityClass(slot) {
|
|
4
|
-
return generateUtilityClass('MuiTooltip', slot);
|
|
5
|
-
}
|
|
6
|
-
const tooltipClasses = generateUtilityClasses('MuiTooltip', ['popper', 'popperInteractive', 'popperArrow', 'popperClose', 'tooltip', 'tooltipArrow', 'touch', 'tooltipPlacementLeft', 'tooltipPlacementRight', 'tooltipPlacementTop', 'tooltipPlacementBottom', 'arrow']);
|
|
7
|
-
export default tooltipClasses;
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
|
-
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import { styled, internal_createExtendSxProp } from "../zero-styled/index.js";
|
|
8
|
-
import memoTheme from "../utils/memoTheme.js";
|
|
9
|
-
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
10
|
-
import capitalize from "../utils/capitalize.js";
|
|
11
|
-
import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.js";
|
|
12
|
-
import { getTypographyUtilityClass } from "./typographyClasses.js";
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
const v6Colors = {
|
|
15
|
-
primary: true,
|
|
16
|
-
secondary: true,
|
|
17
|
-
error: true,
|
|
18
|
-
info: true,
|
|
19
|
-
success: true,
|
|
20
|
-
warning: true,
|
|
21
|
-
textPrimary: true,
|
|
22
|
-
textSecondary: true,
|
|
23
|
-
textDisabled: true
|
|
24
|
-
};
|
|
25
|
-
const extendSxProp = internal_createExtendSxProp();
|
|
26
|
-
const useUtilityClasses = ownerState => {
|
|
27
|
-
const {
|
|
28
|
-
align,
|
|
29
|
-
gutterBottom,
|
|
30
|
-
noWrap,
|
|
31
|
-
paragraph,
|
|
32
|
-
variant,
|
|
33
|
-
classes
|
|
34
|
-
} = ownerState;
|
|
35
|
-
const slots = {
|
|
36
|
-
root: ['root', variant, ownerState.align !== 'inherit' && `align${capitalize(align)}`, gutterBottom && 'gutterBottom', noWrap && 'noWrap', paragraph && 'paragraph']
|
|
37
|
-
};
|
|
38
|
-
return composeClasses(slots, getTypographyUtilityClass, classes);
|
|
39
|
-
};
|
|
40
|
-
export const TypographyRoot = styled('span', {
|
|
41
|
-
name: 'MuiTypography',
|
|
42
|
-
slot: 'Root',
|
|
43
|
-
overridesResolver: (props, styles) => {
|
|
44
|
-
const {
|
|
45
|
-
ownerState
|
|
46
|
-
} = props;
|
|
47
|
-
return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== 'inherit' && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom, ownerState.paragraph && styles.paragraph];
|
|
48
|
-
}
|
|
49
|
-
})(memoTheme(({
|
|
50
|
-
theme
|
|
51
|
-
}) => ({
|
|
52
|
-
margin: 0,
|
|
53
|
-
variants: [{
|
|
54
|
-
props: {
|
|
55
|
-
variant: 'inherit'
|
|
56
|
-
},
|
|
57
|
-
style: {
|
|
58
|
-
// Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
|
|
59
|
-
font: 'inherit',
|
|
60
|
-
lineHeight: 'inherit',
|
|
61
|
-
letterSpacing: 'inherit'
|
|
62
|
-
}
|
|
63
|
-
}, ...Object.entries(theme.typography).filter(([variant, value]) => variant !== 'inherit' && value && typeof value === 'object').map(([variant, value]) => ({
|
|
64
|
-
props: {
|
|
65
|
-
variant
|
|
66
|
-
},
|
|
67
|
-
style: value
|
|
68
|
-
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
|
|
69
|
-
props: {
|
|
70
|
-
color
|
|
71
|
-
},
|
|
72
|
-
style: {
|
|
73
|
-
color: (theme.vars || theme).palette[color].main
|
|
74
|
-
}
|
|
75
|
-
})), ...Object.entries(theme.palette?.text || {}).filter(([, value]) => typeof value === 'string').map(([color]) => ({
|
|
76
|
-
props: {
|
|
77
|
-
color: `text${capitalize(color)}`
|
|
78
|
-
},
|
|
79
|
-
style: {
|
|
80
|
-
color: (theme.vars || theme).palette.text[color]
|
|
81
|
-
}
|
|
82
|
-
})), {
|
|
83
|
-
props: ({
|
|
84
|
-
ownerState
|
|
85
|
-
}) => ownerState.align !== 'inherit',
|
|
86
|
-
style: {
|
|
87
|
-
textAlign: 'var(--Typography-textAlign)'
|
|
88
|
-
}
|
|
89
|
-
}, {
|
|
90
|
-
props: ({
|
|
91
|
-
ownerState
|
|
92
|
-
}) => ownerState.noWrap,
|
|
93
|
-
style: {
|
|
94
|
-
overflow: 'hidden',
|
|
95
|
-
textOverflow: 'ellipsis',
|
|
96
|
-
whiteSpace: 'nowrap'
|
|
97
|
-
}
|
|
98
|
-
}, {
|
|
99
|
-
props: ({
|
|
100
|
-
ownerState
|
|
101
|
-
}) => ownerState.gutterBottom,
|
|
102
|
-
style: {
|
|
103
|
-
marginBottom: '0.35em'
|
|
104
|
-
}
|
|
105
|
-
}, {
|
|
106
|
-
props: ({
|
|
107
|
-
ownerState
|
|
108
|
-
}) => ownerState.paragraph,
|
|
109
|
-
style: {
|
|
110
|
-
marginBottom: 16
|
|
111
|
-
}
|
|
112
|
-
}]
|
|
113
|
-
})));
|
|
114
|
-
const defaultVariantMapping = {
|
|
115
|
-
h1: 'h1',
|
|
116
|
-
h2: 'h2',
|
|
117
|
-
h3: 'h3',
|
|
118
|
-
h4: 'h4',
|
|
119
|
-
h5: 'h5',
|
|
120
|
-
h6: 'h6',
|
|
121
|
-
subtitle1: 'h6',
|
|
122
|
-
subtitle2: 'h6',
|
|
123
|
-
body1: 'p',
|
|
124
|
-
body2: 'p',
|
|
125
|
-
inherit: 'p'
|
|
126
|
-
};
|
|
127
|
-
const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, ref) {
|
|
128
|
-
const {
|
|
129
|
-
color,
|
|
130
|
-
...themeProps
|
|
131
|
-
} = useDefaultProps({
|
|
132
|
-
props: inProps,
|
|
133
|
-
name: 'MuiTypography'
|
|
134
|
-
});
|
|
135
|
-
const isSxColor = !v6Colors[color];
|
|
136
|
-
// TODO: Remove `extendSxProp` in v7
|
|
137
|
-
const props = extendSxProp({
|
|
138
|
-
...themeProps,
|
|
139
|
-
...(isSxColor && {
|
|
140
|
-
color
|
|
141
|
-
})
|
|
142
|
-
});
|
|
143
|
-
const {
|
|
144
|
-
align = 'inherit',
|
|
145
|
-
className,
|
|
146
|
-
component,
|
|
147
|
-
gutterBottom = false,
|
|
148
|
-
noWrap = false,
|
|
149
|
-
paragraph = false,
|
|
150
|
-
variant = 'body1',
|
|
151
|
-
variantMapping = defaultVariantMapping,
|
|
152
|
-
...other
|
|
153
|
-
} = props;
|
|
154
|
-
const ownerState = {
|
|
155
|
-
...props,
|
|
156
|
-
align,
|
|
157
|
-
color,
|
|
158
|
-
className,
|
|
159
|
-
component,
|
|
160
|
-
gutterBottom,
|
|
161
|
-
noWrap,
|
|
162
|
-
paragraph,
|
|
163
|
-
variant,
|
|
164
|
-
variantMapping
|
|
165
|
-
};
|
|
166
|
-
const Component = component || (paragraph ? 'p' : variantMapping[variant] || defaultVariantMapping[variant]) || 'span';
|
|
167
|
-
const classes = useUtilityClasses(ownerState);
|
|
168
|
-
return /*#__PURE__*/_jsx(TypographyRoot, {
|
|
169
|
-
as: Component,
|
|
170
|
-
ref: ref,
|
|
171
|
-
className: clsx(classes.root, className),
|
|
172
|
-
...other,
|
|
173
|
-
ownerState: ownerState,
|
|
174
|
-
style: {
|
|
175
|
-
...(align !== 'inherit' && {
|
|
176
|
-
'--Typography-textAlign': align
|
|
177
|
-
}),
|
|
178
|
-
...other.style
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
});
|
|
182
|
-
process.env.NODE_ENV !== "production" ? Typography.propTypes /* remove-proptypes */ = {
|
|
183
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
184
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
185
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
186
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
187
|
-
/**
|
|
188
|
-
* Set the text-align on the component.
|
|
189
|
-
* @default 'inherit'
|
|
190
|
-
*/
|
|
191
|
-
align: PropTypes.oneOf(['center', 'inherit', 'justify', 'left', 'right']),
|
|
192
|
-
/**
|
|
193
|
-
* The content of the component.
|
|
194
|
-
*/
|
|
195
|
-
children: PropTypes.node,
|
|
196
|
-
/**
|
|
197
|
-
* Override or extend the styles applied to the component.
|
|
198
|
-
*/
|
|
199
|
-
classes: PropTypes.object,
|
|
200
|
-
/**
|
|
201
|
-
* @ignore
|
|
202
|
-
*/
|
|
203
|
-
className: PropTypes.string,
|
|
204
|
-
/**
|
|
205
|
-
* The color of the component.
|
|
206
|
-
* It supports both default and custom theme colors, which can be added as shown in the
|
|
207
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
208
|
-
*/
|
|
209
|
-
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['primary', 'secondary', 'success', 'error', 'info', 'warning', 'textPrimary', 'textSecondary', 'textDisabled']), PropTypes.string]),
|
|
210
|
-
/**
|
|
211
|
-
* The component used for the root node.
|
|
212
|
-
* Either a string to use a HTML element or a component.
|
|
213
|
-
*/
|
|
214
|
-
component: PropTypes.elementType,
|
|
215
|
-
/**
|
|
216
|
-
* If `true`, the text will have a bottom margin.
|
|
217
|
-
* @default false
|
|
218
|
-
*/
|
|
219
|
-
gutterBottom: PropTypes.bool,
|
|
220
|
-
/**
|
|
221
|
-
* If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
|
|
222
|
-
*
|
|
223
|
-
* Note that text overflow can only happen with block or inline-block level elements
|
|
224
|
-
* (the element needs to have a width in order to overflow).
|
|
225
|
-
* @default false
|
|
226
|
-
*/
|
|
227
|
-
noWrap: PropTypes.bool,
|
|
228
|
-
/**
|
|
229
|
-
* If `true`, the element will be a paragraph element.
|
|
230
|
-
* @default false
|
|
231
|
-
* @deprecated Use the `component` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
232
|
-
*/
|
|
233
|
-
paragraph: PropTypes.bool,
|
|
234
|
-
/**
|
|
235
|
-
* @ignore
|
|
236
|
-
*/
|
|
237
|
-
style: PropTypes.object,
|
|
238
|
-
/**
|
|
239
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
240
|
-
*/
|
|
241
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
242
|
-
/**
|
|
243
|
-
* Applies the theme typography styles.
|
|
244
|
-
* @default 'body1'
|
|
245
|
-
*/
|
|
246
|
-
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['body1', 'body2', 'button', 'caption', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'inherit', 'overline', 'subtitle1', 'subtitle2']), PropTypes.string]),
|
|
247
|
-
/**
|
|
248
|
-
* The component maps the variant prop to a range of different HTML element types.
|
|
249
|
-
* For instance, subtitle1 to `<h6>`.
|
|
250
|
-
* If you wish to change that mapping, you can provide your own.
|
|
251
|
-
* Alternatively, you can use the `component` prop.
|
|
252
|
-
* @default {
|
|
253
|
-
* h1: 'h1',
|
|
254
|
-
* h2: 'h2',
|
|
255
|
-
* h3: 'h3',
|
|
256
|
-
* h4: 'h4',
|
|
257
|
-
* h5: 'h5',
|
|
258
|
-
* h6: 'h6',
|
|
259
|
-
* subtitle1: 'h6',
|
|
260
|
-
* subtitle2: 'h6',
|
|
261
|
-
* body1: 'p',
|
|
262
|
-
* body2: 'p',
|
|
263
|
-
* inherit: 'p',
|
|
264
|
-
* }
|
|
265
|
-
*/
|
|
266
|
-
variantMapping: PropTypes /* @typescript-to-proptypes-ignore */.object
|
|
267
|
-
} : void 0;
|
|
268
|
-
export default Typography;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
2
|
-
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
3
|
-
export function getTypographyUtilityClass(slot) {
|
|
4
|
-
return generateUtilityClass('MuiTypography', slot);
|
|
5
|
-
}
|
|
6
|
-
const typographyClasses = generateUtilityClasses('MuiTypography', ['root', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'inherit', 'button', 'caption', 'overline', 'alignLeft', 'alignRight', 'alignCenter', 'alignJustify', 'noWrap', 'gutterBottom', 'paragraph']);
|
|
7
|
-
export default typographyClasses;
|
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex */
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
import { exactProp, elementAcceptingRef, unstable_useForkRef as useForkRef, unstable_ownerDocument as ownerDocument, unstable_getReactElementRef as getReactElementRef } from '@mui/utils';
|
|
7
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
// Inspired by https://github.com/focus-trap/tabbable
|
|
9
|
-
const candidatesSelector = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])'].join(',');
|
|
10
|
-
function getTabIndex(node) {
|
|
11
|
-
const tabindexAttr = parseInt(node.getAttribute('tabindex') || '', 10);
|
|
12
|
-
if (!Number.isNaN(tabindexAttr)) {
|
|
13
|
-
return tabindexAttr;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Browsers do not return `tabIndex` correctly for contentEditable nodes;
|
|
17
|
-
// https://issues.chromium.org/issues/41283952
|
|
18
|
-
// so if they don't have a tabindex attribute specifically set, assume it's 0.
|
|
19
|
-
// in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
|
|
20
|
-
// `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
|
|
21
|
-
// yet they are still part of the regular tab order; in FF, they get a default
|
|
22
|
-
// `tabIndex` of 0; since Chrome still puts those elements in the regular tab
|
|
23
|
-
// order, consider their tab index to be 0.
|
|
24
|
-
if (node.contentEditable === 'true' || (node.nodeName === 'AUDIO' || node.nodeName === 'VIDEO' || node.nodeName === 'DETAILS') && node.getAttribute('tabindex') === null) {
|
|
25
|
-
return 0;
|
|
26
|
-
}
|
|
27
|
-
return node.tabIndex;
|
|
28
|
-
}
|
|
29
|
-
function isNonTabbableRadio(node) {
|
|
30
|
-
if (node.tagName !== 'INPUT' || node.type !== 'radio') {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
if (!node.name) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
const getRadio = selector => node.ownerDocument.querySelector(`input[type="radio"]${selector}`);
|
|
37
|
-
let roving = getRadio(`[name="${node.name}"]:checked`);
|
|
38
|
-
if (!roving) {
|
|
39
|
-
roving = getRadio(`[name="${node.name}"]`);
|
|
40
|
-
}
|
|
41
|
-
return roving !== node;
|
|
42
|
-
}
|
|
43
|
-
function isNodeMatchingSelectorFocusable(node) {
|
|
44
|
-
if (node.disabled || node.tagName === 'INPUT' && node.type === 'hidden' || isNonTabbableRadio(node)) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
function defaultGetTabbable(root) {
|
|
50
|
-
const regularTabNodes = [];
|
|
51
|
-
const orderedTabNodes = [];
|
|
52
|
-
Array.from(root.querySelectorAll(candidatesSelector)).forEach((node, i) => {
|
|
53
|
-
const nodeTabIndex = getTabIndex(node);
|
|
54
|
-
if (nodeTabIndex === -1 || !isNodeMatchingSelectorFocusable(node)) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
if (nodeTabIndex === 0) {
|
|
58
|
-
regularTabNodes.push(node);
|
|
59
|
-
} else {
|
|
60
|
-
orderedTabNodes.push({
|
|
61
|
-
documentOrder: i,
|
|
62
|
-
tabIndex: nodeTabIndex,
|
|
63
|
-
node: node
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
return orderedTabNodes.sort((a, b) => a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex).map(a => a.node).concat(regularTabNodes);
|
|
68
|
-
}
|
|
69
|
-
function defaultIsEnabled() {
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* @ignore - internal component.
|
|
75
|
-
*/
|
|
76
|
-
function FocusTrap(props) {
|
|
77
|
-
const {
|
|
78
|
-
children,
|
|
79
|
-
disableAutoFocus = false,
|
|
80
|
-
disableEnforceFocus = false,
|
|
81
|
-
disableRestoreFocus = false,
|
|
82
|
-
getTabbable = defaultGetTabbable,
|
|
83
|
-
isEnabled = defaultIsEnabled,
|
|
84
|
-
open
|
|
85
|
-
} = props;
|
|
86
|
-
const ignoreNextEnforceFocus = React.useRef(false);
|
|
87
|
-
const sentinelStart = React.useRef(null);
|
|
88
|
-
const sentinelEnd = React.useRef(null);
|
|
89
|
-
const nodeToRestore = React.useRef(null);
|
|
90
|
-
const reactFocusEventTarget = React.useRef(null);
|
|
91
|
-
// This variable is useful when disableAutoFocus is true.
|
|
92
|
-
// It waits for the active element to move into the component to activate.
|
|
93
|
-
const activated = React.useRef(false);
|
|
94
|
-
const rootRef = React.useRef(null);
|
|
95
|
-
const handleRef = useForkRef(getReactElementRef(children), rootRef);
|
|
96
|
-
const lastKeydown = React.useRef(null);
|
|
97
|
-
React.useEffect(() => {
|
|
98
|
-
// We might render an empty child.
|
|
99
|
-
if (!open || !rootRef.current) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
activated.current = !disableAutoFocus;
|
|
103
|
-
}, [disableAutoFocus, open]);
|
|
104
|
-
React.useEffect(() => {
|
|
105
|
-
// We might render an empty child.
|
|
106
|
-
if (!open || !rootRef.current) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const doc = ownerDocument(rootRef.current);
|
|
110
|
-
if (!rootRef.current.contains(doc.activeElement)) {
|
|
111
|
-
if (!rootRef.current.hasAttribute('tabIndex')) {
|
|
112
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
113
|
-
console.error(['MUI: The modal content node does not accept focus.', 'For the benefit of assistive technologies, ' + 'the tabIndex of the node is being set to "-1".'].join('\n'));
|
|
114
|
-
}
|
|
115
|
-
rootRef.current.setAttribute('tabIndex', '-1');
|
|
116
|
-
}
|
|
117
|
-
if (activated.current) {
|
|
118
|
-
rootRef.current.focus();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return () => {
|
|
122
|
-
// restoreLastFocus()
|
|
123
|
-
if (!disableRestoreFocus) {
|
|
124
|
-
// In IE11 it is possible for document.activeElement to be null resulting
|
|
125
|
-
// in nodeToRestore.current being null.
|
|
126
|
-
// Not all elements in IE11 have a focus method.
|
|
127
|
-
// Once IE11 support is dropped the focus() call can be unconditional.
|
|
128
|
-
if (nodeToRestore.current && nodeToRestore.current.focus) {
|
|
129
|
-
ignoreNextEnforceFocus.current = true;
|
|
130
|
-
nodeToRestore.current.focus();
|
|
131
|
-
}
|
|
132
|
-
nodeToRestore.current = null;
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
// Missing `disableRestoreFocus` which is fine.
|
|
136
|
-
// We don't support changing that prop on an open FocusTrap
|
|
137
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
138
|
-
}, [open]);
|
|
139
|
-
React.useEffect(() => {
|
|
140
|
-
// We might render an empty child.
|
|
141
|
-
if (!open || !rootRef.current) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
const doc = ownerDocument(rootRef.current);
|
|
145
|
-
const loopFocus = nativeEvent => {
|
|
146
|
-
lastKeydown.current = nativeEvent;
|
|
147
|
-
if (disableEnforceFocus || !isEnabled() || nativeEvent.key !== 'Tab') {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Make sure the next tab starts from the right place.
|
|
152
|
-
// doc.activeElement refers to the origin.
|
|
153
|
-
if (doc.activeElement === rootRef.current && nativeEvent.shiftKey) {
|
|
154
|
-
// We need to ignore the next contain as
|
|
155
|
-
// it will try to move the focus back to the rootRef element.
|
|
156
|
-
ignoreNextEnforceFocus.current = true;
|
|
157
|
-
if (sentinelEnd.current) {
|
|
158
|
-
sentinelEnd.current.focus();
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
const contain = () => {
|
|
163
|
-
const rootElement = rootRef.current;
|
|
164
|
-
|
|
165
|
-
// Cleanup functions are executed lazily in React 17.
|
|
166
|
-
// Contain can be called between the component being unmounted and its cleanup function being run.
|
|
167
|
-
if (rootElement === null) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
if (!doc.hasFocus() || !isEnabled() || ignoreNextEnforceFocus.current) {
|
|
171
|
-
ignoreNextEnforceFocus.current = false;
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// The focus is already inside
|
|
176
|
-
if (rootElement.contains(doc.activeElement)) {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// The disableEnforceFocus is set and the focus is outside of the focus trap (and sentinel nodes)
|
|
181
|
-
if (disableEnforceFocus && doc.activeElement !== sentinelStart.current && doc.activeElement !== sentinelEnd.current) {
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// if the focus event is not coming from inside the children's react tree, reset the refs
|
|
186
|
-
if (doc.activeElement !== reactFocusEventTarget.current) {
|
|
187
|
-
reactFocusEventTarget.current = null;
|
|
188
|
-
} else if (reactFocusEventTarget.current !== null) {
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
if (!activated.current) {
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
let tabbable = [];
|
|
195
|
-
if (doc.activeElement === sentinelStart.current || doc.activeElement === sentinelEnd.current) {
|
|
196
|
-
tabbable = getTabbable(rootRef.current);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// one of the sentinel nodes was focused, so move the focus
|
|
200
|
-
// to the first/last tabbable element inside the focus trap
|
|
201
|
-
if (tabbable.length > 0) {
|
|
202
|
-
const isShiftTab = Boolean(lastKeydown.current?.shiftKey && lastKeydown.current?.key === 'Tab');
|
|
203
|
-
const focusNext = tabbable[0];
|
|
204
|
-
const focusPrevious = tabbable[tabbable.length - 1];
|
|
205
|
-
if (typeof focusNext !== 'string' && typeof focusPrevious !== 'string') {
|
|
206
|
-
if (isShiftTab) {
|
|
207
|
-
focusPrevious.focus();
|
|
208
|
-
} else {
|
|
209
|
-
focusNext.focus();
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
// no tabbable elements in the trap focus or the focus was outside of the focus trap
|
|
213
|
-
} else {
|
|
214
|
-
rootElement.focus();
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
doc.addEventListener('focusin', contain);
|
|
218
|
-
doc.addEventListener('keydown', loopFocus, true);
|
|
219
|
-
|
|
220
|
-
// With Edge, Safari and Firefox, no focus related events are fired when the focused area stops being a focused area.
|
|
221
|
-
// for example https://bugzilla.mozilla.org/show_bug.cgi?id=559561.
|
|
222
|
-
// Instead, we can look if the active element was restored on the BODY element.
|
|
223
|
-
//
|
|
224
|
-
// The whatwg spec defines how the browser should behave but does not explicitly mention any events:
|
|
225
|
-
// https://html.spec.whatwg.org/multipage/interaction.html#focus-fixup-rule.
|
|
226
|
-
const interval = setInterval(() => {
|
|
227
|
-
if (doc.activeElement && doc.activeElement.tagName === 'BODY') {
|
|
228
|
-
contain();
|
|
229
|
-
}
|
|
230
|
-
}, 50);
|
|
231
|
-
return () => {
|
|
232
|
-
clearInterval(interval);
|
|
233
|
-
doc.removeEventListener('focusin', contain);
|
|
234
|
-
doc.removeEventListener('keydown', loopFocus, true);
|
|
235
|
-
};
|
|
236
|
-
}, [disableAutoFocus, disableEnforceFocus, disableRestoreFocus, isEnabled, open, getTabbable]);
|
|
237
|
-
const onFocus = event => {
|
|
238
|
-
if (nodeToRestore.current === null) {
|
|
239
|
-
nodeToRestore.current = event.relatedTarget;
|
|
240
|
-
}
|
|
241
|
-
activated.current = true;
|
|
242
|
-
reactFocusEventTarget.current = event.target;
|
|
243
|
-
const childrenPropsHandler = children.props.onFocus;
|
|
244
|
-
if (childrenPropsHandler) {
|
|
245
|
-
childrenPropsHandler(event);
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
const handleFocusSentinel = event => {
|
|
249
|
-
if (nodeToRestore.current === null) {
|
|
250
|
-
nodeToRestore.current = event.relatedTarget;
|
|
251
|
-
}
|
|
252
|
-
activated.current = true;
|
|
253
|
-
};
|
|
254
|
-
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
255
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
256
|
-
tabIndex: open ? 0 : -1,
|
|
257
|
-
onFocus: handleFocusSentinel,
|
|
258
|
-
ref: sentinelStart,
|
|
259
|
-
"data-testid": "sentinelStart"
|
|
260
|
-
}), /*#__PURE__*/React.cloneElement(children, {
|
|
261
|
-
ref: handleRef,
|
|
262
|
-
onFocus
|
|
263
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
264
|
-
tabIndex: open ? 0 : -1,
|
|
265
|
-
onFocus: handleFocusSentinel,
|
|
266
|
-
ref: sentinelEnd,
|
|
267
|
-
"data-testid": "sentinelEnd"
|
|
268
|
-
})]
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
process.env.NODE_ENV !== "production" ? FocusTrap.propTypes /* remove-proptypes */ = {
|
|
272
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
273
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
274
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
275
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
276
|
-
/**
|
|
277
|
-
* A single child content element.
|
|
278
|
-
*/
|
|
279
|
-
children: elementAcceptingRef,
|
|
280
|
-
/**
|
|
281
|
-
* If `true`, the focus trap will not automatically shift focus to itself when it opens, and
|
|
282
|
-
* replace it to the last focused element when it closes.
|
|
283
|
-
* This also works correctly with any focus trap children that have the `disableAutoFocus` prop.
|
|
284
|
-
*
|
|
285
|
-
* Generally this should never be set to `true` as it makes the focus trap less
|
|
286
|
-
* accessible to assistive technologies, like screen readers.
|
|
287
|
-
* @default false
|
|
288
|
-
*/
|
|
289
|
-
disableAutoFocus: PropTypes.bool,
|
|
290
|
-
/**
|
|
291
|
-
* If `true`, the focus trap will not prevent focus from leaving the focus trap while open.
|
|
292
|
-
*
|
|
293
|
-
* Generally this should never be set to `true` as it makes the focus trap less
|
|
294
|
-
* accessible to assistive technologies, like screen readers.
|
|
295
|
-
* @default false
|
|
296
|
-
*/
|
|
297
|
-
disableEnforceFocus: PropTypes.bool,
|
|
298
|
-
/**
|
|
299
|
-
* If `true`, the focus trap will not restore focus to previously focused element once
|
|
300
|
-
* focus trap is hidden or unmounted.
|
|
301
|
-
* @default false
|
|
302
|
-
*/
|
|
303
|
-
disableRestoreFocus: PropTypes.bool,
|
|
304
|
-
/**
|
|
305
|
-
* Returns an array of ordered tabbable nodes (i.e. in tab order) within the root.
|
|
306
|
-
* For instance, you can provide the "tabbable" npm dependency.
|
|
307
|
-
* @param {HTMLElement} root
|
|
308
|
-
*/
|
|
309
|
-
getTabbable: PropTypes.func,
|
|
310
|
-
/**
|
|
311
|
-
* This prop extends the `open` prop.
|
|
312
|
-
* It allows to toggle the open state without having to wait for a rerender when changing the `open` prop.
|
|
313
|
-
* This prop should be memoized.
|
|
314
|
-
* It can be used to support multiple focus trap mounted at the same time.
|
|
315
|
-
* @default function defaultIsEnabled(): boolean {
|
|
316
|
-
* return true;
|
|
317
|
-
* }
|
|
318
|
-
*/
|
|
319
|
-
isEnabled: PropTypes.func,
|
|
320
|
-
/**
|
|
321
|
-
* If `true`, focus is locked.
|
|
322
|
-
*/
|
|
323
|
-
open: PropTypes.bool.isRequired
|
|
324
|
-
} : void 0;
|
|
325
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
326
|
-
// eslint-disable-next-line
|
|
327
|
-
FocusTrap['propTypes' + ''] = exactProp(FocusTrap.propTypes);
|
|
328
|
-
}
|
|
329
|
-
export default FocusTrap;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./FocusTrap.js";
|