@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
|
@@ -37,7 +37,7 @@ export const componentRules = {
|
|
|
37
37
|
severity: 'warn',
|
|
38
38
|
repair: 'authored',
|
|
39
39
|
guidance:
|
|
40
|
-
"Add the catalogue export to the runtime's <script module> block, with description,
|
|
40
|
+
"Add the catalogue export to the runtime's <script module> block, with description and whenToUse as string literals, and whenNotToUse as an array of { when, use? } rows: `when` names the condition that rules this component out, and `use` names the sibling component id that fits instead. A row with no sibling to name takes no `use`. A component with no disqualifying condition takes `whenNotToUse: []`. An optional constraints array states each rule of use as one sentence. The message names the field that is missing or malformed, and `npx live-tokens components <id>` prints the entry once it is there.",
|
|
41
41
|
},
|
|
42
42
|
'state-after-property': {
|
|
43
43
|
severity: 'error',
|
|
@@ -111,21 +111,29 @@ export function checkFiles({ root, runtimePath, editorPath }, record) {
|
|
|
111
111
|
return { editorMissing, runtimeMissing };
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
export function checkRuntime({ id, Id, root, runtimePath, runtime, blocks, intrinsic }, record) {
|
|
114
|
+
export function checkRuntime({ id, Id, root, runtimePath, runtime, blocks, intrinsic, vocab }, record) {
|
|
115
115
|
// Runtime: the file exports the `catalogue` that says what the component
|
|
116
116
|
// is for. Without it the component is pickable but unexplained.
|
|
117
117
|
const catalogue = catalogueOf(runtime);
|
|
118
118
|
if (!catalogue) {
|
|
119
119
|
record(
|
|
120
120
|
'missing-description',
|
|
121
|
-
`${relative(root, runtimePath)}: has no catalogue export. Say what ${Id} is for
|
|
121
|
+
`${relative(root, runtimePath)}: has no catalogue export. Say what ${Id} is for and when not to use it`,
|
|
122
122
|
);
|
|
123
123
|
} else {
|
|
124
|
-
for (const requiredField of ['description', '
|
|
124
|
+
for (const requiredField of ['description', 'whenToUse', 'whenNotToUse']) {
|
|
125
125
|
if (!catalogue[requiredField]) {
|
|
126
126
|
record('missing-description', `${relative(root, runtimePath)}: catalogue has no ${requiredField}`);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
+
for (const row of catalogue.whenNotToUse ?? []) {
|
|
130
|
+
if (row.use && !vocab.components.has(row.use)) {
|
|
131
|
+
record(
|
|
132
|
+
'missing-description',
|
|
133
|
+
`${relative(root, runtimePath)}: catalogue whenNotToUse names "${row.use}", which is not a component id`,
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
// Runtime: :global(:root) block present.
|
|
@@ -1176,8 +1176,56 @@ var componentMigration_2026_09_13_sectiondividerSurface = {
|
|
|
1176
1176
|
}
|
|
1177
1177
|
};
|
|
1178
1178
|
|
|
1179
|
-
// src/editor/core/themes/migrations/2026-09-
|
|
1179
|
+
// src/editor/core/themes/migrations/2026-09-20-imagelightbox-scrim.ts
|
|
1180
1180
|
var RENAMES7 = {
|
|
1181
|
+
"--imagelightbox-overlay-surface": "--imagelightbox-scrim-surface"
|
|
1182
|
+
};
|
|
1183
|
+
var componentMigration_2026_09_20_imagelightboxScrim = {
|
|
1184
|
+
id: "2026-09-20-imagelightbox-scrim",
|
|
1185
|
+
fromVersion: 35,
|
|
1186
|
+
toVersion: 36,
|
|
1187
|
+
appliesTo: "component-config",
|
|
1188
|
+
apply(rawVars, meta) {
|
|
1189
|
+
if (meta.component !== "imagelightbox") return { ...rawVars };
|
|
1190
|
+
const out = {};
|
|
1191
|
+
for (const [key, value] of Object.entries(rawVars)) {
|
|
1192
|
+
out[RENAMES7[key] ?? key] = value;
|
|
1193
|
+
}
|
|
1194
|
+
return out;
|
|
1195
|
+
}
|
|
1196
|
+
};
|
|
1197
|
+
|
|
1198
|
+
// src/editor/core/themes/migrations/2026-09-20-scrim-color-and-opacity.ts
|
|
1199
|
+
var STOPS = {
|
|
1200
|
+
"--scrim-low": "--scrim-opacity-low",
|
|
1201
|
+
"--scrim": "--scrim-opacity",
|
|
1202
|
+
"--scrim-high": "--scrim-opacity-high"
|
|
1203
|
+
};
|
|
1204
|
+
var SURFACE = /^--(imagelightbox|dialog)-scrim-surface$/;
|
|
1205
|
+
var componentMigration_2026_09_20_scrimColorAndOpacity = {
|
|
1206
|
+
id: "2026-09-20-scrim-color-and-opacity",
|
|
1207
|
+
fromVersion: 36,
|
|
1208
|
+
toVersion: 37,
|
|
1209
|
+
appliesTo: "component-config",
|
|
1210
|
+
apply(rawVars) {
|
|
1211
|
+
const out = {};
|
|
1212
|
+
for (const [key, value] of Object.entries(rawVars)) {
|
|
1213
|
+
const match = SURFACE.exec(key);
|
|
1214
|
+
if (!match) {
|
|
1215
|
+
out[key] = value;
|
|
1216
|
+
continue;
|
|
1217
|
+
}
|
|
1218
|
+
const stem = `--${match[1]}-scrim`;
|
|
1219
|
+
const stop = STOPS[value];
|
|
1220
|
+
out[`${stem}-color`] = stop ? "--scrim-color" : value;
|
|
1221
|
+
out[`${stem}-opacity`] = stop ?? "1";
|
|
1222
|
+
}
|
|
1223
|
+
return out;
|
|
1224
|
+
}
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1227
|
+
// src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts
|
|
1228
|
+
var RENAMES8 = {
|
|
1181
1229
|
cornerbadge: {
|
|
1182
1230
|
"--corner-badge-margin": "--cornerbadge-margin",
|
|
1183
1231
|
"--corner-badge-outer-radius": "--cornerbadge-outer-radius",
|
|
@@ -1227,7 +1275,7 @@ var componentMigration_2026_09_13_cornerbadgePrefix = {
|
|
|
1227
1275
|
toVersion: 32,
|
|
1228
1276
|
appliesTo: "component-config",
|
|
1229
1277
|
apply(rawVars, meta) {
|
|
1230
|
-
const renames = meta.component ?
|
|
1278
|
+
const renames = meta.component ? RENAMES8[meta.component] : void 0;
|
|
1231
1279
|
if (!renames) return { ...rawVars };
|
|
1232
1280
|
const out = {};
|
|
1233
1281
|
for (const [key, value] of Object.entries(rawVars)) {
|
|
@@ -1238,7 +1286,7 @@ var componentMigration_2026_09_13_cornerbadgePrefix = {
|
|
|
1238
1286
|
};
|
|
1239
1287
|
|
|
1240
1288
|
// src/editor/core/themes/migrations/2026-09-13-toggle-label.ts
|
|
1241
|
-
var
|
|
1289
|
+
var RENAMES9 = {
|
|
1242
1290
|
toggle: {
|
|
1243
1291
|
"--toggle-label-text": "--toggle-label",
|
|
1244
1292
|
"--toggle-disabled-label-text": "--toggle-disabled-label"
|
|
@@ -1250,7 +1298,7 @@ var componentMigration_2026_09_13_toggleLabel = {
|
|
|
1250
1298
|
toVersion: 33,
|
|
1251
1299
|
appliesTo: "component-config",
|
|
1252
1300
|
apply(rawVars, meta) {
|
|
1253
|
-
const renames = meta.component ?
|
|
1301
|
+
const renames = meta.component ? RENAMES9[meta.component] : void 0;
|
|
1254
1302
|
if (!renames) return { ...rawVars };
|
|
1255
1303
|
const out = {};
|
|
1256
1304
|
for (const [key, value] of Object.entries(rawVars)) {
|
|
@@ -1261,7 +1309,7 @@ var componentMigration_2026_09_13_toggleLabel = {
|
|
|
1261
1309
|
};
|
|
1262
1310
|
|
|
1263
1311
|
// src/editor/core/themes/migrations/2026-09-13-collapsiblesection-open.ts
|
|
1264
|
-
var
|
|
1312
|
+
var RENAMES10 = {
|
|
1265
1313
|
collapsiblesection: {
|
|
1266
1314
|
"--collapsiblesection-chromeless-expanded-padding": "--collapsiblesection-chromeless-open-padding",
|
|
1267
1315
|
"--collapsiblesection-hairline-expanded-padding": "--collapsiblesection-hairline-open-padding",
|
|
@@ -1275,7 +1323,7 @@ var componentMigration_2026_09_13_collapsiblesectionOpen = {
|
|
|
1275
1323
|
toVersion: 34,
|
|
1276
1324
|
appliesTo: "component-config",
|
|
1277
1325
|
apply(rawVars, meta) {
|
|
1278
|
-
const renames = meta.component ?
|
|
1326
|
+
const renames = meta.component ? RENAMES10[meta.component] : void 0;
|
|
1279
1327
|
if (!renames) return { ...rawVars };
|
|
1280
1328
|
const out = {};
|
|
1281
1329
|
for (const [key, value] of Object.entries(rawVars)) {
|
|
@@ -1302,7 +1350,7 @@ var BADGE_SUFFIXES = [
|
|
|
1302
1350
|
"icon-size"
|
|
1303
1351
|
];
|
|
1304
1352
|
var CORNERBADGE_SUFFIXES = ["surface", "border", "text"];
|
|
1305
|
-
var
|
|
1353
|
+
var RENAMES11 = {
|
|
1306
1354
|
badge: Object.fromEntries(
|
|
1307
1355
|
BADGE_SUFFIXES.map((s) => [`--badge-primary-${s}`, `--badge-brand-${s}`])
|
|
1308
1356
|
),
|
|
@@ -1316,7 +1364,7 @@ var componentMigration_2026_09_13_badgeBrand = {
|
|
|
1316
1364
|
toVersion: 35,
|
|
1317
1365
|
appliesTo: "component-config",
|
|
1318
1366
|
apply(rawVars, meta) {
|
|
1319
|
-
const renames = meta.component ?
|
|
1367
|
+
const renames = meta.component ? RENAMES11[meta.component] : void 0;
|
|
1320
1368
|
if (!renames) return { ...rawVars };
|
|
1321
1369
|
const out = {};
|
|
1322
1370
|
for (const [key, value] of Object.entries(rawVars)) {
|
|
@@ -1370,7 +1418,9 @@ var MIGRATIONS = [
|
|
|
1370
1418
|
componentMigration_2026_09_13_cornerbadgePrefix,
|
|
1371
1419
|
componentMigration_2026_09_13_toggleLabel,
|
|
1372
1420
|
componentMigration_2026_09_13_collapsiblesectionOpen,
|
|
1373
|
-
componentMigration_2026_09_13_badgeBrand
|
|
1421
|
+
componentMigration_2026_09_13_badgeBrand,
|
|
1422
|
+
componentMigration_2026_09_20_imagelightboxScrim,
|
|
1423
|
+
componentMigration_2026_09_20_scrimColorAndOpacity
|
|
1374
1424
|
];
|
|
1375
1425
|
function countFor(kind) {
|
|
1376
1426
|
return MIGRATIONS.filter((m) => m.appliesTo === kind).length;
|
|
@@ -552,6 +552,26 @@ var tokensCssMigration_2026_09_01_tintScale = {
|
|
|
552
552
|
}
|
|
553
553
|
};
|
|
554
554
|
|
|
555
|
+
// vite-plugin/tokensCssMigrations/migrations/2026-09-20-scrim-color-and-opacity.ts
|
|
556
|
+
var ENTRIES2 = [
|
|
557
|
+
{ name: "--scrim-color", value: "rgb(20, 3, 0)" },
|
|
558
|
+
{ name: "--scrim-opacity-low", value: "0.38" },
|
|
559
|
+
{ name: "--scrim-opacity", value: "0.51" },
|
|
560
|
+
{ name: "--scrim-opacity-high", value: "0.64" }
|
|
561
|
+
];
|
|
562
|
+
var tokensCssMigration_2026_09_20_scrimColorAndOpacity = {
|
|
563
|
+
id: "2026-09-20-scrim-color-and-opacity",
|
|
564
|
+
kind: "additive",
|
|
565
|
+
description: "Add --scrim-color and --scrim-opacity-*; a scrim's colour and strength are separate tokens",
|
|
566
|
+
apply(css) {
|
|
567
|
+
return ensureScale(css, {
|
|
568
|
+
entries: ENTRIES2,
|
|
569
|
+
sectionComment: "Scrim colour and strength, which each screen mixes where it paints",
|
|
570
|
+
anchorPrefixes: ["--scrim"]
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
|
|
555
575
|
// vite-plugin/tokensCssMigrations/index.ts
|
|
556
576
|
var TOKENS_CSS_MIGRATIONS = [
|
|
557
577
|
tokensCssMigration_2026_05_29_typographyScaleAdditions,
|
|
@@ -568,7 +588,8 @@ var TOKENS_CSS_MIGRATIONS = [
|
|
|
568
588
|
tokensCssMigration_2026_08_27_editorialSizeSteps,
|
|
569
589
|
tokensCssMigration_2026_08_27_editorialLargeSteps,
|
|
570
590
|
tokensCssMigration_2026_09_01_scrimRename,
|
|
571
|
-
tokensCssMigration_2026_09_01_tintScale
|
|
591
|
+
tokensCssMigration_2026_09_01_tintScale,
|
|
592
|
+
tokensCssMigration_2026_09_20_scrimColorAndOpacity
|
|
572
593
|
];
|
|
573
594
|
function runTokensCssMigrations(css) {
|
|
574
595
|
return foldMigrations(css, () => true);
|
package/dist-plugin/index.cjs
CHANGED
|
@@ -1960,8 +1960,56 @@ var componentMigration_2026_09_13_sectiondividerSurface = {
|
|
|
1960
1960
|
}
|
|
1961
1961
|
};
|
|
1962
1962
|
|
|
1963
|
-
// src/editor/core/themes/migrations/2026-09-
|
|
1963
|
+
// src/editor/core/themes/migrations/2026-09-20-imagelightbox-scrim.ts
|
|
1964
1964
|
var RENAMES7 = {
|
|
1965
|
+
"--imagelightbox-overlay-surface": "--imagelightbox-scrim-surface"
|
|
1966
|
+
};
|
|
1967
|
+
var componentMigration_2026_09_20_imagelightboxScrim = {
|
|
1968
|
+
id: "2026-09-20-imagelightbox-scrim",
|
|
1969
|
+
fromVersion: 35,
|
|
1970
|
+
toVersion: 36,
|
|
1971
|
+
appliesTo: "component-config",
|
|
1972
|
+
apply(rawVars, meta) {
|
|
1973
|
+
if (meta.component !== "imagelightbox") return { ...rawVars };
|
|
1974
|
+
const out = {};
|
|
1975
|
+
for (const [key, value] of Object.entries(rawVars)) {
|
|
1976
|
+
out[RENAMES7[key] ?? key] = value;
|
|
1977
|
+
}
|
|
1978
|
+
return out;
|
|
1979
|
+
}
|
|
1980
|
+
};
|
|
1981
|
+
|
|
1982
|
+
// src/editor/core/themes/migrations/2026-09-20-scrim-color-and-opacity.ts
|
|
1983
|
+
var STOPS = {
|
|
1984
|
+
"--scrim-low": "--scrim-opacity-low",
|
|
1985
|
+
"--scrim": "--scrim-opacity",
|
|
1986
|
+
"--scrim-high": "--scrim-opacity-high"
|
|
1987
|
+
};
|
|
1988
|
+
var SURFACE = /^--(imagelightbox|dialog)-scrim-surface$/;
|
|
1989
|
+
var componentMigration_2026_09_20_scrimColorAndOpacity = {
|
|
1990
|
+
id: "2026-09-20-scrim-color-and-opacity",
|
|
1991
|
+
fromVersion: 36,
|
|
1992
|
+
toVersion: 37,
|
|
1993
|
+
appliesTo: "component-config",
|
|
1994
|
+
apply(rawVars) {
|
|
1995
|
+
const out = {};
|
|
1996
|
+
for (const [key, value] of Object.entries(rawVars)) {
|
|
1997
|
+
const match = SURFACE.exec(key);
|
|
1998
|
+
if (!match) {
|
|
1999
|
+
out[key] = value;
|
|
2000
|
+
continue;
|
|
2001
|
+
}
|
|
2002
|
+
const stem = `--${match[1]}-scrim`;
|
|
2003
|
+
const stop = STOPS[value];
|
|
2004
|
+
out[`${stem}-color`] = stop ? "--scrim-color" : value;
|
|
2005
|
+
out[`${stem}-opacity`] = stop ?? "1";
|
|
2006
|
+
}
|
|
2007
|
+
return out;
|
|
2008
|
+
}
|
|
2009
|
+
};
|
|
2010
|
+
|
|
2011
|
+
// src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts
|
|
2012
|
+
var RENAMES8 = {
|
|
1965
2013
|
cornerbadge: {
|
|
1966
2014
|
"--corner-badge-margin": "--cornerbadge-margin",
|
|
1967
2015
|
"--corner-badge-outer-radius": "--cornerbadge-outer-radius",
|
|
@@ -2011,7 +2059,7 @@ var componentMigration_2026_09_13_cornerbadgePrefix = {
|
|
|
2011
2059
|
toVersion: 32,
|
|
2012
2060
|
appliesTo: "component-config",
|
|
2013
2061
|
apply(rawVars, meta) {
|
|
2014
|
-
const renames = meta.component ?
|
|
2062
|
+
const renames = meta.component ? RENAMES8[meta.component] : void 0;
|
|
2015
2063
|
if (!renames) return { ...rawVars };
|
|
2016
2064
|
const out = {};
|
|
2017
2065
|
for (const [key, value] of Object.entries(rawVars)) {
|
|
@@ -2022,7 +2070,7 @@ var componentMigration_2026_09_13_cornerbadgePrefix = {
|
|
|
2022
2070
|
};
|
|
2023
2071
|
|
|
2024
2072
|
// src/editor/core/themes/migrations/2026-09-13-toggle-label.ts
|
|
2025
|
-
var
|
|
2073
|
+
var RENAMES9 = {
|
|
2026
2074
|
toggle: {
|
|
2027
2075
|
"--toggle-label-text": "--toggle-label",
|
|
2028
2076
|
"--toggle-disabled-label-text": "--toggle-disabled-label"
|
|
@@ -2034,7 +2082,7 @@ var componentMigration_2026_09_13_toggleLabel = {
|
|
|
2034
2082
|
toVersion: 33,
|
|
2035
2083
|
appliesTo: "component-config",
|
|
2036
2084
|
apply(rawVars, meta) {
|
|
2037
|
-
const renames = meta.component ?
|
|
2085
|
+
const renames = meta.component ? RENAMES9[meta.component] : void 0;
|
|
2038
2086
|
if (!renames) return { ...rawVars };
|
|
2039
2087
|
const out = {};
|
|
2040
2088
|
for (const [key, value] of Object.entries(rawVars)) {
|
|
@@ -2045,7 +2093,7 @@ var componentMigration_2026_09_13_toggleLabel = {
|
|
|
2045
2093
|
};
|
|
2046
2094
|
|
|
2047
2095
|
// src/editor/core/themes/migrations/2026-09-13-collapsiblesection-open.ts
|
|
2048
|
-
var
|
|
2096
|
+
var RENAMES10 = {
|
|
2049
2097
|
collapsiblesection: {
|
|
2050
2098
|
"--collapsiblesection-chromeless-expanded-padding": "--collapsiblesection-chromeless-open-padding",
|
|
2051
2099
|
"--collapsiblesection-hairline-expanded-padding": "--collapsiblesection-hairline-open-padding",
|
|
@@ -2059,7 +2107,7 @@ var componentMigration_2026_09_13_collapsiblesectionOpen = {
|
|
|
2059
2107
|
toVersion: 34,
|
|
2060
2108
|
appliesTo: "component-config",
|
|
2061
2109
|
apply(rawVars, meta) {
|
|
2062
|
-
const renames = meta.component ?
|
|
2110
|
+
const renames = meta.component ? RENAMES10[meta.component] : void 0;
|
|
2063
2111
|
if (!renames) return { ...rawVars };
|
|
2064
2112
|
const out = {};
|
|
2065
2113
|
for (const [key, value] of Object.entries(rawVars)) {
|
|
@@ -2086,7 +2134,7 @@ var BADGE_SUFFIXES = [
|
|
|
2086
2134
|
"icon-size"
|
|
2087
2135
|
];
|
|
2088
2136
|
var CORNERBADGE_SUFFIXES = ["surface", "border", "text"];
|
|
2089
|
-
var
|
|
2137
|
+
var RENAMES11 = {
|
|
2090
2138
|
badge: Object.fromEntries(
|
|
2091
2139
|
BADGE_SUFFIXES.map((s) => [`--badge-primary-${s}`, `--badge-brand-${s}`])
|
|
2092
2140
|
),
|
|
@@ -2100,7 +2148,7 @@ var componentMigration_2026_09_13_badgeBrand = {
|
|
|
2100
2148
|
toVersion: 35,
|
|
2101
2149
|
appliesTo: "component-config",
|
|
2102
2150
|
apply(rawVars, meta) {
|
|
2103
|
-
const renames = meta.component ?
|
|
2151
|
+
const renames = meta.component ? RENAMES11[meta.component] : void 0;
|
|
2104
2152
|
if (!renames) return { ...rawVars };
|
|
2105
2153
|
const out = {};
|
|
2106
2154
|
for (const [key, value] of Object.entries(rawVars)) {
|
|
@@ -2154,7 +2202,9 @@ var MIGRATIONS = [
|
|
|
2154
2202
|
componentMigration_2026_09_13_cornerbadgePrefix,
|
|
2155
2203
|
componentMigration_2026_09_13_toggleLabel,
|
|
2156
2204
|
componentMigration_2026_09_13_collapsiblesectionOpen,
|
|
2157
|
-
componentMigration_2026_09_13_badgeBrand
|
|
2205
|
+
componentMigration_2026_09_13_badgeBrand,
|
|
2206
|
+
componentMigration_2026_09_20_imagelightboxScrim,
|
|
2207
|
+
componentMigration_2026_09_20_scrimColorAndOpacity
|
|
2158
2208
|
];
|
|
2159
2209
|
function countFor(kind) {
|
|
2160
2210
|
return MIGRATIONS.filter((m) => m.appliesTo === kind).length;
|
|
@@ -3575,7 +3625,7 @@ var tokensCssMigration_2026_06_04_easingColorAndTypescaleAdditions = {
|
|
|
3575
3625
|
};
|
|
3576
3626
|
|
|
3577
3627
|
// vite-plugin/tokensCssMigrations/migrations/2026-07-20-line-height-rename.ts
|
|
3578
|
-
var
|
|
3628
|
+
var RENAMES12 = [
|
|
3579
3629
|
["--line-height-xs", "--line-height-none"],
|
|
3580
3630
|
["--line-height-sm", "--line-height-tighter"],
|
|
3581
3631
|
["--line-height-md", "--line-height-normal"],
|
|
@@ -3595,7 +3645,7 @@ var tokensCssMigration_2026_07_20_lineHeightRename = {
|
|
|
3595
3645
|
description: "Reshape --line-height-{xs..xl} to leading vocabulary (none/tightest/tighter/tight/normal/relaxed); retire the 2.0 slot",
|
|
3596
3646
|
apply(css) {
|
|
3597
3647
|
let out = css;
|
|
3598
|
-
for (const [oldName, newName] of
|
|
3648
|
+
for (const [oldName, newName] of RENAMES12) out = renameToken2(out, oldName, newName);
|
|
3599
3649
|
out = removeToken(out, "--line-height-xl");
|
|
3600
3650
|
out = ensureScale(out, {
|
|
3601
3651
|
anchorPrefixes: ["--line-height-", "--font-size-", "--font-weight-", "--font-"],
|
|
@@ -3828,7 +3878,7 @@ var tokensCssMigration_2026_08_27_editorialLargeSteps = {
|
|
|
3828
3878
|
};
|
|
3829
3879
|
|
|
3830
3880
|
// vite-plugin/tokensCssMigrations/migrations/2026-09-01-scrim-rename.ts
|
|
3831
|
-
var
|
|
3881
|
+
var RENAMES13 = [
|
|
3832
3882
|
["--overlay-low", "--scrim-low"],
|
|
3833
3883
|
["--overlay-high", "--scrim-high"],
|
|
3834
3884
|
["--overlay", "--scrim"]
|
|
@@ -3839,7 +3889,7 @@ var tokensCssMigration_2026_09_01_scrimRename = {
|
|
|
3839
3889
|
description: "Rename --overlay-{low,base,high} to --scrim-*; a scrim dims what is behind it",
|
|
3840
3890
|
apply(css) {
|
|
3841
3891
|
let out = css;
|
|
3842
|
-
for (const [oldName, newName] of
|
|
3892
|
+
for (const [oldName, newName] of RENAMES13) out = renameToken2(out, oldName, newName);
|
|
3843
3893
|
return out;
|
|
3844
3894
|
}
|
|
3845
3895
|
};
|
|
@@ -3863,6 +3913,26 @@ var tokensCssMigration_2026_09_01_tintScale = {
|
|
|
3863
3913
|
}
|
|
3864
3914
|
};
|
|
3865
3915
|
|
|
3916
|
+
// vite-plugin/tokensCssMigrations/migrations/2026-09-20-scrim-color-and-opacity.ts
|
|
3917
|
+
var ENTRIES2 = [
|
|
3918
|
+
{ name: "--scrim-color", value: "rgb(20, 3, 0)" },
|
|
3919
|
+
{ name: "--scrim-opacity-low", value: "0.38" },
|
|
3920
|
+
{ name: "--scrim-opacity", value: "0.51" },
|
|
3921
|
+
{ name: "--scrim-opacity-high", value: "0.64" }
|
|
3922
|
+
];
|
|
3923
|
+
var tokensCssMigration_2026_09_20_scrimColorAndOpacity = {
|
|
3924
|
+
id: "2026-09-20-scrim-color-and-opacity",
|
|
3925
|
+
kind: "additive",
|
|
3926
|
+
description: "Add --scrim-color and --scrim-opacity-*; a scrim's colour and strength are separate tokens",
|
|
3927
|
+
apply(css) {
|
|
3928
|
+
return ensureScale(css, {
|
|
3929
|
+
entries: ENTRIES2,
|
|
3930
|
+
sectionComment: "Scrim colour and strength, which each screen mixes where it paints",
|
|
3931
|
+
anchorPrefixes: ["--scrim"]
|
|
3932
|
+
});
|
|
3933
|
+
}
|
|
3934
|
+
};
|
|
3935
|
+
|
|
3866
3936
|
// vite-plugin/tokensCssMigrations/index.ts
|
|
3867
3937
|
var TOKENS_CSS_MIGRATIONS = [
|
|
3868
3938
|
tokensCssMigration_2026_05_29_typographyScaleAdditions,
|
|
@@ -3879,7 +3949,8 @@ var TOKENS_CSS_MIGRATIONS = [
|
|
|
3879
3949
|
tokensCssMigration_2026_08_27_editorialSizeSteps,
|
|
3880
3950
|
tokensCssMigration_2026_08_27_editorialLargeSteps,
|
|
3881
3951
|
tokensCssMigration_2026_09_01_scrimRename,
|
|
3882
|
-
tokensCssMigration_2026_09_01_tintScale
|
|
3952
|
+
tokensCssMigration_2026_09_01_tintScale,
|
|
3953
|
+
tokensCssMigration_2026_09_20_scrimColorAndOpacity
|
|
3883
3954
|
];
|
|
3884
3955
|
function runTokensCssMigrations(css) {
|
|
3885
3956
|
return foldMigrations(css, () => true);
|
package/dist-plugin/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
nextAvailableName,
|
|
6
6
|
normalizeTheme,
|
|
7
7
|
versionedFileResourceServer
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-M6BWSS6C.js";
|
|
9
9
|
import {
|
|
10
10
|
formatGradientValue,
|
|
11
11
|
palettesToVars,
|
|
@@ -16,14 +16,14 @@ import {
|
|
|
16
16
|
} from "./chunk-O6GQ6GBH.js";
|
|
17
17
|
import {
|
|
18
18
|
CURRENT_COMPONENT_SCHEMA_VERSION
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-FD4FVDOC.js";
|
|
20
20
|
import {
|
|
21
21
|
TOKENS_CSS_MIGRATIONS,
|
|
22
22
|
extractGlobalRootBody,
|
|
23
23
|
runAdditiveTokensCssMigrations,
|
|
24
24
|
runTokensCssMigrations,
|
|
25
25
|
validateTokensCss
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-V2OVSC5Z.js";
|
|
27
27
|
import {
|
|
28
28
|
hexToOklch,
|
|
29
29
|
oklchToRgb255,
|
|
@@ -1356,8 +1356,56 @@ var componentMigration_2026_09_13_sectiondividerSurface = {
|
|
|
1356
1356
|
}
|
|
1357
1357
|
};
|
|
1358
1358
|
|
|
1359
|
-
// src/editor/core/themes/migrations/2026-09-
|
|
1359
|
+
// src/editor/core/themes/migrations/2026-09-20-imagelightbox-scrim.ts
|
|
1360
1360
|
var RENAMES7 = {
|
|
1361
|
+
"--imagelightbox-overlay-surface": "--imagelightbox-scrim-surface"
|
|
1362
|
+
};
|
|
1363
|
+
var componentMigration_2026_09_20_imagelightboxScrim = {
|
|
1364
|
+
id: "2026-09-20-imagelightbox-scrim",
|
|
1365
|
+
fromVersion: 35,
|
|
1366
|
+
toVersion: 36,
|
|
1367
|
+
appliesTo: "component-config",
|
|
1368
|
+
apply(rawVars, meta) {
|
|
1369
|
+
if (meta.component !== "imagelightbox") return { ...rawVars };
|
|
1370
|
+
const out = {};
|
|
1371
|
+
for (const [key, value] of Object.entries(rawVars)) {
|
|
1372
|
+
out[RENAMES7[key] ?? key] = value;
|
|
1373
|
+
}
|
|
1374
|
+
return out;
|
|
1375
|
+
}
|
|
1376
|
+
};
|
|
1377
|
+
|
|
1378
|
+
// src/editor/core/themes/migrations/2026-09-20-scrim-color-and-opacity.ts
|
|
1379
|
+
var STOPS = {
|
|
1380
|
+
"--scrim-low": "--scrim-opacity-low",
|
|
1381
|
+
"--scrim": "--scrim-opacity",
|
|
1382
|
+
"--scrim-high": "--scrim-opacity-high"
|
|
1383
|
+
};
|
|
1384
|
+
var SURFACE = /^--(imagelightbox|dialog)-scrim-surface$/;
|
|
1385
|
+
var componentMigration_2026_09_20_scrimColorAndOpacity = {
|
|
1386
|
+
id: "2026-09-20-scrim-color-and-opacity",
|
|
1387
|
+
fromVersion: 36,
|
|
1388
|
+
toVersion: 37,
|
|
1389
|
+
appliesTo: "component-config",
|
|
1390
|
+
apply(rawVars) {
|
|
1391
|
+
const out = {};
|
|
1392
|
+
for (const [key, value] of Object.entries(rawVars)) {
|
|
1393
|
+
const match = SURFACE.exec(key);
|
|
1394
|
+
if (!match) {
|
|
1395
|
+
out[key] = value;
|
|
1396
|
+
continue;
|
|
1397
|
+
}
|
|
1398
|
+
const stem = `--${match[1]}-scrim`;
|
|
1399
|
+
const stop = STOPS[value];
|
|
1400
|
+
out[`${stem}-color`] = stop ? "--scrim-color" : value;
|
|
1401
|
+
out[`${stem}-opacity`] = stop ?? "1";
|
|
1402
|
+
}
|
|
1403
|
+
return out;
|
|
1404
|
+
}
|
|
1405
|
+
};
|
|
1406
|
+
|
|
1407
|
+
// src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts
|
|
1408
|
+
var RENAMES8 = {
|
|
1361
1409
|
cornerbadge: {
|
|
1362
1410
|
"--corner-badge-margin": "--cornerbadge-margin",
|
|
1363
1411
|
"--corner-badge-outer-radius": "--cornerbadge-outer-radius",
|
|
@@ -1407,7 +1455,7 @@ var componentMigration_2026_09_13_cornerbadgePrefix = {
|
|
|
1407
1455
|
toVersion: 32,
|
|
1408
1456
|
appliesTo: "component-config",
|
|
1409
1457
|
apply(rawVars, meta) {
|
|
1410
|
-
const renames = meta.component ?
|
|
1458
|
+
const renames = meta.component ? RENAMES8[meta.component] : void 0;
|
|
1411
1459
|
if (!renames) return { ...rawVars };
|
|
1412
1460
|
const out = {};
|
|
1413
1461
|
for (const [key, value] of Object.entries(rawVars)) {
|
|
@@ -1418,7 +1466,7 @@ var componentMigration_2026_09_13_cornerbadgePrefix = {
|
|
|
1418
1466
|
};
|
|
1419
1467
|
|
|
1420
1468
|
// src/editor/core/themes/migrations/2026-09-13-toggle-label.ts
|
|
1421
|
-
var
|
|
1469
|
+
var RENAMES9 = {
|
|
1422
1470
|
toggle: {
|
|
1423
1471
|
"--toggle-label-text": "--toggle-label",
|
|
1424
1472
|
"--toggle-disabled-label-text": "--toggle-disabled-label"
|
|
@@ -1430,7 +1478,7 @@ var componentMigration_2026_09_13_toggleLabel = {
|
|
|
1430
1478
|
toVersion: 33,
|
|
1431
1479
|
appliesTo: "component-config",
|
|
1432
1480
|
apply(rawVars, meta) {
|
|
1433
|
-
const renames = meta.component ?
|
|
1481
|
+
const renames = meta.component ? RENAMES9[meta.component] : void 0;
|
|
1434
1482
|
if (!renames) return { ...rawVars };
|
|
1435
1483
|
const out = {};
|
|
1436
1484
|
for (const [key, value] of Object.entries(rawVars)) {
|
|
@@ -1441,7 +1489,7 @@ var componentMigration_2026_09_13_toggleLabel = {
|
|
|
1441
1489
|
};
|
|
1442
1490
|
|
|
1443
1491
|
// src/editor/core/themes/migrations/2026-09-13-collapsiblesection-open.ts
|
|
1444
|
-
var
|
|
1492
|
+
var RENAMES10 = {
|
|
1445
1493
|
collapsiblesection: {
|
|
1446
1494
|
"--collapsiblesection-chromeless-expanded-padding": "--collapsiblesection-chromeless-open-padding",
|
|
1447
1495
|
"--collapsiblesection-hairline-expanded-padding": "--collapsiblesection-hairline-open-padding",
|
|
@@ -1455,7 +1503,7 @@ var componentMigration_2026_09_13_collapsiblesectionOpen = {
|
|
|
1455
1503
|
toVersion: 34,
|
|
1456
1504
|
appliesTo: "component-config",
|
|
1457
1505
|
apply(rawVars, meta) {
|
|
1458
|
-
const renames = meta.component ?
|
|
1506
|
+
const renames = meta.component ? RENAMES10[meta.component] : void 0;
|
|
1459
1507
|
if (!renames) return { ...rawVars };
|
|
1460
1508
|
const out = {};
|
|
1461
1509
|
for (const [key, value] of Object.entries(rawVars)) {
|
|
@@ -1482,7 +1530,7 @@ var BADGE_SUFFIXES = [
|
|
|
1482
1530
|
"icon-size"
|
|
1483
1531
|
];
|
|
1484
1532
|
var CORNERBADGE_SUFFIXES = ["surface", "border", "text"];
|
|
1485
|
-
var
|
|
1533
|
+
var RENAMES11 = {
|
|
1486
1534
|
badge: Object.fromEntries(
|
|
1487
1535
|
BADGE_SUFFIXES.map((s) => [`--badge-primary-${s}`, `--badge-brand-${s}`])
|
|
1488
1536
|
),
|
|
@@ -1496,7 +1544,7 @@ var componentMigration_2026_09_13_badgeBrand = {
|
|
|
1496
1544
|
toVersion: 35,
|
|
1497
1545
|
appliesTo: "component-config",
|
|
1498
1546
|
apply(rawVars, meta) {
|
|
1499
|
-
const renames = meta.component ?
|
|
1547
|
+
const renames = meta.component ? RENAMES11[meta.component] : void 0;
|
|
1500
1548
|
if (!renames) return { ...rawVars };
|
|
1501
1549
|
const out = {};
|
|
1502
1550
|
for (const [key, value] of Object.entries(rawVars)) {
|
|
@@ -1550,7 +1598,9 @@ var MIGRATIONS = [
|
|
|
1550
1598
|
componentMigration_2026_09_13_cornerbadgePrefix,
|
|
1551
1599
|
componentMigration_2026_09_13_toggleLabel,
|
|
1552
1600
|
componentMigration_2026_09_13_collapsiblesectionOpen,
|
|
1553
|
-
componentMigration_2026_09_13_badgeBrand
|
|
1601
|
+
componentMigration_2026_09_13_badgeBrand,
|
|
1602
|
+
componentMigration_2026_09_20_imagelightboxScrim,
|
|
1603
|
+
componentMigration_2026_09_20_scrimColorAndOpacity
|
|
1554
1604
|
];
|
|
1555
1605
|
function countFor(kind) {
|
|
1556
1606
|
return MIGRATIONS.filter((m) => m.appliesTo === kind).length;
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
normalizeTheme,
|
|
8
8
|
planLegacyRenames,
|
|
9
9
|
versionedFileResourceServer
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-M6BWSS6C.js";
|
|
11
11
|
import {
|
|
12
12
|
CURRENT_COMPONENT_SCHEMA_VERSION
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-FD4FVDOC.js";
|
|
14
14
|
import {
|
|
15
15
|
readLiveTokensConfig,
|
|
16
16
|
resolveDataDirs
|