import defaultTheme from './defaultTheme'

export type Animation = keyof VuiTheme['animations']
export type Border = keyof VuiTheme['borders']
export type Color = keyof VuiTheme['colors']
export type Component = keyof VuiTheme['components']
export type Elevation = keyof VuiTheme['shadows']
export type Font = keyof VuiTheme['fonts']
export type FontSize = keyof VuiTheme['fontSizes']
export type FontWeight = keyof VuiTheme['fontWeights']
export type GridTemplateColumn = keyof VuiTheme['gridTemplateColumns']
export type GridTemplateRow = keyof VuiTheme['gridTemplateRows']
export type Radius = keyof VuiTheme['radii']
export type RingWidth = keyof VuiTheme['ringWidths']
export type Screen = keyof VuiTheme['screens']
export type Shadow = keyof VuiTheme['shadows']
export type Size = keyof VuiTheme['sizes']
export type Space = keyof VuiTheme['spaces']
export type Transform = keyof VuiTheme['transforms']
export type TransitionDuration = keyof VuiTheme['durations']
export type ZIndex = keyof VuiTheme['zIndices']

export type VuiThemeDefaults = typeof defaultTheme

/** Can be extended to add new properties to the theme or override default ones  */
export type VuiThemeExtensions = object

/** Defines variant and size types of each component connected to the theme. */
export type ThemingProps<ThemeComponent extends string = string> = {
  variant?: ThemeComponent extends Component ? keyof VuiTheme['components'][ThemeComponent]['variants'] : string
  size?: ThemeComponent extends keyof VuiTheme['components']
    ? keyof VuiTheme['components'][ThemeComponent]['sizes']
    : string
}

// Using intersection instead of 'extends' to allow different, deeply-nested objects
/** VUI theme definition object, containing default values and extensions */
export type VuiTheme = VuiThemeDefaults & VuiThemeExtensions
