# XWUIBidPanel

The detail-side bidding surface for a featured auction item: lot reference, title and description, an optional "Ends in" countdown row, two side-by-side stat cards for `instantPrice` and `lastBid`, and a bid form whose numeric input is pre-filled with the suggested next bid. The primary "Place a Bid" button stays disabled until the entered amount clears `lastBid + minIncrement`, and a secondary "View Item" button (or link, via `data.viewItemHref`) sits alongside it.

Countdown handling: the panel renders its own inline countdown from `data.endsAt`, or takes a pre-formatted `data.endsInLabel`. `basic/XWUICountdownTimer` did not exist when this component was written - `startCountdown()` in `XWUIBidPanel.ts` is the one seam to swap for a mounted `XWUICountdownTimer`.

## Bid floor

`resolveBidFloor()` (exported from the view module, so ports share the rule) computes `minimumBid = lastBid + minIncrement`, falling back to `minIncrement` when nothing has been bid yet. The input's `min`/`step` attributes, the submit button's disabled state, and the inline error message all derive from it.

## Events

Every interaction is surfaced three ways - a `data.on*` callback, an instance subscriber method (the `XWUIPointOfSale.onCompleteSale()` / `XWUIInputNumber.onChange()` convention), and a bubbling, composed `CustomEvent` on the container:

| Event | Callback | Subscriber | `detail` |
|---|---|---|---|
| `xwui-bid-panel:place-bid` | `onPlaceBid` | `onPlaceBid(handler)` | `{ amount, itemId, lastBid, currency }` |
| `xwui-bid-panel:amount-change` | `onAmountChange` | `onAmountChange(handler)` | `{ amount, itemId }` |
| `xwui-bid-panel:view-item` | `onViewItem` | — | `{ itemId }` |

## Usage

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

const panel = new XWUIBidPanel(host, {
  itemId: 'lot-4471',
  reference: 'LOT-4471',
  title: '1968 Aston Martin DB6 Vantage',
  description: 'Matching-numbers Vantage in Silver Birch, one of 240 built.',
  endsAt: '2026-09-01T18:00:00Z',
}, {
  instantPrice: 495000,
  lastBid: 412000,
  minIncrement: 2500,
  currency: 'USD',
});

panel.onPlaceBid(({ amount }) => api.placeBid('lot-4471', amount));

// When a websocket reports someone outbid the viewer:
panel.setLastBid(418500);
```

```api
```
