{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "board",
  "type": "registry:ui",
  "title": "Board",
  "description": "The board primitive.",
  "dependencies": [
    "lucide-react@^1.49.0"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/avatar.json",
    "https://ui.klarhimmel.com/r/menu.json",
    "https://ui.klarhimmel.com/r/theme.json",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/ui/board.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/ui/board.tsx",
      "content": "import { useEffect, useId, useRef, useState, type DragEvent, type ReactNode } from 'react';\nimport { AlertCircle, MoreHorizontal } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport { Avatar } from './avatar';\nimport { Menu, MenuContent, MenuItem, MenuLabel, MenuSeparator, MenuTrigger } from './menu';\n\n/** What a card shows. Every app's board draws the same card, so only the fields differ. */\nexport interface BoardCardFields {\n  /** Shown as given (a host may pass editable text); `name` is the plain words for menus and announcements, when title is not a string. */\n  title: ReactNode;\n  name?: string;\n  /** The task's number, in a circle of the column's tone over the person's avatar. */\n  number?: string | number;\n  /** Who it is with: name beside the avatar (whose initials come from `avatar`, or person when it is a string). */\n  person?: ReactNode;\n  avatar?: string;\n  /** A quiet line under the name (\"2 days ago\"). */\n  meta?: ReactNode;\n  /** One quiet sentence under the title, wrapping (a request's state, \"Waiting for your OK since Monday\"; Klar Portal, Felix 10-27 19:58).\n   *  meta stays the line under the person's name, above the title. Not drawn on a compact row. */\n  line?: ReactNode;\n  /** The status, in an outlined pill with the column's dot. */\n  status?: ReactNode;\n  /** A grey chip at the right end: a planned date or a checklist count, with its icon. `overdue` says the word beside it, never colour alone. */\n  chip?: { icon?: ReactNode; text: ReactNode; overdue?: ReactNode };\n  /** A compact row instead of a card (a board's overview, Felix 28 Oct: \"epics as compact rows with a progress ring\"): the theme's\n   *  mark, the number, the title in one line, the chip's text, the ring, the menu. cover and action are not drawn. */\n  compact?: boolean;\n  /** The ring on a compact row: parts done of total. */\n  ring?: { done: number; total: number };\n  /** The card's mark: its key as quiet text (KS-102) where the number circle sat; a circle overflows at three digits (Felix 28 Oct). */\n  mark?: ReactNode;\n  /** The card's theme (Felix 28 Oct \"themes should be incorporated somehow\"): a thin colour stripe with the theme's name over the card. */\n  theme?: { name: ReactNode; color: string };\n  /** The card's epic, when a part is drawn as a card of its own (a board's Tasks level): a short stripe in the epic's colour and\n   *  its key or short title over the title, so the title stays the part's own (Felix 28 Oct). */\n  epic?: { name: ReactNode; color?: string };\n  /** A picture across the card's top, edge to edge (an attached image, a project's cover; Felix 28 Oct \"we need the cards to support images\"). */\n  cover?: { src: string; alt?: string };\n  /** A control at the card's foot, above the open target (an app's Review button, Felix 28 Oct: \"understand and approve a card from the board view\"). */\n  action?: ReactNode;\n}\n\nexport interface BoardColumn<T> {\n  key: string;\n  title: ReactNode;\n  /** Plain words for the title when it is not a string (announcements). */\n  name?: string;\n  items: T[];\n  /** The status colour (--kh-status-*) of the column's dot, its cards' number circle and status pill. */\n  tone?: BoardTone;\n  /** Controls at the right of the column's header (filter, sort menus). */\n  actions?: ReactNode;\n  /** The second line of an empty column (\"Finished tasks land here.\"). */\n  emptyLine?: ReactNode;\n  /** The last row of the column's well, under the cards (an app's 'Add a card' that shows on hover below them). */\n  footer?: ReactNode;\n}\n\nexport type BoardTone = 'todo' | 'doing' | 'review' | 'done';\n// Classes, not a style attribute: server-rendered pages run under a CSP without inline styles.\nconst TONE: Record<BoardTone | 'none', string> = {\n  todo: '[--kh-board-tone:var(--kh-status-todo)]',\n  doing: '[--kh-board-tone:var(--kh-status-doing)]',\n  review: '[--kh-board-tone:var(--kh-status-review)]',\n  done: '[--kh-board-tone:var(--kh-status-done)]',\n  none: '[--kh-board-tone:var(--kh-muted)]',\n};\nconst COLS = ['', '', '@3xl:grid-cols-2', '@3xl:grid-cols-3', '@3xl:grid-cols-4', '@3xl:grid-cols-5', '@3xl:grid-cols-6'];\n\nexport interface BoardWords {\n  /** Kept for hosts' word tables; the phone's column picker went (the columns stack, Felix 28 Oct). */\n  column: string;\n  /** The card menu's open item. */\n  open: string;\n  /** The card menu's label over the other columns: the keyboard way to move a card. */\n  moveTo: string;\n  /** Said after a move: \"<card> moved to <column>\". */\n  moved: string;\n  /** An empty column's first line. */\n  empty: string;\n  /** The card menu's button name: \"More for <card>\". */\n  more: string;\n  /** The count after a column title, for screen readers: (3) => \"3 tasks\". */\n  count?: (n: number) => string;\n}\n\n/** A node's plain words, for names when a host passes no string. */\nconst text = (n: ReactNode): string => (typeof n === 'string' || typeof n === 'number' ? String(n) : '');\n\nconst EN: BoardWords = { column: 'Column', open: 'Open', moveTo: 'Move to', moved: 'moved to', empty: 'Nothing here', more: 'More for', count: (n) => `${n} ${n === 1 ? 'card' : 'cards'}` };\n\nexport interface BoardProps<T> {\n  /** Names the board for screen readers. */\n  label: string;\n  columns: BoardColumn<T>[];\n  id(item: T): string;\n  card(item: T, column: BoardColumn<T>): BoardCardFields;\n  onOpen?(item: T): void;\n  /**\n   * A person moved a card (drag, or the card menu). Controlled: the board changes nothing itself, so the host's data stays the only truth\n   * and a move the server refuses never shows as done. The board says and focuses the card once it appears in the new column.\n   */\n  onMove?(item: T, to: string): void;\n  /** Whether a card may go to a column; menu items and drop targets that may not are greyed. Default: any other column. */\n  allowed?(item: T, to: string): boolean;\n  /**\n   * A person put a card in a new place in its own column (drag between cards; Felix 28 Oct \"organize the lists by dragging cards\").\n   * `before` is the card it now sits above, null for last. Controlled like onMove: the host writes the order and the board redraws it.\n   * A column takes reorders where `reorderable` says (default: every column, when onReorder is given).\n   */\n  onReorder?(item: T, before: T | null, column: string): void;\n  reorderable?(column: string): boolean;\n  /** Extra items for a card's ⋯ menu, above the moves (an app's 'Move to top'). */\n  menu?(item: T): { key: string; title: ReactNode; go: () => void }[];\n  /** Whether a card can be dragged. Default: when the board has onMove. The menu stays the keyboard way. */\n  draggable?(item: T): boolean;\n  /** Fill the height it is given: columns run the full height and each well scrolls on its own. Off: columns are as tall as their cards. */\n  fill?: boolean;\n  /** Which column a phone opens on: the first in this order that has cards. Default: the columns' order. */\n  words?: Partial<BoardWords>;\n  className?: string;\n}\n\n/**\n * A board of columns (Trello's, Huddlekit's panels look): each column a panel with a tone dot, its count and its own actions over an inset\n * well of cards. Cards open on click, move by drag or by their ⋯ menu, and only where `allowed` says. On a phone the columns stack, each\n * at most one screen tall (100svh), a short column ending at its last card, with its cards scrolling inside (Felix 28 Oct: \"we just stack the columns on top of each other here ...\n * 100svh per column\"). Controlled throughout; `app-boards-kanban` is this board with its data in props.\n */\nexport function Board<T>({ label, columns, id, card, onOpen, onMove, onReorder, reorderable, menu, allowed, draggable, fill = false, words: given, className }: BoardProps<T>) {\n  const words = { ...EN, ...given };\n  const uid = useId();\n  const can = (item: T, from: string, to: string) => to !== from && (allowed ? allowed(item, to) : true);\n  const [dragging, setDragging] = useState<{ item: T; from: string } | null>(null);\n  const [over, setOver] = useState<string | null>(null);\n  // Where a card dropped in its own column would land: above `before` (a card's key), or last (null).\n  const [slot, setSlot] = useState<{ col: string; before: string | null } | null>(null);\n  const sorts = (col: string) => !!onReorder && (reorderable ? reorderable(col) : true);\n  const [said, setSaid] = useState('');\n  // A move waits for the host: once the card is in the column it was sent to, say so and put focus back on its menu button.\n  const pending = useRef<{ key: string; to: string } | null>(null);\n  const buttons = useRef(new Map<string, HTMLButtonElement>());\n  useEffect(() => {\n    const p = pending.current;\n    if (!p) return;\n    const col = columns.find((c) => c.key === p.to);\n    const item = col?.items.find((x) => id(x) === p.key);\n    if (!col || !item) return;\n    pending.current = null;\n    const f = card(item, col);\n    setSaid(`${f.name ?? text(f.title)} ${words.moved} ${col.name ?? text(col.title)}`);\n    requestAnimationFrame(() => buttons.current.get(p.key)?.focus());\n  });\n  const move = (item: T, to: string) => {\n    pending.current = { key: id(item), to };\n    onMove?.(item, to);\n  };\n  const drop = (e: DragEvent, to: string) => {\n    e.preventDefault();\n    setOver(null);\n    const at = slot;\n    setSlot(null);\n    if (dragging && dragging.from === to && at?.col === to && sorts(to)) {\n      const col = columns.find((c) => c.key === to);\n      const before = at.before === null ? null : col?.items.find((x) => id(x) === at.before) ?? null;\n      if (before === null || id(before) !== id(dragging.item)) onReorder?.(dragging.item, before, to);\n    } else if (dragging && can(dragging.item, dragging.from, to)) move(dragging.item, to);\n    setDragging(null);\n  };\n  // Over a column's cards: the slot is above the first card whose middle is below the pointer, else last.\n  const aim = (e: DragEvent<HTMLUListElement>, col: string) => {\n    if (!dragging || dragging.from !== col || !sorts(col)) return;\n    const cards = [...e.currentTarget.querySelectorAll<HTMLElement>(':scope > li[data-card]')];\n    const next = cards.find((li) => { const r = li.getBoundingClientRect(); return e.clientY < r.top + r.height / 2; });\n    const before = next?.dataset.card ?? null;\n    if (slot?.col !== col || slot.before !== before) setSlot({ col, before });\n  };\n  const count = (n: number) => words.count?.(n) ?? String(n);\n  return (\n    <div role=\"group\" aria-label={label} className={cn('flex flex-col gap-3', fill && 'min-h-0 flex-1', className)}>\n      <p role=\"status\" className=\"sr-only\">{said}</p>\n      <div\n        className={cn('grid gap-(--kh-shell-gap)', COLS[Math.min(columns.length, 6)], fill ? 'min-h-0 flex-1 @3xl:items-stretch' : 'items-start')}\n      >\n        {columns.map((col) => {\n          const target = dragging ? can(dragging.item, dragging.from, col.key) || (dragging.from === col.key && sorts(col.key)) : false;\n          return (\n            <section\n              key={col.key}\n              aria-labelledby={`${uid}-${col.key}`}\n              onDragOver={(e) => { if (target) { e.preventDefault(); e.dataTransfer.dropEffect = 'move'; setOver(col.key); } }}\n              onDragLeave={(e) => { if (!e.currentTarget.contains(e.relatedTarget as Node)) { setOver(null); setSlot(null); } }}\n              onDrop={(e) => drop(e, col.key)}\n              className={cn(\n                TONE[col.tone ?? 'none'],\n                'flex min-w-0 flex-col rounded-(--kh-panel-radius) bg-(--kh-panel-bg) p-1.5 shadow-(--kh-panel-shadow) transition-[box-shadow,opacity] duration-(--kh-dur)',\n                fill && 'min-h-0',\n                '@max-3xl:max-h-[100svh]',\n                dragging && !target && col.key !== dragging.from && 'opacity-60',\n              )}\n            >\n              <h3 id={`${uid}-${col.key}`} className=\"flex min-h-10 items-center gap-2 pl-2.5 text-kh-small\">\n                {col.tone && <span aria-hidden className=\"size-2 shrink-0 rounded-full bg-(--kh-board-tone)\" />}\n                <span className=\"font-medium\">{col.title}</span>\n                <span className=\"text-kh-muted\"><span aria-hidden>{col.items.length}</span><span className=\"sr-only\">{count(col.items.length)}</span></span>\n                {col.actions && <span className=\"ml-auto flex\">{col.actions}</span>}\n              </h3>\n              <ul onDragOver={(e) => aim(e, col.key)} className={cn('flex flex-col gap-2 rounded-(--kh-well-radius) bg-(--kh-well) p-2 outline-2 -outline-offset-2 outline-transparent transition-[outline-color,background-color] duration-(--kh-dur)', over === col.key && dragging?.from !== col.key && 'bg-(--kh-row-active) outline-dashed outline-(--kh-board-tone)', fill ? 'min-h-0 flex-1 overflow-y-auto' : '@max-3xl:min-h-0 @max-3xl:flex-1 @max-3xl:overflow-y-auto')}>\n                {col.items.map((item) => {\n                  const key = id(item);\n                  const drag = draggable ? draggable(item) : !!onMove;\n                  const others = onMove ? columns.filter((c) => c.key !== col.key) : [];\n                  return (\n                    <li key={key} data-card={key} className=\"relative\">\n                      {slot?.col === col.key && slot.before === key && <span aria-hidden className=\"absolute -top-[5px] right-1 left-1 h-0.5 rounded-full bg-(--kh-board-tone)\" />}\n                      <BoardCard\n                        {...card(item, col)}\n                        words={words}\n                        onOpen={onOpen && (() => onOpen(item))}\n                        menuRef={(el) => { if (el) buttons.current.set(key, el); else buttons.current.delete(key); }}\n                        moves={others.length > 0 ? others.map((c) => ({ key: c.key, title: c.title, ok: can(item, col.key, c.key), go: () => move(item, c.key) })) : undefined}\n                        {...(menu ? { actions: menu(item) } : {})}\n                        draggable={drag}\n                        dragging={dragging !== null && id(dragging.item) === key}\n                        onDragStart={(e) => { e.dataTransfer.setData('text/plain', key); e.dataTransfer.effectAllowed = 'move'; setDragging({ item, from: col.key }); }}\n                        onDragEnd={() => { setDragging(null); setOver(null); setSlot(null); }}\n                      />\n                    </li>\n                  );\n                })}\n                {slot?.col === col.key && slot.before === null && col.items.length > 0 && <li aria-hidden className=\"h-0.5 rounded-full bg-(--kh-board-tone)\" />}\n                {col.items.length === 0 && (\n                  // A filling column starts its empty note at a fixed height, not centred, so \"Nothing here\" lines up across columns whatever its second line wraps to\n                  <li className={cn('flex flex-col items-center gap-1 px-6 text-center', fill ? 'flex-1 justify-start pt-16 pb-8' : 'justify-center py-8')}>\n                    <span className=\"font-semibold\">{words.empty}</span>\n                    {col.emptyLine && <span className=\"text-kh-small text-kh-muted\">{col.emptyLine}</span>}\n                  </li>\n                )}\n                {col.footer && <li>{col.footer}</li>}\n              </ul>\n            </section>\n          );\n        })}\n      </div>\n    </div>\n  );\n}\n\ninterface CardProps extends BoardCardFields {\n  words: BoardWords;\n  onOpen?: () => void;\n  moves?: { key: string; title: ReactNode; ok: boolean; go: () => void }[];\n  actions?: { key: string; title: ReactNode; go: () => void }[];\n  menuRef?: (el: HTMLButtonElement | null) => void;\n  draggable?: boolean;\n  onDragStart?: (e: DragEvent) => void;\n  onDragEnd?: () => void;\n  /** This card is the one being dragged: it stays as a faint placeholder where it was. */\n  dragging?: boolean;\n}\n\n/** The card: the title at body size (it is what people read; Klar Portal 19:14), number on the person's avatar, who and when, a round ⋯ (open, move), the title as the open target, then status and chip. */\nfunction BoardCard({ title, name, number, mark, person, avatar, meta, line, status, chip, action, cover, theme, epic, compact, ring, words, onOpen, moves, actions, menuRef, draggable, onDragStart, onDragEnd, dragging }: CardProps) {\n  const hasMenu = !!onOpen || !!moves?.length || !!actions?.length;\n  // On a card with a picture the ⋯ floats over its top right corner (Felix 28 Oct), so the card spends no row on it.\n  const menu = hasMenu ? (\n            <Menu>\n              <MenuTrigger asChild>\n                <button type=\"button\" ref={menuRef} aria-label={`${words.more} ${name ?? text(title)}`} className={cn('relative z-10 inline-flex size-8 shrink-0 items-center justify-center rounded-full border border-(--kh-card-line) text-kh-ink-2 hover:bg-(--kh-row-active) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--kh-focus) pointer-coarse:size-11', cover && 'bg-kh-surface/90 backdrop-blur-sm')}>\n                  <MoreHorizontal aria-hidden className=\"size-4\" />\n                </button>\n              </MenuTrigger>\n              <MenuContent align=\"end\">\n                {onOpen && <MenuItem onSelect={onOpen}>{words.open}</MenuItem>}\n                {actions?.map((a) => <MenuItem key={a.key} onSelect={a.go}>{a.title}</MenuItem>)}\n                {(onOpen || actions?.length) && moves?.length ? <MenuSeparator /> : null}\n                {moves?.length ? <MenuLabel>{words.moveTo}</MenuLabel> : null}\n                {moves?.map((m) => <MenuItem key={m.key} disabled={!m.ok} onSelect={m.go}>{m.title}</MenuItem>)}\n              </MenuContent>\n            </Menu>\n  ) : null;\n  const who = avatar ?? text(person);\n  // With nothing else for the top row, the ⋯ ends the title row instead of drawing a band of its own (Klar Portal KS-179, Felix 2 Nov 'something wrong here').\n  const top = number !== undefined || !!mark || !!person || !!meta;\n  const inTitle = !top && !cover && !!menu;\n  if (compact) return (\n    <article\n      draggable={draggable || undefined}\n      onDragStart={onDragStart}\n      onDragEnd={onDragEnd}\n      className={cn('relative flex items-center gap-2.5 rounded-(--kh-well-radius) border border-(--kh-card-line) bg-kh-surface py-2 pr-1.5 pl-3 text-kh-small shadow-(--kh-card-shadow) transition-shadow duration-(--kh-dur) hover:shadow-(--kh-card-shadow-hover)', draggable && 'cursor-grab active:cursor-grabbing', dragging && 'opacity-40')}\n    >\n      {theme && <span aria-hidden title={text(theme.name)} className=\"h-1 w-3 shrink-0 rounded-full\" style={{ background: theme.color }} />}\n      {number !== undefined && <span className=\"inline-flex size-7 shrink-0 items-center justify-center rounded-full bg-(--kh-board-tone) text-kh-caption font-semibold text-kh-surface\">{number}</span>}\n      {epic && <span className=\"inline-flex shrink-0 items-center gap-1.5 text-kh-caption text-kh-muted\"><span aria-hidden className=\"h-1 w-3 rounded-full\" style={{ background: epic.color ?? 'var(--kh-board-tone)' }} />{epic.name}</span>}\n      {onOpen ? (\n        <button type=\"button\" onClick={onOpen} className={cn(\"min-w-0 flex-1 text-left text-kh-body font-medium [overflow-wrap:anywhere] line-clamp-2 after:absolute after:inset-0 after:content-[''] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--kh-focus)\", draggable ? 'cursor-grab active:cursor-grabbing' : 'cursor-pointer')}>{title}</button>\n      ) : (\n        <span className=\"min-w-0 flex-1 text-kh-body font-medium [overflow-wrap:anywhere] line-clamp-2\">{title}</span>\n      )}\n      {chip && <span className=\"shrink-0 text-kh-muted\">{chip.text}</span>}\n      {ring && <Ring done={ring.done} total={ring.total} />}\n      {menu}\n    </article>\n  );\n  // In the title row the first line is centred on the 32 px menu button (pt-1 on a 24 px line).\n  const heading = onOpen ? (\n    <button type=\"button\" onClick={onOpen} className={cn(\"block w-full text-left text-kh-body font-medium [overflow-wrap:anywhere] after:absolute after:inset-0 after:content-[''] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--kh-focus)\", draggable ? 'cursor-grab active:cursor-grabbing' : 'cursor-pointer', inTitle && 'min-w-0 flex-1 pt-1')}>{title}</button>\n  ) : (\n    <p className={cn('text-kh-body font-medium [overflow-wrap:anywhere]', inTitle && 'min-w-0 flex-1 pt-1')}>{title}</p>\n  );\n  return (\n    <article\n      draggable={draggable || undefined}\n      onDragStart={onDragStart}\n      onDragEnd={onDragEnd}\n      className={cn('relative rounded-(--kh-well-radius) border border-(--kh-card-line) bg-kh-surface p-3 text-kh-small shadow-(--kh-card-shadow) transition-shadow duration-(--kh-dur) hover:shadow-(--kh-card-shadow-hover)', draggable && 'cursor-grab active:cursor-grabbing', dragging && 'border-dashed opacity-40 shadow-none')}\n    >\n      {cover && <img src={cover.src} alt={cover.alt ?? ''} loading=\"lazy\" draggable={false} className=\"-mx-3 -mt-3 mb-3 block aspect-[16/9] w-[calc(100%+1.5rem)] max-w-none rounded-t-(--kh-well-radius) bg-kh-surface-2 object-cover\" />}\n      {cover && menu && <div className=\"absolute top-2 right-2 z-10\">{menu}</div>}\n      {theme && <span className=\"mb-2 flex items-center gap-2 text-kh-small text-kh-muted\"><span aria-hidden className=\"h-1 w-6 shrink-0 rounded-full\" style={{ background: theme.color }} />{theme.name}</span>}\n      {epic && <span className=\"mb-2 flex items-center gap-2 text-kh-caption text-kh-muted\"><span aria-hidden className=\"h-1 w-6 shrink-0 rounded-full\" style={{ background: epic.color ?? 'var(--kh-board-tone)' }} />{epic.name}</span>}\n      {top && (\n        <div className=\"mb-2.5 flex items-center gap-2.5\">\n          {mark && <span className=\"shrink-0 text-kh-caption font-medium text-kh-muted\">{mark}</span>}\n          {(number !== undefined || person) && (\n            <span className=\"flex shrink-0 items-center\">\n              {number !== undefined && <span className=\"relative z-10 inline-flex size-8 items-center justify-center rounded-full bg-(--kh-board-tone) font-semibold text-kh-surface ring-2 ring-kh-surface\">{number}</span>}\n              {person && <Avatar name={who} size=\"sm\" decorative className={cn(number !== undefined && '-ml-2')} />}\n            </span>\n          )}\n          <span className=\"min-w-0 flex-1\">\n            {person && <span className=\"block truncate font-medium\">{person}</span>}\n            {meta && <span className=\"block text-kh-muted\">{meta}</span>}\n          </span>\n          {!cover && menu}\n        </div>\n      )}\n      {inTitle ? <div className=\"flex items-start gap-2.5\">{heading}{menu}</div> : heading}\n      {line && <p className=\"mt-1 text-kh-small text-kh-ink-2 [overflow-wrap:anywhere]\">{line}</p>}\n      {(status || chip || action) && (\n        <div className=\"mt-2.5 flex flex-wrap items-center justify-between gap-2\">\n          {action && <span className=\"relative z-10\">{action}</span>}\n          {status && <span className=\"inline-flex h-7 items-center gap-1.5 rounded-kh-pill border border-(--kh-card-line) px-2.5\"><span aria-hidden className=\"size-2 rounded-full bg-(--kh-board-tone)\" />{status}</span>}\n          {chip && (\n            <span className={cn('ml-auto inline-flex h-7 items-center gap-1.5 rounded-kh bg-(--kh-bubble) px-2.5', chip.overdue && 'font-medium', 'text-kh-ink')}>\n              {chip.icon}{chip.text}\n              {chip.overdue && <><AlertCircle aria-hidden className=\"size-3.5 text-kh-danger\" />{chip.overdue}</>}\n            </span>\n          )}\n        </div>\n      )}\n    </article>\n  );\n}\n\n/** A compact row's ring: parts done of total, the column's tone over the card line. */\nfunction Ring({ done, total }: { done: number; total: number }) {\n  const pct = total > 0 ? Math.round((Math.min(done, total) / total) * 100) : 0;\n  return (\n    <span role=\"img\" aria-label={`${done} / ${total}`} className=\"inline-flex size-7 shrink-0 items-center justify-center\">\n      <svg viewBox=\"0 0 24 24\" className=\"size-5 -rotate-90\" fill=\"none\" aria-hidden>\n        <circle cx=\"12\" cy=\"12\" r=\"9\" strokeWidth=\"2.5\" className=\"stroke-(--kh-card-line)\" />\n        {pct > 0 && <circle cx=\"12\" cy=\"12\" r=\"9\" strokeWidth=\"2.5\" pathLength=\"100\" strokeDasharray={`${pct} 100`} strokeLinecap=\"round\" className=\"stroke-(--kh-board-tone)\" />}\n      </svg>\n    </span>\n  );\n}\n"
    }
  ]
}
