/** * Centralized color resolution for OptionDef.color (badges, dots, filters). * * Backend metadata can express option colors either as Tailwind-style semantic * names (`"green"`, `"emerald"`, `"blue"`, ...) — the preferred convention — * or as raw hex (`"#22c55e"`). Every consumer (table cell badges, filter * pills, column header chips) must funnel through this module so the visual * language stays consistent across the app and the theme palette only needs * to be updated in one place. */ /** * Returns a 6-digit hex string (no `#`) for an OptionDef color value, accepting * either a semantic name from COLOR_MAP or any hex literal. */ export declare const resolveColorHex: (input: string) => string; /** Returns a `#xxxxxx` CSS-safe color literal — handy for inline styles. */ export declare const resolveColorCss: (input: string) => string; interface BadgeStyleOptions { isDark: boolean; } /** * Builds the inline style object for a colored badge (background + border + * text), tinted in the OptionDef color and adapted to light/dark mode. The * text is pushed toward white (dark) or black (light) until it reads at WCAG * AA 4.5:1 on the tinted background — a navy or wine option color no longer * vanishes on a dark card. */ export declare const generateBadgeStyles: (input: string, { isDark }: BadgeStyleOptions) => React.CSSProperties; /** * Curated, cohesive palette used to colorize options/relations that ship * WITHOUT an explicit `color` from the backend. These are well-known * Tailwind-500 hues, hand-picked to read well as soft chips in BOTH light and * dark mode and to avoid muddy/low-contrast tones (no bare yellow that vanishes * on white). Order is intentional so the first handful of distinct values land * on visually distant hues rather than neighbours on the color wheel. */ export declare const OPTION_PALETTE: readonly string[]; /** * Maps an arbitrary option key (its `value`, falling back to `label`) to a * stable hex color drawn from {@link OPTION_PALETTE}. Same input → same color, * always; similar/equal inputs collapse to the same hue because the hash is on * the normalized key. This is what makes "dead" gray option badges feel ALIVE * without the backend declaring a color per option. * * The returned hex has NO leading `#` so it funnels through the same * {@link generateBadgeStyles} / {@link resolveColorCss} helpers as an explicit * OptionDef color. */ export declare const optionColor: (key: string) => string; /** * Ready-to-use inline badge style for a key-derived palette color, in the * requested light/dark variant. Equivalent to * `generateBadgeStyles(optionColor(key), { isDark })`. */ export declare const optionColorBadgeStyles: (key: string, { isDark }: BadgeStyleOptions) => React.CSSProperties; /** * Inline style for a RELATION chip keyed on the related label/id. Intentionally * lighter than an enum badge: soft tinted background + matching border, but no * heavy fill — so relations stay visually distinguishable from option/status * enums while still reading as "alive" rather than dead gray. */ export declare const relationChipStyles: (key: string, { isDark }: BadgeStyleOptions) => React.CSSProperties; export {}; //# sourceMappingURL=option-colors.d.ts.map