@grampro/kit 2.4.4 → 2.6.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 (74) hide show
  1. package/CHANGELOG.md +257 -0
  2. package/README.md +25 -5
  3. package/index.cjs +70 -4
  4. package/package.json +1 -1
  5. package/source/components/accordion/passport.json +11 -7
  6. package/source/components/accordion/react/Accordion.tsx +5 -0
  7. package/source/components/alert/passport.json +3 -3
  8. package/source/components/avatar/passport.json +8 -6
  9. package/source/components/avatar/react/Avatar.tsx +4 -0
  10. package/source/components/badge/passport.json +8 -6
  11. package/source/components/badge/react/Badge.tsx +1 -0
  12. package/source/components/badge/react/Tag.tsx +1 -0
  13. package/source/components/breadcrumb/passport.json +8 -6
  14. package/source/components/breadcrumb/react/Breadcrumb.tsx +1 -0
  15. package/source/components/button/passport.json +8 -6
  16. package/source/components/button/react/Button.tsx +1 -0
  17. package/source/components/card/passport.json +17 -9
  18. package/source/components/card/react/Card.tsx +5 -0
  19. package/source/components/card/react/Stat.tsx +5 -0
  20. package/source/components/checkbox/passport.json +32 -14
  21. package/source/components/checkbox/react/Checkbox.tsx +17 -0
  22. package/source/components/checkbox/react/CheckboxGroup.tsx +6 -0
  23. package/source/components/combobox/passport.json +36 -16
  24. package/source/components/combobox/react/Select.tsx +6 -1
  25. package/source/components/combobox/react/props.ts +23 -0
  26. package/source/components/data-grid/core/types.ts +53 -0
  27. package/source/components/data-grid/passport.json +82 -30
  28. package/source/components/data-grid/react/AskGrid.tsx +10 -0
  29. package/source/components/data-grid/react/DataGrid.tsx +16 -0
  30. package/source/components/date-picker/passport.json +30 -14
  31. package/source/components/date-picker/react/DatePicker.tsx +5 -0
  32. package/source/components/date-picker/react/props.ts +13 -1
  33. package/source/components/dialog/core/types.ts +14 -0
  34. package/source/components/dialog/passport.json +26 -12
  35. package/source/components/dialog/react/Dialog.tsx +4 -0
  36. package/source/components/file-uploader/passport.json +44 -18
  37. package/source/components/file-uploader/react/FileUploader.tsx +39 -0
  38. package/source/components/input/passport.json +14 -8
  39. package/source/components/input/react/Input.tsx +3 -0
  40. package/source/components/menu/passport.json +29 -13
  41. package/source/components/menu/react/Menu.tsx +7 -0
  42. package/source/components/menu/react/items.tsx +4 -0
  43. package/source/components/modal/passport.json +14 -8
  44. package/source/components/modal/react/Modal.tsx +6 -0
  45. package/source/components/number-input/passport.json +23 -11
  46. package/source/components/number-input/react/NumberInput.tsx +13 -0
  47. package/source/components/popover/passport.json +17 -9
  48. package/source/components/popover/react/Popover.tsx +7 -0
  49. package/source/components/progress/passport.json +3 -3
  50. package/source/components/radio-group/passport.json +32 -14
  51. package/source/components/radio-group/react/Radio.tsx +17 -0
  52. package/source/components/radio-group/react/RadioGroup.tsx +13 -0
  53. package/source/components/skeleton/passport.json +8 -6
  54. package/source/components/skeleton/react/Skeleton.tsx +5 -0
  55. package/source/components/spinner/passport.json +3 -3
  56. package/source/components/switch/passport.json +23 -11
  57. package/source/components/switch/react/Switch.tsx +14 -0
  58. package/source/components/tabs/passport.json +11 -7
  59. package/source/components/tabs/react/Tabs.tsx +2 -0
  60. package/source/components/textarea/passport.json +14 -8
  61. package/source/components/textarea/react/Textarea.tsx +3 -0
  62. package/source/components/toaster/passport.json +8 -6
  63. package/source/components/toaster/react/Toaster.tsx +4 -0
  64. package/source/components/tooltip/passport.json +3 -3
  65. package/tools/mcp/README.md +163 -36
  66. package/tools/mcp/design.cjs +154 -0
  67. package/tools/mcp/figma.cjs +136 -29
  68. package/tools/mcp/install.cjs +270 -0
  69. package/tools/mcp/secret-cli.cjs +174 -0
  70. package/tools/mcp/secret.cjs +289 -0
  71. package/tools/mcp/server.cjs +60 -16
  72. package/tools/passport/cli.cjs +8 -1
  73. package/tools/passport/extract.cjs +7 -3
  74. package/tools/passport/merge.cjs +24 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,262 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.6.0
4
+
5
+ ### Added
6
+
7
+ **A whole Figma design, exported once and built screen by screen.**
8
+
9
+ In Figma, **Grampro Kit → Export all screens for an agent** walks every page
10
+ and takes each top-level frame. Then:
11
+
12
+ ```bash
13
+ npx @grampro/kit design ./design.json
14
+ ```
15
+
16
+ ```text
17
+ Wrote 3 screen(s) to design/
18
+ purchase-orders.json Purchase orders (Product) — 22 nodes
19
+ suppliers.json Suppliers (Product) — 16 nodes
20
+ settings.json Settings (Admin) — 12 nodes
21
+ index.json the plan: every screen, shared theme
22
+ ```
23
+
24
+ The accuracy is in the theme rather than the convenience. Derived one
25
+ frame at a time it disagrees with itself — a screen that is mostly white
26
+ names a different background from one that is mostly grey — and the agent
27
+ then themes each page differently. Read across every screen, once, it is
28
+ well founded.
29
+
30
+ `index.json` is the plan: every screen with its size, node count and the
31
+ regions whose names repeat, plus that shared theme. It is the cheap place
32
+ to be wrong. A design drawn without the component library names nothing
33
+ directly, so every component is inferred, and a guess that `Action` is a
34
+ Card rather than a Button costs one sentence there and five screens of
35
+ rework later.
36
+
37
+ **`figma_frame` reads a file.** Pass `designFile` with a path instead of
38
+ `design` with the JSON. A chat input caps at around fifty thousand
39
+ characters and a whole screen passes that; and a pasted export sits in the
40
+ conversation twice, once as the argument and again inside the tool call,
41
+ where a file appears only in the answer.
42
+
43
+ **Every prop the library declares now carries a description.** 117 did
44
+ not, and the passports are what an agent reads instead of the source, so
45
+ an undescribed prop is one it guesses at. `DataGrid`'s `columns` and
46
+ `data` had none at all. See 2.5.0's notes — this is that work, reaching
47
+ npm for the first time.
48
+
49
+ ### Changed
50
+
51
+ **The Figma export costs a third of what it did.** The copy button takes
52
+ minified JSON: `JSON.parse` cannot tell the difference, and indentation
53
+ was most of the payload. Three fields that said nothing went with it —
54
+ `radius: 0` on every square frame, `padding: [0,0,0,0]` on every frame
55
+ without padding, and `align`/`justify` restating Figma's own defaults —
56
+ along with the child frame Figma wraps around every icon, whose entire
57
+ content was the word "Vector" when the frame's name (`search`, `plus`)
58
+ was the whole signal.
59
+
60
+ **It also says more about what it exports.** Node size and stroke colour
61
+ are now included, because most designs are not built from the kit's Figma
62
+ library and an agent has to infer every component from what it can see. A
63
+ 36px pill with a label is a button; the same shape at 200px is a card. A
64
+ white box with a border is a secondary button; without one it is a
65
+ surface. Neither was visible before.
66
+
67
+ ### Fixed
68
+
69
+ **The design system generator laid out over itself.** Variant grids were
70
+ placed by column count without measuring whether the row fitted, so 14 of
71
+ 38 component sets overflowed the card holding them — Alert reached 2444px
72
+ inside a 1320px section.
73
+
74
+ **Text that was told a width kept its own.** Figma creates a text node
75
+ auto-width, and setting it to fill is quietly ignored, so 23 layers across
76
+ the file measured themselves from their own characters. NumberInput's
77
+ value layer, created empty and filled in later by a component property,
78
+ wrapped one glyph per line.
79
+
80
+ **Alert's coloured edge did not match its card**, being sized before the
81
+ card had any content and never clipped to its rounded corners. Toast drew
82
+ the same edge with the same fault.
83
+
84
+ **The uploader thumbnails and the dialog's intent badge rendered at full
85
+ saturation**, which also hid the icon drawn on them in the same colour.
86
+
87
+ **The plugin's name displayed as mojibake** in Figma's menu, and its
88
+ build was never committed despite its README saying so, so a clone could
89
+ not run it.
90
+
91
+ ## 2.5.0
92
+
93
+ ### Added
94
+
95
+ **Every prop this library declares now carries a description.**
96
+
97
+ 117 did not, and the passports are what an agent reads instead of the
98
+ source, so an undescribed prop is one it has to guess at. The worst of them
99
+ were not obscure: `DataGrid`'s `columns` and `data` had no description at
100
+ all, and `label`, `error`, `description` and `onChange` were bare on
101
+ Checkbox, Switch and RadioGroup.
102
+
103
+ Where reading the code turned up something a type cannot say, that is in
104
+ the description now:
105
+
106
+ - `onCellEdit` fires only when the value actually changed, and returning a
107
+ promise makes the edit optimistic - the cell reverts and shows the
108
+ rejection's message if it fails, so reject with the reason you want read.
109
+ - `CheckboxGroup`'s values accumulate in the order they were checked, not
110
+ the order the options are declared, so sort before comparing selections.
111
+ - `Checkbox.onCheckedChange` never fires with `"indeterminate"`.
112
+ - `FileUploader` treats name, size and last-modified time as a file's
113
+ identity when rejecting duplicates.
114
+ - `NumberInput`'s `min` and `max` apply on blur rather than per keystroke,
115
+ unless `clampBehavior` says otherwise.
116
+ - `DatePicker.onChange` always hands back a `Date` at local midnight, even
117
+ though `value` accepts a string or a number.
118
+ **The Figma token belongs to your operating system now, not to a file in
119
+ your repository.**
120
+
121
+ ```bash
122
+ npx @grampro/kit secret set figma
123
+ ```
124
+
125
+ It prompts with the echo off and stores the token where the platform keeps
126
+ credentials: the Data Protection API on Windows, the keychain on macOS, the
127
+ Secret Service on Linux. Anywhere else it falls back to a 0600 file in your
128
+ config directory and says so rather than implying otherwise. The value is
129
+ never passed as an argument, because arguments land in shell history and in
130
+ every process listing on the machine; pipe it instead if you need to script
131
+ it.
132
+
133
+ `secret list` shows what is stored, masked, and names the backend. `secret
134
+ remove figma` deletes it.
135
+
136
+ The old `.env` route still works, so upgrading breaks nothing, but reading
137
+ from one now prints a note telling you to move it. A credential sitting in a
138
+ working tree is one `git add -A` away from being published, which is the
139
+ whole reason for the change.
140
+
141
+ **`mcp install` writes the configuration for you.**
142
+
143
+ ```bash
144
+ npx @grampro/kit mcp install # every agent it knows
145
+ npx @grampro/kit mcp install --for codex
146
+ ```
147
+
148
+ Claude Code, Codex and Cursor each take the same stdio server and differ
149
+ only in where the configuration lives and what format it is in. This writes
150
+ `.mcp.json`, `.codex/config.toml` and `.cursor/mcp.json` respectively,
151
+ merging into whatever is already there and leaving other servers alone.
152
+
153
+ It is worth preferring over editing those files by hand, which is how this
154
+ goes wrong: PowerShell's `Out-File -Encoding utf8` adds a byte-order mark,
155
+ and every JSON parser then rejects the file with an error naming the first
156
+ character and explaining nothing. This writes UTF-8 without a BOM and with
157
+ LF endings, and strips a BOM from a file that already has one.
158
+
159
+ It writes to the project root — the nearest folder above you with a `.git`
160
+ or a `package.json` — and prints which one it chose. An agent reads these
161
+ files from the folder it has open, so running the command from a
162
+ subdirectory would have written somewhere nothing ever looks while still
163
+ reporting success.
164
+
165
+ It also now says what has to happen next, because writing the file is not
166
+ the same as loading the server. A `.mcp.json` server is project-scoped and
167
+ Claude Code asks before trusting one, so it sits at `Pending approval` until
168
+ you agree; and the configuration is read when a session starts, so an editor
169
+ window that was already open sees nothing until it reloads. Installing at
170
+ user scope — `claude mcp add -s user grampro -- npx -y @grampro/kit mcp` —
171
+ skips both, at the cost of not being shareable through a commit.
172
+
173
+ ### Changed
174
+
175
+ **Reading a Figma design no longer downloads the whole file.**
176
+
177
+ Figma charges for file reads by the size of the response, and the frame
178
+ listing was fetching the entire document — 710 KB on the file this was
179
+ tested against — to answer a question about one screen. Two of those in a
180
+ row is what earns a 429, and the lockout is long: a `Retry-After` of 395274
181
+ was observed on a single token.
182
+
183
+ The listing now uses `depth=1`, which returns the document's outline rather
184
+ than its contents, and the chosen frame is fetched by id. A URL that already
185
+ carries a `node-id` — what Figma copies when you right-click a frame — goes
186
+ straight there in one call. Responses are still held for five minutes, so
187
+ the usual list-then-read flow costs one outline and one frame.
188
+
189
+ If a token is already rate limited, the Figma plugin export route still
190
+ works; it reads the scene graph from inside Figma and never calls the API.
191
+
192
+ **The MCP server starts in about the time an empty Node process takes.**
193
+
194
+ An agent spawns the server once per session, and it was loading the CLI's
195
+ own dependencies first — `fs-extra` and `yargs`, roughly 70ms, and of no use
196
+ to a JSON-RPC loop. The `mcp` command is now routed before they load.
197
+
198
+ The passports are also indexed on the first question rather than re-read
199
+ from disk for each one.
200
+
201
+ ### Fixed
202
+
203
+ **`Select`'s `closeOnSelect` was documented backwards, in both directions.**
204
+ Its description read "Keep the list open after choosing. Default false."
205
+ while the code defaults it to `true` and closing is what the prop does. An
206
+ agent reading that passport would have had both the behaviour and the
207
+ default inverted - the failure mode that makes a wrong description worse
208
+ than a missing one. MultiSelect's was already right.
209
+
210
+ **Description coverage was measured against a denominator nobody could
211
+ move.** It counted every prop, including the HTML and ARIA attributes that
212
+ arrive through `extends ButtonHTMLAttributes` - 390 of the 507 undescribed
213
+ props were those. So Button sat at 31% with its entire own API documented
214
+ bar one prop, and eleven components stayed under the 40% threshold with
215
+ nothing left to write. A gate that cannot be satisfied by doing the work it
216
+ asks for gets ignored.
217
+
218
+ It now measures the props the library authors, excluding inherited
219
+ attributes and the handful whose meaning is library-wide (`className`,
220
+ `style`, `ref` and friends) rather than restating them 27 times. On that
221
+ measure the library is at 87% and the weakest component at 75%, so the
222
+ threshold moves from 40 to 75 - a floor rather than an aspiration.
223
+ **The rate-limit message no longer promises that waiting a minute will
224
+ help.** It said to try again shortly, which is wrong for a cost-based limit
225
+ whose window runs to tens of minutes or longer. It now passes Figma's own
226
+ `Retry-After` through as given, without asserting a unit — the value has
227
+ been seen in a range where seconds and milliseconds differ by three orders
228
+ of magnitude — and points at the plugin route, which cannot be rate limited.
229
+
230
+ ## 2.4.4
231
+
232
+ ### Added
233
+
234
+ **An MCP server, so an agent can ask about a component instead of recalling
235
+ it.**
236
+
237
+ ```bash
238
+ npx @grampro/kit mcp
239
+ ```
240
+
241
+ Seven tools: `list_components`, `get_component`, `get_example`,
242
+ `get_guidance`, `figma_frame`, `install_component` and `validate_usage`. The
243
+ catalogue is 280 KB of passports and a page needs two or three components,
244
+ which is the argument for answering on demand rather than pasting a document
245
+ into the prompt.
246
+
247
+ `validate_usage` is the one that earns its place. A page written from
248
+ passports alone compiled on the first attempt apart from a single prop the
249
+ model had remembered from elsewhere — every type, union value and handler
250
+ signature the passports carried came out right. So the remaining failure
251
+ mode is invention, and that is what this checks.
252
+
253
+ No dependencies: MCP is newline-delimited JSON-RPC over stdio, and a server
254
+ shipped inside a library every consumer installs should not drag an SDK
255
+ along with it.
256
+
257
+ Marked beta — the tools work and are tested, but their names and shapes may
258
+ change.
259
+
3
260
  ## 2.4.3
4
261
 
5
262
  ### Fixed
package/README.md CHANGED
@@ -6,6 +6,10 @@ React components you own — styled, dependency-free, and machine-readable. Each
6
6
  component arrives in your project as source, with its stylesheet, and with a
7
7
  contract describing what it is and what can safely be done to it.
8
8
 
9
+ It ships an **MCP server**, so Claude Code, Codex and Cursor can read that
10
+ contract instead of guessing at it — and build a screen straight from a
11
+ Figma design.
12
+
9
13
  ```bash
10
14
  npx @grampro/kit add DataGrid
11
15
  ```
@@ -92,15 +96,31 @@ In this repository:
92
96
 
93
97
  ## MCP server (beta)
94
98
 
95
- For agents that speak MCP, the catalogue is also served on demand:
99
+ The catalogue, served to a coding agent on demand over the Model Context
100
+ Protocol:
96
101
 
97
102
  ```bash
98
- claude mcp add grampro -- npx -y @grampro/kit mcp
103
+ npx @grampro/kit mcp install
99
104
  ```
100
105
 
101
- It reads a Figma design, installs what it needs, answers what exists, each component's full contract, working examples, and
102
- whether the JSX an agent just wrote actually matches the component it used.
103
- No dependencies, no configuration. See `tools/mcp/README.md`.
106
+ That configures **Claude Code** (`.mcp.json`), **Codex**
107
+ (`.codex/config.toml`) and **Cursor** (`.cursor/mcp.json`) in one command,
108
+ merging into whatever is already there.
109
+
110
+ Its seven tools answer what components exist (`list_components`), what a
111
+ component's props actually are (`get_component`), how it is used
112
+ (`get_example`, `get_guidance`), what a Figma frame contains
113
+ (`figma_frame`), and — the one that earns its place — whether the JSX an
114
+ agent just wrote matches the real API (`validate_usage`).
115
+
116
+ `install_component` copies what the design needs into your project, so an
117
+ agent can go from a Figma link to a working screen without you installing
118
+ anything first.
119
+
120
+ No dependencies, and it starts in about the time an empty Node process
121
+ takes. Full walkthrough, including a prompt to paste:
122
+ [kit.gramproindia.com/mcp-server](https://kit.gramproindia.com/mcp-server).
123
+ Details in [`tools/mcp/README.md`](tools/mcp/README.md).
104
124
 
105
125
  ## Agent skill
106
126
 
package/index.cjs CHANGED
@@ -1,5 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ /*
4
+ * The MCP server starts before the CLI does, and deliberately.
5
+ *
6
+ * An agent spawns the server once per session, and this file's own
7
+ * dependencies — fs-extra and yargs — cost about 70ms to load and are of no
8
+ * use to a JSON-RPC loop. Routing here first takes the server's start-up down
9
+ * to roughly what an empty Node process costs. A top-level `return` is valid
10
+ * in CommonJS, where a module body is already wrapped in a function.
11
+ *
12
+ * Only bare `mcp` is the server. Anything with a word after it — `install`,
13
+ * or a misspelling of it — is the CLI's business and falls through, so that a
14
+ * typo gets an answer instead of silently becoming a server waiting on stdin.
15
+ */
16
+ if (process.argv[2] === "mcp" && !process.argv.slice(3).some((arg) => !arg.startsWith("-"))) {
17
+ // From here stdout carries JSON-RPC; nothing else may write to it.
18
+ require("./tools/mcp/server.cjs").main();
19
+ return;
20
+ }
21
+
3
22
  const fs = require("fs-extra");
4
23
  const path = require("path");
5
24
  const crypto = require("crypto");
@@ -1171,7 +1190,7 @@ const validateComponents = (components, beta = false) => {
1171
1190
  * projects a week install this; breaking their scripts to tidy an argument
1172
1191
  * parser is not a trade worth making.
1173
1192
  */
1174
- const COMMANDS = new Set(["add", "list", "skill", "passport", "mcp"]);
1193
+ const COMMANDS = new Set(["add", "list", "skill", "passport", "mcp", "secret", "design"]);
1175
1194
 
1176
1195
  /**
1177
1196
  * Flags that take a separate value, so the token after one is that value and
@@ -1244,7 +1263,7 @@ const main = async () => {
1244
1263
  })
1245
1264
  .option("for", {
1246
1265
  describe:
1247
- "With skill: which agents to write adapters for (claude, codex, antigravity, or none)",
1266
+ "With skill or mcp install: which agents (claude, codex, antigravity, cursor, all)",
1248
1267
  type: "string",
1249
1268
  })
1250
1269
  .option("passport", {
@@ -1275,6 +1294,10 @@ const main = async () => {
1275
1294
  .example("$0 add Select --legacy", "Install from the 1.x set")
1276
1295
  .example("$0 add Button --dest app/ui", "Choose where they go")
1277
1296
  .example("$0 mcp", "Serve the catalogue to a coding agent over MCP")
1297
+ .example("$0 mcp install", "Register the MCP server with every agent found")
1298
+ .example("$0 mcp install --for codex", "Only write the Codex config")
1299
+ .example("$0 secret set figma", "Store a Figma token in the OS credential store")
1300
+ .example("$0 design ./design.json", "Split a whole-file Figma export into design/")
1278
1301
  .example("$0 -i", "Interactive selection")
1279
1302
  .help().argv;
1280
1303
 
@@ -1293,8 +1316,51 @@ const main = async () => {
1293
1316
  }
1294
1317
 
1295
1318
  if (parsed && parsed.command === "mcp") {
1296
- // Speaks JSON-RPC on stdout; nothing else may write there.
1297
- require("./tools/mcp/server.cjs").main();
1319
+ // Bare `mcp` never reaches this far: it is handled at the top of the file,
1320
+ // before the CLI's dependencies load. What arrives here is `mcp install`,
1321
+ // and anything else is a typo worth naming.
1322
+ if (parsed.operands[0] === "install") {
1323
+ require("./tools/mcp/install.cjs").main(parsed.operands.slice(1), { for: argv.for });
1324
+ return;
1325
+ }
1326
+ console.log(
1327
+ `Did you mean \`${CLI_NAME} mcp\` (run the server) or \`${CLI_NAME} mcp install\` (configure an agent)?`,
1328
+ );
1329
+ return;
1330
+ }
1331
+
1332
+ if (parsed && parsed.command === "secret") {
1333
+ await require("./tools/mcp/secret-cli.cjs").main(parsed.operands);
1334
+ return;
1335
+ }
1336
+
1337
+ if (parsed && parsed.command === "design") {
1338
+ const [file, dest] = parsed.operands;
1339
+ if (!file) {
1340
+ console.log(`Which export? Try: ${CLI_NAME} design ./design.json`);
1341
+ console.log("");
1342
+ console.log("Save one from Figma first: Grampro Kit -> Export all screens for an agent.");
1343
+ return;
1344
+ }
1345
+ const { splitDesign } = require("./tools/mcp/design.cjs");
1346
+ const result = splitDesign(file, dest || "design");
1347
+ if (result.error) {
1348
+ console.log(result.error);
1349
+ process.exitCode = 1;
1350
+ return;
1351
+ }
1352
+ const rel = path.relative(process.cwd(), result.dest) || result.dest;
1353
+ console.log(`Wrote ${result.written.length} screen(s) to ${rel}/`);
1354
+ for (const screen of result.written) {
1355
+ const where = screen.page ? ` (${screen.page})` : "";
1356
+ console.log(` ${screen.file.padEnd(28)} ${screen.name}${where} — ${screen.nodes} nodes`);
1357
+ }
1358
+ console.log(` index.json${" ".repeat(18)} the plan: every screen, shared theme`);
1359
+ console.log("");
1360
+ console.log(
1361
+ `Point an agent at it: "read ${rel}/index.json and build these screens`
1362
+ + ` with the grampro MCP server".`,
1363
+ );
1298
1364
  return;
1299
1365
  }
1300
1366
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grampro/kit",
3
- "version": "2.4.4",
3
+ "version": "2.6.0",
4
4
  "description": "GramproKit \u2014 an agent-native UI runtime for React. Copy-in components you own, each publishing a contract that software can read.",
5
5
  "type": "module",
6
6
  "files": [
@@ -10,7 +10,7 @@
10
10
  ]
11
11
  },
12
12
  "source": {
13
- "libraryVersion": "2.4.4",
13
+ "libraryVersion": "2.6.0",
14
14
  "files": [
15
15
  "core/index.ts",
16
16
  "core/open.ts",
@@ -21,7 +21,7 @@
21
21
  "react/context.ts",
22
22
  "react/props.ts"
23
23
  ],
24
- "sourceHash": "sha256:719b5c18a3e0f3f7479cd1c4f59d729b335053fc47708cc5ab5763b6d69a206a"
24
+ "sourceHash": "sha256:c04b9c09e8661f463e2a808ecd45a7c080c236bc7b398efc1b3505a45e245f00"
25
25
  },
26
26
  "props": [
27
27
  {
@@ -60,7 +60,9 @@
60
60
  "type": "other",
61
61
  "typeText": "string[] | undefined",
62
62
  "required": false,
63
- "origin": "derived"
63
+ "origin": "derived",
64
+ "description": "Panels open to begin with, when you are not controlling `value`.",
65
+ "descriptionOrigin": "jsdoc"
64
66
  },
65
67
  {
66
68
  "name": "description",
@@ -135,7 +137,9 @@
135
137
  "type": "function",
136
138
  "signature": "((value: string[]) => void) | undefined",
137
139
  "required": false,
138
- "origin": "derived"
140
+ "origin": "derived",
141
+ "description": "The open panels after a change, always an array even with `multiple`\r\noff - where it holds one value, or none once a panel is closed.",
142
+ "descriptionOrigin": "jsdoc"
139
143
  },
140
144
  {
141
145
  "name": "ref",
@@ -249,9 +253,9 @@
249
253
  "safeMutations": {},
250
254
  "examples": [],
251
255
  "coverage": {
252
- "propsTotal": 19,
253
- "propsDescribed": 10,
254
- "describedPct": 53,
256
+ "propsTotal": 15,
257
+ "propsDescribed": 12,
258
+ "describedPct": 80,
255
259
  "authoredSections": [
256
260
  "accessibility"
257
261
  ]
@@ -22,7 +22,12 @@ import { cx, type AccordionSlot } from "./props";
22
22
  export interface AccordionProps {
23
23
  /** Open panels, by value (controlled). */
24
24
  value?: string[];
25
+ /** Panels open to begin with, when you are not controlling `value`. */
25
26
  defaultValue?: string[];
27
+ /**
28
+ * The open panels after a change, always an array even with `multiple`
29
+ * off - where it holds one value, or none once a panel is closed.
30
+ */
26
31
  onValueChange?(value: string[]): void;
27
32
  /** Render these panels, or pass `<AccordionItem>` children. */
28
33
  items?: readonly AccordionItemData[];
@@ -8,7 +8,7 @@
8
8
  ]
9
9
  },
10
10
  "source": {
11
- "libraryVersion": "2.4.4",
11
+ "libraryVersion": "2.6.0",
12
12
  "files": [
13
13
  "core/index.ts",
14
14
  "core/live.ts",
@@ -240,9 +240,9 @@
240
240
  "safeMutations": {},
241
241
  "examples": [],
242
242
  "coverage": {
243
- "propsTotal": 19,
243
+ "propsTotal": 8,
244
244
  "propsDescribed": 6,
245
- "describedPct": 32,
245
+ "describedPct": 75,
246
246
  "authoredSections": [
247
247
  "accessibility"
248
248
  ]
@@ -9,7 +9,7 @@
9
9
  ]
10
10
  },
11
11
  "source": {
12
- "libraryVersion": "2.4.4",
12
+ "libraryVersion": "2.6.0",
13
13
  "files": [
14
14
  "core/identity.ts",
15
15
  "core/index.ts",
@@ -20,7 +20,7 @@
20
20
  "react/locale.ts",
21
21
  "react/props.ts"
22
22
  ],
23
- "sourceHash": "sha256:2e50d4901b3c6a436a1c8ee35fb43eb11488e305b0466874f007ee325aa02896"
23
+ "sourceHash": "sha256:541aa6ca5c99e64fba414881c07cc3c29244e03c09b665a4934690d633cc20e1"
24
24
  },
25
25
  "props": [
26
26
  {
@@ -186,7 +186,9 @@
186
186
  "type": "string",
187
187
  "typeText": "string | undefined",
188
188
  "required": false,
189
- "origin": "derived"
189
+ "origin": "derived",
190
+ "description": "The image. If it fails to load, the avatar falls back to the initials\nrather than showing a broken image, so `name` is worth setting too.",
191
+ "descriptionOrigin": "jsdoc"
190
192
  },
191
193
  {
192
194
  "name": "status",
@@ -284,9 +286,9 @@
284
286
  "safeMutations": {},
285
287
  "examples": [],
286
288
  "coverage": {
287
- "propsTotal": 23,
288
- "propsDescribed": 9,
289
- "describedPct": 39,
289
+ "propsTotal": 10,
290
+ "propsDescribed": 10,
291
+ "describedPct": 100,
290
292
  "authoredSections": [
291
293
  "accessibility"
292
294
  ]
@@ -22,6 +22,10 @@ export interface AvatarProps extends Omit<HTMLAttributes<HTMLSpanElement>, "chil
22
22
  * for the colour, so the same person is always the same colour.
23
23
  */
24
24
  name?: string;
25
+ /**
26
+ * The image. If it fails to load, the avatar falls back to the initials
27
+ * rather than showing a broken image, so `name` is worth setting too.
28
+ */
25
29
  src?: string;
26
30
  /** Overrides the text derived from `name`. */
27
31
  initials?: string;
@@ -9,7 +9,7 @@
9
9
  ]
10
10
  },
11
11
  "source": {
12
- "libraryVersion": "2.4.4",
12
+ "libraryVersion": "2.6.0",
13
13
  "files": [
14
14
  "core/count.ts",
15
15
  "core/index.ts",
@@ -20,7 +20,7 @@
20
20
  "react/locale.ts",
21
21
  "react/props.ts"
22
22
  ],
23
- "sourceHash": "sha256:f6db45647bfab522ced894c388fb16f6a7fac5ebd20a7114d351b812a1f73d34"
23
+ "sourceHash": "sha256:16f626a94da3bac9b1a105718010edd7e1ce5a6118823ed8a53c97d658d89a3e"
24
24
  },
25
25
  "props": [
26
26
  {
@@ -128,7 +128,9 @@
128
128
  "type": "other",
129
129
  "typeText": "ReactNode",
130
130
  "required": false,
131
- "origin": "derived"
131
+ "origin": "derived",
132
+ "description": "An icon before the label, in place of `dot`.",
133
+ "descriptionOrigin": "jsdoc"
132
134
  },
133
135
  {
134
136
  "name": "id",
@@ -322,9 +324,9 @@
322
324
  "safeMutations": {},
323
325
  "examples": [],
324
326
  "coverage": {
325
- "propsTotal": 26,
326
- "propsDescribed": 10,
327
- "describedPct": 38,
327
+ "propsTotal": 13,
328
+ "propsDescribed": 11,
329
+ "describedPct": 85,
328
330
  "authoredSections": [
329
331
  "accessibility"
330
332
  ]
@@ -23,6 +23,7 @@ export interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "child
23
23
  formatValue?(value: number): string;
24
24
  /** A small filled circle before the label, for a status. */
25
25
  dot?: boolean;
26
+ /** An icon before the label, in place of `dot`. */
26
27
  icon?: ReactNode;
27
28
  classNames?: Partial<Record<BadgeSlot, string>>;
28
29
  ref?: Ref<HTMLSpanElement>;
@@ -11,6 +11,7 @@ export interface TagProps extends Omit<HTMLAttributes<HTMLSpanElement>, "onRemov
11
11
  variant?: BadgeVariant;
12
12
  appearance?: BadgeAppearance;
13
13
  size?: BadgeSize;
14
+ /** An icon before the label. */
14
15
  icon?: ReactNode;
15
16
  /** Show a remove button. Without it a Tag is a Badge with a bit more padding. */
16
17
  onRemove?(): void;
@@ -8,7 +8,7 @@
8
8
  ]
9
9
  },
10
10
  "source": {
11
- "libraryVersion": "2.4.4",
11
+ "libraryVersion": "2.6.0",
12
12
  "files": [
13
13
  "core/index.ts",
14
14
  "core/trail.ts",
@@ -18,7 +18,7 @@
18
18
  "react/locale.ts",
19
19
  "react/props.ts"
20
20
  ],
21
- "sourceHash": "sha256:ea18a9023e99fd751d8295a40f257e4471948a5cc9878d808501471718da32aa"
21
+ "sourceHash": "sha256:3b7fef8f48d1a1290c25a263d2e92ef5dcb706b1a06899ffe5a4df1cdab663e1"
22
22
  },
23
23
  "props": [
24
24
  {
@@ -151,7 +151,9 @@
151
151
  "typeText": "'sm' | 'md' | 'lg' | undefined",
152
152
  "required": false,
153
153
  "default": "md",
154
- "origin": "derived"
154
+ "origin": "derived",
155
+ "description": "Default `md`.",
156
+ "descriptionOrigin": "jsdoc"
155
157
  },
156
158
  {
157
159
  "name": "structuredData",
@@ -233,9 +235,9 @@
233
235
  "safeMutations": {},
234
236
  "examples": [],
235
237
  "coverage": {
236
- "propsTotal": 20,
237
- "propsDescribed": 7,
238
- "describedPct": 35,
238
+ "propsTotal": 8,
239
+ "propsDescribed": 8,
240
+ "describedPct": 100,
239
241
  "authoredSections": [
240
242
  "accessibility"
241
243
  ]