# XWUIBidHistoryList

A chronological list of the bids placed on an auction item. Each row carries the bidder's avatar (composed from XWUIAvatar) and name, a relative timestamp inside a real `<time datetime>` element, and the bid amount at the trailing edge. The current top bid gets a green "Winning" badge; retracted bids render dimmed with a struck-through amount and are excluded from winner resolution.

Rows are supplied newest-first and are **not** re-sorted - the component trusts the caller's order. `config.maxItems` truncates the visible rows and adds a "+N earlier bids" footer.

## List composition

Rows are built inline in `buildRow()`. `basic/XWUIRankedList` did not exist on disk when this component was written, so nothing was composed. Its shape maps cleanly onto this one - `leading: avatar`, `label: bidderName`, `subtitle: <relative time>`, `trailing value: <amount>` - so **swapping `buildRow()` for a mounted XWUIRankedList is a good follow-up refactor** once the basic-tier component lands. The winning badge and the retracted-row styling are the two bits that would need a slot or a per-row modifier on XWUIRankedList.

## Winner resolution

Handled in the view projection so ports share the rule: an explicit non-retracted `isWinning` entry wins; otherwise, when `config.autoMarkWinning` is left at its `true` default, the highest non-retracted amount across the **full** list (not just the visible slice) is flagged.

## Config highlights

| Field | Purpose |
|---|---|
| `maxItems` | Cap visible rows; the remainder is summarised in the footer |
| `currency` / `locale` | Money and relative-time formatting (`Intl.NumberFormat` / `Intl.RelativeTimeFormat`) |
| `autoMarkWinning` | Set `false` to badge only rows that explicitly set `isWinning` |
| `winningLabel` / `emptyLabel` / `title` | Copy overrides |
| `density` | `'comfortable'` (default) or `'compact'` |

Rows only become clickable when `data.onBidClick` is supplied; activating one fires the callback and a bubbling `xwui-bid-history-list:bid-click` event with `{ id, bidderName, amount }`.

## Usage

```ts
import { XWUIBidHistoryList } from '@exonware/xwui/industry';

const history = new XWUIBidHistoryList(host, {
  bids: [
    { id: 'b5', bidderName: 'Amelia Hart', amount: 418500, timestamp: '2026-08-12T09:41:00Z', isWinning: true },
    { id: 'b4', bidderName: 'Bidder ***42', amount: 412000, timestamp: '2026-08-12T09:33:00Z' },
    { id: 'b3', bidderName: 'Ravi Menon', amount: 405000, timestamp: '2026-08-12T08:58:00Z' },
  ],
}, { title: 'Bid history', maxItems: 8, currency: 'USD' });

// Live feed:
history.prependBid({ id: 'b6', bidderName: 'Clara Ostrom', amount: 425000, timestamp: Date.now() });
```

```api
```
