feat: apply lobster palette to prompts
This commit is contained in:
12
src/terminal/palette.ts
Normal file
12
src/terminal/palette.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
// Lobster palette tokens for CLI/UI theming. "lobster seam" == use this palette.
|
||||
// Keep in sync with docs/cli/index.md (CLI palette section).
|
||||
export const LOBSTER_PALETTE = {
|
||||
accent: "#FF5A2D",
|
||||
accentBright: "#FF7A3D",
|
||||
accentDim: "#D14A22",
|
||||
info: "#FF8A5B",
|
||||
success: "#2FBF71",
|
||||
warn: "#FFB020",
|
||||
error: "#E23D2D",
|
||||
muted: "#8B7F77",
|
||||
} as const;
|
||||
10
src/terminal/prompt-style.ts
Normal file
10
src/terminal/prompt-style.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { isRich, theme } from "./theme.js";
|
||||
|
||||
export const stylePromptMessage = (message: string): string =>
|
||||
isRich() ? theme.accent(message) : message;
|
||||
|
||||
export const stylePromptTitle = (title?: string): string | undefined =>
|
||||
title && isRich() ? theme.heading(title) : title;
|
||||
|
||||
export const stylePromptHint = (hint?: string): string | undefined =>
|
||||
hint && isRich() ? theme.muted(hint) : hint;
|
||||
@@ -1,16 +1,6 @@
|
||||
import chalk from "chalk";
|
||||
|
||||
// Semantic palette for CLI output. Keep in sync with docs/cli/index.md.
|
||||
export const LOBSTER_PALETTE = {
|
||||
accent: "#FF5A2D",
|
||||
accentBright: "#FF7A3D",
|
||||
accentDim: "#D14A22",
|
||||
info: "#FF8A5B",
|
||||
success: "#2FBF71",
|
||||
warn: "#FFB020",
|
||||
error: "#E23D2D",
|
||||
muted: "#8B7F77",
|
||||
} as const;
|
||||
import { LOBSTER_PALETTE } from "./palette.js";
|
||||
|
||||
const hex = (value: string) => chalk.hex(value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user