@motion-proto/live-tokens 0.78.0 → 0.80.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 (172) hide show
  1. package/.claude/skills/live-tokens-check-compliance/SKILL.md +49 -38
  2. package/.claude/skills/live-tokens-create-component/SKILL.md +23 -28
  3. package/.claude/skills/live-tokens-create-component/references/contract-tests.md +61 -0
  4. package/.claude/skills/live-tokens-create-component/references/sketch-mode.md +2 -2
  5. package/.claude/skills/live-tokens-create-component/references/token-naming.md +6 -15
  6. package/.claude/skills/live-tokens-create-page/SKILL.md +6 -4
  7. package/.claude/skills/live-tokens-create-theme/references/design-directions.md +1 -1
  8. package/.claude/skills/live-tokens-pick-component/SKILL.md +3 -3
  9. package/.claude/skills/live-tokens-set-colors/references/color-anchors.md +1 -1
  10. package/.claude/skills/live-tokens-set-geometry/SKILL.md +1 -1
  11. package/.claude/skills/live-tokens-set-geometry/references/geometry-anchors.md +1 -1
  12. package/CHANGELOG.md +271 -0
  13. package/README.md +10 -16
  14. package/bin/check-component.mjs +154 -551
  15. package/bin/check-page.mjs +57 -541
  16. package/bin/cli.mjs +93 -16
  17. package/bin/contractRunner.mjs +37 -91
  18. package/bin/lib/buildChecks.mjs +32 -0
  19. package/bin/lib/catalogue.mjs +161 -34
  20. package/bin/lib/componentSource.mjs +152 -0
  21. package/bin/lib/cssValues.mjs +9 -0
  22. package/bin/lib/dataDir.mjs +126 -0
  23. package/bin/lib/findings.mjs +103 -12
  24. package/bin/lib/fixers.mjs +64 -0
  25. package/bin/lib/geometry.mjs +92 -0
  26. package/bin/lib/pageSource.mjs +230 -0
  27. package/bin/lib/report.mjs +57 -59
  28. package/bin/lib/tokenVocabulary.mjs +104 -34
  29. package/bin/migrate-build-script.mjs +66 -0
  30. package/bin/migrate.mjs +5 -0
  31. package/bin/rules/componentStructure.mjs +344 -0
  32. package/bin/rules/componentUse.mjs +313 -0
  33. package/bin/rules/importsAndRoutes.mjs +136 -0
  34. package/bin/rules/testRuns.mjs +122 -0
  35. package/bin/rules/tokens.mjs +426 -0
  36. package/bin/setup-claude.mjs +1 -2
  37. package/dist-plugin/{chunk-PDNL4NC5.js → chunk-D4WRIKEZ.js} +7 -2
  38. package/dist-plugin/{chunk-SWXRVZKT.js → chunk-REBHE3ZM.js} +414 -1
  39. package/dist-plugin/index.cjs +470 -19
  40. package/dist-plugin/index.d.cts +1 -0
  41. package/dist-plugin/index.d.ts +1 -0
  42. package/dist-plugin/index.js +87 -55
  43. package/dist-plugin/migrateData/index.cjs +422 -4
  44. package/dist-plugin/migrateData/index.js +2 -2
  45. package/dist-plugin/setColors/index.cjs +414 -1
  46. package/dist-plugin/setColors/index.d.cts +1 -1
  47. package/dist-plugin/setColors/index.d.ts +1 -1
  48. package/dist-plugin/setColors/index.js +1 -1
  49. package/dist-plugin/setGeometry/index.cjs +423 -13
  50. package/dist-plugin/setGeometry/index.d.cts +3 -3
  51. package/dist-plugin/setGeometry/index.d.ts +3 -3
  52. package/dist-plugin/setGeometry/index.js +10 -13
  53. package/dist-plugin/setType/index.d.cts +1 -1
  54. package/dist-plugin/setType/index.d.ts +1 -1
  55. package/dist-plugin/{themeTypes-BxRtuN5V.d.cts → themeTypes-B8_Idrp4.d.cts} +2 -2
  56. package/dist-plugin/{themeTypes-BxRtuN5V.d.ts → themeTypes-B8_Idrp4.d.ts} +2 -2
  57. package/package.json +2 -2
  58. package/src/editor/component-editor/CalloutEditor.svelte +2 -2
  59. package/src/editor/component-editor/CollapsibleSectionEditor.svelte +14 -15
  60. package/src/editor/component-editor/CornerBadgeEditor.svelte +14 -14
  61. package/src/editor/component-editor/DialogEditor.svelte +5 -5
  62. package/src/editor/component-editor/InlineEditActionsEditor.svelte +2 -2
  63. package/src/editor/component-editor/RadioButtonEditor.svelte +21 -21
  64. package/src/editor/component-editor/SectionDividerEditor.svelte +7 -7
  65. package/src/editor/component-editor/SegmentedControlEditor.svelte +5 -5
  66. package/src/editor/component-editor/SideNavigationEditor.svelte +25 -25
  67. package/src/editor/component-editor/TabBarEditor.svelte +6 -6
  68. package/src/editor/component-editor/TableEditor.svelte +6 -6
  69. package/src/editor/component-editor/ToggleEditor.svelte +2 -2
  70. package/src/editor/component-editor/index.ts +3 -0
  71. package/src/editor/component-editor/registry.ts +57 -1
  72. package/src/editor/component-editor/scaffolding/TokenLayout.svelte +14 -14
  73. package/src/editor/component-editor/scaffolding/VariantGroup.svelte +3 -0
  74. package/src/editor/component-editor/scaffolding/types.ts +15 -0
  75. package/src/editor/core/components/adjustAliases.ts +4 -4
  76. package/src/editor/core/components/aliasKinds.ts +20 -19
  77. package/src/editor/core/sketch/sketchLayer.ts +3 -3
  78. package/src/editor/core/themes/migrateComponentConfig.ts +14 -6
  79. package/src/editor/core/themes/migrations/2026-09-13-badge-brand.ts +42 -0
  80. package/src/editor/core/themes/migrations/2026-09-13-collapsiblesection-open.ts +33 -0
  81. package/src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts +70 -0
  82. package/src/editor/core/themes/migrations/2026-09-13-hairline.ts +92 -0
  83. package/src/editor/core/themes/migrations/2026-09-13-indicator.ts +54 -0
  84. package/src/editor/core/themes/migrations/2026-09-13-sectiondivider-surface.ts +36 -0
  85. package/src/editor/core/themes/migrations/2026-09-13-selected-state.ts +124 -0
  86. package/src/editor/core/themes/migrations/2026-09-13-toggle-label.ts +31 -0
  87. package/src/editor/core/themes/migrations/index.ts +16 -0
  88. package/src/editor/core/themes/themeService.ts +3 -3
  89. package/src/editor/core/themes/themeTypes.ts +13 -15
  90. package/src/editor/docs/Docs.svelte +1 -1
  91. package/src/editor/docs/content/light-and-dark.md +3 -3
  92. package/src/editor/docs/content.generated.ts +1 -1
  93. package/src/editor/index.ts +1 -0
  94. package/src/editor/overlay/LiveEditorOverlay.svelte +15 -0
  95. package/src/editor/skill-atlas/SkillAtlas.svelte +4 -4
  96. package/src/editor/skill-atlas/TreeNodeCard.svelte +4 -4
  97. package/src/editor/skill-atlas/skillSources.generated.ts +11 -14
  98. package/src/editor/skill-atlas/skillTrees.ts +1 -3
  99. package/src/editor/skill-atlas/trees/check-compliance.ts +37 -149
  100. package/src/editor/skill-atlas/trees/create-component.ts +62 -64
  101. package/src/editor/skill-atlas/trees/create-page.ts +38 -17
  102. package/src/editor/skill-atlas/trees/pick-component.ts +3 -3
  103. package/src/editor/skill-atlas/trees/set-geometry.ts +1 -1
  104. package/src/editor/ui/UIPaletteSelector.svelte +11 -15
  105. package/src/editor/ui/variantScales.ts +8 -8
  106. package/src/live-tokens/data/themes/autumn.json +188 -188
  107. package/src/live-tokens/data/themes/halloween.json +188 -188
  108. package/src/live-tokens/data/themes/midnight-study.json +245 -245
  109. package/src/live-tokens/data/themes/ocean.json +188 -188
  110. package/src/live-tokens/data/themes/royal-velvet.json +188 -188
  111. package/src/live-tokens/data/themes/sketchy.json +188 -188
  112. package/src/live-tokens/data/themes/spring-meadow.json +188 -188
  113. package/src/live-tokens/data/themes/sunset.json +188 -188
  114. package/src/system/components/Badge.svelte +27 -23
  115. package/src/system/components/Button.svelte +13 -7
  116. package/src/system/components/Callout.svelte +16 -11
  117. package/src/system/components/Card.svelte +22 -15
  118. package/src/system/components/CodeSnippet.svelte +10 -6
  119. package/src/system/components/CollapsibleSection.svelte +81 -76
  120. package/src/system/components/CornerBadge.svelte +78 -72
  121. package/src/system/components/Dialog.svelte +21 -18
  122. package/src/system/components/IconButton.svelte +13 -9
  123. package/src/system/components/Image.svelte +14 -8
  124. package/src/system/components/ImageLightbox.svelte +10 -6
  125. package/src/system/components/InlineEditActions.svelte +17 -14
  126. package/src/system/components/Input.svelte +13 -7
  127. package/src/system/components/MenuSelect.svelte +13 -7
  128. package/src/system/components/Notification.svelte +17 -11
  129. package/src/system/components/Panel.svelte +13 -6
  130. package/src/system/components/ProgressBar.svelte +10 -5
  131. package/src/system/components/RadioButton.svelte +33 -30
  132. package/src/system/components/SectionDivider.svelte +28 -21
  133. package/src/system/components/SegmentedControl.svelte +27 -23
  134. package/src/system/components/SideNavigation.svelte +175 -171
  135. package/src/system/components/Slider.svelte +11 -7
  136. package/src/system/components/TabBar.svelte +53 -49
  137. package/src/system/components/Table.svelte +20 -15
  138. package/src/system/components/Toggle.svelte +14 -10
  139. package/src/system/components/Tooltip.svelte +10 -6
  140. package/src/system/styles/CONVENTIONS.md +3 -4
  141. package/src/testing-js/chunk-3UKGXCDL.js +48 -0
  142. package/src/testing-js/chunk-3UKGXCDL.js.map +1 -0
  143. package/src/testing-js/{chunk-FAFOAWYL.js → chunk-Q3YIAAG3.js} +17 -3
  144. package/src/testing-js/chunk-Q3YIAAG3.js.map +1 -0
  145. package/src/testing-js/{chunk-GNIUPIU2.js → chunk-U7OJE5DU.js} +18 -18
  146. package/src/testing-js/chunk-U7OJE5DU.js.map +1 -0
  147. package/src/testing-js/{chunk-4JQX6WWL.js → chunk-ZMZQZ33J.js} +474 -166
  148. package/src/testing-js/chunk-ZMZQZ33J.js.map +1 -0
  149. package/src/testing-js/component-behavior.contract.js +155 -0
  150. package/src/testing-js/component-behavior.contract.js.map +1 -0
  151. package/src/testing-js/component-editor.contract.js +6 -4
  152. package/src/testing-js/component-editor.contract.js.map +1 -1
  153. package/src/testing-js/component-render.contract.js +14 -10
  154. package/src/testing-js/component-render.contract.js.map +1 -1
  155. package/src/testing-js/index.d.ts +44 -4
  156. package/src/testing-js/index.js +13 -7
  157. package/src/testing-js/index.js.map +1 -1
  158. package/src/testing-js/page-compliance.contract.js +48 -10
  159. package/src/testing-js/page-compliance.contract.js.map +1 -1
  160. package/src/testing-js/registry.contract.js +5 -3
  161. package/src/testing-js/registry.contract.js.map +1 -1
  162. package/src/testing-js/{vitest-C-wNWcoA.d.ts → vitest-BMLIbDs2.d.ts} +8 -2
  163. package/src/testing-js/vitest.d.ts +1 -1
  164. package/src/testing-js/vitest.js +2 -1
  165. package/template/package.json +1 -2
  166. package/template/vite.config.ts +3 -2
  167. package/.claude/skills/live-tokens-create-component/SKILL copy.md +0 -196
  168. package/.claude/skills/live-tokens-fix-findings/SKILL.md +0 -105
  169. package/src/editor/skill-atlas/trees/fix-findings.ts +0 -504
  170. package/src/testing-js/chunk-4JQX6WWL.js.map +0 -1
  171. package/src/testing-js/chunk-FAFOAWYL.js.map +0 -1
  172. package/src/testing-js/chunk-GNIUPIU2.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,276 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.80.0 — The build runs the design checks
4
+
5
+ ### Added
6
+
7
+ - **`vite build` runs the design checks.** `themeFileApi` runs both static
8
+ checkers at the start of the build, under the project's severities and
9
+ without repairs. An error stops the build, and warnings print.
10
+ `themeFileApi({ checks: false })` turns the checks off. The dev server
11
+ runs no checks.
12
+
13
+ ### Changed
14
+
15
+ - **A CollapsibleSection header toggles from its label.** Without `href`, the
16
+ chevron and the label share one button, so a click anywhere on the header
17
+ opens or closes the section. The label is the button's accessible name, in
18
+ place of "Expand section" or "Collapse section".
19
+ - **The template's build is `vite build`.** Its `check:design` script is
20
+ gone, since the plugin runs the same checks.
21
+ - **check-compliance leaves the build alone.** It no longer adds
22
+ `check:design` to `package.json`.
23
+ - **`migrate` removes the `check:design` build step.** It removes the script
24
+ and its place in `build` when both hold what live-tokens wrote and the Vite
25
+ config uses `themeFileApi` with its checks on. It reports any other
26
+ `check:design` and leaves it in place.
27
+
28
+ - **The checkers bring `tokens.css` up to the installed package.** Before
29
+ either checker reads the design tokens, it applies every pending additive
30
+ migration and lists it in `fix.applied` under `tokens-migration`. A pending
31
+ breaking migration is a `tokens-breaking-migration` finding with
32
+ `repair: 'choice'`, and `npx live-tokens migrate` still applies it.
33
+ `--no-fix` reports both and writes nothing.
34
+ - **check-compliance runs only the checkers.** It no longer runs
35
+ `npx live-tokens report` or `npx live-tokens migrate` first. `report` stays
36
+ a CLI command.
37
+
38
+ ### Fixed
39
+
40
+ - **`migrate`'s usage text names the breaking migrations it applies.** It
41
+ said additive only, and it has always applied both.
42
+
43
+ ## 0.79.0 — Checks fix what they find
44
+
45
+ ### Added
46
+
47
+ - **Every finding carries its own repair.** `report --json` and both
48
+ checkers' `--json` now put `guidance`, `repair`, and `exception` on every
49
+ finding, alongside `rule`, `severity`, `file`, `line`, and `message`.
50
+ `guidance` is the rule's repair instruction in plain sentences, such as the
51
+ design token each color role takes for a `color-literal`.
52
+ `repair` is `auto` (code can apply the patch), `choice` (a role or a tie
53
+ needs the user, and `details` lists the candidates), or `authored` (the
54
+ user's own words are the fix). `exception` is the narrower
55
+ `live-tokens.config.json` entry that steps the rule down one level to
56
+ record a deliberate decision to leave the finding as it is.
57
+ - **`check-page` and `check-component` fix what they can.** Both apply every
58
+ `auto` finding's patch before they report: a deep import rewritten to its
59
+ public path, a spacing, radius, or stroke-width literal replaced by its one
60
+ nearest design token, a page's `size` prop deleted, a semantic property
61
+ override deleted. They then recheck and list each fix beside the findings
62
+ that remain, in `--json` as `fix.applied`. With `--tests`, the fixes land
63
+ before the tests run. A second run applies nothing. `--no-fix` reports
64
+ without editing, for a build or CI; the template's `check:design` passes it.
65
+ - **Three findings that used to be report-only facts.** `unread-token`
66
+ (warn): a runtime declares a property in `:global(:root)` and reads it
67
+ nowhere in its own CSS. `missing-description` (warn): a runtime file has no
68
+ `catalogue` export, or a required field in it is not a string literal. `config-token`: an alias in
69
+ `component-configs/<id>/default.json` names something the vocabulary
70
+ lacks, or a bare literal stands on a property the editor declares no
71
+ intrinsic for.
72
+ - **`ComponentContract` gains `behavior`.** A Vitest suite mounts the
73
+ runtime under happy-dom by its registration and drives each declared case
74
+ with a real DOM event: a callback fires with its documented argument,
75
+ stays silent under `disabled`, or a controlled prop drives its attribute
76
+ while an action leaves it alone. A failure reports `contract-behavior`,
77
+ naming the case. `behavior` is a required field; a component with no
78
+ callback prop declares it `{ applicable: false, reason: '...' }`.
79
+ - **A stroke's width has its own token scale**, `border-width`, so a
80
+ `dimension-literal` on a border, divider, or accent resolves to a stroke
81
+ step instead of a colour scale with nothing to offer it. 26 scales in
82
+ total; `tokens --scale border-width` resolves the name.
83
+ - **One component inventory.** `componentDirs` in `live-tokens.config.json`
84
+ is honoured everywhere a component is discovered, checked, or run under
85
+ `--tests`, not only by `report`. A registered id with no runtime, or a
86
+ runtime with no editor, now surfaces as a `missing-file` finding rather
87
+ than silently dropping out of the batch.
88
+ - **`CatalogueEntry` and the `catalogue` export.** A runtime file's
89
+ `<script module>` block exports `catalogue`, typed `CatalogueEntry`, with
90
+ `description`, `useFor`, `notFor`, and an optional `props` map keyed by
91
+ prop name. `CatalogueEntry` is exported from `@motion-proto/live-tokens`
92
+ and from `@motion-proto/live-tokens/component-editor`. `catalogueOf` reads
93
+ the export statically, the way the CLI already reads `component` and
94
+ `allTokens` from editor files, and `components <id>` prints its fields.
95
+
96
+ ### Changed (breaking)
97
+
98
+ - **`check-page` and `check-component` edit files by default.** `--fix` is
99
+ gone; every run applies the `auto` patches. A build or CI script that runs
100
+ either checker must pass `--no-fix` to stay report-only, as the template's
101
+ `check:design` does.
102
+ - **`behavior` is a required `ComponentContract` field.** A consumer's
103
+ `tests/contracts.ts` stops compiling until each contract declares a
104
+ behavior or marks it inapplicable with a reason. `references/contract-tests.md`
105
+ in the create-component skill carries the Toggle-shaped example and the
106
+ one-line inapplicable form.
107
+ - **`RegistryEntry.catalogue` is required, with no default.** A
108
+ `registerComponent` call now passes `catalogue`, imported from the
109
+ runtime file beside its editor import. The runtime file's leading comment
110
+ is deleted; the CLI never falls back to it. A consumer's registration
111
+ stops compiling until it imports and passes `catalogue`.
112
+ - **Selection says `selected`.** RadioButton's `active` prop is `selected`
113
+ and SideNavigation's `forceActivePart` is `forceSelectedPart`. The
114
+ `-active-` segment reads `-selected-` across RadioButton's nine, TabBar's
115
+ fourteen, and SideNavigation's forty semantic properties, and the `.active`
116
+ class on a radio row, a tab, and a rail part is `.selected`. A saved theme
117
+ or component config is renamed on load. `active` stays the pressed state,
118
+ so Button's and IconButton's `--*-outline-active-*` are untouched.
119
+ - **One hairline.** The line a component draws between its parts is
120
+ `-hairline-color` and its width is `-hairline-width` everywhere. Dialog's,
121
+ Table's, and TabBar's `-divider` and `-divider-width`, SegmentedControl's
122
+ `-divider-color`, `-divider-thickness`, and `-divider-inset`,
123
+ CollapsibleSection's twenty-three `--collapsiblesection-divider-*`, and
124
+ SectionDivider's three `-hairline-thickness` are renamed on load.
125
+ CollapsibleSection's `variant="divider"` is `variant="hairline"`, and its
126
+ class is `.variant-hairline`. `check-component` no longer accepts the
127
+ suffixes `-thickness`, `-divider`, `-divider-width`, `-divider-thickness`,
128
+ `-hairline-thickness`, `-divider-height`, `-divider-inset`, or `-inset`; a
129
+ property carrying one is a naming finding. The `set-geometry` op kind
130
+ `divider-width` is `hairline-width`, and an ops file naming the old kind is
131
+ rejected.
132
+ - **One indicator.** The bar beside SideNavigation's current item and the
133
+ stripe on Callout's leading edge are indicators, the word MenuSelect and
134
+ TabBar already use. SideNavigation's twelve `-accent` and twelve
135
+ `-accent-width` properties and Callout's four `-accent-width` are
136
+ `-indicator` and `-indicator-width`, renamed on load. `check-component` no
137
+ longer accepts the suffixes `-accent` or `-accent-width`; a property
138
+ carrying one is a naming finding. The `set-geometry` op kind `accent-width`
139
+ is `indicator-width`, and an ops file naming the old kind is rejected.
140
+ `accent` now names the color family only, so Badge's and CornerBadge's
141
+ `--*-accent-*` are untouched.
142
+ - **SectionDivider's fill reads `-surface`.** Its three `-background`
143
+ properties are `-surface`, matching every other component's fill name,
144
+ renamed on load. `check-component` no longer accepts the suffix
145
+ `-background`; a property carrying one is a naming finding.
146
+ - **A property's prefix is the component's id, with no exception.**
147
+ CornerBadge's forty `--corner-badge-*` properties are `--cornerbadge-*`,
148
+ renamed on load. `check-component` no longer accepts a hyphenated prefix
149
+ for any component; a property that carries one is a naming finding.
150
+ - **A text part's color is its bare name.** Toggle's `--toggle-label-text`
151
+ and `--toggle-disabled-label-text` are `--toggle-label` and
152
+ `--toggle-disabled-label`, renamed on load, matching every other
153
+ component's bare-part color.
154
+ - **A callback prop is `on` followed by the event name, all lowercase.**
155
+ TabBar's `ontabChange` is `onchange`. InlineEditActions' `onSave` and
156
+ `onCancel` are `onsave` and `oncancel`. A consumer passing the old prop
157
+ name stops compiling; there is no runtime migration for a prop.
158
+ - **`open` everywhere.** Dialog's `show` prop is `open`, still `$bindable`.
159
+ CollapsibleSection's `expanded` prop is `open`, and its four
160
+ `-expanded-` properties are `-open-`, renamed on load. A consumer passing
161
+ the old prop name stops compiling; there is no runtime migration for a
162
+ prop.
163
+ - **Size values are `default` and `small`.** Card's `size="compact"` is
164
+ `size="small"`. Notification's `size="normal"` is `size="default"` and
165
+ `size="compact"` is `size="small"`. A consumer passing the old value
166
+ stops compiling; there is no runtime migration for a prop.
167
+ - **TabBar's `selectedTab` is `value`; SideNavigation's `titleLabel` is
168
+ `title`.** Both now hold the same kind of value SegmentedControl's and
169
+ MenuSelect's `value` props do. `titleHref` is unchanged. A consumer
170
+ passing the old prop name stops compiling; there is no runtime migration
171
+ for a prop.
172
+ - **Badge's and CornerBadge's `primary` variant is `brand`.** The variant
173
+ paints the brand color family, which its tokens already name
174
+ (`--surface-brand`), so `variant="primary"` on either component is
175
+ `variant="brand"` and the rendered class is `badge-brand`. Badge's
176
+ thirteen `--badge-primary-*` and CornerBadge's three
177
+ `--cornerbadge-primary-*` properties are `--badge-brand-*` and
178
+ `--cornerbadge-brand-*`, renamed on load. Button's and IconButton's
179
+ `primary`, the one primary action a page carries, is unchanged. A consumer
180
+ passing the old value stops compiling; there is no runtime migration for a
181
+ prop.
182
+
183
+ ### Changed
184
+
185
+ - **Every shipped catalogue entry explains the props that carry a choice.**
186
+ `props.variant` on Badge, CornerBadge, Callout, Notification, Card, and
187
+ Slider, `props.anchor` on CornerBadge, `props.type` on Input,
188
+ `props.role` on MenuSelect, and `props.minHeight` on Panel, which used to
189
+ sit inside `useFor`. SectionDivider's entry keys its size guidance under
190
+ `variant`, the prop's real name, instead of `level`, and adds `eyebrow`
191
+ and `description`. The registry contract test now fails on a `props` key
192
+ that names no declared prop.
193
+ - **`components` prints only the catalogue fields a file has.** A file whose
194
+ export lacks a field no longer prints `Use for: undefined`; the
195
+ `missing-description` finding already names the field.
196
+ - **"section" replaces "band" and "range" replaces "band"** in the catalogue,
197
+ the skills, the docs, and the README, following the design vocabulary in
198
+ `docs/terminology.md`.
199
+ - **`contract-preview` is retired.** The harness throws `contract-states`
200
+ from its state assertions and `contract-interaction` from its interaction
201
+ assertions directly, so a failure the CLI used to report under
202
+ `contract-preview` now reports under the rule that actually failed.
203
+ - **`report --json`'s `components[]` facts are narrower.** No `name`,
204
+ `unread`, or `described`; a component's unread tokens and missing
205
+ description are now the `unread-token` and `missing-description` findings
206
+ under `findings.components`. `usage` drops `customUnregistered`; an
207
+ unregistered project component is now `missing-registration`.
208
+ - **The catalogue reads "views" for what TabBar switches, "a note" for
209
+ Tooltip, "section" for what Panel frames, and "a modal window" for
210
+ Dialog.**
211
+ - **`docs/terminology.md` and the create-component skill record the
212
+ component naming rules**: which word names a prop or a semantic property,
213
+ and the retired spellings each replaces.
214
+
215
+ ### Removed
216
+
217
+ - **`live-tokens-fix-findings` is gone.** `live-tokens-check-compliance`
218
+ now checks and fixes the whole project: it reads the report, runs the
219
+ token migrations, runs both checkers, repairs each remaining finding from
220
+ its `guidance`, and adds `check:design` to the build. "Make check:design
221
+ pass" and "fix the project" now reach it. `npx live-tokens setup-claude
222
+ --force` deletes a project's old copy, because it prunes every
223
+ `live-tokens-` skill a release no longer ships.
224
+
225
+ ### Fixed
226
+
227
+ - **The overlay's collapsed pill no longer covers the pinned variant strip on
228
+ the components page.** While the pill rests in the top band the overlay
229
+ publishes its right inset as `--lt-pill-inset`, and the pinned preview header
230
+ wraps its tabs clear of it. The contract harness's tab clicks are forced
231
+ clicks again, so chrome over a tab fails the run.
232
+ - **The component inventory discovers a runtime nested below a
233
+ `componentDirs` entry**, not only one directly inside it. `componentInventory`
234
+ now walks each directory recursively, the way the discovery it replaced did.
235
+ - **`config-token` reads `component-configs/<id>/default.json` from the
236
+ project's actual data directory** — `dataDir` in `live-tokens.testing.ts` or
237
+ `live-tokens.config.json`, same resolution `check-component --tests`
238
+ already isolates — instead of the literal `src/live-tokens/data`.
239
+ - **`config-token` checks an alias against its own component's properties**,
240
+ not the union across every component's. An alias that names a sibling
241
+ component's property now fires, where it used to pass silently.
242
+ - **A component with neither a runtime nor an editor reports both
243
+ `missing-file` findings**, not only the runtime's. The editor check runs
244
+ before the runtime check returns.
245
+ - **`check-page`'s attribute parser reads an attribute a newline separates
246
+ from the tag name**, and reads `size = "small"` — spaces around `=` — as
247
+ Svelte does, as one attribute rather than a stray `=` that stopped the scan.
248
+ - **One broken alias is one finding.** `check-component <id> --tests` used to
249
+ report a `default.json` alias naming an unknown token twice: once as
250
+ `config-token` from the static read, once as `contract-alias` from the
251
+ browser watching the same property resolve to nothing. The merge now drops
252
+ the browser's copy when every property it names already carries a
253
+ `config-token` finding for that component. A `contract-alias` naming a token
254
+ the vocabulary knows, declared and still unresolved, is a different defect
255
+ and stays.
256
+ - **A missing runtime is the registry rule's finding.** The behavior suite
257
+ skips a component's cases, with the reason, when the file its registration
258
+ names does not exist, instead of failing every declared case on the same
259
+ unresolved import. `contract-behavior` then reads `incomplete` in coverage,
260
+ explained by the `contract-registry` failure beside it.
261
+ - **Every registry assertion names its component.** "Every authored component
262
+ is registered" is now one assertion per authored id, so an unregistered
263
+ component reports `contract-registry` naming itself. It used to reach the
264
+ CLI as `tests-setup`, which means the tooling never ran.
265
+ - **A page obligation measures a page that has stopped moving.** `PageHarness`
266
+ waited on `--body-md-font-size`, which `tokens.css` sets on its own, then on
267
+ two animation frames. A page whose theme values, route stylesheet, or fonts
268
+ were still arriving could be measured mid-flight, and a rule reading its
269
+ geometry would report a finding on one run and none on the next. The harness
270
+ now waits for a quiet window over the page's geometry, its projected root
271
+ style, and its font set, bounded so a page that never settles is still
272
+ measured.
273
+
3
274
  ## 0.78.0 — A page proves compliance as rendered
4
275
 
5
276
  ### Added
package/README.md CHANGED
@@ -332,13 +332,13 @@ npx @motion-proto/live-tokens <command>
332
332
  | `set-type <pairing.json> [--dry-run] [--no-verify]` | Bind Google Fonts families to the theme's font stacks, verified against the API. |
333
333
  | `set-geometry <ops.json> [--dry-run]` | Move radius, padding, gap, and border-width aliases along their token scales. |
334
334
  | `save-theme <name> [--no-activate] [--dry-run]` | Compose the live state into `themes/<slug>.json` and open it, which clears the unsaved buffers. |
335
- | `migrate [--check] [--write] [--tokens <path>]` | Reconcile the project with the installed package: additive `tokens.css` migrations, the pre-0.48 data-tree move, and a report on source references to the routes that moved in 0.35.0. |
335
+ | `migrate [--check] [--write] [--tokens <path>]` | Reconcile the project with the installed package: every `tokens.css` migration, breaking ones included, the pre-0.48 data-tree move, and a report on source references to the routes that moved in 0.35.0. |
336
336
 
337
337
  Once installed in a project, the same commands are available as `npx live-tokens <command>`.
338
338
 
339
339
  ## Claude Code skills
340
340
 
341
- The package bundles nine Claude Code skills. They encode the conventions this README cannot carry in full: which component fits a need, how a page is wired, how one request becomes a whole look, what a valid theme looks like in OKLCH, how two typefaces sit together, how geometry moves along the token scales, how a project is checked against all of that, and how an existing page or component is brought back into line. Each triggers from an ordinary request, so there are no slash commands to learn.
341
+ The package bundles eight Claude Code skills. They encode the conventions this README cannot carry in full: which component fits a need, how a page is wired, how one request becomes a whole look, what a valid theme looks like in OKLCH, how two typefaces sit together, how geometry moves along the token scales, how a project is checked against all of that, and how an existing page or component is brought back into line. Each triggers from an ordinary request, so there are no slash commands to learn.
342
342
 
343
343
  ### Install
344
344
 
@@ -390,7 +390,7 @@ Ask for color: "a cooler palette", "warmer", "more contrast", "calmer", "make th
390
390
 
391
391
  The skill translates the color intent into ten OKLCH base colors (Brand, Accent, Special, Canvas, Neutral, Alternate, Info, Success, Warning, Danger) plus a light or dark scheme, then runs `npx live-tokens set-colors <base-colors.json>`. The CLI assembles the curves, enforces AA contrast on derived text tokens and auto-corrects where it can, writes the result to the unsaved colors-and-type buffer, and prints a contrast report. Exit 1 means the base colors themselves are unworkable, and each failure line names the base color to change.
392
392
 
393
- Most of the skill is the judgment the generator cannot supply: a chroma budget scaled to how much screen area each palette covers, per-role lightness and hue bands for each scheme, three levels of canvas commitment, gamut guardrails against impossible base colors, harmony modes, and the optional canvas gradient. OKLCH anchors for every named feeling, idiom, and occasion live in a reference file the skill reads on demand.
393
+ Most of the skill is the judgment the generator cannot supply: a chroma budget scaled to how much screen area each palette covers, per-role lightness and hue ranges for each scheme, three levels of canvas commitment, gamut guardrails against impossible base colors, harmony modes, and the optional canvas gradient. OKLCH anchors for every named feeling, idiom, and occasion live in a reference file the skill reads on demand.
394
394
 
395
395
  Color is the one dimension every look fixes, so it runs first and never skips. `--dry-run` prints the report without writing. Saving the open theme in the editor, or running `save-theme`, keeps the result; Adopt ships it. A re-run replaces the buffer's whole color state, including palette edits made in the editor since the last run, and carries the type and geometry buffers forward.
396
396
 
@@ -420,25 +420,19 @@ Ask for something the catalogue lacks: "author a Rating component", "make my Chi
420
420
 
421
421
  The skill covers the recipe: the runtime `.svelte` file with its `:global(:root)` token block, the editor `.svelte` file exporting `allTokens` and its variant groups, the `registerComponent()` call, and the catalogue entry that keeps `live-tokens-pick-component` current. It carries the naming scheme, the token suffix vocabulary, the state model (component states such as selected and disabled are separate from interaction states such as hover), and the public-imports rule, and points at the shipped `Toggle` in `node_modules` as the worked example. Linked siblings, intrinsics, and the fixed-overlay portal rule sit in reference files the skill reads only when a component needs them.
422
422
 
423
- ### `live-tokens-check-compliance`
424
-
425
- Ask how things stand: "check this project against the design system", "audit the pricing page", "what would it take to make the build pass?", "review this before I upgrade".
426
-
427
- The skill runs `npx live-tokens report --json`, which is the project as facts: pending `tokens.css` migrations, the tokens each component declares and reads, which page renders which component, and both checkers' findings by rule under the project's severities and under `--strict`. It presents the report, says what each rule holds, marks each recommended fix as mechanical or a judgement call, names any visible shift, and flags a finding that looks deliberate together with the config entry that would record the decision. It edits nothing and ends by handing the list to `live-tokens-fix-findings`.
428
-
429
- ### `live-tokens-fix-findings`
430
-
431
- Ask for the existing code to catch up: "make check:design pass", "fix the design-system warnings", "replace the hex and pixel values with tokens", "why is check-page failing on the pricing page?".
432
-
433
- The two checkers report a stable rule id per finding. The skill runs them with `--json`, groups the findings by rule, and carries one fix recipe per rule: a colour literal becomes the token for its role rather than the nearest hue, a spacing literal moves to the nearest `--space-*` step with the shift named, a raw `font-size` becomes a whole text style, a prop the component does not declare is mapped or dropped, and `site.css` moves out of `main.ts` into each page. It re-runs after every rule and stops at exit 0, then reports what changed, what it left and why, and what `--strict` would add. It never silences a rule to pass and never adds a token to `tokens.css` to match a value a page happened to use.
434
-
435
423
  Verify the result:
436
424
 
437
425
  ```bash
438
426
  npx @motion-proto/live-tokens check-component <id>
439
427
  ```
440
428
 
441
- The validator checks the file layout, the `:global(:root)` block, the token-suffix vocabulary, the state-before-property rule, the public-imports rule, the `registerComponent({ id })` call, and that every default resolves to a theme token rather than a literal. Exit code 0 means the static contract is met. A project scaffolded by `create` runs it, with `check-page`, as `npm run check:design` before every `vite build`, so a component or page that opts out of the theme cannot ship by accident.
429
+ The validator checks the file layout, the `:global(:root)` block, the token-suffix vocabulary, the state-before-property rule, the public-imports rule, the `registerComponent({ id })` call, and that every default resolves to a design token rather than a literal. Exit code 0 means the static contract is met. `themeFileApi` runs it, with `check-page`, at the start of every `vite build`, so a component or page that opts out of the theme cannot ship by accident. An error stops the build, and warnings print. `themeFileApi({ checks: false })` turns the checks off.
430
+
431
+ ### `live-tokens-check-compliance`
432
+
433
+ Ask how things stand, or ask for the code to catch up: "check this project against the design system and fix it", "audit the pricing page", "make the build's design checks pass", "fix the design-system warnings", "replace the hex and pixel values with tokens", "review this before I upgrade".
434
+
435
+ The skill runs both checkers, which apply every pending additive `tokens.css` migration and every `auto` repair themselves and return each remaining finding with its own `guidance`. The skill groups what remains by rule, largest error group first, makes each repair from its guidance, and re-runs until both checkers exit 0. It reports what `--strict` adds and clears the warnings when the request covers them. The reply names the fixes the checkers applied, the changes by rule with any visible shift, and each finding left with its reason. It never silences a rule to pass and never adds a token to `tokens.css` to match a value a page happened to use. A finding the user chooses to keep goes into the config entry its `exception` field names.
442
436
 
443
437
  ## From edit to production
444
438