@mui/material 6.0.0-alpha.7 → 6.0.0-alpha.9
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.js +33 -33
- package/AccordionActions/AccordionActions.d.ts +1 -1
- package/AccordionActions/AccordionActions.js +11 -12
- package/AccordionDetails/AccordionDetails.d.ts +1 -1
- package/AccordionDetails/AccordionDetails.js +7 -9
- package/AccordionSummary/AccordionSummary.js +14 -16
- package/Alert/Alert.d.ts +1 -1
- package/Alert/Alert.js +56 -51
- package/AlertTitle/AlertTitle.d.ts +3 -3
- package/AlertTitle/AlertTitle.js +7 -9
- package/AppBar/AppBar.js +34 -32
- package/Autocomplete/Autocomplete.d.ts +1 -1
- package/Autocomplete/Autocomplete.js +164 -136
- package/Avatar/Avatar.js +44 -36
- package/AvatarGroup/AvatarGroup.d.ts +51 -18
- package/AvatarGroup/AvatarGroup.js +60 -41
- package/Backdrop/Backdrop.js +33 -30
- package/Badge/Badge.js +31 -30
- package/BottomNavigation/BottomNavigation.js +15 -17
- package/BottomNavigationAction/BottomNavigationAction.js +15 -18
- package/Breadcrumbs/BreadcrumbCollapsed.js +35 -34
- package/Breadcrumbs/Breadcrumbs.js +19 -21
- package/Button/Button.d.ts +1 -1
- package/Button/Button.js +32 -29
- package/ButtonBase/ButtonBase.d.ts +1 -1
- package/ButtonBase/ButtonBase.js +43 -42
- package/ButtonBase/TouchRipple.js +9 -12
- package/ButtonGroup/ButtonGroup.js +23 -25
- package/CHANGELOG.md +113 -2
- package/Card/Card.js +11 -12
- package/CardActionArea/CardActionArea.js +9 -12
- package/CardActions/CardActions.d.ts +1 -1
- package/CardActions/CardActions.js +11 -12
- package/CardContent/CardContent.js +11 -12
- package/CardHeader/CardHeader.d.ts +1 -1
- package/CardHeader/CardHeader.js +30 -31
- package/CardMedia/CardMedia.js +19 -20
- package/Checkbox/Checkbox.d.ts +1 -1
- package/Checkbox/Checkbox.js +29 -26
- package/Chip/Chip.d.ts +3 -3
- package/Chip/Chip.js +38 -37
- package/CircularProgress/CircularProgress.d.ts +1 -1
- package/CircularProgress/CircularProgress.js +24 -23
- package/Collapse/Collapse.d.ts +1 -1
- package/Collapse/Collapse.js +44 -42
- package/CssBaseline/CssBaseline.d.ts +1 -1
- package/CssBaseline/CssBaseline.js +17 -14
- package/Dialog/Dialog.d.ts +1 -1
- package/Dialog/Dialog.js +41 -42
- package/DialogActions/DialogActions.d.ts +1 -1
- package/DialogActions/DialogActions.js +11 -12
- package/DialogContent/DialogContent.d.ts +1 -1
- package/DialogContent/DialogContent.js +11 -12
- package/DialogContentText/DialogContentText.js +13 -11
- package/DialogTitle/DialogTitle.js +8 -10
- package/Divider/Divider.js +19 -21
- package/Drawer/Drawer.d.ts +1 -1
- package/Drawer/Drawer.js +50 -49
- package/Fab/Fab.js +26 -23
- package/Fade/Fade.d.ts +1 -1
- package/Fade/Fade.js +31 -30
- package/FilledInput/FilledInput.d.ts +1 -1
- package/FilledInput/FilledInput.js +48 -44
- package/FilledInput/filledInputClasses.js +4 -2
- package/FormControl/FormControl.js +27 -25
- package/FormControlLabel/FormControlLabel.d.ts +1 -1
- package/FormControlLabel/FormControlLabel.js +32 -26
- package/FormGroup/FormGroup.d.ts +1 -1
- package/FormGroup/FormGroup.js +11 -12
- package/FormHelperText/FormHelperText.js +26 -18
- package/FormLabel/FormLabel.js +27 -19
- package/GlobalStyles/GlobalStyles.d.ts +1 -1
- package/GlobalStyles/GlobalStyles.js +3 -3
- package/Grid/Grid.d.ts +1 -0
- package/Grid/Grid.js +50 -41
- package/Grow/Grow.d.ts +1 -1
- package/Grow/Grow.js +31 -30
- package/Hidden/Hidden.d.ts +2 -0
- package/Hidden/Hidden.js +23 -22
- package/Hidden/HiddenCss.js +29 -29
- package/Hidden/withWidth.js +19 -19
- package/Icon/Icon.js +15 -16
- package/IconButton/IconButton.js +18 -20
- package/ImageList/ImageList.js +24 -24
- package/ImageListItem/ImageListItem.js +19 -20
- package/ImageListItemBar/ImageListItemBar.d.ts +1 -1
- package/ImageListItemBar/ImageListItemBar.js +15 -17
- package/Input/Input.d.ts +1 -1
- package/Input/Input.js +21 -20
- package/Input/inputClasses.js +4 -2
- package/InputAdornment/InputAdornment.js +16 -18
- package/InputBase/InputBase.d.ts +1 -1
- package/InputBase/InputBase.js +90 -73
- package/InputLabel/InputLabel.js +20 -16
- package/LinearProgress/LinearProgress.d.ts +1 -1
- package/LinearProgress/LinearProgress.js +21 -23
- package/Link/Link.js +27 -26
- package/List/List.js +15 -17
- package/ListItem/ListItem.d.ts +4 -12
- package/ListItem/ListItem.js +64 -63
- package/ListItemAvatar/ListItemAvatar.d.ts +1 -1
- package/ListItemAvatar/ListItemAvatar.js +10 -11
- package/ListItemButton/ListItemButton.js +23 -22
- package/ListItemIcon/ListItemIcon.d.ts +1 -1
- package/ListItemIcon/ListItemIcon.js +10 -11
- package/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +5 -1
- package/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -11
- package/ListItemText/ListItemText.d.ts +3 -1
- package/ListItemText/ListItemText.js +25 -27
- package/ListSubheader/ListSubheader.js +15 -16
- package/Menu/Menu.d.ts +1 -1
- package/Menu/Menu.js +34 -36
- package/MenuItem/MenuItem.js +28 -26
- package/MenuList/MenuList.js +17 -20
- package/MobileStepper/MobileStepper.d.ts +1 -1
- package/MobileStepper/MobileStepper.js +21 -22
- package/Modal/Modal.d.ts +1 -1
- package/Modal/Modal.js +47 -38
- package/NativeSelect/NativeSelect.d.ts +1 -1
- package/NativeSelect/NativeSelect.js +26 -22
- package/NativeSelect/NativeSelectInput.js +15 -16
- package/OutlinedInput/NotchedOutline.js +14 -14
- package/OutlinedInput/OutlinedInput.d.ts +3 -1
- package/OutlinedInput/OutlinedInput.js +46 -42
- package/OutlinedInput/outlinedInputClasses.js +4 -2
- package/OverridableComponent.d.ts +2 -2
- package/Pagination/Pagination.d.ts +1 -1
- package/Pagination/Pagination.js +36 -32
- package/PaginationItem/PaginationItem.js +31 -30
- package/Paper/Paper.js +26 -23
- package/Popover/Popover.d.ts +1 -1
- package/Popover/Popover.js +71 -71
- package/Popper/Popper.d.ts +4 -0
- package/Popper/Popper.js +29 -27
- package/Radio/Radio.d.ts +1 -1
- package/Radio/Radio.js +24 -22
- package/Radio/RadioButtonIcon.js +3 -3
- package/RadioGroup/RadioGroup.d.ts +1 -1
- package/RadioGroup/RadioGroup.js +15 -18
- package/Rating/Rating.d.ts +1 -1
- package/Rating/Rating.js +54 -47
- package/ScopedCssBaseline/ScopedCssBaseline.js +18 -15
- package/Select/Select.d.ts +1 -1
- package/Select/Select.js +63 -57
- package/Select/SelectInput.js +64 -59
- package/Skeleton/Skeleton.js +20 -21
- package/Slide/Slide.d.ts +1 -1
- package/Slide/Slide.js +37 -33
- package/Slider/Slider.d.ts +1 -1
- package/Slider/Slider.js +155 -106
- package/Slider/SliderValueLabel.types.d.ts +1 -1
- package/Snackbar/Snackbar.d.ts +1 -1
- package/Snackbar/Snackbar.js +52 -45
- package/SnackbarContent/SnackbarContent.d.ts +1 -1
- package/SnackbarContent/SnackbarContent.js +13 -15
- package/SpeedDial/SpeedDial.d.ts +1 -1
- package/SpeedDial/SpeedDial.js +59 -60
- package/SpeedDialAction/SpeedDialAction.d.ts +1 -1
- package/SpeedDialAction/SpeedDialAction.js +34 -33
- package/SpeedDialIcon/SpeedDialIcon.d.ts +3 -1
- package/SpeedDialIcon/SpeedDialIcon.js +10 -12
- package/Step/Step.js +18 -20
- package/StepButton/StepButton.js +16 -17
- package/StepConnector/StepConnector.d.ts +2 -2
- package/StepConnector/StepConnector.js +10 -12
- package/StepContent/StepContent.d.ts +1 -1
- package/StepContent/StepContent.js +18 -20
- package/StepIcon/StepIcon.d.ts +1 -1
- package/StepIcon/StepIcon.js +22 -22
- package/StepLabel/StepLabel.d.ts +1 -1
- package/StepLabel/StepLabel.js +33 -30
- package/Stepper/Stepper.js +21 -22
- package/SvgIcon/SvgIcon.js +21 -21
- package/SwipeableDrawer/SwipeArea.js +15 -16
- package/SwipeableDrawer/SwipeableDrawer.js +49 -43
- package/Switch/Switch.d.ts +1 -1
- package/Switch/Switch.js +23 -20
- package/Tab/Tab.d.ts +1 -1
- package/Tab/Tab.js +32 -33
- package/TabScrollButton/TabScrollButton.d.ts +1 -1
- package/TabScrollButton/TabScrollButton.js +27 -21
- package/Table/Table.js +17 -17
- package/TableBody/TableBody.js +11 -12
- package/TableCell/TableCell.d.ts +1 -1
- package/TableCell/TableCell.js +19 -19
- package/TableContainer/TableContainer.js +11 -12
- package/TableFooter/TableFooter.js +11 -12
- package/TableHead/TableHead.js +11 -12
- package/TablePagination/TablePagination.js +56 -52
- package/TablePagination/TablePaginationActions.js +51 -38
- package/TableRow/TableRow.js +13 -14
- package/TableSortLabel/TableSortLabel.js +15 -17
- package/Tabs/ScrollbarSize.js +7 -9
- package/Tabs/Tabs.js +52 -49
- package/TextField/TextField.d.ts +59 -4
- package/TextField/TextField.js +137 -67
- package/ToggleButton/ToggleButton.js +30 -32
- package/ToggleButtonGroup/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButtonGroup/ToggleButtonGroup.js +19 -21
- package/Toolbar/Toolbar.js +13 -14
- package/Tooltip/Tooltip.d.ts +3 -5
- package/Tooltip/Tooltip.js +77 -64
- package/Typography/Typography.js +37 -35
- package/Zoom/Zoom.d.ts +1 -1
- package/Zoom/Zoom.js +31 -30
- package/index.js +1 -1
- package/internal/SwitchBase.js +37 -37
- package/locale/index.d.ts +1 -0
- package/locale/index.js +74 -1
- package/modern/Accordion/Accordion.js +33 -33
- package/modern/AccordionActions/AccordionActions.js +11 -12
- package/modern/AccordionDetails/AccordionDetails.js +7 -9
- package/modern/AccordionSummary/AccordionSummary.js +14 -16
- package/modern/Alert/Alert.js +56 -51
- package/modern/AlertTitle/AlertTitle.js +7 -9
- package/modern/AppBar/AppBar.js +34 -32
- package/modern/Autocomplete/Autocomplete.js +164 -136
- package/modern/Avatar/Avatar.js +44 -36
- package/modern/AvatarGroup/AvatarGroup.js +60 -41
- package/modern/Backdrop/Backdrop.js +33 -30
- package/modern/Badge/Badge.js +31 -30
- package/modern/BottomNavigation/BottomNavigation.js +15 -17
- package/modern/BottomNavigationAction/BottomNavigationAction.js +15 -18
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +35 -34
- package/modern/Breadcrumbs/Breadcrumbs.js +19 -21
- package/modern/Button/Button.js +32 -29
- package/modern/ButtonBase/ButtonBase.js +43 -42
- package/modern/ButtonBase/TouchRipple.js +9 -12
- package/modern/ButtonGroup/ButtonGroup.js +23 -25
- package/modern/Card/Card.js +11 -12
- package/modern/CardActionArea/CardActionArea.js +9 -12
- package/modern/CardActions/CardActions.js +11 -12
- package/modern/CardContent/CardContent.js +11 -12
- package/modern/CardHeader/CardHeader.js +30 -31
- package/modern/CardMedia/CardMedia.js +19 -20
- package/modern/Checkbox/Checkbox.js +29 -26
- package/modern/Chip/Chip.js +38 -37
- package/modern/CircularProgress/CircularProgress.js +24 -23
- package/modern/Collapse/Collapse.js +44 -42
- package/modern/CssBaseline/CssBaseline.js +17 -14
- package/modern/Dialog/Dialog.js +41 -42
- package/modern/DialogActions/DialogActions.js +11 -12
- package/modern/DialogContent/DialogContent.js +11 -12
- package/modern/DialogContentText/DialogContentText.js +13 -11
- package/modern/DialogTitle/DialogTitle.js +8 -10
- package/modern/Divider/Divider.js +19 -21
- package/modern/Drawer/Drawer.js +50 -49
- package/modern/Fab/Fab.js +26 -23
- package/modern/Fade/Fade.js +31 -30
- package/modern/FilledInput/FilledInput.js +48 -44
- package/modern/FilledInput/filledInputClasses.js +4 -2
- package/modern/FormControl/FormControl.js +27 -25
- package/modern/FormControlLabel/FormControlLabel.js +32 -26
- package/modern/FormGroup/FormGroup.js +11 -12
- package/modern/FormHelperText/FormHelperText.js +26 -18
- package/modern/FormLabel/FormLabel.js +27 -19
- package/modern/GlobalStyles/GlobalStyles.js +3 -3
- package/modern/Grid/Grid.js +50 -41
- package/modern/Grow/Grow.js +31 -30
- package/modern/Hidden/Hidden.js +23 -22
- package/modern/Hidden/HiddenCss.js +29 -29
- package/modern/Hidden/withWidth.js +19 -19
- package/modern/Icon/Icon.js +15 -16
- package/modern/IconButton/IconButton.js +18 -20
- package/modern/ImageList/ImageList.js +24 -24
- package/modern/ImageListItem/ImageListItem.js +19 -20
- package/modern/ImageListItemBar/ImageListItemBar.js +15 -17
- package/modern/Input/Input.js +21 -20
- package/modern/Input/inputClasses.js +4 -2
- package/modern/InputAdornment/InputAdornment.js +16 -18
- package/modern/InputBase/InputBase.js +90 -73
- package/modern/InputLabel/InputLabel.js +20 -16
- package/modern/LinearProgress/LinearProgress.js +21 -23
- package/modern/Link/Link.js +27 -26
- package/modern/List/List.js +15 -17
- package/modern/ListItem/ListItem.js +64 -63
- package/modern/ListItemAvatar/ListItemAvatar.js +10 -11
- package/modern/ListItemButton/ListItemButton.js +23 -22
- package/modern/ListItemIcon/ListItemIcon.js +10 -11
- package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -11
- package/modern/ListItemText/ListItemText.js +25 -27
- package/modern/ListSubheader/ListSubheader.js +15 -16
- package/modern/Menu/Menu.js +34 -36
- package/modern/MenuItem/MenuItem.js +28 -26
- package/modern/MenuList/MenuList.js +17 -20
- package/modern/MobileStepper/MobileStepper.js +21 -22
- package/modern/Modal/Modal.js +47 -38
- package/modern/NativeSelect/NativeSelect.js +26 -22
- package/modern/NativeSelect/NativeSelectInput.js +15 -16
- package/modern/OutlinedInput/NotchedOutline.js +14 -14
- package/modern/OutlinedInput/OutlinedInput.js +46 -42
- package/modern/OutlinedInput/outlinedInputClasses.js +4 -2
- package/modern/Pagination/Pagination.js +36 -32
- package/modern/PaginationItem/PaginationItem.js +31 -30
- package/modern/Paper/Paper.js +26 -23
- package/modern/Popover/Popover.js +71 -71
- package/modern/Popper/Popper.js +29 -27
- package/modern/Radio/Radio.js +24 -22
- package/modern/Radio/RadioButtonIcon.js +3 -3
- package/modern/RadioGroup/RadioGroup.js +15 -18
- package/modern/Rating/Rating.js +54 -47
- package/modern/ScopedCssBaseline/ScopedCssBaseline.js +18 -15
- package/modern/Select/Select.js +63 -57
- package/modern/Select/SelectInput.js +64 -59
- package/modern/Skeleton/Skeleton.js +20 -21
- package/modern/Slide/Slide.js +37 -33
- package/modern/Slider/Slider.js +155 -106
- package/modern/Snackbar/Snackbar.js +52 -45
- package/modern/SnackbarContent/SnackbarContent.js +13 -15
- package/modern/SpeedDial/SpeedDial.js +59 -60
- package/modern/SpeedDialAction/SpeedDialAction.js +34 -33
- package/modern/SpeedDialIcon/SpeedDialIcon.js +10 -12
- package/modern/Step/Step.js +18 -20
- package/modern/StepButton/StepButton.js +16 -17
- package/modern/StepConnector/StepConnector.js +10 -12
- package/modern/StepContent/StepContent.js +18 -20
- package/modern/StepIcon/StepIcon.js +22 -22
- package/modern/StepLabel/StepLabel.js +33 -30
- package/modern/Stepper/Stepper.js +21 -22
- package/modern/SvgIcon/SvgIcon.js +21 -21
- package/modern/SwipeableDrawer/SwipeArea.js +15 -16
- package/modern/SwipeableDrawer/SwipeableDrawer.js +49 -43
- package/modern/Switch/Switch.js +23 -20
- package/modern/Tab/Tab.js +32 -33
- package/modern/TabScrollButton/TabScrollButton.js +27 -21
- package/modern/Table/Table.js +17 -17
- package/modern/TableBody/TableBody.js +11 -12
- package/modern/TableCell/TableCell.js +19 -19
- package/modern/TableContainer/TableContainer.js +11 -12
- package/modern/TableFooter/TableFooter.js +11 -12
- package/modern/TableHead/TableHead.js +11 -12
- package/modern/TablePagination/TablePagination.js +56 -52
- package/modern/TablePagination/TablePaginationActions.js +51 -38
- package/modern/TableRow/TableRow.js +13 -14
- package/modern/TableSortLabel/TableSortLabel.js +15 -17
- package/modern/Tabs/ScrollbarSize.js +7 -9
- package/modern/Tabs/Tabs.js +52 -49
- package/modern/TextField/TextField.js +137 -67
- package/modern/ToggleButton/ToggleButton.js +30 -32
- package/modern/ToggleButtonGroup/ToggleButtonGroup.js +19 -21
- package/modern/Toolbar/Toolbar.js +13 -14
- package/modern/Tooltip/Tooltip.js +77 -64
- package/modern/Typography/Typography.js +37 -35
- package/modern/Zoom/Zoom.js +31 -30
- package/modern/index.js +1 -1
- package/modern/internal/SwitchBase.js +37 -37
- package/modern/locale/index.js +74 -1
- package/modern/styles/CssVarsProvider.js +20 -9
- package/modern/styles/ThemeProvider.js +7 -10
- package/modern/styles/adaptV4Theme.js +31 -31
- package/modern/styles/createMixins.js +4 -4
- package/modern/styles/createPalette.js +16 -13
- package/modern/styles/createTheme.js +16 -11
- package/modern/styles/createTransitions.js +17 -14
- package/modern/styles/createTypography.js +31 -29
- package/modern/styles/experimental_extendTheme.js +8 -344
- package/modern/styles/extendTheme.js +355 -0
- package/modern/styles/index.js +2 -1
- package/modern/styles/responsiveFontSizes.js +20 -11
- package/modern/usePagination/usePagination.js +18 -20
- package/modern/useScrollTrigger/useScrollTrigger.js +8 -10
- package/modern/utils/createSvgIcon.js +4 -5
- package/modern/utils/useSlot.js +41 -40
- package/node/Accordion/Accordion.js +33 -33
- package/node/AccordionActions/AccordionActions.js +11 -12
- package/node/AccordionDetails/AccordionDetails.js +7 -9
- package/node/AccordionSummary/AccordionSummary.js +14 -16
- package/node/Alert/Alert.js +56 -51
- package/node/AlertTitle/AlertTitle.js +7 -9
- package/node/AppBar/AppBar.js +125 -129
- package/node/Autocomplete/Autocomplete.js +165 -137
- package/node/Avatar/Avatar.js +44 -36
- package/node/AvatarGroup/AvatarGroup.js +60 -41
- package/node/Backdrop/Backdrop.js +33 -30
- package/node/Badge/Badge.js +179 -184
- package/node/BottomNavigation/BottomNavigation.js +15 -17
- package/node/BottomNavigationAction/BottomNavigationAction.js +15 -18
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +35 -34
- package/node/Breadcrumbs/Breadcrumbs.js +19 -21
- package/node/Button/Button.js +32 -29
- package/node/ButtonBase/ButtonBase.js +43 -42
- package/node/ButtonBase/TouchRipple.js +9 -12
- package/node/ButtonGroup/ButtonGroup.js +23 -25
- package/node/Card/Card.js +11 -12
- package/node/CardActionArea/CardActionArea.js +9 -12
- package/node/CardActions/CardActions.js +11 -12
- package/node/CardContent/CardContent.js +11 -12
- package/node/CardHeader/CardHeader.js +30 -31
- package/node/CardMedia/CardMedia.js +19 -20
- package/node/Checkbox/Checkbox.js +29 -26
- package/node/Chip/Chip.js +38 -37
- package/node/CircularProgress/CircularProgress.js +24 -23
- package/node/Collapse/Collapse.js +44 -42
- package/node/CssBaseline/CssBaseline.js +17 -14
- package/node/Dialog/Dialog.js +41 -42
- package/node/DialogActions/DialogActions.js +11 -12
- package/node/DialogContent/DialogContent.js +11 -12
- package/node/DialogContentText/DialogContentText.js +13 -11
- package/node/DialogTitle/DialogTitle.js +8 -10
- package/node/Divider/Divider.js +19 -21
- package/node/Drawer/Drawer.js +50 -49
- package/node/Fab/Fab.js +27 -24
- package/node/Fade/Fade.js +31 -30
- package/node/FilledInput/FilledInput.js +48 -44
- package/node/FilledInput/filledInputClasses.js +4 -2
- package/node/FormControl/FormControl.js +27 -25
- package/node/FormControlLabel/FormControlLabel.js +32 -26
- package/node/FormGroup/FormGroup.js +11 -12
- package/node/FormHelperText/FormHelperText.js +26 -18
- package/node/FormLabel/FormLabel.js +27 -19
- package/node/GlobalStyles/GlobalStyles.js +3 -3
- package/node/Grid/Grid.js +50 -41
- package/node/Grow/Grow.js +31 -30
- package/node/Hidden/Hidden.js +26 -26
- package/node/Hidden/HiddenCss.js +29 -29
- package/node/Hidden/withWidth.js +19 -19
- package/node/Icon/Icon.js +15 -16
- package/node/IconButton/IconButton.js +18 -20
- package/node/ImageList/ImageList.js +24 -24
- package/node/ImageListItem/ImageListItem.js +19 -20
- package/node/ImageListItemBar/ImageListItemBar.js +15 -17
- package/node/Input/Input.js +21 -20
- package/node/Input/inputClasses.js +4 -2
- package/node/InputAdornment/InputAdornment.js +16 -18
- package/node/InputBase/InputBase.js +90 -73
- package/node/InputLabel/InputLabel.js +20 -16
- package/node/LinearProgress/LinearProgress.js +21 -23
- package/node/Link/Link.js +27 -26
- package/node/List/List.js +15 -17
- package/node/ListItem/ListItem.js +64 -63
- package/node/ListItemAvatar/ListItemAvatar.js +10 -11
- package/node/ListItemButton/ListItemButton.js +23 -22
- package/node/ListItemIcon/ListItemIcon.js +10 -11
- package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -11
- package/node/ListItemText/ListItemText.js +25 -27
- package/node/ListSubheader/ListSubheader.js +15 -16
- package/node/Menu/Menu.js +34 -36
- package/node/MenuItem/MenuItem.js +28 -26
- package/node/MenuList/MenuList.js +17 -20
- package/node/MobileStepper/MobileStepper.js +21 -22
- package/node/Modal/Modal.js +47 -38
- package/node/NativeSelect/NativeSelect.js +26 -22
- package/node/NativeSelect/NativeSelectInput.js +15 -16
- package/node/OutlinedInput/NotchedOutline.js +14 -14
- package/node/OutlinedInput/OutlinedInput.js +46 -42
- package/node/OutlinedInput/outlinedInputClasses.js +4 -2
- package/node/Pagination/Pagination.js +36 -32
- package/node/PaginationItem/PaginationItem.js +31 -30
- package/node/Paper/Paper.js +26 -23
- package/node/Popover/Popover.js +71 -71
- package/node/Popper/Popper.js +29 -27
- package/node/Radio/Radio.js +24 -22
- package/node/Radio/RadioButtonIcon.js +3 -3
- package/node/RadioGroup/RadioGroup.js +15 -18
- package/node/Rating/Rating.js +54 -47
- package/node/ScopedCssBaseline/ScopedCssBaseline.js +18 -15
- package/node/Select/Select.js +63 -57
- package/node/Select/SelectInput.js +64 -59
- package/node/Skeleton/Skeleton.js +20 -21
- package/node/Slide/Slide.js +39 -34
- package/node/Slider/Slider.js +299 -266
- package/node/Snackbar/Snackbar.js +52 -45
- package/node/SnackbarContent/SnackbarContent.js +13 -15
- package/node/SpeedDial/SpeedDial.js +59 -60
- package/node/SpeedDialAction/SpeedDialAction.js +34 -33
- package/node/SpeedDialIcon/SpeedDialIcon.js +10 -12
- package/node/Step/Step.js +18 -20
- package/node/StepButton/StepButton.js +16 -17
- package/node/StepConnector/StepConnector.js +10 -12
- package/node/StepContent/StepContent.js +18 -20
- package/node/StepIcon/StepIcon.js +22 -22
- package/node/StepLabel/StepLabel.js +33 -30
- package/node/Stepper/Stepper.js +21 -22
- package/node/SvgIcon/SvgIcon.js +21 -21
- package/node/SwipeableDrawer/SwipeArea.js +15 -16
- package/node/SwipeableDrawer/SwipeableDrawer.js +51 -44
- package/node/Switch/Switch.js +23 -20
- package/node/Tab/Tab.js +32 -33
- package/node/TabScrollButton/TabScrollButton.js +27 -21
- package/node/Table/Table.js +17 -17
- package/node/TableBody/TableBody.js +11 -12
- package/node/TableCell/TableCell.js +19 -19
- package/node/TableContainer/TableContainer.js +11 -12
- package/node/TableFooter/TableFooter.js +11 -12
- package/node/TableHead/TableHead.js +11 -12
- package/node/TablePagination/TablePagination.js +56 -52
- package/node/TablePagination/TablePaginationActions.js +54 -42
- package/node/TableRow/TableRow.js +13 -14
- package/node/TableSortLabel/TableSortLabel.js +15 -17
- package/node/Tabs/ScrollbarSize.js +7 -9
- package/node/Tabs/Tabs.js +52 -49
- package/node/TextField/TextField.js +137 -67
- package/node/ToggleButton/ToggleButton.js +30 -32
- package/node/ToggleButtonGroup/ToggleButtonGroup.js +19 -21
- package/node/Toolbar/Toolbar.js +13 -14
- package/node/Tooltip/Tooltip.js +77 -64
- package/node/Typography/Typography.js +37 -35
- package/node/Zoom/Zoom.js +31 -30
- package/node/index.js +1 -1
- package/node/internal/SwitchBase.js +37 -37
- package/node/locale/index.js +75 -2
- package/node/styles/CssVarsProvider.js +25 -10
- package/node/styles/ThemeProvider.js +7 -10
- package/node/styles/adaptV4Theme.js +31 -32
- package/node/styles/createMixins.js +4 -5
- package/node/styles/createPalette.js +16 -13
- package/node/styles/createTheme.js +16 -11
- package/node/styles/createTransitions.js +17 -15
- package/node/styles/createTypography.js +31 -29
- package/node/styles/experimental_extendTheme.js +9 -350
- package/node/styles/extendTheme.js +367 -0
- package/node/styles/index.js +10 -0
- package/node/styles/responsiveFontSizes.js +20 -11
- package/node/usePagination/usePagination.js +18 -20
- package/node/useScrollTrigger/useScrollTrigger.js +8 -11
- package/node/utils/createSvgIcon.js +4 -5
- package/node/utils/useSlot.js +41 -40
- package/package.json +6 -6
- package/styles/CssVarsProvider.d.ts +3 -2
- package/styles/CssVarsProvider.js +20 -9
- package/styles/ThemeProvider.js +7 -10
- package/styles/adaptV4Theme.js +31 -31
- package/styles/createMixins.js +4 -4
- package/styles/createPalette.js +16 -13
- package/styles/createTheme.js +16 -11
- package/styles/createTransitions.js +17 -14
- package/styles/createTypography.js +31 -29
- package/styles/experimental_extendTheme.js +8 -344
- package/styles/{experimental_extendTheme.d.ts → extendTheme.d.ts} +1 -2
- package/styles/extendTheme.js +355 -0
- package/styles/index.d.ts +2 -2
- package/styles/index.js +2 -1
- package/styles/responsiveFontSizes.js +20 -11
- package/themeCssVarsAugmentation/index.d.ts +1 -1
- package/types/OverridableComponentAugmentation.d.ts +2 -2
- package/usePagination/usePagination.d.ts +1 -1
- package/usePagination/usePagination.js +18 -20
- package/useScrollTrigger/useScrollTrigger.js +8 -10
- package/utils/createSvgIcon.js +4 -5
- package/utils/useSlot.js +41 -40
- package/umd/material-ui.development.js +0 -54226
- package/umd/material-ui.production.min.js +0 -25
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import deepmerge from '@mui/utils/deepmerge';
|
|
2
|
+
import { unstable_createGetCssVar as systemCreateGetCssVar, createSpacing } from '@mui/system';
|
|
3
|
+
import { createUnarySpacing } from '@mui/system/spacing';
|
|
4
|
+
import { prepareCssVars, prepareTypographyVars } from '@mui/system/cssVars';
|
|
5
|
+
import styleFunctionSx, { unstable_defaultSxConfig as defaultSxConfig } from '@mui/system/styleFunctionSx';
|
|
6
|
+
import { private_safeColorChannel as safeColorChannel, private_safeAlpha as safeAlpha, private_safeDarken as safeDarken, private_safeLighten as safeLighten, private_safeEmphasize as safeEmphasize, hslToRgb } from '@mui/system/colorManipulator';
|
|
7
|
+
import defaultShouldSkipGeneratingVar from './shouldSkipGeneratingVar';
|
|
8
|
+
import createThemeWithoutVars from './createTheme';
|
|
9
|
+
import getOverlayAlpha from './getOverlayAlpha';
|
|
10
|
+
import defaultGetSelector from './createGetSelector';
|
|
11
|
+
const defaultDarkOverlays = [...Array(25)].map((_, index) => {
|
|
12
|
+
if (index === 0) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
const overlay = getOverlayAlpha(index);
|
|
16
|
+
return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;
|
|
17
|
+
});
|
|
18
|
+
function assignNode(obj, keys) {
|
|
19
|
+
keys.forEach(k => {
|
|
20
|
+
if (!obj[k]) {
|
|
21
|
+
obj[k] = {};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function setColor(obj, key, defaultValue) {
|
|
26
|
+
if (!obj[key] && defaultValue) {
|
|
27
|
+
obj[key] = defaultValue;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function toRgb(color) {
|
|
31
|
+
if (!color || !color.startsWith('hsl')) {
|
|
32
|
+
return color;
|
|
33
|
+
}
|
|
34
|
+
return hslToRgb(color);
|
|
35
|
+
}
|
|
36
|
+
function setColorChannel(obj, key) {
|
|
37
|
+
if (!(`${key}Channel` in obj)) {
|
|
38
|
+
// custom channel token is not provided, generate one.
|
|
39
|
+
// if channel token can't be generated, show a warning.
|
|
40
|
+
obj[`${key}Channel`] = safeColorChannel(toRgb(obj[key]), `MUI: Can't create \`palette.${key}Channel\` because \`palette.${key}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` + '\n' + `To suppress this warning, you need to explicitly provide the \`palette.${key}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function getSpacingVal(spacingInput) {
|
|
44
|
+
if (typeof spacingInput === 'number') {
|
|
45
|
+
return `${spacingInput}px`;
|
|
46
|
+
}
|
|
47
|
+
if (typeof spacingInput === 'string') {
|
|
48
|
+
return spacingInput;
|
|
49
|
+
}
|
|
50
|
+
if (typeof spacingInput === 'function') {
|
|
51
|
+
return getSpacingVal(spacingInput(1));
|
|
52
|
+
}
|
|
53
|
+
if (Array.isArray(spacingInput)) {
|
|
54
|
+
return spacingInput;
|
|
55
|
+
}
|
|
56
|
+
return '8px';
|
|
57
|
+
}
|
|
58
|
+
const silent = fn => {
|
|
59
|
+
try {
|
|
60
|
+
return fn();
|
|
61
|
+
} catch (error) {
|
|
62
|
+
// ignore error
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
};
|
|
66
|
+
export const createGetCssVar = (cssVarPrefix = 'mui') => systemCreateGetCssVar(cssVarPrefix);
|
|
67
|
+
export default function extendTheme(options = {}, ...args) {
|
|
68
|
+
const {
|
|
69
|
+
colorSchemes: colorSchemesInput = {},
|
|
70
|
+
cssVarPrefix = 'mui',
|
|
71
|
+
shouldSkipGeneratingVar = defaultShouldSkipGeneratingVar,
|
|
72
|
+
getSelector,
|
|
73
|
+
...input
|
|
74
|
+
} = options;
|
|
75
|
+
const getCssVar = createGetCssVar(cssVarPrefix);
|
|
76
|
+
const {
|
|
77
|
+
palette: lightPalette,
|
|
78
|
+
...muiTheme
|
|
79
|
+
} = createThemeWithoutVars({
|
|
80
|
+
...input,
|
|
81
|
+
...(colorSchemesInput.light && {
|
|
82
|
+
palette: colorSchemesInput.light?.palette
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
const {
|
|
86
|
+
palette: darkPalette
|
|
87
|
+
} = createThemeWithoutVars({
|
|
88
|
+
palette: {
|
|
89
|
+
mode: 'dark',
|
|
90
|
+
...colorSchemesInput.dark?.palette
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
let theme = {
|
|
94
|
+
defaultColorScheme: 'light',
|
|
95
|
+
...muiTheme,
|
|
96
|
+
cssVarPrefix,
|
|
97
|
+
getCssVar,
|
|
98
|
+
colorSchemes: {
|
|
99
|
+
...colorSchemesInput,
|
|
100
|
+
light: {
|
|
101
|
+
...colorSchemesInput.light,
|
|
102
|
+
palette: lightPalette,
|
|
103
|
+
opacity: {
|
|
104
|
+
inputPlaceholder: 0.42,
|
|
105
|
+
inputUnderline: 0.42,
|
|
106
|
+
switchTrackDisabled: 0.12,
|
|
107
|
+
switchTrack: 0.38,
|
|
108
|
+
...colorSchemesInput.light?.opacity
|
|
109
|
+
},
|
|
110
|
+
overlays: colorSchemesInput.light?.overlays || []
|
|
111
|
+
},
|
|
112
|
+
dark: {
|
|
113
|
+
...colorSchemesInput.dark,
|
|
114
|
+
palette: darkPalette,
|
|
115
|
+
opacity: {
|
|
116
|
+
inputPlaceholder: 0.5,
|
|
117
|
+
inputUnderline: 0.7,
|
|
118
|
+
switchTrackDisabled: 0.2,
|
|
119
|
+
switchTrack: 0.3,
|
|
120
|
+
...colorSchemesInput.dark?.opacity
|
|
121
|
+
},
|
|
122
|
+
overlays: colorSchemesInput.dark?.overlays || defaultDarkOverlays
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
font: {
|
|
126
|
+
...prepareTypographyVars(muiTheme.typography),
|
|
127
|
+
...muiTheme.font
|
|
128
|
+
},
|
|
129
|
+
spacing: getSpacingVal(input.spacing)
|
|
130
|
+
};
|
|
131
|
+
Object.keys(theme.colorSchemes).forEach(key => {
|
|
132
|
+
const palette = theme.colorSchemes[key].palette;
|
|
133
|
+
const setCssVarColor = cssVar => {
|
|
134
|
+
const tokens = cssVar.split('-');
|
|
135
|
+
const color = tokens[1];
|
|
136
|
+
const colorToken = tokens[2];
|
|
137
|
+
return getCssVar(cssVar, palette[color][colorToken]);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// attach black & white channels to common node
|
|
141
|
+
if (key === 'light') {
|
|
142
|
+
setColor(palette.common, 'background', '#fff');
|
|
143
|
+
setColor(palette.common, 'onBackground', '#000');
|
|
144
|
+
} else {
|
|
145
|
+
setColor(palette.common, 'background', '#000');
|
|
146
|
+
setColor(palette.common, 'onBackground', '#fff');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// assign component variables
|
|
150
|
+
assignNode(palette, ['Alert', 'AppBar', 'Avatar', 'Button', 'Chip', 'FilledInput', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']);
|
|
151
|
+
if (key === 'light') {
|
|
152
|
+
setColor(palette.Alert, 'errorColor', safeDarken(palette.error.light, 0.6));
|
|
153
|
+
setColor(palette.Alert, 'infoColor', safeDarken(palette.info.light, 0.6));
|
|
154
|
+
setColor(palette.Alert, 'successColor', safeDarken(palette.success.light, 0.6));
|
|
155
|
+
setColor(palette.Alert, 'warningColor', safeDarken(palette.warning.light, 0.6));
|
|
156
|
+
setColor(palette.Alert, 'errorFilledBg', setCssVarColor('palette-error-main'));
|
|
157
|
+
setColor(palette.Alert, 'infoFilledBg', setCssVarColor('palette-info-main'));
|
|
158
|
+
setColor(palette.Alert, 'successFilledBg', setCssVarColor('palette-success-main'));
|
|
159
|
+
setColor(palette.Alert, 'warningFilledBg', setCssVarColor('palette-warning-main'));
|
|
160
|
+
setColor(palette.Alert, 'errorFilledColor', silent(() => lightPalette.getContrastText(palette.error.main)));
|
|
161
|
+
setColor(palette.Alert, 'infoFilledColor', silent(() => lightPalette.getContrastText(palette.info.main)));
|
|
162
|
+
setColor(palette.Alert, 'successFilledColor', silent(() => lightPalette.getContrastText(palette.success.main)));
|
|
163
|
+
setColor(palette.Alert, 'warningFilledColor', silent(() => lightPalette.getContrastText(palette.warning.main)));
|
|
164
|
+
setColor(palette.Alert, 'errorStandardBg', safeLighten(palette.error.light, 0.9));
|
|
165
|
+
setColor(palette.Alert, 'infoStandardBg', safeLighten(palette.info.light, 0.9));
|
|
166
|
+
setColor(palette.Alert, 'successStandardBg', safeLighten(palette.success.light, 0.9));
|
|
167
|
+
setColor(palette.Alert, 'warningStandardBg', safeLighten(palette.warning.light, 0.9));
|
|
168
|
+
setColor(palette.Alert, 'errorIconColor', setCssVarColor('palette-error-main'));
|
|
169
|
+
setColor(palette.Alert, 'infoIconColor', setCssVarColor('palette-info-main'));
|
|
170
|
+
setColor(palette.Alert, 'successIconColor', setCssVarColor('palette-success-main'));
|
|
171
|
+
setColor(palette.Alert, 'warningIconColor', setCssVarColor('palette-warning-main'));
|
|
172
|
+
setColor(palette.AppBar, 'defaultBg', setCssVarColor('palette-grey-100'));
|
|
173
|
+
setColor(palette.Avatar, 'defaultBg', setCssVarColor('palette-grey-400'));
|
|
174
|
+
setColor(palette.Button, 'inheritContainedBg', setCssVarColor('palette-grey-300'));
|
|
175
|
+
setColor(palette.Button, 'inheritContainedHoverBg', setCssVarColor('palette-grey-A100'));
|
|
176
|
+
setColor(palette.Chip, 'defaultBorder', setCssVarColor('palette-grey-400'));
|
|
177
|
+
setColor(palette.Chip, 'defaultAvatarColor', setCssVarColor('palette-grey-700'));
|
|
178
|
+
setColor(palette.Chip, 'defaultIconColor', setCssVarColor('palette-grey-700'));
|
|
179
|
+
setColor(palette.FilledInput, 'bg', 'rgba(0, 0, 0, 0.06)');
|
|
180
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(0, 0, 0, 0.09)');
|
|
181
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(0, 0, 0, 0.12)');
|
|
182
|
+
setColor(palette.LinearProgress, 'primaryBg', safeLighten(palette.primary.main, 0.62));
|
|
183
|
+
setColor(palette.LinearProgress, 'secondaryBg', safeLighten(palette.secondary.main, 0.62));
|
|
184
|
+
setColor(palette.LinearProgress, 'errorBg', safeLighten(palette.error.main, 0.62));
|
|
185
|
+
setColor(palette.LinearProgress, 'infoBg', safeLighten(palette.info.main, 0.62));
|
|
186
|
+
setColor(palette.LinearProgress, 'successBg', safeLighten(palette.success.main, 0.62));
|
|
187
|
+
setColor(palette.LinearProgress, 'warningBg', safeLighten(palette.warning.main, 0.62));
|
|
188
|
+
setColor(palette.Skeleton, 'bg', `rgba(${setCssVarColor('palette-text-primaryChannel')} / 0.11)`);
|
|
189
|
+
setColor(palette.Slider, 'primaryTrack', safeLighten(palette.primary.main, 0.62));
|
|
190
|
+
setColor(palette.Slider, 'secondaryTrack', safeLighten(palette.secondary.main, 0.62));
|
|
191
|
+
setColor(palette.Slider, 'errorTrack', safeLighten(palette.error.main, 0.62));
|
|
192
|
+
setColor(palette.Slider, 'infoTrack', safeLighten(palette.info.main, 0.62));
|
|
193
|
+
setColor(palette.Slider, 'successTrack', safeLighten(palette.success.main, 0.62));
|
|
194
|
+
setColor(palette.Slider, 'warningTrack', safeLighten(palette.warning.main, 0.62));
|
|
195
|
+
const snackbarContentBackground = safeEmphasize(palette.background.default, 0.8);
|
|
196
|
+
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
|
197
|
+
setColor(palette.SnackbarContent, 'color', silent(() => lightPalette.getContrastText(snackbarContentBackground)));
|
|
198
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', safeEmphasize(palette.background.paper, 0.15));
|
|
199
|
+
setColor(palette.StepConnector, 'border', setCssVarColor('palette-grey-400'));
|
|
200
|
+
setColor(palette.StepContent, 'border', setCssVarColor('palette-grey-400'));
|
|
201
|
+
setColor(palette.Switch, 'defaultColor', setCssVarColor('palette-common-white'));
|
|
202
|
+
setColor(palette.Switch, 'defaultDisabledColor', setCssVarColor('palette-grey-100'));
|
|
203
|
+
setColor(palette.Switch, 'primaryDisabledColor', safeLighten(palette.primary.main, 0.62));
|
|
204
|
+
setColor(palette.Switch, 'secondaryDisabledColor', safeLighten(palette.secondary.main, 0.62));
|
|
205
|
+
setColor(palette.Switch, 'errorDisabledColor', safeLighten(palette.error.main, 0.62));
|
|
206
|
+
setColor(palette.Switch, 'infoDisabledColor', safeLighten(palette.info.main, 0.62));
|
|
207
|
+
setColor(palette.Switch, 'successDisabledColor', safeLighten(palette.success.main, 0.62));
|
|
208
|
+
setColor(palette.Switch, 'warningDisabledColor', safeLighten(palette.warning.main, 0.62));
|
|
209
|
+
setColor(palette.TableCell, 'border', safeLighten(safeAlpha(palette.divider, 1), 0.88));
|
|
210
|
+
setColor(palette.Tooltip, 'bg', safeAlpha(palette.grey[700], 0.92));
|
|
211
|
+
} else {
|
|
212
|
+
setColor(palette.Alert, 'errorColor', safeLighten(palette.error.light, 0.6));
|
|
213
|
+
setColor(palette.Alert, 'infoColor', safeLighten(palette.info.light, 0.6));
|
|
214
|
+
setColor(palette.Alert, 'successColor', safeLighten(palette.success.light, 0.6));
|
|
215
|
+
setColor(palette.Alert, 'warningColor', safeLighten(palette.warning.light, 0.6));
|
|
216
|
+
setColor(palette.Alert, 'errorFilledBg', setCssVarColor('palette-error-dark'));
|
|
217
|
+
setColor(palette.Alert, 'infoFilledBg', setCssVarColor('palette-info-dark'));
|
|
218
|
+
setColor(palette.Alert, 'successFilledBg', setCssVarColor('palette-success-dark'));
|
|
219
|
+
setColor(palette.Alert, 'warningFilledBg', setCssVarColor('palette-warning-dark'));
|
|
220
|
+
setColor(palette.Alert, 'errorFilledColor', silent(() => darkPalette.getContrastText(palette.error.dark)));
|
|
221
|
+
setColor(palette.Alert, 'infoFilledColor', silent(() => darkPalette.getContrastText(palette.info.dark)));
|
|
222
|
+
setColor(palette.Alert, 'successFilledColor', silent(() => darkPalette.getContrastText(palette.success.dark)));
|
|
223
|
+
setColor(palette.Alert, 'warningFilledColor', silent(() => darkPalette.getContrastText(palette.warning.dark)));
|
|
224
|
+
setColor(palette.Alert, 'errorStandardBg', safeDarken(palette.error.light, 0.9));
|
|
225
|
+
setColor(palette.Alert, 'infoStandardBg', safeDarken(palette.info.light, 0.9));
|
|
226
|
+
setColor(palette.Alert, 'successStandardBg', safeDarken(palette.success.light, 0.9));
|
|
227
|
+
setColor(palette.Alert, 'warningStandardBg', safeDarken(palette.warning.light, 0.9));
|
|
228
|
+
setColor(palette.Alert, 'errorIconColor', setCssVarColor('palette-error-main'));
|
|
229
|
+
setColor(palette.Alert, 'infoIconColor', setCssVarColor('palette-info-main'));
|
|
230
|
+
setColor(palette.Alert, 'successIconColor', setCssVarColor('palette-success-main'));
|
|
231
|
+
setColor(palette.Alert, 'warningIconColor', setCssVarColor('palette-warning-main'));
|
|
232
|
+
setColor(palette.AppBar, 'defaultBg', setCssVarColor('palette-grey-900'));
|
|
233
|
+
setColor(palette.AppBar, 'darkBg', setCssVarColor('palette-background-paper')); // specific for dark mode
|
|
234
|
+
setColor(palette.AppBar, 'darkColor', setCssVarColor('palette-text-primary')); // specific for dark mode
|
|
235
|
+
setColor(palette.Avatar, 'defaultBg', setCssVarColor('palette-grey-600'));
|
|
236
|
+
setColor(palette.Button, 'inheritContainedBg', setCssVarColor('palette-grey-800'));
|
|
237
|
+
setColor(palette.Button, 'inheritContainedHoverBg', setCssVarColor('palette-grey-700'));
|
|
238
|
+
setColor(palette.Chip, 'defaultBorder', setCssVarColor('palette-grey-700'));
|
|
239
|
+
setColor(palette.Chip, 'defaultAvatarColor', setCssVarColor('palette-grey-300'));
|
|
240
|
+
setColor(palette.Chip, 'defaultIconColor', setCssVarColor('palette-grey-300'));
|
|
241
|
+
setColor(palette.FilledInput, 'bg', 'rgba(255, 255, 255, 0.09)');
|
|
242
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(255, 255, 255, 0.13)');
|
|
243
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(255, 255, 255, 0.12)');
|
|
244
|
+
setColor(palette.LinearProgress, 'primaryBg', safeDarken(palette.primary.main, 0.5));
|
|
245
|
+
setColor(palette.LinearProgress, 'secondaryBg', safeDarken(palette.secondary.main, 0.5));
|
|
246
|
+
setColor(palette.LinearProgress, 'errorBg', safeDarken(palette.error.main, 0.5));
|
|
247
|
+
setColor(palette.LinearProgress, 'infoBg', safeDarken(palette.info.main, 0.5));
|
|
248
|
+
setColor(palette.LinearProgress, 'successBg', safeDarken(palette.success.main, 0.5));
|
|
249
|
+
setColor(palette.LinearProgress, 'warningBg', safeDarken(palette.warning.main, 0.5));
|
|
250
|
+
setColor(palette.Skeleton, 'bg', `rgba(${setCssVarColor('palette-text-primaryChannel')} / 0.13)`);
|
|
251
|
+
setColor(palette.Slider, 'primaryTrack', safeDarken(palette.primary.main, 0.5));
|
|
252
|
+
setColor(palette.Slider, 'secondaryTrack', safeDarken(palette.secondary.main, 0.5));
|
|
253
|
+
setColor(palette.Slider, 'errorTrack', safeDarken(palette.error.main, 0.5));
|
|
254
|
+
setColor(palette.Slider, 'infoTrack', safeDarken(palette.info.main, 0.5));
|
|
255
|
+
setColor(palette.Slider, 'successTrack', safeDarken(palette.success.main, 0.5));
|
|
256
|
+
setColor(palette.Slider, 'warningTrack', safeDarken(palette.warning.main, 0.5));
|
|
257
|
+
const snackbarContentBackground = safeEmphasize(palette.background.default, 0.98);
|
|
258
|
+
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
|
259
|
+
setColor(palette.SnackbarContent, 'color', silent(() => darkPalette.getContrastText(snackbarContentBackground)));
|
|
260
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', safeEmphasize(palette.background.paper, 0.15));
|
|
261
|
+
setColor(palette.StepConnector, 'border', setCssVarColor('palette-grey-600'));
|
|
262
|
+
setColor(palette.StepContent, 'border', setCssVarColor('palette-grey-600'));
|
|
263
|
+
setColor(palette.Switch, 'defaultColor', setCssVarColor('palette-grey-300'));
|
|
264
|
+
setColor(palette.Switch, 'defaultDisabledColor', setCssVarColor('palette-grey-600'));
|
|
265
|
+
setColor(palette.Switch, 'primaryDisabledColor', safeDarken(palette.primary.main, 0.55));
|
|
266
|
+
setColor(palette.Switch, 'secondaryDisabledColor', safeDarken(palette.secondary.main, 0.55));
|
|
267
|
+
setColor(palette.Switch, 'errorDisabledColor', safeDarken(palette.error.main, 0.55));
|
|
268
|
+
setColor(palette.Switch, 'infoDisabledColor', safeDarken(palette.info.main, 0.55));
|
|
269
|
+
setColor(palette.Switch, 'successDisabledColor', safeDarken(palette.success.main, 0.55));
|
|
270
|
+
setColor(palette.Switch, 'warningDisabledColor', safeDarken(palette.warning.main, 0.55));
|
|
271
|
+
setColor(palette.TableCell, 'border', safeDarken(safeAlpha(palette.divider, 1), 0.68));
|
|
272
|
+
setColor(palette.Tooltip, 'bg', safeAlpha(palette.grey[700], 0.92));
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// MUI X - DataGrid needs this token.
|
|
276
|
+
setColorChannel(palette.background, 'default');
|
|
277
|
+
|
|
278
|
+
// added for consistency with the `background.default` token
|
|
279
|
+
setColorChannel(palette.background, 'paper');
|
|
280
|
+
setColorChannel(palette.common, 'background');
|
|
281
|
+
setColorChannel(palette.common, 'onBackground');
|
|
282
|
+
setColorChannel(palette, 'divider');
|
|
283
|
+
Object.keys(palette).forEach(color => {
|
|
284
|
+
const colors = palette[color];
|
|
285
|
+
|
|
286
|
+
// The default palettes (primary, secondary, error, info, success, and warning) errors are handled by the above `createTheme(...)`.
|
|
287
|
+
|
|
288
|
+
if (colors && typeof colors === 'object') {
|
|
289
|
+
// Silent the error for custom palettes.
|
|
290
|
+
if (colors.main) {
|
|
291
|
+
setColor(palette[color], 'mainChannel', safeColorChannel(toRgb(colors.main)));
|
|
292
|
+
}
|
|
293
|
+
if (colors.light) {
|
|
294
|
+
setColor(palette[color], 'lightChannel', safeColorChannel(toRgb(colors.light)));
|
|
295
|
+
}
|
|
296
|
+
if (colors.dark) {
|
|
297
|
+
setColor(palette[color], 'darkChannel', safeColorChannel(toRgb(colors.dark)));
|
|
298
|
+
}
|
|
299
|
+
if (colors.contrastText) {
|
|
300
|
+
setColor(palette[color], 'contrastTextChannel', safeColorChannel(toRgb(colors.contrastText)));
|
|
301
|
+
}
|
|
302
|
+
if (color === 'text') {
|
|
303
|
+
// Text colors: text.primary, text.secondary
|
|
304
|
+
setColorChannel(palette[color], 'primary');
|
|
305
|
+
setColorChannel(palette[color], 'secondary');
|
|
306
|
+
}
|
|
307
|
+
if (color === 'action') {
|
|
308
|
+
// Action colors: action.active, action.selected
|
|
309
|
+
if (colors.active) {
|
|
310
|
+
setColorChannel(palette[color], 'active');
|
|
311
|
+
}
|
|
312
|
+
if (colors.selected) {
|
|
313
|
+
setColorChannel(palette[color], 'selected');
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
theme = args.reduce((acc, argument) => deepmerge(acc, argument), theme);
|
|
320
|
+
const parserConfig = {
|
|
321
|
+
prefix: cssVarPrefix,
|
|
322
|
+
shouldSkipGeneratingVar,
|
|
323
|
+
getSelector: getSelector || defaultGetSelector(theme)
|
|
324
|
+
};
|
|
325
|
+
const {
|
|
326
|
+
vars,
|
|
327
|
+
generateThemeVars,
|
|
328
|
+
generateStyleSheets
|
|
329
|
+
} = prepareCssVars(theme, parserConfig);
|
|
330
|
+
theme.attribute = 'data-mui-color-scheme';
|
|
331
|
+
theme.colorSchemeSelector = ':root';
|
|
332
|
+
theme.vars = vars;
|
|
333
|
+
Object.entries(theme.colorSchemes[theme.defaultColorScheme]).forEach(([key, value]) => {
|
|
334
|
+
theme[key] = value;
|
|
335
|
+
});
|
|
336
|
+
theme.generateThemeVars = generateThemeVars;
|
|
337
|
+
theme.generateStyleSheets = generateStyleSheets;
|
|
338
|
+
theme.generateSpacing = function generateSpacing() {
|
|
339
|
+
return createSpacing(input.spacing, createUnarySpacing(this));
|
|
340
|
+
};
|
|
341
|
+
theme.getColorSchemeSelector = colorScheme => `[${theme.attribute}="${colorScheme}"] &`;
|
|
342
|
+
theme.spacing = theme.generateSpacing();
|
|
343
|
+
theme.shouldSkipGeneratingVar = shouldSkipGeneratingVar;
|
|
344
|
+
theme.unstable_sxConfig = {
|
|
345
|
+
...defaultSxConfig,
|
|
346
|
+
...input?.unstable_sxConfig
|
|
347
|
+
};
|
|
348
|
+
theme.unstable_sx = function sx(props) {
|
|
349
|
+
return styleFunctionSx({
|
|
350
|
+
sx: props,
|
|
351
|
+
theme: this
|
|
352
|
+
});
|
|
353
|
+
};
|
|
354
|
+
return theme;
|
|
355
|
+
}
|
package/modern/styles/index.js
CHANGED
|
@@ -27,7 +27,8 @@ export { default as makeStyles } from './makeStyles';
|
|
|
27
27
|
export { default as withStyles } from './withStyles';
|
|
28
28
|
export { default as withTheme } from './withTheme';
|
|
29
29
|
export * from './CssVarsProvider';
|
|
30
|
-
export { default as
|
|
30
|
+
export { default as extendTheme } from './extendTheme';
|
|
31
|
+
export { default as experimental_extendTheme } from './experimental_extendTheme'; // TODO: Remove in v7
|
|
31
32
|
export { default as getOverlayAlpha } from './getOverlayAlpha';
|
|
32
33
|
export { default as shouldSkipGeneratingVar } from './shouldSkipGeneratingVar';
|
|
33
34
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
|
3
2
|
import { isUnitless, convertLength, responsiveProperty, alignProperty, fontGrid } from './cssUtils';
|
|
4
3
|
export default function responsiveFontSizes(themeInput, options = {}) {
|
|
@@ -8,8 +7,12 @@ export default function responsiveFontSizes(themeInput, options = {}) {
|
|
|
8
7
|
factor = 2,
|
|
9
8
|
variants = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'caption', 'button', 'overline']
|
|
10
9
|
} = options;
|
|
11
|
-
const theme =
|
|
12
|
-
|
|
10
|
+
const theme = {
|
|
11
|
+
...themeInput
|
|
12
|
+
};
|
|
13
|
+
theme.typography = {
|
|
14
|
+
...theme.typography
|
|
15
|
+
};
|
|
13
16
|
const typography = theme.typography;
|
|
14
17
|
|
|
15
18
|
// Convert between CSS lengths e.g. em->px or px->rem
|
|
@@ -18,6 +21,9 @@ export default function responsiveFontSizes(themeInput, options = {}) {
|
|
|
18
21
|
const breakpointValues = breakpoints.map(x => theme.breakpoints.values[x]);
|
|
19
22
|
variants.forEach(variant => {
|
|
20
23
|
const style = typography[variant];
|
|
24
|
+
if (!style) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
21
27
|
const remFontSize = parseFloat(convert(style.fontSize, 'rem'));
|
|
22
28
|
if (remFontSize <= 1) {
|
|
23
29
|
return;
|
|
@@ -46,14 +52,17 @@ Use unitless line heights instead.` : _formatMuiErrorMessage(6));
|
|
|
46
52
|
})
|
|
47
53
|
});
|
|
48
54
|
}
|
|
49
|
-
typography[variant] =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
typography[variant] = {
|
|
56
|
+
...style,
|
|
57
|
+
...responsiveProperty({
|
|
58
|
+
cssProperty: 'fontSize',
|
|
59
|
+
min: minFontSize,
|
|
60
|
+
max: maxFontSize,
|
|
61
|
+
unit: 'rem',
|
|
62
|
+
breakpoints: breakpointValues,
|
|
63
|
+
transform
|
|
64
|
+
})
|
|
65
|
+
};
|
|
57
66
|
});
|
|
58
67
|
return theme;
|
|
59
68
|
}
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["boundaryCount", "componentName", "count", "defaultPage", "disabled", "hideNextButton", "hidePrevButton", "onChange", "page", "showFirstButton", "showLastButton", "siblingCount"];
|
|
6
3
|
import useControlled from '@mui/utils/useControlled';
|
|
7
4
|
export default function usePagination(props = {}) {
|
|
8
5
|
// keep default values in sync with @default tags in Pagination.propTypes
|
|
9
6
|
const {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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;
|
|
24
21
|
const [page, setPageState] = useControlled({
|
|
25
22
|
controlled: pageProp,
|
|
26
23
|
default: defaultPage,
|
|
@@ -109,7 +106,8 @@ export default function usePagination(props = {}) {
|
|
|
109
106
|
disabled: disabled || item.indexOf('ellipsis') === -1 && (item === 'next' || item === 'last' ? page >= count : page <= 1)
|
|
110
107
|
};
|
|
111
108
|
});
|
|
112
|
-
return
|
|
113
|
-
items
|
|
114
|
-
|
|
109
|
+
return {
|
|
110
|
+
items,
|
|
111
|
+
...other
|
|
112
|
+
};
|
|
115
113
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["getTrigger", "target"];
|
|
6
3
|
import * as React from 'react';
|
|
7
4
|
function defaultTrigger(store, options) {
|
|
8
5
|
const {
|
|
@@ -25,17 +22,18 @@ function defaultTrigger(store, options) {
|
|
|
25
22
|
const defaultTarget = typeof window !== 'undefined' ? window : null;
|
|
26
23
|
export default function useScrollTrigger(options = {}) {
|
|
27
24
|
const {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
getTrigger = defaultTrigger,
|
|
26
|
+
target = defaultTarget,
|
|
27
|
+
...other
|
|
28
|
+
} = options;
|
|
32
29
|
const store = React.useRef();
|
|
33
30
|
const [trigger, setTrigger] = React.useState(() => getTrigger(store, other));
|
|
34
31
|
React.useEffect(() => {
|
|
35
32
|
const handleScroll = () => {
|
|
36
|
-
setTrigger(getTrigger(store,
|
|
37
|
-
target
|
|
38
|
-
|
|
33
|
+
setTrigger(getTrigger(store, {
|
|
34
|
+
target,
|
|
35
|
+
...other
|
|
36
|
+
}));
|
|
39
37
|
};
|
|
40
38
|
handleScroll(); // Re-evaluate trigger when dependencies change
|
|
41
39
|
target.addEventListener('scroll', handleScroll, {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import SvgIcon from '../SvgIcon';
|
|
6
5
|
|
|
@@ -10,12 +9,12 @@ import SvgIcon from '../SvgIcon';
|
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
export default function createSvgIcon(path, displayName) {
|
|
12
11
|
function Component(props, ref) {
|
|
13
|
-
return /*#__PURE__*/_jsx(SvgIcon,
|
|
12
|
+
return /*#__PURE__*/_jsx(SvgIcon, {
|
|
14
13
|
"data-testid": `${displayName}Icon`,
|
|
15
|
-
ref: ref
|
|
16
|
-
|
|
14
|
+
ref: ref,
|
|
15
|
+
...props,
|
|
17
16
|
children: path
|
|
18
|
-
})
|
|
17
|
+
});
|
|
19
18
|
}
|
|
20
19
|
if (process.env.NODE_ENV !== 'production') {
|
|
21
20
|
// Need to set `displayName` on the inner component for React.memo.
|
package/modern/utils/useSlot.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["className", "elementType", "ownerState", "externalForwardedProps", "getSlotOwnerState", "internalForwardedProps"],
|
|
6
|
-
_excluded2 = ["component", "slots", "slotProps"],
|
|
7
|
-
_excluded3 = ["component"];
|
|
8
3
|
import useForkRef from '@mui/utils/useForkRef';
|
|
9
4
|
import { appendOwnerState, resolveComponentProps, mergeSlotProps } from '@mui/base/utils';
|
|
10
5
|
/**
|
|
@@ -30,51 +25,57 @@ export default function useSlot(
|
|
|
30
25
|
*/
|
|
31
26
|
name, parameters) {
|
|
32
27
|
const {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
className,
|
|
29
|
+
elementType: initialElementType,
|
|
30
|
+
ownerState,
|
|
31
|
+
externalForwardedProps,
|
|
32
|
+
getSlotOwnerState,
|
|
33
|
+
internalForwardedProps,
|
|
34
|
+
...useSlotPropsParams
|
|
35
|
+
} = parameters;
|
|
41
36
|
const {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
component: rootComponent,
|
|
38
|
+
slots = {
|
|
39
|
+
[name]: undefined
|
|
40
|
+
},
|
|
41
|
+
slotProps = {
|
|
42
|
+
[name]: undefined
|
|
43
|
+
},
|
|
44
|
+
...other
|
|
45
|
+
} = externalForwardedProps;
|
|
51
46
|
const elementType = slots[name] || initialElementType;
|
|
52
47
|
|
|
53
48
|
// `slotProps[name]` can be a callback that receives the component's ownerState.
|
|
54
49
|
// `resolvedComponentsProps` is always a plain object.
|
|
55
50
|
const resolvedComponentsProps = resolveComponentProps(slotProps[name], ownerState);
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
mergedProps = _objectWithoutPropertiesLoose(_mergeSlotProps.props, _excluded3);
|
|
51
|
+
const {
|
|
52
|
+
props: {
|
|
53
|
+
component: slotComponent,
|
|
54
|
+
...mergedProps
|
|
55
|
+
},
|
|
56
|
+
internalRef
|
|
57
|
+
} = mergeSlotProps({
|
|
58
|
+
className,
|
|
59
|
+
...useSlotPropsParams,
|
|
60
|
+
externalForwardedProps: name === 'root' ? other : undefined,
|
|
61
|
+
externalSlotProps: resolvedComponentsProps
|
|
62
|
+
});
|
|
69
63
|
const ref = useForkRef(internalRef, resolvedComponentsProps?.ref, parameters.ref);
|
|
70
64
|
const slotOwnerState = getSlotOwnerState ? getSlotOwnerState(mergedProps) : {};
|
|
71
|
-
const finalOwnerState =
|
|
65
|
+
const finalOwnerState = {
|
|
66
|
+
...ownerState,
|
|
67
|
+
...slotOwnerState
|
|
68
|
+
};
|
|
72
69
|
const LeafComponent = name === 'root' ? slotComponent || rootComponent : slotComponent;
|
|
73
|
-
const props = appendOwnerState(elementType,
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
const props = appendOwnerState(elementType, {
|
|
71
|
+
...(name === 'root' && !rootComponent && !slots[name] && internalForwardedProps),
|
|
72
|
+
...(name !== 'root' && !slots[name] && internalForwardedProps),
|
|
73
|
+
...mergedProps,
|
|
74
|
+
...(LeafComponent && {
|
|
75
|
+
as: LeafComponent
|
|
76
|
+
}),
|
|
76
77
|
ref
|
|
77
|
-
}
|
|
78
|
+
}, finalOwnerState);
|
|
78
79
|
Object.keys(slotOwnerState).forEach(propName => {
|
|
79
80
|
delete props[propName];
|
|
80
81
|
});
|