UNPKG

claude-statusline-powerline

Version:

Beautiful powerline-style statusline for Claude Code with git integration, session tracking, and cost monitoring

92 lines 2.59 kB
"use strict"; /** * Shared ANSI color constants and utilities */ Object.defineProperty(exports, "__esModule", { value: true }); exports.FALLBACK_COLORS = exports.ANSI_FG = exports.ANSI_BG = exports.ANSI_RESET = void 0; exports.create_styled_text = create_styled_text; exports.get_fallback_colors = get_fallback_colors; // Reset codes exports.ANSI_RESET = '\x1b[0m'; // Background colors (48;2;r;g;b format for 24-bit) exports.ANSI_BG = { red: '\x1b[41m', green: '\x1b[42m', yellow: '\x1b[43m', blue: '\x1b[44m', purple: '\x1b[45m', cyan: '\x1b[46m', white: '\x1b[47m', gray: '\x1b[100m', bright_black: '\x1b[100m', }; // Foreground colors (38;2;r;g;b format for 24-bit) exports.ANSI_FG = { black: '\x1b[30m', red: '\x1b[31m', green: '\x1b[32m', yellow: '\x1b[33m', blue: '\x1b[34m', purple: '\x1b[35m', cyan: '\x1b[36m', white: '\x1b[37m', bright_white: '\x1b[97m', gray: '\x1b[90m', }; // Common color combinations for fallbacks exports.FALLBACK_COLORS = { model: { bg: exports.ANSI_BG.blue, fg: exports.ANSI_FG.bright_white, separator: exports.ANSI_FG.blue, }, directory: { bg: exports.ANSI_BG.gray, fg: exports.ANSI_FG.bright_white, separator: exports.ANSI_FG.gray, }, git_clean: { bg: exports.ANSI_BG.green, fg: exports.ANSI_FG.bright_white, separator: exports.ANSI_FG.green, }, git_dirty: { bg: exports.ANSI_BG.yellow, fg: exports.ANSI_FG.black, separator: exports.ANSI_FG.yellow, }, session: { bg: exports.ANSI_BG.purple, fg: exports.ANSI_FG.bright_white, separator: exports.ANSI_FG.purple, }, context: { bg: exports.ANSI_BG.cyan, fg: exports.ANSI_FG.bright_white, separator: exports.ANSI_FG.cyan, }, usage: { bg: exports.ANSI_BG.purple, fg: exports.ANSI_FG.bright_white, separator: exports.ANSI_FG.purple, }, error: { bg: exports.ANSI_BG.red, fg: exports.ANSI_FG.bright_white, separator: exports.ANSI_FG.red, }, }; /** * Create a styled text with foreground and background colors */ function create_styled_text(text, fg_color, bg_color) { const bg = bg_color || ''; return `${bg}${fg_color}${text}${exports.ANSI_RESET}`; } /** * Get fallback colors for a segment type */ function get_fallback_colors(segment_type) { return exports.FALLBACK_COLORS[segment_type] || exports.FALLBACK_COLORS.model; } //# sourceMappingURL=ansi.js.map