@motion-proto/live-tokens 0.78.0 → 0.79.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.
- package/.claude/skills/live-tokens-check-compliance/SKILL.md +60 -31
- package/.claude/skills/live-tokens-create-component/SKILL.md +23 -28
- package/.claude/skills/live-tokens-create-component/references/contract-tests.md +61 -0
- package/.claude/skills/live-tokens-create-component/references/sketch-mode.md +2 -2
- package/.claude/skills/live-tokens-create-component/references/token-naming.md +6 -15
- package/.claude/skills/live-tokens-create-page/SKILL.md +6 -4
- package/.claude/skills/live-tokens-create-theme/references/design-directions.md +1 -1
- package/.claude/skills/live-tokens-pick-component/SKILL.md +3 -3
- package/.claude/skills/live-tokens-set-colors/references/color-anchors.md +1 -1
- package/.claude/skills/live-tokens-set-geometry/SKILL.md +1 -1
- package/.claude/skills/live-tokens-set-geometry/references/geometry-anchors.md +1 -1
- package/CHANGELOG.md +231 -0
- package/README.md +9 -15
- package/bin/check-component.mjs +152 -551
- package/bin/check-page.mjs +55 -541
- package/bin/cli.mjs +59 -13
- package/bin/contractRunner.mjs +37 -91
- package/bin/lib/catalogue.mjs +161 -34
- package/bin/lib/componentSource.mjs +152 -0
- package/bin/lib/cssValues.mjs +9 -0
- package/bin/lib/dataDir.mjs +126 -0
- package/bin/lib/findings.mjs +103 -12
- package/bin/lib/fixers.mjs +64 -0
- package/bin/lib/geometry.mjs +92 -0
- package/bin/lib/pageSource.mjs +230 -0
- package/bin/lib/report.mjs +57 -59
- package/bin/lib/tokenVocabulary.mjs +104 -34
- package/bin/rules/componentStructure.mjs +344 -0
- package/bin/rules/componentUse.mjs +313 -0
- package/bin/rules/importsAndRoutes.mjs +136 -0
- package/bin/rules/testRuns.mjs +122 -0
- package/bin/rules/tokens.mjs +363 -0
- package/bin/setup-claude.mjs +1 -2
- package/dist-plugin/{chunk-PDNL4NC5.js → chunk-D4WRIKEZ.js} +7 -2
- package/dist-plugin/{chunk-SWXRVZKT.js → chunk-REBHE3ZM.js} +414 -1
- package/dist-plugin/index.cjs +432 -15
- package/dist-plugin/index.js +8 -9
- package/dist-plugin/migrateData/index.cjs +422 -4
- package/dist-plugin/migrateData/index.js +2 -2
- package/dist-plugin/setColors/index.cjs +414 -1
- package/dist-plugin/setColors/index.d.cts +1 -1
- package/dist-plugin/setColors/index.d.ts +1 -1
- package/dist-plugin/setColors/index.js +1 -1
- package/dist-plugin/setGeometry/index.cjs +423 -13
- package/dist-plugin/setGeometry/index.d.cts +3 -3
- package/dist-plugin/setGeometry/index.d.ts +3 -3
- package/dist-plugin/setGeometry/index.js +10 -13
- package/dist-plugin/setType/index.d.cts +1 -1
- package/dist-plugin/setType/index.d.ts +1 -1
- package/dist-plugin/{themeTypes-BxRtuN5V.d.cts → themeTypes-B8_Idrp4.d.cts} +2 -2
- package/dist-plugin/{themeTypes-BxRtuN5V.d.ts → themeTypes-B8_Idrp4.d.ts} +2 -2
- package/package.json +2 -2
- package/src/editor/component-editor/CalloutEditor.svelte +2 -2
- package/src/editor/component-editor/CollapsibleSectionEditor.svelte +14 -15
- package/src/editor/component-editor/CornerBadgeEditor.svelte +14 -14
- package/src/editor/component-editor/DialogEditor.svelte +5 -5
- package/src/editor/component-editor/InlineEditActionsEditor.svelte +2 -2
- package/src/editor/component-editor/RadioButtonEditor.svelte +21 -21
- package/src/editor/component-editor/SectionDividerEditor.svelte +7 -7
- package/src/editor/component-editor/SegmentedControlEditor.svelte +5 -5
- package/src/editor/component-editor/SideNavigationEditor.svelte +25 -25
- package/src/editor/component-editor/TabBarEditor.svelte +6 -6
- package/src/editor/component-editor/TableEditor.svelte +6 -6
- package/src/editor/component-editor/ToggleEditor.svelte +2 -2
- package/src/editor/component-editor/index.ts +3 -0
- package/src/editor/component-editor/registry.ts +57 -1
- package/src/editor/component-editor/scaffolding/TokenLayout.svelte +14 -14
- package/src/editor/component-editor/scaffolding/VariantGroup.svelte +3 -0
- package/src/editor/component-editor/scaffolding/types.ts +15 -0
- package/src/editor/core/components/adjustAliases.ts +4 -4
- package/src/editor/core/components/aliasKinds.ts +20 -19
- package/src/editor/core/sketch/sketchLayer.ts +3 -3
- package/src/editor/core/themes/migrateComponentConfig.ts +14 -6
- package/src/editor/core/themes/migrations/2026-09-13-badge-brand.ts +42 -0
- package/src/editor/core/themes/migrations/2026-09-13-collapsiblesection-open.ts +33 -0
- package/src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts +70 -0
- package/src/editor/core/themes/migrations/2026-09-13-hairline.ts +92 -0
- package/src/editor/core/themes/migrations/2026-09-13-indicator.ts +54 -0
- package/src/editor/core/themes/migrations/2026-09-13-sectiondivider-surface.ts +36 -0
- package/src/editor/core/themes/migrations/2026-09-13-selected-state.ts +124 -0
- package/src/editor/core/themes/migrations/2026-09-13-toggle-label.ts +31 -0
- package/src/editor/core/themes/migrations/index.ts +16 -0
- package/src/editor/core/themes/themeService.ts +3 -3
- package/src/editor/core/themes/themeTypes.ts +13 -15
- package/src/editor/docs/Docs.svelte +1 -1
- package/src/editor/docs/content/light-and-dark.md +3 -3
- package/src/editor/docs/content.generated.ts +1 -1
- package/src/editor/index.ts +1 -0
- package/src/editor/overlay/LiveEditorOverlay.svelte +15 -0
- package/src/editor/skill-atlas/SkillAtlas.svelte +4 -4
- package/src/editor/skill-atlas/TreeNodeCard.svelte +4 -4
- package/src/editor/skill-atlas/skillSources.generated.ts +11 -14
- package/src/editor/skill-atlas/skillTrees.ts +1 -3
- package/src/editor/skill-atlas/trees/check-compliance.ts +258 -93
- package/src/editor/skill-atlas/trees/create-component.ts +73 -62
- package/src/editor/skill-atlas/trees/create-page.ts +38 -17
- package/src/editor/skill-atlas/trees/pick-component.ts +3 -3
- package/src/editor/skill-atlas/trees/set-geometry.ts +1 -1
- package/src/editor/ui/UIPaletteSelector.svelte +11 -15
- package/src/editor/ui/variantScales.ts +8 -8
- package/src/live-tokens/data/themes/autumn.json +188 -188
- package/src/live-tokens/data/themes/halloween.json +188 -188
- package/src/live-tokens/data/themes/midnight-study.json +245 -245
- package/src/live-tokens/data/themes/ocean.json +188 -188
- package/src/live-tokens/data/themes/royal-velvet.json +188 -188
- package/src/live-tokens/data/themes/sketchy.json +188 -188
- package/src/live-tokens/data/themes/spring-meadow.json +188 -188
- package/src/live-tokens/data/themes/sunset.json +188 -188
- package/src/system/components/Badge.svelte +27 -23
- package/src/system/components/Button.svelte +13 -7
- package/src/system/components/Callout.svelte +16 -11
- package/src/system/components/Card.svelte +22 -15
- package/src/system/components/CodeSnippet.svelte +10 -6
- package/src/system/components/CollapsibleSection.svelte +68 -63
- package/src/system/components/CornerBadge.svelte +78 -72
- package/src/system/components/Dialog.svelte +21 -18
- package/src/system/components/IconButton.svelte +13 -9
- package/src/system/components/Image.svelte +14 -8
- package/src/system/components/ImageLightbox.svelte +10 -6
- package/src/system/components/InlineEditActions.svelte +17 -14
- package/src/system/components/Input.svelte +13 -7
- package/src/system/components/MenuSelect.svelte +13 -7
- package/src/system/components/Notification.svelte +17 -11
- package/src/system/components/Panel.svelte +13 -6
- package/src/system/components/ProgressBar.svelte +10 -5
- package/src/system/components/RadioButton.svelte +33 -30
- package/src/system/components/SectionDivider.svelte +28 -21
- package/src/system/components/SegmentedControl.svelte +27 -23
- package/src/system/components/SideNavigation.svelte +175 -171
- package/src/system/components/Slider.svelte +11 -7
- package/src/system/components/TabBar.svelte +53 -49
- package/src/system/components/Table.svelte +20 -15
- package/src/system/components/Toggle.svelte +14 -10
- package/src/system/components/Tooltip.svelte +10 -6
- package/src/system/styles/CONVENTIONS.md +3 -4
- package/src/testing-js/chunk-3UKGXCDL.js +48 -0
- package/src/testing-js/chunk-3UKGXCDL.js.map +1 -0
- package/src/testing-js/{chunk-FAFOAWYL.js → chunk-Q3YIAAG3.js} +17 -3
- package/src/testing-js/chunk-Q3YIAAG3.js.map +1 -0
- package/src/testing-js/{chunk-GNIUPIU2.js → chunk-U7OJE5DU.js} +18 -18
- package/src/testing-js/chunk-U7OJE5DU.js.map +1 -0
- package/src/testing-js/{chunk-4JQX6WWL.js → chunk-ZMZQZ33J.js} +474 -166
- package/src/testing-js/chunk-ZMZQZ33J.js.map +1 -0
- package/src/testing-js/component-behavior.contract.js +155 -0
- package/src/testing-js/component-behavior.contract.js.map +1 -0
- package/src/testing-js/component-editor.contract.js +6 -4
- package/src/testing-js/component-editor.contract.js.map +1 -1
- package/src/testing-js/component-render.contract.js +14 -10
- package/src/testing-js/component-render.contract.js.map +1 -1
- package/src/testing-js/index.d.ts +44 -4
- package/src/testing-js/index.js +13 -7
- package/src/testing-js/index.js.map +1 -1
- package/src/testing-js/page-compliance.contract.js +48 -10
- package/src/testing-js/page-compliance.contract.js.map +1 -1
- package/src/testing-js/registry.contract.js +5 -3
- package/src/testing-js/registry.contract.js.map +1 -1
- package/src/testing-js/{vitest-C-wNWcoA.d.ts → vitest-BMLIbDs2.d.ts} +8 -2
- package/src/testing-js/vitest.d.ts +1 -1
- package/src/testing-js/vitest.js +2 -1
- package/template/package.json +1 -1
- package/.claude/skills/live-tokens-create-component/SKILL copy.md +0 -196
- package/.claude/skills/live-tokens-fix-findings/SKILL.md +0 -105
- package/src/editor/skill-atlas/trees/fix-findings.ts +0 -504
- package/src/testing-js/chunk-4JQX6WWL.js.map +0 -1
- package/src/testing-js/chunk-FAFOAWYL.js.map +0 -1
- package/src/testing-js/chunk-GNIUPIU2.js.map +0 -1
|
@@ -2,7 +2,7 @@ import type { SkillTree } from '../types';
|
|
|
2
2
|
|
|
3
3
|
export const createComponent: SkillTree = {
|
|
4
4
|
"id": "live-tokens-create-component",
|
|
5
|
-
"digest": "sha256:
|
|
5
|
+
"digest": "sha256:64a50a8081b1f789",
|
|
6
6
|
"title": "create-component",
|
|
7
7
|
"tagline": "Create a LiveTokens Component",
|
|
8
8
|
"nodes": [
|
|
@@ -26,27 +26,27 @@ export const createComponent: SkillTree = {
|
|
|
26
26
|
"chips": [
|
|
27
27
|
{
|
|
28
28
|
"label": "Config",
|
|
29
|
-
"lines": [
|
|
29
|
+
"lines": [43, 43],
|
|
30
30
|
"anchor": "Read the project's `package.json`, `live-tokens.config.json`"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"label": "Catalogue",
|
|
34
|
-
"lines": [
|
|
34
|
+
"lines": [44, 44],
|
|
35
35
|
"anchor": "Run `npx live-tokens components`. The list holds every compo"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"label": "Token scales",
|
|
39
|
-
"lines": [
|
|
39
|
+
"lines": [45, 45],
|
|
40
40
|
"anchor": "Run `npx live-tokens tokens --scale <name>` for each token s"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"label": "Shipped pair",
|
|
44
|
-
"lines": [
|
|
44
|
+
"lines": [46, 46],
|
|
45
45
|
"anchor": "Read a shipped runtime and editor pair: `Toggle` for interac"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"label": "Suffixes",
|
|
49
|
-
"lines": [
|
|
49
|
+
"lines": [47, 47],
|
|
50
50
|
"anchor": "Read `references/token-naming.md` for the suffixes that sele"
|
|
51
51
|
}
|
|
52
52
|
]
|
|
@@ -62,31 +62,31 @@ export const createComponent: SkillTree = {
|
|
|
62
62
|
"chips": [
|
|
63
63
|
{
|
|
64
64
|
"label": "Design model",
|
|
65
|
-
"lines": [20,
|
|
65
|
+
"lines": [20, 37],
|
|
66
66
|
"anchor": "## Design model",
|
|
67
|
-
"anchorEnd": "
|
|
67
|
+
"anchorEnd": "Prop names follow the shipped components. `label` names a co"
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
"label": "Parts, variants, and states",
|
|
71
|
-
"lines": [
|
|
71
|
+
"lines": [51, 67],
|
|
72
72
|
"anchor": "## Variants and states",
|
|
73
73
|
"anchorEnd": "A component supplies its variants. The page chooses the one "
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
"label": "Property map",
|
|
77
|
-
"lines": [
|
|
77
|
+
"lines": [71, 84],
|
|
78
78
|
"anchor": "Before writing a file, identify the component's parts, text ",
|
|
79
79
|
"anchorEnd": "Assign from the tokens the project has. Match the token scal"
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
"label": "Name shape",
|
|
83
|
-
"lines": [
|
|
83
|
+
"lines": [86, 98],
|
|
84
84
|
"anchor": "A property name starts with the component id and ends with t",
|
|
85
85
|
"anchorEnd": "For a state that affects several parts, follow Toggle: `--to"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"label": "Shipped role names",
|
|
89
|
-
"lines": [
|
|
89
|
+
"lines": [100, 100],
|
|
90
90
|
"anchor": "Name a role as the shipped component that paints the same th"
|
|
91
91
|
}
|
|
92
92
|
]
|
|
@@ -95,36 +95,36 @@ export const createComponent: SkillTree = {
|
|
|
95
95
|
"id": "cc-runtime",
|
|
96
96
|
"row": 3,
|
|
97
97
|
"kind": "chipset",
|
|
98
|
-
"title": "Write the component runtime
|
|
99
|
-
"desc": "Start with the
|
|
98
|
+
"title": "Write the component runtime",
|
|
99
|
+
"desc": "Start with the catalogue export. Declare every property with its token, and read it in the CSS.",
|
|
100
100
|
"lines": [14, 14],
|
|
101
|
-
"anchor": "Write the runtime file: the
|
|
101
|
+
"anchor": "Write the runtime file: the catalogue export and the `:globa",
|
|
102
102
|
"chips": [
|
|
103
103
|
{
|
|
104
|
-
"label": "
|
|
105
|
-
"lines": [
|
|
106
|
-
"anchor": "Open the file with
|
|
107
|
-
"anchorEnd": "
|
|
104
|
+
"label": "Catalogue entry",
|
|
105
|
+
"lines": [106, 118],
|
|
106
|
+
"anchor": "Open the file with a `<script module lang=\"ts\">` block that ",
|
|
107
|
+
"anchorEnd": "```"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
"label": "Root block",
|
|
111
|
-
"lines": [
|
|
111
|
+
"lines": [120, 148],
|
|
112
112
|
"anchor": "Declare every editable property in a literal `:global(:root)",
|
|
113
113
|
"anchorEnd": "The excerpt shows the chain for part of the property map. Ev"
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
"label": "Intrinsics",
|
|
117
|
-
"lines": [
|
|
117
|
+
"lines": [148, 148],
|
|
118
118
|
"anchor": "The excerpt shows the chain for part of the property map. Ev"
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
"label": "Sketch mode",
|
|
122
|
-
"lines": [
|
|
122
|
+
"lines": [223, 223],
|
|
123
123
|
"anchor": "Every component joins the sketch layer: read `references/ske"
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
"label": "Fixed overlays",
|
|
127
|
-
"lines": [
|
|
127
|
+
"lines": [225, 225],
|
|
128
128
|
"anchor": "A fixed overlay portals to `<body>`: read `references/fixed-"
|
|
129
129
|
}
|
|
130
130
|
]
|
|
@@ -140,22 +140,22 @@ export const createComponent: SkillTree = {
|
|
|
140
140
|
"chips": [
|
|
141
141
|
{
|
|
142
142
|
"label": "Schema",
|
|
143
|
-
"lines": [
|
|
143
|
+
"lines": [154, 154],
|
|
144
144
|
"anchor": "A `<script module>` block exports `component`, the id, and `"
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
"label": "Preview props",
|
|
148
|
-
"lines": [
|
|
148
|
+
"lines": [155, 155],
|
|
149
149
|
"anchor": "The instance script imports the runtime component and the ed"
|
|
150
150
|
},
|
|
151
151
|
{
|
|
152
152
|
"label": "Markup",
|
|
153
|
-
"lines": [
|
|
153
|
+
"lines": [156, 156],
|
|
154
154
|
"anchor": "The markup mounts `ComponentEditorBase` with one `VariantGro"
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
"label": "Linked siblings",
|
|
158
|
-
"lines": [
|
|
158
|
+
"lines": [192, 192],
|
|
159
159
|
"anchor": "When variants share a value, read `references/linked-sibling"
|
|
160
160
|
}
|
|
161
161
|
]
|
|
@@ -171,23 +171,23 @@ export const createComponent: SkillTree = {
|
|
|
171
171
|
"chips": [
|
|
172
172
|
{
|
|
173
173
|
"label": "Shared module",
|
|
174
|
-
"lines": [
|
|
174
|
+
"lines": [196, 212],
|
|
175
175
|
"anchor": "Register the component in `src/registerComponents.ts`, a reg",
|
|
176
176
|
"anchorEnd": "});"
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
179
|
"label": "Import and name it",
|
|
180
|
-
"lines": [
|
|
180
|
+
"lines": [215, 215],
|
|
181
181
|
"anchor": "Import the module from `src/main.ts`, before `bootLiveTokens"
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
184
|
"label": "Contract",
|
|
185
|
-
"lines": [
|
|
185
|
+
"lines": [215, 215],
|
|
186
186
|
"anchor": "Import the module from `src/main.ts`, before `bootLiveTokens"
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
189
|
"label": "First-party",
|
|
190
|
-
"lines": [
|
|
190
|
+
"lines": [219, 219],
|
|
191
191
|
"anchor": "Inside the live-tokens repository, a first-party component k"
|
|
192
192
|
}
|
|
193
193
|
]
|
|
@@ -195,38 +195,33 @@ export const createComponent: SkillTree = {
|
|
|
195
195
|
{
|
|
196
196
|
"id": "cc-checks",
|
|
197
197
|
"row": 6,
|
|
198
|
-
"kind": "
|
|
199
|
-
"title": "Run
|
|
200
|
-
"desc": "
|
|
201
|
-
"lines": [
|
|
202
|
-
"anchor": "Run
|
|
203
|
-
"chips": [
|
|
204
|
-
{
|
|
205
|
-
"label": "Compliance and tests",
|
|
206
|
-
"lines": [221, 221],
|
|
207
|
-
"anchor": "Run **live-tokens-check-compliance** and address its finding"
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"label": "Svelte check and build",
|
|
211
|
-
"lines": [222, 222],
|
|
212
|
-
"anchor": "Run the project's Svelte check and its build."
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
"label": "Component tests",
|
|
216
|
-
"lines": [17, 17],
|
|
217
|
-
"anchor": "Run **live-tokens-check-compliance**, then `npx live-tokens "
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
"label": "Rule table",
|
|
221
|
-
"lines": [227, 237],
|
|
222
|
-
"anchor": "| `fix` | Section |",
|
|
223
|
-
"anchorEnd": "| `coverage` | Add the missing contract, or complete the run"
|
|
224
|
-
}
|
|
225
|
-
]
|
|
198
|
+
"kind": "cli",
|
|
199
|
+
"title": "Run check-component",
|
|
200
|
+
"desc": "check-component <id> --tests --strict --json applies every auto repair, runs the contract suites, and returns the fixes beside the remaining findings and coverage by rule.",
|
|
201
|
+
"lines": [229, 229],
|
|
202
|
+
"anchor": "Run `npx live-tokens check-component <id> --tests --strict -"
|
|
226
203
|
},
|
|
227
204
|
{
|
|
228
|
-
"id": "cc-
|
|
205
|
+
"id": "cc-repair",
|
|
229
206
|
"row": 7,
|
|
207
|
+
"kind": "gate",
|
|
208
|
+
"title": "Repair from guidance",
|
|
209
|
+
"desc": "Each remaining finding carries its guidance. Make each repair, then run check-component again until coverage is complete.",
|
|
210
|
+
"lines": [230, 230],
|
|
211
|
+
"anchor": "Each remaining finding carries a rule id, a line, and its `g"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"id": "cc-build",
|
|
215
|
+
"row": 8,
|
|
216
|
+
"kind": "step",
|
|
217
|
+
"title": "Run the Svelte check and the build",
|
|
218
|
+
"desc": "Both run once check-component exits 0.",
|
|
219
|
+
"lines": [231, 231],
|
|
220
|
+
"anchor": "Run the project's Svelte check and its build."
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"id": "cc-reply",
|
|
224
|
+
"row": 9,
|
|
230
225
|
"kind": "step",
|
|
231
226
|
"title": "Reply with the result",
|
|
232
227
|
"desc": "The files, the id, the props, and each check's result.",
|
|
@@ -235,11 +230,11 @@ export const createComponent: SkillTree = {
|
|
|
235
230
|
},
|
|
236
231
|
{
|
|
237
232
|
"id": "cc-page",
|
|
238
|
-
"row":
|
|
233
|
+
"row": 10,
|
|
239
234
|
"kind": "hand",
|
|
240
235
|
"title": "live-tokens-create-page",
|
|
241
236
|
"desc": "The component is done. Placing it on a page is the next skill.",
|
|
242
|
-
"lines": [
|
|
237
|
+
"lines": [236, 236],
|
|
243
238
|
"anchor": "Then place the component on a page with **live-tokens-create"
|
|
244
239
|
}
|
|
245
240
|
],
|
|
@@ -270,6 +265,22 @@ export const createComponent: SkillTree = {
|
|
|
270
265
|
},
|
|
271
266
|
{
|
|
272
267
|
"from": "cc-checks",
|
|
268
|
+
"to": "cc-repair",
|
|
269
|
+
"label": "findings"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"from": "cc-repair",
|
|
273
|
+
"to": "cc-checks",
|
|
274
|
+
"label": "rerun",
|
|
275
|
+
"back": true
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"from": "cc-checks",
|
|
279
|
+
"to": "cc-build",
|
|
280
|
+
"label": "exit 0"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"from": "cc-build",
|
|
273
284
|
"to": "cc-reply"
|
|
274
285
|
},
|
|
275
286
|
{
|
|
@@ -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:
|
|
5
|
+
"digest": "sha256:0d78d225ef7199e2",
|
|
6
6
|
"title": "create-page",
|
|
7
7
|
"tagline": "Create a Page Using Live Tokens",
|
|
8
8
|
"nodes": [
|
|
@@ -210,43 +210,52 @@ export const createPage: SkillTree = {
|
|
|
210
210
|
{
|
|
211
211
|
"id": "cp-check",
|
|
212
212
|
"row": 8,
|
|
213
|
-
"kind": "
|
|
214
|
-
"title": "Run
|
|
215
|
-
"desc": "
|
|
216
|
-
"lines": [
|
|
217
|
-
"anchor": "Run
|
|
213
|
+
"kind": "cli",
|
|
214
|
+
"title": "Run check-page",
|
|
215
|
+
"desc": "check-page --tests --strict --json applies every auto repair, proves the rendered page at its own route, and returns the fixes beside the remaining findings.",
|
|
216
|
+
"lines": [168, 168],
|
|
217
|
+
"anchor": "Run `npx live-tokens check-page <file> --tests --strict --js"
|
|
218
218
|
},
|
|
219
219
|
{
|
|
220
|
-
"id": "cp-
|
|
220
|
+
"id": "cp-repair",
|
|
221
221
|
"row": 9,
|
|
222
|
+
"kind": "gate",
|
|
223
|
+
"title": "Repair from guidance",
|
|
224
|
+
"desc": "Each remaining finding carries its guidance. Make each repair, then run check-page again.",
|
|
225
|
+
"lines": [170, 170],
|
|
226
|
+
"anchor": "Each remaining finding carries a rule id, a line, and its `g"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"id": "cp-verify",
|
|
230
|
+
"row": 10,
|
|
222
231
|
"kind": "chipset",
|
|
223
232
|
"title": "Check the page in the browser",
|
|
224
233
|
"desc": "The checkers cannot see a layout. Open the page at its width and check each line.",
|
|
225
|
-
"lines": [
|
|
234
|
+
"lines": [172, 188],
|
|
226
235
|
"anchor": "The checkers cannot see a layout. Open the page at the width",
|
|
227
236
|
"anchorEnd": "`references/interaction-sources.md` names the sources for th",
|
|
228
237
|
"chips": [
|
|
229
238
|
{
|
|
230
239
|
"label": "Structure",
|
|
231
|
-
"lines": [
|
|
240
|
+
"lines": [174, 178],
|
|
232
241
|
"anchor": "The first section holds what the user came for.",
|
|
233
242
|
"anchorEnd": "The containers in a section align at the bottom."
|
|
234
243
|
},
|
|
235
244
|
{
|
|
236
245
|
"label": "Actions",
|
|
237
|
-
"lines": [
|
|
246
|
+
"lines": [179, 182],
|
|
238
247
|
"anchor": "The actions sit where the eye goes last, with the one primar",
|
|
239
248
|
"anchorEnd": "An action that runs longer than a moment shows progress in a"
|
|
240
249
|
},
|
|
241
250
|
{
|
|
242
251
|
"label": "Fields",
|
|
243
|
-
"lines": [
|
|
252
|
+
"lines": [183, 184],
|
|
244
253
|
"anchor": "Every field has a default, and Reset restores it.",
|
|
245
254
|
"anchorEnd": "Secondary settings sit in a `CollapsibleSection`. Every cont"
|
|
246
255
|
},
|
|
247
256
|
{
|
|
248
257
|
"label": "Words and access",
|
|
249
|
-
"lines": [
|
|
258
|
+
"lines": [185, 186],
|
|
250
259
|
"anchor": "Labels use the user's words, such as \"Export slices\".",
|
|
251
260
|
"anchorEnd": "Every `img` has `alt` text. Focus order follows the reading "
|
|
252
261
|
}
|
|
@@ -254,19 +263,19 @@ export const createPage: SkillTree = {
|
|
|
254
263
|
},
|
|
255
264
|
{
|
|
256
265
|
"id": "cp-read",
|
|
257
|
-
"row":
|
|
266
|
+
"row": 11,
|
|
258
267
|
"kind": "step",
|
|
259
268
|
"title": "Read the page twice",
|
|
260
269
|
"desc": "From a distance only the sections show. Up close, every border and bar earns its place or goes.",
|
|
261
|
-
"lines": [
|
|
270
|
+
"lines": [190, 190],
|
|
262
271
|
"anchor": "Then read the page from a distance: the sections and their e"
|
|
263
272
|
},
|
|
264
273
|
{
|
|
265
274
|
"id": "cp-reply",
|
|
266
|
-
"row":
|
|
275
|
+
"row": 12,
|
|
267
276
|
"kind": "done",
|
|
268
277
|
"title": "Reply with the result",
|
|
269
|
-
"desc": "The sections and the layout each took, the components placed, the route, and the
|
|
278
|
+
"desc": "The sections and the layout each took, the components placed, the route, and the check-page result.",
|
|
270
279
|
"lines": [21, 21],
|
|
271
280
|
"anchor": "Reply with the sections and the layout each took, the compon"
|
|
272
281
|
}
|
|
@@ -306,7 +315,19 @@ export const createPage: SkillTree = {
|
|
|
306
315
|
},
|
|
307
316
|
{
|
|
308
317
|
"from": "cp-check",
|
|
309
|
-
"to": "cp-
|
|
318
|
+
"to": "cp-repair",
|
|
319
|
+
"label": "findings"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"from": "cp-repair",
|
|
323
|
+
"to": "cp-check",
|
|
324
|
+
"label": "rerun",
|
|
325
|
+
"back": true
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"from": "cp-check",
|
|
329
|
+
"to": "cp-verify",
|
|
330
|
+
"label": "exit 0"
|
|
310
331
|
},
|
|
311
332
|
{
|
|
312
333
|
"from": "cp-verify",
|
|
@@ -2,7 +2,7 @@ import type { SkillTree } from '../types';
|
|
|
2
2
|
|
|
3
3
|
export const pickComponent: SkillTree = {
|
|
4
4
|
"id": "live-tokens-pick-component",
|
|
5
|
-
"digest": "sha256:
|
|
5
|
+
"digest": "sha256:fa031772b2802175",
|
|
6
6
|
"title": "pick-component",
|
|
7
7
|
"tagline": "Select a component from the catalogue",
|
|
8
8
|
"nodes": [
|
|
@@ -139,7 +139,7 @@ export const pickComponent: SkillTree = {
|
|
|
139
139
|
"desc": "Use a component from the catalogue if one fits, otherwise build a new one.",
|
|
140
140
|
"lines": [92, 96],
|
|
141
141
|
"anchor": "## Nothing fits",
|
|
142
|
-
"anchorEnd": "`npx live-tokens components <id>` prints one component's
|
|
142
|
+
"anchorEnd": "`npx live-tokens components <id>` prints one component's cat",
|
|
143
143
|
"chips": [
|
|
144
144
|
{
|
|
145
145
|
"label": "shipped component",
|
|
@@ -170,7 +170,7 @@ export const pickComponent: SkillTree = {
|
|
|
170
170
|
"title": "Check the component",
|
|
171
171
|
"desc": "See the component's props and usage before placing it.",
|
|
172
172
|
"lines": [96, 96],
|
|
173
|
-
"anchor": "`npx live-tokens components <id>` prints one component's
|
|
173
|
+
"anchor": "`npx live-tokens components <id>` prints one component's cat"
|
|
174
174
|
},
|
|
175
175
|
{
|
|
176
176
|
"id": "pk-native",
|
|
@@ -2,7 +2,7 @@ import type { SkillTree } from '../types';
|
|
|
2
2
|
|
|
3
3
|
export const setGeometry: SkillTree = {
|
|
4
4
|
"id": "live-tokens-set-geometry",
|
|
5
|
-
"digest": "sha256:
|
|
5
|
+
"digest": "sha256:adba9f61a4113c03",
|
|
6
6
|
"title": "set-geometry",
|
|
7
7
|
"tagline": "Set Spacing, Corner Radius, Line Weight",
|
|
8
8
|
"nodes": [
|
|
@@ -18,11 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
/** Tokens that match the surface/fill suffix but live in <color>-only CSS contexts
|
|
20
20
|
(color-mix, box-shadow color slot) where a gradient would invalidate the declaration. */
|
|
21
|
-
const GRADIENT_DENYLIST = new Set<string>([
|
|
22
|
-
'--radiobutton-default-surface',
|
|
23
|
-
'--radiobutton-hover-surface',
|
|
24
|
-
'--radiobutton-active-surface',
|
|
25
|
-
]);
|
|
21
|
+
const GRADIENT_DENYLIST = new Set<string>([]);
|
|
26
22
|
|
|
27
23
|
/** Slot kinds where a gradient is a renderable assignment. */
|
|
28
24
|
function acceptsGradient(name: string): boolean {
|
|
@@ -135,7 +131,7 @@
|
|
|
135
131
|
|
|
136
132
|
let selector: UITokenSelector | undefined = $state();
|
|
137
133
|
let selectedFamily: string | null = $state(null);
|
|
138
|
-
let
|
|
134
|
+
let selectedCategory: Category = $state('palette');
|
|
139
135
|
|
|
140
136
|
/** Compass-rose layout for the orientation grid. Angles follow the CSS
|
|
141
137
|
* linear-gradient convention (0° points up, 90° points right). */
|
|
@@ -459,7 +455,7 @@
|
|
|
459
455
|
if (familyFilter && name !== familyFilter) return;
|
|
460
456
|
selectedFamily = name;
|
|
461
457
|
if (name === chosenFamily && chosenCategory) {
|
|
462
|
-
|
|
458
|
+
selectedCategory = chosenCategory;
|
|
463
459
|
}
|
|
464
460
|
}
|
|
465
461
|
|
|
@@ -575,8 +571,8 @@
|
|
|
575
571
|
const family = selectedFamily;
|
|
576
572
|
const tabs = availableTabs;
|
|
577
573
|
untrack(() => {
|
|
578
|
-
if (family && !tabs.find(t => t.id ===
|
|
579
|
-
|
|
574
|
+
if (family && !tabs.find(t => t.id === selectedCategory)) {
|
|
575
|
+
selectedCategory = 'palette';
|
|
580
576
|
}
|
|
581
577
|
});
|
|
582
578
|
});
|
|
@@ -674,14 +670,14 @@
|
|
|
674
670
|
{#each availableTabs as tab}
|
|
675
671
|
<button
|
|
676
672
|
class="tab-btn"
|
|
677
|
-
class:selected={
|
|
673
|
+
class:selected={selectedCategory === tab.id}
|
|
678
674
|
class:assigned={chosenCategory === tab.id && chosenFamily === selectedFamily}
|
|
679
|
-
onclick={() =>
|
|
675
|
+
onclick={() => selectedCategory = tab.id}
|
|
680
676
|
>{tab.label}</button>
|
|
681
677
|
{/each}
|
|
682
678
|
</div>
|
|
683
679
|
|
|
684
|
-
{#if
|
|
680
|
+
{#if selectedCategory === 'palette'}
|
|
685
681
|
<div class="step-grid">
|
|
686
682
|
{#each paletteSteps as step}
|
|
687
683
|
<button
|
|
@@ -694,7 +690,7 @@
|
|
|
694
690
|
</button>
|
|
695
691
|
{/each}
|
|
696
692
|
</div>
|
|
697
|
-
{:else if
|
|
693
|
+
{:else if selectedCategory === 'surface'}
|
|
698
694
|
<div class="step-grid">
|
|
699
695
|
{#each surfaceSteps as step}
|
|
700
696
|
<button
|
|
@@ -707,7 +703,7 @@
|
|
|
707
703
|
</button>
|
|
708
704
|
{/each}
|
|
709
705
|
</div>
|
|
710
|
-
{:else if
|
|
706
|
+
{:else if selectedCategory === 'border'}
|
|
711
707
|
<div class="step-grid">
|
|
712
708
|
{#each borderSteps as step}
|
|
713
709
|
<button
|
|
@@ -720,7 +716,7 @@
|
|
|
720
716
|
</button>
|
|
721
717
|
{/each}
|
|
722
718
|
</div>
|
|
723
|
-
{:else if
|
|
719
|
+
{:else if selectedCategory === 'text'}
|
|
724
720
|
<div class="step-grid">
|
|
725
721
|
{#each (selectedFamily === 'neutral' ? neutralTextSteps : textSteps) as step}
|
|
726
722
|
<button
|
|
@@ -102,10 +102,10 @@ export const SHADOW: VariantScaleEntry = {
|
|
|
102
102
|
],
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
/** Used by `*-
|
|
106
|
-
* not a dedicated
|
|
107
|
-
* can pick from larger heights (up to 100%). */
|
|
108
|
-
export const
|
|
105
|
+
/** Used by `*-track-height` variables; values come from the `--space-*` scale,
|
|
106
|
+
* not a dedicated height scale. The label-set differs from BORDER_WIDTH so a
|
|
107
|
+
* track can pick from larger heights (up to 100%). */
|
|
108
|
+
export const TRACK_HEIGHT: VariantScaleEntry = {
|
|
109
109
|
varPrefix: '--space-',
|
|
110
110
|
options: [
|
|
111
111
|
{ key: '0', label: 'None', value: '0px' },
|
|
@@ -135,12 +135,12 @@ export const DURATION: VariantScaleEntry = {
|
|
|
135
135
|
],
|
|
136
136
|
};
|
|
137
137
|
|
|
138
|
-
/** Used by `*-
|
|
139
|
-
*
|
|
140
|
-
* inset = bar-height
|
|
138
|
+
/** Used by `*-hairline-inset` variables (margin-block trimmed off a stretched
|
|
139
|
+
* hairline). Labels describe the resulting line, not the inset value: 0
|
|
140
|
+
* inset = bar-height line ("Full"); larger insets = shorter line.
|
|
141
141
|
* Replaces the percentage-height approach that collapsed to 0 in
|
|
142
142
|
* auto-height flex parents. */
|
|
143
|
-
export const
|
|
143
|
+
export const HAIRLINE_INSET: VariantScaleEntry = {
|
|
144
144
|
varPrefix: '--space-',
|
|
145
145
|
options: [
|
|
146
146
|
{ key: '0', label: 'Full', value: '0px' },
|