# Copy field

> A link that leaves the room: the call sheet’s address, what revision it shows, who can open it, and one button that copies it and says so.

Source: https://kwark.space/designSystem/components/copy-field

## Usage

### What it is
A copy field shows a value someone will paste somewhere else, and copies it in one press. In Kwark that is usually a link that leaves the room, so the field says what the link opens before anyone sends it: **which revision** (*Rev 3*), **what it allows** (*View only*), and **who it reaches** (*Cast and crew of Blank Pages*). Sharing is by film role (Decision 0042), and a person should never paste a link without knowing who it lets in.

### When to use
- A call sheet, a reading-cast invite, a review link for a cut; any address shared outside Kwark.
- A short value people retype by mistake: a project code, a timecode for the editor.

### When not to
- Sending directly to people Kwark already knows: use the share dialog, which names them.
- Long text (a whole Fountain file): a [Code block](https://kwark.space/designSystem/components/code-block.md) with its own copy, or a download.

### Behaviour
- **Copy link** puts the value on the clipboard, then says *Copied* with a tick in the success colour for 1.4s before returning. A polite status says the same in words.
- If the browser refuses, the button reads *Select and copy*, the field selects its text, and the line under it says which keys to press. The value is never hidden behind a failure.
- The field is read-only, focusable and selectable; clicking it selects all.
- When the call sheet is revised, a link that keeps working says so (*Rev 4 will use the same link*). Issued revisions stay frozen (Decision 0020).

**Do:** *Rev 3 · View only · Cast and crew of Blank Pages* under the link, and *Copied* after the press.

**Don't:** A bare URL with a clipboard icon and no word of what it opens or who can open it.

## Style

### Anatomy

1. **Box**: 44px, 1px `--k-line`, 6px corners, no fill (it is read-only). 16px link glyph in `--k-text-2`.
2. **Value**: 14px tabular, ellipsised at the end; the whole value is selectable.
3. **Button**: inside the box on the right, 36px, 4px corners, `--k-raise` with a 1px line; 14px copy glyph and *Copy link* in 500 12px. Hover: `--k-line-strong` edge.
4. **Copied**: `--k-ok-bg` fill, `--k-ok` text, a 2px-stroke tick.
5. **Meta**: 12px `--k-text-2`, beginning with the revision tag (1px `--k-ok` box, as on the call sheet).
6. **Failed**: `--k-warn` edge on the box, the value highlighted as selected, the instruction in `--k-warn`.

### Tokens

| Token | Light | Dark |
|---|---|---|
| `--k-surface` | #ffffff | #1a1a1a |
| `--k-raise` | #f1f5f9 | #252525 |
| `--k-line` | #e2e8f0 | rgba(255, 255, 255, .1) |
| `--k-line-strong` | var(--k-text-2) | var(--k-text-2) |
| `--k-text` | #0f172a | #e3e3e3 |
| `--k-text-2` | #5b6779 | #9ca3af |
| `--k-accent-soft` | #e8b58b | #e8b58b |
| `--k-ok` | #2c6e49 | #6cc08a |
| `--k-ok-bg` | #e7f3ec | #17281e |
| `--k-warn` | #8a5a00 | #d8a44a |
| `--k-tap` | 44px |  |
| `--k-radius-control` | 6px |  |

## Code

### React

Use the HTML below with `kwark.css`. The example shows the markup and styling. Supply any application behavior described on this page.

### HTML and CSS

Works anywhere with `kwark.css`.

```html
<div class="kw-copy"><span class="kw-label">Call sheet link · Day 7</span>
  <div class="kw-copy__box"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"/></svg><input type="text" value="kwark.space/s/blank-pages/day-7" readonly aria-label="Call sheet link for Day 7"><button class="kw-copy__btn" type="button" data-copy-field><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1"/></svg>Copy link</button></div>
  <p class="kw-copy__meta"><span class="kw-time__rev">Rev 3</span>View only · Cast and crew of Blank Pages · Rev 4 will use the same link</p>
</div>
<div class="kw-copy"><span class="kw-label">Call sheet link · Day 7</span>
  <div class="kw-copy__box"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"/></svg><input type="text" value="kwark.space/s/blank-pages/day-7" readonly aria-label="Call sheet link for Day 7"><button class="kw-copy__btn is-done" type="button"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>Copied</button></div>
  <p class="kw-copy__meta" role="status">Link copied. Paste it into the unit’s group.</p>
</div>
<div class="kw-copy kw-copy--failed"><span class="kw-label">Call sheet link · Day 7</span>
  <div class="kw-copy__box"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"/></svg><input type="text" value="kwark.space/s/blank-pages/day-7" readonly aria-label="Call sheet link for Day 7"><button class="kw-copy__btn" type="button"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1"/></svg>Select and copy</button></div>
  <p class="kw-copy__meta" role="status">This browser blocked copying. The link is selected: press ⌘C or Ctrl+C.</p>
</div>
```

## Accessibility

### Keyboard
| Key | Does |
|---|---|
| Tab | The value, then the button. |
| Enter / Space on the button | Copies. |
| ⌘C / Ctrl+C in the value | Copies what is selected. |

### Roles and names
- The value is a read-only `<input>` named with what it is and for: *Call sheet link for Day 7*.
- The button keeps its label in words; when it changes to *Copied*, a polite `role="status"` line says *Link copied* so nothing depends on seeing the button.
- Do not disable the button while it shows *Copied* in a way that drops focus; keep focus on it.
- The revision and access line is plain text next to the field, read in order after the button.

## For agents

### Rules

- **Must** say what a shared link opens and who it reaches, next to the link.
- **Must** confirm a copy in words ("Copied") and in a polite status.
- **Always** fall back to selecting the value with keyboard instructions when the clipboard is refused.
- **Never** hide or truncate a value so that it cannot be selected and copied by hand.
- **Always** label the copy button with its object: "Copy link", not "Copy".

### AI readiness test

**Task:** Show the share link for the Day 7 call sheet after it is issued.

**Give the agent:** Copy field, Call sheet, Decisions 0020 and 0042.

**Constraint:** The link is view only for the cast and crew; Rev 3 is current.

**A reliable answer:**
- Read-only field named Call sheet link for Day 7
- Copy link button
- Copied with a polite status
- Rev 3, View only and who it reaches beside it
- Fallback selects the text
