# Note

A line of information in the flow of a page, with an action beside it when there's something to do.

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/note shows the Dex app's own React component, which only works inside the Dex codebase.

## HTML

A tone says what a note means and `--fill` how loudly. The default is a hairline edge with the text in the tone's colour; with no tone it's neutral.

```html
<div class="dex-note">
  <div class="dex-note-content"><svg aria-hidden="true"><!-- Lucide info --></svg><p>Your answers save as you go.</p></div>
</div>
<div class="dex-note dex-note--info">
  <div class="dex-note-content"><svg aria-hidden="true"><!-- Lucide info --></svg><p>The team replies within two working days.</p></div>
</div>
<div class="dex-note dex-note--success">
  <div class="dex-note-content"><svg aria-hidden="true"><!-- Lucide circle-check --></svg><p>Your application is with the team.</p></div>
</div>
<div class="dex-note dex-note--warning">
  <div class="dex-note-content"><svg aria-hidden="true"><!-- Lucide triangle-alert --></svg><p>This role closes on Friday.</p></div>
</div>
<div class="dex-note dex-note--danger">
  <div class="dex-note-content"><svg aria-hidden="true"><!-- Lucide octagon-exclamation-point --></svg><p>We couldn't send your answers. Try again.</p></div>
</div>
```

Give each `<p>` `margin: 0` if the page doesn't already.

- **Fill**: `dex-note--fill` swaps the edge for a tint of the tone, for a note inside a card or one that reads as a block with its action.
- **With an action**: a `dex-note-actions` after the content holds one small button, or two: a `dex-button--ghost` that sets the note aside, then the action as a default `dex-button` on the outside edge, as in a dialog. They wrap under the text on a narrow screen.

```html
<div class="dex-note dex-note--fill">
  <div class="dex-note-content"><p>Dex has recommendations for strengthening your CV</p></div>
  <div class="dex-note-actions">
    <button class="dex-button dex-button--ghost dex-button--sm">Ignore</button>
    <button class="dex-button dex-button--sm">Show me</button>
  </div>
</div>
```

- **Label**: a `<span class="dex-note-label">Closing soon:</span>` at the start of the sentence, in semibold, a step above the note's medium text.
- **Icons**: each tone's icon is the Lucide one named above. Swap it where another says more, or leave it out where the words are enough.
- **Small**: `dex-note--sm` (12px text) in a dense pane, a dialog or a toolbar.
- **Invalid**: `dex-note--invalid` gives the note the danger tone, keeping `--fill` if it has it, when the note is holding something back, such as a submit. A `dex-field-error` with `role="alert"` by the button that was held back says what to do.

## Rules

- A note stays until the person deals with it or the page changes. Something that comes and goes on its own is a toast (https://brand.meetdex.ai/components/toast.md), and a problem with one field is that field's error (https://brand.meetdex.ai/components/errors.md).
- Keep a tone for a real status. A suggestion or a fact that's neither good nor bad news is neutral. Never orange: the brand colour isn't a status.
- One sentence, two at most, in sentence case. Never start with "Note:".
- Set a note aside with a word, such as Ignore, rather than an X.
