@alis-build/design-system 0.47.0 → 0.49.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.
@@ -4,7 +4,7 @@ Where you write to Alis, an agent or a person. One floating surface with three b
4
4
 
5
5
  ## Use / don't use
6
6
 
7
- - **Every conversation**: Ideate, an interview, an agent session, a specialist thread. One composer per conversation, at the thread's measure (`measure-prose`, 710px), docked to the bottom of the thread or centred on an empty home.
7
+ - **Every conversation**: Ideate, an interview, an agent session, a specialist thread. One composer per conversation, at the thread's measure (`measure-prose`, 710px), docked to the bottom of the thread or centred on an empty home. On a list, a report, an artifact or a document it docks at the foot as the way in to Alis, and settles into Ask Alis while you read (§ Docked as a way in).
8
8
  - **Not a form.** Something you fill in and submit once (feedback, a ticket, a contribution, a new session's brief) is an [AppTextField](AppTextField.md) with a labelled filled button ([page.md](../rules/page.md) § Forms). Its voice is the field's dictation, whose ✓ keeps the text, or a recording staged as a tile; neither submits: the composer's trailing button sends, so inside a form, stopping a recording would send the form.
9
9
  - The surface is `surface-container-high` (white in light, a step lighter than a card in dark) at `elevation-2` with `radius-xl` (28): concentric with the 40px trailing button set 8 in. It floats; locked, it drops to the ground and the shadow goes.
10
10
 
@@ -33,7 +33,7 @@ Where you write to Alis, an agent or a person. One floating surface with three b
33
33
  | Empty, live offered | `graphic_eq` **Talk** | `mic` "Dictate" (not on a phone) or "Record a voice note" | Placeholder |
34
34
  | Empty, mic only | `mic` **Dictate** or **Record** (on a phone, Dictate gives way to Send, disabled) | none | Placeholder |
35
35
  | Empty, no voice | `arrow_upward` "Send", disabled | none | Placeholder |
36
- | Something to send (text or a staged file) | `arrow_upward` "Send" | none: the voice controls leave | Live |
36
+ | Something to send (text, a staged file or a quote) | `arrow_upward` "Send" | none: the voice controls leave | Live |
37
37
  | Queued, uploading, processing, or a tile failed | "Send", disabled; the line says why | none | Live |
38
38
  | Alis is working | `stop` (filled glyph) "Stop" | none | Stays writable; the draft is kept |
39
39
  | Working, queue on, with text | `arrow_upward` "Send when Alis finishes" | `stop_circle` "Stop" | Live |
@@ -116,6 +116,30 @@ The draft and a submitted message have different owners. Use this lifecycle in e
116
116
  - **When it stops**, the bar leaves and what it captured is an [AppAttachment](AppAttachment.md) (`screen_record`) in the thread; its upload is the tile's own progress, never the bar's.
117
117
  - **Not the recording bar** (§ Voice): that one replaces the row while you make the message, and finishes in cyan because finishing commits.
118
118
 
119
+ ## Docked as a way in
120
+
121
+ **On a screen that isn't a conversation** (a list, a report, an artifact, a document), the composer docks at the foot as the way in to Alis: what you send opens a new conversation on Alis's own page. Arriving, it is the composer as written above. Reading down, it settles into **Ask Alis**, the mark and the words, at its own foot, and opens again when you want it.
122
+
123
+ **Where it goes.** One dock per screen, in the content: the list's pane on a list-detail screen, never the detail pane. Not on a conversation (it has its own composer), a form or a flow in steps (their actions hold the foot), sign-in or sign-up, a dialog, the voice view or the file pane. A screen whose list is empty keeps it.
124
+
125
+ - **It is sticky at the foot of the content** (`.app-dock`): the last child of the content that scrolls, in a column at least as tall as what you can see (AppShell's `.app-shell__content` is one), so it sits at the foot of a short page and stays there over a long one. In a split view it goes in the pane you read. Its own height is the page's clearance: at the end of the page it sits under the last line, never over it, and **a page never adds space for it.** The ground under it fades the page out above the composer (`background`, from transparent over 32px).
126
+ - **The box sits in `.app-composer__lift`**, which carries the shadow, so the clip below takes the shadow with it. A docked composer has no line except an error.
127
+ - **It settles** while you scroll down, once the content is more than half its visible height from the top, and only while it holds nothing of yours: empty, unfocused, nothing in the tray, no menu or popover open from it, no ask, no capture, no recording and no call. Only scrolls you make count, not the product's own (restoring a position, scrolling to an anchor or to what has focus). A page that doesn't scroll never settles.
128
+ - **It opens** when you scroll up 48px from the furthest point down, reach the end of the page (with nothing more to load), click or tab to Ask Alis (the cursor goes to the editor), drop a file on the page, or choose Ask Alis on a selection. Scrolling down again past the halfway mark settles it again.
129
+ - **The movement**: the box closes in from the sides and the top onto Ask Alis, so it reads as the composer put away, never as something arriving. Settling, the box closes on `spring-default-spatial`; the editor and the row fade on `spring-fast-effects` and drop 6px (on a phone, where they share a row, they only fade); Ask Alis fades in on `spring-default-effects` once they have gone. Opening runs it back: Ask Alis goes, the box opens, the rest fades and rises into place after it. Under reduced motion the box changes in one step and the rest still fades ([motion.md](../rules/motion.md)). The mark's dots hold still: dots that move are the loader, Alis working.
130
+ - **One markup.** The settle is `.is-settled` on `.app-composer`; Ask Alis is `.app-composer__trace` inside the box, there all along. The textarea is never re-rendered or moved, so a draft, a cursor or a phone's keyboard can't be lost.
131
+ - **What its controls do.** Send opens the new conversation on Alis's page with the message, the tray, and the page you were on as references. Talk opens it in a call. Add and a dropped file stage files in the tray first, as in any composer.
132
+ - **Layers.** The dock is at `z-index` 1, above the page. What opens from the composer or over the page (the Add menu, a combobox's panel, a popover) opens in a layer above it, outside the box: the box is clipped and would cut it. A snackbar rises above the composer at rest (the CSS does it).
133
+
134
+ ### Asking about what you selected
135
+
136
+ Select text on a screen with a dock and **Ask Alis** appears by the selection (`.app-selection-ask`): the same pill as the settled dock, the mark and the words, floating at `elevation-2`. Choosing it puts the selection in the tray as a quote (`.app-composer__quote`), opens the composer and puts the cursor in the editor; you say what you want done with it. It is pointing at a passage and asking a colleague: you don't describe what you mean.
137
+
138
+ - **Where it shows**: 8px above the selection's first line, centred on it, kept inside the window; on a touch screen 8px below its last line, since the phone's own menu takes the space above. It takes `.app-target`. It goes when the selection collapses, on Esc, or on scroll, and never takes focus.
139
+ - **Never offered** on text in a field, an editor, a `contenteditable`, the composer itself or a dialog, nor inside anything marked `data-no-ask` (a code block, which has its own Copy).
140
+ - **The quote** in the tray: the system's quote rule (4px `outline`) on `surface-container-low`, two lines at most, cut with an ellipsis, and a `close` icon button, "Remove quote". One quote at a time: a new one replaces it. It holds up to 2,000 characters, cut at a word with "…". A quote is something to send, like a staged file: Send takes the slot.
141
+ - **Sent**, the quote goes with the message the way a file does: in your turn it keeps its tile, without remove, above your bubble ([AppTurn](AppTurn.md)). Alis receives it as a Markdown quote, every line starting `> `, before what you wrote.
142
+
119
143
  ## Markup
120
144
 
121
145
  ```html
@@ -155,7 +179,7 @@ The draft and a submitted message have different owners. Use this lifecycle in e
155
179
  <div class="app-composer__row">
156
180
  <button type="button" class="app-icon-btn app-state app-target" aria-label="Add files and more" title="Add files and more"><span class="app-icon" aria-hidden="true">add</span></button>
157
181
  <span class="app-composer__spacer"></span>
158
- <button type="button" class="app-composer__go app-state app-target" aria-label="Send internal note" title="Send internal note"><span class="app-icon" aria-hidden="true">arrow_upward</span></button>
182
+ <button type="button" class="app-composer__go app-state app-target" aria-label="Send internal note" title="Send internal note"><span class="app-icon-swap" aria-hidden="true"><span class="app-icon">arrow_upward</span><span class="app-icon">stop</span></span></button>
159
183
  </div>
160
184
  </div>
161
185
  </div>
@@ -291,11 +315,48 @@ The draft and a submitted message have different owners. Use this lifecycle in e
291
315
 
292
316
  <!-- Locked -->
293
317
  <div class="app-composer is-locked"><!-- box with the editor only; the line says why --></div>
318
+
319
+ <!-- Docked as a way in: the last child of the content that scrolls; is-settled on .app-composer puts it away -->
320
+ <main class="app-shell__content">
321
+ <!-- the page -->
322
+ <div class="app-dock">
323
+ <div class="app-composer">
324
+ <div class="app-composer__lift">
325
+ <div class="app-composer__box">
326
+ <div class="app-composer__editor"><textarea class="app-composer__input" rows="1" aria-label="Message" placeholder="Ask Alis anything"></textarea></div>
327
+ <div class="app-composer__row">
328
+ <button type="button" class="app-icon-btn app-state app-target" aria-label="Add files and more" title="Add files and more"><span class="app-icon" aria-hidden="true">add</span></button>
329
+ <span class="app-composer__spacer"></span>
330
+ <button type="button" class="app-composer__go app-state"><span class="app-icon" aria-hidden="true">graphic_eq</span><span class="app-composer__go-label">Talk</span></button>
331
+ </div>
332
+ <button type="button" class="app-composer__trace app-state" inert>
333
+ <svg viewBox="0 0 30 50" aria-hidden="true" style="fill:var(--alis-red)"><circle cx="5" cy="25" r="3.7"/><circle cx="5" cy="35" r="3.7"/><circle cx="5" cy="45" r="3.7"/><circle cx="15" cy="5" r="3.7"/><circle cx="15" cy="15" r="3.7"/><circle cx="15" cy="25" r="3.7"/><circle cx="15" cy="35" r="3.7"/><circle cx="15" cy="45" r="3.7"/><circle cx="25" cy="5" r="3.7"/><circle cx="25" cy="15" r="3.7"/><circle cx="25" cy="25" r="3.7"/></svg>
334
+ <span>Ask Alis</span>
335
+ </button>
336
+ </div>
337
+ </div>
338
+ </div>
339
+ </div>
340
+ </main>
341
+
342
+ <!-- Ask Alis over a selection, placed by the selection's end -->
343
+ <button type="button" class="app-selection-ask app-state app-target" aria-label="Ask Alis about the selection" style="left: 412px; top: 288px">
344
+ <svg viewBox="0 0 30 50" aria-hidden="true" style="fill:var(--alis-red)"><circle cx="5" cy="25" r="3.7"/><circle cx="5" cy="35" r="3.7"/><circle cx="5" cy="45" r="3.7"/><circle cx="15" cy="5" r="3.7"/><circle cx="15" cy="15" r="3.7"/><circle cx="15" cy="25" r="3.7"/><circle cx="15" cy="35" r="3.7"/><circle cx="15" cy="45" r="3.7"/><circle cx="25" cy="5" r="3.7"/><circle cx="25" cy="15" r="3.7"/><circle cx="25" cy="25" r="3.7"/></svg>
345
+ <span>Ask Alis</span>
346
+ </button>
347
+
348
+ <!-- The quote in the tray -->
349
+ <div class="app-composer__tray">
350
+ <div class="app-composer__quote">
351
+ <p class="app-composer__quote-text">Commission is the open question. Distribution expects clawback to pause with the premium; nobody else had considered it.</p>
352
+ <button type="button" class="app-icon-btn app-state app-target" aria-label="Remove quote" title="Remove quote"><span class="app-icon" aria-hidden="true">close</span></button>
353
+ </div>
354
+ </div>
294
355
  ```
295
356
 
296
357
  ## Behaviour you must supply
297
358
 
298
- - **The state machine** above: swap the trailing button's glyph, `aria-label` and `title` (or its word, in a voice state), and add or remove the plain voice buttons, on every change to the draft, the tray or the agent's state. `disabled` on Send until there is something to send and every tile is ready.
359
+ - **The state machine** above: swap the trailing button's glyph, `aria-label` and `title` (or its word, in a voice state), and add or remove the plain voice buttons, on every change to the draft, the tray or the agent's state. `disabled` on Send until there is something to send and every tile is ready. **Send and Stop** share one `.app-icon-swap` (`arrow_upward` first, `stop` second), `is-swapped` while Alis works, so the glyph turns over rather than blinking ([AppIconButton](AppIconButton.md)).
299
360
  - **Keyboard**, on the editor only (never a window listener): Enter sends; Shift Enter adds a line (no hint line says so: Send's [AppTooltip](AppTooltip.md) carries Enter, and the [AppShortcutSheet](AppShortcutSheet.md) lists both); ignore Enter while `isComposing` (IME) or while a suggestion menu is open ([AppMenu](AppMenu.md)). In a call, Enter with text sends into the call. While Alis works with the queue off, Enter does nothing.
300
361
  - **Auto-grow**: set the textarea's height to its `scrollHeight` on input; the editor caps it at eight lines (five on a phone while the keyboard is up) and scrolls.
301
362
  - **One markup at every width.** The phone's one row is CSS alone. Never re-render or move the textarea when the composer changes form or state: a phone drops its keyboard mid-word.
@@ -306,7 +367,9 @@ The draft and a submitted message have different owners. Use this lifecycle in e
306
367
  - **Drop**: show `.app-composer__drop` in the tray while a file is dragged over the composer; on drop, stage an [AppAttachment](AppAttachment.md).
307
368
  - **Delivery** follows § Delivery and retry: before submission the draft stays; after submission, the turn owns any failure and retry. A new draft never changes the audience or files of a retry.
308
369
  - Return focus to the editor after sending, after dictation and after a call.
370
+ - **Docked as a way in** (§ Docked as a way in): put `.app-dock` last in the content that scrolls, with no bottom padding of the content's own after it (AppShell's is removed for you). Settle by toggling `.is-settled` on `.app-composer` on the rules in § Docked as a way in, listening to that scroller (the window, for AppShell); flag the product's own scrolls so they don't count. Before settling, set `inert` on the box's bands and clear it from Ask Alis; opening, focus the editor first when it opens from Ask Alis, then set `inert` on Ask Alis, so focus never falls to the page. Focusing Ask Alis from the keyboard opens the composer.
371
+ - **Ask Alis on a selection**: on `selectionchange`, show `.app-selection-ask` for a selection that isn't empty, inside the content, and outside a field, an editor, a `contenteditable`, the composer, a dialog and `[data-no-ask]`. Read the selection's text and rectangle when you show it, and stop `pointerdown` on the pill from collapsing it. On press, put the text in the tray as the quote, clear the selection, open the composer and focus the editor. On send, put the quote before the message as a Markdown quote (`> ` before every line, then a blank line).
309
372
 
310
373
  ## Classes
311
374
 
312
- `.app-composer`, `.app-composer__audience`, `.is-locked`, `.app-composer__go--plain`, `.is-alis`, `.is-muted`, `.app-composer__light`, `.app-composer__box`, `.app-composer__tray`, `.app-composer__drop`, `.app-composer__editor`, `.app-composer__input`, `.app-composer__interim`, `.app-composer__row`, `.app-composer__spacer`, `.app-composer__go`, `.app-composer__go-label`, `.app-composer__rec`, `.app-composer__meter`, `.app-composer__timer`, `.app-composer__capture`, `.is-paused`, `.app-composer__capture-label`, `.app-capture-thumb`, `.is-empty`, `.app-capture-peek`, `.app-capture-peek__head`, `.app-capture-peek__title`, `.app-capture-peek__frame`, `.app-capture-peek__note`, `.app-composer__status`, `.app-composer__line`, `.is-error`, `.app-composer__line-action`, with `.drop-target` on the drop, `.app-state` on every button, `.app-target` on the icon buttons and the capture bar's buttons, `.app-btn--error` on Stop recording, and `.app-compact-only` on Pause's glyph.
375
+ `.app-composer`, `.app-icon-swap`, `.is-swapped`, `.app-composer__audience`, `.is-locked`, `.app-composer__go--plain`, `.is-alis`, `.is-muted`, `.app-composer__light`, `.app-composer__box`, `.app-composer__tray`, `.app-composer__drop`, `.app-composer__editor`, `.app-composer__input`, `.app-composer__interim`, `.app-composer__row`, `.app-composer__spacer`, `.app-composer__go`, `.app-composer__go-label`, `.app-composer__rec`, `.app-composer__meter`, `.app-composer__timer`, `.app-composer__capture`, `.is-paused`, `.app-composer__capture-label`, `.app-capture-thumb`, `.is-empty`, `.app-capture-peek`, `.app-capture-peek__head`, `.app-capture-peek__title`, `.app-capture-peek__frame`, `.app-capture-peek__note`, `.app-composer__status`, `.app-composer__line`, `.is-error`, `.app-composer__line-action`, `.app-dock`, `.app-composer__lift`, `.is-settled`, `.app-composer__trace`, `.app-composer__quote`, `.app-composer__quote-text`, `.app-selection-ask`, with `.drop-target` on the drop, `.app-state` on every button, `.app-target` on the icon buttons and the capture bar's buttons, `.app-btn--error` on Stop recording, and `.app-compact-only` on Pause's glyph.
@@ -85,7 +85,7 @@ A dialog: `surface-container-high` (white in light) at `elevation-3`, an object-
85
85
  - **Open**: remember `document.activeElement`, then focus the first focusable element inside the dialog (the first field, else the first action, which is Cancel), or a chosen element; fall back to the dialog itself (`tabindex="-1"`).
86
86
  - **Trap focus**: on Tab from the last focusable element go to the first, and on Shift+Tab from the first go to the last.
87
87
  - **Close** on Escape, on a press of the scrim itself (`mousedown` whose target is the `.app-scrim`, not the dialog), and on Cancel. A persistent dialog (a form) ignores Escape and the scrim.
88
- - **On close**: remove the scrim and return focus to the remembered element if it is still in the document.
88
+ - **On close**: set `hidden` on the scrim and remove it after `--spring-fast-effects-duration`, so it fades ([motion.md](../rules/motion.md)); return focus to the remembered element if it is still in the document.
89
89
  - Mount one dialog at a time.
90
90
  - **Signed out**: Sign in again opens sign-in in a new tab from the click itself; where the tab is blocked, reload through sign-in instead. Close the dialog when that tab reports back, or when the window regains focus and the session is back. Back as someone else, reload the page.
91
91
  - **Asking for access**: Send request shows its work on the button; on success close the dialog, return focus to where the request's state now stands, and replace the control that opened it with that state. A failure stays in the dialog as an error alert at its top, with the note still there ([errors.md](../rules/errors.md)).
@@ -52,7 +52,7 @@ Detail most people don't need, folded under its title: press the title and it op
52
52
 
53
53
  ## Behaviour you must supply
54
54
 
55
- - None: the native `<details>` opens, closes, takes Enter and Space, and announces its state. Add `open` to start one open.
55
+ - None: the native `<details>` opens, closes, takes Enter and Space, and announces its state. Add `open` to start one open. It opens to its height and its contents fade in once there's room (the CSS does it).
56
56
  - **Remember** what a person opened for as long as they stay on the screen; a refetch never closes it.
57
57
  - **A field with an error inside a closed one**: open it before focusing the field.
58
58
 
@@ -11,7 +11,7 @@ See [page.md](../rules/page.md).
11
11
  - It takes the drafting field, one per screen. In `.app-shell__content` or the detail pane the field bleeds to the pane's edges (the CSS cancels the pane padding). Where the list pane and the detail pane are both empty, the detail pane takes the field and the list pane's empty state goes without it.
12
12
  - Keep the title bar's name and verb; hide search and the filter row.
13
13
  - A detail pane with nothing open, beside a list that has items, takes it without a button: choosing from the list is the first step, and the bar already holds New. Its headline says what opens here.
14
- - It sits in the centre of the pane, from the title bar's foot to the window's, as the pane's only content: a view switch or a drop hint goes with the list, and a docked composer floats over the pane rather than shortening it. `.app-empty` centres itself in what it is given, so give it the whole pane.
14
+ - It sits in the centre of the pane, from the title bar's foot to the window's, as the pane's only content: a view switch or a drop hint goes with the list, and a docked composer keeps its own height at the foot, so the empty state centres in the space above it. `.app-empty` centres itself in what it is given, so give it the whole pane.
15
15
  - **A pane that can't show its content** (it couldn't load, they may not open it, it isn't there) is this same block without the drafting field: a headline in ink that says what couldn't happen, one line that says what to do, one outlined action. Never red: nothing they did failed. In a detail pane or a card the headline is `text-section-title`. The words for each case are in [errors.md](../rules/errors.md).
16
16
  - **When the person's role can't do what the button did** ([access.md](../rules/access.md) § A role): the headline stays, the line says who can and who to ask ("Only Editors can create interviews. Ask Ruan Spies for Editor access."), and the action is Request access, outlined, with no glyph. Where the product can't send a request, there is no button. After they send one, the button is replaced by the request's state (`.app-access-line`): "Request sent · Waiting for Ruan Spies", or "Declined by Ruan Spies: …" with Request again. Never the drafting field: this isn't an invitation.
17
17
  - **One section that couldn't load** is an empty line with Try again beside it (`.app-empty-line__action`); the rest of the screen stays.
@@ -45,8 +45,9 @@ A 20px glyph in a 40px box that performs one action.
45
45
 
46
46
  - `aria-label` and the [AppTooltip](AppTooltip.md) carry the same label. Older markup in these guides shows it as `title`; render the tooltip instead.
47
47
  - A shortcut: its keys in the tooltip and `aria-keyshortcuts` on the button ([shortcuts.md](../rules/shortcuts.md)).
48
- - A toggle: on press flip `aria-pressed`, `is-selected` on the button and `app-icon--filled` on the glyph together. A plain action never has `aria-pressed`.
48
+ - A toggle: on press flip `aria-pressed`, `is-selected` on the button and `app-icon--filled` on the glyph together. A plain action never has `aria-pressed`. Turning on, the glyph gives under the press and springs back filled (the CSS does it).
49
+ - **A glyph that changes its meaning** (Copy to ✓ for about two seconds, Send to Stop): put both in `<span class="app-icon-swap" aria-hidden="true">`, the one at rest first, and toggle `is-swapped`; the first turns away as the second springs in. Change the accessible name with it.
49
50
 
50
51
  ## Classes
51
52
 
52
- `.app-icon-btn`, `.app-icon-btn--small`, `.is-selected`, with `.app-state .app-target`.
53
+ `.app-icon-btn`, `.app-icon-btn--small`, `.is-selected`; `.app-icon-swap`, `.is-swapped`; with `.app-state .app-target`.
@@ -99,7 +99,9 @@ Order inside the row: icon, text, trailing, meta.
99
99
  - Focus lands on the hit; the CSS draws the focus ring on the whole row.
100
100
  - **Field row**: on press, replace the row with its edit form in place (labels above, Cancel and Save on the trailing edge; Save is filled unless the screen already holds its one filled action, as a review before publishing does), one field at a time; on save or cancel, show the row again and return focus to its hit. The hit's accessible name is the verb and the name ("Edit length").
101
101
  - Controls in the trailing slot are siblings of the hit, never inside it.
102
+ - **A row that arrives while the list is open** (a new response, a ticket) is rendered with `is-arriving`: it opens its space and is tinted for a moment. Never on the rows a page draws when it loads; take it off after about a second.
103
+ - **A row that leaves**: add `is-leaving`, then remove it once it has gone ([motion.md](../rules/motion.md) § Removing what has left); it folds away and the rows below close up.
102
104
 
103
105
  ## Classes
104
106
 
105
- `.app-list`, `.app-row`, `.app-row--nav`, `.app-row--agent-chat`, `.app-row--divided`, `.app-list--fields`, `.app-row--field`, `.is-selected`, `.app-row__icon`, `.app-row__text`, `.app-row__hit`, `.app-row__trailing`, `.app-row__meta`, `.app-nav-heading`, with `.app-state` on every row.
107
+ `.app-list`, `.app-row`, `.app-row--nav`, `.app-row--agent-chat`, `.app-row--divided`, `.app-list--fields`, `.app-row--field`, `.is-selected`, `.is-arriving`, `.is-leaving`, `.app-row__icon`, `.app-row__text`, `.app-row__hit`, `.app-row__trailing`, `.app-row__meta`, `.app-nav-heading`, with `.app-state` on every row.
@@ -87,7 +87,7 @@ What you chose from `/` or `@` becomes **one token in the sentence** (`.app-toke
87
87
 
88
88
  ## Behaviour you must supply
89
89
 
90
- - **Place an action menu** 4 below its trigger, its start edge on the trigger's start (its end edge for a trigger at the end of a row), flipping above when there isn't room; the composer's Add opens upward. Toggle `hidden` and the trigger's `aria-expanded`.
90
+ - **Place an action menu** 4 below its trigger, its start edge on the trigger's start (its end edge for a trigger at the end of a row), flipping above when there isn't room; the composer's Add opens upward. A menu above its trigger takes `app-menu--above` (the composer's bands already do). Toggle `hidden` and the trigger's `aria-expanded`: it grows out of its trigger and leaves as a fade ([motion.md](../rules/motion.md)).
91
91
  - **Action menu keys**: Up and Down move and wrap, Home and End, a letter jumps to the next item starting with it, Enter or Space chooses, Escape closes and returns focus to the trigger, Tab closes. Down or Up on the trigger opens it on the first or last item. A press outside closes it.
92
92
  - **Suggestion menu keys**, on the editor only (never a window listener): Up and Down move `is-active` and `aria-activedescendant`, Enter or Tab chooses, Escape closes. Ignore keys while `isComposing`. Stop the keys you handle from reaching anything else.
93
93
  - **Triggers**: `/` at the start of the message only, `@` at the start or after a space; filter as you type; close when a space follows no match.
@@ -97,4 +97,4 @@ What you chose from `/` or `@` becomes **one token in the sentence** (`.app-toke
97
97
 
98
98
  ## Classes
99
99
 
100
- `.app-menu`, `.app-menu--suggest`, `.app-menu__heading`, `.app-menu__divider`, `.app-menu__item`, `.app-menu__item--danger`, `.is-active`, `.is-selected`, `.app-menu__text`, `.app-menu__support`, `.app-menu__hint`, `.app-menu__avatar`, `.app-menu__empty`; `.app-token`; with `.app-state` on every item and `.app-loader.app-loader--line` on the searching line.
100
+ `.app-menu`, `.app-menu--above`, `.app-menu--suggest`, `.app-menu__heading`, `.app-menu__divider`, `.app-menu__item`, `.app-menu__item--danger`, `.is-active`, `.is-selected`, `.app-menu__text`, `.app-menu__support`, `.app-menu__hint`, `.app-menu__avatar`, `.app-menu__empty`; `.app-token`; with `.app-state` on every item and `.app-loader.app-loader--line` on the searching line.
@@ -29,9 +29,10 @@ See [selection.md](../rules/selection.md).
29
29
  ## Behaviour you must supply
30
30
 
31
31
  - On press move `is-selected` and `aria-checked="true"` to the pressed segment (and `app-icon--filled` to its icon), clear them on the rest, and re-parameterise the content.
32
+ - **The selection travels**: set `--indicator-left` and `--indicator-width` on the `.app-seg` to the selected segment's `offsetLeft` and `offsetWidth`, then add `app-seg--travel` (in that order, or it grows in on every load); set them again when the choice changes or the fonts load.
32
33
  - The group needs an `aria-label`.
33
34
  - A radiogroup expects one tab stop and arrow keys: `tabindex="0"` on the checked segment, `-1` on the rest, Arrow keys move the choice.
34
35
 
35
36
  ## Classes
36
37
 
37
- `.app-seg`, `.app-seg__item`, `.is-selected`, with `.app-state`.
38
+ `.app-seg`, `.app-seg--travel`, `.app-seg__item`, `.is-selected`, with `.app-state`.
@@ -148,9 +148,10 @@ Usage lives here, never in a title bar: it measures the account, not the screen
148
148
 
149
149
  ## Behaviour you must supply
150
150
 
151
- - Add `app-shell--detail` and the `<aside>` only while something is selected; remove both when the detail pane closes, and return focus to the row that opened it.
151
+ - Add `app-shell--detail` and the `<aside>` only while something is selected, the `<aside>` rendered with `is-arriving` when someone opens it (not when a page loads with it open): the pane comes in from the right and the content narrows. To close, remove `app-shell--detail`, then the `<aside>` once it has gone ([motion.md](../rules/motion.md) § Removing what has left), so the pane goes back over the edge; return focus to the row that opened it.
152
152
  - When the rail runs long, scroll only the region after the product groups (the agent chat list); the brand, the groups and the foot stay put.
153
- - **The drawer** (below 600px): the title bar's menu button (`aria-expanded`, `aria-controls` on the nav) adds `app-shell--nav-open`. While it's open, make `.app-shell__main` `inert` and move focus to its close. It closes from its close, on a route change and on Escape, and focus returns to the menu button. Remove the class at 600px and up.
153
+ - **The drawer** (below 600px): the title bar's menu button (`aria-expanded`, `aria-controls` on the nav) adds `app-shell--nav-open`. While it's open, make `.app-shell__main` `inert` and move focus to its close. It closes from its close, on a route change and on Escape, and focus returns to the menu button. Remove the class at 600px and up. It comes in from the left by itself.
154
+ - **Changing page**: run the route change in a view transition, forward, back or neither ([motion.md](../rules/motion.md) § Changing page). The content is `app-content`; nothing else takes that name.
154
155
  - **The detail pane's history**: opening it pushes a history entry with its parameter; choosing another row while it's open replaces that entry, so back doesn't step through every row you looked at; close goes back. At every width.
155
156
  - The account card opens the account menu (toggle `aria-expanded`).
156
157
  - No photo: the person's initials ([AppAvatar](AppAvatar.md)) in `<span class="app-account__avatar text-label" aria-hidden="true">RS</span>`.
@@ -160,4 +161,4 @@ Usage lives here, never in a title bar: it measures the account, not the screen
160
161
 
161
162
  ## Classes
162
163
 
163
- `.app-shell`, `.app-shell--detail`, `.app-shell__nav`, `.app-shell__nav-foot`, `.app-shell__main`, `.app-shell__content`, `.app-shell__detail`; `.app-shell--nav-open`, `.app-shell__nav-close`; `.app-brand`, `.app-brand__wordmark`; `.app-nav-heading`, `.app-nav-secondary`; `.app-nav-switcher`, `.app-nav-switcher__text`, `.app-nav-switcher__kind`; `.app-account`, `.app-account__avatar`, `.app-account__text`.
164
+ `.app-shell`, `.app-shell--detail`, `.app-shell__nav`, `.app-shell__nav-foot`, `.app-shell__main`, `.app-shell__content`, `.app-shell__detail`, `.is-arriving`; `.app-shell--nav-open`, `.app-shell__nav-close`; `.app-brand`, `.app-brand__wordmark`; `.app-nav-heading`, `.app-nav-secondary`; `.app-nav-switcher`, `.app-nav-switcher__text`, `.app-nav-switcher__kind`; `.app-account`, `.app-account__avatar`, `.app-account__text`.
@@ -142,11 +142,12 @@ The tabs scroll under it; the filter row is unchanged. Mark the parts that exist
142
142
  - **Search**: filter as the user types a list you already hold; where the search goes to a server, run it on Enter and say so in the placeholder. Show the clear button only while the input has a value; clear empties the input, re-filters and returns focus to the input. Keep the query in the URL (`?q=`), so back, refresh and a shared link keep it.
143
143
  - **`/`** puts focus in the screen's search field from anywhere on the screen, except while focus is in another field ([shortcuts.md](../rules/shortcuts.md)). A section's or a pane's own search has no `/` and no cap: one field per screen answers to it.
144
144
  - **The count** answers the row: the total at rest, "2 of 5" while a query or a filter narrows.
145
- - **Tabs**: they are routes. Move `is-selected` and `aria-current="page"` to the current tab when the route changes. If your router renders links, `<a class="app-tab app-state" href="…">` takes the same classes.
145
+ - **Tabs**: they are routes. Move `is-selected` and `aria-current="page"` to the current tab when the route changes. If your router renders links, `<a class="app-tab app-state" href="…">` takes the same classes. The panel changes as a page does, with no type ([motion.md](../rules/motion.md) § Changing page).
146
+ - **The indicator travels** to the new tab: set `--indicator-left` and `--indicator-width` on the `.app-tabs` to the selected tab's `offsetLeft` and `offsetWidth`, then add `app-tabs--travel` (in that order, or it grows in from the start on every load); set them again when the tab changes, the fonts load or the bar resizes.
146
147
  - Hide search and the filter row when the list is empty.
147
148
  - **The role chip**: draw it only once the role is known, with the verbs ([access.md](../rules/access.md) § Before it is known). Pressing it opens Sharing; when the role changes (a request granted), remove it and draw the verbs the new role allows.
148
149
  - **`is-scrolled`** on the bar while what scrolls under it has left the top (its `scrollTop` is above 0), and off again at the top. Where the bar scrolls away with the page, nothing is under it: leave it off.
149
150
 
150
151
  ## Classes
151
152
 
152
- `.app-titlebar`, `.app-titlebar--detail`, `.app-titlebar__row`, `.app-titlebar__name`, `.app-titlebar__leading`, `.app-titlebar__title`, `.app-titlebar__actions`, `.app-titlebar__lead`, `.app-titlebar__label`, `.app-titlebar__role`, `.is-scrolled`; `.app-compact-only`, `.app-wide-only`; `.app-tabs`, `.app-tab`, `.is-selected`; `.app-filterrow`, `.app-filterrow__search`, `.app-filterrow__controls`, `.app-filterrow__summary`; `.app-search`, `.app-search__input`, `.app-search__clear`.
153
+ `.app-titlebar`, `.app-titlebar--detail`, `.app-titlebar__row`, `.app-titlebar__name`, `.app-titlebar__leading`, `.app-titlebar__title`, `.app-titlebar__actions`, `.app-titlebar__lead`, `.app-titlebar__label`, `.app-titlebar__role`, `.is-scrolled`; `.app-compact-only`, `.app-wide-only`; `.app-tabs`, `.app-tabs--travel`, `.app-tab`, `.is-selected`; `.app-filterrow`, `.app-filterrow__search`, `.app-filterrow__controls`, `.app-filterrow__summary`; `.app-search`, `.app-search__input`, `.app-search__clear`.
@@ -40,7 +40,7 @@ Names a control that shows no words, and carries its keys ([shortcuts.md](../rul
40
40
  - **Open** 200ms after the pointer rests on the control, or at once when it takes keyboard focus. Once one tooltip is open, the next opens at once while the pointer moves along a row of controls.
41
41
  - **Close** when the pointer leaves or focus moves, when the control is pressed, when the page scrolls, and on Escape.
42
42
  - **Place it** with `position: fixed` against the control's box; flip above near the window's bottom.
43
- - **Render it once**, near the end of the document or in a portal, so a scrolling pane or an `overflow: hidden` parent can't clip it. Toggle `hidden`.
43
+ - **Render it once**, near the end of the document or in a portal, so a scrolling pane or an `overflow: hidden` parent can't clip it. Toggle `hidden`: it fades in and out by itself.
44
44
  - **Assistive technology** already has the label (`aria-label`) and the keys (`aria-keyshortcuts`), so don't point `aria-describedby` at the tooltip unless it says more than the label, as a truncated name's full text does.
45
45
 
46
46
  ## Classes
@@ -45,7 +45,7 @@ One turn in a conversation, in an `.app-thread`. **You write in a bubble; Alis w
45
45
  ## What you send
46
46
 
47
47
  - **What it was about**: when the composer's context chip went with your message, a meta line above your bubble names it, in `on-surface-variant` (`.app-turn__about`): "About pricing.html". The chip as it was when you sent, so the thread says what you pointed at. Never the page you were on: that went as references and isn't shown.
48
- - **Files and things** keep their [AppAttachment](AppAttachment.md) tile from the tray, without remove, stacked right above your bubble; the tile opens what it names. A thing shared into the conversation (a meeting, its notes, an interview, diagnostics, a skill, an issue, an agent session) is the same tile, never a card with a button in it. An image shows itself, 240 wide. A file or a thing sent alone is a turn with no bubble.
48
+ - **Files and things** keep their [AppAttachment](AppAttachment.md) tile from the tray, without remove, stacked right above your bubble; the tile opens what it names. A thing shared into the conversation (a meeting, its notes, an interview, diagnostics, a skill, an issue, an agent session) is the same tile, never a card with a button in it. An image shows itself, 240 wide. A file or a thing sent alone is a turn with no bubble. A quote of the page you asked about ([AppComposer](AppComposer.md) § Asking about what you selected) is the same: its tile, without remove, above your bubble.
49
49
  - **A voice note** is its own bubble (`.app-voice-note`): play, the waveform (played in `primary`, the rest in `outline`) and the time, then the transcript in body, three lines and Show all. The transcript is what Alis acted on, so a misheard word is in plain sight.
50
50
 
51
51
  ## People in the thread
@@ -163,7 +163,7 @@ Northwind 120 —</pre></li>
163
163
  <!-- Thinking: the mark animates; the status names the step -->
164
164
  <div class="app-turn__head">
165
165
  <span class="app-turn__mark app-loader app-loader--line" aria-hidden="true"><svg …></svg></span>
166
- <span class="app-turn__status text-supporting" role="status">Reading 14 interview transcripts</span>
166
+ <span class="app-turn__status text-supporting" role="status"><span>Reading 14 interview transcripts</span></span>
167
167
  </div>
168
168
 
169
169
  <!-- Writing: the caret follows the last word -->
@@ -236,11 +236,15 @@ Northwind 120 —</pre></li>
236
236
  - **The disclosure**: toggle `aria-expanded` and the steps' `hidden`.
237
237
  - **Your bubble**: put the text straight into the element with no whitespace around it; line breaks are kept.
238
238
  - **A voice note**: drive `is-played` on the bars as it plays, swap `play_arrow` and `pause` (and the label); Show all toggles `is-open` and reads Show less.
239
- - **Thumbs**: one at a time; set `aria-pressed`, `is-selected` and `app-icon--filled` on the one given.
239
+ - **Thumbs**: one at a time; set `aria-pressed`, `is-selected` and `app-icon--filled` on the one given. The glyph gives under the press and springs back filled (the CSS does it).
240
+ - **Copy**: the glyph sits in `.app-icon-swap` with ✓ second; `is-swapped` and "Copied" as its name for about two seconds ([AppIconButton](AppIconButton.md)).
241
+ - **A turn that arrives while the thread is open** is rendered with `is-arriving`: yours rises out of the composer as you send it, Alis's and a person's fade in. Never on the turns drawn when the thread loads; take it off after about a second.
242
+ - **The status**: keep `.app-turn__status` for the whole wait (it is a live region, and a new one isn't reliably announced) and put each step's words in a new `<span>` inside it, so each fades in where the last one was.
243
+ - **As the reply streams**, wrap each run of text as it arrives in `<span class="app-turn__chunk">`, so it fades in where it lands. A renderer that redraws the whole reply on every run leaves it out, or the reply would fade in again each time.
240
244
  - **On a phone**, a long press on a turn opens its actions as a menu.
241
245
  - Keep the thread pinned to the bottom while Alis writes, unless the person has scrolled up. Keep it there too when the space it has shrinks (the keyboard opening on a phone, the composer growing), if its end was in view: the latest question is what the person is answering.
242
246
  - **People**: insert the day line before the first turn of each day; move *Seen* to the newest of your bubbles anyone has read; show the typing line while they type and drop it when their turn arrives; keep a request's state line in step with the request; write typing (once, as it starts) and each request change into the thread's status region.
243
247
 
244
248
  ## Classes
245
249
 
246
- `.app-thread`, `.app-thread__event`, `.app-thread__typing`, `.app-thread__status`; `.app-turn`, `.app-turn--you`, `.app-turn--alis`, `.app-turn--them`, `.is-latest`; `.app-turn__about`, `.app-turn__who`, `.app-turn__audience`, `.app-turn__avatar`, `.app-turn__avatar--alis`; `.app-turn__head`, `.app-turn__mark`, `.app-turn__status`, `.app-turn__worked`, `.app-turn__steps`, `.app-turn__step`, `.app-turn__output`, `.app-turn__caret`; `.app-turn__row`, `.app-turn__bubble`, `.app-turn__bubble--voice`, `.app-turn__tools`, `.app-turn__files`, `.app-turn__image`; `.app-turn__foot`; `.app-turn__line`, `.is-error`, `.app-turn__line-action`; `.app-turn__record`; `.app-turn__request`; `.app-voice-note`, `.is-open`, `.app-voice-note__player`, `.app-voice-note__wave`, `.is-played`, `.app-voice-note__time`, `.app-voice-note__transcript`, `.app-voice-note__more`; with `.prose` on the reply, `.app-icon-btn` and `.app-state` on the buttons, and `.app-loader.app-loader--line` on the mark while Alis thinks.
250
+ `.app-thread`, `.app-thread__event`, `.app-thread__typing`, `.app-thread__status`; `.app-turn`, `.app-turn--you`, `.app-turn--alis`, `.app-turn--them`, `.is-latest`, `.is-arriving`; `.app-turn__about`, `.app-turn__who`, `.app-turn__audience`, `.app-turn__avatar`, `.app-turn__avatar--alis`; `.app-turn__head`, `.app-turn__mark`, `.app-turn__status`, `.app-turn__worked`, `.app-turn__steps`, `.app-turn__step`, `.app-turn__output`, `.app-turn__caret`, `.app-turn__chunk`; `.app-turn__row`, `.app-turn__bubble`, `.app-turn__bubble--voice`, `.app-turn__tools`, `.app-turn__files`, `.app-turn__image`; `.app-turn__foot`; `.app-turn__line`, `.is-error`, `.app-turn__line-action`; `.app-turn__record`; `.app-turn__request`; `.app-voice-note`, `.is-open`, `.app-voice-note__player`, `.app-voice-note__wave`, `.is-played`, `.app-voice-note__time`, `.app-voice-note__transcript`, `.app-voice-note__more`; with `.prose` on the reply, `.app-icon-btn` and `.app-state` on the buttons, and `.app-loader.app-loader--line` on the mark while Alis thinks.
@@ -37,7 +37,7 @@ Shared conventions: `app-state` gives anything pressable its hover, focus and pr
37
37
  | AppCard | Statement and instrument surfaces | [AppCard.md](AppCard.md) |
38
38
  | AppDisclosure | Detail few people need, folded under its title | [AppDisclosure.md](AppDisclosure.md) |
39
39
  | AppLattice | Content you read; the transcript and `.prose` | [AppLattice.md](AppLattice.md) |
40
- | AppComposer | Where you write to Alis, an agent or a person; voice and live calls | [AppComposer.md](AppComposer.md) |
40
+ | AppComposer | Where you write to Alis, an agent or a person; voice and live calls; docked at a page's foot as the way in, settling into Ask Alis | [AppComposer.md](AppComposer.md) |
41
41
  | AppCodeBlock | Code to read or copy, edged on its own ground; a command to run, on the machine ground | [AppCodeBlock.md](AppCodeBlock.md) |
42
42
  | AppAttachment | A file, a thing shared into the conversation, or a queued message, in the composer's tray and in the sent message | [AppAttachment.md](AppAttachment.md) |
43
43
  | AppVoiceView | A live call given the content area, or the screen on a phone | [AppVoiceView.md](AppVoiceView.md) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alis-build/design-system",
3
- "version": "0.47.0",
3
+ "version": "0.49.0",
4
4
  "description": "The AlisX design system for coding agents: tokens, product CSS, component markup, capability marks, words and rules.",
5
5
  "keywords": ["alisx", "design-system", "design-tokens", "css"],
6
6
  "homepage": "https://alisx.com",
package/rules/README.md CHANGED
@@ -23,6 +23,7 @@ Read only what the job needs.
23
23
  | [spacing.md](spacing.md) | The scale, targets, density |
24
24
  | [buttons.md](buttons.md) | Which button, and how many |
25
25
  | [selection.md](selection.md) | How a selected thing is drawn |
26
+ | [motion.md](motion.md) | The springs, which one moves what, reduced motion, changing page |
26
27
  | [chips-alerts.md](chips-alerts.md) | Chips, alerts, status |
27
28
  | [loading.md](loading.md) | Skeleton, loader, progress |
28
29
  | [errors.md](errors.md) | What shows when something fails, can't load, isn't allowed or isn't there |
package/rules/buttons.md CHANGED
@@ -240,7 +240,7 @@ The rest:
240
240
  § Weight). Verb first, sentence case, no full stop.
241
241
  - Groups sit in a row with `gap`.
242
242
  - **A filled button answers a press**: it scales to 97% and rounds to 12px over
243
- `dur-spatial` on `motion-spatial`, then settles. The button owns it: never on an
243
+ `spring-fast-spatial`, then springs back. The button owns it: never on an
244
244
  icon button, a tab or a disabled button, never under reduced motion, and a site
245
245
  never animates a press itself.
246
246
 
@@ -28,6 +28,12 @@ What the system doesn't decide yet, in one place. When you hit one, take the qui
28
28
  - `surface-variant` and `surface-container-highest` hold one value (`#E6E8EB`) for two jobs.
29
29
  - Long-form document surfaces have no ruled measure beyond 710px prose.
30
30
 
31
+ ## Motion
32
+
33
+ - **Gestures.** A swipe or a drag that lets go (the phone's navigation pane swiped shut, a row swiped to act on it, a row dragged to reorder) needs a spring that starts at the finger's speed, which CSS can't do. Until there is one, these move only on a press ([motion.md](motion.md)).
34
+ - **Motion tied to scrolling** (a phone's title bar condensing as you read) has no pattern yet.
35
+ - **Height** animates only in browsers with `interpolate-size`. Elsewhere a fold, an ask and an arriving row open at once and their contents still fade.
36
+
31
37
  ## Assets
32
38
 
33
39
  - No font files are vendored. `fonts.css` loads Nunito Sans and Material Symbols from Google Fonts, for prototypes; in production, self-host them (Material Symbols as the subset you use).
@@ -0,0 +1,154 @@
1
+ # Motion
2
+
3
+ **Every move is a spring.** A spring has a stiffness and a damping, never a
4
+ duration: it settles when it settles, and something interrupted mid-way carries
5
+ on from where it is. The springs are M3's motion physics. The system's components
6
+ already move; a site that moves something of its own picks a spring token, and
7
+ never writes a duration or a curve.
8
+
9
+ ## The springs
10
+
11
+ | Token | From M3 | Settles | Overshoot | For |
12
+ | --- | --- | --- | --- | --- |
13
+ | `spring-fast-spatial` | Expressive | 359ms | 9.5% | A control answering a touch in place: a press, a switch's handle, a toggle's glyph, an icon changing its meaning |
14
+ | `spring-default-spatial` | Expressive | 435ms | 1.5% | What covers part of the screen or travels across it: a menu, a dialog, a snackbar, a pane, a tab's indicator, a fold, a page's 24px shift |
15
+ | `spring-slow-spatial` | Standard | 484ms | 0.15%, too little to see | What fills the screen: the phone's navigation pane |
16
+ | `spring-fast-effects` | both | 150ms | never | Colour and opacity on a control, state layers, and every fade out |
17
+ | `spring-default-effects` | both | 231ms | never | Content fading in: a page, a tab's panel, a reply as it streams, a scrim |
18
+ | `spring-slow-effects` | both | 326ms | never | A slow colour change: the tint on a row that just arrived |
19
+
20
+ Each comes three ways: `--spring-fast-spatial` is the duration and the curve
21
+ together, for a `transition` or an `animation`; `--spring-fast-spatial-duration`
22
+ and `--spring-fast-spatial-easing` are the parts, for a delay, a timer, or a
23
+ property that takes them apart.
24
+
25
+ ```css
26
+ .thing { transition: opacity var(--spring-fast-effects), translate var(--spring-default-spatial); }
27
+ .thing.is-open { transition: opacity var(--spring-default-effects) var(--spring-fast-effects-duration); }
28
+ ```
29
+
30
+ The curve is CSS `linear()`, drawn from the spring itself, every wobble of it.
31
+
32
+ ## Which spring
33
+
34
+ - **What moves picks the kind.** Position, size, rotation, corners and a reveal are
35
+ spatial. Colour and opacity are effects. Something that shows a value (a
36
+ progress bar's width) moves on effects, so it never shows more than it means.
37
+ - **How much of the screen picks the speed.** Fast for a control, default for
38
+ anything up to a pane, slow for the whole screen.
39
+ - **The whole screen never bounces.** Fast and default spatial overshoot a little;
40
+ slow spatial comes from M3's Standard scheme and doesn't.
41
+ - **One transition, one spring.** The parts of a move share it: a chevron turns on
42
+ its fold's spring, not a faster one.
43
+
44
+ ## The rules
45
+
46
+ - **Reduced motion: movement becomes a fade.** Under `prefers-reduced-motion` the
47
+ spatial springs are `0s` and the effects springs stay, so things appear in place
48
+ and still fade, and nothing jump-cuts. The tokens do it; never zero a fade
49
+ yourself. A loop (a loader, a shimmer, a caret) holds still: wrap its
50
+ `animation` in `@media (prefers-reduced-motion: no-preference)`.
51
+ - **One direction.** Everything that moves in a transition moves along one axis.
52
+ - **Clean fades.** The old content fades out on fast effects, then the new fades in
53
+ on default effects, delayed by `--spring-fast-effects-duration`. Two contents are
54
+ never half visible at once.
55
+ - **Things come from where they live**, and leave the way they came: the detail pane
56
+ from the right edge, the phone's navigation pane from the left, the composer's
57
+ bands up out of the composer, a menu out of its trigger, a snackbar up from the
58
+ foot.
59
+ - **Leaving is quicker than arriving.** Something within the screen leaves as a
60
+ fade on fast effects, without moving. A pane goes back over its edge.
61
+ - **Grow, never scale.** A surface arrives by revealing itself along one axis (a
62
+ clip or a height). Scale belongs to a press and a glyph.
63
+ - **The layout holds still.** A skeleton holds the shape ([loading.md](loading.md));
64
+ a row that arrives opens its own space; nothing pops in or shoves.
65
+ - **Focus never animates.** The ring is there the moment the key is pressed.
66
+ - **Only the tokens.** No duration or curve of your own in a `transition` or an
67
+ `animation`; the check refuses one ([styling.md](styling.md)). A loop of your
68
+ own is a gap: say so where it is.
69
+ - **Timing that isn't a spring** belongs to its component: a tooltip opens after
70
+ the pointer rests ([AppTooltip](../components/AppTooltip.md)); ✓ stays about two
71
+ seconds ([buttons.md](buttons.md)).
72
+
73
+ ## What moves, and what the site does
74
+
75
+ The CSS hangs the motion off the state each component already has. Most of it
76
+ needs nothing from the site.
77
+
78
+ | Moment | The system | The site |
79
+ | --- | --- | --- |
80
+ | A press | The filled button gives and springs back ([buttons.md](buttons.md)) | Nothing |
81
+ | A toggle turning on | The glyph gives under the press and springs back filled | Flip `aria-pressed`, as it already does |
82
+ | An icon changing its meaning (Send to Stop, Copy to ✓) | `.app-icon-swap` turns one glyph away and springs the other in | Put both glyphs in it and toggle `is-swapped` ([AppIconButton](../components/AppIconButton.md)) |
83
+ | Selection that travels | `app-tabs--travel` and `app-seg--travel` draw one indicator that travels | Set `--indicator-left` and `--indicator-width` to the selected item's `offsetLeft` and `offsetWidth`, then add the modifier, so it is drawn in place and moves only on a change ([AppTitleBar](../components/AppTitleBar.md), [AppSegmented](../components/AppSegmented.md)) |
84
+ | Expand and collapse | A disclosure and a turn's steps open to their height, then their rows fade in | Toggle `open` or `hidden`, as already |
85
+ | A menu, tooltip, snackbar or dialog | Arrives growing out of where it lives; leaves as a fade when it's `hidden`. Nothing is clipped once it has arrived, so a field's panel inside it shows whole | Toggle `hidden`, or set it and remove the element once it has gone (§ Removing what has left). Removed at once, it just goes |
86
+ | Alis's ask | Grows up out of the composer | Render it with `is-arriving` when it opens while someone is there |
87
+ | The conversation | A turn that arrives fades in, and yours rises out of the composer; each status fades in; each run of a reply fades in as it lands | `is-arriving` on a turn that arrives while the thread is open; each step's words in a new element inside the one status; each arriving run in `.app-turn__chunk` ([AppTurn](../components/AppTurn.md)) |
88
+ | A list that changes | A row that arrives opens its space and is tinted for a moment; one that leaves folds away | `is-arriving` on a row that arrives while the list is open; `is-leaving`, then remove it once it has gone ([AppListRow](../components/AppListRow.md)) |
89
+ | The detail pane | Comes in from the right while the content narrows; slides over the content below 840, and on a phone, where it fills the screen, on the slow spring | Open it with `is-arriving` on the pane; to close, drop `app-shell--detail`, then remove the pane once it has gone ([AppShell](../components/AppShell.md)) |
90
+ | The phone's navigation pane | Comes in from the left on slow spatial | Nothing |
91
+ | Changing page | The content fades out, then in; forward it comes 24px from the end, back from the start | Run the route change in a view transition (below) |
92
+
93
+ `is-arriving` is for what arrives while someone is watching. Never on what a page
94
+ draws when it loads, which would all fly in at once. Render the element with it:
95
+ added once the element is on the page, it does nothing. Take it off after about a
96
+ second, or the arrival plays again if the list is hidden and shown.
97
+
98
+ A few things move when a page first draws them, because nothing can tell that
99
+ draw from an arrival: a menu, tooltip, snackbar or dialog shown at once, a turn's
100
+ steps or a disclosure's rows drawn open, and a status. Each is brief, and it is what they would do anyway.
101
+
102
+ ## Removing what has left
103
+
104
+ A thing that leaves stays on the page until it has gone, then the site removes it.
105
+ Wait for the longer of its move and its fade: under reduced motion the move is
106
+ 0ms and the fade isn't.
107
+
108
+ ```js
109
+ const springMs = (name) => parseFloat(getComputedStyle(document.documentElement).getPropertyValue(`--spring-${name}-duration`))
110
+ const gone = () => Math.max(springMs('default-spatial'), springMs('fast-effects'))
111
+ // close the detail pane
112
+ shell.classList.remove('app-shell--detail')
113
+ const timer = setTimeout(() => pane.remove(), gone())
114
+ ```
115
+
116
+ If it opens again before the timer fires, cancel the timer and put the class back:
117
+ the move turns round from where it is.
118
+
119
+ ## Changing page
120
+
121
+ The browser's view transitions do it. `.app-shell__content` is named
122
+ `app-content` and `.app-dock` is named `app-dock`; the rest of the shell, the title
123
+ bar included, changes in place. Give no other element those names.
124
+
125
+ ```js
126
+ // type: 'forward' going deeper (a list to one of its things), 'back' returning to
127
+ // where you came from, none between the navigation pane's destinations and a thing's tabs.
128
+ function changePage(update, type) {
129
+ if (!document.startViewTransition) return update()
130
+ try {
131
+ return document.startViewTransition({ update, types: type ? [type] : [] })
132
+ } catch {
133
+ return document.startViewTransition(update) // a browser that takes only the callback
134
+ }
135
+ }
136
+ ```
137
+
138
+ `update` renders the new page, or returns a promise that settles once it has. A
139
+ change that keeps the page (a filter, a query, a sort) is no transition. The
140
+ browser's own back and forward buttons run through it too: `back` when the entry
141
+ you arrive at is older than the one you left (keep its place in `history.state`),
142
+ `forward` when it is newer. A browser without view transitions changes at once;
143
+ one without their types fades without the shift. Two elements with one name stop
144
+ every transition, so a page renders one `.app-shell__content`.
145
+
146
+ **A container transform** (a tile opening into the file pane, the composer's trace
147
+ opening into the composer) is the same call with one `view-transition-name` on the
148
+ thing before and the thing after: the system's group timing morphs one into the
149
+ other on default spatial. It is for those moments, never a list row opening a page.
150
+
151
+ ## Not yet
152
+
153
+ Swiping and dragging (the drawer swiped shut, a row dragged to reorder) and motion
154
+ tied to scrolling ([known-gaps.md](known-gaps.md)).
package/rules/page.md CHANGED
@@ -240,8 +240,12 @@ leads its content with it, or leaves it out. What a failure shows, and where, is
240
240
  - **An empty state sits in the centre of its pane**, the space from the title
241
241
  bar's foot to the window's, so it is in the same place on every screen. It is
242
242
  the pane's only content: a view switch, a drop hint and anything else that
243
- works on the list go with the list, and a composer docked at the foot floats
244
- over the pane without taking its height.
243
+ works on the list go with the list. A composer docked at the foot keeps its own
244
+ height, and the empty state centres in the space above it.
245
+ - **A composer docked at the foot of a screen** is sticky, the last thing in the
246
+ content, so its own height keeps the page's last line clear, and it settles
247
+ into Ask Alis while you read down ([AppComposer](../components/AppComposer.md)
248
+ § Docked as a way in). A page never adds its own space for it.
245
249
  - **An empty state that fills its pane speaks to the user**
246
250
  ([AppEmptyState](../components/AppEmptyState.md)). Its headline says why you
247
251
  would act and never repeats the screen's name: "Hear from the people closest to
@@ -45,6 +45,7 @@ AppShell
45
45
  | More actions behind `more_vert`, the composer's Add, `/` commands and `@` mentions | `AppMenu`: floating for actions, a band on the composer for suggestions; what you choose is an `.app-token` |
46
46
  | A task the person can do in their own agent (Claude, ChatGPT, Copilot…), with a way back | `AppHandOff`, one per screen: a list at the start of a create flow, a text button before the affirmative ("Plan it with Claude"), or a ⋯ row; each opens the steps |
47
47
  | Alis or a person needs an answer, an approval or a connection | `AppAsk`, docked on the composer of whoever decides; the conversation's row shows a `warning` "Needs you" chip and the rail an `.app-count` |
48
+ | The way in to Alis on a page that isn't a conversation (a list, a report, an artifact) | `AppComposer` in `.app-dock`, sticky and last in the content that scrolls, so the page needs no space of its own for it; it settles into Ask Alis while you read, and Ask Alis over a selection quotes it in the tray |
48
49
  | A recording that runs while you keep writing (a screen, through an interview) | `AppComposer`'s capture bar, docked on top of the composer and led by a live thumbnail; Stop recording in `error` ink, unfilled beside Send |
49
50
  | Content Alis wrote | a label `AppChip icon="auto_awesome"` "AI-generated", once, at its top |
50
51
  | The one action that moves the user forward | `AppButton variant="filled"`, once per screen, labelled with the outcome; never in the title bar |
package/rules/styling.md CHANGED
@@ -47,8 +47,9 @@ listed semantic roles and validated identity fields may change.
47
47
  any of these.
48
48
  - **Spacing**, only where the system's own spacing can't reach (a grid gap,
49
49
  inside a media query), and only on the scale.
50
- - **Motion.** Keyframes, transitions, animation, transform, opacity, using the
51
- duration and easing tokens. A colour inside a keyframe is still a role.
50
+ - **Motion.** Keyframes, transitions, animation, transform, translate, scale,
51
+ rotate, opacity, timed by the spring tokens: never a duration or a curve of your
52
+ own ([motion.md](motion.md)). A colour inside a keyframe is still a role.
52
53
  - **Drawing.** Fill, stroke and stop colour on SVG marks, from roles. A role at an
53
54
  alpha is allowed for an area or a band in a drawing, and for the `scrim` behind
54
55
  text on an image. **Nowhere else.**
package/rules/surfaces.md CHANGED
@@ -86,8 +86,9 @@ Why is this above the page?
86
86
 
87
87
  **Hover never lifts.** A clickable card's hover is its state layer.
88
88
 
89
- Transparency and blur appear in exactly four places: a floating nav pill, glass
90
- on a dark panel, a dialog backdrop, and the statement over a gradient.
89
+ Transparency and blur appear in exactly five places: a floating nav pill, glass
90
+ on a dark panel, a dialog backdrop, the statement over a gradient, and the ground
91
+ that fades the page out above a docked composer.
91
92
 
92
93
  **What floats takes `surface-container-high`**: a menu, the composer, a dialog,
93
94
  the detail pane when it slides over, a dragged card. In light it is white, the