# Popover

A click-opened surface that may hold interactive content, beside its trigger or any element it is about, and the hover card that previews a link or a row.

Live variants: https://design.arcadia.is/components/popover

```tsx
import {
  Popover, PopoverTrigger, PopoverContent, PopoverTitle, PopoverDescription,
  PopoverFooter, PopoverError, PopoverClose, HoverCard, HoverCardTrigger,
  HoverCardContent, HoverCardTitle, HoverCardRow, HoverCardGroup,
  ContextPopover, ChecksPopover, ChecksChip,
} from "@arcadia/ui";
```

## When to use

- A few controls or toggles tied to a trigger
- Details about its trigger, beside it
- One state and one act, ended by `PopoverFooter`

## When not to use

- A task that must finish before the page is used: use `Dialog`
- A list of actions or choices: use `Menu`
- A preview of what a link points to: use `HoverCard`

## In context

Change Fast mode, then apply or cancel.

```tsx
import { useState } from "react";
import {
  Button, Popover, PopoverClose, PopoverContent, PopoverDescription,
  PopoverTitle, PopoverTrigger, Switch,
} from "@arcadia/ui";

function Parameters() {
  const [fast, setFast] = useState(false);
  const [draft, setDraft] = useState(fast);
  return (
    <Popover onOpenChange={(open) => { if (open) setDraft(fast); }}>
      <PopoverTrigger
        render={<Button variant="secondary" iconEnd="chevron-down">Model effort: {fast ? "Fast" : "Standard"}</Button>}
      />
      <PopoverContent align="start">
        <PopoverTitle>Model effort</PopoverTitle>
        <PopoverDescription>Applies to new turns in this chat.</PopoverDescription>
        <Switch label="Fast mode" checked={draft} onCheckedChange={setDraft} />
        <div {...sx("cmp-form-actions", cmp.formActions)}>
          <PopoverClose render={<Button size="sm">Cancel</Button>} />
          <PopoverClose render={<Button size="sm" variant="primary" onClick={() => setFast(draft)}>Apply</Button>} />
        </div>
      </PopoverContent>
    </Popover>
  );
}
```

## Usage

```tsx
import {
  Button, Popover, PopoverContent, PopoverDescription, PopoverTitle,
  PopoverTrigger,
} from "@arcadia/ui";

<Popover>
  <PopoverTrigger render={<Button>Filters</Button>} />
  <PopoverContent size="sm" align="start">
    <PopoverTitle>Filters</PopoverTitle>
    <PopoverDescription>Show only chats that match.</PopoverDescription>
  </PopoverContent>
</Popover>
```

Click-opened and non-modal by default, on the shared popup surface with 12px padding; opened from the keyboard, it is there in one frame. It may hold controls: switches, a field, a pair of buttons. `PopoverClose` wraps any button that should close it.

Which overlay? A Popover holds content you act on. A [Hover Card](#hover-card) previews what a link or a row points to. A [Menu](/components/menu) lists actions or choices, and a [Tooltip](/components/tooltip) names a control in a few words.

A floating surface is placed inside the visible viewport, `window.visualViewport` where there is one, with its width, height and offsets: in a zoomed view or over a phone's keyboard it flips or caps to the room that is left, so it never goes under the keys or past the edge of what shows.

## Examples

### Sizes

Three widths with the same padding, shrinking to fit their preview frame on a narrow screen.

- 240 wide
- 320 wide, the default
- 400 wide

### A list

With `padding="list"` 28px Body rows share their leading column. The frame has 4px padding, so the rows' corners stay concentric. A label too long for the width takes its meta's place first and then ends on a whole word, as in any `ListRow`.

```tsx
import {
  Button, ListRow, Popover, PopoverContent, PopoverTitle, PopoverTrigger,
} from "@arcadia/ui";

<Popover>
  <PopoverTrigger render={<Button variant="secondary" iconEnd="chevron-down">acme-web</Button>} />
  <PopoverContent size="sm" align="start" padding="list">
    <PopoverTitle>Branches</PopoverTitle>
    <ListRow leading="branch" label="main" meta="Current" />
    <ListRow leading="branch" label="fix/unread-divider-race" meta="2h" />
    <ListRow leading="branch" label="Round refunds to the minor unit" meta="3d" />
    <ListRow label="Show every branch" tone="muted" />
  </PopoverContent>
</Popover>
```

- Rows with a title

### Emoji list

Use `variant="emoji-list"` for reactions. The 14px frame wraps rows with 10px corners and 4px of padding.

```tsx
import { useState } from "react";
import {
  Button, ListRow, Popover, PopoverClose, PopoverContent, PopoverTrigger,
} from "@arcadia/ui";

function EmojiList() {
  const [reaction, setReaction] = useState<string>();
  return (
    <Popover>
      <PopoverTrigger render={<Button variant="secondary">{reaction ?? "Reactions"}</Button>} />
      <PopoverContent aria-label="Reactions" variant="emoji-list" size="sm" align="start">
        <PopoverClose render={<ListRow leading={<span aria-hidden>🙂</span>} label="Smile" />} onClick={() => setReaction("Smile")} />
        <PopoverClose render={<ListRow leading={<span aria-hidden>🎉</span>} label="Celebrate" />} onClick={() => setReaction("Celebrate")} />
      </PopoverContent>
    </Popover>
  );
}
```

### Long content scrolls inside

A popover takes the width its size names and never grows past the room its side leaves: what does not fit scrolls inside its frame, so it stays where it opened. A new view or more rows inside changes nothing around it.

```tsx
import {
  Button, ListRow, Popover, PopoverContent, PopoverTitle, PopoverTrigger,
} from "@arcadia/ui";

<Popover>
  <PopoverTrigger render={<Button variant="secondary" iconEnd="chevron-down">Deployments</Button>} />
  <PopoverContent size="sm" align="start" padding="list">
    <PopoverTitle>Deployments</PopoverTitle>
    {Array.from({ length: 24 }, (_, i) => "release-" + (i + 1)).map((name) => <ListRow key={name} leading="branch" label={name} meta="main" />)}
  </PopoverContent>
</Popover>
```

### One state, one act

`PopoverFooter` ends a popover that states one thing and offers one act; `PopoverError` under it says why the act failed.

```tsx
import {
  Button, IconButton, Popover, PopoverContent, PopoverDescription,
  PopoverFooter, PopoverTitle, PopoverTrigger, StatusDot,
} from "@arcadia/ui";

<Popover>
  <PopoverTrigger render={<IconButton icon="mic" label="Dictate" />} />
  <PopoverContent size="sm" side="top" align="end">
    <PopoverTitle>Microphone</PopoverTitle>
    <PopoverDescription>Dictation in the composer</PopoverDescription>
    <PopoverFooter action={<Button size="sm" variant="secondary">Allow</Button>}>
      <StatusDot tone="neutral">Not asked</StatusDot>
    </PopoverFooter>
  </PopoverContent>
</Popover>
```

- Not asked yet
- The act failed

### Beside another element

`anchor` places it beside any element in place of its trigger: here over the message the receipt under it is about, so the receipt stays in sight. It takes an element, a ref or a function, and works without a trigger too, for a popover a menu's item or a shortcut opens.

```tsx
import { useRef } from "react";
import {
  Bubble, Button, MessageGroup, Popover, PopoverContent, PopoverDescription,
  PopoverTitle, PopoverTrigger,
} from "@arcadia/ui";

function Beside() {
  const message = useRef<HTMLDivElement>(null);
  return (
    <Popover>
      <MessageGroup side="end" meta={<PopoverTrigger render={<Button size="xs" variant="ghost">Read by 2</Button>} />}>
        <Bubble ref={message} side="end">The refunds round to the minor unit now.</Bubble>
      </MessageGroup>
      <PopoverContent anchor={message} side="top" align="end" size="sm">
        <PopoverTitle>Read by</PopoverTitle>
        <PopoverDescription>Ada Lovelace and Scout for maya</PopoverDescription>
      </PopoverContent>
    </Popover>
  );
}
```

## Hover card

`HoverCard` previews what a link or a row points to, on hover and on keyboard focus, after 150ms. It holds metadata, never actions.

Use it for a preview that a person can also reach by pressing its trigger or on the thing's own page, or to show a row's cut label whole. Anything a person must act on belongs in a popover, and a few words that name an icon-only control in a `Tooltip`.

In Act, a chat's row in the sidebar previews its branch and folder in a card when the pointer rests on it.

```tsx
import {
  HoverCard, HoverCardContent, HoverCardRow, HoverCardTitle, HoverCardTrigger,
  ListRow, StatusDot,
} from "@arcadia/ui";

<div {...sx("cmp-rows", cmp.rows, cmp.rowsNarrow)} data-width="narrow">
  <HoverCard>
    <HoverCardTrigger
      render={
        <ListRow leading={<StatusDot status="unread" />} label="Quarterly report" meta="13h" />
      }
    />
    <HoverCardContent>
      <HoverCardTitle>Quarterly report</HoverCardTitle>
      <HoverCardRow icon="branch">main</HoverCardRow>
      <HoverCardRow icon="folder">projects/acme-web</HoverCardRow>
    </HoverCardContent>
  </HoverCard>
  <ListRow leading={<StatusDot />} label="Onboarding copy" meta="2d" />
</div>
```

```tsx
import {
  HoverCard, HoverCardContent, HoverCardRow, HoverCardTitle, HoverCardTrigger,
} from "@arcadia/ui";

<HoverCard>
  <HoverCardTrigger href="/chats/42">Quarterly report</HoverCardTrigger>
  <HoverCardContent side="bottom">
    <HoverCardTitle>Quarterly report</HoverCardTitle>
    <HoverCardRow icon="branch">main</HoverCardRow>
  </HoverCardContent>
</HoverCard>
```

Metadata for a link or a row, never actions. It opens 150ms after the pointer rests or the trigger takes keyboard focus, and closes 150ms after the pointer leaves, so sweeping down a sidebar doesn't flash a card per row. A Caption bold title, rows of Caption text that wrap to three lines at most, 10px padding, at most 280 wide, to the right of a sidebar row by default. Inside its trigger a cut label shows no tooltip of its own: the card shows it whole.

Rows that each have a card, such as a sidebar's list, sit in one `HoverCardGroup`, so one card shows at a time. Moving the pointer or the focus to the next row puts its card in place of the open one at once, with no delay and no motion. A diagonal move toward the open card keeps it. A card that opens within 300ms of the last one closing opens at once too.

It is never taller than the room the window leaves on its side, nor than `--hover-card-max-h` (60vh): longer content scrolls inside the card instead of running past the window. Nor is it wider than that room: `collisionBoundary` names a box it stays inside instead of the window, a sidebar for a card on the sidebar's footer, and the card narrows to fit it. A card is a preview, so keep what it shows short and put the whole thing one click away.

### One at a time

Rows in a `HoverCardGroup` share one card. Move down the rows and the card moves with the pointer.

### An action in a hover card

Pass `onClick` to make the row a button. Tab from the trigger to the action, then press Enter or Space. Escape returns focus to the trigger.

```tsx
import { useState } from "react";
import {
  Button, HoverCard, HoverCardContent, HoverCardRow, HoverCardTitle,
  HoverCardTrigger,
} from "@arcadia/ui";

function HoverAction() {
  const [checked, setChecked] = useState(0);
  return (
    <HoverCard>
      <HoverCardTrigger render={<Button variant="secondary" />}>Project details</HoverCardTrigger>
      <HoverCardContent side="bottom">
        <HoverCardTitle>Example project</HoverCardTitle>
        <HoverCardRow icon="folder">projects/example</HoverCardRow>
        <HoverCardRow icon="check" onClick={() => setChecked((n) => n + 1)}>
          {checked ? `Path checked ${checked}` : "Check path"}
        </HoverCardRow>
      </HoverCardContent>
    </HoverCard>
  );
}
```

### Long rows

A `HoverCardRow` wraps at word ends, three lines at most; a longer one ends with an ellipsis on its third line. A path breaks where it must.

- Three lines at most

### A card that scrolls

A card whose rows outgrow its height stops there and scrolls, here at a short `--hover-card-max-h`.

- Capped, scrolling

### A whole message

`size="lg"` holds a whole formatted message at a bubble's measure, `--bubble-measure`, its text in Body; past its tallest height it scrolls inside.

- A message between two agents

## Context popover

`ContextPopover` is content built on `Popover`: a composer's context ring that opens the context window's reading, its token categories, the account's limits and compaction.

Open the ring to read the context window, inspect token categories and check the active account's limits. The ring keeps its quiet ink however full the window is: auto-compact answers a full context, so the ring never calls for the eye.

The panel prefers to open above the ring. Set `side` to `bottom` for a ring at the top of a pane. The panel can flip when there is too little room.

### Data and action

- Supply the reported usage and category estimates separately. Leave unknown thresholds, reserved tokens and detail counts out.
- A reported auto-compact threshold draws a dashed mark and names itself in the bar's reading; usage at or past it takes the warning tone. Without one the kit draws neither.
- Supply what each window of the active account has left and the other accounts' real states. Reset times use the product's local clock.
- Keep compaction outside the popover. The same callback starts compaction and retries it; the caller reports progress, errors and the tokens freed.
- A pass waits as `queued` behind the running turn, and `onStop` takes it back. The same `onStop` stops a running pass; without it both draw their action disabled.
- A finished pass eases the confirmed reading in and says what the context is now; a failed one stops the motion and shows the caller's message.
- Keep completion visible until the caller clears it. Dismissing or reopening the popover never starts, cancels or restarts compaction.

### From the start edge

A ring at the start of its bar sets `align` to `start`, so the panel lines up with the ring's start edge and grows toward the free side. By default it lines up with the end edge, and near a window edge it takes whichever edge keeps it inside.

```tsx
import { ContextPopover } from "@arcadia/ui";

<ContextPopover
  align="start"
  reading={{ state: "ready", snapshot }}
  compaction={{ state: "idle" }}
  onCompact={() => {}} />
```

- A ring at the start edge

### At the auto-compact threshold

Real usage past the threshold turns the mark and the usage percentage to the warning tone. A failed pass keeps the last confirmed reading and says what happened.

```tsx
import { ContextPopover } from "@arcadia/ui";

<ContextPopover
  reading={{ state: "ready", snapshot: near }}
  compaction={{ state: "idle" }}
  onCompact={() => {}} />
```

- Threshold reached
- A failed pass

### Compaction settling

Press Compact now. The messages run compresses under a crossing beam, then the confirmed reading eases in and a polite line says what the context is now.

```tsx
import { useEffect, useState } from "react";
import {
  ChecksChip, ChecksPopover, ContextPopover, HoverCard, HoverCardContent,
  HoverCardRow, ListRow, Popover, PopoverClose, PopoverError, PopoverFooter,
  StatusDot,
} from "@arcadia/ui";

function Settling() {
  const [reading, setReading] = useState(snapshot);
  const [compaction, setCompaction] = useState<ContextCompaction>({ state: "idle" });
  useEffect(() => {
    if (compaction.state !== "compacting") return;
    const began = performance.now();
    const timer = setInterval(() => {
      const progress = Math.min(1, (performance.now() - began) / 1800);
      if (progress < 1) return setCompaction({ state: "compacting", progress });
      clearInterval(timer);
      setReading(settled);
      setCompaction({ state: "compacted", freed: 494_000 });
    }, 80);
    return () => clearInterval(timer);
  }, [compaction.state]);
  return (
    <ContextPopover
      reading={{ state: "ready", snapshot: reading }}
      compaction={compaction}
      onCompact={() => setCompaction({ state: "compacting", progress: 0 })}
      onStop={() => setCompaction({ state: "idle" })} />
  );
}

const BASE = 1_700_000_000_000;
const COMMIT: CheckCommit = { sha: "4c1a9e2", message: "Round refunds to the minor unit" };
const FAILING_COMMIT: CheckCommit = { sha: "8f3d1c7", message: "Retry the refund batch once and keep the order" };
const AVOID = { side: "none", align: "shift" } as const;

const PASSING: CheckRun[] = [
  { id: "build", name: "Build", state: "passed", start: BASE, end: BASE + 42_000 },
  { id: "lint", name: "Lint", state: "passed", start: BASE + 4_000, end: BASE + 22_000 },
  { id: "test", name: "Test", state: "passed", start: BASE + 6_000, end: BASE + 78_000 },
  { id: "deploy", name: "Deploy preview", state: "passed", start: BASE + 40_000, end: BASE + 76_000 },
];

const FAILING: CheckRun[] = [
  { id: "build", name: "Build", state: "passed", start: BASE, end: BASE + 38_000 },
  { id: "lint", name: "Lint", state: "passed", start: BASE + 4_000, end: BASE + 20_000 },
  {
    id: "test", name: "Test", state: "failed", start: BASE + 6_000, end: BASE + 130_000,
    detail: {
      step: "Install dependencies",
      lines: [
        "npm ERR! code ERESOLVE",
        "npm ERR! ERESOLVE unable to resolve dependency tree",
        "npm ERR! Could not resolve peer react@19.3.0 from the registry",
      ],
    },
  },
  { id: "coverage", name: "Coverage", state: "skipped", start: BASE + 8_000, end: BASE + 8_000 },
  { id: "deploy", name: "Deploy preview", state: "queued" },
];

const APPROXIMATE: CheckRun[] = [
  { id: "vercel", name: "Vercel", state: "passed", start: BASE, end: BASE + 64_000, approximate: true },
  { id: "netlify", name: "Netlify", state: "passed", end: BASE + 90_000, approximate: true },
  { id: "build", name: "Build", state: "failed", start: BASE + 10_000, end: BASE + 52_000, approximate: true },
];

const UNREADABLE: CheckRun[] = [{ id: "gitlab", name: "Checks on GitLab", state: "unknown" }];

const RUNNING_CHIP: CheckRun[] = [
  { id: "build", name: "Build", state: "passed", start: BASE, end: BASE + 38_000 },
  { id: "visual", name: "Visual", state: "running", start: BASE + 40_000 },
  { id: "deploy", name: "Deploy preview", state: "queued" },
];

function useChecksActions() {
  const [, setSent] = useState("");
  return {
    onRerunFailed: (failed: readonly string[]) => setSent("Re-running " + failed.join(", ")),
    onOpenChecks: () => setSent("Open on GitHub"),
    onAskToFix: (failure: string) => setSent(failure),
  };
}

function useRunningBase() {
  const [base] = useState(() => Date.now() - 125_000);
  return base;
}

function runningChecks(base: number): CheckRun[] {
  return [
    { id: "build", name: "Build", state: "passed", start: base, end: base + 38_000 },
    { id: "lint", name: "Lint", state: "passed", start: base + 4_000, end: base + 20_000 },
    {
      id: "test", name: "Test", state: "failed", start: base + 6_000, end: base + 118_000,
      detail: { step: "Install dependencies", lines: ["npm ERR! code ERESOLVE", "npm ERR! could not resolve react"] },
    },
    { id: "visual", name: "Visual", state: "running", start: base + 70_000 },
    { id: "deploy", name: "Deploy preview", state: "queued" },
  ];
}

const checkStyles = stylex.create({
  chips: { display: "flex", flexWrap: "wrap", alignItems: "center", justifyContent: "center", gap: spacing["--space-3"] },
});

function Passing() {
  return <ChecksPopover checks={PASSING} commit={COMMIT} number={128} />;
}

function PassingStage({ container }: { container: HTMLElement }) {
  return <ChecksPopover open checks={PASSING} commit={COMMIT} number={128} container={container} collisionBoundary={container} collisionAvoidance={AVOID} />;
}

function Failing() {
  const actions = useChecksActions();
  return <ChecksPopover checks={FAILING} commit={FAILING_COMMIT} number={128} {...actions} />;
}

function FailingStage({ container }: { container: HTMLElement }) {
  const actions = useChecksActions();
  return <ChecksPopover open defaultOpenFailed checks={FAILING} commit={FAILING_COMMIT} number={128} container={container} collisionBoundary={container} collisionAvoidance={AVOID} {...actions} />;
}

function Running() {
  const base = useRunningBase();
  return <ChecksPopover checks={runningChecks(base)} commit={FAILING_COMMIT} number={128} />;
}

function RunningStage({ container }: { container: HTMLElement }) {
  const base = useRunningBase();
  return <ChecksPopover open checks={runningChecks(base)} commit={FAILING_COMMIT} number={128} container={container} collisionBoundary={container} collisionAvoidance={AVOID} />;
}

function Approximate() {
  return <ChecksPopover checks={APPROXIMATE} commit={COMMIT} number={128} />;
}

function ApproximateStage({ container }: { container: HTMLElement }) {
  return <ChecksPopover open checks={APPROXIMATE} commit={COMMIT} number={128} container={container} collisionBoundary={container} collisionAvoidance={AVOID} />;
}

function Unreadable() {
  return <ChecksPopover checks={UNREADABLE} commit={COMMIT} number={128} />;
}

function UnreadableStage({ container }: { container: HTMLElement }) {
  return <ChecksPopover open checks={UNREADABLE} commit={COMMIT} number={128} container={container} collisionBoundary={container} collisionAvoidance={AVOID} />;
}

function Reading() {
  return <ChecksPopover loading checks={[]} commit={COMMIT} number={128} />;
}

function ReadingStage({ container }: { container: HTMLElement }) {
  return <ChecksPopover open loading checks={[]} commit={COMMIT} number={128} container={container} collisionBoundary={container} collisionAvoidance={AVOID} />;
}

function Empty() {
  return <ChecksPopover checks={[]} commit={COMMIT} number={128} />;
}

function EmptyStage({ container }: { container: HTMLElement }) {
  return <ChecksPopover open checks={[]} commit={COMMIT} number={128} container={container} collisionBoundary={container} collisionAvoidance={AVOID} />;
}

function Chips() {
  return (
    <div {...sx("cmp-checks-chips", checkStyles.chips)}>
      <ChecksChip checks={PASSING} number={128} />
      <ChecksChip checks={FAILING} number={128} />
      <ChecksChip checks={RUNNING_CHIP} number={128} />
      <ChecksChip checks={[]} />
    </div>
  );
}

function ChecksUsage() {
  const [, setSent] = useState("");
  return (
    <ChecksPopover
      checks={FAILING}
      commit={FAILING_COMMIT}
      number={128}
      onRerunFailed={(failed) => setSent("Re-running " + failed.join(", "))}
      onOpenChecks={() => window.open("https://github.com/acme/web/actions")}
      onAskToFix={(failure) => setSent(failure)}
    />
  );
}

export default function PopoverPage() {
  return (
    <>
      <Section title="When to use">
        <Bullets items={[
          "A few controls or toggles tied to a trigger",
          "Details about its trigger, beside it",
          "One state and one act, ended by `PopoverFooter`",
        ]} />
      </Section>

      <Section title="When not to use">
        <Bullets items={[
          "A task that must finish before the page is used: use `Dialog`",
          "A list of actions or choices: use `Menu`",
          "A preview of what a link points to: use `HoverCard`",
        ]} />
      </Section>

      <Section title="In context">
        <Specimen code={SRC.Parameters} surface="pane" size="compact" caption="Change Fast mode, then apply or cancel.">
          <Parameters />
        </Specimen>
      </Section>

      <Section title="Usage">
        <CodeBlock code={displaySnippet(SRC.Usage)} />
        <P>
          Click-opened and non-modal by default, on the shared popup surface with 12px padding; opened from the keyboard, it
          is there in one frame. It may hold controls: switches, a field, a pair of buttons. `PopoverClose` wraps any button
          that should close it.
        </P>
        <P>
          Which overlay? A Popover holds content you act on. A <a href="#hover-card">Hover Card</a> previews what a link or
          a row points to. A <a href="/components/menu">Menu</a> lists actions or choices, and
          a <a href="/components/tooltip">Tooltip</a> names a control in a few words.
        </P>
        <P>
          A floating surface is placed inside the visible viewport, `window.visualViewport` where there is one, with its
          width, height and offsets: in a zoomed view or over a phone's keyboard it flips or caps to the room that is
          left, so it never goes under the keys or past the edge of what shows.
        </P>
      </Section>
      <Section title="Examples">
        <Sub title="Sizes" lead="Three widths with the same padding, shrinking to fit their preview frame on a narrow screen.">
          <Specimen surface="pane" cols={1}>
            {union<PopoverSize>("PopoverSize").map((size) => (
              <Cell
                key={size}
                caption={WIDTHS[size]}
                align="start"
                height={space(size === "sm" ? 8.5 : 10.5)}
                stage={(c) => <SizeOpen size={size} container={c} />}
              />
            ))}
          </Specimen>
        </Sub>
        <Sub title="A list" lead={'With `padding="list"` 28px Body rows share their leading column. The frame has 4px padding, so the rows\' corners stay concentric. A label too long for the width takes its meta\'s place first and then ends on a whole word, as in any `ListRow`.'}>
          <Specimen code={SRC.List} surface="pane" cols={1}>
            <Cell caption="Rows with a title" align="start" height={space(12)} stage={(c) => <ListOpen container={c} />} />
          </Specimen>
        </Sub>
        <Sub title="Emoji list" lead={'Use `variant="emoji-list"` for reactions. The 14px frame wraps rows with 10px corners and 4px of padding.'}>
          <Specimen code={SRC.EmojiList} layout="start"><EmojiList /></Specimen>
        </Sub>
        <Sub title="Long content scrolls inside" lead="A popover takes the width its size names and never grows past the room its side leaves: what does not fit scrolls inside its frame, so it stays where it opened. A new view or more rows inside changes nothing around it.">
          <Specimen code={SRC.LongList} size="compact"><LongList /></Specimen>
        </Sub>
        <Sub title="One state, one act" lead="`PopoverFooter` ends a popover that states one thing and offers one act; `PopoverError` under it says why the act failed.">
          <Specimen code={SRC.OneAct} surface="pane" cols={2}>
            <Cell caption="Not asked yet" align="start" height={space(9.5)} stage={(c) => <OneActOpen container={c} />} />
            <Cell caption="The act failed" align="start" height={space(12)} stage={(c) => <OneActOpen container={c} failed />} />
          </Specimen>
        </Sub>
        <Sub title="Beside another element" lead="`anchor` places it beside any element in place of its trigger: here over the message the receipt under it is about, so the receipt stays in sight. It takes an element, a ref or a function, and works without a trigger too, for a popover a menu's item or a shortcut opens.">
          <Specimen code={SRC.Beside} surface="pane" size="tall" stage={(c) => <BesideOpen container={c} />} stageAlign="end">
            <Beside />
          </Specimen>
        </Sub>
      </Section>
      <Section title="Hover card" lead="`HoverCard` previews what a link or a row points to, on hover and on keyboard focus, after 150ms. It holds metadata, never actions.">
        <P>
          Use it for a preview that a person can also reach by pressing its trigger or on the thing&apos;s own page, or to
          show a row&apos;s cut label whole. Anything a person must act on belongs in a popover, and a few words that name
          an icon-only control in a `Tooltip`.
        </P>
        <P>In Act, a chat&apos;s row in the sidebar previews its branch and folder in a card when the pointer rests on it.</P>
        <Specimen code={SRC.ChatRow} surface="pane" layout="start" tryLabel="Hover the row" stage={(c) => <ChatRowOpen container={c} />}>
          <ChatRow />
        </Specimen>
        <CodeBlock code={displaySnippet(SRC.HoverCardUsage)} />
        <P>
          Metadata for a link or a row, never actions. It opens 150ms after the pointer rests or the trigger takes keyboard
          focus, and closes 150ms after the pointer leaves, so sweeping down a sidebar doesn't flash a card per row. A Caption bold
          title, rows of Caption text that wrap to three lines at most, 10px padding, at most 280 wide, to the right of a
          sidebar row by default. Inside its trigger a cut label shows no tooltip of its own: the card shows it whole.
        </P>
        <P>
          Rows that each have a card, such as a sidebar&apos;s list, sit in one `HoverCardGroup`, so one card shows at a time.
          Moving the pointer or the focus to the next row puts its card in place of the open one at once, with no delay and no
          motion. A diagonal move toward the open card keeps it. A card that opens within 300ms of the last one closing opens at
          once too.
        </P>
        <P>
          It is never taller than the room the window leaves on its side, nor than `--hover-card-max-h` (60vh): longer content
          scrolls inside the card instead of running past the window. Nor is it wider than that room: `collisionBoundary`
          names a box it stays inside instead of the window, a sidebar for a card on the sidebar&apos;s footer, and the card
          narrows to fit it. A card is a preview, so keep what it shows short and put the whole thing one click away.
        </P>
        <Sub title="One at a time" lead="Rows in a `HoverCardGroup` share one card. Move down the rows and the card moves with the pointer.">
          <Specimen surface="pane" layout="start">
            <GroupRows />
          </Specimen>
        </Sub>
        <Sub title="An action in a hover card" lead="Pass `onClick` to make the row a button. Tab from the trigger to the action, then press Enter or Space. Escape returns focus to the trigger.">
          <Specimen code={SRC.HoverAction}><HoverAction /></Specimen>
        </Sub>
        <Sub title="Long rows" lead="A `HoverCardRow` wraps at word ends, three lines at most; a longer one ends with an ellipsis on its third line. A path breaks where it must.">
          <Specimen surface="pane" cols={1}>
            <Cell caption="Three lines at most" align="start" height={space(14)} stage={(c) => <LongRows container={c} />} />
          </Specimen>
        </Sub>
        <Sub title="A card that scrolls" lead="A card whose rows outgrow its height stops there and scrolls, here at a short `--hover-card-max-h`.">
          <Specimen surface="pane" cols={1}>
            <Cell caption="Capped, scrolling" align="start" height={space(11)} stage={(c) => <LongOpen container={c} />} />
          </Specimen>
        </Sub>
        <Sub title="A whole message" lead="`size=&quot;lg&quot;` holds a whole formatted message at a bubble's measure, `--bubble-measure`, its text in Body; past its tallest height it scrolls inside.">
          <Specimen surface="pane" cols={1}>
            <Cell caption="A message between two agents" align="start" height={space(16)} stage={(c) => <Message container={c} />} />
          </Specimen>
        </Sub>
      </Section>

      <Section title="Context popover" lead="`ContextPopover` is content built on `Popover`: a composer's context ring that opens the context window's reading, its token categories, the account's limits and compaction.">
        <P>Open the ring to read the context window, inspect token categories and check the active account&apos;s limits. The ring keeps its quiet ink however full the window is: auto-compact answers a full context, so the ring never calls for the eye.</P>
        <P>The panel prefers to open above the ring. Set `side` to `bottom` for a ring at the top of a pane. The panel can flip when there is too little room.</P>
        <ContextPopoverSpecimen />
        <Sub title="Data and action">
          <Bullets items={[
            "Supply the reported usage and category estimates separately. Leave unknown thresholds, reserved tokens and detail counts out.",
            "A reported auto-compact threshold draws a dashed mark and names itself in the bar's reading; usage at or past it takes the warning tone. Without one the kit draws neither.",
            "Supply what each window of the active account has left and the other accounts' real states. Reset times use the product's local clock.",
            "Keep compaction outside the popover. The same callback starts compaction and retries it; the caller reports progress, errors and the tokens freed.",
            "A pass waits as `queued` behind the running turn, and `onStop` takes it back. The same `onStop` stops a running pass; without it both draw their action disabled.",
            "A finished pass eases the confirmed reading in and says what the context is now; a failed one stops the motion and shows the caller's message.",
            "Keep completion visible until the caller clears it. Dismissing or reopening the popover never starts, cancels or restarts compaction.",
          ]} />
        </Sub>
        <Sub title="From the start edge" lead="A ring at the start of its bar sets `align` to `start`, so the panel lines up with the ring's start edge and grows toward the free side. By default it lines up with the end edge, and near a window edge it takes whichever edge keeps it inside.">
          <Specimen code={SRC.StartEdge} cols={1}>
            <Cell caption="A ring at the start edge"><div {...stylex.props(ringRoom.room, ringRoom.start)}><StartEdge /></div></Cell>
          </Specimen>
        </Sub>
        <Sub title="At the auto-compact threshold" lead="Real usage past the threshold turns the mark and the usage percentage to the warning tone. A failed pass keeps the last confirmed reading and says what happened.">
          <Specimen code={SRC.Near} cols={2}>
            <Cell caption="Threshold reached"><div {...stylex.props(ringRoom.room)}><Near /></div></Cell>
            <Cell caption="A failed pass"><div {...stylex.props(ringRoom.room)}><Failed /></div></Cell>
          </Specimen>
        </Sub>
        <Sub title="Compaction settling" lead="Press Compact now. The messages run compresses under a crossing beam, then the confirmed reading eases in and a polite line says what the context is now.">
          <Specimen code={SRC.Settling} cols={1}>
            <Cell caption="Running, then the confirmed reading"><div {...stylex.props(ringRoom.room)}><Settling /></div></Cell>
          </Specimen>
        </Sub>
        <Sub title="Queued behind the running turn" lead="Open each ring. A queued pass states the fact and offers Stop before it starts; a running pass offers the same Stop, and Stop returns each to Compact now.">
          <Specimen code={SRC.Queued} cols={2}>
            <Cell caption="Queued"><div {...stylex.props(ringRoom.room)}><Queued /></div></Cell>
            <Cell caption="Running"><div {...stylex.props(ringRoom.room)}><Compacting /></div></Cell>
          </Specimen>
        </Sub>
      </Section>

      <Section title="Checks popover" lead="`ChecksPopover` is content built on `Popover`: a commit's checks under its pull request chip, one row per run on a shared time axis, with the failing step and its log in place.">
        <P>
          Use it for a commit&apos;s checks in a conversation, read on one time axis so the slow run is the longest bar, with a
          failed run&apos;s step and last log lines in place. One run&apos;s state on its own is a `StatusDot` or a `Chip`. A
          whole CI dashboard, or a log longer than a few lines, opens where it lives, and a pull request&apos;s own state and
          title belong to the card around this chip.
        </P>
        <P>The chip counts the checks that passed and opens the runs on the head commit. Every row shares one axis, so a long run reads as a long bar and parallel runs line up under it. A failure turns the chip and its ring danger; only every check passed turns them success. The data is made up.</P>
        <Specimen code={SRC.Failing} stage={(container) => <FailingStage container={container} />}><Failing /></Specimen>
        <CodeBlock code={displaySnippet(SRC.ChecksUsage)} />
        <P>Give the checks as the provider reports them: a name, a state, a start and an end. Leave out a start the provider does not have; the row draws no bar and no time rather than a guess. A commit status known only from when it was first and last seen passes those as the times and sets `approximate`, and the row says "approx".</P>
        <P>A running check has a start and no end: its time and its bar grow from the kit's clock while the page is visible. Map a provider's conclusions onto `passed`, `failed`, `cancelled`, `skipped` and `neutral`; a provider whose checks cannot be read is one row with `unknown`. The chip counts passed of all, so a skipped check keeps it from success.</P>
        <P>The actions are the caller's: `onRerunFailed` names the failed checks, `onOpenChecks` goes where they live, and `onAskToFix` receives each failed check and its failing step for the turn it starts. A product that may not write checks passes neither rerun nor ask.</P>
        <Sub title="The chip" lead="The ring is the share that passed; the ink is the state. The number is the pull request's, and the count is passed of all.">
          <Specimen code={SRC.Chips} layout="stretch"><Chips /></Specimen>
        </Sub>
        <Sub title="Every check passed" lead="The whole set passed, so the chip and the ring take success.">
          <Specimen code={SRC.Passing} stage={(container) => <PassingStage container={container} />}><Passing /></Specimen>
        </Sub>
        <Sub title="A failure, open on its step" lead="The failed row opens to the failing step and the last log lines. The other rows keep their bars on the shared axis.">
          <Specimen code={SRC.Failing} stage={(container) => <FailingStage container={container} />}><Failing /></Specimen>
        </Sub>
        <Sub title="Running" lead="The running row has a live pill and a time that ticks; its bar grows from its start. The total counts with it.">
          <Specimen code={SRC.Running} stage={(container) => <RunningStage container={container} />}><Running /></Specimen>
        </Sub>
        <Sub title="From commit statuses" lead="A provider that reports only first and last seen passes them as the times and sets `approximate`. With no start, the row has no bar and no time.">
          <Specimen code={SRC.Approximate} stage={(container) => <ApproximateStage container={container} />}><Approximate /></Specimen>
        </Sub>
        <Sub title="A provider not read" lead="One honest row, with no bar and no time, rather than an empty set.">
          <Specimen code={SRC.Unreadable} stage={(container) => <UnreadableStage container={container} />}><Unreadable /></Specimen>
        </Sub>
        <Sub title="Reading and empty" lead="The reading line appears after 200ms. With no checks and no read, the popover says what belongs there.">
          <Specimen code={SRC.Reading} stage={(container) => <ReadingStage container={container} />}><Reading /></Specimen>
          <Specimen code={SRC.Empty} stage={(container) => <EmptyStage container={container} />}><Empty /></Specimen>
        </Sub>
      </Section>
      <Section title="Customising" lead="Use `collisionBoundary` for a clipped frame. Placement and width stay inside it; `rootStyle` controls the preferred width and layout.">
        <Knobs type="PopoverKnobs" label="Popover knobs" />
        <P>`rootStyle` on `HoverCardContent` takes where the card sits, its widest width and its tallest height.</P>
        <Knobs type="HoverCardKnobs" label="Hover card knobs" />
        <P>`ChecksPopover`&apos;s `rootStyle` takes where the part sits, the lane&apos;s width as a space token, and the four inks a bar may take.</P>
        <Knobs type="ChecksPopoverKnobs" label="Checks popover knobs" />
      </Section>
    </>
  )
```

- Running, then the confirmed reading

### Queued behind the running turn

Open each ring. A queued pass states the fact and offers Stop before it starts; a running pass offers the same Stop, and Stop returns each to Compact now.

```tsx
import { useState } from "react";
import { ContextPopover } from "@arcadia/ui";

function Queued() {
  const [compaction, setCompaction] = useState<ContextCompaction>({ state: "queued" });
  return (
    <ContextPopover
      reading={{ state: "ready", snapshot }}
      compaction={compaction}
      onCompact={() => setCompaction({ state: "compacting", progress: 0.42 })}
      onStop={() => setCompaction({ state: "idle" })} />
  );
}
```

- Queued
- Running

## Checks popover

`ChecksPopover` is content built on `Popover`: a commit's checks under its pull request chip, one row per run on a shared time axis, with the failing step and its log in place.

Use it for a commit's checks in a conversation, read on one time axis so the slow run is the longest bar, with a failed run's step and last log lines in place. One run's state on its own is a `StatusDot` or a `Chip`. A whole CI dashboard, or a log longer than a few lines, opens where it lives, and a pull request's own state and title belong to the card around this chip.

The chip counts the checks that passed and opens the runs on the head commit. Every row shares one axis, so a long run reads as a long bar and parallel runs line up under it. A failure turns the chip and its ring danger; only every check passed turns them success. The data is made up.

```tsx
import { ChecksPopover } from "@arcadia/ui";

function Failing() {
  const actions = useChecksActions();
  return <ChecksPopover checks={FAILING} commit={FAILING_COMMIT} number={128} {...actions} />;
}
```

```tsx
import { useState } from "react";
import { ChecksPopover } from "@arcadia/ui";

function ChecksUsage() {
  const [, setSent] = useState("");
  return (
    <ChecksPopover
      checks={FAILING}
      commit={FAILING_COMMIT}
      number={128}
      onRerunFailed={(failed) => setSent("Re-running " + failed.join(", "))}
      onOpenChecks={() => window.open("https://github.com/acme/web/actions")}
      onAskToFix={(failure) => setSent(failure)}
    />
  );
}
```

Give the checks as the provider reports them: a name, a state, a start and an end. Leave out a start the provider does not have; the row draws no bar and no time rather than a guess. A commit status known only from when it was first and last seen passes those as the times and sets `approximate`, and the row says "approx".

A running check has a start and no end: its time and its bar grow from the kit's clock while the page is visible. Map a provider's conclusions onto `passed`, `failed`, `cancelled`, `skipped` and `neutral`; a provider whose checks cannot be read is one row with `unknown`. The chip counts passed of all, so a skipped check keeps it from success.

The actions are the caller's: `onRerunFailed` names the failed checks, `onOpenChecks` goes where they live, and `onAskToFix` receives each failed check and its failing step for the turn it starts. A product that may not write checks passes neither rerun nor ask.

### The chip

The ring is the share that passed; the ink is the state. The number is the pull request's, and the count is passed of all.

```tsx
import { ChecksChip } from "@arcadia/ui";

<div {...sx("cmp-checks-chips", checkStyles.chips)}>
  <ChecksChip checks={PASSING} number={128} />
  <ChecksChip checks={FAILING} number={128} />
  <ChecksChip checks={RUNNING_CHIP} number={128} />
  <ChecksChip checks={[]} />
</div>
```

### Every check passed

The whole set passed, so the chip and the ring take success.

```tsx
import { ChecksPopover } from "@arcadia/ui";

<ChecksPopover checks={PASSING} commit={COMMIT} number={128} />
```

### A failure, open on its step

The failed row opens to the failing step and the last log lines. The other rows keep their bars on the shared axis.

```tsx
import { ChecksPopover } from "@arcadia/ui";

function Failing() {
  const actions = useChecksActions();
  return <ChecksPopover checks={FAILING} commit={FAILING_COMMIT} number={128} {...actions} />;
}
```

### Running

The running row has a live pill and a time that ticks; its bar grows from its start. The total counts with it.

```tsx
import { ChecksPopover } from "@arcadia/ui";

function Running() {
  const base = useRunningBase();
  return <ChecksPopover checks={runningChecks(base)} commit={FAILING_COMMIT} number={128} />;
}
```

### From commit statuses

A provider that reports only first and last seen passes them as the times and sets `approximate`. With no start, the row has no bar and no time.

```tsx
import { ChecksPopover } from "@arcadia/ui";

<ChecksPopover checks={APPROXIMATE} commit={COMMIT} number={128} />
```

### A provider not read

One honest row, with no bar and no time, rather than an empty set.

```tsx
import { ChecksPopover } from "@arcadia/ui";

<ChecksPopover checks={UNREADABLE} commit={COMMIT} number={128} />
```

### Reading and empty

The reading line appears after 200ms. With no checks and no read, the popover says what belongs there.

```tsx
import { ChecksPopover } from "@arcadia/ui";

<ChecksPopover loading checks={[]} commit={COMMIT} number={128} />
```

```tsx
import { ChecksPopover } from "@arcadia/ui";

<ChecksPopover checks={[]} commit={COMMIT} number={128} />
```

## Customising

Use `collisionBoundary` for a clipped frame. Placement and width stay inside it; `rootStyle` controls the preferred width and layout.

- `--popover-w` (`TokenRef<Measure>`, default `320px`): Width (240 / 320 / 400 by `size`), capped by the available boundary.

`rootStyle` on `HoverCardContent` takes where the card sits, its widest width and its tallest height.

- `--hover-card-max-w` (`TokenRef<Measure>`, default `280px`): Widest width (280), never past the room its boundary leaves.
- `--hover-card-max-h` (`TokenRef<Measure>`, default `60vh`): Tallest height (60vh), never past the room the window leaves on the card's side: longer content scrolls.

`ChecksPopover`'s `rootStyle` takes where the part sits, the lane's width as a space token, and the four inks a bar may take.

- `--check-axis` (`Ref<Space>`): The bar lane's width. Default 96px at the default text size.
- `--check-track` (`Paint`, default `var(--fill-4)`): The ground every bar stands on.
- `--check-passed` (`Paint`, default `var(--success)`): A passed bar.
- `--check-failed` (`Paint`, default `var(--danger)`): A failed bar.
- `--check-running` (`Paint`, default `var(--status-running)`): A bar that is running.
- `--check-quiet` (`Paint`, default `var(--icon-4)`): A bar that ended without passing or failing.

## Accessibility

A non-modal dialog: the trigger gets `aria-expanded`, the title and description name and describe the popup, focus moves in on open and returns to the trigger on close. Pass `modal` (or `modal="trap-focus"`) when it holds a task that must be finished or cancelled before going back to the page.

With an `anchor` it stands beside that element and is still the same dialog: focus goes back to its trigger, or, opened with none, to what had focus before it opened, and Tab out of it carries on from there.

- Esc: Closes the popover
- Tab: Moves through its controls

### On a hover card

The trigger is a link (an `<a>`, or your row through `render`), so it keeps its own name and its own action: pressing it navigates, it never opens the card. The card opens on keyboard focus as well as hover and is not announced as a dialog; its rows are extra detail that the trigger's text must not depend on.

A card that opens only on hover and focus can't be reached on touch screens, and screen-reader users rarely meet it. Anything people need, such as an action or the only copy of a value, belongs in a popover or on the page.

In a `HoverCardGroup`, Tab to the next trigger shows its card in place of the last one. The card never takes focus by itself, and Esc closes the one open card.

- Tab: Focus the trigger; the card opens after 150ms
- Esc: Close the card
- Enter: Follow the link

### In the context popover

Tab to a category to read its share, or tap it to show the detail inline. Escape dismisses the popover and returns focus to the ring. The bar is a meter that names the real usage, the limit and the threshold. With reduced motion, counts update directly, the run stands whole and the beam stops.

### In the checks popover

The chip is a button with `aria-haspopup="dialog"` and a name that says passed of all and every state short of passed. The popover is a dialog labelled by its title; Escape closes it and returns focus to the chip. A failed row is a disclosure with `aria-expanded` and `aria-controls`; its panel is a region labelled by the row.

Bars are decorative: each row's state and time are text, and a passed row keeps a hidden "passed" so the glyph and the ink are never the only cue. The log is a bounded, focusable scroller; the product sends only the lines its connector already bounded and redacted.

Reduced motion leaves the bars and the running glyph still while the time still counts. The clock stops while the page is hidden. At 390 wide a row stacks its bar under the name, and nothing scrolls sideways.

## API reference

### Popover

- `modal` (`boolean | "trap-focus"`, default `false`): `false`: focus may leave, which closes it. `true`: focus is trapped and the page behind is inert. `"trap-focus"`: focus is trapped, the page stays as it is.
- `open` (`boolean`): Controlled open state.
- `defaultOpen` (`boolean`, default `false`): Initial open state when uncontrolled.
- `onOpenChange` (`(open: boolean, details: OpenChangeDetails) => void`): Called when the popup opens or closes, with why (`details.reason`) and the event.
- `onOpenChangeComplete` (`(open: boolean) => void`): Called once the open or close transition has finished.

### PopoverTrigger

- `render` (`RenderProp<{ disabled: boolean }>`): Replace the rendered element, e.g. `render={<a href="/settings" />}`, or a function of props and state.
- `disabled` (`boolean`): Native disabled: no pointer events, no tooltip, skipped by Tab.
- `focusableWhenDisabled` (`boolean`): Keep a disabled control focusable and hoverable (`aria-disabled`), so a tooltip can say why.
- `nativeButton` (`boolean`): Button semantics, inferred from what renders: a `<button>` is native, an `<a>` stays a link, anything else gets `role="button"` and key handling. `false` forces button semantics on whatever renders (a link acting as a button).

Rest props go to `<button>` props.

### PopoverContent

- `rootStyle` (`RootStyle<PopoverKnobs>`): Typed StyleX override: where the popover sits (layout) and `--popover-w`.
- `side` (`"top" | "bottom" | "left" | "right" | "inline-start" | "inline-end"`, default `"bottom"`)
- `align` (`"start" | "center" | "end"`, default `"center"`)
- `sideOffset` (`number`, default `6`)
- `alignOffset` (`number`)
- `anchor` (`PopoverAnchor`): What it stands beside in place of its trigger: a row, a message, a field, when it opens from a menu's item, a shortcut or a control elsewhere (a controlled `open`, with or without a `PopoverTrigger`). An element, a ref or a function, read on every placement pass. Focus still goes back to the trigger, or to what had it before the open.
- `collisionBoundary` (`Element | null`): The clipping boundary for placement and available width; defaults to the viewport.
- `collisionAvoidance` (`{ side?: "flip" | "none"; align?: "flip" | "shift" | "none"; fallbackAxisSide?: "start" | "end" | "none" }`): Placement corrections; a growing preview can keep its preferred side while shifting horizontally.
- `size` (`"sm" | "md" | "lg"`, default `"md"`): Width 240 / 320 / 400.
- `padding` (`"default" | "list"`, default `"default"`): `default`: 12 in, 15 above and below. `list`: a 4px frame around Body rows, concentric with it; its title starts on their text.
- `variant` (`"default" | "emoji-list"`): An emoji list uses a 14px frame around 10px rows, inset 4px.
- `container` (`PortalContainer`, default `document.body`): Portal container.
- `instant` (`boolean`): Skip the open/close transition.
- `initialFocus` (`FocusTarget`): Where focus goes on open: an element, `false` to stay, or a function of how it opened. Default: the first field or button inside (the popup itself on touch).
- `finalFocus` (`FocusTarget`): Where focus goes on close. Default: the trigger.

Rest props go to `<div>` props.

### PopoverFooter

- `action` (`ReactNode`): Its one act: a `Button`.
- `children` (`ReactNode`): What it states: a `StatusDot` with words.

### HoverCard

- `open` (`boolean`): Controlled open state.
- `defaultOpen` (`boolean`, default `false`): Initial open state when uncontrolled.
- `onOpenChange` (`(open: boolean, details: OpenChangeDetails) => void`): Called when the popup opens or closes, with why (`details.reason`) and the event.
- `onOpenChangeComplete` (`(open: boolean) => void`): Called once the open or close transition has finished.

### HoverCardTrigger

- `delay` (`number`, default `150`): Open delay in ms (150).
- `closeDelay` (`number`, default `150`): Close delay in ms (150).
- `render` (`RenderProp`): Replace the rendered `<a>`, e.g. `render={<div className="slot" />}`.

Rest props go to `<a>` props.

### HoverCardContent

- `rootStyle` (`RootStyle<HoverCardKnobs>`): Typed StyleX override: where the card sits (layout) and `--hover-card-max-w`.
- `size` (`"md" | "lg"`, default `"md"`): `lg`: a whole message, at a bubble's measure.
- `side` (`"top" | "bottom" | "left" | "right" | "inline-start" | "inline-end"`, default `"right"`): Beside a sidebar row.
- `align` (`"start" | "center" | "end"`, default `"start"`)
- `sideOffset` (`number`, default `8`)
- `alignOffset` (`number`)
- `collisionBoundary` (`Element | null`): The box it stays inside, for placement and width (a sidebar's, for a card on its footer); defaults to the viewport.
- `container` (`PortalContainer`, default `document.body`): Portal container.

Rest props go to `<div>` props.

### HoverCardRow

- `icon` (`IconName | ReactElement`)
- `onClick` (`NonNullable<ComponentProps<"button">["onClick"]>`)

Rest props go to `<div>` props and `<button>` props.

### HoverCardGroup

- `timeout` (`number`, default `300`): How long after one card closes the next opens at once, in ms (300).

### ContextPopover

- `reading` (`ContextReading`, required)
- `compaction` (`ContextCompaction`, required)
- `limits` (`readonly ContextLimit[]`): Only the active account's windows.
- `accounts` (`readonly ContextAccount[]`): Other accounts, in product order.
- `onCompact` (`() => void`, required): Start now or retry. The action and its state belong to the caller, not the popup.
- `onStop` (`() => void`): Stops a running pass or takes back one queued behind it. Without it both states draw their action disabled.
- `open` (`boolean`)
- `defaultOpen` (`boolean`)
- `onOpenChange` (`(open: boolean) => void`)
- `trigger` (`ComponentProps<typeof PopoverTrigger>["render"]`): What the popover hangs on, when the product draws its own control (a pill carrying the ring and a figure): the render a PopoverTrigger takes, the ring's own name among its props. The ring alone otherwise.
- `side` (`"top" | "bottom"`)
- `align` (`PopoverContentProps["align"]`, default `"end"`): Which edge of the trigger the panel lines up with. `start` for a ring at the start of its bar.

### ChecksPopover

- `checks` (`readonly CheckRun[]`, required): The checks on the head commit, in the provider's order.
- `commit` (`{ sha: string; message: string }`): The head commit: its short sha and message, above the rows.
- `number` (`string | number`): The pull request's number, drawn on the chip as #128.
- `words` (`Partial<ChecksWords>`): Its words, where a product changes them.
- `loading` (`boolean`): The checks are being read: after 200ms a reading line, until they arrive.
- `defaultOpenFailed` (`boolean`): Opens the first failing check's detail as the popover opens: a run opened because it failed.
- `open` (`boolean`): Controlled open state.
- `defaultOpen` (`boolean`, default `false`): Its open state when uncontrolled.
- `onOpenChange` (`(open: boolean) => void`): Called when the popover opens or closes.
- `onRerunFailed` (`(failed: readonly string[]) => void`): Runs the failed checks again. The action shows only with this and a failure.
- `onOpenChecks` (`() => void`): Opens the checks where they live. The action shows only with this.
- `onAskToFix` (`(failure: string) => void`): Asks an agent to fix the failures, given them as one line of names and failing steps. The action shows only with this and a failure.
- `side` (`"top" | "bottom" | "left" | "right" | "inline-start" | "inline-end"`, default `"bottom"`)
- `align` (`"start" | "center" | "end"`, default `"start"`): Under the chip's start edge.
- `size` (`"sm" | "md" | "lg"`, default `"lg"`): Width 240 / 320 / 400.
- `container` (`PortalContainer`, default `document.body`): The portal container, for a staged preview.
- `collisionBoundary` (`Element | null`): The boundary it stays inside, for placement and width (a stage); defaults to the viewport.
- `collisionAvoidance` (`PopoverContentProps["collisionAvoidance"]`): Where it may go to stay in view.
- `initialFocus` (`PopoverContentProps["initialFocus"]`): What takes focus as it opens. Default the first control: a failed row, or the first action.
- `rootStyle` (`RootStyle<ChecksPopoverKnobs>`): Typed StyleX override: where the part sits and its --check-* knobs.

### ChecksChip

- `checks` (`readonly CheckRun[]`, required): The checks its count and ring follow.
- `number` (`string | number`): The pull request's number, drawn as #128; leave out the #.
- `words` (`Partial<ChecksWords>`): Its words, where a product changes them.
- `type` (`"button"`): A button when it opens something. The trigger sets it.
- `rootStyle` (`RootStyle`): Typed StyleX override: where the chip sits.

Rest props go to `<span>` props.
