// node modules
import { createContext, ReactNode } from 'react';
import { createTheming } from 'react-jss';

// local files
import { palette, Palette } from "./palette";
import { font, Font } from "./font";

export type ThemeProps = {
    palette: Palette,
    font?: Record<string, Font>
}

export type Theme = {
    theme: ThemeProps,
    adornmentEnd?: string | ReactNode,
    adornmentStart?: string | ReactNode
}

export const defaultTheme = {
    palette,
    font
}

const ThemeContext = createContext<ThemeProps>(defaultTheme);

export const theming = createTheming(ThemeContext);
