From 03e0443b0aeaa794719ea70bb78342b352ba4a3c Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Fri, 10 Oct 2025 17:20:56 +0700 Subject: [PATCH 01/31] add perf-test --- packages/mui-material/perf-test/test-createTheme.tsx | 12 ++++++++++++ packages/mui-material/perf-test/tsconfig.json | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 packages/mui-material/perf-test/test-createTheme.tsx create mode 100644 packages/mui-material/perf-test/tsconfig.json diff --git a/packages/mui-material/perf-test/test-createTheme.tsx b/packages/mui-material/perf-test/test-createTheme.tsx new file mode 100644 index 00000000000000..ade1cc8a6e7833 --- /dev/null +++ b/packages/mui-material/perf-test/test-createTheme.tsx @@ -0,0 +1,12 @@ +import Button from '@mui/material/Button'; +import { createTheme, type Theme } from '../src/stylesOptimized'; + +export default createTheme({ + components: { + MuiButton: { + defaultProps: { + disableElevation: true, + }, + }, + }, +}); diff --git a/packages/mui-material/perf-test/tsconfig.json b/packages/mui-material/perf-test/tsconfig.json new file mode 100644 index 00000000000000..c38f73658a0f4c --- /dev/null +++ b/packages/mui-material/perf-test/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../../tsconfig.json", + "include": ["test-createTheme.tsx"], + "compilerOptions": { + "moduleResolution": "Bundler" + } +} From 4d89fcfb5fd236e415d397783ca3c5faf1989ff2 Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Fri, 10 Oct 2025 17:21:34 +0700 Subject: [PATCH 02/31] migrate to stylesOptimized --- packages/mui-material/src/Accordion/Accordion.d.ts | 2 +- .../mui-material/src/AccordionActions/AccordionActions.d.ts | 2 +- .../mui-material/src/AccordionDetails/AccordionDetails.d.ts | 2 +- .../mui-material/src/AccordionSummary/AccordionSummary.d.ts | 2 +- packages/mui-material/src/Alert/Alert.d.ts | 2 +- packages/mui-material/src/AlertTitle/AlertTitle.d.ts | 2 +- packages/mui-material/src/Autocomplete/Autocomplete.d.ts | 2 +- packages/mui-material/src/Avatar/Avatar.d.ts | 2 +- packages/mui-material/src/AvatarGroup/AvatarGroup.d.ts | 2 +- packages/mui-material/src/Backdrop/Backdrop.d.ts | 2 +- packages/mui-material/src/Badge/Badge.d.ts | 2 +- .../mui-material/src/BottomNavigation/BottomNavigation.d.ts | 2 +- .../src/BottomNavigationAction/BottomNavigationAction.d.ts | 2 +- packages/mui-material/src/Breadcrumbs/Breadcrumbs.d.ts | 2 +- packages/mui-material/src/Button/Button.d.ts | 2 +- packages/mui-material/src/ButtonBase/ButtonBase.d.ts | 2 +- packages/mui-material/src/ButtonGroup/ButtonGroup.d.ts | 2 +- packages/mui-material/src/Card/Card.d.ts | 2 +- packages/mui-material/src/CardActionArea/CardActionArea.d.ts | 2 +- packages/mui-material/src/CardActions/CardActions.d.ts | 2 +- packages/mui-material/src/CardContent/CardContent.d.ts | 2 +- packages/mui-material/src/CardHeader/CardHeader.d.ts | 2 +- packages/mui-material/src/CardMedia/CardMedia.d.ts | 2 +- packages/mui-material/src/Checkbox/Checkbox.d.ts | 2 +- packages/mui-material/src/Chip/Chip.d.ts | 2 +- .../mui-material/src/CircularProgress/CircularProgress.d.ts | 2 +- packages/mui-material/src/Collapse/Collapse.d.ts | 2 +- packages/mui-material/src/Container/Container.d.ts | 2 +- packages/mui-material/src/Dialog/Dialog.d.ts | 2 +- packages/mui-material/src/DialogActions/DialogActions.d.ts | 2 +- packages/mui-material/src/DialogContent/DialogContent.d.ts | 2 +- .../mui-material/src/DialogContentText/DialogContentText.d.ts | 2 +- packages/mui-material/src/DialogTitle/DialogTitle.d.ts | 2 +- packages/mui-material/src/Divider/Divider.d.ts | 2 +- packages/mui-material/src/Drawer/Drawer.d.ts | 2 +- packages/mui-material/src/FilledInput/FilledInput.d.ts | 2 +- packages/mui-material/src/FormControl/FormControl.d.ts | 2 +- .../mui-material/src/FormControlLabel/FormControlLabel.d.ts | 2 +- packages/mui-material/src/FormGroup/FormGroup.d.ts | 2 +- packages/mui-material/src/FormHelperText/FormHelperText.d.ts | 2 +- packages/mui-material/src/FormLabel/FormLabel.d.ts | 2 +- packages/mui-material/src/GlobalStyles/GlobalStyles.d.ts | 2 +- packages/mui-material/src/GridLegacy/GridLegacy.d.ts | 2 +- packages/mui-material/src/Icon/Icon.d.ts | 2 +- packages/mui-material/src/IconButton/IconButton.d.ts | 2 +- packages/mui-material/src/ImageList/ImageList.d.ts | 2 +- packages/mui-material/src/ImageListItem/ImageListItem.d.ts | 2 +- .../mui-material/src/ImageListItemBar/ImageListItemBar.d.ts | 2 +- packages/mui-material/src/Input/Input.d.ts | 2 +- packages/mui-material/src/InputAdornment/InputAdornment.d.ts | 2 +- packages/mui-material/src/InputBase/InputBase.d.ts | 2 +- packages/mui-material/src/InputLabel/InputLabel.d.ts | 2 +- packages/mui-material/src/LinearProgress/LinearProgress.d.ts | 2 +- packages/mui-material/src/Link/Link.d.ts | 2 +- packages/mui-material/src/List/List.d.ts | 2 +- packages/mui-material/src/ListItem/ListItem.d.ts | 2 +- packages/mui-material/src/ListItemAvatar/ListItemAvatar.d.ts | 2 +- packages/mui-material/src/ListItemButton/ListItemButton.d.ts | 2 +- packages/mui-material/src/ListItemIcon/ListItemIcon.d.ts | 2 +- .../src/ListItemSecondaryAction/ListItemSecondaryAction.d.ts | 2 +- packages/mui-material/src/ListItemText/ListItemText.d.ts | 2 +- packages/mui-material/src/ListSubheader/ListSubheader.d.ts | 2 +- packages/mui-material/src/Menu/Menu.d.ts | 2 +- packages/mui-material/src/MenuItem/MenuItem.d.ts | 2 +- packages/mui-material/src/MobileStepper/MobileStepper.d.ts | 2 +- packages/mui-material/src/Modal/Modal.d.ts | 2 +- packages/mui-material/src/NativeSelect/NativeSelect.d.ts | 2 +- packages/mui-material/src/NativeSelect/NativeSelectInput.d.ts | 2 +- packages/mui-material/src/OutlinedInput/OutlinedInput.d.ts | 2 +- packages/mui-material/src/OverridableComponent/index.ts | 2 +- packages/mui-material/src/Pagination/Pagination.d.ts | 2 +- packages/mui-material/src/PaginationItem/PaginationItem.d.ts | 2 +- packages/mui-material/src/Paper/Paper.d.ts | 2 +- packages/mui-material/src/PigmentContainer/PigmentContainer.tsx | 2 +- packages/mui-material/src/Popover/Popover.d.ts | 2 +- packages/mui-material/src/Popper/Popper.tsx | 2 +- packages/mui-material/src/Radio/Radio.d.ts | 2 +- packages/mui-material/src/Rating/Rating.d.ts | 2 +- .../mui-material/src/ScopedCssBaseline/ScopedCssBaseline.d.ts | 2 +- packages/mui-material/src/Select/Select.d.ts | 2 +- packages/mui-material/src/Select/SelectInput.d.ts | 2 +- packages/mui-material/src/Skeleton/Skeleton.d.ts | 2 +- packages/mui-material/src/Slider/Slider.d.ts | 2 +- packages/mui-material/src/Snackbar/Snackbar.d.ts | 2 +- packages/mui-material/src/SnackbarContent/SnackbarContent.d.ts | 2 +- packages/mui-material/src/SpeedDial/SpeedDial.d.ts | 2 +- packages/mui-material/src/SpeedDialAction/SpeedDialAction.d.ts | 2 +- packages/mui-material/src/SpeedDialIcon/SpeedDialIcon.d.ts | 2 +- packages/mui-material/src/Step/Step.d.ts | 2 +- packages/mui-material/src/StepButton/StepButton.d.ts | 2 +- packages/mui-material/src/StepConnector/StepConnector.d.ts | 2 +- packages/mui-material/src/StepContent/StepContent.d.ts | 2 +- packages/mui-material/src/StepIcon/StepIcon.d.ts | 2 +- packages/mui-material/src/StepLabel/StepLabel.d.ts | 2 +- packages/mui-material/src/Stepper/Stepper.d.ts | 2 +- packages/mui-material/src/SvgIcon/SvgIcon.d.ts | 2 +- packages/mui-material/src/Switch/Switch.d.ts | 2 +- packages/mui-material/src/Tab/Tab.d.ts | 2 +- packages/mui-material/src/TabScrollButton/TabScrollButton.d.ts | 2 +- packages/mui-material/src/Table/Table.d.ts | 2 +- packages/mui-material/src/TableBody/TableBody.d.ts | 2 +- packages/mui-material/src/TableCell/TableCell.d.ts | 2 +- packages/mui-material/src/TableContainer/TableContainer.d.ts | 2 +- packages/mui-material/src/TableFooter/TableFooter.d.ts | 2 +- packages/mui-material/src/TableHead/TableHead.d.ts | 2 +- packages/mui-material/src/TablePagination/TablePagination.d.ts | 2 +- packages/mui-material/src/TableRow/TableRow.d.ts | 2 +- packages/mui-material/src/TableSortLabel/TableSortLabel.d.ts | 2 +- packages/mui-material/src/Tabs/Tabs.d.ts | 2 +- packages/mui-material/src/TextField/TextField.d.ts | 2 +- packages/mui-material/src/ToggleButton/ToggleButton.d.ts | 2 +- .../mui-material/src/ToggleButtonGroup/ToggleButtonGroup.d.ts | 2 +- packages/mui-material/src/Toolbar/Toolbar.d.ts | 2 +- packages/mui-material/src/Tooltip/Tooltip.d.ts | 2 +- packages/mui-material/src/internal/index.ts | 2 +- packages/mui-material/src/utils/types.ts | 2 +- packages/mui-material/src/zero-styled/index.tsx | 2 +- 117 files changed, 117 insertions(+), 117 deletions(-) diff --git a/packages/mui-material/src/Accordion/Accordion.d.ts b/packages/mui-material/src/Accordion/Accordion.d.ts index 13079334f1ec50..0049be47e04046 100644 --- a/packages/mui-material/src/Accordion/Accordion.d.ts +++ b/packages/mui-material/src/Accordion/Accordion.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { TransitionProps } from '../transitions/transition'; import { AccordionClasses } from './accordionClasses'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; diff --git a/packages/mui-material/src/AccordionActions/AccordionActions.d.ts b/packages/mui-material/src/AccordionActions/AccordionActions.d.ts index 1f5148ab00a766..06c05a9260ca2c 100644 --- a/packages/mui-material/src/AccordionActions/AccordionActions.d.ts +++ b/packages/mui-material/src/AccordionActions/AccordionActions.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { AccordionActionsClasses } from './accordionActionsClasses'; diff --git a/packages/mui-material/src/AccordionDetails/AccordionDetails.d.ts b/packages/mui-material/src/AccordionDetails/AccordionDetails.d.ts index 4f248fd39d2f8e..6332a76e12bdf6 100644 --- a/packages/mui-material/src/AccordionDetails/AccordionDetails.d.ts +++ b/packages/mui-material/src/AccordionDetails/AccordionDetails.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { AccordionDetailsClasses } from './accordionDetailsClasses'; diff --git a/packages/mui-material/src/AccordionSummary/AccordionSummary.d.ts b/packages/mui-material/src/AccordionSummary/AccordionSummary.d.ts index b57be73430895d..f0113aa57d100c 100644 --- a/packages/mui-material/src/AccordionSummary/AccordionSummary.d.ts +++ b/packages/mui-material/src/AccordionSummary/AccordionSummary.d.ts @@ -3,7 +3,7 @@ import { SxProps } from '@mui/system'; import { ButtonBaseProps, ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps } from '../OverridableComponent'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { AccordionSummaryClasses } from './accordionSummaryClasses'; export interface AccordionSummarySlots { diff --git a/packages/mui-material/src/Alert/Alert.d.ts b/packages/mui-material/src/Alert/Alert.d.ts index 07cbe88f0027ce..f0ad2284a6c575 100644 --- a/packages/mui-material/src/Alert/Alert.d.ts +++ b/packages/mui-material/src/Alert/Alert.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { OverridableStringUnion } from '@mui/types'; import { SxProps } from '@mui/system'; import { SvgIconProps } from '../SvgIcon'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { IconButtonProps } from '../IconButton'; import { PaperProps } from '../Paper'; diff --git a/packages/mui-material/src/AlertTitle/AlertTitle.d.ts b/packages/mui-material/src/AlertTitle/AlertTitle.d.ts index a13424acd691f0..191fa9107e27b1 100644 --- a/packages/mui-material/src/AlertTitle/AlertTitle.d.ts +++ b/packages/mui-material/src/AlertTitle/AlertTitle.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { TypographyProps } from '../Typography'; import { AlertTitleClasses } from './alertTitleClasses'; diff --git a/packages/mui-material/src/Autocomplete/Autocomplete.d.ts b/packages/mui-material/src/Autocomplete/Autocomplete.d.ts index 789cb00a8405da..f078ac5e713078 100644 --- a/packages/mui-material/src/Autocomplete/Autocomplete.d.ts +++ b/packages/mui-material/src/Autocomplete/Autocomplete.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { IconButtonProps } from '../IconButton'; import { ChipProps, ChipTypeMap } from '../Chip'; diff --git a/packages/mui-material/src/Avatar/Avatar.d.ts b/packages/mui-material/src/Avatar/Avatar.d.ts index 27dbebb88f5426..08d2a929762033 100644 --- a/packages/mui-material/src/Avatar/Avatar.d.ts +++ b/packages/mui-material/src/Avatar/Avatar.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { AvatarClasses } from './avatarClasses'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; diff --git a/packages/mui-material/src/AvatarGroup/AvatarGroup.d.ts b/packages/mui-material/src/AvatarGroup/AvatarGroup.d.ts index 18b1301fae861d..b6670ab65b1c56 100644 --- a/packages/mui-material/src/AvatarGroup/AvatarGroup.d.ts +++ b/packages/mui-material/src/AvatarGroup/AvatarGroup.d.ts @@ -6,7 +6,7 @@ import { PartiallyRequired, } from '@mui/types'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { AvatarGroupClasses } from './avatarGroupClasses'; import Avatar from '../Avatar'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; diff --git a/packages/mui-material/src/Backdrop/Backdrop.d.ts b/packages/mui-material/src/Backdrop/Backdrop.d.ts index d329a26e5faa98..6ebaf93dd3721e 100644 --- a/packages/mui-material/src/Backdrop/Backdrop.d.ts +++ b/packages/mui-material/src/Backdrop/Backdrop.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { FadeProps } from '../Fade'; import { TransitionProps } from '../transitions/transition'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { BackdropClasses } from './backdropClasses'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { CreateSlotsAndSlotProps, SlotComponentProps, SlotProps } from '../utils/types'; diff --git a/packages/mui-material/src/Badge/Badge.d.ts b/packages/mui-material/src/Badge/Badge.d.ts index f632622cbedbcf..d4ff9263ed09c3 100644 --- a/packages/mui-material/src/Badge/Badge.d.ts +++ b/packages/mui-material/src/Badge/Badge.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion, Simplify } from '@mui/types'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { BadgeClasses } from './badgeClasses'; diff --git a/packages/mui-material/src/BottomNavigation/BottomNavigation.d.ts b/packages/mui-material/src/BottomNavigation/BottomNavigation.d.ts index 8ee3712d347df5..c44e8cc7b35816 100644 --- a/packages/mui-material/src/BottomNavigation/BottomNavigation.d.ts +++ b/packages/mui-material/src/BottomNavigation/BottomNavigation.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { BottomNavigationClasses } from './bottomNavigationClasses'; diff --git a/packages/mui-material/src/BottomNavigationAction/BottomNavigationAction.d.ts b/packages/mui-material/src/BottomNavigationAction/BottomNavigationAction.d.ts index c7dfbccffb9412..2c2785fa2d0d64 100644 --- a/packages/mui-material/src/BottomNavigationAction/BottomNavigationAction.d.ts +++ b/packages/mui-material/src/BottomNavigationAction/BottomNavigationAction.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { ButtonBaseProps, ButtonBaseTypeMap, diff --git a/packages/mui-material/src/Breadcrumbs/Breadcrumbs.d.ts b/packages/mui-material/src/Breadcrumbs/Breadcrumbs.d.ts index 66f8e9f0ea71ba..bce2522f3ddd20 100644 --- a/packages/mui-material/src/Breadcrumbs/Breadcrumbs.d.ts +++ b/packages/mui-material/src/Breadcrumbs/Breadcrumbs.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { SlotComponentProps } from '../utils/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { BreadcrumbsClasses } from './breadcrumbsClasses'; import SvgIcon from '../SvgIcon'; diff --git a/packages/mui-material/src/Button/Button.d.ts b/packages/mui-material/src/Button/Button.d.ts index 0e32a0b6ab459e..6631773b2a7b72 100644 --- a/packages/mui-material/src/Button/Button.d.ts +++ b/packages/mui-material/src/Button/Button.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { DistributiveOmit, OverridableStringUnion } from '@mui/types'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps, OverridableComponent, OverridableTypeMap } from '../OverridableComponent'; import { ButtonClasses } from './buttonClasses'; diff --git a/packages/mui-material/src/ButtonBase/ButtonBase.d.ts b/packages/mui-material/src/ButtonBase/ButtonBase.d.ts index 66eb592b9e6bc7..2e601c449a7239 100644 --- a/packages/mui-material/src/ButtonBase/ButtonBase.d.ts +++ b/packages/mui-material/src/ButtonBase/ButtonBase.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { TouchRippleActions, TouchRippleProps } from './TouchRipple'; import { OverrideProps, OverridableComponent, OverridableTypeMap } from '../OverridableComponent'; import { ButtonBaseClasses } from './buttonBaseClasses'; diff --git a/packages/mui-material/src/ButtonGroup/ButtonGroup.d.ts b/packages/mui-material/src/ButtonGroup/ButtonGroup.d.ts index 75eab285d16818..d46519a47c824c 100644 --- a/packages/mui-material/src/ButtonGroup/ButtonGroup.d.ts +++ b/packages/mui-material/src/ButtonGroup/ButtonGroup.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { ButtonGroupClasses } from './buttonGroupClasses'; export interface ButtonGroupPropsColorOverrides {} diff --git a/packages/mui-material/src/Card/Card.d.ts b/packages/mui-material/src/Card/Card.d.ts index 8e4da68393723c..b30cffe687da45 100644 --- a/packages/mui-material/src/Card/Card.d.ts +++ b/packages/mui-material/src/Card/Card.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { DistributiveOmit } from '@mui/types'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { PaperOwnProps } from '../Paper'; import { CardClasses } from './cardClasses'; diff --git a/packages/mui-material/src/CardActionArea/CardActionArea.d.ts b/packages/mui-material/src/CardActionArea/CardActionArea.d.ts index 0b5020f463ff63..0e5fed61c5611f 100644 --- a/packages/mui-material/src/CardActionArea/CardActionArea.d.ts +++ b/packages/mui-material/src/CardActionArea/CardActionArea.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { SlotProps, CreateSlotsAndSlotProps } from '../utils/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { ButtonBaseProps, ButtonBaseTypeMap, diff --git a/packages/mui-material/src/CardActions/CardActions.d.ts b/packages/mui-material/src/CardActions/CardActions.d.ts index 1d4aff55ddf182..8bd18339b73f2e 100644 --- a/packages/mui-material/src/CardActions/CardActions.d.ts +++ b/packages/mui-material/src/CardActions/CardActions.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { CardActionsClasses } from './cardActionsClasses'; diff --git a/packages/mui-material/src/CardContent/CardContent.d.ts b/packages/mui-material/src/CardContent/CardContent.d.ts index dcd4246e81fe29..48deaa160d7308 100644 --- a/packages/mui-material/src/CardContent/CardContent.d.ts +++ b/packages/mui-material/src/CardContent/CardContent.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { CardContentClasses } from './cardContentClasses'; export interface CardContentOwnProps { diff --git a/packages/mui-material/src/CardHeader/CardHeader.d.ts b/packages/mui-material/src/CardHeader/CardHeader.d.ts index 3f9c7ae8e71a96..1bfd14bd8ed2c0 100644 --- a/packages/mui-material/src/CardHeader/CardHeader.d.ts +++ b/packages/mui-material/src/CardHeader/CardHeader.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { TypographyProps } from '../Typography'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; import { CardHeaderClasses } from './cardHeaderClasses'; diff --git a/packages/mui-material/src/CardMedia/CardMedia.d.ts b/packages/mui-material/src/CardMedia/CardMedia.d.ts index 65cfa85db78d23..4281c988f4587f 100644 --- a/packages/mui-material/src/CardMedia/CardMedia.d.ts +++ b/packages/mui-material/src/CardMedia/CardMedia.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { CardMediaClasses } from './cardMediaClasses'; diff --git a/packages/mui-material/src/Checkbox/Checkbox.d.ts b/packages/mui-material/src/Checkbox/Checkbox.d.ts index 34d1b6d9a1a1f4..19767edd71cd3f 100644 --- a/packages/mui-material/src/Checkbox/Checkbox.d.ts +++ b/packages/mui-material/src/Checkbox/Checkbox.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; import { SwitchBaseProps } from '../internal/SwitchBase'; diff --git a/packages/mui-material/src/Chip/Chip.d.ts b/packages/mui-material/src/Chip/Chip.d.ts index 06f81d7d09a6bc..6719df6785ac11 100644 --- a/packages/mui-material/src/Chip/Chip.d.ts +++ b/packages/mui-material/src/Chip/Chip.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { OverridableStringUnion } from '@mui/types'; import { SxProps } from '@mui/system'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { ChipClasses } from './chipClasses'; diff --git a/packages/mui-material/src/CircularProgress/CircularProgress.d.ts b/packages/mui-material/src/CircularProgress/CircularProgress.d.ts index 8caa6abdced8d5..f0cb53e459803c 100644 --- a/packages/mui-material/src/CircularProgress/CircularProgress.d.ts +++ b/packages/mui-material/src/CircularProgress/CircularProgress.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { CircularProgressClasses } from './circularProgressClasses'; diff --git a/packages/mui-material/src/Collapse/Collapse.d.ts b/packages/mui-material/src/Collapse/Collapse.d.ts index bdab394f7fa3fd..f27e9f349077e1 100644 --- a/packages/mui-material/src/Collapse/Collapse.d.ts +++ b/packages/mui-material/src/Collapse/Collapse.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { TransitionProps } from '../transitions/transition'; import { CollapseClasses } from './collapseClasses'; diff --git a/packages/mui-material/src/Container/Container.d.ts b/packages/mui-material/src/Container/Container.d.ts index 9416144afe2943..e4a192d446ef55 100644 --- a/packages/mui-material/src/Container/Container.d.ts +++ b/packages/mui-material/src/Container/Container.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps, Breakpoint } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { ContainerClasses } from './containerClasses'; diff --git a/packages/mui-material/src/Dialog/Dialog.d.ts b/packages/mui-material/src/Dialog/Dialog.d.ts index 0069a75f7b1252..e89c3ee6e52e29 100644 --- a/packages/mui-material/src/Dialog/Dialog.d.ts +++ b/packages/mui-material/src/Dialog/Dialog.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps, Breakpoint } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { BackdropProps } from '../Backdrop'; import { PaperProps } from '../Paper'; diff --git a/packages/mui-material/src/DialogActions/DialogActions.d.ts b/packages/mui-material/src/DialogActions/DialogActions.d.ts index c9bb4e960378b0..0107c16a714fb2 100644 --- a/packages/mui-material/src/DialogActions/DialogActions.d.ts +++ b/packages/mui-material/src/DialogActions/DialogActions.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { DialogActionsClasses } from './dialogActionsClasses'; diff --git a/packages/mui-material/src/DialogContent/DialogContent.d.ts b/packages/mui-material/src/DialogContent/DialogContent.d.ts index 05a238bfea6452..5de85ba3d4d56d 100644 --- a/packages/mui-material/src/DialogContent/DialogContent.d.ts +++ b/packages/mui-material/src/DialogContent/DialogContent.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { DialogContentClasses } from './dialogContentClasses'; diff --git a/packages/mui-material/src/DialogContentText/DialogContentText.d.ts b/packages/mui-material/src/DialogContentText/DialogContentText.d.ts index 4241654030a832..545d2a979f4d66 100644 --- a/packages/mui-material/src/DialogContentText/DialogContentText.d.ts +++ b/packages/mui-material/src/DialogContentText/DialogContentText.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { TypographyTypeMap } from '../Typography'; import { OverrideProps, OverridableComponent } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { DialogContentTextClasses } from './dialogContentTextClasses'; export interface DialogContentTextOwnProps extends Omit { diff --git a/packages/mui-material/src/DialogTitle/DialogTitle.d.ts b/packages/mui-material/src/DialogTitle/DialogTitle.d.ts index 3586405748dc38..13f495f93a5a7b 100644 --- a/packages/mui-material/src/DialogTitle/DialogTitle.d.ts +++ b/packages/mui-material/src/DialogTitle/DialogTitle.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { TypographyTypeMap } from '../Typography'; import { DialogTitleClasses } from './dialogTitleClasses'; diff --git a/packages/mui-material/src/Divider/Divider.d.ts b/packages/mui-material/src/Divider/Divider.d.ts index 25b5f969e88339..c429798e6e0c51 100644 --- a/packages/mui-material/src/Divider/Divider.d.ts +++ b/packages/mui-material/src/Divider/Divider.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { OverridableStringUnion } from '@mui/types'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { DividerClasses } from './dividerClasses'; diff --git a/packages/mui-material/src/Drawer/Drawer.d.ts b/packages/mui-material/src/Drawer/Drawer.d.ts index 58fdfd9bb80cc6..c660e1173bd71b 100644 --- a/packages/mui-material/src/Drawer/Drawer.d.ts +++ b/packages/mui-material/src/Drawer/Drawer.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; import { ModalProps } from '../Modal'; diff --git a/packages/mui-material/src/FilledInput/FilledInput.d.ts b/packages/mui-material/src/FilledInput/FilledInput.d.ts index a2903ec7107209..014d7d1a857b69 100644 --- a/packages/mui-material/src/FilledInput/FilledInput.d.ts +++ b/packages/mui-material/src/FilledInput/FilledInput.d.ts @@ -1,5 +1,5 @@ import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { InputBaseProps } from '../InputBase'; import { FilledInputClasses } from './filledInputClasses'; diff --git a/packages/mui-material/src/FormControl/FormControl.d.ts b/packages/mui-material/src/FormControl/FormControl.d.ts index 3bf94a5d6dd196..94e264ebe50941 100644 --- a/packages/mui-material/src/FormControl/FormControl.d.ts +++ b/packages/mui-material/src/FormControl/FormControl.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { FormControlClasses } from './formControlClasses'; export interface FormControlPropsSizeOverrides {} diff --git a/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts b/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts index 87df9c07eaebb5..0a2b26bcff6e6a 100644 --- a/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts +++ b/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import Typography, { TypographyProps } from '../Typography'; import { FormControlLabelClasses } from './formControlLabelClasses'; diff --git a/packages/mui-material/src/FormGroup/FormGroup.d.ts b/packages/mui-material/src/FormGroup/FormGroup.d.ts index 3e2ff166d7e54a..b0a36ee9cd90c9 100644 --- a/packages/mui-material/src/FormGroup/FormGroup.d.ts +++ b/packages/mui-material/src/FormGroup/FormGroup.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { FormGroupClasses } from './formGroupClasses'; diff --git a/packages/mui-material/src/FormHelperText/FormHelperText.d.ts b/packages/mui-material/src/FormHelperText/FormHelperText.d.ts index 0869db3920d6b8..b3fdc25dd37a50 100644 --- a/packages/mui-material/src/FormHelperText/FormHelperText.d.ts +++ b/packages/mui-material/src/FormHelperText/FormHelperText.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { FormHelperTextClasses } from './formHelperTextClasses'; export interface FormHelperTextPropsVariantOverrides {} diff --git a/packages/mui-material/src/FormLabel/FormLabel.d.ts b/packages/mui-material/src/FormLabel/FormLabel.d.ts index f332f4d1c1a33d..797fe4ba3e62cb 100644 --- a/packages/mui-material/src/FormLabel/FormLabel.d.ts +++ b/packages/mui-material/src/FormLabel/FormLabel.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps, OverridableTypeMap } from '../OverridableComponent'; import { FormLabelClasses } from './formLabelClasses'; diff --git a/packages/mui-material/src/GlobalStyles/GlobalStyles.d.ts b/packages/mui-material/src/GlobalStyles/GlobalStyles.d.ts index a5f9b45d7ab4fc..5201b91eafea64 100644 --- a/packages/mui-material/src/GlobalStyles/GlobalStyles.d.ts +++ b/packages/mui-material/src/GlobalStyles/GlobalStyles.d.ts @@ -1,5 +1,5 @@ import { GlobalStylesProps as StyledGlobalStylesProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; export interface GlobalStylesProps { /** diff --git a/packages/mui-material/src/GridLegacy/GridLegacy.d.ts b/packages/mui-material/src/GridLegacy/GridLegacy.d.ts index e97350963e7d6d..fa1ddb8253f136 100644 --- a/packages/mui-material/src/GridLegacy/GridLegacy.d.ts +++ b/packages/mui-material/src/GridLegacy/GridLegacy.d.ts @@ -7,7 +7,7 @@ import { BreakpointOverrides, } from '@mui/system'; import { IfEquals } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { GridLegacyClasses } from './gridLegacyClasses'; diff --git a/packages/mui-material/src/Icon/Icon.d.ts b/packages/mui-material/src/Icon/Icon.d.ts index 643e8a9667a12d..a0b3ff07f036a3 100644 --- a/packages/mui-material/src/Icon/Icon.d.ts +++ b/packages/mui-material/src/Icon/Icon.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { IconClasses } from './iconClasses'; diff --git a/packages/mui-material/src/IconButton/IconButton.d.ts b/packages/mui-material/src/IconButton/IconButton.d.ts index b28c9d8983f232..19ead23169c40c 100644 --- a/packages/mui-material/src/IconButton/IconButton.d.ts +++ b/packages/mui-material/src/IconButton/IconButton.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps } from '../OverridableComponent'; import { IconButtonClasses } from './iconButtonClasses'; diff --git a/packages/mui-material/src/ImageList/ImageList.d.ts b/packages/mui-material/src/ImageList/ImageList.d.ts index 0b14c467dea56f..dee94f462d2674 100644 --- a/packages/mui-material/src/ImageList/ImageList.d.ts +++ b/packages/mui-material/src/ImageList/ImageList.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { ImageListClasses } from './imageListClasses'; diff --git a/packages/mui-material/src/ImageListItem/ImageListItem.d.ts b/packages/mui-material/src/ImageListItem/ImageListItem.d.ts index 8d1b8af3087a4a..5877558ea152b1 100644 --- a/packages/mui-material/src/ImageListItem/ImageListItem.d.ts +++ b/packages/mui-material/src/ImageListItem/ImageListItem.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { ImageListItemClasses } from './imageListItemClasses'; diff --git a/packages/mui-material/src/ImageListItemBar/ImageListItemBar.d.ts b/packages/mui-material/src/ImageListItemBar/ImageListItemBar.d.ts index a2497ce76e91b0..452df549545fbb 100644 --- a/packages/mui-material/src/ImageListItemBar/ImageListItemBar.d.ts +++ b/packages/mui-material/src/ImageListItemBar/ImageListItemBar.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { ImageListItemBarClasses } from './imageListItemBarClasses'; diff --git a/packages/mui-material/src/Input/Input.d.ts b/packages/mui-material/src/Input/Input.d.ts index 09eeb86b2bc811..9d2f63c744cd83 100644 --- a/packages/mui-material/src/Input/Input.d.ts +++ b/packages/mui-material/src/Input/Input.d.ts @@ -1,5 +1,5 @@ import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { InputBaseProps } from '../InputBase'; import { InputClasses } from './inputClasses'; diff --git a/packages/mui-material/src/InputAdornment/InputAdornment.d.ts b/packages/mui-material/src/InputAdornment/InputAdornment.d.ts index 0c4083d21460db..cc17bbe5460d16 100644 --- a/packages/mui-material/src/InputAdornment/InputAdornment.d.ts +++ b/packages/mui-material/src/InputAdornment/InputAdornment.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InputAdornmentClasses } from './inputAdornmentClasses'; export interface InputAdornmentOwnProps { diff --git a/packages/mui-material/src/InputBase/InputBase.d.ts b/packages/mui-material/src/InputBase/InputBase.d.ts index 21040080f02eec..b72ce3c35213a0 100644 --- a/packages/mui-material/src/InputBase/InputBase.d.ts +++ b/packages/mui-material/src/InputBase/InputBase.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { InputBaseClasses } from './inputBaseClasses'; diff --git a/packages/mui-material/src/InputLabel/InputLabel.d.ts b/packages/mui-material/src/InputLabel/InputLabel.d.ts index 22d25409d41828..b1a14612ecbe8b 100644 --- a/packages/mui-material/src/InputLabel/InputLabel.d.ts +++ b/packages/mui-material/src/InputLabel/InputLabel.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; import { FormLabelProps, ExtendFormLabelTypeMap } from '../FormLabel'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InputLabelClasses } from './inputLabelClasses'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; diff --git a/packages/mui-material/src/LinearProgress/LinearProgress.d.ts b/packages/mui-material/src/LinearProgress/LinearProgress.d.ts index 5b0586be0ed0d5..9843d2295f4a9c 100644 --- a/packages/mui-material/src/LinearProgress/LinearProgress.d.ts +++ b/packages/mui-material/src/LinearProgress/LinearProgress.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { LinearProgressClasses } from './linearProgressClasses'; diff --git a/packages/mui-material/src/Link/Link.d.ts b/packages/mui-material/src/Link/Link.d.ts index d144f31447d7ff..f5b1d317528310 100644 --- a/packages/mui-material/src/Link/Link.d.ts +++ b/packages/mui-material/src/Link/Link.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { DistributiveOmit } from '@mui/types'; import { SxProps } from '@mui/system'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { TypographyOwnProps } from '../Typography'; import { LinkClasses } from './linkClasses'; diff --git a/packages/mui-material/src/List/List.d.ts b/packages/mui-material/src/List/List.d.ts index 4428576dc6e6ae..c1116f08edd51e 100644 --- a/packages/mui-material/src/List/List.d.ts +++ b/packages/mui-material/src/List/List.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverridableTypeMap, OverrideProps } from '../OverridableComponent'; import { ListClasses } from './listClasses'; diff --git a/packages/mui-material/src/ListItem/ListItem.d.ts b/packages/mui-material/src/ListItem/ListItem.d.ts index 8ae949d3edc526..7b764f185173a7 100644 --- a/packages/mui-material/src/ListItem/ListItem.d.ts +++ b/packages/mui-material/src/ListItem/ListItem.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { ListItemClasses } from './listItemClasses'; diff --git a/packages/mui-material/src/ListItemAvatar/ListItemAvatar.d.ts b/packages/mui-material/src/ListItemAvatar/ListItemAvatar.d.ts index a6e4753064c73b..db4e14d773e64e 100644 --- a/packages/mui-material/src/ListItemAvatar/ListItemAvatar.d.ts +++ b/packages/mui-material/src/ListItemAvatar/ListItemAvatar.d.ts @@ -1,5 +1,5 @@ import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { ListItemAvatarClasses } from './listItemAvatarClasses'; diff --git a/packages/mui-material/src/ListItemButton/ListItemButton.d.ts b/packages/mui-material/src/ListItemButton/ListItemButton.d.ts index 9172789eaa7ea1..e9e9aff1b879db 100644 --- a/packages/mui-material/src/ListItemButton/ListItemButton.d.ts +++ b/packages/mui-material/src/ListItemButton/ListItemButton.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps } from '../OverridableComponent'; import { ListItemButtonClasses } from './listItemButtonClasses'; diff --git a/packages/mui-material/src/ListItemIcon/ListItemIcon.d.ts b/packages/mui-material/src/ListItemIcon/ListItemIcon.d.ts index 89af755b187908..8686b871a181e0 100644 --- a/packages/mui-material/src/ListItemIcon/ListItemIcon.d.ts +++ b/packages/mui-material/src/ListItemIcon/ListItemIcon.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { ListItemIconClasses } from './listItemIconClasses'; diff --git a/packages/mui-material/src/ListItemSecondaryAction/ListItemSecondaryAction.d.ts b/packages/mui-material/src/ListItemSecondaryAction/ListItemSecondaryAction.d.ts index 40764e2cb16f0e..4887aae0930efa 100644 --- a/packages/mui-material/src/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +++ b/packages/mui-material/src/ListItemSecondaryAction/ListItemSecondaryAction.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { ListItemSecondaryActionClasses } from './listItemSecondaryActionClasses'; diff --git a/packages/mui-material/src/ListItemText/ListItemText.d.ts b/packages/mui-material/src/ListItemText/ListItemText.d.ts index dbcfd79f3dca33..b03a226838f63f 100644 --- a/packages/mui-material/src/ListItemText/ListItemText.d.ts +++ b/packages/mui-material/src/ListItemText/ListItemText.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { TypographyProps } from '../Typography'; import { ListItemTextClasses } from './listItemTextClasses'; diff --git a/packages/mui-material/src/ListSubheader/ListSubheader.d.ts b/packages/mui-material/src/ListSubheader/ListSubheader.d.ts index 9d728c99223af7..cac4507e253bbd 100644 --- a/packages/mui-material/src/ListSubheader/ListSubheader.d.ts +++ b/packages/mui-material/src/ListSubheader/ListSubheader.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { ListSubheaderClasses } from './listSubheaderClasses'; diff --git a/packages/mui-material/src/Menu/Menu.d.ts b/packages/mui-material/src/Menu/Menu.d.ts index 88259c7056a96d..b7023dd764783e 100644 --- a/packages/mui-material/src/Menu/Menu.d.ts +++ b/packages/mui-material/src/Menu/Menu.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { PaperProps } from '../Paper'; import { PopoverProps } from '../Popover'; diff --git a/packages/mui-material/src/MenuItem/MenuItem.d.ts b/packages/mui-material/src/MenuItem/MenuItem.d.ts index 76f2fe665f8070..749db5931084b6 100644 --- a/packages/mui-material/src/MenuItem/MenuItem.d.ts +++ b/packages/mui-material/src/MenuItem/MenuItem.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps } from '../OverridableComponent'; import { MenuItemClasses } from './menuItemClasses'; diff --git a/packages/mui-material/src/MobileStepper/MobileStepper.d.ts b/packages/mui-material/src/MobileStepper/MobileStepper.d.ts index 491e2c96d2e3de..74c7ff870bd16e 100644 --- a/packages/mui-material/src/MobileStepper/MobileStepper.d.ts +++ b/packages/mui-material/src/MobileStepper/MobileStepper.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { PaperProps } from '../Paper'; import { LinearProgressProps } from '../LinearProgress'; diff --git a/packages/mui-material/src/Modal/Modal.d.ts b/packages/mui-material/src/Modal/Modal.d.ts index 45433c7056efb9..47ca5758a700e6 100644 --- a/packages/mui-material/src/Modal/Modal.d.ts +++ b/packages/mui-material/src/Modal/Modal.d.ts @@ -3,7 +3,7 @@ import { SxProps } from '@mui/system'; import { OverrideProps } from '@mui/types'; import { SlotComponentProps } from '../utils/types'; import { PortalProps } from '../Portal'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import Backdrop, { BackdropProps } from '../Backdrop'; import { OverridableComponent } from '../OverridableComponent'; import { ModalClasses } from './modalClasses'; diff --git a/packages/mui-material/src/NativeSelect/NativeSelect.d.ts b/packages/mui-material/src/NativeSelect/NativeSelect.d.ts index 8b211dd54d2832..4c8cd9ea3c7bbc 100644 --- a/packages/mui-material/src/NativeSelect/NativeSelect.d.ts +++ b/packages/mui-material/src/NativeSelect/NativeSelect.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { InputProps } from '../Input'; import { NativeSelectInputProps } from './NativeSelectInput'; diff --git a/packages/mui-material/src/NativeSelect/NativeSelectInput.d.ts b/packages/mui-material/src/NativeSelect/NativeSelectInput.d.ts index 633c5ee3bf491e..6c40f3d38e5da6 100644 --- a/packages/mui-material/src/NativeSelect/NativeSelectInput.d.ts +++ b/packages/mui-material/src/NativeSelect/NativeSelectInput.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; export interface NativeSelectInputProps extends React.SelectHTMLAttributes { disabled?: boolean; diff --git a/packages/mui-material/src/OutlinedInput/OutlinedInput.d.ts b/packages/mui-material/src/OutlinedInput/OutlinedInput.d.ts index 7af6427a1e0bf3..677698d386acda 100644 --- a/packages/mui-material/src/OutlinedInput/OutlinedInput.d.ts +++ b/packages/mui-material/src/OutlinedInput/OutlinedInput.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { InputBaseProps } from '../InputBase'; import { OutlinedInputClasses } from './outlinedInputClasses'; diff --git a/packages/mui-material/src/OverridableComponent/index.ts b/packages/mui-material/src/OverridableComponent/index.ts index ea7448789b44cf..3dbcb954a9f175 100644 --- a/packages/mui-material/src/OverridableComponent/index.ts +++ b/packages/mui-material/src/OverridableComponent/index.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { DistributiveOmit } from '@mui/types'; -import { StyledComponentProps } from '../styles'; +import { StyledComponentProps } from '../stylesOptimized'; /** * A component whose root component can be controlled via a `component` prop. diff --git a/packages/mui-material/src/Pagination/Pagination.d.ts b/packages/mui-material/src/Pagination/Pagination.d.ts index 46b5743c815f20..c27d32a73eed3b 100644 --- a/packages/mui-material/src/Pagination/Pagination.d.ts +++ b/packages/mui-material/src/Pagination/Pagination.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { OverridableStringUnion } from '@mui/types'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { UsePaginationItem, UsePaginationProps } from '../usePagination/usePagination'; import { PaginationClasses } from './paginationClasses'; diff --git a/packages/mui-material/src/PaginationItem/PaginationItem.d.ts b/packages/mui-material/src/PaginationItem/PaginationItem.d.ts index a2f42524a5232a..ec570828d3a56b 100644 --- a/packages/mui-material/src/PaginationItem/PaginationItem.d.ts +++ b/packages/mui-material/src/PaginationItem/PaginationItem.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { OverridableStringUnion } from '@mui/types'; import { SxProps } from '@mui/system'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { UsePaginationItem } from '../usePagination/usePagination'; import { PaginationItemClasses } from './paginationItemClasses'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; diff --git a/packages/mui-material/src/Paper/Paper.d.ts b/packages/mui-material/src/Paper/Paper.d.ts index 4c35061f6e3395..ce976bd433baa5 100644 --- a/packages/mui-material/src/Paper/Paper.d.ts +++ b/packages/mui-material/src/Paper/Paper.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverrideProps, OverridableComponent, OverridableTypeMap } from '../OverridableComponent'; import { PaperClasses } from './paperClasses'; diff --git a/packages/mui-material/src/PigmentContainer/PigmentContainer.tsx b/packages/mui-material/src/PigmentContainer/PigmentContainer.tsx index 9ea90947bfe742..85069e11ce9773 100644 --- a/packages/mui-material/src/PigmentContainer/PigmentContainer.tsx +++ b/packages/mui-material/src/PigmentContainer/PigmentContainer.tsx @@ -8,7 +8,7 @@ import capitalize from '@mui/utils/capitalize'; import composeClasses from '@mui/utils/composeClasses'; import generateUtilityClass from '@mui/utils/generateUtilityClass'; import { SxProps, Breakpoint } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { ContainerClasses } from '../Container/containerClasses'; export interface PigmentContainerOwnProps { diff --git a/packages/mui-material/src/Popover/Popover.d.ts b/packages/mui-material/src/Popover/Popover.d.ts index 5363e21ff207bd..2dc5b412d15902 100644 --- a/packages/mui-material/src/Popover/Popover.d.ts +++ b/packages/mui-material/src/Popover/Popover.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { SlotComponentProps } from '@mui/utils/types'; import { BackdropProps } from '../Backdrop'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import Paper, { PaperProps } from '../Paper'; import Modal, { ModalProps } from '../Modal'; diff --git a/packages/mui-material/src/Popper/Popper.tsx b/packages/mui-material/src/Popper/Popper.tsx index d0b90220bc3da8..85335e795ce76d 100644 --- a/packages/mui-material/src/Popper/Popper.tsx +++ b/packages/mui-material/src/Popper/Popper.tsx @@ -7,7 +7,7 @@ import PropTypes from 'prop-types'; import * as React from 'react'; import BasePopper from './BasePopper'; import { PopperProps as BasePopperProps } from './BasePopper.types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { styled } from '../zero-styled'; import { useDefaultProps } from '../DefaultPropsProvider'; diff --git a/packages/mui-material/src/Radio/Radio.d.ts b/packages/mui-material/src/Radio/Radio.d.ts index 30036021c8cd9e..a26cac0e0cbd1c 100644 --- a/packages/mui-material/src/Radio/Radio.d.ts +++ b/packages/mui-material/src/Radio/Radio.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; import { SwitchBaseProps } from '../internal/SwitchBase'; diff --git a/packages/mui-material/src/Rating/Rating.d.ts b/packages/mui-material/src/Rating/Rating.d.ts index 09a5d5f751e571..fc0a8b05fd656e 100644 --- a/packages/mui-material/src/Rating/Rating.d.ts +++ b/packages/mui-material/src/Rating/Rating.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { RatingClasses } from './ratingClasses'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; diff --git a/packages/mui-material/src/ScopedCssBaseline/ScopedCssBaseline.d.ts b/packages/mui-material/src/ScopedCssBaseline/ScopedCssBaseline.d.ts index d4224ff66fefea..c87dd4c6b1429e 100644 --- a/packages/mui-material/src/ScopedCssBaseline/ScopedCssBaseline.d.ts +++ b/packages/mui-material/src/ScopedCssBaseline/ScopedCssBaseline.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { ScopedCssBaselineClasses } from './scopedCssBaselineClasses'; diff --git a/packages/mui-material/src/Select/Select.d.ts b/packages/mui-material/src/Select/Select.d.ts index 0560e197a8e357..428b47a9a3d66d 100644 --- a/packages/mui-material/src/Select/Select.d.ts +++ b/packages/mui-material/src/Select/Select.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { InputProps } from '../Input'; import { MenuProps } from '../Menu'; diff --git a/packages/mui-material/src/Select/SelectInput.d.ts b/packages/mui-material/src/Select/SelectInput.d.ts index 04bb068f51c816..c58153642361cb 100644 --- a/packages/mui-material/src/Select/SelectInput.d.ts +++ b/packages/mui-material/src/Select/SelectInput.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { MenuProps } from '../Menu'; /** diff --git a/packages/mui-material/src/Skeleton/Skeleton.d.ts b/packages/mui-material/src/Skeleton/Skeleton.d.ts index cb69022885c588..27b148144ceef3 100644 --- a/packages/mui-material/src/Skeleton/Skeleton.d.ts +++ b/packages/mui-material/src/Skeleton/Skeleton.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { SkeletonClasses } from './skeletonClasses'; diff --git a/packages/mui-material/src/Slider/Slider.d.ts b/packages/mui-material/src/Slider/Slider.d.ts index 6ec82183ee5ac8..897826a0e02c85 100644 --- a/packages/mui-material/src/Slider/Slider.d.ts +++ b/packages/mui-material/src/Slider/Slider.d.ts @@ -3,7 +3,7 @@ import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; import { Mark } from './useSlider.types'; import { SlotComponentProps } from '../utils/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverrideProps, OverridableComponent } from '../OverridableComponent'; import SliderValueLabelComponent from './SliderValueLabel'; import { SliderClasses } from './sliderClasses'; diff --git a/packages/mui-material/src/Snackbar/Snackbar.d.ts b/packages/mui-material/src/Snackbar/Snackbar.d.ts index d3397b5d2306e2..2e7cc3c257bfdb 100644 --- a/packages/mui-material/src/Snackbar/Snackbar.d.ts +++ b/packages/mui-material/src/Snackbar/Snackbar.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import ClickAwayListener, { ClickAwayListenerProps } from '../ClickAwayListener'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { SnackbarContentProps } from '../SnackbarContent'; import { TransitionProps } from '../transitions/transition'; diff --git a/packages/mui-material/src/SnackbarContent/SnackbarContent.d.ts b/packages/mui-material/src/SnackbarContent/SnackbarContent.d.ts index 0da2bcf3c8891a..0b253a868eb2b8 100644 --- a/packages/mui-material/src/SnackbarContent/SnackbarContent.d.ts +++ b/packages/mui-material/src/SnackbarContent/SnackbarContent.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { PaperProps } from '../Paper'; import { SnackbarContentClasses } from './snackbarContentClasses'; diff --git a/packages/mui-material/src/SpeedDial/SpeedDial.d.ts b/packages/mui-material/src/SpeedDial/SpeedDial.d.ts index d681a72aed2657..f23cbd782c9890 100644 --- a/packages/mui-material/src/SpeedDial/SpeedDial.d.ts +++ b/packages/mui-material/src/SpeedDial/SpeedDial.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { FabProps } from '../Fab'; import { TransitionProps } from '../transitions'; diff --git a/packages/mui-material/src/SpeedDialAction/SpeedDialAction.d.ts b/packages/mui-material/src/SpeedDialAction/SpeedDialAction.d.ts index d4366c3d4827cb..400dedf54ec790 100644 --- a/packages/mui-material/src/SpeedDialAction/SpeedDialAction.d.ts +++ b/packages/mui-material/src/SpeedDialAction/SpeedDialAction.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { FabProps } from '../Fab'; import { TooltipProps } from '../Tooltip'; diff --git a/packages/mui-material/src/SpeedDialIcon/SpeedDialIcon.d.ts b/packages/mui-material/src/SpeedDialIcon/SpeedDialIcon.d.ts index d8096df5a9ee4a..c54c5dd1c3f3a1 100644 --- a/packages/mui-material/src/SpeedDialIcon/SpeedDialIcon.d.ts +++ b/packages/mui-material/src/SpeedDialIcon/SpeedDialIcon.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { SpeedDialIconClasses } from './speedDialIconClasses'; diff --git a/packages/mui-material/src/Step/Step.d.ts b/packages/mui-material/src/Step/Step.d.ts index ccb6f1044ff242..c859b8787c081e 100644 --- a/packages/mui-material/src/Step/Step.d.ts +++ b/packages/mui-material/src/Step/Step.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { StepClasses } from './stepClasses'; export interface StepOwnProps { diff --git a/packages/mui-material/src/StepButton/StepButton.d.ts b/packages/mui-material/src/StepButton/StepButton.d.ts index 0dae1f9975af1b..72ecba39a48215 100644 --- a/packages/mui-material/src/StepButton/StepButton.d.ts +++ b/packages/mui-material/src/StepButton/StepButton.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { ButtonBaseTypeMap, ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { StepButtonClasses } from './stepButtonClasses'; export interface StepButtonOwnProps { diff --git a/packages/mui-material/src/StepConnector/StepConnector.d.ts b/packages/mui-material/src/StepConnector/StepConnector.d.ts index 1111d905040423..e2273635fbb576 100644 --- a/packages/mui-material/src/StepConnector/StepConnector.d.ts +++ b/packages/mui-material/src/StepConnector/StepConnector.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { StepConnectorClasses } from './stepConnectorClasses'; diff --git a/packages/mui-material/src/StepContent/StepContent.d.ts b/packages/mui-material/src/StepContent/StepContent.d.ts index fdbf12e2ab19d8..9adde3ef8f928f 100644 --- a/packages/mui-material/src/StepContent/StepContent.d.ts +++ b/packages/mui-material/src/StepContent/StepContent.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { CollapseProps } from '../Collapse'; import { TransitionProps } from '../transitions/transition'; diff --git a/packages/mui-material/src/StepIcon/StepIcon.d.ts b/packages/mui-material/src/StepIcon/StepIcon.d.ts index 77e4be8d96b9db..209f83de053bd4 100644 --- a/packages/mui-material/src/StepIcon/StepIcon.d.ts +++ b/packages/mui-material/src/StepIcon/StepIcon.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { SvgIconOwnProps } from '../SvgIcon'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { StepIconClasses } from './stepIconClasses'; diff --git a/packages/mui-material/src/StepLabel/StepLabel.d.ts b/packages/mui-material/src/StepLabel/StepLabel.d.ts index 53f2c7be1f1215..110dcb3d5d33e5 100644 --- a/packages/mui-material/src/StepLabel/StepLabel.d.ts +++ b/packages/mui-material/src/StepLabel/StepLabel.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { StepIconProps } from '../StepIcon'; import { StepLabelClasses } from './stepLabelClasses'; diff --git a/packages/mui-material/src/Stepper/Stepper.d.ts b/packages/mui-material/src/Stepper/Stepper.d.ts index 5fc6837acaf0b0..5b58a28cf0ad68 100644 --- a/packages/mui-material/src/Stepper/Stepper.d.ts +++ b/packages/mui-material/src/Stepper/Stepper.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { PaperProps } from '../Paper'; import { StepperClasses } from './stepperClasses'; diff --git a/packages/mui-material/src/SvgIcon/SvgIcon.d.ts b/packages/mui-material/src/SvgIcon/SvgIcon.d.ts index af45429fe43714..da69ab1837b85a 100644 --- a/packages/mui-material/src/SvgIcon/SvgIcon.d.ts +++ b/packages/mui-material/src/SvgIcon/SvgIcon.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { SvgIconClasses } from './svgIconClasses'; diff --git a/packages/mui-material/src/Switch/Switch.d.ts b/packages/mui-material/src/Switch/Switch.d.ts index 883dab4de3ff51..558874b8599eac 100644 --- a/packages/mui-material/src/Switch/Switch.d.ts +++ b/packages/mui-material/src/Switch/Switch.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; import { SwitchBaseProps } from '../internal/SwitchBase'; diff --git a/packages/mui-material/src/Tab/Tab.d.ts b/packages/mui-material/src/Tab/Tab.d.ts index 5461779d91e1f8..b67d760cdb56d2 100644 --- a/packages/mui-material/src/Tab/Tab.d.ts +++ b/packages/mui-material/src/Tab/Tab.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps } from '../OverridableComponent'; import { TabClasses } from './tabClasses'; diff --git a/packages/mui-material/src/TabScrollButton/TabScrollButton.d.ts b/packages/mui-material/src/TabScrollButton/TabScrollButton.d.ts index 3212600ab97c02..6f593235e8a408 100644 --- a/packages/mui-material/src/TabScrollButton/TabScrollButton.d.ts +++ b/packages/mui-material/src/TabScrollButton/TabScrollButton.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { SlotComponentProps } from '../utils/types'; import { ButtonBaseProps } from '../ButtonBase'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import SvgIcon from '../SvgIcon'; import { TabScrollButtonClasses } from './tabScrollButtonClasses'; diff --git a/packages/mui-material/src/Table/Table.d.ts b/packages/mui-material/src/Table/Table.d.ts index d53c9a06b36915..b2e15779658708 100644 --- a/packages/mui-material/src/Table/Table.d.ts +++ b/packages/mui-material/src/Table/Table.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TableClasses } from './tableClasses'; diff --git a/packages/mui-material/src/TableBody/TableBody.d.ts b/packages/mui-material/src/TableBody/TableBody.d.ts index 290fffc5a0bfb0..0382c4bd19a123 100644 --- a/packages/mui-material/src/TableBody/TableBody.d.ts +++ b/packages/mui-material/src/TableBody/TableBody.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TableBodyClasses } from './tableBodyClasses'; diff --git a/packages/mui-material/src/TableCell/TableCell.d.ts b/packages/mui-material/src/TableCell/TableCell.d.ts index 0fac2586cc74b1..6243d53e9e8d7a 100644 --- a/packages/mui-material/src/TableCell/TableCell.d.ts +++ b/packages/mui-material/src/TableCell/TableCell.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { OverridableStringUnion } from '@mui/types'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { TableCellClasses } from './tableCellClasses'; diff --git a/packages/mui-material/src/TableContainer/TableContainer.d.ts b/packages/mui-material/src/TableContainer/TableContainer.d.ts index 3eb38c98a64aac..9e2c4c7dc35204 100644 --- a/packages/mui-material/src/TableContainer/TableContainer.d.ts +++ b/packages/mui-material/src/TableContainer/TableContainer.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TableContainerClasses } from './tableContainerClasses'; diff --git a/packages/mui-material/src/TableFooter/TableFooter.d.ts b/packages/mui-material/src/TableFooter/TableFooter.d.ts index 5fbe9e9a14158d..e8f38f5d7a5ae8 100644 --- a/packages/mui-material/src/TableFooter/TableFooter.d.ts +++ b/packages/mui-material/src/TableFooter/TableFooter.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TableFooterClasses } from './tableFooterClasses'; diff --git a/packages/mui-material/src/TableHead/TableHead.d.ts b/packages/mui-material/src/TableHead/TableHead.d.ts index 8e8d478d6570ed..e653f382bcc02d 100644 --- a/packages/mui-material/src/TableHead/TableHead.d.ts +++ b/packages/mui-material/src/TableHead/TableHead.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TableHeadClasses } from './tableHeadClasses'; diff --git a/packages/mui-material/src/TablePagination/TablePagination.d.ts b/packages/mui-material/src/TablePagination/TablePagination.d.ts index 0a50fc42fd4810..505be880b3fcd8 100644 --- a/packages/mui-material/src/TablePagination/TablePagination.d.ts +++ b/packages/mui-material/src/TablePagination/TablePagination.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TablePaginationActionsProps, diff --git a/packages/mui-material/src/TableRow/TableRow.d.ts b/packages/mui-material/src/TableRow/TableRow.d.ts index 62c68f7d4382ac..2dd5220b0acb31 100644 --- a/packages/mui-material/src/TableRow/TableRow.d.ts +++ b/packages/mui-material/src/TableRow/TableRow.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TableRowClasses } from './tableRowClasses'; diff --git a/packages/mui-material/src/TableSortLabel/TableSortLabel.d.ts b/packages/mui-material/src/TableSortLabel/TableSortLabel.d.ts index 5de2fe77ccf34b..c888692eda1101 100644 --- a/packages/mui-material/src/TableSortLabel/TableSortLabel.d.ts +++ b/packages/mui-material/src/TableSortLabel/TableSortLabel.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps } from '../OverridableComponent'; import { TableSortLabelClasses } from './tableSortLabelClasses'; diff --git a/packages/mui-material/src/Tabs/Tabs.d.ts b/packages/mui-material/src/Tabs/Tabs.d.ts index 24ec83124669b5..df2e57af6b9ae2 100644 --- a/packages/mui-material/src/Tabs/Tabs.d.ts +++ b/packages/mui-material/src/Tabs/Tabs.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import TabScrollButton, { TabScrollButtonProps } from '../TabScrollButton'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TabsClasses } from './tabsClasses'; diff --git a/packages/mui-material/src/TextField/TextField.d.ts b/packages/mui-material/src/TextField/TextField.d.ts index d246134f11f3eb..b9f2141b1dec58 100644 --- a/packages/mui-material/src/TextField/TextField.d.ts +++ b/packages/mui-material/src/TextField/TextField.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { FormControlProps } from '../FormControl'; import { FormHelperTextProps } from '../FormHelperText'; diff --git a/packages/mui-material/src/ToggleButton/ToggleButton.d.ts b/packages/mui-material/src/ToggleButton/ToggleButton.d.ts index 7bd2be06e4ba6a..cd7efe4884c4f5 100644 --- a/packages/mui-material/src/ToggleButton/ToggleButton.d.ts +++ b/packages/mui-material/src/ToggleButton/ToggleButton.d.ts @@ -1,7 +1,7 @@ import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; import * as React from 'react'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps } from '../OverridableComponent'; import { ToggleButtonClasses } from './toggleButtonClasses'; diff --git a/packages/mui-material/src/ToggleButtonGroup/ToggleButtonGroup.d.ts b/packages/mui-material/src/ToggleButtonGroup/ToggleButtonGroup.d.ts index ccba9238c93a10..69c5b11ad89bd2 100644 --- a/packages/mui-material/src/ToggleButtonGroup/ToggleButtonGroup.d.ts +++ b/packages/mui-material/src/ToggleButtonGroup/ToggleButtonGroup.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { ToggleButtonGroupClasses } from './toggleButtonGroupClasses'; diff --git a/packages/mui-material/src/Toolbar/Toolbar.d.ts b/packages/mui-material/src/Toolbar/Toolbar.d.ts index 842d9938cd28ea..6cefd395caca74 100644 --- a/packages/mui-material/src/Toolbar/Toolbar.d.ts +++ b/packages/mui-material/src/Toolbar/Toolbar.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { ToolbarClasses } from './toolbarClasses'; diff --git a/packages/mui-material/src/Tooltip/Tooltip.d.ts b/packages/mui-material/src/Tooltip/Tooltip.d.ts index 6fc31dfd31f704..bae5f987567def 100644 --- a/packages/mui-material/src/Tooltip/Tooltip.d.ts +++ b/packages/mui-material/src/Tooltip/Tooltip.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { MUIStyledCommonProps, SxProps } from '@mui/system'; import { PopperProps } from '../Popper'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; import { InternalStandardProps as StandardProps } from '../internal'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; import { TransitionProps } from '../transitions/transition'; diff --git a/packages/mui-material/src/internal/index.ts b/packages/mui-material/src/internal/index.ts index 6986f62cbedf4a..c996a24f32f427 100644 --- a/packages/mui-material/src/internal/index.ts +++ b/packages/mui-material/src/internal/index.ts @@ -1,5 +1,5 @@ import { DistributiveOmit } from '@mui/types'; -import { StyledComponentProps } from '../styles'; +import { StyledComponentProps } from '../stylesOptimized'; /** * @internal diff --git a/packages/mui-material/src/utils/types.ts b/packages/mui-material/src/utils/types.ts index b67d6cce4486a1..0ffc08fe42ce01 100644 --- a/packages/mui-material/src/utils/types.ts +++ b/packages/mui-material/src/utils/types.ts @@ -1,6 +1,6 @@ import { SxProps } from '@mui/system'; import { SlotComponentProps } from '@mui/utils/types'; -import { Theme } from '../styles'; +import { Theme } from '../stylesOptimized'; export type { EventHandlers, diff --git a/packages/mui-material/src/zero-styled/index.tsx b/packages/mui-material/src/zero-styled/index.tsx index 159973f48008a3..b43144538c9479 100644 --- a/packages/mui-material/src/zero-styled/index.tsx +++ b/packages/mui-material/src/zero-styled/index.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { Interpolation } from '@mui/system'; import { extendSxProp } from '@mui/system/styleFunctionSx'; -import { Theme } from '../styles/createTheme'; +import { Theme } from '../stylesOptimized'; import useTheme from '../styles/useTheme'; import GlobalStyles, { GlobalStylesProps } from '../GlobalStyles'; From 1e958dde688d77207d327a9c80f28d39a803c8b3 Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Fri, 10 Oct 2025 17:24:33 +0700 Subject: [PATCH 03/31] move Theme to stylesOptimized --- .../src/styles/createThemeNoVars.d.ts | 64 +------ .../src/stylesOptimized/createTheme.d.ts | 173 ++++++++++++++++++ .../src/stylesOptimized/createTheme.js | 1 + .../mui-material/src/stylesOptimized/index.ts | 36 ++++ 4 files changed, 219 insertions(+), 55 deletions(-) create mode 100644 packages/mui-material/src/stylesOptimized/createTheme.d.ts create mode 100644 packages/mui-material/src/stylesOptimized/createTheme.js create mode 100644 packages/mui-material/src/stylesOptimized/index.ts diff --git a/packages/mui-material/src/styles/createThemeNoVars.d.ts b/packages/mui-material/src/styles/createThemeNoVars.d.ts index eb05eb58966f68..ef909c3bf87a61 100644 --- a/packages/mui-material/src/styles/createThemeNoVars.d.ts +++ b/packages/mui-material/src/styles/createThemeNoVars.d.ts @@ -1,18 +1,13 @@ -import { - ThemeOptions as SystemThemeOptions, - Theme as SystemTheme, - SxProps, - CSSObject, - SxConfig, -} from '@mui/system'; -import { Mixins, MixinsOptions } from './createMixins'; +import { ThemeOptions as SystemThemeOptions, SxConfig } from '@mui/system'; +import { MixinsOptions } from './createMixins'; import { Palette, PaletteOptions } from './createPalette'; -import { TypographyVariants, TypographyVariantsOptions } from './createTypography'; +import { TypographyVariantsOptions } from './createTypography'; import { Shadows } from './shadows'; -import { Transitions, TransitionsOptions } from './createTransitions'; -import { ZIndex, ZIndexOptions } from './zIndex'; +import { TransitionsOptions } from './createTransitions'; +import { ZIndexOptions } from './zIndex'; import { Components } from './components'; -import { CssVarsTheme, CssVarsPalette, ColorSystemOptions } from './createThemeFoundation'; +import { ColorSystemOptions } from './createThemeFoundation'; +import { Theme as ThemeOptimized } from '../stylesOptimized'; /** * To disable custom properties, use module augmentation @@ -45,49 +40,8 @@ export interface ThemeOptions extends Omit, CssVar modularCssLayers?: boolean | string; } -export interface BaseTheme extends SystemTheme { - mixins: Mixins; - palette: Palette & (CssThemeVariables extends { enabled: true } ? CssVarsPalette : {}); - shadows: Shadows; - transitions: Transitions; - typography: TypographyVariants; - zIndex: ZIndex; - unstable_strictMode?: boolean; -} - -// shut off automatic exporting for the `BaseTheme` above -export {}; - -type CssVarsProperties = CssThemeVariables extends { enabled: true } - ? Pick< - CssVarsTheme, - | 'applyStyles' - | 'colorSchemes' - | 'colorSchemeSelector' - | 'rootSelector' - | 'cssVarPrefix' - | 'defaultColorScheme' - | 'getCssVar' - | 'getColorSchemeSelector' - | 'generateThemeVars' - | 'generateStyleSheets' - | 'generateSpacing' - | 'shouldSkipGeneratingVar' - | 'vars' - > - : Partial>; - -/** - * Our [TypeScript guide on theme customization](https://mui.com/material-ui/guides/typescript/#customization-of-theme) explains in detail how you would add custom properties. - */ -export interface Theme extends BaseTheme, CssVarsProperties { - cssVariables?: false; - components?: Components; - unstable_sx: (props: SxProps) => CSSObject; - unstable_sxConfig: SxConfig; - alpha: (color: string, value: number | string) => string; - lighten: (color: string, coefficient: number | string) => string; - darken: (color: string, coefficient: number | string) => string; +export interface Theme extends ThemeOptimized { + components?: Components>; } /** diff --git a/packages/mui-material/src/stylesOptimized/createTheme.d.ts b/packages/mui-material/src/stylesOptimized/createTheme.d.ts new file mode 100644 index 00000000000000..31d3a6759a37bf --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/createTheme.d.ts @@ -0,0 +1,173 @@ +import { + ThemeOptions as SystemThemeOptions, + Theme as SystemTheme, + CSSObject, + SxProps, + SxConfig, +} from '@mui/system'; +import { Palette, PaletteOptions } from '../styles/createPalette'; +import { Mixins, MixinsOptions } from '../styles/createMixins'; +import { Shadows } from '../styles/shadows'; +import { Transitions, TransitionsOptions } from '../styles/createTransitions'; +import { TypographyVariants, TypographyVariantsOptions } from '../styles/createTypography'; +import { ZIndex, ZIndexOptions } from '../styles/zIndex'; +import { + DefaultColorScheme, + ExtendedColorScheme, + SupportedColorScheme, + ColorSystemOptions, + CssVarsTheme, + CssVarsPalette, +} from '../styles/createThemeFoundation'; + +export interface ThemeComponents { + mergeClassNameAndStyles?: boolean; + [componentName: string]: any; +} + +interface ThemeNoVarsOptions extends Omit, CssVarsOptions { + mixins?: MixinsOptions; + components?: ThemeComponents; + palette?: PaletteOptions; + shadows?: Shadows; + transitions?: TransitionsOptions; + typography?: TypographyVariantsOptions | ((palette: Palette) => TypographyVariantsOptions); + zIndex?: ZIndexOptions; + unstable_strictMode?: boolean; + unstable_sxConfig?: SxConfig; + modularCssLayers?: boolean | string; +} + +export interface CssVarsThemeOptions extends Omit { + /** + * The strategy to generate CSS variables + * + * @example 'media' + * Generate CSS variables using [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) + * + * @example '.mode-%s' + * Generate CSS variables within a class .mode-light, .mode-dark + * + * @example '[data-mode-%s]' + * Generate CSS variables within a data attribute [data-mode-light], [data-mode-dark] + */ + colorSchemeSelector?: 'media' | 'class' | 'data' | string; + /** + * Prefix of the generated CSS variables + * @default 'mui' + */ + cssVarPrefix?: string; + /** + * If `true`, the CSS color-scheme will not be set. + * https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme + * @default false + */ + disableCssColorScheme?: boolean; + /** + * If `true`, the CSS relative color will be used. + */ + nativeColor?: boolean; + /** + * The selector to generate the global CSS variables (non-color-scheme related) + * @default ':root' + * @example ':host' // (for shadow DOM) + * @see https://mui.com/material-ui/customization/shadow-dom/#3-css-theme-variables-optional + */ + rootSelector?: string; + /** + * A function to determine if the key, value should be attached as CSS Variable + * `keys` is an array that represents the object path keys. + * Ex, if the theme is { foo: { bar: 'var(--test)' } } + * then, keys = ['foo', 'bar'] + * value = 'var(--test)' + */ + shouldSkipGeneratingVar?: (keys: string[], value: string | number) => boolean; + /** + * @default 'light' + */ + defaultColorScheme?: SupportedColorScheme; + /** + * Color schemes configuration + */ + colorSchemes?: Partial> & + (ExtendedColorScheme extends string ? Record : {}); +} + +export interface CssThemeVariables {} + +type CssVarsOptions = CssThemeVariables extends { + enabled: true; +} + ? ColorSystemOptions + : {}; + +// shut off automatic exporting for the `BaseTheme` above +export {}; + +type CssVarsConfigList = + | 'colorSchemeSelector' + | 'rootSelector' + | 'disableCssColorScheme' + | 'cssVarPrefix' + | 'shouldSkipGeneratingVar' + | 'nativeColor'; + +export interface ThemeOptions extends CssVarsOptions, Omit { + cssVariables?: boolean | Pick; + palette?: PaletteOptions; +} + +export interface BaseTheme extends SystemTheme { + mixins: Mixins; + palette: Palette & (CssThemeVariables extends { enabled: true } ? CssVarsPalette : {}); + shadows: Shadows; + transitions: Transitions; + typography: TypographyVariants; + zIndex: ZIndex; + unstable_strictMode?: boolean; +} + +type CssVarsProperties = CssThemeVariables extends { enabled: true } + ? Pick< + CssVarsTheme, + | 'applyStyles' + | 'colorSchemes' + | 'colorSchemeSelector' + | 'rootSelector' + | 'cssVarPrefix' + | 'defaultColorScheme' + | 'getCssVar' + | 'getColorSchemeSelector' + | 'generateThemeVars' + | 'generateStyleSheets' + | 'generateSpacing' + | 'shouldSkipGeneratingVar' + | 'vars' + > + : Partial>; + +/** + * Our [TypeScript guide on theme customization](https://mui.com/material-ui/guides/typescript/#customization-of-theme) explains in detail how you would add custom properties. + */ +export interface Theme extends BaseTheme, CssVarsProperties { + cssVariables?: false; + components?: ThemeComponents; + unstable_sx: (props: SxProps) => CSSObject; + unstable_sxConfig: SxConfig; + alpha: (color: string, value: number | string) => string; + lighten: (color: string, coefficient: number | string) => string; + darken: (color: string, coefficient: number | string) => string; +} + +/** + * Generate a theme base on the options received. + * @param options Takes an incomplete theme object and adds the missing parts. + * @param args Deep merge the arguments with the about to be returned theme. + * @returns A complete, ready-to-use theme object. + */ +declare function createTheme( + options: ThemeOptions, // cast type to skip module augmentation test + ...args: object[] +): Theme; + +export default createTheme; diff --git a/packages/mui-material/src/stylesOptimized/createTheme.js b/packages/mui-material/src/stylesOptimized/createTheme.js new file mode 100644 index 00000000000000..363ad00254cc9d --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/createTheme.js @@ -0,0 +1 @@ +export { default } from '../styles/createTheme'; diff --git a/packages/mui-material/src/stylesOptimized/index.ts b/packages/mui-material/src/stylesOptimized/index.ts new file mode 100644 index 00000000000000..4e1437af3a8020 --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/index.ts @@ -0,0 +1,36 @@ +import { DistributiveOmit } from '@mui/types'; + +export { default as createTheme } from './createTheme'; +export { + BaseTheme, + CssThemeVariables, + CssVarsThemeOptions, + ThemeComponents, + ThemeOptions, + Theme, +} from './createTheme'; + +export type ClassNameMap = Record; +export interface StyledComponentProps { + /** + * Override or extend the styles applied to the component. + */ + classes?: Partial>; +} + +/** + * All standard components exposed by `material-ui` are `StyledComponents` with + * certain `classes`, on which one can also set a top-level `className` and inline + * `style`. + * @deprecated will be removed in v5 for internal usage only + */ +export type StandardProps< + ComponentProps, + ClassKey extends string, + Removals extends keyof ComponentProps = never, +> = DistributiveOmit & + StyledComponentProps & { + className?: string; + ref?: ComponentProps extends { ref?: infer RefType } ? RefType : React.Ref; + style?: React.CSSProperties; + }; From 054d4e1eb03c0469f88112169f34bf3347c95838 Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Mon, 13 Oct 2025 09:14:41 +0700 Subject: [PATCH 04/31] mirror exports part 1 --- .../stylesOptimized/createColorScheme.d.ts | 7 ++ .../src/stylesOptimized/createColorScheme.js | 1 + .../mui-material/src/stylesOptimized/index.ts | 68 +++++++++++++++++++ .../src/stylesOptimized/styled.d.ts | 15 ++++ .../src/stylesOptimized/styled.js | 2 + .../src/stylesOptimized/useTheme.d.ts | 3 + .../src/stylesOptimized/useTheme.js | 1 + .../src/stylesOptimized/useThemeProps.d.ts | 40 +++++++++++ .../src/stylesOptimized/useThemeProps.js | 1 + 9 files changed, 138 insertions(+) create mode 100644 packages/mui-material/src/stylesOptimized/createColorScheme.d.ts create mode 100644 packages/mui-material/src/stylesOptimized/createColorScheme.js create mode 100644 packages/mui-material/src/stylesOptimized/styled.d.ts create mode 100644 packages/mui-material/src/stylesOptimized/styled.js create mode 100644 packages/mui-material/src/stylesOptimized/useTheme.d.ts create mode 100644 packages/mui-material/src/stylesOptimized/useTheme.js create mode 100644 packages/mui-material/src/stylesOptimized/useThemeProps.d.ts create mode 100644 packages/mui-material/src/stylesOptimized/useThemeProps.js diff --git a/packages/mui-material/src/stylesOptimized/createColorScheme.d.ts b/packages/mui-material/src/stylesOptimized/createColorScheme.d.ts new file mode 100644 index 00000000000000..1d8d993e257eb3 --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/createColorScheme.d.ts @@ -0,0 +1,7 @@ +import { ColorSystemOptions } from '../styles/createThemeFoundation'; + +declare function createColorScheme( + options: ColorSystemOptions & { colorSpace?: string }, +): ColorSystemOptions; + +export default createColorScheme; diff --git a/packages/mui-material/src/stylesOptimized/createColorScheme.js b/packages/mui-material/src/stylesOptimized/createColorScheme.js new file mode 100644 index 00000000000000..789da10fa5de7b --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/createColorScheme.js @@ -0,0 +1 @@ +export { default } from '../styles/createColorScheme'; diff --git a/packages/mui-material/src/stylesOptimized/index.ts b/packages/mui-material/src/stylesOptimized/index.ts index 4e1437af3a8020..a33a9482413b07 100644 --- a/packages/mui-material/src/stylesOptimized/index.ts +++ b/packages/mui-material/src/stylesOptimized/index.ts @@ -1,5 +1,6 @@ import { DistributiveOmit } from '@mui/types'; +export { default as THEME_ID } from '../styles/identifier'; export { default as createTheme } from './createTheme'; export { BaseTheme, @@ -9,6 +10,73 @@ export { ThemeOptions, Theme, } from './createTheme'; +export { Shadows } from '../styles/shadows'; +export { ZIndex } from '../styles/zIndex'; +export { + CommonColors, + Palette, + PaletteColor, + PaletteColorOptions, + PaletteOptions, + SimplePaletteColorOptions, + TypeText, + TypeAction, + TypeBackground, + PaletteMode, + Color, +} from '../styles/createPalette'; +export { default as createColorScheme } from './createColorScheme'; +export { default as createStyles } from '../styles/createStyles'; +export { + TypographyVariants, + TypographyVariantsOptions, + TypographyStyle, + TypographyVariant, +} from '../styles/createTypography'; +export { default as responsiveFontSizes } from '../styles/responsiveFontSizes'; +export { + Duration, + Easing, + Transitions, + TransitionsOptions, + duration, + easing, +} from '../styles/createTransitions'; +export { Mixins, CSSProperties, MixinsOptions } from '../styles/createMixins'; +export { + Direction, + Breakpoint, + BreakpointOverrides, + Breakpoints, + BreakpointsOptions, + CreateMUIStyled, + Interpolation, + CSSInterpolation, + CSSObject, + css, + keyframes, + // color manipulators + hexToRgb, + rgbToHex, + hslToRgb, + decomposeColor, + recomposeColor, + getContrastRatio, + getLuminance, + emphasize, + alpha, + darken, + lighten, + ColorFormat, + ColorObject, + StyledEngineProvider, + SxProps, +} from '@mui/system'; +export { unstable_createBreakpoints } from '@mui/system/createBreakpoints'; +export { default as useTheme } from './useTheme'; +export { default as useThemeProps } from './useThemeProps'; +export * from './useThemeProps'; +export { default as styled } from './styled'; export type ClassNameMap = Record; export interface StyledComponentProps { diff --git a/packages/mui-material/src/stylesOptimized/styled.d.ts b/packages/mui-material/src/stylesOptimized/styled.d.ts new file mode 100644 index 00000000000000..f0739bd177dc7a --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/styled.d.ts @@ -0,0 +1,15 @@ +import { CreateMUIStyled } from '@mui/system'; +import { Theme } from './createTheme'; + +export { default as slotShouldForwardProp } from '../styles/slotShouldForwardProp'; +export { default as rootShouldForwardProp } from '../styles/rootShouldForwardProp'; + +/** + * Custom styled utility that has a default MUI theme. + * @param tag HTML tag or component that should serve as base. + * @param options Styled options for the created component. + * @returns React component that has styles attached to it. + */ +declare const styled: CreateMUIStyled; + +export default styled; diff --git a/packages/mui-material/src/stylesOptimized/styled.js b/packages/mui-material/src/stylesOptimized/styled.js new file mode 100644 index 00000000000000..2e02593454a25a --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/styled.js @@ -0,0 +1,2 @@ +export { default } from '../styles/styled'; +export * from '../styles/styled'; diff --git a/packages/mui-material/src/stylesOptimized/useTheme.d.ts b/packages/mui-material/src/stylesOptimized/useTheme.d.ts new file mode 100644 index 00000000000000..7fbc5ac3657c89 --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/useTheme.d.ts @@ -0,0 +1,3 @@ +import { Theme } from './createTheme'; + +export default function useTheme(): T; diff --git a/packages/mui-material/src/stylesOptimized/useTheme.js b/packages/mui-material/src/stylesOptimized/useTheme.js new file mode 100644 index 00000000000000..8b3aeb1eae89de --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/useTheme.js @@ -0,0 +1 @@ +export { default } from '../styles/useTheme'; diff --git a/packages/mui-material/src/stylesOptimized/useThemeProps.d.ts b/packages/mui-material/src/stylesOptimized/useThemeProps.d.ts new file mode 100644 index 00000000000000..06aabbf699df22 --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/useThemeProps.d.ts @@ -0,0 +1,40 @@ +import { Theme as ThemeWithProps } from './createTheme'; + +export type ThemedProps = Theme extends { + components: Record; +} + ? Props + : {}; + +/** + * Merges input `props` with the `defaultProps` for a component that were defined in the theme. + * + * The `defaultProps` are defined in the theme under `theme.components[componentName].defaultProps`. + * + * @example + * + * ```tsx + * const createTheme = () => ({ + * components: { + * MuiStat: { + * defaultProps: { + * variant: 'outlined', + * }, + * }, + * }, + * }); + * + * function Stat(props) { + * const themeProps = useThemeProps({ props, name: 'MuiStat' }); + * return
; + * } + * ``` + * + * @param params.props The input props + * @param params.name The name of the component as defined in the theme + */ +export default function useThemeProps< + Theme extends ThemeWithProps, + Props, + Name extends keyof any, +>(params: { props: Props; name: Name }): Props & ThemedProps; diff --git a/packages/mui-material/src/stylesOptimized/useThemeProps.js b/packages/mui-material/src/stylesOptimized/useThemeProps.js new file mode 100644 index 00000000000000..82c066fdde105e --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/useThemeProps.js @@ -0,0 +1 @@ +export { default } from '../styles/useThemeProps'; From 0607504b9c517c7d2735e102e2d3be9e0c744dba Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Mon, 13 Oct 2025 09:21:12 +0700 Subject: [PATCH 05/31] finish mirror exports --- .../src/stylesOptimized/ThemeProvider.d.ts | 81 +++++++++++++++++++ .../src/stylesOptimized/ThemeProvider.js | 1 + .../ThemeProviderWithVars.d.ts | 13 +++ .../stylesOptimized/ThemeProviderWithVars.js | 6 ++ .../createMuiStrictModeTheme.d.ts | 5 ++ .../createMuiStrictModeTheme.js | 1 + .../src/stylesOptimized/createTheme.d.ts | 27 +++++++ .../stylesOptimized/createThemeWithVars.d.ts | 9 +++ .../stylesOptimized/createThemeWithVars.js | 1 + .../mui-material/src/stylesOptimized/index.ts | 71 +++++++++++++++- 10 files changed, 211 insertions(+), 4 deletions(-) create mode 100644 packages/mui-material/src/stylesOptimized/ThemeProvider.d.ts create mode 100644 packages/mui-material/src/stylesOptimized/ThemeProvider.js create mode 100644 packages/mui-material/src/stylesOptimized/ThemeProviderWithVars.d.ts create mode 100644 packages/mui-material/src/stylesOptimized/ThemeProviderWithVars.js create mode 100644 packages/mui-material/src/stylesOptimized/createMuiStrictModeTheme.d.ts create mode 100644 packages/mui-material/src/stylesOptimized/createMuiStrictModeTheme.js create mode 100644 packages/mui-material/src/stylesOptimized/createThemeWithVars.d.ts create mode 100644 packages/mui-material/src/stylesOptimized/createThemeWithVars.js diff --git a/packages/mui-material/src/stylesOptimized/ThemeProvider.d.ts b/packages/mui-material/src/stylesOptimized/ThemeProvider.d.ts new file mode 100644 index 00000000000000..48229667c2c102 --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/ThemeProvider.d.ts @@ -0,0 +1,81 @@ +import * as React from 'react'; +import { DefaultTheme } from '@mui/system'; +import { CssThemeVariables } from './createTheme'; + +type ThemeProviderCssVariablesProps = CssThemeVariables extends { enabled: true } + ? { + /** + * The node for attaching the `theme.colorSchemeSelector`. + * @default document + */ + colorSchemeNode?: Element | null; + /** + * If `true`, the provider creates its own context and generate stylesheet as if it is a root `ThemeProvider`. + */ + disableNestedContext?: boolean; + /** + * If `true`, the style sheet for CSS theme variables won't be generated. + * + * This is useful for controlling nested ThemeProvider behavior. + * @default false + */ + disableStyleSheetGeneration?: boolean; + /** + * If `true`, theme values are recalculated when the mode changes. + * The `theme.colorSchemes.{mode}.*` nodes will be shallow merged to the top-level of the theme. + * @default false + */ + forceThemeRerender?: boolean; + } + : {}; + +export interface ThemeProviderProps extends ThemeProviderCssVariablesProps { + children?: React.ReactNode; + theme: Partial | ((outerTheme: Theme) => Theme); + /** + * The document used to perform `disableTransitionOnChange` feature + * @default document + */ + documentNode?: Document | null; + /** + * The default mode when the local storage has no mode yet, + * requires the theme to have `colorSchemes` with light and dark. + * @default 'system' + */ + defaultMode?: 'light' | 'dark' | 'system'; + /** + * The window that attaches the 'storage' event listener + * @default window + */ + storageWindow?: Window | null; + /** + * The storage manager to be used for storing the mode and color scheme + * @default using `window.localStorage` + */ + storageManager?: StorageManager | null; + /** + * localStorage key used to store application `mode` + * @default 'mui-mode' + */ + modeStorageKey?: string; + /** + * localStorage key used to store `colorScheme` + * @default 'mui-color-scheme' + */ + colorSchemeStorageKey?: string; + /* + * If `true`, ThemeProvider will not rerender and the initial value of `mode` comes from the local storage. + * For SSR applications, you must ensure that the server render output must match the initial render output on the client. + * @default false + */ + noSsr?: boolean; + /** + * Disable CSS transitions when switching between modes or color schemes + * @default false + */ + disableTransitionOnChange?: boolean; +} + +declare function ThemeProvider(): React.JSX.Element; + +export default ThemeProvider; diff --git a/packages/mui-material/src/stylesOptimized/ThemeProvider.js b/packages/mui-material/src/stylesOptimized/ThemeProvider.js new file mode 100644 index 00000000000000..fac9cf5bbc378d --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/ThemeProvider.js @@ -0,0 +1 @@ +export { default } from '../styles/ThemeProvider'; diff --git a/packages/mui-material/src/stylesOptimized/ThemeProviderWithVars.d.ts b/packages/mui-material/src/stylesOptimized/ThemeProviderWithVars.d.ts new file mode 100644 index 00000000000000..735a97afdacb7a --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/ThemeProviderWithVars.d.ts @@ -0,0 +1,13 @@ +import * as React from 'react'; +import { unstable_createCssVarsProvider } from '@mui/system'; +import { SupportedColorScheme } from '../styles/createThemeFoundation'; +import THEME_ID from '../styles/identifier'; + +type Result = ReturnType< + typeof unstable_createCssVarsProvider +>; + +export declare const CssVarsProvider: Result['CssVarsProvider']; +export declare const useColorScheme: Result['useColorScheme']; +export declare const getInitColorSchemeScript: Result['getInitColorSchemeScript']; +export declare function Experimental_CssVarsProvider(props: any): React.JSX.Element; diff --git a/packages/mui-material/src/stylesOptimized/ThemeProviderWithVars.js b/packages/mui-material/src/stylesOptimized/ThemeProviderWithVars.js new file mode 100644 index 00000000000000..f59235d976c203 --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/ThemeProviderWithVars.js @@ -0,0 +1,6 @@ +export { + CssVarsProvider, + useColorScheme, + getInitColorSchemeScript, + Experimental_CssVarsProvider, +} from '../styles/ThemeProviderWithVars'; diff --git a/packages/mui-material/src/stylesOptimized/createMuiStrictModeTheme.d.ts b/packages/mui-material/src/stylesOptimized/createMuiStrictModeTheme.d.ts new file mode 100644 index 00000000000000..27c2daa842498c --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/createMuiStrictModeTheme.d.ts @@ -0,0 +1,5 @@ +import createTheme from './createTheme'; + +declare const createMuiStrictModeTheme: typeof createTheme; + +export default createMuiStrictModeTheme; diff --git a/packages/mui-material/src/stylesOptimized/createMuiStrictModeTheme.js b/packages/mui-material/src/stylesOptimized/createMuiStrictModeTheme.js new file mode 100644 index 00000000000000..3732f560f73d2a --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/createMuiStrictModeTheme.js @@ -0,0 +1 @@ +export { default } from '../styles/createMuiStrictModeTheme'; diff --git a/packages/mui-material/src/stylesOptimized/createTheme.d.ts b/packages/mui-material/src/stylesOptimized/createTheme.d.ts index 31d3a6759a37bf..cef830c9340c9a 100644 --- a/packages/mui-material/src/stylesOptimized/createTheme.d.ts +++ b/packages/mui-material/src/stylesOptimized/createTheme.d.ts @@ -4,6 +4,7 @@ import { CSSObject, SxProps, SxConfig, + Interpolation, } from '@mui/system'; import { Palette, PaletteOptions } from '../styles/createPalette'; import { Mixins, MixinsOptions } from '../styles/createMixins'; @@ -159,6 +160,32 @@ export interface Theme extends BaseTheme, CssVarsProperties { darken: (color: string, coefficient: number | string) => string; } +export type CreateThemeComponent = { + defaultProps?: Partial; + styleOverrides?: Record< + SlotNames, + Interpolation< + // Record is for other props that the slot receive internally + // Documenting all ownerStates could be a huge work, let's wait until we have a real needs from developers. + Props & + Record & { + ownerState: OwnerState & Record; + theme: Theme; + } + > + >; + variants?: Array<{ + props: + | Partial + | (( + props: Partial & { + ownerState: Partial; + }, + ) => boolean); + style: Interpolation<{ theme: Theme }>; + }>; +}; + /** * Generate a theme base on the options received. * @param options Takes an incomplete theme object and adds the missing parts. diff --git a/packages/mui-material/src/stylesOptimized/createThemeWithVars.d.ts b/packages/mui-material/src/stylesOptimized/createThemeWithVars.d.ts new file mode 100644 index 00000000000000..d12fd853d6a56b --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/createThemeWithVars.d.ts @@ -0,0 +1,9 @@ +import { CssVarsTheme } from '../styles/createThemeFoundation'; +import { CssVarsThemeOptions, Theme } from './createTheme'; + +declare function createThemeWithVars( + options?: CssVarsThemeOptions, + ...args: object[] +): Omit & CssVarsTheme; + +export default createThemeWithVars; diff --git a/packages/mui-material/src/stylesOptimized/createThemeWithVars.js b/packages/mui-material/src/stylesOptimized/createThemeWithVars.js new file mode 100644 index 00000000000000..2193f3f5be8413 --- /dev/null +++ b/packages/mui-material/src/stylesOptimized/createThemeWithVars.js @@ -0,0 +1 @@ +export { default } from '../styles/createThemeWithVars'; diff --git a/packages/mui-material/src/stylesOptimized/index.ts b/packages/mui-material/src/stylesOptimized/index.ts index a33a9482413b07..141ac30fc8f935 100644 --- a/packages/mui-material/src/stylesOptimized/index.ts +++ b/packages/mui-material/src/stylesOptimized/index.ts @@ -1,15 +1,24 @@ +/** + * This file must mirror the exports of `@mui/material/styles` for non-breaking changes in v7. + * This entry point is an alternative for `@mui/material/styles` for optimizing TypeScript interface instantiation + */ + import { DistributiveOmit } from '@mui/types'; export { default as THEME_ID } from '../styles/identifier'; -export { default as createTheme } from './createTheme'; export { - BaseTheme, - CssThemeVariables, - CssVarsThemeOptions, + // New types for augmenting the Theme Components + CreateThemeComponent, ThemeComponents, + // ============================================= + default as createTheme, ThemeOptions, Theme, + CssThemeVariables, + CssVarsThemeOptions, + BaseTheme, } from './createTheme'; +export { default as unstable_createMuiStrictModeTheme } from './createMuiStrictModeTheme'; export { Shadows } from '../styles/shadows'; export { ZIndex } from '../styles/zIndex'; export { @@ -77,6 +86,8 @@ export { default as useTheme } from './useTheme'; export { default as useThemeProps } from './useThemeProps'; export * from './useThemeProps'; export { default as styled } from './styled'; +export { default as ThemeProvider, ThemeProviderProps } from './ThemeProvider'; +export { getUnit as unstable_getUnit, toUnitless as unstable_toUnitless } from '../styles/cssUtils'; export type ClassNameMap = Record; export interface StyledComponentProps { @@ -102,3 +113,55 @@ export type StandardProps< ref?: ComponentProps extends { ref?: infer RefType } ? RefType : React.Ref; style?: React.CSSProperties; }; + +export namespace PropTypes { + // keeping the type structure for backwards compat + type Color = 'inherit' | 'primary' | 'secondary' | 'default'; +} + +export { default as makeStyles } from '../styles/makeStyles'; +export { default as withStyles } from '../styles/withStyles'; +export { default as withTheme } from '../styles/withTheme'; + +export type { StorageManager } from '@mui/system/cssVars'; + +export { default as extendTheme } from './createThemeWithVars'; + +export type { + ColorSchemeOverrides, + SupportedColorScheme, + ColorSystem, + CssVarsPalette, + Opacity, + Overlays, + PaletteAlert, + PaletteActionChannel, + PaletteAppBar, + PaletteAvatar, + PaletteChip, + PaletteColorChannel, + PaletteCommonChannel, + PaletteFilledInput, + PaletteLinearProgress, + PaletteSkeleton, + PaletteSlider, + PaletteSnackbarContent, + PaletteSpeedDialAction, + PaletteStepConnector, + PaletteStepContent, + PaletteSwitch, + PaletteTableCell, + PaletteTextChannel, + PaletteTooltip, + CssVarsTheme, + ThemeVars, + ThemeCssVar, + ThemeCssVarOverrides, + ColorSystemOptions, +} from '../styles/createThemeFoundation'; +export { default as getOverlayAlpha } from '../styles/getOverlayAlpha'; +export { default as shouldSkipGeneratingVar } from '../styles/shouldSkipGeneratingVar'; + +// Private methods for creating parts of the theme +export { default as private_createTypography } from '../styles/createTypography'; +export { default as private_excludeVariablesFromRoot } from '../styles/excludeVariablesFromRoot'; From e69ff50acbd2e2a044c8714686ca1b58e8362a16 Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Mon, 13 Oct 2025 09:59:04 +0700 Subject: [PATCH 06/31] rexport CssThemeVariables --- .../mui-material/src/styles/createThemeNoVars.d.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/mui-material/src/styles/createThemeNoVars.d.ts b/packages/mui-material/src/styles/createThemeNoVars.d.ts index ef909c3bf87a61..c8221de5261eb9 100644 --- a/packages/mui-material/src/styles/createThemeNoVars.d.ts +++ b/packages/mui-material/src/styles/createThemeNoVars.d.ts @@ -7,19 +7,9 @@ import { TransitionsOptions } from './createTransitions'; import { ZIndexOptions } from './zIndex'; import { Components } from './components'; import { ColorSystemOptions } from './createThemeFoundation'; -import { Theme as ThemeOptimized } from '../stylesOptimized'; +import { Theme as ThemeOptimized, CssThemeVariables } from '../stylesOptimized'; -/** - * To disable custom properties, use module augmentation - * - * @example - * declare module '@mui/material/styles' { - * interface CssThemeVariables { - * enabled: true; - * } - * } - */ -export interface CssThemeVariables {} +export { CssThemeVariables }; type CssVarsOptions = CssThemeVariables extends { enabled: true; From f129fe42582c54ef892dd8b9031406e4ceb5dc2c Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Mon, 13 Oct 2025 10:27:58 +0700 Subject: [PATCH 07/31] move to stylesOptimized --- packages/mui-material/src/AppBar/AppBar.d.ts | 2 +- packages/mui-material/src/Box/Box.d.ts | 2 +- packages/mui-material/src/CssBaseline/CssBaseline.d.ts | 2 +- packages/mui-material/src/Fab/Fab.d.ts | 2 +- packages/mui-material/src/Grid/Grid.tsx | 4 ++-- packages/mui-material/src/Link/getTextDecoration.ts | 2 +- packages/mui-material/src/PigmentGrid/PigmentGrid.tsx | 2 +- packages/mui-material/src/PigmentStack/PigmentStack.tsx | 2 +- packages/mui-material/src/Stack/Stack.d.ts | 2 +- packages/mui-material/src/stylesOptimized/index.ts | 2 +- packages/mui-material/src/useMediaQuery/index.d.ts | 2 +- packages/mui-material/src/utils/memoTheme.ts | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/mui-material/src/AppBar/AppBar.d.ts b/packages/mui-material/src/AppBar/AppBar.d.ts index a2cd04260fcac1..0a68d58abea089 100644 --- a/packages/mui-material/src/AppBar/AppBar.d.ts +++ b/packages/mui-material/src/AppBar/AppBar.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -import { PropTypes, Theme } from '../styles'; +import { PropTypes, Theme } from '../stylesOptimized'; import { AppBarClasses } from './appBarClasses'; import { ExtendPaperTypeMap } from '../Paper/Paper'; diff --git a/packages/mui-material/src/Box/Box.d.ts b/packages/mui-material/src/Box/Box.d.ts index 55d5f2928abb38..8151374e1c75c3 100644 --- a/packages/mui-material/src/Box/Box.d.ts +++ b/packages/mui-material/src/Box/Box.d.ts @@ -1,7 +1,7 @@ import { BoxTypeMap } from '@mui/system'; import { OverridableComponent } from '@mui/types'; import { OverrideProps } from '../OverridableComponent'; -import { Theme as MaterialTheme } from '../styles'; +import { Theme as MaterialTheme } from '../stylesOptimized'; /** * diff --git a/packages/mui-material/src/CssBaseline/CssBaseline.d.ts b/packages/mui-material/src/CssBaseline/CssBaseline.d.ts index 11cb225bd7ac03..dd4fc5954a3f34 100644 --- a/packages/mui-material/src/CssBaseline/CssBaseline.d.ts +++ b/packages/mui-material/src/CssBaseline/CssBaseline.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { StyledComponentProps } from '../styles'; +import { StyledComponentProps } from '../stylesOptimized'; export interface CssBaselineProps extends StyledComponentProps { /** diff --git a/packages/mui-material/src/Fab/Fab.d.ts b/packages/mui-material/src/Fab/Fab.d.ts index 935bb60bbeff2b..8df199a29bd149 100644 --- a/packages/mui-material/src/Fab/Fab.d.ts +++ b/packages/mui-material/src/Fab/Fab.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { OverridableStringUnion } from '@mui/types'; import { SxProps } from '@mui/system'; -import { PropTypes, Theme } from '../styles'; +import { PropTypes, Theme } from '../stylesOptimized'; import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps } from '../OverridableComponent'; import { FabClasses } from './fabClasses'; diff --git a/packages/mui-material/src/Grid/Grid.tsx b/packages/mui-material/src/Grid/Grid.tsx index 82f026147cb593..ec0c6defb7dae5 100644 --- a/packages/mui-material/src/Grid/Grid.tsx +++ b/packages/mui-material/src/Grid/Grid.tsx @@ -4,9 +4,9 @@ import { createGrid } from '@mui/system/Grid'; import { SxProps, SystemProps } from '@mui/system'; import { OverridableComponent, OverrideProps } from '@mui/types'; import requirePropFactory from '../utils/requirePropFactory'; -import { Theme, styled, Breakpoint } from '../styles'; +import { Theme, styled, Breakpoint } from '../stylesOptimized'; import { useDefaultProps } from '../DefaultPropsProvider'; -import useTheme from '../styles/useTheme'; +import useTheme from '../stylesOptimized/useTheme'; type ResponsiveStyleValue = T | Array | { [key in Breakpoint]?: T | null }; diff --git a/packages/mui-material/src/Link/getTextDecoration.ts b/packages/mui-material/src/Link/getTextDecoration.ts index 375180905cd40c..0542f90d97b549 100644 --- a/packages/mui-material/src/Link/getTextDecoration.ts +++ b/packages/mui-material/src/Link/getTextDecoration.ts @@ -1,6 +1,6 @@ import { getPath } from '@mui/system/style'; import { alpha } from '@mui/system/colorManipulator'; -import type { Theme } from '../styles'; +import type { Theme } from '../stylesOptimized'; const getTextDecoration = ({ theme, diff --git a/packages/mui-material/src/PigmentGrid/PigmentGrid.tsx b/packages/mui-material/src/PigmentGrid/PigmentGrid.tsx index 8d1cde0e06e8fe..01b127ded8e6ed 100644 --- a/packages/mui-material/src/PigmentGrid/PigmentGrid.tsx +++ b/packages/mui-material/src/PigmentGrid/PigmentGrid.tsx @@ -12,7 +12,7 @@ import { unstable_generateSizeClassNames as generateSizeClassNames, unstable_generateSpacingClassNames as generateSpacingClassNames, } from '@mui/system/Grid'; -import { Breakpoint, Theme } from '../styles'; +import { Breakpoint, Theme } from '../stylesOptimized'; type ResponsiveStyleValue = T | Array | { [key in Breakpoint]?: T | null }; diff --git a/packages/mui-material/src/PigmentStack/PigmentStack.tsx b/packages/mui-material/src/PigmentStack/PigmentStack.tsx index 4b0e34d9abbe2f..1ec188333f81de 100644 --- a/packages/mui-material/src/PigmentStack/PigmentStack.tsx +++ b/packages/mui-material/src/PigmentStack/PigmentStack.tsx @@ -7,7 +7,7 @@ import Stack from '@mui/material-pigment-css/Stack'; import composeClasses from '@mui/utils/composeClasses'; import generateUtilityClass from '@mui/utils/generateUtilityClass'; import { SxProps } from '@mui/system'; -import { Breakpoint, Theme } from '../styles'; +import { Breakpoint, Theme } from '../stylesOptimized'; type ResponsiveStyleValue = T | Array | { [key in Breakpoint]?: T | null }; diff --git a/packages/mui-material/src/Stack/Stack.d.ts b/packages/mui-material/src/Stack/Stack.d.ts index fe13177c0b0aae..be13f3cc770561 100644 --- a/packages/mui-material/src/Stack/Stack.d.ts +++ b/packages/mui-material/src/Stack/Stack.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { ResponsiveStyleValue, SxProps, SystemProps } from '@mui/system'; import { OverrideProps, OverridableComponent } from '../OverridableComponent'; -import { Theme } from '../styles/createTheme'; +import { Theme } from '../stylesOptimized/createTheme'; export interface StackOwnProps extends SystemProps { /** diff --git a/packages/mui-material/src/stylesOptimized/index.ts b/packages/mui-material/src/stylesOptimized/index.ts index 141ac30fc8f935..2a8ceda0c0e427 100644 --- a/packages/mui-material/src/stylesOptimized/index.ts +++ b/packages/mui-material/src/stylesOptimized/index.ts @@ -116,7 +116,7 @@ export type StandardProps< export namespace PropTypes { // keeping the type structure for backwards compat - type Color = 'inherit' | 'primary' | 'secondary' | 'default'; + export type Color = 'inherit' | 'primary' | 'secondary' | 'default'; } export { default as makeStyles } from '../styles/makeStyles'; diff --git a/packages/mui-material/src/useMediaQuery/index.d.ts b/packages/mui-material/src/useMediaQuery/index.d.ts index 8ce15a6118cb17..1e16b16e8e9e24 100644 --- a/packages/mui-material/src/useMediaQuery/index.d.ts +++ b/packages/mui-material/src/useMediaQuery/index.d.ts @@ -1,5 +1,5 @@ import { UseMediaQueryOptions } from '@mui/system/useMediaQuery'; -import { Theme } from '../styles/createTheme'; +import { Theme } from '../stylesOptimized/createTheme'; export * from '@mui/system/useMediaQuery'; diff --git a/packages/mui-material/src/utils/memoTheme.ts b/packages/mui-material/src/utils/memoTheme.ts index ea7da75140e77c..45d49b50da1b86 100644 --- a/packages/mui-material/src/utils/memoTheme.ts +++ b/packages/mui-material/src/utils/memoTheme.ts @@ -1,5 +1,5 @@ import { unstable_memoTheme } from '@mui/system'; -import { Theme } from '../styles/createTheme'; +import { Theme } from '../stylesOptimized/createTheme'; const memoTheme = unstable_memoTheme; From 35135b1e7c240471ff1c573f438660af7fbf734d Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Tue, 14 Oct 2025 09:17:50 +0700 Subject: [PATCH 08/31] reexport Theme with augmenting ThemeComponents --- packages/mui-material/src/styles/createThemeNoVars.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/mui-material/src/styles/createThemeNoVars.d.ts b/packages/mui-material/src/styles/createThemeNoVars.d.ts index c8221de5261eb9..26b0436e7982b7 100644 --- a/packages/mui-material/src/styles/createThemeNoVars.d.ts +++ b/packages/mui-material/src/styles/createThemeNoVars.d.ts @@ -7,7 +7,7 @@ import { TransitionsOptions } from './createTransitions'; import { ZIndexOptions } from './zIndex'; import { Components } from './components'; import { ColorSystemOptions } from './createThemeFoundation'; -import { Theme as ThemeOptimized, CssThemeVariables } from '../stylesOptimized'; +import { Theme, CssThemeVariables } from '../stylesOptimized'; export { CssThemeVariables }; @@ -30,10 +30,12 @@ export interface ThemeOptions extends Omit, CssVar modularCssLayers?: boolean | string; } -export interface Theme extends ThemeOptimized { - components?: Components>; +declare module '../stylesOptimized' { + interface ThemeComponents extends Components> {} } +export { Theme }; + /** * Generate a theme base on the options received. * @param options Takes an incomplete theme object and adds the missing parts. From ccebdd4defe01db6ce2a6dde2549687cad4d244b Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Tue, 14 Oct 2025 09:38:25 +0700 Subject: [PATCH 09/31] fix lint --- .../mui-material/src/stylesOptimized/index.ts | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/packages/mui-material/src/stylesOptimized/index.ts b/packages/mui-material/src/stylesOptimized/index.ts index 2a8ceda0c0e427..c78a6c2ca540f6 100644 --- a/packages/mui-material/src/stylesOptimized/index.ts +++ b/packages/mui-material/src/stylesOptimized/index.ts @@ -7,11 +7,13 @@ import { DistributiveOmit } from '@mui/types'; export { default as THEME_ID } from '../styles/identifier'; export { + default as createTheme, +} from './createTheme'; +export type { // New types for augmenting the Theme Components CreateThemeComponent, ThemeComponents, // ============================================= - default as createTheme, ThemeOptions, Theme, CssThemeVariables, @@ -19,9 +21,9 @@ export { BaseTheme, } from './createTheme'; export { default as unstable_createMuiStrictModeTheme } from './createMuiStrictModeTheme'; -export { Shadows } from '../styles/shadows'; -export { ZIndex } from '../styles/zIndex'; -export { +export type { Shadows } from '../styles/shadows'; +export type { ZIndex } from '../styles/zIndex'; +export type { CommonColors, Palette, PaletteColor, @@ -36,23 +38,25 @@ export { } from '../styles/createPalette'; export { default as createColorScheme } from './createColorScheme'; export { default as createStyles } from '../styles/createStyles'; -export { +export type { TypographyVariants, TypographyVariantsOptions, TypographyStyle, TypographyVariant, } from '../styles/createTypography'; export { default as responsiveFontSizes } from '../styles/responsiveFontSizes'; -export { +export type { Duration, Easing, Transitions, TransitionsOptions, +} from '../styles/createTransitions'; +export { duration, easing, } from '../styles/createTransitions'; -export { Mixins, CSSProperties, MixinsOptions } from '../styles/createMixins'; -export { +export type { Mixins, CSSProperties, MixinsOptions } from '../styles/createMixins'; +export type { Direction, Breakpoint, BreakpointOverrides, @@ -62,6 +66,11 @@ export { Interpolation, CSSInterpolation, CSSObject, + ColorFormat, + ColorObject, + SxProps, +} from '@mui/system'; +export { css, keyframes, // color manipulators @@ -76,17 +85,15 @@ export { alpha, darken, lighten, - ColorFormat, - ColorObject, StyledEngineProvider, - SxProps, } from '@mui/system'; export { unstable_createBreakpoints } from '@mui/system/createBreakpoints'; export { default as useTheme } from './useTheme'; export { default as useThemeProps } from './useThemeProps'; export * from './useThemeProps'; export { default as styled } from './styled'; -export { default as ThemeProvider, ThemeProviderProps } from './ThemeProvider'; +export { default as ThemeProvider } from './ThemeProvider'; +export type { ThemeProviderProps } from './ThemeProvider'; export { getUnit as unstable_getUnit, toUnitless as unstable_toUnitless } from '../styles/cssUtils'; export type ClassNameMap = Record; From e6f3e54767ffefd6ea7d33c75bd01b68e0f74f91 Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Tue, 14 Oct 2025 10:34:03 +0700 Subject: [PATCH 10/31] fix lint --- .../mui-material/perf-test/test-createTheme.tsx | 5 ++++- .../src/stylesOptimized/ThemeProviderWithVars.d.ts | 1 + packages/mui-material/src/stylesOptimized/index.ts | 13 ++++--------- .../src/stylesOptimized/useThemeProps.d.ts | 6 +++++- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/mui-material/perf-test/test-createTheme.tsx b/packages/mui-material/perf-test/test-createTheme.tsx index ade1cc8a6e7833..26990c743ab319 100644 --- a/packages/mui-material/perf-test/test-createTheme.tsx +++ b/packages/mui-material/perf-test/test-createTheme.tsx @@ -1,5 +1,8 @@ +import * as React from 'react'; import Button from '@mui/material/Button'; -import { createTheme, type Theme } from '../src/stylesOptimized'; +import { createTheme } from '@mui/material/stylesOptimized'; + +