@filipgutica/design-system 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/language/DESIGN.md +46 -4
- package/language/components.html +800 -221
- package/language/components.md +132 -51
- package/language/decisions.md +20 -3
- package/language/docs.html +9 -6
- package/language/reference.html +16 -15
- package/package.json +4 -2
package/language/components.html
CHANGED
|
@@ -224,15 +224,23 @@
|
|
|
224
224
|
/* Tabs */
|
|
225
225
|
/* The list scrolls, so it clips on every side: the padding keeps the selected tab's shadow whole
|
|
226
226
|
and its fill off the frame edge. */
|
|
227
|
-
.tablist { display: flex; width: max-content; max-width: 100%; overflow-x: auto; padding: var(--space-1); }
|
|
227
|
+
.tablist { --glide-lead: 260ms; --glide-trail: 300ms; display: flex; width: max-content; max-width: 100%; overflow-x: auto; padding: var(--space-1); isolation: isolate; }
|
|
228
228
|
/* A clipped edge fades over 24px. The script names the clipped ends in data-clip as the list scrolls or resizes. */
|
|
229
229
|
.tablist[data-clip="start"] { mask-image: linear-gradient(to right, transparent, #000 24px); }
|
|
230
230
|
.tablist[data-clip="end"] { mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
|
|
231
231
|
.tablist[data-clip="start end"] { mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
|
|
232
|
-
.tab { flex: none; min-height: var(--control-md); padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-
|
|
232
|
+
.tab { position: relative; flex: none; min-height: var(--control-md); padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-inline); background: transparent; color: var(--color-muted); font: var(--weight-medium) var(--text-md) / var(--leading) var(--font-ui); white-space: nowrap; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
|
|
233
233
|
.tab:is(:hover, .is-hover) { background: var(--color-row-hover); color: var(--color-text); }
|
|
234
|
-
/* The selected tab takes the navigation row's lifted fill
|
|
235
|
-
|
|
234
|
+
/* The selected tab takes the navigation row's lifted fill: one selected state for both. The fill is a
|
|
235
|
+
::before layer behind the label, so it can glide between tabs as the segmented thumb does. */
|
|
236
|
+
.tab[aria-selected="true"] { background: transparent; color: var(--color-nav-current-text); }
|
|
237
|
+
.tab[aria-selected="true"]::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); pointer-events: none; }
|
|
238
|
+
/* A change of tab starts the new fill at the old one's edges; the script marks it with data-slide. */
|
|
239
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
240
|
+
.tablist[data-slide] .tab { transition: color var(--glide-lead) ease; }
|
|
241
|
+
.tablist[data-slide="right"] .tab[aria-selected="true"]::before { animation: glide-left var(--glide-trail) ease, glide-right var(--glide-lead) ease; }
|
|
242
|
+
.tablist[data-slide="left"] .tab[aria-selected="true"]::before { animation: glide-left var(--glide-lead) ease, glide-right var(--glide-trail) ease; }
|
|
243
|
+
}
|
|
236
244
|
/* Inset: the tab list scrolls sideways, which would clip an outer ring. */
|
|
237
245
|
.tab:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
238
246
|
.tabpanel { padding-top: var(--space-3); font-size: var(--text-sm); color: var(--color-muted); }
|
|
@@ -288,6 +296,10 @@
|
|
|
288
296
|
.drawer { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(calc(var(--sidebar) + var(--space-12)), 100%); height: 260px; overflow: hidden; padding: 0; border: 1px solid transparent; background: var(--color-surface-raised); color: var(--color-text); box-shadow: var(--shadow-dialog); }
|
|
289
297
|
dialog.drawer { position: fixed; inset: 0 auto 0 0; height: 100dvh; max-height: none; margin: 0; }
|
|
290
298
|
dialog.drawer::backdrop { background: var(--color-overlay); }
|
|
299
|
+
/* The page behind an open drawer does not scroll, through the slide out too. Hiding the root's overflow keeps the
|
|
300
|
+
reader's position. The gutter is reserved all the time, so a classic scrollbar that hides does not reflow the page. */
|
|
301
|
+
:root { scrollbar-gutter: stable; }
|
|
302
|
+
:root:has(dialog.drawer[open]) { overflow: hidden; }
|
|
291
303
|
@media (prefers-reduced-motion: no-preference) {
|
|
292
304
|
dialog.drawer[open] { animation: drawer-in var(--duration) var(--ease-out); }
|
|
293
305
|
dialog.drawer[open]::backdrop { animation: fade-in var(--duration) var(--ease-out); }
|
|
@@ -306,7 +318,7 @@
|
|
|
306
318
|
/* Navigation list */
|
|
307
319
|
.navlist { display: grid; gap: 0.125rem; width: min(100%, 240px); }
|
|
308
320
|
.navlist .group-label { padding: 0 var(--space-3) var(--space-1); color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
|
|
309
|
-
.navlist a { position: relative; display: flex; align-items: center; min-height: var(--row); padding-inline: var(--space-3); border-radius: var(--radius-
|
|
321
|
+
.navlist a { position: relative; display: flex; align-items: center; min-height: var(--row); padding-inline: var(--space-3); border-radius: var(--radius-inline); color: var(--color-muted); font-size: var(--text-sm); text-decoration: none; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
|
|
310
322
|
.navlist a:is(:hover, .is-hover) { background: var(--color-row-hover); color: var(--color-text); text-decoration: none; }
|
|
311
323
|
.navlist a[aria-current="page"] { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); color: var(--color-nav-current-text); font-weight: var(--weight-medium); }
|
|
312
324
|
.navlist a[aria-current="location"] { color: var(--color-text); font-weight: var(--weight-medium); }
|
|
@@ -319,7 +331,76 @@
|
|
|
319
331
|
.rail-summary { list-style: none; width: max-content; max-width: 100%; }
|
|
320
332
|
.rail-summary::-webkit-details-marker { display: none; }
|
|
321
333
|
.rail-summary::after { content: ""; width: 6px; height: 6px; margin-left: var(--space-1); border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }
|
|
322
|
-
details.rail[open] > .navlist { margin-top: var(--space-2); }
|
|
334
|
+
details.rail-details[open] > .navlist { margin-top: var(--space-2); }
|
|
335
|
+
/* A collapsible group's label is a disclosure button in the group-label type. Only rails over about 40 rows use it. */
|
|
336
|
+
.group-toggle { display: flex; align-items: center; justify-content: space-between; min-height: var(--control-sm); padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius-inline); background: transparent; color: var(--color-muted); font: var(--weight-semibold) var(--text-xs) var(--font-ui); cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
|
|
337
|
+
.group-toggle:is(:hover, .is-hover) { background: var(--color-row-hover); color: var(--color-text); }
|
|
338
|
+
.group-toggle .icon { transition: transform var(--duration-fast) var(--ease-out); }
|
|
339
|
+
.group-toggle[aria-expanded="false"] .icon { transform: rotate(-90deg); }
|
|
340
|
+
/* Inset: the rail list scrolls. */
|
|
341
|
+
.group-toggle:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
342
|
+
/* Horizontal strip: the same rows in one line that scrolls sideways. The padding keeps the current row's shadow whole.
|
|
343
|
+
A clipped edge fades over 24px, as tabs do; the script names the clipped ends in data-clip. */
|
|
344
|
+
.navlist.strip { display: flex; width: auto; max-width: 100%; overflow-x: auto; padding: 0.125rem; }
|
|
345
|
+
.navlist.strip a { flex: none; white-space: nowrap; }
|
|
346
|
+
.navlist.strip[data-clip="start"] { mask-image: linear-gradient(to right, transparent, #000 24px); }
|
|
347
|
+
.navlist.strip[data-clip="end"] { mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
|
|
348
|
+
.navlist.strip[data-clip="start end"] { mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
|
|
349
|
+
|
|
350
|
+
/* Section rail: sticky and full height. The find field and the footer stay put while the list scrolls,
|
|
351
|
+
and the list's padding keeps the current row's shadow whole. */
|
|
352
|
+
.rail { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: var(--space-3); height: 100dvh; padding-block: var(--space-6) var(--space-4); }
|
|
353
|
+
.rail-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0.125rem; }
|
|
354
|
+
.rail .navlist { width: auto; }
|
|
355
|
+
.rail .navlist + .navlist { margin-top: var(--space-4); }
|
|
356
|
+
.rail-foot { padding-top: var(--space-3); border-top: 1px solid var(--color-border-subtle); color: var(--color-muted); font-size: var(--text-sm); }
|
|
357
|
+
.rail-foot .switch-row label { color: var(--color-muted); }
|
|
358
|
+
/* In a rail the current section takes the current-page look, with no pip. Strips and contents lists keep the pip. */
|
|
359
|
+
:is(.rail, .rail-specimen) a[aria-current="location"] { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); color: var(--color-nav-current-text); }
|
|
360
|
+
:is(.rail, .rail-specimen) a[aria-current="location"]::before { content: none; }
|
|
361
|
+
/* Tablet and phone: Find and Menu, icon-only and square, in the header row. */
|
|
362
|
+
.section-bar { display: flex; gap: var(--space-2); }
|
|
363
|
+
.section-bar .btn { width: var(--control-lg); padding: 0; }
|
|
364
|
+
|
|
365
|
+
/* Find field: a search input with a leading icon and a trailing key hint. */
|
|
366
|
+
.find { position: relative; display: block; width: 100%; max-width: 260px; }
|
|
367
|
+
.find .input { width: 100%; padding-inline: 2rem 2.25rem; }
|
|
368
|
+
.find > .icon { position: absolute; left: 10px; top: 50%; translate: 0 -50%; color: var(--color-muted); pointer-events: none; }
|
|
369
|
+
.find > .key { position: absolute; right: 8px; top: 50%; translate: 0 -50%; pointer-events: none; }
|
|
370
|
+
.find:focus-within > .key, .find:has(.input:not(:placeholder-shown)) > .key { display: none; }
|
|
371
|
+
/* Touch-only devices have no / key to press, so the hint hides. */
|
|
372
|
+
@media (hover: none) { .find > .key { display: none; } }
|
|
373
|
+
.find-empty { display: grid; justify-items: start; gap: var(--space-1); padding: var(--space-2) var(--space-3); color: var(--color-muted); font-size: var(--text-sm); }
|
|
374
|
+
.find-empty .btn.text { margin-inline-start: calc(-1 * var(--space-1)); }
|
|
375
|
+
.find-count { color: var(--color-muted); font-size: var(--text-xs); }
|
|
376
|
+
|
|
377
|
+
/* Breadcrumbs. The separator is drawn by CSS, so it is not read. */
|
|
378
|
+
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); }
|
|
379
|
+
.crumbs li { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
|
|
380
|
+
.crumbs li + li::before { content: "/" / ""; color: var(--color-muted); }
|
|
381
|
+
.crumbs a { display: inline-flex; align-items: center; min-height: var(--control-sm); border-radius: var(--radius-inline); color: var(--color-muted); text-decoration: none; }
|
|
382
|
+
.crumbs a:is(:hover, .is-hover) { color: var(--color-text); text-decoration: underline; text-underline-offset: 0.2em; }
|
|
383
|
+
.crumbs [aria-current="page"] { color: var(--color-text); font-weight: var(--weight-medium); overflow-wrap: anywhere; }
|
|
384
|
+
/* Phones show only the parent, as a back link; .is-back pins that for the specimen. */
|
|
385
|
+
.crumbs.is-back li:not(:nth-last-child(2)) { display: none; }
|
|
386
|
+
.crumbs.is-back li::before { content: none; }
|
|
387
|
+
.crumbs.is-back li:nth-last-child(2) a::before { content: "‹\a0" / ""; }
|
|
388
|
+
|
|
389
|
+
/* Pager: previous at the start, next always at the end. */
|
|
390
|
+
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); width: 100%; padding-top: var(--space-6); border-top: 1px solid var(--color-border-subtle); }
|
|
391
|
+
.pager a { display: grid; align-content: start; gap: 0.125rem; padding: var(--space-3) var(--space-4); border: 1px solid transparent; border-radius: var(--radius-field); color: var(--color-text); text-decoration: none; transition: background-color var(--duration-fast) var(--ease-out); }
|
|
392
|
+
.pager a:is(:hover, .is-hover) { background: var(--color-row-hover); }
|
|
393
|
+
.pager a[rel="next"] { grid-column: 2; justify-items: end; text-align: end; }
|
|
394
|
+
.pager-dir { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--color-muted); font-size: var(--text-xs); }
|
|
395
|
+
.pager-title { font-weight: var(--weight-medium); }
|
|
396
|
+
|
|
397
|
+
/* Keyboard key: mono, with an edge and no shadow. */
|
|
398
|
+
.key { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 0.3125rem; border: 1px solid var(--color-border); border-radius: var(--radius-inline); background: var(--color-surface); color: var(--color-muted); font: var(--weight-medium) var(--text-xs) / 1 var(--font-mono); vertical-align: 0.1em; }
|
|
399
|
+
|
|
400
|
+
/* Skip link: hidden above the page until it takes focus. */
|
|
401
|
+
.skip { position: absolute; top: calc(-1 * var(--space-16)); left: var(--space-4); z-index: 10; padding: var(--space-2) var(--space-3); border: 1px solid transparent; border-radius: var(--radius-field); background: var(--color-surface-raised); box-shadow: var(--shadow-dialog); color: var(--color-text); }
|
|
402
|
+
.skip:focus { top: var(--space-4); }
|
|
403
|
+
.skip.is-focus { position: static; outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
|
|
323
404
|
/* List selection */
|
|
324
405
|
.rows { display: grid; width: min(100%, 360px); }
|
|
325
406
|
.rows [role="option"] { position: relative; display: flex; align-items: center; min-height: var(--row); padding: 0 var(--space-3); border-radius: var(--radius-inline); font-size: var(--text-sm); }
|
|
@@ -428,9 +509,8 @@
|
|
|
428
509
|
.projects.is-open .navlist { position: static; }
|
|
429
510
|
.projects .navlist a { font-family: var(--font-mono); }
|
|
430
511
|
.site-end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-6); margin-left: auto; }
|
|
431
|
-
|
|
432
|
-
.site-links a {
|
|
433
|
-
.site-links a:hover { color: var(--color-text); }
|
|
512
|
+
/* The site links are a navigation strip at the header's 44px. */
|
|
513
|
+
.site-links a { min-height: var(--control-lg); }
|
|
434
514
|
|
|
435
515
|
/* Page type and helpers */
|
|
436
516
|
.folio-h2 { font: var(--weight-semibold) var(--text-xl) / var(--leading-tight) var(--font-mono); letter-spacing: var(--tracking-tight); }
|
|
@@ -446,10 +526,6 @@
|
|
|
446
526
|
.definitions dt { font-weight: var(--weight-medium); }
|
|
447
527
|
.definitions dd { margin: 0; color: var(--color-muted); }
|
|
448
528
|
.definitions code { white-space: nowrap; }
|
|
449
|
-
/* Skip link: hidden above the page until it takes focus. */
|
|
450
|
-
.skip { position: absolute; top: calc(-1 * var(--space-16)); left: var(--space-4); z-index: 10; padding: var(--space-2) var(--space-3); border: 1px solid transparent; border-radius: var(--radius-field); background: var(--color-surface-raised); box-shadow: var(--shadow-dialog); color: var(--color-text); }
|
|
451
|
-
.skip:focus { top: var(--space-4); }
|
|
452
|
-
.skip.is-focus { position: static; outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
|
|
453
529
|
.facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin: 0; font: var(--text-sm) / var(--leading) var(--font-mono); }
|
|
454
530
|
.facts > div { display: flex; flex-wrap: wrap; column-gap: var(--space-2); }
|
|
455
531
|
.facts dt { color: var(--color-muted); }
|
|
@@ -470,7 +546,7 @@
|
|
|
470
546
|
/* One ring for every role: --focus-width of --color-focus (the accent) with a --focus-offset gap and no
|
|
471
547
|
glow, over the control's own raise or sink. The tokens.css base draws it on links; these rules pin
|
|
472
548
|
it and move it to the visible part of composite controls. */
|
|
473
|
-
:is(.btn, .quiet-action, .check input, .segmented button, .toggle):is(:focus-visible, .is-focus),
|
|
549
|
+
:is(.btn, .quiet-action, .check input, .segmented button, .toggle, .crumbs a):is(:focus-visible, .is-focus),
|
|
474
550
|
:is(.dialog, .drawer):focus-visible,
|
|
475
551
|
.switch:is(:focus-visible, .is-focus) .switch-track,
|
|
476
552
|
.radio-card:has(input:is(:focus-visible, .is-focus)) { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
|
|
@@ -491,6 +567,7 @@
|
|
|
491
567
|
:is(.input, .select, .textarea):is(:focus-visible, .is-focus), .search:is(:has(input:focus-visible), .is-focus) { outline: var(--focus-width) solid Highlight; outline-offset: -1px; }
|
|
492
568
|
/* The lifted fill drops, so the selected tab takes a system border; the padding absorbs it. */
|
|
493
569
|
.tab[aria-selected="true"] { border: 2px solid Highlight; padding: calc(var(--space-2) - 2px) calc(var(--space-3) - 2px); }
|
|
570
|
+
.tab[aria-selected="true"]::before { content: none; }
|
|
494
571
|
.check input:checked { forced-color-adjust: none; border-color: Highlight; background: Highlight; }
|
|
495
572
|
/* The masked search cross would lose its fill, so it opts out and takes the system text colour. */
|
|
496
573
|
.search input::-webkit-search-cancel-button, .search input::-webkit-search-cancel-button:hover { forced-color-adjust: none; background: CanvasText; }
|
|
@@ -511,6 +588,10 @@
|
|
|
511
588
|
its pip, redrawn in the system highlight, so the two still differ. */
|
|
512
589
|
.navlist a[aria-current="page"] { border-inline-start: 2px solid Highlight; }
|
|
513
590
|
.navlist a[aria-current="location"]::before { forced-color-adjust: none; background: Highlight; }
|
|
591
|
+
/* A rail's current section has no pip, so it takes the current page's system border. */
|
|
592
|
+
:is(.rail, .rail-specimen) a[aria-current="location"] { border-inline-start: 2px solid Highlight; }
|
|
593
|
+
.key { border-color: CanvasText; }
|
|
594
|
+
.coverage td { color: CanvasText; }
|
|
514
595
|
/* Value marks: only the mark opts out of adjustment and redraws in the system highlight. */
|
|
515
596
|
.progress > span, .score .pips i.on { forced-color-adjust: none; border-color: Highlight; background: Highlight; }
|
|
516
597
|
/* Each engine's range pseudo-element has its own rule: an unknown one drops the whole list. */
|
|
@@ -521,28 +602,33 @@
|
|
|
521
602
|
}
|
|
522
603
|
|
|
523
604
|
/* ---------- Catalogue page ---------- */
|
|
605
|
+
/* One scroll offset for every in-page jump; sections set no scroll-margin-top. The location tracker reads the same value. */
|
|
606
|
+
html { scroll-padding-top: var(--space-4); }
|
|
524
607
|
.frame { width: min(calc(var(--page-max) + var(--sidebar)), calc(100% - var(--space-12))); margin-inline: auto; }
|
|
525
|
-
|
|
526
|
-
.page-head
|
|
527
|
-
.
|
|
528
|
-
|
|
608
|
+
/* Header: the site name, the design system's pages as a navigation strip, and the appearance control. */
|
|
609
|
+
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); min-height: var(--space-16); border-bottom: 1px solid var(--color-border-subtle); }
|
|
610
|
+
.site-name { margin: 0 auto 0 0; font: var(--weight-semibold) var(--text-sm) / 1 var(--font-mono); }
|
|
611
|
+
/* Header links are navigation rows at the site header's 44px. The strip's label shows only in the drawer. */
|
|
612
|
+
.page-head .strip a { min-height: var(--control-lg); }
|
|
613
|
+
.navlist.strip > .group-label { display: none; }
|
|
529
614
|
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: var(--space-8); }
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
/* One column that may shrink below its content, so a long title or specimen cannot widen the page. */
|
|
534
|
-
main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-12); min-width: 0; padding-block: var(--space-8) var(--space-16); }
|
|
615
|
+
/* One column that may shrink below its content, so a long title or specimen cannot widen the page.
|
|
616
|
+
A short page, such as one left by a find with no matches, keeps its rows at the top. */
|
|
617
|
+
main { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--space-12); min-width: 0; padding-block: var(--space-8) var(--space-16); }
|
|
535
618
|
.intro { display: grid; gap: var(--space-3); }
|
|
536
619
|
.intro h1 { font: var(--weight-semibold) var(--text-3xl) / 1.08 var(--font-mono); letter-spacing: var(--tracking-tight); overflow-wrap: anywhere; }
|
|
537
620
|
.intro p { max-width: var(--measure); color: var(--color-muted); font-size: var(--text-reading); }
|
|
538
621
|
.layer-head { display: grid; gap: var(--space-2); padding-top: var(--space-6); border-top: 1px solid var(--color-border-subtle); }
|
|
539
|
-
.layer-head h2 { font: var(--weight-semibold) var(--text-xl) / var(--leading-tight) var(--font-mono); }
|
|
540
|
-
.layer-head h2::before { content: "## " / ""; color: var(--color-accent); }
|
|
622
|
+
:is(.layer-head, .index) > h2 { font: var(--weight-semibold) var(--text-xl) / var(--leading-tight) var(--font-mono); }
|
|
623
|
+
:is(.layer-head, .index) > h2::before { content: "## " / ""; color: var(--color-accent); }
|
|
541
624
|
.layer-head p { max-width: var(--measure); color: var(--color-muted); }
|
|
542
|
-
.component { display: grid; gap: var(--space-3); min-width: 0;
|
|
625
|
+
.component { display: grid; gap: var(--space-3); min-width: 0; }
|
|
543
626
|
.component > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-3); }
|
|
544
627
|
.component h3 { font-size: var(--text-lg); }
|
|
545
628
|
.component > header a { font-size: var(--text-sm); }
|
|
629
|
+
/* Each component has a one-line purpose, which Find also matches, and a Copy link quiet action. */
|
|
630
|
+
.purpose { max-width: var(--measure); margin-top: calc(-1 * var(--space-2)); color: var(--color-muted); font-size: var(--text-sm); }
|
|
631
|
+
.copy-link { width: var(--control-sm); height: var(--control-sm); align-self: center; color: var(--color-muted); }
|
|
546
632
|
.note { max-width: var(--measure); color: var(--color-muted); font-size: var(--text-sm); }
|
|
547
633
|
.row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--space-2) var(--space-6); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border-subtle); }
|
|
548
634
|
.row:last-child { border-bottom: 0; }
|
|
@@ -558,26 +644,84 @@
|
|
|
558
644
|
.wide { flex-basis: 100%; }
|
|
559
645
|
/* Fields fill their container; the catalogue gives each specimen a preferred width. */
|
|
560
646
|
.state > :is(.field, .input, .select, .textarea, .search) { width: 220px; }
|
|
647
|
+
.state .pager { padding-top: 0; border-top: 0; }
|
|
648
|
+
.rail-specimen { display: grid; gap: var(--space-3); width: 240px; }
|
|
649
|
+
.phone-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: min(100%, 360px); padding-block: var(--space-3); border-bottom: 1px solid var(--color-border-subtle); }
|
|
650
|
+
|
|
651
|
+
/* By purpose: each group with its components, in two balanced columns. */
|
|
652
|
+
.index { display: grid; gap: var(--space-4); }
|
|
653
|
+
.index-grid { columns: 2; column-gap: var(--space-8); }
|
|
654
|
+
.index-grid > div { break-inside: avoid; padding-bottom: var(--space-6); }
|
|
655
|
+
.index-grid h3 { margin-bottom: var(--space-2); font-size: var(--text-md); }
|
|
656
|
+
.index-grid h3 a { color: var(--color-text); text-decoration: none; }
|
|
657
|
+
.index-grid h3 a:hover { text-decoration: underline; }
|
|
658
|
+
.index-grid ul { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
|
|
659
|
+
.index-grid li { display: grid; font-size: var(--text-sm); }
|
|
660
|
+
.index-grid li > span { color: var(--color-muted); }
|
|
661
|
+
|
|
662
|
+
/* Control states. The wrapper is positioned, so the visually hidden cell text stays inside the scroller. */
|
|
663
|
+
.coverage-wrap { position: relative; overflow-x: auto; margin-top: calc(-1 * var(--space-8)); }
|
|
664
|
+
.coverage { width: 100%; border-collapse: collapse; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
|
|
665
|
+
.coverage th, .coverage td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border-subtle); text-align: center; }
|
|
666
|
+
.coverage thead th { color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-medium); }
|
|
667
|
+
.coverage :is(thead th:first-child, tbody th) { padding-inline-start: 0; text-align: left; font-weight: var(--weight-regular); white-space: nowrap; }
|
|
668
|
+
.coverage td { color: var(--color-accent); }
|
|
669
|
+
.coverage .none { color: var(--color-muted); }
|
|
670
|
+
|
|
671
|
+
/* The menu drawer holds Find, the pages, the appearance control, and the rail's groups. */
|
|
672
|
+
.drawer .rail { position: static; height: auto; padding: 0; }
|
|
673
|
+
.drawer .rail-list { overflow: visible; }
|
|
674
|
+
.drawer .find { max-width: none; }
|
|
675
|
+
/* The find field stays at the top of the drawer while the list scrolls under it. */
|
|
676
|
+
.drawer .rail-find { position: sticky; top: calc(-1 * var(--space-4)); z-index: 1; margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) 0; padding: var(--space-4); background: var(--color-surface-raised); }
|
|
677
|
+
.drawer .navlist.strip { display: grid; overflow: visible; margin-bottom: var(--space-4); padding: 0; }
|
|
678
|
+
.drawer .navlist.strip > .group-label { display: block; }
|
|
679
|
+
.drawer .navlist.strip a { white-space: normal; }
|
|
680
|
+
.drawer-appearance { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
|
|
681
|
+
.drawer-appearance > .group-label { padding-inline: var(--space-3); color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
|
|
682
|
+
.drawer-appearance > .segmented { justify-self: start; max-width: 100%; }
|
|
683
|
+
/* A tap opens the drawer with focus on its body, which draws no ring; the rows show their own. */
|
|
684
|
+
#nav-drawer-body:focus { outline: none; }
|
|
561
685
|
|
|
562
686
|
@media (max-width: 800px) {
|
|
687
|
+
/* With the script, the header is one sticky row with Find and Menu. --head-inset is its height, and
|
|
688
|
+
in-page jumps land below it. */
|
|
689
|
+
:root { --head-inset: calc(var(--control-lg) + 2 * var(--space-3) + 1px); }
|
|
690
|
+
html { scroll-padding-top: calc(var(--head-inset) + var(--space-4)); }
|
|
691
|
+
.page-head { padding-block: var(--space-3); }
|
|
692
|
+
.page-head:has(> .section-bar) { position: sticky; top: 0; z-index: 5; flex-wrap: nowrap; background: var(--color-bg); }
|
|
693
|
+
.page-head:has(> .section-bar) > .site-name { min-width: 0; }
|
|
694
|
+
/* The buttons sit inside the scroll inset, so they cancel it; otherwise focusing one scrolls the page. */
|
|
695
|
+
.page-head > .section-bar > * { scroll-margin-top: calc(-1 * (var(--head-inset) + var(--space-4))); }
|
|
696
|
+
/* Without the script, the links take a second row and the rail stays in place above the content. */
|
|
697
|
+
.page-head .strip { order: 3; flex-basis: 100%; margin-inline: -2px; }
|
|
563
698
|
.layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
|
|
564
|
-
|
|
565
|
-
.
|
|
566
|
-
|
|
567
|
-
.
|
|
568
|
-
.
|
|
569
|
-
.toc .navlist .group-label { display: flex; align-items: center; padding: 0 var(--space-1) 0 0; }
|
|
699
|
+
.layout > .rail { position: static; height: auto; padding-block: var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
|
|
700
|
+
.layout > .rail .rail-list { overflow: visible; }
|
|
701
|
+
/* The rail sits in the drawer or, without the script, right after the header, so it needs no skip link. */
|
|
702
|
+
.skip[href="#contents"] { display: none; }
|
|
703
|
+
.index-grid { columns: 1; }
|
|
570
704
|
.row { grid-template-columns: minmax(0, 1fr); }
|
|
571
705
|
/* Touch: unsized controls grow to --control-lg. Size specimens keep their sizes. */
|
|
572
706
|
.btn:not([data-size]), .segmented:not([data-size]) button, .navlist a, .tab { min-height: var(--control-lg); }
|
|
707
|
+
/* An unsized segmented control grows its item size too, so icon-only options stay square. */
|
|
708
|
+
.segmented:not([data-size]) { --item: var(--control-lg); }
|
|
573
709
|
.input:not([data-size]), .select:not([data-size]), .range:not([data-size]) { height: var(--control-lg); }
|
|
574
710
|
.search { height: var(--control-lg); }
|
|
575
711
|
.check:not([data-size]), .switch:not([data-size]), .toggle:not([data-size]) { min-height: var(--control-lg); }
|
|
712
|
+
.copy-link { width: var(--control-lg); height: var(--control-lg); }
|
|
713
|
+
.crumbs a, .group-toggle { min-height: var(--control-lg); }
|
|
576
714
|
.folio-display { font-size: var(--text-display-sm); }
|
|
577
715
|
}
|
|
578
716
|
@media (max-width: 640px) {
|
|
579
717
|
/* Phones: a dialog becomes a bottom sheet with rounded top corners. */
|
|
580
718
|
dialog.dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
|
|
719
|
+
/* Breadcrumbs show only the parent, as a back link. */
|
|
720
|
+
.crumbs li:not(:nth-last-child(2)) { display: none; }
|
|
721
|
+
.crumbs li::before { content: none; }
|
|
722
|
+
.crumbs li:nth-last-child(2) a::before { content: "‹\a0" / ""; }
|
|
723
|
+
.pager { grid-template-columns: minmax(0, 1fr); }
|
|
724
|
+
.pager a[rel="next"] { grid-column: 1; }
|
|
581
725
|
.definitions { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-1); }
|
|
582
726
|
.definitions dd + dt { margin-top: var(--space-3); }
|
|
583
727
|
.frame { width: calc(100% - var(--space-8)); }
|
|
@@ -605,52 +749,114 @@
|
|
|
605
749
|
<symbol id="i-expand" viewBox="0 0 16 16"><path d="M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5 9 7M2.5 13.5 7 9"/></symbol>
|
|
606
750
|
<symbol id="i-list" viewBox="0 0 16 16"><path d="M5.5 4.5h8M5.5 8h8M5.5 11.5h8M2.5 4.5h.01M2.5 8h.01M2.5 11.5h.01"/></symbol>
|
|
607
751
|
<symbol id="i-grid" viewBox="0 0 16 16"><rect x="2.5" y="2.5" width="4.5" height="4.5" rx="1"/><rect x="9" y="2.5" width="4.5" height="4.5" rx="1"/><rect x="2.5" y="9" width="4.5" height="4.5" rx="1"/><rect x="9" y="9" width="4.5" height="4.5" rx="1"/></symbol>
|
|
752
|
+
<symbol id="i-link" viewBox="0 0 16 16"><path d="M6.8 9.2a2.5 2.5 0 0 0 3.5 0l2.2-2.2a2.5 2.5 0 0 0-3.5-3.5l-.8.8M9.2 6.8a2.5 2.5 0 0 0-3.5 0L3.5 9a2.5 2.5 0 0 0 3.5 3.5l.8-.8"/></symbol>
|
|
753
|
+
<symbol id="i-menu" viewBox="0 0 16 16"><path d="M1.5 3.5h13M1.5 8h13M1.5 12.5h13"/></symbol>
|
|
754
|
+
<symbol id="i-arrow-left" viewBox="0 0 16 16"><path d="M12.5 8h-9M7 4.5 3.5 8 7 11.5"/></symbol>
|
|
755
|
+
<symbol id="i-arrow-right" viewBox="0 0 16 16"><path d="M3.5 8h9M9 4.5l3.5 3.5L9 11.5"/></symbol>
|
|
608
756
|
</svg>
|
|
609
757
|
|
|
610
|
-
<a class="skip" href="#
|
|
758
|
+
<a class="skip" href="#main">Skip to content</a>
|
|
759
|
+
<a class="skip" href="#contents">Skip to contents</a>
|
|
611
760
|
<div class="frame">
|
|
612
761
|
<header class="page-head">
|
|
613
|
-
<
|
|
614
|
-
<nav aria-label="
|
|
615
|
-
|
|
616
|
-
<a href="reference.html">Application example</a>
|
|
617
|
-
<a href="docs.html">Documentation example</a>
|
|
618
|
-
<a href="product.html">Product page example</a>
|
|
619
|
-
</nav>
|
|
620
|
-
<div class="segmented" role="group" aria-label="Theme" data-live>
|
|
762
|
+
<p class="site-name">Design system</p>
|
|
763
|
+
<nav class="navlist strip" aria-label="Pages"><span class="group-label" aria-hidden="true">Pages</span><a href="reference.html#foundations">Foundations</a><a href="components.html" aria-current="page">Components</a><a href="reference.html">Application example</a><a href="docs.html">Documentation example</a><a href="product.html">Product page example</a></nav>
|
|
764
|
+
<div class="segmented" role="group" aria-label="Appearance" data-live hidden>
|
|
621
765
|
<button type="button" data-theme-choice="system" aria-pressed="true">System</button>
|
|
622
766
|
<button type="button" data-theme-choice="light" aria-pressed="false">Light</button>
|
|
623
767
|
<button type="button" data-theme-choice="dark" aria-pressed="false">Dark</button>
|
|
624
768
|
</div>
|
|
625
769
|
</header>
|
|
626
770
|
|
|
771
|
+
<!-- Phones: the script moves this bar into the header row, and the rail into the menu drawer. -->
|
|
772
|
+
<div class="section-bar" id="section-bar" hidden>
|
|
773
|
+
<button class="btn secondary" type="button" data-size="lg" id="section-find" aria-label="Find a component" aria-haspopup="dialog"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg></button>
|
|
774
|
+
<button class="btn secondary" type="button" data-size="lg" id="section-menu" aria-label="Menu" aria-haspopup="dialog"><svg class="icon" aria-hidden="true"><use href="#i-menu"/></svg></button>
|
|
775
|
+
</div>
|
|
776
|
+
|
|
627
777
|
<div class="layout">
|
|
628
|
-
<
|
|
629
|
-
<div class="
|
|
630
|
-
<
|
|
631
|
-
<
|
|
778
|
+
<aside class="rail" id="rail" aria-label="Contents">
|
|
779
|
+
<div class="rail-find" hidden>
|
|
780
|
+
<div class="find"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input class="input" type="search" id="find" placeholder="Find a component" aria-label="Find a component" aria-describedby="find-count" autocomplete="off" spellcheck="false" aria-keyshortcuts="/"><kbd class="key" aria-hidden="true">/</kbd></div>
|
|
781
|
+
<p class="sr-only" role="status" id="find-count"></p>
|
|
632
782
|
</div>
|
|
633
|
-
<
|
|
634
|
-
<
|
|
635
|
-
|
|
783
|
+
<nav class="rail-list" id="contents" aria-label="Components">
|
|
784
|
+
<div class="navlist" role="group" aria-labelledby="rail-overview">
|
|
785
|
+
<span class="group-label" id="rail-overview">Overview</span>
|
|
786
|
+
<a href="#index" data-terms="by purpose overview index overview all components">By purpose</a>
|
|
787
|
+
</div>
|
|
788
|
+
<div class="navlist" role="group" aria-labelledby="rail-actions">
|
|
789
|
+
<span class="group-label" id="rail-actions">Actions</span>
|
|
790
|
+
<a href="#button" data-terms="button actions the main action control: primary, secondary, ghost, danger, and text. cta submit link">Button</a><a href="#quiet-action" data-terms="quiet action actions a small transparent action inside a component, such as copy or close. icon button copy close">Quiet action</a>
|
|
791
|
+
</div>
|
|
792
|
+
<div class="navlist" role="group" aria-labelledby="rail-selection">
|
|
793
|
+
<span class="group-label" id="rail-selection">Selection</span>
|
|
794
|
+
<a href="#checkbox-and-radio" data-terms="checkbox and radio selection pick several options, or one from a short list. check tick option">Checkbox and radio</a><a href="#radio-card-group" data-terms="radio card group selection pick one option that needs a description. choice card option">Radio card group</a><a href="#switch" data-terms="switch selection turn a setting on or off at once. toggle on off">Switch</a><a href="#toggle-button" data-terms="toggle button selection a labelled card that latches on, with a switch inside. toggle card pressed">Toggle button</a><a href="#segmented-control" data-terms="segmented control selection two to five short options that apply at once. button group toggle group theme view mode">Segmented control</a>
|
|
795
|
+
</div>
|
|
796
|
+
<div class="navlist" role="group" aria-labelledby="rail-inputs">
|
|
797
|
+
<span class="group-label" id="rail-inputs">Inputs</span>
|
|
798
|
+
<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>
|
|
799
|
+
</div>
|
|
800
|
+
<div class="navlist" role="group" aria-labelledby="rail-feedback">
|
|
801
|
+
<span class="group-label" id="rail-feedback">Feedback and status</span>
|
|
802
|
+
<a href="#progress" data-terms="progress feedback and status show how far a task has got. loading bar meter">Progress</a><a href="#score" data-terms="score feedback and status show a value out of a maximum. rating pips">Score</a><a href="#badge" data-terms="badge feedback and status a short status label. tag chip pill label status">Badge</a><a href="#alert" data-terms="alert feedback and status a real caveat or status message in the page. callout banner notice warning error">Alert</a>
|
|
803
|
+
</div>
|
|
804
|
+
<div class="navlist" role="group" aria-labelledby="rail-containers">
|
|
805
|
+
<span class="group-label" id="rail-containers">Containers and overlays</span>
|
|
806
|
+
<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 a side panel, such as phone navigation. sheet off-canvas sidebar menu">Drawer</a>
|
|
807
|
+
</div>
|
|
808
|
+
<div class="navlist" role="group" aria-labelledby="rail-navigation">
|
|
809
|
+
<span class="group-label" id="rail-navigation">Navigation</span>
|
|
810
|
+
<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>
|
|
811
|
+
</div>
|
|
812
|
+
<div class="navlist" role="group" aria-labelledby="rail-code">
|
|
813
|
+
<span class="group-label" id="rail-code">Code and examples</span>
|
|
814
|
+
<a href="#code-block" data-terms="code block code and examples source code with an optional header and copy, and a live example above it. snippet pre syntax example demo preview playground">Code block</a>
|
|
815
|
+
</div>
|
|
816
|
+
<div class="navlist" role="group" aria-labelledby="rail-identity">
|
|
817
|
+
<span class="group-label" id="rail-identity">Identity</span>
|
|
818
|
+
<a href="#command-plate" data-terms="command plate identity a shell command on a hue-tinted plate. install shell terminal">Command plate</a><a href="#terminal-capture" data-terms="terminal capture identity a recorded terminal screen with a status line. screenshot tui">Terminal capture</a><a href="#site-header" data-terms="site header identity the ~/name header with project switcher and appearance. header project switcher appearance">Site header</a><a href="#page-type-and-helpers" data-terms="page type and helpers identity mono headings, steps, definitions, facts, and the footer. headings steps footer definitions">Page type and helpers</a>
|
|
819
|
+
</div>
|
|
820
|
+
<div class="navlist" role="group" aria-labelledby="rail-reference">
|
|
821
|
+
<span class="group-label" id="rail-reference">Reference</span>
|
|
822
|
+
<a href="#state-coverage" data-terms="control states reference coverage hover pressed selected focus disabled busy invalid matrix">Control states</a>
|
|
823
|
+
</div>
|
|
824
|
+
<div class="find-empty" id="find-empty" hidden><p>No component matches <q></q>.</p><button class="btn text" type="button" id="find-clear">Clear</button></div>
|
|
825
|
+
</nav>
|
|
826
|
+
<div class="rail-foot" hidden>
|
|
827
|
+
<div class="switch-row"><button class="switch" id="shortcut-switch" type="button" role="switch" aria-checked="true" aria-labelledby="shortcut-label"><span class="switch-track" aria-hidden="true"></span></button><label id="shortcut-label" for="shortcut-switch">Single-key shortcuts</label></div>
|
|
636
828
|
</div>
|
|
637
|
-
</
|
|
829
|
+
</aside>
|
|
638
830
|
|
|
639
831
|
<main id="main">
|
|
640
832
|
<section class="intro" aria-labelledby="title">
|
|
641
833
|
<h1 id="title">Components</h1>
|
|
642
834
|
<p>Every component in the design language, in each state that applies. The styles use only <a href="tokens.css"><code>tokens.css</code></a>, and the markup carries the roles and states a React or Vue version should copy. <a href="components.md">Component specs</a> describe each one; <a href="decisions.md">decisions</a> say why.</p>
|
|
643
|
-
<p>The first specimen in each row is live. The others pin one state for display and do not respond
|
|
835
|
+
<p>Each component’s badge names its layer: a new project adopts Core as it is, with its own hue and fonts set in the <code>tokens.css</code> identity block, and replaces Identity with its own look. The first specimen in each row is live. The others pin one state for display and do not respond, and every caption names its state.</p>
|
|
644
836
|
</section>
|
|
645
837
|
|
|
646
|
-
<section class="
|
|
647
|
-
<h2 id="
|
|
648
|
-
<
|
|
838
|
+
<section class="index" id="index" aria-labelledby="index-title">
|
|
839
|
+
<h2 id="index-title">By purpose</h2>
|
|
840
|
+
<div class="index-grid">
|
|
841
|
+
<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></ul></div>
|
|
842
|
+
<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>
|
|
843
|
+
<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>
|
|
844
|
+
<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>
|
|
845
|
+
<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>A side panel, such as phone navigation.</span></li></ul></div>
|
|
846
|
+
<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>
|
|
847
|
+
<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>
|
|
848
|
+
<div><h3><a href="#group-identity">Identity: terminal folio</a></h3><ul><li><a href="#command-plate">Command plate</a><span>A shell command on a hue-tinted plate.</span></li><li><a href="#terminal-capture">Terminal capture</a><span>A recorded terminal screen with a status line.</span></li><li><a href="#site-header">Site header</a><span>The ~/name header with project switcher and appearance.</span></li><li><a href="#page-type-and-helpers">Page type and helpers</a><span>Mono headings, steps, definitions, facts, and the footer.</span></li></ul></div>
|
|
849
|
+
</div>
|
|
649
850
|
</section>
|
|
650
851
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
<
|
|
852
|
+
<section class="layer-head" id="group-actions" aria-labelledby="group-actions-title">
|
|
853
|
+
<h2 id="group-actions-title">Actions</h2>
|
|
854
|
+
<p>Start, confirm, or cancel something.</p>
|
|
855
|
+
</section>
|
|
856
|
+
|
|
857
|
+
<section class="component" id="button" data-layer="Core" data-states="hover pressed focus disabled busy" aria-labelledby="button-title">
|
|
858
|
+
<header><h3 id="button-title">Button</h3><span class="badge">Core</span><a href="components.md#button">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="button" aria-label="Copy link to Button" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
859
|
+
<p class="purpose">The main action control: primary, secondary, ghost, danger, and text.</p>
|
|
654
860
|
<div class="row"><h4>Primary</h4><div class="states">
|
|
655
861
|
<div class="state"><button class="btn" type="button"><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg>New monitor</button><span class="caption">Rest</span></div>
|
|
656
862
|
<div class="state" inert><button class="btn is-hover" type="button">New monitor</button><span class="caption">Hover</span></div>
|
|
@@ -698,8 +904,9 @@
|
|
|
698
904
|
</div></div>
|
|
699
905
|
</section>
|
|
700
906
|
|
|
701
|
-
<section class="component" id="quiet-action" data-layer="Core" aria-labelledby="quiet-action-title">
|
|
702
|
-
<header><h3 id="quiet-action-title">Quiet action</h3><span class="badge">Core</span><a href="components.md#quiet-action">Spec</a></header>
|
|
907
|
+
<section class="component" id="quiet-action" data-layer="Core" data-states="hover pressed focus disabled" aria-labelledby="quiet-action-title">
|
|
908
|
+
<header><h3 id="quiet-action-title">Quiet action</h3><span class="badge">Core</span><a href="components.md#quiet-action">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="quiet-action" aria-label="Copy link to Quiet action" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
909
|
+
<p class="purpose">A small transparent action inside a component, such as Copy or Close.</p>
|
|
703
910
|
<p class="note">One recipe for Copy, Full size, dialog and drawer close, and the project trigger. Each component sets only its size and place.</p>
|
|
704
911
|
<div class="row"><h4>Icon</h4><div class="states">
|
|
705
912
|
<div class="state"><button class="quiet-action close" type="button" aria-label="Close"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button><span class="caption">Rest</span></div>
|
|
@@ -716,64 +923,14 @@
|
|
|
716
923
|
</div></div>
|
|
717
924
|
</section>
|
|
718
925
|
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
<
|
|
722
|
-
<div class="row"><h4>Input</h4><div class="states">
|
|
723
|
-
<div class="state"><div class="field"><label class="field-label" for="in-rest">Service</label><input class="input" id="in-rest" placeholder="checkout-api"></div><span class="caption">Rest</span></div>
|
|
724
|
-
<div class="state" inert><div class="field"><label class="field-label" for="in-focus">Service</label><input class="input is-focus" id="in-focus" value="checkout-api"></div><span class="caption">Focus visible</span></div>
|
|
725
|
-
<div class="state" inert><div class="field"><label class="field-label" for="in-disabled">Service</label><input class="input" id="in-disabled" value="checkout-api" disabled></div><span class="caption">Disabled</span></div>
|
|
726
|
-
<div class="state" inert><div class="field"><label class="field-label" for="in-invalid">Service</label><input class="input" id="in-invalid" aria-invalid="true" aria-errormessage="in-invalid-error"><p class="field-error" id="in-invalid-error">Enter a service name.</p></div><span class="caption">Invalid</span></div>
|
|
727
|
-
<div class="state" inert><div class="field"><label class="field-label" for="in-invalid-focus">Service</label><input class="input is-focus" id="in-invalid-focus" aria-invalid="true" aria-errormessage="in-invalid-focus-error"><p class="field-error" id="in-invalid-focus-error">Enter a service name.</p></div><span class="caption">Invalid, focus visible</span></div>
|
|
728
|
-
</div></div>
|
|
729
|
-
<div class="row"><h4>Search</h4><div class="states">
|
|
730
|
-
<div class="state"><label class="search"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input type="search" aria-label="Search monitors" value="latency"></label><span class="caption">Live; focus it to show the clear cross, which darkens on hover</span></div>
|
|
731
|
-
<div class="state" inert><label class="search is-focus"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input type="search" aria-label="Search monitors, focused" value="latency"></label><span class="caption">Focus visible</span></div>
|
|
732
|
-
</div></div>
|
|
733
|
-
<div class="row"><h4>Sizes</h4><div class="states">
|
|
734
|
-
<div class="state" inert><input class="input" data-size="sm" aria-label="Small input" placeholder="Small"><span class="caption">sm</span></div>
|
|
735
|
-
<div class="state" inert><input class="input" data-size="md" aria-label="Medium input" placeholder="Medium"><span class="caption">md</span></div>
|
|
736
|
-
<div class="state" inert><input class="input" data-size="lg" aria-label="Large input" placeholder="Large"><span class="caption">lg</span></div>
|
|
737
|
-
</div></div>
|
|
738
|
-
<div class="row"><h4>Textarea</h4><div class="states">
|
|
739
|
-
<div class="state"><div class="field"><label class="field-label" for="ta-rest">Note</label><textarea class="textarea" id="ta-rest" placeholder="What changed?"></textarea></div><span class="caption">Rest</span></div>
|
|
740
|
-
<div class="state" inert><div class="field"><label class="field-label" for="ta-focus">Note</label><textarea class="textarea is-focus" id="ta-focus">Raised the threshold.</textarea></div><span class="caption">Focus visible</span></div>
|
|
741
|
-
<div class="state" inert><div class="field"><label class="field-label" for="ta-disabled">Note</label><textarea class="textarea" id="ta-disabled" disabled>Raised the threshold.</textarea></div><span class="caption">Disabled</span></div>
|
|
742
|
-
<div class="state" inert><div class="field"><label class="field-label" for="ta-invalid">Note</label><textarea class="textarea" id="ta-invalid" aria-invalid="true" aria-errormessage="ta-invalid-error"></textarea><p class="field-error" id="ta-invalid-error">Add a note.</p></div><span class="caption">Invalid</span></div>
|
|
743
|
-
</div></div>
|
|
744
|
-
</section>
|
|
745
|
-
|
|
746
|
-
<!-- Select -->
|
|
747
|
-
<section class="component" id="select" data-layer="Core" aria-labelledby="select-title">
|
|
748
|
-
<header><h3 id="select-title">Select</h3><span class="badge">Core</span><a href="components.md#select">Spec</a></header>
|
|
749
|
-
<div class="row"><h4>Closed</h4><div class="states">
|
|
750
|
-
<div class="state"><div class="field"><label class="field-label" for="se-rest">Window</label><select class="select" id="se-rest"><option>Last hour</option><option>Last 24 hours</option><option>Last 7 days</option></select></div><span class="caption">Rest</span></div>
|
|
751
|
-
<div class="state" inert><div class="field"><label class="field-label" for="se-focus">Window</label><select class="select is-focus" id="se-focus"><option>Last hour</option></select></div><span class="caption">Focus visible</span></div>
|
|
752
|
-
<div class="state" inert><div class="field"><label class="field-label" for="se-disabled">Window</label><select class="select" id="se-disabled" disabled><option>Last hour</option></select></div><span class="caption">Disabled</span></div>
|
|
753
|
-
<div class="state" inert><div class="field"><label class="field-label" for="se-invalid">Window</label><select class="select" id="se-invalid" aria-invalid="true" aria-errormessage="se-invalid-error"><option></option></select><p class="field-error" id="se-invalid-error">Choose a window.</p></div><span class="caption">Invalid</span></div>
|
|
754
|
-
</div></div>
|
|
755
|
-
<div class="row"><h4>Sizes</h4><div class="states">
|
|
756
|
-
<div class="state" inert><select class="select" data-size="sm" aria-label="Small select"><option>Small</option></select><span class="caption">sm</span></div>
|
|
757
|
-
<div class="state" inert><select class="select" data-size="md" aria-label="Medium select"><option>Medium</option></select><span class="caption">md</span></div>
|
|
758
|
-
<div class="state" inert><select class="select" data-size="lg" aria-label="Large select"><option>Large</option></select><span class="caption">lg</span></div>
|
|
759
|
-
</div></div>
|
|
760
|
-
<div class="row"><h4>Open picker</h4><div class="states">
|
|
761
|
-
<div class="state" inert aria-hidden="true"><ul class="picker"><li>Last hour</li><li class="is-hover">Last 24 hours</li><li aria-selected="true">Last 7 days</li></ul><span class="caption">A static drawing: hover on one option, another checked</span></div>
|
|
762
|
-
</div></div>
|
|
763
|
-
</section>
|
|
764
|
-
|
|
765
|
-
<!-- Field wrapper -->
|
|
766
|
-
<section class="component" id="field-wrapper" data-layer="Core" aria-labelledby="fieldw-title">
|
|
767
|
-
<header><h3 id="fieldw-title">Field wrapper</h3><span class="badge">Core</span><a href="components.md#field-wrapper">Spec</a></header>
|
|
768
|
-
<div class="row"><h4>Description and error</h4><div class="states">
|
|
769
|
-
<div class="state"><div class="field"><label class="field-label" for="fw-desc">Threshold</label><input class="input" id="fw-desc" inputmode="numeric" value="300" aria-describedby="fw-desc-text"><p class="field-description" id="fw-desc-text">Milliseconds at p95.</p></div><span class="caption">With description</span></div>
|
|
770
|
-
<div class="state" inert><div class="field"><label class="field-label" for="fw-error">Threshold</label><input class="input" id="fw-error" value="-1" aria-invalid="true" aria-errormessage="fw-error-text"><p class="field-error" id="fw-error-text">Enter a positive number.</p></div><span class="caption">Error replaces the description</span></div>
|
|
771
|
-
</div></div>
|
|
926
|
+
<section class="layer-head" id="group-selection" aria-labelledby="group-selection-title">
|
|
927
|
+
<h2 id="group-selection-title">Selection</h2>
|
|
928
|
+
<p>Choose options or turn something on.</p>
|
|
772
929
|
</section>
|
|
773
930
|
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
<
|
|
931
|
+
<section class="component" id="checkbox-and-radio" data-layer="Core" data-states="selected focus disabled" aria-labelledby="check-title">
|
|
932
|
+
<header><h3 id="check-title">Checkbox and radio</h3><span class="badge">Core</span><a href="components.md#checkbox-and-radio">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="checkbox-and-radio" aria-label="Copy link to Checkbox and radio" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
933
|
+
<p class="purpose">Pick several options, or one from a short list.</p>
|
|
777
934
|
<div class="row"><h4>Checkbox</h4><div class="states">
|
|
778
935
|
<div class="state"><label class="check"><input type="checkbox">Notify on recovery</label><span class="caption">Rest</span></div>
|
|
779
936
|
<div class="state" inert><label class="check"><input type="checkbox" checked>Notify on recovery</label><span class="caption">Checked</span></div>
|
|
@@ -793,9 +950,9 @@
|
|
|
793
950
|
</div></div>
|
|
794
951
|
</section>
|
|
795
952
|
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
<
|
|
953
|
+
<section class="component" id="radio-card-group" data-layer="Core" data-states="hover selected focus disabled" aria-labelledby="rc-title">
|
|
954
|
+
<header><h3 id="rc-title">Radio card group</h3><span class="badge">Core</span><a href="components.md#radio-card-group">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="radio-card-group" aria-label="Copy link to Radio card group" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
955
|
+
<p class="purpose">Pick one option that needs a description.</p>
|
|
799
956
|
<div class="row"><h4>Live</h4><div class="states">
|
|
800
957
|
<div class="state wide"><fieldset class="radio-cards"><legend class="sr-only">Delivery</legend><label class="radio-card"><input type="radio" name="delivery" checked><strong>Immediate</strong><span class="muted">Send each alert.</span></label><label class="radio-card"><input type="radio" name="delivery"><strong>Digest</strong><span class="muted">Group the alerts.</span></label></fieldset><span class="caption">Rest; Immediate is selected</span></div>
|
|
801
958
|
</div></div>
|
|
@@ -805,9 +962,9 @@
|
|
|
805
962
|
</div></div>
|
|
806
963
|
</section>
|
|
807
964
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
<
|
|
965
|
+
<section class="component" id="switch" data-layer="Core" data-states="selected focus disabled" aria-labelledby="switch-title">
|
|
966
|
+
<header><h3 id="switch-title">Switch</h3><span class="badge">Core</span><a href="components.md#switch">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="switch" aria-label="Copy link to Switch" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
967
|
+
<p class="purpose">Turn a setting on or off at once.</p>
|
|
811
968
|
<div class="row"><h4>States</h4><div class="states">
|
|
812
969
|
<div class="state"><div class="switch-row"><button class="switch" id="sw-rest" type="button" role="switch" aria-checked="false" aria-labelledby="sw-rest-label"><span class="switch-track" aria-hidden="true"></span></button><label id="sw-rest-label" for="sw-rest">Alerts</label></div><span class="caption">Off, live</span></div>
|
|
813
970
|
<div class="state" inert><div class="switch-row"><button class="switch" id="sw-on" type="button" role="switch" aria-checked="true" aria-labelledby="sw-on-label"><span class="switch-track" aria-hidden="true"></span></button><label id="sw-on-label" for="sw-on">Alerts</label></div><span class="caption">On</span></div>
|
|
@@ -822,9 +979,9 @@
|
|
|
822
979
|
</div></div>
|
|
823
980
|
</section>
|
|
824
981
|
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
<
|
|
982
|
+
<section class="component" id="toggle-button" data-layer="Core" data-states="hover pressed focus disabled" aria-labelledby="toggle-title">
|
|
983
|
+
<header><h3 id="toggle-title">Toggle button</h3><span class="badge">Core</span><a href="components.md#toggle-button">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="toggle-button" aria-label="Copy link to Toggle button" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
984
|
+
<p class="purpose">A labelled card that latches on, with a switch inside.</p>
|
|
828
985
|
<div class="row"><h4>States</h4><div class="states">
|
|
829
986
|
<div class="state"><button class="toggle" type="button" aria-pressed="false" data-live-toggle><span class="toggle-track" aria-hidden="true"></span><span class="toggle-text">Wrap lines<small>Long lines fold</small></span></button><span class="caption">Rest, live</span></div>
|
|
830
987
|
<div class="state" inert><button class="toggle is-hover" type="button" aria-pressed="false"><span class="toggle-track" aria-hidden="true"></span><span class="toggle-text">Wrap lines</span></button><span class="caption">Hover</span></div>
|
|
@@ -839,9 +996,9 @@
|
|
|
839
996
|
</div></div>
|
|
840
997
|
</section>
|
|
841
998
|
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
<
|
|
999
|
+
<section class="component" id="segmented-control" data-layer="Core" data-states="hover pressed focus disabled" aria-labelledby="seg-title">
|
|
1000
|
+
<header><h3 id="seg-title">Segmented control</h3><span class="badge">Core</span><a href="components.md#segmented-control">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="segmented-control" aria-label="Copy link to Segmented control" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1001
|
+
<p class="purpose">Two to five short options that apply at once.</p>
|
|
845
1002
|
<p class="note">The live control glides its thumb between options: 260ms for the leading edge, 300ms for the trailing edge. The theme picker at the top uses the same script, and it does not glide when the page loads a saved choice.</p>
|
|
846
1003
|
<div class="row"><h4>Text</h4><div class="states">
|
|
847
1004
|
<div class="state"><div class="segmented" role="group" aria-label="View" data-live><button type="button" aria-pressed="true">List</button><button type="button" aria-pressed="false">Board</button><button type="button" aria-pressed="false">Timeline</button></div><span class="caption">Rest, live</span></div>
|
|
@@ -856,9 +1013,69 @@
|
|
|
856
1013
|
</div></div>
|
|
857
1014
|
</section>
|
|
858
1015
|
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
<
|
|
1016
|
+
<section class="layer-head" id="group-inputs" aria-labelledby="group-inputs-title">
|
|
1017
|
+
<h2 id="group-inputs-title">Inputs</h2>
|
|
1018
|
+
<p>Enter text and values.</p>
|
|
1019
|
+
</section>
|
|
1020
|
+
|
|
1021
|
+
<section class="component" id="text-input-and-textarea" data-layer="Core" data-states="focus disabled invalid" aria-labelledby="input-title">
|
|
1022
|
+
<header><h3 id="input-title">Text input and textarea</h3><span class="badge">Core</span><a href="components.md#text-input-and-textarea">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="text-input-and-textarea" aria-label="Copy link to Text input and textarea" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1023
|
+
<p class="purpose">Type a short value or a longer note.</p>
|
|
1024
|
+
<div class="row"><h4>Input</h4><div class="states">
|
|
1025
|
+
<div class="state"><div class="field"><label class="field-label" for="in-rest">Service</label><input class="input" id="in-rest" placeholder="checkout-api"></div><span class="caption">Rest</span></div>
|
|
1026
|
+
<div class="state" inert><div class="field"><label class="field-label" for="in-focus">Service</label><input class="input is-focus" id="in-focus" value="checkout-api"></div><span class="caption">Focus visible</span></div>
|
|
1027
|
+
<div class="state" inert><div class="field"><label class="field-label" for="in-disabled">Service</label><input class="input" id="in-disabled" value="checkout-api" disabled></div><span class="caption">Disabled</span></div>
|
|
1028
|
+
<div class="state" inert><div class="field"><label class="field-label" for="in-invalid">Service</label><input class="input" id="in-invalid" aria-invalid="true" aria-errormessage="in-invalid-error"><p class="field-error" id="in-invalid-error">Enter a service name.</p></div><span class="caption">Invalid</span></div>
|
|
1029
|
+
<div class="state" inert><div class="field"><label class="field-label" for="in-invalid-focus">Service</label><input class="input is-focus" id="in-invalid-focus" aria-invalid="true" aria-errormessage="in-invalid-focus-error"><p class="field-error" id="in-invalid-focus-error">Enter a service name.</p></div><span class="caption">Invalid, focus visible</span></div>
|
|
1030
|
+
</div></div>
|
|
1031
|
+
<div class="row"><h4>Search</h4><div class="states">
|
|
1032
|
+
<div class="state"><label class="search"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input type="search" aria-label="Search monitors" value="latency"></label><span class="caption">Live; focus it to show the clear cross, which darkens on hover</span></div>
|
|
1033
|
+
<div class="state" inert><label class="search is-focus"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input type="search" aria-label="Search monitors, focused" value="latency"></label><span class="caption">Focus visible</span></div>
|
|
1034
|
+
</div></div>
|
|
1035
|
+
<div class="row"><h4>Sizes</h4><div class="states">
|
|
1036
|
+
<div class="state" inert><input class="input" data-size="sm" aria-label="Small input" placeholder="Small"><span class="caption">sm</span></div>
|
|
1037
|
+
<div class="state" inert><input class="input" data-size="md" aria-label="Medium input" placeholder="Medium"><span class="caption">md</span></div>
|
|
1038
|
+
<div class="state" inert><input class="input" data-size="lg" aria-label="Large input" placeholder="Large"><span class="caption">lg</span></div>
|
|
1039
|
+
</div></div>
|
|
1040
|
+
<div class="row"><h4>Textarea</h4><div class="states">
|
|
1041
|
+
<div class="state"><div class="field"><label class="field-label" for="ta-rest">Note</label><textarea class="textarea" id="ta-rest" placeholder="What changed?"></textarea></div><span class="caption">Rest</span></div>
|
|
1042
|
+
<div class="state" inert><div class="field"><label class="field-label" for="ta-focus">Note</label><textarea class="textarea is-focus" id="ta-focus">Raised the threshold.</textarea></div><span class="caption">Focus visible</span></div>
|
|
1043
|
+
<div class="state" inert><div class="field"><label class="field-label" for="ta-disabled">Note</label><textarea class="textarea" id="ta-disabled" disabled>Raised the threshold.</textarea></div><span class="caption">Disabled</span></div>
|
|
1044
|
+
<div class="state" inert><div class="field"><label class="field-label" for="ta-invalid">Note</label><textarea class="textarea" id="ta-invalid" aria-invalid="true" aria-errormessage="ta-invalid-error"></textarea><p class="field-error" id="ta-invalid-error">Add a note.</p></div><span class="caption">Invalid</span></div>
|
|
1045
|
+
</div></div>
|
|
1046
|
+
</section>
|
|
1047
|
+
|
|
1048
|
+
<section class="component" id="select" data-layer="Core" data-states="focus disabled invalid" aria-labelledby="select-title">
|
|
1049
|
+
<header><h3 id="select-title">Select</h3><span class="badge">Core</span><a href="components.md#select">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="select" aria-label="Copy link to Select" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1050
|
+
<p class="purpose">Choose from a longer list.</p>
|
|
1051
|
+
<div class="row"><h4>Closed</h4><div class="states">
|
|
1052
|
+
<div class="state"><div class="field"><label class="field-label" for="se-rest">Window</label><select class="select" id="se-rest"><option>Last hour</option><option>Last 24 hours</option><option>Last 7 days</option></select></div><span class="caption">Rest</span></div>
|
|
1053
|
+
<div class="state" inert><div class="field"><label class="field-label" for="se-focus">Window</label><select class="select is-focus" id="se-focus"><option>Last hour</option></select></div><span class="caption">Focus visible</span></div>
|
|
1054
|
+
<div class="state" inert><div class="field"><label class="field-label" for="se-disabled">Window</label><select class="select" id="se-disabled" disabled><option>Last hour</option></select></div><span class="caption">Disabled</span></div>
|
|
1055
|
+
<div class="state" inert><div class="field"><label class="field-label" for="se-invalid">Window</label><select class="select" id="se-invalid" aria-invalid="true" aria-errormessage="se-invalid-error"><option></option></select><p class="field-error" id="se-invalid-error">Choose a window.</p></div><span class="caption">Invalid</span></div>
|
|
1056
|
+
</div></div>
|
|
1057
|
+
<div class="row"><h4>Sizes</h4><div class="states">
|
|
1058
|
+
<div class="state" inert><select class="select" data-size="sm" aria-label="Small select"><option>Small</option></select><span class="caption">sm</span></div>
|
|
1059
|
+
<div class="state" inert><select class="select" data-size="md" aria-label="Medium select"><option>Medium</option></select><span class="caption">md</span></div>
|
|
1060
|
+
<div class="state" inert><select class="select" data-size="lg" aria-label="Large select"><option>Large</option></select><span class="caption">lg</span></div>
|
|
1061
|
+
</div></div>
|
|
1062
|
+
<div class="row"><h4>Open picker</h4><div class="states">
|
|
1063
|
+
<div class="state" inert aria-hidden="true"><ul class="picker"><li>Last hour</li><li class="is-hover">Last 24 hours</li><li aria-selected="true">Last 7 days</li></ul><span class="caption">A static drawing: hover on one option, another checked</span></div>
|
|
1064
|
+
</div></div>
|
|
1065
|
+
</section>
|
|
1066
|
+
|
|
1067
|
+
<section class="component" id="field-wrapper" data-layer="Core" data-states="invalid" aria-labelledby="fieldw-title">
|
|
1068
|
+
<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>
|
|
1069
|
+
<p class="purpose">Label, description, and error text around a field.</p>
|
|
1070
|
+
<div class="row"><h4>Description and error</h4><div class="states">
|
|
1071
|
+
<div class="state"><div class="field"><label class="field-label" for="fw-desc">Threshold</label><input class="input" id="fw-desc" inputmode="numeric" value="300" aria-describedby="fw-desc-text"><p class="field-description" id="fw-desc-text">Milliseconds at p95.</p></div><span class="caption">With description</span></div>
|
|
1072
|
+
<div class="state" inert><div class="field"><label class="field-label" for="fw-error">Threshold</label><input class="input" id="fw-error" value="-1" aria-invalid="true" aria-errormessage="fw-error-text"><p class="field-error" id="fw-error-text">Enter a positive number.</p></div><span class="caption">Error replaces the description</span></div>
|
|
1073
|
+
</div></div>
|
|
1074
|
+
</section>
|
|
1075
|
+
|
|
1076
|
+
<section class="component" id="slider" data-layer="Core" data-states="focus disabled" aria-labelledby="slider-title">
|
|
1077
|
+
<header><h3 id="slider-title">Slider</h3><span class="badge">Core</span><a href="components.md#slider">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="slider" aria-label="Copy link to Slider" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1078
|
+
<p class="purpose">Set a value in a range.</p>
|
|
862
1079
|
<div class="row"><h4>States</h4><div class="states">
|
|
863
1080
|
<div class="state"><div class="field"><label class="field-label" for="sl-rest">Sample rate</label><input class="range" id="sl-rest" type="range" min="0" max="100" value="40" style="--value:40%" data-live-range></div><span class="caption">Rest, live</span></div>
|
|
864
1081
|
<div class="state" inert><input class="range is-focus" type="range" aria-label="Sample rate, focused" min="0" max="100" value="60" style="--value:60%"><span class="caption">Focus visible</span></div>
|
|
@@ -871,9 +1088,14 @@
|
|
|
871
1088
|
</div></div>
|
|
872
1089
|
</section>
|
|
873
1090
|
|
|
874
|
-
|
|
1091
|
+
<section class="layer-head" id="group-feedback" aria-labelledby="group-feedback-title">
|
|
1092
|
+
<h2 id="group-feedback-title">Feedback and status</h2>
|
|
1093
|
+
<p>Show state, progress, and caveats.</p>
|
|
1094
|
+
</section>
|
|
1095
|
+
|
|
875
1096
|
<section class="component" id="progress" data-layer="Core" aria-labelledby="progress-title">
|
|
876
|
-
<header><h3 id="progress-title">Progress</h3><span class="badge">Core</span><a href="components.md#progress">Spec</a></header>
|
|
1097
|
+
<header><h3 id="progress-title">Progress</h3><span class="badge">Core</span><a href="components.md#progress">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="progress" aria-label="Copy link to Progress" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1098
|
+
<p class="purpose">Show how far a task has got.</p>
|
|
877
1099
|
<div class="row"><h4>Values</h4><div class="states">
|
|
878
1100
|
<div class="state"><div class="progress" role="progressbar" aria-label="Import, empty" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span style="transform:translateX(-100%)"></span></div><span class="caption">0%</span></div>
|
|
879
1101
|
<div class="state"><div class="progress" role="progressbar" aria-label="Import" aria-valuemin="0" aria-valuemax="100" aria-valuenow="40"><span style="transform:translateX(-60%)"></span></div><span class="caption">40%</span></div>
|
|
@@ -881,35 +1103,18 @@
|
|
|
881
1103
|
</div></div>
|
|
882
1104
|
</section>
|
|
883
1105
|
|
|
884
|
-
<!-- Score -->
|
|
885
1106
|
<section class="component" id="score" data-layer="Core" aria-labelledby="score-title">
|
|
886
|
-
<header><h3 id="score-title">Score</h3><span class="badge">Core</span><a href="components.md#score">Spec</a></header>
|
|
1107
|
+
<header><h3 id="score-title">Score</h3><span class="badge">Core</span><a href="components.md#score">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="score" aria-label="Copy link to Score" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1108
|
+
<p class="purpose">Show a value out of a maximum.</p>
|
|
887
1109
|
<div class="row"><h4>Values</h4><div class="states">
|
|
888
1110
|
<div class="state"><span class="score"><span class="pips" aria-hidden="true"><i class="on"></i><i class="on"></i><i class="on"></i><i></i><i></i></span><b>3<span>/5</span></b></span><span class="caption">3 of 5</span></div>
|
|
889
1111
|
<div class="state"><span class="score"><span class="pips" aria-hidden="true"><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i></span><b>5<span>/5</span></b></span><span class="caption">5 of 5</span></div>
|
|
890
1112
|
</div></div>
|
|
891
1113
|
</section>
|
|
892
1114
|
|
|
893
|
-
<!-- Tabs -->
|
|
894
|
-
<section class="component" id="tabs" data-layer="Core" aria-labelledby="tabs-title">
|
|
895
|
-
<header><h3 id="tabs-title">Tabs</h3><span class="badge">Core</span><a href="components.md#tabs">Spec</a></header>
|
|
896
|
-
<div class="row"><h4>Live</h4><div class="states">
|
|
897
|
-
<div class="state wide" data-tabs data-label="Monitor">
|
|
898
|
-
<!-- Without JavaScript every panel shows under its heading; the script builds the tab list. -->
|
|
899
|
-
<section class="tabpanel" id="panel-overview" aria-labelledby="panel-overview-heading"><h5 class="tabs-heading" id="panel-overview-heading">Overview</h5><p>Arrow keys move between tabs; Home and End jump to the ends.</p></section>
|
|
900
|
-
<section class="tabpanel" id="panel-history" aria-labelledby="panel-history-heading"><h5 class="tabs-heading" id="panel-history-heading">History</h5><p>Seven days of evaluations.</p></section>
|
|
901
|
-
<section class="tabpanel" id="panel-settings" aria-labelledby="panel-settings-heading"><h5 class="tabs-heading" id="panel-settings-heading">Settings</h5><p>Threshold and notification settings.</p></section>
|
|
902
|
-
</div>
|
|
903
|
-
</div></div>
|
|
904
|
-
<div class="row"><h4>Pinned</h4><div class="states">
|
|
905
|
-
<div class="state" inert><div class="tablist" role="tablist" aria-label="Monitor, hover"><button class="tab" type="button" role="tab" aria-selected="true">Overview</button><button class="tab is-hover" type="button" role="tab" aria-selected="false">History</button></div><span class="caption">Hover on History</span></div>
|
|
906
|
-
<div class="state" inert><div class="tablist" role="tablist" aria-label="Monitor, focus"><button class="tab is-focus" type="button" role="tab" aria-selected="true">Overview</button><button class="tab" type="button" role="tab" aria-selected="false">History</button></div><span class="caption">Focus visible</span></div>
|
|
907
|
-
</div></div>
|
|
908
|
-
</section>
|
|
909
|
-
|
|
910
|
-
<!-- Badge -->
|
|
911
1115
|
<section class="component" id="badge" data-layer="Core" aria-labelledby="badge-title">
|
|
912
|
-
<header><h3 id="badge-title">Badge</h3><span class="badge">Core</span><a href="components.md#badge">Spec</a></header>
|
|
1116
|
+
<header><h3 id="badge-title">Badge</h3><span class="badge">Core</span><a href="components.md#badge">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="badge" aria-label="Copy link to Badge" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1117
|
+
<p class="purpose">A short status label.</p>
|
|
913
1118
|
<div class="row"><h4>Tones</h4><div class="states">
|
|
914
1119
|
<div class="state"><span class="badge">No data</span><span class="caption">Neutral</span></div>
|
|
915
1120
|
<div class="state"><span class="badge success">Healthy</span><span class="caption">Success</span></div>
|
|
@@ -919,9 +1124,9 @@
|
|
|
919
1124
|
</div></div>
|
|
920
1125
|
</section>
|
|
921
1126
|
|
|
922
|
-
<!-- Alert -->
|
|
923
1127
|
<section class="component" id="alert" data-layer="Core" aria-labelledby="alert-title">
|
|
924
|
-
<header><h3 id="alert-title">Alert</h3><span class="badge">Core</span><a href="components.md#alert">Spec</a></header>
|
|
1128
|
+
<header><h3 id="alert-title">Alert</h3><span class="badge">Core</span><a href="components.md#alert">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="alert" aria-label="Copy link to Alert" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1129
|
+
<p class="purpose">A real caveat or status message in the page.</p>
|
|
925
1130
|
<div class="row"><h4>Tones</h4><div class="states">
|
|
926
1131
|
<div class="state wide"><div class="alert"><svg class="icon" aria-hidden="true"><use href="#i-help"/></svg><p>Values are sampled every 5 minutes.</p></div><span class="caption">Neutral</span></div>
|
|
927
1132
|
<div class="state wide"><div class="alert success"><svg class="icon" aria-hidden="true"><use href="#i-check"/></svg><p>The monitor recovered at 14:20.</p></div><span class="caption">Success</span></div>
|
|
@@ -931,9 +1136,14 @@
|
|
|
931
1136
|
</div></div>
|
|
932
1137
|
</section>
|
|
933
1138
|
|
|
934
|
-
|
|
1139
|
+
<section class="layer-head" id="group-containers" aria-labelledby="group-containers-title">
|
|
1140
|
+
<h2 id="group-containers-title">Containers and overlays</h2>
|
|
1141
|
+
<p>Group content, or lay a task over the page.</p>
|
|
1142
|
+
</section>
|
|
1143
|
+
|
|
935
1144
|
<section class="component" id="surface-and-card" data-layer="Core" aria-labelledby="card-title">
|
|
936
|
-
<header><h3 id="card-title">Surface and card</h3><span class="badge">Core</span><a href="components.md#surface-and-card">Spec</a></header>
|
|
1145
|
+
<header><h3 id="card-title">Surface and card</h3><span class="badge">Core</span><a href="components.md#surface-and-card">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="surface-and-card" aria-label="Copy link to Surface and card" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1146
|
+
<p class="purpose">Panels and cards for parallel, comparable content.</p>
|
|
937
1147
|
<div class="row"><h4>Card</h4><div class="states">
|
|
938
1148
|
<div class="state wide"><article class="card" aria-labelledby="card-sample-title"><div class="card-head"><h4 id="card-sample-title">API p95 latency</h4><span class="badge danger">Alerting</span></div><div class="card-body">412 ms against a 300 ms threshold for 10 minutes.</div><div class="card-foot"><span>checkout-api</span><span>Updated 2 minutes ago</span></div></article><span class="caption">Header, body, and footer</span></div>
|
|
939
1149
|
</div></div>
|
|
@@ -943,15 +1153,15 @@
|
|
|
943
1153
|
</div></div>
|
|
944
1154
|
</section>
|
|
945
1155
|
|
|
946
|
-
<!-- Figure -->
|
|
947
1156
|
<section class="component" id="figure" data-layer="Core" aria-labelledby="figure-title">
|
|
948
|
-
<header><h3 id="figure-title">Figure</h3><span class="badge">Core</span><a href="components.md#figure">Spec</a></header>
|
|
1157
|
+
<header><h3 id="figure-title">Figure</h3><span class="badge">Core</span><a href="components.md#figure">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="figure" aria-label="Copy link to Figure" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1158
|
+
<p class="purpose">An image or diagram with a caption.</p>
|
|
949
1159
|
<figure class="figure"><div class="figure-plate"><div class="cluster" style="display:flex;gap:var(--space-2);flex-wrap:wrap"><span class="badge success">Healthy</span><span class="badge warning">Warning</span><span class="badge danger">Alerting</span></div></div><figcaption><b>Figure 1.</b> A well with its caption below.</figcaption></figure>
|
|
950
1160
|
</section>
|
|
951
1161
|
|
|
952
|
-
<!-- Dialog -->
|
|
953
1162
|
<section class="component" id="dialog" data-layer="Core" aria-labelledby="dialog-title">
|
|
954
|
-
<header><h3 id="dialog-title">Dialog</h3><span class="badge">Core</span><a href="components.md#dialog">Spec</a></header>
|
|
1163
|
+
<header><h3 id="dialog-title">Dialog</h3><span class="badge">Core</span><a href="components.md#dialog">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="dialog" aria-label="Copy link to Dialog" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1164
|
+
<p class="purpose">A modal task that needs an answer before the page continues.</p>
|
|
955
1165
|
<div class="row"><h4>Live</h4><div class="states">
|
|
956
1166
|
<div class="state"><button class="btn secondary" type="button" data-open="live-dialog">Open dialog</button><span class="caption">Opens a native modal dialog</span></div>
|
|
957
1167
|
</div></div>
|
|
@@ -960,37 +1170,125 @@
|
|
|
960
1170
|
</div></div>
|
|
961
1171
|
</section>
|
|
962
1172
|
|
|
963
|
-
<!-- Drawer -->
|
|
964
1173
|
<section class="component" id="drawer" data-layer="Core" aria-labelledby="drawer-title">
|
|
965
|
-
<header><h3 id="drawer-title">Drawer</h3><span class="badge">Core</span><a href="components.md#drawer">Spec</a></header>
|
|
1174
|
+
<header><h3 id="drawer-title">Drawer</h3><span class="badge">Core</span><a href="components.md#drawer">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="drawer" aria-label="Copy link to Drawer" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1175
|
+
<p class="purpose">A side panel, such as phone navigation.</p>
|
|
966
1176
|
<div class="row"><h4>Live</h4><div class="states">
|
|
967
|
-
<div class="state"><button class="btn secondary menu-glyph" type="button" data-size="lg" data-open="live-drawer">Contents</button><span class="caption">
|
|
1177
|
+
<div class="state"><button class="btn secondary menu-glyph" type="button" data-size="lg" data-open="live-drawer">Contents</button><span class="caption">Rest, live: a page’s contents trigger opens a side drawer</span></div>
|
|
968
1178
|
</div></div>
|
|
969
1179
|
<div class="row"><h4>In place</h4><div class="states">
|
|
970
|
-
<div class="state wide" inert><div class="drawer" role="dialog" aria-labelledby="drw-static-title"><div class="drawer-head"><h4 id="drw-static-title">Contents</h4><button class="quiet-action close" type="button" aria-label="Close drawer"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></div><div class="drawer-body"><nav class="navlist" aria-label="Contents, static"><a href="#button" aria-current="
|
|
1180
|
+
<div class="state wide" inert><div class="drawer" role="dialog" aria-labelledby="drw-static-title"><div class="drawer-head"><h4 id="drw-static-title">Contents</h4><button class="quiet-action close" type="button" aria-label="Close drawer"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></div><div class="drawer-body"><nav class="navlist" aria-label="Contents, static"><a href="#button" aria-current="location">Button</a><a href="#select">Select</a><a href="#switch">Switch</a></nav></div></div><span class="caption">Open, pinned; Button is the current section</span></div>
|
|
971
1181
|
</div></div>
|
|
972
1182
|
</section>
|
|
973
1183
|
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
<
|
|
1184
|
+
<section class="layer-head" id="group-navigation" aria-labelledby="group-navigation-title">
|
|
1185
|
+
<h2 id="group-navigation-title">Navigation</h2>
|
|
1186
|
+
<p>Move between pages and sections, and find things.</p>
|
|
1187
|
+
</section>
|
|
1188
|
+
|
|
1189
|
+
<section class="component" id="navigation-list" data-layer="Core" data-states="hover selected focus" aria-labelledby="nav-title">
|
|
1190
|
+
<header><h3 id="nav-title">Navigation list</h3><span class="badge">Core</span><a href="components.md#navigation-list">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="navigation-list" aria-label="Copy link to Navigation list" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1191
|
+
<p class="purpose">Rows of links with current page and current location.</p>
|
|
977
1192
|
<div class="row"><h4>Rows</h4><div class="states">
|
|
978
|
-
<div class="state"><nav class="navlist" aria-label="Sample routes"><span class="group-label">Guides</span><a href="
|
|
979
|
-
<div class="state" inert><nav class="navlist" aria-label="Sample routes, pinned"><a href="#navigation-list" class="is-hover">Hover</a><a href="
|
|
1193
|
+
<div class="state"><nav class="navlist" aria-label="Sample routes"><span class="group-label">Guides</span><a href="components.html" aria-current="page">Install</a><a href="#navigation-list">Configure</a><a href="#navigation-list">Release</a></nav><span class="caption">Live; Install is the current page</span></div>
|
|
1194
|
+
<div class="state" inert><nav class="navlist" aria-label="Sample routes, pinned"><a href="#navigation-list" class="is-hover">Hover</a><a href="components.html" aria-current="page" class="is-hover">Current page, hover</a><a href="#navigation-list" aria-current="location">Current location</a><a href="#navigation-list" class="is-focus">Focus visible</a></nav><span class="caption">Hover, current page with hover, current location, and focus visible</span></div>
|
|
980
1195
|
</div></div>
|
|
981
|
-
<div class="row"><h4>
|
|
982
|
-
<div class="state" inert><button class="btn secondary
|
|
983
|
-
<div class="state" inert><button class="btn secondary menu-glyph
|
|
984
|
-
<div class="state"
|
|
1196
|
+
<div class="row"><h4>Drawer triggers</h4><div class="states">
|
|
1197
|
+
<div class="state" inert><div class="section-bar"><button class="btn secondary" type="button" data-size="lg" aria-label="Menu"><svg class="icon" aria-hidden="true"><use href="#i-menu"/></svg></button></div><span class="caption">Rest: the site shell’s Menu button, in the header row; see Section rail</span></div>
|
|
1198
|
+
<div class="state" inert><button class="btn secondary menu-glyph" type="button" data-size="lg">On this page</button><span class="caption">Rest: a page’s own contents drawer, such as a docs page’s On this page</span></div>
|
|
1199
|
+
<div class="state" inert><button class="btn secondary menu-glyph is-active" type="button" data-size="lg">On this page</button><span class="caption">Pressed: the page’s contents trigger</span></div>
|
|
1200
|
+
<div class="state"><details class="rail-details"><summary class="btn secondary rail-summary" data-size="lg">On this page</summary><nav class="navlist" aria-label="On this page, no JavaScript"><a href="#navigation-list" aria-current="location">Rows</a><a href="#code-block">Next section</a></nav></details><span class="caption">Live: the contents trigger’s no-JavaScript fallback</span></div>
|
|
985
1201
|
</div></div>
|
|
986
1202
|
<div class="row"><h4>List selection</h4><div class="states">
|
|
987
1203
|
<div class="state wide" inert><div class="rows" role="listbox" aria-label="Monitors"><div role="option" aria-selected="false">Active consumers</div><div role="option" aria-selected="false">5xx error rate</div><div role="option" aria-selected="true">API p95 latency</div><div role="option" aria-selected="false" class="is-hover">Request volume</div></div><span class="caption">Selected row, and hover on the next</span></div>
|
|
988
1204
|
</div></div>
|
|
989
1205
|
</section>
|
|
990
1206
|
|
|
991
|
-
|
|
1207
|
+
<section class="component" id="section-rail" data-layer="Core" aria-labelledby="section-rail-title">
|
|
1208
|
+
<header><h3 id="section-rail-title">Section rail</h3><span class="badge">Core</span><a href="components.md#section-rail">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="section-rail" aria-label="Copy link to Section rail" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1209
|
+
<p class="purpose">A sticky list of sections that moves into a drawer on phones.</p>
|
|
1210
|
+
<div class="row"><h4>Desktop rail</h4><div class="states">
|
|
1211
|
+
<div class="state"><div class="rail-specimen"><div class="find"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input class="input" type="search" aria-label="Find a component, specimen" placeholder="Find a component"><kbd class="key" aria-hidden="true">/</kbd></div>
|
|
1212
|
+
<nav class="navlist" aria-label="Rail specimen"><span class="group-label">Inputs</span><a href="#section-rail">Select</a><a href="#section-rail" aria-current="location">Slider</a><a href="#section-rail">Field wrapper</a></nav></div><span class="caption">Live; Slider is the current section</span></div>
|
|
1213
|
+
<div class="state" inert><div class="rail-specimen"><nav class="navlist" aria-label="Collapsible specimen"><button class="group-toggle" type="button" aria-expanded="true"><span>Inputs</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></button><a href="#section-rail">Select</a><a href="#section-rail">Slider</a><button class="group-toggle" type="button" aria-expanded="false"><span>Feedback</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></button></nav></div><span class="caption">Collapsible groups: Inputs open, Feedback closed</span></div>
|
|
1214
|
+
</div></div>
|
|
1215
|
+
<div class="row"><h4>Phone header</h4><div class="states">
|
|
1216
|
+
<div class="state wide" inert><div class="phone-head"><p class="site-name">Design system</p><div class="section-bar"><button class="btn secondary" type="button" data-size="lg" aria-label="Find a component"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg></button><button class="btn secondary" type="button" data-size="lg" aria-label="Menu"><svg class="icon" aria-hidden="true"><use href="#i-menu"/></svg></button></div></div><span class="caption">Rest: the sticky header row at tablet width, with Find and Menu</span></div>
|
|
1217
|
+
</div></div>
|
|
1218
|
+
</section>
|
|
1219
|
+
|
|
1220
|
+
<section class="component" id="find-field" data-layer="Core" aria-labelledby="find-field-title">
|
|
1221
|
+
<header><h3 id="find-field-title">Find field</h3><span class="badge">Core</span><a href="components.md#find-field">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="find-field" aria-label="Copy link to Find field" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1222
|
+
<p class="purpose">Filter a navigation list as you type.</p>
|
|
1223
|
+
<div class="row"><h4>States</h4><div class="states">
|
|
1224
|
+
<div class="state"><div class="find"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input class="input" type="search" aria-label="Find a component, rest specimen" placeholder="Find a component"><kbd class="key" aria-hidden="true">/</kbd></div><span class="caption">Rest, live; the key hint shows the shortcut</span></div>
|
|
1225
|
+
<div class="state" inert><div class="find"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input class="input is-focus" type="search" aria-label="Find a component, focus specimen" value="tog"></div><span class="find-count">3 matches</span><span class="caption">Focus visible with a query; the hint hides</span></div>
|
|
1226
|
+
<div class="state" inert><div class="find-empty"><p>No component matches <q>tooltip</q>.</p><button class="btn text" type="button">Clear</button></div><span class="caption">No matches</span></div>
|
|
1227
|
+
<div class="state" inert><div class="find"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input class="input" type="search" aria-label="Find a component, shortcuts off specimen" placeholder="Find a component"></div><span class="caption">Rest, shortcuts off: no hint</span></div>
|
|
1228
|
+
</div></div>
|
|
1229
|
+
</section>
|
|
1230
|
+
|
|
1231
|
+
<section class="component" id="breadcrumbs" data-layer="Core" aria-labelledby="breadcrumbs-title">
|
|
1232
|
+
<header><h3 id="breadcrumbs-title">Breadcrumbs</h3><span class="badge">Core</span><a href="components.md#breadcrumbs">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="breadcrumbs" aria-label="Copy link to Breadcrumbs" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1233
|
+
<p class="purpose">The path from the site to this page.</p>
|
|
1234
|
+
<div class="row"><h4>Trail</h4><div class="states">
|
|
1235
|
+
<div class="state"><nav class="crumbs" aria-label="Breadcrumb, specimen"><ol><li><a href="#breadcrumbs">Design system</a></li><li><a href="#breadcrumbs">Components</a></li><li><span aria-current="page">Navigation</span></li></ol></nav><span class="caption">Rest, live; the current page is text</span></div>
|
|
1236
|
+
<div class="state" inert><nav class="crumbs" aria-label="Breadcrumb, pinned"><ol><li><a href="#breadcrumbs" class="is-hover">Design system</a></li><li><a href="#breadcrumbs" class="is-focus">Components</a></li><li><span aria-current="page">Navigation</span></li></ol></nav><span class="caption">Hover on Design system, focus visible on Components</span></div>
|
|
1237
|
+
<div class="state" inert><nav class="crumbs is-back" aria-label="Breadcrumb, phone"><ol><li><a href="#breadcrumbs">Design system</a></li><li><a href="#breadcrumbs">Components</a></li><li><span aria-current="page">Navigation</span></li></ol></nav><span class="caption">Phone: the parent only, as a back link</span></div>
|
|
1238
|
+
</div></div>
|
|
1239
|
+
</section>
|
|
1240
|
+
|
|
1241
|
+
<section class="component" id="pager" data-layer="Core" aria-labelledby="pager-title">
|
|
1242
|
+
<header><h3 id="pager-title">Pager</h3><span class="badge">Core</span><a href="components.md#pager">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="pager" aria-label="Copy link to Pager" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1243
|
+
<p class="purpose">Previous and next pages in a sequence.</p>
|
|
1244
|
+
<div class="row"><h4>Sequence</h4><div class="states">
|
|
1245
|
+
<div class="state wide"><nav class="pager" aria-label="Pages, specimen"><a href="#pager" rel="prev"><span class="pager-dir"><svg class="icon" aria-hidden="true"><use href="#i-arrow-left"/></svg>Previous</span><span class="pager-title">Foundations</span></a><a href="#pager" rel="next"><span class="pager-dir">Next<svg class="icon" aria-hidden="true"><use href="#i-arrow-right"/></svg></span><span class="pager-title">Application example</span></a></nav><span class="caption">Rest, live; previous and next</span></div>
|
|
1246
|
+
<div class="state wide" inert><nav class="pager" aria-label="Pages, pinned"><a href="#pager" rel="next" class="is-hover"><span class="pager-dir">Next<svg class="icon" aria-hidden="true"><use href="#i-arrow-right"/></svg></span><span class="pager-title">Components</span></a></nav><span class="caption">First page: next only, still at the end; hover</span></div>
|
|
1247
|
+
</div></div>
|
|
1248
|
+
</section>
|
|
1249
|
+
|
|
1250
|
+
<section class="component" id="tabs" data-layer="Core" data-states="hover selected focus" aria-labelledby="tabs-title">
|
|
1251
|
+
<header><h3 id="tabs-title">Tabs</h3><span class="badge">Core</span><a href="components.md#tabs">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="tabs" aria-label="Copy link to Tabs" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1252
|
+
<p class="purpose">Switch panels about one object, without leaving the page.</p>
|
|
1253
|
+
<div class="row"><h4>Live</h4><div class="states">
|
|
1254
|
+
<div class="state wide" data-tabs data-label="Monitor">
|
|
1255
|
+
<!-- Without JavaScript every panel shows under its heading; the script builds the tab list. -->
|
|
1256
|
+
<section class="tabpanel" id="panel-overview" aria-labelledby="panel-overview-heading"><h5 class="tabs-heading" id="panel-overview-heading">Overview</h5><p>Arrow keys move between tabs; Home and End jump to the ends.</p></section>
|
|
1257
|
+
<section class="tabpanel" id="panel-history" aria-labelledby="panel-history-heading"><h5 class="tabs-heading" id="panel-history-heading">History</h5><p>Seven days of evaluations.</p></section>
|
|
1258
|
+
<section class="tabpanel" id="panel-settings" aria-labelledby="panel-settings-heading"><h5 class="tabs-heading" id="panel-settings-heading">Settings</h5><p>Threshold and notification settings.</p></section>
|
|
1259
|
+
<span class="caption">Live; Overview is selected</span>
|
|
1260
|
+
</div>
|
|
1261
|
+
</div></div>
|
|
1262
|
+
<div class="row"><h4>Pinned</h4><div class="states">
|
|
1263
|
+
<div class="state" inert><div class="tablist" role="tablist" aria-label="Monitor, hover"><button class="tab" type="button" role="tab" aria-selected="true">Overview</button><button class="tab is-hover" type="button" role="tab" aria-selected="false">History</button></div><span class="caption">Hover on History</span></div>
|
|
1264
|
+
<div class="state" inert><div class="tablist" role="tablist" aria-label="Monitor, focus"><button class="tab is-focus" type="button" role="tab" aria-selected="true">Overview</button><button class="tab" type="button" role="tab" aria-selected="false">History</button></div><span class="caption">Focus visible</span></div>
|
|
1265
|
+
</div></div>
|
|
1266
|
+
</section>
|
|
1267
|
+
|
|
1268
|
+
<section class="component" id="skip-link" data-layer="Core" aria-labelledby="skip-link-title">
|
|
1269
|
+
<header><h3 id="skip-link-title">Skip link</h3><span class="badge">Core</span><a href="components.md#skip-link">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="skip-link" aria-label="Copy link to Skip link" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1270
|
+
<p class="purpose">Jump past the header to the content.</p>
|
|
1271
|
+
<div class="row"><h4>Focused</h4><div class="states">
|
|
1272
|
+
<div class="state" inert><a class="skip is-focus" href="#main">Skip to content</a><span class="caption">Focus visible; hidden above the page until focused</span></div>
|
|
1273
|
+
</div></div>
|
|
1274
|
+
</section>
|
|
1275
|
+
|
|
1276
|
+
<section class="component" id="keyboard-key" data-layer="Core" aria-labelledby="keyboard-key-title">
|
|
1277
|
+
<header><h3 id="keyboard-key-title">Keyboard key</h3><span class="badge">Core</span><a href="components.md#keyboard-key">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="keyboard-key" aria-label="Copy link to Keyboard key" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1278
|
+
<p class="purpose">Show a key or shortcut in text.</p>
|
|
1279
|
+
<div class="row"><h4>Keys</h4><div class="states">
|
|
1280
|
+
<div class="state"><p class="note">Press <kbd class="key">/</kbd> to find, <kbd class="key">Esc</kbd> to clear, and <kbd class="key">Enter</kbd> to go to the first match.</p><span class="caption">Rest, in running text</span></div>
|
|
1281
|
+
</div></div>
|
|
1282
|
+
</section>
|
|
1283
|
+
|
|
1284
|
+
<section class="layer-head" id="group-code" aria-labelledby="group-code-title">
|
|
1285
|
+
<h2 id="group-code-title">Code and examples</h2>
|
|
1286
|
+
<p>Show source and live examples.</p>
|
|
1287
|
+
</section>
|
|
1288
|
+
|
|
992
1289
|
<section class="component" id="code-block" data-layer="Core" aria-labelledby="code-title">
|
|
993
|
-
<header><h3 id="code-title">Code block</h3><span class="badge">Core</span><a href="components.md#code-block">Spec</a></header>
|
|
1290
|
+
<header><h3 id="code-title">Code block</h3><span class="badge">Core</span><a href="components.md#code-block">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="code-block" aria-label="Copy link to Code block" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1291
|
+
<p class="purpose">Source code with an optional header and Copy, and a live example above it.</p>
|
|
994
1292
|
<div class="row"><h4>Source well</h4><div class="states">
|
|
995
1293
|
<div class="state wide"><div class="code"><div class="code-head"><b>monitor.ts</b><span class="lang">TypeScript</span><button class="quiet-action copy" type="button" data-copy="code-src"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg>Copy</button></div><pre tabindex="0" role="region" aria-label="monitor.ts"><code id="code-src"><span class="line"><span class="ln">1</span><span><span class="k">const</span> threshold = <span class="n">300</span> <span class="c">// ms at p95</span></span></span><span class="line"><span class="ln">2</span><span><span class="k">export const</span> name = <span class="s">'API p95 latency'</span></span></span></code></pre></div><span class="caption">Header, line numbers, and Copy, live</span></div>
|
|
996
1294
|
<div class="state wide" inert><div class="code compact"><pre><code><span class="line"><span>import { threshold } from './monitor'</span></span></code></pre><button class="quiet-action copy is-focus" type="button" aria-label="Copy import"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></div><span class="caption">Compact, with focus visible on Copy</span></div>
|
|
@@ -1001,15 +1299,14 @@
|
|
|
1001
1299
|
<p class="sr-only" role="status" id="copy-status"></p>
|
|
1002
1300
|
</section>
|
|
1003
1301
|
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
<
|
|
1007
|
-
<p>The personal sites' own look. A new project replaces these with its own identity and keeps the core.</p>
|
|
1302
|
+
<section class="layer-head" id="group-identity" aria-labelledby="group-identity-title">
|
|
1303
|
+
<h2 id="group-identity-title">Identity: terminal folio</h2>
|
|
1304
|
+
<p>The personal sites’ look. A new project replaces these with its own.</p>
|
|
1008
1305
|
</section>
|
|
1009
1306
|
|
|
1010
|
-
<!-- Command plate -->
|
|
1011
1307
|
<section class="component" id="command-plate" data-layer="Identity" aria-labelledby="cmd-title">
|
|
1012
|
-
<header><h3 id="cmd-title">Command plate</h3><span class="badge">Identity</span><a href="components.md#command-plate">Spec</a></header>
|
|
1308
|
+
<header><h3 id="cmd-title">Command plate</h3><span class="badge">Identity</span><a href="components.md#command-plate">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="command-plate" aria-label="Copy link to Command plate" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1309
|
+
<p class="purpose">A shell command on a hue-tinted plate.</p>
|
|
1013
1310
|
<div class="row"><h4>Commands</h4><div class="states">
|
|
1014
1311
|
<div class="state wide"><div class="code command compact"><pre tabindex="0" role="region" aria-label="Install command"><code id="cmd-install"><span class="line"><span>brew install filipgutica/tap/filip-stack</span></span></code></pre><button class="quiet-action copy" type="button" data-copy="cmd-install" aria-label="Copy install command"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></div><span class="caption">Compact, live; the <code>$</code> is drawn by CSS</span></div>
|
|
1015
1312
|
<div class="state wide"><div class="code command"><div class="code-head"><b>Set up</b><button class="quiet-action copy" type="button" data-copy="cmd-setup"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg>Copy</button></div><pre tabindex="0" role="region" aria-label="Set up commands"><code id="cmd-setup"><span class="line"><span>pnpm install --frozen-lockfile</span></span><span class="line"><span>pnpm check</span></span></code></pre></div><span class="caption">With a header, two lines</span></div>
|
|
@@ -1017,9 +1314,9 @@
|
|
|
1017
1314
|
</div></div>
|
|
1018
1315
|
</section>
|
|
1019
1316
|
|
|
1020
|
-
<!-- Terminal capture -->
|
|
1021
1317
|
<section class="component" id="terminal-capture" data-layer="Identity" aria-labelledby="capture-title">
|
|
1022
|
-
<header><h3 id="capture-title">Terminal capture</h3><span class="badge">Identity</span><a href="components.md#terminal-capture">Spec</a></header>
|
|
1318
|
+
<header><h3 id="capture-title">Terminal capture</h3><span class="badge">Identity</span><a href="components.md#terminal-capture">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="terminal-capture" aria-label="Copy link to Terminal capture" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1319
|
+
<p class="purpose">A recorded terminal screen with a status line.</p>
|
|
1023
1320
|
<div class="capture" data-tabs data-label="Captures">
|
|
1024
1321
|
<!-- The script adds the tab list and the Full size button; without it every capture is listed. -->
|
|
1025
1322
|
<div class="capture-head" hidden><button class="quiet-action full" type="button" data-full-size><svg class="icon" aria-hidden="true"><use href="#i-expand"/></svg>Full size</button></div>
|
|
@@ -1029,48 +1326,72 @@
|
|
|
1029
1326
|
</div>
|
|
1030
1327
|
</section>
|
|
1031
1328
|
|
|
1032
|
-
<!-- Site header -->
|
|
1033
1329
|
<section class="component" id="site-header" data-layer="Identity" aria-labelledby="header-title">
|
|
1034
|
-
<header><h3 id="header-title">Site header</h3><span class="badge">Identity</span><a href="components.md#site-header">Spec</a></header>
|
|
1330
|
+
<header><h3 id="header-title">Site header</h3><span class="badge">Identity</span><a href="components.md#site-header">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="site-header" aria-label="Copy link to Site header" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1331
|
+
<p class="purpose">The ~/name header with project switcher and appearance.</p>
|
|
1035
1332
|
<div class="row"><h4>Closed</h4><div class="states">
|
|
1036
1333
|
<div class="state wide"><div class="site-header">
|
|
1037
|
-
<details class="projects"><summary class="quiet-action" aria-label="Project: filip-stack"><span>filip-stack</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></summary><nav class="navlist" aria-label="Projects"><a href="#site-header">annoterm</a><a href="
|
|
1038
|
-
<div class="site-end"><nav class="site-links" aria-label="Site links"><a href="
|
|
1334
|
+
<details class="projects"><summary class="quiet-action" aria-label="Project: filip-stack"><span>filip-stack</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></summary><nav class="navlist" aria-label="Projects"><a href="#site-header">annoterm</a><a href="components.html" aria-current="page">filip-stack</a><a href="#site-header">ui</a></nav></details>
|
|
1335
|
+
<div class="site-end"><nav class="navlist strip site-links" aria-label="Site links"><a href="components.html" aria-current="page">Docs</a><a href="#site-header">GitHub</a></nav>
|
|
1039
1336
|
<div class="segmented" role="group" aria-label="Color theme, sample" data-size="lg" data-icon-only><button type="button" aria-pressed="true" aria-label="System" title="System"><svg class="icon" aria-hidden="true" viewBox="0 0 16 16"><rect x="2" y="2.5" width="12" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11v3"/></svg></button><button type="button" aria-pressed="false" aria-label="Light" title="Light"><svg class="icon" aria-hidden="true" viewBox="0 0 16 16"><circle cx="8" cy="8" r="3"/><path d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1 1M11.6 11.6l1 1M3.4 12.6l1-1M11.6 4.4l1-1"/></svg></button><button type="button" aria-pressed="false" aria-label="Dark" title="Dark"><svg class="icon" aria-hidden="true" viewBox="0 0 16 16"><path d="M13 9.5A5.5 5.5 0 0 1 6.5 3a5.5 5.5 0 1 0 6.5 6.5z"/></svg></button></div>
|
|
1040
1337
|
</div>
|
|
1041
|
-
</div><span class="caption">Live: the project switcher opens; the picker is a sample</span></div>
|
|
1338
|
+
</div><span class="caption">Live: the project switcher opens, and Docs is the current page; the picker is a sample</span></div>
|
|
1042
1339
|
</div></div>
|
|
1043
1340
|
<div class="row"><h4>Open menu</h4><div class="states">
|
|
1044
|
-
<div class="state" inert><details class="projects is-open" open><summary class="quiet-action" aria-label="Project: filip-stack, open"><span>filip-stack</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></summary><nav class="navlist" aria-label="Projects, pinned"><a href="#site-header" class="is-hover">annoterm</a><a href="
|
|
1341
|
+
<div class="state" inert><details class="projects is-open" open><summary class="quiet-action" aria-label="Project: filip-stack, open"><span>filip-stack</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></summary><nav class="navlist" aria-label="Projects, pinned"><a href="#site-header" class="is-hover">annoterm</a><a href="components.html" aria-current="page">filip-stack</a><a href="#site-header">ui</a></nav></details><span class="caption">Menu open, hover on annoterm</span></div>
|
|
1045
1342
|
</div></div>
|
|
1046
1343
|
</section>
|
|
1047
1344
|
|
|
1048
|
-
<!-- Page type and helpers -->
|
|
1049
1345
|
<section class="component" id="page-type-and-helpers" data-layer="Identity" aria-labelledby="page-type-title">
|
|
1050
|
-
<header><h3 id="page-type-title">Page type and helpers</h3><span class="badge">Identity</span><a href="components.md#page-type-and-helpers">Spec</a></header>
|
|
1346
|
+
<header><h3 id="page-type-title">Page type and helpers</h3><span class="badge">Identity</span><a href="components.md#page-type-and-helpers">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="page-type-and-helpers" aria-label="Copy link to Page type and helpers" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1347
|
+
<p class="purpose">Mono headings, steps, definitions, facts, and the footer.</p>
|
|
1051
1348
|
<div class="row"><h4>Headings</h4><div class="states">
|
|
1052
1349
|
<div class="state wide"><p class="folio-display">~/annoterm</p><span class="caption">Display title, mono</span></div>
|
|
1053
1350
|
<div class="state wide"><p class="folio-h2">Install</p><span class="caption">Section heading with its <code>##</code> mark</span></div>
|
|
1054
1351
|
</div></div>
|
|
1055
1352
|
<div class="row"><h4>Steps</h4><div class="states">
|
|
1056
|
-
<div class="state wide"><ol class="steps"><li><h4>Install the CLI</h4><p>Homebrew installs the launcher.</p></li><li><h4>Apply host config</h4><p>It copies the guidance and the design language.</p></li></ol></div>
|
|
1353
|
+
<div class="state wide"><ol class="steps"><li><h4>Install the CLI</h4><p>Homebrew installs the launcher.</p></li><li><h4>Apply host config</h4><p>It copies the guidance and the design language.</p></li></ol><span class="caption">Rest: two steps</span></div>
|
|
1057
1354
|
</div></div>
|
|
1058
1355
|
<div class="row"><h4>Facts</h4><div class="states">
|
|
1059
|
-
<div class="state wide"><dl class="facts"><div><dt>Installed to</dt><dd>~/design-language</dd></div><div><dt>Source</dt><dd>host-config/design-language</dd></div></dl></div>
|
|
1356
|
+
<div class="state wide"><dl class="facts"><div><dt>Installed to</dt><dd>~/design-language</dd></div><div><dt>Source</dt><dd>host-config/design-language</dd></div></dl><span class="caption">Rest: two facts</span></div>
|
|
1060
1357
|
</div></div>
|
|
1061
1358
|
<div class="row"><h4>Definitions</h4><div class="states">
|
|
1062
|
-
<div class="state wide"><dl class="definitions"><dt><code>--all</code></dt><dd>Apply every target, including skipped ones.</dd><dt><code>--home</code></dt><dd>Install into another home directory.</dd></dl></div>
|
|
1063
|
-
</div></div>
|
|
1064
|
-
<div class="row"><h4>Skip link</h4><div class="states">
|
|
1065
|
-
<div class="state" inert><a class="skip is-focus" href="#title">Skip to content</a><span class="caption">Focus visible; hidden until focused</span></div>
|
|
1359
|
+
<div class="state wide"><dl class="definitions"><dt><code>--all</code></dt><dd>Apply every target, including skipped ones.</dd><dt><code>--home</code></dt><dd>Install into another home directory.</dd></dl><span class="caption">Rest: two terms</span></div>
|
|
1066
1360
|
</div></div>
|
|
1067
1361
|
<div class="row"><h4>Command list</h4><div class="states">
|
|
1068
|
-
<div class="state wide"><table class="cmdlist"><thead><tr><th scope="col">Command</th><th scope="col">Use it for</th><td></td></tr></thead><tbody><tr><td><code id="cl-status">filip-stack status</code></td><td>Compare host files with the repository.</td><td><button class="quiet-action copy" type="button" data-copy="cl-status" aria-label="Copy filip-stack status"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></td></tr><tr><td><code id="cl-apply">filip-stack apply</code></td><td>Install the current host config.</td><td><button class="quiet-action copy" type="button" data-copy="cl-apply" aria-label="Copy filip-stack apply"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></td></tr></tbody></table></div>
|
|
1362
|
+
<div class="state wide"><table class="cmdlist"><thead><tr><th scope="col">Command</th><th scope="col">Use it for</th><td></td></tr></thead><tbody><tr><td><code id="cl-status">filip-stack status</code></td><td>Compare host files with the repository.</td><td><button class="quiet-action copy" type="button" data-copy="cl-status" aria-label="Copy filip-stack status"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></td></tr><tr><td><code id="cl-apply">filip-stack apply</code></td><td>Install the current host config.</td><td><button class="quiet-action copy" type="button" data-copy="cl-apply" aria-label="Copy filip-stack apply"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></td></tr></tbody></table><span class="caption">Rest: two commands</span></div>
|
|
1069
1363
|
</div></div>
|
|
1070
1364
|
<div class="row"><h4>Footer</h4><div class="states">
|
|
1071
|
-
<div class="state wide"><div class="site-footer"><a href="#page-type-and-helpers">Made by Filip</a><nav aria-label="Projects, footer"><a href="#page-type-and-helpers">annoterm</a><a href="#page-type-and-helpers">ui</a></nav></div></div>
|
|
1365
|
+
<div class="state wide"><div class="site-footer"><a href="#page-type-and-helpers">Made by Filip</a><nav aria-label="Projects, footer"><a href="#page-type-and-helpers">annoterm</a><a href="#page-type-and-helpers">ui</a></nav></div><span class="caption">Rest</span></div>
|
|
1072
1366
|
</div></div>
|
|
1073
1367
|
</section>
|
|
1368
|
+
|
|
1369
|
+
<section class="layer-head" id="state-coverage" aria-labelledby="coverage-title">
|
|
1370
|
+
<h2 id="coverage-title">Control states</h2>
|
|
1371
|
+
<p>The interactive states each control’s spec defines. Selected covers checked, on, and current. Components with no interactive states are left out.</p>
|
|
1372
|
+
</section>
|
|
1373
|
+
<div class="coverage-wrap" tabindex="0" role="region" aria-label="Control states table">
|
|
1374
|
+
<table class="coverage">
|
|
1375
|
+
<thead><tr><th scope="col">Component</th><th scope="col">Hover</th><th scope="col">Pressed</th><th scope="col">Selected</th><th scope="col">Focus</th><th scope="col">Disabled</th><th scope="col">Busy</th><th scope="col">Invalid</th></tr></thead>
|
|
1376
|
+
<tbody>
|
|
1377
|
+
<tr data-for="button"><th scope="row"><a href="#button">Button</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 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></tr>
|
|
1378
|
+
<tr data-for="quiet-action"><th scope="row"><a href="#quiet-action">Quiet action</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>
|
|
1379
|
+
<tr data-for="checkbox-and-radio"><th scope="row"><a href="#checkbox-and-radio">Checkbox and radio</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 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 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>
|
|
1380
|
+
<tr data-for="radio-card-group"><th scope="row"><a href="#radio-card-group">Radio card group</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 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>
|
|
1381
|
+
<tr data-for="switch"><th scope="row"><a href="#switch">Switch</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 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 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>
|
|
1382
|
+
<tr data-for="toggle-button"><th scope="row"><a href="#toggle-button">Toggle button</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>
|
|
1383
|
+
<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>
|
|
1384
|
+
<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>
|
|
1385
|
+
<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>
|
|
1386
|
+
<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>
|
|
1387
|
+
<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>
|
|
1388
|
+
<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>
|
|
1389
|
+
<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>
|
|
1390
|
+
</tbody>
|
|
1391
|
+
</table>
|
|
1392
|
+
</div>
|
|
1393
|
+
|
|
1394
|
+
<nav class="pager" aria-label="Design system pages"><a href="reference.html#foundations" rel="prev"><span class="pager-dir"><svg class="icon" aria-hidden="true"><use href="#i-arrow-left"/></svg>Previous</span><span class="pager-title">Foundations</span></a><a href="reference.html" rel="next"><span class="pager-dir">Next<svg class="icon" aria-hidden="true"><use href="#i-arrow-right"/></svg></span><span class="pager-title">Application example</span></a></nav>
|
|
1074
1395
|
</main>
|
|
1075
1396
|
</div>
|
|
1076
1397
|
</div>
|
|
@@ -1086,7 +1407,11 @@
|
|
|
1086
1407
|
</dialog>
|
|
1087
1408
|
<dialog class="drawer" id="live-drawer" aria-labelledby="live-drawer-title">
|
|
1088
1409
|
<div class="drawer-head"><h4 id="live-drawer-title">Contents</h4><form method="dialog"><button class="quiet-action close" type="submit" aria-label="Close drawer"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></form></div>
|
|
1089
|
-
<div class="drawer-body"><nav class="navlist" aria-label="Contents"><a href="#button">Button</a><a href="#segmented-control">Segmented control</a><a href="#navigation-list" aria-current="
|
|
1410
|
+
<div class="drawer-body"><nav class="navlist" aria-label="Contents"><a href="#button">Button</a><a href="#segmented-control">Segmented control</a><a href="#navigation-list" aria-current="location">Navigation list</a></nav></div>
|
|
1411
|
+
</dialog>
|
|
1412
|
+
<dialog class="drawer" id="nav-drawer" aria-labelledby="nav-drawer-title">
|
|
1413
|
+
<div class="drawer-head"><h4 id="nav-drawer-title">Menu</h4><form method="dialog"><button class="quiet-action close" type="submit" aria-label="Close menu"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></form></div>
|
|
1414
|
+
<div class="drawer-body" id="nav-drawer-body"></div>
|
|
1090
1415
|
</dialog>
|
|
1091
1416
|
|
|
1092
1417
|
<script>
|
|
@@ -1132,8 +1457,10 @@
|
|
|
1132
1457
|
return press;
|
|
1133
1458
|
};
|
|
1134
1459
|
|
|
1135
|
-
//
|
|
1136
|
-
|
|
1460
|
+
// Appearance: System removes the attribute so prefers-color-scheme decides. The control needs the
|
|
1461
|
+
// script, so it shows only once the script runs.
|
|
1462
|
+
const themeGroup = document.querySelector('[aria-label="Appearance"]');
|
|
1463
|
+
themeGroup.hidden = false;
|
|
1137
1464
|
const pressTheme = segmented(themeGroup, (b) => {
|
|
1138
1465
|
const choice = b.dataset.themeChoice;
|
|
1139
1466
|
if (choice === 'system') root.removeAttribute('data-theme'); else root.setAttribute('data-theme', choice);
|
|
@@ -1151,6 +1478,17 @@
|
|
|
1151
1478
|
// Slider fill follows the value.
|
|
1152
1479
|
document.querySelectorAll('[data-live-range]').forEach((r) => r.addEventListener('input', () => r.style.setProperty('--value', `${r.value}%`)));
|
|
1153
1480
|
|
|
1481
|
+
// A list that scrolls sideways names its clipped ends in data-clip, so CSS fades only those edges.
|
|
1482
|
+
const trackClip = (list) => {
|
|
1483
|
+
const clip = () => {
|
|
1484
|
+
const hidden = list.scrollWidth - list.clientWidth;
|
|
1485
|
+
const ends = [list.scrollLeft > 1 && 'start', list.scrollLeft < hidden - 1 && 'end'].filter(Boolean).join(' ');
|
|
1486
|
+
if (ends) list.dataset.clip = ends; else delete list.dataset.clip;
|
|
1487
|
+
};
|
|
1488
|
+
list.addEventListener('scroll', clip, { passive: true });
|
|
1489
|
+
new ResizeObserver(clip).observe(list);
|
|
1490
|
+
};
|
|
1491
|
+
|
|
1154
1492
|
// Tabs: progressive enhancement. Each panel starts visible under its heading; the script builds
|
|
1155
1493
|
// the tab list from the headings, applies tab roles, and hides the headings and other panels.
|
|
1156
1494
|
document.querySelectorAll('[data-tabs]').forEach((box) => {
|
|
@@ -1177,20 +1515,44 @@
|
|
|
1177
1515
|
});
|
|
1178
1516
|
const head = box.querySelector('.capture-head');
|
|
1179
1517
|
if (head) { head.prepend(list); head.hidden = false; } else box.prepend(list);
|
|
1180
|
-
|
|
1181
|
-
const hidden = list.scrollWidth - list.clientWidth;
|
|
1182
|
-
const ends = [list.scrollLeft > 1 && 'start', list.scrollLeft < hidden - 1 && 'end'].filter(Boolean).join(' ');
|
|
1183
|
-
if (ends) list.dataset.clip = ends; else delete list.dataset.clip;
|
|
1184
|
-
};
|
|
1185
|
-
list.addEventListener('scroll', clip, { passive: true });
|
|
1186
|
-
new ResizeObserver(clip).observe(list);
|
|
1518
|
+
trackClip(list);
|
|
1187
1519
|
box.dataset.enhanced = 'true';
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1520
|
+
// A change of tab glides the fill as the segmented thumb does: the new fill starts at the old fill's
|
|
1521
|
+
// edges, read before the selection changes, and CSS animates each edge home. Edges are kept in the
|
|
1522
|
+
// list's scroll space, because a key press can scroll the list. The first selection does not glide.
|
|
1523
|
+
let glide = 0;
|
|
1524
|
+
const x = (px) => px - list.getBoundingClientRect().left + list.scrollLeft;
|
|
1525
|
+
const clearGlide = () => { delete list.dataset.slide; list.style.removeProperty('--slide-left'); list.style.removeProperty('--slide-right'); };
|
|
1526
|
+
const select = (tab) => {
|
|
1527
|
+
const from = tabs.find((t) => t.getAttribute('aria-selected') === 'true');
|
|
1528
|
+
let edges;
|
|
1529
|
+
if (from && from !== tab && !reduced.matches) {
|
|
1530
|
+
// An interrupted glide starts from where its fill is now.
|
|
1531
|
+
const fill = getComputedStyle(from, '::before');
|
|
1532
|
+
const a = from.getBoundingClientRect();
|
|
1533
|
+
edges = [x(a.left + parseFloat(fill.left)), x(a.right - parseFloat(fill.right))];
|
|
1534
|
+
}
|
|
1535
|
+
tabs.forEach((t) => {
|
|
1536
|
+
const on = t === tab;
|
|
1537
|
+
t.setAttribute('aria-selected', String(on));
|
|
1538
|
+
t.tabIndex = on ? 0 : -1;
|
|
1539
|
+
document.getElementById(t.getAttribute('aria-controls')).hidden = !on;
|
|
1540
|
+
});
|
|
1541
|
+
if (!edges) return;
|
|
1542
|
+
clearGlide();
|
|
1543
|
+
const b = tab.getBoundingClientRect();
|
|
1544
|
+
const [left, right] = edges;
|
|
1545
|
+
list.style.setProperty('--slide-left', `${left - x(b.left)}px`);
|
|
1546
|
+
list.style.setProperty('--slide-right', `${x(b.right) - right}px`);
|
|
1547
|
+
const direction = x(b.left) + x(b.right) > left + right ? 'right' : 'left';
|
|
1548
|
+
list.dataset.slide = direction;
|
|
1549
|
+
const id = ++glide;
|
|
1550
|
+
const end = () => { if (id === glide) clearGlide(); };
|
|
1551
|
+
requestAnimationFrame(() => {
|
|
1552
|
+
const trailing = list.getAnimations({ subtree: true }).find((a) => a.animationName === (direction === 'right' ? 'glide-left' : 'glide-right'));
|
|
1553
|
+
if (trailing) trailing.finished.then(end, end); else end();
|
|
1554
|
+
});
|
|
1555
|
+
};
|
|
1194
1556
|
select(tabs[0]);
|
|
1195
1557
|
tabs.forEach((t, i) => {
|
|
1196
1558
|
t.addEventListener('click', () => select(t));
|
|
@@ -1272,12 +1634,229 @@
|
|
|
1272
1634
|
menu.addEventListener('focusout', (e) => { if (!menu.contains(e.relatedTarget)) menu.open = false; });
|
|
1273
1635
|
});
|
|
1274
1636
|
|
|
1275
|
-
//
|
|
1276
|
-
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1637
|
+
// ---------- Catalogue shell: header strip, rail, Find, shortcuts, location, phone drawer ----------
|
|
1638
|
+
// Header strip: start scrolled to the current page, and fade only the edges that hide links.
|
|
1639
|
+
const strip = document.querySelector('.page-head .navlist.strip');
|
|
1640
|
+
const here = strip.querySelector('[aria-current="page"]');
|
|
1641
|
+
if (here && strip.scrollWidth > strip.clientWidth) strip.scrollLeft = here.offsetLeft - (strip.clientWidth - here.offsetWidth) / 2;
|
|
1642
|
+
trackClip(strip);
|
|
1643
|
+
|
|
1644
|
+
// Each skip link moves focus to its target (main, or the rail's list), which takes tabindex="-1" only then.
|
|
1645
|
+
const main = document.getElementById('main');
|
|
1646
|
+
document.querySelectorAll('body > a.skip').forEach((skip) => skip.addEventListener('click', () => {
|
|
1647
|
+
const target = document.getElementById(skip.hash.slice(1));
|
|
1648
|
+
target.tabIndex = -1;
|
|
1649
|
+
target.focus({ preventScroll: true });
|
|
1650
|
+
}));
|
|
1651
|
+
|
|
1652
|
+
const rail = document.getElementById('rail');
|
|
1653
|
+
const railHome = rail.parentElement;
|
|
1654
|
+
const list = rail.querySelector('.rail-list');
|
|
1655
|
+
const links = [...list.querySelectorAll('a[href^="#"]')];
|
|
1656
|
+
const railGroups = [...list.querySelectorAll('.navlist')];
|
|
1657
|
+
const find = document.getElementById('find');
|
|
1658
|
+
const findCount = document.getElementById('find-count');
|
|
1659
|
+
const empty = document.getElementById('find-empty');
|
|
1660
|
+
const bar = document.getElementById('section-bar');
|
|
1661
|
+
const drawer = document.getElementById('nav-drawer');
|
|
1662
|
+
const drawerBody = document.getElementById('nav-drawer-body');
|
|
1663
|
+
const tablet = matchMedia('(max-width: 800px)');
|
|
1664
|
+
// Find and the shortcut switch need the script, so they show only once it runs.
|
|
1665
|
+
rail.querySelector('.rail-find').hidden = false;
|
|
1666
|
+
rail.querySelector('.rail-foot').hidden = false;
|
|
1667
|
+
|
|
1668
|
+
// Scrolls a list so a row sits at its centre. It sets the list's own scrollTop, so the page never moves.
|
|
1669
|
+
const centre = (box, row) => {
|
|
1670
|
+
const a = box.getBoundingClientRect();
|
|
1671
|
+
const b = row.getBoundingClientRect();
|
|
1672
|
+
box.scrollTop += b.top - a.top - a.height / 2 + b.height / 2;
|
|
1673
|
+
};
|
|
1674
|
+
|
|
1675
|
+
// Find filters the rail only, never the page, so deep links and the page order stay stable. Every word
|
|
1676
|
+
// must appear in a row's terms. The count is announced after a pause.
|
|
1677
|
+
let announce;
|
|
1678
|
+
const filter = () => {
|
|
1679
|
+
const query = find.value.trim().toLowerCase();
|
|
1680
|
+
const words = query.split(/\s+/).filter(Boolean);
|
|
1681
|
+
let shown = 0;
|
|
1682
|
+
links.forEach((a) => {
|
|
1683
|
+
const match = words.every((w) => a.dataset.terms.includes(w));
|
|
1684
|
+
a.hidden = !match;
|
|
1685
|
+
if (match) shown += 1;
|
|
1686
|
+
});
|
|
1687
|
+
railGroups.forEach((g) => { g.hidden = !g.querySelector('a:not([hidden])'); });
|
|
1688
|
+
empty.hidden = shown > 0;
|
|
1689
|
+
empty.querySelector('q').textContent = find.value.trim();
|
|
1690
|
+
clearTimeout(announce);
|
|
1691
|
+
announce = setTimeout(() => {
|
|
1692
|
+
findCount.textContent = query ? (shown ? `${shown} ${shown === 1 ? 'match' : 'matches'}` : 'No matches') : '';
|
|
1693
|
+
}, 500);
|
|
1694
|
+
};
|
|
1695
|
+
// Goes to a row's destination and focuses it. In the drawer the click closes it, and the drawer moves focus.
|
|
1696
|
+
const go = (link) => {
|
|
1697
|
+
link.click();
|
|
1698
|
+
if (drawer.open) return;
|
|
1699
|
+
const target = document.getElementById(link.hash.slice(1));
|
|
1700
|
+
if (!target.hasAttribute('tabindex')) target.tabIndex = -1;
|
|
1701
|
+
target.focus({ preventScroll: true });
|
|
1702
|
+
};
|
|
1703
|
+
find.addEventListener('input', filter);
|
|
1704
|
+
find.addEventListener('keydown', (e) => {
|
|
1705
|
+
const first = links.find((a) => !a.hidden);
|
|
1706
|
+
if (e.key === 'Escape') {
|
|
1707
|
+
// The first Escape clears the query; the next one leaves the field, or closes the drawer.
|
|
1708
|
+
if (find.value) { e.preventDefault(); find.value = ''; filter(); } else if (!drawer.open) find.blur();
|
|
1709
|
+
} else if (e.key === 'Enter' && first) { e.preventDefault(); go(first); }
|
|
1710
|
+
else if (e.key === 'ArrowDown' && first) { e.preventDefault(); first.focus(); }
|
|
1711
|
+
});
|
|
1712
|
+
document.getElementById('find-clear').addEventListener('click', () => { find.value = ''; filter(); find.focus(); });
|
|
1713
|
+
|
|
1714
|
+
// Single-key shortcut: / focuses Find. WCAG 2.1.4 needs a way to turn it off, so a saved switch does.
|
|
1715
|
+
const shortcutSwitch = document.getElementById('shortcut-switch');
|
|
1716
|
+
const hint = rail.querySelector('.find > .key');
|
|
1717
|
+
let shortcuts = true;
|
|
1718
|
+
try { shortcuts = localStorage.getItem('dl-shortcuts') !== 'off'; } catch (e) { /* Storage is blocked: keep the default. */ }
|
|
1719
|
+
const applyShortcuts = () => {
|
|
1720
|
+
shortcutSwitch.setAttribute('aria-checked', String(shortcuts));
|
|
1721
|
+
hint.hidden = !shortcuts;
|
|
1722
|
+
if (shortcuts) find.setAttribute('aria-keyshortcuts', '/'); else find.removeAttribute('aria-keyshortcuts');
|
|
1723
|
+
};
|
|
1724
|
+
shortcutSwitch.addEventListener('click', () => {
|
|
1725
|
+
shortcuts = !shortcuts;
|
|
1726
|
+
try { localStorage.setItem('dl-shortcuts', shortcuts ? 'on' : 'off'); } catch (e) { /* Storage is blocked: the choice lasts for this page only. */ }
|
|
1727
|
+
applyShortcuts();
|
|
1728
|
+
});
|
|
1729
|
+
applyShortcuts();
|
|
1730
|
+
const editable = (el) => el instanceof Element && el.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])');
|
|
1731
|
+
|
|
1732
|
+
// A tap opens the drawer with focus on its body, so no ring shows and no keyboard opens. A keyboard
|
|
1733
|
+
// open moves focus to the current row, where the ring shows the reader's place. Find focuses the field.
|
|
1734
|
+
drawerBody.tabIndex = -1;
|
|
1735
|
+
const openDrawer = ({ toFind = false, byPointer = false } = {}) => {
|
|
1736
|
+
if (!drawer.open) drawer.showModal();
|
|
1737
|
+
const current = rail.querySelector('[aria-current="location"]:not([hidden])');
|
|
1738
|
+
if (current) centre(drawerBody, current);
|
|
1739
|
+
if (toFind || !current) find.focus({ preventScroll: true });
|
|
1740
|
+
else if (byPointer) drawerBody.focus({ preventScroll: true });
|
|
1741
|
+
else current.focus({ preventScroll: true });
|
|
1742
|
+
};
|
|
1743
|
+
document.addEventListener('keydown', (e) => {
|
|
1744
|
+
if (!shortcuts || e.key !== '/' || e.metaKey || e.ctrlKey || e.altKey || e.defaultPrevented || editable(e.target)) return;
|
|
1745
|
+
if (document.querySelector('dialog[open]:not(#nav-drawer)')) return;
|
|
1746
|
+
e.preventDefault();
|
|
1747
|
+
if (tablet.matches) openDrawer({ toFind: true }); else find.focus();
|
|
1748
|
+
find.select();
|
|
1749
|
+
});
|
|
1750
|
+
|
|
1751
|
+
// Location: the last tracked section, in page order, whose top has passed the scroll-padding inset; at
|
|
1752
|
+
// the bottom of the page, the last one. After a jump the target stays current until the reader scrolls
|
|
1753
|
+
// away from where it landed. A group heading counts as its group's first row.
|
|
1754
|
+
const tracked = links.map((a) => ({ el: document.getElementById(a.hash.slice(1)), a }))
|
|
1755
|
+
.concat([...main.querySelectorAll(':scope > .layer-head[id^="group-"]')].map((el) => ({ el, a: document.getElementById(`rail-${el.id.slice(6)}`)?.parentElement.querySelector('a') })))
|
|
1756
|
+
.filter((t) => t.el && t.a)
|
|
1757
|
+
.sort((x, y) => (x.el.compareDocumentPosition(y.el) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1));
|
|
1758
|
+
const insetOf = () => Number.parseFloat(getComputedStyle(root).scrollPaddingTop) || 0;
|
|
1759
|
+
let jump;
|
|
1760
|
+
let frame;
|
|
1761
|
+
// The rail scrolls its own list to keep the current row in view, and leaves it alone while the reader is in it.
|
|
1762
|
+
const keepInView = (a) => {
|
|
1763
|
+
if (!a || a.hidden || rail.parentElement !== railHome || rail.contains(document.activeElement) || rail.matches(':hover')) return;
|
|
1764
|
+
const box = list.getBoundingClientRect();
|
|
1765
|
+
const row = a.getBoundingClientRect();
|
|
1766
|
+
if (row.top < box.top || row.bottom > box.bottom) centre(list, a);
|
|
1767
|
+
};
|
|
1768
|
+
const mark = (current) => {
|
|
1769
|
+
links.forEach((a) => { if (a === current) a.setAttribute('aria-current', 'location'); else a.removeAttribute('aria-current'); });
|
|
1770
|
+
keepInView(current);
|
|
1771
|
+
};
|
|
1772
|
+
const update = () => {
|
|
1773
|
+
frame = undefined;
|
|
1774
|
+
if (jump) {
|
|
1775
|
+
const distance = Math.abs(scrollY - jump.landing);
|
|
1776
|
+
if (distance > jump.closest + 2) jump = undefined; else jump.closest = Math.min(jump.closest, distance);
|
|
1777
|
+
}
|
|
1778
|
+
const inset = insetOf();
|
|
1779
|
+
let current = tracked[0];
|
|
1780
|
+
for (const t of tracked) if (t.el.getBoundingClientRect().top <= inset + 1) current = t;
|
|
1781
|
+
if (scrollY > 0 && scrollY + innerHeight >= root.scrollHeight - 2) current = tracked.at(-1);
|
|
1782
|
+
mark((jump?.target ?? current)?.a);
|
|
1783
|
+
};
|
|
1784
|
+
const schedule = () => { frame ??= requestAnimationFrame(update); };
|
|
1785
|
+
// Where a jump to the target lands: its top at the inset, clamped to the page's scroll range.
|
|
1786
|
+
const landingOf = (target) => Math.min(Math.max(scrollY + target.el.getBoundingClientRect().top - insetOf(), 0), Math.max(0, root.scrollHeight - innerHeight));
|
|
1787
|
+
const jumpTo = (id) => {
|
|
1788
|
+
jump = undefined;
|
|
1789
|
+
const target = tracked.find((t) => t.el.id === id);
|
|
1790
|
+
if (target) {
|
|
1791
|
+
const landing = landingOf(target);
|
|
1792
|
+
jump = { target, landing, closest: Math.abs(scrollY - landing) };
|
|
1793
|
+
}
|
|
1794
|
+
schedule();
|
|
1795
|
+
};
|
|
1796
|
+
// A layout change can move the target. While the landing stays within 2px of the stored one, the jump holds
|
|
1797
|
+
// unchanged, so small changes cannot add up (the scroll may still be on its way). When the landing moved and the
|
|
1798
|
+
// page already sits at the new one, as when the page bottom clamps it, the jump measures again. Otherwise the
|
|
1799
|
+
// target moved away, and the jump ends so tracking follows the page.
|
|
1800
|
+
const rebase = () => {
|
|
1801
|
+
if (jump) {
|
|
1802
|
+
const landing = landingOf(jump.target);
|
|
1803
|
+
if (Math.abs(landing - jump.landing) <= 2) return schedule();
|
|
1804
|
+
if (Math.abs(scrollY - landing) <= 2) return jumpTo(jump.target.el.id);
|
|
1805
|
+
}
|
|
1806
|
+
jump = undefined;
|
|
1807
|
+
schedule();
|
|
1808
|
+
};
|
|
1809
|
+
addEventListener('scroll', schedule, { passive: true });
|
|
1810
|
+
addEventListener('resize', rebase);
|
|
1811
|
+
addEventListener('hashchange', () => jumpTo(location.hash.slice(1)));
|
|
1812
|
+
// A second click on the same link changes no hash, so clicks start the jump too.
|
|
1813
|
+
document.addEventListener('click', (e) => {
|
|
1814
|
+
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
1815
|
+
const href = e.target instanceof Element ? e.target.closest('a[href^="#"]')?.getAttribute('href') : undefined;
|
|
1816
|
+
if (href && href.length > 1) jumpTo(href.slice(1));
|
|
1279
1817
|
});
|
|
1280
|
-
|
|
1281
|
-
|
|
1818
|
+
|
|
1819
|
+
// Tablet and phone: one sticky header row holds Find and Menu. The drawer holds Find, the pages, the
|
|
1820
|
+
// appearance control, and the rail's groups, in that order. Desktop puts each piece back.
|
|
1821
|
+
const pageHead = document.querySelector('.page-head');
|
|
1822
|
+
const appearanceRow = document.createElement('div');
|
|
1823
|
+
appearanceRow.className = 'drawer-appearance';
|
|
1824
|
+
appearanceRow.innerHTML = '<span class="group-label" aria-hidden="true">Appearance</span>';
|
|
1825
|
+
const barHome = [bar.parentElement, bar.nextSibling];
|
|
1826
|
+
const place = () => {
|
|
1827
|
+
if (tablet.matches) {
|
|
1828
|
+
pageHead.append(bar);
|
|
1829
|
+
appearanceRow.append(themeGroup);
|
|
1830
|
+
rail.insertBefore(strip, list);
|
|
1831
|
+
rail.insertBefore(appearanceRow, list);
|
|
1832
|
+
drawerBody.append(rail);
|
|
1833
|
+
bar.hidden = false;
|
|
1834
|
+
} else {
|
|
1835
|
+
if (drawer.open) drawer.close();
|
|
1836
|
+
pageHead.append(strip, themeGroup);
|
|
1837
|
+
appearanceRow.remove();
|
|
1838
|
+
barHome[0].insertBefore(bar, barHome[1]);
|
|
1839
|
+
railHome.prepend(rail);
|
|
1840
|
+
bar.hidden = true;
|
|
1841
|
+
}
|
|
1842
|
+
};
|
|
1843
|
+
tablet.addEventListener('change', () => { place(); rebase(); });
|
|
1844
|
+
place();
|
|
1845
|
+
// Moving the rail shifts the page under a deep link, so the target is scrolled back into place and its
|
|
1846
|
+
// landing measured after the move.
|
|
1847
|
+
if (location.hash) {
|
|
1848
|
+
document.getElementById(location.hash.slice(1))?.scrollIntoView();
|
|
1849
|
+
jumpTo(location.hash.slice(1));
|
|
1850
|
+
}
|
|
1851
|
+
update();
|
|
1852
|
+
// detail is 0 for a click made with Enter or Space, and 1 or more for a tap or a mouse click.
|
|
1853
|
+
document.getElementById('section-menu').addEventListener('click', (e) => openDrawer({ byPointer: e.detail > 0 }));
|
|
1854
|
+
document.getElementById('section-find').addEventListener('click', () => openDrawer({ toFind: true }));
|
|
1855
|
+
|
|
1856
|
+
// Copy link: writes the component's URL and announces the result.
|
|
1857
|
+
document.querySelectorAll('[data-copy-link]').forEach((button) => button.addEventListener('click', async () => {
|
|
1858
|
+
const url = new URL(`#${button.dataset.copyLink}`, location.href).href;
|
|
1859
|
+
try { await navigator.clipboard.writeText(url); status.textContent = 'Link copied.'; } catch (e) { status.textContent = 'Copy failed. Use the address bar instead.'; }
|
|
1860
|
+
}));
|
|
1282
1861
|
})();
|
|
1283
1862
|
</script>
|