@fusion.dev/helix-templates 0.139.0 → 0.140.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 (57) hide show
  1. package/package.json +1 -1
  2. package/templates/angular/src/app/data.ts +17 -17
  3. package/templates/angular/src/app/docs.ts +9 -9
  4. package/templates/angular/src/app/landing.html +36 -71
  5. package/templates/angular/src/app/landing.ts +0 -2
  6. package/templates/angular/src/app/overview.html +2 -2
  7. package/templates/angular/src/app/pathname.ts +1 -1
  8. package/templates/angular/src/app/signup-form.html +9 -10
  9. package/templates/angular/src/app/site-footer.html +1 -1
  10. package/templates/angular/src/app/site-header.ts +2 -3
  11. package/templates/angular/src/app.css +144 -152
  12. package/templates/react-nextjs/app/app.css +144 -152
  13. package/templates/react-nextjs/app/data.ts +17 -17
  14. package/templates/react-nextjs/app/docs.ts +9 -9
  15. package/templates/react-nextjs/app/landing.tsx +63 -121
  16. package/templates/react-nextjs/app/overview.tsx +24 -26
  17. package/templates/react-nextjs/app/signup-form.tsx +36 -39
  18. package/templates/react-nextjs/app/site-footer.tsx +7 -10
  19. package/templates/react-nextjs/app/site-header.tsx +17 -21
  20. package/templates/react-nextjs/helix-jsx.d.ts +5 -7
  21. package/templates/react-vite/helix-jsx.d.ts +5 -7
  22. package/templates/react-vite/src/app.css +144 -152
  23. package/templates/react-vite/src/data.ts +17 -17
  24. package/templates/react-vite/src/docs.ts +9 -9
  25. package/templates/react-vite/src/landing.tsx +63 -121
  26. package/templates/react-vite/src/overview.tsx +24 -26
  27. package/templates/react-vite/src/routes.tsx +11 -13
  28. package/templates/react-vite/src/signup-form.tsx +36 -39
  29. package/templates/react-vite/src/site-footer.tsx +7 -10
  30. package/templates/react-vite/src/site-header.tsx +15 -19
  31. package/templates/solid-vite/src/app.css +144 -152
  32. package/templates/solid-vite/src/data.ts +17 -17
  33. package/templates/solid-vite/src/docs.ts +9 -9
  34. package/templates/solid-vite/src/landing.tsx +51 -98
  35. package/templates/solid-vite/src/overview.tsx +2 -2
  36. package/templates/solid-vite/src/routes.ts +6 -6
  37. package/templates/solid-vite/src/signup-form.tsx +10 -10
  38. package/templates/solid-vite/src/site-footer.tsx +1 -1
  39. package/templates/solid-vite/src/site-header.tsx +2 -3
  40. package/templates/svelte-vite/src/Landing.svelte +36 -73
  41. package/templates/svelte-vite/src/Overview.svelte +2 -2
  42. package/templates/svelte-vite/src/SignupForm.svelte +9 -10
  43. package/templates/svelte-vite/src/SiteFooter.svelte +1 -1
  44. package/templates/svelte-vite/src/SiteHeader.svelte +2 -3
  45. package/templates/svelte-vite/src/app.css +144 -152
  46. package/templates/svelte-vite/src/data.ts +17 -17
  47. package/templates/svelte-vite/src/docs.ts +9 -9
  48. package/templates/svelte-vite/src/routes.svelte.ts +5 -5
  49. package/templates/vue-vite/src/LandingPage.vue +36 -73
  50. package/templates/vue-vite/src/OverviewPage.vue +2 -2
  51. package/templates/vue-vite/src/SignupForm.vue +10 -10
  52. package/templates/vue-vite/src/SiteFooter.vue +1 -1
  53. package/templates/vue-vite/src/SiteHeader.vue +2 -3
  54. package/templates/vue-vite/src/app.css +144 -152
  55. package/templates/vue-vite/src/data.ts +17 -17
  56. package/templates/vue-vite/src/docs.ts +9 -9
  57. package/templates/vue-vite/src/routes.ts +6 -6
@@ -3,43 +3,43 @@ import { roster } from './data'
3
3
  import { DOCS } from './docs'
4
4
 
5
5
  /**
6
- * **A locale named rather than left to the machine.** `toLocaleString()` with no
7
- * argument reads the environment's locale, which is the server's in one template
8
- * and the reader's in both, so the same number is grouped two ways and the
9
- * markup React hydrates does not match the markup it rendered.
6
+ * **A locale named, so the number reads the same everywhere.**
7
+ * `toLocaleString()` with no argument reads the machine's locale: the server's
8
+ * in the Next.js template, and the browser's in both. The same number is then
9
+ * grouped two ways, and the markup React hydrates does not match the markup it
10
+ * rendered.
10
11
  */
11
12
  const figure = new Intl.NumberFormat('en-US')
12
13
 
13
14
  /**
14
- * The first screen, and the only page here that is about the starter rather
15
- * than built out of it.
15
+ * The first screen, and the only page here about the starter itself.
16
16
  *
17
17
  * Delete it once you know your way around: nothing else imports it, and the
18
18
  * route it answers becomes yours.
19
19
  *
20
- * **The heading says what this is, and the project's name stays in the bar.** A
21
- * scaffold called `my-app` opening on an `<h1>my-app</h1>` tells its reader
22
- * nothing they did not type thirty seconds ago, and spends the loudest line on
23
- * the page doing it.
24
- *
25
- * **Anchors, not a `Button` with an `href`.** A button that navigates is a link
26
- * wearing a button's clothes, and the two are different things to a keyboard and
27
- * to a screen reader. The base stylesheet styles an anchor that asks with
28
- * `data-button`, so a link can look like one without being one.
20
+ * **The calls to action are anchors.** A button that navigates is a link
21
+ * dressed as a button, and the two are different things to a keyboard and to
22
+ * a screen reader. The base stylesheet styles an anchor that asks with
23
+ * `data-button`, so a link can look like one and stay a link.
29
24
  */
30
25
  export function Landing() {
31
26
  return (
32
27
  <div className="stack">
33
28
  <header className="first-screen">
29
+ {/* **The light behind the first screen**: a helix, drawn by the library
30
+ in the theme's colors, so a new brand color relights it. It shows
31
+ one still frame where motion is reduced, and a gradient where the
32
+ browser draws without a GPU. */}
33
+ <helix-aura className="first-light" data-layer speed={0.4} terminus={0.8} variant="braid" />
34
34
  <div className="hero">
35
- <helix-text emphasis="muted" variant="label">
36
- Helix starter
35
+ <helix-tag emphasis="subtle" tone="primary">
36
+ Starter
37
+ </helix-tag>
38
+ <helix-text as="h1" variant="display">
39
+ Helix design system
37
40
  </helix-text>
38
- <helix-text as="h1">Every tag on this page is Helix</helix-text>
39
- <helix-text as="p" className="lede" emphasis="muted" variant="body">
40
- Nothing here is a wrapper: the tags are the library's own elements, and every color,
41
- size and space inside them comes from one set of tokens. Three routes are laid down, and
42
- all of them are yours.
41
+ <helix-text as="p" className="lede" variant="body">
42
+ Web components in your brand's colors, drawn from one set of tokens.
43
43
  </helix-text>
44
44
  <div className="actions">
45
45
  <Link data-button="solid" data-button-tone="primary" href="/overview">
@@ -51,13 +51,10 @@ export function Landing() {
51
51
  </div>
52
52
  </div>
53
53
 
54
- {/* **What the first screen has to look at, and the honest thing to look
55
- at is the library working.** The figures are the roster the data view
56
- draws, read from the same module, so the panel is the app rather than
57
- a decoration of it. `helix-stat` sets the number on the display face
58
- at a size the type scale does not reach, which is the one place on a
59
- page where the number is the design. */}
60
- <helix-card className="specimen" separation="outlined">
54
+ {/* **The library at work, on the first screen.** The figures are the
55
+ roster the data view draws, read from the same module, so the panel
56
+ is the app itself, on glass over the light. */}
57
+ <helix-card className="specimen" material="glass" separation="outlined">
61
58
  <helix-text as="h2" slot="header" variant="title">
62
59
  The roster, in three figures
63
60
  </helix-text>
@@ -85,106 +82,51 @@ export function Landing() {
85
82
  <helix-text as="h2" variant="subheading">
86
83
  What you have
87
84
  </helix-text>
88
- {/* Three paragraphs about one installed thing, so they take a rule each
89
- rather than a box each. `app.css` says why at more length. */}
90
- <div className="facts">
91
- <article className="fact">
92
- <helix-text as="h3" variant="title">
93
- Elements, not wrappers
94
- </helix-text>
95
- <helix-text as="p" emphasis="muted" variant="body">
96
- They are custom elements, so you write the tags and there is no per-component import
97
- to keep in step. One line in <helix-code>app/helix-elements.tsx</helix-code> registers all of
98
- them, and a subpath like <helix-code>@fusion.dev/helix/tabs</helix-code> registers
99
- one.
100
- </helix-text>
101
- <a data-link href={DOCS.elements}>
102
- Using the elements
103
- </a>
104
- </article>
105
-
106
- <article className="fact">
107
- <helix-text as="h3" variant="title">
108
- One set of tokens
109
- </helix-text>
110
- <helix-text as="p" emphasis="muted" variant="body">
111
- Every color is written once as a light and dark pair, so the control in the bar moves
112
- the whole page by setting a single attribute on the root. Type, spacing, radii and
113
- control sizes come from the same place.
114
- </helix-text>
115
- <a data-link href={DOCS.tokens}>
116
- Tokens
117
- </a>
118
- </article>
119
-
120
- <article className="fact">
121
- <helix-text as="h3" variant="title">
122
- A short stylesheet
123
- </helix-text>
124
- <helix-text as="p" emphasis="muted" variant="body">
125
- <helix-code>app/app.css</helix-code> holds this page's measure, the rhythm between its
126
- blocks, and nothing a component already draws. Where a component leaves a decision
127
- open it names a part: the data view reaches one to paint the row you tick.
128
- </helix-text>
129
- <a data-link href={DOCS.parts}>
130
- Overriding a component
131
- </a>
132
- </article>
133
- </div>
134
- </section>
135
-
136
- <section className="section">
137
- <helix-text as="h2" variant="subheading">
138
- Where to go next
139
- </helix-text>
140
- {/* **The whole card is the link, which is what `data-card` is for.** A
141
- card with an anchor in its footer gives a reader a target the size of
142
- three words inside a box the size of a paragraph, and the box is what
143
- they aim at. The recipe is in the base layer: it draws the ring, moves
144
- the card's border to the brand on hover, and leaves focus alone. So
145
- nothing inside may be interactive, a link inside a link being neither
146
- valid nor reachable. */}
147
- <helix-grid columns={2} gap="md">
148
- <Link data-card href="/overview">
85
+ {/* **Each tile is a link, which is what `data-card` is for.** The base
86
+ layer draws the ring, moves the card's border to the brand on hover,
87
+ and leaves focus alone. Nothing inside may be interactive, since a
88
+ link inside a link is neither valid nor reachable. */}
89
+ <div className="features">
90
+ <a className="feature" data-card href={DOCS.elements}>
91
+ <helix-card separation="outlined">
92
+ <span className="feature-mark">
93
+ <helix-icon name="cube" />
94
+ </span>
95
+ <helix-text as="h3" variant="title">
96
+ Custom elements
97
+ </helix-text>
98
+ <helix-text as="p" emphasis="muted" variant="body">
99
+ One import in <helix-code>app/helix-elements.tsx</helix-code> registers every tag.
100
+ </helix-text>
101
+ </helix-card>
102
+ </a>
103
+ <a className="feature" data-card href={DOCS.tokens}>
149
104
  <helix-card separation="outlined">
150
- {/* The route beside the name rather than under the text: slotted
151
- into the header the two sit on one baseline, and a row of
152
- cards stretched to a common height has nothing left floating
153
- in the middle of it. */}
154
- <helix-flex align-items="baseline" gap="sm" justify-content="between" slot="header">
155
- <helix-text as="h3" variant="title">
156
- The data view
157
- </helix-text>
158
- <helix-text emphasis="subtle" variant="code">
159
- /overview
160
- </helix-text>
161
- </helix-flex>
105
+ <span className="feature-mark">
106
+ <helix-icon name="palette" />
107
+ </span>
108
+ <helix-text as="h3" variant="title">
109
+ One set of tokens
110
+ </helix-text>
162
111
  <helix-text as="p" emphasis="muted" variant="body">
163
- Twelve people from a local module, sorted, paged and selected with nothing wired up.
164
- The columns are markup you can read and the rows are one property, which is what
165
- keeps the same component working at ten thousand.
112
+ Every color, size, and space, in light and dark.
166
113
  </helix-text>
167
114
  </helix-card>
168
- </Link>
169
-
170
- <Link data-card href="/join">
115
+ </a>
116
+ <a className="feature" data-card href={DOCS.parts}>
171
117
  <helix-card separation="outlined">
172
- <helix-flex align-items="baseline" gap="sm" justify-content="between" slot="header">
173
- <helix-text as="h3" variant="title">
174
- The form
175
- </helix-text>
176
- <helix-text emphasis="subtle" variant="code">
177
- /join
178
- </helix-text>
179
- </helix-flex>
118
+ <span className="feature-mark">
119
+ <helix-icon name="sliders-horizontal" />
120
+ </span>
121
+ <helix-text as="h3" variant="title">
122
+ Parts to style
123
+ </helix-text>
180
124
  <helix-text as="p" emphasis="muted" variant="body">
181
- Five controls a <helix-code>&lt;form&gt;</helix-code> reads with{' '}
182
- <helix-code>FormData</helix-code>, because every one of them is a real form
183
- participant. The email field's complaint is the browser's own.
125
+ Reach inside a component with <helix-code>::part()</helix-code>.
184
126
  </helix-text>
185
127
  </helix-card>
186
- </Link>
187
- </helix-grid>
128
+ </a>
129
+ </div>
188
130
  </section>
189
131
  </div>
190
132
  )
@@ -6,13 +6,13 @@ import { DOCS } from './docs'
6
6
  *
7
7
  * **The schema is markup and the data is a property.** The columns are elements
8
8
  * you can read in the HTML, and `rows` is the whole result handed over at once,
9
- * because a table of ten thousand rows cannot be written out as elements. The
10
- * table sorts, pages and selects out of that array on its own: none of it is
11
- * wired up here, and none of it is a handler you have to write.
9
+ * since a table of ten thousand rows cannot be written out as elements. The
10
+ * table sorts, pages, and selects out of that array on its own, with no handler
11
+ * for you to write.
12
12
  *
13
13
  * **Selection is keyed on `row-key`, so it survives a sort and a page.** A row
14
- * is chosen by its identity rather than by where it happened to be sitting, and
15
- * `app.css` paints the chosen row through the parts the table names for it.
14
+ * is chosen by its identity, wherever it sits, and `app.css` paints the chosen
15
+ * row through the parts the table names for it.
16
16
  */
17
17
  export function Overview() {
18
18
  return (
@@ -39,18 +39,18 @@ export function Overview() {
39
39
  rows={members}
40
40
  selectable
41
41
  >
42
- {/* **Every column declares what it may give up, and that is the whole of
42
+ {/* **Every column declares what it may give up, which is the whole of
43
43
  the narrow-window story.** A column left to itself takes
44
- `minmax(max-content, 1fr)`, which refuses to go below its longest
45
- cell however little room there is, so the last column is pushed
46
- outside the box and the reader has to scroll the table sideways to
47
- read a value. A floor and a share instead: the floor is what the
48
- words need, the share is how the slack is divided. Measured 16 Sep
49
- 2026: at 390 the four columns and the checkboxes come to 358 in a box
50
- of 358, so nothing is cut and nothing wraps; the floors alone come to
51
- 344, so at a 376 pixel window they exactly fit and below it the table
52
- scrolls its own box, which is honest, and it fades whichever edge has
53
- more behind it. */}
44
+ `minmax(max-content, 1fr)`, which never goes below its longest
45
+ cell, so the last column is pushed outside the box and you have to
46
+ scroll the table sideways to read a value. Each column here has a
47
+ floor and a share: the floor is what the words need, and the share
48
+ is how the spare width is divided. Measured September 16, 2026: at
49
+ 390 the four columns and the checkboxes come to 358 in a box of
50
+ 358, so nothing is cut and nothing wraps. The floors alone come to
51
+ 344, so at a 376 pixel window they exactly fit, and below it the
52
+ table scrolls its own box and fades whichever edge has more behind
53
+ it. */}
54
54
  <helix-table-column field="name" sortable width="minmax(5.5rem, 1.6fr)">
55
55
  Name
56
56
  </helix-table-column>
@@ -60,26 +60,24 @@ export function Overview() {
60
60
  <helix-table-column field="role" width="minmax(4.5rem, 1fr)">
61
61
  Role
62
62
  </helix-table-column>
63
- {/* `end` lines the digits up under each other, which is the whole reason
64
- a number column is a different thing from a text one. `max-content`
65
- because a column of numerals has one right width and no reason to
66
- take a share of anything. */}
63
+ {/* `end` lines the digits up under each other, which is what makes a
64
+ number column different from a text one. `max-content`, since a
65
+ column of numerals has one right width. */}
67
66
  <helix-table-column field="reviews" sortable text-align="end" width="max-content">
68
67
  Reviews
69
68
  </helix-table-column>
70
69
 
71
- {/* The footer is a row across the table, not a corner: anything you slot
72
- goes at the start and the table's own pagination sits at the end. */}
70
+ {/* The footer is a row across the table: anything you slot goes at the
71
+ start, and the table's own pagination sits at the end. */}
73
72
  <helix-text emphasis="subtle" slot="footer" variant="caption">
74
73
  {members.length} people
75
74
  </helix-text>
76
75
  </helix-data-table>
77
76
 
78
- {/* A footnote to the table rather than the next block of the page, so it
79
- takes the section's gap and not the stack's. */}
77
+ {/* A footnote to the table, so it takes the section's gap. */}
80
78
  <helix-text as="p" emphasis="muted" variant="caption">
81
- Filtering, column reordering, resizing, virtualized rows and a server mode that asks you
82
- for a page are all on{' '}
79
+ Filtering, column reordering, resizing, virtualized rows, and a server mode for large
80
+ results are on{' '}
83
81
  <a data-link href={DOCS.table}>
84
82
  the component's own page
85
83
  </a>
@@ -21,21 +21,21 @@ interface Message {
21
21
  * The form.
22
22
  *
23
23
  * **Every control here is a form-associated custom element**, so a `<form>`
24
- * collects them, resets them and validates them the way it does an `<input>`.
25
- * That is what `ElementInternals` buys, and the submit below proves it: it reads
26
- * the answers with `new FormData(form)` and nothing gathers them by hand.
24
+ * collects them, resets them, and validates them the way it does an `<input>`.
25
+ * `ElementInternals` makes that possible, and the submit below proves it: it
26
+ * reads the answers with `new FormData(form)`, and nothing gathers them by hand.
27
27
  *
28
- * There is no wrapping `Field` component. A label in one shadow root cannot name
29
- * a control in another, so every control renders its own `label`, `hint` and
30
- * `feedback` instead.
28
+ * There is no wrapping `Field` component. A label in one shadow root cannot
29
+ * name a control in another, so every control renders its own `label`, `hint`,
30
+ * and `feedback`.
31
31
  */
32
32
  export function SignupForm() {
33
33
  const [handle, setHandle] = useState('')
34
34
  const [messages, setMessages] = useState<readonly Message[]>([])
35
35
 
36
36
  const join = (event: FormEvent<HTMLFormElement>) => {
37
- /* The page answers this, so nothing navigates. Remove the line and the form
38
- posts to the server like any other, with the same names. */
37
+ /* The page takes the submit, so nothing navigates. Remove the line and the
38
+ form posts to the server like any other, with the same names. */
39
39
  event.preventDefault()
40
40
  const answers = [...new FormData(event.currentTarget).entries()]
41
41
  .map(([field, value]) => `${field}=${value}`)
@@ -58,18 +58,16 @@ export function SignupForm() {
58
58
  </helix-text>
59
59
  </header>
60
60
 
61
- {/* The form takes a column of its own and the notes take what is left, so a
62
- wide window is a page rather than a form with a void beside it. At 390
63
- the two stack and the notes read as a postscript. */}
61
+ {/* The form takes a column of its own and the notes take what is left. At
62
+ 390 the two stack, and the notes read as a postscript. */}
64
63
  <div className="split">
65
64
  <form className="form" onSubmit={join}>
66
65
  <helix-input autocomplete="name" label="Name" name="name" required />
67
66
 
68
67
  {/* Validation is the platform's: `type` and `required` are set on the
69
- real input inside, and its own message is what shows once the reader
70
- has touched the field. Set `feedback` to say it in your own words
71
- instead, and it shows from the first paint rather than after a
72
- mistake. */}
68
+ real input inside, and its own message shows once the field has been
69
+ touched. Set `feedback` to say it in your own words, and it shows
70
+ from the first paint. */}
73
71
  <helix-input
74
72
  hint="Where we send the welcome note."
75
73
  label="Email"
@@ -81,11 +79,11 @@ export function SignupForm() {
81
79
  {/* **A controlled value, which is the one habit to unlearn.** The handler
82
80
  is a prop named for the event, so `onhelix-before-change` hears
83
81
  `helix-before-change`. A Helix element is not read-only: writing
84
- `value` seeds it and the element goes on applying its own changes, so
85
- taking the decision means refusing the change with `preventDefault()`
86
- and then setting the value you want. Declining to call `setHandle` is
87
- not a refusal, and leaves the element holding what you did not
88
- accept. */}
82
+ `value` seeds it, and the element goes on applying its own changes.
83
+ So taking the decision means refusing the change with
84
+ `preventDefault()`, then setting the value you want. Leaving
85
+ `setHandle` uncalled refuses nothing, and the element keeps the value
86
+ you meant to turn down. */}
89
87
  <helix-input
90
88
  hint="Lowercase and hyphens, whatever you type."
91
89
  label="Handle"
@@ -105,8 +103,8 @@ export function SignupForm() {
105
103
  ))}
106
104
  </helix-select>
107
105
 
108
- {/* A switch is a thing happening now rather than an answer a form asks
109
- for, which is why it says on and off. It still submits, as `on`. */}
106
+ {/* A switch is a thing happening now, which is why it says on and off.
107
+ It still submits, as `on`. */}
110
108
  <helix-switch label="Send me the weekly digest" name="digest" />
111
109
 
112
110
  <helix-button emphasis="solid" tone="primary" type="submit">
@@ -115,27 +113,26 @@ export function SignupForm() {
115
113
  </form>
116
114
 
117
115
  <aside className="notes">
118
- {/* The one fact a reader needs before typing their name into a page
119
- they have had for five minutes, which is why it is a callout and
120
- not the fourth line of a paragraph. `tone` is the meaning and the
121
- component decides what that looks like: a tint mixed from the
122
- status color and a bar on the inline start, so it survives being
123
- read in grayscale. */}
116
+ {/* The one fact you need before typing your name into a page you have
117
+ had for five minutes, so it is a callout. `tone` is the meaning,
118
+ and the component draws it with a tint mixed from the status color
119
+ and a bar on the inline start, so it survives being read in
120
+ grayscale. */}
124
121
  <helix-callout tone="info">
125
- Nothing is posted anywhere. Submit it and the message shows exactly what a server would
126
- have been handed.
122
+ The form posts nothing. Submit it, and a message shows exactly what a server would
123
+ receive.
127
124
  </helix-callout>
128
125
  <helix-text as="h2" variant="title">
129
- What this is showing
126
+ What the form shows
130
127
  </helix-text>
131
128
  <helix-text as="p" emphasis="muted" variant="body">
132
- Every control is a form-associated custom element, so the submit reads them with{' '}
133
- <helix-code>new FormData(form)</helix-code> and nothing gathers the answers by hand.
134
- Reset the form and they all go back, the way an <helix-code>input</helix-code> does.
129
+ Every control is a form-associated custom element, so the submit reads them all
130
+ with <helix-code>new FormData(form)</helix-code>. Reset the form and they all go back,
131
+ the way an <helix-code>input</helix-code> does.
135
132
  </helix-text>
136
133
  <helix-text as="p" emphasis="muted" variant="body">
137
- Leave the email wrong and the complaint is the browser's own, in the reader's language.
138
- Handle is the controlled one: it refuses the change and writes back what it will accept.
134
+ Leave the email wrong and the browser shows its own message, in your language. Handle is
135
+ the controlled field: the page refuses each change and writes back a cleaned value.
139
136
  </helix-text>
140
137
  <a data-link href={DOCS.forms}>
141
138
  Forms
@@ -145,9 +142,9 @@ export function SignupForm() {
145
142
 
146
143
  {/* **The region is rendered whether or not there is anything in it.**
147
144
  Assistive technology subscribes to a live region, and one that arrives
148
- already holding its message is frequently never announced. Nothing
149
- creates or destroys a message here either: the items are state, and a
150
- dismissed one asks to go through `helix-dismiss`. */}
145
+ already holding its message is often never announced. Messages are
146
+ state, so nothing creates or destroys one here, and a dismissed one
147
+ asks to go through `helix-dismiss`. */}
151
148
  <helix-toast>
152
149
  {messages.map((message) => (
153
150
  <helix-toast-item
@@ -3,23 +3,20 @@ import { DOCS } from './docs'
3
3
  /**
4
4
  * The bar's counterpart, on every route.
5
5
  *
6
- * **It is here so that a page ends rather than stops.** The overview is a
7
- * heading, a table and a caption, which on a tall window left the bottom third
8
- * of the screen empty and read as a layout that had run out. A footer is the
9
- * ordinary answer: it puts a floor under the content, and it is where the links
10
- * a reader wants once rather than constantly belong, which is why the landing
11
- * page no longer carries them itself.
6
+ * **It puts a floor under the content.** The overview is a heading, a table,
7
+ * and a caption, which on a tall window left the bottom third of the screen
8
+ * empty, as if the layout had run out. The footer is also where the links you
9
+ * want once belong, so the landing page no longer carries them.
12
10
  *
13
- * `data-link="subtle"` reads as body text until it is hovered, which is what a
14
- * row of links under a rule should do: they are a destination, not a sentence
15
- * asking to be read.
11
+ * `data-link="subtle"` reads as body text until it is hovered, which suits a
12
+ * row of links under a rule.
16
13
  */
17
14
  export function SiteFooter() {
18
15
  return (
19
16
  <footer className="site-footer">
20
17
  <div className="footer-row">
21
18
  <helix-text as="p" emphasis="subtle" variant="caption">
22
- Every component in here, with its API, its parts and its examples, has a page.
19
+ Every component here has a page, with its API, its parts, and its examples.
23
20
  </helix-text>
24
21
  <div className="footer-links">
25
22
  <a data-link="subtle" href={DOCS.gallery}>
@@ -3,8 +3,8 @@
3
3
  /*
4
4
  * **A handler is what makes this a client component**, and so does `usePathname`:
5
5
  * a server component's output is serialized, and a function cannot be. The bar
6
- * is rendered from the layout, so it survives a navigation rather than being
7
- * rebuilt on every page.
6
+ * is rendered from the layout, so it stays in place across a navigation and is
7
+ * built once.
8
8
  */
9
9
 
10
10
  import Link from 'next/link'
@@ -28,18 +28,16 @@ export function SiteHeader() {
28
28
  control draws the same glyph on the server and on the first client paint. */
29
29
  const [mode, setMode] = useState<Mode>('system')
30
30
 
31
- /**
31
+ /**
32
32
  * One attribute, two modes, and no second stylesheet.
33
33
  *
34
- * Every Helix token is written once as a `light-dark()` pair, so which half
35
- * resolves is decided by `color-scheme` and nothing else. `data-color-mode`
36
- * sets it, and because `color-scheme` inherits the attribute works on any
37
- * element, not only on the root: put it on a panel for a light preview inside
38
- * a dark page.
34
+ * Every Helix token is written once as a `light-dark()` pair, so
35
+ * `color-scheme` decides which half resolves. `data-color-mode` sets it, and
36
+ * since `color-scheme` inherits, the attribute works on any element: put it
37
+ * on a panel for a light preview inside a dark page.
39
38
  *
40
- * `system` removes the attribute rather than writing out whichever mode is
41
- * current, which would freeze the page there the moment the reader's machine
42
- * changed.
39
+ * `system` removes the attribute. Writing out whichever mode is current would
40
+ * hold the page there when the system's own setting changed.
43
41
  */
44
42
  const cycle = () => {
45
43
  const next = MODES[(MODES.indexOf(mode) + 1) % MODES.length]
@@ -53,11 +51,10 @@ export function SiteHeader() {
53
51
 
54
52
  return (
55
53
  <helix-app-header material="glass" sticky>
56
- {/* The wordmark is the way back to the first page, which is what a reader
57
- expects of one, so there is no third destination in the bar saying the
58
- same thing. It is also the only name of the project on the screen: the
59
- landing page leads with what this is rather than with what you called
60
- it.
54
+ {/* The wordmark is the way back to the first page, as a wordmark usually
55
+ is, so there is no third destination in the bar saying the same thing.
56
+ It is also the only name of the project on the screen: the landing
57
+ page leads with what the starter is.
61
58
 
62
59
  The mark is a placeholder for your own, and it is drawn in
63
60
  `--helix-color-brand-mark`, the token for the brand as a graphic. */}
@@ -67,8 +64,8 @@ export function SiteHeader() {
67
64
  </Link>
68
65
 
69
66
  {/* The links are yours. Navigation owns the marker that travels between
70
- them and renders no anchors of its own, because a router renders its
71
- own and could not render them inside this shadow root. The base layer
67
+ them and renders no anchors of its own, since a router renders its
68
+ own, which could not sit inside this shadow root. The base layer
72
69
  styles them, `aria-current="page"` included. */}
73
70
  <helix-navigation label="Pages">
74
71
  <Link aria-current={path === '/overview' ? 'page' : undefined} href="/overview">
@@ -79,9 +76,8 @@ export function SiteHeader() {
79
76
  </Link>
80
77
  </helix-navigation>
81
78
 
82
- {/* An icon with no words has no accessible name unless it is given one,
83
- which is the whole reason this is its own element rather than a button
84
- with a glyph in it. */}
79
+ {/* An icon with no words has no accessible name until it is given one,
80
+ which is why this is its own element. */}
85
81
  <helix-icon-button
86
82
  label={`Color mode: ${mode}`}
87
83
  onClick={cycle}
@@ -2,13 +2,11 @@
2
2
  * Types for the Helix custom elements written directly in JSX.
3
3
  *
4
4
  * Emitted by `@wc-toolkit/jsx-types` from the same manifest the API pages read,
5
- * so a wrong attribute or a wrong event detail is a compile error rather than a
6
- * silent no-op.
5
+ * so a wrong attribute or a wrong event detail is a compile error.
7
6
  *
8
- * **A side-effect import in a `.d.ts`, rather than an entry in `types`.** The
9
- * typings are the subpath export `@fusion.dev/helix/jsx`, and entries in the
10
- * `types` compiler array resolve as ambient type packages rather than through a
11
- * package's exports map, so naming the subpath there resolves to nothing and
12
- * every Helix tag comes out untyped.
7
+ * **A side-effect import in a `.d.ts`.** The typings are the subpath export
8
+ * `@fusion.dev/helix/jsx`, and entries in the `types` compiler array resolve as
9
+ * ambient type packages, outside a package's exports map, so naming the subpath
10
+ * there resolves to nothing and every Helix tag comes out untyped.
13
11
  */
14
12
  import '@fusion.dev/helix/jsx'
@@ -2,13 +2,11 @@
2
2
  * Types for the Helix custom elements written directly in JSX.
3
3
  *
4
4
  * Emitted by `@wc-toolkit/jsx-types` from the same manifest the API pages read,
5
- * so a wrong attribute or a wrong event detail is a compile error rather than a
6
- * silent no-op.
5
+ * so a wrong attribute or a wrong event detail is a compile error.
7
6
  *
8
- * **A side-effect import in a `.d.ts`, rather than an entry in `types`.** The
9
- * typings are the subpath export `@fusion.dev/helix/jsx`, and entries in the
10
- * `types` compiler array resolve as ambient type packages rather than through a
11
- * package's exports map, so naming the subpath there resolves to nothing and
12
- * every Helix tag comes out untyped.
7
+ * **A side-effect import in a `.d.ts`.** The typings are the subpath export
8
+ * `@fusion.dev/helix/jsx`, and entries in the `types` compiler array resolve as
9
+ * ambient type packages, outside a package's exports map, so naming the subpath
10
+ * there resolves to nothing and every Helix tag comes out untyped.
13
11
  */
14
12
  import '@fusion.dev/helix/jsx'