# Commerce foundations
> What @sdxc/ui/commerce is for, the forms-first rules its parts share, and every variable it reads.

The pieces of ordering something to be delivered: a menu item and the dialog that asks for its options, priced option groups, cart lines with a quantity stepper, and an order's live status.

Every piece is a form or a link first, so a cart fills and an order places with script off; the islands only reprice and track live.

Import the components from `@sdxc/ui/commerce` and the theme once from `@sdxc/ui/theme.css`.

## When to reach for it

- A food delivery, grocery or takeaway menu whose items ask for picks with prices.
- A cart whose counts change with one tap, and still post without script.
- An order, delivery or job whose progress streams from the server while the visitor watches.

## Shared ideas

- **Forms first.** Steppers, picks and Place order are plain posts; the server prices and checks them.
- **Prices in minor units.** Every choice carries `data-price` in cents; `OptionsLive` sums them with the form's `data-base`.
- **Native dialogs.** A menu card opens its `<dialog>` with `commandfor`; it is a bottom sheet on a phone.
- **Limits on the form.** A required group is radios; extras are checkboxes that stop at `max` once script loads.
- **Progress as text.** `OrderLive` reads `<step> <progress> <minutes>` lines from any `text/plain` stream.
- **Maps by attribute.** The tracker moves any `[data-map-marker]` on the page, so it pairs with a map without importing one.

## CSS variables

Every custom property the namespace reads or declares. Reads the neutral role for text, hairlines and surfaces, and brand for the add button, ticked picks and the steps already done. The roles are documented on Theming.

### Shared

The commerce pieces read the theme's own tokens; none is declared for them alone.

| Variable | Default | What it controls |
| --- | --- | --- |
| `--ui-radius-lg` | `1rem` | The corner of a menu item card. |
| `--ui-color-brand-600` | `the brand scale` | Ticked picks, the done steps' dots and rail, and the current step's ring. |
| `--ui-map-progress` | `set by OrderLive` | Written on each `[data-map-marker]` as the order moves, from 0 to 1. |
