@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
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  Every release of MotifSpec (named brand-codex until 1.10.0), newest first. Entries before 1.10.0 keep the names they were released under. Versions follow the rules in `CONVENTIONS.md`: renaming or removing a semantic token is major, adding tokens, components or icons is minor, and changing a value or fixing a description is a patch. `npm run build` fails if the version in `package.json` has no entry here.
4
4
 
5
+ ## [1.25.1] - 2026-11-18
6
+
7
+ ### Changed
8
+ - The catalogue grid (`catalogue-grid.md`) keeps a specimen's wrapped rows together in the middle of the cell (`align-content: center`), instead of spreading them over its height.
9
+ - The status doc's specimens show its five tones and its three project statuses in a cell each, named as the doc names them, in place of one cell of all eight.
10
+
11
+ ## [1.25.0] - 2026-11-16
12
+
13
+ ### Added
14
+ - Catalogue grid (`catalogue-grid.md`, documentation layout): specimens in a hairline grid, each above a caption with its variant in `color.text.accent` and its name in the label voice, linking to its page through an arrow in a hairline circle. `--wide` cells take a whole row. In Hugo, `motifspec/catalogue-item.html` writes one cell.
15
+ - Every component doc ends with a `## Specimens` section: each variant as the smallest markup that shows it (small variants that read best side by side, such as buttons, statuses and tags, share one), or "None:" and why. Its front matter names a `group` from `docs/components/_groups.json` (Actions, Navigation, Content, Cards and lists, Labels and status, Data, Decoration). The validator checks both, and that specimen ids start "sp-" and are unique.
16
+ - The token sample (`token-table.md`) takes `--_weight`, `--_leading` and `--_tracking` as well as `--_size` and `--_family`.
17
+
18
+ ### Changed
19
+ - motifspec.com's Components page shows every component's variants in a catalogue grid under its group, and its Foundations page shows the colour, type, space, icons and ornaments at a glance, each linking to its full page.
20
+ - The MCP server's `get_component` leaves out the specimens, so a component costs the same to fetch as before.
21
+
22
+ ### Fixed
23
+ - The tooltip doc's theme toggle names its icons (`data-icon`), so its preview shows them.
24
+
5
25
  ## [1.24.3] - 2026-11-16
6
26
 
7
27
  ### Changed
package/dist/codex.css CHANGED
@@ -2,7 +2,7 @@
2
2
  @font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
3
3
  @font-face { font-family: "Yarndings 12"; src: url("../fonts/yarndings-12-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: block; }
4
4
 
5
- /* MotifSpec 1.24.3 — generated from tokens/*.json. Do not edit.
5
+ /* MotifSpec 1.25.1 — generated from tokens/*.json. Do not edit.
6
6
  Themes: semantic colours use light-dark(); color-scheme follows the system unless
7
7
  <html data-theme="light|dark"> pins it. --cx-primitive-* are for this file only. */
8
8
  :root {
@@ -517,7 +517,7 @@ p, li, dd, figcaption { text-wrap: pretty; }
517
517
  .cx-skip-link:focus { transform: none; }
518
518
 
519
519
  /* Shared label voice: mono, uppercase, tracked. */
520
- .cx-eyebrow, .cx-label dt, .cx-table thead th, .cx-toc summary, .cx-code__bar, .cx-callout__title, .cx-footer h2, .cx-figure__plate {
520
+ .cx-eyebrow, .cx-label dt, .cx-table thead th, .cx-toc summary, .cx-code__bar, .cx-callout__title, .cx-footer h2, .cx-figure__plate, .cx-catalogue__name {
521
521
  font-family: var(--cx-font-family-mono);
522
522
  font-size: var(--cx-font-size-label);
523
523
  font-weight: var(--cx-font-weight-ui);
@@ -1182,7 +1182,7 @@ a.cx-tag:hover { border-color: var(--cx-color-accent-border); color: var(--cx-co
1182
1182
  /* ------------------------------------------------------------ token table (token-table.md, documentation layout) */
1183
1183
  /* What a token looks like, beside its name and rule, on the reference pages that MotifSpec's docs generator writes
1184
1184
  from dist/tokens.json. Each shows a value from a private custom property the generator sets on the element
1185
- (--_swatch; --_fg and --_bg; --_size and --_family; --_width). That is the one place MotifSpec writes a style
1185
+ (--_swatch; --_fg and --_bg; --_size, --_family, --_weight, --_leading and --_tracking; --_width). That is the one place MotifSpec writes a style
1186
1186
  attribute, and only in generated pages; without it each falls back to a neutral look. */
1187
1187
  .cx-swatch {
1188
1188
  display: inline-block; flex: none; vertical-align: middle;
@@ -1212,7 +1212,8 @@ a.cx-tag:hover { border-color: var(--cx-color-accent-border); color: var(--cx-co
1212
1212
  .cx-token-table th[scope="row"] code { white-space: nowrap; }
1213
1213
  .cx-token-sample {
1214
1214
  display: block; margin: 0; white-space: nowrap; font-size: var(--_size, inherit); font-family: var(--_family, inherit);
1215
- line-height: var(--cx-font-line-height-heading); color: var(--cx-color-text-primary); overflow-wrap: anywhere;
1215
+ font-weight: var(--_weight, inherit); line-height: var(--_leading, var(--cx-font-line-height-heading));
1216
+ letter-spacing: var(--_tracking, normal); color: var(--cx-color-text-primary); overflow-wrap: anywhere;
1216
1217
  }
1217
1218
  .cx-token-bar { display: block; width: var(--_width, 0%); height: var(--cx-space-inset-sm); background: var(--cx-color-accent-fill-rest); }
1218
1219
  .cx-pair-sample {
@@ -1223,6 +1224,50 @@ a.cx-tag:hover { border-color: var(--cx-color-accent-border); color: var(--cx-co
1223
1224
  font-family: var(--cx-font-family-body); font-weight: var(--cx-font-weight-strong);
1224
1225
  }
1225
1226
 
1227
+ /* ------------------------------------------------------------ catalogue grid (catalogue-grid.md, documentation layout) */
1228
+ /* Specimens in a hairline grid, each above its caption, like a printed catalogue: rules between cells and under each,
1229
+ none on the outer sides. Each cell draws its own end and bottom rule; the list runs one hairline past the frame,
1230
+ which clips the last column's. */
1231
+ .cx-catalogue { overflow: hidden; border-block-start: var(--cx-border-width-hairline) solid var(--cx-color-border-default); }
1232
+ .cx-catalogue__list, .cx-prose .cx-catalogue__list {
1233
+ display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--cx-size-column-sidebar)), 1fr));
1234
+ margin: 0 calc(var(--cx-border-width-hairline) * -1) 0 0; padding: 0; list-style: none;
1235
+ }
1236
+ .cx-catalogue__item, .cx-prose .cx-catalogue__item {
1237
+ display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 0;
1238
+ border-inline-end: var(--cx-border-width-hairline) solid var(--cx-color-border-default);
1239
+ border-block-end: var(--cx-border-width-hairline) solid var(--cx-color-border-default);
1240
+ }
1241
+ .cx-catalogue__item::marker { content: none; }
1242
+ .cx-catalogue__item--wide { grid-column: 1 / -1; }
1243
+ /* The specimen, centred in its cell. contain keeps anything it positions (a sticky header, say) inside the cell. */
1244
+ .cx-catalogue__specimen {
1245
+ flex: 1; display: flex; flex-wrap: wrap; align-items: center; align-content: center; justify-content: center; gap: var(--cx-space-stack-sm);
1246
+ min-height: calc(var(--cx-size-target-touch) * 3.5); padding: var(--cx-space-inset-lg); overflow: hidden; contain: layout paint;
1247
+ }
1248
+ .cx-catalogue__specimen > * { max-width: 100%; }
1249
+ .cx-catalogue__item--wide .cx-catalogue__specimen > * { flex: 1 1 100%; }
1250
+ .cx-catalogue__specimen--note { justify-content: flex-start; color: var(--cx-color-text-muted); font-size: var(--cx-font-size-small); }
1251
+ .cx-catalogue__caption {
1252
+ display: flex; flex-direction: column; gap: var(--cx-space-stack-xs); padding: var(--cx-space-inset-sm) var(--cx-space-inset-md);
1253
+ border-block-start: var(--cx-border-width-hairline) solid var(--cx-color-border-subtle);
1254
+ }
1255
+ .cx-catalogue__variant, .cx-prose .cx-catalogue__variant { margin: 0; color: var(--cx-color-text-accent); font-weight: var(--cx-font-weight-strong); line-height: var(--cx-font-line-height-ui); }
1256
+ /* The name, in the label voice, links to the full page; its arrow sits in a hairline circle at the end of the row. */
1257
+ .cx-catalogue__name, .cx-prose .cx-catalogue__name {
1258
+ display: flex; align-items: center; justify-content: space-between; gap: var(--cx-space-inline-sm);
1259
+ min-height: var(--cx-size-target-min); color: var(--cx-color-text-primary); text-decoration: none;
1260
+ }
1261
+ .cx-catalogue__name .cx-icon {
1262
+ flex: none; box-sizing: content-box; padding: var(--cx-space-inset-xs);
1263
+ border: var(--cx-border-width-hairline) solid var(--cx-color-border-strong); border-radius: var(--cx-radius-pill);
1264
+ }
1265
+ .cx-catalogue__name:focus-visible { outline: var(--cx-border-focus-width) solid var(--cx-color-focus-ring); outline-offset: var(--cx-border-focus-offset); }
1266
+ @media (hover: hover) {
1267
+ .cx-catalogue__name:hover { text-decoration: underline; text-underline-offset: var(--cx-space-inline-xs); }
1268
+ .cx-catalogue__name:hover .cx-icon { background: var(--cx-color-surface-hover); }
1269
+ }
1270
+
1226
1271
  /* ------------------------------------------------------------ project card */
1227
1272
  .cx-cards { display: grid; gap: var(--cx-space-gutter-grid); grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--cx-size-column-card)), 1fr)); margin: 0; padding: 0; list-style: none; }
1228
1273
  .cx-card {
package/dist/tokens.css CHANGED
@@ -1,4 +1,4 @@
1
- /* MotifSpec 1.24.3 — generated from tokens/*.json. Do not edit.
1
+ /* MotifSpec 1.25.1 — generated from tokens/*.json. Do not edit.
2
2
  Themes: semantic colours use light-dark(); color-scheme follows the system unless
3
3
  <html data-theme="light|dark"> pins it. --cx-primitive-* are for this file only. */
4
4
  :root {
package/dist/tokens.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Generated by npm run build. Do not edit.
2
- export const version = "1.24.3";
2
+ export const version = "1.25.1";
3
3
  export const changelog = "https://github.com/Aitrien/motifspec/blob/main/CHANGELOG.md";
4
4
  export const showcase = "https://motifspec.com";
5
5
  export const tokens = [
package/dist/tokens.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.24.3",
2
+ "version": "1.25.1",
3
3
  "changelog": "https://github.com/Aitrien/motifspec/blob/main/CHANGELOG.md",
4
4
  "showcase": "https://motifspec.com",
5
5
  "tokens": [
@@ -0,0 +1,9 @@
1
+ [
2
+ {"key": "actions", "title": "Actions"},
3
+ {"key": "navigation", "title": "Navigation"},
4
+ {"key": "content", "title": "Content"},
5
+ {"key": "collections", "title": "Cards and lists"},
6
+ {"key": "labels", "title": "Labels and status"},
7
+ {"key": "data", "title": "Data"},
8
+ {"key": "decoration", "title": "Decoration"}
9
+ ]
@@ -3,6 +3,7 @@ name: component-name
3
3
  status: draft # draft | stable | deprecated
4
4
  # deprecated: Use x instead; removed in 2.0.0. # required when status is deprecated
5
5
  layouts: [shared] # [shared], or the layouts it belongs to: portfolio, dashboard, documentation
6
+ group: content # the Components page heading it sits under: a key in docs/components/_groups.json
6
7
  tokens: # semantic tokens this component uses
7
8
  - color.accent
8
9
  - space.md
@@ -41,3 +42,11 @@ One sentence: what it is for.
41
42
  ## Behaviour
42
43
 
43
44
  Only for a component with behaviour: what changes on interaction, what script (if any) does it, and what an app that renders the component itself (React, say) must do to match.
45
+
46
+ ## Specimens
47
+
48
+ Last: each variant at a glance, for the Components page's catalogue. One block per variant, named in `specimen="…"`, or one block for small variants that read best side by side, such as buttons or statuses, named together ("Primary, secondary, disabled"); `wide=true` gives it a whole row, `live=true` keeps it interactive (only for what shows on hover or focus, like a tooltip). Ids start "sp-" and are unique across every doc. Links go to real pages. A component that can't be shown in a snippet says "None: " and why, in a sentence.
49
+
50
+ ```html {specimen="Default"}
51
+ <!-- the smallest markup that shows this variant -->
52
+ ```
@@ -2,6 +2,7 @@
2
2
  name: accession-label
3
3
  status: stable
4
4
  layouts: [portfolio]
5
+ group: labels
5
6
  tokens:
6
7
  - border.width.emphasis
7
8
  - border.width.hairline
@@ -109,3 +110,20 @@ Store the number in front matter (`accession: LM-W-004`) rather than deriving it
109
110
  - Status is a word plus a dot, never colour alone.
110
111
  - The ticks are a background on a pseudo-element and are invisible to assistive tech.
111
112
  - Pairs: `color.text.accent` on `color.surface.raised` (4.5:1); `color.text.muted` on `color.surface.raised` (4.5:1); `color.status.*.text` on `color.surface.raised` (4.5:1).
113
+
114
+ ## Specimens
115
+
116
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
117
+
118
+ ```html {specimen="Label"}
119
+ <dl class="cx-label" aria-label="Accession label">
120
+ <div class="cx-label__id"><dt>No.</dt><dd>LM-W-001</dd></div>
121
+ <div><dt>Filed</dt><dd><time datetime="2026-03-14">2026-03-14</time></dd></div>
122
+ <div><dt>Role</dt><dd>Sole engineer</dd></div>
123
+ <div><dt>Status</dt><dd><span class="cx-status cx-status--live">Live</span></dd></div>
124
+ </dl>
125
+ ```
126
+
127
+ ```html {specimen="Compact"}
128
+ <p class="cx-id"><span class="cx-id__no">LM-P-031</span><time datetime="2026-10-02">2026-10-02</time><span>6 min read</span></p>
129
+ ```
@@ -2,6 +2,7 @@
2
2
  name: backdrop
3
3
  status: stable
4
4
  layouts: [portfolio, documentation, dashboard]
5
+ group: decoration
5
6
  tokens:
6
7
  - border.width.emphasis
7
8
  - border.width.hairline
@@ -103,3 +104,7 @@ Where text sits on the frost, the contours keep only `color.backdrop.calm` of th
103
104
  - WCAG 2.2.2 (Pause, Stop, Hide) doesn't apply: the settle is over in under five seconds, and every other change follows the reader's own pointer. So there is no pause control.
104
105
  - Under `prefers-reduced-motion: reduce` the contours never move: no settle and no warming.
105
106
  - Reading text between the fades sits on `color.surface.base`, so the declared pairs apply. Text over the frost (the header, the footer, the home page's statement, a documentation site's navigation, and all of a short page) is measured against `color.surface.base` too: by design, contrast is not checked against the contour lines beneath it, which are faint there by the calm side.
107
+
108
+ ## Specimens
109
+
110
+ None: the backdrop is the contours behind a whole page, under the header and above the footer. This site shows it on its home page.
@@ -2,6 +2,7 @@
2
2
  name: button-and-link
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: actions
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -94,3 +95,22 @@ Add `cx-button--sm` for a compact button in a table row or a toolbar, where full
94
95
  - Buttons are 40px tall (`size.target.control`); links at least 24px.
95
96
  - Focus shows `color.focus.ring` 2px off the element, so it never sits on the green fill.
96
97
  - Pairs: `color.text.on-accent` on `color.accent.fill.rest` and `.hover` (4.5:1); `color.accent.fill.rest` against the page (3:1); secondary border `color.border.strong` (3:1); `color.link.rest` (7:1).
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="Primary, secondary, disabled"}
104
+ <a class="cx-button cx-button--primary" href="/guide/getting-started/">Get started <svg class="cx-icon cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></a>
105
+ <a class="cx-button" href="/components/">Browse components</a>
106
+ <button class="cx-button" type="button" disabled>Not yet published</button>
107
+ ```
108
+
109
+ ```html {specimen="Small"}
110
+ <a class="cx-button cx-button--sm" href="/reference/changelog/">Changelog</a>
111
+ ```
112
+
113
+ ```html {specimen="Text link, back link"}
114
+ <a class="cx-link" href="/components/">All components <svg class="cx-icon cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></a>
115
+ <a class="cx-back" href="/guide/"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>Guide</a>
116
+ ```
@@ -2,6 +2,7 @@
2
2
  name: callout
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: content
5
6
  tokens:
6
7
  - border.width.emphasis
7
8
  - border.width.hairline
@@ -74,3 +75,35 @@ Kinds and their icons: no modifier with `note` (info hues), `--tip` with `tip`,
74
75
  - `role="note"` exposes the callout without adding a landmark.
75
76
  - The kind is in text, so colour is a second signal.
76
77
  - Pairs: `color.status.*.text` on `color.status.*.surface` (4.5:1); `color.text.primary` body on each status surface (7:1); `color.status.*.border` (3:1).
78
+
79
+ ## Specimens
80
+
81
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
82
+
83
+ ```html {specimen="Note"}
84
+ <div class="cx-callout" role="note">
85
+ <p class="cx-callout__title"><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-note"></use></svg>Note</p>
86
+ <p>The checker reads the release a project pins.</p>
87
+ </div>
88
+ ```
89
+
90
+ ```html {specimen="Tip"}
91
+ <div class="cx-callout cx-callout--tip" role="note">
92
+ <p class="cx-callout__title"><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-tip"></use></svg>Tip</p>
93
+ <p>Run the checker before you push.</p>
94
+ </div>
95
+ ```
96
+
97
+ ```html {specimen="Warning"}
98
+ <div class="cx-callout cx-callout--warning" role="note">
99
+ <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>
100
+ <p>Renaming a semantic token is a major version bump.</p>
101
+ </div>
102
+ ```
103
+
104
+ ```html {specimen="Danger"}
105
+ <div class="cx-callout cx-callout--danger" role="note">
106
+ <p class="cx-callout__title"><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-danger"></use></svg>Danger</p>
107
+ <p>Never move a release tag.</p>
108
+ </div>
109
+ ```
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: catalogue-grid
3
+ status: stable
4
+ layouts: [documentation]
5
+ group: collections
6
+ tokens:
7
+ - border.focus.offset
8
+ - border.focus.width
9
+ - border.width.hairline
10
+ - color.border.default
11
+ - color.border.strong
12
+ - color.border.subtle
13
+ - color.focus.ring
14
+ - color.surface.hover
15
+ - color.text.accent
16
+ - color.text.muted
17
+ - color.text.primary
18
+ - font.family.mono
19
+ - font.line-height.ui
20
+ - font.size.label
21
+ - font.size.small
22
+ - font.tracking.label
23
+ - font.weight.strong
24
+ - font.weight.ui
25
+ - radius.pill
26
+ - size.column.sidebar
27
+ - size.target.min
28
+ - size.target.touch
29
+ - space.inline.sm
30
+ - space.inline.xs
31
+ - space.inset.lg
32
+ - space.inset.md
33
+ - space.inset.sm
34
+ - space.inset.xs
35
+ - space.stack.sm
36
+ - space.stack.xs
37
+ ---
38
+
39
+ # Catalogue grid
40
+
41
+ Specimens laid out like a printed catalogue: a hairline grid of cells, each showing one thing above a caption that names it and links to its full page.
42
+
43
+ ## When to use
44
+
45
+ - On an overview page that lets a reader scan everything at once: every component variant, or a foundation's samples.
46
+ - When each cell has its own page to go to for the detail.
47
+
48
+ ## When not to use
49
+
50
+ - For content a reader reads in order; use prose or a list.
51
+ - For tabular facts to compare; use a data table (`data-table.md`).
52
+ - As a card grid for work or writing; use project cards (`project-card.md`).
53
+
54
+ ## Markup
55
+
56
+ ```html {preview=true}
57
+ <div class="cx-catalogue">
58
+ <ul class="cx-catalogue__list">
59
+ <li class="cx-catalogue__item">
60
+ <div class="cx-catalogue__specimen" inert><a class="cx-button cx-button--primary" href="/guide/">Get started</a></div>
61
+ <div class="cx-catalogue__caption">
62
+ <p class="cx-catalogue__variant">Primary</p>
63
+ <a class="cx-catalogue__name" href="/components/button-and-link/">Button and link<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></a>
64
+ </div>
65
+ </li>
66
+ <li class="cx-catalogue__item">
67
+ <div class="cx-catalogue__specimen" inert><span class="cx-status cx-status--live">Live</span></div>
68
+ <div class="cx-catalogue__caption">
69
+ <p class="cx-catalogue__variant">Live</p>
70
+ <a class="cx-catalogue__name" href="/components/status/">Status<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></a>
71
+ </div>
72
+ </li>
73
+ <li class="cx-catalogue__item">
74
+ <div class="cx-catalogue__specimen cx-catalogue__specimen--note">The contours behind a whole page.</div>
75
+ <div class="cx-catalogue__caption">
76
+ <p class="cx-catalogue__variant">Backdrop</p>
77
+ <a class="cx-catalogue__name" href="/components/backdrop/">See the page<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></a>
78
+ </div>
79
+ </li>
80
+ </ul>
81
+ </div>
82
+ ```
83
+
84
+ <!-- caption: Catalogue grid parts -->
85
+ | Class | What it is |
86
+ |---|---|
87
+ | `cx-catalogue` | The frame: a rule along the top, and nothing on the outer sides |
88
+ | `cx-catalogue__list` | The cells, as many to a row as fit `size.column.sidebar` |
89
+ | `cx-catalogue__item` | One cell, with rules on its end and bottom; `--wide` takes a whole row |
90
+ | `cx-catalogue__specimen` | What the cell shows, centred; `--note` for a sentence in place of a specimen |
91
+ | `cx-catalogue__caption` | Under a hairline: the variant, then the name |
92
+ | `cx-catalogue__variant` | The variant's name, in `color.text.accent` |
93
+ | `cx-catalogue__name` | The thing's name in the label voice, linking to its page, with an arrow in a hairline circle |
94
+
95
+ In Hugo, `motifspec/catalogue-item.html` writes one cell (`docs/hugo.md`).
96
+
97
+ ## Do
98
+
99
+ - Show the smallest markup that makes each variant recognisable. Small variants of one component that read best side by side (buttons, statuses, tags) share a cell, and its caption names them all; otherwise, one variant to a cell.
100
+ - Make a specimen `inert` when it is a picture of something interactive: it then takes no clicks or tab stops, and assistive technology skips it, so the caption is what a reader hears. The page it links to has the working version.
101
+ - Leave out `inert` only for what shows on hover or focus, such as a tooltip.
102
+ - Give a cell `--wide` for something page-wide, such as a header, a footer or a table.
103
+ - Give every caption a link to the full page.
104
+
105
+ ## Don't
106
+
107
+ - Don't put a heading in a caption; the section's heading names the group.
108
+ - Don't use it for a mix of things with no pages of their own to link to.
109
+ - Don't give ids in specimens that clash with the page's own.
110
+
111
+ ## Accessibility
112
+
113
+ - The grid is a list, so a screen reader announces how many cells there are.
114
+ - Each caption's link names its destination; the variant name sits beside it as text.
115
+ - An `inert` specimen is hidden from assistive technology and can't be focused or clicked, so a page of specimens adds no headings, landmarks or tab stops of its own.
116
+ - Pairs: `color.text.accent` and `color.text.primary` on `color.surface.base`; the rules are `color.border.default`, under the caption `color.border.subtle`.
117
+
118
+ ## Specimens
119
+
120
+ None: the Components page is one, from top to bottom.
@@ -2,6 +2,7 @@
2
2
  name: code-block
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: content
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -117,3 +118,19 @@ Hugo render hook (`layouts/_default/_markup/render-codeblock.html`):
117
118
  - A click copies the code's text (each line's `.cl` span when Chroma wrote them, otherwise the whole `<code>`) with the Clipboard API. The label becomes "Copied", the icon `check`, and `data-state="copied"`.
118
119
  - If the clipboard is unavailable or refused, the code is selected instead, the label becomes "Selected, press Ctrl+C" and `data-state="selected"`.
119
120
  - After `motion.duration.plate`, the button returns to "Copy" with the `content-copy` icon.
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="With a file name" wide=true}
127
+ <figure class="cx-code">
128
+ <figcaption class="cx-code__bar">
129
+ <span>css</span>
130
+ <span class="cx-code__file">css/site.css</span>
131
+ <button class="cx-code__copy" type="button"><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use data-copy-icon href="#cx-icon-content-copy"></use></svg><span class="cx-code__copy-label">Copy</span></button>
132
+ </figcaption>
133
+ <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-css" data-lang="css"><span class="line"><span class="cl"><span class="nt">h1</span> <span class="p">{</span> <span class="k">margin</span><span class="p">:</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span>
134
+ </span></span></code></pre></div>
135
+ </figure>
136
+ ```
@@ -2,6 +2,7 @@
2
2
  name: component-preview
3
3
  status: stable
4
4
  layouts: [documentation]
5
+ group: data
5
6
  tokens:
6
7
  - border.width.hairline
7
8
  - color.border.default
@@ -67,3 +68,7 @@ The frame's document has the theme snippet (`dist/theme-init.js`), `codex.css`,
67
68
  - **Theme:** the frame's document reads the stored theme like any page, and when the page's theme toggle is used, `data-theme` is set on the frame's root too.
68
69
  - **Links:** inside a preview (`body.cx-preview-body`), clicks on links don't navigate.
69
70
  - **Scripts:** the example's own behaviour, such as a theme toggle or a copy button, runs inside the frame from `codex.js`.
71
+
72
+ ## Specimens
73
+
74
+ None: a preview is a live example above its code, in a frame of its own. Every component page opens with one.
@@ -2,6 +2,7 @@
2
2
  name: data-table
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: data
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -93,3 +94,20 @@ A table of things to act on gives each row a state cell (`td.is-state`, with a s
93
94
  - Header cells use `scope`.
94
95
  - Visually hidden text in a cell, such as a hidden column heading or the rest of a button's name, stays inside the scroll box, so a wide table never widens the page on a phone.
95
96
  - Pairs: `color.text.secondary` headers on `color.surface.sunken` (7:1); `color.text.primary` cells on `color.surface.raised` and `color.surface.hover` (7:1).
97
+
98
+ ## Specimens
99
+
100
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
101
+
102
+ ```html {specimen="Table" wide=true}
103
+ <div class="cx-table" role="region" aria-labelledby="sp-tbl-fonts" tabindex="0">
104
+ <table>
105
+ <caption id="sp-tbl-fonts">Font budget <span class="cx-sep" aria-hidden="true">|</span> Latin subset</caption>
106
+ <thead><tr><th scope="col">Family</th><th scope="col">Role</th><th scope="col" class="is-num">KB</th></tr></thead>
107
+ <tbody>
108
+ <tr><th scope="row">National Park</th><td>Display, body</td><td class="is-num">38.1</td></tr>
109
+ <tr><th scope="row">Geist Mono</th><td>Labels, code</td><td class="is-num">33.7</td></tr>
110
+ </tbody>
111
+ </table>
112
+ </div>
113
+ ```
@@ -2,6 +2,7 @@
2
2
  name: disclosure
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: content
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -71,3 +72,21 @@ Add `open` to `<details>` to start it open. Disclosures that follow each other s
71
72
  - No script. The browser opens and closes it, and keeps the `open` attribute in step.
72
73
  - In a framework, render `<details>` and `<summary>` as they are. If the app needs to know the state, listen for the `toggle` event; don't control it from app state, because the browser already owns it.
73
74
  - The chevron's turn uses `motion.duration.base` and stops under reduced motion.
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="Closed"}
81
+ <details class="cx-disclosure">
82
+ <summary>Show as a table<svg class="cx-icon cx-icon--sm cx-disclosure__chevron" aria-hidden="true" focusable="false"><use href="#cx-icon-expand"></use></svg></summary>
83
+ <div class="cx-disclosure__body"><p>The content that opens.</p></div>
84
+ </details>
85
+ ```
86
+
87
+ ```html {specimen="Open"}
88
+ <details class="cx-disclosure" open>
89
+ <summary>Show as a table<svg class="cx-icon cx-icon--sm cx-disclosure__chevron" aria-hidden="true" focusable="false"><use href="#cx-icon-expand"></use></svg></summary>
90
+ <div class="cx-disclosure__body"><p>The content that opens.</p></div>
91
+ </details>
92
+ ```
@@ -2,6 +2,7 @@
2
2
  name: docs-shell
3
3
  status: stable
4
4
  layouts: [documentation]
5
+ group: navigation
5
6
  tokens:
6
7
  - border.focus.offset
7
8
  - border.focus.width
@@ -118,3 +119,27 @@ In Hugo, `partial "motifspec/docs-nav.html" .` writes the navigation from the si
118
119
  - **Without script:** from `size.breakpoint.lg` up, the navigation is shown beside the page and scrolls with it. Narrower, it is in the header's menu, and the article's own "On this page" is hidden, since the header has one.
119
120
  - **With `dist/codex.js`:** while the navigation sits beside the main column, it gets `is-docked`: it sticks below the header and scrolls on its own, sized from `--_viewport-height` and `--_header-height`, which the script keeps up to date. The current page is scrolled into the middle of the docked navigation on load. Docking is checked again on resize.
120
121
  - An app that renders the shell itself does the same, or leaves it undocked.
122
+
123
+ ## Specimens
124
+
125
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
126
+
127
+ ```html {specimen="Side navigation"}
128
+ <nav class="cx-docs-nav" aria-label="Documentation">
129
+ <div class="cx-docs-nav__groups">
130
+ <details class="cx-docs-nav__group" open>
131
+ <summary id="sp-docs-guide">Guide<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-expand"></use></svg></summary>
132
+ <ul class="cx-docs-nav__list" aria-labelledby="sp-docs-guide">
133
+ <li><a href="/guide/getting-started/" aria-current="page">Getting started</a></li>
134
+ <li><a href="/guide/">Overview</a></li>
135
+ </ul>
136
+ </details>
137
+ <details class="cx-docs-nav__group">
138
+ <summary id="sp-docs-reference">Reference<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-expand"></use></svg></summary>
139
+ <ul class="cx-docs-nav__list" aria-labelledby="sp-docs-reference">
140
+ <li><a href="/reference/tokens/">Tokens</a></li>
141
+ </ul>
142
+ </details>
143
+ </div>
144
+ </nav>
145
+ ```
@@ -2,6 +2,7 @@
2
2
  name: figure
3
3
  status: stable
4
4
  layouts: [shared]
5
+ group: content
5
6
  tokens:
6
7
  - border.width.emphasis
7
8
  - border.width.hairline
@@ -101,3 +102,26 @@ A framed image or diagram with a numbered plate label and a caption.
101
102
  - Informative images need `alt`, or `role="img"` and an accessible name for SVG. In Hugo the Markdown alt text becomes that name, so the `.svg` file sets no `role`, `aria-label` or `<title>` of its own. The caption doesn't replace alt text.
102
103
  - The plate number is plain text inside `<figcaption>`.
103
104
  - Pairs: `color.text.secondary` caption on `color.surface.base` (7:1); `color.text.accent` plate label (4.5:1); data series on `color.surface.raised` (3:1). Diagrams, all on `color.surface.raised`: `color.border.strong` nodes, groups and edges (3:1); `color.accent.border` accents (3:1); `color.text.primary` and `color.text.secondary` text (7:1); `color.text.muted` and `color.text.accent` labels (4.5:1).
105
+
106
+ ## Specimens
107
+
108
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
109
+
110
+ ```html {specimen="Diagram" wide=true}
111
+ <figure class="cx-figure cx-figure--diagram">
112
+ <div class="cx-figure__frame">
113
+ <svg class="cx-diagram" viewBox="0 0 720 120" role="img" aria-label="Tokens go through the build, which writes CSS for sites.">
114
+ <defs><marker id="sp-pipeline-head" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto"><path class="cx-diagram__head" d="M0 0 10 5 0 10z"/></marker></defs>
115
+ <rect class="cx-diagram__node" x="20" y="30" width="180" height="60"/>
116
+ <text class="cx-diagram__title" x="110" y="66" text-anchor="middle">tokens/*.json</text>
117
+ <path class="cx-diagram__edge" d="M200 60 H268" marker-end="url(#sp-pipeline-head)"/>
118
+ <rect class="cx-diagram__node cx-diagram__node--accent" x="270" y="30" width="180" height="60"/>
119
+ <text class="cx-diagram__title" x="360" y="66" text-anchor="middle">npm run build</text>
120
+ <path class="cx-diagram__edge" d="M450 60 H518" marker-end="url(#sp-pipeline-head)"/>
121
+ <rect class="cx-diagram__node" x="520" y="30" width="180" height="60"/>
122
+ <text class="cx-diagram__title" x="610" y="66" text-anchor="middle">dist/codex.css</text>
123
+ </svg>
124
+ </div>
125
+ <figcaption><span class="cx-figure__plate">Plate 2</span>One build feeds every consumer.</figcaption>
126
+ </figure>
127
+ ```
@@ -2,6 +2,7 @@
2
2
  name: heading-anchor
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
@@ -76,3 +77,13 @@ Hugo heading render hook (`layouts/_default/_markup/render-heading.html`):
76
77
  - Its accessible name is the `aria-label`, not "#".
77
78
  - The hit area is 44 × 44px, well above the 24px minimum.
78
79
  - Pairs: `color.text.muted` on `color.surface.base` (4.5:1); on hover `color.text.primary` on `color.surface.hover` (7:1).
80
+
81
+ ## Specimens
82
+
83
+ For the Components page: each variant at a glance. Ids start "sp-"; `wide=true` takes a whole row, `live=true` keeps it interactive.
84
+
85
+ ```html {specimen="Section heading"}
86
+ <div class="cx-prose">
87
+ <h2 id="sp-approach">Approach <a class="cx-anchor" href="#sp-approach" aria-label="Link to Approach">#</a></h2>
88
+ </div>
89
+ ```