@fusion.dev/helix-templates 0.137.0 → 0.139.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.
- package/README.md +18 -6
- package/dist/index.js +24 -0
- package/package.json +1 -1
- package/templates/angular/angular.json +57 -0
- package/templates/angular/package.json +28 -0
- package/templates/angular/src/app/app.config.ts +8 -0
- package/templates/angular/src/app/app.html +19 -0
- package/templates/angular/src/app/app.ts +29 -0
- package/templates/angular/src/app/data.ts +81 -0
- package/templates/angular/src/app/docs.ts +29 -0
- package/templates/angular/src/app/landing.html +112 -0
- package/templates/angular/src/app/landing.ts +31 -0
- package/templates/angular/src/app/overview.html +49 -0
- package/templates/angular/src/app/overview.ts +25 -0
- package/templates/angular/src/app/pathname.ts +24 -0
- package/templates/angular/src/app/signup-form.html +91 -0
- package/templates/angular/src/app/signup-form.ts +65 -0
- package/templates/angular/src/app/site-footer.html +10 -0
- package/templates/angular/src/app/site-footer.ts +22 -0
- package/templates/angular/src/app/site-header.html +30 -0
- package/templates/angular/src/app/site-header.ts +58 -0
- package/templates/angular/src/app.css +363 -0
- package/templates/angular/src/diagnostics.ts +24 -0
- package/templates/angular/src/index.html +12 -0
- package/templates/angular/src/main.ts +21 -0
- package/templates/angular/tsconfig.app.json +9 -0
- package/templates/angular/tsconfig.json +34 -0
- package/templates/react-nextjs/app/diagnostics.ts +19 -0
- package/templates/react-nextjs/app/landing.tsx +2 -2
- package/templates/react-nextjs/app/overview.tsx +1 -1
- package/templates/react-nextjs/instrumentation-client.ts +6 -0
- package/templates/react-nextjs/package.json +1 -0
- package/templates/react-nextjs/tsconfig.json +1 -0
- package/templates/react-vite/package.json +1 -0
- package/templates/react-vite/src/diagnostics.ts +24 -0
- package/templates/react-vite/src/main.tsx +6 -0
- package/templates/react-vite/tsconfig.json +1 -0
- package/templates/solid-vite/helix-solid.d.ts +14 -0
- package/templates/solid-vite/index.html +12 -0
- package/templates/solid-vite/package.json +22 -0
- package/templates/solid-vite/src/App.tsx +35 -0
- package/templates/solid-vite/src/app.css +363 -0
- package/templates/solid-vite/src/data.ts +81 -0
- package/templates/solid-vite/src/diagnostics.ts +24 -0
- package/templates/solid-vite/src/docs.ts +29 -0
- package/templates/solid-vite/src/landing.tsx +177 -0
- package/templates/solid-vite/src/main.tsx +23 -0
- package/templates/solid-vite/src/overview.tsx +78 -0
- package/templates/solid-vite/src/routes.ts +22 -0
- package/templates/solid-vite/src/signup-form.tsx +151 -0
- package/templates/solid-vite/src/site-footer.tsx +34 -0
- package/templates/solid-vite/src/site-header.tsx +77 -0
- package/templates/solid-vite/tsconfig.json +27 -0
- package/templates/solid-vite/vite.config.ts +7 -0
- package/templates/svelte-vite/helix-svelte.d.ts +9 -0
- package/templates/svelte-vite/index.html +12 -0
- package/templates/svelte-vite/package.json +23 -0
- package/templates/svelte-vite/src/App.svelte +35 -0
- package/templates/svelte-vite/src/Landing.svelte +137 -0
- package/templates/svelte-vite/src/Overview.svelte +67 -0
- package/templates/svelte-vite/src/SignupForm.svelte +148 -0
- package/templates/svelte-vite/src/SiteFooter.svelte +26 -0
- package/templates/svelte-vite/src/SiteHeader.svelte +72 -0
- package/templates/svelte-vite/src/app.css +363 -0
- package/templates/svelte-vite/src/data.ts +81 -0
- package/templates/svelte-vite/src/diagnostics.ts +24 -0
- package/templates/svelte-vite/src/docs.ts +29 -0
- package/templates/svelte-vite/src/main.ts +23 -0
- package/templates/svelte-vite/src/routes.svelte.ts +19 -0
- package/templates/svelte-vite/tsconfig.json +28 -0
- package/templates/svelte-vite/vite.config.ts +7 -0
- package/templates/vue-vite/helix-vue.d.ts +8 -0
- package/templates/vue-vite/index.html +12 -0
- package/templates/vue-vite/package.json +23 -0
- package/templates/vue-vite/src/App.vue +39 -0
- package/templates/vue-vite/src/LandingPage.vue +139 -0
- package/templates/vue-vite/src/OverviewPage.vue +69 -0
- package/templates/vue-vite/src/SignupForm.vue +149 -0
- package/templates/vue-vite/src/SiteFooter.vue +28 -0
- package/templates/vue-vite/src/SiteHeader.vue +72 -0
- package/templates/vue-vite/src/app.css +363 -0
- package/templates/vue-vite/src/data.ts +81 -0
- package/templates/vue-vite/src/diagnostics.ts +24 -0
- package/templates/vue-vite/src/docs.ts +29 -0
- package/templates/vue-vite/src/main.ts +23 -0
- package/templates/vue-vite/src/routes.ts +26 -0
- package/templates/vue-vite/tsconfig.json +26 -0
- package/templates/vue-vite/vite.config.ts +13 -0
- package/templates.json +41 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The page around the components.
|
|
3
|
+
*
|
|
4
|
+
* Helix draws its own insides, so what is left to an app stylesheet is the
|
|
5
|
+
* measure, the rhythm between blocks, and the few things a component
|
|
6
|
+
* deliberately leaves open. Everything below is a Helix token or a documented
|
|
7
|
+
* hook, so a theme moves it and both color modes follow without a second copy
|
|
8
|
+
* of anything.
|
|
9
|
+
*
|
|
10
|
+
* **Color appears twice and both places are named.** The wordmark takes
|
|
11
|
+
* `--helix-color-brand-mark`, which is the token for the brand as a graphic
|
|
12
|
+
* rather than as a word, and a chosen row takes `--helix-color-primary-subtle`
|
|
13
|
+
* through the parts the table publishes. Everywhere else this page is ink on the
|
|
14
|
+
* background and the components carry their own.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* **The shell, and what stops a short route ending in a void.** The overview is
|
|
19
|
+
* a header, a table and a caption, which on a 1280 by 900 window left something
|
|
20
|
+
* like four hundred pixels of nothing under it: a page that stopped rather than
|
|
21
|
+
* a page that finished. A column the height of the window with the footer at the
|
|
22
|
+
* end of it puts a floor under every route.
|
|
23
|
+
*
|
|
24
|
+
* **Flex and not grid, because the bar is sticky.** A grid item's containing
|
|
25
|
+
* block is its own grid area, which is one row as tall as the bar, so a sticky
|
|
26
|
+
* header in a grid row sticks for nothing. A flex item's containing block is the
|
|
27
|
+
* flex container, which is the whole document.
|
|
28
|
+
*/
|
|
29
|
+
.shell {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
min-block-size: 100dvh;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/*
|
|
36
|
+
* **56rem, which is a measure rather than a maximum.** A page is as wide as its
|
|
37
|
+
* widest block can be read at, and the widest block here is a four-column table:
|
|
38
|
+
* given the whole of a 1280 window its first column came out 448 pixels across
|
|
39
|
+
* to hold a name, which reads as a table that has been stretched rather than
|
|
40
|
+
* laid out. The bar and the footer are centered in the same width, so the
|
|
41
|
+
* wordmark sits over the first column of the page rather than near it.
|
|
42
|
+
*
|
|
43
|
+
* `flex-grow` is what hands the slack to the page rather than to the footer.
|
|
44
|
+
*/
|
|
45
|
+
.page {
|
|
46
|
+
flex-grow: 1;
|
|
47
|
+
margin-inline: auto;
|
|
48
|
+
max-inline-size: 56rem;
|
|
49
|
+
padding-block: var(--helix-space-2xl) var(--helix-space-3xl);
|
|
50
|
+
padding-inline: var(--helix-space-lg);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
* Two documented hooks, and both are about agreeing with the page. The bar
|
|
55
|
+
* centers its row in the page's measure, so the wordmark sits over the first
|
|
56
|
+
* column rather than near it. And it draws no line under itself by default,
|
|
57
|
+
* because a header over a page that already has a surface does not need one:
|
|
58
|
+
* this page has no such surface, so it asks for one. A token rather than a
|
|
59
|
+
* color, so it follows the theme.
|
|
60
|
+
*/
|
|
61
|
+
helix-app-header {
|
|
62
|
+
--app-header-border-color: var(--helix-color-border);
|
|
63
|
+
--app-header-max-inline-size: 56rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* The mark beside the project's name, which is the one graphic on the page and
|
|
67
|
+
the reason `--helix-color-brand-mark` exists: a mark answers to the 3:1 WCAG
|
|
68
|
+
asks of a graphic rather than to the 4.5 a word does, so it may sit closer to
|
|
69
|
+
the brand a theme was seeded with than any text color can. Swap the glyph, or
|
|
70
|
+
replace the whole element with your own logo. */
|
|
71
|
+
.wordmark {
|
|
72
|
+
align-items: center;
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
gap: var(--helix-space-xs);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.wordmark helix-icon {
|
|
78
|
+
color: var(--helix-color-brand-mark);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/*
|
|
82
|
+
* One rhythm between the blocks of a page, so no page states its own.
|
|
83
|
+
*
|
|
84
|
+
* **`minmax(0, 1fr)` and never a bare column, which is the trap in every grid
|
|
85
|
+
* here.** An implicit track is `auto`, and an `auto` track's minimum is its
|
|
86
|
+
* content's min-content size, so a child that would rather scroll itself widens
|
|
87
|
+
* the track instead and takes the page with it. Measured at 320: the table's
|
|
88
|
+
* columns floor at 344, the column it sits in should have been 288, and
|
|
89
|
+
* `documentElement.scrollWidth` came back 360 against a 320 viewport. The whole
|
|
90
|
+
* page scrolled sideways so that a table with its own scrollport would not have
|
|
91
|
+
* to. Zero as the minimum hands the overflow back to whoever is equipped for it.
|
|
92
|
+
*/
|
|
93
|
+
.stack,
|
|
94
|
+
.section,
|
|
95
|
+
.hero,
|
|
96
|
+
.first-screen,
|
|
97
|
+
.fact,
|
|
98
|
+
.facts,
|
|
99
|
+
.notes,
|
|
100
|
+
.split {
|
|
101
|
+
grid-template-columns: minmax(0, 1fr);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* One step between the blocks of a page and a smaller one inside them, which is
|
|
105
|
+
the whole of the rhythm: `3xl` here against the `md` a section puts between
|
|
106
|
+
its heading and its block, so a reader sees three groups rather than six
|
|
107
|
+
evenly spaced things. */
|
|
108
|
+
.stack {
|
|
109
|
+
display: grid;
|
|
110
|
+
gap: var(--helix-space-3xl);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/*
|
|
114
|
+
* **The first screen is two things at once**, which is what makes it a screen
|
|
115
|
+
* rather than a stack: what this is, on the left, and the library doing it, on
|
|
116
|
+
* the right. Below 60rem there is no room for two columns that are both worth
|
|
117
|
+
* reading, so they become one and the panel reads as the thing the words were
|
|
118
|
+
* about.
|
|
119
|
+
*
|
|
120
|
+
* `start`, because a grid column stretches to its tallest sibling: the panel
|
|
121
|
+
* beside a taller block of words would otherwise grow to match it and spread its
|
|
122
|
+
* own regions out to fill the difference.
|
|
123
|
+
*/
|
|
124
|
+
.first-screen {
|
|
125
|
+
align-items: start;
|
|
126
|
+
display: grid;
|
|
127
|
+
gap: var(--helix-space-xl);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@media (width >= 60rem) {
|
|
131
|
+
.first-screen {
|
|
132
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* A heading and the lines around it are one block, and the gap between them is
|
|
137
|
+
not the gap between blocks. Every route opens with one. */
|
|
138
|
+
.hero {
|
|
139
|
+
display: grid;
|
|
140
|
+
gap: var(--helix-space-xs);
|
|
141
|
+
justify-items: start;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* **A measure for the lede, which the page's own is too wide to be.** A line of
|
|
145
|
+
prose across 56rem is around 110 characters, and the readable range tops out
|
|
146
|
+
near 75. The heading above it is exempt: a heading is scanned rather than
|
|
147
|
+
read along. */
|
|
148
|
+
.lede {
|
|
149
|
+
max-inline-size: 42rem;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.actions {
|
|
153
|
+
display: flex;
|
|
154
|
+
flex-wrap: wrap;
|
|
155
|
+
gap: var(--helix-space-sm);
|
|
156
|
+
padding-block-start: var(--helix-space-md);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/*
|
|
160
|
+
* **The panel is the library rather than a picture of it**, so the only thing it
|
|
161
|
+
* needs from here is room. Two documented hooks: the figures come down a step
|
|
162
|
+
* from the display size, which is set for a figure on its own and is too loud
|
|
163
|
+
* for three of them in a 20rem column, and the rule between them comes in from
|
|
164
|
+
* `2xl`, which `divided` doubles and which would leave no column to put a
|
|
165
|
+
* number in.
|
|
166
|
+
*/
|
|
167
|
+
.specimen {
|
|
168
|
+
--stat-group-gap: var(--helix-space-md);
|
|
169
|
+
--stat-value-size: var(--helix-text-xl);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* A section is its heading and its one block, closer together than two sections
|
|
173
|
+
are. */
|
|
174
|
+
.section {
|
|
175
|
+
display: grid;
|
|
176
|
+
gap: var(--helix-space-md);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/*
|
|
180
|
+
* **Three facts about the library, and deliberately not three cards.** A row of
|
|
181
|
+
* identical outlined boxes is the shape a generated page takes, and it is also a
|
|
182
|
+
* claim: a box says each of these is its own object, when they are three
|
|
183
|
+
* paragraphs about the same installed thing. A rule over each column groups them
|
|
184
|
+
* at a fraction of the weight, and leaves the cards below to mean something,
|
|
185
|
+
* which is that they go somewhere.
|
|
186
|
+
*
|
|
187
|
+
* `border-thick` in the foreground rather than a hairline in the border color:
|
|
188
|
+
* this is a heading device rather than a container edge, and it is the one place
|
|
189
|
+
* the page draws in ink.
|
|
190
|
+
*/
|
|
191
|
+
.facts {
|
|
192
|
+
display: grid;
|
|
193
|
+
gap: var(--helix-space-lg);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@media (width >= 48rem) {
|
|
197
|
+
.facts {
|
|
198
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.fact {
|
|
203
|
+
align-content: start;
|
|
204
|
+
border-block-start: var(--helix-border-thick) solid var(--helix-color-foreground);
|
|
205
|
+
display: grid;
|
|
206
|
+
gap: var(--helix-space-xs);
|
|
207
|
+
justify-items: start;
|
|
208
|
+
padding-block-start: var(--helix-space-sm);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/*
|
|
212
|
+
* **The one departure the grids state.** `helix-grid` takes a fixed count as
|
|
213
|
+
* plain CSS, which is what keeps a server-rendered row of cards correct before
|
|
214
|
+
* any JavaScript arrives. Below this width there is only ever room for one
|
|
215
|
+
* column, and `--grid-columns` is the documented way to say so from outside the
|
|
216
|
+
* shadow root.
|
|
217
|
+
*/
|
|
218
|
+
@media (width < 48rem) {
|
|
219
|
+
helix-grid {
|
|
220
|
+
--grid-columns: minmax(0, 1fr);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/*
|
|
225
|
+
* **The cards keep `start`, which is `--card-align`'s resting value, and the
|
|
226
|
+
* alternative is worth naming because it looks right and is not.**
|
|
227
|
+
* `space-between` puts the last line of each card on its bottom edge, so a row
|
|
228
|
+
* of cards ends in a straight line. It gets there by sharing the slack out
|
|
229
|
+
* between every region, and the first thing that moves is the body: three cards
|
|
230
|
+
* of six, five and seven lines had their opening lines 50 pixels apart under
|
|
231
|
+
* headings that were level. A reader scans the first line of each, so that is
|
|
232
|
+
* the alignment worth keeping.
|
|
233
|
+
*/
|
|
234
|
+
|
|
235
|
+
/* The card fills the link that wraps it, so a row of destinations ends level:
|
|
236
|
+
the anchor is the grid item and stretches, and the card inside it does not.
|
|
237
|
+
The regions stay packed at the top, per `--card-align` above. */
|
|
238
|
+
[data-card] > helix-card {
|
|
239
|
+
block-size: 100%;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* A form is read straight down, and a field wider than about this stops being
|
|
243
|
+
scannable however much room the window has. */
|
|
244
|
+
.form {
|
|
245
|
+
align-content: start;
|
|
246
|
+
display: grid;
|
|
247
|
+
gap: var(--helix-space-lg);
|
|
248
|
+
justify-items: start;
|
|
249
|
+
max-inline-size: 28rem;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Every control fills the column; the submit is as wide as its own words. */
|
|
253
|
+
.form > :not(helix-button) {
|
|
254
|
+
inline-size: 100%;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/*
|
|
258
|
+
* **The form takes a column and the notes take the rest.** A 28rem form on a
|
|
259
|
+
* 1280 window is a third of a page and two thirds of nothing, which is what the
|
|
260
|
+
* measure above cannot fix on its own: the form has a right width and the page
|
|
261
|
+
* does not shrink to it. Narrow, the two stack and the notes read as a
|
|
262
|
+
* postscript, which is the order they are written in.
|
|
263
|
+
*/
|
|
264
|
+
.split {
|
|
265
|
+
display: grid;
|
|
266
|
+
gap: var(--helix-space-2xl);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
@media (width >= 60rem) {
|
|
270
|
+
.split {
|
|
271
|
+
grid-template-columns: minmax(0, 28rem) minmax(0, 1fr);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/* `start`, because a grid column stretches to its tallest sibling and a
|
|
276
|
+
stretched grid shares the difference out between its own rows: beside a form
|
|
277
|
+
half a page long, three paragraphs came out 140 pixels apart. */
|
|
278
|
+
.notes {
|
|
279
|
+
align-content: start;
|
|
280
|
+
display: grid;
|
|
281
|
+
gap: var(--helix-space-sm);
|
|
282
|
+
justify-items: start;
|
|
283
|
+
max-inline-size: 32rem;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/* The callout takes the column, which `start` above would otherwise size to its
|
|
287
|
+
own words: a notice narrower than the paragraph under it reads as a stray. The
|
|
288
|
+
link beside it is meant to be its own width. */
|
|
289
|
+
.notes > helix-callout {
|
|
290
|
+
inline-size: 100%;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/*
|
|
294
|
+
* **The counterpart to the bar, and the reason every route now ends rather than
|
|
295
|
+
* stops.** The rule runs the window while its contents keep the page's measure,
|
|
296
|
+
* which is what a footer under a centered page looks like; the shell above is
|
|
297
|
+
* what holds it to the bottom of a window a route does not fill.
|
|
298
|
+
*/
|
|
299
|
+
.site-footer {
|
|
300
|
+
border-block-start: var(--helix-border-thin) solid var(--helix-color-border);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.footer-row {
|
|
304
|
+
display: flex;
|
|
305
|
+
flex-wrap: wrap;
|
|
306
|
+
gap: var(--helix-space-md);
|
|
307
|
+
justify-content: space-between;
|
|
308
|
+
margin-inline: auto;
|
|
309
|
+
max-inline-size: 56rem;
|
|
310
|
+
padding-block: var(--helix-space-lg);
|
|
311
|
+
padding-inline: var(--helix-space-lg);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.footer-links {
|
|
315
|
+
display: flex;
|
|
316
|
+
flex-wrap: wrap;
|
|
317
|
+
gap: var(--helix-space-md);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/*
|
|
321
|
+
* **Narrow, the gutter gives before the content does.** 24 pixels either side of
|
|
322
|
+
* a 390 window is 48 of 390 spent on margin, and the table needs 355 of what is
|
|
323
|
+
* left. At `md` it has 358 and fits; at `lg` it was 13 pixels short and the last
|
|
324
|
+
* column sat outside the box until the reader scrolled the table sideways.
|
|
325
|
+
*/
|
|
326
|
+
@media (width < 40rem) {
|
|
327
|
+
.page {
|
|
328
|
+
padding-block: var(--helix-space-xl) var(--helix-space-2xl);
|
|
329
|
+
padding-inline: var(--helix-space-md);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.footer-row {
|
|
333
|
+
padding-inline: var(--helix-space-md);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/*
|
|
338
|
+
* **The escape hatch, and the reason a component names its parts.** The table
|
|
339
|
+
* washes a chosen row at the strength `Tag` rests at; this page wants a row
|
|
340
|
+
* somebody has ticked to be findable from across the screen, and there is no
|
|
341
|
+
* token for "more than that". `::part` reaches the boxes the component drew
|
|
342
|
+
* without forking it, and a rule written out here beats the component's own
|
|
343
|
+
* however specific that one is.
|
|
344
|
+
*
|
|
345
|
+
* **Two parts and not one, because a row has no box.** The row is
|
|
346
|
+
* `display: contents` so that one grid can align every column across every row,
|
|
347
|
+
* which leaves the cells as the only thing a selection can be painted on. The
|
|
348
|
+
* table names both: the data cells and the cell holding the checkbox. Naming
|
|
349
|
+
* only the first leaves a pale stripe down the left of every chosen row.
|
|
350
|
+
*
|
|
351
|
+
* The values are still the library's, so a theme carries them like everything
|
|
352
|
+
* else. `primary-subtle` and not `primary-surface`: the second is the solid
|
|
353
|
+
* accent a button stands on and expects white on top of it, so a row painted
|
|
354
|
+
* with it puts the table's own ink on a saturated fill.
|
|
355
|
+
*/
|
|
356
|
+
helix-data-table::part(cell-selected),
|
|
357
|
+
helix-data-table::part(select-selected) {
|
|
358
|
+
background-color: var(--helix-color-primary-subtle);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
helix-data-table::part(cell-selected) {
|
|
362
|
+
font-weight: var(--helix-weight-semibold);
|
|
363
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The rows the overview draws.
|
|
3
|
+
*
|
|
4
|
+
* A local module and no network, so the starter runs with nothing behind it.
|
|
5
|
+
* Point `rows` at whatever you fetch and the table does not change: it takes the
|
|
6
|
+
* whole result and does the sorting, the filtering and the paging itself. Past
|
|
7
|
+
* the size a browser can hold, `mode="server"` inverts that and the table asks
|
|
8
|
+
* you for a page instead.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* One person on the roster.
|
|
13
|
+
*
|
|
14
|
+
* **A type alias and not an interface**, which TypeScript makes load-bearing
|
|
15
|
+
* here: `rows` takes `Readonly<Record<string, unknown>>`, an interface has no
|
|
16
|
+
* implicit index signature, and so an interface of exactly these fields is not
|
|
17
|
+
* assignable to it. The error names the index signature and not the shape, so
|
|
18
|
+
* it reads as though the data were wrong.
|
|
19
|
+
*/
|
|
20
|
+
export type Member = {
|
|
21
|
+
/**
|
|
22
|
+
* A stable identity, which is what `row-key` names.
|
|
23
|
+
*
|
|
24
|
+
* Sorting moves a row's element rather than rewriting every cell in it, so
|
|
25
|
+
* without one a sort throws away focus and anything attached to a row.
|
|
26
|
+
*/
|
|
27
|
+
readonly id: string
|
|
28
|
+
/**
|
|
29
|
+
* What the reader is here to find.
|
|
30
|
+
*/
|
|
31
|
+
readonly name: string
|
|
32
|
+
/**
|
|
33
|
+
* A number rather than a formatted string, so the column sorts by size.
|
|
34
|
+
*
|
|
35
|
+
* A cell showing `2.4k` sorts as text unless the column's `compare` says what
|
|
36
|
+
* the value underneath is, which is the one thing here that is cheap to get
|
|
37
|
+
* right now and expensive to add later.
|
|
38
|
+
*/
|
|
39
|
+
readonly reviews: number
|
|
40
|
+
/**
|
|
41
|
+
* What they do.
|
|
42
|
+
*/
|
|
43
|
+
readonly role: string
|
|
44
|
+
/**
|
|
45
|
+
* Who they do it with.
|
|
46
|
+
*/
|
|
47
|
+
readonly team: string
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const members: readonly Member[] = [
|
|
51
|
+
{ id: 'm-01', name: 'Ada Okonkwo', reviews: 184, role: 'Staff', team: 'Platform' },
|
|
52
|
+
{ id: 'm-02', name: 'Bruno Salas', reviews: 96, role: 'Senior', team: 'Payments' },
|
|
53
|
+
{ id: 'm-03', name: 'Cai Wen', reviews: 231, role: 'Principal', team: 'Platform' },
|
|
54
|
+
{ id: 'm-04', name: 'Dilara Yilmaz', reviews: 64, role: 'Senior', team: 'Growth' },
|
|
55
|
+
{ id: 'm-05', name: 'Esi Mensah', reviews: 148, role: 'Staff', team: 'Payments' },
|
|
56
|
+
{ id: 'm-06', name: 'Felix Braun', reviews: 39, role: 'Engineer', team: 'Growth' },
|
|
57
|
+
{ id: 'm-07', name: 'Gita Raman', reviews: 112, role: 'Senior', team: 'Platform' },
|
|
58
|
+
{ id: 'm-08', name: 'Hana Sato', reviews: 57, role: 'Engineer', team: 'Design' },
|
|
59
|
+
{ id: 'm-09', name: 'Ivan Petrov', reviews: 88, role: 'Senior', team: 'Payments' },
|
|
60
|
+
{ id: 'm-10', name: 'Jo Lindqvist', reviews: 21, role: 'Engineer', team: 'Design' },
|
|
61
|
+
{ id: 'm-11', name: 'Kwame Asante', reviews: 73, role: 'Staff', team: 'Growth' },
|
|
62
|
+
{ id: 'm-12', name: 'Lena Fischer', reviews: 12, role: 'Engineer', team: 'Design' },
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
/** The teams the form offers, read from the roster so the two cannot disagree. */
|
|
66
|
+
export const teams: readonly string[] = [...new Set(members.map((one) => one.team))].toSorted()
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The same roster as three figures, for the panel on the first screen.
|
|
70
|
+
*
|
|
71
|
+
* Derived rather than written out, so the panel cannot claim a number the table
|
|
72
|
+
* does not show.
|
|
73
|
+
*/
|
|
74
|
+
export const roster = {
|
|
75
|
+
/** How many rows the data view has. */
|
|
76
|
+
people: members.length,
|
|
77
|
+
/** Every review on the roster, added up. */
|
|
78
|
+
reviews: members.reduce((total, one) => total + one.reviews, 0),
|
|
79
|
+
/** How many teams they are spread across. */
|
|
80
|
+
teams: teams.length,
|
|
81
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helix diagnostics, which `main.ts` loads in development only.
|
|
3
|
+
*
|
|
4
|
+
* It finds the Helix mistakes that are valid CSS and therefore silent, such as
|
|
5
|
+
* a `::part()` naming a part nothing publishes, and an attribute value outside
|
|
6
|
+
* the set a component takes. Each finding prints once in DevTools, and a badge
|
|
7
|
+
* in the corner of the page lists them while there are any.
|
|
8
|
+
*
|
|
9
|
+
* **Checked against the Helix you installed**, from the lint data it ships, so
|
|
10
|
+
* nothing is loaded from the network.
|
|
11
|
+
*
|
|
12
|
+
* To print the findings in your terminal as well, run `npx helix diagnostics`
|
|
13
|
+
* from `@fusion.dev/helix-cli` beside the dev server, and add
|
|
14
|
+
* `sinks: { relay: true }` below.
|
|
15
|
+
*/
|
|
16
|
+
import { initDiagnostics } from '@fusion.dev/helix-diagnostics'
|
|
17
|
+
import lint from '@fusion.dev/helix/lint.json'
|
|
18
|
+
|
|
19
|
+
initDiagnostics({
|
|
20
|
+
environment: 'development',
|
|
21
|
+
/* The route is in the hash, so each page's findings are kept apart. */
|
|
22
|
+
page: () => window.location.hash.slice(1) || '/',
|
|
23
|
+
tiers: [{ lint }],
|
|
24
|
+
})
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The documentation this starter links to.
|
|
3
|
+
*
|
|
4
|
+
* **One module, because a link is the thing in a starter most likely to rot.**
|
|
5
|
+
* A page that composes its own URLs ships a plausible-looking 404 to every
|
|
6
|
+
* project scaffolded from it, and nobody finds out until a reader clicks one.
|
|
7
|
+
* Here they are in a list somebody can open and check, and pointing the starter
|
|
8
|
+
* at a mirror or an internal copy is one edit.
|
|
9
|
+
*
|
|
10
|
+
* Checked 16 Sep 2026: every entry answers 200.
|
|
11
|
+
*/
|
|
12
|
+
export const DOCS = {
|
|
13
|
+
/** How the elements are registered and written, which is the first page to read. */
|
|
14
|
+
elements: 'https://fusion.dev/helix/docs/using-the-elements',
|
|
15
|
+
/** What a `<form>` does with these controls, and what it cannot do. */
|
|
16
|
+
forms: 'https://fusion.dev/helix/docs/forms',
|
|
17
|
+
/** Every component, with its API, its parts and its examples. */
|
|
18
|
+
gallery: 'https://fusion.dev/helix/components',
|
|
19
|
+
/** The light and dark pair, and the attribute that chooses between them. */
|
|
20
|
+
modes: 'https://fusion.dev/helix/docs/color-modes',
|
|
21
|
+
/** Reaching a component's parts from a page, which `app.css` does once. */
|
|
22
|
+
parts: 'https://fusion.dev/helix/docs/overriding-a-component',
|
|
23
|
+
/** The data view's own page, where the rest of its API is. */
|
|
24
|
+
table: 'https://fusion.dev/helix/components/data-table',
|
|
25
|
+
/** Every token, and what each one is for. */
|
|
26
|
+
tokens: 'https://fusion.dev/helix/docs/tokens',
|
|
27
|
+
/** Vue specifically: the compiler setting, props, and events. */
|
|
28
|
+
vue: 'https://fusion.dev/helix/docs/vue',
|
|
29
|
+
} as const
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createApp } from 'vue'
|
|
2
|
+
|
|
3
|
+
/* Every layer in one import: the tokens, the reset, the utility layer, and the
|
|
4
|
+
`:not(:defined)` rules that keep a tag from arriving unstyled. It reaches its
|
|
5
|
+
pieces by bare specifier, so a bundler resolves it and a `<link>` cannot. */
|
|
6
|
+
import '@fusion.dev/helix-styles/helix.css'
|
|
7
|
+
/* A custom element registers as a side effect of being imported, so this line
|
|
8
|
+
makes every Helix tag in the app real. Import the whole library while you are
|
|
9
|
+
finding your feet. `@fusion.dev/helix/button` and its siblings are subpath
|
|
10
|
+
exports, for when you want to pay for only what you use. */
|
|
11
|
+
import '@fusion.dev/helix'
|
|
12
|
+
/* After both, so a rule of yours that names the same thing wins. */
|
|
13
|
+
import './app.css'
|
|
14
|
+
|
|
15
|
+
import App from './App.vue'
|
|
16
|
+
|
|
17
|
+
/* **Diagnostics in development, and none of it in a build.** `vite build`
|
|
18
|
+
replaces `import.meta.env.DEV` with `false` and drops the import with it. */
|
|
19
|
+
if (import.meta.env.DEV) {
|
|
20
|
+
void import('./diagnostics.ts')
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
createApp(App).mount('#app')
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { onScopeDispose, type Ref, ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
/* **The whole router, which is a hash and a listener.**
|
|
4
|
+
|
|
5
|
+
A starter should not pick your router for you, and three pages need
|
|
6
|
+
`location.hash` and one event. Swap this file for Vue Router when you want
|
|
7
|
+
nested routes or guards: `createWebHashHistory()` keeps these addresses.
|
|
8
|
+
|
|
9
|
+
A hash, because the History API wants a server that answers every path with
|
|
10
|
+
the same document, and `vite preview` and wherever you deploy each have to be
|
|
11
|
+
told to. A hash asks nothing of either. Each link in the app is a plain anchor
|
|
12
|
+
to `#/` and a path. */
|
|
13
|
+
|
|
14
|
+
/** Where the reader is, as a path, so the first page is `/`. */
|
|
15
|
+
const read = (): string => window.location.hash.slice(1) || '/'
|
|
16
|
+
|
|
17
|
+
/** The current path, kept current as the hash changes. */
|
|
18
|
+
export function usePathname(): Readonly<Ref<string>> {
|
|
19
|
+
const path = ref(read())
|
|
20
|
+
const follow = () => {
|
|
21
|
+
path.value = read()
|
|
22
|
+
}
|
|
23
|
+
window.addEventListener('hashchange', follow)
|
|
24
|
+
onScopeDispose(() => window.removeEventListener('hashchange', follow))
|
|
25
|
+
return path
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowImportingTsExtensions": true,
|
|
4
|
+
"lib": [
|
|
5
|
+
"DOM",
|
|
6
|
+
"DOM.Iterable",
|
|
7
|
+
"ES2023"
|
|
8
|
+
],
|
|
9
|
+
"module": "ESNext",
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"noEmit": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"strict": true,
|
|
15
|
+
"target": "ES2023",
|
|
16
|
+
"types": [
|
|
17
|
+
"vite/client"
|
|
18
|
+
],
|
|
19
|
+
"verbatimModuleSyntax": true
|
|
20
|
+
},
|
|
21
|
+
"include": [
|
|
22
|
+
"src/**/*.ts",
|
|
23
|
+
"src/**/*.vue",
|
|
24
|
+
"helix-vue.d.ts"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import vue from '@vitejs/plugin-vue'
|
|
2
|
+
import { defineConfig } from 'vite'
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
plugins: [
|
|
6
|
+
vue({
|
|
7
|
+
/* **The one setting Vue needs.** Without it, Vue looks up every Helix tag
|
|
8
|
+
as a component it cannot find, and warns on every render. Every Helix
|
|
9
|
+
tag starts with `helix-`, in both tiers, and no other name does. */
|
|
10
|
+
template: { compilerOptions: { isCustomElement: (tag) => tag.startsWith('helix-') } },
|
|
11
|
+
}),
|
|
12
|
+
],
|
|
13
|
+
})
|
package/templates.json
CHANGED
|
@@ -20,6 +20,47 @@
|
|
|
20
20
|
"package.json"
|
|
21
21
|
],
|
|
22
22
|
"title": "React (Next.js)"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"description": "Vue and TypeScript on Vite.",
|
|
26
|
+
"id": "vue-vite",
|
|
27
|
+
"named": [
|
|
28
|
+
"index.html",
|
|
29
|
+
"package.json",
|
|
30
|
+
"src/SiteHeader.vue"
|
|
31
|
+
],
|
|
32
|
+
"title": "Vue (Vite)"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"description": "Angular and TypeScript on the Angular CLI.",
|
|
36
|
+
"id": "angular",
|
|
37
|
+
"named": [
|
|
38
|
+
"angular.json",
|
|
39
|
+
"package.json",
|
|
40
|
+
"src/app/site-header.html",
|
|
41
|
+
"src/index.html"
|
|
42
|
+
],
|
|
43
|
+
"title": "Angular"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"description": "Svelte and TypeScript on Vite.",
|
|
47
|
+
"id": "svelte-vite",
|
|
48
|
+
"named": [
|
|
49
|
+
"index.html",
|
|
50
|
+
"package.json",
|
|
51
|
+
"src/SiteHeader.svelte"
|
|
52
|
+
],
|
|
53
|
+
"title": "Svelte (Vite)"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"description": "Solid and TypeScript on Vite.",
|
|
57
|
+
"id": "solid-vite",
|
|
58
|
+
"named": [
|
|
59
|
+
"index.html",
|
|
60
|
+
"package.json",
|
|
61
|
+
"src/site-header.tsx"
|
|
62
|
+
],
|
|
63
|
+
"title": "Solid (Vite)"
|
|
23
64
|
}
|
|
24
65
|
],
|
|
25
66
|
"version": "__HELIX_VERSION__"
|