Update colors tokens for inputer/footer (#6523)

This commit is contained in:
Miguel Solorio
2025-08-26 15:08:47 -07:00
committed by GitHub
parent 327c5f889d
commit 6fb01ddcc4
12 changed files with 32 additions and 24 deletions

View File

@@ -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,
);

View File

@@ -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,
);

View File

@@ -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,
);

View File

@@ -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,
);

View File

@@ -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,
);

View File

@@ -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,
);

View File

@@ -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,
);

View File

@@ -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,
);

View File

@@ -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,
);

View File

@@ -9,7 +9,6 @@
* @author Ahmad Awais <https://twitter.com/mrahmadawais/>
*/
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,
);

View File

@@ -141,6 +141,7 @@ export class Theme {
* to Ink-compatible color strings (hex or name).
*/
protected readonly _colorMap: Readonly<Record<string, string>>;
readonly semanticColors: SemanticColors;
/**
* Creates a new Theme instance.
@@ -152,8 +153,37 @@ export class Theme {
readonly type: ThemeType,
rawMappings: Record<string, CSSProperties>,
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

View File

@@ -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,
);