@fusion.dev/helix-docs 0.186.0 → 0.187.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.
@@ -87,6 +87,17 @@ table should not be seen, hide it visually, and the data is still there:
87
87
  >…</table>
88
88
  ```
89
89
 
90
+ A table hidden this way takes no room on the page, however many rows it has.
91
+ Inside an element with a `transform` or a `filter`, a long hidden table still
92
+ lengthens that element's scrolling area. Wrap the table in a hidden `<div>`
93
+ there:
94
+
95
+ ```html
96
+ <div data-hidden-visually>
97
+ <table id="revenue">…</table>
98
+ </div>
99
+ ```
100
+
90
101
  The table's caption becomes the chart's accessible name unless you set `label`.
91
102
  The caption usually has the right words already.
92
103
 
@@ -45,15 +45,20 @@ type such as `ButtonEmphasis` sends you somewhere else to look.
45
45
  ## Markdown and JSON for each component family
46
46
 
47
47
  ```
48
- /components/<family>.md
49
- /components/<family>.json
48
+ https://fusion.dev/helix/components/<family>.md
49
+ https://fusion.dev/helix/components/<family>.json
50
50
  ```
51
51
 
52
- These are static files. The `.md` file has:
52
+ These are static files, one pair for each family. Read the family you are
53
+ writing instead of the whole manifest. The manifest holds every family in one
54
+ file, and it is several megabytes.
55
+
56
+ The `.md` file has:
53
57
 
54
58
  - the family's metadata
59
+ - a Usage block with the import lines for the family
55
60
  - every element's description and API tables
56
- - the examples
61
+ - the examples, each with the import lines it needs
57
62
 
58
63
  The HTML page leaves the examples out on purpose. The page lists what a
59
64
  component can do, and the sandbox beside it shows what the component looks
@@ -61,24 +66,49 @@ like. Keeping pictures out of the reference keeps it the one place you can trust
61
66
  to be complete. An agent cannot use the sandbox, and it reads an example as
62
67
  text, so the `.md` file includes the examples.
63
68
 
64
- The `.json` file has the same family as structured data.
69
+ Each example the visual check pictures links its pictures under it: wide at
70
+ 640 pixels, narrow at 390, and dark at 640, taken in the environment that
71
+ `examples.json` records. Compare a render of your own to them.
72
+
73
+ The `.json` file has the same family as structured data, and three fields an
74
+ agent uses most:
75
+
76
+ - `usage`, the import block for each tier
77
+ - `imports` on each example, an import line for every element it writes
78
+ - `specifier` and `words` on each element: the line that registers it, and the
79
+ properties `registerWords` translates
80
+
81
+ ## Import every family you write
82
+
83
+ Each tag needs its family's entry imported. A family registers its own parts,
84
+ so `@fusion.dev/helix/tabs` registers Tab and Tab Panel. A family does not
85
+ register another family's elements that you write inside it:
86
+
87
+ ```js
88
+ import '@fusion.dev/helix/select'
89
+ import '@fusion.dev/helix/option'
90
+ ```
91
+
92
+ Without the Option import, the options are unknown elements and the Select
93
+ offers nothing. The same is true
94
+ of the layout around an example: a Button inside a Flex needs both imports.
95
+ Copy the import lines above an example together with its markup.
65
96
 
66
- ## Rules the build checks
97
+ ## Check the code you wrote
67
98
 
68
- Code that looks right can still fail these checks:
99
+ These checks run on your project, and each one prints JSON with `--json`:
69
100
 
70
- | Rule | Check |
101
+ | Command | What it finds |
71
102
  |---|---|
72
- | A dispatched event must be declared | `helix component --only events` |
73
- | A documented part must be rendered | `helix component`'s `parts` |
74
- | A documented CSS hook must be read | `helix component --only hooks` |
75
- | A visual property draws from its axis | `helix component`'s `axes` |
76
- | A form control styles with `:disabled` | `helix component --only disabled` |
77
- | A component that animates supports reduced motion | `helix component --only motion` |
78
- | No component reads a primitive token | `helix component`'s `tokens` |
103
+ | `helix scan` | Unknown tags, attributes, values, slots, parts, hooks, React event props, and tokens, a `--_helix-` primitive read, `[disabled]` on a form control, a selector on an attribute the element never writes back, and a tag whose entry nothing imports, each with its file and line |
104
+ | `helix theme audit` | Every foreground and background pair in your theme that misses its contrast target |
105
+ | `initDiagnostics()` from `@fusion.dev/helix-diagnostics` | The same findings on the running page, and what the library reports as it runs, such as an option nobody imported |
79
106
 
80
- If you generate Helix code, watch the first two rules. Breaking them produces
81
- output that looks like it works and is wrong.
107
+ `helix scan` and `helix theme audit` exit 1 when they find an error and 0 when
108
+ they find none. Run them after you write Helix code, and fix each finding
109
+ before you finish. `helix scan --file <path>` reports one file's findings, and
110
+ `helix scan --stdin tsx` reads a snippet from stdin. Both still read the whole
111
+ project, so an import in another file counts.
82
112
 
83
113
  ## The index
84
114
 
@@ -106,28 +136,57 @@ Each family page has a menu beside its title with:
106
136
  The links send the URL, because the URL stays current. A pasted copy starts to
107
137
  go stale as soon as you paste it.
108
138
 
109
- ## Compute a theme with `helix mcp`
139
+ ## The Helix MCP server
110
140
 
111
141
  ```sh
112
- helix mcp
142
+ helix mcp init --client claude
113
143
  ```
114
144
 
115
- The three sources above are fixed sets. Every tag, token, and example is
116
- published, and an agent can fetch it. None of them has the theme for *your*
117
- brand color. The input is a color, and there are infinitely many colors, so
118
- Helix has to compute the theme when an agent requests it.
145
+ `helix mcp` runs an MCP server over stdio. It answers from the Helix packages
146
+ your project installs, so every answer is for the version you build with, and
147
+ each one names that package and version. `helix mcp init` adds the server to
148
+ the file your client reads and keeps every other server in it:
119
149
 
120
- `helix mcp` runs an MCP server over stdio with two tools:
150
+ | Client | File |
151
+ |---|---|
152
+ | `claude` | `.mcp.json` |
153
+ | `cursor` | `.cursor/mcp.json` |
154
+ | `vscode` | `.vscode/mcp.json` |
121
155
 
122
- - `helix_audit_theme` measures every foreground against the background it is
123
- painted on. It reports each pair with its ratio and target.
124
- - `helix_derive_theme` returns the CSS.
156
+ The server runs `npx @fusion.dev/helix-cli mcp`, which is the copy in your
157
+ project. It has eight tools:
125
158
 
126
- Both take the same JSON that a `helix.theme.json` file holds.
159
+ | Tool | What it returns |
160
+ |---|---|
161
+ | `helix_find` | The families that answer a name, an alias, a tag, or a purpose, best first |
162
+ | `helix_family` | One family's tags, properties and their unions, events and their React props, slots, parts, custom properties, words, and import lines |
163
+ | `helix_example` | One example as HTML and TSX, with its stylesheet, the import lines it needs, and links to its pictures |
164
+ | `helix_imports` | The import lines for a list of tags, and the closest tag to any unknown one |
165
+ | `helix_tokens` | The semantic tokens, by a word in the name or description and by category |
166
+ | `helix_check` | The findings `helix scan` reports for the files you name, or for a snippet before you write it |
167
+ | `helix_audit_theme` | Every foreground and background pair a brand color derives to, with its ratio and target |
168
+ | `helix_derive_theme` | The theme's CSS |
169
+
170
+ Each result is structured, with an output schema, and the same JSON as text.
171
+ A name that matches more than one family, such as `Dropdown`, returns an error
172
+ listing each family. The theme tools take the same JSON that a
173
+ `helix.theme.json` file holds.
174
+
175
+ Each lookup is also a command, for a script or a person:
127
176
 
128
- **`helix mcp` does not return a palette that fails its own targets**, the same
129
- as `helix theme build`. A failing palette pasted into a stylesheet is worse than
130
- a warning above it, and an agent does not read warnings.
177
+ ```sh
178
+ helix api find dropdown
179
+ helix api family select
180
+ helix api example select
181
+ helix api imports helix-select helix-option
182
+ helix api tokens surface --category color
183
+ ```
184
+
185
+ `--json` prints what the MCP tool returns.
186
+
187
+ **`helix_derive_theme` does not return a palette that fails its own targets**,
188
+ the same as `helix theme build`. A failing palette pasted into a stylesheet is
189
+ worse than a warning above it, and an agent does not read warnings.
131
190
 
132
191
  You run `helix mcp` yourself, and we do not host it. A server we operated would
133
192
  be one more service between you and your own tokens. `helix mcp` is a
@@ -136,14 +195,9 @@ no network requests.
136
195
 
137
196
  ## What we do not publish for agents
138
197
 
139
- **`llms-full.txt`, or any other whole-library download.** A single file with
140
- every page goes out of date as soon as anything changes. Each link in `llms.txt`
141
- can be cached on its own and stays current on its own.
142
-
143
- The two sources already here cover what such a file would be for. `llms.txt` is
144
- the index, in one request, and each family's `.md` file is its document. Fetch
145
- the families you use.
198
+ **`llms-full.txt`, or any other whole-library download of the pages.** A single
199
+ file with every page goes out of date as soon as anything changes. Each link in
200
+ `llms.txt` can be cached on its own and stays current on its own.
146
201
 
147
- **A search index.** The site has a search index for people. There is nothing an
148
- agent can query yet. Reading `llms.txt` and the documents it names takes less
149
- work than learning most search APIs.
202
+ `llms.txt` is the index, in one request, and each family's `.md` file is its
203
+ document. Fetch the families you use, or ask `helix mcp`.