@alis-build/design-system 0.11.2 → 0.12.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/alisx.css CHANGED
@@ -815,6 +815,37 @@ a.app-attachment{color:inherit;text-decoration:none}
815
815
  .app-token{display:inline;padding:2px 6px;margin:0 1px;border-radius:var(--radius-sm);background:var(--surface-container-highest);color:var(--on-surface);font-weight:600;white-space:nowrap;text-decoration:none;-webkit-box-decoration-break:clone;box-decoration-break:clone;user-select:all}
816
816
  .app-token>.app-icon{display:inline-block;font-size:1em;width:1em;height:1em;margin-right:var(--space-4);vertical-align:-0.125em;color:var(--on-surface-variant)}
817
817
  a.app-token,button.app-token{border:0;font:inherit;font-weight:600;cursor:pointer}
818
+ /* ── Keys · a shortcut, one cap per key (rules/shortcuts.md) ── */
819
+ .app-keys{display:inline-flex;align-items:center;gap:var(--space-4);flex:none;margin:0;font:inherit;vertical-align:middle;white-space:nowrap}
820
+ .app-key{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:20px;height:20px;padding:0 var(--space-4);border-radius:var(--radius-xs);background:var(--surface-container-highest);color:var(--on-surface-variant);font-family:var(--font-sans);font-size:12px;line-height:16px;font-weight:600;font-style:normal;font-variant-numeric:tabular-nums}
821
+ .app-keys__then{color:var(--on-surface-variant);font-family:var(--font-sans);font-size:12px;line-height:16px;font-weight:400}
822
+ /* What a screen reader says for caps it can't read aloud (⌘, ⇧): in the sheet and in prose */
823
+ .app-keys__said{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
824
+ /* On a grey field the cap lifts to white; the search field's key shows only while it is empty and unfocused */
825
+ .app-search .app-key{background:var(--surface)}
826
+ .app-search:focus-within>.app-keys,.app-search:has(>.app-search__input:not(:placeholder-shown))>.app-keys{display:none}
827
+ /* Single-key shortcuts off (set on the root): letter caps leave tooltips and menus, and dim in the sheet */
828
+ [data-single-keys="off"] .app-keys--single{display:none}
829
+ [data-single-keys="off"] .app-shortcuts .app-keys--single{display:inline-flex;opacity:.38}
830
+ .app-shortcuts[data-single-keys="off"] .app-keys--single{display:inline-flex;opacity:.38}
831
+ /* ── Tooltip · names a control and carries its keys: inverse, below, after 200ms ── */
832
+ .app-tooltip{position:fixed;z-index:40;display:inline-flex;align-items:center;gap:var(--space-8);max-width:240px;min-height:28px;box-sizing:border-box;margin:0;padding:var(--space-4) var(--space-8);border-radius:var(--radius-sm);background:var(--inverse-surface);color:var(--on-inverse-surface);font-family:var(--font-sans);font-size:12px;line-height:16px;font-weight:500;pointer-events:none}
833
+ .app-tooltip[hidden]{display:none}
834
+ .app-tooltip:has(>.app-keys:last-child){padding-right:var(--space-4)}
835
+ .app-tooltip .app-key{background:color-mix(in srgb,var(--on-inverse-surface) 16%,transparent);color:var(--on-inverse-surface)}
836
+ .app-tooltip .app-keys__then{color:inherit;opacity:.72}
837
+ [data-single-keys="off"] .app-tooltip:has(>.app-keys--single:last-child){padding-right:var(--space-8)}
838
+ /* ── Shortcut sheet · the keys of this screen, then everywhere; in the detail pane's place ── */
839
+ .app-shortcuts{display:flex;flex-direction:column;gap:var(--space-24);flex:1;min-height:0}
840
+ .app-shortcuts__group{display:flex;flex-direction:column;margin:0}
841
+ .app-shortcuts__heading{margin:0 0 var(--space-4);color:var(--on-surface-variant)}
842
+ .app-shortcuts__note{margin:0 0 var(--space-4);color:var(--on-surface-variant)}
843
+ .app-shortcuts__row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-16);min-height:36px}
844
+ .app-shortcuts__group>dl{margin:0}
845
+ .app-shortcuts__row>dt,.app-shortcuts__row>dd{margin:0}
846
+ .app-shortcuts__note[hidden]{display:none}
847
+ /* The foot stays in view while the groups scroll under it */
848
+ .app-shortcuts__foot{position:sticky;bottom:0;margin-top:auto;padding-top:var(--space-16);border-top:1px solid var(--outline-variant);background:var(--background)}
818
849
  /* ── Drop target, while something is dragged over it ── */
819
850
  .drop-target{outline:2px dashed var(--primary);outline-offset:-2px;background-color:color-mix(in srgb,var(--primary) calc(var(--state-dragged) * 100%),transparent)}
820
851
 
@@ -12,6 +12,7 @@ Emphasis is allocated, not chosen ([buttons.md](../rules/buttons.md)).
12
12
  - **Error** (`app-btn--error`) for destructive actions, at the same level. **Quiet** (`app-btn--quiet`, `on-surface-variant`) for a quiet action beside content.
13
13
  - No tonal or elevated buttons. A filled button scales to 97% and rounds to 12px when pressed (the CSS does it).
14
14
  - An icon only when the button sits in a set people scan, or `add` on a New or Add action wherever it sits ([buttons.md](../rules/buttons.md) § The form). No other icon on a filled or outlined button, and none on a dialog action.
15
+ - **A shortcut** never goes in the label. A button with one takes an [AppTooltip](AppTooltip.md) that says the label and its keys, and `aria-keyshortcuts` ([shortcuts.md](../rules/shortcuts.md)); a button without one has no tooltip.
15
16
  - The visible box is `control-height` (36px, 48 on touch), padded 24, and the target is `touch-target` ([buttons.md](../rules/buttons.md)). Text and outlined buttons are 600, the filled button 700. `app-btn--small` (32px, padded 12) belongs only in a table row. Inside a toggle group or table row, add `app-target--none`.
16
17
  - **Loading** shows the work on the control the user pressed: a 16px spinner replaces the icon and the label stays (or becomes the present participle, "Deploying"). The button is busy, not disabled: full colour, presses ignored until it settles.
17
18
  - Work with steps you can count (a deploy, an upload) moves its indicator into the content once it starts: an [AppProgress](AppProgress.md), and the button goes back to rest. One wait, one indicator ([loading.md](../rules/loading.md)).
@@ -131,7 +131,7 @@ Where you write to Alis, an agent or a person. One floating surface with three b
131
131
  ## Behaviour you must supply
132
132
 
133
133
  - **The state machine** above: swap the trailing button's glyph, `aria-label` and `title`, 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.
134
- - **Keyboard**, on the editor only (never a window listener): Enter sends; Shift+Enter adds a line; 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.
134
+ - **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.
135
135
  - **Auto-grow**: set the textarea's height to its `scrollHeight` on input; the editor caps it at eight lines and scrolls.
136
136
  - **Recording**: start on the mic (holding Space outside a text field is a shortcut), run the timer, drive the meter bars' heights from the input level (`aria-hidden`; hold them still under `prefers-reduced-motion`). Under about a second is too short.
137
137
  - **Live**: toggle `is-alis` on `.app-composer` while Alis speaks and `is-muted` while muted (and `aria-pressed` on the mute toggle); update the status word, which is a live region.
@@ -5,7 +5,7 @@ A 20px glyph in a 40px box that performs one action.
5
5
  ## Use / don't use
6
6
 
7
7
  - `on-surface-variant`, no fill, no border, no shadow, no product colour ([buttons.md](../rules/buttons.md)).
8
- - The label is required: it is the accessible name and the tooltip.
8
+ - The label is required: it is the accessible name and its [AppTooltip](AppTooltip.md), which carries the keys when it has a shortcut. No `title` as well: the browser would show a second tooltip.
9
9
  - An icon button is not a selection. The one exception is a **toggle** (on or off, and stays that way): selected, it takes the `secondary-container` fill with a filled glyph.
10
10
  - If it shows a word, use [AppButton](AppButton.md). If it does nothing on its own, it is an [AppIcon](AppIcon.md).
11
11
  - `app-icon-btn--small` (32px box; on touch its target still projects to 48) for the title bar's verbs and a detail pane's close. In a list row's trailing slot or a table cell the CSS shrinks it to 32px and drops the projected target for you.
@@ -13,11 +13,17 @@ A 20px glyph in a 40px box that performs one action.
13
13
  ## Markup
14
14
 
15
15
  ```html
16
- <!-- One action -->
17
- <button type="button" class="app-icon-btn app-state app-target" aria-label="More actions" title="More actions">
16
+ <!-- One action; its AppTooltip says "More actions" -->
17
+ <button type="button" class="app-icon-btn app-state app-target" aria-label="More actions">
18
18
  <span class="app-icon" aria-hidden="true">more_vert</span>
19
19
  </button>
20
20
 
21
+ <!-- With a shortcut: the tooltip carries the keys, the button says them to assistive technology -->
22
+ <button type="button" class="app-icon-btn app-state app-target" aria-label="Resolve conversation" aria-keyshortcuts="R">
23
+ <span class="app-icon" aria-hidden="true">check_circle</span>
24
+ </button>
25
+ <div class="app-tooltip" id="tt-3" role="tooltip" hidden>Resolve conversation <kbd class="app-keys app-keys--single" aria-hidden="true"><kbd class="app-key">R</kbd></kbd></div>
26
+
21
27
  <!-- Small (detail pane close, title bar) -->
22
28
  <button type="button" class="app-icon-btn app-state app-target app-icon-btn--small" aria-label="Close details" title="Close details">
23
29
  <span class="app-icon" aria-hidden="true">close</span>
@@ -36,7 +42,8 @@ A 20px glyph in a 40px box that performs one action.
36
42
 
37
43
  ## Behaviour you must supply
38
44
 
39
- - `aria-label` and `title` carry the same label.
45
+ - `aria-label` and the [AppTooltip](AppTooltip.md) carry the same label. Older markup in these guides shows it as `title`; render the tooltip instead.
46
+ - A shortcut: its keys in the tooltip and `aria-keyshortcuts` on the button ([shortcuts.md](../rules/shortcuts.md)).
40
47
  - 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`.
41
48
 
42
49
  ## Classes
@@ -0,0 +1,52 @@
1
+ # AppKeys
2
+
3
+ A keyboard shortcut, one cap per key, written for the platform ([shortcuts.md](../rules/shortcuts.md)).
4
+
5
+ ## Use / don't use
6
+
7
+ - **Where it goes**: after a label in an [AppTooltip](AppTooltip.md), in an [AppMenu](AppMenu.md) row's hint, at the end of the screen's search field, in the [AppShortcutSheet](AppShortcutSheet.md), and inline in prose that tells someone what to press.
8
+ - **Not a label.** Never inside a button, never in brackets, never on a line of its own under a composer or a picker.
9
+ - **One spelling.** ⌘ ⇧ ⌥ ⌃ on a Mac, Ctrl Shift Alt elsewhere; Enter, Esc, Tab, Space and Delete as words everywhere; arrows as arrows. Never a plus sign.
10
+ - **A capital takes Shift**: ⇧ U. A letter cap is always the capital.
11
+ - **A sequence** puts `then` between its keys: G then H.
12
+
13
+ ## Anatomy
14
+
15
+ | Part | What it is |
16
+ |---|---|
17
+ | **Cap** (`kbd.app-key`) | 20 tall, at least 20 wide, 4 either side of the text; `surface-container-highest` behind `on-surface-variant` at 12/16 600, tabular; `radius-xs`. No border, no shadow. On the search field it lifts to `surface`; on a tooltip it is the tooltip's ink at 16% |
18
+ | **Set** (`kbd.app-keys`) | The caps 4 apart, on the text's middle |
19
+ | **Then** | `.app-keys__then`, meta in `on-surface-variant`, between the keys of a sequence |
20
+ | **Said** | `.app-keys__said`: the keys in words for a screen reader, where the caps are content |
21
+
22
+ ## Markup
23
+
24
+ ```html
25
+ <!-- On a control (tooltip, menu row, search field): decoration; the control carries aria-keyshortcuts -->
26
+ <kbd class="app-keys" aria-hidden="true"><kbd class="app-key">⌘</kbd><kbd class="app-key">K</kbd></kbd>
27
+
28
+ <!-- The same shortcut on Windows and Linux -->
29
+ <kbd class="app-keys" aria-hidden="true"><kbd class="app-key">Ctrl</kbd><kbd class="app-key">K</kbd></kbd>
30
+
31
+ <!-- A single letter: --single, so it can leave when single-key shortcuts are off -->
32
+ <kbd class="app-keys app-keys--single" aria-hidden="true"><kbd class="app-key">R</kbd></kbd>
33
+
34
+ <!-- A capital, and a sequence -->
35
+ <kbd class="app-keys" aria-hidden="true"><kbd class="app-key">⇧</kbd><kbd class="app-key">U</kbd></kbd>
36
+ <kbd class="app-keys" aria-hidden="true"><kbd class="app-key">G</kbd><span class="app-keys__then">then</span><kbd class="app-key">H</kbd></kbd>
37
+
38
+ <!-- Content (the sheet, prose): the caps hidden, the keys said -->
39
+ <p class="text-body">Open PowerShell and press
40
+ <kbd class="app-keys" aria-hidden="true"><kbd class="app-key">Ctrl</kbd><kbd class="app-key">V</kbd></kbd><span class="app-keys__said">Control V</span>
41
+ to paste the command.</p>
42
+ ```
43
+
44
+ ## Behaviour you must supply
45
+
46
+ - **The platform**, detected once for the product (a Mac, or anything else), and every set written for it. A guide for another app writes that app's platform instead.
47
+ - **`app-keys--single`** on a set that is one letter with no modifier, so the product can hide it while single-key shortcuts are off (`data-single-keys="off"` on the root).
48
+ - **`aria-keyshortcuts`** on the control a set describes, in the platform's terms (`Meta+K` on a Mac, `Control+K` elsewhere; `R`; `Shift+U`).
49
+
50
+ ## Classes
51
+
52
+ `.app-keys` (`--single`), `.app-key`, `.app-keys__then`, `.app-keys__said`.
@@ -21,7 +21,7 @@ A list of acts or places that opens from a control or from what you type, and cl
21
21
  | **Surface** | White, `elevation-2`, `radius-lg` (16) with 8 inside, so a row's `radius-sm` (8) is concentric. 200 to 320 wide. The one list in the product that is white ([surfaces.md](../rules/surfaces.md)). A suggestion band has no surface of its own: it is the composer's, with a hairline under it, and its rows take the ask's `radius-md` |
22
22
  | **Row** | 40 tall (48 under a coarse pointer), the whole row the target. A 20px icon in `on-surface-variant` if any row in the menu has one; the label at 14/20 500, set by the menu, no role |
23
23
  | **Second line** | Meta, only when the label can't stand alone: who has access, what a command does, a person's role |
24
- | **Hint** | Trailing meta: a shortcut or a /name. Or `open_in_new` when the item leaves the app. Never a chevron |
24
+ | **Hint** | Trailing: a shortcut as an [AppKeys](AppKeys.md), or a /name in meta. Or `open_in_new` when the item leaves the app. Never a chevron |
25
25
  | **Heading** | `text-eyebrow`, only where groups need names (the Add menu's Commands; @'s People and Files). Otherwise a hairline divider alone separates groups |
26
26
  | **Checked** | Where you are or what's on (a view, a sort, a switcher): the `secondary-container` fill and a trailing `check`, text at 700 ([selection.md](../rules/selection.md)). One at a time unless the menu says otherwise |
27
27
  | **Danger** | An act that destroys: `error` ink, last, after a divider, once. It opens its confirmation dialog and never confirms inside the menu |
@@ -52,7 +52,7 @@ What you chose from `/` or `@` becomes **one token in the sentence** (`.app-toke
52
52
  <div class="app-menu" id="m-7" role="menu" aria-label="Renewal calls, round 2" hidden>
53
53
  <button type="button" class="app-menu__item app-state" role="menuitem"><span class="app-icon" aria-hidden="true">edit</span><span class="app-menu__text"><span>Rename</span></span></button>
54
54
  <button type="button" class="app-menu__item app-state" role="menuitem"><span class="app-icon" aria-hidden="true">person_add</span><span class="app-menu__text"><span>Share</span><span class="app-menu__support">Priya and 2 others have access</span></span></button>
55
- <button type="button" class="app-menu__item app-state" role="menuitem"><span class="app-icon" aria-hidden="true">link</span><span class="app-menu__text"><span>Copy link</span></span><span class="app-menu__hint">Ctrl L</span></button>
55
+ <button type="button" class="app-menu__item app-state" role="menuitem" aria-keyshortcuts="Shift+Meta+,"><span class="app-icon" aria-hidden="true">link</span><span class="app-menu__text"><span>Copy link</span></span><span class="app-menu__hint"><kbd class="app-keys" aria-hidden="true"><kbd class="app-key">⇧</kbd><kbd class="app-key">⌘</kbd><kbd class="app-key">,</kbd></kbd></span></button>
56
56
  <hr class="app-menu__divider">
57
57
  <button type="button" class="app-menu__item app-menu__item--danger app-state" role="menuitem"><span class="app-icon" aria-hidden="true">delete</span><span class="app-menu__text"><span>Delete round</span></span></button>
58
58
  </div>
@@ -93,6 +93,7 @@ What you chose from `/` or `@` becomes **one token in the sentence** (`.app-toke
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.
94
94
  - **Tokens**: insert them as non-editable atoms followed by a space; carry them through whatever the editor serializes to (a token must survive the round trip, never becoming plain text or a placeholder), and render them as links in the sent message.
95
95
  - **Checked items**: set `aria-checked`, `is-selected` and the trailing `check` together.
96
+ - **A shortcut**: the same keys the sheet lists, written for the platform, and `aria-keyshortcuts` on the row ([shortcuts.md](../rules/shortcuts.md)). The account menu ends its first group with **Keyboard shortcuts**, `?` as its hint, which opens the [AppShortcutSheet](AppShortcutSheet.md).
96
97
 
97
98
  ## Classes
98
99
 
@@ -10,13 +10,13 @@ See [surfaces.md](../rules/surfaces.md) and [page.md](../rules/page.md).
10
10
  - **Navigation pane** (`nav-width`, 256px), three regions:
11
11
  - **Top**, fixed: the brand (`.app-brand`), the AlisX wordmark linking Home. It is the way home from every rail.
12
12
  - **Middle**: app-wide destinations first (Home, Skill Store), then one group per product under an `.app-nav-heading` naming it ("Ideate", "Build"), its destinations as 36px nav [AppListRow](AppListRow.md)s sitting flush (no gap between rows). A heading names a product in `on-surface-variant`, and sets its own type: 12/16 at 500, sentence case, no tracking. Never an eyebrow. Whatever a screen adds after the groups (the agent chat list, under its own heading) follows them.
13
- - **Foot**, pinned: Support as one nav row, then the account card (`.app-account`): who is signed in and which account they are working in. The card opens the account menu; switching account happens there.
13
+ - **Foot**, pinned: Support as one nav row, then the account card (`.app-account`): who is signed in and which account they are working in. The card opens the account menu; switching account happens there, and its **Keyboard shortcuts** row opens the [AppShortcutSheet](AppShortcutSheet.md).
14
14
  - **A row's "new"** is a small [AppIconButton](AppIconButton.md) (`add`) in that row's trailing slot, with a tooltip naming it ("New project"), on rows whose destination can create.
15
15
  - **No action in the pane.** A screen's "new" is the outlined lead in its title bar ([AppTitleBar](AppTitleBar.md)); the navigation pane holds destinations, and a row's own "new" icon button.
16
16
  - **A contextual rail** (inside a project, an admin account, Support) keeps the brand and the foot and replaces the middle with that object's destinations. Open objects (the interviews you have open) are nav rows with `app-nav-secondary` under a heading.
17
17
  - The pane is permanent chrome, so selection there is `selection-chrome`. Which destinations each product lists is product content, not part of this system.
18
18
  - **Content**: an [AppTitleBar](AppTitleBar.md), then `.app-shell__content`, which pads 24 on every side (32 below) and fills the pane, holding the filter row and the list, table or document.
19
- - **Detail pane** (`detail-width`, 360px): what is selected in the content, led by a detail title bar. It sits on the ground behind a divider, never on a card, and scrolls on its own. Below 840px it slides over the content at `elevation-3`; below 600px the navigation collapses to a 72px column (the mark alone, destination icons, the account's avatar; headings, secondary rows and agent chats hide) and the detail pane covers the full width, over a scrim. The CSS does all of this.
19
+ - **Detail pane** (`detail-width`, 360px): what is selected in the content, led by a detail title bar. It sits on the ground behind a divider, never on a card, and scrolls on its own. The [AppShortcutSheet](AppShortcutSheet.md) opens in its place: the content narrows for it, or it covers an open detail pane until it closes. Below 840px it slides over the content at `elevation-3`; below 600px the navigation collapses to a 72px column (the mark alone, destination icons, the account's avatar; headings, secondary rows and agent chats hide) and the detail pane covers the full width, over a scrim. The CSS does all of this.
20
20
  - No pane is a white card. Panes are separated by an `outline-variant` divider, not by fill.
21
21
 
22
22
  ## Markup
@@ -0,0 +1,84 @@
1
+ # AppShortcutSheet
2
+
3
+ Every key the screen answers to, in the detail pane's place ([shortcuts.md](../rules/shortcuts.md)).
4
+
5
+ ## Use / don't use
6
+
7
+ - **One sheet for the product.** It opens from `?` on any screen and from a **Keyboard shortcuts** row in the account menu (with `?` as its hint). No screen builds its own list of keys or its own dialog for them.
8
+ - **Beside the work, never over it.** It takes the [AppShell](AppShell.md)'s detail pane: on a screen with no detail pane the content narrows for it; on a screen with one open, the sheet covers that pane until it closes and the pane returns. Below 840px it slides over the content like any detail pane. It has no scrim and takes no focus trap: every key it lists works while it is open.
9
+ - **This screen first.** A group named for what is open ("On this conversation", "On this list"), then **Everywhere**. A key that does nothing here is left out, not dimmed.
10
+ - **Not a settings page.** Its one control is the single-key switch.
11
+
12
+ ## Anatomy
13
+
14
+ | Part | What it is |
15
+ |---|---|
16
+ | **Bar** | An [AppTitleBar](AppTitleBar.md) `--detail`: the close icon button leading (its tooltip says Close, Esc), "Keyboard shortcuts" in section-title, no verbs |
17
+ | **Group** | A `text-eyebrow` heading, then a `<dl>` of rows; groups 24 apart |
18
+ | **Row** | 36 tall: what the key does in `text-body`, sentence case and short ("Resolve", "Search this screen"), and its [AppKeys](AppKeys.md) at the end. The verb a tooltip would use |
19
+ | **Note** | While single-key shortcuts are off, one meta line under the first group's heading: *Single-key shortcuts are off.* The letter caps dim to 38% |
20
+ | **Foot** | Pinned to the bottom behind a hairline: an [AppSwitch](AppSwitch.md), **Single-key shortcuts**, with one supporting line |
21
+
22
+ ## Markup
23
+
24
+ ```html
25
+ <aside class="app-shell__detail" aria-labelledby="ks-title">
26
+ <header class="app-titlebar app-titlebar--detail">
27
+ <div class="app-titlebar__row">
28
+ <div class="app-titlebar__name">
29
+ <span class="app-titlebar__leading">
30
+ <button type="button" class="app-icon-btn app-state app-target app-icon-btn--small" aria-label="Close" aria-keyshortcuts="Escape"><span class="app-icon" aria-hidden="true">close</span></button>
31
+ </span>
32
+ <h2 class="app-titlebar__title text-section-title" id="ks-title">Keyboard shortcuts</h2>
33
+ </div>
34
+ </div>
35
+ </header>
36
+
37
+ <div class="app-shortcuts">
38
+ <section class="app-shortcuts__group" aria-labelledby="ks-here">
39
+ <h3 class="app-shortcuts__heading text-eyebrow" id="ks-here">On this conversation</h3>
40
+ <p class="app-shortcuts__note text-meta" hidden>Single-key shortcuts are off.</p>
41
+ <dl>
42
+ <div class="app-shortcuts__row">
43
+ <dt class="text-body">Resolve</dt>
44
+ <dd><kbd class="app-keys app-keys--single" aria-hidden="true"><kbd class="app-key">R</kbd></kbd><span class="app-keys__said">R</span></dd>
45
+ </div>
46
+ <div class="app-shortcuts__row">
47
+ <dt class="text-body">Hand over</dt>
48
+ <dd><kbd class="app-keys" aria-hidden="true"><kbd class="app-key">⇧</kbd><kbd class="app-key">U</kbd></kbd><span class="app-keys__said">Shift U</span></dd>
49
+ </div>
50
+ </dl>
51
+ </section>
52
+
53
+ <section class="app-shortcuts__group" aria-labelledby="ks-all">
54
+ <h3 class="app-shortcuts__heading text-eyebrow" id="ks-all">Everywhere</h3>
55
+ <dl>
56
+ <div class="app-shortcuts__row"><dt class="text-body">Search this screen</dt><dd><kbd class="app-keys" aria-hidden="true"><kbd class="app-key">/</kbd></kbd><span class="app-keys__said">Slash</span></dd></div>
57
+ <div class="app-shortcuts__row"><dt class="text-body">Show these keys</dt><dd><kbd class="app-keys" aria-hidden="true"><kbd class="app-key">?</kbd></kbd><span class="app-keys__said">Question mark</span></dd></div>
58
+ <div class="app-shortcuts__row"><dt class="text-body">Close or step back</dt><dd><kbd class="app-keys" aria-hidden="true"><kbd class="app-key">Esc</kbd></kbd><span class="app-keys__said">Escape</span></dd></div>
59
+ </dl>
60
+ </section>
61
+
62
+ <div class="app-shortcuts__foot">
63
+ <label for="ks-single" class="app-switch-row">
64
+ <span class="app-switch-row__text">
65
+ <span class="text-body">Single-key shortcuts</span>
66
+ <span id="ks-single-s" class="text-supporting">Letters like A and R act on their own. Turn off if you use speech input.</span>
67
+ </span>
68
+ <input id="ks-single" type="checkbox" role="switch" class="app-switch" aria-describedby="ks-single-s" checked>
69
+ </label>
70
+ </div>
71
+ </div>
72
+ </aside>
73
+ ```
74
+
75
+ ## Behaviour you must supply
76
+
77
+ - **One list of shortcuts** for the product, each with its keys, what it does, and where it works. The sheet, the tooltips and the menu hints all read it, so a key is never shown that doesn't work, and no key works that isn't shown.
78
+ - **`?` toggles the sheet** and Esc closes it, except while focus is in a field. Closing returns focus to whatever had it before.
79
+ - **The switch** is kept per person (not per device) and applied at once: set `data-single-keys="off"` on the root, stop handling single-letter keys, and show the note.
80
+ - **The groups follow the screen**: when what is open changes, rebuild the first group.
81
+
82
+ ## Classes
83
+
84
+ `.app-shortcuts`, `__group`, `__heading`, `__note`, `__row`, `__foot`; with `.app-shell__detail`, `.app-titlebar--detail`, `.app-keys`, `.app-switch-row`.
@@ -60,7 +60,9 @@ See [page.md](../rules/page.md).
60
60
  <div class="app-filterrow">
61
61
  <label class="app-search app-filterrow__search" role="search">
62
62
  <span class="app-icon" aria-hidden="true">search</span>
63
- <input class="app-search__input" type="search" placeholder="Search environments" aria-label="Search environments">
63
+ <input class="app-search__input" type="search" placeholder="Search environments" aria-label="Search environments" aria-keyshortcuts="/">
64
+ <!-- The screen's key: the CSS shows it only while the field is empty and unfocused -->
65
+ <kbd class="app-keys" aria-hidden="true"><kbd class="app-key">/</kbd></kbd>
64
66
  <!-- Only while the input has a value: -->
65
67
  <button type="button" class="app-search__clear app-state app-target" aria-label="Clear search">
66
68
  <span class="app-icon" aria-hidden="true">close</span>
@@ -78,6 +80,7 @@ See [page.md](../rules/page.md).
78
80
 
79
81
  - Set `title` on the heading to the full name (the hover text for a truncated name).
80
82
  - **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.
83
+ - **`/`** 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.
81
84
  - **The count** answers the row: the total at rest, "2 of 5" while a query or a filter narrows.
82
85
  - **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.
83
86
  - Hide search and the filter row when the list is empty.
@@ -0,0 +1,48 @@
1
+ # AppTooltip
2
+
3
+ Names a control that shows no words, and carries its keys ([shortcuts.md](../rules/shortcuts.md)).
4
+
5
+ ## Use / don't use
6
+
7
+ - **Every [AppIconButton](AppIconButton.md)** has one, with the button's label. It replaces the browser's `title`: where a guide shows `title` on an icon button, render a tooltip with the same words instead, never both.
8
+ - **A text button** has one only when it has a shortcut, and then it says the label and the keys ("Approve", A).
9
+ - **A truncated name** (a title bar, a row) may show its full text in one.
10
+ - **Never anything you can press or select.** A link, a button, a second paragraph: that is a menu or a dialog. Never on a disabled control to explain why: say why next to it.
11
+ - **Never on touch.** On a coarse pointer there is no hover; the label is the accessible name.
12
+
13
+ ## Anatomy
14
+
15
+ | Part | What it is |
16
+ |---|---|
17
+ | **Surface** | `inverse-surface`, `radius-sm`, no shadow; 28 tall for one line, at most 240 wide, wrapping after that |
18
+ | **Label** | `on-inverse-surface` at 12/16 500, sentence case, no full stop: the action ("Resolve conversation") |
19
+ | **Keys** | An [AppKeys](AppKeys.md) after the label, 8 from it, the tooltip's end padding drawn in to 4 |
20
+ | **Place** | 4 below the control, centred on it; flipped above when there isn't room below, and kept 8 inside the window |
21
+
22
+ ## Markup
23
+
24
+ ```html
25
+ <!-- The label is the control's accessible name and aria-keyshortcuts its keys; the tooltip shows both -->
26
+ <button type="button" class="app-icon-btn app-state app-target" aria-label="Resolve conversation" aria-keyshortcuts="R">
27
+ <span class="app-icon" aria-hidden="true">check_circle</span>
28
+ </button>
29
+ <div class="app-tooltip" id="tt-3" role="tooltip" hidden>
30
+ Resolve conversation
31
+ <kbd class="app-keys app-keys--single" aria-hidden="true"><kbd class="app-key">R</kbd></kbd>
32
+ </div>
33
+
34
+ <!-- No shortcut: the label alone -->
35
+ <div class="app-tooltip" id="tt-4" role="tooltip" hidden>More actions</div>
36
+ ```
37
+
38
+ ## Behaviour you must supply
39
+
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
+ - **Close** when the pointer leaves or focus moves, when the control is pressed, when the page scrolls, and on Escape.
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`.
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
+
46
+ ## Classes
47
+
48
+ `.app-tooltip`.
@@ -23,6 +23,9 @@ Shared conventions: `app-state` gives anything pressable its hover, focus and pr
23
23
  | AppTextField | A labelled input; the field set and the form | [AppTextField.md](AppTextField.md) |
24
24
  | AppSelect | One choice from a list, native select | [AppSelect.md](AppSelect.md) |
25
25
  | AppSwitch | An on/off setting | [AppSwitch.md](AppSwitch.md) |
26
+ | AppTooltip | Names a control that shows no words, and carries its keys | [AppTooltip.md](AppTooltip.md) |
27
+ | AppKeys | A keyboard shortcut, one cap per key, written for the platform | [AppKeys.md](AppKeys.md) |
28
+ | AppShortcutSheet | Every key the screen answers to, opened by `?`, in the detail pane's place | [AppShortcutSheet.md](AppShortcutSheet.md) |
26
29
  | AppChip | A small fact: status, label, category, filter, input | [AppChip.md](AppChip.md) |
27
30
  | AppAlert | A statement carrying one status; the snackbar | [AppAlert.md](AppAlert.md) |
28
31
  | AppDialog | A confirmation or short form over a scrim | [AppDialog.md](AppDialog.md) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alis-build/design-system",
3
- "version": "0.11.2",
3
+ "version": "0.12.0",
4
4
  "description": "The AlisX design system for coding agents: tokens, product CSS, component markup, capability marks and rules.",
5
5
  "keywords": ["alisx", "design-system", "design-tokens", "css"],
6
6
  "homepage": "https://alisx.com",
package/rules/README.md CHANGED
@@ -25,6 +25,7 @@ Read only what the job needs.
25
25
  | [loading.md](loading.md) | Skeleton, loader, progress |
26
26
  | [page.md](page.md) | Page anatomy, forms, empty states |
27
27
  | [icons.md](icons.md) | Material Symbols and the capability marks |
28
+ | [shortcuts.md](shortcuts.md) | How a key is written, where it shows, the sheet, the keys that mean the same everywhere |
28
29
  | [styling.md](styling.md) | What your own CSS may set |
29
30
  | [anti-patterns.md](anti-patterns.md) | A1–D6, and the smell test to run before handing back |
30
31
 
package/rules/buttons.md CHANGED
@@ -88,7 +88,9 @@ similar controls people scan repeatedly, and the glyph is conventional.
88
88
  title bar's lead, an empty state, a text button in a pane, an alert. The glyph
89
89
  names a kind of action, not the object, so never `person_add` or `note_add`;
90
90
  in a menu the item follows the menu's rule (a glyph on every row or none), and
91
- its glyph is `add`. "Add a follow-up round" works inside a thing and keeps none.
91
+ its glyph is `add`. "Add a follow-up round" works inside a thing and keeps none,
92
+ and so does a field's own action ("Add" beside an input, taking what you
93
+ typed): it is that field's affirmative.
92
94
  - **No other icon on a lead**, filled or outlined, and none on a dialog action:
93
95
  "Create project" finishes what New started.
94
96
  - One icon, leading. The only trailing icon is a chevron meaning "opens a menu".
@@ -138,6 +140,9 @@ Did this thing exist before the action?
138
140
  - **One object, one label, everywhere it appears:** the title bar, an empty
139
141
  state, a menu. Not Create, Generate new or Get started: the first two are more
140
142
  words for New, and the last drops the object.
143
+ - **Upload is its own verb.** Files from your device are "Upload files", with
144
+ `upload`, never "Add files": Add brings a thing in, Upload says where it comes
145
+ from.
141
146
  - **A product name keeps its capital and the object doesn't:** "New build
142
147
  environment".
143
148
  - **It names what brings a thing into a screen, not work inside one.** "Add a
package/rules/icons.md CHANGED
@@ -15,7 +15,7 @@ library, and nothing else hand-drawn. Self-host the subset you use.
15
15
  - An icon never appears without a label or an accessible name.
16
16
  - Icons inherit `currentColor`. **Never set a fill on the glyph.**
17
17
  - **No emoji, ever**, and no unicode substitutes except the three the brand owns:
18
- `❯` the prompt caret, `◼` the agent's reply mark, `→` a trailing link arrow.
18
+ `❯` the prompt caret, `◼` the agent's reply mark, `→` a trailing link arrow. Key caps write the keys' own symbols (⌘ ⇧ ⌥ ⌃ ↑ ↓ ← →) ([shortcuts.md](shortcuts.md)).
19
19
  - Prefer an icon's current name over a legacy one that still resolves (`mail`,
20
20
  not `email`).
21
21
  - **Send is `arrow_upward`**, in the composer's filled circle: it points into the
@@ -6,14 +6,13 @@ What the system doesn't decide yet, in one place. When you hit one, take the qui
6
6
 
7
7
  - **Comboboxes** (a searchable or multi-value select) and **date and time pickers**. Use `AppSelect` or a text field with a format hint.
8
8
  - **Checkboxes and radios** as standalone controls. A labelled set of choices is `AppSelectTile`s in an `AppFieldset`; an on/off setting is `AppSwitch`.
9
- - **Tooltips** beyond the native `title` that `AppIconButton` sets (the product's opens below after 200ms, at most 240px wide).
10
9
  - **The marketing components** (`.ax-*`, alisx.com) are not in this package: it covers the product register. A layout class for a grid of lattices is missing too.
11
10
  - **What the Skill store and the Specialists offer**, beyond their one-line descriptions in [README.md](README.md). Marketing copy about them needs a product brief.
12
11
  - **Tabs outside the title bar**, **avatars** as a component ([chips-alerts.md](chips-alerts.md) has the rule), **file upload**, and a **dismissible alert**.
13
12
 
14
13
  ## Open patterns
15
14
 
16
- - **Finding anything across the product** (a project, an interview, a skill, an environment) from any screen. A screen's search narrows the list in front of you ([page.md](page.md) § Search); this is a different job. The likely shape is a Search row at the top of the rail with ⌘K, opening a dialog grouped like the `@` menu, once a search across products exists.
15
+ - **Finding anything across the product** (a project, an interview, a skill, an environment) from any screen. A screen's search narrows the list in front of you ([page.md](page.md) § Search); this is a different job. The likely shape is a Search row at the top of the rail with ⌘ K (reserved for it: [shortcuts.md](shortcuts.md)), opening a dialog grouped like the `@` menu, once a search across products exists.
17
16
  - **Navigation inside a project.** Open objects can sit in the navigation pane as secondary rows under a heading ([AppShell](../components/AppShell.md)), and an object's own views are route tabs in its title bar. A project's own destinations beside the app's have no pattern yet.
18
17
  - **Versions of generated content.** Regenerating replaces a synthesis; keeping or comparing earlier versions has no pattern.
19
18
  - **Withdrawing a request, and approval chains.** A person can't withdraw a request they made, and a request that needs several approvers in turn has no pattern ([AppAsk](../components/AppAsk.md) § Who asks). An approval chain would be its own component: its parts and interaction differ.
@@ -47,6 +47,8 @@ AppShell
47
47
  | The one action that moves the user forward | `AppButton variant="filled"`, once per screen, labelled with the outcome; never in the title bar |
48
48
  | The lead of a surface that starts something (the title bar, a pane, an empty state) | `AppButton variant="outlined"`, once per surface; never in a card or a repeated item |
49
49
  | Everything else you press | `AppButton` (text, in ink), `AppIconButton` |
50
+ | A control's name on hover, and its shortcut | `AppTooltip`: every icon button has one; a text button only to carry its keys. Keys are `AppKeys`, never in a label |
51
+ | The keys a screen answers to | `AppShortcutSheet`, opened by `?` and from the account menu, in the detail pane's place |
50
52
  | A form | `.app-form` of fields, one filled action last (see § Forms) |
51
53
  | Text | `AppTextField` (with `action` for one that collects several values, shown as input `AppChip`s below) |
52
54
  | One choice from a list | `AppSelect` |
@@ -119,7 +121,7 @@ AppShell detail={…}
119
121
 
120
122
  ## 7. Copy
121
123
 
122
- Sentence case, British spelling, plain and calm, no dashes, no emoji. Buttons are a verb then the object: **New project**, **Add member**. A filled button names its outcome: "Send the invites", not "Continue". An empty state's headline says why you would act, never the screen's name. An error says what to do next, in a sentence with a full stop. Times are relative and short: "Just now", "5 min ago", "3h ago", "Yesterday", then a date ("3 Oct", three-letter months, with the year only when it isn't this one).
124
+ Sentence case, British spelling, plain and calm, no dashes, no emoji. Buttons are a verb then the object: **New project**, **Add member**. A filled button names its outcome: "Send the invites", not "Continue". An empty state's headline says why you would act, never the screen's name. An error says what to do next, in a sentence with a full stop. Times are relative and short: "Just now", "5 min ago", "3h ago", "Yesterday", then a date ("3 Oct", three-letter months, with the year only when it isn't this one). A key is an `AppKeys` cap written for the platform (⌘ K on a Mac, Ctrl K elsewhere), never "Ctrl+K" or "Press Enter to send" in text.
123
125
 
124
126
  ## 8. Before you hand it back
125
127
 
@@ -0,0 +1,90 @@
1
+ # Keyboard shortcuts
2
+
3
+ **One way to write a key, three places to show it, one sheet that lists them all.**
4
+ This file decides how a shortcut is shown and which keys mean the same thing on
5
+ every screen. Which other keys a screen binds is that screen's own choice.
6
+
7
+ ## Writing a key
8
+
9
+ A shortcut is an [AppKeys](../components/AppKeys.md): one cap per key, side by
10
+ side, never a plus sign and never brackets.
11
+
12
+ | Key | On a Mac | On Windows and Linux |
13
+ | --- | --- | --- |
14
+ | The command modifier (`mod`) | ⌘ | Ctrl |
15
+ | Shift | ⇧ | Shift |
16
+ | Option / Alt | ⌥ | Alt |
17
+ | Control, where it differs from `mod` | ⌃ | Ctrl |
18
+
19
+ - **Detect the platform once**, for the whole product, and write every shortcut
20
+ for it. Never two spellings side by side ("⌘K / Ctrl K").
21
+ - **Modifiers first**, in the platform's order: ⌃ ⌥ ⇧ ⌘ on a Mac, Ctrl Alt Shift
22
+ elsewhere.
23
+ - **Named keys are words** on every platform: Enter, Esc, Tab, Space, Delete,
24
+ Backspace. **Arrows are arrows**: ↑ ↓ ← →.
25
+ - **A capital is written with Shift**: ⇧ U, never "U" beside "u". A letter cap
26
+ is always the capital.
27
+ - **A sequence says "then"**: G then H. Two caps with nothing between them are
28
+ pressed together.
29
+ - **Keys for another app** (a setup guide: "In PowerShell, press Ctrl V") use that
30
+ guide's platform, not the one detected.
31
+
32
+ ## Where a key shows
33
+
34
+ Only where someone is already looking at the control it works. Nowhere else.
35
+
36
+ 1. **The tooltip** ([AppTooltip](../components/AppTooltip.md)): the label, then the
37
+ keys. A text button that has a shortcut takes a tooltip only to carry its keys.
38
+ 2. **The menu row** ([AppMenu](../components/AppMenu.md)): the keys in the row's
39
+ trailing hint.
40
+ 3. **The screen's search field** ([AppTitleBar](../components/AppTitleBar.md)): a
41
+ `/` cap at its end, while it is empty and unfocused. A field has no tooltip.
42
+
43
+ Never inside a button's label, never in brackets after it ("Submit (Ctrl+Enter)"),
44
+ and no hint lines: not under a composer ("Press Enter to send"), not under a
45
+ picker ("↑↓ to navigate"). Enter sends and Shift Enter breaks the line in every
46
+ composer; Send's tooltip says so, and the sheet lists both.
47
+
48
+ ## The sheet
49
+
50
+ Every key the screen answers to, in one place: an
51
+ [AppShortcutSheet](../components/AppShortcutSheet.md). It opens from `?` and from
52
+ a **Keyboard shortcuts** row in the account menu, and takes the detail pane's
53
+ place, so it never covers the controls it describes and every key in it works
54
+ while it is open. **This screen's keys first, then Everywhere.** A key that does
55
+ nothing here is left out, not dimmed.
56
+
57
+ ## The same everywhere
58
+
59
+ | Keys | Does |
60
+ | --- | --- |
61
+ | ? | Opens or closes the sheet |
62
+ | Esc | Closes what is open (a menu, a dialog, the sheet), or leaves the field you are in |
63
+ | / | Puts you in the screen's search field |
64
+ | ⌘ K | Reserved for finding anything across the product ([known-gaps.md](known-gaps.md)); bind nothing to it |
65
+
66
+ A screen never rebinds these, and never takes a key the browser or the operating
67
+ system owns (⌘ W, ⌘ T, ⌘ L, ⌘ R, ⌘ F, ⌘ P, ⌘ Q, Ctrl Tab).
68
+
69
+ ## Single keys
70
+
71
+ A screen may bind single letters for the verbs a person repeats (A approves, R
72
+ resolves). Three conditions:
73
+
74
+ - **Never while typing.** A single key does nothing while focus is in a field, an
75
+ editor or anything that takes text.
76
+ - **They can be turned off.** The sheet's foot holds an
77
+ [AppSwitch](../components/AppSwitch.md), **Single-key shortcuts**, kept per
78
+ person. Off, every single-letter shortcut stops working and its caps leave
79
+ tooltips and menus; the sheet keeps them, dimmed, under a note saying they are
80
+ off. Speech input types letters, and a stray one must not approve anything.
81
+ - **The same letter, the same act.** R resolves wherever there is something to
82
+ resolve; it never means Reply on another screen.
83
+
84
+ ## Accessible names
85
+
86
+ - **On a control**, the caps are decoration: hide them from assistive technology
87
+ and give the control `aria-keyshortcuts` (`R`, `Meta+L`, `Control+L`,
88
+ `Shift+U`).
89
+ - **In the sheet and in prose**, the keys are the content: say them in words
90
+ (`.app-keys__said`, "Command K"), since a screen reader can't read ⌘ or ⇧.