@alis-build/design-system 0.24.0 → 0.25.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
@@ -411,8 +411,8 @@ button, input, textarea, select { font: inherit; }
411
411
  @keyframes app-spin{to{transform:rotate(360deg)}}
412
412
  .app-target--none::after{content:none}
413
413
  @media (prefers-reduced-motion:no-preference){.app-btn--filled:not(:disabled):active{border-radius:12px;transform:scale(.97)}}
414
- .app-btn-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-8)}
415
- .app-btn-row--end{justify-content:flex-end}
414
+ .app-btn-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--space-8)}
415
+ .app-btn-row--start{justify-content:flex-start}
416
416
  .app-btn-row__start{margin-inline-end:auto}
417
417
 
418
418
  /* ── Icon button · 20px glyph in a 40px box, no fill unless a toggle is on ── */
package/check.mjs CHANGED
@@ -238,11 +238,12 @@ function styles() {
238
238
  function words() {
239
239
  const { terms } = JSON.parse(readFileSync(join(here, 'words.json'), 'utf8'))
240
240
  // Longest first, and each match blanked before the next looks: "Idea brief"
241
- // is one finding, not that and "idea" again.
241
+ // is one finding, not that and "idea" again. A word with a slash on either
242
+ // side is a path (ideas/${id}), a dotted one is code (ideas.length).
242
243
  const retired = terms
243
244
  .flatMap((term) => term.retired.map((text) => ({ text, name: term.name })))
244
245
  .sort((a, b) => b.text.length - a.text.length)
245
- .map((each) => ({ ...each, pattern: new RegExp(`(?<![\\w./-])${escape(each.text).replace(/ /g, '\\s+')}(?![\\w-]|[./]\\w)`, 'gi') }))
246
+ .map((each) => ({ ...each, pattern: new RegExp(`(?<![\\w./-])${escape(each.text).replace(/ /g, '\\s+')}(?![\\w/-]|\\.\\w)`, 'gi') }))
246
247
 
247
248
  const sources = ['.svelte', '.vue', '.html', '.jsx', '.tsx', '.js', '.ts', '.mjs']
248
249
  const missing = paths.filter((path) => !existsSync(path))
@@ -382,12 +383,22 @@ function unlogged(code) {
382
383
  }
383
384
 
384
385
  // Calls back with each quoted string in code, and its offset, skipping
385
- // comments. A quote that doesn't close on its line is an apostrophe, not a
386
- // string.
386
+ // comments and regular expressions. A quote that doesn't close on its line is
387
+ // an apostrophe, not a string.
387
388
  function quoted(code, each) {
388
389
  for (let i = 0; i < code.length; i++) {
389
390
  const c = code[i]
390
- if (c === '/' && code[i + 1] === '/') {
391
+ if (c === '/' && code[i + 1] !== '/' && code[i + 1] !== '*' && startsRegex(code, i)) {
392
+ // To the closing slash, past escapes and character classes ([/`]).
393
+ let j = i + 1
394
+ for (let inClass = false; j < code.length && code[j] !== '\n'; j++) {
395
+ if (code[j] === '\\') j++
396
+ else if (code[j] === '[') inClass = true
397
+ else if (code[j] === ']') inClass = false
398
+ else if (code[j] === '/' && !inClass) break
399
+ }
400
+ i = j
401
+ } else if (c === '/' && code[i + 1] === '/') {
391
402
  const end = code.indexOf('\n', i)
392
403
  if (end < 0) return
393
404
  i = end
@@ -424,6 +435,16 @@ function quoted(code, each) {
424
435
  }
425
436
  }
426
437
 
438
+ // A slash opens a regular expression where a value is expected: after an
439
+ // operator or an opening bracket, at the start, or after return; after a name,
440
+ // a number or a closing bracket it divides.
441
+ function startsRegex(code, i) {
442
+ let j = i - 1
443
+ while (j >= 0 && /\s/.test(code[j])) j--
444
+ if (j < 0 || '(,=:[!&|?{};+-*%<>~^'.includes(code[j])) return true
445
+ return /\b(?:return|typeof|case|do|else|in|of|void|yield|await)$/.test(code.slice(Math.max(0, j - 5), j + 1))
446
+ }
447
+
427
448
  // A --declared file, as text. In JSON a stylesheet is a string with its line
428
449
  // breaks escaped, so its strings are read as they would arrive too.
429
450
  function readDeclared(file) {
package/classes.json CHANGED
@@ -57,7 +57,7 @@
57
57
  "app-btn--quiet",
58
58
  "app-btn--small",
59
59
  "app-btn-row",
60
- "app-btn-row--end",
60
+ "app-btn-row--start",
61
61
  "app-btn-row__start",
62
62
  "app-btn__spinner",
63
63
  "app-card",
@@ -56,7 +56,7 @@ See [chips-alerts.md](../rules/chips-alerts.md) § Avatars.
56
56
  </button>
57
57
 
58
58
  <!-- Changing the picture: a text button beside it -->
59
- <div class="app-btn-row">
59
+ <div class="app-btn-row app-btn-row--start">
60
60
  <span class="app-avatar app-avatar--large" aria-hidden="true">TM</span>
61
61
  <button type="button" class="app-btn app-state app-target">Change photo</button>
62
62
  </div>
@@ -54,17 +54,22 @@ Emphasis is allocated, not chosen ([buttons.md](../rules/buttons.md)).
54
54
  <!-- As a link: same classes on an <a> -->
55
55
  <a class="app-btn app-state app-target" href="#logs">View logs</a>
56
56
 
57
- <!-- A row of buttons; --end puts them on the trailing edge -->
58
- <div class="app-btn-row app-btn-row--end">
57
+ <!-- A row of buttons: on the trailing edge, affirmative last -->
58
+ <div class="app-btn-row">
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
62
 
63
63
  <!-- A flow's row: __start holds Back on the leading edge -->
64
- <div class="app-btn-row app-btn-row--end">
64
+ <div class="app-btn-row">
65
65
  <button type="button" class="app-btn app-state app-target app-btn-row__start">Back</button>
66
66
  <button type="submit" class="app-btn app-state app-target app-btn--filled">Continue</button>
67
67
  </div>
68
+
69
+ <!-- A button among content: --start keeps it with the content -->
70
+ <div class="app-btn-row app-btn-row--start">
71
+ <button type="button" class="app-btn app-state app-target">Retry upload</button>
72
+ </div>
68
73
  ```
69
74
 
70
75
  ## Behaviour you must supply
@@ -75,4 +80,4 @@ Emphasis is allocated, not chosen ([buttons.md](../rules/buttons.md)).
75
80
 
76
81
  ## Classes
77
82
 
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`.
83
+ `.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--start`, `.app-btn-row__start`.
@@ -7,7 +7,7 @@ The two surfaces a product screen contains things in: statement and instrument.
7
7
  See [surfaces.md](../rules/surfaces.md). Default when unsure: no card at all.
8
8
 
9
9
  - **Statement** (`app-card--statement`): `surface-container-low`, flat. Grouped context you don't act on. At most one text link.
10
- - **Instrument** (`app-card--instrument`, the default): `surface`, white, with a 1px `outline-variant` edge and no shadow. An object you act on, with its actions in one row (text buttons, and the screen's one filled button if it lives here; never outlined, because the edge already says act). A card you open is an instrument made into one link or button; its hover is a state layer, never a lift.
10
+ - **Instrument** (`app-card--instrument`, the default): `surface`, white, with a 1px `outline-variant` edge and no shadow. An object you act on, with its actions in one row on the trailing edge (text buttons, and the screen's one filled button if it lives here; never outlined, because the edge already says act). A card you open is an instrument made into one link or button; its hover is a state layer, never a lift.
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.
@@ -18,7 +18,7 @@ A dialog: `surface-container-high` (white in light) at `elevation-3`, an object-
18
18
  <div class="app-dialog__body text-body">
19
19
  This shuts down staging in europe-west1 and removes its 4 variables and deploy history. You can't undo this.
20
20
  </div>
21
- <div class="app-btn-row app-btn-row--end">
21
+ <div class="app-btn-row">
22
22
  <button type="button" class="app-btn app-state app-target">Cancel</button>
23
23
  <button type="button" class="app-btn app-state app-target app-btn--filled app-btn--error">Delete environment</button>
24
24
  </div>
@@ -30,7 +30,7 @@ A dialog: `surface-container-high` (white in light) at `elevation-3`, an object-
30
30
  <div role="dialog" aria-modal="true" aria-labelledby="d-out-t" tabindex="-1" class="app-dialog">
31
31
  <h2 id="d-out-t" class="app-dialog__title text-object-title">You're signed out</h2>
32
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">
33
+ <div class="app-btn-row">
34
34
  <button type="button" class="app-btn app-state app-target">Sign in again</button>
35
35
  </div>
36
36
  </div>
@@ -51,4 +51,4 @@ A dialog: `surface-container-high` (white in light) at `elevation-3`, an object-
51
51
 
52
52
  ## Classes
53
53
 
54
- `.app-scrim`, `.app-scrim--inline`, `.app-dialog`, `.app-dialog__title`, `.app-dialog__body`, `.app-btn-row`, `.app-btn-row--end`.
54
+ `.app-scrim`, `.app-scrim--inline`, `.app-dialog`, `.app-dialog__title`, `.app-dialog__body`, `.app-btn-row`.
@@ -51,14 +51,14 @@ See [page.md](../rules/page.md) § A form in steps for when a form takes steps a
51
51
  <label for="f-purpose" class="app-field__label text-label">What is the interview for?</label>
52
52
  <div class="app-field__box"><textarea id="f-purpose" class="app-field__input" rows="3"></textarea></div>
53
53
  </div>
54
- <div class="app-btn-row app-btn-row--end">
54
+ <div class="app-btn-row">
55
55
  <button type="button" class="app-btn app-state app-target">Save draft</button>
56
56
  <button type="submit" class="app-btn app-state app-target app-btn--filled">Continue</button>
57
57
  </div>
58
58
  </form>
59
59
 
60
60
  <!-- From the second step, Back leads the row -->
61
- <div class="app-btn-row app-btn-row--end">
61
+ <div class="app-btn-row">
62
62
  <button type="button" class="app-btn app-state app-target app-btn-row__start">Back</button>
63
63
  <button type="button" class="app-btn app-state app-target">Save draft</button>
64
64
  <button type="button" class="app-btn app-state app-target app-btn--filled">Publish interview</button>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alis-build/design-system",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "The AlisX design system for coding agents: tokens, product CSS, component markup, capability marks, words and rules.",
5
5
  "keywords": ["alisx", "design-system", "design-tokens", "css"],
6
6
  "homepage": "https://alisx.com",
package/rules/buttons.md CHANGED
@@ -109,7 +109,15 @@ similar controls people scan repeatedly, and the glyph is conventional.
109
109
  buttons on a screen, or two leads on one surface, is B1.
110
110
  - **A dead lead is worse than no lead.** If the lead is disabled by default, draw
111
111
  it as text until it can act (B5).
112
- - **Dialogs: trailing edge, affirmative last.** A dialog is its own screen, so
112
+ - **The row that finishes a surface sits on the trailing edge, affirmative
113
+ last**: a dialog's, a card's, a form's, a step's, a sheet's. It is the last
114
+ thing read and the last thing done, so it sits where reading ends. Back takes
115
+ the leading edge (`.app-btn-row__start`), so the row shows which way the flow
116
+ runs. `.app-btn-row` does this by itself.
117
+ - **A button among content stays with the content**: an empty state's action, a
118
+ section's action in its heading row, Add beside its field, Change photo beside
119
+ the photo, the actions on an item in a list (`.app-btn-row--start`).
120
+ - **Dialogs:** a dialog is its own screen, so
113
121
  its affirmative is filled when it commits, in `error` when it destroys, and
114
122
  the rest are text. "Cancel" is always text. An affirmative that doesn't commit
115
123
  (it opens, copies or reads: "Open app", "Copy message") is text too, so the
package/rules/page.md CHANGED
@@ -190,7 +190,7 @@ leads its content with it, or leaves it out. What a failure shows, and where, is
190
190
  ## Forms
191
191
 
192
192
  - **One column at the prose measure** (`measure-prose`), fields 24px apart, the
193
- one filled action last and labelled with its outcome.
193
+ one filled action last, on the trailing edge, and labelled with its outcome.
194
194
  - **On a page, a form is one instrument card** ([AppCard](../components/AppCard.md)):
195
195
  white, its edge, at the prose measure, its actions the card's action row. Its
196
196
  parts are told apart by space and a `section-title`, never by lines across it.
package/rules/words.md CHANGED
@@ -49,6 +49,11 @@ output, a chat is not a thread, and Sharing is not permissions. `words.json`
49
49
  gives the code word beside the name where they differ, so you can tell which
50
50
  you are holding.
51
51
 
52
+ **Words written for Alis use the names too**: instructions, tool and field
53
+ descriptions. A model repeats what it reads, so "a new idea" there becomes "a
54
+ new idea" in a reply. A resource path (`ideas/*/streams/*`) is code and stays
55
+ as it is; the check leaves a word beside a slash alone.
56
+
52
57
  ## The verbs
53
58
 
54
59
  New, Add and Upload are in [buttons.md](buttons.md) § Naming the action. The