# Auth surface

The centred card every sign-in, consent and finished step shares.

Live variants: https://design.arcadia.is/components/auth-surface

```tsx
import { AuthSurface } from "@arcadia/ui";
```

```tsx
import { useState } from "react";
import { AuthSurface, Button } from "@arcadia/ui";

function SignIn() {
  const [waiting, setWaiting] = useState(false);
  return (
    <AuthSurface
      title="Sign in to Act"
      align="center"
      notice={waiting ? { tone: "warning", text: "Waiting for the browser to finish." } : undefined}
      footer="Preview only. No account is needed."
    >
      <Button variant="primary" size="lg" onClick={() => setWaiting(!waiting)}>
        {waiting ? "Cancel sign-in" : "Continue with browser"}
      </Button>
    </AuthSurface>
  );
}
```

## Accessibility

The title is the page's `h1`. A `notice` is a status, or an alert when its tone is `danger`; its icon carries the tone and its text says it, so colour is never the only signal.

## API reference

### AuthSurface

- `nesting` (`"contained-object"`): Mark a framed surface that is an independent object inside another surface.
- `title` (`ReactNode`, required): The one title.
- `description` (`ReactNode`): One optional line under it.
- `icon` (`IconName`): A state glyph instead of the mark (a check once something finished, an alert when it can't).
- `tone` (`"neutral" | "success" | "warning" | "danger"`, default `"neutral"`): The glyph's tone.
- `notice` (`AuthSurfaceNotice | null`): One line above the body: its icon carries the tone, the text stays in text-2.
- `footer` (`ReactNode`): Quiet lines under the body (a way back, a version row).
- `fill` (`boolean`, default `false`): Fill the viewport and centre the card. Default false: the card alone, for a column the page centres.
- `bare` (`boolean`, default `false`): No card: the same column, for a window that holds nothing else.
- `align` (`"center" | "start"`, default `bare ? "center" : "start"`): Where the column's words stand. `center`, bare's default: a short column that stands alone (a sign-in's). `start`, the card's: a column a person reads (a consent's paragraph, its detail and its answers), the mark and the title on that edge too.
- `stateKey` (`string`): Changing it starts the body afresh (one step of a flow to the next, inside the same card), in one frame.
- `rootStyle` (`RootStyle`): Typed StyleX override: layout only.
- `children` (`ReactNode`): The body: fields, a code, the actions.
