From e097426e58664b8381ed3b504fbe02ca0f07239e Mon Sep 17 00:00:00 2001 From: Maksim <11676775+maksimgm@users.noreply.github.com> Date: Mon, 30 Nov 2026 16:32:54 -0800 Subject: [PATCH 1/2] [system] Export the compose and useThemeProps types from the package root --- packages/mui-system/src/index.spec.tsx | 13 +++++++++++++ packages/mui-system/src/index.ts | 2 ++ 2 files changed, 15 insertions(+) diff --git a/packages/mui-system/src/index.spec.tsx b/packages/mui-system/src/index.spec.tsx index 8605558b50ccfa..1fc7039aa591ba 100644 --- a/packages/mui-system/src/index.spec.tsx +++ b/packages/mui-system/src/index.spec.tsx @@ -1,6 +1,8 @@ import * as React from 'react'; import styled from 'styled-components'; +import { expectType } from '@mui/types'; import { breakpoints, display, compose, spacing, style, styled as muiStyled } from '@mui/system'; +import type { ComposedStyleFunction, ThemedProps, ThemeWithProps } from '@mui/system'; import createTheme from '@mui/system/createTheme'; @@ -72,3 +74,14 @@ function styleTypeTest() { >(compose(display, gap)); ; } + +function rootTypesTest() { + const styler = compose(display, spacing); + expectType, typeof styler>(styler); + + interface Theme extends ThemeWithProps { + components: { MuiFoo: { defaultProps: { foo: string } } }; + } + const props = {} as ThemedProps; + expectType<{ foo: string }, typeof props>(props); +} diff --git a/packages/mui-system/src/index.ts b/packages/mui-system/src/index.ts index c466b58abc0f47..df7e0d520d478e 100644 --- a/packages/mui-system/src/index.ts +++ b/packages/mui-system/src/index.ts @@ -15,6 +15,7 @@ export { resolveBreakpointValues as unstable_resolveBreakpointValues, } from './breakpoints'; export { default as compose } from './compose'; +export type { ComposedStyleFunction } from './compose'; export { default as display } from './display'; export type * from './display'; export { default as flexbox } from './flexbox'; @@ -81,6 +82,7 @@ export type { export { default as shape } from './createTheme/shape'; export type * from './createTheme/shape'; export { default as useThemeProps, getThemeProps } from './useThemeProps'; +export type { ThemeWithProps, ThemedProps } from './useThemeProps'; export { default as useTheme } from './useTheme'; export { default as useThemeWithoutDefault } from './useThemeWithoutDefault'; export type * from './useThemeWithoutDefault'; From 39ecc45f32f81de4307037cd603bdaedf77e47d0 Mon Sep 17 00:00:00 2001 From: Maksim <11676775+maksimgm@users.noreply.github.com> Date: Tue, 1 Dec 2026 09:45:19 -0800 Subject: [PATCH 2/2] [system] Drop the root types spec --- packages/mui-system/src/index.spec.tsx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/packages/mui-system/src/index.spec.tsx b/packages/mui-system/src/index.spec.tsx index 1fc7039aa591ba..8605558b50ccfa 100644 --- a/packages/mui-system/src/index.spec.tsx +++ b/packages/mui-system/src/index.spec.tsx @@ -1,8 +1,6 @@ import * as React from 'react'; import styled from 'styled-components'; -import { expectType } from '@mui/types'; import { breakpoints, display, compose, spacing, style, styled as muiStyled } from '@mui/system'; -import type { ComposedStyleFunction, ThemedProps, ThemeWithProps } from '@mui/system'; import createTheme from '@mui/system/createTheme'; @@ -74,14 +72,3 @@ function styleTypeTest() { >(compose(display, gap)); ; } - -function rootTypesTest() { - const styler = compose(display, spacing); - expectType, typeof styler>(styler); - - interface Theme extends ThemeWithProps { - components: { MuiFoo: { defaultProps: { foo: string } } }; - } - const props = {} as ThemedProps; - expectType<{ foo: string }, typeof props>(props); -}