@fusion.dev/helix-docs 0.0.0-dev → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/content/browser-support.mdx +2 -2
- package/content/charting.mdx +4 -8
- package/content/coding-agents.mdx +14 -22
- package/content/color-modes.mdx +4 -4
- package/content/color.mdx +2 -2
- package/content/elevation-and-material.mdx +2 -2
- package/content/events.mdx +1 -1
- package/content/forms.mdx +5 -7
- package/content/iconography.mdx +15 -12
- package/content/installation.mdx +4 -6
- package/content/introduction.mdx +1 -1
- package/content/metrics.mdx +214 -214
- package/content/other-frameworks.mdx +6 -5
- package/content/overriding-a-component.mdx +11 -15
- package/content/routing.mdx +4 -4
- package/content/server-rendering.mdx +1 -1
- package/content/shape-and-borders.mdx +19 -8
- package/content/space-and-size.mdx +1 -1
- package/content/state-and-control.mdx +5 -5
- package/content/svelte.mdx +3 -3
- package/content/theme-builder.mdx +1 -1
- package/content/theming.mdx +1 -1
- package/content/tiers.mdx +2 -2
- package/content/tokens.mdx +4 -4
- package/content/using-helix-with-an-agent.mdx +30 -27
- package/content/using-the-elements.mdx +0 -2
- package/content/visual-axes.mdx +5 -7
- package/content/without-a-bundler.mdx +4 -5
- package/dist/catalog.d.ts +19 -29
- package/dist/catalog.js +27 -49
- package/dist/naming.js +1 -1
- package/dist/pages.generated.d.ts +1 -1
- package/dist/pages.generated.js +1 -1
- package/dist/reference.js +1 -1
- package/dist/registry.d.ts +3 -3
- package/dist/registry.js +3 -3
- package/dist/sections.d.ts +3 -7
- package/dist/sections.js +3 -7
- package/dist/sources.generated.d.ts +2 -2
- package/dist/sources.generated.js +367 -374
- package/package.json +6 -2
package/dist/catalog.js
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import { displayName, startCase, tierOf } from './naming.js';
|
|
2
2
|
import { place } from './reference.js';
|
|
3
|
-
/* The headless twin's slug, and the suffix every other one carries. Named
|
|
4
|
-
because the sort and the label both ask, and a tier that has been renamed
|
|
5
|
-
once can be renamed again. */
|
|
6
3
|
/**
|
|
7
|
-
* The canonical example's slug, named once because three places
|
|
4
|
+
* The canonical example's slug, named once because three places ask for it.
|
|
8
5
|
*
|
|
9
|
-
* The tier pairing, the first-position pin and the label all
|
|
10
|
-
*
|
|
11
|
-
* pin because the old name sorted early by accident, the pairing because a twin
|
|
12
|
-
* mirrors this one, the label because it reads from the name. A fact three
|
|
13
|
-
* places hold is a fact that drifts, which the comment on the sort below
|
|
14
|
-
* already records happening once when the tier was called `base`.
|
|
6
|
+
* The tier pairing, the first-position pin and the label all read it. A fact
|
|
7
|
+
* three places hold is a fact that drifts.
|
|
15
8
|
*/
|
|
16
9
|
const CANONICAL = 'preview';
|
|
10
|
+
/* The headless twin's slug, and the suffix every other one carries. */
|
|
17
11
|
const HEADLESS = 'headless';
|
|
18
12
|
const HEADLESS_SUFFIX = /\.headless$/;
|
|
19
13
|
/**
|
|
@@ -24,8 +18,7 @@ const HEADLESS_SUFFIX = /\.headless$/;
|
|
|
24
18
|
* on the host that a React consumer's server markup never had. That makes the
|
|
25
19
|
* declared type `'primary' | 'neutral' | undefined`, and the `undefined` is an
|
|
26
20
|
* implementation detail of how the default is expressed rather than a value
|
|
27
|
-
* anyone sets.
|
|
28
|
-
* omissible is already what "attribute" means.
|
|
21
|
+
* anyone sets.
|
|
29
22
|
*/
|
|
30
23
|
const withoutUndefined = (text) => text
|
|
31
24
|
.split('|')
|
|
@@ -48,9 +41,9 @@ const isPublic = (row) => row.privacy === undefined || row.privacy === 'public';
|
|
|
48
41
|
/**
|
|
49
42
|
* Properties, with the default each one falls back to.
|
|
50
43
|
*
|
|
51
|
-
* Fields rather than attributes
|
|
52
|
-
*
|
|
53
|
-
*
|
|
44
|
+
* Fields rather than attributes: an attribute carries no default in the
|
|
45
|
+
* manifest, so a table built from attributes can say a component takes a
|
|
46
|
+
* property and never what it does when you leave it alone.
|
|
54
47
|
*/
|
|
55
48
|
const properties = (rows) => (rows ?? [])
|
|
56
49
|
/* Instance fields only. A static is the class's, not an element's, and the
|
|
@@ -59,12 +52,11 @@ const properties = (rows) => (rows ?? [])
|
|
|
59
52
|
reads to decide a control participates in a form. Thirty-five rows across
|
|
60
53
|
the library, none of them anything a consumer sets on a tag. */
|
|
61
54
|
/* `@internal` needs nothing here: the analyzer drops a member carrying it
|
|
62
|
-
before the manifest is written
|
|
63
|
-
building a plugin and a filter to do the same thing twice. */
|
|
55
|
+
before the manifest is written. */
|
|
64
56
|
.filter((row) => row.kind === 'field' && isPublic(row) && row.static !== true)
|
|
65
57
|
.map((row) => ({
|
|
66
58
|
/* `undefined` is not a default, it is the absence of one, and the
|
|
67
|
-
analyzer records the
|
|
59
|
+
analyzer records the initializer verbatim. Printed, the column reads
|
|
68
60
|
"undefined" for every optional property, which is a table telling a
|
|
69
61
|
reader a word rather than a value. Blank says the same thing and says
|
|
70
62
|
it quietly. */
|
|
@@ -120,11 +112,9 @@ const ANNOTATION = /^[^\S\n]*<!--\s*@[\s\S]*?-->[^\S\n]*\n?/gm;
|
|
|
120
112
|
* The example's markup as a reader should receive it.
|
|
121
113
|
*
|
|
122
114
|
* `@summary` is metadata about the example rather than part of it: the cem
|
|
123
|
-
* plugin lifts it into the manifest
|
|
124
|
-
* description,
|
|
125
|
-
*
|
|
126
|
-
* copied. Ninety-odd examples, each one telling a reader that a Helix component
|
|
127
|
-
* needs a docs annotation above it.
|
|
115
|
+
* plugin lifts it into the manifest and the reference prints it as the
|
|
116
|
+
* description, so left in place it makes the copy button hand back a comment
|
|
117
|
+
* describing the thing you just copied.
|
|
128
118
|
*
|
|
129
119
|
* Stripped here rather than at the reader, because every consumer of the
|
|
130
120
|
* catalog wants the same thing and a site that trimmed it in its own renderer
|
|
@@ -149,26 +139,18 @@ const examplesOf = (slug, declared, sources) => {
|
|
|
149
139
|
const minimums = new Map((declared?.examples ?? []).map((entry) => [entry.slug ?? '', entry.min ?? 0]));
|
|
150
140
|
return (sources
|
|
151
141
|
.filter((source) => source.family === slug)
|
|
152
|
-
/* `
|
|
142
|
+
/* `preview` first, then alphabetical, with each headless twin directly
|
|
153
143
|
behind the example it mirrors.
|
|
154
144
|
|
|
155
|
-
By slug,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
ever sees. The extension is not part of an example's identity:
|
|
159
|
-
`compact` and `compact-counts` are what the tabs say, and `compact`
|
|
160
|
-
comes first.
|
|
145
|
+
By slug, never by filename. Comparing `compact-counts.html` against
|
|
146
|
+
`compact.html` puts the longer name first, `-` preceding `.`, which is
|
|
147
|
+
a list ordered by a file extension no reader ever sees.
|
|
161
148
|
|
|
162
|
-
**
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
it
|
|
167
|
-
that accident as the rule. What the pairing is for is that the tabs
|
|
168
|
-
show the same list on both tiers, which is what `mirrored` below is
|
|
169
|
-
computing anyway: sort on it and the position is a consequence of the
|
|
170
|
-
relationship rather than of where the tier's name falls in the
|
|
171
|
-
alphabet. */
|
|
149
|
+
**Pair on the mirrored name, not on the raw slug.** Sorting on the raw
|
|
150
|
+
slug puts the twin wherever the tier's name happens to fall in the
|
|
151
|
+
alphabet, which is only ever right by luck. The tabs have to show the
|
|
152
|
+
same list on both tiers, and `mirrored` below is that relationship: sort
|
|
153
|
+
on it and the position follows from the pairing. */
|
|
172
154
|
.sort((a, b) => {
|
|
173
155
|
const pairOf = (slug) => slug === HEADLESS ? CANONICAL : slug.replace(HEADLESS_SUFFIX, '');
|
|
174
156
|
const twin = (slug) => (slug === HEADLESS || HEADLESS_SUFFIX.test(slug) ? 1 : 0);
|
|
@@ -181,10 +163,9 @@ const examplesOf = (slug, declared, sources) => {
|
|
|
181
163
|
})
|
|
182
164
|
.map((source) => {
|
|
183
165
|
/* Which styled example this one is the headless twin of. `headless` is
|
|
184
|
-
the twin of `preview`, and `<name>.headless` of `<name>`.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
because a headless example is not named for itself. */
|
|
166
|
+
the twin of `preview`, and `<name>.headless` of `<name>`. This is the
|
|
167
|
+
one place that has to know the pairing, because a headless example is
|
|
168
|
+
not named for itself. */
|
|
188
169
|
/* Read once and narrowed here rather than spread from the map
|
|
189
170
|
directly: `get` answers `string | undefined`, and under
|
|
190
171
|
`exactOptionalPropertyTypes` an optional property will not take the
|
|
@@ -196,11 +177,8 @@ const examplesOf = (slug, declared, sources) => {
|
|
|
196
177
|
css: source.css,
|
|
197
178
|
description: described.get(source.slug) ?? '',
|
|
198
179
|
html: withoutAnnotations(source.html),
|
|
199
|
-
/* **The label is the file's name, with no special case
|
|
200
|
-
|
|
201
|
-
translation that existed only because the name did not say what the
|
|
202
|
-
file was: it is the component's headline, not a named variant sitting
|
|
203
|
-
beside the others. Renamed, `startCase` gives "Preview" on its own.
|
|
180
|
+
/* **The label is the file's name, with no special case.** `startCase`
|
|
181
|
+
gives "Preview" for the canonical example on its own.
|
|
204
182
|
|
|
205
183
|
**A headless example takes the name of the one it mirrors**, so the two
|
|
206
184
|
tiers show the same list rather than a list that changes its labels
|
package/dist/naming.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
/**
|
|
10
10
|
* Words a slug spells in lower case that are read as letters.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* Capitalizing the first letter of `qr` gives `Qr`, which is a word nobody says.
|
|
13
13
|
* A slug is lower case because a URL is, and the initialism it came from is
|
|
14
14
|
* lost by the time this sees it, so it has to be put back by name. Kept small
|
|
15
15
|
* and explicit rather than guessed at from length: `ui`, `id` and `api` are
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Every page this package documents, derived from the frontmatter of each MDX
|
|
3
|
-
* file by `
|
|
3
|
+
* file by `turbo run docs`. Do not edit: `turbo run docs -- --check` fails when this
|
|
4
4
|
* file and the content disagree, and the content is the source.
|
|
5
5
|
*/
|
|
6
6
|
import type { DocPage } from './registry.js';
|
package/dist/pages.generated.js
CHANGED
|
@@ -75,7 +75,7 @@ export const docPages = [
|
|
|
75
75
|
title: 'Forms and validation',
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
description: '
|
|
78
|
+
description: '105 glyphs, one geometry, and how to draw one that is not in the set.',
|
|
79
79
|
section: 'Foundations',
|
|
80
80
|
slug: 'iconography',
|
|
81
81
|
title: 'Iconography',
|
package/dist/reference.js
CHANGED
|
@@ -105,7 +105,7 @@ const element = (depth, declaration, part) => {
|
|
|
105
105
|
borrowed a stylesheet from rather than be its own. Without it a borrowed
|
|
106
106
|
`--icon-button-radii` reads on the Copy Button page as a hook Copy Button
|
|
107
107
|
named, and a consumer who guesses `--copy-button-radii` from that gets
|
|
108
|
-
nothing.
|
|
108
|
+
nothing. */
|
|
109
109
|
table(depth + 1, 'Custom properties', ['Property', 'From', 'Description'], cssProperties.map((one) => [
|
|
110
110
|
`\`${one.name}\``,
|
|
111
111
|
one.inheritedFrom?.name ? `\`${one.inheritedFrom.name}\`` : '-',
|
package/dist/registry.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* mechanism npm already provides and the only one that cannot drift.
|
|
16
16
|
*
|
|
17
17
|
* **Nothing about a page is written here.** `pages.generated.ts` is derived
|
|
18
|
-
* from each file's frontmatter by `
|
|
18
|
+
* from each file's frontmatter by `turbo run docs`, because the frontmatter is
|
|
19
19
|
* what a `.md` consumer receives and a second copy would be a second source of
|
|
20
20
|
* truth. This module is the types and the reading of them; `sections.ts` is the
|
|
21
21
|
* spine that frontmatter has nowhere to live.
|
|
@@ -34,7 +34,7 @@ export interface DocPage {
|
|
|
34
34
|
order?: number;
|
|
35
35
|
/**
|
|
36
36
|
* Slug of the page this one sits under, for the one level of nesting that
|
|
37
|
-
* exists. Installation and
|
|
37
|
+
* exists. Installation and Coding agents are the cases.
|
|
38
38
|
*/
|
|
39
39
|
parent?: string;
|
|
40
40
|
/**
|
|
@@ -77,7 +77,7 @@ export declare const findPage: (slug: string) => DocPage | undefined;
|
|
|
77
77
|
* The whole sidebar: every declared section, its pages in render order, and
|
|
78
78
|
* each page's children beneath it.
|
|
79
79
|
*
|
|
80
|
-
* A section with no pages cannot appear, because `
|
|
80
|
+
* A section with no pages cannot appear, because `turbo run docs -- --check` refuses
|
|
81
81
|
* to generate one. Children are alphabetical, because nesting exists for the
|
|
82
82
|
* per-framework installation pages and a reader picking their framework out of
|
|
83
83
|
* a list is looking one up rather than reading a sequence, and then the
|
package/dist/registry.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* mechanism npm already provides and the only one that cannot drift.
|
|
16
16
|
*
|
|
17
17
|
* **Nothing about a page is written here.** `pages.generated.ts` is derived
|
|
18
|
-
* from each file's frontmatter by `
|
|
18
|
+
* from each file's frontmatter by `turbo run docs`, because the frontmatter is
|
|
19
19
|
* what a `.md` consumer receives and a second copy would be a second source of
|
|
20
20
|
* truth. This module is the types and the reading of them; `sections.ts` is the
|
|
21
21
|
* spine that frontmatter has nowhere to live.
|
|
@@ -30,7 +30,7 @@ const byTitle = (a, b) => a.title.toLowerCase() < b.title.toLowerCase() ? -1 : 1
|
|
|
30
30
|
* The pages of one section, in the order a sidebar renders them.
|
|
31
31
|
*
|
|
32
32
|
* **Alphabetical, except a section that is a path, and except one pinned entry
|
|
33
|
-
* page where a section has one.** The exemption is the same one `
|
|
33
|
+
* page where a section has one.** The exemption is the same one `AGENTS.md`
|
|
34
34
|
* grants positional arguments and middleware chains, that ordering is skipped
|
|
35
35
|
* where order is semantic. Written down so a section is not silently reordered
|
|
36
36
|
* by whoever next notices it is not alphabetical.
|
|
@@ -47,7 +47,7 @@ const ordered = (pages, section) => {
|
|
|
47
47
|
* The whole sidebar: every declared section, its pages in render order, and
|
|
48
48
|
* each page's children beneath it.
|
|
49
49
|
*
|
|
50
|
-
* A section with no pages cannot appear, because `
|
|
50
|
+
* A section with no pages cannot appear, because `turbo run docs -- --check` refuses
|
|
51
51
|
* to generate one. Children are alphabetical, because nesting exists for the
|
|
52
52
|
* per-framework installation pages and a reader picking their framework out of
|
|
53
53
|
* a list is looking one up rather than reading a sequence, and then the
|
package/dist/sections.d.ts
CHANGED
|
@@ -9,13 +9,9 @@
|
|
|
9
9
|
* frontmatter to derive from, so it is written here.
|
|
10
10
|
*
|
|
11
11
|
* **A section with no pages is not declared.** A navigation entry is the
|
|
12
|
-
* strongest existence claim a site can make,
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* heading with nothing under it.
|
|
16
|
-
*
|
|
17
|
-
* See [`plan/23-helix-docs.md`](plan/23-helix-docs.md) for the
|
|
18
|
-
* navigation this is a subset of.
|
|
12
|
+
* strongest existence claim a site can make, so a section is added with the
|
|
13
|
+
* pages that fill it rather than ahead of them. `turbo run docs -- --check` fails
|
|
14
|
+
* on an empty section rather than rendering a heading with nothing under it.
|
|
19
15
|
*/
|
|
20
16
|
/** A top-level grouping in the sidebar. */
|
|
21
17
|
export interface DocSection {
|
package/dist/sections.js
CHANGED
|
@@ -9,13 +9,9 @@
|
|
|
9
9
|
* frontmatter to derive from, so it is written here.
|
|
10
10
|
*
|
|
11
11
|
* **A section with no pages is not declared.** A navigation entry is the
|
|
12
|
-
* strongest existence claim a site can make,
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* heading with nothing under it.
|
|
16
|
-
*
|
|
17
|
-
* See [`plan/23-helix-docs.md`](plan/23-helix-docs.md) for the
|
|
18
|
-
* navigation this is a subset of.
|
|
12
|
+
* strongest existence claim a site can make, so a section is added with the
|
|
13
|
+
* pages that fill it rather than ahead of them. `turbo run docs -- --check` fails
|
|
14
|
+
* on an empty section rather than rendering a heading with nothing under it.
|
|
19
15
|
*/
|
|
20
16
|
/**
|
|
21
17
|
* Every section, in the order the sidebar renders them.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Every page's MDX, inlined by `
|
|
3
|
-
* `content/` are the source, and `
|
|
2
|
+
* Every page's MDX, inlined by `turbo run docs`. Do not edit: the files in
|
|
3
|
+
* `content/` are the source, and `turbo run docs -- --check` fails when this module
|
|
4
4
|
* and they disagree.
|
|
5
5
|
*/
|
|
6
6
|
export declare const docSources: Record<string, string>;
|