@alis-build/design-system 0.18.0 → 0.21.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.
@@ -0,0 +1,88 @@
1
+ # AppCheckbox
2
+
3
+ A checkbox for several of a list, or one thing you agree to; a radio for one of a few short options. Native inputs, and the whole row is the target.
4
+
5
+ ## Use / don't use
6
+
7
+ See [page.md](../rules/page.md) § Which control.
8
+
9
+ - **A checkbox** is for choosing several from a list (the materials to include, the rows of a table), and for one statement you confirm before you send ("I've reviewed the interview screens."). It waits for Save or Send.
10
+ - **A setting that is on or off is an [AppSwitch](AppSwitch.md)**, never a checkbox: a switch says it applies.
11
+ - **A radio** is for one of 2 to 5 options that a few words each can name, all visible ("Only the people I add", "Anyone with the link"). Options that need a sentence each are [AppSelectTile](AppSelectTile.md)s; 2 to 5 that change the content in place are an [AppSegmented](AppSegmented.md); 6 or more are an [AppSelect](AppSelect.md).
12
+ - **The box**: 18px with a 2px `on-surface-variant` edge and `radius-xs`; a radio is a 20px ring. On, it takes `primary`, with the check or the dot in it, because it is a control you press ([colour.md](../rules/colour.md)). Hovering the row shows the state layer as a halo round the box.
13
+ - **The label** is body text and says the thing itself, as a statement: "Include participant names", never "Enable …" or a question. One supporting line at most. Options are never pre-ticked to nudge a choice.
14
+ - **A set is labelled once**, by a field set's legend in label type ([AppTextField](AppTextField.md)); rows stack with no gap in an `.app-check-group`, the most likely first. A radio set always has one option chosen.
15
+ - **In a table or a dense list** the bare box leads the row and takes an `aria-label` naming the row; the header's box selects all and is mixed when only some are chosen. The row's selection is the fill plus the checked box ([selection.md](../rules/selection.md)).
16
+
17
+ ## Markup
18
+
19
+ ```html
20
+ <!-- One checkbox: a statement you confirm -->
21
+ <label for="c-rev" class="app-check-row">
22
+ <input id="c-rev" type="checkbox" class="app-checkbox">
23
+ <span class="app-check-row__text"><span class="text-body">I've reviewed the interview screens.</span></span>
24
+ </label>
25
+
26
+ <!-- Several of a list, labelled once -->
27
+ <fieldset class="app-fieldset">
28
+ <legend class="app-fieldset__legend text-label">Include in the report</legend>
29
+ <div class="app-check-group">
30
+ <label for="c-1" class="app-check-row">
31
+ <input id="c-1" type="checkbox" class="app-checkbox" checked>
32
+ <span class="app-check-row__text"><span class="text-body">Participant names</span></span>
33
+ </label>
34
+ <label for="c-2" class="app-check-row">
35
+ <input id="c-2" type="checkbox" class="app-checkbox" aria-describedby="c-2-s">
36
+ <span class="app-check-row__text">
37
+ <span class="text-body">Recordings</span>
38
+ <span id="c-2-s" class="text-supporting">Anyone who can open the report can play them.</span>
39
+ </span>
40
+ </label>
41
+ </div>
42
+ </fieldset>
43
+
44
+ <!-- One of a few: radios share a name -->
45
+ <fieldset class="app-fieldset">
46
+ <legend class="app-fieldset__legend text-label">Who can take part</legend>
47
+ <div class="app-check-group">
48
+ <label for="r-1" class="app-check-row">
49
+ <input id="r-1" type="radio" name="access" class="app-radio" checked>
50
+ <span class="app-check-row__text"><span class="text-body">Only the people I add</span></span>
51
+ </label>
52
+ <label for="r-2" class="app-check-row">
53
+ <input id="r-2" type="radio" name="access" class="app-radio">
54
+ <span class="app-check-row__text"><span class="text-body">Anyone with the link, once they sign in</span></span>
55
+ </label>
56
+ </div>
57
+ </fieldset>
58
+
59
+ <!-- Error: is-error on the field set, the support line says what to do -->
60
+ <fieldset class="app-fieldset is-error">
61
+ <legend class="app-fieldset__legend text-label">Before you send</legend>
62
+ <label for="c-e" class="app-check-row">
63
+ <input id="c-e" type="checkbox" class="app-checkbox" aria-invalid="true" aria-describedby="c-e-s">
64
+ <span class="app-check-row__text"><span class="text-body">I've reviewed the interview screens.</span></span>
65
+ </label>
66
+ <p id="c-e-s" class="app-fieldset__support text-supporting">Tick this to send the interview.</p>
67
+ </fieldset>
68
+
69
+ <!-- Disabled -->
70
+ <label for="c-x" class="app-check-row is-disabled">
71
+ <input id="c-x" type="checkbox" class="app-checkbox" disabled>
72
+ <span class="app-check-row__text"><span class="text-body">Recordings</span></span>
73
+ </label>
74
+
75
+ <!-- Bare, leading a table row; the header's box is mixed while some rows are chosen -->
76
+ <input type="checkbox" class="app-checkbox" aria-label="Select staging">
77
+ ```
78
+
79
+ ## Behaviour you must supply
80
+
81
+ - The native inputs toggle, group (radios by `name`) and move with the arrow keys themselves. Read them on submit.
82
+ - **Mixed**: set the header box's `indeterminate` property in script while some, not all, rows are chosen; pressing it selects all.
83
+ - **Error**: on submit, `is-error` on the field set, `aria-invalid="true"` on the input, and the support line says what to do; focus the first invalid input.
84
+ - **Disabled**: `disabled` on the input and `is-disabled` on the row.
85
+
86
+ ## Classes
87
+
88
+ `.app-check-row`, `.app-check-row__text`, `.app-check-row.is-disabled`, `.app-check-group`, `.app-checkbox`, `.app-radio`; `.app-checkbox.is-checked` for a box drawn on a menu's option ([AppCombobox](AppCombobox.md)); with `.app-fieldset`, `.app-fieldset__legend`, `.app-fieldset__support`, `.is-error`.
@@ -0,0 +1,117 @@
1
+ # AppCombobox
2
+
3
+ One choice, or several, from a list too long to scan: the select's box opens a menu with a search at its head.
4
+
5
+ ## Use / don't use
6
+
7
+ - **Use it past about ten options**, or when the list comes from a server (people, projects, countries, time zones). A list you can see whole is an [AppSelect](AppSelect.md); it needs no search ([page.md](../rules/page.md) § Search).
8
+ - **The box shows the choice, never what you are typing.** It looks like the select ([AppSelect](AppSelect.md)): label above, the field's box, the choice in ink, a trailing `expand_more` that turns while it is open. With no choice yet it names one in `on-surface-variant` ("Choose a country"). A person leads with their small [AppAvatar](AppAvatar.md).
9
+ - **Pressing it opens the menu** ([AppMenu](AppMenu.md)) under the box, at the box's width. **The search is the menu's first line**: a `search` glyph and the words you type, no box of its own, a hairline under it. The rows are the menu's: its type, its second line, its headings.
10
+ - **One choice**: the chosen row is the menu's checked row (the selection fill, a trailing `check`). Choosing closes the menu.
11
+ - **Several**: each row leads with a checkbox and takes no fill; the box alone says it is chosen. The menu stays open while you tick, and what is already chosen comes first each time it opens.
12
+ - **Several, in a form: the box only adds, and the chosen are a list under it.** The box reads what you would add ("Add owners"), in `on-surface-variant`, whatever is chosen. Each choice is a row below ([AppListRow](AppListRow.md)): a person's avatar, their name and one supporting line, and a small `close` icon button that removes that one. Owners, members and who has access are sets people manage, so every one stays in view and nothing is cut short. Never chips, never names joined in the box.
13
+ - **Only what the list holds.** Free text you add yourself (an email address, a tag) is the text field's Add action ([AppTextField](AppTextField.md)), not this.
14
+ - **In the filter row** the trigger is the button that names its choice ([page.md](../rules/page.md) § The filter row); it opens this same menu when its list is long. With several chosen it reads as a count ("4 people"); with one, its name. A filter only has to say how much it narrows.
15
+ - **Nothing found** is one line that echoes what you typed: *No country matches "atlantis"*. **Searching** a server past 300 ms is one line with the loader.
16
+
17
+ ## Markup
18
+
19
+ ```html
20
+ <!-- One choice, open -->
21
+ <div class="app-field">
22
+ <span id="cb-country-l" class="app-field__label text-label">Billing country</span>
23
+ <div class="app-combo">
24
+ <button type="button" id="cb-country" class="app-field__box app-combo__trigger" aria-haspopup="listbox" aria-expanded="true" aria-controls="cb-country-p" aria-labelledby="cb-country-l cb-country-v">
25
+ <span id="cb-country-v" class="app-combo__value"><span class="app-combo__text">South Africa</span></span>
26
+ <span class="app-icon" aria-hidden="true">expand_more</span>
27
+ </button>
28
+ <div class="app-menu app-combo__panel" id="cb-country-p">
29
+ <label class="app-combo__search">
30
+ <span class="app-icon" aria-hidden="true">search</span>
31
+ <input class="app-combo__input" role="combobox" aria-autocomplete="list" aria-expanded="true" aria-controls="cb-country-o" autocomplete="off" placeholder="Search countries" aria-label="Search countries">
32
+ </label>
33
+ <ul class="app-combo__list" id="cb-country-o" role="listbox" aria-label="Countries">
34
+ <li class="app-menu__item app-state" id="cb-country-1" role="option" aria-selected="false"><span class="app-menu__text"><span>Somalia</span></span></li>
35
+ <li class="app-menu__item app-state is-selected" id="cb-country-2" role="option" aria-selected="true"><span class="app-menu__text"><span>South Africa</span></span><span class="app-icon" aria-hidden="true">check</span></li>
36
+ <li class="app-menu__item app-state" id="cb-country-3" role="option" aria-selected="false"><span class="app-menu__text"><span>South Korea</span></span></li>
37
+ </ul>
38
+ </div>
39
+ </div>
40
+ </div>
41
+
42
+ <!-- Several, in a form: the box only adds; each choice is a row under it. The chosen come first in the menu -->
43
+ <div class="app-field">
44
+ <span id="cb-owners-l" class="app-field__label text-label">Owners</span>
45
+ <div class="app-combo">
46
+ <button type="button" id="cb-owners" class="app-field__box app-combo__trigger" aria-haspopup="listbox" aria-expanded="true" aria-controls="cb-owners-p" aria-labelledby="cb-owners-l cb-owners-v">
47
+ <span id="cb-owners-v" class="app-combo__value is-placeholder"><span class="app-combo__text">Add owners</span></span>
48
+ <span class="app-icon" aria-hidden="true">expand_more</span>
49
+ </button>
50
+ <div class="app-menu app-combo__panel" id="cb-owners-p">
51
+ <label class="app-combo__search">
52
+ <span class="app-icon" aria-hidden="true">search</span>
53
+ <input class="app-combo__input" role="combobox" aria-autocomplete="list" aria-expanded="true" aria-controls="cb-owners-o" autocomplete="off" placeholder="Search people" aria-label="Search people">
54
+ </label>
55
+ <ul class="app-combo__list" id="cb-owners-o" role="listbox" aria-label="People" aria-multiselectable="true">
56
+ <li class="app-menu__item app-state" id="cb-owners-1" role="option" aria-selected="true"><span class="app-checkbox is-checked" aria-hidden="true"></span><span class="app-avatar app-avatar--small" aria-hidden="true">TM</span><span class="app-menu__text"><span>Thandi Mokoena</span><span class="app-menu__support">thandi@example.com</span></span></li>
57
+ <li class="app-menu__item app-state" id="cb-owners-2" role="option" aria-selected="true"><span class="app-checkbox is-checked" aria-hidden="true"></span><span class="app-avatar app-avatar--small" aria-hidden="true">JK</span><span class="app-menu__text"><span>Jan Krynauw</span><span class="app-menu__support">jan@example.com</span></span></li>
58
+ <li class="app-menu__item app-state" id="cb-owners-3" role="option" aria-selected="false"><span class="app-checkbox" aria-hidden="true"></span><span class="app-avatar app-avatar--small" aria-hidden="true">PN</span><span class="app-menu__text"><span>Priya Naidoo</span><span class="app-menu__support">priya@example.com</span></span></li>
59
+ </ul>
60
+ </div>
61
+ </div>
62
+ </div>
63
+
64
+ <!-- The same field closed: the chosen, each with its own remove -->
65
+ <div class="app-field">
66
+ <span id="cb-own2-l" class="app-field__label text-label">Owners</span>
67
+ <div class="app-combo">
68
+ <button type="button" id="cb-own2" class="app-field__box app-combo__trigger" aria-haspopup="listbox" aria-expanded="false" aria-labelledby="cb-own2-l cb-own2-v">
69
+ <span id="cb-own2-v" class="app-combo__value is-placeholder"><span class="app-combo__text">Add owners</span></span>
70
+ <span class="app-icon" aria-hidden="true">expand_more</span>
71
+ </button>
72
+ </div>
73
+ <div class="app-list" role="list" aria-labelledby="cb-own2-l">
74
+ <div class="app-row app-row--divided" role="listitem">
75
+ <span class="app-avatar" aria-hidden="true">TM</span>
76
+ <span class="app-row__text"><span class="text-object-title">Thandi Mokoena</span><span class="text-supporting">thandi@example.com</span></span>
77
+ <span class="app-row__trailing"><button type="button" class="app-icon-btn app-state app-icon-btn--small" aria-label="Remove Thandi Mokoena" title="Remove"><span class="app-icon" aria-hidden="true">close</span></button></span>
78
+ </div>
79
+ <div class="app-row app-row--divided" role="listitem">
80
+ <span class="app-avatar" aria-hidden="true">JK</span>
81
+ <span class="app-row__text"><span class="text-object-title">Jan Krynauw</span><span class="text-supporting">jan@example.com</span></span>
82
+ <span class="app-row__trailing"><button type="button" class="app-icon-btn app-state app-icon-btn--small" aria-label="Remove Jan Krynauw" title="Remove"><span class="app-icon" aria-hidden="true">close</span></button></span>
83
+ </div>
84
+ </div>
85
+ </div>
86
+
87
+ <!-- Closed, with no choice yet: the box names the choice -->
88
+ <div class="app-field">
89
+ <span id="cb-tz-l" class="app-field__label text-label">Time zone</span>
90
+ <div class="app-combo">
91
+ <button type="button" id="cb-tz" class="app-field__box app-combo__trigger" aria-haspopup="listbox" aria-expanded="false" aria-labelledby="cb-tz-l cb-tz-v">
92
+ <span id="cb-tz-v" class="app-combo__value is-placeholder"><span class="app-combo__text">Choose a time zone</span></span>
93
+ <span class="app-icon" aria-hidden="true">expand_more</span>
94
+ </button>
95
+ </div>
96
+ </div>
97
+
98
+ <!-- Searching, and nothing found -->
99
+ <li class="app-menu__empty app-loader app-loader--line" role="presentation"><svg …></svg>Searching</li>
100
+ <li class="app-menu__empty" role="presentation">No country matches “atlantis”</li>
101
+ ```
102
+
103
+ `.app-combo` wraps the box and its panel, so the panel opens under the box and over the supporting line. Closed, the panel carries `hidden` and the trigger `aria-expanded="false"`. Error and disabled are the text field's: `is-error` or `is-disabled` on `.app-field`, and `disabled` on the trigger.
104
+
105
+ ## Behaviour you must supply
106
+
107
+ - **Open** on a press of the box, on Enter, Space or Down, and on a letter typed while the box has focus, which also starts the search with that letter. Focus moves to the search. **Close** on a choice (one choice), Escape, Tab or a press outside, and return focus to the box. Toggle `hidden` on the panel and `aria-expanded` on the trigger.
108
+ - **Filter as you type** a list already loaded, on what a row shows (name and second line); a server search waits for a pause in typing.
109
+ - **The active row** (`is-active`, `aria-activedescendant` on the search) shows once the keyboard is in use: the first match when you type, then wherever Down and Up take it. Enter chooses it. A menu opened with the pointer shows none.
110
+ - **Choosing**: one choice sets `aria-selected`, `is-selected` and the trailing `check` together, writes the name into the box and closes. Several toggle `aria-selected` and `is-checked` on the row's checkbox, keep the menu open and clear the search. In a form, a tick adds that row under the box and an untick removes it; the row's own remove button unticks it. Rows keep the order they were added in.
111
+ - **What the box says**: one choice, its name, or the placeholder with `is-placeholder` when there is none. Several in a form, always what you would add ("Add owners"). Several in the filter row, the count and its noun.
112
+ - **Order**: when several can be chosen, list the chosen first each time it opens, and hold the order while it is open. With one choice, scroll the chosen row into view as it opens.
113
+ - **Ignore keys while `isComposing`.** Place the panel under the box (the CSS does it), above when there isn't room below.
114
+
115
+ ## Classes
116
+
117
+ `.app-combo`, `.app-combo__trigger`, `.app-combo__value`, `.app-combo__text`, `.is-placeholder`, `.app-combo__panel`, `.app-combo__search`, `.app-combo__input`, `.app-combo__list`; `.app-checkbox.is-checked` on a row; `.app-list` and `.app-row` for what is chosen; with `.app-field` and its parts, and `.app-menu`, `.app-menu__item`, `.app-menu__text`, `.app-menu__support`, `.app-menu__empty`, `.is-active`, `.is-selected`.
@@ -0,0 +1,61 @@
1
+ # AppDisclosure
2
+
3
+ Detail most people don't need, folded under its title: press the title and it opens in place.
4
+
5
+ ## Use / don't use
6
+
7
+ - **For what a few people need some of the time**: advanced settings, a long explanation, the raw detail behind a summary. Closed by default; open only when the screen is about it.
8
+ - **Never to hide what the screen is for**: the main content, a required field, an error, or the one action that moves you forward. If most people open it, it shouldn't fold.
9
+ - **The title is a row** 48 tall with a trailing `expand_more` that turns when open. It says what is inside, in label type; when it names a thing, object-title with one supporting line. No icon button of its own: the whole row is the target.
10
+ - **No card round it.** It sits on the surface it is in; several in a row are an `.app-disclosure-group`, divided by hairlines.
11
+ - **Each opens and closes by itself.** Opening one never closes another, and nothing is nested inside another.
12
+ - **Not a view switch.** Views that replace each other are an [AppSegmented](AppSegmented.md) ([page.md](../rules/page.md) § Where things go). **Not navigation**: a destination is a row or a link.
13
+ - Alis's working steps fold the same way, drawn by [AppTurn](AppTurn.md).
14
+
15
+ ## Markup
16
+
17
+ ```html
18
+ <details class="app-disclosure">
19
+ <summary class="app-disclosure__summary app-state">
20
+ <span class="app-disclosure__text"><span class="text-label">Advanced settings</span></span>
21
+ <span class="app-icon" aria-hidden="true">expand_more</span>
22
+ </summary>
23
+ <div class="app-disclosure__body">
24
+ <p class="text-supporting">Fields, prose or a table: whatever the title promised.</p>
25
+ </div>
26
+ </details>
27
+
28
+ <!-- Several, divided; a title that names a thing takes a second line -->
29
+ <div class="app-disclosure-group">
30
+ <details class="app-disclosure" open>
31
+ <summary class="app-disclosure__summary app-state">
32
+ <span class="app-disclosure__text">
33
+ <span class="text-object-title">Cloud Run</span>
34
+ <span class="text-supporting">2 services · europe-west1</span>
35
+ </span>
36
+ <span class="app-icon" aria-hidden="true">expand_more</span>
37
+ </summary>
38
+ <div class="app-disclosure__body"><p class="text-supporting">orders-api and orders-worker, both on revision 42.</p></div>
39
+ </details>
40
+ <details class="app-disclosure">
41
+ <summary class="app-disclosure__summary app-state">
42
+ <span class="app-disclosure__text">
43
+ <span class="text-object-title">Spanner</span>
44
+ <span class="text-supporting">1 database</span>
45
+ </span>
46
+ <span class="app-icon" aria-hidden="true">expand_more</span>
47
+ </summary>
48
+ <div class="app-disclosure__body"><p class="text-supporting">orders, in europe-west1.</p></div>
49
+ </details>
50
+ </div>
51
+ ```
52
+
53
+ ## Behaviour you must supply
54
+
55
+ - None: the native `<details>` opens, closes, takes Enter and Space, and announces its state. Add `open` to start one open.
56
+ - **Remember** what a person opened for as long as they stay on the screen; a refetch never closes it.
57
+ - **A field with an error inside a closed one**: open it before focusing the field.
58
+
59
+ ## Classes
60
+
61
+ `.app-disclosure`, `.app-disclosure__summary`, `.app-disclosure__text`, `.app-disclosure__body`, `.app-disclosure-group`, with `.app-state` on the summary.
@@ -10,7 +10,7 @@ A list of acts or places that opens from a control or from what you type, and cl
10
10
  | **Suggestion menu** (`role="listbox"`) | Typing `/` or `@` in an editor | In a composer, a band on its surface above the editor (`.app-menu--suggest`), like an [AppAsk](AppAsk.md). In a document, at the caret | Stays in the editor; the active row follows the arrows |
11
11
 
12
12
  - **Not a form.** A field, a checkbox or a type-to-confirm inside a menu is an [AppDialog](AppDialog.md); the item that opens it ends in an ellipsis ("Deploy to production…").
13
- - **Not a value in a form.** That's an [AppSelect](AppSelect.md). A searchable picker is a known gap.
13
+ - **Not a value in a form.** That's an [AppSelect](AppSelect.md), or an [AppCombobox](AppCombobox.md) when the list is long: this menu, with a search as its first line.
14
14
  - **Never a submenu.** Flatten it with a heading, or open a dialog. **Never on hover**: a tooltip names a control; a menu opens when you press.
15
15
  - **Not for the verbs a person uses often.** Those stay visible as buttons; the menu holds the rest. A split action is a button and a `more_vert` whose menu holds the alternatives ([page.md](../rules/page.md)).
16
16
 
@@ -31,7 +31,7 @@ A list of acts or places that opens from a control or from what you type, and cl
31
31
 
32
32
  - **Add** (`add`, an action menu opening upward from the button) lists what you can bring in first (Upload files, Record screen, a connected source), then a divider and **Commands**, each with its /name as the hint and no second line. Pointer users find the commands; the hint teaches `/`.
33
33
  - **`/`** opens only at the very start of a message, so "and/or" and a path never trigger it. It lists only the commands, label and second line and /name, filtered on both as you type. **A command leads the message**; choosing another replaces it.
34
- - **`@`** opens at the start or after a space. **People first**, then the things the product offers in this conversation: files, ideas, skills, agents, each group under its heading. A person has their 24px avatar (a photo, else initials); a thing has its icon. In a group thread a mention notifies the person; in a one-to-one with Alis it points her at them.
34
+ - **`@`** opens at the start or after a space. **People first**, then the things the product offers in this conversation: files, ideas, skills, agents, each group under its heading. A person has their small [AppAvatar](AppAvatar.md); a thing has its icon. In a group thread a mention notifies the person; in a one-to-one with Alis it points her at them.
35
35
  - **While it's open**: the first match is active. Up and Down move, Enter or Tab chooses, Escape closes and keeps what you typed. **Enter never sends while a suggestion menu is open** ([AppComposer](AppComposer.md)).
36
36
  - **Searching** past 300 ms is one line with the loader: *Searching*. **Nothing found** is one line that echoes what you typed (*No commands match "/pricing"*, *No one or nothing called "thandi"*); a space or Escape then closes the band and your text stays text.
37
37
  - **With an ask open**, the band sits between the ask and the editor, closest to the caret; the ask stays where it is.
@@ -8,6 +8,7 @@ See [selection.md](../rules/selection.md).
8
8
 
9
9
  - One pill track filled `surface-container-low`, with no border so it never reads as an outlined button, `control-height` tall with 4px of padding, so it lines up with the buttons and fields beside it. The selected segment is a white pill with an `outline-variant` edge, in `on-surface` at weight 700; the rest transparent in `on-surface-variant` at 500. No dividers ([selection.md](../rules/selection.md)).
10
10
  - A filter that narrows one list belongs in the filter row as one of these ([page.md](../rules/page.md)); a route is a tab in [AppTitleBar](AppTitleBar.md), not a segment.
11
+ - **Views that switch in place inside a pane, a section or a dialog are one of these**, at the head of what they switch (Preview and Code in [AppFilePane](AppFilePane.md)). The underlined tab belongs to the title bar's routes and appears nowhere else.
11
12
  - If the options don't fit (a narrow pane, long labels, a phone), use an [AppSelect](AppSelect.md) with an `aria-label` instead; a segmented control never hides options.
12
13
 
13
14
  ## Markup
@@ -5,10 +5,10 @@ One choice from a list you can name in advance: a native select in the text fiel
5
5
  ## Use / don't use
6
6
 
7
7
  - Everything about it is [AppTextField](AppTextField.md)'s: label above, a `control-height` box at `radius-lg`, one supporting or error line. A chevron (`expand_more`) at the trailing edge says it opens. The list itself is the platform's own, so it is accessible and right on every device.
8
- - Use it for 6 or more options, or when space is short. 2 to 5 options that change the content in place are an [AppSegmented](AppSegmented.md); choices that need a sentence each are [AppSelectTile](AppSelectTile.md)s.
8
+ - Use it for 6 or more options, or when space is short. 2 to 5 options that change the content in place are an [AppSegmented](AppSegmented.md); 2 to 5 short options in a form are radios ([AppCheckbox](AppCheckbox.md)); choices that need a sentence each are [AppSelectTile](AppSelectTile.md)s.
9
9
  - A placeholder names the choice when there is no default ("Choose a branch"); prefer a sensible default.
10
10
  - Without a visible label (a select in the filter row, left of the main control), give the select an `aria-label`.
11
- - A searchable or multi-value picker (a combobox) is not in the set yet.
11
+ - Past about ten options, or to choose several, use an [AppCombobox](AppCombobox.md).
12
12
 
13
13
  ## Markup
14
14
 
@@ -9,7 +9,7 @@ See [selection.md](../rules/selection.md).
9
9
  - Unselected it is the statement surface, and the check holds its place unseen; selected it takes `secondary-container`, the filled check and weight 700, at the same size so nothing moves. Padded like a card (24, 28 from 600px).
10
10
  - One of a set is a radio, so the group is a radiogroup; when several may be chosen each is a checkbox. Label the set with a field set ([AppTextField](AppTextField.md)).
11
11
  - Never a tint, a ring or a border swap.
12
- - Check the shape first: 2 to 5 options that re-parameterise content in place are an [AppSegmented](AppSegmented.md); a data-driven set is filter [AppChip](AppChip.md)s; a list is [AppListRow](AppListRow.md)s.
12
+ - Check the shape first: options a few words can name are radios or checkboxes ([AppCheckbox](AppCheckbox.md)); 2 to 5 options that re-parameterise content in place are an [AppSegmented](AppSegmented.md); a data-driven set is filter [AppChip](AppChip.md)s; a list is [AppListRow](AppListRow.md)s.
13
13
 
14
14
  ## Markup
15
15
 
@@ -102,7 +102,7 @@ Usage lives here, never in a title bar: it measures the account, not the screen
102
102
  - **The drawer** (below 600px): the title bar's menu button (`aria-expanded`, `aria-controls` on the nav) adds `app-shell--nav-open`. While it's open, make `.app-shell__main` `inert` and move focus to its close. It closes from its close, on a route change and on Escape, and focus returns to the menu button. Remove the class at 600px and up.
103
103
  - **The detail pane's history**: opening it pushes a history entry with its parameter; choosing another row while it's open replaces that entry, so back doesn't step through every row you looked at; close goes back. At every width.
104
104
  - The account card opens the account menu (toggle `aria-expanded`).
105
- - No photo: the person's initial in `<span class="app-account__avatar text-label" aria-hidden="true">R</span>`.
105
+ - No photo: the person's initials ([AppAvatar](AppAvatar.md)) in `<span class="app-account__avatar text-label" aria-hidden="true">RS</span>`.
106
106
  - The brand link keeps its `aria-label`, since the wordmark is decorative.
107
107
 
108
108
  ## Classes
@@ -7,6 +7,7 @@ An on/off setting: a label and one supporting line on the left, the switch on th
7
7
  - The M3 switch: a 52×32 track. Off: `surface-container-highest` with an `outline` border and a 16px `outline` handle. On: `primary` with a 24px `on-primary` handle, because a switch is a control you press.
8
8
  - **On its own, a switch applies at once**, like a light switch: no Save.
9
9
  - **Inside a form with a Save button** it is one of the form's answers and applies with the rest when the user saves. That needs no extra wording.
10
+ - **Something you agree to, or several of a list, is an [AppCheckbox](AppCheckbox.md)**: it waits for Save or Send, where a switch says it applies.
10
11
  - The label says what is on, as a statement: "Deploy on every push", not "Auto-deploy?". Never "Enable …".
11
12
  - Hovering the row shows the state layer as a halo round the switch (the CSS does it).
12
13
 
@@ -9,7 +9,7 @@ A labelled text input: label above, an outlined box, one supporting or error lin
9
9
  - **An error** replaces the supporting line, in `error` with the `error` icon (outlined: FILL 1 is for selection), and turns the border `error`. Say what to do, as a sentence with a full stop: "Enter a full email address.", not "Invalid".
10
10
  - A `<textarea>` for longer answers. A leading icon only for a conventional glyph (mail, search, link).
11
11
  - **Action**: one text [AppButton](AppButton.md) beside the box (Add, Copy), for a field that collects several values or acts on its own value. Collected values are input [AppChip](AppChip.md)s between the box and the supporting line. With none yet, show nothing; the supporting line says the format ("One per line, as NAME=value.").
12
- - **A choice from a list** is an [AppSelect](AppSelect.md); an on/off setting is an [AppSwitch](AppSwitch.md).
12
+ - **A choice from a list** is an [AppSelect](AppSelect.md), or an [AppCombobox](AppCombobox.md) when the list is long; an on/off setting is an [AppSwitch](AppSwitch.md) ([page.md](../rules/page.md) § Which control).
13
13
  - **A set of choices** (tiles, checkboxes) is labelled with a field set: a legend in label type, an optional supporting line.
14
14
  - **A form** is one column at the prose measure, fields 24px apart (`.app-form`), with its one filled action last. [page.md](../rules/page.md) § Forms says where errors go.
15
15
 
@@ -61,7 +61,7 @@ A labelled text input: label above, an outlined box, one supporting or error lin
61
61
  <fieldset class="app-fieldset">
62
62
  <legend class="app-fieldset__legend text-label">Plan</legend>
63
63
  <p class="app-fieldset__support text-supporting text-on-surface-variant">You can change it later.</p>
64
- <!-- AppSelectTiles in .app-tile-group, or checkboxes -->
64
+ <!-- AppSelectTiles in .app-tile-group, or AppCheckbox rows in .app-check-group -->
65
65
  </fieldset>
66
66
 
67
67
  <div class="app-btn-row">
@@ -17,7 +17,7 @@ One turn in a conversation, in an `.app-thread`. **You write in a bubble; Alis w
17
17
  | **Anyone else** | A bubble on the left, same fill and corner, under a who-line | `.app-turn--them` |
18
18
 
19
19
  - **Markdown in a bubble.** With Alis, your words stay as written and markdown isn't rendered. In a conversation with people, where messages also arrive from the CLI and from agents, every bubble renders its markdown: `.prose` on the bubble keeps body type, and headings step down to body size at 600, so lists, code and links read and nothing outgrows the bubble.
20
- - **The who-line** appears only when someone besides you and Alis is in the thread, and opens each run of turns by anyone but you: a 24px avatar (a photo, else initials), the name in label, then role and time in meta. **Alis's avatar is the mark**, so in a group thread it marks each of her runs. Two bubbles in one run sit 8 apart under one who-line.
20
+ - **The who-line** appears only when someone besides you and Alis is in the thread, and opens each run of turns by anyone but you: a 24px avatar (a photo, else initials: [AppAvatar](AppAvatar.md)), the name in label, then role and time in meta. **Alis's avatar is the mark**, so in a group thread it marks each of her runs. Two bubbles in one run sit 8 apart under one who-line.
21
21
  - **The mark is where Alis is now.** In a one-to-one it stands only at the top of her latest turn, 20px, in the turn's head: animated while she thinks, still once she writes, and it moves on to her next turn. Earlier turns carry none: a column of red marks stops meaning *Alis is on it*. In a group thread the who-line carries it instead.
22
22
 
23
23
  ## Her work
@@ -22,15 +22,19 @@ Shared conventions: `app-state` gives anything pressable its hover, focus and pr
22
22
  | AppIconButton | A glyph that performs one action; or a toggle | [AppIconButton.md](AppIconButton.md) |
23
23
  | AppTextField | A labelled input; the field set and the form | [AppTextField.md](AppTextField.md) |
24
24
  | AppSelect | One choice from a list, native select | [AppSelect.md](AppSelect.md) |
25
+ | AppCombobox | One or several from a long list: the select's box, with a search in its menu | [AppCombobox.md](AppCombobox.md) |
25
26
  | AppSwitch | An on/off setting | [AppSwitch.md](AppSwitch.md) |
27
+ | AppCheckbox | Several of a list, or something you agree to; the radio for one of a few | [AppCheckbox.md](AppCheckbox.md) |
26
28
  | AppTooltip | Names a control that shows no words, and carries its keys | [AppTooltip.md](AppTooltip.md) |
27
29
  | AppKeys | A keyboard shortcut, one cap per key, written for the platform | [AppKeys.md](AppKeys.md) |
28
30
  | AppFilePane | A file Alis made, opened beside the conversation: Preview / Code, each kind's body, its states | [AppFilePane.md](AppFilePane.md) |
29
31
  | AppShortcutSheet | Every key the screen answers to, opened by `?`, in the detail pane's place | [AppShortcutSheet.md](AppShortcutSheet.md) |
32
+ | AppAvatar | A person (round) or a thing (a square tile), at 24, 36 or 80 | [AppAvatar.md](AppAvatar.md) |
30
33
  | AppChip | A small fact: status, label, category, filter, input | [AppChip.md](AppChip.md) |
31
34
  | AppAlert | A statement carrying one status; the snackbar | [AppAlert.md](AppAlert.md) |
32
35
  | AppDialog | A confirmation or short form over a scrim | [AppDialog.md](AppDialog.md) |
33
36
  | AppCard | Statement and instrument surfaces | [AppCard.md](AppCard.md) |
37
+ | AppDisclosure | Detail few people need, folded under its title | [AppDisclosure.md](AppDisclosure.md) |
34
38
  | AppLattice | Content you read; the transcript and `.prose` | [AppLattice.md](AppLattice.md) |
35
39
  | AppComposer | Where you write to Alis, an agent or a person; voice and live calls | [AppComposer.md](AppComposer.md) |
36
40
  | AppAttachment | A file, a thing shared into the conversation, or a queued message, in the composer's tray and in the sent message | [AppAttachment.md](AppAttachment.md) |
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@alis-build/design-system",
3
- "version": "0.18.0",
3
+ "version": "0.21.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",
7
7
  "license": "Apache-2.0",
8
8
  "style": "alisx.css",
9
9
  "sideEffects": ["*.css"],
10
+ "bin": {
11
+ "alisx-check": "check.mjs"
12
+ },
10
13
  "exports": {
11
14
  "./alisx.css": "./alisx.css",
12
15
  "./tokens.css": "./tokens.css",
@@ -14,6 +17,8 @@
14
17
  "./tokens.json": "./tokens.json",
15
18
  "./themes.json": "./themes.json",
16
19
  "./marks.json": "./marks.json",
20
+ "./classes.json": "./classes.json",
21
+ "./stylelint": "./stylelint.mjs",
17
22
  "./rules/*": "./rules/*",
18
23
  "./components/*": "./components/*",
19
24
  "./assets/*": "./assets/*",
@@ -26,11 +31,22 @@
26
31
  "tokens.json",
27
32
  "themes.json",
28
33
  "marks.json",
34
+ "classes.json",
35
+ "stylelint.mjs",
36
+ "check.mjs",
29
37
  "rules",
30
38
  "components",
31
39
  "assets",
32
40
  "NOTICE"
33
41
  ],
42
+ "peerDependencies": {
43
+ "stylelint": ">=16.11.0"
44
+ },
45
+ "peerDependenciesMeta": {
46
+ "stylelint": {
47
+ "optional": true
48
+ }
49
+ },
34
50
  "publishConfig": {
35
51
  "access": "public"
36
52
  }
@@ -54,8 +54,17 @@ tint allowed is a diff's, beside + and − (a drawing, [styling.md](styling.md))
54
54
 
55
55
  ## Avatars
56
56
 
57
+ [AppAvatar](../components/AppAvatar.md). **A person is round and a thing is a
58
+ square tile**: a person by their photo or initials, an organisation by its logo
59
+ or initials, anything else by its icon. Alis is the mark.
60
+
57
61
  Icon tiles and initials take `surface-container-highest` with `on-surface` ink; a
58
62
  categorical avatar takes a `catN-container` with its `on-catN-container` ink. Never a status role, never `primary`.
63
+ People are never coloured by their name.
64
+
65
+ **Three sizes: 24 in a line, 36 leading a row, 80 on the page about them.**
66
+ Several people sit side by side at 24, three then a count, never overlapped: a
67
+ ring round each would have to match whatever ground is under it.
59
68
 
60
69
  **A logo takes no ground.** It arrives with its own, so no disc and no white plate
61
70
  behind it. The tile returns only when the logo is absent and a drawn mark stands
package/rules/colour.md CHANGED
@@ -6,7 +6,7 @@
6
6
  it is not something you press. The reverse does not hold: most things you press
7
7
  are ink. `primary` is spent on four things only: the filled button, a link, the
8
8
  composer's trailing button, and a control while you use it (the focus outline, a
9
- focused field, a switch that is on, a drop target). Text and outlined buttons are
9
+ focused field, a switch, checkbox or radio that is on, a drop target). Text and outlined buttons are
10
10
  ink ([buttons.md](buttons.md)), and so is a progress bar.
11
11
 
12
12
  ## The decision
@@ -4,11 +4,11 @@ What the system doesn't decide yet, in one place. When you hit one, take the qui
4
4
 
5
5
  ## Components not in the set
6
6
 
7
- - **Comboboxes** (a searchable or multi-value select) and **date and time pickers**. Use `AppSelect` or a text field with a format hint.
8
- - **Checkboxes and radios** as standalone controls. A labelled set of choices is `AppSelectTile`s in an `AppFieldset`; an on/off setting is `AppSwitch`.
7
+ - **Date and time pickers**. Use a text field with a format hint.
8
+ - **A bar of actions for several chosen rows** ("3 selected"). [AppCheckbox](../components/AppCheckbox.md) chooses them; what acts on them has no pattern yet.
9
9
  - **The marketing components** (`.ax-*`, alisx.com) are not in this package: it covers the product register. A layout class for a grid of lattices is missing too.
10
10
  - **What the Skill store and the Specialists offer**, beyond their one-line descriptions in [README.md](README.md). Marketing copy about them needs a product brief.
11
- - **Tabs outside the title bar**, **avatars** as a component ([chips-alerts.md](chips-alerts.md) has the rule), **file upload**, and a **dismissible alert**.
11
+ - **File upload**, and a **dismissible alert**.
12
12
 
13
13
  ## Open patterns
14
14
 
package/rules/page.md CHANGED
@@ -14,13 +14,19 @@ Where does this go?
14
14
  ├─ A filter that scopes the page: account,
15
15
  │ product, period, status, target, or tabs
16
16
  │ that narrow one list → the filter row
17
+ ├─ Views that switch in place inside a pane,
18
+ │ a section or a dialog → a segmented control at its head
17
19
  └─ A filter or a search inside one pane or
18
20
  one section → that pane or section's header
19
21
  ```
20
22
 
21
23
  **A tab that changes the route is navigation; a tab that narrows one list is a
22
24
  filter**, and a filter belongs in the filter row as a segmented control
23
- ([selection.md](selection.md)).
25
+ ([selection.md](selection.md)). **Inside content there are no tabs**: views that
26
+ replace each other in a pane, a section or a dialog are a segmented control at
27
+ the head of what they switch, and past five, a button that names its choice
28
+ (§ The filter row). The underlined tab is the title bar's alone, so it always
29
+ means another route.
24
30
 
25
31
  ## The title bar
26
32
 
@@ -112,7 +118,9 @@ scrolling with it: **one row that narrows the list**, and wraps.
112
118
  - **A choice among several options is a button that names its choice**, with a
113
119
  trailing `expand_more`, opening a menu whose chosen row is checked (§ Menus).
114
120
  It keeps the row at the control height, where a field wouldn't. A select field
115
- ([AppSelect](../components/AppSelect.md)) belongs in a form.
121
+ ([AppSelect](../components/AppSelect.md)) belongs in a form. A long list gets a
122
+ search as the menu's first line, and with several chosen the button reads as a
123
+ count, "4 people" ([AppCombobox](../components/AppCombobox.md)).
116
124
  - **The count closes the row**, at the far end, and answers it: what the scope
117
125
  produces ("24 projects"), and "3 of 24" while a query or a filter narrows.
118
126
  - One row of controls before the first result, never two.
@@ -180,6 +188,9 @@ leads its content with it, or leaves it out.
180
188
  one filled action last and labelled with its outcome.
181
189
  - **A field is labelled above**, in label type. A set of choices (tiles,
182
190
  checkboxes, radios) is labelled once, as a group, the same way.
191
+ - **Detail few people need folds** under its title
192
+ ([AppDisclosure](../components/AppDisclosure.md)): advanced settings, never a
193
+ required field.
183
194
  - **A field that collects several values** (email addresses, tags) takes one text
184
195
  action beside it ("Add"); added values show below as input chips. Enter adds
185
196
  too.
@@ -210,6 +221,23 @@ leads its content with it, or leaves it out.
210
221
  at the top.
211
222
  - **A switch** applies at once on its own, and with the rest on Save inside a form.
212
223
 
224
+ ### Which control
225
+
226
+ ```
227
+ What is the person choosing?
228
+ ├─ On or off, a setting → AppSwitch
229
+ ├─ Something they agree to before sending,
230
+ │ or several of a list → checkboxes (AppCheckbox)
231
+ ├─ One of 2 to 5
232
+ │ ├─ it changes the content in place → AppSegmented
233
+ │ ├─ a few words name each → radios (AppCheckbox)
234
+ │ └─ each needs a sentence → AppSelectTile
235
+ ├─ One of 6 to about ten → AppSelect
236
+ ├─ One or several of a longer list, or a
237
+ │ list from a server (people, countries) → AppCombobox
238
+ └─ Values they type themselves (emails, tags) → AppTextField with Add
239
+ ```
240
+
213
241
  ## The drafting field
214
242
 
215
243
  The alisx.com hero grid (the `DraftingField` component, or its classes).
@@ -51,9 +51,13 @@ AppShell
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
53
  | Text | `AppTextField` (with `action` for one that collects several values, shown as input `AppChip`s below) |
54
- | One choice from a list | `AppSelect` |
54
+ | One choice from a list | `AppSelect`; past about ten options, or to choose several, `AppCombobox` |
55
55
  | An on/off setting | `AppSwitch` |
56
+ | Several of a list, or something to agree to | `AppCheckbox`; one of a few short options is its radio ([page.md](page.md) § Which control) |
56
57
  | A choice among cards, labelled | `AppSelectTile`s in an `AppFieldset` |
58
+ | A person, an organisation, or an icon leading a row | `AppAvatar`: a person round, a thing a square tile; 24, 36 or 80 |
59
+ | Detail few people need | `AppDisclosure`, closed by default |
60
+ | Views that switch in place inside a pane or a dialog | `AppSegmented` at its head; never tabs |
57
61
  | Rendered markdown | `.prose` on the container |
58
62
  | A status on a panel | `AppAlert` (the panel is the status) or `AppChip` (the panel has one); states map to tones in [AppChip](../components/AppChip.md) |
59
63
  | A result that passes ("Saved", "Deleted") | `AppSnackbar` |
@@ -74,8 +74,10 @@ rows; a toggle is [buttons.md](buttons.md) § Icon buttons.
74
74
  - **A content-plane list row takes the full fill** and the selected weight
75
75
  ([AppListRow](../components/AppListRow.md)).
76
76
  - **A dense row may use a checked control as its second property.** Where a
77
- checkbox already reports the state, the fill plus the checked box is the pair
78
- and weight is left alone.
77
+ checkbox ([AppCheckbox](../components/AppCheckbox.md)) already reports the state, the fill plus the checked box is the pair
78
+ and weight is left alone. **An option in a menu that takes several is not a
79
+ selected row**: its checkbox says it, and the row takes no fill
80
+ ([AppCombobox](../components/AppCombobox.md)).
79
81
  - **A selected filter chip** takes the selection fill
80
82
  ([AppChip](../components/AppChip.md)).
81
83