Sign In

@opencode-ai/theme

Package Overview
Dependencies
Maintainers
2
Versions
417
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opencode-ai/theme - npm Package Compare versions

Comparing version
0.0.0-next-16420
to
0.0.0-next-16473
+1
-1
dist/tui/index.d.ts
export { ActionState, type ActionStateKey, ActionVariant, BaseHue, CategoricalDefinition, FeedbackKind, FormfieldState, type FormfieldStateKey, HueAlias, HueName, HueStep, MarkdownDefinition, MarkdownToken, ModeDefinition, SyntaxDefinition, SyntaxToken, ThemeDefinition, ThemeDocument, type BackgroundDefinition, type DiffDefinition, type FileThemeDefinition, type FormfieldColorDefinition, type HueDefinition, type HueOverrideDefinition, type MergeModeDefinition, type Mode, type StatefulColorDefinition, type ContextKey, type TextDefinition, type ThemeTokensDefinition, } from "./schema.js";
export type { Categorical, FormfieldColor, Hue, HueSource, HueScale, ResolvedActionState, ResolvedFormfieldState, ResolvedTheme, ResolvedThemeView, StatefulColor, } from "./types.js";
export type { Categorical, ContextName, FormfieldColor, Hue, HueSource, HueScale, ResolvedActionState, ResolvedFormfieldState, ResolvedTheme, ResolvedThemeTokens, StatefulColor, } from "./types.js";
export { DEFAULT_CATEGORICAL, DEFAULT_THEME } from "./defaults.js";

@@ -4,0 +4,0 @@ export { migrateV1 } from "./v1-migrate.js";

@@ -44,9 +44,13 @@ import { RGBA } from "@opentui/core";

const resolved = resolveView(base, hue, categorical, hueSteps);
const contexts = Object.fromEntries(Object.entries(definition)
.filter(([key]) => key.startsWith("@context:"))
.map(([key, override]) => {
const contextual = contextualize(base, override);
return [key, resolveView(contextual, hue, categorical, hueSteps)];
}));
return { ...resolved, contexts };
const context = (name) => {
const override = definition[`@context:${name}`];
if (!override)
return resolved;
return resolveView(contextualize(base, override), hue, categorical, hueSteps);
};
const contextual = {
elevated: context("elevated"),
overlay: context("overlay"),
};
return { ...resolved, contextual };
}

@@ -53,0 +57,0 @@ function tokens(definition) {

import { SyntaxStyle } from "@opentui/core";
import type { Mode, ResolvedThemeView } from "./index.js";
export declare function generateSyntax(theme: ResolvedThemeView, mode: Mode): SyntaxStyle;
import type { Mode, ResolvedThemeTokens } from "./index.js";
export declare function generateSyntax(theme: ResolvedThemeTokens, mode: Mode): SyntaxStyle;
import type { RGBA } from "@opentui/core";
import type { ActionState, ActionVariant, BaseHue, FeedbackKind, HueAlias, HueStep, MarkdownToken, ContextKey, SyntaxToken } from "./schema.js";
import type { ActionState, ActionVariant, BaseHue, FeedbackKind, HueAlias, HueStep, MarkdownToken, SyntaxToken } from "./schema.js";
export type ResolvedActionState = "default" | ActionState;

@@ -14,3 +14,3 @@ export type ResolvedFormfieldState = ResolvedActionState;

export type FormfieldColor = StatefulColor;
export type ResolvedThemeView = {
export type ResolvedThemeTokens = {
readonly hue: Hue;

@@ -76,4 +76,5 @@ readonly categorical: Categorical;

};
export type ResolvedTheme = ResolvedThemeView & {
readonly contexts: Readonly<Partial<Record<ContextKey, ResolvedThemeView>>>;
export type ContextName = "elevated" | "overlay";
export type ResolvedTheme = ResolvedThemeTokens & {
readonly contextual: Readonly<Record<ContextName, ResolvedThemeTokens>>;
};
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/theme",
"version": "0.0.0-next-16420",
"version": "0.0.0-next-16473",
"type": "module",

@@ -6,0 +6,0 @@ "license": "MIT",