@aitrien/motifspec 1.17.3 → 1.18.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +37 -9
  3. package/dist/codex.css +26 -6
  4. package/dist/contrast.md +5 -1
  5. package/dist/icons.svg +13 -0
  6. package/dist/tokens.css +1 -1
  7. package/dist/tokens.js +17 -1
  8. package/dist/tokens.json +17 -1
  9. package/docs/components/_template.md +5 -0
  10. package/docs/components/accession-label.md +5 -1
  11. package/docs/components/backdrop.md +3 -1
  12. package/docs/components/button-and-link.md +10 -1
  13. package/docs/components/callout.md +1 -0
  14. package/docs/components/code-block.md +10 -0
  15. package/docs/components/data-table.md +22 -1
  16. package/docs/components/disclosure.md +73 -0
  17. package/docs/components/figure.md +1 -0
  18. package/docs/components/heading-anchor.md +3 -1
  19. package/docs/components/icon.md +3 -2
  20. package/docs/components/keyboard-key.md +53 -0
  21. package/docs/components/ornament.md +2 -0
  22. package/docs/components/pagination.md +1 -0
  23. package/docs/components/post-list-item.md +1 -0
  24. package/docs/components/project-card.md +1 -0
  25. package/docs/components/prose.md +1 -0
  26. package/docs/components/site-footer.md +1 -0
  27. package/docs/components/site-header.md +10 -0
  28. package/docs/components/specimen-plate.md +1 -0
  29. package/docs/components/status.md +74 -0
  30. package/docs/components/table-of-contents.md +9 -0
  31. package/docs/components/tag.md +2 -1
  32. package/docs/components/tooltip.md +6 -0
  33. package/docs/hugo.md +2 -2
  34. package/docs/layouts/a-la-carte.md +36 -0
  35. package/docs/layouts/dashboard.md +58 -0
  36. package/docs/layouts/documentation.md +48 -0
  37. package/docs/{templates.md → layouts/portfolio.md} +34 -2
  38. package/icons/manifest.json +52 -0
  39. package/icons/svg/apps.svg +1 -0
  40. package/icons/svg/close.svg +1 -0
  41. package/icons/svg/dashboard.svg +1 -0
  42. package/icons/svg/dns.svg +1 -0
  43. package/icons/svg/edit.svg +1 -0
  44. package/icons/svg/lan.svg +1 -0
  45. package/icons/svg/menu.svg +1 -0
  46. package/icons/svg/notifications.svg +1 -0
  47. package/icons/svg/restart_alt.svg +1 -0
  48. package/icons/svg/search.svg +1 -0
  49. package/icons/svg/settings.svg +1 -0
  50. package/icons/svg/storage.svg +1 -0
  51. package/icons/svg/terminal.svg +1 -0
  52. package/layouts/_partials/motifspec/filed-under.html +1 -1
  53. package/package.json +1 -1
  54. package/scripts/check.mjs +171 -23
  55. package/scripts/lib.mjs +64 -0
  56. package/tokens/color.json +16 -0
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: figure
3
3
  status: stable
4
+ layouts: [shared]
4
5
  tokens:
5
6
  - border.width.emphasis
6
7
  - border.width.hairline
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: heading-anchor
3
3
  status: stable
4
+ layouts: [portfolio, documentation]
4
5
  tokens:
5
6
  - border.focus.offset
6
7
  - border.focus.width
@@ -27,7 +28,7 @@ A "#" link after a section heading, so readers can copy a link straight to that
27
28
 
28
29
  ## When to use
29
30
 
30
- - On every `<h2>` that has an id: prose sections in posts and case studies, top-level sections of index and docs pages.
31
+ - On every `<h2>` that has an id in reading text: prose sections in posts and case studies, top-level sections of index and docs pages.
31
32
  - On `<h3>` in long documentation where readers link to sub-sections.
32
33
 
33
34
  ## When not to use
@@ -35,6 +36,7 @@ A "#" link after a section heading, so readers can copy a link straight to that
35
36
  - On the page `<h1>`; the page URL already points there.
36
37
  - On headings without an id, or on card and list titles that are themselves links.
37
38
  - On `<h4>` and below.
39
+ - On dashboard sections (`docs/layouts/dashboard.md`): they are places on a screen, not parts of an article. Give them an id and no anchor.
38
40
 
39
41
  ## Markup
40
42
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: icon
3
3
  status: stable
4
+ layouts: [shared]
4
5
  tokens:
5
6
  - size.icon.lg
6
7
  - size.icon.md
@@ -13,13 +14,13 @@ A Material Symbols glyph from the MotifSpec sprite, used to reinforce a control'
13
14
 
14
15
  ## When to use
15
16
 
16
- - Only for the roles listed in `icons/manifest.json`: direction arrows on buttons, links and pagination; the theme toggle; the copy button and its confirmation; callout titles; RSS; external links; back to top; the disclosure chevron.
17
+ - Only for the roles listed in `icons/manifest.json`: direction arrows on buttons, links and pagination; the theme toggle; the copy button and its confirmation; callout titles; RSS; external links; back to top; the disclosure chevron; search, menu, close and edit; and, in the dashboard and documentation layouts, the items of a side navigation and the controls of a toolbar.
17
18
  - Beside text that already says the same thing, so the icon is a second cue.
18
19
 
19
20
  ## When not to use
20
21
 
21
22
  - As decoration, bullets or section markers. Decoration is the ornament set (Yarndings), not icons.
22
- - In headings, tags, nav labels or body copy.
23
+ - In headings, tags or body copy, or in nav labels other than a side navigation's items in the dashboard and documentation layouts. A portfolio's header nav has none.
23
24
  - For anything not in the manifest. A new icon is a new manifest entry and a minor version.
24
25
  - As the only label of a control, unless the control has an accessible name (`aria-label`).
25
26
 
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: keyboard-key
3
+ status: stable
4
+ layouts: [shared]
5
+ tokens:
6
+ - border.width.emphasis
7
+ - border.width.hairline
8
+ - color.border.strong
9
+ - color.surface.sunken
10
+ - font.family.mono
11
+ - font.size.code-inline
12
+ - radius.control
13
+ - space.inset.xs
14
+ ---
15
+
16
+ # Keyboard key
17
+
18
+ A key the reader presses, set as a small keycap: Ctrl K, Esc, Enter.
19
+
20
+ ## When to use
21
+
22
+ - To name a keyboard shortcut beside the control it opens, such as a search field's hint.
23
+ - In instructions that say which keys to press.
24
+
25
+ ## When not to use
26
+
27
+ - For code or something the reader types; that is inline code (`prose.md`).
28
+ - For a button the reader clicks; write the button's label.
29
+ - Inside prose. Markdown and prose already style `<kbd>`, so add no class there.
30
+
31
+ ## Markup
32
+
33
+ ```html preview
34
+ <kbd class="cx-kbd">Ctrl</kbd> <kbd class="cx-kbd">K</kbd>
35
+ ```
36
+
37
+ One `<kbd>` per key, with a space between keys that are pressed together.
38
+
39
+ ## Do
40
+
41
+ - Name keys as they're printed on most keyboards: Ctrl, Shift, Esc, Enter, the letter in capitals.
42
+ - Show both forms when they differ by platform, separated by "or": <kbd class="cx-kbd">Ctrl</kbd> <kbd class="cx-kbd">K</kbd> or <kbd class="cx-kbd">⌘</kbd> <kbd class="cx-kbd">K</kbd>.
43
+
44
+ ## Don't
45
+
46
+ - Don't use it for decoration or emphasis.
47
+ - Don't show a shortcut that doesn't work in the browser the reader is using.
48
+
49
+ ## Accessibility
50
+
51
+ - `<kbd>` is announced as text, so the keys read in order.
52
+ - A shortcut is never the only way in: the control it opens has its own visible label.
53
+ - Pairs: `color.text.primary` on `color.surface.sunken` (7:1).
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: ornament
3
3
  status: stable
4
+ layouts: [portfolio, documentation]
4
5
  tokens:
5
6
  - border.width.hairline
6
7
  - color.border.subtle
@@ -31,6 +32,7 @@ Yarndings 12 knitting-chart glyphs: the footer band, the prose divider, the arti
31
32
 
32
33
  - As icons, bullets, status markers or anything that carries meaning.
33
34
  - More than one ornament group in a viewport.
35
+ - On dashboards (`docs/layouts/dashboard.md`), which have no ornaments.
34
36
  - Glyphs in `codex.glyphs.forbidden` (`u v w x y z [ ] { }`): faces, a robot, hearts and animals read as emoji and are never allowed.
35
37
 
36
38
  ## Markup
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: pagination
3
3
  status: stable
4
+ layouts: [shared]
4
5
  tokens:
5
6
  - border.focus.offset
6
7
  - border.focus.width
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: post-list-item
3
3
  status: stable
4
+ layouts: [portfolio]
4
5
  tokens:
5
6
  - border.focus.offset
6
7
  - border.focus.width
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: project-card
3
3
  status: stable
4
+ layouts: [portfolio]
4
5
  tokens:
5
6
  - border.focus.offset
6
7
  - border.focus.width
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: prose
3
3
  status: stable
4
+ layouts: [shared]
4
5
  tokens:
5
6
  - border.focus.offset
6
7
  - border.focus.width
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: site-footer
3
3
  status: stable
4
+ layouts: [shared]
4
5
  tokens:
5
6
  - border.width.hairline
6
7
  - color.border.subtle
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: site-header
3
3
  status: stable
4
+ layouts: [shared]
4
5
  tokens:
5
6
  - border.focus.offset
6
7
  - border.focus.width
@@ -122,3 +123,12 @@ Copy the snippet as it is: the build fails if this doc and `js/theme-init.js` di
122
123
  - The toggle's `aria-label` is its action ("Switch to light theme"); the visible tooltip repeats it and is `aria-hidden`. Escape hides the tooltip without moving the pointer (see `tooltip.md`).
123
124
  - `aria-current` carries the current state for assistive tech; the outline is the visual cue.
124
125
  - Pairs: `color.text.secondary` and `color.text.primary` on `color.surface.base` (7:1); `color.border.strong` on `color.surface.base` (current outline, 3:1). On a backdrop page the frost is measured as `color.surface.base`; the contour lines beneath it are not part of the check.
126
+
127
+ ## Behaviour
128
+
129
+ `dist/codex.js` adds this; an app that renders the header itself does the same.
130
+
131
+ - **Theme toggle:** ships `hidden` and is shown by script. A click switches between light and dark: it sets `data-theme` on `<html>`, or removes it when the choice matches the system again, so the page follows the system from then on. The choice is stored as `cx-theme` in `localStorage` (`light` or `dark`; removed for system), and `dist/theme-init.js` applies it before first paint. The toggle's `aria-label` and tooltip always name the action ("Switch to dark theme").
132
+ - **System changes:** while following the system, a change to the system theme updates the toggle's label.
133
+ - **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`.
134
+ - **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.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: specimen-plate
3
3
  status: stable
4
+ layouts: [portfolio]
4
5
  tokens:
5
6
  - border.focus.offset
6
7
  - border.focus.width
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: status
3
+ status: stable
4
+ layouts: [shared]
5
+ tokens:
6
+ - border.width.emphasis
7
+ - color.status.danger.text
8
+ - color.status.info.text
9
+ - color.status.success.text
10
+ - color.status.warning.text
11
+ - color.text.muted
12
+ - font.family.mono
13
+ - font.line-height.ui
14
+ - font.size.label
15
+ - font.tracking.label
16
+ - radius.round
17
+ - space.inline.xs
18
+ - space.inset.sm
19
+ ---
20
+
21
+ # Status
22
+
23
+ A short mono label with a dot that names a state: online, degraded, down, live, archived.
24
+
25
+ ## When to use
26
+
27
+ - Beside something whose state changes and matters: a service, a node, a build, a project.
28
+ - In a table's state column (`td.is-state`), a card's meta line, an event in a feed.
29
+ - Wherever the state needs to be scanned at a glance, with the word carrying the meaning and the colour repeating it.
30
+
31
+ ## When not to use
32
+
33
+ - For a topic or technology; that is a tag (`tag.md`).
34
+ - For a message the reader must read in full; that is a callout (`callout.md`).
35
+ - As the only sign of a problem on a page. A problem that needs action also gets a callout.
36
+
37
+ ## Markup
38
+
39
+ ```html preview
40
+ <span class="cx-status cx-status--success">Online</span>
41
+ <span class="cx-status cx-status--warning">Degraded</span>
42
+ <span class="cx-status cx-status--danger">Down</span>
43
+ <span class="cx-status cx-status--info">Updating</span>
44
+ <span class="cx-status cx-status--muted">Scheduled</span>
45
+ ```
46
+
47
+ | Tone | For | Example words |
48
+ |---|---|---|
49
+ | `--success` | Working, passing, done | Online, Running, Passed, Done |
50
+ | `--warning` | Needs attention soon, or in progress | Degraded, Restarting, High, Building |
51
+ | `--danger` | Failed or stopped | Down, Offline, Failed |
52
+ | `--info` | Neutral and informative | Updating, Update, New |
53
+ | `--muted` | Not active: waiting, paused or finished with | Scheduled, Paused, Archived |
54
+
55
+ A portfolio's project statuses are named variants of these: `cx-status--live` (success), `--building` (warning) and `--archived` (muted). Use them on cards and accession labels (`accession-label.md`).
56
+
57
+ ## Do
58
+
59
+ - Write the state as a word, always. The dot and colour repeat it.
60
+ - Keep it to one or two words, in the reader's terms ("Down", not "HTTP 503").
61
+ - Use the same word for the same state everywhere on a page: in the navigation, the table and the feed.
62
+
63
+ ## Don't
64
+
65
+ - Don't use a tone for decoration or to mean something else, such as a category. Status colours are reserved for status.
66
+ - Don't pick a tone by how a word sounds; pick it by what the reader should do.
67
+ - Don't animate the dot to draw attention.
68
+
69
+ ## Accessibility
70
+
71
+ - The word is the text, so the state reads without colour. The dot is a CSS pseudo-element and isn't announced.
72
+ - `--muted` draws a ring instead of a solid dot, so it differs in shape as well as colour.
73
+ - 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).
74
+ - 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.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: table-of-contents
3
3
  status: stable
4
+ layouts: [portfolio, documentation]
4
5
  tokens:
5
6
  - border.focus.offset
6
7
  - border.focus.width
@@ -81,3 +82,11 @@ A numbered list of an article's sections, beside the text on wide screens and ab
81
82
  - The active entry is announced through `aria-current`, not colour alone (it also gets the accent rule).
82
83
  - Entries are at least 24px tall.
83
84
  - Pairs: `color.text.secondary` on `color.surface.base` (7:1); active rule `color.accent.border` (3:1).
85
+
86
+ ## Behaviour
87
+
88
+ `dist/codex.js` adds this; an app that renders the table of contents itself does the same.
89
+
90
+ - **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
+ - **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
+ - Without script, the table of contents is a plain open list, and its `<details>` opens and closes natively.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: tag
3
3
  status: stable
4
+ layouts: [shared]
4
5
  tokens:
5
6
  - border.focus.offset
6
7
  - border.focus.width
@@ -37,7 +38,7 @@ A small mono label for a topic or technology, optionally linking to its index.
37
38
 
38
39
  ## When not to use
39
40
 
40
- - For status; use `cx-status` in an accession label.
41
+ - For status; use `status.md`.
41
42
  - For actions; use `button-and-link`.
42
43
  - For more than three tags on a card or five on a post.
43
44
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: tooltip
3
3
  status: stable
4
+ layouts: [shared]
4
5
  tokens:
5
6
  - color.surface.inverse
6
7
  - color.text.inverse
@@ -65,3 +66,8 @@ It opens below the control, aligned to its right edge. Add `cx-tooltip--start` t
65
66
  - It shows on `:focus-visible` as well as `:hover`, so keyboard users see it too.
66
67
  - Escape hides it without moving the pointer or focus (WCAG 1.4.13).
67
68
  - Pair: `color.text.inverse` on `color.surface.inverse` (7:1 in both themes).
69
+
70
+ ## Behaviour
71
+
72
+ - Showing is CSS: the tooltip appears while its control is hovered or has `:focus-visible`.
73
+ - `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.
package/docs/hugo.md CHANGED
@@ -66,7 +66,7 @@ Every partial below is called as `partial "motifspec/<name>.html" <context>`.
66
66
  | `table-of-contents.html` | `table-of-contents.md` | A page. `article.html` already calls it. |
67
67
  | `tags.html` | `tag.md` | `dict "page" . "max" 3`. |
68
68
  | `tag-filter.html` | `tag.md` | `dict "section" "work" "current" nil` on a section page, or `dict "section" "" "current" .` on a term page. |
69
- | `filed-under.html` | `tag.md`, `docs/templates.md` | A page. "Filed under" and its tags, after an article. |
69
+ | `filed-under.html` | `tag.md`, `docs/layouts/portfolio.md` | A page. "Filed under" and its tags, after an article. |
70
70
  | `pagination-entries.html` | `pagination.md` | `dict "page" . "label" "Post navigation" "noun" "Post"`. Previous and next in the page's section, oldest first. |
71
71
  | `pagination-pages.html` | `pagination.md` | `dict "pager" $pager "label" "Writing pages"`. Pages of a paginated list; nothing when it fits on one page. |
72
72
  | `back-link.html` | `button-and-link.md` | `dict "href" "…" "label" "All work"`. |
@@ -125,7 +125,7 @@ const motifspec = mounts.split(/\n(?=\{)/).map((m) => JSON.parse(m)).find((m) =>
125
125
  execFileSync('node', [join(motifspec.dir, 'scripts', 'check.mjs'), '.'], { stdio: 'inherit' });
126
126
  ```
127
127
 
128
- It checks `layouts/` and `content/` for what the README's Commands section lists. In GitHub Actions each problem is also an annotation on the pull request; `--json` prints the problems as JSON. In CI, give the step the same `HUGO_CACHEDIR` and `HUGO_MODULE_PROXY` as the build, because `hugo config mounts` downloads the module if it isn't cached.
128
+ It checks `layouts/` and `content/` for what the README's Commands section lists, against the layout the site declares in `[params.motifspec]` (see the README's Layouts section; portfolio when it declares none). In GitHub Actions each problem is also an annotation on the pull request; `--json` prints the problems as JSON. In CI, give the step the same `HUGO_CACHEDIR` and `HUGO_MODULE_PROXY` as the build, because `hugo config mounts` downloads the module if it isn't cached.
129
129
 
130
130
  ## Overriding
131
131
 
@@ -0,0 +1,36 @@
1
+ # À la carte
2
+
3
+ For a project that fits none of the layouts, such as an app built around a full-screen canvas or map. It takes MotifSpec's tokens and the components it chooses, and brings its own frame. Declare it with `layout = "a-la-carte"` and list the components it uses (see `README.md`, Layouts).
4
+
5
+ ## What it gets
6
+
7
+ - Every shared component, without listing them.
8
+ - The layout components it lists by doc name (the file name in `docs/components/` without `.md`), such as `table-of-contents` or `heading-anchor`, from any layout.
9
+
10
+ The checker treats any other layout component as a problem, so a project can't borrow parts by accident: add a component to the list when you mean to use it.
11
+
12
+ ## Its own frame
13
+
14
+ There is no MotifSpec shell. The project lays out its own frame, for example controls placed over a canvas. That is the one case where a project using MotifSpec may have a stylesheet of its own, and the checker holds it to these rules:
15
+
16
+ - Every colour, size, radius, border width and duration is a semantic token (`var(--cx-…)`), as in MotifSpec's own CSS.
17
+ - No selector targets a `cx-` class: MotifSpec's components aren't restyled or overridden. A component that needs to change is changed in MotifSpec.
18
+ - The project's own class names don't start with `cx-`.
19
+
20
+ Use the stylesheet for the frame only. Anything that looks like a component belongs in MotifSpec first.
21
+
22
+ ## Decoration
23
+
24
+ The project decides, within `backdrop.md` and `ornament.md`.
25
+
26
+ ## Headings
27
+
28
+ One `<h1>` per page. Use heading anchors only on headings that start sections of reading text.
29
+
30
+ ## Choosing a stack
31
+
32
+ | The project | Use |
33
+ |---|---|
34
+ | Already has a stack | Keep it. MotifSpec adapts to the project, not the reverse. |
35
+ | An app with state, live data or a lot of interaction | React, or the app's own framework, with `@aitrien/motifspec` from npm and the components' markup. |
36
+ | Mostly pages to read | Probably a layout, not à la carte: see `portfolio.md` and `documentation.md`. |
@@ -0,0 +1,58 @@
1
+ # Dashboard layout
2
+
3
+ For tools and admin screens: an overview of systems, lists of things to act on, settings. Declare it with `layout = "dashboard"` (see `README.md`, Layouts).
4
+
5
+ ## Status
6
+
7
+ In progress. The dashboard's own components arrive in later releases, so this file says what exists now and what doesn't.
8
+
9
+ - **Available now:** every shared component, including buttons and compact buttons, callouts, data tables with state and action cells, status labels in five tones, disclosures, keyboard keys, code blocks, tags, tooltips, and icons for navigation and tools (`icon.md`).
10
+ - **Not available yet:** the app shell, side navigation, panels, stat tiles, meters, sparklines and charts, resource cards, the facts list, the event feed, the segmented control, form controls and the dialog.
11
+
12
+ Don't write classes for parts that aren't available. The checker fails on any `cx-` class MotifSpec doesn't define. Build what you can from the shared components, and say which parts MotifSpec doesn't have yet.
13
+
14
+ ## Shell
15
+
16
+ Planned: a side navigation column (wordmark, grouped links, the theme toggle and a context line at its foot) beside the main region. Below `size.breakpoint.md`, the side navigation becomes a bar with a Menu disclosure that ships closed. Until it ships, use the site header and footer.
17
+
18
+ ## Page templates
19
+
20
+ | Template | Order | Dominant | Secondary |
21
+ |---|---|---|---|
22
+ | **Overview** | Page head (title, when the readings were last updated, page-wide controls) → alerts as callouts → headline figures → the main column and a side column of sections | Alerts and headline figures | Detail sections |
23
+ | **List** | Page head → filters → a data table with row actions → pagination | The table | Filters |
24
+ | **Detail** | Page head with the item's status → its facts → its readings → related lists | Status and readings | Related lists |
25
+ | **Form** | Page head → grouped fields → actions at the end of the form | The fields | Help text |
26
+ | **Empty and error** | Page head → what's missing or what failed, and what to do next | The message | Links back |
27
+
28
+ ## Components
29
+
30
+ Every shared component, plus the components whose doc lists `dashboard` under `layouts:`. Portfolio parts (catalogue numbers, accession labels, project cards, post rows, plates) don't belong on a dashboard.
31
+
32
+ ## Decoration
33
+
34
+ - The backdrop fills the background of the main area, behind the content, for now; review this once a real dashboard has been used.
35
+ - No ornaments.
36
+
37
+ ## Headings
38
+
39
+ - One `<h1>` per page: the page title.
40
+ - Section headings are `<h2>` with an id. On dashboard sections they take no heading anchor: sections are places on a screen, not parts of an article.
41
+
42
+ ## Live data
43
+
44
+ MotifSpec doesn't fetch data; where an app gets its readings is the project's decision. How readings appear:
45
+
46
+ - Readings that update on a schedule aren't live regions, so a screen reader isn't interrupted on every update. New alerts and state changes are announced once, through one polite live region (`role="status"`) per page.
47
+ - The page says when its readings were last updated, as a `<time>`. A source that has gone quiet says so ("No readings since 13:58"); old numbers are never shown as current.
48
+ - Values change in place, with no counting animation and nothing flashing.
49
+ - A section whose source fails says so and when it last worked; the rest of the page keeps working.
50
+ - Recommended: the page requests readings only from its own backend, on the same origin, and the backend queries each service. That keeps API keys off the browser and gives one place to notice a source that has stopped.
51
+
52
+ ## Choosing a stack
53
+
54
+ | The project | Use |
55
+ |---|---|
56
+ | Already has a stack | Keep it. MotifSpec adapts to the project, not the reverse. |
57
+ | A dashboard with live data or a lot of interaction (most dashboards) | React, or the app's own framework, with `@aitrien/motifspec` from npm and the components' markup. |
58
+ | A dashboard of reports that can be rebuilt on a schedule | Hugo with the module. |
@@ -0,0 +1,48 @@
1
+ # Documentation layout
2
+
3
+ For product and system documentation: guides, reference pages and a changelog. motifspec.com will be its first site. Declare it with `layout = "documentation"` (see `README.md`, Layouts).
4
+
5
+ ## Status
6
+
7
+ In progress. The documentation shell and its own components arrive in a later release, so this file says what exists now and what doesn't.
8
+
9
+ - **Available now:** every shared component, including disclosures and keyboard keys, plus the table of contents, heading anchors and the ornaments.
10
+ - **Not available yet:** the documentation shell, the top bar with search and version, the docs sidebar, page actions (Copy page), the page footer (edit link, last updated), the component preview, the token table, steps and tabs.
11
+
12
+ Don't write classes for parts that aren't available. The checker fails on any `cx-` class MotifSpec doesn't define. Build what you can from the shared components, and say which parts MotifSpec doesn't have yet.
13
+
14
+ ## Shell
15
+
16
+ Planned: a top bar (wordmark, search, section nav, version, theme toggle, repository link), grouped page navigation on the left, the article in the middle and "On this page" on the right. Below `size.breakpoint.md`, the page navigation sits behind a Menu disclosure and "On this page" moves above the article. Until it ships, use the site header and footer with the table of contents.
17
+
18
+ ## Page templates
19
+
20
+ | Template | Order | Dominant | Secondary |
21
+ |---|---|---|---|
22
+ | **Docs home** | Header → statement (display h1, lede) → entry points to each section → what's new → footer | The statement and entry points | What's new |
23
+ | **Article** | Header → title and lede → TOC + prose with figures, code blocks, callouts and tables → edit link and last updated → previous and next → footer | The prose column | TOC, page actions |
24
+ | **Reference table** | Header → title and one-line intro → the table (tokens, icons, rules) → footer | The table | Intro |
25
+ | **Changelog** | Header → title → releases, newest first, each with its version, date and changes → footer | The releases | Dates |
26
+ | **404** | Header → h1 "Page not found" → links to the docs home and search → footer | Heading and the routes out | |
27
+
28
+ ## Components
29
+
30
+ Every shared component, plus the components whose doc lists `documentation` under `layouts:`. Catalogue numbers, accession labels, project cards and post rows belong to the portfolio.
31
+
32
+ ## Decoration
33
+
34
+ - The head of the backdrop on the docs home, and its foot behind the footer on every page.
35
+ - The footer band. No other ornaments in articles.
36
+
37
+ ## Headings
38
+
39
+ - One `<h1>` per page.
40
+ - Every `<h2>` in an article has an id and a heading anchor; `<h3>`s in long pages may have one too (`heading-anchor.md`).
41
+
42
+ ## Choosing a stack
43
+
44
+ | The project | Use |
45
+ |---|---|
46
+ | Already has a stack | Keep it. MotifSpec adapts to the project, not the reverse. |
47
+ | A new documentation site | Hugo with the module (`docs/hugo.md`). |
48
+ | Documentation inside an app | The app's own framework, with `@aitrien/motifspec` from npm and the components' markup. |
@@ -1,6 +1,14 @@
1
- # Page templates
1
+ # Portfolio layout
2
2
 
3
- Content hierarchy for the six page types. Every template sits on the backdrop (`components/backdrop.md`): its contours show behind the footer, and on the home page behind the header and the statement too. Every template keeps the full site header (Work, Writing, About, the theme toggle) and the footer. Every `<h2>` section heading carries a heading anchor.
3
+ For a personal or studio portfolio: case studies, writing and an about page. aitrien.com uses it. Declare it with `layout = "portfolio"` (see `README.md`, Layouts); a project that declares nothing is checked as portfolio.
4
+
5
+ ## Shell
6
+
7
+ The site header, the main region and the site footer, on a backdrop page. In Hugo the shell is the page shell in `docs/hugo.md`; elsewhere, copy the markup from `site-header.md`, `site-footer.md` and `backdrop.md`.
8
+
9
+ ## Page templates
10
+
11
+ Every template sits on the backdrop (`backdrop.md`): its contours show behind the footer, and on the home page behind the header and the statement too. Every template keeps the full site header (Work, Writing, About, the theme toggle) and the footer.
4
12
 
5
13
  | Template | Order | Dominant | Secondary |
6
14
  |---|---|---|---|
@@ -11,11 +19,35 @@ Content hierarchy for the six page types. Every template sits on the backdrop (`
11
19
  | **Blog post** | Header → back link "← All writing" → meta line (`cx-id`: number, date, reading time) → h1 and lede → article layout: TOC (when three or more h2s) + prose with figures, code blocks and callouts → end mark → "Filed under" tags → pagination → footer | The prose column | Meta, TOC |
12
20
  | **404** | Header → sprout ornament (lg) → accession label "No. — / Not in collection" → h1 "Page not found" → the requested path in mono → three links: Home, Work, Writing → footer | Heading and the routes out | Ornament, path |
13
21
 
22
+ ## Components
23
+
24
+ Every shared component, plus the components whose doc lists `portfolio` under `layouts:`: accession label, backdrop, heading anchor, ornament, post list item, project card, specimen plate and table of contents.
25
+
14
26
  ## Catalogue numbers
15
27
 
28
+ Catalogue numbers belong to this layout only.
29
+
16
30
  - Work: `LM-W-001` onward. Writing: `LM-P-001` onward. Zero-padded, never reused, stored in front matter as `accession`.
17
31
  - They appear on cards, post rows, post meta lines and case-study labels.
18
32
 
33
+ ## Decoration
34
+
35
+ - The head of the backdrop on the home page, and its foot behind the footer on every page.
36
+ - Ornaments as `ornament.md` places them: the footer band, the prose divider, the article end mark and the 404 glyph.
37
+
38
+ ## Headings
39
+
40
+ - One `<h1>` per page.
41
+ - Every `<h2>` section heading has an id and a heading anchor (`heading-anchor.md`).
42
+
19
43
  ## Front matter
20
44
 
21
45
  The fields each template reads are in `docs/hugo.md` (Front matter the partials read).
46
+
47
+ ## Choosing a stack
48
+
49
+ | The project | Use |
50
+ |---|---|
51
+ | Already has a stack | Keep it. MotifSpec adapts to the project, not the reverse. |
52
+ | A new portfolio or content site | Hugo with the module (`docs/hugo.md`). |
53
+ | An app with state, live data or a lot of interaction | React, or the app's own framework, with `@aitrien/motifspec` from npm and the components' markup. |
@@ -70,6 +70,58 @@
70
70
  "play": {
71
71
  "symbol": "play_arrow",
72
72
  "use": "Resume control for ambient motion while it is paused."
73
+ },
74
+ "search": {
75
+ "symbol": "search",
76
+ "use": "The search field and the control that opens search."
77
+ },
78
+ "menu": {
79
+ "symbol": "menu",
80
+ "use": "The Menu control that opens the navigation on a phone, in the dashboard and documentation layouts."
81
+ },
82
+ "close": {
83
+ "symbol": "close",
84
+ "use": "Closing a dialog, the search panel or an opened menu."
85
+ },
86
+ "edit": {
87
+ "symbol": "edit",
88
+ "use": "\"Edit this page\" links in the documentation layout, and edit actions in a dashboard."
89
+ },
90
+ "dashboard": {
91
+ "symbol": "dashboard",
92
+ "use": "Before the overview item in a dashboard's side navigation."
93
+ },
94
+ "notifications": {
95
+ "symbol": "notifications",
96
+ "use": "Before alerts in a dashboard's side navigation."
97
+ },
98
+ "dns": {
99
+ "symbol": "dns",
100
+ "use": "Before servers, nodes and hosts in a dashboard's side navigation."
101
+ },
102
+ "storage": {
103
+ "symbol": "storage",
104
+ "use": "Before storage, pools and disks in a dashboard's side navigation."
105
+ },
106
+ "lan": {
107
+ "symbol": "lan",
108
+ "use": "Before networks in a dashboard's side navigation."
109
+ },
110
+ "apps": {
111
+ "symbol": "apps",
112
+ "use": "Before applications and services in a dashboard's side navigation."
113
+ },
114
+ "settings": {
115
+ "symbol": "settings",
116
+ "use": "Before settings in a side navigation, and settings controls in a toolbar."
117
+ },
118
+ "restart": {
119
+ "symbol": "restart_alt",
120
+ "use": "Restart actions, such as restarting a service."
121
+ },
122
+ "logs": {
123
+ "symbol": "terminal",
124
+ "use": "Logs and consoles: a link or action that opens them."
73
125
  }
74
126
  }
75
127
  }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M191.12-191.12q-15.73-15.73-15.73-38.73 0-23 15.73-38.73 15.73-15.73 38.73-15.73 23 0 38.73 15.73 15.73 15.73 15.73 38.73 0 23-15.73 38.73-15.73 15.73-38.73 15.73-23 0-38.73-15.73Zm250.15 0q-15.73-15.73-15.73-38.73 0-23 15.73-38.73Q457-284.31 480-284.31q23 0 38.73 15.73 15.73 15.73 15.73 38.73 0 23-15.73 38.73Q503-175.39 480-175.39q-23 0-38.73-15.73Zm250.15 0q-15.73-15.73-15.73-38.73 0-23 15.73-38.73 15.73-15.73 38.73-15.73 23 0 38.73 15.73 15.73 15.73 15.73 38.73 0 23-15.73 38.73-15.73 15.73-38.73 15.73-23 0-38.73-15.73Zm-500.3-250.15Q175.39-457 175.39-480q0-23 15.73-38.73 15.73-15.73 38.73-15.73 23 0 38.73 15.73Q284.31-503 284.31-480q0 23-15.73 38.73-15.73 15.73-38.73 15.73-23 0-38.73-15.73Zm250.15 0Q425.54-457 425.54-480q0-23 15.73-38.73Q457-534.46 480-534.46q23 0 38.73 15.73Q534.46-503 534.46-480q0 23-15.73 38.73Q503-425.54 480-425.54q-23 0-38.73-15.73Zm250.15 0Q675.69-457 675.69-480q0-23 15.73-38.73 15.73-15.73 38.73-15.73 23 0 38.73 15.73Q784.61-503 784.61-480q0 23-15.73 38.73-15.73 15.73-38.73 15.73-23 0-38.73-15.73Zm-500.3-250.15q-15.73-15.73-15.73-38.73 0-23 15.73-38.73 15.73-15.73 38.73-15.73 23 0 38.73 15.73 15.73 15.73 15.73 38.73 0 23-15.73 38.73-15.73 15.73-38.73 15.73-23 0-38.73-15.73Zm250.15 0q-15.73-15.73-15.73-38.73 0-23 15.73-38.73Q457-784.61 480-784.61q23 0 38.73 15.73 15.73 15.73 15.73 38.73 0 23-15.73 38.73Q503-675.69 480-675.69q-23 0-38.73-15.73Zm250.15 0q-15.73-15.73-15.73-38.73 0-23 15.73-38.73 15.73-15.73 38.73-15.73 23 0 38.73 15.73 15.73 15.73 15.73 38.73 0 23-15.73 38.73-15.73 15.73-38.73 15.73-23 0-38.73-15.73Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="m250.92-218.92-32-32L448-480 218.92-709.08l32-32L480-512l229.08-229.08 32 32L512-480l229.08 229.08-32 32L480-448 250.92-218.92Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M522.69-578.08V-820H820v241.92H522.69ZM140-467.31V-820h297.31v352.69H140ZM522.69-140v-352.69H820V-140H522.69ZM140-140v-241.92h297.31V-140H140Zm45.39-372.69h206.53v-261.92H185.39v261.92Zm382.69 327.3h206.53v-261.92H568.08v261.92Zm0-438.07h206.53v-151.15H568.08v151.15ZM185.39-185.39h206.53v-151.15H185.39v151.15Zm206.53-327.3Zm176.16-110.77Zm0 176.15ZM391.92-336.54Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M290.37-695.46q-17.83 0-30.22 12.48-12.38 12.48-12.38 30.31 0 17.82 12.48 30.21 12.48 12.38 30.31 12.38 17.82 0 30.21-12.48 12.38-12.48 12.38-30.3 0-17.83-12.48-30.22-12.48-12.38-30.3-12.38Zm0 385.54q-17.83 0-30.22 12.48-12.38 12.48-12.38 30.3 0 17.83 12.48 30.22 12.48 12.38 30.31 12.38 17.82 0 30.21-12.48 12.38-12.48 12.38-30.31 0-17.82-12.48-30.21-12.48-12.38-30.3-12.38ZM140-497.85v-309.22h680v309.22H140Zm45.39-263.84v218.46h589.22v-218.46H185.39ZM140-112.31v-309.84h680v309.84H140Zm45.39-264.46v219.08h589.22v-219.08H185.39Zm0-384.92v218.46-218.46Zm0 384.92v219.08-219.08Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M185.39-185.39h40.92l468.54-467.92-40.93-40.92-468.53 467.92v40.92ZM140-140v-104.54l593.54-593.69 105.69 105.31L244.54-140H140Zm634-593.92L734.54-773 774-733.92Zm-99.37 60.29-20.71-20.6 40.93 40.92-20.22-20.32Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M130-90v-252.69h120v-160h207.31v-114.62h-120V-870h285.38v252.69h-120v114.62H710v160h120V-90H544.62v-252.69h120v-114.62H295.38v114.62h120V-90H130Zm252.69-572.69h194.62v-161.93H382.69v161.93ZM175.38-135.38H370v-161.93H175.38v161.93Zm414.62 0h194.62v-161.93H590v161.93ZM480-662.69ZM370-297.31Zm220 0Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M140-254.62V-300h680v45.38H140Zm0-202.69v-45.38h680v45.38H140ZM140-660v-45.38h680V-660H140Z"/></svg>