refactor: replace hardcoded hex colors with design tokens across priority components
- Add DS_COLORS.heat, DS_COLORS.futureCard, INQUIRY_STATUS_META tokens to ds.ts - Eliminate 4 duplicate RESULT_TYPE_META / TYPE_META constants (now all use ds.ts) - Eliminate 3 duplicate scoreColor / SCORE_COLOR functions (now all use matchScoreHex) - HeatBadge: use DS_COLORS.heat.VERY_HOT / HOT tokens - FutureAvailabilityCard: use DS_COLORS.futureCard.controlled / signal tokens - IntelligenceMatchCard: import RESULT_TYPE_META from ds.ts, remove primary override - MatchScoreDisplay: replace local scoreColor() with matchScoreHex() - CompareColumnHeader: remove local TYPE_META + SCORE_COLOR, use ds.ts + utils.ts - CompareTableBody: import RESULT_TYPE_META + matchScoreHex, fix #7c3aed → token - compareUtils: remove TYPE_META + SCORE_COLOR, use dataQualityHex in scoreBar - Anfragen + AnfragenInquiryItem: deduplicate STATUS_CONFIG → INQUIRY_STATUS_META - Anfragen: #1e3a5f → 'primary.main', KI alert → futureCard.controlled tokens - AnfragenMessageBubble: own-message bubble → 'primary.main', AI bubble → tokens - ScoreBreakdownPanel: #1e3a5f → 'primary.main', #6d28d9 → futureCard.controlled - ESLint: add warn rule against new hex colors in component sx props Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -42,8 +42,40 @@ export const DS_COLORS = {
|
||||
LOW: { bg: 'rgba(192,57,43,0.10)', fg: '#c0392b' },
|
||||
INCOMPLETE: { bg: 'rgba(127,0,0,0.12)', fg: '#7f1d1d' },
|
||||
},
|
||||
heat: {
|
||||
VERY_HOT: { bg: '#fef3c7', border: '#fcd34d', icon: '#d97706', text: '#92400e' },
|
||||
HOT: { bg: '#fff7ed', border: '#fed7aa', icon: '#ea580c', text: '#c2410c' },
|
||||
},
|
||||
futureCard: {
|
||||
controlled: {
|
||||
accent: '#7c3aed',
|
||||
accentHover: '#6d28d9',
|
||||
headerBg: '#faf5ff',
|
||||
border: '#e9d5ff',
|
||||
badgeBg: '#ede9fe',
|
||||
badgeText: '#5b21b6',
|
||||
},
|
||||
signal: {
|
||||
accent: '#1d4ed8',
|
||||
accentHover: '#1e40af',
|
||||
headerBg: '#eff6ff',
|
||||
border: '#bfdbfe',
|
||||
badgeBg: '#dbeafe',
|
||||
badgeText: '#1e40af',
|
||||
indicator: '#1d4ed8',
|
||||
},
|
||||
},
|
||||
} as const
|
||||
|
||||
// ── Inquiry status metadata ───────────────────────────────────────────────────
|
||||
|
||||
export const INQUIRY_STATUS_META: Record<string, { label: string; fg: string; bg: string }> = {
|
||||
new: { label: 'Neu', fg: '#dc2626', bg: '#fef2f2' },
|
||||
in_progress: { label: 'Aktiv', fg: '#d97706', bg: '#fffbeb' },
|
||||
answered: { label: 'Beantwortet', fg: '#1a7a4a', bg: '#f0fdf4' },
|
||||
archived: { label: 'Archiviert', fg: '#64748b', bg: '#f8fafc' },
|
||||
}
|
||||
|
||||
// ── Score → qualitative level helpers ────────────────────────────────────────
|
||||
|
||||
export function scoreToConfidenceLevel(score: number): ConfidenceLevel {
|
||||
|
||||
Reference in New Issue
Block a user