@motion-proto/live-tokens 0.82.0 → 0.84.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-create-component/SKILL.md +16 -4
- package/.claude/skills/live-tokens-create-page/SKILL.md +19 -17
- package/.claude/skills/live-tokens-create-page/references/interaction-sources.md +3 -3
- package/.claude/skills/live-tokens-pick-component/SKILL.md +10 -83
- package/CHANGELOG.md +84 -0
- package/README.md +1 -1
- package/bin/cli.mjs +21 -8
- package/bin/lib/catalogue.mjs +140 -41
- package/bin/rules/componentStructure.mjs +12 -4
- package/dist-plugin/{chunk-REBHE3ZM.js → chunk-FD4FVDOC.js} +59 -9
- package/dist-plugin/{chunk-D4WRIKEZ.js → chunk-M6BWSS6C.js} +1 -1
- package/dist-plugin/{chunk-RFVYPNRO.js → chunk-V2OVSC5Z.js} +22 -1
- package/dist-plugin/index.cjs +85 -14
- package/dist-plugin/index.js +3 -3
- package/dist-plugin/migrateData/index.cjs +59 -9
- package/dist-plugin/migrateData/index.js +2 -2
- package/dist-plugin/setColors/index.cjs +59 -9
- package/dist-plugin/setColors/index.js +1 -1
- package/dist-plugin/setGeometry/index.cjs +63 -11
- package/dist-plugin/setGeometry/index.d.cts +1 -1
- package/dist-plugin/setGeometry/index.d.ts +1 -1
- package/dist-plugin/setGeometry/index.js +5 -3
- package/dist-plugin/tokensCssMigrations/index.cjs +22 -1
- package/dist-plugin/tokensCssMigrations/index.js +1 -1
- package/package.json +3 -1
- package/src/editor/component-editor/DialogEditor.svelte +2 -1
- package/src/editor/component-editor/ImageLightboxEditor.svelte +2 -1
- package/src/editor/component-editor/scaffolding/TokenLayout.svelte +4 -1
- package/src/editor/component-editor/scaffolding/types.ts +13 -8
- package/src/editor/core/components/aliasKinds.ts +5 -1
- package/src/editor/core/sketch/sketchLayer.ts +1 -1
- package/src/editor/core/themes/migrations/2026-09-20-imagelightbox-scrim.ts +28 -0
- package/src/editor/core/themes/migrations/2026-09-20-scrim-color-and-opacity.ts +45 -0
- package/src/editor/core/themes/migrations/index.ts +4 -0
- package/src/editor/docs/content/creating-components.md +3 -0
- package/src/editor/docs/content.generated.ts +1 -1
- package/src/editor/skill-atlas/SkillAtlas.svelte +65 -38
- package/src/editor/skill-atlas/SkillValue.svelte +202 -0
- package/src/editor/skill-atlas/evalResults.ts +46 -0
- package/src/editor/skill-atlas/skillSources.generated.ts +4 -4
- package/src/editor/skill-atlas/trees/create-component.ts +18 -18
- package/src/editor/skill-atlas/trees/create-page.ts +28 -32
- package/src/editor/skill-atlas/trees/pick-component.ts +66 -196
- package/src/editor/ui/UIVariantSelector.svelte +1 -1
- package/src/editor/ui/variantScales.ts +11 -0
- package/src/live-tokens/data/themes/autumn.json +6 -4
- package/src/live-tokens/data/themes/halloween.json +6 -4
- package/src/live-tokens/data/themes/midnight-study.json +6 -4
- package/src/live-tokens/data/themes/ocean.json +6 -4
- package/src/live-tokens/data/themes/royal-velvet.json +6 -4
- package/src/live-tokens/data/themes/sketchy.json +6 -4
- package/src/live-tokens/data/themes/spring-meadow.json +6 -4
- package/src/live-tokens/data/themes/sunset.json +6 -4
- package/src/system/components/Badge.svelte +5 -2
- package/src/system/components/Button.svelte +10 -2
- package/src/system/components/Callout.svelte +5 -2
- package/src/system/components/Card.svelte +8 -3
- package/src/system/components/CodeSnippet.svelte +6 -2
- package/src/system/components/CollapsibleSection.svelte +6 -2
- package/src/system/components/CornerBadge.svelte +5 -2
- package/src/system/components/Dialog.svelte +12 -4
- package/src/system/components/IconButton.svelte +5 -2
- package/src/system/components/Image.svelte +5 -2
- package/src/system/components/ImageLightbox.svelte +44 -4
- package/src/system/components/InlineEditActions.svelte +5 -2
- package/src/system/components/Input.svelte +6 -2
- package/src/system/components/MenuSelect.svelte +9 -2
- package/src/system/components/Notification.svelte +5 -2
- package/src/system/components/Panel.svelte +5 -2
- package/src/system/components/ProgressBar.svelte +5 -2
- package/src/system/components/RadioButton.svelte +5 -2
- package/src/system/components/SectionDivider.svelte +5 -2
- package/src/system/components/SegmentedControl.svelte +5 -2
- package/src/system/components/SideNavigation.svelte +5 -2
- package/src/system/components/Slider.svelte +6 -2
- package/src/system/components/TabBar.svelte +5 -2
- package/src/system/components/Table.svelte +4 -2
- package/src/system/components/Toggle.svelte +5 -2
- package/src/system/components/Tooltip.svelte +5 -2
- package/src/system/styles/tokens.css +12 -4
- package/src/testing-js/{chunk-ZMZQZ33J.js → chunk-WQJ6QB6Y.js} +8 -4
- package/src/testing-js/chunk-WQJ6QB6Y.js.map +1 -0
- package/src/testing-js/{chunk-Q3YIAAG3.js → chunk-XXABJNUU.js} +2 -2
- package/src/testing-js/component-behavior.contract.js +1 -1
- package/src/testing-js/component-editor.contract.js +1 -1
- package/src/testing-js/component-render.contract.js +1 -1
- package/src/testing-js/index.js +2 -2
- package/src/testing-js/page-compliance.contract.js +1 -1
- package/src/testing-js/vitest.js +2 -2
- package/src/testing-js/chunk-ZMZQZ33J.js.map +0 -1
- /package/src/testing-js/{chunk-Q3YIAAG3.js.map → chunk-XXABJNUU.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:
|
|
5
|
+
"digest": "sha256:e9eafa612a3b863b",
|
|
6
6
|
"title": "create-page",
|
|
7
7
|
"tagline": "Create a Page Using Live Tokens",
|
|
8
8
|
"nodes": [
|
|
@@ -88,38 +88,34 @@ export const createPage: SkillTree = {
|
|
|
88
88
|
"row": 4,
|
|
89
89
|
"kind": "chipset",
|
|
90
90
|
"title": "Choose containers by purpose",
|
|
91
|
-
"desc": "
|
|
91
|
+
"desc": "Panel is a stage, Card is titled content; a component's own constraints come from the components command.",
|
|
92
92
|
"lines": [15, 15],
|
|
93
|
-
"anchor": "Give each section its container
|
|
93
|
+
"anchor": "Give each section its container. `npx live-tokens components",
|
|
94
94
|
"chips": [
|
|
95
95
|
{
|
|
96
96
|
"label": "Stage",
|
|
97
|
-
"lines": [
|
|
98
|
-
"anchor": "
|
|
99
|
-
"anchorEnd": "An empty stage shows a heading that names the condition and "
|
|
97
|
+
"lines": [81, 81],
|
|
98
|
+
"anchor": "An empty stage shows a heading that names the condition and "
|
|
100
99
|
},
|
|
101
100
|
{
|
|
102
101
|
"label": "Card",
|
|
103
|
-
"lines": [
|
|
104
|
-
"anchor": "
|
|
105
|
-
"anchorEnd": "A container in a tool UI labels itself: `Card variant=\"bare\""
|
|
102
|
+
"lines": [82, 82],
|
|
103
|
+
"anchor": "A container in a tool UI labels itself: `Card variant=\"bare\""
|
|
106
104
|
},
|
|
107
105
|
{
|
|
108
106
|
"label": "Form",
|
|
109
|
-
"lines": [
|
|
110
|
-
"anchor": "A
|
|
111
|
-
"anchorEnd": "A row of fields is a flex row with `gap: var(--space-20)`. E"
|
|
107
|
+
"lines": [83, 83],
|
|
108
|
+
"anchor": "A row of fields is a flex row with `gap: var(--space-20)`; e"
|
|
112
109
|
},
|
|
113
110
|
{
|
|
114
111
|
"label": "Buttons",
|
|
115
|
-
"lines": [
|
|
116
|
-
"anchor": "A toolbar is a flex row of Buttons on the section's bottom e"
|
|
117
|
-
"anchorEnd": "A vertical stack of Buttons sets `fullWidth` on each Button."
|
|
112
|
+
"lines": [84, 84],
|
|
113
|
+
"anchor": "A toolbar is a flex row of Buttons on the section's bottom e"
|
|
118
114
|
},
|
|
119
115
|
{
|
|
120
116
|
"label": "Picker",
|
|
121
|
-
"lines": [
|
|
122
|
-
"anchor": "`MenuSelect`
|
|
117
|
+
"lines": [85, 85],
|
|
118
|
+
"anchor": "For a `MenuSelect` picker, toggle it from a Button with a tr"
|
|
123
119
|
}
|
|
124
120
|
]
|
|
125
121
|
},
|
|
@@ -134,7 +130,7 @@ export const createPage: SkillTree = {
|
|
|
134
130
|
"chips": [
|
|
135
131
|
{
|
|
136
132
|
"label": "Components",
|
|
137
|
-
"lines": [
|
|
133
|
+
"lines": [73, 80],
|
|
138
134
|
"anchor": "## Components",
|
|
139
135
|
"anchorEnd": "Text inside a `Card` or a `CollapsibleSection` takes the con"
|
|
140
136
|
},
|
|
@@ -162,25 +158,25 @@ export const createPage: SkillTree = {
|
|
|
162
158
|
"chips": [
|
|
163
159
|
{
|
|
164
160
|
"label": "Tokens",
|
|
165
|
-
"lines": [
|
|
161
|
+
"lines": [96, 101],
|
|
166
162
|
"anchor": "## Tokens",
|
|
167
163
|
"anchorEnd": "A value that comes from data, such as a sheet's padding in p"
|
|
168
164
|
},
|
|
169
165
|
{
|
|
170
166
|
"label": "Type",
|
|
171
|
-
"lines": [
|
|
167
|
+
"lines": [105, 120],
|
|
172
168
|
"anchor": "### Type",
|
|
173
169
|
"anchorEnd": "Use the semantic element for each place: one `h1`, an `h2` f"
|
|
174
170
|
},
|
|
175
171
|
{
|
|
176
172
|
"label": "Size and emphasis",
|
|
177
|
-
"lines": [
|
|
173
|
+
"lines": [122, 130],
|
|
178
174
|
"anchor": "### Size",
|
|
179
175
|
"anchorEnd": "In a row of actions the primary sits last, on the right. Up "
|
|
180
176
|
},
|
|
181
177
|
{
|
|
182
178
|
"label": "Spacing",
|
|
183
|
-
"lines": [
|
|
179
|
+
"lines": [132, 146],
|
|
184
180
|
"anchor": "### Spacing",
|
|
185
181
|
"anchorEnd": "Every section after the first opens with a hairline: `paddin"
|
|
186
182
|
}
|
|
@@ -197,12 +193,12 @@ export const createPage: SkillTree = {
|
|
|
197
193
|
"chips": [
|
|
198
194
|
{
|
|
199
195
|
"label": "LiveTokensRouter",
|
|
200
|
-
"lines": [
|
|
196
|
+
"lines": [152, 152],
|
|
201
197
|
"anchor": "`<LiveTokensRouter pages={...}>`: add a `pages` entry with `"
|
|
202
198
|
},
|
|
203
199
|
{
|
|
204
200
|
"label": "LiveEditorOverlay",
|
|
205
|
-
"lines": [
|
|
201
|
+
"lines": [153, 153],
|
|
206
202
|
"anchor": "Manual `<LiveEditorOverlay>`: dispatch with `$derived.by(() "
|
|
207
203
|
}
|
|
208
204
|
]
|
|
@@ -213,7 +209,7 @@ export const createPage: SkillTree = {
|
|
|
213
209
|
"kind": "cli",
|
|
214
210
|
"title": "Run check-page",
|
|
215
211
|
"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": [
|
|
212
|
+
"lines": [170, 170],
|
|
217
213
|
"anchor": "Run `npx live-tokens check-page <file> --tests --strict --js"
|
|
218
214
|
},
|
|
219
215
|
{
|
|
@@ -222,7 +218,7 @@ export const createPage: SkillTree = {
|
|
|
222
218
|
"kind": "gate",
|
|
223
219
|
"title": "Repair from guidance",
|
|
224
220
|
"desc": "Each remaining finding carries its guidance. Make each repair, then run check-page again.",
|
|
225
|
-
"lines": [
|
|
221
|
+
"lines": [172, 172],
|
|
226
222
|
"anchor": "Each remaining finding carries a rule id, a line, and its `g"
|
|
227
223
|
},
|
|
228
224
|
{
|
|
@@ -231,31 +227,31 @@ export const createPage: SkillTree = {
|
|
|
231
227
|
"kind": "chipset",
|
|
232
228
|
"title": "Check the page in the browser",
|
|
233
229
|
"desc": "The checkers cannot see a layout. Open the page at its width and check each line.",
|
|
234
|
-
"lines": [
|
|
230
|
+
"lines": [174, 190],
|
|
235
231
|
"anchor": "The checkers cannot see a layout. Open the page at the width",
|
|
236
232
|
"anchorEnd": "`references/interaction-sources.md` names the sources for th",
|
|
237
233
|
"chips": [
|
|
238
234
|
{
|
|
239
235
|
"label": "Structure",
|
|
240
|
-
"lines": [
|
|
236
|
+
"lines": [176, 180],
|
|
241
237
|
"anchor": "The first section holds what the user came for.",
|
|
242
238
|
"anchorEnd": "The containers in a section align at the bottom."
|
|
243
239
|
},
|
|
244
240
|
{
|
|
245
241
|
"label": "Actions",
|
|
246
|
-
"lines": [
|
|
242
|
+
"lines": [181, 184],
|
|
247
243
|
"anchor": "The actions sit where the eye goes last, with the one primar",
|
|
248
244
|
"anchorEnd": "An action that runs longer than a moment shows progress in a"
|
|
249
245
|
},
|
|
250
246
|
{
|
|
251
247
|
"label": "Fields",
|
|
252
|
-
"lines": [
|
|
248
|
+
"lines": [185, 186],
|
|
253
249
|
"anchor": "Every field has a default, and Reset restores it.",
|
|
254
250
|
"anchorEnd": "Secondary settings sit in a `CollapsibleSection`. Every cont"
|
|
255
251
|
},
|
|
256
252
|
{
|
|
257
253
|
"label": "Words and access",
|
|
258
|
-
"lines": [
|
|
254
|
+
"lines": [187, 188],
|
|
259
255
|
"anchor": "Labels use the user's words, such as \"Export slices\".",
|
|
260
256
|
"anchorEnd": "Every `img` has `alt` text. Focus order follows the reading "
|
|
261
257
|
}
|
|
@@ -267,7 +263,7 @@ export const createPage: SkillTree = {
|
|
|
267
263
|
"kind": "step",
|
|
268
264
|
"title": "Read the page twice",
|
|
269
265
|
"desc": "From a distance only the sections show. Up close, every border and bar earns its place or goes.",
|
|
270
|
-
"lines": [
|
|
266
|
+
"lines": [192, 192],
|
|
271
267
|
"anchor": "Then read the page from a distance: the sections and their e"
|
|
272
268
|
},
|
|
273
269
|
{
|
|
@@ -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:2c4a39712f046d14",
|
|
6
6
|
"title": "pick-component",
|
|
7
7
|
"tagline": "Select a component from the catalogue",
|
|
8
8
|
"nodes": [
|
|
@@ -10,245 +10,143 @@ export const pickComponent: SkillTree = {
|
|
|
10
10
|
"id": "pk-trig",
|
|
11
11
|
"row": 0,
|
|
12
12
|
"kind": "trigger",
|
|
13
|
-
"title": "
|
|
14
|
-
"desc": "Recommends the
|
|
13
|
+
"title": "Pick a component",
|
|
14
|
+
"desc": "Recommends the component that fits a UX need, from the shipped components and the project's own.",
|
|
15
15
|
"lines": [3, 3],
|
|
16
16
|
"anchor": "description: Recommend which shipped @motion-proto/live-toke"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
"id": "pk-
|
|
19
|
+
"id": "pk-cli",
|
|
20
20
|
"row": 1,
|
|
21
|
+
"kind": "cli",
|
|
22
|
+
"title": "List the catalogue",
|
|
23
|
+
"desc": "The components command, with its JSON flag, returns every component's catalogue entry.",
|
|
24
|
+
"lines": [12, 12],
|
|
25
|
+
"anchor": "Run `npx live-tokens components --json`. The list carries th"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "pk-read",
|
|
29
|
+
"row": 2,
|
|
30
|
+
"kind": "step",
|
|
31
|
+
"title": "Read the candidates' entries",
|
|
32
|
+
"desc": "whenToUse is the condition that makes a component right. whenNotToUse lists the conditions that rule it out. constraints are its rules of use.",
|
|
33
|
+
"lines": [13, 13],
|
|
34
|
+
"anchor": "Read each plausible candidate's `whenToUse`, `whenNotToUse`,"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "pk-drop",
|
|
38
|
+
"row": 3,
|
|
21
39
|
"kind": "decide",
|
|
22
|
-
"title": "
|
|
23
|
-
"desc": "
|
|
24
|
-
"lines": [
|
|
25
|
-
"anchor": "
|
|
40
|
+
"title": "Drop what the requirement rules out",
|
|
41
|
+
"desc": "A candidate goes when one of its whenNotToUse conditions matches the requirement. A row that names a use points at the component to weigh next.",
|
|
42
|
+
"lines": [14, 15],
|
|
43
|
+
"anchor": "Drop a candidate whose `whenNotToUse` names a condition the ",
|
|
44
|
+
"anchorEnd": "When a dropped row names a `use`, weigh that component the s",
|
|
26
45
|
"chips": [
|
|
27
46
|
{
|
|
28
|
-
"label": "
|
|
29
|
-
"lines": [
|
|
30
|
-
"anchor": "
|
|
47
|
+
"label": "a dropped row names a use",
|
|
48
|
+
"lines": [15, 15],
|
|
49
|
+
"anchor": "When a dropped row names a `use`, weigh that component the s"
|
|
31
50
|
},
|
|
32
51
|
{
|
|
33
|
-
"label": "
|
|
34
|
-
"lines": [
|
|
35
|
-
"anchor": "
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"label": "Text entry",
|
|
39
|
-
"lines": [34, 34],
|
|
40
|
-
"anchor": "## Text entry"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"label": "On and off",
|
|
44
|
-
"lines": [43, 43],
|
|
45
|
-
"anchor": "## On and off"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"label": "Container family",
|
|
49
|
-
"lines": [55, 55],
|
|
50
|
-
"anchor": "## Container family"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"label": "Messaging family",
|
|
54
|
-
"lines": [68, 68],
|
|
55
|
-
"anchor": "## Messaging family"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"label": "Display family",
|
|
59
|
-
"lines": [82, 82],
|
|
60
|
-
"anchor": "## Display family"
|
|
52
|
+
"label": "surviving candidate",
|
|
53
|
+
"lines": [16, 16],
|
|
54
|
+
"anchor": "Choose the surviving candidate whose `whenToUse` condition t"
|
|
61
55
|
}
|
|
62
56
|
]
|
|
63
57
|
},
|
|
64
|
-
{
|
|
65
|
-
"id": "pk-act",
|
|
66
|
-
"row": 2,
|
|
67
|
-
"kind": "chipset",
|
|
68
|
-
"title": "Action family",
|
|
69
|
-
"desc": "Does the action need a word, a glyph, or a confirm and cancel pair.",
|
|
70
|
-
"lines": [14, 18],
|
|
71
|
-
"anchor": "## Action family",
|
|
72
|
-
"anchorEnd": "The pair that confirms or cancels an inline edit: `InlineEdi"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"id": "pk-sel",
|
|
76
|
-
"row": 2,
|
|
77
|
-
"kind": "chipset",
|
|
78
|
-
"title": "Single-selection family",
|
|
79
|
-
"desc": "How many options there are and what does the selection change.",
|
|
80
|
-
"lines": [20, 32],
|
|
81
|
-
"anchor": "## Single-selection family",
|
|
82
|
-
"anchorEnd": "The URL changes: `SideNavigation`. Sections inside one page:"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"id": "pk-text",
|
|
86
|
-
"row": 2,
|
|
87
|
-
"kind": "chipset",
|
|
88
|
-
"title": "Text entry",
|
|
89
|
-
"desc": "If the options are known, use a list or select. Anything else is an input field.",
|
|
90
|
-
"lines": [34, 41],
|
|
91
|
-
"anchor": "## Text entry",
|
|
92
|
-
"anchorEnd": "A number where the position on a track carries the meaning ("
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"id": "pk-bin",
|
|
96
|
-
"row": 2,
|
|
97
|
-
"kind": "chipset",
|
|
98
|
-
"title": "On and off",
|
|
99
|
-
"desc": "If two states have names of their own use segmented control or radio buttons.",
|
|
100
|
-
"lines": [43, 53],
|
|
101
|
-
"anchor": "## On and off",
|
|
102
|
-
"anchorEnd": "When the two states share the feature's one name, use `Toggl"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"id": "pk-con",
|
|
106
|
-
"row": 2,
|
|
107
|
-
"kind": "chipset",
|
|
108
|
-
"title": "Container family",
|
|
109
|
-
"desc": "Is the block: an item, a section, collapsed content, or a decision.",
|
|
110
|
-
"lines": [55, 66],
|
|
111
|
-
"anchor": "## Container family",
|
|
112
|
-
"anchorEnd": "A set of items is one `Card` per item. A routine form goes i"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"id": "pk-msg",
|
|
116
|
-
"row": 2,
|
|
117
|
-
"kind": "chipset",
|
|
118
|
-
"title": "Messaging family",
|
|
119
|
-
"desc": "What is the message about? What triggers it? Is it dismissable?",
|
|
120
|
-
"lines": [68, 80],
|
|
121
|
-
"anchor": "## Messaging family",
|
|
122
|
-
"anchorEnd": "`Badge` and `CornerBadge` differ in position only."
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"id": "pk-disp",
|
|
126
|
-
"row": 2,
|
|
127
|
-
"kind": "chipset",
|
|
128
|
-
"title": "Display family",
|
|
129
|
-
"desc": "Does the user view it, or interact with it?",
|
|
130
|
-
"lines": [82, 90],
|
|
131
|
-
"anchor": "## Display family",
|
|
132
|
-
"anchorEnd": "A titled break between the sections of one page: `SectionDiv"
|
|
133
|
-
},
|
|
134
58
|
{
|
|
135
59
|
"id": "pk-fits",
|
|
136
|
-
"row":
|
|
60
|
+
"row": 4,
|
|
137
61
|
"kind": "decide",
|
|
138
|
-
"title": "
|
|
139
|
-
"desc": "
|
|
140
|
-
"lines": [
|
|
141
|
-
"anchor": "
|
|
142
|
-
"anchorEnd": "
|
|
62
|
+
"title": "Choose the candidate that fits",
|
|
63
|
+
"desc": "The survivor whose whenToUse matches the requirement is the answer. With no survivor, the piece is a native element or a new component.",
|
|
64
|
+
"lines": [16, 17],
|
|
65
|
+
"anchor": "Choose the surviving candidate whose `whenToUse` condition t",
|
|
66
|
+
"anchorEnd": "When no candidate fits, follow \"Nothing fits\".",
|
|
143
67
|
"chips": [
|
|
144
68
|
{
|
|
145
|
-
"label": "
|
|
146
|
-
"lines": [
|
|
147
|
-
"anchor": "
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"label": "custom component",
|
|
151
|
-
"lines": [12, 12],
|
|
152
|
-
"anchor": "Before choosing, run `npx live-tokens components`. The list "
|
|
69
|
+
"label": "whenToUse condition the requirement meets",
|
|
70
|
+
"lines": [16, 16],
|
|
71
|
+
"anchor": "Choose the surviving candidate whose `whenToUse` condition t"
|
|
153
72
|
},
|
|
154
73
|
{
|
|
155
74
|
"label": "native element",
|
|
156
|
-
"lines": [
|
|
75
|
+
"lines": [21, 21],
|
|
157
76
|
"anchor": "A native element with no chrome of its own needs no componen"
|
|
158
77
|
},
|
|
159
78
|
{
|
|
160
79
|
"label": "nothing in the catalogue fits",
|
|
161
|
-
"lines": [
|
|
80
|
+
"lines": [21, 21],
|
|
162
81
|
"anchor": "A native element with no chrome of its own needs no componen"
|
|
163
82
|
}
|
|
164
83
|
]
|
|
165
84
|
},
|
|
166
85
|
{
|
|
167
86
|
"id": "pk-inspect",
|
|
168
|
-
"row":
|
|
87
|
+
"row": 5,
|
|
169
88
|
"kind": "cli",
|
|
170
89
|
"title": "Check the component",
|
|
171
|
-
"desc": "
|
|
172
|
-
"lines": [
|
|
90
|
+
"desc": "The components command, given the id, prints the chosen component's props and the values each accepts.",
|
|
91
|
+
"lines": [23, 23],
|
|
173
92
|
"anchor": "`npx live-tokens components <id>` prints one component's cat"
|
|
174
93
|
},
|
|
175
94
|
{
|
|
176
95
|
"id": "pk-native",
|
|
177
|
-
"row":
|
|
96
|
+
"row": 5,
|
|
178
97
|
"kind": "step",
|
|
179
98
|
"title": "Use a native element",
|
|
180
99
|
"desc": "An element with no chrome of its own needs no component.",
|
|
181
|
-
"lines": [
|
|
100
|
+
"lines": [21, 21],
|
|
182
101
|
"anchor": "A native element with no chrome of its own needs no componen"
|
|
183
102
|
},
|
|
184
103
|
{
|
|
185
104
|
"id": "pk-make",
|
|
186
|
-
"row":
|
|
105
|
+
"row": 5,
|
|
187
106
|
"kind": "hand",
|
|
188
107
|
"title": "Create a component",
|
|
189
108
|
"desc": "A piece with chrome that nothing in the catalogue fits goes to live-tokens-create-component.",
|
|
190
|
-
"lines": [
|
|
109
|
+
"lines": [21, 21],
|
|
191
110
|
"anchor": "A native element with no chrome of its own needs no componen"
|
|
192
111
|
},
|
|
193
112
|
{
|
|
194
113
|
"id": "pk-page",
|
|
195
|
-
"row":
|
|
114
|
+
"row": 6,
|
|
196
115
|
"kind": "hand",
|
|
197
116
|
"title": "Return the selected component",
|
|
198
117
|
"desc": "The named component returns to live-tokens-create-page, which owns size, emphasis, and placement.",
|
|
199
|
-
"lines": [
|
|
118
|
+
"lines": [21, 21],
|
|
200
119
|
"anchor": "A native element with no chrome of its own needs no componen"
|
|
201
120
|
}
|
|
202
121
|
],
|
|
203
122
|
"edges": [
|
|
204
123
|
{
|
|
205
|
-
"to": "pk-
|
|
124
|
+
"to": "pk-cli",
|
|
206
125
|
"from": "pk-trig"
|
|
207
126
|
},
|
|
208
127
|
{
|
|
209
|
-
"to": "pk-
|
|
210
|
-
"from": "pk-
|
|
211
|
-
"label": "Action family"
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
"to": "pk-sel",
|
|
215
|
-
"from": "pk-fam",
|
|
216
|
-
"label": "Single-selection family"
|
|
128
|
+
"to": "pk-read",
|
|
129
|
+
"from": "pk-cli"
|
|
217
130
|
},
|
|
218
131
|
{
|
|
219
|
-
"to": "pk-
|
|
220
|
-
"from": "pk-
|
|
221
|
-
"label": "Text entry"
|
|
132
|
+
"to": "pk-drop",
|
|
133
|
+
"from": "pk-read"
|
|
222
134
|
},
|
|
223
135
|
{
|
|
224
|
-
"to": "pk-
|
|
225
|
-
"from": "pk-
|
|
226
|
-
"label": "
|
|
136
|
+
"to": "pk-read",
|
|
137
|
+
"from": "pk-drop",
|
|
138
|
+
"label": "a dropped row names a use",
|
|
139
|
+
"back": true
|
|
227
140
|
},
|
|
228
141
|
{
|
|
229
|
-
"to": "pk-
|
|
230
|
-
"from": "pk-
|
|
231
|
-
"label": "
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
"to": "pk-msg",
|
|
235
|
-
"from": "pk-fam",
|
|
236
|
-
"label": "Messaging family"
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
"to": "pk-disp",
|
|
240
|
-
"from": "pk-fam",
|
|
241
|
-
"label": "Display family"
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
"to": "pk-inspect",
|
|
245
|
-
"from": "pk-fits",
|
|
246
|
-
"label": "shipped component"
|
|
142
|
+
"to": "pk-fits",
|
|
143
|
+
"from": "pk-drop",
|
|
144
|
+
"label": "surviving candidate"
|
|
247
145
|
},
|
|
248
146
|
{
|
|
249
147
|
"to": "pk-inspect",
|
|
250
148
|
"from": "pk-fits",
|
|
251
|
-
"label": "
|
|
149
|
+
"label": "whenToUse condition the requirement meets"
|
|
252
150
|
},
|
|
253
151
|
{
|
|
254
152
|
"to": "pk-native",
|
|
@@ -267,34 +165,6 @@ export const pickComponent: SkillTree = {
|
|
|
267
165
|
{
|
|
268
166
|
"to": "pk-page",
|
|
269
167
|
"from": "pk-native"
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
"to": "pk-fits",
|
|
273
|
-
"from": "pk-act"
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
"to": "pk-fits",
|
|
277
|
-
"from": "pk-sel"
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
"to": "pk-fits",
|
|
281
|
-
"from": "pk-text"
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
"to": "pk-fits",
|
|
285
|
-
"from": "pk-bin"
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
"to": "pk-fits",
|
|
289
|
-
"from": "pk-con"
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
"to": "pk-fits",
|
|
293
|
-
"from": "pk-msg"
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
"to": "pk-fits",
|
|
297
|
-
"from": "pk-disp"
|
|
298
168
|
}
|
|
299
169
|
]
|
|
300
170
|
};
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
let validKeys = $derived(new Set(options.map((o) => o.key)));
|
|
56
56
|
let refMatcher = $derived.by(() => {
|
|
57
57
|
const escaped = varPrefix.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
58
|
-
return new RegExp(`var\\((${escaped}[^)\\s]
|
|
58
|
+
return new RegExp(`var\\((${escaped}[^)\\s]*)\\)`);
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
function parseRef(value: string): string | null {
|
|
@@ -45,6 +45,17 @@ export const SCALE: VariantScaleEntry = {
|
|
|
45
45
|
],
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
/** The scrim's three strengths. The middle stop has no suffix, as `--scrim`
|
|
49
|
+
* and `--tint` have none, so its key is empty. */
|
|
50
|
+
export const SCRIM_OPACITY: VariantScaleEntry = {
|
|
51
|
+
varPrefix: '--scrim-opacity',
|
|
52
|
+
options: [
|
|
53
|
+
{ key: '-low', label: 'Low', value: '0.38' },
|
|
54
|
+
{ key: '', label: 'Medium', value: '0.51' },
|
|
55
|
+
{ key: '-high', label: 'High', value: '0.64' },
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
|
|
48
59
|
export const BORDER_WIDTH: VariantScaleEntry = {
|
|
49
60
|
varPrefix: '--border-width-',
|
|
50
61
|
options: [
|
|
@@ -2996,7 +2996,8 @@
|
|
|
2996
2996
|
"createdAt": "2026-05-10T20:05:24.719Z",
|
|
2997
2997
|
"updatedAt": "2026-08-19T22:39:32.785Z",
|
|
2998
2998
|
"aliases": {
|
|
2999
|
-
"--dialog-scrim-
|
|
2999
|
+
"--dialog-scrim-color": "--scrim-color",
|
|
3000
|
+
"--dialog-scrim-opacity": "--scrim-opacity-high",
|
|
3000
3001
|
"--dialog-surface": "--surface-neutral-lowest",
|
|
3001
3002
|
"--dialog-border": "--border-neutral-strong",
|
|
3002
3003
|
"--dialog-border-width": "--border-width-2",
|
|
@@ -3140,7 +3141,8 @@
|
|
|
3140
3141
|
"--imagelightbox-tile-border": "--color-transparent",
|
|
3141
3142
|
"--imagelightbox-tile-border-width": "--border-width-0",
|
|
3142
3143
|
"--imagelightbox-tile-shadow": "--shadow-md",
|
|
3143
|
-
"--imagelightbox-
|
|
3144
|
+
"--imagelightbox-scrim-color": "color-mix(in srgb, var(--color-neutral-950) 76%, transparent)",
|
|
3145
|
+
"--imagelightbox-scrim-opacity": "1",
|
|
3144
3146
|
"--imagelightbox-chrome-surface": "--surface-neutral-low",
|
|
3145
3147
|
"--imagelightbox-chrome-border": "--border-brand",
|
|
3146
3148
|
"--imagelightbox-chrome-border-width": "--border-width-1",
|
|
@@ -3994,5 +3996,5 @@
|
|
|
3994
3996
|
}
|
|
3995
3997
|
}
|
|
3996
3998
|
},
|
|
3997
|
-
"componentSchemaVersion":
|
|
3998
|
-
}
|
|
3999
|
+
"componentSchemaVersion": 37
|
|
4000
|
+
}
|
|
@@ -3035,7 +3035,8 @@
|
|
|
3035
3035
|
"createdAt": "2026-05-10T20:05:24.719Z",
|
|
3036
3036
|
"updatedAt": "2026-08-19T22:39:32.785Z",
|
|
3037
3037
|
"aliases": {
|
|
3038
|
-
"--dialog-scrim-
|
|
3038
|
+
"--dialog-scrim-color": "--scrim-color",
|
|
3039
|
+
"--dialog-scrim-opacity": "--scrim-opacity-high",
|
|
3039
3040
|
"--dialog-surface": "--surface-neutral-lowest",
|
|
3040
3041
|
"--dialog-border": "--border-neutral-strong",
|
|
3041
3042
|
"--dialog-border-width": "--border-width-4",
|
|
@@ -3179,7 +3180,8 @@
|
|
|
3179
3180
|
"--imagelightbox-tile-border": "--color-transparent",
|
|
3180
3181
|
"--imagelightbox-tile-border-width": "--border-width-2",
|
|
3181
3182
|
"--imagelightbox-tile-shadow": "--shadow-md",
|
|
3182
|
-
"--imagelightbox-
|
|
3183
|
+
"--imagelightbox-scrim-color": "color-mix(in srgb, var(--color-neutral-950) 76%, transparent)",
|
|
3184
|
+
"--imagelightbox-scrim-opacity": "1",
|
|
3183
3185
|
"--imagelightbox-chrome-surface": "--surface-neutral-low",
|
|
3184
3186
|
"--imagelightbox-chrome-border": "--border-brand",
|
|
3185
3187
|
"--imagelightbox-chrome-border-width": "--border-width-3",
|
|
@@ -4033,5 +4035,5 @@
|
|
|
4033
4035
|
}
|
|
4034
4036
|
}
|
|
4035
4037
|
},
|
|
4036
|
-
"componentSchemaVersion":
|
|
4037
|
-
}
|
|
4038
|
+
"componentSchemaVersion": 37
|
|
4039
|
+
}
|
|
@@ -3053,7 +3053,8 @@
|
|
|
3053
3053
|
"createdAt": "2026-05-10T20:05:24.719Z",
|
|
3054
3054
|
"updatedAt": "2026-08-19T22:39:32.785Z",
|
|
3055
3055
|
"aliases": {
|
|
3056
|
-
"--dialog-scrim-
|
|
3056
|
+
"--dialog-scrim-color": "--scrim-color",
|
|
3057
|
+
"--dialog-scrim-opacity": "--scrim-opacity-high",
|
|
3057
3058
|
"--dialog-surface": "--surface-neutral-lowest",
|
|
3058
3059
|
"--dialog-border": "--border-neutral-strong",
|
|
3059
3060
|
"--dialog-border-width": "--border-width-2",
|
|
@@ -3197,7 +3198,8 @@
|
|
|
3197
3198
|
"--imagelightbox-tile-border": "--color-transparent",
|
|
3198
3199
|
"--imagelightbox-tile-border-width": "--border-width-0",
|
|
3199
3200
|
"--imagelightbox-tile-shadow": "--shadow-md",
|
|
3200
|
-
"--imagelightbox-
|
|
3201
|
+
"--imagelightbox-scrim-color": "color-mix(in srgb, var(--color-neutral-950) 76%, transparent)",
|
|
3202
|
+
"--imagelightbox-scrim-opacity": "1",
|
|
3201
3203
|
"--imagelightbox-chrome-surface": "--surface-neutral-low",
|
|
3202
3204
|
"--imagelightbox-chrome-border": "--border-brand",
|
|
3203
3205
|
"--imagelightbox-chrome-border-width": "--border-width-1",
|
|
@@ -4052,5 +4054,5 @@
|
|
|
4052
4054
|
}
|
|
4053
4055
|
}
|
|
4054
4056
|
},
|
|
4055
|
-
"componentSchemaVersion":
|
|
4056
|
-
}
|
|
4057
|
+
"componentSchemaVersion": 37
|
|
4058
|
+
}
|