diff --git a/packages/cli/src/ui/themes/atom-one-dark.ts b/packages/cli/src/ui/themes/atom-one-dark.ts
index e5d76256..5545971e 100644
--- a/packages/cli/src/ui/themes/atom-one-dark.ts
+++ b/packages/cli/src/ui/themes/atom-one-dark.ts
@@ -5,7 +5,6 @@
*/
import { type ColorsTheme, Theme } from './theme.js';
-import { darkSemanticColors } from './semantic-tokens.js';
const atomOneDarkColors: ColorsTheme = {
type: 'dark',
@@ -143,5 +142,4 @@ export const AtomOneDark: Theme = new Theme(
},
},
atomOneDarkColors,
- darkSemanticColors,
);
diff --git a/packages/cli/src/ui/themes/ayu-light.ts b/packages/cli/src/ui/themes/ayu-light.ts
index f96fbbf0..8410cfb2 100644
--- a/packages/cli/src/ui/themes/ayu-light.ts
+++ b/packages/cli/src/ui/themes/ayu-light.ts
@@ -5,7 +5,6 @@
*/
import { type ColorsTheme, Theme } from './theme.js';
-import { lightSemanticColors } from './semantic-tokens.js';
const ayuLightColors: ColorsTheme = {
type: 'light',
@@ -135,5 +134,4 @@ export const AyuLight: Theme = new Theme(
},
},
ayuLightColors,
- lightSemanticColors,
);
diff --git a/packages/cli/src/ui/themes/ayu.ts b/packages/cli/src/ui/themes/ayu.ts
index 1f2d247a..1d1fc7d0 100644
--- a/packages/cli/src/ui/themes/ayu.ts
+++ b/packages/cli/src/ui/themes/ayu.ts
@@ -5,7 +5,6 @@
*/
import { type ColorsTheme, Theme } from './theme.js';
-import { darkSemanticColors } from './semantic-tokens.js';
const ayuDarkColors: ColorsTheme = {
type: 'dark',
@@ -109,5 +108,4 @@ export const AyuDark: Theme = new Theme(
},
},
ayuDarkColors,
- darkSemanticColors,
);
diff --git a/packages/cli/src/ui/themes/default-light.ts b/packages/cli/src/ui/themes/default-light.ts
index 707648f1..1803e7fa 100644
--- a/packages/cli/src/ui/themes/default-light.ts
+++ b/packages/cli/src/ui/themes/default-light.ts
@@ -5,7 +5,6 @@
*/
import { lightTheme, Theme } from './theme.js';
-import { lightSemanticColors } from './semantic-tokens.js';
export const DefaultLight: Theme = new Theme(
'Default Light',
@@ -104,5 +103,4 @@ export const DefaultLight: Theme = new Theme(
},
},
lightTheme,
- lightSemanticColors,
);
diff --git a/packages/cli/src/ui/themes/default.ts b/packages/cli/src/ui/themes/default.ts
index d6662bf5..e1d0247c 100644
--- a/packages/cli/src/ui/themes/default.ts
+++ b/packages/cli/src/ui/themes/default.ts
@@ -5,7 +5,6 @@
*/
import { darkTheme, Theme } from './theme.js';
-import { darkSemanticColors } from './semantic-tokens.js';
export const DefaultDark: Theme = new Theme(
'Default',
@@ -147,5 +146,4 @@ export const DefaultDark: Theme = new Theme(
},
},
darkTheme,
- darkSemanticColors,
);
diff --git a/packages/cli/src/ui/themes/dracula.ts b/packages/cli/src/ui/themes/dracula.ts
index 2def698e..e746d8e8 100644
--- a/packages/cli/src/ui/themes/dracula.ts
+++ b/packages/cli/src/ui/themes/dracula.ts
@@ -5,7 +5,6 @@
*/
import { type ColorsTheme, Theme } from './theme.js';
-import { darkSemanticColors } from './semantic-tokens.js';
const draculaColors: ColorsTheme = {
type: 'dark',
@@ -120,5 +119,4 @@ export const Dracula: Theme = new Theme(
},
},
draculaColors,
- darkSemanticColors,
);
diff --git a/packages/cli/src/ui/themes/github-dark.ts b/packages/cli/src/ui/themes/github-dark.ts
index 3fae630d..e93c8c6a 100644
--- a/packages/cli/src/ui/themes/github-dark.ts
+++ b/packages/cli/src/ui/themes/github-dark.ts
@@ -5,7 +5,6 @@
*/
import { type ColorsTheme, Theme } from './theme.js';
-import { darkSemanticColors } from './semantic-tokens.js';
const githubDarkColors: ColorsTheme = {
type: 'dark',
@@ -143,5 +142,4 @@ export const GitHubDark: Theme = new Theme(
},
},
githubDarkColors,
- darkSemanticColors,
);
diff --git a/packages/cli/src/ui/themes/github-light.ts b/packages/cli/src/ui/themes/github-light.ts
index 380559b9..dcb4bbf0 100644
--- a/packages/cli/src/ui/themes/github-light.ts
+++ b/packages/cli/src/ui/themes/github-light.ts
@@ -5,7 +5,6 @@
*/
import { type ColorsTheme, Theme } from './theme.js';
-import { lightSemanticColors } from './semantic-tokens.js';
const githubLightColors: ColorsTheme = {
type: 'light',
@@ -145,5 +144,4 @@ export const GitHubLight: Theme = new Theme(
},
},
githubLightColors,
- lightSemanticColors,
);
diff --git a/packages/cli/src/ui/themes/googlecode.ts b/packages/cli/src/ui/themes/googlecode.ts
index 187f22fa..27fd50e9 100644
--- a/packages/cli/src/ui/themes/googlecode.ts
+++ b/packages/cli/src/ui/themes/googlecode.ts
@@ -4,8 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import { lightTheme, Theme, type ColorsTheme } from './theme.js';
-import { lightSemanticColors } from './semantic-tokens.js';
+import { type ColorsTheme, Theme, lightTheme } from './theme.js';
const googleCodeColors: ColorsTheme = {
type: 'light',
@@ -142,5 +141,4 @@ export const GoogleCode: Theme = new Theme(
},
},
googleCodeColors,
- lightSemanticColors,
);
diff --git a/packages/cli/src/ui/themes/shades-of-purple.ts b/packages/cli/src/ui/themes/shades-of-purple.ts
index 289bdee9..6e20240f 100644
--- a/packages/cli/src/ui/themes/shades-of-purple.ts
+++ b/packages/cli/src/ui/themes/shades-of-purple.ts
@@ -9,7 +9,6 @@
* @author Ahmad Awais
*/
import { type ColorsTheme, Theme } from './theme.js';
-import { darkSemanticColors } from './semantic-tokens.js';
const shadesOfPurpleColors: ColorsTheme = {
type: 'dark',
@@ -348,5 +347,4 @@ export const ShadesOfPurple = new Theme(
},
},
shadesOfPurpleColors,
- darkSemanticColors,
);
diff --git a/packages/cli/src/ui/themes/theme.ts b/packages/cli/src/ui/themes/theme.ts
index 82f2da89..ed6db897 100644
--- a/packages/cli/src/ui/themes/theme.ts
+++ b/packages/cli/src/ui/themes/theme.ts
@@ -141,6 +141,7 @@ export class Theme {
* to Ink-compatible color strings (hex or name).
*/
protected readonly _colorMap: Readonly>;
+ readonly semanticColors: SemanticColors;
/**
* Creates a new Theme instance.
@@ -152,8 +153,37 @@ export class Theme {
readonly type: ThemeType,
rawMappings: Record,
readonly colors: ColorsTheme,
- readonly semanticColors: SemanticColors,
+ semanticColors?: SemanticColors,
) {
+ this.semanticColors = semanticColors ?? {
+ text: {
+ primary: this.colors.Foreground,
+ secondary: this.colors.Gray,
+ link: this.colors.AccentBlue,
+ accent: this.colors.AccentPurple,
+ },
+ background: {
+ primary: this.colors.Background,
+ diff: {
+ added: this.colors.DiffAdded,
+ removed: this.colors.DiffRemoved,
+ },
+ },
+ border: {
+ default: this.colors.Gray,
+ focused: this.colors.AccentBlue,
+ },
+ ui: {
+ comment: this.colors.Comment,
+ symbol: this.colors.Gray,
+ gradient: this.colors.GradientColors,
+ },
+ status: {
+ error: this.colors.AccentRed,
+ success: this.colors.AccentGreen,
+ warning: this.colors.AccentYellow,
+ },
+ };
this._colorMap = Object.freeze(this._buildColorMap(rawMappings)); // Build and freeze the map
// Determine the default foreground color
diff --git a/packages/cli/src/ui/themes/xcode.ts b/packages/cli/src/ui/themes/xcode.ts
index 6c150007..690d2386 100644
--- a/packages/cli/src/ui/themes/xcode.ts
+++ b/packages/cli/src/ui/themes/xcode.ts
@@ -5,7 +5,6 @@
*/
import { type ColorsTheme, Theme } from './theme.js';
-import { lightSemanticColors } from './semantic-tokens.js';
const xcodeColors: ColorsTheme = {
type: 'light',
@@ -150,5 +149,4 @@ export const XCode: Theme = new Theme(
},
},
xcodeColors,
- lightSemanticColors,
);