@motion-proto/live-tokens 0.74.0 → 0.76.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 +33 -38
- package/.claude/skills/live-tokens-create-component/SKILL copy.md +196 -0
- package/.claude/skills/live-tokens-create-component/SKILL.md +198 -146
- package/.claude/skills/live-tokens-create-component/references/contract-tests.md +95 -52
- package/.claude/skills/live-tokens-create-component/references/intrinsics.md +2 -2
- package/.claude/skills/live-tokens-create-component/references/linked-siblings.md +2 -2
- package/.claude/skills/live-tokens-create-component/references/sketch-mode.md +12 -12
- package/.claude/skills/live-tokens-create-component/references/token-naming.md +2 -1
- package/.claude/skills/live-tokens-create-page/SKILL.md +187 -0
- package/.claude/skills/live-tokens-create-page/references/interaction-sources.md +66 -0
- package/.claude/skills/live-tokens-create-page/references/layout-sources.md +87 -0
- package/.claude/skills/live-tokens-create-theme/SKILL.md +52 -48
- package/.claude/skills/live-tokens-create-theme/references/design-directions.md +1 -1
- package/.claude/skills/live-tokens-fix-findings/SKILL.md +69 -60
- package/.claude/skills/live-tokens-pick-component/SKILL.md +64 -79
- package/.claude/skills/live-tokens-set-colors/SKILL.md +47 -38
- package/.claude/skills/live-tokens-set-geometry/SKILL.md +58 -35
- package/.claude/skills/live-tokens-set-geometry/references/geometry-anchors.md +5 -3
- package/.claude/skills/live-tokens-set-type/SKILL.md +30 -30
- package/CHANGELOG.md +138 -0
- package/README.md +17 -7
- package/bin/check-component.mjs +91 -19
- package/bin/check-page.mjs +102 -21
- package/bin/cli.mjs +87 -113
- package/bin/contractRunner.mjs +945 -0
- package/bin/create.mjs +1 -1
- package/bin/lib/catalogue.mjs +37 -30
- package/bin/lib/findings.mjs +46 -15
- package/bin/lib/report.mjs +3 -3
- package/bin/lib/tokenVocabulary.mjs +4 -4
- package/bin/migrate-routes.mjs +5 -5
- package/bin/migrate.mjs +4 -4
- package/bin/save-theme.mjs +8 -9
- package/bin/set-colors.mjs +9 -11
- package/bin/set-geometry.mjs +7 -7
- package/bin/set-type.mjs +5 -7
- package/bin/setup-claude.mjs +110 -0
- package/dist-plugin/{chunk-W6Y4BWFB.js → chunk-6WGFOJXO.js} +22 -0
- package/dist-plugin/{chunk-7VRTBGJT.js → chunk-PDNL4NC5.js} +9 -2
- package/dist-plugin/{chunk-V3YF6CGT.js → chunk-SWXRVZKT.js} +43 -1
- package/dist-plugin/{dataPaths-BhWzd5cL.d.cts → dataPaths-BpIK_Obx.d.cts} +1 -0
- package/dist-plugin/{dataPaths-BhWzd5cL.d.ts → dataPaths-BpIK_Obx.d.ts} +1 -0
- package/dist-plugin/index.cjs +310 -147
- package/dist-plugin/index.d.cts +1 -1
- package/dist-plugin/index.d.ts +1 -1
- package/dist-plugin/index.js +218 -122
- package/dist-plugin/migrateData/index.cjs +66 -2
- package/dist-plugin/migrateData/index.d.cts +1 -1
- package/dist-plugin/migrateData/index.d.ts +1 -1
- package/dist-plugin/migrateData/index.js +3 -3
- package/dist-plugin/setColors/index.cjs +61 -4
- package/dist-plugin/setColors/index.d.cts +1 -1
- package/dist-plugin/setColors/index.d.ts +1 -1
- package/dist-plugin/setColors/index.js +5 -5
- package/dist-plugin/setGeometry/index.cjs +107 -44
- package/dist-plugin/setGeometry/index.d.cts +5 -5
- package/dist-plugin/setGeometry/index.d.ts +5 -5
- package/dist-plugin/setGeometry/index.js +51 -45
- package/dist-plugin/setType/index.cjs +15 -0
- package/dist-plugin/setType/index.d.cts +1 -1
- package/dist-plugin/setType/index.d.ts +1 -1
- package/dist-plugin/setType/index.js +1 -1
- package/dist-plugin/tokensCssMigrations/index.d.cts +1 -1
- package/dist-plugin/tokensCssMigrations/index.d.ts +1 -1
- package/dist-plugin/tokensCssMigrations/index.js +1 -1
- package/package.json +35 -8
- package/src/app/site.css +19 -9
- package/src/editor/bootstrap.ts +2 -0
- package/src/editor/component-editor/CollapsibleSectionEditor.svelte +4 -4
- package/src/editor/component-editor/DialogEditor.svelte +4 -4
- package/src/editor/component-editor/MenuSelectEditor.svelte +4 -1
- package/src/editor/component-editor/SegmentedControlEditor.svelte +6 -1
- package/src/editor/component-editor/TabBarEditor.svelte +1 -1
- package/src/editor/component-editor/TableEditor.svelte +2 -2
- package/src/editor/component-editor/scaffolding/TokenLayout.svelte +6 -3
- package/src/editor/component-editor/scaffolding/VariantGroup.svelte +41 -20
- package/src/editor/core/components/adjustAliases.ts +59 -45
- package/src/editor/core/components/aliasKinds.ts +9 -5
- package/src/editor/core/preview/themePreview.ts +9 -2
- package/src/editor/core/sketch/sketchLayer.ts +22 -0
- package/src/editor/core/store/editorStore.ts +10 -1
- package/src/editor/core/themes/buildColors.ts +3 -3
- package/src/editor/core/themes/liveStateStream.ts +26 -0
- package/src/editor/core/themes/migrations/2026-09-07-stroke-role-renames.ts +52 -0
- package/src/editor/core/themes/migrations/index.ts +2 -0
- package/src/editor/core/themes/themeDocumentSync.ts +22 -11
- package/src/editor/core/themes/themeService.ts +9 -2
- package/src/editor/pages/ComponentEditorPage.svelte +17 -1
- package/src/editor/pages/liveTokensEditorHandle.ts +23 -0
- package/src/editor/skill-atlas/SkillAtlas.svelte +75 -573
- package/src/editor/skill-atlas/TreeCanvas.svelte +263 -0
- package/src/editor/skill-atlas/TreeNodeCard.svelte +136 -53
- package/src/editor/skill-atlas/edges.ts +31 -0
- package/src/editor/skill-atlas/skillSources.generated.ts +20 -19
- package/src/editor/skill-atlas/skillTrees.ts +19 -3840
- package/src/editor/skill-atlas/trees/check-compliance.ts +183 -0
- package/src/editor/skill-atlas/trees/create-component.ts +275 -0
- package/src/editor/skill-atlas/trees/create-page.ts +320 -0
- package/src/editor/skill-atlas/trees/create-theme.ts +255 -0
- package/src/editor/skill-atlas/trees/fix-findings.ts +469 -0
- package/src/editor/skill-atlas/trees/pick-component.ts +300 -0
- package/src/editor/skill-atlas/trees/set-colors.ts +148 -0
- package/src/editor/skill-atlas/trees/set-geometry.ts +136 -0
- package/src/editor/skill-atlas/trees/set-type.ts +142 -0
- package/src/editor/skill-atlas/types.ts +3 -4
- package/src/editor/skill-atlas/wireLayout.ts +287 -0
- package/src/live-tokens/data/themes/autumn.json +15 -15
- package/src/live-tokens/data/themes/halloween.json +15 -15
- package/src/live-tokens/data/themes/midnight-study.json +15 -15
- package/src/live-tokens/data/themes/ocean.json +15 -15
- package/src/live-tokens/data/themes/royal-velvet.json +15 -15
- package/src/live-tokens/data/themes/sketchy.json +15 -15
- package/src/live-tokens/data/themes/spring-meadow.json +15 -15
- package/src/live-tokens/data/themes/sunset.json +15 -15
- package/src/system/components/Badge.svelte +7 -0
- package/src/system/components/Button.svelte +7 -0
- package/src/system/components/Callout.svelte +10 -6
- package/src/system/components/Card.svelte +23 -4
- package/src/system/components/CodeSnippet.svelte +4 -3
- package/src/system/components/CollapsibleSection.svelte +23 -8
- package/src/system/components/CornerBadge.svelte +6 -0
- package/src/system/components/Dialog.svelte +13 -6
- package/src/system/components/IconButton.svelte +9 -0
- package/src/system/components/Image.svelte +8 -0
- package/src/system/components/ImageLightbox.svelte +6 -0
- package/src/system/components/InlineEditActions.svelte +7 -0
- package/src/system/components/Input.svelte +7 -0
- package/src/system/components/MenuSelect.svelte +7 -0
- package/src/system/components/Notification.svelte +7 -0
- package/src/system/components/Panel.svelte +6 -0
- package/src/system/components/ProgressBar.svelte +5 -0
- package/src/system/components/RadioButton.svelte +11 -5
- package/src/system/components/SectionDivider.svelte +8 -0
- package/src/system/components/SegmentedControl.svelte +6 -0
- package/src/system/components/SideNavigation.svelte +6 -0
- package/src/system/components/Slider.svelte +7 -4
- package/src/system/components/TabBar.svelte +15 -9
- package/src/system/components/Table.svelte +8 -3
- package/src/system/components/Toggle.svelte +4 -4
- package/src/system/components/Tooltip.svelte +6 -0
- package/src/testing-js/chunk-AO7EZHYV.js +776 -0
- package/src/testing-js/chunk-AO7EZHYV.js.map +1 -0
- package/src/testing-js/chunk-FAFOAWYL.js +39 -0
- package/src/testing-js/chunk-FAFOAWYL.js.map +1 -0
- package/src/testing-js/chunk-L73N4NSO.js +23 -0
- package/src/testing-js/chunk-L73N4NSO.js.map +1 -0
- package/src/testing-js/chunk-LXR3MN6N.js +3063 -0
- package/src/testing-js/chunk-LXR3MN6N.js.map +1 -0
- package/src/testing-js/chunk-ZMSX6CXR.js +53 -0
- package/src/testing-js/chunk-ZMSX6CXR.js.map +1 -0
- package/src/testing-js/component-alias.contract.js +81 -0
- package/src/testing-js/component-alias.contract.js.map +1 -0
- package/src/testing-js/component-editor.contract.js +62 -0
- package/src/testing-js/component-editor.contract.js.map +1 -0
- package/src/testing-js/component-render.contract.js +568 -0
- package/src/testing-js/component-render.contract.js.map +1 -0
- package/src/testing-js/index.d.ts +293 -0
- package/src/testing-js/index.js +222 -0
- package/src/testing-js/index.js.map +1 -0
- package/src/testing-js/registry.contract.js +39 -0
- package/src/testing-js/registry.contract.js.map +1 -0
- package/src/testing-js/vitest-BE6uGF31.d.ts +73 -0
- package/src/testing-js/vitest.d.ts +3 -0
- package/src/testing-js/vitest.js +13 -0
- package/src/testing-js/vitest.js.map +1 -0
- package/template/README.md +13 -0
- package/template/_gitignore +6 -0
- package/template/package.json +3 -1
- package/template/src/pages/Home.svelte +4 -18
- package/.claude/skills/live-tokens-build-page/SKILL.md +0 -103
- package/.claude/skills/live-tokens-build-page/references/layout-sources.md +0 -48
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { SkillTree } from '../types';
|
|
2
|
+
|
|
3
|
+
export const checkCompliance: SkillTree = {
|
|
4
|
+
"id": "live-tokens-check-compliance",
|
|
5
|
+
"digest": "sha256:63b3e0e064051940",
|
|
6
|
+
"title": "check-compliance",
|
|
7
|
+
"tagline": "Check to Ensure Live Tokens Is Used",
|
|
8
|
+
"nodes": [
|
|
9
|
+
{
|
|
10
|
+
"id": "cc2-trig",
|
|
11
|
+
"row": 0,
|
|
12
|
+
"kind": "trigger",
|
|
13
|
+
"title": "Review design-system compliance",
|
|
14
|
+
"desc": "Checks for correct use of components, properties, and tokens.",
|
|
15
|
+
"lines": [3, 3],
|
|
16
|
+
"anchor": "description: Report an existing project's adherence to @moti"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "cc2-run",
|
|
20
|
+
"row": 1,
|
|
21
|
+
"kind": "cli",
|
|
22
|
+
"title": "Generate the compliance report",
|
|
23
|
+
"desc": "Provides a report of fixes for the fix-findings skill",
|
|
24
|
+
"lines": [8, 8],
|
|
25
|
+
"anchor": "Run `npx live-tokens report`. The CLI prints a report with t"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "cc2-sections",
|
|
29
|
+
"row": 2,
|
|
30
|
+
"kind": "chipset",
|
|
31
|
+
"title": "Read the report sections",
|
|
32
|
+
"desc": "Fixes in the report are listed by section.",
|
|
33
|
+
"lines": [17, 17],
|
|
34
|
+
"anchor": "Read each section of the report with the Report sections tab",
|
|
35
|
+
"chips": [
|
|
36
|
+
{
|
|
37
|
+
"label": "Pending token migrations",
|
|
38
|
+
"lines": [30, 30],
|
|
39
|
+
"anchor": "| Pending token migrations (`migrations`) | Whether `tokens."
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"label": "Checker findings by rule",
|
|
43
|
+
"lines": [31, 31],
|
|
44
|
+
"anchor": "| Checker findings by rule (`findings.pages`, `findings.comp"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"label": "Tokens a component never reads",
|
|
48
|
+
"lines": [32, 32],
|
|
49
|
+
"anchor": "| Tokens a component never reads (`components[].unread`) | T"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"label": "Component registration",
|
|
53
|
+
"lines": [33, 33],
|
|
54
|
+
"anchor": "| Component registration (`components[].registered`) | Wheth"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"label": "Component usage comment",
|
|
58
|
+
"lines": [34, 34],
|
|
59
|
+
"anchor": "| Component usage comment (`components[].described`) | Wheth"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"label": "Components each page renders",
|
|
63
|
+
"lines": [35, 35],
|
|
64
|
+
"anchor": "| Components each page renders (`usage.byPage`) | Which comp"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"label": "Shipped components no page renders",
|
|
68
|
+
"lines": [36, 36],
|
|
69
|
+
"anchor": "| Shipped components no page renders (`usage.unusedShipped`)"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"label": "Project components unregistered or unused",
|
|
73
|
+
"lines": [37, 37],
|
|
74
|
+
"anchor": "| Project components unregistered or unused (`usage.customUn"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "cc2-drill-q",
|
|
80
|
+
"row": 3,
|
|
81
|
+
"kind": "decide",
|
|
82
|
+
"title": "Get details",
|
|
83
|
+
"desc": "A finding may need more about one component or one token scale, such as space or color.",
|
|
84
|
+
"lines": [18, 18],
|
|
85
|
+
"anchor": "When a finding needs component or token scale details, run t",
|
|
86
|
+
"chips": [
|
|
87
|
+
{
|
|
88
|
+
"label": "component",
|
|
89
|
+
"lines": [24, 24],
|
|
90
|
+
"anchor": "For one component, run `npx live-tokens components <id>`. Fo"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"label": "token scale",
|
|
94
|
+
"lines": [24, 24],
|
|
95
|
+
"anchor": "For one component, run `npx live-tokens components <id>`. Fo"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"label": "continue with classification",
|
|
99
|
+
"lines": [19, 19],
|
|
100
|
+
"anchor": "Classify each finding as Mechanical, Judgement, or Deliberat"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "cc2-component",
|
|
106
|
+
"row": 4,
|
|
107
|
+
"kind": "cli",
|
|
108
|
+
"title": "Inspect the component",
|
|
109
|
+
"desc": "Shows one component's props and usage.",
|
|
110
|
+
"lines": [24, 24],
|
|
111
|
+
"anchor": "For one component, run `npx live-tokens components <id>`. Fo"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "cc2-scale",
|
|
115
|
+
"row": 4,
|
|
116
|
+
"kind": "cli",
|
|
117
|
+
"title": "Inspect the token scale",
|
|
118
|
+
"desc": "Shows every token in one scale, such as space or color, with its value.",
|
|
119
|
+
"lines": [24, 24],
|
|
120
|
+
"anchor": "For one component, run `npx live-tokens components <id>`. Fo"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"id": "cc2-classify",
|
|
124
|
+
"row": 6,
|
|
125
|
+
"kind": "chipset",
|
|
126
|
+
"title": "Classify the findings",
|
|
127
|
+
"desc": "Mechanical maps a value to an existing token.\nJudgement asks the user to decide.\nDeliberate records a decision the project made.",
|
|
128
|
+
"lines": [19, 19],
|
|
129
|
+
"anchor": "Classify each finding as Mechanical, Judgement, or Deliberat"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"id": "cc2-handoff",
|
|
133
|
+
"row": 7,
|
|
134
|
+
"kind": "hand",
|
|
135
|
+
"title": "live-tokens-fix-findings",
|
|
136
|
+
"desc": "Reply with the findings and the fixes, in the order the repair skill takes them, and hand it the list.",
|
|
137
|
+
"lines": [20, 22],
|
|
138
|
+
"anchor": "Reply with the findings of each section in the table's order",
|
|
139
|
+
"anchorEnd": "End with the hand-off: run **live-tokens-fix-findings** on t"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"edges": [
|
|
143
|
+
{
|
|
144
|
+
"to": "cc2-run",
|
|
145
|
+
"from": "cc2-trig"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"to": "cc2-sections",
|
|
149
|
+
"from": "cc2-run"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"to": "cc2-drill-q",
|
|
153
|
+
"from": "cc2-sections"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"to": "cc2-component",
|
|
157
|
+
"from": "cc2-drill-q",
|
|
158
|
+
"label": "component"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"to": "cc2-scale",
|
|
162
|
+
"from": "cc2-drill-q",
|
|
163
|
+
"label": "token scale"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"to": "cc2-classify",
|
|
167
|
+
"from": "cc2-drill-q",
|
|
168
|
+
"label": "continue with classification"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"to": "cc2-classify",
|
|
172
|
+
"from": "cc2-component"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"to": "cc2-classify",
|
|
176
|
+
"from": "cc2-scale"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"to": "cc2-handoff",
|
|
180
|
+
"from": "cc2-classify"
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
};
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import type { SkillTree } from '../types';
|
|
2
|
+
|
|
3
|
+
export const createComponent: SkillTree = {
|
|
4
|
+
"id": "live-tokens-create-component",
|
|
5
|
+
"digest": "sha256:b923ee9c68cc13fc",
|
|
6
|
+
"title": "create-component",
|
|
7
|
+
"tagline": "Create a LiveTokens Component",
|
|
8
|
+
"nodes": [
|
|
9
|
+
{
|
|
10
|
+
"id": "cc-trig",
|
|
11
|
+
"row": 0,
|
|
12
|
+
"kind": "trigger",
|
|
13
|
+
"title": "Create component",
|
|
14
|
+
"desc": "Makes a component. Every editable value is a semantic property assigned a design token.",
|
|
15
|
+
"lines": [3, 3],
|
|
16
|
+
"anchor": "description: Create an editable component for a @motion-prot"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "cc-project",
|
|
20
|
+
"row": 1,
|
|
21
|
+
"kind": "chipset",
|
|
22
|
+
"title": "Read the project",
|
|
23
|
+
"desc": "Determine the existing context.",
|
|
24
|
+
"lines": [12, 12],
|
|
25
|
+
"anchor": "Read the project: `package.json`, `live-tokens.config.json`,",
|
|
26
|
+
"chips": [
|
|
27
|
+
{
|
|
28
|
+
"label": "Config",
|
|
29
|
+
"lines": [41, 41],
|
|
30
|
+
"anchor": "Read the project's `package.json`, `live-tokens.config.json`"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"label": "Catalogue",
|
|
34
|
+
"lines": [42, 42],
|
|
35
|
+
"anchor": "Run `npx live-tokens components`. The list holds every compo"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"label": "Token scales",
|
|
39
|
+
"lines": [43, 43],
|
|
40
|
+
"anchor": "Run `npx live-tokens tokens --scale <name>` for each token s"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"label": "Shipped pair",
|
|
44
|
+
"lines": [44, 44],
|
|
45
|
+
"anchor": "Read a shipped runtime and editor pair: `Toggle` for interac"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"label": "Suffixes",
|
|
49
|
+
"lines": [45, 45],
|
|
50
|
+
"anchor": "Read `references/token-naming.md` for the suffixes that sele"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"id": "cc-design",
|
|
56
|
+
"row": 2,
|
|
57
|
+
"kind": "chipset",
|
|
58
|
+
"title": "Design the Component",
|
|
59
|
+
"desc": "Separate the parts, variants, and states.",
|
|
60
|
+
"lines": [13, 13],
|
|
61
|
+
"anchor": "Design the properties: separate the component's parts, varia",
|
|
62
|
+
"chips": [
|
|
63
|
+
{
|
|
64
|
+
"label": "Design model",
|
|
65
|
+
"lines": [20, 35],
|
|
66
|
+
"anchor": "## Design model",
|
|
67
|
+
"anchorEnd": "Props carry content and behavior: a value, a label, a callba"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"label": "Parts, variants, and states",
|
|
71
|
+
"lines": [49, 65],
|
|
72
|
+
"anchor": "## Variants and states",
|
|
73
|
+
"anchorEnd": "A component supplies its variants. The page chooses the one "
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"label": "Property map",
|
|
77
|
+
"lines": [69, 82],
|
|
78
|
+
"anchor": "Before writing a file, identify the component's parts, text ",
|
|
79
|
+
"anchorEnd": "Assign from the tokens the project has. Match the token scal"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"label": "Name shape",
|
|
83
|
+
"lines": [84, 96],
|
|
84
|
+
"anchor": "A property name starts with the component id and ends with t",
|
|
85
|
+
"anchorEnd": "For a state that affects several parts, follow Toggle: `--to"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"label": "Shipped role names",
|
|
89
|
+
"lines": [98, 98],
|
|
90
|
+
"anchor": "Name a role as the shipped component that paints the same th"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "cc-runtime",
|
|
96
|
+
"row": 3,
|
|
97
|
+
"kind": "chipset",
|
|
98
|
+
"title": "Write the component runtime ",
|
|
99
|
+
"desc": "Start with the usage comment. Declare every property with its token, and read it in the CSS.",
|
|
100
|
+
"lines": [14, 14],
|
|
101
|
+
"anchor": "Write the runtime file: the usage comment and the `:global(:",
|
|
102
|
+
"chips": [
|
|
103
|
+
{
|
|
104
|
+
"label": "Usage comment",
|
|
105
|
+
"lines": [104, 111],
|
|
106
|
+
"anchor": "Open the file with an HTML comment in the shape every shippe",
|
|
107
|
+
"anchorEnd": "-->"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"label": "Root block",
|
|
111
|
+
"lines": [114, 142],
|
|
112
|
+
"anchor": "Declare every editable property in a literal `:global(:root)",
|
|
113
|
+
"anchorEnd": "The excerpt shows the chain for part of the property map. Ev"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"label": "Intrinsics",
|
|
117
|
+
"lines": [142, 142],
|
|
118
|
+
"anchor": "The excerpt shows the chain for part of the property map. Ev"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"label": "Sketch mode",
|
|
122
|
+
"lines": [215, 215],
|
|
123
|
+
"anchor": "Every component joins the sketch layer: read `references/ske"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"label": "Fixed overlays",
|
|
127
|
+
"lines": [217, 217],
|
|
128
|
+
"anchor": "A fixed overlay portals to `<body>`: read `references/fixed-"
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"id": "cc-editor",
|
|
134
|
+
"row": 4,
|
|
135
|
+
"kind": "chipset",
|
|
136
|
+
"title": "Write the component editor",
|
|
137
|
+
"desc": "Show semantic properties and token assignment. Link properties that are shared across states or variants.",
|
|
138
|
+
"lines": [15, 15],
|
|
139
|
+
"anchor": "Write the editor file: the schema, the preview props, and th",
|
|
140
|
+
"chips": [
|
|
141
|
+
{
|
|
142
|
+
"label": "Schema",
|
|
143
|
+
"lines": [148, 148],
|
|
144
|
+
"anchor": "A `<script module>` block exports `component`, the id, and `"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"label": "Preview props",
|
|
148
|
+
"lines": [149, 149],
|
|
149
|
+
"anchor": "The instance script imports the runtime component and the ed"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"label": "Markup",
|
|
153
|
+
"lines": [150, 150],
|
|
154
|
+
"anchor": "The markup mounts `ComponentEditorBase` with one `VariantGro"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"label": "Linked siblings",
|
|
158
|
+
"lines": [186, 186],
|
|
159
|
+
"anchor": "When variants share a value, read `references/linked-sibling"
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "cc-register",
|
|
165
|
+
"row": 5,
|
|
166
|
+
"kind": "chipset",
|
|
167
|
+
"title": "Register the component",
|
|
168
|
+
"desc": "Register it in the shared module main.ts and live-tokens.testing.ts both name, so check-component --tests can see it.",
|
|
169
|
+
"lines": [16, 16],
|
|
170
|
+
"anchor": "Register the component in the module `src/main.ts` and `live",
|
|
171
|
+
"chips": [
|
|
172
|
+
{
|
|
173
|
+
"label": "Shared module",
|
|
174
|
+
"lines": [190, 204],
|
|
175
|
+
"anchor": "Register the component in `src/registerComponents.ts`, a reg",
|
|
176
|
+
"anchorEnd": "});"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"label": "Import and name it",
|
|
180
|
+
"lines": [207, 207],
|
|
181
|
+
"anchor": "Import the module from `src/main.ts`, before `bootLiveTokens"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"label": "First-party",
|
|
185
|
+
"lines": [211, 211],
|
|
186
|
+
"anchor": "Inside the live-tokens repository, a first-party component k"
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"id": "cc-checks",
|
|
192
|
+
"row": 6,
|
|
193
|
+
"kind": "chipset",
|
|
194
|
+
"title": "Run the checks",
|
|
195
|
+
"desc": "Get a report from check-compliance, then run check-component --tests until it passes.",
|
|
196
|
+
"lines": [17, 17],
|
|
197
|
+
"anchor": "Run **live-tokens-check-compliance**, then `npx live-tokens ",
|
|
198
|
+
"chips": [
|
|
199
|
+
{
|
|
200
|
+
"label": "Compliance and tests",
|
|
201
|
+
"lines": [221, 221],
|
|
202
|
+
"anchor": "Run **live-tokens-check-compliance** and address its finding"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"label": "Svelte check and build",
|
|
206
|
+
"lines": [222, 222],
|
|
207
|
+
"anchor": "Run the project's Svelte check and its build."
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"label": "Component tests",
|
|
211
|
+
"lines": [17, 17],
|
|
212
|
+
"anchor": "Run **live-tokens-check-compliance**, then `npx live-tokens "
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"label": "Rule table",
|
|
216
|
+
"lines": [227, 237],
|
|
217
|
+
"anchor": "| `fix` | Section |",
|
|
218
|
+
"anchorEnd": "| `coverage` | Add the missing contract, or complete the run"
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"id": "cc-reply",
|
|
224
|
+
"row": 7,
|
|
225
|
+
"kind": "step",
|
|
226
|
+
"title": "Reply with the result",
|
|
227
|
+
"desc": "The files, the id, the props, and each check's result.",
|
|
228
|
+
"lines": [18, 18],
|
|
229
|
+
"anchor": "Reply with the files, the id, the props, and each check's re"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"id": "cc-page",
|
|
233
|
+
"row": 8,
|
|
234
|
+
"kind": "hand",
|
|
235
|
+
"title": "live-tokens-create-page",
|
|
236
|
+
"desc": "The component is done. Placing it on a page is the next skill.",
|
|
237
|
+
"lines": [241, 241],
|
|
238
|
+
"anchor": "Then place the component on a page with **live-tokens-create"
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
"edges": [
|
|
242
|
+
{
|
|
243
|
+
"from": "cc-trig",
|
|
244
|
+
"to": "cc-project"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"from": "cc-project",
|
|
248
|
+
"to": "cc-design"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"from": "cc-design",
|
|
252
|
+
"to": "cc-runtime"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"from": "cc-runtime",
|
|
256
|
+
"to": "cc-editor"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"from": "cc-editor",
|
|
260
|
+
"to": "cc-register"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"from": "cc-register",
|
|
264
|
+
"to": "cc-checks"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"from": "cc-checks",
|
|
268
|
+
"to": "cc-reply"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"from": "cc-reply",
|
|
272
|
+
"to": "cc-page"
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
};
|