@motion-proto/live-tokens 0.76.0 → 0.78.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 (50) hide show
  1. package/.claude/skills/live-tokens-check-compliance/SKILL.md +2 -0
  2. package/.claude/skills/live-tokens-create-component/SKILL.md +3 -3
  3. package/.claude/skills/live-tokens-create-component/references/contract-tests.md +99 -3
  4. package/.claude/skills/live-tokens-create-page/SKILL.md +5 -4
  5. package/.claude/skills/live-tokens-fix-findings/SKILL.md +7 -0
  6. package/CHANGELOG.md +90 -0
  7. package/bin/check-component.mjs +2 -0
  8. package/bin/check-page.mjs +131 -9
  9. package/bin/cli.mjs +25 -3
  10. package/bin/contractRunner.mjs +349 -30
  11. package/bin/lib/pageRoutes.mjs +309 -0
  12. package/package.json +5 -3
  13. package/src/editor/overlay/ColumnsOverlay.svelte +1 -1
  14. package/src/editor/overlay/LiveEditorOverlay.svelte +1 -0
  15. package/src/editor/overlay/LiveTokensRouter.svelte +1 -0
  16. package/src/editor/skill-atlas/skillSources.generated.ts +5 -5
  17. package/src/editor/skill-atlas/trees/check-compliance.ts +18 -18
  18. package/src/editor/skill-atlas/trees/create-component.ts +8 -3
  19. package/src/editor/skill-atlas/trees/create-page.ts +26 -26
  20. package/src/editor/skill-atlas/trees/fix-findings.ts +46 -11
  21. package/src/testing-js/{chunk-LXR3MN6N.js → chunk-4JQX6WWL.js} +1 -1
  22. package/src/testing-js/chunk-4JQX6WWL.js.map +1 -0
  23. package/src/testing-js/{chunk-AO7EZHYV.js → chunk-GNIUPIU2.js} +3 -3
  24. package/src/testing-js/{chunk-ZMSX6CXR.js → chunk-NB3NZRBM.js} +13 -2
  25. package/src/testing-js/chunk-NB3NZRBM.js.map +1 -0
  26. package/src/testing-js/{chunk-L73N4NSO.js → chunk-WIZ6W7UT.js} +2 -2
  27. package/src/testing-js/component-alias.contract.js +2 -2
  28. package/src/testing-js/component-editor.contract.js +21 -5
  29. package/src/testing-js/component-editor.contract.js.map +1 -1
  30. package/src/testing-js/component-render.contract.js +4 -4
  31. package/src/testing-js/index.d.ts +9 -3
  32. package/src/testing-js/index.js +20 -12
  33. package/src/testing-js/index.js.map +1 -1
  34. package/src/testing-js/page-compliance.contract.js +829 -0
  35. package/src/testing-js/page-compliance.contract.js.map +1 -0
  36. package/src/testing-js/{vitest-BE6uGF31.d.ts → vitest-C-wNWcoA.d.ts} +21 -1
  37. package/src/testing-js/vitest.d.ts +1 -1
  38. package/src/testing-js/vitest.js +1 -1
  39. package/template/README.md +17 -5
  40. package/template/live-tokens.testing.ts +6 -0
  41. package/template/package.json +5 -2
  42. package/template/src/main.ts +1 -0
  43. package/template/src/pages/Home.svelte +13 -0
  44. package/template/src/registerComponents.ts +4 -0
  45. package/template/tests/contracts.ts +3 -0
  46. package/template/tsconfig.json +1 -1
  47. package/src/testing-js/chunk-LXR3MN6N.js.map +0 -1
  48. package/src/testing-js/chunk-ZMSX6CXR.js.map +0 -1
  49. /package/src/testing-js/{chunk-AO7EZHYV.js.map → chunk-GNIUPIU2.js.map} +0 -0
  50. /package/src/testing-js/{chunk-L73N4NSO.js.map → chunk-WIZ6W7UT.js.map} +0 -0
@@ -2,7 +2,7 @@ import type { SkillTree } from '../types';
2
2
 
3
3
  export const createPage: SkillTree = {
4
4
  "id": "live-tokens-create-page",
5
- "digest": "sha256:00cc1191fecc9707",
5
+ "digest": "sha256:7d816fe66d20567c",
6
6
  "title": "create-page",
7
7
  "tagline": "Create a Page Using Live Tokens",
8
8
  "nodes": [
@@ -71,13 +71,13 @@ export const createPage: SkillTree = {
71
71
  "chips": [
72
72
  {
73
73
  "label": "Grid",
74
- "lines": [39, 50],
74
+ "lines": [39, 52],
75
75
  "anchor": "### Grid",
76
- "anchorEnd": "A grid that follows the page columns takes `var(--columns-co"
76
+ "anchorEnd": "No scaffold collapses the page grid on a phone: the theme's "
77
77
  },
78
78
  {
79
79
  "label": "Separation",
80
- "lines": [52, 69],
80
+ "lines": [54, 71],
81
81
  "anchor": "### Separation",
82
82
  "anchorEnd": "`references/layout-sources.md` names the sources for these l"
83
83
  }
@@ -94,31 +94,31 @@ export const createPage: SkillTree = {
94
94
  "chips": [
95
95
  {
96
96
  "label": "Stage",
97
- "lines": [73, 74],
97
+ "lines": [75, 76],
98
98
  "anchor": "`Panel` is a stage: a canvas, a player, a preview. `minHeigh",
99
99
  "anchorEnd": "An empty stage shows a heading that names the condition and "
100
100
  },
101
101
  {
102
102
  "label": "Card",
103
- "lines": [75, 76],
103
+ "lines": [77, 78],
104
104
  "anchor": "`Card` is a titled block of content. Its `title` prop is the",
105
105
  "anchorEnd": "A container in a tool UI labels itself: `Card variant=\"bare\""
106
106
  },
107
107
  {
108
108
  "label": "Form",
109
- "lines": [77, 78],
109
+ "lines": [79, 80],
110
110
  "anchor": "A form puts the essential fields first and the secondary fie",
111
111
  "anchorEnd": "A row of fields is a flex row with `gap: var(--space-20)`. E"
112
112
  },
113
113
  {
114
114
  "label": "Buttons",
115
- "lines": [79, 80],
115
+ "lines": [81, 82],
116
116
  "anchor": "A toolbar is a flex row of Buttons on the section's bottom e",
117
117
  "anchorEnd": "A vertical stack of Buttons sets `fullWidth` on each Button."
118
118
  },
119
119
  {
120
120
  "label": "Picker",
121
- "lines": [81, 81],
121
+ "lines": [83, 83],
122
122
  "anchor": "`MenuSelect` renders its list open. For a picker, toggle it "
123
123
  }
124
124
  ]
@@ -134,7 +134,7 @@ export const createPage: SkillTree = {
134
134
  "chips": [
135
135
  {
136
136
  "label": "Components",
137
- "lines": [83, 90],
137
+ "lines": [85, 92],
138
138
  "anchor": "## Components",
139
139
  "anchorEnd": "Text inside a `Card` or a `CollapsibleSection` takes the con"
140
140
  },
@@ -162,25 +162,25 @@ export const createPage: SkillTree = {
162
162
  "chips": [
163
163
  {
164
164
  "label": "Tokens",
165
- "lines": [92, 97],
165
+ "lines": [94, 99],
166
166
  "anchor": "## Tokens",
167
167
  "anchorEnd": "A value that comes from data, such as a sheet's padding in p"
168
168
  },
169
169
  {
170
170
  "label": "Type",
171
- "lines": [101, 116],
171
+ "lines": [103, 118],
172
172
  "anchor": "### Type",
173
173
  "anchorEnd": "Use the semantic element for each place: one `h1`, an `h2` f"
174
174
  },
175
175
  {
176
176
  "label": "Size and emphasis",
177
- "lines": [118, 126],
177
+ "lines": [120, 128],
178
178
  "anchor": "### Size",
179
179
  "anchorEnd": "In a row of actions the primary sits last, on the right. Up "
180
180
  },
181
181
  {
182
182
  "label": "Spacing",
183
- "lines": [128, 142],
183
+ "lines": [130, 144],
184
184
  "anchor": "### Spacing",
185
185
  "anchorEnd": "Every section after the first opens with a hairline: `paddin"
186
186
  }
@@ -197,12 +197,12 @@ export const createPage: SkillTree = {
197
197
  "chips": [
198
198
  {
199
199
  "label": "LiveTokensRouter",
200
- "lines": [148, 148],
200
+ "lines": [150, 150],
201
201
  "anchor": "`<LiveTokensRouter pages={...}>`: add a `pages` entry with `"
202
202
  },
203
203
  {
204
204
  "label": "LiveEditorOverlay",
205
- "lines": [149, 149],
205
+ "lines": [151, 151],
206
206
  "anchor": "Manual `<LiveEditorOverlay>`: dispatch with `$derived.by(() "
207
207
  }
208
208
  ]
@@ -211,10 +211,10 @@ export const createPage: SkillTree = {
211
211
  "id": "cp-check",
212
212
  "row": 8,
213
213
  "kind": "step",
214
- "title": "Run live-tokens-check-compliance",
215
- "desc": "Its report goes to live-tokens-fix-findings until the page is clean.",
214
+ "title": "Run both checkers",
215
+ "desc": "live-tokens-check-compliance reads the source. check-page --tests --strict proves the rendered page at its route. Both reports go to live-tokens-fix-findings until the page is clean.",
216
216
  "lines": [20, 20],
217
- "anchor": "Run **live-tokens-check-compliance**, then check the rendere"
217
+ "anchor": "Run **live-tokens-check-compliance** and `npx live-tokens ch"
218
218
  },
219
219
  {
220
220
  "id": "cp-verify",
@@ -222,31 +222,31 @@ export const createPage: SkillTree = {
222
222
  "kind": "chipset",
223
223
  "title": "Check the page in the browser",
224
224
  "desc": "The checkers cannot see a layout. Open the page at its width and check each line.",
225
- "lines": [168, 185],
225
+ "lines": [170, 186],
226
226
  "anchor": "The checkers cannot see a layout. Open the page at the width",
227
227
  "anchorEnd": "`references/interaction-sources.md` names the sources for th",
228
228
  "chips": [
229
229
  {
230
230
  "label": "Structure",
231
- "lines": [170, 175],
231
+ "lines": [172, 176],
232
232
  "anchor": "The first section holds what the user came for.",
233
- "anchorEnd": "Every control stays inside its wrapper. A `width: 100%` fiel"
233
+ "anchorEnd": "The containers in a section align at the bottom."
234
234
  },
235
235
  {
236
236
  "label": "Actions",
237
- "lines": [176, 179],
237
+ "lines": [177, 180],
238
238
  "anchor": "The actions sit where the eye goes last, with the one primar",
239
239
  "anchorEnd": "An action that runs longer than a moment shows progress in a"
240
240
  },
241
241
  {
242
242
  "label": "Fields",
243
- "lines": [180, 181],
243
+ "lines": [181, 182],
244
244
  "anchor": "Every field has a default, and Reset restores it.",
245
245
  "anchorEnd": "Secondary settings sit in a `CollapsibleSection`. Every cont"
246
246
  },
247
247
  {
248
248
  "label": "Words and access",
249
- "lines": [182, 183],
249
+ "lines": [183, 184],
250
250
  "anchor": "Labels use the user's words, such as \"Export slices\".",
251
251
  "anchorEnd": "Every `img` has `alt` text. Focus order follows the reading "
252
252
  }
@@ -258,7 +258,7 @@ export const createPage: SkillTree = {
258
258
  "kind": "step",
259
259
  "title": "Read the page twice",
260
260
  "desc": "From a distance only the sections show. Up close, every border and bar earns its place or goes.",
261
- "lines": [187, 187],
261
+ "lines": [188, 188],
262
262
  "anchor": "Then read the page from a distance: the sections and their e"
263
263
  },
264
264
  {
@@ -2,7 +2,7 @@ import type { SkillTree } from '../types';
2
2
 
3
3
  export const fixFindings: SkillTree = {
4
4
  "id": "live-tokens-fix-findings",
5
- "digest": "sha256:2c39f9f00b03b5ad",
5
+ "digest": "sha256:e400a3de85a17e3c",
6
6
  "title": "fix-findings",
7
7
  "tagline": "Repair Deviations from the Design System",
8
8
  "nodes": [
@@ -160,7 +160,7 @@ export const fixFindings: SkillTree = {
160
160
  "kind": "chipset",
161
161
  "title": "The remaining rules",
162
162
  "desc": "Every other rule has its fix in the table.",
163
- "lines": [71, 90],
163
+ "lines": [71, 97],
164
164
  "anchor": "## The remaining rules",
165
165
  "anchorEnd": "| `fix: runtime` | Wire the component as the recipe in **liv",
166
166
  "chips": [
@@ -205,48 +205,83 @@ export const fixFindings: SkillTree = {
205
205
  "anchor": "| `danger-without-dialog` | Open a `Dialog` from the danger "
206
206
  },
207
207
  {
208
- "label": "hardcoded-columns",
208
+ "label": "native-control",
209
209
  "lines": [83, 83],
210
+ "anchor": "| `native-control` | Replace the native element with the shi"
211
+ },
212
+ {
213
+ "label": "property-override",
214
+ "lines": [84, 84],
215
+ "anchor": "| `property-override` | Delete the declaration from the page"
216
+ },
217
+ {
218
+ "label": "page-component-paint",
219
+ "lines": [85, 85],
220
+ "anchor": "| `page-component-paint` | The finding names the page file a"
221
+ },
222
+ {
223
+ "label": "page-text-style",
224
+ "lines": [86, 86],
225
+ "anchor": "| `page-text-style` | The finding names the page file and th"
226
+ },
227
+ {
228
+ "label": "page-contrast",
229
+ "lines": [87, 87],
230
+ "anchor": "| `page-contrast` | The finding names the page file and the "
231
+ },
232
+ {
233
+ "label": "page-grid",
234
+ "lines": [88, 88],
235
+ "anchor": "| `page-grid` | The finding names the page file and the line"
236
+ },
237
+ {
238
+ "label": "page-overflow",
239
+ "lines": [89, 89],
240
+ "anchor": "| `page-overflow` | The finding names the page file and the "
241
+ },
242
+ {
243
+ "label": "hardcoded-columns",
244
+ "lines": [90, 90],
210
245
  "anchor": "| `hardcoded-columns` | `repeat(var(--columns-count), 1fr)` "
211
246
  },
212
247
  {
213
248
  "label": "site-css-in-main",
214
- "lines": [84, 84],
249
+ "lines": [91, 91],
215
250
  "anchor": "| `site-css-in-main` | Delete the import from `main.ts`. Add"
216
251
  },
217
252
  {
218
253
  "label": "missing-source",
219
- "lines": [85, 85],
254
+ "lines": [92, 92],
220
255
  "anchor": "| `missing-source` | Add `source: 'src/...'` to the route en"
221
256
  },
222
257
  {
223
258
  "label": "reserved-route",
224
- "lines": [86, 86],
259
+ "lines": [93, 93],
225
260
  "anchor": "| `reserved-route` | Move the route out of `/live-tokens/*`."
226
261
  },
227
262
  {
228
263
  "label": "deep-import",
229
- "lines": [87, 87],
264
+ "lines": [94, 94],
230
265
  "anchor": "| `deep-import` | Import from `@motion-proto/live-tokens`, `"
231
266
  },
232
267
  {
233
268
  "label": "Component name rules",
234
- "lines": [88, 88],
269
+ "lines": [95, 95],
235
270
  "anchor": "| `fix: property-name` | Rename the token to the name a ship"
236
271
  },
237
272
  {
238
273
  "label": "Component token rules",
239
- "lines": [89, 89],
274
+ "lines": [96, 96],
240
275
  "anchor": "| `fix: property-token` | Make the `:global(:root)` default "
241
276
  },
242
277
  {
243
278
  "label": "Component editor rules",
244
- "lines": [92, 92],
279
+ "lines": [99, 99],
245
280
  "anchor": "| `fix: editor` | The editor names a token the runtime never"
246
281
  },
247
282
  {
248
283
  "label": "Component wiring rules",
249
- "lines": [90, 90],
284
+ "lines": [97, 97],
250
285
  "anchor": "| `fix: runtime` | Wire the component as the recipe in **liv"
251
286
  }
252
287
  ]
@@ -3060,4 +3060,4 @@ export {
3060
3060
  allContracts,
3061
3061
  selectedContracts
3062
3062
  };
3063
- //# sourceMappingURL=chunk-LXR3MN6N.js.map
3063
+ //# sourceMappingURL=chunk-4JQX6WWL.js.map