@alis-build/design-system 0.57.0 → 0.61.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/README.md CHANGED
@@ -18,10 +18,11 @@ product screens in any framework: Svelte, Vue, or plain HTML.
18
18
  | `marks.json` | The capability marks (`alis_*`): construction, stroke grade by size, geometry, in canonical order. |
19
19
  | `words.json` | One name per thing: what each means, what it replaces, and the code word where it differs. Read it wherever words are written for people, an AI's instructions included (`rules/words.md`). |
20
20
  | `email/` | The email shell (`shell.html`), its blocks (`blocks.html`) and plain-text twin (`shell.txt`), with every colour written in from the product roles, and the wordmark as PNG (`rules/email.md`). |
21
+ | `hosts/` | One profile per host we appear inside (Microsoft Teams first): what it can do, with sources, and where it differs from `rules/hosts.md`, as a page and as data (`teams.json`). |
21
22
  | `assets/Brand/` | The Alis mark, product lockups, app icon and favicon. |
22
23
  | `stylelint.mjs` | The style check that restates `rules/styling.md`, as a stylelint config your own extends. |
23
24
  | `classes.json` | Every class and custom property `alisx.css` defines in this version. |
24
- | `check.mjs` | `alisx-check`: runs the three checks below in your build. |
25
+ | `check.mjs` | `alisx-check`: runs the four checks below in your build. |
25
26
 
26
27
  ```bash
27
28
  pnpm add -E @alis-build/design-system
@@ -122,7 +123,8 @@ export default {
122
123
  "lint:styles": "alisx-check styles \"src/**/*.{css,svelte,vue}\"",
123
124
  "lint:styles:record": "alisx-check styles \"src/**/*.{css,svelte,vue}\" --update",
124
125
  "lint:words": "alisx-check words src",
125
- "lint:words:record": "alisx-check words src --update"
126
+ "lint:words:record": "alisx-check words src --update",
127
+ "lint:cards": "alisx-check cards src"
126
128
  }
127
129
  ```
128
130
 
@@ -152,6 +154,12 @@ export default {
152
154
  Its baseline, `alisx-words-baseline.json`, works as the styles one does. A
153
155
  use that must stay is marked on its line or the line above:
154
156
  `alisx-words-ignore -- the reason`.
157
+ - `alisx-check cards` fails on something you can press inside a card you open
158
+ (an `<a>` or `<button>` with `app-card` in its class): a link, a button, a
159
+ field, a `<details>`, an element with a control's `role`, or a `tabindex`. It
160
+ is a gate with no baseline, because the markup is invalid HTML too. It reads
161
+ plain elements only: a framework's own components (a `<Button>`) need that
162
+ framework's lint.
155
163
  - `alisx-check words --text <file>` reads a words file instead of markup: the
156
164
  plain text a terminal app writes out of everything it says, in blocks headed
157
165
  `== kind place · area`, then one `field<TAB>text` line per thing read.
package/alisx.css CHANGED
@@ -152,6 +152,7 @@
152
152
  --measure-prose: 710px;
153
153
  --nav-width: 256px;
154
154
  --detail-width: 360px;
155
+ --card-min-width: 320px;
155
156
  --breakpoint-compact: 600px;
156
157
  --breakpoint-medium: 840px;
157
158
  --breakpoint-expanded: 1200px;
@@ -185,6 +186,7 @@
185
186
  --loop-look: 5s ease-in-out infinite;
186
187
  --loop-speak: 1.3s ease-in-out infinite;
187
188
  --loop-trace: 2.2s linear infinite;
189
+ --loop-tick: 1.8s ease-in-out infinite;
188
190
  --loop-blink: 1.1s steps(1) infinite;
189
191
  --state-hover: 0.04;
190
192
  --state-focus: 0.04;
@@ -367,6 +369,88 @@
367
369
  @media (pointer: coarse) { :root { --touch-target: var(--touch-target-coarse); --control-height: var(--touch-target-coarse); } }
368
370
  @media (prefers-reduced-motion: reduce) { :root { --dur-tint: 0ms; --dur-ui: 0ms; --dur-panel: 0ms; --dur-arrive: 0ms; --stagger: 0ms; } }
369
371
 
372
+ /* Host theme "contrast": only where a host profile maps to it, on <html> only, never in print (rules/themes.md § Contrast and forced colours). */
373
+ @media screen and (forced-colors: none) {
374
+ :root[data-theme="contrast"] {
375
+ color-scheme: dark;
376
+ --primary: #7fd4e8;
377
+ --on-primary: #000000;
378
+ --signal: #f02222;
379
+ --on-surface: #ffffff;
380
+ --on-surface-variant: #c4cbd0;
381
+ --background: #000000;
382
+ --surface: #000000;
383
+ --surface-container-low: #000000;
384
+ --surface-container-high: #000000;
385
+ --surface-container-highest: #000000;
386
+ --surface-variant: #000000;
387
+ --shimmer: #000000;
388
+ --secondary-container: #ffffff;
389
+ --on-secondary-container: #000000;
390
+ --selection-chrome: #ffffff;
391
+ --outline: #ffffff;
392
+ --field-edge: #ffffff;
393
+ --field-edge-hover: #ffffff;
394
+ --outline-variant: #ffffff;
395
+ --error: #ffb4ab;
396
+ --on-error: #000000;
397
+ --warning: #ffffff;
398
+ --success: #ffffff;
399
+ --info: #ffffff;
400
+ --inverse-surface: #ffffff;
401
+ --on-inverse-surface: #000000;
402
+ --code-surface: #000000;
403
+ --machine-surface: #000000;
404
+ --on-machine-surface: #ffffff;
405
+ --paper: #ffffff;
406
+ --scrim: #000000;
407
+ --shadow-key: transparent;
408
+ --glass-rim: transparent;
409
+ --glass-edge: #ffffff;
410
+ --glass-grid: transparent;
411
+ --shadow-ambient: transparent;
412
+ --highlight: #ffffff;
413
+ --on-highlight: #000000;
414
+ --cat1: #ffffff;
415
+ --cat2: #ffffff;
416
+ --cat3: #ffffff;
417
+ --cat4: #ffffff;
418
+ --cat5: #ffffff;
419
+ --cat6: #ffffff;
420
+ --on-cat: #000000;
421
+ --cat1-container: #000000;
422
+ --cat2-container: #000000;
423
+ --cat3-container: #000000;
424
+ --cat4-container: #000000;
425
+ --cat5-container: #000000;
426
+ --cat6-container: #000000;
427
+ --on-cat1-container: #ffffff;
428
+ --on-cat2-container: #ffffff;
429
+ --on-cat3-container: #ffffff;
430
+ --on-cat4-container: #ffffff;
431
+ --on-cat5-container: #ffffff;
432
+ --on-cat6-container: #ffffff;
433
+ --chart-neutral: #c4cbd0;
434
+ --syntax-plain: #ffffff;
435
+ --syntax-comment: #c4cbd0;
436
+ --syntax-keyword: #ffffff;
437
+ --syntax-string: #ffffff;
438
+ --syntax-number: #ffffff;
439
+ --syntax-function: #ffffff;
440
+ --ai-you: #ffffff;
441
+ --ai-you-container: #000000;
442
+ --ai-alis: #f02222;
443
+ --ai-alis-container: #000000;
444
+ --ai-tail: #ffffff;
445
+ --ai-ground-start: #000000;
446
+ --ai-ground-end: #000000;
447
+ --field-grid-line: transparent;
448
+ --field-glow-1: transparent;
449
+ --field-glow-2: transparent;
450
+ --field-noise: transparent;
451
+ }
452
+ }
453
+
370
454
  /* Type styles: one class per job (rules/type.md). */
371
455
  .text-welcome-title { font-family: var(--font-sans); font-size: 40px; line-height: 48px; font-weight: 800; letter-spacing: -0.03em; }
372
456
  .text-page-title { font-family: var(--font-sans); font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -0.03em; }
@@ -536,6 +620,16 @@ button, input, textarea, select { font: inherit; }
536
620
  button.app-card{border:0;font:inherit;width:100%}
537
621
  .app-card__title{margin:0}
538
622
  .app-card>.app-btn-row{margin-top:var(--space-8)}
623
+ /* A card in a collection (0.59.0): the cover, a line on why, the name on one line, two lines that sell it, and the foot at the bottom, so a row's feet line up. The card's padding and gap space its parts; a part brings none of its own */
624
+ .app-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--card-min-width)),1fr));gap:var(--space-16)}
625
+ .app-card__cover{position:relative;flex:none;height:80px;margin-bottom:var(--space-8);border-radius:var(--radius-md);background:var(--surface-container-low);overflow:hidden}
626
+ .app-card__tags{position:absolute;top:var(--space-8);left:var(--space-8);display:flex;gap:var(--space-4)}
627
+ .app-card__reason{margin:0 0 calc(var(--space-4) - var(--space-8));color:var(--on-surface-variant);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
628
+ .app-card-grid .app-card__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
629
+ .app-card__summary{margin:0;color:var(--on-surface-variant);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
630
+ .app-card__foot{display:flex;align-items:center;justify-content:space-between;gap:var(--space-12);min-width:0;margin-top:auto;padding-top:var(--space-8);color:var(--on-surface-variant)}
631
+ .app-card__foot>:first-child{display:flex;align-items:center;gap:var(--space-8);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
632
+ .app-card__foot>:last-child:not(:first-child){flex:none}
539
633
  /* A statement over a gradient: the role at the statement opacity */
540
634
  .app-statement-over-gradient{background:color-mix(in srgb,var(--on-surface) calc(var(--state-statement) * 100%),transparent)}
541
635
  /* The AI identity: a drawing, from its own tokens, never a category */
@@ -1553,12 +1647,15 @@ a.app-token,button.app-token{border:0;font:inherit;font-weight:600;cursor:pointe
1553
1647
  link, menu row or navigation row holding the mark is hovered or focused. Live: a loop, only while the product marks the
1554
1648
  mark is-live, and never on Projects or Artifacts, which have nothing that runs. All of it is drawn here, from the classes
1555
1649
  marks.json names; a site never animates a mark. Under reduced motion nothing moves ── */
1556
- .app-mark :is(.app-mark__glint,.app-mark__arc,.app-mark__line,.app-mark__cloud,.app-mark__prompt,.app-mark__dot){transform-box:view-box;transform-origin:12px 12px;transition:transform var(--spring-default-spatial)}
1650
+ .app-mark :is(.app-mark__glint,.app-mark__arc,.app-mark__line,.app-mark__cloud,.app-mark__prompt,.app-mark__boom,.app-mark__dot){transform-box:view-box;transform-origin:12px 12px;transition:transform var(--spring-default-spatial)}
1557
1651
  .app-mark .app-mark__piece{transform-box:fill-box;transform-origin:center;transition:transform var(--spring-default-spatial)}
1558
1652
  .app-mark .app-mark__piece~.app-mark__piece,.app-mark--environments .app-mark__dot{transition-delay:60ms}
1559
1653
  .app-mark--interviews .app-mark__line{transform-origin:8.8px 6.8px}
1654
+ /* The Support mic swings from the ear cup it hangs off */
1655
+ .app-mark--support :is(.app-mark__boom,.app-mark__dot){transform-origin:19.4px 16px}
1656
+ .app-mark--activity .app-mark__dot{transform-box:fill-box;transform-origin:center}
1560
1657
  @media (prefers-reduced-motion:no-preference){
1561
- /* The Skill store's dot runs its loop: a path from where it sits, round both lobes and back, so it starts and ends in place */
1658
+ /* The AlisX Skill Store's dot runs its loop: a path from where it sits, round both lobes and back, so it starts and ends in place */
1562
1659
  .app-mark--skills .app-mark__dot{transform-box:fill-box;transform-origin:center;offset-anchor:center;offset-rotate:0deg;offset-path:path('M15.16 14.52C16.4 15.66 17.6 16.5 18.5 16.5A4.5 4.5 0 0 0 18.5 7.5C15.5 7.5 8.5 16.5 5.5 16.5A4.5 4.5 0 0 1 5.5 7.5C6.55 7.5 8.09 8.6 9.78 10.04L15.16 14.52')}
1563
1660
  :is(:is(button,a,[role="button"],[role="menuitem"]):is(:hover,:focus-visible),.app-row:is(:hover,:has(:focus-visible))) .app-mark--glass .app-mark__glint{transform:rotate(40deg)}
1564
1661
  :is(:is(button,a,[role="button"],[role="menuitem"]):is(:hover,:focus-visible),.app-row:is(:hover,:has(:focus-visible))) .app-mark--glass .app-mark__dot{transform:rotate(-28deg)}
@@ -1568,17 +1665,28 @@ a.app-token,button.app-token{border:0;font:inherit;font-weight:600;cursor:pointe
1568
1665
  :is(:is(button,a,[role="button"],[role="menuitem"]):is(:hover,:focus-visible),.app-row:is(:hover,:has(:focus-visible))) .app-mark--skills .app-mark__dot{animation:app-mark-round calc(var(--spring-default-spatial-duration) * 2) var(--spring-slow-spatial-easing) both}
1569
1666
  :is(:is(button,a,[role="button"],[role="menuitem"]):is(:hover,:focus-visible),.app-row:is(:hover,:has(:focus-visible))) .app-mark--environments :is(.app-mark__cloud,.app-mark__dot){transform:translateY(-1.6px)}
1570
1667
  :is(:is(button,a,[role="button"],[role="menuitem"]):is(:hover,:focus-visible),.app-row:is(:hover,:has(:focus-visible))) .app-mark--workstations .app-mark__prompt{transform:translateX(1.5px)}
1668
+ :is(:is(button,a,[role="button"],[role="menuitem"]):is(:hover,:focus-visible),.app-row:is(:hover,:has(:focus-visible))) .app-mark--activity .app-mark__trace{animation:app-mark-redraw calc(var(--spring-default-spatial-duration) * 2) var(--spring-slow-spatial-easing) both}
1669
+ :is(:is(button,a,[role="button"],[role="menuitem"]):is(:hover,:focus-visible),.app-row:is(:hover,:has(:focus-visible))) .app-mark--activity .app-mark__dot{animation:app-mark-land calc(var(--spring-default-spatial-duration) * 2) var(--spring-slow-spatial-easing) both}
1670
+ :is(:is(button,a,[role="button"],[role="menuitem"]):is(:hover,:focus-visible),.app-row:is(:hover,:has(:focus-visible))) .app-mark--support :is(.app-mark__boom,.app-mark__dot){transform:rotate(9deg)}
1571
1671
  .app-mark--glass.is-live .app-mark__dot{animation:app-mark-look var(--loop-look)}
1572
1672
  .app-mark--interviews.is-live .app-mark__line{animation:app-mark-speak var(--loop-speak)}
1573
1673
  .app-mark--skills.is-live .app-mark__dot{animation:app-mark-round var(--loop-orbit)}
1574
1674
  .app-mark--environments.is-live .app-mark__cloud{stroke-dasharray:44.63 5;animation:app-mark-trace var(--loop-trace)}
1575
1675
  .app-mark--workstations.is-live .app-mark__dot{animation:app-dot var(--loop-blink)}
1676
+ .app-mark--activity.is-live .app-mark__dot{animation:app-mark-tick var(--loop-tick)}
1677
+ .app-mark--support.is-live .app-mark__dot{animation:app-mark-mic var(--loop-speak)}
1576
1678
  }
1577
1679
  @keyframes app-mark-round{from{offset-distance:0%}to{offset-distance:100%}}
1578
1680
  @keyframes app-mark-look{0%,100%{transform:translate(0,0)}20%{transform:translate(-3.2px,-.6px)}40%{transform:translate(-2.4px,-3.4px)}60%{transform:translate(.4px,-4px)}80%{transform:translate(.6px,-1px)}}
1579
1681
  @keyframes app-mark-speak{0%,100%{transform:scaleX(1)}25%{transform:scaleX(.55)}50%{transform:scaleX(.85)}75%{transform:scaleX(.4)}}
1580
1682
  /* 49.63 is the cloud's length in the mark's own units, so the gap is the same at every size */
1581
1683
  @keyframes app-mark-trace{to{stroke-dashoffset:-49.63}}
1684
+ /* 18.47 is the Activity trace's length: it pulls back to its start and draws out again to now, while the dot lands */
1685
+ @keyframes app-mark-redraw{0%{stroke-dasharray:18.47;stroke-dashoffset:0}32%{stroke-dasharray:18.47;stroke-dashoffset:18.47}100%{stroke-dasharray:18.47;stroke-dashoffset:0}}
1686
+ @keyframes app-mark-land{0%{transform:scale(1)}28%,72%{transform:scale(.35)}100%{transform:scale(1)}}
1687
+ @keyframes app-mark-tick{0%,100%{transform:translateY(0)}35%{transform:translateY(-2.2px)}65%{transform:translateY(.6px)}}
1688
+ /* The mic talks by its edge, not a transform, so it stays on the boom while the boom swings */
1689
+ @keyframes app-mark-mic{0%,100%{stroke:currentColor;stroke-width:0}25%{stroke:currentColor;stroke-width:1.2px}50%{stroke:currentColor;stroke-width:.3px}75%{stroke:currentColor;stroke-width:1px}}
1582
1690
 
1583
1691
  /* ── Scrollbars · one treatment for the app ── */
1584
1692
  *{scrollbar-width:thin;scrollbar-color:var(--outline-variant) transparent}
@@ -1733,3 +1841,126 @@ a.app-token,button.app-token{border:0;font:inherit;font-weight:600;cursor:pointe
1733
1841
  .app-shell--nav-open .app-shell__nav{opacity:1}
1734
1842
  @starting-style{.app-shell--nav-open .app-shell__nav{opacity:0}}
1735
1843
  }
1844
+
1845
+ /* Forced colours (rules/themes.md § Contrast and forced colours): the operating system picks every colour; edges stand in for shadows and fills. GENERATED from source/css/contrast.css. */
1846
+ @media (forced-colors: active) {
1847
+ :root { --contrast-ink: CanvasText; --contrast-muted: GrayText; --contrast-edge: CanvasText; --contrast-focus: Highlight; --contrast-selected: Highlight; --contrast-on-selected: HighlightText; }
1848
+
1849
+
1850
+
1851
+ .app-dialog,.app-menu,.app-tooltip,.app-machine,.app-snackbar,.app-composer__box,.app-capture-peek,.app-selection-ask,.app-shell__detail,.app-card,.app-tile,.app-alert,.app-ask,.app-code,.prose pre,.app-handoff__context,.app-attachment.is-gone .app-attachment__glyph{outline:1px solid var(--contrast-edge);outline-offset:-1px}
1852
+
1853
+ .app-code,.prose pre,.app-handoff__context,.app-attachment.is-gone .app-attachment__glyph{box-shadow:none}
1854
+ .app-card.is-dragged,.app-row.is-dragged{outline:2px solid var(--contrast-edge);outline-offset:-2px}
1855
+
1856
+
1857
+ .app-btn--filled{outline:1px solid var(--contrast-edge);outline-offset:-1px}
1858
+
1859
+
1860
+ .app-titlebar.is-scrolled,.app-file-pane__bar.is-scrolled{border-bottom:1px solid var(--contrast-edge);margin-bottom:-1px;box-shadow:none}
1861
+ .app-dialog__body.is-scrolled,.app-dialog__body.is-more{box-shadow:none}
1862
+ .app-dialog__body.is-scrolled{border-top:1px solid var(--contrast-edge);margin-top:-1px}
1863
+ .app-dialog__body.is-more{border-bottom:1px solid var(--contrast-edge);margin-bottom:-1px}
1864
+
1865
+
1866
+ .app-field__box:focus-within,.app-code-field__cell.is-active,.app-code-field:not(.is-drawn) .app-code-field__input:focus,.app-combo__trigger:focus-visible,.app-combo__trigger[aria-expanded="true"]{outline:2px solid var(--contrast-focus);outline-offset:-2px;box-shadow:none}
1867
+ .app-field.is-error .app-field__box,.app-code-field.is-error .app-code-field__cell,.app-code-field.is-error:not(.is-drawn) .app-code-field__input{outline:2px dashed var(--contrast-ink);outline-offset:-2px;box-shadow:none}
1868
+ .app-state:focus-visible,.app-switch:focus-visible,.app-checkbox:focus-visible,.app-radio:focus-visible,.app-menu__item:focus-visible,.app-menu__item.is-active,.app-row:has(.app-row__hit:focus-visible),.app-table tr:has(.app-row__hit:focus-visible),.app-search:focus-within,.drop-target{outline-color:var(--contrast-focus)}
1869
+
1870
+ :is(.app-row.is-selected,.app-row--nav.is-selected,.app-tile.is-selected,.app-icon-btn.is-selected,.app-menu__item.is-selected,.app-ask__option.is-selected):is(:focus-visible,.is-active,:has(.app-row__hit:focus-visible)){outline-color:var(--contrast-on-selected)}
1871
+
1872
+
1873
+ .app-row.is-selected,.app-row--nav.is-selected,.app-tile.is-selected,.app-icon-btn.is-selected,.app-chip--outlined.is-selected,.app-attachment.is-selected,.app-voice__round.is-selected,.app-ask__option.is-selected,.app-menu__item.is-selected,.app-table tr.is-selected>td{forced-color-adjust:none;background:var(--contrast-selected);color:var(--contrast-on-selected)}
1874
+
1875
+ :is(.app-row.is-selected,.app-row--nav.is-selected,.app-tile.is-selected,.app-attachment.is-selected,.app-menu__item.is-selected,.app-table tr.is-selected>td) :is(.app-checkbox,.app-radio,.app-chip,.app-icon-btn,.app-attachment__glyph,.app-btn){forced-color-adjust:auto}
1876
+ :is(.app-row.is-selected,.app-row--nav.is-selected,.app-tile.is-selected,.app-icon-btn.is-selected,.app-chip--outlined.is-selected,.app-attachment.is-selected,.app-voice__round.is-selected,.app-ask__option.is-selected,.app-menu__item.is-selected,.app-table tr.is-selected>td) :is(.text-label,.text-object-title,.text-supporting,.text-meta,.app-icon,.app-row__icon,.app-tile__check,.app-menu__support,.app-attachment__text){color:var(--contrast-on-selected)}
1877
+ .app-ask__option.is-selected .app-ask__key{forced-color-adjust:none;background:var(--contrast-on-selected);color:var(--contrast-selected)}
1878
+ .app-tab.is-selected::after{forced-color-adjust:none;background:var(--contrast-selected)}
1879
+ .app-seg:not(.app-seg--travel)>.app-seg__item.is-selected{outline:2px solid var(--contrast-selected);outline-offset:-2px}
1880
+ .app-seg--travel::before{forced-color-adjust:none;border:2px solid var(--contrast-selected)}
1881
+
1882
+
1883
+ .app-checkbox:is(:checked,:indeterminate,.is-checked){forced-color-adjust:none;border-color:var(--contrast-selected);background:var(--contrast-selected)}
1884
+ .app-radio:checked{forced-color-adjust:none;border-color:var(--contrast-selected)}
1885
+ .app-checkbox:is(:checked,.is-checked)::before{forced-color-adjust:none;border-color:var(--contrast-on-selected)}
1886
+ .app-checkbox:indeterminate::before{forced-color-adjust:none;background:var(--contrast-on-selected)}
1887
+ .app-radio:checked::before{forced-color-adjust:none;background:var(--contrast-selected)}
1888
+ .app-switch::before{forced-color-adjust:none;background:var(--contrast-ink)}
1889
+ .app-switch:checked{forced-color-adjust:none;border-color:var(--contrast-selected);background:var(--contrast-selected)}
1890
+ .app-switch:checked::before{background:var(--contrast-on-selected)}
1891
+
1892
+
1893
+ .app-progress__track{outline:1px solid var(--contrast-edge);outline-offset:-1px}
1894
+ .app-progress__fill{forced-color-adjust:none;background:var(--contrast-selected)}
1895
+ .app-progress.is-error .app-progress__fill{background:var(--contrast-ink)}
1896
+ .app-skel__bar,.app-skel__dot{outline:1px solid var(--contrast-muted);outline-offset:-1px}
1897
+ .app-skel__bar::after{display:none}
1898
+
1899
+
1900
+ .app-row.is-arriving{background-color:transparent}
1901
+
1902
+
1903
+ .app-ai-text{background:none;color:var(--contrast-ink)}
1904
+ }
1905
+
1906
+ /* The contrast block under host theme "contrast". GENERATED from source/css/contrast.css. */
1907
+ @media screen and (forced-colors: none) {
1908
+ :where(:root[data-theme="contrast"]) { --contrast-ink: #ffffff; --contrast-muted: #c4cbd0; --contrast-edge: #ffffff; --contrast-focus: #7fd4e8; --contrast-selected: #ffffff; --contrast-on-selected: #000000;
1909
+
1910
+
1911
+
1912
+ .app-dialog,.app-menu,.app-tooltip,.app-machine,.app-snackbar,.app-composer__box,.app-capture-peek,.app-selection-ask,.app-shell__detail,.app-card,.app-tile,.app-alert,.app-ask,.app-code,.prose pre,.app-handoff__context,.app-attachment.is-gone .app-attachment__glyph{outline:1px solid var(--contrast-edge);outline-offset:-1px}
1913
+
1914
+ .app-code,.prose pre,.app-handoff__context,.app-attachment.is-gone .app-attachment__glyph{box-shadow:none}
1915
+ .app-card.is-dragged,.app-row.is-dragged{outline:2px solid var(--contrast-edge);outline-offset:-2px}
1916
+
1917
+
1918
+ .app-btn--filled{outline:1px solid var(--contrast-edge);outline-offset:-1px}
1919
+
1920
+
1921
+ .app-titlebar.is-scrolled,.app-file-pane__bar.is-scrolled{border-bottom:1px solid var(--contrast-edge);margin-bottom:-1px;box-shadow:none}
1922
+ .app-dialog__body.is-scrolled,.app-dialog__body.is-more{box-shadow:none}
1923
+ .app-dialog__body.is-scrolled{border-top:1px solid var(--contrast-edge);margin-top:-1px}
1924
+ .app-dialog__body.is-more{border-bottom:1px solid var(--contrast-edge);margin-bottom:-1px}
1925
+
1926
+
1927
+ .app-field__box:focus-within,.app-code-field__cell.is-active,.app-code-field:not(.is-drawn) .app-code-field__input:focus,.app-combo__trigger:focus-visible,.app-combo__trigger[aria-expanded="true"]{outline:2px solid var(--contrast-focus);outline-offset:-2px;box-shadow:none}
1928
+ .app-field.is-error .app-field__box,.app-code-field.is-error .app-code-field__cell,.app-code-field.is-error:not(.is-drawn) .app-code-field__input{outline:2px dashed var(--contrast-ink);outline-offset:-2px;box-shadow:none}
1929
+ .app-state:focus-visible,.app-switch:focus-visible,.app-checkbox:focus-visible,.app-radio:focus-visible,.app-menu__item:focus-visible,.app-menu__item.is-active,.app-row:has(.app-row__hit:focus-visible),.app-table tr:has(.app-row__hit:focus-visible),.app-search:focus-within,.drop-target{outline-color:var(--contrast-focus)}
1930
+
1931
+ :is(.app-row.is-selected,.app-row--nav.is-selected,.app-tile.is-selected,.app-icon-btn.is-selected,.app-menu__item.is-selected,.app-ask__option.is-selected):is(:focus-visible,.is-active,:has(.app-row__hit:focus-visible)){outline-color:var(--contrast-on-selected)}
1932
+
1933
+
1934
+ .app-row.is-selected,.app-row--nav.is-selected,.app-tile.is-selected,.app-icon-btn.is-selected,.app-chip--outlined.is-selected,.app-attachment.is-selected,.app-voice__round.is-selected,.app-ask__option.is-selected,.app-menu__item.is-selected,.app-table tr.is-selected>td{forced-color-adjust:none;background:var(--contrast-selected);color:var(--contrast-on-selected)}
1935
+
1936
+ :is(.app-row.is-selected,.app-row--nav.is-selected,.app-tile.is-selected,.app-attachment.is-selected,.app-menu__item.is-selected,.app-table tr.is-selected>td) :is(.app-checkbox,.app-radio,.app-chip,.app-icon-btn,.app-attachment__glyph,.app-btn){forced-color-adjust:auto}
1937
+ :is(.app-row.is-selected,.app-row--nav.is-selected,.app-tile.is-selected,.app-icon-btn.is-selected,.app-chip--outlined.is-selected,.app-attachment.is-selected,.app-voice__round.is-selected,.app-ask__option.is-selected,.app-menu__item.is-selected,.app-table tr.is-selected>td) :is(.text-label,.text-object-title,.text-supporting,.text-meta,.app-icon,.app-row__icon,.app-tile__check,.app-menu__support,.app-attachment__text){color:var(--contrast-on-selected)}
1938
+ .app-ask__option.is-selected .app-ask__key{forced-color-adjust:none;background:var(--contrast-on-selected);color:var(--contrast-selected)}
1939
+ .app-tab.is-selected::after{forced-color-adjust:none;background:var(--contrast-selected)}
1940
+ .app-seg:not(.app-seg--travel)>.app-seg__item.is-selected{outline:2px solid var(--contrast-selected);outline-offset:-2px}
1941
+ .app-seg--travel::before{forced-color-adjust:none;border:2px solid var(--contrast-selected)}
1942
+
1943
+
1944
+ .app-checkbox:is(:checked,:indeterminate,.is-checked){forced-color-adjust:none;border-color:var(--contrast-selected);background:var(--contrast-selected)}
1945
+ .app-radio:checked{forced-color-adjust:none;border-color:var(--contrast-selected)}
1946
+ .app-checkbox:is(:checked,.is-checked)::before{forced-color-adjust:none;border-color:var(--contrast-on-selected)}
1947
+ .app-checkbox:indeterminate::before{forced-color-adjust:none;background:var(--contrast-on-selected)}
1948
+ .app-radio:checked::before{forced-color-adjust:none;background:var(--contrast-selected)}
1949
+ .app-switch::before{forced-color-adjust:none;background:var(--contrast-ink)}
1950
+ .app-switch:checked{forced-color-adjust:none;border-color:var(--contrast-selected);background:var(--contrast-selected)}
1951
+ .app-switch:checked::before{background:var(--contrast-on-selected)}
1952
+
1953
+
1954
+ .app-progress__track{outline:1px solid var(--contrast-edge);outline-offset:-1px}
1955
+ .app-progress__fill{forced-color-adjust:none;background:var(--contrast-selected)}
1956
+ .app-progress.is-error .app-progress__fill{background:var(--contrast-ink)}
1957
+ .app-skel__bar,.app-skel__dot{outline:1px solid var(--contrast-muted);outline-offset:-1px}
1958
+ .app-skel__bar::after{display:none}
1959
+
1960
+
1961
+ .app-row.is-arriving{background-color:transparent}
1962
+
1963
+
1964
+ .app-ai-text{background:none;color:var(--contrast-ink)}
1965
+ }
1966
+ }
package/check.mjs CHANGED
@@ -33,7 +33,8 @@
33
33
  // alisx-words-baseline.json). A line marked alisx-words-ignore with a
34
34
  // reason, or the line under it, is skipped. A retired name written with a
35
35
  // capital (Read only) is a label, and counts only when it has the capital:
36
- // "read only the parts that matter" is English.
36
+ // "read only the parts that matter" is English. One in a term's
37
+ // retiredExact counts only as written ("Skill store", not "Skill Store").
37
38
  //
38
39
  // alisx-check words --text <file…> [--baseline <file>] [--update]
39
40
  // Reads plain text written as a words file instead of markup: blocks headed
@@ -42,6 +43,15 @@
42
43
  // is in backticks, a printf verb (%s) or a placeholder (<id>). The baseline
43
44
  // counts each block's place, so one gaining a retired name fails.
44
45
  //
46
+ // alisx-check cards <path…>
47
+ // Fails on something you can press inside a card you open: an <a> or a
48
+ // <button> whose class holds app-card and that contains a link, a button,
49
+ // a field, a <details>, an element with a control's role, or a tabindex
50
+ // (components/AppCard.md). It is a gate, with no baseline: the markup is
51
+ // invalid HTML as well, and a browser moves the inner control out of the
52
+ // card or nests a click inside a click. It reads plain elements only; a
53
+ // framework's own components (<v-btn>, <Button>) need its own lint.
54
+ //
45
55
  // Svelte, Vue, HTML and templ files are read as markup. In templ, the Go is
46
56
  // script: outside a component, and inside one its statement lines (if, for,
47
57
  // switch, case) and the arguments of an @Component(…) call.
@@ -54,7 +64,7 @@ import { fileURLToPath } from 'node:url'
54
64
  const here = dirname(fileURLToPath(import.meta.url))
55
65
  const { version } = JSON.parse(readFileSync(join(here, 'package.json'), 'utf8'))
56
66
  const usage =
57
- 'usage: alisx-check names <path…> [--prefix app-] [--declared <path>] [--allow <property>]\n alisx-check styles <glob…> [--baseline <file>] [--update]\n alisx-check words [--text] <path…> [--baseline <file>] [--update]'
67
+ 'usage: alisx-check names <path…> [--prefix app-] [--declared <path>] [--allow <property>]\n alisx-check styles <glob…> [--baseline <file>] [--update]\n alisx-check words [--text] <path…> [--baseline <file>] [--update]\n alisx-check cards <path…>'
58
68
  const [command, ...argv] = process.argv.slice(2)
59
69
 
60
70
  const paths = []
@@ -76,6 +86,7 @@ for (let i = 0; i < argv.length; i++) {
76
86
  if (command === 'names' && paths.length) names()
77
87
  else if (command === 'styles' && paths.length) styles()
78
88
  else if (command === 'words' && paths.length) words()
89
+ else if (command === 'cards' && paths.length) cards()
79
90
  else stop(usage)
80
91
 
81
92
  function names() {
@@ -261,7 +272,10 @@ function words() {
261
272
  // is one finding, not that and "idea" again. A word with a slash on either
262
273
  // side is a path (ideas/${id}), a dotted one is code (ideas.length).
263
274
  const retired = terms
264
- .flatMap((term) => term.retired.map((text) => ({ text, name: term.name })))
275
+ .flatMap((term) => [
276
+ ...term.retired.map((text) => ({ text, name: term.name })),
277
+ ...(term.retiredExact ?? []).map((text) => ({ text, name: term.name, exact: true })),
278
+ ])
265
279
  .sort((a, b) => b.text.length - a.text.length)
266
280
  .map((each) => ({ ...each, pattern: new RegExp(`(?<![\\w./-])${escape(each.text).replace(/ /g, '\\s+')}(?![\\w/-]|\\.\\w)`, 'gi') }))
267
281
 
@@ -291,10 +305,13 @@ function words() {
291
305
  if (options.text && !pieces.length) stop(`alisx-check words: ${key(file)} has no == blocks, so it is not a words file.`)
292
306
  for (const { start, value, place } of pieces) {
293
307
  let rest = value
294
- for (const { text: word, name, pattern } of retired)
308
+ for (const { text: word, name, pattern, exact } of retired)
295
309
  rest = rest.replace(pattern, (match, offset) => {
296
310
  // A label's capital is part of it: "Read only" is a role, "read only" English.
297
311
  if (/[A-Z]/.test(word[0]) && match[0] !== word[0]) return match
312
+ // An exact retirement counts only as written: "Skill store" is retired,
313
+ // "Skill Store" is the name.
314
+ if (exact && match.replace(/\s+/g, ' ') !== word) return match
298
315
  const line = lineOf(start + offset)
299
316
  if (!ignored.has(line)) {
300
317
  const path = place ? `${key(file)} › ${place}` : key(file)
@@ -358,6 +375,55 @@ function words() {
358
375
  process.exit(1)
359
376
  }
360
377
 
378
+ function cards() {
379
+ const sources = ['.svelte', '.vue', '.html', '.templ']
380
+ const missing = paths.filter((path) => !existsSync(path))
381
+ if (missing.length) stop(`alisx-check cards: no such path: ${missing.join(', ')}`)
382
+ const files = paths.flatMap((path) => walk(resolve(path))).filter((file) => sources.includes(extname(file)))
383
+ if (!files.length) stop(`alisx-check cards: no markup files under ${paths.join(', ')}.`)
384
+
385
+ // A card you open: an <a> or a <button> with app-card in its class.
386
+ const opener = /<(a|button)\b((?:[^>"']|"[^"]*"|'[^']*')*)>/gi
387
+ const card = /\bclass(?:Name)?\s*=\s*(?:"[^"]*(?<![\w-])app-card(?![\w-])[^"]*"|'[^']*(?<![\w-])app-card(?![\w-])[^']*'|\{[^}]*(?<![\w-])app-card(?![\w-])[^}]*\})/
388
+ const control = /<(?:a|button|input|select|textarea|details|summary)\b|\brole\s*=\s*["'](?:button|link|menuitem|menuitemcheckbox|menuitemradio|checkbox|radio|switch|tab|option|combobox|textbox|slider)["']|\btabindex\s*=\s*["']?-?\d/gi
389
+ const blank = (match) => match.replace(/[^\n]/g, ' ')
390
+
391
+ const problems = []
392
+ let count = 0
393
+ for (const file of files) {
394
+ const text = readFileSync(file, 'utf8')
395
+ const lineOf = (index) => text.slice(0, index).split('\n').length
396
+ let markup = extname(file) === '.templ' ? templ(text, () => {}, blank) : text
397
+ markup = markup.replace(/<!--[\s\S]*?-->/g, blank).replace(/<(script|style)\b[\s\S]*?<\/\1>/gi, blank)
398
+ for (const open of markup.matchAll(opener)) {
399
+ if (!card.test(open[2]) || open[2].trimEnd().endsWith('/')) continue
400
+ count++
401
+ // Its end: the close that balances it, counting the same element nested.
402
+ const tag = open[1].toLowerCase()
403
+ const nested = new RegExp(`<(/?)${tag}\\b[^>]*>`, 'gi')
404
+ nested.lastIndex = open.index + open[0].length
405
+ let depth = 1
406
+ let end = markup.length
407
+ for (let found; depth && (found = nested.exec(markup)); ) {
408
+ depth += found[1] ? -1 : 1
409
+ if (!depth) end = found.index
410
+ }
411
+ const inside = markup.slice(open.index + open[0].length, end)
412
+ for (const inner of inside.matchAll(control))
413
+ problems.push(`${relative(process.cwd(), file)}:${lineOf(open.index + open[0].length + inner.index)} ${inner[0].trim()} inside a card you open (line ${lineOf(open.index)})`)
414
+ }
415
+ }
416
+
417
+ if (!problems.length) {
418
+ console.log(`alisx-check cards: ok. ${count} ${count === 1 ? 'card' : 'cards'} you open in ${files.length} files, none holding a control.`)
419
+ return
420
+ }
421
+ console.error(`\nalisx-check cards: a card you open holds nothing else to press (components/AppCard.md).\n`)
422
+ for (const problem of problems) console.error(` ${problem}`)
423
+ console.error('\nMove the action to the thing\'s own page, or once for the section into its heading row.\n')
424
+ process.exit(1)
425
+ }
426
+
361
427
  // The text in a source file a person may read, each piece with where it
362
428
  // starts. In markup: text between tags, and the values of attributes that
363
429
  // aren't code. In script: quoted text that holds a space or starts with a
package/classes.json CHANGED
@@ -73,7 +73,13 @@
73
73
  "app-card",
74
74
  "app-card--instrument",
75
75
  "app-card--statement",
76
+ "app-card-grid",
77
+ "app-card__cover",
78
+ "app-card__foot",
76
79
  "app-card__inset",
80
+ "app-card__reason",
81
+ "app-card__summary",
82
+ "app-card__tags",
77
83
  "app-card__title",
78
84
  "app-check-group",
79
85
  "app-check-row",
@@ -268,20 +274,24 @@
268
274
  "app-loader--line",
269
275
  "app-machine",
270
276
  "app-mark",
277
+ "app-mark--activity",
271
278
  "app-mark--artifacts",
272
279
  "app-mark--environments",
273
280
  "app-mark--glass",
274
281
  "app-mark--interviews",
275
282
  "app-mark--projects",
276
283
  "app-mark--skills",
284
+ "app-mark--support",
277
285
  "app-mark--workstations",
278
286
  "app-mark__arc",
287
+ "app-mark__boom",
279
288
  "app-mark__cloud",
280
289
  "app-mark__dot",
281
290
  "app-mark__glint",
282
291
  "app-mark__line",
283
292
  "app-mark__piece",
284
293
  "app-mark__prompt",
294
+ "app-mark__trace",
285
295
  "app-menu",
286
296
  "app-menu--above",
287
297
  "app-menu--suggest",
@@ -552,6 +562,7 @@
552
562
  "--breakpoint-expanded",
553
563
  "--breakpoint-large",
554
564
  "--breakpoint-medium",
565
+ "--card-min-width",
555
566
  "--card-padding-wide",
556
567
  "--cat",
557
568
  "--cat1",
@@ -570,6 +581,12 @@
570
581
  "--chat-row",
571
582
  "--code-surface",
572
583
  "--container",
584
+ "--contrast-edge",
585
+ "--contrast-focus",
586
+ "--contrast-ink",
587
+ "--contrast-muted",
588
+ "--contrast-on-selected",
589
+ "--contrast-selected",
573
590
  "--control-height",
574
591
  "--cyan-200",
575
592
  "--cyan-600",
@@ -620,6 +637,7 @@
620
637
  "--loop-shimmer",
621
638
  "--loop-speak",
622
639
  "--loop-spin",
640
+ "--loop-tick",
623
641
  "--loop-trace",
624
642
  "--machine-surface",
625
643
  "--measure-prose",
@@ -11,6 +11,23 @@ See [surfaces.md](../rules/surfaces.md). Default when unsure: no card at all.
11
11
  - Padding is 24, and 28 from 600px wide. The title sits 8 above its body; the action row 16 below it. Radius `radius-lg` with a `radius-md` inset (`.app-card__inset`). The instrument's edge is the only border a card takes; a statement has none.
12
12
  - A statement over a gradient takes `.app-statement-over-gradient`: the role at the statement opacity.
13
13
  - A card chosen among others is an [AppSelectTile](AppSelectTile.md), never a card with a ring.
14
+ - **A card's parts bring no padding or margin of their own.** The card's padding and its gap space them, so every gap is on the scale; a part's own padding adds to the gap and lands off it (8 + 12 + 8 is 28).
15
+
16
+ ## In a collection
17
+
18
+ Cards you open, side by side: skills, projects, templates, anything a person browses and picks. Each new fact is not a new row; it fits a zone below or it belongs on the thing's own page.
19
+
20
+ - **The grid is `.app-card-grid`**: as many columns as fit at `card-min-width` (three across a 1120 column, one on a phone), 16 apart, every card the row's height. Never a column count or a width chosen per screen.
21
+ - **Five zones, in this order, each optional except the name:**
22
+ 1. **Cover** (`.app-card__cover`): the card's inset as a picture of the thing (a drawing, a preview, data), 80 tall, 16 above what follows. At most two tags on it (`.app-card__tags`, small opaque `AppChip`s): a safety or failure state first, then a kind. A tag never repeats a line below.
23
+ 2. **Why it is here** (`.app-card__reason`, `text-meta`): one line, 4 over the name, only when it is about the person ("Because you're working on Claims"). A reason that would be the same on every card is said once, in the section's supporting line.
24
+ 3. **The name** (`.app-card__title`, `text-object-title`): one line, truncating, the full name in its `title`.
25
+ 4. **What sells it** (`.app-card__summary`, `text-supporting`): two lines, 8 under the name, in `on-surface-variant` whatever it is (a description, a sample prompt in quotes).
26
+ 5. **The foot** (`.app-card__foot`, `text-meta`): one row at the card's bottom, who made it leading (a 24 `AppAvatar` or the mark, then the name) and one fact trailing (this week's use, a date). A shorter card's slack sits above it, so a row's feet line up.
27
+ - **Three type roles**: object-title, supporting, meta. A rank, a metric or a second fact row is a fourth job: it goes on the thing's page.
28
+ - **A compact card** (a long catalogue under the shelves) is the same card without its cover; the foot stays where it is.
29
+ - **Nothing else to press.** What a person might do to one item (remove it from suggestions, hide it, share it) goes on the thing's page, or once for the section in its heading row ("Manage suggestions"). Never a menu or a button on the card: it is a control inside a link, and its state layer shows on the whole card.
30
+
14
31
 
15
32
  ## Markup
16
33
 
@@ -38,6 +55,23 @@ See [surfaces.md](../rules/surfaces.md). Default when unsure: no card at all.
38
55
  <div class="text-supporting">europe-west1 · v1.42.3</div>
39
56
  </a>
40
57
 
58
+ <!-- Cards in a collection: one grid, five zones, the foot at the bottom -->
59
+ <div class="app-card-grid">
60
+ <a class="app-card app-card--instrument app-state" href="/skills/landing-page">
61
+ <div class="app-card__cover">
62
+ <!-- the drawing -->
63
+ <div class="app-card__tags"><span class="app-chip app-chip--small app-chip--opaque">Code block</span></div>
64
+ </div>
65
+ <p class="app-card__reason text-meta">Because you're working on Landing Page</p>
66
+ <h3 class="app-card__title text-object-title" title="Landing Page Playbook">Landing Page Playbook</h3>
67
+ <p class="app-card__summary text-supporting">Build, optimise and deploy a marketing landing page, from an intake brief to a live site.</p>
68
+ <div class="app-card__foot text-meta">
69
+ <span><span class="app-avatar app-avatar--small">JS</span>James Spanjaard</span>
70
+ <span>1 builder this week</span>
71
+ </div>
72
+ </a>
73
+ </div>
74
+
41
75
  <!-- Opened in-page: a button, which may hold only phrasing content (spans) -->
42
76
  <button type="button" class="app-card app-card--instrument app-state">
43
77
  <span class="app-card__title text-object-title">staging</span>
@@ -47,8 +81,9 @@ See [surfaces.md](../rules/surfaces.md). Default when unsure: no card at all.
47
81
 
48
82
  ## Behaviour you must supply
49
83
 
50
- - A card you open is an `<a href>` (navigation) or a `<button type="button">` (in-page) with `app-state`, and holds nothing else interactive. Inside a `<button>`, use spans, not `<h3>`, `<p>` or `<div>`.
84
+ - A card you open is an `<a href>` (navigation) or a `<button type="button">` (in-page) with `app-state`, and holds nothing else interactive: no link, button, field, menu, `role` of a control or `tabindex`. `alisx-check cards` fails on one. Inside a `<button>`, use spans, not `<h3>`, `<p>` or `<div>`.
85
+ - The grid's cards stretch to the row; a framework card that sets its own height or padding is set back to the card's.
51
86
 
52
87
  ## Classes
53
88
 
54
- `.app-card`, `.app-card--statement`, `.app-card--instrument`, `.app-card__title`, `.app-card__inset`, `.app-statement-over-gradient`, with `.app-state` on a card you open and `.app-btn-row` for its actions.
89
+ `.app-card`, `.app-card--statement`, `.app-card--instrument`, `.app-card__title`, `.app-card__inset`, `.app-statement-over-gradient`, with `.app-state` on a card you open and `.app-btn-row` for its actions. In a collection: `.app-card-grid`, `.app-card__cover`, `.app-card__tags`, `.app-card__reason`, `.app-card__summary`, `.app-card__foot`.
@@ -8,7 +8,8 @@ A code a person types to prove who they are: one emailed to them, or one their d
8
8
  - **One real input, the cells drawn over it.** The input lies unseen over the cells and takes every key, paste, the phone's autofill from Mail or Messages, a password manager and undo; a screen reader hears one field. Never one input per character. Without the script the input is one plain box, and the form still works.
9
9
  - **A cell per character, in two groups**: six as 3 + 3, eight as 4 + 4. Each cell is 40 × 48 on every pointer, `radius-sm`, in `font-mono` at 20, with the field's edge: `field-edge`, `field-edge-hover` under the pointer, 2px `primary` on the cell the next character goes in. Cells sit 8 apart, groups 16; on a phone eight cells wrap to two rows of four.
10
10
  - **Labelled "Code", centred above**; the supporting line centred below. On the email-code step of [AppSignIn](AppSignIn.md) the supporting line is the way back a step: "Wrong address? Use a different email", the last three words a link.
11
- - **It never sends itself.** The last character lands and nothing moves; Enter or the card's filled action sends it, as on every form ([page.md](../rules/page.md) § Forms). Never a disabled action while cells are empty.
11
+ - **It sends itself when the last character lands**, once: typed, pasted or filled in by the phone. It is the one form that does, because a code is copied, not composed: there is nothing to look over. The card says so before the person types, in its line ("Enter it to sign in."), so the page never changes unannounced. The filled action stays, for Enter, for a code that was refused and for a page without the script, and shows the work while the code is sent. Never a disabled action while cells are empty.
12
+ - **Only what the person enters sends.** A code the page was served with, or one the server refused, waits: a refused code is sent again only once it has been changed.
12
13
  - **Errors at the field when they send**, in `error` with the `error` icon, replacing the supporting line; every cell takes the error edge. Say what to do: "Enter all 6 digits.", "That code doesn't match. Check the email and try again.", "That code has expired. Resend code to get a new one." A wrong code stays in the cells, selected, so typing replaces it.
13
14
  - **Digits or letters, never both**: an emailed code is digits (`inputmode="numeric"`, `autocomplete="one-time-code"`); a device code is letters, shown as capitals, with autocomplete off.
14
15
  - **The words**: Code, Send code, Resend code, Use a different email ([words.json](../words.json)). Never OTP, PIN, passcode or verification code.
@@ -56,6 +57,7 @@ A code a person types to prove who they are: one emailed to them, or one their d
56
57
  - **Draw the cells** once the script runs: add `is-drawn` to `.app-code-field` and two `.app-code-field__group`s of cells after the input, `aria-hidden="true"`, as many cells as `maxlength`.
57
58
  - **On every input**, keep only the allowed characters (digits; or letters, upper-cased) up to `maxlength`, write each into its cell, and clear `is-error`. Paste and autofill arrive as one input event; nothing else is needed for them.
58
59
  - **`is-active`** is on the cell the next character goes in (the last cell once full) while the input has focus, on none when it hasn't. The caret stays at the end: on focus and click, move the selection there. When the whole code is selected, every filled cell is `is-active`, and typing replaces it.
60
+ - **When the code is full** after an input event (the allowed characters number `maxlength`), send the form as its filled action would, once: not again until the code has changed, and never from the script's own first draw of a value the page was served with. While it is sent the filled action shows work and nothing sends a second time.
59
61
  - **On send**: fewer characters than `maxlength`, or a code the server refuses, sets `is-error`, `aria-invalid="true"` and the error line, focuses the input and selects the code. Work in progress shows on the button pressed.
60
62
 
61
63
  ## Classes
@@ -10,7 +10,7 @@ Signing in, signing up and onboarding: one card on the plain ground.
10
10
  - **The lead, centred at the top of the card**: the logo of the app being signed in to, then the question in `text-page-title`, then one `text-body` line. **An invitation leads with who sent it** instead of a logo: their [AppAvatar](AppAvatar.md) at 36, in the logo's place, beside "Ruan Spies invited you" on one line in `text-body`, the name at 600. A long name ends in an ellipsis, with the whole name as its `title`; "invited you" never shortens. Then the title of what they were invited to. For AlisX the logo is the Alis mark at 32 ([AlisMark](AlisMark.md)); a client's logo is at most 40 tall and 200 wide, keeps its aspect ratio, and falls back to its name in `text-object-title`. Never `text-welcome-title`: this is a card.
11
11
  - **One question per card and one filled action**, the card's full width, last. A second way on ("Create an account", "Resend code") is a text button, full width, under it; one at most. A way back a step ("Use a different email") is a link in the field's supporting line, never a second button. Signing in with a provider ("Continue with Google") is an outlined button, its words alone until the marks are listed ([known-gaps.md](../rules/known-gaps.md)).
12
12
  - **Fields as on every form** ([page.md](../rules/page.md) § Forms): labelled above, errors at the field when they try to continue, the action never disabled. A form's groups inside the card are headed in `text-section-title` ([type.md](../rules/type.md)).
13
- - **Signing in with a code from an email is two cards.** First the address: "Email address", a supporting line that says a code will be sent, and **Send code**. Then the code: "Check your email", one line naming the address and how long the code lasts ("A code was sent to sam@acme.com. It expires in 10 minutes."), an [AppCodeField](AppCodeField.md) whose supporting line is "Wrong address? Use a different email", the filled action named for where it goes ("Sign in", "Open the page", "Open the interview"), and **Resend code** as the second way on. Where telling a stranger whether an address was invited would leak it, the line says "If sam@acme.com was invited, a code is on its way." The code never sends itself.
13
+ - **Signing in with a code from an email is two cards.** First the address: "Email address", a supporting line that says a code will be sent, and **Send code**. Then the code: "Check your email", one line naming the address, how long the code lasts and what entering it does ("A code was sent to sam@acme.com. It expires in 10 minutes. Enter it to sign in."), an [AppCodeField](AppCodeField.md) whose supporting line is "Wrong address? Use a different email", the filled action named for where it goes ("Sign in", "Open the page", "Open the interview"), and **Resend code** as the second way on. Where telling a stranger whether an address was invited would leak it, the line says "If sam@acme.com was invited, a code is on its way." The code sends itself when its last character lands; the filled action stays for Enter and for a code that was refused.
14
14
  - **Resend code** sends a new code without leaving the card and says so in the status line under it (`.app-signin__status`, a live region that takes no room while empty): "New code sent. The earlier one still works." Never a countdown in front of it; if the server's limit is reached, that line says when another can be sent.
15
15
  - **Help · Privacy · Terms under the card**, in `text-meta` and `on-surface-variant`, centred: the links of whoever's app it is.
16
16
  - **Onboarding in steps** ([page.md](../rules/page.md) § A form in steps): from the first stepped card, [AppStepper](AppStepper.md) leads the card and the logo goes, because the person has just seen it. A stepped card reads like any form in steps: the title and its line start-aligned, and the action row at the foot with Back leading and the filled action last, at its own width.
@@ -71,7 +71,7 @@ Signing in, signing up and onboarding: one card on the plain ground.
71
71
  <div class="app-signin__lead">
72
72
  <img class="app-signin__logo" src="…/acme.svg" alt="Acme">
73
73
  <h1 class="text-page-title">Check your email</h1>
74
- <p class="text-body">A code was sent to sam@acme.com. It expires in 10 minutes.</p>
74
+ <p class="text-body">A code was sent to sam@acme.com. It expires in 10 minutes. Enter it to sign in.</p>
75
75
  </div>
76
76
  <div class="app-code-field">
77
77
  <label for="signin-code" class="text-label">Code</label>