# UI components

> The pieces the game uses to show a step that acts on a machine: plan card, agreement, run, proof, sign-in, secret field, quest panel.

`@altasystem/ui` is the set of pieces the game uses to show a step that does something on a machine: the plan card
("here is what will be installed"), the owner's yes, the run going, the proof, a sign-in, a secret typed safely, and
the panel that holds a whole quest. Any page served by the owner's own server can use them: a dashboard, a store page
of a chart, an admin panel.

Two packages:

| Package | What it holds |
|---|---|
| `@altasystem/ui-core` | The flows without any DOM (plan → agree → run → prove, sign-ins, choices, values), the client of the owner's server (`createAltaClient`), the words in English and French, and a fake client for tests (`@altasystem/ui-core/testing`). |
| `@altasystem/ui` | The elements: Custom Elements in the light DOM, styled through tokens, with two themes (`galaxy`, the game's, and `alta`, light and dark) and a Tailwind preset. |

Both are private for now: they live in the repository under `packages/ui-core` and `packages/ui`.

## Three ways to use them

1. **As they are.** Import the elements and a theme, put `<alta-plan-card quest="…" step="…">` in the page. The
   card plans, the agreement asks, the run shows its progress, the proof says if it worked.
   [Quickstart](https://docs.os.altasystem.ai/ui/quickstart).
2. **In your own look.** Change the tokens, style the parts and states with CSS or Tailwind, give classes per part.
   [Theming](https://docs.os.altasystem.ai/ui/theming).
3. **Around your own markup.** Use the flows of `@altasystem/ui-core` alone and draw them yourself: the rules (nothing
   runs before a yes, a secret goes only to the owner's server) stay those of the flows.

## What never changes

- Nothing runs on the machine before the owner agrees to a plan card.
- A secret is typed in `<alta-secret-field>`, which the page cannot read; it goes once, in the body of one request, to
  the owner's server, and is cleared. [Secrets](https://docs.os.altasystem.ai/ui/secrets).
- A step is green only when its proof passes (or, when it has no proof, on the owner's word, said as such).

## Where to go next

- [Quickstart](https://docs.os.altasystem.ai/ui/quickstart): a plan card on a page in five minutes.
- [Theming](https://docs.os.altasystem.ai/ui/theming): tokens, parts and states, classes, Tailwind.
- [Secrets](https://docs.os.altasystem.ai/ui/secrets): the guarantees of the secret field, and their limits.
- [The quest panel](https://docs.os.altasystem.ai/ui/rail): `<alta-quest-rail>`, as the game uses it.
- [Every component](https://docs.os.altasystem.ai/ui/components/) and [every token](https://docs.os.altasystem.ai/ui/tokens).
