Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

2.9 KB
Raw Blame
import type { HealthBand } from "@repowise-dev/types/health";

export const THEME = {
  canvas: {
    bg: "var(--color-bg-canvas)",
    dot: "var(--color-canvas-dot, rgba(148,163,184,0.08))",
  },

  surface: {
    elevated: "var(--color-bg-elevated, rgba(17,24,39,0.96))",
    overlay: "var(--color-bg-overlay, rgba(15,23,42,0.92))",
    glass: "var(--color-bg-glass, rgba(17,24,39,0.75))",
    glassBlur: "blur(8px)",
    wash: "var(--color-bg-wash)",
    washHover: "var(--color-bg-wash-hover)",
  },

  border: {
    default: "var(--color-border-default)",
    subtle: "var(--color-border-subtle, rgba(148,163,184,0.12))",
  },

  text: {
    primary: "var(--color-text-primary)",
    secondary: "var(--color-text-secondary)",
    muted: "var(--color-text-muted)",
  },

  accent: {
    primary: "var(--color-accent-primary)",
    muted: "var(--color-accent-muted, rgba(245,149,32,0.2))",
    hover: "var(--color-accent-hover, rgba(245,149,32,0.35))",
  },

  selection: {
    ring: "var(--color-viz-selection)",
    ringAlpha: "var(--color-accent-muted, rgba(245,149,32,0.16))",
  },

  complexity: {
    simple: "var(--color-success)",
    moderate: "var(--color-warning)",
    complex: "var(--color-error)",
  } as Record<string, string>,

  /** Status badge glyphs (entry / hotspot / dead) — semantic tokens, both themes. */
  status: {
    entry: "var(--color-success)",
    hotspot: "var(--color-error)",
    dead: "var(--color-text-muted)",
  },

  /** Health band inks, on the shared 1-10 bands read at 0-100. */
  health: {
    excellent: "var(--color-success)",
    good: "var(--color-success)",
    fair: "var(--color-caution)",
    needs_work: "var(--color-warning)",
    at_risk: "var(--color-error)",
  } satisfies Record<HealthBand, string>,

  edge: {
    imports: "var(--color-edge-imports)",
    depends_on: "var(--color-warning)",
    contains: "var(--color-accent-secondary)",
    tested_by: "var(--color-success)",
    default: "var(--color-text-tertiary)",
  } as Record<string, string>,

  diff: {
    changed: "var(--color-viz-diff-changed)",
    changedAlpha: "rgba(252,165,165,0.4)",
    affected: "var(--color-viz-diff-affected)",
    affectedAlpha: "rgba(251,191,36,0.3)",
  },

  font: {
    sans: "var(--font-sans, system-ui, sans-serif)",
    mono: "var(--font-mono, ui-monospace, monospace)",
  },

  radius: {
    sm: 4,
    md: 8,
    lg: 12,
  },

  shadow: {
    panel: "0 10px 30px rgba(0,0,0,0.35)",
    tooltip: "0 8px 24px rgba(0,0,0,0.4)",
  },
} as const;

export const KEYFRAMES = {
  accentPulse: `
@keyframes accentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 149, 32, 0.3); }
  50% { box-shadow: 0 0 12px 4px rgba(245, 149, 32, 0.15); }
}`,
  edgeFlow: `
@keyframes edgeFlow {
  to { stroke-dashoffset: -20; }
}`,
  fadeSlideIn: `
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}`,
} as const;