# Firm Pilot Mark

The Firm Pilot logo: an open 270° orbit round a paper plane, with three speed lines in the orbit's gap. 1.25 px line on a 24 px grid; scale it, never restroke it. Animated, it draws itself, circles with gravity while Firm Pilot thinks, and comes to rest green when done, never interrupting a pass.

- Beta: ready to use; its API can still change in a minor release.
- Category: Brand

```tsx
import { FirmPilotMark } from "@leap-crm/design-system";
```

## Best practices

- Do: Use `colour="current"` when the mark is an icon in the UI, like on a button, so it draws in the text colour like any other icon.
- Do: Use `white` or `brand-on-navy` on dark surfaces, like the navy chat bar, and keep `inverse` for the app-icon tile.
- Do: Set `decorative` when text beside it already says Firm Pilot. Otherwise screen readers hear its `label`, "Firm Pilot" by default.
- Do: Pass `size="large"` from 40 px up, like in an empty state, so the line draws thinner and doesn't read heavy.
- Do: Set `state` to `thinking` while Firm Pilot works and `done` when it answers. Each change waits for the current pass to finish, so never remount the mark to restart it.
- Don't: Restroke the mark or draw it at another weight. Scale it with a size class; the line scales with it.

## Related

- [Pilot](./pilot.md)
- [Logo](./logo.md)
- [Conflict Status](./conflict-status.md)

## Examples

What the examples import:

```tsx
import { useState } from "react";
import { Button, FirmPilotMark, type PilotMarkState } from "@leap-crm/design-system";
```

Scaffolding the examples call. It lives in the docs page, not in the library:

```tsx
const colours = [
  "brand",
  "success",
  "mono",
  "inverse",
  "white",
  "brand-on-navy",
  "current",
] as const;

const onDark = new Set<string>(["white", "brand-on-navy"]);

const states: PilotMarkState[] = ["idle", "thinking", "done", "ready"];

const titles: Record<PilotMarkState, string> = {
  idle: "Idle",
  thinking: "Thinking",
  done: "Done",
  ready: "Ready to send",
};

function MotionDemo() {
  const [state, setState] = useState<PilotMarkState>("thinking");
  const [run, setRun] = useState(0);
  return (
    <div className="flex flex-wrap items-center gap-8">
      <FirmPilotMark key={run} state={state} size="large" className="size-24" />
      <div className="flex flex-col gap-3">
        <div className="flex flex-wrap gap-2">
          {states.map(next => (
            <Button
              key={next}
              size="sm"
              intent={next === state ? "primary" : "outline"}
              aria-pressed={next === state}
              onClick={() => setState(next)}
            >
              {titles[next]}
            </Button>
          ))}
        </div>
        <Button
          size="sm"
          intent="ghost"
          className="self-start"
          onClick={() => setRun(value => value + 1)}
        >
          Draw again
        </Button>
        <p className="text-small text-neutral-text-muted max-w-80">
          In Ready to send, hover the mark to stream the speed lines. Change
          state mid-motion: the current pass always finishes first.
        </p>
      </div>
    </div>
  );
}
```

### Colours

Brand on the diagonal; success when done; mono for single-colour use; inverse is the app-icon tile; white and brand-on-navy sit on dark surfaces like the navy chat bar; current is the UI icon, orbit and plane in the text colour.

```tsx
<div className="flex flex-wrap gap-4">
  {colours.map(colour => (
    <div key={colour} className="flex flex-col items-center gap-2">
      <span
        className={
          onDark.has(colour)
            ? "bg-chrome rounded-lg p-3"
            : "rounded-lg p-3"
        }
      >
        <FirmPilotMark
          colour={colour}
          size="large"
          className="size-12"
        />
      </span>
      <span className="text-small text-neutral-text-muted">
        {colour}
      </span>
    </div>
  ))}
</div>
```

### Motion

Draw: the plane draws and the pen swings the orbit round. Thinking: the orbit circles with gravity, slow over the top. Done: it glides to rest as it turns green and the trail draws in. Ready to send: the speed lines stream while hovered. Reduced motion holds the resting mark and fades the colour.

```tsx
<MotionDemo />
```

### Sizes

16, 20, 24 and 32 px. The line scales with the mark: 0.83 px at 16.

```tsx
<div className="flex items-end gap-4">
  <FirmPilotMark className="size-4" />
  <FirmPilotMark className="size-5" />
  <FirmPilotMark />
  <FirmPilotMark className="size-8" />
</div>
```

### Large

From 40 px up, pass size="large": the line drops to 0.6 of the small weight, so 1.5 px at 48 and 3 px at 96 instead of 2.5 and 5.

```tsx
<div className="flex items-end gap-6">
  <FirmPilotMark size="large" className="size-12" />
  <FirmPilotMark size="large" className="size-24" />
  <FirmPilotMark colour="inverse" size="large" className="size-12" />
  <FirmPilotMark colour="inverse" size="large" className="size-24" />
</div>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colour` | `\| "current" \| "brand" \| "success" \| "mono" \| "inverse" \| "white" \| "brand-on-navy"` | `"brand"` | Brand by default; success when done; mono for single-colour use; inverse (the app-icon tile), white and brand-on-navy for dark surfaces. Current is the UI icon: orbit and plane in the text colour, coloured like any icon. |
| `state` | `PilotMarkState` |  | Animates the mark. Leave it out for the still mark. On mount it draws itself, then: idle rests; thinking circles with gravity; done comes to rest green with its trail; ready streams the speed lines while hovered. Every change waits for the current pass to finish. |
| `draw` | `boolean` | `true` | Draw the mark in on mount when animated. |
| `hovered` | `boolean` |  | Hover from outside, like the send button the mark sits in. Defaults to the mark's own hover. |
| `label` | `string` | `"Firm Pilot"` | What a screen reader hears. |
| `decorative` | `boolean` | `false` | Beside text that already says Firm Pilot: hidden from screen readers. |
| `size` | `"small" \| "large"` | `"small"` | Small for marks up to 32 px; large for marks drawn 40 px and up, like empty states and the brand tile, which draws a thinner line so it doesn't read heavy when scaled up. |
| `className` | `string` |  | Sizes the mark: 24 px by default. Pass size="large" from 40 px up. |
