@motion-proto/live-tokens 0.83.0 → 0.85.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.claude/skills/live-tokens-create-component/references/token-naming.md +0 -1
  2. package/CHANGELOG.md +72 -0
  3. package/dist-plugin/{chunk-RFVYPNRO.js → chunk-GWMEYBZ2.js} +43 -1
  4. package/dist-plugin/{chunk-6JKUYCPL.js → chunk-ONYAIXCZ.js} +104 -1
  5. package/dist-plugin/{chunk-LBZISJPG.js → chunk-W5VQV32K.js} +1 -1
  6. package/dist-plugin/index.cjs +152 -7
  7. package/dist-plugin/index.js +3 -3
  8. package/dist-plugin/migrateData/index.cjs +108 -5
  9. package/dist-plugin/migrateData/index.js +2 -2
  10. package/dist-plugin/setColors/index.cjs +104 -1
  11. package/dist-plugin/setColors/index.js +1 -1
  12. package/dist-plugin/setGeometry/index.cjs +105 -3
  13. package/dist-plugin/setGeometry/index.js +2 -3
  14. package/dist-plugin/tokensCssMigrations/index.cjs +43 -1
  15. package/dist-plugin/tokensCssMigrations/index.js +1 -1
  16. package/package.json +1 -1
  17. package/src/editor/core/components/aliasKinds.ts +1 -1
  18. package/src/editor/core/store/editorPersistence.ts +46 -23
  19. package/src/editor/core/store/editorStore.ts +1 -5
  20. package/src/editor/core/store/editorTypes.ts +11 -7
  21. package/src/editor/core/themes/migrations/2026-09-20-scrim-color-and-opacity.ts +45 -0
  22. package/src/editor/core/themes/migrations/2026-09-21-scrim-surface.ts +56 -0
  23. package/src/editor/core/themes/migrations/2026-09-21-wash-color-and-opacity.ts +51 -0
  24. package/src/editor/core/themes/migrations/index.ts +6 -0
  25. package/src/editor/core/themes/slices/washes.ts +59 -77
  26. package/src/editor/skill-atlas/skillSources.generated.ts +1 -1
  27. package/src/editor/ui/UIPaletteSelector.svelte +5 -1
  28. package/src/editor/ui/sections/WashesSection.svelte +100 -99
  29. package/src/live-tokens/data/colors-and-type/autumn.json +9 -7
  30. package/src/live-tokens/data/colors-and-type/default.json +9 -7
  31. package/src/live-tokens/data/colors-and-type/halloween.json +9 -7
  32. package/src/live-tokens/data/colors-and-type/midnight-study.json +9 -7
  33. package/src/live-tokens/data/colors-and-type/ocean.json +9 -7
  34. package/src/live-tokens/data/colors-and-type/royal-velvet.json +9 -7
  35. package/src/live-tokens/data/colors-and-type/sketchy.json +9 -7
  36. package/src/live-tokens/data/colors-and-type/spring-meadow.json +9 -7
  37. package/src/live-tokens/data/colors-and-type/sunset.json +9 -7
  38. package/src/live-tokens/data/themes/autumn.json +11 -9
  39. package/src/live-tokens/data/themes/halloween.json +11 -9
  40. package/src/live-tokens/data/themes/midnight-study.json +11 -9
  41. package/src/live-tokens/data/themes/ocean.json +11 -9
  42. package/src/live-tokens/data/themes/royal-velvet.json +11 -9
  43. package/src/live-tokens/data/themes/sketchy.json +11 -9
  44. package/src/live-tokens/data/themes/spring-meadow.json +11 -9
  45. package/src/live-tokens/data/themes/sunset.json +11 -9
  46. package/src/live-tokens/data/tokens.generated.css +8 -6
  47. package/src/system/components/ImageLightbox.svelte +5 -19
  48. package/src/system/styles/tokens.css +22 -9
@@ -19,7 +19,6 @@ to that list, so the two cannot drift apart.
19
19
  | `-fill` | Inner fill (distinct from outer surface) |
20
20
  | `-color` | A hairline rule's colour, or a color no role word above names |
21
21
  | `-shadow` | Box-shadow |
22
- | `-opacity` | Opacity (0–1) |
23
22
  | `-blur` | Backdrop or filter blur radius |
24
23
  | `-tint` | A wash over the surface, aliasing a `--tint-*` stop |
25
24
  | `-indicator` | The colour of the bar or stripe that marks an item |
package/CHANGELOG.md CHANGED
@@ -1,5 +1,77 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.85.0 — A theme's scrims and tints are a colour and three strengths
4
+
5
+ ### Changed
6
+
7
+ - **The theme stores each wash family as a colour and three opacity stops.**
8
+ It writes `--scrim-color` with `--scrim-opacity-low`, `--scrim-opacity`, and
9
+ `--scrim-opacity-high`, and the same four for tints. It no longer writes the
10
+ composed `--scrim-*` and `--tint-*` fills. From 0.84.0 Dialog and
11
+ ImageLightbox read `--scrim-color` and `--scrim-opacity-*`, and themes never
12
+ set them, so a theme's scrim reached neither screen. The Washes section edits
13
+ one colour per family and a slider per stop. Migration
14
+ `2026-09-21-wash-color-and-opacity` splits the composed fills in a saved
15
+ theme. A fill that is not a `color-mix()` of one token stays as written.
16
+
17
+ - **Scrims default to 70%, 80%, and 90%.** They were 38%, 51%, and 64%. The
18
+ shipped themes use the new stops, and their ImageLightbox scrims read
19
+ `--scrim-high` instead of a hand-written fill. Tints stay at 5%, 10%, and 15%.
20
+
21
+ ### Changed (breaking)
22
+
23
+ - **Dialog and ImageLightbox each take one scrim fill again,
24
+ `-scrim-surface`, defaulting to `--scrim-high`.** The theme composes each
25
+ `--scrim-*` stop from its colour and strength, so a screen picks a stop the
26
+ way a hover picks a `--tint-*` stop. `-scrim-color` and `-scrim-opacity`
27
+ are gone. ImageLightbox's `scrim` prop takes any CSS fill, such as
28
+ `var(--scrim-low)`, and `scrimOpacity` is gone. Migration
29
+ `2026-09-21-scrim-surface` folds a saved pair into one value: the scale's
30
+ colour at one of its strengths becomes that stop, and any other pair becomes
31
+ the `color-mix()` the screen painted. The editor's `opacity` property kind
32
+ and its stop picker go with them, since no other property used them.
33
+
34
+ ### Added
35
+
36
+ - **`--tint-color` and `--tint-opacity-low`, `--tint-opacity`,
37
+ `--tint-opacity-high`.** tokens.css composes the three `--tint-*` stops from
38
+ them. The additive tokens-css migration `2026-09-21-tint-color-and-opacity`
39
+ inserts the four names into an existing `tokens.css`. The stops already in
40
+ that file keep their values; to have them follow `--tint-color`, write each
41
+ as `color-mix(in srgb, var(--tint-color) calc(var(--tint-opacity) * 100%), transparent)`
42
+ with its own opacity stop.
43
+
44
+ ## 0.84.0 — A scrim's colour and strength are separate tokens
45
+
46
+ ### Added
47
+
48
+ - **`--scrim-color` and `--scrim-opacity-low`, `--scrim-opacity`,
49
+ `--scrim-opacity-high`.** A theme holds one and moves the other: a light
50
+ `--scrim-color` gives a scrim that pales the page. The three `--scrim-*` stops
51
+ remain, composed from the two. The additive tokens-css migration
52
+ `2026-09-20-scrim-color-and-opacity` inserts the four names into an existing
53
+ `tokens.css`, and the dev plugin applies it on its own. The stops already in
54
+ that file keep their values; to have them follow `--scrim-color`, write each
55
+ as `color-mix(in srgb, var(--scrim-color) calc(var(--scrim-opacity) * 100%), transparent)`
56
+ with its own opacity stop.
57
+
58
+ - **The editor picks an opacity from its stops.** A property whose name ends in
59
+ `-opacity` takes a picker of the three scrim strengths, low, medium, and high.
60
+ The suffix used to fall under the fill rule, which offered a palette and wrote
61
+ a colour into a number.
62
+
63
+ ### Changed (breaking)
64
+
65
+ - **`--dialog-scrim-surface` and `--imagelightbox-scrim-surface` each split into
66
+ `-scrim-color` and `-scrim-opacity`.** Each screen mixes the pair where it
67
+ paints. ImageLightbox's `scrim` prop writes the colour and `scrimOpacity`
68
+ writes the strength, and the opacity now stands on its own. Migration
69
+ `2026-09-20-scrim-color-and-opacity` splits the old key in a saved component
70
+ config: a `--scrim-*` stop becomes that stop's opacity with `--scrim-color`,
71
+ and a hand-written fill becomes the colour at full strength. A project whose
72
+ `tokens.css` gave the scrim stops their own colour sets `--scrim-color` to it,
73
+ since Dialog and ImageLightbox now read that token.
74
+
3
75
  ## 0.83.0 — The catalogue entry names what rules a component out
4
76
 
5
77
  ### Added
@@ -552,6 +552,46 @@ 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
+
575
+ // vite-plugin/tokensCssMigrations/migrations/2026-09-21-tint-color-and-opacity.ts
576
+ var ENTRIES3 = [
577
+ { name: "--tint-color", value: "rgb(255, 255, 255)" },
578
+ { name: "--tint-opacity-low", value: "0.05" },
579
+ { name: "--tint-opacity", value: "0.1" },
580
+ { name: "--tint-opacity-high", value: "0.15" }
581
+ ];
582
+ var tokensCssMigration_2026_09_21_tintColorAndOpacity = {
583
+ id: "2026-09-21-tint-color-and-opacity",
584
+ kind: "additive",
585
+ description: "Add --tint-color and --tint-opacity-*; a tint's colour and strength are separate tokens",
586
+ apply(css) {
587
+ return ensureScale(css, {
588
+ entries: ENTRIES3,
589
+ sectionComment: "Tint colour and strength, which the --tint-* stops compose",
590
+ anchorPrefixes: ["--tint"]
591
+ });
592
+ }
593
+ };
594
+
555
595
  // vite-plugin/tokensCssMigrations/index.ts
556
596
  var TOKENS_CSS_MIGRATIONS = [
557
597
  tokensCssMigration_2026_05_29_typographyScaleAdditions,
@@ -568,7 +608,9 @@ var TOKENS_CSS_MIGRATIONS = [
568
608
  tokensCssMigration_2026_08_27_editorialSizeSteps,
569
609
  tokensCssMigration_2026_08_27_editorialLargeSteps,
570
610
  tokensCssMigration_2026_09_01_scrimRename,
571
- tokensCssMigration_2026_09_01_tintScale
611
+ tokensCssMigration_2026_09_01_tintScale,
612
+ tokensCssMigration_2026_09_20_scrimColorAndOpacity,
613
+ tokensCssMigration_2026_09_21_tintColorAndOpacity
572
614
  ];
573
615
  function runTokensCssMigrations(css) {
574
616
  return foldMigrations(css, () => true);
@@ -1195,6 +1195,106 @@ var componentMigration_2026_09_20_imagelightboxScrim = {
1195
1195
  }
1196
1196
  };
1197
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-21-wash-color-and-opacity.ts
1228
+ var FAMILIES = ["scrim", "tint"];
1229
+ var COLOR_MIX_RE = /^color-mix\(in srgb,\s*var\((--[a-z0-9-]+)\)\s+(\d+(?:\.\d+)?)%,\s*transparent\)$/i;
1230
+ var PLAIN_VAR_RE = /^var\((--[a-z0-9-]+)\)$/i;
1231
+ function parseFill(raw) {
1232
+ const s = raw.trim();
1233
+ const mix = s.match(COLOR_MIX_RE);
1234
+ if (mix) return { color: mix[1], opacity: Math.min(100, Number(mix[2])) / 100 };
1235
+ const plain = s.match(PLAIN_VAR_RE);
1236
+ return plain ? { color: plain[1], opacity: 1 } : null;
1237
+ }
1238
+ var colorsAndTypeMigration_2026_09_21_washColorAndOpacity = {
1239
+ id: "2026-09-21-wash-color-and-opacity",
1240
+ fromVersion: 8,
1241
+ toVersion: 9,
1242
+ appliesTo: "colors-and-type",
1243
+ apply(rawVars) {
1244
+ const out = { ...rawVars };
1245
+ for (const family of FAMILIES) {
1246
+ let color = null;
1247
+ for (const suffix of ["", "-low", "-high"]) {
1248
+ const key = `--${family}${suffix}`;
1249
+ const parsed = out[key] === void 0 ? null : parseFill(out[key]);
1250
+ if (!parsed) continue;
1251
+ color ??= parsed.color;
1252
+ out[`--${family}-opacity${suffix}`] = String(parsed.opacity);
1253
+ delete out[key];
1254
+ }
1255
+ if (color) out[`--${family}-color`] = `var(${color})`;
1256
+ }
1257
+ return out;
1258
+ }
1259
+ };
1260
+
1261
+ // src/editor/core/themes/migrations/2026-09-21-scrim-surface.ts
1262
+ var STOPS2 = {
1263
+ "--scrim-opacity-low": "--scrim-low",
1264
+ "--scrim-opacity": "--scrim",
1265
+ "--scrim-opacity-high": "--scrim-high"
1266
+ };
1267
+ var PAIR = /^--(imagelightbox|dialog)-scrim-(color|opacity)$/;
1268
+ var ref = (value) => value.startsWith("--") ? `var(${value})` : value;
1269
+ function fill(color, opacity) {
1270
+ if (color === "--scrim-color" && STOPS2[opacity]) return STOPS2[opacity];
1271
+ if (opacity === "1") return color;
1272
+ const pct = Number.isFinite(Number(opacity)) ? `${Number(opacity) * 100}%` : `calc(${ref(opacity)} * 100%)`;
1273
+ return `color-mix(in srgb, ${ref(color)} ${pct}, transparent)`;
1274
+ }
1275
+ var componentMigration_2026_09_21_scrimSurface = {
1276
+ id: "2026-09-21-scrim-surface",
1277
+ fromVersion: 37,
1278
+ toVersion: 38,
1279
+ appliesTo: "component-config",
1280
+ apply(rawVars) {
1281
+ const out = {};
1282
+ const pairs = {};
1283
+ for (const [key, value] of Object.entries(rawVars)) {
1284
+ const match = PAIR.exec(key);
1285
+ if (!match) {
1286
+ out[key] = value;
1287
+ continue;
1288
+ }
1289
+ (pairs[match[1]] ??= {})[match[2]] = value;
1290
+ }
1291
+ for (const [id, { color = "--scrim-color", opacity = "--scrim-opacity-high" }] of Object.entries(pairs)) {
1292
+ out[`--${id}-scrim-surface`] = fill(color, opacity);
1293
+ }
1294
+ return out;
1295
+ }
1296
+ };
1297
+
1198
1298
  // src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts
1199
1299
  var RENAMES8 = {
1200
1300
  cornerbadge: {
@@ -1390,7 +1490,10 @@ var MIGRATIONS = [
1390
1490
  componentMigration_2026_09_13_toggleLabel,
1391
1491
  componentMigration_2026_09_13_collapsiblesectionOpen,
1392
1492
  componentMigration_2026_09_13_badgeBrand,
1393
- componentMigration_2026_09_20_imagelightboxScrim
1493
+ componentMigration_2026_09_20_imagelightboxScrim,
1494
+ componentMigration_2026_09_20_scrimColorAndOpacity,
1495
+ colorsAndTypeMigration_2026_09_21_washColorAndOpacity,
1496
+ componentMigration_2026_09_21_scrimSurface
1394
1497
  ];
1395
1498
  function countFor(kind) {
1396
1499
  return MIGRATIONS.filter((m) => m.appliesTo === kind).length;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CURRENT_COMPONENT_SCHEMA_VERSION,
3
3
  runMigrations
4
- } from "./chunk-6JKUYCPL.js";
4
+ } from "./chunk-ONYAIXCZ.js";
5
5
 
6
6
  // vite-plugin/files/versionedFileResourceServer.ts
7
7
  import fs from "fs";
@@ -1979,6 +1979,106 @@ var componentMigration_2026_09_20_imagelightboxScrim = {
1979
1979
  }
1980
1980
  };
1981
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-21-wash-color-and-opacity.ts
2012
+ var FAMILIES = ["scrim", "tint"];
2013
+ var COLOR_MIX_RE = /^color-mix\(in srgb,\s*var\((--[a-z0-9-]+)\)\s+(\d+(?:\.\d+)?)%,\s*transparent\)$/i;
2014
+ var PLAIN_VAR_RE = /^var\((--[a-z0-9-]+)\)$/i;
2015
+ function parseFill(raw) {
2016
+ const s = raw.trim();
2017
+ const mix = s.match(COLOR_MIX_RE);
2018
+ if (mix) return { color: mix[1], opacity: Math.min(100, Number(mix[2])) / 100 };
2019
+ const plain = s.match(PLAIN_VAR_RE);
2020
+ return plain ? { color: plain[1], opacity: 1 } : null;
2021
+ }
2022
+ var colorsAndTypeMigration_2026_09_21_washColorAndOpacity = {
2023
+ id: "2026-09-21-wash-color-and-opacity",
2024
+ fromVersion: 8,
2025
+ toVersion: 9,
2026
+ appliesTo: "colors-and-type",
2027
+ apply(rawVars) {
2028
+ const out = { ...rawVars };
2029
+ for (const family of FAMILIES) {
2030
+ let color = null;
2031
+ for (const suffix of ["", "-low", "-high"]) {
2032
+ const key = `--${family}${suffix}`;
2033
+ const parsed = out[key] === void 0 ? null : parseFill(out[key]);
2034
+ if (!parsed) continue;
2035
+ color ??= parsed.color;
2036
+ out[`--${family}-opacity${suffix}`] = String(parsed.opacity);
2037
+ delete out[key];
2038
+ }
2039
+ if (color) out[`--${family}-color`] = `var(${color})`;
2040
+ }
2041
+ return out;
2042
+ }
2043
+ };
2044
+
2045
+ // src/editor/core/themes/migrations/2026-09-21-scrim-surface.ts
2046
+ var STOPS2 = {
2047
+ "--scrim-opacity-low": "--scrim-low",
2048
+ "--scrim-opacity": "--scrim",
2049
+ "--scrim-opacity-high": "--scrim-high"
2050
+ };
2051
+ var PAIR = /^--(imagelightbox|dialog)-scrim-(color|opacity)$/;
2052
+ var ref = (value) => value.startsWith("--") ? `var(${value})` : value;
2053
+ function fill(color, opacity) {
2054
+ if (color === "--scrim-color" && STOPS2[opacity]) return STOPS2[opacity];
2055
+ if (opacity === "1") return color;
2056
+ const pct = Number.isFinite(Number(opacity)) ? `${Number(opacity) * 100}%` : `calc(${ref(opacity)} * 100%)`;
2057
+ return `color-mix(in srgb, ${ref(color)} ${pct}, transparent)`;
2058
+ }
2059
+ var componentMigration_2026_09_21_scrimSurface = {
2060
+ id: "2026-09-21-scrim-surface",
2061
+ fromVersion: 37,
2062
+ toVersion: 38,
2063
+ appliesTo: "component-config",
2064
+ apply(rawVars) {
2065
+ const out = {};
2066
+ const pairs = {};
2067
+ for (const [key, value] of Object.entries(rawVars)) {
2068
+ const match = PAIR.exec(key);
2069
+ if (!match) {
2070
+ out[key] = value;
2071
+ continue;
2072
+ }
2073
+ (pairs[match[1]] ??= {})[match[2]] = value;
2074
+ }
2075
+ for (const [id, { color = "--scrim-color", opacity = "--scrim-opacity-high" }] of Object.entries(pairs)) {
2076
+ out[`--${id}-scrim-surface`] = fill(color, opacity);
2077
+ }
2078
+ return out;
2079
+ }
2080
+ };
2081
+
1982
2082
  // src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts
1983
2083
  var RENAMES8 = {
1984
2084
  cornerbadge: {
@@ -2174,7 +2274,10 @@ var MIGRATIONS = [
2174
2274
  componentMigration_2026_09_13_toggleLabel,
2175
2275
  componentMigration_2026_09_13_collapsiblesectionOpen,
2176
2276
  componentMigration_2026_09_13_badgeBrand,
2177
- componentMigration_2026_09_20_imagelightboxScrim
2277
+ componentMigration_2026_09_20_imagelightboxScrim,
2278
+ componentMigration_2026_09_20_scrimColorAndOpacity,
2279
+ colorsAndTypeMigration_2026_09_21_washColorAndOpacity,
2280
+ componentMigration_2026_09_21_scrimSurface
2178
2281
  ];
2179
2282
  function countFor(kind) {
2180
2283
  return MIGRATIONS.filter((m) => m.appliesTo === kind).length;
@@ -2521,7 +2624,7 @@ function migrateComponentConfig(component, aliasesIn, rawConfig, fileVersion) {
2521
2624
  config: configOut
2522
2625
  };
2523
2626
  }
2524
- var FAMILIES = ["canvas", "neutral", "alternate", "primary", "accent", "special"];
2627
+ var FAMILIES2 = ["canvas", "neutral", "alternate", "primary", "accent", "special"];
2525
2628
  var SIZE_VARIANTS = ["lg", "md", "sm"];
2526
2629
  function renameSectionDividerObjectSlots(objectPart) {
2527
2630
  const canvasSourceKeys = [
@@ -2539,7 +2642,7 @@ function renameSectionDividerObjectSlots(objectPart) {
2539
2642
  const out = {};
2540
2643
  for (const [key, value] of Object.entries(objectPart)) {
2541
2644
  let isFamilyGradient = false;
2542
- for (const f of FAMILIES) {
2645
+ for (const f of FAMILIES2) {
2543
2646
  if (key === `--sectiondivider-${f}-background` || key === `--sectiondivider-${f}-gradient` || key === `--sectiondivider-color-${f}-background`) {
2544
2647
  isFamilyGradient = true;
2545
2648
  break;
@@ -3883,6 +3986,46 @@ var tokensCssMigration_2026_09_01_tintScale = {
3883
3986
  }
3884
3987
  };
3885
3988
 
3989
+ // vite-plugin/tokensCssMigrations/migrations/2026-09-20-scrim-color-and-opacity.ts
3990
+ var ENTRIES2 = [
3991
+ { name: "--scrim-color", value: "rgb(20, 3, 0)" },
3992
+ { name: "--scrim-opacity-low", value: "0.38" },
3993
+ { name: "--scrim-opacity", value: "0.51" },
3994
+ { name: "--scrim-opacity-high", value: "0.64" }
3995
+ ];
3996
+ var tokensCssMigration_2026_09_20_scrimColorAndOpacity = {
3997
+ id: "2026-09-20-scrim-color-and-opacity",
3998
+ kind: "additive",
3999
+ description: "Add --scrim-color and --scrim-opacity-*; a scrim's colour and strength are separate tokens",
4000
+ apply(css) {
4001
+ return ensureScale(css, {
4002
+ entries: ENTRIES2,
4003
+ sectionComment: "Scrim colour and strength, which each screen mixes where it paints",
4004
+ anchorPrefixes: ["--scrim"]
4005
+ });
4006
+ }
4007
+ };
4008
+
4009
+ // vite-plugin/tokensCssMigrations/migrations/2026-09-21-tint-color-and-opacity.ts
4010
+ var ENTRIES3 = [
4011
+ { name: "--tint-color", value: "rgb(255, 255, 255)" },
4012
+ { name: "--tint-opacity-low", value: "0.05" },
4013
+ { name: "--tint-opacity", value: "0.1" },
4014
+ { name: "--tint-opacity-high", value: "0.15" }
4015
+ ];
4016
+ var tokensCssMigration_2026_09_21_tintColorAndOpacity = {
4017
+ id: "2026-09-21-tint-color-and-opacity",
4018
+ kind: "additive",
4019
+ description: "Add --tint-color and --tint-opacity-*; a tint's colour and strength are separate tokens",
4020
+ apply(css) {
4021
+ return ensureScale(css, {
4022
+ entries: ENTRIES3,
4023
+ sectionComment: "Tint colour and strength, which the --tint-* stops compose",
4024
+ anchorPrefixes: ["--tint"]
4025
+ });
4026
+ }
4027
+ };
4028
+
3886
4029
  // vite-plugin/tokensCssMigrations/index.ts
3887
4030
  var TOKENS_CSS_MIGRATIONS = [
3888
4031
  tokensCssMigration_2026_05_29_typographyScaleAdditions,
@@ -3899,7 +4042,9 @@ var TOKENS_CSS_MIGRATIONS = [
3899
4042
  tokensCssMigration_2026_08_27_editorialSizeSteps,
3900
4043
  tokensCssMigration_2026_08_27_editorialLargeSteps,
3901
4044
  tokensCssMigration_2026_09_01_scrimRename,
3902
- tokensCssMigration_2026_09_01_tintScale
4045
+ tokensCssMigration_2026_09_01_tintScale,
4046
+ tokensCssMigration_2026_09_20_scrimColorAndOpacity,
4047
+ tokensCssMigration_2026_09_21_tintColorAndOpacity
3903
4048
  ];
3904
4049
  function runTokensCssMigrations(css) {
3905
4050
  return foldMigrations(css, () => true);
@@ -3930,9 +4075,9 @@ function validateTokensCss(input) {
3930
4075
  const body = extractGlobalRootBody(source);
3931
4076
  if (!body) continue;
3932
4077
  for (const t of collectDefinedTokens(body)) defined.add(t);
3933
- for (const ref of collectReferencedTokens(body)) {
3934
- let set = referencedBy.get(ref);
3935
- if (!set) referencedBy.set(ref, set = /* @__PURE__ */ new Set());
4078
+ for (const ref2 of collectReferencedTokens(body)) {
4079
+ let set = referencedBy.get(ref2);
4080
+ if (!set) referencedBy.set(ref2, set = /* @__PURE__ */ new Set());
3936
4081
  set.add(name);
3937
4082
  }
3938
4083
  }
@@ -5,7 +5,7 @@ import {
5
5
  nextAvailableName,
6
6
  normalizeTheme,
7
7
  versionedFileResourceServer
8
- } from "./chunk-LBZISJPG.js";
8
+ } from "./chunk-W5VQV32K.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-6JKUYCPL.js";
19
+ } from "./chunk-ONYAIXCZ.js";
20
20
  import {
21
21
  TOKENS_CSS_MIGRATIONS,
22
22
  extractGlobalRootBody,
23
23
  runAdditiveTokensCssMigrations,
24
24
  runTokensCssMigrations,
25
25
  validateTokensCss
26
- } from "./chunk-RFVYPNRO.js";
26
+ } from "./chunk-GWMEYBZ2.js";
27
27
  import {
28
28
  hexToOklch,
29
29
  oklchToRgb255,
@@ -1375,6 +1375,106 @@ var componentMigration_2026_09_20_imagelightboxScrim = {
1375
1375
  }
1376
1376
  };
1377
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-21-wash-color-and-opacity.ts
1408
+ var FAMILIES = ["scrim", "tint"];
1409
+ var COLOR_MIX_RE = /^color-mix\(in srgb,\s*var\((--[a-z0-9-]+)\)\s+(\d+(?:\.\d+)?)%,\s*transparent\)$/i;
1410
+ var PLAIN_VAR_RE = /^var\((--[a-z0-9-]+)\)$/i;
1411
+ function parseFill(raw) {
1412
+ const s = raw.trim();
1413
+ const mix = s.match(COLOR_MIX_RE);
1414
+ if (mix) return { color: mix[1], opacity: Math.min(100, Number(mix[2])) / 100 };
1415
+ const plain = s.match(PLAIN_VAR_RE);
1416
+ return plain ? { color: plain[1], opacity: 1 } : null;
1417
+ }
1418
+ var colorsAndTypeMigration_2026_09_21_washColorAndOpacity = {
1419
+ id: "2026-09-21-wash-color-and-opacity",
1420
+ fromVersion: 8,
1421
+ toVersion: 9,
1422
+ appliesTo: "colors-and-type",
1423
+ apply(rawVars) {
1424
+ const out = { ...rawVars };
1425
+ for (const family of FAMILIES) {
1426
+ let color = null;
1427
+ for (const suffix of ["", "-low", "-high"]) {
1428
+ const key = `--${family}${suffix}`;
1429
+ const parsed = out[key] === void 0 ? null : parseFill(out[key]);
1430
+ if (!parsed) continue;
1431
+ color ??= parsed.color;
1432
+ out[`--${family}-opacity${suffix}`] = String(parsed.opacity);
1433
+ delete out[key];
1434
+ }
1435
+ if (color) out[`--${family}-color`] = `var(${color})`;
1436
+ }
1437
+ return out;
1438
+ }
1439
+ };
1440
+
1441
+ // src/editor/core/themes/migrations/2026-09-21-scrim-surface.ts
1442
+ var STOPS2 = {
1443
+ "--scrim-opacity-low": "--scrim-low",
1444
+ "--scrim-opacity": "--scrim",
1445
+ "--scrim-opacity-high": "--scrim-high"
1446
+ };
1447
+ var PAIR = /^--(imagelightbox|dialog)-scrim-(color|opacity)$/;
1448
+ var ref = (value) => value.startsWith("--") ? `var(${value})` : value;
1449
+ function fill(color, opacity) {
1450
+ if (color === "--scrim-color" && STOPS2[opacity]) return STOPS2[opacity];
1451
+ if (opacity === "1") return color;
1452
+ const pct = Number.isFinite(Number(opacity)) ? `${Number(opacity) * 100}%` : `calc(${ref(opacity)} * 100%)`;
1453
+ return `color-mix(in srgb, ${ref(color)} ${pct}, transparent)`;
1454
+ }
1455
+ var componentMigration_2026_09_21_scrimSurface = {
1456
+ id: "2026-09-21-scrim-surface",
1457
+ fromVersion: 37,
1458
+ toVersion: 38,
1459
+ appliesTo: "component-config",
1460
+ apply(rawVars) {
1461
+ const out = {};
1462
+ const pairs = {};
1463
+ for (const [key, value] of Object.entries(rawVars)) {
1464
+ const match = PAIR.exec(key);
1465
+ if (!match) {
1466
+ out[key] = value;
1467
+ continue;
1468
+ }
1469
+ (pairs[match[1]] ??= {})[match[2]] = value;
1470
+ }
1471
+ for (const [id, { color = "--scrim-color", opacity = "--scrim-opacity-high" }] of Object.entries(pairs)) {
1472
+ out[`--${id}-scrim-surface`] = fill(color, opacity);
1473
+ }
1474
+ return out;
1475
+ }
1476
+ };
1477
+
1378
1478
  // src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts
1379
1479
  var RENAMES8 = {
1380
1480
  cornerbadge: {
@@ -1570,7 +1670,10 @@ var MIGRATIONS = [
1570
1670
  componentMigration_2026_09_13_toggleLabel,
1571
1671
  componentMigration_2026_09_13_collapsiblesectionOpen,
1572
1672
  componentMigration_2026_09_13_badgeBrand,
1573
- componentMigration_2026_09_20_imagelightboxScrim
1673
+ componentMigration_2026_09_20_imagelightboxScrim,
1674
+ componentMigration_2026_09_20_scrimColorAndOpacity,
1675
+ colorsAndTypeMigration_2026_09_21_washColorAndOpacity,
1676
+ componentMigration_2026_09_21_scrimSurface
1574
1677
  ];
1575
1678
  function countFor(kind) {
1576
1679
  return MIGRATIONS.filter((m) => m.appliesTo === kind).length;
@@ -1609,7 +1712,7 @@ function migrateComponentConfig(component, aliasesIn, rawConfig, fileVersion) {
1609
1712
  config: configOut
1610
1713
  };
1611
1714
  }
1612
- var FAMILIES = ["canvas", "neutral", "alternate", "primary", "accent", "special"];
1715
+ var FAMILIES2 = ["canvas", "neutral", "alternate", "primary", "accent", "special"];
1613
1716
  var SIZE_VARIANTS = ["lg", "md", "sm"];
1614
1717
  function renameSectionDividerObjectSlots(objectPart) {
1615
1718
  const canvasSourceKeys = [
@@ -1627,7 +1730,7 @@ function renameSectionDividerObjectSlots(objectPart) {
1627
1730
  const out = {};
1628
1731
  for (const [key, value] of Object.entries(objectPart)) {
1629
1732
  let isFamilyGradient = false;
1630
- for (const f of FAMILIES) {
1733
+ for (const f of FAMILIES2) {
1631
1734
  if (key === `--sectiondivider-${f}-background` || key === `--sectiondivider-${f}-gradient` || key === `--sectiondivider-color-${f}-background`) {
1632
1735
  isFamilyGradient = true;
1633
1736
  break;
@@ -2560,9 +2663,9 @@ function migrateData(opts) {
2560
2663
  }
2561
2664
  const { theme, migrated, dropped } = normalizeTheme(raw, resolvers);
2562
2665
  themes.push({ slug, theme });
2563
- for (const ref of dropped) {
2666
+ for (const ref2 of dropped) {
2564
2667
  droppedRefs.push(
2565
- `theme "${slug}": the reference ${ref} resolved to nothing, so it carries the shipped default instead`
2668
+ `theme "${slug}": the reference ${ref2} resolved to nothing, so it carries the shipped default instead`
2566
2669
  );
2567
2670
  }
2568
2671
  if (migrated && import_fs3.default.existsSync(themesRes.filePath(slug))) {
@@ -7,10 +7,10 @@ import {
7
7
  normalizeTheme,
8
8
  planLegacyRenames,
9
9
  versionedFileResourceServer
10
- } from "../chunk-LBZISJPG.js";
10
+ } from "../chunk-W5VQV32K.js";
11
11
  import {
12
12
  CURRENT_COMPONENT_SCHEMA_VERSION
13
- } from "../chunk-6JKUYCPL.js";
13
+ } from "../chunk-ONYAIXCZ.js";
14
14
  import {
15
15
  readLiveTokensConfig,
16
16
  resolveDataDirs