@@ -9,7 +9,6 @@ import { useIsDark } from "./lib/darkMode";
99import { typography } from "./lib/generatedFromCss/typography" ;
1010import { spacingTokenByValue } from "./lib/generatedFromCss/spacing" ;
1111import type { ColorTheme } from "./lib/colors" ;
12- import type { Theme as NonAugmentedMuiTheme } from "./lib/tools/@mui/material/styles/createTheme" ;
1312import { assert } from "tsafe/assert" ;
1413import { objectKeys } from "tsafe/objectKeys" ;
1514import defaultMuiShadows from "@mui/material/styles/shadows" ;
@@ -220,12 +219,16 @@ function createMuiDsfrTheme(params: { isDark: boolean }): MuiTheme {
220219}
221220
222221export function createMuiDsfrThemeProvider ( params : {
223- augmentMuiTheme : ( params : {
224- nonAugmentedMuiTheme : NonAugmentedMuiTheme ;
222+ augmentMuiTheme ?: ( params : {
223+ /** WARNING: The types is lying here.
224+ * It's a Theme as defined in import type { Theme } from "@mui/material/styles";
225+ * That is to say before augmentation.
226+ **/
227+ nonAugmentedMuiTheme : MuiTheme ;
225228 frColorTheme : ColorTheme ;
226229 } ) => MuiTheme ;
227230} ) {
228- const { augmentMuiTheme } = params ;
231+ const { augmentMuiTheme = ( { nonAugmentedMuiTheme } ) => nonAugmentedMuiTheme } = params ;
229232
230233 type Props = {
231234 children : ReactNode ;
@@ -251,8 +254,3 @@ export function createMuiDsfrThemeProvider(params: {
251254
252255 return { MuiDsfrThemeProvider } ;
253256}
254-
255- export function noAugmentation ( params : { nonAugmentedMuiTheme : MuiTheme } ) {
256- const { nonAugmentedMuiTheme } = params ;
257- return nonAugmentedMuiTheme ;
258- }
0 commit comments