From f6f23b1fc215e57a37f8b9a8b23e1850c78736d3 Mon Sep 17 00:00:00 2001 From: Wurielle Date: Sat, 20 Jul 2024 23:19:40 +0200 Subject: [PATCH] refactor: improve theme naming --- packages/react/src/tokens/border.ts | 2 +- packages/react/src/tokens/colors.ts | 2 +- packages/react/src/tokens/elevation.ts | 2 +- packages/react/src/tokens/index.ts | 12 ++++++------ packages/react/src/tokens/level.ts | 2 +- packages/react/src/tokens/ratio.ts | 2 +- packages/react/src/tokens/screens.ts | 2 +- packages/react/src/tokens/spacing.ts | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/react/src/tokens/border.ts b/packages/react/src/tokens/border.ts index c46f13d..e4e280d 100644 --- a/packages/react/src/tokens/border.ts +++ b/packages/react/src/tokens/border.ts @@ -21,7 +21,7 @@ export const borderWidth = { export type BorderWidth = keyof typeof borderWidth declare module '@/tokens' { - export interface BearmeanTheme { + export interface Theme { borderRadius: typeof borderRadius borderStyle: typeof borderStyle borderWidth: typeof borderWidth diff --git a/packages/react/src/tokens/colors.ts b/packages/react/src/tokens/colors.ts index 6c82ec4..497fb03 100644 --- a/packages/react/src/tokens/colors.ts +++ b/packages/react/src/tokens/colors.ts @@ -298,7 +298,7 @@ export type Colors = typeof colors export type Color = ObjectDotNotation declare module '@/tokens' { - export interface BearmeanTheme { + export interface Theme { colors: Colors } } diff --git a/packages/react/src/tokens/elevation.ts b/packages/react/src/tokens/elevation.ts index 469c4c0..ae092e5 100644 --- a/packages/react/src/tokens/elevation.ts +++ b/packages/react/src/tokens/elevation.ts @@ -5,7 +5,7 @@ export const elevation = { export type Elevation = keyof typeof elevation declare module '@/tokens' { - export interface BearmeanTheme { + export interface Theme { elevation: typeof elevation } } diff --git a/packages/react/src/tokens/index.ts b/packages/react/src/tokens/index.ts index 36e0a98..7533d98 100644 --- a/packages/react/src/tokens/index.ts +++ b/packages/react/src/tokens/index.ts @@ -6,21 +6,21 @@ export * from './ratio' export * from './screens' export * from './spacing' -export interface BearmeanTheme {} +export interface Theme {} -export interface BearmeanThemeOverride {} +export interface ThemeOverride {} -type BearmeanMergedTheme = { - [Key in keyof BearmeanTheme]-?: Key extends keyof BearmeanThemeOverride ? BearmeanThemeOverride[Key] : BearmeanTheme[Key] +type BearmeanTheme = { + [Key in keyof Theme]-?: Key extends keyof ThemeOverride ? ThemeOverride[Key] : Theme[Key] } declare module '@emotion/react' { - export interface Theme extends BearmeanMergedTheme {} + export interface Theme extends BearmeanTheme {} } /* Override default theme like this: */ // declare module '@/tokens' { -// export interface BearmeanThemeOverride { +// export interface ThemeOverride { // screens: { // min: { // value: number diff --git a/packages/react/src/tokens/level.ts b/packages/react/src/tokens/level.ts index a40b577..dbdddcd 100644 --- a/packages/react/src/tokens/level.ts +++ b/packages/react/src/tokens/level.ts @@ -12,7 +12,7 @@ export const level = { export type Level = keyof typeof level declare module '@/tokens' { - export interface BearmeanTheme { + export interface Theme { level: typeof level } } diff --git a/packages/react/src/tokens/ratio.ts b/packages/react/src/tokens/ratio.ts index a1fcc03..d8fe951 100644 --- a/packages/react/src/tokens/ratio.ts +++ b/packages/react/src/tokens/ratio.ts @@ -15,7 +15,7 @@ export const ratio = { export type Ratio = keyof typeof ratio declare module '@/tokens' { - export interface BearmeanTheme { + export interface Theme { ratio: typeof ratio } } diff --git a/packages/react/src/tokens/screens.ts b/packages/react/src/tokens/screens.ts index 0beacfc..303feaf 100644 --- a/packages/react/src/tokens/screens.ts +++ b/packages/react/src/tokens/screens.ts @@ -33,7 +33,7 @@ export type Screens = typeof screens export type Screen = keyof Screens declare module '@/tokens' { - export interface BearmeanTheme { + export interface Theme { screens: Screens } } diff --git a/packages/react/src/tokens/spacing.ts b/packages/react/src/tokens/spacing.ts index 0b38dd3..76cedbb 100644 --- a/packages/react/src/tokens/spacing.ts +++ b/packages/react/src/tokens/spacing.ts @@ -42,7 +42,7 @@ export type NegativeSpacing = keyof typeof negativeSpacing export type PositiveSpacing = keyof typeof positiveSpacing declare module '@/tokens' { - export interface BearmeanTheme { + export interface Theme { spacing: typeof spacing negativeSpacing: typeof negativeSpacing positiveSpacing: typeof positiveSpacing