@teaui/core
Version:
A high-level terminal UI library for Node
64 lines (63 loc) • 2.03 kB
TypeScript
import type { Color } from './Color.js';
import { Style } from './Style.js';
export type Purpose = 'primary' | 'blue' | 'secondary' | 'orange' | 'proceed' | 'green' | 'cancel' | 'red' | 'selected' | 'plain';
interface Props {
text?: Color;
dimText?: Color;
dimBackground?: Color;
contrastText?: Color;
controlBackground: Color;
textBackground?: Color;
highlight: Color;
darken: Color;
tableChecked?: Color;
tableCheckedHighlight?: Color;
emoji?: boolean;
}
export declare class Palette {
textColor: Color;
contrastTextColor: Color;
dimTextColor: Color;
dimBackgroundColor: Color;
controlBackgroundColor: Color;
textBackgroundColor: Color;
highlightColor: Color;
darkenColor: Color;
tableCheckedColor: Color;
tableCheckedHighlightColor: Color;
emoji: boolean;
static plain: Palette;
static primary: Palette;
static secondary: Palette;
static proceed: Palette;
static cancel: Palette;
static selected: Palette;
static red: Palette;
static green: Palette;
static blue: Palette;
static orange: Palette;
constructor({ text, contrastText, dimText, dimBackground, controlBackground, textBackground, highlight, darken, tableChecked, tableCheckedHighlight, emoji, }: Props);
/**
* "Ornament" is meant to draw decorative characters that disappear on hover/press
*/
ui({ isPressed, isHover, isOrnament, }?: {
isPressed?: boolean;
isHover?: boolean;
isOrnament?: boolean;
}): Style;
/**
* Creates a text style using the current purpose.
*
* Not all combinations are supported:
* - isSelected and isPlaceholder revert to just isPlaceholder
*/
text({ isPressed, isHover, isSelected, isPlaceholder, hasFocus, }?: {
isPressed?: boolean;
isHover?: boolean;
isSelected?: boolean;
isPlaceholder?: boolean;
hasFocus?: boolean;
}): Style;
merge(props: Partial<Props>): Palette;
}
export {};