diff --git a/src/components/core/Theme/ThemeBuilder.ts b/src/components/core/Theme/ThemeBuilder.ts new file mode 100644 index 0000000..771be19 --- /dev/null +++ b/src/components/core/Theme/ThemeBuilder.ts @@ -0,0 +1,44 @@ +import { + DefaultColorScheme, + type ColorScheme, + type Theme, +} from '../../../index'; + +type ThemeBuilderOptions = Partial; +}>; + +export class ThemeBuilder { + colorScheme: "light" | "dark" | "auto" | "disabled" = "auto"; + colors: ColorScheme = DefaultColorScheme; + fontFamily = "Arial, sans-serif"; + lineHeight = "1.6"; + primaryColor = "blue"; + radius = "4px"; + spacing = "16px"; + shadows = "0px 4px 12px rgba(0, 0, 0, 0.1)"; + headings = { + fontFamily: "Arial, sans-serif", + fontWeight: "bold", + sizes: { + h1: "2em", + h2: "1.5em", + h3: "1.17em", + h4: "1em", + h5: ".83em", + h6: ".67em", + }, + }; + + constructor(options: ThemeBuilderOptions) { + this.colorScheme = options.colorScheme || this.colorScheme; + this.colors = options.colors ? { ...this.colors, ...options.colors } : this.colors; + this.fontFamily = options.fontFamily || this.fontFamily; + this.lineHeight = options.lineHeight || this.lineHeight; + this.primaryColor = options.primaryColor || this.primaryColor; + this.radius = options.radius || this.radius; + this.spacing = options.spacing || this.spacing; + this.shadows = options.shadows || this.shadows; + this.headings = options.headings ? { ...this.headings, ...options.headings } : this.headings; + } +} diff --git a/src/components/core/Theme/index.ts b/src/components/core/Theme/index.ts new file mode 100644 index 0000000..a93f8e3 --- /dev/null +++ b/src/components/core/Theme/index.ts @@ -0,0 +1 @@ +export { ThemeBuilder } from './ThemeBuilder'; \ No newline at end of file diff --git a/src/components/core/index.ts b/src/components/core/index.ts index e69de29..de24b17 100644 --- a/src/components/core/index.ts +++ b/src/components/core/index.ts @@ -0,0 +1 @@ +export { ThemeBuilder } from './Theme/index'; \ No newline at end of file diff --git a/src/components/index.ts b/src/components/index.ts new file mode 100644 index 0000000..76d41d9 --- /dev/null +++ b/src/components/index.ts @@ -0,0 +1,3 @@ +export { + ThemeBuilder, +} from './core/index'; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index fa0da39..f9b6760 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,7 @@ +export { + ThemeBuilder, +} from './components/index'; + export { DefaultColorScheme, } from './styles/index';