@alis-build/design-system 0.22.0 → 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 +24 -0
- package/classes.json +9 -0
- package/components/AppButton.md +7 -1
- package/components/AppProgress.md +1 -1
- package/components/AppStepper.md +76 -0
- package/components/README.md +1 -0
- package/package.json +1 -1
- package/rules/page.md +35 -0
- package/rules/quick-start.md +1 -0
- package/rules/selection.md +3 -1
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)}
|
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",
|
|
@@ -247,6 +248,13 @@
|
|
|
247
248
|
"app-state",
|
|
248
249
|
"app-statement-over-gradient",
|
|
249
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",
|
|
250
258
|
"app-steps",
|
|
251
259
|
"app-switch",
|
|
252
260
|
"app-switch-row",
|
|
@@ -337,6 +345,7 @@
|
|
|
337
345
|
"is-failed",
|
|
338
346
|
"is-gone",
|
|
339
347
|
"is-interactive",
|
|
348
|
+
"is-invalid",
|
|
340
349
|
"is-latest",
|
|
341
350
|
"is-loading",
|
|
342
351
|
"is-locked",
|
package/components/AppButton.md
CHANGED
|
@@ -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`.
|
|
@@ -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.
|
package/components/README.md
CHANGED
|
@@ -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.
|
|
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/page.md
CHANGED
|
@@ -191,6 +191,10 @@ leads its content with it, or leaves it out. What a failure shows, and where, is
|
|
|
191
191
|
|
|
192
192
|
- **One column at the prose measure** (`measure-prose`), fields 24px apart, the
|
|
193
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.
|
|
194
198
|
- **A field is labelled above**, in label type. A set of choices (tiles,
|
|
195
199
|
checkboxes, radios) is labelled once, as a group, the same way.
|
|
196
200
|
- **Detail few people need folds** under its title
|
|
@@ -226,6 +230,37 @@ leads its content with it, or leaves it out. What a failure shows, and where, is
|
|
|
226
230
|
at the top.
|
|
227
231
|
- **A switch** applies at once on its own, and with the rest on Save inside a form.
|
|
228
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
|
+
|
|
229
264
|
### Which control
|
|
230
265
|
|
|
231
266
|
```
|
package/rules/quick-start.md
CHANGED
|
@@ -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` |
|
package/rules/selection.md
CHANGED
|
@@ -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.
|
|
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
|