56 lines · 2.2 KBRaw
| 1 | import { Link } from "../provider"; |
| 2 | import { cn } from "../ui/cn"; |
| 3 | |
| 4 | /** Merge: two agent rings flow into one main line, which stops short of the orange dot. The last step, the decision, is yours. */ |
| 5 | export function LogoMark({ className = "size-[1.15em]" }: { className?: string }) { |
| 6 | return ( |
| 7 | <svg viewBox="0 0 24 24" aria-hidden="true" className={`shrink-0 ${className}`}> |
| 8 | <g fill="none" stroke="currentColor" strokeLinecap="round"> |
| 9 | <circle cx="7" cy="3.6" r="1.9" strokeWidth="1.6" /> |
| 10 | <circle cx="17" cy="3.6" r="1.9" strokeWidth="1.6" /> |
| 11 | <path d="M7 6.3C7 12.25 12 10.75 12 16M17 6.3C17 12.25 12 10.75 12 16" strokeWidth="2" /> |
| 12 | </g> |
| 13 | <circle cx="12" cy="20.4" r="2.3" fill="#f6821f" /> |
| 14 | </svg> |
| 15 | ); |
| 16 | } |
| 17 | |
| 18 | export function Wordmark({ large = false }: { large?: boolean }) { |
| 19 | return ( |
| 20 | <Link href="/" aria-label="refs home" className={`wordmark rounded-chip text-ink ${large ? "text-3xl" : "text-[1.2143rem]"}`}> |
| 21 | <LogoMark /> |
| 22 | refs |
| 23 | </Link> |
| 24 | ); |
| 25 | } |
| 26 | |
| 27 | function initials(name: string): string { |
| 28 | return ( |
| 29 | name |
| 30 | .split(/\s+/) |
| 31 | .filter(Boolean) |
| 32 | .slice(0, 2) |
| 33 | .map((part) => part[0]!.toUpperCase()) |
| 34 | .join("") || "?" |
| 35 | ); |
| 36 | } |
| 37 | |
| 38 | const SIZE = { xs: "size-5 text-[0.6429rem]", sm: "size-6 text-[0.7143rem]", base: "size-8 text-xs", lg: "size-11 text-sm" }; |
| 39 | |
| 40 | /** A person: a filled blue roundel. Every human act in refs carries this mark. */ |
| 41 | export function Avatar({ name, size = "sm", className }: { name: string; size?: keyof typeof SIZE; className?: string }) { |
| 42 | return ( |
| 43 | <span aria-hidden="true" className={cn("inline-flex shrink-0 items-center justify-center rounded-full bg-accent font-semibold text-on-accent shadow-[inset_0_1px_0_rgb(255_255_255/0.22)]", SIZE[size], className)}> |
| 44 | {initials(name)} |
| 45 | </span> |
| 46 | ); |
| 47 | } |
| 48 | |
| 49 | /** An agent: a hollow ring, like a station on the line. Agent work never wears the human fill. */ |
| 50 | export function AgentAvatar({ name, size = "sm", className }: { name: string; size?: keyof typeof SIZE; className?: string }) { |
| 51 | return ( |
| 52 | <span aria-hidden="true" className={cn("inline-flex shrink-0 items-center justify-center rounded-full font-semibold text-porcelain shadow-[inset_0_0_0_1.5px_var(--porcelain)]", SIZE[size], className)}> |
| 53 | {initials(name)} |
| 54 | </span> |
| 55 | ); |
| 56 | } |