UNPKG

@codegouvfr/react-dsfr

Version:

French State Design System React integration library

39 lines (38 loc) 1.25 kB
import type { ReactNode } from "react"; import type { Theme as MuiTheme, ThemeOptions } from "@mui/material/styles"; import type { ColorTheme } from "./fr/colors"; export declare function getMuiDsfrThemeOptions(params: { isDark: boolean; }): ThemeOptions; /** *Generate a theme base on the options received. * * @param params — Dark or light mode. * * @param args — Deep merge the arguments with the about to be returned theme. * * @returns — A complete, ready-to-use mui theme object. */ export declare function createMuiDsfrTheme(params: { isDark: boolean; }, ...args: object[]): MuiTheme; export declare function createMuiDsfrThemeProvider(params: { useIsDark?: () => { isDark: boolean; }; augmentMuiTheme?: (params: { /** WARNING: The types is lying here. * It's a Theme as defined in import type { Theme } from "@mui/material/styles"; * That is to say before augmentation. **/ nonAugmentedMuiTheme: MuiTheme; frColorTheme: ColorTheme; }) => MuiTheme; }): { MuiDsfrThemeProvider: (props: { children: ReactNode; }) => JSX.Element; }; export declare const MuiDsfrThemeProvider: (props: { children: ReactNode; }) => JSX.Element;