# ChatWidgetPrimitives

## 2026-07-21 — Contrast-safe brand color on the launcher

**Prompted by:** Hellen — widget color customization (theme color vs custom pick)

### What changed
- `ChatWidgetLauncher` no longer hardcodes `text-white` on its icon; it uses `text-primary-foreground`.
- When `brandColor` is passed, the launcher now emits the full brand variable set via the new `resolveBrandVars()` helper (`--primary`, `--primary-foreground`, `--ring`) instead of only setting `backgroundColor`. The icon color is therefore derived from the brand color.

### Why
- A light brand color (e.g. `#33FF99`, the WealthX default green) rendered a white icon on a light fill — effectively invisible.
- Hardcoded `text-white` violated `.claude/rules/theme-and-component-styling.md`, which requires the matching `*-foreground` token on any primary-background surface.

### Affected tokens / files
- `packages/shadcn/src/components/ui/chat-widget-primitives.tsx`
- `packages/shadcn/src/lib/colors.ts` — new `resolveBrandVars()`
- Behaviour is unchanged when `brandColor` is omitted (still inherits `--primary` from ThemeProvider).

## 2026-06-17 — Markdown messages + a pre-stream "thinking" indicator

**Prompted by:** Copilot extension design work (Hellen)

### What changed
- `ChatWidgetMessage` gains `format?: "plain" | "markdown"` (default `"plain"`). When `"markdown"`, the body renders through `MarkdownContent` instead of a raw string.
- `ChatWidgetTypingIndicator` gains `label?` (text beside the animation, also the accessible status text) and `variant?: "dots" | "shimmer"`. `"shimmer"` is a pulsing bar for a pre-stream "thinking" state; `"dots"` (default) is the existing live-typing animation.

### Why
- AI / assistant responses need rich text (headings, lists, tables, code) rather than plain strings.
- A labelled "thinking" state communicates that the agent is working before tokens stream — distinct from active typing.

### Affected tokens / files
- `packages/shadcn/src/components/ui/chat-widget-primitives.tsx`
- Both changes are additive (optional props, defaults preserve prior behaviour).
