@aitrien/motifspec 1.24.3 → 1.25.1

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/codex.css +49 -4
  3. package/dist/tokens.css +1 -1
  4. package/dist/tokens.js +1 -1
  5. package/dist/tokens.json +1 -1
  6. package/docs/components/_groups.json +9 -0
  7. package/docs/components/_template.md +9 -0
  8. package/docs/components/accession-label.md +18 -0
  9. package/docs/components/backdrop.md +5 -0
  10. package/docs/components/button-and-link.md +20 -0
  11. package/docs/components/callout.md +33 -0
  12. package/docs/components/catalogue-grid.md +120 -0
  13. package/docs/components/code-block.md +17 -0
  14. package/docs/components/component-preview.md +5 -0
  15. package/docs/components/data-table.md +18 -0
  16. package/docs/components/disclosure.md +19 -0
  17. package/docs/components/docs-shell.md +25 -0
  18. package/docs/components/figure.md +24 -0
  19. package/docs/components/heading-anchor.md +11 -0
  20. package/docs/components/icon.md +18 -0
  21. package/docs/components/keyboard-key.md +9 -0
  22. package/docs/components/ornament.md +17 -0
  23. package/docs/components/page-actions.md +12 -0
  24. package/docs/components/page-footer.md +12 -0
  25. package/docs/components/pagination.md +19 -0
  26. package/docs/components/post-list-item.md +17 -0
  27. package/docs/components/project-card.md +16 -0
  28. package/docs/components/prose.md +24 -0
  29. package/docs/components/search.md +13 -0
  30. package/docs/components/site-footer.md +31 -0
  31. package/docs/components/site-header.md +23 -0
  32. package/docs/components/specimen-plate.md +19 -0
  33. package/docs/components/status.md +19 -0
  34. package/docs/components/steps.md +13 -0
  35. package/docs/components/table-of-contents.md +19 -0
  36. package/docs/components/tabs.md +12 -0
  37. package/docs/components/tag.md +13 -0
  38. package/docs/components/token-table.md +17 -1
  39. package/docs/components/tooltip.md +15 -1
  40. package/docs/foundations/_overview.md +35 -0
  41. package/docs/hugo.md +1 -0
  42. package/layouts/_partials/motifspec/catalogue-item.html +14 -0
  43. package/package.json +1 -1
  44. package/scripts/lib.mjs +1 -0
@@ -2,14 +2,20 @@
2
2
  name: icon
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: content
5
6
  tokens:
7
+ - border.width.hairline
8
+ - color.border.strong
9
+ - color.surface.hover
6
10
  - color.text.muted
7
11
  - motion.duration.base
8
12
  - motion.easing.standard
13
+ - radius.pill
9
14
  - size.icon.lg
10
15
  - size.icon.md
11
16
  - size.icon.sm
12
17
  - space.inline.xs
18
+ - space.inset.xs
13
19
  ---
14
20
 
15
21
  # Icon
@@ -66,3 +72,15 @@ Sizes: `cx-icon--sm` (16px, beside label-size mono text), default (20px, in butt
66
72
  - An icon-only control carries `aria-label` and uses `cx-icon--lg` inside a 44px target (`size.target.touch`).
67
73
  - Icons share their text's contrast pair, because they inherit `currentColor`.
68
74
  - Material Symbols is licensed under Apache-2.0 (`icons/LICENSE`); keep the licence with the sprite.
75
+
76
+ ## Specimens
77
+
78
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
79
+
80
+ ```html {specimen="Beside text"}
81
+ <p class="cx-callout__title"><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-warning"></use></svg>Warning</p>
82
+ ```
83
+
84
+ ```html {specimen="In a button"}
85
+ <a class="cx-button cx-button--primary" href="/components/">View all <svg class="cx-icon cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></a>
86
+ ```
@@ -2,6 +2,7 @@
2
2
  name: keyboard-key
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: content
5
6
  tokens:
6
7
  - border.width.emphasis
7
8
  - border.width.hairline
@@ -51,3 +52,11 @@ One `<kbd>` per key, with a space between keys that are pressed together.
51
52
  - `<kbd>` is announced as text, so the keys read in order.
52
53
  - A shortcut is never the only way in: the control it opens has its own visible label.
53
54
  - Pairs: `color.text.primary` on `color.surface.sunken` (7:1).
55
+
56
+ ## Specimens
57
+
58
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
59
+
60
+ ```html {specimen="Shortcut"}
61
+ <p><kbd class="cx-kbd">Ctrl</kbd> <kbd class="cx-kbd">K</kbd></p>
62
+ ```
@@ -2,6 +2,7 @@
2
2
  name: ornament
3
3
  status: stable
4
4
  layouts: [portfolio, documentation]
5
+ group: decoration
5
6
  tokens:
6
7
  - border.width.hairline
7
8
  - color.border.subtle
@@ -78,3 +79,19 @@ Yarndings 12 knitting-chart glyphs: the footer band, the prose divider, the arti
78
79
  - Every ornament is `aria-hidden="true"` or generated content with no text equivalent.
79
80
  - `<hr>` keeps its separator role.
80
81
  - Pair: `color.ornament.rest` on `color.surface.base` (3:1) so the band is visible, although it carries no information.
82
+
83
+ ## Specimens
84
+
85
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
86
+
87
+ ```html {specimen="Single"}
88
+ <span class="cx-ornament cx-ornament--lg" aria-hidden="true">f</span>
89
+ ```
90
+
91
+ ```html {specimen="Band" wide=true}
92
+ <span class="cx-band" aria-hidden="true"></span>
93
+ ```
94
+
95
+ ```html {specimen="End mark"}
96
+ <p>Last sentence of the article.<span class="cx-end-mark" aria-hidden="true">g</span></p>
97
+ ```
@@ -2,6 +2,7 @@
2
2
  name: page-actions
3
3
  status: stable
4
4
  layouts: [documentation]
5
+ group: actions
5
6
  tokens:
6
7
  - space.inline.xs
7
8
  ---
@@ -54,3 +55,14 @@ In Hugo, `partial "motifspec/page-actions.html" .` writes it for a page that has
54
55
  - **Without script:** only "View as Markdown" shows.
55
56
  - **With `dist/codex.js`:** when the browser has a clipboard, the copy button is shown. A click fetches the address in `data-copy-page` and copies it as plain text. With `ClipboardItem`, the copy is written with a promise, so it still counts as part of the click while the file loads (Safari needs this); without it, the text is fetched first and written with `writeText`. The label becomes "Copied" with the `check` icon, or "Couldn't copy", and `data-state` is `copied` or `failed`; after `motion.duration.plate` it returns to "Copy page".
56
57
  - An app that renders it itself does the same, or leaves only the link.
58
+
59
+ ## Specimens
60
+
61
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
62
+
63
+ ```html {specimen="Copy and view"}
64
+ <div class="cx-page-actions">
65
+ <button class="cx-button cx-button--sm" type="button"><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-content-copy"></use></svg><span class="cx-page-actions__label">Copy page</span></button>
66
+ <a class="cx-button cx-button--sm" href="/guide/getting-started/index.md" type="text/markdown">View as Markdown</a>
67
+ </div>
68
+ ```
@@ -2,6 +2,7 @@
2
2
  name: page-footer
3
3
  status: stable
4
4
  layouts: [documentation]
5
+ group: collections
5
6
  tokens:
6
7
  - border.width.emphasis
7
8
  - border.width.hairline
@@ -84,3 +85,14 @@ A page with no file of its own, such as one a content adapter makes from another
84
85
  - The pagination is a `<nav>` named "Documentation pages", separate from the navigation's "Documentation". Pairs and targets as `pagination.md`.
85
86
  - The generated-from links are underlined, like links in prose, so they read as links in the mono line without relying on colour.
86
87
  - Pairs: `color.text.muted` on `color.surface.base` (4.5:1) for the date; `color.link.rest` on `color.surface.base` (7:1).
88
+
89
+ ## Specimens
90
+
91
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
92
+
93
+ ```html {specimen="Last updated" wide=true}
94
+ <footer class="cx-page-footer">
95
+ <p class="cx-meta">Last updated <time datetime="2026-11-04">4 November 2026</time></p>
96
+ <a class="cx-link" href="/reference/changelog/">View source<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-outward"></use></svg></a>
97
+ </footer>
98
+ ```
@@ -2,6 +2,7 @@
2
2
  name: pagination
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: navigation
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -78,3 +79,21 @@ A three-cell bar: previous with its title, current position, and next with its t
78
79
  - Disabled ends are not links, so they're skipped by Tab.
79
80
  - Cells are at least 44px tall.
80
81
  - Pairs: `color.text.primary` titles on `color.surface.raised` and `color.surface.hover` (7:1); `color.text.muted` labels (4.5:1).
82
+
83
+ ## Specimens
84
+
85
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
86
+
87
+ ```html {specimen="Previous and next" wide=true}
88
+ <nav class="cx-pagination" aria-label="Pages">
89
+ <a class="cx-pagination__link" href="/guide/" rel="prev">
90
+ <span class="cx-pagination__dir"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>Previous</span>
91
+ <span class="cx-pagination__title">Guide</span>
92
+ </a>
93
+ <p class="cx-pagination__status">Guide<strong>2 / 12</strong></p>
94
+ <a class="cx-pagination__link" href="/guide/getting-started/" rel="next">
95
+ <span class="cx-pagination__dir">Next<svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></span>
96
+ <span class="cx-pagination__title">Getting started</span>
97
+ </a>
98
+ </nav>
99
+ ```
@@ -2,6 +2,7 @@
2
2
  name: post-list-item
3
3
  status: stable
4
4
  layouts: [portfolio]
5
+ group: collections
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -90,3 +91,19 @@ One ledger row in a list of writing: catalogue number, date and reading time bes
90
91
  - Focus on the title draws the ring around the row.
91
92
  - Dates use `<time datetime>`.
92
93
  - Pairs: `color.text.accent` number on `color.surface.base` (4.5:1); `color.text.muted` meta (4.5:1); `color.text.primary` title on `color.surface.hover` (7:1).
94
+
95
+ ## Specimens
96
+
97
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
98
+
99
+ ```html {specimen="Post"}
100
+ <ol class="cx-posts">
101
+ <li class="cx-post">
102
+ <p class="cx-post__meta"><span class="cx-id__no">LM-P-031</span><time datetime="2026-10-02">2026-10-02</time><span>6 min</span></p>
103
+ <div class="cx-post__main">
104
+ <h3 class="cx-post__title"><a href="/guide/">Serving design tokens to AI assistants</a></h3>
105
+ <p class="cx-post__summary">Why every token carries a usage rule.</p>
106
+ </div>
107
+ </li>
108
+ </ol>
109
+ ```
@@ -2,6 +2,7 @@
2
2
  name: project-card
3
3
  status: stable
4
4
  layouts: [portfolio]
5
+ group: collections
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -81,3 +82,18 @@ A framed summary of one project that links to its case study.
81
82
  - Focus on the title link draws the focus ring around the whole card (`:has(:focus-visible)`).
82
83
  - Tags stay keyboard-reachable after the title link.
83
84
  - Pairs: `color.text.primary` on `color.surface.raised` (7:1); `color.text.secondary` summary (7:1); hover border `color.border.strong` (3:1).
85
+
86
+ ## Specimens
87
+
88
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
89
+
90
+ ```html {specimen="Project"}
91
+ <article class="cx-card">
92
+ <div class="cx-card__media"><svg class="cx-plate__map" viewBox="0 0 160 100" aria-hidden="true" focusable="false"><path class="cx-plate__line" pathLength="1" d="M0 80C40 55 64 75 88 45S136 20 160 30"/><path class="cx-plate__line cx-plate__line--index" pathLength="1" d="M0 95C48 75 72 90 99.2 62S140.8 40 160 48"/></svg></div>
93
+ <div class="cx-card__body">
94
+ <p class="cx-id"><span class="cx-id__no">LM-W-001</span><span>2026</span><span class="cx-status cx-status--live">Live</span></p>
95
+ <h3 class="cx-card__title"><a class="cx-card__link" href="/layouts/">Interactive WebGL globe</a></h3>
96
+ <p class="cx-card__summary">A React app that renders live routes on a 3D globe.</p>
97
+ </div>
98
+ </article>
99
+ ```
@@ -2,12 +2,14 @@
2
2
  name: prose
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: content
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
8
9
  - border.width.emphasis
9
10
  - border.width.hairline
10
11
  - color.accent.border
12
+ - color.border.default
11
13
  - color.border.strong
12
14
  - color.border.subtle
13
15
  - color.focus.ring
@@ -45,11 +47,13 @@ tokens:
45
47
  - font.weight.strong
46
48
  - font.weight.ui
47
49
  - radius.control
50
+ - size.column.sidebar
48
51
  - size.container.breakout
49
52
  - size.measure.caption
50
53
  - size.measure.code
51
54
  - size.measure.prose
52
55
  - size.ornament.sm
56
+ - size.target.min
53
57
  - size.target.touch
54
58
  - space.inline.md
55
59
  - space.inline.sm
@@ -122,3 +126,23 @@ Styles for Markdown-rendered long-form content: headings, paragraphs, lists, blo
122
126
  - Heading anchors name their section in `aria-label` and appear on hover or focus (always on touch screens).
123
127
  - `<hr>` keeps its separator role; the stitches are generated content with no text.
124
128
  - Pairs: `color.text.primary` (7:1), `color.link.rest` and `color.link.hover` (7:1), `color.text.secondary` blockquotes (7:1) on `color.surface.base`.
129
+
130
+ ## Specimens
131
+
132
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
133
+
134
+ ```html {specimen="Reading text"}
135
+ <div class="cx-prose">
136
+ <p>A token without a rule is a colour with a name, so the <a href="/reference/tokens/">description is the contract</a>.</p>
137
+ <ul>
138
+ <li>Name the role, never the page.</li>
139
+ <li>Say when not to use it.</li>
140
+ </ul>
141
+ </div>
142
+ ```
143
+
144
+ ```html {specimen="Quotation"}
145
+ <div class="cx-prose">
146
+ <blockquote><p>Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.</p><footer>Andy Hunt and Dave Thomas <span class="cx-sep" aria-hidden="true">|</span> <cite>The Pragmatic Programmer</cite></footer></blockquote>
147
+ </div>
148
+ ```
@@ -2,6 +2,7 @@
2
2
  name: search
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: navigation
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -117,3 +118,15 @@ A result, as the script writes it:
117
118
  - **Failing:** if Pagefind's script can't load, the status says "Search isn't available right now." and searching stops.
118
119
  - **Closing:** Escape (handled on the dialog, because a search field would otherwise spend the first Escape clearing itself), the close button, or a click on the scrim. Focus returns to the element that had it before opening. Following a result navigates as a link does.
119
120
  - **What's indexed:** Pagefind indexes the element with `data-pagefind-body` (the docs shell's `<main>`), skipping anything inside marked `data-pagefind-ignore`; the table of contents, page actions, page footer and pagination are marked.
121
+
122
+ ## Specimens
123
+
124
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
125
+
126
+ ```html {specimen="Trigger"}
127
+ <button class="cx-search-trigger" type="button">
128
+ <svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-search"></use></svg>
129
+ <span class="cx-search-trigger__label">Search</span>
130
+ <span class="cx-search-trigger__keys" aria-hidden="true"><kbd class="cx-kbd">Ctrl</kbd><kbd class="cx-kbd">K</kbd></span>
131
+ </button>
132
+ ```
@@ -2,6 +2,7 @@
2
2
  name: site-footer
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: navigation
5
6
  tokens:
6
7
  - border.width.hairline
7
8
  - color.border.subtle
@@ -99,3 +100,33 @@ The closing band of every page: a knitted ornament band, grouped links, a coloph
99
100
  - The band is `aria-hidden="true"` and has no text alternative because it carries no meaning.
100
101
  - Links are at least 24px tall (`size.target.min`).
101
102
  - Pairs: `color.text.secondary` on `color.surface.raised` (7:1); `color.text.muted` on `color.surface.raised` (4.5:1, labels only). On a backdrop page the frost is measured as `color.surface.base`; the contour lines beneath it are not part of the check.
103
+
104
+ ## Specimens
105
+
106
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
107
+
108
+ ```html {specimen="Footer" wide=true}
109
+ <footer class="cx-footer">
110
+ <div class="cx-container">
111
+ <div class="cx-footer__grid">
112
+ <div>
113
+ <h2>Pages</h2>
114
+ <ul>
115
+ <li><a href="/guide/">Guide</a></li>
116
+ <li><a href="/components/">Components</a></li>
117
+ </ul>
118
+ </div>
119
+ <div>
120
+ <h2>Colophon</h2>
121
+ <p>Set in National Park and Geist Mono, with ornaments from Yarndings 12.</p>
122
+ </div>
123
+ </div>
124
+ </div>
125
+ <div class="cx-container">
126
+ <div class="cx-footer__base">
127
+ <span>© 2026 Liam Marshall</span>
128
+ <a href="/">Back to top<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-upward"></use></svg></a>
129
+ </div>
130
+ </div>
131
+ </footer>
132
+ ```
@@ -2,6 +2,7 @@
2
2
  name: site-header
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: navigation
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -203,3 +204,25 @@ Copy the snippet as it is: the build fails if this doc and `js/theme-init.js` di
203
204
  - **Header height:** `--_header-height` on `<html>` is kept equal to the header's height, for scroll padding and the docked table of contents. When the nav wraps below the wordmark, the header gets `data-wrapped`.
204
205
  - **On a backdrop page:** the header sticks once script runs, and `data-scrolled="true"` fades its surface in as soon as the page leaves the top. Without script it scrolls away with the page.
205
206
  - **On a documentation site:** the header always sticks with its surface, and gets `data-scrolled` too, which compacts the wordmark and (below `size.breakpoint.lg`) shows "On this page" once the page leaves the top. Without script the bar stays compact, with "On this page" shown. Only one of the menu and "On this page" is open at a time; each closes on Escape, a click outside it, or a link followed inside it. The current section is marked in "On this page", as in the article's table of contents.
207
+
208
+ ## Specimens
209
+
210
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
211
+
212
+ ```html {specimen="Portfolio header" wide=true}
213
+ <header class="cx-header">
214
+ <div class="cx-container cx-header__inner">
215
+ <a class="cx-wordmark" href="/">Liam Marshall <span class="cx-wordmark__role">Web engineer</span></a>
216
+ <div class="cx-header__end">
217
+ <nav class="cx-nav" aria-label="Main">
218
+ <ul>
219
+ <li><a href="/guide/" aria-current="page">Guide</a></li>
220
+ <li><a href="/components/">Components</a></li>
221
+ <li><a href="/reference/">Reference</a></li>
222
+ </ul>
223
+ </nav>
224
+ <button class="cx-theme-toggle" type="button" aria-label="Switch theme"><svg class="cx-icon" data-icon="to-dark" aria-hidden="true" focusable="false"><use href="#cx-icon-theme-dark"></use></svg><svg class="cx-icon" data-icon="to-light" aria-hidden="true" focusable="false"><use href="#cx-icon-theme-light"></use></svg></button>
225
+ </div>
226
+ </div>
227
+ </header>
228
+ ```
@@ -2,6 +2,7 @@
2
2
  name: specimen-plate
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: decoration
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -135,3 +136,21 @@ MotifSpec's own plate: simplex-noise height lines drawn as a static SVG, which s
135
136
  - WCAG 2.3.1 (Three Flashes): nothing flashes more than three times a second.
136
137
  - The contour survey stops drawing while it is off screen or the tab is hidden.
137
138
  - The drawing classes are decorative: `color.ornament.rest` has no text-contrast requirement.
139
+
140
+ ## Specimens
141
+
142
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
143
+
144
+ ```html {specimen="Plate"}
145
+ <figure class="cx-plate-frame">
146
+ <div class="cx-plate" aria-hidden="true">
147
+ <svg class="cx-plate__map" viewBox="0 0 240 240" focusable="false">
148
+ <path class="cx-plate__grid" d="M80 0V240M160 0V240M0 80H240M0 160H240"/>
149
+ <path class="cx-plate__line" pathLength="1" d="M0 200C60 150 90 190 130 120S200 60 240 70"/>
150
+ <path class="cx-plate__line cx-plate__line--index" pathLength="1" d="M0 220C70 180 100 210 150 150S210 100 240 110"/>
151
+ <path class="cx-plate__line" pathLength="1" d="M60 240C90 200 140 220 170 180S220 150 240 150"/>
152
+ </svg>
153
+ </div>
154
+ <figcaption>Plate 0 <span class="cx-sep" aria-hidden="true">|</span> Contours</figcaption>
155
+ </figure>
156
+ ```
@@ -2,6 +2,7 @@
2
2
  name: status
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: labels
5
6
  tokens:
6
7
  - border.width.emphasis
7
8
  - color.status.danger.text
@@ -73,3 +74,21 @@ A portfolio's project statuses are named variants of these: `cx-status--live` (s
73
74
  - `--muted` draws a ring instead of a solid dot, so it differs in shape as well as colour.
74
75
  - Pairs: each tone's `color.status.*.text` on `color.surface.base`, `color.surface.raised` and `color.surface.hover` (4.5:1); `color.text.muted` on the same surfaces (4.5:1).
75
76
  - A status that changes while the page is open isn't a live region on its own. Announce changes once, as `docs/layouts/dashboard.md` (Live data) says.
77
+
78
+ ## Specimens
79
+
80
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
81
+
82
+ ```html {specimen="Tones"}
83
+ <span class="cx-status cx-status--success">Online</span>
84
+ <span class="cx-status cx-status--warning">Degraded</span>
85
+ <span class="cx-status cx-status--danger">Down</span>
86
+ <span class="cx-status cx-status--info">Updating</span>
87
+ <span class="cx-status cx-status--muted">Scheduled</span>
88
+ ```
89
+
90
+ ```html {specimen="Project statuses"}
91
+ <span class="cx-status cx-status--live">Live</span>
92
+ <span class="cx-status cx-status--building">Building</span>
93
+ <span class="cx-status cx-status--archived">Archived</span>
94
+ ```
@@ -2,6 +2,7 @@
2
2
  name: steps
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: content
5
6
  tokens:
6
7
  - border.width.hairline
7
8
  - color.border.subtle
@@ -68,3 +69,15 @@ In Markdown, write an ordered list whose items start with a bold lead-in, and pu
68
69
  - It is an `<ol>`, so the count and each step's position are announced.
69
70
  - The visible numbers are generated, so they're not read twice.
70
71
  - Pairs: `color.text.accent` on `color.surface.base` (4.5:1) for the numbers; `color.text.primary` on `color.surface.base` (7:1).
72
+
73
+ ## Specimens
74
+
75
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
76
+
77
+ ```html {specimen="Three steps"}
78
+ <ol class="cx-steps">
79
+ <li><h3 class="cx-steps__title">Import the module</h3><p>Add it to your site's config.</p></li>
80
+ <li><h3 class="cx-steps__title">Pin a version</h3><p>Choose the release you want.</p></li>
81
+ <li><h3 class="cx-steps__title">Check the site</h3><p>Run the checker before you push.</p></li>
82
+ </ol>
83
+ ```
@@ -2,6 +2,7 @@
2
2
  name: table-of-contents
3
3
  status: stable
4
4
  layouts: [portfolio, documentation]
5
+ group: navigation
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -90,3 +91,21 @@ A numbered list of an article's sections, beside the text on wide screens and ab
90
91
  - **Docking:** when the article is wide enough for the table of contents to sit beside the text, it gets `is-docked` and sticks below the header (`--_header-height`). It's checked again on resize.
91
92
  - **Current section:** as the reader scrolls, the link to the section that enters the top 30% of the view gets `aria-current="true"` and the others `"false"` (an IntersectionObserver with a bottom margin of -70%).
92
93
  - Without script, the table of contents is a plain open list, and its `<details>` opens and closes natively.
94
+
95
+ ## Specimens
96
+
97
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
98
+
99
+ ```html {specimen="On this page"}
100
+ <nav class="cx-toc" aria-labelledby="sp-toc-title">
101
+ <details open>
102
+ <summary id="sp-toc-title">On this page<svg class="cx-icon cx-icon--sm cx-toc__chevron" aria-hidden="true" focusable="false"><use href="#cx-icon-expand"></use></svg></summary>
103
+ <ol>
104
+ <li><a href="/foundations/colour/"><span class="cx-toc__no">01</span>Colour</a></li>
105
+ <li><a href="/foundations/type/"><span class="cx-toc__no">02</span>Type</a>
106
+ <ol><li><a href="/foundations/space-and-size/"><span class="cx-toc__no">2.1</span>Space and size</a></li></ol>
107
+ </li>
108
+ </ol>
109
+ </details>
110
+ </nav>
111
+ ```
@@ -2,6 +2,7 @@
2
2
  name: tabs
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: navigation
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -79,3 +80,14 @@ The same content in two to four forms, such as Hugo and npm, with one shown at a
79
80
  - **Building:** in each `.cx-tabs` with two or more `.cx-tabs__panel` children, a tab list is inserted before the first panel, with one button per panel, named by its `.cx-tabs__label`. The set gets `is-tabbed`, which hides the labels.
80
81
  - **Choosing:** a click, or the arrow keys, Home and End, selects a tab and shows its panel; the others get `hidden`. Selection follows focus.
81
82
  - **Keeping in step:** choosing in a set with `data-tabs` selects the same label in every other set with that name, and stores it as `cx-tabs:<name>` in `localStorage`, which the next page reads. Storage that's blocked is ignored.
83
+
84
+ ## Specimens
85
+
86
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
87
+
88
+ ```html {specimen="Two panels"}
89
+ <div class="cx-tabs" data-tabs="sp-stack" aria-label="Stack">
90
+ <section class="cx-tabs__panel"><h3 class="cx-tabs__label">Hugo</h3><p>Import the module and call the partials.</p></section>
91
+ <section class="cx-tabs__panel"><h3 class="cx-tabs__label">npm</h3><p>Install the package and copy the markup.</p></section>
92
+ </div>
93
+ ```
@@ -2,6 +2,7 @@
2
2
  name: tag
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: labels
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -69,3 +70,15 @@ A small mono label for a topic or technology, optionally linking to its index.
69
70
  - Wrap groups in `<ul>` so the count is announced.
70
71
  - The current filter uses `aria-current="page"` as well as the accent border.
71
72
  - Pairs: `color.text.secondary` on `color.surface.sunken` (7:1); hover border `color.accent.border` (3:1).
73
+
74
+ ## Specimens
75
+
76
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
77
+
78
+ ```html {specimen="With a count, current, plain"}
79
+ <ul class="cx-tags">
80
+ <li><a class="cx-tag" href="/components/">webgl<span class="cx-tag__count">4</span></a></li>
81
+ <li><a class="cx-tag" href="/components/" aria-current="page">accessibility</a></li>
82
+ <li><span class="cx-tag">draft</span></li>
83
+ </ul>
84
+ ```
@@ -2,6 +2,7 @@
2
2
  name: token-table
3
3
  status: stable
4
4
  layouts: [documentation]
5
+ group: data
5
6
  tokens:
6
7
  - border.width.hairline
7
8
  - color.accent.fill.rest
@@ -69,7 +70,7 @@ A token shown as it looks, beside its name, value and rule: colour tiles, a prim
69
70
  | `cx-swatch--tile` | A colour tile: the colour as the background, with its name and value written on it | `--_swatch`, and `--_ink` for the text |
70
71
  | `cx-palette` | One hue's steps as a grid of tiles, lightest first | Each tile's |
71
72
  | `cx-pair-sample` | "Aa" in a foreground on a background, beside the pair's ratio | `--_fg` and `--_bg` |
72
- | `cx-token-sample` | Text at a size or in a family | `--_size`, `--_family` |
73
+ | `cx-token-sample` | Text in a type style: its size, family, weight, leading and tracking | `--_size`, `--_family`, `--_weight`, `--_leading`, `--_tracking` |
73
74
  | `cx-token-bar` | A length, as a bar | `--_width` |
74
75
 
75
76
  The value each part shows comes from a private custom property on the element, set in a `style` attribute by MotifSpec's docs generator (`scripts/docs-reference.mjs`) from `dist/tokens.json`. That's the only place MotifSpec writes a style attribute, and only in generated pages, which the checker doesn't read. Hand-written markup can't set them (the checker fails any `style` attribute), so it shows the neutral fallback, as above.
@@ -94,3 +95,18 @@ The value each part shows comes from a private custom property on the element, s
94
95
  - A tile's text is in whichever of the darkest and lightest neutral contrasts more with the tile. Against black or white, the better of the two is at least 4.5:1 on any colour, so every tile's label meets the label size's target.
95
96
  - A pair sample's own contrast is the pair's: it is drawn in the colours it measures, so a failing pair looks like one.
96
97
  - Pairs: the text around each sample is `color.text.primary` and `color.text.muted` on `color.surface.raised` (7:1 and 4.5:1); a chip's edge is `color.border.default`.
98
+
99
+ ## Specimens
100
+
101
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
102
+
103
+ ```html {specimen="Palette"}
104
+ <ol class="cx-palette" aria-label="ash">
105
+ <li><span class="cx-swatch cx-swatch--tile"><b>50</b><span>value</span></span></li>
106
+ <li><span class="cx-swatch cx-swatch--tile"><b>100</b><span>value</span></span></li>
107
+ </ol>
108
+ ```
109
+
110
+ ```html {specimen="Samples"}
111
+ <p><span class="cx-pair-sample">Aa</span> <span class="cx-token-sample">Type sample</span></p>
112
+ ```
@@ -2,6 +2,7 @@
2
2
  name: tooltip
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: actions
5
6
  tokens:
6
7
  - color.surface.inverse
7
8
  - color.text.inverse
@@ -40,7 +41,8 @@ The tooltip is a child of the control, so hover and focus on the control reveal
40
41
 
41
42
  ```html {preview=true}
42
43
  <button class="cx-theme-toggle" type="button" aria-label="Switch to dark theme">
43
- <svg class="cx-icon" aria-hidden="true" focusable="false"><use href="#cx-icon-theme-dark"></use></svg>
44
+ <svg class="cx-icon" data-icon="to-dark" aria-hidden="true" focusable="false"><use href="#cx-icon-theme-dark"></use></svg>
45
+ <svg class="cx-icon" data-icon="to-light" aria-hidden="true" focusable="false"><use href="#cx-icon-theme-light"></use></svg>
44
46
  <span class="cx-tooltip" aria-hidden="true">Switch to dark theme</span>
45
47
  </button>
46
48
  ```
@@ -71,3 +73,15 @@ It opens below the control, aligned to its right edge. Add `cx-tooltip--start` t
71
73
 
72
74
  - Showing is CSS: the tooltip appears while its control is hovered or has `:focus-visible`.
73
75
  - `dist/codex.js` adds dismissal: Escape adds `is-tooltip-dismissed` to every tooltip's control, hiding it without moving the pointer or focus. The class is removed when the pointer leaves the control or focus moves away. An app that renders tooltips itself does the same.
76
+
77
+ ## Specimens
78
+
79
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
80
+
81
+ ```html {specimen="On hover" live=true}
82
+ <button class="cx-theme-toggle" type="button" aria-label="Switch theme">
83
+ <svg class="cx-icon" data-icon="to-dark" aria-hidden="true" focusable="false"><use href="#cx-icon-theme-dark"></use></svg>
84
+ <svg class="cx-icon" data-icon="to-light" aria-hidden="true" focusable="false"><use href="#cx-icon-theme-light"></use></svg>
85
+ <span class="cx-tooltip" aria-hidden="true">Switch theme</span>
86
+ </button>
87
+ ```
@@ -0,0 +1,35 @@
1
+ ---
2
+ weight: 0
3
+ ---
4
+
5
+ # Foundations
6
+
7
+ The colour, type, space, icons and ornaments every component is built from, at a glance. Each sample links to its full page.
8
+
9
+ [The principles](/foundations/principles/) and [the identity in brief](/foundations/identity/) say why they look the way they do.
10
+
11
+ ## Colour
12
+
13
+ The semantic colours components use. They follow the theme, so switching it shows their dark values.
14
+
15
+ *Generated from `tokens/color.json`: colour at a glance.*
16
+
17
+ ## Type
18
+
19
+ National Park for display and reading, Geist Mono for labels and code, from display down to the label voice.
20
+
21
+ *Generated from `tokens/typography.json`: type at a glance.*
22
+
23
+ ## Space
24
+
25
+ Each bar is its token's length: inset inside a box, stack between blocks, inline between things on a line.
26
+
27
+ *Generated from `tokens/space.json`: space at a glance.*
28
+
29
+ ## Icons
30
+
31
+ *Generated from `icons/manifest.json`: icons at a glance.*
32
+
33
+ ## Ornaments and motion
34
+
35
+ *Generated from `tokens/typography.json`: ornaments at a glance.*