@alis-build/design-system 0.21.1 → 0.23.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
@@ -413,6 +413,7 @@ button, input, textarea, select { font: inherit; }
413
413
  @media (prefers-reduced-motion:no-preference){.app-btn--filled:not(:disabled):active{border-radius:12px;transform:scale(.97)}}
414
414
  .app-btn-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-8)}
415
415
  .app-btn-row--end{justify-content:flex-end}
416
+ .app-btn-row__start{margin-inline-end:auto}
416
417
 
417
418
  /* ── Icon button · 20px glyph in a 40px box, no fill unless a toggle is on ── */
418
419
  .app-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;border:0;border-radius:var(--radius-pill);background:transparent;color:var(--on-surface-variant)}
@@ -760,6 +761,29 @@ span.app-account__avatar{display:flex;align-items:center;justify-content:center;
760
761
  .app-step.is-current,.app-step.is-done{color:var(--on-surface)}
761
762
  .app-step.is-failed{color:var(--error)}
762
763
 
764
+ /* ── Stepper · a form a person moves through in named steps ──
765
+ Our progress bar cut into one segment per step: done and current ink, next the
766
+ track. The current step's name is 600; a done step is a button back. Narrower
767
+ than 480 (the stepper's own width), the names leave and one caption names the
768
+ current step and counts. */
769
+ .app-stepper{container-type:inline-size;min-width:0}
770
+ .app-stepper__steps{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:var(--space-4);margin:0;padding:0;list-style:none}
771
+ .app-stepper__step{display:flex;flex-direction:column;gap:var(--space-8);width:100%;min-width:0;padding:0 0 var(--space-4);border:0;border-radius:var(--radius-xs);background:transparent;color:var(--on-surface-variant);font:inherit;text-align:left}
772
+ .app-stepper__bar{display:block;height:4px;border-radius:var(--radius-pill);background:var(--surface-container-highest)}
773
+ .app-stepper__label{display:flex;align-items:center;gap:var(--space-4);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
774
+ .app-stepper__label>.app-icon{font-size:16px}
775
+ .app-stepper__step.is-done,.app-stepper__step.is-current{color:var(--on-surface)}
776
+ .app-stepper__step.is-done .app-stepper__bar,.app-stepper__step.is-current .app-stepper__bar{background:var(--on-surface)}
777
+ .app-stepper__step.is-current .app-stepper__label{font-weight:600}
778
+ .app-stepper__step.is-invalid{color:var(--error)}
779
+ .app-stepper__step.is-invalid .app-stepper__bar{background:var(--error)}
780
+ .app-stepper__caption{display:none;align-items:baseline;justify-content:space-between;gap:var(--space-16);margin-top:var(--space-8)}
781
+ .app-stepper__count{color:var(--on-surface-variant);font-variant-numeric:tabular-nums}
782
+ @container (max-width:479px){
783
+ .app-stepper__label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
784
+ .app-stepper__caption{display:flex}
785
+ }
786
+
763
787
  /* ── Table · scanned, not read: full width, 40px rows, radius 0 ── */
764
788
  .app-table-wrap{width:100%;overflow-x:auto}
765
789
  .app-table{width:100%;border-collapse:collapse;border-radius:var(--radius-0);color:var(--on-surface);font-family:var(--font-sans)}
@@ -949,7 +973,7 @@ button.app-attachment{border:0;color:inherit;font:inherit;text-align:left;cursor
949
973
  .app-turn__line{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-4);margin:0;color:var(--on-surface-variant)}
950
974
  .app-turn__line .app-icon{font-size:16px}
951
975
  .app-turn__line.is-error{color:var(--error)}
952
- .app-turn__line-action{margin-left:var(--space-4);padding:0;border:0;background:none;color:var(--primary);font:inherit;font-weight:600;cursor:pointer}
976
+ .app-turn__line-action,.app-empty-line__action{margin-left:var(--space-4);padding:0;border:0;background:none;color:var(--primary);font:inherit;font-weight:600;cursor:pointer}
953
977
  @media (hover:none){.app-turn__tools,.app-turn--alis:not(.is-latest) .app-turn__foot{display:none}}
954
978
  /* What your message was about: the context chip as you sent it */
955
979
  .app-turn__about{max-width:80%;color:var(--on-surface-variant);text-align:right}
package/classes.json CHANGED
@@ -58,6 +58,7 @@
58
58
  "app-btn--small",
59
59
  "app-btn-row",
60
60
  "app-btn-row--end",
61
+ "app-btn-row__start",
61
62
  "app-btn__spinner",
62
63
  "app-card",
63
64
  "app-card--instrument",
@@ -124,6 +125,7 @@
124
125
  "app-empty",
125
126
  "app-empty-field",
126
127
  "app-empty-line",
128
+ "app-empty-line__action",
127
129
  "app-empty__headline",
128
130
  "app-empty__line",
129
131
  "app-field",
@@ -246,6 +248,13 @@
246
248
  "app-state",
247
249
  "app-statement-over-gradient",
248
250
  "app-step",
251
+ "app-stepper",
252
+ "app-stepper__bar",
253
+ "app-stepper__caption",
254
+ "app-stepper__count",
255
+ "app-stepper__label",
256
+ "app-stepper__step",
257
+ "app-stepper__steps",
249
258
  "app-steps",
250
259
  "app-switch",
251
260
  "app-switch-row",
@@ -336,6 +345,7 @@
336
345
  "is-failed",
337
346
  "is-gone",
338
347
  "is-interactive",
348
+ "is-invalid",
339
349
  "is-latest",
340
350
  "is-loading",
341
351
  "is-locked",
@@ -9,11 +9,12 @@ See [chips-alerts.md](../rules/chips-alerts.md).
9
9
  - Never filled, never `primary`, never more than one on a surface. A button in it is a text [AppButton](AppButton.md). Radius `radius-xs`.
10
10
  - **A panel that *is* the status is an alert; a panel that *has* one carries a chip.** A row or card with a status keeps its neutral fill and shows an [AppChip](AppChip.md).
11
11
  - **Where**: a page-level notice goes directly after the title bar, in the flow, so it moves the content down. In a detail pane, at the top of the pane under its bar.
12
- - **An error says what happened and what to do next**, and offers the next step as its one action ("View logs").
12
+ - **An error says what happened and what to do next**, and offers the next step as its one action ("View logs"). In words a person wrote: never a status code or the machine's own message ([errors.md](../rules/errors.md)). When there is nothing they can do, the action is Copy details, for support.
13
+ - **The connection dropped**: one `warning` alert as the page-level notice, until it returns ("You're offline. What you do now may not be saved.").
13
14
  - **Narrow**: in the detail pane and below 600px the action stacks under the message automatically; `app-alert--stacked` does it anywhere.
14
15
  - **It stays** until the user acts again or leaves. It never times out.
15
16
 
16
- **Snackbar** confirms a result whose evidence is off-screen or easy to miss (a removed row, a closed pane, a save that changes nothing in view, a deploy finishing in a list); not when the change is plainly in view. Level 3 on `surface-variant`, light, bottom centre, one text action at most (Undo). A failure is never a snackbar: it is an alert that stays.
17
+ **Snackbar** confirms a result whose evidence is off-screen or easy to miss (a removed row, a closed pane, a save that changes nothing in view, a deploy finishing in a list); not when the change is plainly in view. Level 3 on `surface-variant`, light, bottom centre, one text action at most (Undo). A failure is never a snackbar: it is an alert that stays. **One snackbar stays**: "A new version is ready." with Reload, which waits until it is pressed and never reloads by itself.
17
18
 
18
19
  ## Markup
19
20
 
@@ -37,11 +38,31 @@ See [chips-alerts.md](../rules/chips-alerts.md).
37
38
  </div>
38
39
  <!-- Icons: info → info, success → check_circle, warning → warning, error → error. Title and actions are optional. -->
39
40
 
41
+ <!-- Something they did failed: at the top of the form or pane; what happened, then what to do -->
42
+ <div role="alert" class="app-alert app-alert--error">
43
+ <span class="app-icon" aria-hidden="true">error</span>
44
+ <div class="app-alert__body">
45
+ <strong class="app-alert__title">Couldn't save the environment</strong>
46
+ The name is already in use. Choose another, then save again.
47
+ </div>
48
+ </div>
49
+
50
+ <!-- The connection dropped: the page-level notice, until it returns -->
51
+ <div role="status" class="app-alert app-alert--warning">
52
+ <span class="app-icon" aria-hidden="true">warning</span>
53
+ <div class="app-alert__body">You're offline. What you do now may not be saved.</div>
54
+ </div>
55
+
40
56
  <!-- Snackbar -->
41
57
  <div role="status" class="app-snackbar">
42
58
  <span class="app-snackbar__text">Deleted preview-pr-218</span>
43
59
  <button type="button" class="app-btn app-state app-target">Undo</button>
44
60
  </div>
61
+ <!-- The one snackbar that stays -->
62
+ <div role="status" class="app-snackbar">
63
+ <span class="app-snackbar__text">A new version is ready.</span>
64
+ <button type="button" class="app-btn app-state app-target">Reload</button>
65
+ </div>
45
66
  <!-- app-snackbar--inline: in the flow instead of fixed, for docs -->
46
67
  ```
47
68
 
@@ -59,6 +59,12 @@ Emphasis is allocated, not chosen ([buttons.md](../rules/buttons.md)).
59
59
  <button type="button" class="app-btn app-state app-target">Cancel</button>
60
60
  <button type="button" class="app-btn app-state app-target">Delete environment</button>
61
61
  </div>
62
+
63
+ <!-- A flow's row: __start holds Back on the leading edge -->
64
+ <div class="app-btn-row app-btn-row--end">
65
+ <button type="button" class="app-btn app-state app-target app-btn-row__start">Back</button>
66
+ <button type="submit" class="app-btn app-state app-target app-btn--filled">Continue</button>
67
+ </div>
62
68
  ```
63
69
 
64
70
  ## Behaviour you must supply
@@ -69,4 +75,4 @@ Emphasis is allocated, not chosen ([buttons.md](../rules/buttons.md)).
69
75
 
70
76
  ## Classes
71
77
 
72
- `.app-btn`, `.app-btn--outlined`, `.app-btn--filled`, `.app-btn--error`, `.app-btn--quiet`, `.app-btn--small`, `.app-btn__spinner`, `.app-state`, `.app-target`, `.app-target--none`, `.is-loading`, `.app-btn-row`, `.app-btn-row--end`.
78
+ `.app-btn`, `.app-btn--outlined`, `.app-btn--filled`, `.app-btn--error`, `.app-btn--quiet`, `.app-btn--small`, `.app-btn__spinner`, `.app-state`, `.app-target`, `.app-target--none`, `.is-loading`, `.app-btn-row`, `.app-btn-row--end`, `.app-btn-row__start`.
@@ -6,6 +6,7 @@ A dialog: `surface-container-high` (white in light) at `elevation-3`, an object-
6
6
 
7
7
  - Actions are [AppButton](AppButton.md)s on the trailing edge, affirmative last. A dialog is a screen of its own, so the affirmative is filled when it commits (`app-btn--filled`, with `app-btn--error` when it destroys) and the rest, Cancel always among them, are text. An affirmative that only opens, copies or reads stays text, so the whole dialog is text. The affirmative names the outcome ("Delete environment", not "OK"). A dialog is never heavier than what it interrupts, and never dark.
8
8
  - **Confirm** what is hard to undo or reaches past the user: deleting, sending to people, deploying to production. Restate it in the title as a question ("Delete staging?") and say what goes with it in the body.
9
+ - **Signed out** is the one dialog with no Cancel: there is nothing to go back to. It sits over the screen as it was, Escape and the scrim don't close it, and signing in returns to the same screen ([errors.md](../rules/errors.md)).
9
10
  - **A form in a dialog** (Invite people) follows the form rules: fields 24 apart, validated on submit, and persistent (Escape and the scrim don't close it). The dialog is the confirmation, so its affirmative ("Send 3 invites") needs no second one; it is the dialog's filled button.
10
11
 
11
12
  ## Markup
@@ -24,6 +25,17 @@ A dialog: `surface-container-high` (white in light) at `elevation-3`, an object-
24
25
  </div>
25
26
  </div>
26
27
 
28
+ <!-- Signed out: the one dialog with no Cancel -->
29
+ <div class="app-scrim">
30
+ <div role="dialog" aria-modal="true" aria-labelledby="d-out-t" tabindex="-1" class="app-dialog">
31
+ <h2 id="d-out-t" class="app-dialog__title text-object-title">You're signed out</h2>
32
+ <div class="app-dialog__body text-body">Sign in again to pick up where you left off.</div>
33
+ <div class="app-btn-row app-btn-row--end">
34
+ <button type="button" class="app-btn app-state app-target">Sign in again</button>
35
+ </div>
36
+ </div>
37
+ </div>
38
+
27
39
  <!-- In the flow, for docs: no scrim, no aria-modal, no focus handling -->
28
40
  <div class="app-scrim app-scrim--inline">…</div>
29
41
  <!-- or the .app-dialog alone -->
@@ -10,6 +10,8 @@ See [page.md](../rules/page.md).
10
10
  - **It may lead with one icon tile**, above the headline: the avatar's thing tile at 80 ([AppAvatar](AppAvatar.md)), holding the icon of what the screen is about. Neutral, as every tile is, and never a status colour: a result says how it went in its headline. Leave it out when no icon is plainly the thing's own.
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
+ - **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).
14
+ - **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.
13
15
  - An empty line inside working content ("No files yet" in a tab) is not this: use one supporting line, `.app-empty-line`.
14
16
 
15
17
  ## Markup
@@ -46,6 +48,31 @@ See [page.md](../rules/page.md).
46
48
  <!-- action -->
47
49
  </div>
48
50
 
51
+ <!-- Couldn't load: no field, in ink, Try again -->
52
+ <div class="app-empty">
53
+ <h2 class="app-empty__headline text-page-title">Couldn't load environments</h2>
54
+ <p class="app-empty__line text-supporting">Check your connection, then try again.</p>
55
+ <button type="button" class="app-btn app-state app-target app-btn--outlined"><span class="app-icon" aria-hidden="true">refresh</span>Try again</button>
56
+ </div>
57
+
58
+ <!-- No access: led by the tile, says who can help -->
59
+ <div class="app-empty">
60
+ <span class="app-avatar app-avatar--thing app-avatar--large" aria-hidden="true"><span class="app-icon" aria-hidden="true">lock</span></span>
61
+ <h2 class="app-empty__headline text-page-title">You don't have access to Renewal calls</h2>
62
+ <p class="app-empty__line text-supporting">Ask one of its owners to add you.</p>
63
+ <button type="button" class="app-btn app-state app-target app-btn--outlined">Request access</button>
64
+ </div>
65
+
66
+ <!-- Not there -->
67
+ <div class="app-empty">
68
+ <h2 class="app-empty__headline text-page-title">This project doesn't exist</h2>
69
+ <p class="app-empty__line text-supporting">It may have been deleted, or the link may be wrong.</p>
70
+ <a class="app-btn app-state app-target app-btn--outlined" href="/projects">Go to projects</a>
71
+ </div>
72
+
73
+ <!-- One section that couldn't load: a line, with Try again beside it -->
74
+ <p class="app-empty-line text-supporting">Couldn't load spend history.<button type="button" class="app-empty-line__action">Try again</button></p>
75
+
49
76
  <!-- An empty line inside working content -->
50
77
  <p class="app-empty-line text-supporting">No environments match. Try All, or clear the search.</p>
51
78
  ```
@@ -57,4 +84,4 @@ See [page.md](../rules/page.md).
57
84
 
58
85
  ## Classes
59
86
 
60
- `.app-empty`, `.app-empty__headline`, `.app-empty__line`, `.app-empty-line`, `.app-empty-field`; the drafting field: `.ax-field`, `.ax-field__glow`, `.ax-field__grid`, `.ax-field__noise`.
87
+ `.app-empty`, `.app-empty__headline`, `.app-empty__line`, `.app-empty-line`, `.app-empty-line__action`, `.app-empty-field`; the drafting field: `.ax-field`, `.ax-field__glow`, `.ax-field__grid`, `.ax-field__noise`.
@@ -4,7 +4,7 @@ Work you can count: a determinate bar, and steps for work that runs in named sta
4
4
 
5
5
  ## Use / don't use
6
6
 
7
- See [loading.md](../rules/loading.md). Never for a wait whose length you don't know: that is an [AppSkeleton](AppSkeleton.md) or an [AppLoader](AppLoader.md).
7
+ See [loading.md](../rules/loading.md). Never for a wait whose length you don't know: that is an [AppSkeleton](AppSkeleton.md) or an [AppLoader](AppLoader.md). A form a person moves through is an [AppStepper](AppStepper.md): the same bar, cut into steps.
8
8
 
9
9
  - **The bar**: 4px, `radius-pill`, a `surface-container-highest` track and an `on-surface` fill: ink, because a bar is not something you press, and dark enough to read at a glance. On failure the fill turns `error` (`is-error`) and stops where it failed. A label above names the work ("Deploying v1.43.0"); the value on the right counts it ("Step 2 of 4", "48%").
10
10
  - **The steps**: drawn under the bar, or alone. Done is a filled check, current a filled number in ink (near selection, not selection, so not 700), next an outlined number, a failure the error icon in `error`. Never `primary` ([selection.md](../rules/selection.md) § A step). Nine steps at most; group more into stages.
@@ -0,0 +1,76 @@
1
+ # AppStepper
2
+
3
+ A form a person moves through in named steps: one short bar per step, its name under it, so they see where they are, what is left and the way back.
4
+
5
+ ## Use / don't use
6
+
7
+ See [page.md](../rules/page.md) § A form in steps for when a form takes steps at all.
8
+
9
+ - **Two to five steps, each named in a word or two** ("Setup", "Contact", "Review and publish"; never "Enter your contact information"). Steps that are questions, one a screen with no short name, take the [AppProgress](AppProgress.md) bar instead ("Step 2 of 6"), with the question as the step's title.
10
+ - **It is the progress bar cut into steps:** a 4px `radius-pill` segment per step on the `surface-container-highest` track, filled `on-surface` for a step done or current. Never `primary`: nothing on it is the action ([selection.md](../rules/selection.md) § A step).
11
+ - **The current step's name is 600** and carries `aria-current="step"`. A done step's name is `on-surface`; a next one's is `on-surface-variant`.
12
+ - **A done step is a button back to it**, with `app-state`. A later step is not: the flow's Continue checks the step before it moves on. Editing something that already exists, every step has been reached, so every step is a button.
13
+ - **A step that no longer holds** (an edit elsewhere broke it, or the server refused it) is `is-invalid`: its segment and name in `error`, the `error` glyph before the name.
14
+ - **It leads the flow's surface**: the top of the instrument card on a page, under the title in a dialog. Never a panel of its own, and never "Step 1 of 2" written beside it.
15
+ - **Narrower than 480** (its own width, so a narrow dialog counts too) the names leave and one caption under the bars names the current step and counts ("Contact", "2 of 3"). The names stay for assistive technology.
16
+ - Not for work the system runs: that is [AppProgress](AppProgress.md) and its steps. Not for views of one thing: that is an [AppSegmented](AppSegmented.md).
17
+
18
+ ## Markup
19
+
20
+ ```html
21
+ <nav class="app-stepper" aria-label="Sign-up steps">
22
+ <ol class="app-stepper__steps">
23
+ <li><button type="button" class="app-stepper__step app-state is-done"><span class="app-stepper__bar" aria-hidden="true"></span><span class="app-stepper__label text-label">Company</span></button></li>
24
+ <li><span class="app-stepper__step is-current" aria-current="step"><span class="app-stepper__bar" aria-hidden="true"></span><span class="app-stepper__label text-label">Contact</span></span></li>
25
+ <li><span class="app-stepper__step"><span class="app-stepper__bar" aria-hidden="true"></span><span class="app-stepper__label text-label">Agreement</span></span></li>
26
+ </ol>
27
+ <div class="app-stepper__caption" aria-hidden="true"><span class="text-label">Contact</span><span class="app-stepper__count text-meta">2 of 3</span></div>
28
+ </nav>
29
+
30
+ <!-- A done step that no longer holds -->
31
+ <nav class="app-stepper" aria-label="Sign-up steps">
32
+ <ol class="app-stepper__steps">
33
+ <li><button type="button" class="app-stepper__step app-state is-invalid"><span class="app-stepper__bar" aria-hidden="true"></span><span class="app-stepper__label text-label"><span class="app-icon app-icon--filled" aria-hidden="true">error</span>Company</span></button></li>
34
+ <li><button type="button" class="app-stepper__step app-state is-done"><span class="app-stepper__bar" aria-hidden="true"></span><span class="app-stepper__label text-label">Contact</span></button></li>
35
+ <li><span class="app-stepper__step is-current" aria-current="step"><span class="app-stepper__bar" aria-hidden="true"></span><span class="app-stepper__label text-label">Agreement</span></span></li>
36
+ </ol>
37
+ <div class="app-stepper__caption" aria-hidden="true"><span class="text-label">Agreement</span><span class="app-stepper__count text-meta">3 of 3</span></div>
38
+ </nav>
39
+
40
+ <!-- The flow on a page: one instrument card at the prose measure, the stepper first, the step's fields, the action row -->
41
+ <form class="app-card app-card--instrument app-form" novalidate>
42
+ <nav class="app-stepper" aria-label="Interview steps">
43
+ <ol class="app-stepper__steps">
44
+ <li><span class="app-stepper__step is-current" aria-current="step"><span class="app-stepper__bar" aria-hidden="true"></span><span class="app-stepper__label text-label">Setup</span></span></li>
45
+ <li><span class="app-stepper__step"><span class="app-stepper__bar" aria-hidden="true"></span><span class="app-stepper__label text-label">Review and publish</span></span></li>
46
+ </ol>
47
+ <div class="app-stepper__caption" aria-hidden="true"><span class="text-label">Setup</span><span class="app-stepper__count text-meta">1 of 2</span></div>
48
+ </nav>
49
+ <div class="app-field">
50
+ <label for="f-purpose" class="app-field__label text-label">What is the interview for?</label>
51
+ <div class="app-field__box"><textarea id="f-purpose" class="app-field__input" rows="3"></textarea></div>
52
+ </div>
53
+ <div class="app-btn-row app-btn-row--end">
54
+ <button type="button" class="app-btn app-state app-target">Save draft</button>
55
+ <button type="submit" class="app-btn app-state app-target app-btn--filled">Continue</button>
56
+ </div>
57
+ </form>
58
+
59
+ <!-- From the second step, Back leads the row -->
60
+ <div class="app-btn-row app-btn-row--end">
61
+ <button type="button" class="app-btn app-state app-target app-btn-row__start">Back</button>
62
+ <button type="button" class="app-btn app-state app-target">Save draft</button>
63
+ <button type="button" class="app-btn app-state app-target app-btn--filled">Publish interview</button>
64
+ </div>
65
+ ```
66
+
67
+ ## Behaviour you must supply
68
+
69
+ - **Move the states** as the person moves: `is-done` on every step behind them, `is-current` and `aria-current="step"` on theirs, nothing on the rest. Swap a step's `<span>` for a `<button>` once it is done.
70
+ - **Continue checks the step**: on a failure it stays, turns each field `error` with its supporting line, and moves focus to the first; it is never disabled ([page.md](../rules/page.md) § Forms).
71
+ - **Keep the step in the URL** (`?step=review`): each step pushes a history entry, so the browser's back steps back and a refresh stays.
72
+ - **Update the caption** with the current step's name and count; it is `aria-hidden`, because the list already says it.
73
+
74
+ ## Classes
75
+
76
+ `.app-stepper`, `.app-stepper__steps`, `.app-stepper__step`, `.app-stepper__bar`, `.app-stepper__label`, `.app-stepper__caption`, `.app-stepper__count`; `.is-done`, `.is-current`, `.is-invalid` on a step, with `.app-state` on a done one.
@@ -49,6 +49,7 @@ Shared conventions: `app-state` gives anything pressable its hover, focus and pr
49
49
  | AppSkeleton | A wait whose shape you know | [AppSkeleton.md](AppSkeleton.md) |
50
50
  | AppLoader | A wait whose shape you don't know | [AppLoader.md](AppLoader.md) |
51
51
  | AppProgress | Work you can count; the steps | [AppProgress.md](AppProgress.md) |
52
+ | AppStepper | A form a person moves through in named steps | [AppStepper.md](AppStepper.md) |
52
53
  | CapabilityMark | The six tool marks, as SVG from `marks.json` | [CapabilityMark.md](CapabilityMark.md) |
53
54
  | AlisMark | The brand mark | [AlisMark.md](AlisMark.md) |
54
55
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alis-build/design-system",
3
- "version": "0.21.1",
3
+ "version": "0.23.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
@@ -24,6 +24,7 @@ Read only what the job needs.
24
24
  | [selection.md](selection.md) | How a selected thing is drawn |
25
25
  | [chips-alerts.md](chips-alerts.md) | Chips, alerts, status |
26
26
  | [loading.md](loading.md) | Skeleton, loader, progress |
27
+ | [errors.md](errors.md) | What shows when something fails, can't load, isn't allowed or isn't there |
27
28
  | [page.md](page.md) | Page anatomy, forms, empty states |
28
29
  | [icons.md](icons.md) | Material Symbols and the capability marks |
29
30
  | [shortcuts.md](shortcuts.md) | How a key is written, where it shows, the sheet, the keys that mean the same everywhere |
@@ -0,0 +1,152 @@
1
+ # When something goes wrong
2
+
3
+ ## The one rule
4
+
5
+ **Say what happened and what to do next, in the place it happened, and keep
6
+ everything else on screen.** A failure never passes silently, never shows the
7
+ machine's own words, and never takes the screen away.
8
+
9
+ ## The decision
10
+
11
+ ```
12
+ What went wrong?
13
+ ├─ A value in a field → the field's error line
14
+ │ (page.md § Forms)
15
+ ├─ Something the person just did: a save,
16
+ │ a send, a deploy, a delete → one error alert at the top of the
17
+ │ form or pane they acted in
18
+ ├─ Work that failed after they moved on → the thing's own state says Failed,
19
+ │ and the alert waits in its pane
20
+ ├─ A screen or a pane could not load → a pane state in the content's place
21
+ ├─ One section of a screen could not load → one line in that section's place
22
+ ├─ What is on screen could not refresh → it stays; an alert only if they
23
+ │ asked for the refresh
24
+ ├─ They may not open this, or it isn't there → a pane state in the content's place
25
+ ├─ They may not do this one thing → the control leaves, or says why
26
+ │ beside it
27
+ ├─ The connection dropped → one page-level notice until it
28
+ │ returns
29
+ ├─ They were signed out → a dialog over the screen as it was
30
+ ├─ A new version is waiting → the one snackbar that stays
31
+ └─ A message didn't send, or Alis couldn't
32
+ finish a reply → the turn says so (AppTurn)
33
+ ```
34
+
35
+ **One failure, one notice.** The field, or the alert, or the pane state: never
36
+ two for the same thing.
37
+
38
+ ## Never
39
+
40
+ - **Silent.** A failure a person would notice always shows. Writing it to a log
41
+ is not showing it.
42
+ - **The machine's words.** No status code, no exception's message, no stack, no
43
+ "[unknown] Load failed". When the service sent a sentence written for a
44
+ person, show that sentence; otherwise write one.
45
+ - **A snackbar.** A failure stays until the person acts
46
+ ([AppAlert](../components/AppAlert.md)).
47
+ - **Red for what they didn't do.** A pane that couldn't load, or that they can't
48
+ open, is in ink: nothing they did failed. `error` is for an alert, a field, and
49
+ a thing whose state is Failed.
50
+ - **The whole screen.** The rail and the title bar stay, and so does every part
51
+ of the screen that did load.
52
+ - "Something went wrong" on its own, "Error:", "Oops", an apology, "please", an
53
+ exclamation mark.
54
+
55
+ ## The words
56
+
57
+ **What happened, then what to do, each as a sentence.** "Couldn't save the
58
+ environment. Check the name, then try again."
59
+
60
+ - **Start with "Couldn't" and name the thing in the person's words**: "Couldn't
61
+ load environments", "Couldn't send the interview". The product speaks; never
62
+ "I" or "we".
63
+ - **Say whose move it is.**
64
+
65
+ | The next step | Say |
66
+ | --- | --- |
67
+ | It will likely work again | "Try again.", with Try again as the action |
68
+ | It needs a moment | "Wait a moment, then try again." |
69
+ | They need to change something | what to change: "Use lowercase letters, numbers and hyphens only." |
70
+ | Someone else has to act | who: "Ask one of its owners to add you." |
71
+ | Nothing they can do | what happens to their work, and **Copy details** for support |
72
+
73
+ - **Details for support are copied, never shown.** Copy details is the notice's
74
+ one action only when there is no better next step.
75
+ - **No promise** about when it will work, and none that anyone has been told,
76
+ unless it is true.
77
+
78
+ ## A pane that can't show its content
79
+
80
+ [AppEmptyState](../components/AppEmptyState.md), without the drafting field:
81
+ this is work, not an invitation ([page.md](page.md) § The drafting field). A
82
+ headline in ink that says what couldn't happen, one supporting line that says
83
+ what to do, and one outlined action, the surface's lead. It may lead with the
84
+ neutral tile.
85
+
86
+ | | Headline | Line | Action |
87
+ | --- | --- | --- | --- |
88
+ | **Couldn't load** | "Couldn't load environments" | "Check your connection, then try again." | Try again, led by `refresh` |
89
+ | **No access** | "You don't have access to Renewal calls" | "Ask one of its owners to add you." | Request access, where the product can ask |
90
+ | **Not there** | "This project doesn't exist" | "It may have been deleted, or the link may be wrong." | Go to projects |
91
+ | **The service won't say which** | "You can't open this project" | "It may have been deleted, or you may not have access. Ask the person who sent you the link." | Go to projects |
92
+
93
+ - **It stands where the content would**, in the same conditional that renders
94
+ it ([loading.md](loading.md)). The title bar keeps the screen's name; search
95
+ and the filter row go, as when a list is empty. When they can't open the screen
96
+ at all, the bar's verbs go too.
97
+ - **The headline is `text-page-title` when it fills the screen's content, and
98
+ `text-section-title` in a detail pane or a card.**
99
+ - **Try again** shows its work on the button; the state stays until the content
100
+ arrives.
101
+ - **One section** that couldn't load is one line in its place
102
+ (`.app-empty-line`) with Try again beside it: "Couldn't load spend history."
103
+ The sections that did load stay.
104
+
105
+ ## Something they did failed
106
+
107
+ - **One error alert at the top of the form or pane they acted in**
108
+ ([AppAlert](../components/AppAlert.md)); a failure that belongs to a field
109
+ goes to the field instead ([page.md](page.md) § Forms).
110
+ - **The control returns to rest and what they entered stays.** A switch that
111
+ didn't apply flips back.
112
+ - **An action taken from a row or a menu** (Delete, Pause) puts its alert at the
113
+ top of the page, as a page-level notice ([page.md](page.md)).
114
+ - **The alert leaves when they act again**, never on a timer.
115
+ - **Work that fails later** (a deploy, an upload, a send to many people) changes
116
+ the thing's own state: its chip says Failed, and the alert waits in its pane
117
+ with the next step ([quick-start.md](quick-start.md) § 5).
118
+
119
+ ## What they may not do
120
+
121
+ - **Never theirs here**: leave the control out. The bar's verbs follow what can
122
+ be done ([page.md](page.md) § The title bar).
123
+ - **Theirs, but not now** (it needs a published version first, a limit is
124
+ reached): the control stays, disabled, with the reason in a supporting line
125
+ beside it. Never in a tooltip ([AppTooltip](../components/AppTooltip.md)), and
126
+ a lead that starts disabled is text until it can act
127
+ ([buttons.md](buttons.md)).
128
+ - **A whole screen they may not use** is the pane state above, never a screen of
129
+ disabled controls.
130
+
131
+ ## The app itself
132
+
133
+ - **The connection dropped.** One `warning` alert as the page-level notice:
134
+ "You're offline. What you do now may not be saved." It leaves by itself when
135
+ the connection returns. Nothing on the screen is disabled; what needs the
136
+ service fails into its own alert.
137
+ - **Signed out.** An [AppDialog](../components/AppDialog.md) over the screen as
138
+ it was: "You're signed out", "Sign in again to pick up where you left off.",
139
+ and one text action, Sign in again. It is the one dialog with no Cancel: there
140
+ is nothing to go back to. Signing in returns to the same screen, with what was
141
+ typed still there.
142
+ - **A new version is waiting.** The one snackbar that stays: "A new version is
143
+ ready." with Reload. It never interrupts and never reloads by itself.
144
+
145
+ ## Before you hand it back
146
+
147
+ 1. Switch the network off and load each screen you touched. Does every one say
148
+ what couldn't load, with a way to try again?
149
+ 2. Make the action you built fail. Does the button return to rest, with what
150
+ was entered still there?
151
+ 3. Is any text on screen something the machine wrote?
152
+ 4. Is there a `catch` that only logs?
package/rules/loading.md CHANGED
@@ -66,6 +66,9 @@ decides which screen comes next (an invitation link, account setup, a handoff).
66
66
  - **What is on screen stays on screen.** A refetch, a poll or a regeneration
67
67
  never blanks content or turns it back into a skeleton. A refresh the user asked
68
68
  for shows on the control they pressed.
69
+ - **A wait that fails says so where it stood**: the skeleton or the mark gives
70
+ way to what couldn't load and a way to try again ([errors.md](errors.md)),
71
+ never to a blank region or an endless wait.
69
72
  - **An empty state is an answer, not a wait.** Never show "No … yet" before the
70
73
  first response is back: start in the loading state, or gate the empty state on
71
74
  having loaded.
package/rules/page.md CHANGED
@@ -154,7 +154,8 @@ Then:
154
154
 
155
155
  Directly after the title bar, in the flow, never over it or inside it, so it
156
156
  moves the content down instead of covering the name. A screen with no title bar
157
- leads its content with it, or leaves it out.
157
+ leads its content with it, or leaves it out. What a failure shows, and where, is
158
+ [errors.md](errors.md).
158
159
 
159
160
  ## Empty and entry screens
160
161
 
@@ -190,6 +191,10 @@ leads its content with it, or leaves it out.
190
191
 
191
192
  - **One column at the prose measure** (`measure-prose`), fields 24px apart, the
192
193
  one filled action last and labelled with its outcome.
194
+ - **On a page, a form is one instrument card** ([AppCard](../components/AppCard.md)):
195
+ white, its edge, at the prose measure, its actions the card's action row. Its
196
+ parts are told apart by space and a `section-title`, never by lines across it.
197
+ In a dialog the dialog is the surface.
193
198
  - **A field is labelled above**, in label type. A set of choices (tiles,
194
199
  checkboxes, radios) is labelled once, as a group, the same way.
195
200
  - **Detail few people need folds** under its title
@@ -225,6 +230,37 @@ leads its content with it, or leaves it out.
225
230
  at the top.
226
231
  - **A switch** applies at once on its own, and with the rest on Save inside a form.
227
232
 
233
+ ### A form in steps
234
+
235
+ ```
236
+ Should this form take steps?
237
+ ├─ It fits one screen without overwhelming → no: one form
238
+ ├─ Later parts depend on earlier answers, or
239
+ │ a review must come before it reaches people → steps (AppStepper)
240
+ ├─ Each step is one question with no short name → steps, shown as the
241
+ │ AppProgress bar ("Step 2 of 6")
242
+ └─ Views of one thing, or work the system runs → not steps: AppSegmented, AppProgress
243
+ ```
244
+
245
+ - **Two to five steps, each named in a word or two.** More than five is two flows.
246
+ - **[AppStepper](../components/AppStepper.md) leads the flow's surface**: the top
247
+ of its card on a page, under the title in a dialog. No panel round it, and no
248
+ "Step 1 of 2" beside it.
249
+ - **One action row at the foot.** Back is text, on the leading edge, from the
250
+ second step. The forward action is the one filled button, last: "Continue", or
251
+ named by its outcome when the step makes something ("Create collection") and on
252
+ the last step ("Publish interview"). "Save draft", where the flow keeps drafts,
253
+ is text beside it.
254
+ - **Continue is never disabled.** It checks the step, puts each error at its
255
+ field and stays (§ Forms). A done step is a way back; a later one is reached
256
+ only by Continue.
257
+ - **The last step is the confirmation** when the flow reaches past the user: its
258
+ title asks the question ("Publish this interview?"), it lists what was chosen,
259
+ and its button names the outcome. No dialog after it.
260
+ - **A result is not a step.** When the flow ends, show the thing it made.
261
+ - **The step is in the URL** (`?step=review`), so a refresh keeps it and the
262
+ browser's back steps back.
263
+
228
264
  ### Which control
229
265
 
230
266
  ```
@@ -50,6 +50,7 @@ AppShell
50
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
51
  | The keys a screen answers to | `AppShortcutSheet`, opened by `?` and from the account menu, in the detail pane's place |
52
52
  | A form | `.app-form` of fields, one filled action last (see § Forms) |
53
+ | A form in named steps | `AppStepper` at the top of the form's card; Back on the leading edge, one filled forward action ([page.md](page.md) § A form in steps) |
53
54
  | Text | `AppTextField` (with `action` for one that collects several values, shown as input `AppChip`s below) |
54
55
  | One choice from a list | `AppSelect`; past about ten options, or to choose several, `AppCombobox` |
55
56
  | An on/off setting | `AppSwitch` |
@@ -65,6 +66,8 @@ AppShell
65
66
  | Waiting, shape known | `AppSkeleton` in the content's shape |
66
67
  | Waiting, shape unknown | `AppLoader` |
67
68
  | Work you can count (a deploy, an upload) | `AppProgress`, with `AppSteps` for named stages |
69
+ | A screen or pane that couldn't load, or that they can't open | `AppEmptyState` without the drafting field: what couldn't happen, what to do, one action ([errors.md](errors.md)) |
70
+ | Something they did failed | one `AppAlert tone="error"` at the top of the form or pane, in words a person wrote; never a snackbar, never the machine's message |
68
71
  | Nothing yet | `AppEmptyState` filling the pane; keep the bar's name and verb, hide search and the filter row |
69
72
 
70
73
  ## 4. The values you'll reach for
@@ -108,7 +108,9 @@ never `primary`.
108
108
  location: a chip that says so, no fill. Choosing an account from a list is a
109
109
  selection, not location: the fill and `check_circle`.
110
110
  - **A step** in a sequence: done is a check, current a filled number in ink, next
111
- an outlined number. Never `primary`.
111
+ an outlined number. In a form's steps ([AppStepper](../components/AppStepper.md))
112
+ the segments carry it: done and current ink, next the track, the current name
113
+ at 600. Never `primary`.
112
114
  - **Unread** is emphasis, 600, and a dot. No fill.
113
115
  - **A button, a hover and a badge are not selections.** A button never shows an
114
116
  active state to mean "current", and a row's badge hides once the row is