import { THEME_FACTOR_MULTIPLIERS_NAMES , ThemeSettings , Theme } from '../constants' ; import { createThemeFactorMultiplier } from '../createThemeFactorMultiplier' ; import { getThemeSetup } from './getThemeSetup' ; import { createThemeBreakpoints } from './createThemeBreakpoints' ; import { createThemePalette } from './createThemePalette' ; const createTheme = ( settings ? , extendTheme ? ) : Theme => { const setup = getThemeSetup ( settings , extendTheme ) ; const breakpoints = createThemeBreakpoints ( setup ) ; const palette = createThemePalette ( setup ) ; const multipliers = THEME_FACTOR_MULTIPLIERS_NAMES . reduce ( ( multipliers , multiplierName ) => ( { ... multipliers , [ multiplierName ] : createThemeFactorMultiplier ( setup [ multiplierName ] ) } ) , { } ) ; return Object . freeze ( { ... setup , breakpoints , palette , ... multipliers } ) ; } ; export { createTheme } ;