Single source of truth for compact card Tailwind class constants and URL safety validation used across chat-inline `size='sm'` card frames. ## Key Components ### Constants | Export | Purpose | |---|---| | `COMPACT_CARD_OUTER` | Interactive anchor frame with hover/transition styles | | `COMPACT_CARD_OUTER_STATIC` | Non-interactive span frame (`cursor-default`, no hover) | | `COMPACT_CARD_SKELETON_OUTER` | Skeleton frame with `animate-pulse` | | `COMPACT_CARD_IMAGE_SLOT` | 56×56 cover image container | | `COMPACT_CARD_SKELETON_IMAGE_SLOT` | 56×56 placeholder for skeleton state | | `COMPACT_CARD_ICON_SLOT` | 56×56 icon container (cards without a cover image) | | `COMPACT_CARD_TEXT_COL` | Flex column wrapper for title/subtitle/meta rows | | `COMPACT_CARD_TITLE_ROW` | Fixed 20px title row container | | `COMPACT_CARD_META_ROW_BOX` | Fixed 16px subtitle/summary row container | | `COMPACT_CARD_TITLE` | Bold 14px/20px leading title text | | `COMPACT_CARD_SUBTITLE` | 11px secondary text | | `COMPACT_CARD_SUMMARY` | 11px secondary text at 80% opacity | | `COMPACT_CARD_META_ROW` | Multi-part 11px metadata row | | `COMPACT_CARD_ROW_FILLER` | Non-breaking space to preserve 16px row height | ### Functions **`safeHref(url)`** — Validates a URL before use in an ``. Returns the original string only if it passes all safety checks, otherwise `null`. Allowed: - `http:`, `https:`, `mailto:` schemes - Same-origin paths starting with `/` (not `//`) - Hash fragments starting with `#` Rejected: - Control/zero-width/line-separator characters - Unknown schemes (`javascript:`, `data:`, etc.) - Bare scheme-only strings - `http`/`https` URLs with no hostname ## Usage Example ```typescript import { COMPACT_CARD_OUTER, COMPACT_CARD_OUTER_STATIC, COMPACT_CARD_IMAGE_SLOT, COMPACT_CARD_TITLE, COMPACT_CARD_SUBTITLE, safeHref, } from './compact-card-classes' const href = safeHref(card.url) // Renders an interactive anchor if href is safe, otherwise a static span const outerClass = href ? COMPACT_CARD_OUTER : COMPACT_CARD_OUTER_STATIC const Wrapper = href ? 'a' : 'span' const wrapperProps = href ? { href } : {} ``` > **Card-specific variation** (play overlays, pill badges, status indicators) lives inside each individual card component. These constants govern only the shared outer frame — uniform across all compact card types.