# Joined field

A control and an input that share one border, such as a currency and an amount.

This is the HTML to build it with `dex.css`, for work outside the Dex codebase. Read https://brand.meetdex.ai/design.md first: it says how to set up a page and how to use the stylesheet. The page at https://brand.meetdex.ai/components/joined-field shows the Dex app's own React component, which only works inside the Dex codebase.

## HTML

A `dex-joined` holds the parts inside one border. A `<select>` in front gets its own divider; `dex-joined-text` holds text or an icon at either end.

```html
<label class="dex-form-row">
  <span class="dex-field-label">Minimum salary</span>
  <span class="dex-joined">
    <select aria-label="Currency"><option>GBP</option><option>EUR</option><option>USD</option></select>
    <input inputmode="numeric" placeholder="95,000" />
    <span class="dex-joined-text">a year</span>
  </span>
  <span class="dex-field-help">Base salary only</span>
</label>
```

- **Text at the end**: a `dex-joined-text` after the input ("a year", "days").
- **An icon at the start**: a `dex-joined-text` before the input, holding a 16px Lucide `<svg aria-hidden="true">`.
- **Invalid**: `aria-invalid="true"` on the input turns the whole border red, with a `dex-field-error` under it: "Enter your minimum salary."
- **Disabled**: `disabled` on the input (and the select) fades the whole field.
- **Read-only**: `readonly` on the input gives the whole field the muted fill. Show the leading value as a `dex-joined-text` instead of a select, and add helper text saying where it came from ("From your CV").

## States

The group is the field: hover, focus and error show on the outer border, whichever part caused them, and the parts draw none of their own.

## Rules

- Use a joined field for a control and an input that make one answer. The phone input is built the same way.
- The field's label names the input; give the select in front its own `aria-label`.
- The Dex app puts a lock at the end of a read-only field. `dex.css` doesn't draw it; add a 14px Lucide lock in a trailing `dex-joined-text` if you need it.
