@fusion.dev/helix-templates 0.138.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 (106) hide show
  1. package/README.md +18 -6
  2. package/dist/index.js +24 -0
  3. package/package.json +1 -1
  4. package/templates/angular/angular.json +57 -0
  5. package/templates/angular/package.json +28 -0
  6. package/templates/angular/src/app/app.config.ts +8 -0
  7. package/templates/angular/src/app/app.html +19 -0
  8. package/templates/angular/src/app/app.ts +29 -0
  9. package/templates/angular/src/app/data.ts +81 -0
  10. package/templates/angular/src/app/docs.ts +29 -0
  11. package/templates/angular/src/app/landing.html +77 -0
  12. package/templates/angular/src/app/landing.ts +29 -0
  13. package/templates/angular/src/app/overview.html +49 -0
  14. package/templates/angular/src/app/overview.ts +25 -0
  15. package/templates/angular/src/app/pathname.ts +24 -0
  16. package/templates/angular/src/app/signup-form.html +90 -0
  17. package/templates/angular/src/app/signup-form.ts +65 -0
  18. package/templates/angular/src/app/site-footer.html +10 -0
  19. package/templates/angular/src/app/site-footer.ts +22 -0
  20. package/templates/angular/src/app/site-header.html +30 -0
  21. package/templates/angular/src/app/site-header.ts +57 -0
  22. package/templates/angular/src/app.css +355 -0
  23. package/templates/angular/src/diagnostics.ts +24 -0
  24. package/templates/angular/src/index.html +12 -0
  25. package/templates/angular/src/main.ts +21 -0
  26. package/templates/angular/tsconfig.app.json +9 -0
  27. package/templates/angular/tsconfig.json +34 -0
  28. package/templates/react-nextjs/app/app.css +144 -152
  29. package/templates/react-nextjs/app/data.ts +17 -17
  30. package/templates/react-nextjs/app/diagnostics.ts +19 -0
  31. package/templates/react-nextjs/app/docs.ts +9 -9
  32. package/templates/react-nextjs/app/landing.tsx +63 -121
  33. package/templates/react-nextjs/app/overview.tsx +25 -27
  34. package/templates/react-nextjs/app/signup-form.tsx +36 -39
  35. package/templates/react-nextjs/app/site-footer.tsx +7 -10
  36. package/templates/react-nextjs/app/site-header.tsx +17 -21
  37. package/templates/react-nextjs/helix-jsx.d.ts +5 -7
  38. package/templates/react-nextjs/instrumentation-client.ts +6 -0
  39. package/templates/react-nextjs/package.json +1 -0
  40. package/templates/react-nextjs/tsconfig.json +1 -0
  41. package/templates/react-vite/helix-jsx.d.ts +5 -7
  42. package/templates/react-vite/package.json +1 -0
  43. package/templates/react-vite/src/app.css +144 -152
  44. package/templates/react-vite/src/data.ts +17 -17
  45. package/templates/react-vite/src/diagnostics.ts +24 -0
  46. package/templates/react-vite/src/docs.ts +9 -9
  47. package/templates/react-vite/src/landing.tsx +63 -121
  48. package/templates/react-vite/src/main.tsx +6 -0
  49. package/templates/react-vite/src/overview.tsx +24 -26
  50. package/templates/react-vite/src/routes.tsx +11 -13
  51. package/templates/react-vite/src/signup-form.tsx +36 -39
  52. package/templates/react-vite/src/site-footer.tsx +7 -10
  53. package/templates/react-vite/src/site-header.tsx +15 -19
  54. package/templates/react-vite/tsconfig.json +1 -0
  55. package/templates/solid-vite/helix-solid.d.ts +14 -0
  56. package/templates/solid-vite/index.html +12 -0
  57. package/templates/solid-vite/package.json +22 -0
  58. package/templates/solid-vite/src/App.tsx +35 -0
  59. package/templates/solid-vite/src/app.css +355 -0
  60. package/templates/solid-vite/src/data.ts +81 -0
  61. package/templates/solid-vite/src/diagnostics.ts +24 -0
  62. package/templates/solid-vite/src/docs.ts +29 -0
  63. package/templates/solid-vite/src/landing.tsx +130 -0
  64. package/templates/solid-vite/src/main.tsx +23 -0
  65. package/templates/solid-vite/src/overview.tsx +78 -0
  66. package/templates/solid-vite/src/routes.ts +22 -0
  67. package/templates/solid-vite/src/signup-form.tsx +151 -0
  68. package/templates/solid-vite/src/site-footer.tsx +34 -0
  69. package/templates/solid-vite/src/site-header.tsx +76 -0
  70. package/templates/solid-vite/tsconfig.json +27 -0
  71. package/templates/solid-vite/vite.config.ts +7 -0
  72. package/templates/svelte-vite/helix-svelte.d.ts +9 -0
  73. package/templates/svelte-vite/index.html +12 -0
  74. package/templates/svelte-vite/package.json +23 -0
  75. package/templates/svelte-vite/src/App.svelte +35 -0
  76. package/templates/svelte-vite/src/Landing.svelte +100 -0
  77. package/templates/svelte-vite/src/Overview.svelte +67 -0
  78. package/templates/svelte-vite/src/SignupForm.svelte +147 -0
  79. package/templates/svelte-vite/src/SiteFooter.svelte +26 -0
  80. package/templates/svelte-vite/src/SiteHeader.svelte +71 -0
  81. package/templates/svelte-vite/src/app.css +355 -0
  82. package/templates/svelte-vite/src/data.ts +81 -0
  83. package/templates/svelte-vite/src/diagnostics.ts +24 -0
  84. package/templates/svelte-vite/src/docs.ts +29 -0
  85. package/templates/svelte-vite/src/main.ts +23 -0
  86. package/templates/svelte-vite/src/routes.svelte.ts +19 -0
  87. package/templates/svelte-vite/tsconfig.json +28 -0
  88. package/templates/svelte-vite/vite.config.ts +7 -0
  89. package/templates/vue-vite/helix-vue.d.ts +8 -0
  90. package/templates/vue-vite/index.html +12 -0
  91. package/templates/vue-vite/package.json +23 -0
  92. package/templates/vue-vite/src/App.vue +39 -0
  93. package/templates/vue-vite/src/LandingPage.vue +102 -0
  94. package/templates/vue-vite/src/OverviewPage.vue +69 -0
  95. package/templates/vue-vite/src/SignupForm.vue +149 -0
  96. package/templates/vue-vite/src/SiteFooter.vue +28 -0
  97. package/templates/vue-vite/src/SiteHeader.vue +71 -0
  98. package/templates/vue-vite/src/app.css +355 -0
  99. package/templates/vue-vite/src/data.ts +81 -0
  100. package/templates/vue-vite/src/diagnostics.ts +24 -0
  101. package/templates/vue-vite/src/docs.ts +29 -0
  102. package/templates/vue-vite/src/main.ts +23 -0
  103. package/templates/vue-vite/src/routes.ts +26 -0
  104. package/templates/vue-vite/tsconfig.json +26 -0
  105. package/templates/vue-vite/vite.config.ts +13 -0
  106. package/templates.json +41 -0
@@ -0,0 +1,355 @@
1
+ /*
2
+ * The page around the components.
3
+ *
4
+ * Helix draws the inside of each component, so an app stylesheet holds the
5
+ * measure, the rhythm between blocks, and the few decisions a component leaves
6
+ * open. Everything below is a Helix token or a documented hook, so a theme
7
+ * changes it, and both color modes follow from one copy.
8
+ *
9
+ * **Color appears in two places, and both are named.** The wordmark takes
10
+ * `--helix-color-brand-mark`, the token for the brand as a graphic, and a
11
+ * chosen row takes `--helix-color-primary-subtle` through the parts the table
12
+ * publishes. Everywhere else the page is ink on the background, and the
13
+ * components carry their own color.
14
+ */
15
+
16
+ /*
17
+ * **The shell: a column the height of the window, with the footer at its end.**
18
+ * The overview is a header, a table, and a caption, which on a 1280 by 900
19
+ * window left about four hundred empty pixels under it. The column puts a floor
20
+ * under every route.
21
+ *
22
+ * **A flex column, because the bar is sticky.** A grid item's containing block
23
+ * is its own grid area, one row as tall as the bar, so a sticky header in a
24
+ * grid row has nowhere to stick. A flex item's containing block is the flex
25
+ * container, which here is the whole document.
26
+ */
27
+ .shell {
28
+ display: flex;
29
+ flex-direction: column;
30
+ min-block-size: 100dvh;
31
+ }
32
+
33
+ /*
34
+ * **56rem, the width the widest block reads well at.** The widest block here is
35
+ * a four-column table: given the whole of a 1280 window, its first column came
36
+ * out 448 pixels across to hold a name, which reads as a stretched table. The
37
+ * bar and the footer are centered in the same width, so the wordmark sits over
38
+ * the first column of the page.
39
+ *
40
+ * `flex-grow` gives the spare height to the page, and the footer keeps its own.
41
+ */
42
+ .page {
43
+ flex-grow: 1;
44
+ margin-inline: auto;
45
+ max-inline-size: 56rem;
46
+ padding-block: var(--helix-space-2xl) var(--helix-space-3xl);
47
+ padding-inline: var(--helix-space-lg);
48
+ }
49
+
50
+ /*
51
+ * Two documented hooks, both to match the page. The bar centers its row in the
52
+ * page's measure, so the wordmark sits over the first column. And the bar draws
53
+ * no line under itself by default, since a header over a page with its own
54
+ * surface needs none: this page has no such surface, so it sets one. The line
55
+ * is a token, so it follows the theme.
56
+ */
57
+ helix-app-header {
58
+ --app-header-border-color: var(--helix-color-border);
59
+ --app-header-max-inline-size: 56rem;
60
+ }
61
+
62
+ /* The mark beside the project's name, the one graphic on the page and the
63
+ reason `--helix-color-brand-mark` exists. WCAG asks 3:1 of a graphic and 4.5:1
64
+ of text, so a mark can sit closer to a theme's brand color than any text
65
+ color can. Swap the glyph, or replace the whole element with your own logo. */
66
+ .wordmark {
67
+ align-items: center;
68
+ display: inline-flex;
69
+ gap: var(--helix-space-xs);
70
+ }
71
+
72
+ .wordmark helix-icon {
73
+ color: var(--helix-color-brand-mark);
74
+ }
75
+
76
+ /*
77
+ * One rhythm between the blocks of a page, so no page sets its own.
78
+ *
79
+ * **`minmax(0, 1fr)` for every column, the guard every grid here needs.** An
80
+ * implicit track is `auto`, and an `auto` track's minimum is its content's
81
+ * min-content size, so a child that scrolls itself widens the track and takes
82
+ * the page with it. Measured at 320: the table's columns floor at 344, the
83
+ * column it sits in should have been 288, and `documentElement.scrollWidth`
84
+ * came back 360 against a 320 viewport, so the whole page scrolled sideways. A
85
+ * minimum of zero leaves the overflow to the table, which scrolls its own box.
86
+ */
87
+ .stack,
88
+ .section,
89
+ .hero,
90
+ .first-screen,
91
+ .features,
92
+ .notes,
93
+ .split {
94
+ grid-template-columns: minmax(0, 1fr);
95
+ }
96
+
97
+ /* One step between the blocks of a page and a smaller one inside them, which is
98
+ the whole of the rhythm: `3xl` here, and the `md` a section puts between its
99
+ heading and its block. */
100
+ .stack {
101
+ display: grid;
102
+ gap: var(--helix-space-3xl);
103
+ }
104
+
105
+ /*
106
+ * **The first screen: one lit panel, with what the starter is on the left and
107
+ * the library at work on the right.** Below 60rem two readable columns do not
108
+ * fit, so they become one, and the glass card follows the words.
109
+ *
110
+ * `isolation` makes the panel its own stacking context, so the light behind it
111
+ * sits under the content and above the page, and `overflow: clip` keeps the
112
+ * light inside the rounded corners.
113
+ */
114
+ .first-screen {
115
+ align-items: center;
116
+ border: var(--helix-border-thin) solid var(--helix-color-border);
117
+ border-radius: var(--helix-radii-lg);
118
+ display: grid;
119
+ gap: var(--helix-space-2xl);
120
+ isolation: isolate;
121
+ overflow: clip;
122
+ padding: var(--helix-space-3xl) var(--helix-space-2xl);
123
+ position: relative;
124
+ }
125
+
126
+ @media (width >= 60rem) {
127
+ .first-screen {
128
+ grid-template-columns: minmax(0, 1fr) minmax(0, 18rem);
129
+ }
130
+ }
131
+
132
+ /* The light, under everything in the panel and out of the way of the pointer,
133
+ and faded out behind the words so they keep their contrast: it is at full
134
+ strength only behind the card, which is below the words in one column and
135
+ beside them in two. */
136
+ .first-light {
137
+ block-size: auto;
138
+ inset: 0;
139
+ mask-image: linear-gradient(to bottom, transparent 40%, black 80%);
140
+ pointer-events: none;
141
+ position: absolute;
142
+ z-index: var(--helix-layer-beneath);
143
+ }
144
+
145
+ @media (width >= 60rem) {
146
+ .first-light {
147
+ mask-image: linear-gradient(to right, transparent 35%, black 70%);
148
+ }
149
+ }
150
+
151
+ /* A heading and the lines around it are one block, with a smaller gap than the
152
+ one between blocks. Every route opens with one. */
153
+ .hero {
154
+ display: grid;
155
+ gap: var(--helix-space-xs);
156
+ justify-items: start;
157
+ }
158
+
159
+ /* The first screen's heading takes more room around it than a route's, and
160
+ its lede a step more size, wrapped to even lines. */
161
+ .first-screen .hero {
162
+ gap: var(--helix-space-md);
163
+ }
164
+
165
+ .first-screen .lede {
166
+ font-size: var(--helix-text-lg);
167
+ text-wrap: balance;
168
+ }
169
+
170
+ /* **A measure for the lede, narrower than the page's.** A line of prose across
171
+ 56rem is around 110 characters, and the readable range tops out near 75. The
172
+ heading above it keeps the page's measure, since a heading is scanned. */
173
+ .lede {
174
+ max-inline-size: 42rem;
175
+ }
176
+
177
+ .actions {
178
+ display: flex;
179
+ flex-wrap: wrap;
180
+ gap: var(--helix-space-sm);
181
+ padding-block-start: var(--helix-space-md);
182
+ }
183
+
184
+ /*
185
+ * **The panel is the library at work**, so all it needs from here is room. Two
186
+ * documented hooks: the figures come down a step from the display size, which
187
+ * suits one figure on its own and is too loud for three in an 18rem column, and
188
+ * the gap around the rule between them comes in from `2xl`, which `divided`
189
+ * doubles, leaving no room for a number.
190
+ */
191
+ .specimen {
192
+ --stat-group-gap: var(--helix-space-md);
193
+ --stat-value-size: var(--helix-text-xl);
194
+ }
195
+
196
+ /* A section is its heading and its one block, closer together than two sections
197
+ are. */
198
+ .section {
199
+ display: grid;
200
+ gap: var(--helix-space-md);
201
+ }
202
+
203
+ /* Three tiles, side by side where there is room for three. */
204
+ .features {
205
+ display: grid;
206
+ gap: var(--helix-space-lg);
207
+ }
208
+
209
+ @media (width >= 48rem) {
210
+ .features {
211
+ grid-template-columns: repeat(3, minmax(0, 1fr));
212
+ }
213
+ }
214
+
215
+ /* The card fills the link that wraps it, so the row of tiles ends level: the
216
+ anchor is the grid item, which stretches, and the card takes its full height. */
217
+ [data-card] > helix-card {
218
+ block-size: 100%;
219
+ }
220
+
221
+ /* Each tile's icon, on a tint of the brand. */
222
+ .feature-mark {
223
+ --icon-size: 1.25rem;
224
+ background-color: var(--helix-color-primary-subtle);
225
+ border-radius: var(--helix-radii-md);
226
+ color: var(--helix-color-primary);
227
+ display: inline-flex;
228
+ inline-size: fit-content;
229
+ padding: var(--helix-space-xs);
230
+ }
231
+
232
+ /* A form is read straight down, and a field wider than about 28rem is hard to
233
+ scan, however much room the window has. */
234
+ .form {
235
+ align-content: start;
236
+ display: grid;
237
+ gap: var(--helix-space-lg);
238
+ justify-items: start;
239
+ max-inline-size: 28rem;
240
+ }
241
+
242
+ /* Every control fills the column; the submit is as wide as its own words. */
243
+ .form > :not(helix-button) {
244
+ inline-size: 100%;
245
+ }
246
+
247
+ /*
248
+ * **The form takes a column and the notes take the rest.** A 28rem form alone
249
+ * on a 1280 window fills a third of the page and leaves two thirds empty: the
250
+ * form has a right width, and the page keeps its own. Narrow, the two stack,
251
+ * and the notes read as a postscript, the order they are written in.
252
+ */
253
+ .split {
254
+ display: grid;
255
+ gap: var(--helix-space-2xl);
256
+ }
257
+
258
+ @media (width >= 60rem) {
259
+ .split {
260
+ grid-template-columns: minmax(0, 28rem) minmax(0, 1fr);
261
+ }
262
+ }
263
+
264
+ /* `start`, because a grid column stretches to its tallest sibling and a
265
+ stretched grid shares the difference out between its own rows: beside a form
266
+ half a page long, three paragraphs came out 140 pixels apart. */
267
+ .notes {
268
+ align-content: start;
269
+ display: grid;
270
+ gap: var(--helix-space-sm);
271
+ justify-items: start;
272
+ max-inline-size: 32rem;
273
+ }
274
+
275
+ /* The callout takes the column, which `start` above would otherwise size to its
276
+ own words: a notice narrower than the paragraph under it reads as a stray. The
277
+ link beside it is meant to be its own width. */
278
+ .notes > helix-callout {
279
+ inline-size: 100%;
280
+ }
281
+
282
+ /*
283
+ * **The counterpart to the bar, which gives every route an end.** The rule runs
284
+ * the width of the window while its contents keep the page's measure, as a
285
+ * footer under a centered page does. The shell above holds it to the bottom of a
286
+ * window a route does not fill.
287
+ */
288
+ .site-footer {
289
+ border-block-start: var(--helix-border-thin) solid var(--helix-color-border);
290
+ }
291
+
292
+ .footer-row {
293
+ display: flex;
294
+ flex-wrap: wrap;
295
+ gap: var(--helix-space-md);
296
+ justify-content: space-between;
297
+ margin-inline: auto;
298
+ max-inline-size: 56rem;
299
+ padding-block: var(--helix-space-lg);
300
+ padding-inline: var(--helix-space-lg);
301
+ }
302
+
303
+ .footer-links {
304
+ display: flex;
305
+ flex-wrap: wrap;
306
+ gap: var(--helix-space-md);
307
+ }
308
+
309
+ /*
310
+ * **Narrow, the gutter gives first.** 24 pixels either side of a 390 window
311
+ * spend 48 of 390 on margin, and the table needs 355 of what is left. At `md` it
312
+ * has 358 and fits; at `lg` it was 13 pixels short, and the last column sat
313
+ * outside the box until you scrolled the table sideways.
314
+ */
315
+ @media (width < 40rem) {
316
+ .first-screen {
317
+ padding: var(--helix-space-2xl) var(--helix-space-lg);
318
+ }
319
+
320
+ .page {
321
+ padding-block: var(--helix-space-xl) var(--helix-space-2xl);
322
+ padding-inline: var(--helix-space-md);
323
+ }
324
+
325
+ .footer-row {
326
+ padding-inline: var(--helix-space-md);
327
+ }
328
+ }
329
+
330
+ /*
331
+ * **The escape hatch, and the reason a component names its parts.** The table
332
+ * tints a chosen row at the strength `Tag` rests at, and this page wants a
333
+ * ticked row easy to find from across the screen, a step past any token.
334
+ * `::part` reaches the boxes the component drew, with no fork, and a rule
335
+ * written out here beats the component's own, however specific that one is.
336
+ *
337
+ * **Two parts, because a row has no box.** The row is `display: contents`, so
338
+ * one grid can align every column across every row, and the cells are what a
339
+ * selection is painted on. The table names both: the data cells and the cell
340
+ * holding the checkbox. Naming only the first leaves a pale stripe down the
341
+ * left of every chosen row.
342
+ *
343
+ * The values are still the library's, so a theme carries them like everything
344
+ * else. `primary-subtle`, because `primary-surface` is the solid accent a
345
+ * button stands on, made for white text, so a row painted with it would put the
346
+ * table's own ink on a saturated fill.
347
+ */
348
+ helix-data-table::part(cell-selected),
349
+ helix-data-table::part(select-selected) {
350
+ background-color: var(--helix-color-primary-subtle);
351
+ }
352
+
353
+ helix-data-table::part(cell-selected) {
354
+ font-weight: var(--helix-weight-semibold);
355
+ }
@@ -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 stays the same: 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"` hands the paging to you, one page
8
+ * at a time.
9
+ */
10
+
11
+ /**
12
+ * One person on the roster.
13
+ *
14
+ * **A type alias, which TypeScript makes load-bearing here.** `rows` takes
15
+ * `Readonly<Record<string, unknown>>`, and an interface has no implicit index
16
+ * signature, so an interface of exactly these fields is not assignable to it.
17
+ * The error names the index signature, so it reads as though the data were
18
+ * wrong.
19
+ */
20
+ export type Member = {
21
+ /**
22
+ * A stable identity, which is what `row-key` names.
23
+ *
24
+ * With one, a sort moves each row's element whole, so focus and anything
25
+ * attached to a row go with it. Without one, a sort rewrites the cells in
26
+ * place and loses both.
27
+ */
28
+ readonly id: string
29
+ /**
30
+ * The name a row is found by.
31
+ */
32
+ readonly name: string
33
+ /**
34
+ * A number, so the column sorts by size.
35
+ *
36
+ * A cell showing `2.4k` sorts as text unless the column's `compare` says what
37
+ * the value underneath is, which is cheap to get right now and expensive to
38
+ * add later.
39
+ */
40
+ readonly reviews: number
41
+ /**
42
+ * What they do.
43
+ */
44
+ readonly role: string
45
+ /**
46
+ * Who they do it with.
47
+ */
48
+ readonly team: string
49
+ }
50
+
51
+ export const members: readonly Member[] = [
52
+ { id: 'm-01', name: 'Ada Okonkwo', reviews: 184, role: 'Staff', team: 'Platform' },
53
+ { id: 'm-02', name: 'Bruno Salas', reviews: 96, role: 'Senior', team: 'Payments' },
54
+ { id: 'm-03', name: 'Cai Wen', reviews: 231, role: 'Principal', team: 'Platform' },
55
+ { id: 'm-04', name: 'Dilara Yilmaz', reviews: 64, role: 'Senior', team: 'Growth' },
56
+ { id: 'm-05', name: 'Esi Mensah', reviews: 148, role: 'Staff', team: 'Payments' },
57
+ { id: 'm-06', name: 'Felix Braun', reviews: 39, role: 'Engineer', team: 'Growth' },
58
+ { id: 'm-07', name: 'Gita Raman', reviews: 112, role: 'Senior', team: 'Platform' },
59
+ { id: 'm-08', name: 'Hana Sato', reviews: 57, role: 'Engineer', team: 'Design' },
60
+ { id: 'm-09', name: 'Ivan Petrov', reviews: 88, role: 'Senior', team: 'Payments' },
61
+ { id: 'm-10', name: 'Jo Lindqvist', reviews: 21, role: 'Engineer', team: 'Design' },
62
+ { id: 'm-11', name: 'Kwame Asante', reviews: 73, role: 'Staff', team: 'Growth' },
63
+ { id: 'm-12', name: 'Lena Fischer', reviews: 12, role: 'Engineer', team: 'Design' },
64
+ ]
65
+
66
+ /** The teams the form offers, read from the roster so the two cannot disagree. */
67
+ export const teams: readonly string[] = [...new Set(members.map((one) => one.team))].toSorted()
68
+
69
+ /**
70
+ * The same roster as three figures, for the panel on the first screen.
71
+ *
72
+ * Derived from the rows, so the panel and the table always agree.
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 the starter links to.
3
+ *
4
+ * **One module, because links are what rots first in a starter.** A page that
5
+ * composes its own URLs ships a plausible-looking 404 to every project
6
+ * scaffolded from it, and it shows only when the link is followed. Here they
7
+ * are in one list you can open and check, and pointing the starter at a mirror
8
+ * or an internal copy is one edit.
9
+ *
10
+ * Checked October 4, 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 sets which one shows. */
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
+ /** Svelte specifically: the typings, props, and events. */
24
+ svelte: 'https://fusion.dev/helix/docs/svelte',
25
+ /** The data view's own page, where the rest of its API is. */
26
+ table: 'https://fusion.dev/helix/components/data-table',
27
+ /** Every token, and what each one is for. */
28
+ tokens: 'https://fusion.dev/helix/docs/tokens',
29
+ } as const
@@ -0,0 +1,23 @@
1
+ import { mount } from 'svelte'
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.svelte'
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
+ mount(App, { target: document.querySelector('#app') as HTMLElement })
@@ -0,0 +1,19 @@
1
+ /* **The whole router, which is a hash and a listener.**
2
+
3
+ Three pages need `location.hash` and one event, so the starter leaves the
4
+ router to you. Swap this file for the router you want.
5
+
6
+ A hash, because the History API wants a server that answers every path with
7
+ the same document, and `vite preview` and wherever you deploy each have to be
8
+ told to. A hash asks nothing of either. Each link in the app is a plain
9
+ anchor to `#/` and a path. */
10
+
11
+ /** The current path, read from the hash, so the first page is `/`. */
12
+ const read = (): string => window.location.hash.slice(1) || '/'
13
+
14
+ /** The current path, kept current as the hash changes. */
15
+ export const route = $state({ path: read() })
16
+
17
+ window.addEventListener('hashchange', () => {
18
+ route.path = read()
19
+ })
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowImportingTsExtensions": true,
4
+ "isolatedModules": true,
5
+ "lib": [
6
+ "DOM",
7
+ "DOM.Iterable",
8
+ "ES2023"
9
+ ],
10
+ "module": "ESNext",
11
+ "moduleResolution": "bundler",
12
+ "noEmit": true,
13
+ "resolveJsonModule": true,
14
+ "skipLibCheck": true,
15
+ "strict": true,
16
+ "target": "ES2023",
17
+ "types": [
18
+ "svelte",
19
+ "vite/client"
20
+ ],
21
+ "verbatimModuleSyntax": true
22
+ },
23
+ "include": [
24
+ "src/**/*.ts",
25
+ "src/**/*.svelte",
26
+ "helix-svelte.d.ts"
27
+ ]
28
+ }
@@ -0,0 +1,7 @@
1
+ import { svelte } from '@sveltejs/vite-plugin-svelte'
2
+ import { defineConfig } from 'vite'
3
+
4
+ /* Svelte needs no setting for custom elements: it sets a property where the
5
+ element has one, an attribute otherwise, and binds `on*` with
6
+ `addEventListener`. */
7
+ export default defineConfig({ plugins: [svelte()] })
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Types for the Helix custom elements in Vue templates.
3
+ *
4
+ * Generated from the same manifest the API pages read, so a wrong prop or a
5
+ * wrong event detail is a compile error in `vue-tsc`. The import augments Vue's
6
+ * `GlobalComponents`, so every Helix tag in an SFC template is typed.
7
+ */
8
+ import '@fusion.dev/helix/vue'
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>__PROJECT_NAME__</title>
7
+ </head>
8
+ <body>
9
+ <div id="app"></div>
10
+ <script type="module" src="/src/main.ts"></script>
11
+ </body>
12
+ </html>
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "__PROJECT_NAME__",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "vue-tsc && vite build",
8
+ "dev": "vite",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "@fusion.dev/helix": "^__HELIX_VERSION__",
13
+ "@fusion.dev/helix-styles": "^__HELIX_VERSION__",
14
+ "vue": "^3.5.43"
15
+ },
16
+ "devDependencies": {
17
+ "@fusion.dev/helix-diagnostics": "^__HELIX_VERSION__",
18
+ "@vitejs/plugin-vue": "^6.0.9",
19
+ "typescript": "~6.0.3",
20
+ "vite": "^8.3.0",
21
+ "vue-tsc": "^3.3.12"
22
+ }
23
+ }
@@ -0,0 +1,39 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+ import LandingPage from './LandingPage.vue'
4
+ import OverviewPage from './OverviewPage.vue'
5
+ import { usePathname } from './routes.ts'
6
+ import SignupForm from './SignupForm.vue'
7
+ import SiteFooter from './SiteFooter.vue'
8
+ import SiteHeader from './SiteHeader.vue'
9
+
10
+ /** The page for each path, in the order the bar offers them. */
11
+ const PAGES = {
12
+ '/': LandingPage,
13
+ '/join': SignupForm,
14
+ '/overview': OverviewPage,
15
+ }
16
+
17
+ const path = usePathname()
18
+ const page = computed(() => PAGES[path.value as keyof typeof PAGES] ?? LandingPage)
19
+ </script>
20
+
21
+ <!--
22
+ The shell, and the switch between the three pages.
23
+
24
+ Helix components are custom elements, so you write the tags directly. There
25
+ is no wrapper package and nothing to import per component: `src/main.ts`
26
+ registers them once, and every tag in the app is real from then on.
27
+
28
+ The bar, the route, and the footer sit in a column the height of the window.
29
+ `app.css` says why the footer is worth having and why the column is flex.
30
+ -->
31
+ <template>
32
+ <div class="shell">
33
+ <SiteHeader />
34
+ <main class="page">
35
+ <component :is="page" />
36
+ </main>
37
+ <SiteFooter />
38
+ </div>
39
+ </template>