@brignano/design 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/DECISIONS.md CHANGED
@@ -381,3 +381,32 @@ step's OKLCH lightness and stays monotonic.
381
381
  - A visible change, so the release that carries it is a minor.
382
382
  - `--chart-1` is a separately validated categorical slot (ADR-0002) and is
383
383
  unchanged.
384
+
385
+ ---
386
+
387
+ ## ADR-0009 — Motion the reader asks for is allowed in the tool tier
388
+
389
+ **Status:** accepted · 2026-10-31
390
+
391
+ ### Context
392
+
393
+ The tool tier has no motion (§2). driftwood's request flow view answers the
394
+ first question on an incident call, "where does traffic come in and what does
395
+ it pass through", and its *Trace a request* control walks a request through the
396
+ diagram one hop at a time. Shown all at once, the order is only in the numbers;
397
+ walked, it is obvious.
398
+
399
+ ### Decision
400
+
401
+ Motion is allowed in the tool tier when the reader starts it and it shows an
402
+ order: it runs only on a click, can be stopped, every step it shows is also
403
+ listed as text, and `prefers-reduced-motion` gets the final state at once (the
404
+ whole path lit). It uses the selection treatment from §9, so it adds no hue.
405
+ Decorative motion stays out.
406
+
407
+ ### Consequences
408
+
409
+ - The §7 contract still holds: nothing is hidden until an animation runs, and
410
+ the page reads the same with the script off.
411
+ - Any later animation in a tool has to meet the same four conditions or it is
412
+ decorative.
package/DESIGN.md CHANGED
@@ -154,6 +154,14 @@ or is disabled is disqualified.
154
154
  and that block ships inside `tokens.css` so no surface can forget it. One easing
155
155
  curve (`--ease`), three durations, compositor-only properties.
156
156
 
157
+ **The tool tier has one exception: motion a person asks for.** A control that
158
+ walks through a sequence step by step, such as driftwood's *Trace a request*,
159
+ may animate, because the reader started it to follow an order of events, and
160
+ the order is the content. It runs only when clicked, never on load; it can be
161
+ stopped at any step; every state it passes through is also listed as text; and
162
+ under `prefers-reduced-motion` it shows the final state (the whole sequence lit)
163
+ at once. Nothing decorative qualifies: no entrance, hover or scroll animation.
164
+
157
165
  ## 8. Charts
158
166
 
159
167
  The one place the restraint rule does **not** apply: a categorical chart needs
@@ -197,6 +205,10 @@ is thirty coloured things, and the one that is down disappears among them.
197
205
  - **Selection** is the focus treatment: a 2px `--i-ink` outline, offset. Asking
198
206
  "what depends on this?" dims everything unrelated to ~30% opacity and inks the
199
207
  connecting edges in `--ink`; it never introduces a colour.
208
+ - **A path is numbered, not coloured.** A request path drawn over a diagram
209
+ numbers its hops in order (`1`, `2a`/`2b` for a branch) in `--mono`, in a
210
+ `--line-strong` ring, and lists them beside the picture. Tracing it lights each
211
+ hop with the selection treatment above, never with a new hue.
200
212
  - **Lead with the verdict.** A page about a deploy opens with one sentence saying
201
213
  what happened and what needs you, then the pills that back it up, then the
202
214
  picture.
@@ -325,14 +337,22 @@ The order is fixed, because each band answers the question the last one raised:
325
337
  2. **Hero** (`.pp-hero`) — the status, a one-line **thesis** (`.pp-thesis`), a
326
338
  subhead of one or two sentences, the primary action and one secondary, and a
327
339
  **proof slot** (`.pp-media`). The proof is the product itself where it can be
328
- (a live demo), else a real screenshot. Never stock imagery.
340
+ (a live demo), else a real screenshot or a short screen recording (see
341
+ *Video in the proof slot* below). Never stock imagery.
329
342
  3. **Story** (`ol.pp-story` of `.pp-chapter`) — three or four numbered chapters,
330
343
  usually *the problem*, *how it works*, *who it's for*, *why now*. Each is a mono
331
344
  label (`.pp-label`, numbered `01 /` by the list, so reordering renumbers), a
332
345
  headline that is a sentence, a short body, and optionally `.pp-points` (two to
333
346
  four ruled columns) or a `.pp-figure`.
334
347
  4. **Close** (`.pp-close`) — the primary action again, with the room a form needs
335
- (`.pp-panel`).
348
+ (`.pp-panel`). If the product has prices, they go in the left column under the
349
+ subhead, as a **price list** (`dl.pp-price`, below). A short form is
350
+ `.pp-form` of `.pp-field` (label above the control), then the button, then a
351
+ `.pp-note` for the privacy line. Mark the optional fields (`.pp-optional`),
352
+ not the required ones. A field that fails takes `aria-invalid="true"` and a
353
+ `.pp-error` sentence under it; a failed send puts its error in the note
354
+ (`.pp-note.is-error`). On success the form gives way to `.pp-done`, a heading
355
+ and one line with `role="status"`, focused.
336
356
  5. **Footer** (`.pp-footer`) — the brand and a line about it, a few links, then
337
357
  the **legal line** (`.pp-legal`): `© {year} Anthony Brignano. All rights
338
358
  reserved.` and, if the product has them, its Privacy and Terms links
@@ -352,11 +372,74 @@ Rules:
352
372
  development". `data-state="open"` takes `--success` (you can join now),
353
373
  `"soon"` takes `--attention`; no attribute stays neutral. The word carries the
354
374
  meaning on its own (§3, never colour alone).
375
+ - **Prices sit beside the ask, not apart from it.** `dl.pp-price` holds two to
376
+ four options, one `<div>` each: the price as `<dt>` ("From $100"), one line
377
+ of condition as `<dd>`. A single price needs no list; say it in the subhead.
378
+ Its home is the close band, under the subhead, so the price is read right before the action.
379
+ Only when pricing *is* the argument (tiers the reader has to choose between)
380
+ does it get its own chapter, in the chapter body like `.pp-points`. An option
381
+ never gets its own `.pp-button`: the one primary action stays in the panel and
382
+ covers every option (the form can ask which). An option that needs a separate
383
+ way in gets a plain link in its `<dd>`. Write the price the way you'd say it;
384
+ no strike-through prices, "most popular" badges or highlighted tiers.
355
385
  - **Headlines are sentences.** Calm and declarative, no exclamation marks, no
356
386
  claims the page can't back up.
357
387
  - **Restraint carries the style.** Hairlines between chapters, whitespace, the
358
388
  type scale. No gradients, no tinted section backgrounds, no decorative colour.
359
389
 
390
+ ### Video in the proof slot
391
+
392
+ When the proof is something a person does, such as editing their site on a
393
+ phone and seeing it update, a short clip shows it better than a still.
394
+ `.pp-media` takes a `<video>` (or `<img>`) directly, framed like a hero surface,
395
+ or inside `.pp-device`, a phone frame. `previews/product-media.html` shows both.
396
+
397
+ - **The clip.** `<video muted loop playsinline preload="metadata">` with
398
+ `width`/`height` set, a `poster`, and no `autoplay` attribute. Keep it under
399
+ about 15 seconds and silent: it loops, and nobody turns sound on in a hero.
400
+ - **The poster is the finished state.** It is what shows before the clip
401
+ loads, without JavaScript, and under `prefers-reduced-motion`, so it has to
402
+ make the argument on its own (§7: content is visible by default).
403
+ - **The phone frame** (`.pp-device`) is a 10px bezel in `--device`, which stays
404
+ dark in both themes. A phone is a dark object, and a bezel in `--ink` would
405
+ turn near-white in dark mode. Its one child is the screen, at 9 : 19.5.
406
+ `--pp-device-width` (default 280px) sizes it.
407
+ - **Steps** (`ol.pp-steps` in a `figcaption.pp-caption`) name what the clip
408
+ shows, in mono: *1 Change the hours, 2 Press Save, 3 The site updates*. Each
409
+ `<li data-at="3">` gives the second it starts at, and the step the clip is on
410
+ gets `aria-current="step"`, which inks it. The list is the sequence as text,
411
+ so it reads the same with the clip stopped.
412
+ - **Pause / Play** (`button.pp-play`) is required. Motion that runs longer than
413
+ five seconds needs a way to stop it (WCAG 2.2.2). It starts `hidden`, and the
414
+ script shows it.
415
+
416
+ The package is CSS, so the page carries this script, once, after the figure:
417
+
418
+ ```js
419
+ for (const fig of document.querySelectorAll('.pp-media')) {
420
+ const video = fig.querySelector('video'), button = fig.querySelector('.pp-play');
421
+ if (!video || !button) continue;
422
+ const steps = [...fig.querySelectorAll('.pp-steps > li[data-at]')];
423
+ const label = () => { button.textContent = video.paused ? 'Play' : 'Pause'; };
424
+ video.addEventListener('timeupdate', () => {
425
+ const now = steps.filter((s) => video.currentTime >= +s.dataset.at).pop();
426
+ for (const s of steps) {
427
+ if (s === now) s.setAttribute('aria-current', 'step');
428
+ else s.removeAttribute('aria-current');
429
+ }
430
+ });
431
+ video.addEventListener('play', label);
432
+ video.addEventListener('pause', label);
433
+ button.addEventListener('click', () => (video.paused ? video.play() : video.pause()));
434
+ button.hidden = false;
435
+ label();
436
+ if (!matchMedia('(prefers-reduced-motion: reduce)').matches) video.play().catch(label);
437
+ }
438
+ ```
439
+
440
+ Under reduced motion the clip waits on its poster with a **Play** button, so it
441
+ runs only when the reader asks for it, the same terms as ADR-0009.
442
+
360
443
  Every class starts with `.pp-`, so the file sits beside a site's own stylesheet.
361
444
  A page can change `--pp-width` (default 1160px) and `--pp-gutter` on `.pp`.
362
445
 
@@ -366,8 +449,13 @@ Before a product page ships, check it:
366
449
  - [ ] One primary action, the same everywhere it appears.
367
450
  - [ ] A status word with a dot, in the header and the hero.
368
451
  - [ ] A one-line thesis; every headline is a sentence.
369
- - [ ] The proof slot is the product (a live demo) or a real screenshot.
452
+ - [ ] The proof slot is the product (a live demo), a real screenshot, or a
453
+ real screen recording.
454
+ - [ ] A clip has a finished-state poster, a Pause / Play button, and no
455
+ `autoplay` attribute.
370
456
  - [ ] Three or four story chapters, numbered by the list.
457
+ - [ ] Prices, if any, are a `.pp-price` of two to four options in the close
458
+ band (or one chapter), with no buttons of their own.
371
459
  - [ ] Has a copyright footer: `© {year} Anthony Brignano. All rights reserved.`,
372
460
  the year filled in at build time, plus Privacy and Terms links for the
373
461
  pages the product has.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brignano/design",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Shared design system for brignano surfaces \u2014 colour, type, space, shape, motion.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/product-page.css CHANGED
@@ -9,7 +9,9 @@
9
9
  * .pp-header brand, a few in-page links, the status, the primary action
10
10
  * .pp-hero status, a one-line thesis, a subhead, two actions, a proof slot
11
11
  * .pp-story 3–4 numbered chapters: problem, how it works, who it's for, why now
12
- * .pp-close the primary action again, with whatever it needs (a form)
12
+ * .pp-close the primary action again, with whatever it needs: a short
13
+ * .pp-form of .pp-field (.pp-done once it's sent), and the
14
+ * prices (.pp-price) if the product has them
13
15
  * .pp-footer brand and links, then the legal line: © year, owner, and
14
16
  * the product's Privacy and Terms links if it has them
15
17
  *
@@ -19,7 +21,8 @@
19
21
  * - One primary action per page (.pp-button). Everything else is secondary.
20
22
  * - The status is a word with a dot, never a coloured badge on its own.
21
23
  * - The proof slot is the product itself where possible (a live demo), else a
22
- * real screenshot. No stock imagery, no illustrations of people.
24
+ * real screenshot or a screen recording, optionally in a .pp-device phone
25
+ * frame. No stock imagery, no illustrations of people.
23
26
  * - Chapters are numbered by the list, so reordering them renumbers them.
24
27
  *
25
28
  * Every class starts with .pp- so it can sit beside a site's own stylesheet.
@@ -125,6 +128,80 @@ body.pp { margin: 0; }
125
128
  .pp-subhead { font-size: var(--text-lg); line-height: 1.5; color: var(--ink-soft); margin: 0 0 var(--s6); max-width: 40ch; }
126
129
  .pp-media { margin: 0; min-width: 0; }
127
130
 
131
+ /* ── Proof media: a clip, a phone frame, the steps it shows ───────────────
132
+ The proof slot holds an <img> or a <video>, bare or in a .pp-device phone
133
+ frame, and optionally a row of .pp-steps naming what the clip shows.
134
+
135
+ <figure class="pp-media">
136
+ <div class="pp-device">
137
+ <video muted loop playsinline preload="metadata" width="390" height="844"
138
+ poster="finished.png" aria-describedby="clip-steps">
139
+ <source src="clip.mp4" type="video/mp4"></video>
140
+ </div>
141
+ <figcaption class="pp-caption">
142
+ <ol class="pp-steps" id="clip-steps">
143
+ <li data-at="0">Change the hours</li>
144
+ <li data-at="3">Press Save</li>
145
+ <li data-at="6">The site updates</li>
146
+ </ol>
147
+ <button class="pp-play" type="button" hidden>Pause</button>
148
+ </figcaption>
149
+ </figure>
150
+
151
+ No autoplay attribute: the small script in DESIGN.md §13 starts the clip
152
+ unless the reader prefers reduced motion, shows the Pause / Play button,
153
+ and lights the step the clip is on. Without the script, or with reduced
154
+ motion, the poster stands still, so the poster is the finished state. */
155
+ .pp-media > img, .pp-media > video {
156
+ display: block; width: 100%; height: auto; background: var(--card);
157
+ border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-3);
158
+ }
159
+
160
+ /* A phone around the clip. The bezel is --device, dark in both themes; the
161
+ screen is whatever the frame's one child is (video, img, or a stand-in). */
162
+ .pp-device {
163
+ --pp-device-width: 280px;
164
+ box-sizing: border-box; width: min(100%, var(--pp-device-width)); margin: 0 auto;
165
+ padding: 10px; background: var(--device); border-radius: 44px; box-shadow: var(--shadow-3);
166
+ }
167
+ .pp-device > * {
168
+ display: block; box-sizing: border-box; width: 100%; height: auto; aspect-ratio: 9 / 19.5;
169
+ object-fit: cover; overflow: hidden; border-radius: 34px; background: var(--card);
170
+ }
171
+
172
+ /* Under the clip: the steps in mono, then the control. Centred, because the
173
+ phone is. */
174
+ .pp-caption {
175
+ display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: var(--s3) var(--s5);
176
+ margin-top: var(--s5);
177
+ }
178
+ .pp-steps {
179
+ list-style: none; margin: 0; padding: 0; counter-reset: pp-step;
180
+ display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2) var(--s4);
181
+ }
182
+ .pp-steps > li {
183
+ counter-increment: pp-step; padding-top: var(--s2); border-top: 2px solid var(--line-strong);
184
+ font: 500 var(--text-xs) / 1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft);
185
+ transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
186
+ }
187
+ .pp-steps > li::before { content: counter(pp-step) " "; color: var(--ink); }
188
+ /* The step the clip is on. Ink, not a hue: it is emphasis, not state. */
189
+ .pp-steps > li[aria-current="step"] { color: var(--ink); border-top-color: var(--ink); }
190
+
191
+ /* Pause / Play. A word, because moving content that runs past five seconds
192
+ needs a way to stop it (WCAG 2.2.2). Hidden until the script wires it. */
193
+ .pp-play {
194
+ display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; cursor: pointer;
195
+ font: 500 var(--text-xs) / 1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
196
+ padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-control);
197
+ background: transparent; color: var(--ink);
198
+ }
199
+ .pp-play:hover { background: var(--surface-hover); }
200
+ .pp-play:active { background: var(--surface-active); }
201
+ .pp-play:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
202
+ .pp-play[hidden] { display: none; }
203
+ @media (pointer: coarse) { .pp-play { min-height: 44px; } }
204
+
128
205
  /* ── Story ─────────────────────────────────────────────────────────────
129
206
  An <ol> of chapters. Each opens on a hairline with "01 / Label" in mono,
130
207
  then a headline that is a sentence, then a short body and an optional
@@ -169,6 +246,62 @@ body.pp { margin: 0; }
169
246
  .pp-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: var(--s6); }
170
247
  @media (max-width: 560px) { .pp-panel { padding: var(--s5) var(--s4); } }
171
248
 
249
+ /* ── Form ──────────────────────────────────────────────────────────────
250
+ The short form a close panel may need: a few .pp-field, then the primary
251
+ action in .pp-actions, then a .pp-note for the privacy line (or, after a
252
+ failed send, the error). Mark the optional fields with .pp-optional inside
253
+ the label; required is the default and goes unmarked.
254
+
255
+ A field that fails takes aria-invalid="true" on its control and a
256
+ .pp-error message under it, tied with aria-describedby. The message is a
257
+ sentence, so the colour is never the only sign (DESIGN.md §3).
258
+
259
+ On success the form is replaced in the panel by .pp-done: a short heading
260
+ and one line, with role="status" so it is announced, and tabindex="-1" so
261
+ script can move focus to it. */
262
+ .pp-form { display: grid; gap: var(--s4); margin: 0; }
263
+ .pp-form .pp-actions { margin-top: var(--s2); }
264
+ /* [hidden] is how the form gives way to .pp-done; display: grid would beat it. */
265
+ .pp-form[hidden], .pp-error[hidden], .pp-done[hidden] { display: none; }
266
+ .pp-field { display: grid; gap: 6px; min-width: 0; }
267
+ .pp-field > label { font-size: var(--text-sm); font-weight: 500; line-height: 1.4; color: var(--ink); }
268
+ .pp-optional { font-weight: 400; color: var(--ink-soft); }
269
+ .pp-field input, .pp-field textarea {
270
+ box-sizing: border-box; width: 100%; margin: 0; min-width: 0;
271
+ font: var(--text-base) / 1.5 var(--sans); color: var(--ink);
272
+ background: var(--card); border: 1px solid var(--line-control); border-radius: var(--radius-sm);
273
+ padding: 10px 12px;
274
+ transition: border-color var(--dur-fast) var(--ease);
275
+ }
276
+ .pp-field textarea { min-height: 7em; resize: vertical; }
277
+ .pp-field input::placeholder, .pp-field textarea::placeholder { color: var(--slate); opacity: 1; }
278
+ /* Hover darkens the edge rather than lightening it: --line-strong would drop
279
+ the boundary under 3:1 (DESIGN.md §4). */
280
+ .pp-field input:hover, .pp-field textarea:hover { border-color: var(--ink-soft); }
281
+ .pp-field input:focus-visible, .pp-field textarea:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
282
+ .pp-field input:disabled, .pp-field textarea:disabled { background: var(--surface-hover); color: var(--ink-soft); cursor: not-allowed; }
283
+ .pp-field [aria-invalid="true"], .pp-field [aria-invalid="true"]:hover { border-color: var(--danger); }
284
+ .pp-error { margin: 0; font-size: var(--text-sm); line-height: 1.4; color: var(--danger-ink); }
285
+ /* A send error reuses the note under the button. */
286
+ .pp-note.is-error { color: var(--danger-ink); }
287
+
288
+ .pp-done h3 { margin: 0 0 var(--s2); font-size: var(--text-xl); font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
289
+ .pp-done p { margin: 0; color: var(--ink-soft); }
290
+ .pp-done:focus { outline: none; }
291
+ .pp-done:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 4px; border-radius: var(--radius-sm); }
292
+ /* ── Price ─────────────────────────────────────────────────────────────
293
+ Two to four ways to pay, as a <dl>: one <div> per option, the price as <dt>,
294
+ one line of condition as <dd>. Ruled like .pp-points, narrower so three fit
295
+ in the close band's left column. It goes under the close's subhead (or in a
296
+ chapter body, if pricing is the argument). The options carry no buttons:
297
+ the page's one .pp-button stays in the panel, and an option that needs its
298
+ own way in gets a plain link in its <dd>. */
299
+ .pp-price { margin: var(--s6) 0 0; display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
300
+ .pp-price > div { border-top: 2px solid var(--ink); padding-top: var(--s3); }
301
+ .pp-price dt { margin: 0 0 6px; font-size: var(--text-lg); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
302
+ .pp-price dd { margin: 0; font-size: var(--text-sm); color: var(--ink-soft); }
303
+ .pp-price dd a { color: var(--i-ink); }
304
+
172
305
  /* ── Footer ────────────────────────────────────────────────────────────── */
173
306
  .pp-footer { border-top: 1px solid var(--line); padding: var(--s6) 0 var(--s7); color: var(--ink-soft); font-size: var(--text-sm); }
174
307
  .pp-footer > .pp-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4) var(--s6); }
package/tokens.css CHANGED
@@ -137,6 +137,11 @@
137
137
  for (3.39:1 on card, 3.68:1 on bg). */
138
138
  --line-control: light-dark(#8a8a8f, #6b6b73);
139
139
  --on-dark: light-dark(#fafafb, #0d0d0f); /* n-25 / n-0 */
140
+ /* A phone's bezel (.pp-device). A phone is a dark object in either theme,
141
+ so this stays dark rather than flipping with --ink, which would draw a
142
+ near-white bezel in dark mode. Dark lifts it to n-300 so the frame still
143
+ has an edge against the near-black page. Decoration, not a boundary. */
144
+ --device: light-dark(#111114, #3a3a41); /* n-900 / n-300 */
140
145
 
141
146
  /* ── Interactive — cobalt ─────────────────────────────────────────────
142
147
  Everything you can act on: links, buttons, focus, selection. Chosen to