# Changelog

What to change in your code when you upgrade, newest first.

## 0.24

A NumberField without `min` now opens the full keyboard on a phone, so a minus can be typed. Give `min` to a number that cannot go below zero, like a quantity or an amount, and it keeps the decimal keypad.

Two names grew, which matters to tests that find them by name. Each AttentionList link carries its item's sentence after its label, as in `"Reconnect, The Shopify connection stopped"`. A Table's row actions are named after the row's first column in words; a numeric first column used to give every row the same name.

## 0.23

A theme defines `control.gap`: the space between the parts of a control, such as a filter's name, its value and its chevron. regua's own themes have it, and a theme of your own without it no longer builds. To keep the space you had, point it at `{space.2}`.

## 0.22

A theme defines `surface.border-color`, with a dark value: the edge that cards and popups draw. regua's own themes have it, and a theme of your own without it no longer builds. To keep the edge you had, point it at the step your borders use, like `{gray.7}`.

`Stats` warns in development when only some of its numbers have a `series`. Give every number its series, or none.

## 0.21

`Status` and `statuses` are no longer exported. A state is data: pass a `StatusValue` to the Page's `status`, a Table's `status` column or a SummaryList item, and regua draws it. For the words of a state, as in a Select's options, `useStatusLabel()` stays.

## 0.17

`Chart` takes a required `title`, on a page and in an assistant's answer alike, so every chart is a section with its name, as a Table is. Give each chart, and each `chart` block of an AssistantChat answer, the title that says what it shows, like `"Resolved without a person, by day"`.

Two states are renamed, so each word means one thing on every object: replace `status="live"` with `"active"` and `"off"` with `"paused"`, in your code and in any states your product stores or receives. A state regua doesn't know fails the page. Four states are new: `ended`, `overdue`, `paid` and `refunded`.

## 0.16

`Card` and `ConfirmDialog` are no longer exported. Each section of a page carries its own title and frame:

- **Fields:** put them in a `FieldGroup`, which takes the Card's `title`, `description` and one secondary `action`, and only regua fields and FieldRows.
- **Numbers and charts:** give `Stats` and `Chart` the `title` and `description` the Card had.
- **Facts:** `SummaryList` takes a required `title`, like `"Details"`.
- **A Timeline:** take the Card away. Its `caption` is now its visible title.
- **A Card with a destructive action:** make it one of the Page's `actions`, with its `question` and `consequence`.
- **Your own ConfirmDialog:** a destructive action asks through its `question` and `consequence`. Anything that is not destructive, like pausing, applies at once.

`AttentionList` is not there when it has no items, and `checkedAt` is removed. It still shows while the check runs and when it failed.

A Timeline event takes an `href`: its text links to the page of what happened, like a published change, where it can be undone.

## 0.13

`Stack` is no longer exported. regua owns every distance:

- **Sections of a page:** put them straight in the Page, which spaces them.
- **Content of a Card:** put it straight in the Card, which spaces it. Fields that share a row go in a FieldRow.

`statuses` keeps only each state's `tone`. For the words of a state, as in a Select's options, call `useStatusLabel()`: it returns `(status) => string` in the language of the ReguaProvider's locale, the same words the Status shows.

```tsx
const statusLabel = useStatusLabel()
const options = (['open', 'waiting', 'closed'] as const).map((status) => ({
  value: status,
  label: statusLabel(status),
}))
```

A Page's `unavailable.object` is now its title as written, so pass `'Conversation'`, not `'conversation'`. The sentence under it speaks of the page ("Couldn’t load this page."), so it reads right in every language.

Words changed too:

- With `locale="pt-PT"` on the ReguaProvider, everything regua writes is in European Portuguese: buttons, dialogs, states, tones, legends, dates and what screen readers hear. Every other locale gets English.
- A Textarea with a `name` over its `maxLength` stops Publish and Save, and is listed among the problems: "{label} must be {max} characters or fewer."

New: a Switch that applies a change takes `loading` while it applies and `error` when it fails, and goes back to `checked` by itself.

## 0.12

`Button` and `Composer` are no longer exported. Every action is now data in a regua home, which draws it:

- **A Button beside a page's title:** an item of the Page's `actions`.
- **A Button in a Card:** the Card's `action`. A Card with an action needs no content, and is then one row.
- **A destructive Button:** give it `question` and `consequence`. regua opens the dialog and runs `onClick` once people confirm, so remove your own ConfirmDialog for it. It goes in a Page's `actions`, or as the `action` of a Card with no content.
- **A Composer for replies or notes:** the Timeline's `reply` (Send, and Send and close) and `note` (Add note), under its entries.
- **A box to ask an assistant:** AssistantChat.
- **"Plans" on a page someone's plan does not include:** a Page with `unavailable={{ reason: 'locked', object, plans }}`.

Words changed too:

- Tones read "Needs attention", "Problem" and "Done" in the AttentionList, the Table and the charts.
- The Table's legend reads "below 40% is a problem, below 60% needs attention".

## 0.6

`data-theme` used to be the mode. Replace `data-theme="dark"` (or `"light"`) with `data-mode="dark"` (or `"light"`).
