/**
 * Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.
 */

export type {ITheme} from './interfaces/ITheme';
export type {IColorSystem} from './interfaces/IColorSystem';
export type {ISpacingSystem, IExtendedSpacingSystem} from './interfaces/ISpacingSystem';
export type {ITypographySystem} from './interfaces/ITypographySystem';
export type {IScreenSystem} from './interfaces/IScreenSystem';
export type {IBackgroundSystem} from './interfaces/IBackgroundSystem';
export {ColorSystem} from './defaultTheme/ColorSystem';
export {SpacingSystem} from './defaultTheme/SpacingSystem';
export {TypographySystem} from './defaultTheme/TypographySystem';
export {ScreenSystem} from './defaultTheme/ScreenSystem';
export {BackgroundSystem} from './defaultTheme/BackgroundSystem';
export {ThemeFactory} from './ThemeFactory';
export {ColorUtils} from './utils/ColorUtils';
export {ViewportUtils} from './utils/ViewportUtils';

import {ITheme} from './interfaces/ITheme';
import {ThemeFactory} from './ThemeFactory';
import {ColorUtils} from './utils/ColorUtils';
import {ViewportUtils} from './utils/ViewportUtils';

export class Theme {
  private static _instance: ITheme = ThemeFactory.createDefaultTheme();

  static get instance(): ITheme {
    return Theme._instance;
  }

  static setTheme(theme: ITheme): void {
    Theme._instance = theme;
  }

  static resetToDefault(): void {
    Theme._instance = ThemeFactory.createDefaultTheme();
  }

  // Backward compatibility properties
  static get colors() {
    return Theme.instance.colors;
  }

  static get paddings() {
    return {
      xsmall: Theme.instance.spacing.xsmall,
      small: Theme.instance.spacing.small,
      medium: Theme.instance.spacing.medium,
      large: Theme.instance.spacing.large,
      xlarge: Theme.instance.spacing.xlarge
    };
  }

  static get theme() {
    return Theme.instance;
  }

  static get background() {
    return Theme
  }
}

export default Theme.instance;
export const theme = Theme.instance;
export const pxToVw = ViewportUtils.pxToVw;
export const hexToRgba = ColorUtils.hexToRgba;
export const paddings = Theme.paddings;
