@filipgutica/design-system 1.0.40 → 1.0.42
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/language/DESIGN.md +2 -2
- package/language/components.html +335 -6
- package/language/components.md +55 -3
- package/language/decisions.md +6 -1
- package/language/ui-sdk.css +1 -1
- package/package.json +1 -1
package/language/DESIGN.md
CHANGED
|
@@ -109,7 +109,7 @@ Controls use quiet depth and familiar shapes: borderless surfaces with one tight
|
|
|
109
109
|
|
|
110
110
|
Use `@media (min-width: 801px)` only for a rule that applies to desktop alone. One documented exception: the tool-home hero splits at `@media (min-width: 1024px)`, with the title across the top, the lede on the left, and the install block and facts on the right. Below 1024px it stacks in source order. Pages add no viewport breakpoint beyond the table and the hero split. A pane that must collapse at its own width uses a container query, as the detail column in `reference.html` does.
|
|
111
111
|
- Density: an application screen has one size for each place, not a range. In an application screen, buttons, fields, and segmented controls are `sm`, `--control-sm` tall (28px), the main action included: it stands out by its primary fill, not its size. Chips stay 24px, their own size. Rows in a table or list, such as the console's monitor list, and rail and navigation rows, are `--row` tall; their body text is `--text-sm` and their metadata `--text-xs`. Documentation and product pages keep the default `md`. At tablet width every touch target grows to `--control-touch`. The console in `reference.html` uses these sizes. This density is control size; how much a screen shows is [Minimal by default](#minimal-by-default).
|
|
112
|
-
- [Navigation](#navigation) is a strip of 6 links or fewer, or a section rail that moves into a drawer at tablet width. A sticky side rail taller than the window scrolls its link list, not the element that draws its divider, so an overlay scrollbar sits clear of the line. Keep wide code, tables, and charts scrolling inside their containers.
|
|
112
|
+
- [Navigation](#navigation) is a strip of 6 links or fewer, or a section rail that moves into a drawer at tablet width. A sticky side rail taller than the window scrolls its link list, not the element that draws its divider, so an overlay scrollbar sits clear of the line. A contents list beside the reading column is sticky, and at tablet width the labelled trigger opens it instead ([Navigation list](components.md#navigation-list)). Keep wide code, tables, and charts scrolling inside their containers.
|
|
113
113
|
- Keep main headings, actions, and product evidence visible on load. Scrolling should reveal more content without being required to make existing content appear.
|
|
114
114
|
|
|
115
115
|
### Surfaces
|
|
@@ -221,7 +221,7 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
|
|
|
221
221
|
| --- | --- | --- | --- |
|
|
222
222
|
| Global | Which site? | Site header and project switcher | `aria-current="page"` on the registry row |
|
|
223
223
|
| Local | Which page of this site? | Section rail, or a navigation strip of 6 links or fewer | `aria-current="page"`: the lifted fill |
|
|
224
|
-
| In-page | Where am I on this page? | Section rail rows that point to `#id` | `aria-current="location"`: the lifted fill in a rail, a pip in strips and contents lists |
|
|
224
|
+
| In-page | Where am I on this page? | Section rail rows, or a contents list's rows, that point to `#id` | `aria-current="location"`: the lifted fill in a rail, a pip in strips and contents lists |
|
|
225
225
|
| Sequential | What comes next? | Pager | `rel="prev"` and `rel="next"` |
|
|
226
226
|
| Path | How do I get back up? | Breadcrumbs above the page title, on every page below the site's home page; never in the header | The current page as text with `aria-current="page"` |
|
|
227
227
|
| Find | Where is X? | Find field that filters the rail | A live match count |
|
package/language/components.html
CHANGED
|
@@ -126,7 +126,49 @@
|
|
|
126
126
|
.picker li { display: flex; align-items: center; min-height: var(--control-sm); padding: var(--space-2) var(--space-3); border-radius: calc(var(--radius-panel) - var(--space-1)); }
|
|
127
127
|
.picker li.is-hover { background: var(--color-row-hover); }
|
|
128
128
|
.picker li[aria-selected="true"] { background: var(--color-row-selected); }
|
|
129
|
-
|
|
129
|
+
/* The check is decorative: aria-selected carries the state, so the empty alternative text keeps it out of the name. */
|
|
130
|
+
.picker li[aria-selected="true"]::after { content: "✓" / ""; margin-left: auto; color: var(--color-accent); }
|
|
131
|
+
|
|
132
|
+
/* Combobox: an editable field with the select's chevron, over a listbox in the picker recipe. Focus stays in
|
|
133
|
+
the field: aria-activedescendant names the active option, which takes the hover fill and the inset ring.
|
|
134
|
+
Options are rows, --row tall. */
|
|
135
|
+
.combobox { position: relative; width: 100%; }
|
|
136
|
+
.combobox > .input { padding-inline-end: 1.75rem; }
|
|
137
|
+
/* The chevron is a button out of the Tab order, drawn as the styled select's corner. */
|
|
138
|
+
.combobox-toggle { position: absolute; top: 0; inset-inline-end: 0; height: var(--control-md); display: grid; place-items: center; width: 1.75rem; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--color-muted); }
|
|
139
|
+
.combobox-toggle::before { content: ""; width: var(--space-2); height: var(--space-2); border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
|
|
140
|
+
.combobox-toggle:disabled { opacity: 0.58; cursor: not-allowed; }
|
|
141
|
+
.combobox > .picker { position: absolute; z-index: 3; top: 100%; inset-inline-start: 0; width: 100%; max-height: min(20rem, 50dvh); overflow: auto; margin-top: var(--space-1); }
|
|
142
|
+
.combobox > .picker[hidden], .combobox [role="option"][hidden] { display: none; }
|
|
143
|
+
/* A pinned specimen draws the open list in the flow, so its row holds it. */
|
|
144
|
+
[inert] .combobox > .picker { position: static; }
|
|
145
|
+
.combobox [role="option"] { min-height: var(--row); padding-block: 0; }
|
|
146
|
+
.combobox [role="option"]:is(.is-hover, [data-active]) { background: var(--color-row-hover); }
|
|
147
|
+
@media (hover: hover) { .combobox [role="option"]:not([aria-disabled="true"]):hover { background: var(--color-row-hover); } }
|
|
148
|
+
.combobox [role="option"][data-active] { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
149
|
+
.combobox [role="option"][aria-disabled="true"] { color: var(--color-muted); font-size: var(--text-sm); }
|
|
150
|
+
|
|
151
|
+
/* Number field: a wrapper in the field recipe, as the search wrapper is, holding the decrease button, the
|
|
152
|
+
input, an optional unit, and the increase button. The wrapper carries the fill, edge, shadow, and focus. Each
|
|
153
|
+
button spans the wrapper's 1px edges, so its box is the control height square (44px at tablet width), and takes
|
|
154
|
+
the field's corners, so its tint meets the wrapper's own. The wrapper does not clip, because a clip would also
|
|
155
|
+
cut the buttons' tap area along the edge. */
|
|
156
|
+
.number-field { --depth: var(--shadow-field); --field-height: var(--control-md); display: flex; width: 100%; height: var(--field-height); border: 1px solid var(--color-field-edge); border-radius: var(--radius-field); background: var(--color-field-bg); box-shadow: var(--depth); color: var(--color-text); font: var(--text-md) / 1.35 var(--font-ui); }
|
|
157
|
+
.number-field[data-size="sm"] { --field-height: var(--control-sm); font-size: var(--text-sm); }
|
|
158
|
+
.number-field[data-size="lg"] { --field-height: var(--control-lg); font-size: var(--text-lg); }
|
|
159
|
+
/* A zero width lets the input take the free space without its intrinsic width widening the field. */
|
|
160
|
+
.number-field > input { flex: 1; width: 0; min-width: 0; padding: 0 var(--space-2); border: 0; outline: 0; background: transparent; color: inherit; font: inherit; font-variant-numeric: tabular-nums; text-align: end; }
|
|
161
|
+
.number-field > input:has(+ .number-unit) { padding-inline-end: 0; }
|
|
162
|
+
.number-unit { align-self: center; padding-inline: var(--space-1) var(--space-2); color: var(--color-muted); font-size: var(--text-sm); }
|
|
163
|
+
/* :where keeps the quiet action's hover and press colours above this rest colour. */
|
|
164
|
+
.number-field > :where(.quiet-action) { flex: none; width: var(--field-height); margin-block: -1px; padding: 0; border: 0; border-radius: var(--radius-field); color: var(--color-muted); }
|
|
165
|
+
.number-field > :where(.quiet-action:first-child) { margin-inline-start: -1px; }
|
|
166
|
+
.number-field > :where(.quiet-action:last-child) { margin-inline-end: -1px; }
|
|
167
|
+
.number-field:has(input[aria-invalid="true"]) { border-color: var(--color-error); }
|
|
168
|
+
.number-field:has(input:disabled) { background: var(--color-well); box-shadow: none; opacity: 0.58; cursor: not-allowed; }
|
|
169
|
+
.number-field > input:disabled { cursor: not-allowed; }
|
|
170
|
+
/* The wrapper already fades, so its disabled buttons do not fade again. */
|
|
171
|
+
.number-field:has(input:disabled) > .quiet-action:disabled { opacity: 1; }
|
|
130
172
|
|
|
131
173
|
/* Overflow menu: a quiet-action trigger and a floating list of actions (the WAI-ARIA menu button pattern). */
|
|
132
174
|
.overflow { position: relative; display: inline-flex; }
|
|
@@ -345,6 +387,34 @@
|
|
|
345
387
|
.card-body { padding: 0 var(--space-4) var(--space-4); font-size: var(--text-sm); color: var(--color-muted); }
|
|
346
388
|
.card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); margin-inline: var(--space-4); padding-block: var(--space-3); border-top: 1px solid var(--color-border-subtle); color: var(--color-muted); font-size: var(--text-sm); }
|
|
347
389
|
|
|
390
|
+
/* Description list: one record's details as term and value pairs, each pair in a div. Each pair is a subgrid
|
|
391
|
+
row, so the terms share one column as wide as the longest term, up to 12rem. In a container under 30rem each
|
|
392
|
+
term sits above its value. */
|
|
393
|
+
.description-list { display: grid; grid-template-columns: fit-content(12rem) minmax(0, 1fr); gap: var(--space-2) var(--space-4); margin: 0; }
|
|
394
|
+
.description-list > div { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: first baseline; }
|
|
395
|
+
/* A term wraps anywhere, so an unbroken term cannot push the fit-content(12rem) column past its cap. */
|
|
396
|
+
.description-list dt { color: var(--color-muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
|
|
397
|
+
.description-list dd { min-width: 0; margin: 0; color: var(--color-text); font-size: var(--text-md); font-variant-numeric: tabular-nums; }
|
|
398
|
+
.description-list dd[data-empty] { color: var(--color-muted); }
|
|
399
|
+
.description-list dd .quiet-action { width: var(--control-sm); height: var(--control-sm); margin-inline-start: var(--space-1); vertical-align: middle; color: var(--color-muted); }
|
|
400
|
+
@container (max-width: 30rem) {
|
|
401
|
+
.description-list { grid-template-columns: minmax(0, 1fr); }
|
|
402
|
+
.description-list > div { row-gap: var(--space-1); }
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/* Stat tile: a headline count on the surface fill, in a grid of tiles outside a card. The label comes first in
|
|
406
|
+
the DOM, and the value takes no status colour. A linked tile fills on hover and takes the focus ring. */
|
|
407
|
+
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--space-4); width: 100%; }
|
|
408
|
+
.stat, .stat > dl { display: grid; align-content: start; gap: var(--space-1); min-width: 0; margin: 0; }
|
|
409
|
+
.stat { padding: var(--space-4); border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface); color: var(--color-text); text-decoration: none; }
|
|
410
|
+
.stat-label { color: var(--color-muted); font-size: var(--text-sm); }
|
|
411
|
+
.stat-value { margin: 0; font: var(--weight-semibold) var(--text-2xl) / var(--leading-tight) var(--font-ui); font-variant-numeric: tabular-nums; }
|
|
412
|
+
.stat-unit { color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--weight-regular); }
|
|
413
|
+
.stat-context { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; color: var(--color-muted); font-size: var(--text-sm); }
|
|
414
|
+
a.stat { transition: background-color var(--duration-fast) var(--ease-out); }
|
|
415
|
+
a.stat.is-hover { background: var(--color-row-hover); }
|
|
416
|
+
@media (hover: hover) { a.stat:hover { background: var(--color-row-hover); } }
|
|
417
|
+
|
|
348
418
|
/* Figure */
|
|
349
419
|
.figure { display: grid; gap: var(--space-3); min-width: 0; margin: 0; }
|
|
350
420
|
.figure-plate { min-width: 0; overflow-x: auto; padding: var(--space-5); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-panel); background: var(--color-surface); }
|
|
@@ -816,7 +886,7 @@
|
|
|
816
886
|
/* One ring for every role: --focus-width of --color-focus (the accent) with a --focus-offset gap and no
|
|
817
887
|
glow, over the control's own raise or sink. The tokens.css base draws it on links; these rules pin
|
|
818
888
|
it and move it to the visible part of composite controls. */
|
|
819
|
-
:is(.btn, .quiet-action, .check input, .segmented button, .toggle, .crumbs a, .chip, .tool > summary):is(:focus-visible, .is-focus),
|
|
889
|
+
:is(.btn, .quiet-action, .check input, .segmented button, .toggle, .crumbs a, .chip, .tool > summary, a.stat):is(:focus-visible, .is-focus),
|
|
820
890
|
:is(.dialog, .drawer, .slideout):focus-visible,
|
|
821
891
|
.switch:is(:focus-visible, .is-focus) .switch-track,
|
|
822
892
|
.radio-card:has(input:is(:focus-visible, .is-focus)) { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
|
|
@@ -831,10 +901,13 @@
|
|
|
831
901
|
.search:has(input[aria-invalid="true"]) { border-color: var(--color-error); }
|
|
832
902
|
.search:has(input[aria-invalid="true"]):is(:has(input:focus-visible), .is-focus) { border-color: var(--color-error); box-shadow: var(--shadow-field-focus-invalid); }
|
|
833
903
|
.search:has(input:disabled) { background: var(--color-well); box-shadow: none; opacity: 0.58; cursor: not-allowed; }
|
|
904
|
+
/* The number field wrapper takes the field focus in the same way, and the invalid edge and line through its input. */
|
|
905
|
+
.number-field:is(:has(input:focus-visible), .is-focus) { outline: none; border-color: var(--color-accent); box-shadow: var(--shadow-field-focus); }
|
|
906
|
+
.number-field:has(input[aria-invalid="true"]):is(:has(input:focus-visible), .is-focus) { border-color: var(--color-error); box-shadow: var(--shadow-field-focus-invalid); }
|
|
834
907
|
|
|
835
908
|
@media (forced-colors: active) {
|
|
836
909
|
/* The inset accent line drops, so a focused field draws the system ring just inside its edge. */
|
|
837
|
-
:is(.input, .select, .textarea):is(:focus-visible, .is-focus), .search:is(:has(input:focus-visible), .is-focus), .composer-box:is(:has(textarea:focus-visible), .is-focus) { outline: var(--focus-width) solid Highlight; outline-offset: -1px; }
|
|
910
|
+
:is(.input, .select, .textarea):is(:focus-visible, .is-focus), .search:is(:has(input:focus-visible), .is-focus), .number-field:is(:has(input:focus-visible), .is-focus), .composer-box:is(:has(textarea:focus-visible), .is-focus) { outline: var(--focus-width) solid Highlight; outline-offset: -1px; }
|
|
838
911
|
/* The lifted fill drops, so the selected tab takes a system border; the padding absorbs it. */
|
|
839
912
|
.tab[aria-selected="true"] { border: 2px solid Highlight; padding-inline: calc(var(--tab-pad) - 2px); }
|
|
840
913
|
.tab[aria-selected="true"]::before { content: none; }
|
|
@@ -877,6 +950,12 @@
|
|
|
877
950
|
/* WebKit draws the range on the track. The thumb inherits the opt-out, so it takes adjustment back. */
|
|
878
951
|
.range::-webkit-slider-runnable-track { forced-color-adjust: none; background: linear-gradient(Highlight, Highlight) 0 / var(--value, 50%) 100% no-repeat, Canvas; }
|
|
879
952
|
.range::-webkit-slider-thumb { forced-color-adjust: auto; }
|
|
953
|
+
/* The combobox's active option keeps an inset system ring, and the chosen option's check the system text colour. */
|
|
954
|
+
.combobox [role="option"][data-active] { outline: var(--focus-width) solid Highlight; outline-offset: calc(var(--focus-width) * -1); }
|
|
955
|
+
.combobox [role="option"][aria-selected="true"]::after { color: CanvasText; }
|
|
956
|
+
/* The number field's signs take the button text colour, and a button at its limit the disabled colour. */
|
|
957
|
+
.number-field > .quiet-action { color: ButtonText; }
|
|
958
|
+
.number-field > .quiet-action:disabled { color: GrayText; }
|
|
880
959
|
}
|
|
881
960
|
|
|
882
961
|
/* ---------- Catalogue page ---------- */
|
|
@@ -931,7 +1010,11 @@
|
|
|
931
1010
|
.caption { color: var(--color-muted); font-size: var(--text-xs); }
|
|
932
1011
|
.wide { flex-basis: 100%; }
|
|
933
1012
|
/* Fields fill their container; the catalogue gives each specimen a preferred width. */
|
|
934
|
-
.state > :is(.field, .input, .select, .textarea, .search) { width: 220px; }
|
|
1013
|
+
.state > :is(.field, .input, .select, .textarea, .search, .number-field) { width: 220px; }
|
|
1014
|
+
/* A description list stacks by its container's width, so its specimen is the container. The narrow specimen
|
|
1015
|
+
is 20rem wide, under the 30rem query. */
|
|
1016
|
+
.state:has(> .description-list) { container-type: inline-size; }
|
|
1017
|
+
.state.narrow { flex: 0 1 20rem; }
|
|
935
1018
|
.state .pager { padding-top: 0; border-top: 0; }
|
|
936
1019
|
.rail-specimen { display: grid; gap: var(--space-3); width: 240px; }
|
|
937
1020
|
.phone-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); width: min(100%, 360px); padding-block: var(--space-2); border-bottom: 1px solid var(--color-text); }
|
|
@@ -1010,6 +1093,10 @@
|
|
|
1010
1093
|
.segmented:not([data-specimen="size"] *) { --item: var(--control-touch); }
|
|
1011
1094
|
.input:not([data-specimen="size"] *), .select:not([data-specimen="size"] *), .range:not([data-specimen="size"] *) { height: var(--control-touch); }
|
|
1012
1095
|
.search { height: var(--control-touch); }
|
|
1096
|
+
.combobox [role="option"] { min-height: var(--control-touch); }
|
|
1097
|
+
/* The chevron is its own target, so it grows to a square; the text stops before it. */
|
|
1098
|
+
.combobox-toggle { width: var(--control-touch); }
|
|
1099
|
+
.combobox > .input { padding-inline-end: var(--control-touch); }
|
|
1013
1100
|
.check:not([data-specimen="size"] *), .switch:not([data-specimen="size"] *), .toggle:not([data-specimen="size"] *) { min-height: var(--control-touch); }
|
|
1014
1101
|
.copy-link { width: var(--control-touch); height: var(--control-touch); }
|
|
1015
1102
|
/* Quiet actions in docs components: 32px on desktop, 44px here. */
|
|
@@ -1064,6 +1151,7 @@
|
|
|
1064
1151
|
<symbol id="i-search" viewBox="0 0 16 16"><circle cx="7" cy="7" r="4.5"/><path d="M10.5 10.5 14 14"/></symbol>
|
|
1065
1152
|
<symbol id="i-close" viewBox="0 0 16 16"><path d="M4 4l8 8M12 4l-8 8"/></symbol>
|
|
1066
1153
|
<symbol id="i-plus" viewBox="0 0 16 16"><path d="M8 3.5v9M3.5 8h9"/></symbol>
|
|
1154
|
+
<symbol id="i-minus" viewBox="0 0 16 16"><path d="M3.5 8h9"/></symbol>
|
|
1067
1155
|
<symbol id="i-copy" viewBox="0 0 16 16"><rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 5.5V3.5a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2"/></symbol>
|
|
1068
1156
|
<symbol id="i-wrap" viewBox="0 0 16 16"><path d="M2.5 4h11M2.5 8h9a2 2 0 0 1 0 4H8.5M10 10.5 8.5 12l1.5 1.5M2.5 12h3"/></symbol>
|
|
1069
1157
|
<symbol id="i-chevron-down" viewBox="0 0 16 16"><path d="m4 6 4 4 4-4"/></symbol>
|
|
@@ -1123,7 +1211,7 @@
|
|
|
1123
1211
|
</div>
|
|
1124
1212
|
<div class="navlist" role="group" aria-labelledby="rail-inputs">
|
|
1125
1213
|
<span class="group-label" id="rail-inputs">Inputs</span>
|
|
1126
|
-
<a href="#text-input-and-textarea" data-terms="text input and textarea inputs type a short value or a longer note. field textbox search form">Text input and textarea</a><a href="#select" data-terms="select inputs choose from a longer list. dropdown picker menu">Select</a><a href="#field-wrapper" data-terms="field wrapper inputs label, description, and error text around a field. label help error validation form">Field wrapper</a><a href="#slider" data-terms="slider inputs set a value in a range. range">Slider</a>
|
|
1214
|
+
<a href="#text-input-and-textarea" data-terms="text input and textarea inputs type a short value or a longer note. field textbox search form">Text input and textarea</a><a href="#select" data-terms="select inputs choose from a longer list. dropdown picker menu">Select</a><a href="#combobox" data-terms="combobox inputs choose one value from a long list by typing to filter it. autocomplete typeahead search select">Combobox</a><a href="#number-field" data-terms="number field inputs enter an exact amount, with steps and a unit. stepper spinbutton quantity numeric">Number field</a><a href="#field-wrapper" data-terms="field wrapper inputs label, description, and error text around a field. label help error validation form">Field wrapper</a><a href="#slider" data-terms="slider inputs set a value in a range. range">Slider</a>
|
|
1127
1215
|
</div>
|
|
1128
1216
|
<div class="navlist" role="group" aria-labelledby="rail-feedback">
|
|
1129
1217
|
<span class="group-label" id="rail-feedback">Feedback and status</span>
|
|
@@ -1133,6 +1221,10 @@
|
|
|
1133
1221
|
<span class="group-label" id="rail-containers">Containers and overlays</span>
|
|
1134
1222
|
<a href="#surface-and-card" data-terms="surface and card containers and overlays panels and cards for parallel, comparable content. panel box tile">Surface and card</a><a href="#figure" data-terms="figure containers and overlays an image or diagram with a caption. image screenshot caption">Figure</a><a href="#dialog" data-terms="dialog containers and overlays a modal task that needs an answer before the page continues. modal popup sheet confirm">Dialog</a><a href="#drawer" data-terms="drawer containers and overlays navigation in a panel from the leading edge, such as phone navigation. off-canvas sidebar menu">Drawer</a><a href="#slideout" data-terms="slideout containers and overlays a modal panel from an edge for filters and secondary detail. sheet side panel flyout filters">Slideout</a>
|
|
1135
1223
|
</div>
|
|
1224
|
+
<div class="navlist" role="group" aria-labelledby="rail-data-display">
|
|
1225
|
+
<span class="group-label" id="rail-data-display">Data display</span>
|
|
1226
|
+
<a href="#description-list" data-terms="description list data display the details of one record as term and value pairs. dl key value details properties">Description list</a><a href="#stat-tile" data-terms="stat tile data display a headline count with its label and context. kpi metric number summary dashboard">Stat tile</a>
|
|
1227
|
+
</div>
|
|
1136
1228
|
<div class="navlist" role="group" aria-labelledby="rail-navigation">
|
|
1137
1229
|
<span class="group-label" id="rail-navigation">Navigation</span>
|
|
1138
1230
|
<a href="#navigation-list" data-terms="navigation list navigation rows of links with current page and current location. nav menu sidebar rail toc contents strip">Navigation list</a><a href="#section-rail" data-terms="section rail navigation a sticky list of sections that moves into a drawer on phones. sidebar on this page toc contents scroll spy">Section rail</a><a href="#find-field" data-terms="find field navigation filter a navigation list as you type. search filter shortcut slash">Find field</a><a href="#breadcrumbs" data-terms="breadcrumbs navigation the path from the site to this page. crumbs hierarchy back path">Breadcrumbs</a><a href="#pager" data-terms="pager navigation previous and next pages in a sequence. pagination prev next sequence">Pager</a><a href="#tabs" data-terms="tabs navigation switch panels about one object, without leaving the page. tablist panels">Tabs</a><a href="#skip-link" data-terms="skip link navigation jump past the header to the content. skip to content a11y bypass">Skip link</a><a href="#keyboard-key" data-terms="keyboard key navigation show a key or shortcut in text. kbd shortcut hotkey">Keyboard key</a>
|
|
@@ -1172,9 +1264,10 @@
|
|
|
1172
1264
|
<div class="index-grid">
|
|
1173
1265
|
<div><h3><a href="#group-actions">Actions</a></h3><ul><li><a href="#button">Button</a><span>The main action control: primary, secondary, ghost, danger, and text.</span></li><li><a href="#quiet-action">Quiet action</a><span>A small transparent action inside a component, such as Copy or Close.</span></li><li><a href="#overflow-menu">Overflow menu</a><span>Two or more secondary actions behind a More button.</span></li><li><a href="#chip">Chip</a><span>A small suggestion that fills in a composer or opens a screen.</span></li></ul></div>
|
|
1174
1266
|
<div><h3><a href="#group-selection">Selection</a></h3><ul><li><a href="#checkbox-and-radio">Checkbox and radio</a><span>Pick several options, or one from a short list.</span></li><li><a href="#radio-card-group">Radio card group</a><span>Pick one option that needs a description.</span></li><li><a href="#switch">Switch</a><span>Turn a setting on or off at once.</span></li><li><a href="#toggle-button">Toggle button</a><span>A labelled card that latches on, with a switch inside.</span></li><li><a href="#segmented-control">Segmented control</a><span>Two to five short options that apply at once.</span></li></ul></div>
|
|
1175
|
-
<div><h3><a href="#group-inputs">Inputs</a></h3><ul><li><a href="#text-input-and-textarea">Text input and textarea</a><span>Type a short value or a longer note.</span></li><li><a href="#select">Select</a><span>Choose from a longer list.</span></li><li><a href="#field-wrapper">Field wrapper</a><span>Label, description, and error text around a field.</span></li><li><a href="#slider">Slider</a><span>Set a value in a range.</span></li></ul></div>
|
|
1267
|
+
<div><h3><a href="#group-inputs">Inputs</a></h3><ul><li><a href="#text-input-and-textarea">Text input and textarea</a><span>Type a short value or a longer note.</span></li><li><a href="#select">Select</a><span>Choose from a longer list.</span></li><li><a href="#combobox">Combobox</a><span>Choose one value from a long list by typing to filter it.</span></li><li><a href="#number-field">Number field</a><span>Enter an exact amount, with steps and a unit.</span></li><li><a href="#field-wrapper">Field wrapper</a><span>Label, description, and error text around a field.</span></li><li><a href="#slider">Slider</a><span>Set a value in a range.</span></li></ul></div>
|
|
1176
1268
|
<div><h3><a href="#group-feedback">Feedback and status</a></h3><ul><li><a href="#progress">Progress</a><span>Show how far a task has got.</span></li><li><a href="#score">Score</a><span>Show a value out of a maximum.</span></li><li><a href="#badge">Badge</a><span>A short status label.</span></li><li><a href="#alert">Alert</a><span>A real caveat or status message in the page.</span></li></ul></div>
|
|
1177
1269
|
<div><h3><a href="#group-containers">Containers and overlays</a></h3><ul><li><a href="#surface-and-card">Surface and card</a><span>Panels and cards for parallel, comparable content.</span></li><li><a href="#figure">Figure</a><span>An image or diagram with a caption.</span></li><li><a href="#dialog">Dialog</a><span>A modal task that needs an answer before the page continues.</span></li><li><a href="#drawer">Drawer</a><span>Navigation in a panel from the leading edge, such as phone navigation.</span></li><li><a href="#slideout">Slideout</a><span>A modal panel from an edge for filters and secondary detail.</span></li></ul></div>
|
|
1270
|
+
<div><h3><a href="#group-data-display">Data display</a></h3><ul><li><a href="#description-list">Description list</a><span>The details of one record as term and value pairs.</span></li><li><a href="#stat-tile">Stat tile</a><span>A headline count with its label and context.</span></li></ul></div>
|
|
1178
1271
|
<div><h3><a href="#group-navigation">Navigation</a></h3><ul><li><a href="#navigation-list">Navigation list</a><span>Rows of links with current page and current location.</span></li><li><a href="#section-rail">Section rail</a><span>A sticky list of sections that moves into a drawer on phones.</span></li><li><a href="#find-field">Find field</a><span>Filter a navigation list as you type.</span></li><li><a href="#breadcrumbs">Breadcrumbs</a><span>The path from the site to this page.</span></li><li><a href="#pager">Pager</a><span>Previous and next pages in a sequence.</span></li><li><a href="#tabs">Tabs</a><span>Switch panels about one object, without leaving the page.</span></li><li><a href="#skip-link">Skip link</a><span>Jump past the header to the content.</span></li><li><a href="#keyboard-key">Keyboard key</a><span>Show a key or shortcut in text.</span></li></ul></div>
|
|
1179
1272
|
<div><h3><a href="#group-conversation">Conversation</a></h3><ul><li><a href="#message-row">Message row</a><span>One message: avatar, author, time, and body, with no bubble.</span></li><li><a href="#message-group">Message group</a><span>Consecutive messages by one author under one avatar.</span></li><li><a href="#hover-toolbar">Hover toolbar</a><span>Quick actions on a message, shown on hover or focus.</span></li><li><a href="#thread-panel">Thread panel</a><span>A resizable side pane with a message and its replies.</span></li><li><a href="#composer">Composer</a><span>One growing field with an inline send button.</span></li><li><a href="#tool-call-disclosure">Tool-call disclosure</a><span>A collapsed one-line summary of tool output or a handoff note.</span></li><li><a href="#mention">Mention</a><span>An inline @name in a message.</span></li></ul></div>
|
|
1180
1273
|
<div><h3><a href="#group-code">Code and examples</a></h3><ul><li><a href="#code-block">Code block</a><span>Source code with an optional header and Copy, and a live example above it.</span></li></ul></div>
|
|
@@ -1458,6 +1551,45 @@
|
|
|
1458
1551
|
</div></div>
|
|
1459
1552
|
</section>
|
|
1460
1553
|
|
|
1554
|
+
<section class="component" id="combobox" data-layer="Core" data-states="hover focus disabled invalid" aria-labelledby="combobox-title">
|
|
1555
|
+
<header><h3 id="combobox-title">Combobox</h3><span class="badge">Core</span><a href="components.md#combobox">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="combobox" aria-label="Copy link to Combobox" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1556
|
+
<p class="purpose">Choose one value from a long list by typing to filter it.</p>
|
|
1557
|
+
<dl class="guidance"><dt>Do</dt><dd>Use a combobox to choose one value from a long or growing list that the reader can name, such as a product, a location, or a supplier.</dd><dt>Don’t</dt><dd>A combobox for about 15 options or fewer, which is a select, or a free-text field that only suggests values. Typed text never chooses by itself: on leaving the field, it goes back to the chosen option’s label, even when it names another option.</dd></dl>
|
|
1558
|
+
<div class="row"><h4>Closed</h4><div class="states">
|
|
1559
|
+
<div class="state"><div class="field"><label class="field-label" for="cb-live">Product</label><div class="combobox" data-live-combobox><input class="input" id="cb-live" role="combobox" aria-expanded="false" aria-controls="cb-live-list" aria-autocomplete="list" autocomplete="off" value="Hex bolt M8"><button class="combobox-toggle" type="button" tabindex="-1" aria-label="Show products"></button><ul class="picker" id="cb-live-list" role="listbox" aria-label="Products" hidden><li role="option" id="cb-live-1" aria-selected="false">Anchor bolt M10</li><li role="option" id="cb-live-2" aria-selected="false">Cap screw M5</li><li role="option" id="cb-live-3" aria-selected="false">Carriage bolt M8</li><li role="option" id="cb-live-4" aria-selected="false">Cotter pin 3 mm</li><li role="option" id="cb-live-5" aria-selected="false">Eye bolt M8</li><li role="option" id="cb-live-6" aria-selected="false">Flat washer M6</li><li role="option" id="cb-live-7" aria-selected="false">Flat washer M8</li><li role="option" id="cb-live-8" aria-selected="false">Hex bolt M6</li><li role="option" id="cb-live-9" aria-selected="true">Hex bolt M8</li><li role="option" id="cb-live-10" aria-selected="false">Hex nut M6</li><li role="option" id="cb-live-11" aria-selected="false">Hex nut M8</li><li role="option" id="cb-live-12" aria-selected="false">Lock nut M6</li><li role="option" id="cb-live-13" aria-selected="false">Machine screw M4</li><li role="option" id="cb-live-14" aria-selected="false">Rivet 4 mm</li><li role="option" id="cb-live-15" aria-selected="false">Set screw M5</li><li role="option" id="cb-live-16" aria-selected="false">Spring washer M8</li><li role="option" id="cb-live-17" aria-selected="false">Threaded rod M10</li><li role="option" id="cb-live-18" aria-selected="false">Wing nut M8</li><li role="option" id="cb-live-none" aria-disabled="true" hidden>No matches</li></ul></div><p class="sr-only" role="status" id="cb-live-count"></p></div><span class="caption">Rest, live; type to filter, or press ArrowDown</span></div>
|
|
1560
|
+
<div class="state" inert><div class="field"><label class="field-label" for="cb-focus">Product</label><div class="combobox"><input class="input is-focus" id="cb-focus" role="combobox" aria-expanded="false" aria-autocomplete="list" autocomplete="off" value="Hex bolt M8"><button class="combobox-toggle" type="button" tabindex="-1" aria-label="Show products"></button></div></div><span class="caption">Focus visible</span></div>
|
|
1561
|
+
<div class="state" inert><div class="field"><label class="field-label" for="cb-disabled">Product</label><div class="combobox"><input class="input" id="cb-disabled" role="combobox" aria-expanded="false" aria-autocomplete="list" autocomplete="off" value="Hex bolt M8" disabled><button class="combobox-toggle" type="button" tabindex="-1" aria-label="Show products" disabled></button></div></div><span class="caption">Disabled</span></div>
|
|
1562
|
+
<div class="state" inert><div class="field"><label class="field-label" for="cb-invalid">Product</label><div class="combobox"><input class="input" id="cb-invalid" role="combobox" aria-expanded="false" aria-autocomplete="list" autocomplete="off" value="" aria-invalid="true" aria-errormessage="cb-invalid-error"><button class="combobox-toggle" type="button" tabindex="-1" aria-label="Show products"></button></div><p class="field-error" id="cb-invalid-error">Choose a product.</p></div><span class="caption">Invalid</span></div>
|
|
1563
|
+
<div class="state" inert><div class="field"><label class="field-label" for="cb-invalid-focus">Product</label><div class="combobox"><input class="input is-focus" id="cb-invalid-focus" role="combobox" aria-expanded="false" aria-autocomplete="list" autocomplete="off" value="" aria-invalid="true" aria-errormessage="cb-invalid-focus-error"><button class="combobox-toggle" type="button" tabindex="-1" aria-label="Show products"></button></div><p class="field-error" id="cb-invalid-focus-error">Choose a product.</p></div><span class="caption">Invalid, focus visible</span></div>
|
|
1564
|
+
</div></div>
|
|
1565
|
+
<div class="row"><h4>Open</h4><div class="states">
|
|
1566
|
+
<div class="state" inert><div class="field"><label class="field-label" for="cb-open">Product</label><div class="combobox"><input class="input is-focus" id="cb-open" role="combobox" aria-expanded="true" aria-controls="cb-open-list" aria-autocomplete="list" autocomplete="off" value="bolt" aria-activedescendant="cb-open-3"><button class="combobox-toggle" type="button" tabindex="-1" aria-label="Hide products"></button><ul class="picker" id="cb-open-list" role="listbox" aria-label="Products"><li role="option" id="cb-open-1" aria-selected="false" class="is-hover">Anchor bolt M10</li><li role="option" id="cb-open-2" aria-selected="false">Carriage bolt M8</li><li role="option" id="cb-open-3" aria-selected="false" data-active>Eye bolt M8</li><li role="option" id="cb-open-4" aria-selected="false">Hex bolt M6</li><li role="option" id="cb-open-5" aria-selected="true">Hex bolt M8</li></ul></div></div><span class="caption">Filtered by “bolt”: hover on Anchor bolt M10, Eye bolt M8 active, Hex bolt M8 chosen</span></div>
|
|
1567
|
+
<div class="state" inert><div class="field"><label class="field-label" for="cb-empty">Product</label><div class="combobox"><input class="input is-focus" id="cb-empty" role="combobox" aria-expanded="true" aria-controls="cb-empty-list" aria-autocomplete="list" autocomplete="off" value="spacer"><button class="combobox-toggle" type="button" tabindex="-1" aria-label="Hide products"></button><ul class="picker" id="cb-empty-list" role="listbox" aria-label="Products"><li role="option" id="cb-empty-none" aria-disabled="true">No matches</li></ul></div></div><span class="caption">No matches</span></div>
|
|
1568
|
+
</div></div>
|
|
1569
|
+
</section>
|
|
1570
|
+
|
|
1571
|
+
<section class="component" id="number-field" data-layer="Core" data-states="hover pressed focus disabled invalid" aria-labelledby="number-field-title">
|
|
1572
|
+
<header><h3 id="number-field-title">Number field</h3><span class="badge">Core</span><a href="components.md#number-field">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="number-field" aria-label="Copy link to Number field" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1573
|
+
<p class="purpose">Enter an exact amount, with steps and a unit.</p>
|
|
1574
|
+
<dl class="guidance"><dt>Do</dt><dd>Use a number field for an exact amount that the reader may change by a few steps, such as a quantity or a reorder point. Show the unit in the field, and set <code>min</code> and <code>max</code> when the amount has limits.</dd><dt>Don’t</dt><dd>A number field for a code made of digits, such as a part number, an order number, or a postcode. Use a text input, because steps and digit grouping would change it. Don’t use the native <code>type="number"</code>, which changes the value on a scroll and shows its own spinner.</dd></dl>
|
|
1575
|
+
<div class="row"><h4>States</h4><div class="states">
|
|
1576
|
+
<div class="state"><div class="field"><label class="field-label" for="nf-live">Quantity</label><div class="number-field" data-live-number><button class="quiet-action" type="button" tabindex="-1" aria-label="Decrease quantity"><svg class="icon" aria-hidden="true"><use href="#i-minus"/></svg></button><input id="nf-live" type="text" inputmode="numeric" role="spinbutton" aria-valuetext="1,200 pcs" aria-valuenow="1200" aria-valuemin="0" aria-valuemax="9999" autocomplete="off" value="1,200"><span class="number-unit" aria-hidden="true">pcs</span><button class="quiet-action" type="button" tabindex="-1" aria-label="Increase quantity"><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg></button></div></div><span class="caption">Rest, live; the arrow keys, Home, End, and the buttons change it</span></div>
|
|
1577
|
+
<div class="state"><div class="field"><label class="field-label" for="nf-weight">Weight</label><div class="number-field" data-live-number><button class="quiet-action" type="button" tabindex="-1" aria-label="Decrease weight"><svg class="icon" aria-hidden="true"><use href="#i-minus"/></svg></button><input id="nf-weight" type="text" inputmode="decimal" role="spinbutton" aria-valuetext="12.5 kg" aria-valuenow="12.5" aria-valuemin="0" aria-valuemax="500" data-step="0.5" autocomplete="off" value="12.5"><span class="number-unit" aria-hidden="true">kg</span><button class="quiet-action" type="button" tabindex="-1" aria-label="Increase weight"><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg></button></div></div><span class="caption">Rest, live; a fraction, in steps of 0.5</span></div>
|
|
1578
|
+
<div class="state" inert><div class="field"><label class="field-label" for="nf-focus">Quantity</label><div class="number-field is-focus"><button class="quiet-action" type="button" tabindex="-1" aria-label="Decrease quantity"><svg class="icon" aria-hidden="true"><use href="#i-minus"/></svg></button><input id="nf-focus" type="text" inputmode="numeric" role="spinbutton" aria-valuetext="1,200 pcs" aria-valuenow="1200" aria-valuemin="0" aria-valuemax="9999" autocomplete="off" value="1,200"><span class="number-unit" aria-hidden="true">pcs</span><button class="quiet-action" type="button" tabindex="-1" aria-label="Increase quantity"><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg></button></div></div><span class="caption">Focus visible</span></div>
|
|
1579
|
+
<div class="state" inert><div class="field"><label class="field-label" for="nf-hover">Quantity</label><div class="number-field"><button class="quiet-action" type="button" tabindex="-1" aria-label="Decrease quantity"><svg class="icon" aria-hidden="true"><use href="#i-minus"/></svg></button><input id="nf-hover" type="text" inputmode="numeric" role="spinbutton" aria-valuetext="1,200 pcs" aria-valuenow="1200" aria-valuemin="0" aria-valuemax="9999" autocomplete="off" value="1,200"><span class="number-unit" aria-hidden="true">pcs</span><button class="quiet-action is-hover" type="button" tabindex="-1" aria-label="Increase quantity"><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg></button></div></div><span class="caption">Hover on Increase</span></div>
|
|
1580
|
+
<div class="state" inert><div class="field"><label class="field-label" for="nf-pressed">Quantity</label><div class="number-field"><button class="quiet-action" type="button" tabindex="-1" aria-label="Decrease quantity"><svg class="icon" aria-hidden="true"><use href="#i-minus"/></svg></button><input id="nf-pressed" type="text" inputmode="numeric" role="spinbutton" aria-valuetext="1,200 pcs" aria-valuenow="1200" aria-valuemin="0" aria-valuemax="9999" autocomplete="off" value="1,200"><span class="number-unit" aria-hidden="true">pcs</span><button class="quiet-action is-active" type="button" tabindex="-1" aria-label="Increase quantity"><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg></button></div></div><span class="caption">Pressed Increase</span></div>
|
|
1581
|
+
<div class="state" inert><div class="field"><label class="field-label" for="nf-min">Quantity</label><div class="number-field"><button class="quiet-action" type="button" tabindex="-1" aria-label="Decrease quantity" disabled><svg class="icon" aria-hidden="true"><use href="#i-minus"/></svg></button><input id="nf-min" type="text" inputmode="numeric" role="spinbutton" aria-valuetext="0 pcs" aria-valuenow="0" aria-valuemin="0" aria-valuemax="9999" autocomplete="off" value="0"><span class="number-unit" aria-hidden="true">pcs</span><button class="quiet-action" type="button" tabindex="-1" aria-label="Increase quantity"><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg></button></div></div><span class="caption">At the minimum: Decrease is disabled</span></div>
|
|
1582
|
+
<div class="state" inert><div class="field"><label class="field-label" for="nf-disabled">Quantity</label><div class="number-field"><button class="quiet-action" type="button" tabindex="-1" aria-label="Decrease quantity" disabled><svg class="icon" aria-hidden="true"><use href="#i-minus"/></svg></button><input id="nf-disabled" type="text" inputmode="numeric" role="spinbutton" aria-valuetext="1,200 pcs" aria-valuenow="1200" aria-valuemin="0" aria-valuemax="9999" autocomplete="off" value="1,200" disabled><span class="number-unit" aria-hidden="true">pcs</span><button class="quiet-action" type="button" tabindex="-1" aria-label="Increase quantity" disabled><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg></button></div></div><span class="caption">Disabled</span></div>
|
|
1583
|
+
<div class="state" inert><div class="field"><label class="field-label" for="nf-invalid">Quantity</label><div class="number-field"><button class="quiet-action" type="button" tabindex="-1" aria-label="Decrease quantity"><svg class="icon" aria-hidden="true"><use href="#i-minus"/></svg></button><input id="nf-invalid" type="text" inputmode="numeric" role="spinbutton" aria-valuemin="0" aria-valuemax="9999" autocomplete="off" value="" aria-invalid="true" aria-errormessage="nf-invalid-error"><span class="number-unit" aria-hidden="true">pcs</span><button class="quiet-action" type="button" tabindex="-1" aria-label="Increase quantity"><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg></button></div><p class="field-error" id="nf-invalid-error">Enter a quantity.</p></div><span class="caption">Invalid</span></div>
|
|
1584
|
+
<div class="state" inert><div class="field"><label class="field-label" for="nf-invalid-focus">Quantity</label><div class="number-field is-focus"><button class="quiet-action" type="button" tabindex="-1" aria-label="Decrease quantity"><svg class="icon" aria-hidden="true"><use href="#i-minus"/></svg></button><input id="nf-invalid-focus" type="text" inputmode="numeric" role="spinbutton" aria-valuemin="0" aria-valuemax="9999" autocomplete="off" value="" aria-invalid="true" aria-errormessage="nf-invalid-focus-error"><span class="number-unit" aria-hidden="true">pcs</span><button class="quiet-action" type="button" tabindex="-1" aria-label="Increase quantity"><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg></button></div><p class="field-error" id="nf-invalid-focus-error">Enter a quantity.</p></div><span class="caption">Invalid, focus visible</span></div>
|
|
1585
|
+
</div></div>
|
|
1586
|
+
<div class="row"><h4>Sizes</h4><div class="states">
|
|
1587
|
+
<div class="state" inert data-specimen="size"><div class="number-field" data-size="sm"><button class="quiet-action" type="button" tabindex="-1" aria-label="Decrease quantity"><svg class="icon" aria-hidden="true"><use href="#i-minus"/></svg></button><input id="nf-sm" type="text" inputmode="numeric" role="spinbutton" aria-valuetext="24 pcs" aria-valuenow="24" aria-valuemin="0" aria-valuemax="9999" autocomplete="off" value="24" aria-label="Small quantity"><span class="number-unit" aria-hidden="true">pcs</span><button class="quiet-action" type="button" tabindex="-1" aria-label="Increase quantity"><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg></button></div><span class="caption">sm</span></div>
|
|
1588
|
+
<div class="state" inert data-specimen="size"><div class="number-field" data-size="md"><button class="quiet-action" type="button" tabindex="-1" aria-label="Decrease quantity"><svg class="icon" aria-hidden="true"><use href="#i-minus"/></svg></button><input id="nf-md" type="text" inputmode="numeric" role="spinbutton" aria-valuetext="24 pcs" aria-valuenow="24" aria-valuemin="0" aria-valuemax="9999" autocomplete="off" value="24" aria-label="Medium quantity"><span class="number-unit" aria-hidden="true">pcs</span><button class="quiet-action" type="button" tabindex="-1" aria-label="Increase quantity"><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg></button></div><span class="caption">md</span></div>
|
|
1589
|
+
<div class="state" inert data-specimen="size"><div class="number-field" data-size="lg"><button class="quiet-action" type="button" tabindex="-1" aria-label="Decrease quantity"><svg class="icon" aria-hidden="true"><use href="#i-minus"/></svg></button><input id="nf-lg" type="text" inputmode="numeric" role="spinbutton" aria-valuetext="24 pcs" aria-valuenow="24" aria-valuemin="0" aria-valuemax="9999" autocomplete="off" value="24" aria-label="Large quantity"><span class="number-unit" aria-hidden="true">pcs</span><button class="quiet-action" type="button" tabindex="-1" aria-label="Increase quantity"><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg></button></div><span class="caption">lg</span></div>
|
|
1590
|
+
</div></div>
|
|
1591
|
+
</section>
|
|
1592
|
+
|
|
1461
1593
|
<section class="component" id="field-wrapper" data-layer="Core" data-states="invalid" aria-labelledby="fieldw-title">
|
|
1462
1594
|
<header><h3 id="fieldw-title">Field wrapper</h3><span class="badge">Core</span><a href="components.md#field-wrapper">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="field-wrapper" aria-label="Copy link to Field wrapper" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1463
1595
|
<p class="purpose">Label, description, and error text around a field.</p>
|
|
@@ -1597,6 +1729,32 @@
|
|
|
1597
1729
|
</div></div>
|
|
1598
1730
|
</section>
|
|
1599
1731
|
|
|
1732
|
+
<section class="layer-head" id="group-data-display" aria-labelledby="group-data-display-title">
|
|
1733
|
+
<h2 id="group-data-display-title">Data display</h2>
|
|
1734
|
+
<p>Show the details and headline counts of records.</p>
|
|
1735
|
+
</section>
|
|
1736
|
+
|
|
1737
|
+
<section class="component" id="description-list" data-layer="Core" aria-labelledby="description-list-title">
|
|
1738
|
+
<header><h3 id="description-list-title">Description list</h3><span class="badge">Core</span><a href="components.md#description-list">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="description-list" aria-label="Copy link to Description list" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1739
|
+
<p class="purpose">The details of one record as term and value pairs.</p>
|
|
1740
|
+
<dl class="guidance"><dt>Do</dt><dd>Use a description list for the details of one record, such as a product’s location, supplier, and reorder point. Order the terms the way the reader checks them, most used first.</dd><dt>Don’t</dt><dd>A description list to compare several records, which is a table, or a border or fill on each pair. Leave a pair out only when it never applies to the record; when it applies and is empty, write “None”.</dd></dl>
|
|
1741
|
+
<div class="row"><h4>Layouts</h4><div class="states">
|
|
1742
|
+
<div class="state wide"><dl class="description-list"><div><dt>Location</dt><dd><span id="dl-wide-location">Aisle 4, bay 2</span><button class="quiet-action" type="button" data-copy="dl-wide-location" aria-label="Copy location"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></dd></div><div><dt>Supplier</dt><dd><a href="#description-list">Example supplier</a></dd></div><div><dt>In stock</dt><dd>1,284 pcs</dd></div><div><dt>Reorder point</dt><dd>200 pcs</dd></div><div><dt>Status</dt><dd><span class="badge success">In stock</span></dd></div><div><dt>Last counted</dt><dd data-empty>None</dd></div></dl><span class="caption">Wide container, live: the terms share one column; Copy, the link, and the badge sit in values, and Last counted is not set</span></div>
|
|
1743
|
+
<div class="state narrow" inert><dl class="description-list"><div><dt>Location</dt><dd><span id="dl-narrow-location">Aisle 4, bay 2</span><button class="quiet-action" type="button" data-copy="dl-narrow-location" aria-label="Copy location"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></dd></div><div><dt>Supplier</dt><dd><a href="#description-list">Example supplier</a></dd></div><div><dt>In stock</dt><dd>1,284 pcs</dd></div><div><dt>Reorder point</dt><dd>200 pcs</dd></div><div><dt>Status</dt><dd><span class="badge success">In stock</span></dd></div><div><dt>Last counted</dt><dd data-empty>None</dd></div></dl><span class="caption">Container under 30rem: each term sits above its value</span></div>
|
|
1744
|
+
</div></div>
|
|
1745
|
+
</section>
|
|
1746
|
+
|
|
1747
|
+
<section class="component" id="stat-tile" data-layer="Core" data-states="hover focus" aria-labelledby="stat-tile-title">
|
|
1748
|
+
<header><h3 id="stat-tile-title">Stat tile</h3><span class="badge">Core</span><a href="components.md#stat-tile">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="stat-tile" aria-label="Copy link to Stat tile" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1749
|
+
<p class="purpose">A headline count with its label and context.</p>
|
|
1750
|
+
<dl class="guidance"><dt>Do</dt><dd>Use stat tiles for a few headline counts at the top of an overview, such as items in stock and items below their reorder point, each with a context line that says what the number means. Link a tile to the list of records it counts.</dd><dt>Don’t</dt><dd>A border on each tile or a tile inside a card. Don’t colour the value to show good or bad: a badge or the context line says it in words. Don’t add a trend arrow or a sparkline without the period it compares.</dd></dl>
|
|
1751
|
+
<div class="row"><h4>Tiles</h4><div class="states">
|
|
1752
|
+
<div class="state wide"><div class="stat-tiles"><div class="stat"><dl><dt class="stat-label">In stock</dt><dd class="stat-value">1,284 <span class="stat-unit">items</span></dd><dd class="stat-context">Across 3 locations</dd></dl></div><a class="stat" href="#stat-tile"><span class="stat-label">Below reorder point</span><span class="sr-only">, </span><span class="stat-value">8 <span class="stat-unit">items</span></span><span class="sr-only">, </span><span class="stat-context">3 have no open order</span></a><div class="stat"><dl><dt class="stat-label">Open orders</dt><dd class="stat-value">5</dd><dd class="stat-context"><span class="badge warning">2 late</span>3 arrive this week</dd></dl></div></div><span class="caption">Rest, live: Below reorder point is a link; Open orders says it in a badge</span></div>
|
|
1753
|
+
<div class="state" inert><a class="stat is-hover" href="#stat-tile"><span class="stat-label">Below reorder point</span><span class="sr-only">, </span><span class="stat-value">8 <span class="stat-unit">items</span></span><span class="sr-only">, </span><span class="stat-context">3 have no open order</span></a><span class="caption">Linked tile, hover</span></div>
|
|
1754
|
+
<div class="state" inert><a class="stat is-focus" href="#stat-tile"><span class="stat-label">Below reorder point</span><span class="sr-only">, </span><span class="stat-value">8 <span class="stat-unit">items</span></span><span class="sr-only">, </span><span class="stat-context">3 have no open order</span></a><span class="caption">Linked tile, focus visible</span></div>
|
|
1755
|
+
</div></div>
|
|
1756
|
+
</section>
|
|
1757
|
+
|
|
1600
1758
|
<section class="layer-head" id="group-navigation" aria-labelledby="group-navigation-title">
|
|
1601
1759
|
<h2 id="group-navigation-title">Navigation</h2>
|
|
1602
1760
|
<p>Move between pages and sections, and find things.</p>
|
|
@@ -1925,8 +2083,11 @@ I’ll open a ticket for it.</textarea><button class="btn" type="button" data-si
|
|
|
1925
2083
|
<tr data-for="segmented-control"><th scope="row"><a href="#segmented-control">Segmented control</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1926
2084
|
<tr data-for="text-input-and-textarea"><th scope="row"><a href="#text-input-and-textarea">Text input and textarea</a></th><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td></tr>
|
|
1927
2085
|
<tr data-for="select"><th scope="row"><a href="#select">Select</a></th><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td></tr>
|
|
2086
|
+
<tr data-for="combobox"><th scope="row"><a href="#combobox">Combobox</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td></tr>
|
|
2087
|
+
<tr data-for="number-field"><th scope="row"><a href="#number-field">Number field</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td></tr>
|
|
1928
2088
|
<tr data-for="field-wrapper"><th scope="row"><a href="#field-wrapper">Field wrapper</a></th><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td></tr>
|
|
1929
2089
|
<tr data-for="slider"><th scope="row"><a href="#slider">Slider</a></th><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
2090
|
+
<tr data-for="stat-tile"><th scope="row"><a href="#stat-tile">Stat tile</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1930
2091
|
<tr data-for="navigation-list"><th scope="row"><a href="#navigation-list">Navigation list</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1931
2092
|
<tr data-for="tabs"><th scope="row"><a href="#tabs">Tabs</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1932
2093
|
<tr data-for="message-row"><th scope="row"><a href="#message-row">Message row</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
@@ -2035,6 +2196,174 @@ I’ll open a ticket for it.</textarea><button class="btn" type="button" data-si
|
|
|
2035
2196
|
if (value) value.value = `${r.value}%`;
|
|
2036
2197
|
}));
|
|
2037
2198
|
|
|
2199
|
+
// Combobox: typing opens the list and filters it, keeping the options' order. Focus stays in the field, and
|
|
2200
|
+
// aria-activedescendant names the active option. Only Enter on the active option, or a click, chooses: leaving
|
|
2201
|
+
// the field keeps the choice and puts its label back, even when the text names another option. The first Escape
|
|
2202
|
+
// closes the list and puts the label back; the second clears the text and the choice. The match count is
|
|
2203
|
+
// announced after a 500ms pause, as in Find.
|
|
2204
|
+
document.querySelectorAll('[data-live-combobox]').forEach((box) => {
|
|
2205
|
+
const input = box.querySelector('[role="combobox"]');
|
|
2206
|
+
const list = box.querySelector('[role="listbox"]');
|
|
2207
|
+
const toggle = box.querySelector('.combobox-toggle');
|
|
2208
|
+
const options = [...list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')];
|
|
2209
|
+
const none = list.querySelector('[role="option"][aria-disabled="true"]');
|
|
2210
|
+
const count = box.parentElement.querySelector('[role="status"]');
|
|
2211
|
+
let chosen = options.find((option) => option.getAttribute('aria-selected') === 'true') ?? null;
|
|
2212
|
+
let announce;
|
|
2213
|
+
const isOpen = () => !list.hidden;
|
|
2214
|
+
const active = () => options.find((option) => option.hasAttribute('data-active'));
|
|
2215
|
+
const setActive = (target) => {
|
|
2216
|
+
options.forEach((option) => option.toggleAttribute('data-active', option === target));
|
|
2217
|
+
if (!target) { input.removeAttribute('aria-activedescendant'); return; }
|
|
2218
|
+
input.setAttribute('aria-activedescendant', target.id);
|
|
2219
|
+
target.scrollIntoView({ block: 'nearest' });
|
|
2220
|
+
};
|
|
2221
|
+
// Shows the options that contain the query. Opening on the chosen label shows every option.
|
|
2222
|
+
const filter = (query) => {
|
|
2223
|
+
const words = query.trim().toLowerCase();
|
|
2224
|
+
options.forEach((option) => { option.hidden = !option.textContent.toLowerCase().includes(words); });
|
|
2225
|
+
const shown = options.filter((option) => !option.hidden).length;
|
|
2226
|
+
none.hidden = shown > 0;
|
|
2227
|
+
clearTimeout(announce);
|
|
2228
|
+
announce = setTimeout(() => { count.textContent = shown ? `${shown} ${shown === 1 ? 'match' : 'matches'}` : 'No matches'; }, 500);
|
|
2229
|
+
};
|
|
2230
|
+
const open = (query = input.value === chosen?.textContent ? '' : input.value) => {
|
|
2231
|
+
filter(query);
|
|
2232
|
+
list.hidden = false;
|
|
2233
|
+
input.setAttribute('aria-expanded', 'true');
|
|
2234
|
+
toggle.setAttribute('aria-label', 'Hide products');
|
|
2235
|
+
};
|
|
2236
|
+
const close = () => {
|
|
2237
|
+
setActive(null);
|
|
2238
|
+
list.hidden = true;
|
|
2239
|
+
input.setAttribute('aria-expanded', 'false');
|
|
2240
|
+
toggle.setAttribute('aria-label', 'Show products');
|
|
2241
|
+
clearTimeout(announce);
|
|
2242
|
+
count.textContent = '';
|
|
2243
|
+
};
|
|
2244
|
+
const choose = (option) => {
|
|
2245
|
+
chosen = option;
|
|
2246
|
+
options.forEach((each) => each.setAttribute('aria-selected', String(each === option)));
|
|
2247
|
+
input.value = option?.textContent ?? '';
|
|
2248
|
+
};
|
|
2249
|
+
// Moves the active option by one among the shown options, and stops at either end.
|
|
2250
|
+
const move = (by) => {
|
|
2251
|
+
const shown = options.filter((option) => !option.hidden);
|
|
2252
|
+
if (!shown.length) return;
|
|
2253
|
+
const at = shown.indexOf(active());
|
|
2254
|
+
setActive(shown[at < 0 ? (by > 0 ? 0 : shown.length - 1) : Math.min(Math.max(at + by, 0), shown.length - 1)]);
|
|
2255
|
+
};
|
|
2256
|
+
input.addEventListener('input', () => { setActive(null); open(input.value); });
|
|
2257
|
+
input.addEventListener('keydown', (e) => {
|
|
2258
|
+
if (e.key === 'ArrowDown') {
|
|
2259
|
+
e.preventDefault();
|
|
2260
|
+
if (isOpen()) move(1); else open();
|
|
2261
|
+
} else if (e.key === 'ArrowUp' && isOpen()) {
|
|
2262
|
+
e.preventDefault();
|
|
2263
|
+
move(-1);
|
|
2264
|
+
} else if (e.key === 'Enter' && isOpen() && active()) {
|
|
2265
|
+
e.preventDefault();
|
|
2266
|
+
choose(active());
|
|
2267
|
+
close();
|
|
2268
|
+
} else if (e.key === 'Escape') {
|
|
2269
|
+
// Typed text left by a list the chevron closed counts as a first press too.
|
|
2270
|
+
if (isOpen() || input.value !== (chosen?.textContent ?? '')) { close(); choose(chosen); } else choose(null);
|
|
2271
|
+
}
|
|
2272
|
+
});
|
|
2273
|
+
input.addEventListener('blur', () => {
|
|
2274
|
+
close();
|
|
2275
|
+
choose(chosen);
|
|
2276
|
+
});
|
|
2277
|
+
// A press on the list or the chevron keeps focus in the field.
|
|
2278
|
+
[list, toggle].forEach((part) => part.addEventListener('mousedown', (e) => e.preventDefault()));
|
|
2279
|
+
list.addEventListener('click', (e) => {
|
|
2280
|
+
const option = e.target.closest('[role="option"]:not([aria-disabled="true"])');
|
|
2281
|
+
if (!option) return;
|
|
2282
|
+
choose(option);
|
|
2283
|
+
close();
|
|
2284
|
+
});
|
|
2285
|
+
toggle.addEventListener('click', () => {
|
|
2286
|
+
input.focus();
|
|
2287
|
+
if (isOpen()) close(); else open();
|
|
2288
|
+
});
|
|
2289
|
+
});
|
|
2290
|
+
|
|
2291
|
+
// Number field: the arrow keys change the value by one step, Shift with an arrow by ten, and Home and End jump to
|
|
2292
|
+
// the limits. The value shows with the locale's digit grouping, written back when the field loses focus. A button
|
|
2293
|
+
// at a limit is disabled, and a held button repeats its step after a 400ms pause.
|
|
2294
|
+
// The format keeps every fraction digit the value holds, so the field, aria-valuenow, and aria-valuetext agree.
|
|
2295
|
+
const grouped = new Intl.NumberFormat(undefined, { maximumFractionDigits: 20 });
|
|
2296
|
+
const [groupMark, decimalMark] = ['group', 'decimal'].map((type) => grouped.formatToParts(1000.5).find((part) => part.type === type)?.value ?? '');
|
|
2297
|
+
const minusSign = (grouped.formatToParts(-1).find((part) => part.type === 'minusSign')?.value ?? '-').replace(/[\u061c\u200e\u200f]/g, '');
|
|
2298
|
+
const digits = new Map([...Array(10).keys()].map((digit) => [grouped.format(digit), String(digit)]));
|
|
2299
|
+
// Reads what the formatter writes: its group and decimal marks and its digits. Empty text is not a number.
|
|
2300
|
+
const readNumber = (text) => {
|
|
2301
|
+
// Direction marks around a sign (as in ar-EG) are not part of the number.
|
|
2302
|
+
const plain = [...text.trim().replace(/[\u061c\u200e\u200f]/g, '').replaceAll(groupMark, '').replace(decimalMark, '.').replace(minusSign, '-')].map((char) => digits.get(char) ?? char).join('');
|
|
2303
|
+
return plain ? Number(plain) : NaN;
|
|
2304
|
+
};
|
|
2305
|
+
document.querySelectorAll('[data-live-number]').forEach((field) => {
|
|
2306
|
+
const input = field.querySelector('[role="spinbutton"]');
|
|
2307
|
+
const [down, up] = field.querySelectorAll('button');
|
|
2308
|
+
const min = Number(input.getAttribute('aria-valuemin'));
|
|
2309
|
+
const max = Number(input.getAttribute('aria-valuemax'));
|
|
2310
|
+
const step = Number(input.dataset.step ?? 1);
|
|
2311
|
+
// The unit is aria-hidden, so the value text carries it.
|
|
2312
|
+
const unit = field.querySelector('.number-unit')?.textContent;
|
|
2313
|
+
// The last number in range the field showed: the ARIA value, its text, the buttons, and the base of the next step.
|
|
2314
|
+
let shown;
|
|
2315
|
+
const reflect = (number) => {
|
|
2316
|
+
shown = number;
|
|
2317
|
+
input.setAttribute('aria-valuenow', String(number));
|
|
2318
|
+
if (unit) input.setAttribute('aria-valuetext', `${grouped.format(number)} ${unit}`);
|
|
2319
|
+
down.disabled = number <= min;
|
|
2320
|
+
up.disabled = number >= max;
|
|
2321
|
+
};
|
|
2322
|
+
const set = (next) => {
|
|
2323
|
+
// The value is what the field can show, so the text, aria-valuenow, and aria-valuetext always agree.
|
|
2324
|
+
const value = readNumber(grouped.format(Math.min(max, Math.max(min, next))));
|
|
2325
|
+
input.value = grouped.format(value);
|
|
2326
|
+
reflect(value);
|
|
2327
|
+
};
|
|
2328
|
+
// Typed text counts once it reads as a number; anything else keeps the last number shown.
|
|
2329
|
+
const typed = () => {
|
|
2330
|
+
const number = readNumber(input.value);
|
|
2331
|
+
return Number.isFinite(number) ? number : shown;
|
|
2332
|
+
};
|
|
2333
|
+
// Rounding a step to six places drops the binary error that a fractional step adds; a typed value keeps its digits.
|
|
2334
|
+
const stepFrom = (by) => Math.round((typed() + by) * 1e6) / 1e6;
|
|
2335
|
+
// The markup's number, not its text: the text is in English, and the page may format in another locale.
|
|
2336
|
+
set(Number(input.getAttribute('aria-valuenow')));
|
|
2337
|
+
input.addEventListener('keydown', (e) => {
|
|
2338
|
+
const by = { ArrowUp: step, ArrowDown: -step }[e.key];
|
|
2339
|
+
const to = by ? stepFrom(e.shiftKey ? by * 10 : by) : { Home: min, End: max }[e.key];
|
|
2340
|
+
if (to === undefined) return;
|
|
2341
|
+
e.preventDefault();
|
|
2342
|
+
set(to);
|
|
2343
|
+
});
|
|
2344
|
+
// A typed number in range shows at once; other text changes nothing until the change event clamps it.
|
|
2345
|
+
input.addEventListener('input', () => {
|
|
2346
|
+
const number = readNumber(input.value);
|
|
2347
|
+
if (number >= min && number <= max) reflect(number);
|
|
2348
|
+
});
|
|
2349
|
+
input.addEventListener('change', () => set(typed()));
|
|
2350
|
+
[[down, -step], [up, step]].forEach(([button, by]) => {
|
|
2351
|
+
let timer;
|
|
2352
|
+
const stop = () => clearTimeout(timer);
|
|
2353
|
+
const repeat = (delay) => { timer = setTimeout(() => { if (button.disabled) return; set(stepFrom(by)); repeat(100); }, delay); };
|
|
2354
|
+
// A press keeps focus where it is, steps once, and repeats while held.
|
|
2355
|
+
button.addEventListener('mousedown', (e) => e.preventDefault());
|
|
2356
|
+
button.addEventListener('pointerdown', (e) => {
|
|
2357
|
+
if (e.button !== 0) return;
|
|
2358
|
+
set(stepFrom(by));
|
|
2359
|
+
repeat(400);
|
|
2360
|
+
});
|
|
2361
|
+
['pointerup', 'pointerleave', 'pointercancel'].forEach((type) => button.addEventListener(type, stop));
|
|
2362
|
+
// A screen reader activates the button with a click that has no press before it.
|
|
2363
|
+
button.addEventListener('click', (e) => { if (e.detail === 0) set(stepFrom(by)); });
|
|
2364
|
+
});
|
|
2365
|
+
});
|
|
2366
|
+
|
|
2038
2367
|
// A list that scrolls sideways names its clipped ends in data-clip, so CSS fades only those edges. An
|
|
2039
2368
|
// edge with 12px or less hidden is not faded, because the fade would cover more than it hides. A focused
|
|
2040
2369
|
// item scrolls clear of the fades, which the list's scroll-padding reserves.
|
package/language/components.md
CHANGED
|
@@ -21,9 +21,10 @@ The sections follow the catalogue's purpose groups, in this order. Each componen
|
|
|
21
21
|
| --- | --- |
|
|
22
22
|
| Actions | Button, quiet action, overflow menu, chip |
|
|
23
23
|
| Selection | Checkbox and radio, radio card group, switch, toggle button, segmented control |
|
|
24
|
-
| Inputs | Text input and textarea, select, field wrapper, slider |
|
|
24
|
+
| Inputs | Text input and textarea, select, combobox, number field, field wrapper, slider |
|
|
25
25
|
| Feedback and status | Progress, score, badge, alert |
|
|
26
26
|
| Containers and overlays | Surface and card, figure, dialog, drawer, slideout |
|
|
27
|
+
| Data display | Description list, stat tile |
|
|
27
28
|
| Navigation | Navigation list, section rail, find field, breadcrumbs, pager, tabs, skip link, keyboard key |
|
|
28
29
|
| Conversation | Message row, message group, hover toolbar, thread panel, composer, tool-call disclosure, mention |
|
|
29
30
|
| Code and examples | Code block |
|
|
@@ -198,6 +199,32 @@ Layer: Core.
|
|
|
198
199
|
- **Motion.** None: as for the input, and the picker opens at once.
|
|
199
200
|
- **Forced colors.** The closed field as for the input, including the `Highlight` focus outline. The picker is native.
|
|
200
201
|
|
|
202
|
+
## Combobox
|
|
203
|
+
|
|
204
|
+
Layer: Core.
|
|
205
|
+
|
|
206
|
+
- **Anatomy.** An editable `<input role="combobox">` in the [field](#text-input-and-textarea) recipe, with the [select](#select)'s chevron at the end, and a listbox in the select's picker recipe below it. Typing filters the options; the list keeps their order. When nothing matches, the list holds one row, "No matches", in `--text-sm` `--color-muted`, which cannot be chosen.
|
|
207
|
+
- **States.** Rest, focus-visible (field focus), open, disabled, invalid, and invalid while focused. In the open list, pointer hover fills `--color-row-hover`; the active option, the one the arrow keys reach, takes the same fill and the inset focus ring, because DOM focus stays in the field. An `--color-accent` check marks the chosen option, as in the select.
|
|
208
|
+
- **Do.** Use a combobox to choose one value from a long or growing list that the reader can name, such as a product, a location, or a supplier.
|
|
209
|
+
- **Don't.** A combobox for about 15 options or fewer, which is a select, or a free-text field that only suggests values. Typed text never chooses by itself: on leaving the field, it goes back to the chosen option's label, even when it names another option.
|
|
210
|
+
- **Keyboard and screen reader.** `aria-expanded`, `aria-controls` naming the listbox, `aria-autocomplete="list"`, and `aria-activedescendant` naming the active option. Typing opens the list and filters it. ArrowDown opens the list or moves down, and ArrowUp moves up. Only Enter on the active option, or a click on an option, chooses it and closes the list. Typed text never chooses by itself: Tab, or leaving the field another way, keeps the choice and puts its label back, even when the text matches another option exactly. The first Escape closes the list and puts the chosen label back; a second Escape clears the text and the choice. The chosen option's check is decorative and stays out of its name (empty alternative text, `content: "✓" / ""`); `aria-selected` carries the state. The chevron is a button out of the Tab order (`tabindex="-1"`) that opens and closes the list. A visually hidden `role="status"` element announces the match count after a 500ms pause, as in the [find field](#find-field). A visible `<label>`.
|
|
211
|
+
- **Motion.** None: the list opens, closes, and filters at once, as the select's picker does.
|
|
212
|
+
- **Forced colors.** The field as for the input. The active option draws a `Highlight` outline inside its edge, and the chosen option's check draws in `CanvasText`.
|
|
213
|
+
- **Touch.** At tablet width (`max-width: 800px`) the field and each option grow to `--control-touch`, and the chevron becomes a `--control-touch` square, with the field's end padding to match.
|
|
214
|
+
|
|
215
|
+
## Number field
|
|
216
|
+
|
|
217
|
+
Layer: Core.
|
|
218
|
+
|
|
219
|
+
- **Anatomy.** A wrapper in the field recipe, which carries the fill, edge, shadow, and focus as the [search](#text-input-and-textarea) wrapper does. Inside it, left to right: a decrease button, the input, an optional unit, and an increase button. The input is `type="text"` with `inputmode="numeric"`, or `inputmode="decimal"` for a fraction, in tabular numbers and aligned to the end. The unit, such as "pcs" or "kg", is `--text-sm` `--color-muted` with `--space-1` before it. Each button is a square [quiet action](#quiet-action) the height of the control, which spans the wrapper's 1px edges (a -1px margin on its outer sides), with a 16px minus or plus in `--color-muted`, and `--radius-field` corners, so its tint meets the field's own corners on its outer side. The wrapper does not clip its contents, because a clip would also cut the buttons' tap area along the edge they span. The value shows with the locale's digit grouping, such as "1,200", and is written back in that form when the field loses focus.
|
|
220
|
+
- **States.** Rest, focus-visible (field focus on the wrapper, through `:has(input:focus-visible)`), disabled, invalid, and invalid while focused. A button at its limit (`min` or `max`) is disabled. A button tints on hover and press as a quiet action does.
|
|
221
|
+
- **Do.** Use a number field for an exact amount that the reader may change by a few steps, such as a quantity or a reorder point. Show the unit in the field, and set `min` and `max` when the amount has limits.
|
|
222
|
+
- **Don't.** A number field for a code made of digits, such as a part number, an order number, or a postcode. Use a text input, because steps and digit grouping would change it. Don't use the native `type="number"`, which changes the value on a scroll and shows its own spinner.
|
|
223
|
+
- **Keyboard and screen reader.** The input takes `role="spinbutton"` with `aria-valuenow`, and `aria-valuemin` and `aria-valuemax` when they are set, and a visible `<label>`. ArrowUp and ArrowDown change the value by one step, Shift with an arrow by ten steps, and Home and End jump to `min` and `max`. With a unit, `aria-valuetext` reads the value with it, such as "1,200 pcs", and the visible unit is `aria-hidden`. The buttons are out of the Tab order (`tabindex="-1"`), because the arrow keys do the same, and are named for their action with the label, such as "Increase quantity". A held button repeats its step after a 400ms pause.
|
|
224
|
+
- **Motion.** None: the value changes at once.
|
|
225
|
+
- **Forced colors.** The wrapper as for the input. The minus and plus draw in `ButtonText`, and a disabled button's sign draws in `GrayText`.
|
|
226
|
+
- **Touch.** At tablet width (`max-width: 800px`) the field grows to `--control-touch`, and the decrease and increase buttons are `--control-touch` squares, because they span the wrapper's edges.
|
|
227
|
+
|
|
201
228
|
## Field wrapper
|
|
202
229
|
|
|
203
230
|
Layer: Core.
|
|
@@ -355,19 +382,44 @@ Layer: Core.
|
|
|
355
382
|
- **Motion.** As for the drawer, from its own edge: it slides in over `--duration` and out over `--duration-fast`, with `--ease-out`, while the overlay fades. Reduced motion shows and hides it at once.
|
|
356
383
|
- **Forced colors.** As for the dialog: the shadow drops and the edge draws in the system colour.
|
|
357
384
|
|
|
385
|
+
## Description list
|
|
386
|
+
|
|
387
|
+
Layer: Core.
|
|
388
|
+
|
|
389
|
+
- **Anatomy.** A `<dl>` of term and value pairs, each pair in a `<div>`. On a wide screen it is a two-column grid: the term column is as wide as its longest term, up to 12rem, and the value column takes the rest. Terms wrap anywhere (`overflow-wrap: anywhere`), so an unbroken term keeps the column at its 12rem cap. The grid has an `--space-4` column gap and an `--space-2` row gap. A term is `--text-sm` `--color-muted`; a value is `--text-md` `--color-text`, in tabular numbers, and may hold a link, a [badge](#badge), or a quiet copy action. Both align to the first line's baseline. A value that is not set reads "None" in `--color-muted`. In a narrow container (`max-width: 30rem` on the list's container), each term sits above its value with an `--space-1` gap, and the pairs keep the `--space-2` gap.
|
|
390
|
+
- **States.** None: the list is static text. A link or an action inside a value keeps its own states.
|
|
391
|
+
- **Do.** Use a description list for the details of one record, such as a product's location, supplier, and reorder point. Order the terms the way the reader checks them, most used first.
|
|
392
|
+
- **Don't.** A description list to compare several records, which is a table, or a border or fill on each pair. Leave a pair out only when it never applies to the record; when it applies and is empty, write "None".
|
|
393
|
+
- **Keyboard and screen reader.** Native `<dl>`, `<dt>`, and `<dd>`, so a screen reader reads each term with its value. A copy action is named for its value, such as "Copy location".
|
|
394
|
+
- **Motion.** None: the list is static.
|
|
395
|
+
- **Forced colors.** Terms and values take the system text colour. The list has no fill or edge to lose.
|
|
396
|
+
|
|
397
|
+
## Stat tile
|
|
398
|
+
|
|
399
|
+
Layer: Core.
|
|
400
|
+
|
|
401
|
+
- **Anatomy.** A tile with `--color-surface` fill, a transparent 1px border, `--radius-panel`, and `--space-4` padding, holding, top to bottom: a label in `--text-sm` `--color-muted`; the value in `--text-2xl` semibold `--color-text`, tabular numbers, with an optional unit in `--text-sm` `--color-muted`; and an optional context line in `--text-sm` `--color-muted`, such as "8 below reorder point", or a [badge](#badge). Tiles sit in a grid with `repeat(auto-fit, minmax(12rem, 1fr))` and an `--space-4` gap, outside a card.
|
|
402
|
+
- **States.** Rest. A tile that opens the records behind its number is a link: hover fills `--color-row-hover`, and focus-visible shows the focus ring.
|
|
403
|
+
- **Do.** Use stat tiles for a few headline counts at the top of an overview, such as items in stock and items below their reorder point, each with a context line that says what the number means. Link a tile to the list of records it counts.
|
|
404
|
+
- **Don't.** A border on each tile or a tile inside a card. Don't colour the value to show good or bad: a badge or the context line says it in words. Don't add a trend arrow or a sparkline without the period it compares.
|
|
405
|
+
- **Keyboard and screen reader.** The label comes before the value in the DOM, so it is read first. A tile without a link is a `<div>` holding a `<dl>` with one `<dt>` and its `<dd>`s. A linked tile is one `<a>` whose name reads the label, the value, and the context line, such as "Below reorder point, 8 items".
|
|
406
|
+
- **Motion.** A linked tile's fill changes over `--duration-fast` with `--ease-out`.
|
|
407
|
+
- **Forced colors.** The fill drops, and the transparent border draws as the system edge, so each tile keeps its outline.
|
|
408
|
+
|
|
358
409
|
## Navigation list
|
|
359
410
|
|
|
360
411
|
Layer: Core. The mono font on rail rows is identity.
|
|
361
412
|
|
|
362
413
|
- **Anatomy.** A `<nav>` with a name, holding links in rows: at least `--row` tall (`--control-touch` at tablet width), `0 --space-3` padding, `--radius-inline` corners (`calc(var(--radius-panel) - var(--space-1))`, the same 8px, inside a floating menu such as the project menu, so they are concentric with it), `--text-sm`, and `--color-muted`. A row may hold a leading 16px icon and a trailing muted count. A text-only row centres its label on the cap height: where `text-box` is supported, it is a block with `align-content: center`, `--space-2` block padding, and `text-box: trim-both cap alphabetic`, and the location pip centres itself. The padding keeps a wrapped label's first and last lines clear of the fill's edges and the focus ring. Rows with an icon or a count, and browsers without `text-box`, centre the line box, which leaves a label without descenders about 1px above centre. Groups have a `--text-xs` semibold muted label and 2px gaps between rows.
|
|
363
414
|
- **Groups.** Name groups by purpose, with 2 to 8 rows each. Collapse groups only in a list of more than about 40 rows. A collapsible group's label is a `<button aria-expanded>` in the label type, with `--radius-inline` corners and a chevron that turns −90° when the group is closed. Never collapse the group that holds the current row.
|
|
364
|
-
- **States.** Hover: `--color-row-hover` fill and `--color-text`. Current page (`aria-current="page"`): `--color-nav-current` fill, `--shadow-nav-current`, `--color-nav-current-text`, and medium weight; hover keeps that fill. `--color-nav-current` is an accent tint: `--color-accent` at 14% over `--color-surface-raised` in light, and `--color-accent` at 20% over transparent in dark. `--color-nav-current-text` is the first of `--color-accent`, `--color-text`, black, and white that reaches 4.5:1 over the tinted fill, both on the page and on a surface (composite a translucent fill over each first). Selected tabs and selected list rows use the same fill and rule. Current location in the page (`aria-current="location"`): `--color-text` in medium weight, with a 3×14 `--color-accent` pip at the leading edge, inset 4px, and no fill, in strips and contents lists. In a [section rail](#section-rail) the current section takes the current-page look instead and keeps `aria-current="location"`. A link carries one marker, and page outranks location; the [`aria-current` rules](DESIGN.md#navigation) say which applies, and the [tracking rule](DESIGN.md#navigation) says which section is current. Focus-visible: the focus ring, inset because the rail
|
|
415
|
+
- **States.** Hover: `--color-row-hover` fill and `--color-text`. Current page (`aria-current="page"`): `--color-nav-current` fill, `--shadow-nav-current`, `--color-nav-current-text`, and medium weight; hover keeps that fill. `--color-nav-current` is an accent tint: `--color-accent` at 14% over `--color-surface-raised` in light, and `--color-accent` at 20% over transparent in dark. `--color-nav-current-text` is the first of `--color-accent`, `--color-text`, black, and white that reaches 4.5:1 over the tinted fill, both on the page and on a surface (composite a translucent fill over each first). Selected tabs and selected list rows use the same fill and rule. Current location in the page (`aria-current="location"`): `--color-text` in medium weight, with a 3×14 `--color-accent` pip at the leading edge, inset 4px, and no fill, in strips and contents lists. In a [section rail](#section-rail) the current section takes the current-page look instead and keeps `aria-current="location"`. A link carries one marker, and page outranks location; the [`aria-current` rules](DESIGN.md#navigation) say which applies, and the [tracking rule](DESIGN.md#navigation) says which section is current. Focus-visible: the focus ring, inset because the rail, the drawer, and a contents list beside a column scroll.
|
|
365
416
|
- **Do.** Label a page link with the destination page's title, and an in-page link with its destination section's heading.
|
|
366
417
|
- **Don't.** Actions such as Delete or Sign out in a navigation list. Every row is a link to a place; an action is a button.
|
|
418
|
+
- **Beside a column.** A contents list ("On this page") that sits beside the reading column stays in view while the column scrolls. It takes `position: sticky`, a `top` equal to the page's one [scroll offset](DESIGN.md#navigation) (the `html { scroll-padding-top }` length: any sticky bar plus `--space-4`, or `--space-4` alone), and `align-self: start` in its grid or flex row, so the row does not stretch it to the column's height. Its `max-height` is the window height (`100dvh`, as the rail uses) less its `top` and `--space-4`, and it is a column flex layout: its heading stays put, and its list scrolls on its own (`overflow-y: auto`, `overscroll-behavior: contain`) when it does not fit. It keeps the current row in view as the [section rail](#section-rail) does: when the location changes, it scrolls only its own list, never the page, to centre the current row if it is out of view. It leaves the list alone while the pointer is over it or focus is inside it, and centres the current row again when they leave. Its rows, pip, and states do not change. At `max-width: 800px`, where the layout becomes one column, the phone trigger takes its place, as the next part says.
|
|
367
419
|
- **Phone triggers.** One labelled trigger opens a navigation drawer: a secondary button at least `--control-touch` tall, with `--space-2` block padding so a label that wraps grows it, and a three-line menu glyph (14×10, 1.5px lines) `--space-3` before the label. The label names the list and its current row, such as "Components: By purpose" for a [section rail](#section-rail) or "On this page: Install" for a docs page's contents, and follows the current section as the page scrolls. The trigger sits at the start, below the site header, and its drawer opens from the left. It shows the page's contents and does not act, so it takes the 8px field corner (`--radius-field`), at rest and pressed. A page has one trigger: no icon-only Find or Menu button beside it. Without JavaScript the list opens in place, so the trigger is a `<details>` summary with the secondary button classes and a chevron after the label. It takes the same 8px field corner. Only the chevron is local.
|
|
368
420
|
- **Horizontal strip.** A row of 6 links or fewer; beyond that, use a drawer. It uses these rows and states unchanged: the current page takes the lifted fill, and a location keeps its pip. It scrolls sideways with 2px padding, so the current row's shadow stays whole, and a clipped edge fades over 24px, as [tabs](#tabs) do. An edge with 12px or less hidden does not fade. A focused row scrolls into view clear of the fades (`scroll-padding-inline: 24px`), and the strip shows no scrollbar (`scrollbar-width: none`), because the fade shows the overflow. Becoming current changes no row's width: each link carries its label in `data-label`, and a hidden copy of it at the current row's medium weight (`::after`, with empty alternative text and `margin-top: -1lh`, so it shares the label's line) sets the row's width. A strip in a drawer, where labels wrap, drops the copy, and so does a browser without the `lh` unit.
|
|
369
421
|
- **Keyboard and screen reader.** Plain links in Tab order.
|
|
370
|
-
- **Motion.** Fill, colour, and shadow change over `--duration-fast` with `--ease-out`.
|
|
422
|
+
- **Motion.** Fill, colour, and shadow change over `--duration-fast` with `--ease-out`. A contents list beside a column scrolls its list at once, as the rail does.
|
|
371
423
|
- **Forced colors.** Fills and shadows drop. The current page (`aria-current="page"`), and a rail's current section, take a 2px `Highlight` border on the leading edge, and their leading padding gives up 2px for it, so the row keeps its width. The location pip keeps its shape with `forced-color-adjust: none` and a `Highlight` fill, so page and location still differ.
|
|
372
424
|
- **List selection.** A selected row in a list or table (`aria-selected="true"`) takes the current-page recipe: `--color-nav-current` fill, `--shadow-nav-current`, medium weight, and its primary text in `--color-nav-current-text`, with no accent bar. Hover keeps that fill. Rows keep their own radius. Dividers between rows are straight 1px `--color-border-subtle` lines inset by the row's inline padding, drawn on the row, not as a shadow, and hidden next to a filled (hovered or selected) row. Forced colors: the fill and shadow drop, and the selected row takes a 2px `Highlight` border on its leading edge, as the current page does.
|
|
373
425
|
|
package/language/decisions.md
CHANGED
|
@@ -54,7 +54,7 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
54
54
|
| Phone header | Core | The family shell, option A, which the owner chose on 2026-11-11: the site's header matches the other family sites. At tablet width the static header has two rows, the project switcher and the appearance control, then the Pages strip. Where both do not fit, as at 320px, the appearance control wraps to its own row at the start, as UiSiteHeader does on PluginBench and Filip Stack, and the project name never truncates. The rule below the header is the family's solid `--color-text` line. Just below it, at the start, the labelled trigger ("Components: By purpose") opens the drawer from the left, the side it sits on. The drawer is titled with the rail's name and holds Find and the rail's groups. `/` opens it with Find focused. Without JavaScript nothing moves. | The Gate M single sticky row with the site name, then icon-only Find and Menu buttons, with the pages and appearance in the Menu drawer: the site had no way to the other family sites, and the Menu button sat at the right while the drawer slid in from the left. Option B, keeping that row and sliding the drawer in from the right: it kept the site apart from the other seven family sites. Truncating the project name at 320px so both controls shared row 1: the family wraps the picker instead, and the name should never truncate. | `tests/site/site.spec.ts` "the switcher and appearance share the first row, then the pages, then the trigger", "the switcher and appearance take a row each, then the pages, then the trigger", "every clipped strip link shows at least 16px", "the trigger opens the drawer from the left edge, titled with the rail and holding Find and the rail only", "the trigger label follows the current section as the page scrolls"; `tests/catalogue/catalogue.spec.ts` "the trigger opens the drawer on the current row, and a link closes it and focuses the target" |
|
|
55
55
|
| Drawer instead of a long strip | Core | A horizontal strip holds 6 links or fewer; a longer list moves into the drawer at tablet width. | The catalogue's 26-link strip on phones: most links sat off screen, and the page broke its own drawer spec. | rail moves into the drawer: `tests/catalogue/catalogue.spec.ts` "resizing moves the rail between the page and the drawer, and the pages and appearance stay in the header"; six-link strip limit: no test yet |
|
|
56
56
|
| Drawer and slideout | Core | Owner decision, 2026-11-25: two components for two jobs. A drawer holds navigation and opens from the leading edge; a slideout holds filters or secondary detail, opens from the trailing edge by default (the top or bottom when the page names it), is `min(75%, 384px)` wide, and may have a footer whose actions stack on phones. Both share the floating layer, backdrop, page-scroll lock, and slide, and every slideout close returns focus to its trigger. | One drawer for navigation and detail: the owner reads "drawer" as a navigation menu, so a filter panel called a drawer read as the wrong component, and the one spec could not say which edge or width a panel takes. | spec parts: `tests/component-parts.test.mjs` "every component section has every part, or says None with a reason"; edge, width, close, scroll lock, and footer: `tests/catalogue/catalogue.spec.ts` "slideout" |
|
|
57
|
-
| Purpose groups | Core | The catalogue and `components.md` group components by purpose (Actions, Selection, Inputs, Feedback and status, Containers and overlays, Navigation, Code and examples, then Identity). Each section keeps its Core or Identity badge, and the heading ids stay unchanged, so old deep links still work. | Core, then Identity, in build order: a reader had to know a component's layer to find it. Splitting the catalogue into pages: agents copy from and grep one file, and the hosts serve a fixed list of files. | No test yet |
|
|
57
|
+
| Purpose groups | Core | The catalogue and `components.md` group components by purpose (Actions, Selection, Inputs, Feedback and status, Containers and overlays, Data display, Navigation, Code and examples, then Identity). Each section keeps its Core or Identity badge, and the heading ids stay unchanged, so old deep links still work. | Core, then Identity, in build order: a reader had to know a component's layer to find it. Splitting the catalogue into pages: agents copy from and grep one file, and the hosts serve a fixed list of files. | No test yet |
|
|
58
58
|
| Find and its shortcut | Core | A find field filters the rail; `/` focuses it. A saved switch in the rail footer turns single-key shortcuts off (WCAG 2.1.4), and the shortcut is ignored in editable elements and while a modal dialog is open. | No shortcut: Find is a long Tab away. A shortcut with no off switch: it fails WCAG 2.1.4 for speech and switch users. | shortcut and its switch: `tests/catalogue/catalogue.spec.ts` "/ focuses Find, types normally in a field, and does nothing once shortcuts are off" |
|
|
59
59
|
| No command palette | Core | Find, which filters the rail, and no command palette. Revisit when a site has more than one searchable index. | A command palette: Find already covers a single-page catalogue and a site of about 25 skills. | No test yet |
|
|
60
60
|
| One pager per page | Core | One pager at the end of `main`, for the sequence of pages. | A pager per component: on one page with a sticky rail it adds 26 repeated blocks. | No test yet |
|
|
@@ -62,6 +62,7 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
62
62
|
| Breadcrumb above the title | Core | Every site page but the home page has a breadcrumb right above its h1, and the header keeps the project switcher. Separators, and the phone back mark, are chevrons drawn with two borders of a turned box. The trail sits on its text line, level with the Find field at 1280px, and shows in full on phones when it has two crumbs, as in the approved mock. The owner chose it with header option A on 2026-11-11. | The breadcrumb as the header's start item: it read as the page title and moved the strip. The depth-3 rule it replaces kept trails off a two-level site, which then had only the header to show the way back. A `/` or `‹` glyph with empty alternative text: the owner chose chevrons, and a chevron drawn with borders holds no text in any engine. | `tests/site/site.spec.ts` "the breadcrumb sits above the h1 on every page but Overview, with no separator text", "the breadcrumb lines up with Find, and shows both crumbs on phones" |
|
|
63
63
|
| Header current page | Core | Header links are navigation rows `--control-md` tall (32px), `--control-touch` at tablet width, and a link to the current page takes `aria-current="page"` with the current-page recipe. | Muted text links with no current state: the header did not show which page the reader was on. 44px rows at every width (until 2026-11-24): the owner found them too thick beside the 32px controls. | heights: `tests/site/site.spec.ts` "links and icon actions keep their sizes and hit areas" |
|
|
64
64
|
| One scroll offset | Core | `html { scroll-padding-top }` is the only offset: any sticky bar plus `--space-4`. The location tracker reads the same value. | `scroll-margin-top` on each section: every page set its own value, and the tracker needs one inset to compare against. | No test yet |
|
|
65
|
+
| Sticky contents list | Core | Owner decision, 2026-11-25: a contents list ("On this page") beside the reading column is sticky, with `top` at the page's one scroll offset (see One scroll offset) and `align-self: start` in its row, so it stays in view while the column scrolls. It caps at the window height less its `top` and `--space-4`, its list scrolls under a heading that stays put when it does not fit, and it keeps the current row in view as the section rail does, scrolling only its own list. The phone trigger and the list's rows, pip, and states do not change. | A static list that scrolls away with the page: past the first screen the reader loses the contents and the current-section pip. A fixed-position panel: it leaves the layout, so it overlaps content and ignores the column and the frame's edges. | No test yet: no example page has a contents list beside a column |
|
|
65
66
|
| Specimen captions | Core | Every catalogue specimen has a caption that names its state, such as "Disabled" or "Rest, live". The owner chose it at Gate M. | Captions only on some specimens: a disabled or static specimen with no caption could read as broken. | every specimen captioned: `tests/catalogue/catalogue.spec.ts` "every specimen has a caption" |
|
|
66
67
|
| Focus ring | Core | One accent ring for every role but fields: `outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset)` (2px, 3px), with no glow, over the control's own shadow. Variants recolour it with `outline-color` only. `--color-focus` is `--color-accent`: 6.26:1 on the page, 5.72:1 on a surface, and 6.61:1 on a raised surface in light; 8.31:1, 7.85:1, and 7.39:1 in dark. Commands use the normal code block ring: the accent on `--color-code` (5.72:1 in light and 7.85:1 in dark). Terminal captures use `--color-project-dark`: 8.53:1 on the terminal plate. Inspired by Astryx `focusDefaults` (`utils/focusOutline.stylex.ts`), which writes the width, accent colour, and offset once from tokens. The user chose it from rendered demos and accepted an accent ring around primary, danger, and selected controls. | The neutral ink ring (`--color-focus: var(--color-text)`, offset 2px), the previous choice; the user preferred the accent ring with a 3px gap in rendered demos. Before that, an accent ring on controls and a `--color-link` ring on links, tabs, and navigation rows: two ring hues, cyan around the purple selected tab and current row. A ring in each control's own tone, such as `--color-error` around the danger button: every role needs its own ring rule, and the ring changes colour from control to control. A 2px ring with a 6px accent halo felt jarring, and a 1.5px ring was hard to see; Chromium drew it 1px at 1x. | one accent ring: `tests/design-foundations.test.mjs` "every focus ring is the one accent ring: no per-role ring colour or hand-written ring on any page or in tokens.css"; ring contrast: `tests/design-foundations.test.mjs` "the accent focus ring reaches 3:1 on --color-bg, --color-surface, and --color-surface-raised in both themes" |
|
|
67
68
|
| Page colours outside the base layer | Core | `tokens.css` sets the body background and text colour unlayered; the rest of the base stays in `@layer base`, so component rules still outrank it. | Everything in the layer: a host that wraps the page in its own unlayered reset, such as an artifact viewer, kept its light body while the tokens switched to dark, so token-coloured text sat near-white on white. A note telling each page to restate the body: every delivered page would need to remember it, and the failure only shows in dark mode. | unlayered page colours: `tests/design-foundations.test.mjs` "keeps the page background and text colour outside the base layer, so a host reset cannot win" |
|
|
@@ -89,6 +90,10 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
89
90
|
| Versioning | Core | Releases are 1.0.x patches while the system has no outside users, tagged `ds-v*` from the `ds-v1.0.0` seed. Every release, a breaking one included, is a patch; the release notes name a breaking change written as `!` or a `BREAKING CHANGE:` footer in the commit message. npm already holds 1.1.0 through 2.4.0 from the earlier `v*` series, so leaving 1.0.x means 2.5.0 or 3.0.0. | Semver majors and minors (2.x): the numbers signalled a maturity the system does not have yet. 0.0.x: npm already holds 1.0.0, and a `^0.0.1` range matches only 0.0.1. | patch cap: `tests/release.test.mjs` "the release analyzer caps feat, fix, and breaking changes, from a commit or a PR body, at a patch", "the release analyzer releases nothing for chore-only commits"; tag series: `tests/release.test.mjs` "the site version comes from the latest ds-v tag and ignores the earlier v tags" |
|
|
90
91
|
| Agent delivery | Core | A Claude and Codex plugin whose root is this repository. Its `design-system` skill reads `language/` in place, and each release stamps its version into the plugin manifests and commits them back, since both hosts cache a plugin by version. A `docs` commit releases a patch, because agents read `language/` as instructions. | filip-stack host config copying the pinned package to `~/design-system`: it tied the design system to filip-stack and needed its own installer. A plugin folder holding a copy of `language/`: plugin caches cannot reach outside the plugin folder, so the copy would need a build step and a staleness check. | skill path: `tests/plugin.test.mjs` "the design-system skill names a DESIGN.md that exists in the plugin"; version stamp: `tests/plugin.test.mjs` "a release stamps its version into every plugin manifest and keeps the other fields"; docs release: `tests/release.test.mjs` "the release analyzer releases a patch for a docs commit, since agents read language/ through the plugin" |
|
|
91
92
|
| Command-line tool | Core | None yet. A VS Code theme import built on `open-vsx` and `theme-mapper` is the one job no other tool covers; it waits until `@filipgutica/ui` uses the theme mapper, since both APIs are experimental. It would ship as a `bin` in this package, run with `npx`. | A `check` command for off-token values: the `interface-design` skill's `ui-check --tokens` and fallow already find them. A separate Homebrew tool: more release setup than one command needs. | No test yet |
|
|
93
|
+
| Combobox | Core | An editable field that filters a listbox of known options and accepts only one of them: only Enter on the active option, or a click, chooses, and on leaving the field the text goes back to the chosen option's label, even when it names another option. Focus stays in the field, and `aria-activedescendant` names the active option, which takes the hover fill and the inset ring. About 15 options or fewer stay a select. | A free-text field that only suggests values: a typo becomes a product, location, or supplier that no list holds. Moving DOM focus into the list: the caret and the typed text leave the reader's view. | active option in forced colors: `tests/catalogue/catalogue.spec.ts` "the combobox active option keeps a Highlight ring inside its edge"; no free text: `tests/catalogue/catalogue.spec.ts` "leaving the combobox keeps the choice, even when the text names another option" |
|
|
94
|
+
| Number field | Core | A text input (`type="text"`) with `inputmode="numeric"`, or `"decimal"` for a fraction, and `role="spinbutton"`, between square decrease and increase buttons that are out of the Tab order. The unit sits inside the field, and the value shows with the locale's digit grouping. The buttons span the wrapper's edges and take `--radius-field` corners; the wrapper does not clip them, because a clip also cut their tap area along the edge. | The native `type="number"`: a scroll over the focused field changes the value, the browser draws its own spinner, and it rejects grouped digits such as "1,200". Buttons in the Tab order: two more stops that repeat the arrow keys. Square buttons clipped by the wrapper: the clip also cut their tap area along the 1px edge they span. A corner on each button's outer side only: the shape check allows one corner per part. | button corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one"; signs in forced colors: `tests/catalogue/catalogue.spec.ts` "the number field signs take the button text colour, and a disabled sign the disabled colour"; text input: `tests/catalogue/catalogue.spec.ts` "the seed values keep their numbers, and a step reads the shown digits", "a typed fraction keeps its digits in the field, the value, and the value text", and "typing a number in range updates the value, its text, and both buttons; other text changes none" |
|
|
95
|
+
| Description list | Core | Term and value pairs in a two-column grid whose term column is as wide as the longest term, up to 12rem. In a container under 30rem each term sits above its value: the query reads the list's container, so a list in a narrow panel stacks on a wide screen too. A value that is not set reads "None". | A viewport breakpoint: a list in a slideout or a side column kept two cramped columns on a desktop. A fixed term column: short terms left a gap, and long terms wrapped. Leaving an empty pair out: the reader cannot tell a value that is not set from a detail the record does not have. | 12rem term column: `tests/catalogue/catalogue.spec.ts` "an unbroken description list term keeps the term column at 12rem"; narrow stacking: no test yet |
|
|
96
|
+
| Stat tile | Core | The value is always `--color-text`; a badge or the context line says in words whether it is good or bad. Tiles take the `--color-surface` fill and no border, in a grid outside a card. | A green or red value: colour alone fails readers who cannot tell the hues apart (WCAG 1.4.1), and the hue reads as an alarm before the reader knows what the number counts. A border on each tile, or tiles inside a card: boxes inside a box, against [Minimal by default](DESIGN.md#minimal-by-default). | No test yet |
|
|
92
97
|
|
|
93
98
|
## Token names
|
|
94
99
|
|
package/language/ui-sdk.css
CHANGED
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
/* The check carries the state, because the selected fill equals the list's. It sits on the item, so a list
|
|
155
155
|
without SelectItemIndicator still shows it. */
|
|
156
156
|
[data-slot="select-item"][data-selected] { background: var(--color-row-selected); }
|
|
157
|
-
[data-slot="select-item"][data-selected]::after { content: "✓"; margin-left: auto; color: var(--color-accent); }
|
|
157
|
+
[data-slot="select-item"][data-selected]::after { content: "✓" / ""; margin-left: auto; color: var(--color-accent); }
|
|
158
158
|
[data-slot="select-item-indicator"] { display: none; }
|
|
159
159
|
@media (hover: hover) {
|
|
160
160
|
[data-slot="select-item"][data-highlighted]:not([data-disabled]) { background: var(--color-row-hover); }
|