@motion-proto/live-tokens 0.83.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist-plugin/{chunk-6JKUYCPL.js → chunk-FD4FVDOC.js} +31 -1
  3. package/dist-plugin/{chunk-LBZISJPG.js → chunk-M6BWSS6C.js} +1 -1
  4. package/dist-plugin/{chunk-RFVYPNRO.js → chunk-V2OVSC5Z.js} +22 -1
  5. package/dist-plugin/index.cjs +53 -2
  6. package/dist-plugin/index.js +3 -3
  7. package/dist-plugin/migrateData/index.cjs +31 -1
  8. package/dist-plugin/migrateData/index.js +2 -2
  9. package/dist-plugin/setColors/index.cjs +31 -1
  10. package/dist-plugin/setColors/index.js +1 -1
  11. package/dist-plugin/setGeometry/index.cjs +35 -3
  12. package/dist-plugin/setGeometry/index.d.cts +1 -1
  13. package/dist-plugin/setGeometry/index.d.ts +1 -1
  14. package/dist-plugin/setGeometry/index.js +5 -3
  15. package/dist-plugin/tokensCssMigrations/index.cjs +22 -1
  16. package/dist-plugin/tokensCssMigrations/index.js +1 -1
  17. package/package.json +1 -1
  18. package/src/editor/component-editor/DialogEditor.svelte +2 -1
  19. package/src/editor/component-editor/ImageLightboxEditor.svelte +2 -1
  20. package/src/editor/component-editor/scaffolding/TokenLayout.svelte +4 -1
  21. package/src/editor/core/components/aliasKinds.ts +5 -1
  22. package/src/editor/core/sketch/sketchLayer.ts +1 -1
  23. package/src/editor/core/themes/migrations/2026-09-20-scrim-color-and-opacity.ts +45 -0
  24. package/src/editor/core/themes/migrations/index.ts +2 -0
  25. package/src/editor/ui/UIVariantSelector.svelte +1 -1
  26. package/src/editor/ui/variantScales.ts +11 -0
  27. package/src/live-tokens/data/themes/autumn.json +5 -3
  28. package/src/live-tokens/data/themes/halloween.json +5 -3
  29. package/src/live-tokens/data/themes/midnight-study.json +5 -3
  30. package/src/live-tokens/data/themes/ocean.json +5 -3
  31. package/src/live-tokens/data/themes/royal-velvet.json +5 -3
  32. package/src/live-tokens/data/themes/sketchy.json +5 -3
  33. package/src/live-tokens/data/themes/spring-meadow.json +5 -3
  34. package/src/live-tokens/data/themes/sunset.json +5 -3
  35. package/src/system/components/Dialog.svelte +7 -2
  36. package/src/system/components/ImageLightbox.svelte +16 -19
  37. package/src/system/styles/tokens.css +12 -4
  38. package/src/testing-js/{chunk-RDHCBQ6I.js → chunk-WQJ6QB6Y.js} +8 -4
  39. package/src/testing-js/chunk-WQJ6QB6Y.js.map +1 -0
  40. package/src/testing-js/{chunk-XV5CYADO.js → chunk-XXABJNUU.js} +2 -2
  41. package/src/testing-js/component-behavior.contract.js +1 -1
  42. package/src/testing-js/component-editor.contract.js +1 -1
  43. package/src/testing-js/component-render.contract.js +1 -1
  44. package/src/testing-js/index.js +2 -2
  45. package/src/testing-js/page-compliance.contract.js +1 -1
  46. package/src/testing-js/vitest.js +2 -2
  47. package/src/testing-js/chunk-RDHCBQ6I.js.map +0 -1
  48. /package/src/testing-js/{chunk-XV5CYADO.js.map → chunk-XXABJNUU.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.84.0 — A scrim's colour and strength are separate tokens
4
+
5
+ ### Added
6
+
7
+ - **`--scrim-color` and `--scrim-opacity-low`, `--scrim-opacity`,
8
+ `--scrim-opacity-high`.** A theme holds one and moves the other: a light
9
+ `--scrim-color` gives a scrim that pales the page. The three `--scrim-*` stops
10
+ remain, composed from the two. The additive tokens-css migration
11
+ `2026-09-20-scrim-color-and-opacity` inserts the four names into an existing
12
+ `tokens.css`, and the dev plugin applies it on its own. The stops already in
13
+ that file keep their values; to have them follow `--scrim-color`, write each
14
+ as `color-mix(in srgb, var(--scrim-color) calc(var(--scrim-opacity) * 100%), transparent)`
15
+ with its own opacity stop.
16
+
17
+ - **The editor picks an opacity from its stops.** A property whose name ends in
18
+ `-opacity` takes a picker of the three scrim strengths, low, medium, and high.
19
+ The suffix used to fall under the fill rule, which offered a palette and wrote
20
+ a colour into a number.
21
+
22
+ ### Changed (breaking)
23
+
24
+ - **`--dialog-scrim-surface` and `--imagelightbox-scrim-surface` each split into
25
+ `-scrim-color` and `-scrim-opacity`.** Each screen mixes the pair where it
26
+ paints. ImageLightbox's `scrim` prop writes the colour and `scrimOpacity`
27
+ writes the strength, and the opacity now stands on its own. Migration
28
+ `2026-09-20-scrim-color-and-opacity` splits the old key in a saved component
29
+ config: a `--scrim-*` stop becomes that stop's opacity with `--scrim-color`,
30
+ and a hand-written fill becomes the colour at full strength. A project whose
31
+ `tokens.css` gave the scrim stops their own colour sets `--scrim-color` to it,
32
+ since Dialog and ImageLightbox now read that token.
33
+
3
34
  ## 0.83.0 — The catalogue entry names what rules a component out
4
35
 
5
36
  ### Added
@@ -1195,6 +1195,35 @@ 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
+
1198
1227
  // src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts
1199
1228
  var RENAMES8 = {
1200
1229
  cornerbadge: {
@@ -1390,7 +1419,8 @@ var MIGRATIONS = [
1390
1419
  componentMigration_2026_09_13_toggleLabel,
1391
1420
  componentMigration_2026_09_13_collapsiblesectionOpen,
1392
1421
  componentMigration_2026_09_13_badgeBrand,
1393
- componentMigration_2026_09_20_imagelightboxScrim
1422
+ componentMigration_2026_09_20_imagelightboxScrim,
1423
+ componentMigration_2026_09_20_scrimColorAndOpacity
1394
1424
  ];
1395
1425
  function countFor(kind) {
1396
1426
  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-FD4FVDOC.js";
5
5
 
6
6
  // vite-plugin/files/versionedFileResourceServer.ts
7
7
  import fs from "fs";
@@ -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);
@@ -1979,6 +1979,35 @@ 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
+
1982
2011
  // src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts
1983
2012
  var RENAMES8 = {
1984
2013
  cornerbadge: {
@@ -2174,7 +2203,8 @@ var MIGRATIONS = [
2174
2203
  componentMigration_2026_09_13_toggleLabel,
2175
2204
  componentMigration_2026_09_13_collapsiblesectionOpen,
2176
2205
  componentMigration_2026_09_13_badgeBrand,
2177
- componentMigration_2026_09_20_imagelightboxScrim
2206
+ componentMigration_2026_09_20_imagelightboxScrim,
2207
+ componentMigration_2026_09_20_scrimColorAndOpacity
2178
2208
  ];
2179
2209
  function countFor(kind) {
2180
2210
  return MIGRATIONS.filter((m) => m.appliesTo === kind).length;
@@ -3883,6 +3913,26 @@ var tokensCssMigration_2026_09_01_tintScale = {
3883
3913
  }
3884
3914
  };
3885
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
+
3886
3936
  // vite-plugin/tokensCssMigrations/index.ts
3887
3937
  var TOKENS_CSS_MIGRATIONS = [
3888
3938
  tokensCssMigration_2026_05_29_typographyScaleAdditions,
@@ -3899,7 +3949,8 @@ var TOKENS_CSS_MIGRATIONS = [
3899
3949
  tokensCssMigration_2026_08_27_editorialSizeSteps,
3900
3950
  tokensCssMigration_2026_08_27_editorialLargeSteps,
3901
3951
  tokensCssMigration_2026_09_01_scrimRename,
3902
- tokensCssMigration_2026_09_01_tintScale
3952
+ tokensCssMigration_2026_09_01_tintScale,
3953
+ tokensCssMigration_2026_09_20_scrimColorAndOpacity
3903
3954
  ];
3904
3955
  function runTokensCssMigrations(css) {
3905
3956
  return foldMigrations(css, () => true);
@@ -5,7 +5,7 @@ import {
5
5
  nextAvailableName,
6
6
  normalizeTheme,
7
7
  versionedFileResourceServer
8
- } from "./chunk-LBZISJPG.js";
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-6JKUYCPL.js";
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-RFVYPNRO.js";
26
+ } from "./chunk-V2OVSC5Z.js";
27
27
  import {
28
28
  hexToOklch,
29
29
  oklchToRgb255,
@@ -1375,6 +1375,35 @@ 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
+
1378
1407
  // src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts
1379
1408
  var RENAMES8 = {
1380
1409
  cornerbadge: {
@@ -1570,7 +1599,8 @@ var MIGRATIONS = [
1570
1599
  componentMigration_2026_09_13_toggleLabel,
1571
1600
  componentMigration_2026_09_13_collapsiblesectionOpen,
1572
1601
  componentMigration_2026_09_13_badgeBrand,
1573
- componentMigration_2026_09_20_imagelightboxScrim
1602
+ componentMigration_2026_09_20_imagelightboxScrim,
1603
+ componentMigration_2026_09_20_scrimColorAndOpacity
1574
1604
  ];
1575
1605
  function countFor(kind) {
1576
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-LBZISJPG.js";
10
+ } from "../chunk-M6BWSS6C.js";
11
11
  import {
12
12
  CURRENT_COMPONENT_SCHEMA_VERSION
13
- } from "../chunk-6JKUYCPL.js";
13
+ } from "../chunk-FD4FVDOC.js";
14
14
  import {
15
15
  readLiveTokensConfig,
16
16
  resolveDataDirs
@@ -2389,6 +2389,35 @@ var componentMigration_2026_09_20_imagelightboxScrim = {
2389
2389
  }
2390
2390
  };
2391
2391
 
2392
+ // src/editor/core/themes/migrations/2026-09-20-scrim-color-and-opacity.ts
2393
+ var STOPS = {
2394
+ "--scrim-low": "--scrim-opacity-low",
2395
+ "--scrim": "--scrim-opacity",
2396
+ "--scrim-high": "--scrim-opacity-high"
2397
+ };
2398
+ var SURFACE = /^--(imagelightbox|dialog)-scrim-surface$/;
2399
+ var componentMigration_2026_09_20_scrimColorAndOpacity = {
2400
+ id: "2026-09-20-scrim-color-and-opacity",
2401
+ fromVersion: 36,
2402
+ toVersion: 37,
2403
+ appliesTo: "component-config",
2404
+ apply(rawVars) {
2405
+ const out = {};
2406
+ for (const [key, value] of Object.entries(rawVars)) {
2407
+ const match = SURFACE.exec(key);
2408
+ if (!match) {
2409
+ out[key] = value;
2410
+ continue;
2411
+ }
2412
+ const stem = `--${match[1]}-scrim`;
2413
+ const stop = STOPS[value];
2414
+ out[`${stem}-color`] = stop ? "--scrim-color" : value;
2415
+ out[`${stem}-opacity`] = stop ?? "1";
2416
+ }
2417
+ return out;
2418
+ }
2419
+ };
2420
+
2392
2421
  // src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts
2393
2422
  var RENAMES8 = {
2394
2423
  cornerbadge: {
@@ -2584,7 +2613,8 @@ var MIGRATIONS = [
2584
2613
  componentMigration_2026_09_13_toggleLabel,
2585
2614
  componentMigration_2026_09_13_collapsiblesectionOpen,
2586
2615
  componentMigration_2026_09_13_badgeBrand,
2587
- componentMigration_2026_09_20_imagelightboxScrim
2616
+ componentMigration_2026_09_20_imagelightboxScrim,
2617
+ componentMigration_2026_09_20_scrimColorAndOpacity
2588
2618
  ];
2589
2619
  function countFor(kind) {
2590
2620
  return MIGRATIONS.filter((m) => m.appliesTo === kind).length;
@@ -18,7 +18,7 @@ import {
18
18
  } from "../chunk-O6GQ6GBH.js";
19
19
  import {
20
20
  CURRENT_COMPONENT_SCHEMA_VERSION
21
- } from "../chunk-6JKUYCPL.js";
21
+ } from "../chunk-FD4FVDOC.js";
22
22
  import {
23
23
  cssColorToOklch,
24
24
  gamutClamp,
@@ -74,6 +74,9 @@ var KIND_RULES = [
74
74
  { kind: "dot-size", suffix: ["-dot-size"] },
75
75
  { kind: "blur", suffix: ["-blur"], prefix: ["--blur-"] },
76
76
  { kind: "scale", suffix: ["-scale"], prefix: ["--scale-"] },
77
+ // A strength from 0 to 1 that the component mixes into a colour where it
78
+ // paints. A palette picker here writes a colour into a number.
79
+ { kind: "opacity", suffix: ["-opacity"], prefix: ["--scrim-opacity"] },
77
80
  { kind: "shadow", suffix: ["-shadow"], prefix: ["--shadow-"] },
78
81
  { kind: "padding", suffix: ["-padding", "-margin"] },
79
82
  { kind: "gap", suffix: ["-gap"] },
@@ -95,8 +98,7 @@ var KIND_RULES = [
95
98
  "-indicator",
96
99
  "-thumb",
97
100
  "-color",
98
- "-tint",
99
- "-opacity"
101
+ "-tint"
100
102
  ],
101
103
  prefix: ["--surface-", "--tint", "--color-"]
102
104
  }
@@ -1538,6 +1540,35 @@ var componentMigration_2026_09_20_imagelightboxScrim = {
1538
1540
  }
1539
1541
  };
1540
1542
 
1543
+ // src/editor/core/themes/migrations/2026-09-20-scrim-color-and-opacity.ts
1544
+ var STOPS = {
1545
+ "--scrim-low": "--scrim-opacity-low",
1546
+ "--scrim": "--scrim-opacity",
1547
+ "--scrim-high": "--scrim-opacity-high"
1548
+ };
1549
+ var SURFACE = /^--(imagelightbox|dialog)-scrim-surface$/;
1550
+ var componentMigration_2026_09_20_scrimColorAndOpacity = {
1551
+ id: "2026-09-20-scrim-color-and-opacity",
1552
+ fromVersion: 36,
1553
+ toVersion: 37,
1554
+ appliesTo: "component-config",
1555
+ apply(rawVars) {
1556
+ const out = {};
1557
+ for (const [key, value] of Object.entries(rawVars)) {
1558
+ const match = SURFACE.exec(key);
1559
+ if (!match) {
1560
+ out[key] = value;
1561
+ continue;
1562
+ }
1563
+ const stem = `--${match[1]}-scrim`;
1564
+ const stop = STOPS[value];
1565
+ out[`${stem}-color`] = stop ? "--scrim-color" : value;
1566
+ out[`${stem}-opacity`] = stop ?? "1";
1567
+ }
1568
+ return out;
1569
+ }
1570
+ };
1571
+
1541
1572
  // src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts
1542
1573
  var RENAMES8 = {
1543
1574
  cornerbadge: {
@@ -1733,7 +1764,8 @@ var MIGRATIONS = [
1733
1764
  componentMigration_2026_09_13_toggleLabel,
1734
1765
  componentMigration_2026_09_13_collapsiblesectionOpen,
1735
1766
  componentMigration_2026_09_13_badgeBrand,
1736
- componentMigration_2026_09_20_imagelightboxScrim
1767
+ componentMigration_2026_09_20_imagelightboxScrim,
1768
+ componentMigration_2026_09_20_scrimColorAndOpacity
1737
1769
  ];
1738
1770
  function countFor(kind) {
1739
1771
  return MIGRATIONS.filter((m) => m.appliesTo === kind).length;
@@ -37,7 +37,7 @@ interface AdjustResult {
37
37
  }
38
38
  declare function adjustAliases(configs: Record<string, ComponentConfig>, ops: readonly AdjustOp[], now: string): AdjustResult;
39
39
 
40
- type TokenKind = 'surface' | 'border' | 'border-width' | 'hairline-width' | 'indicator-width' | 'radius' | 'track-height' | 'hairline-inset' | 'dot-size' | 'length' | 'blur' | 'scale' | 'shadow' | 'font-family' | 'font-weight' | 'font-size' | 'line-height' | 'letter-spacing' | 'padding' | 'gap' | 'duration' | 'easing' | 'text-color';
40
+ type TokenKind = 'surface' | 'border' | 'border-width' | 'hairline-width' | 'indicator-width' | 'radius' | 'track-height' | 'hairline-inset' | 'dot-size' | 'length' | 'blur' | 'scale' | 'opacity' | 'shadow' | 'font-family' | 'font-weight' | 'font-size' | 'line-height' | 'letter-spacing' | 'padding' | 'gap' | 'duration' | 'easing' | 'text-color';
41
41
  /** Side-aware kind test. Per-side paddings (`--card-default-body-padding-top`)
42
42
  are written by UIPaddingSelector and never declared as editor tokens, so
43
43
  `rawKind` never meets one; the CLI does, and they belong with their parent. */
@@ -37,7 +37,7 @@ interface AdjustResult {
37
37
  }
38
38
  declare function adjustAliases(configs: Record<string, ComponentConfig>, ops: readonly AdjustOp[], now: string): AdjustResult;
39
39
 
40
- type TokenKind = 'surface' | 'border' | 'border-width' | 'hairline-width' | 'indicator-width' | 'radius' | 'track-height' | 'hairline-inset' | 'dot-size' | 'length' | 'blur' | 'scale' | 'shadow' | 'font-family' | 'font-weight' | 'font-size' | 'line-height' | 'letter-spacing' | 'padding' | 'gap' | 'duration' | 'easing' | 'text-color';
40
+ type TokenKind = 'surface' | 'border' | 'border-width' | 'hairline-width' | 'indicator-width' | 'radius' | 'track-height' | 'hairline-inset' | 'dot-size' | 'length' | 'blur' | 'scale' | 'opacity' | 'shadow' | 'font-family' | 'font-weight' | 'font-size' | 'line-height' | 'letter-spacing' | 'padding' | 'gap' | 'duration' | 'easing' | 'text-color';
41
41
  /** Side-aware kind test. Per-side paddings (`--card-default-body-padding-top`)
42
42
  are written by UIPaddingSelector and never declared as editor tokens, so
43
43
  `rawKind` never meets one; the CLI does, and they belong with their parent. */
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CURRENT_COMPONENT_SCHEMA_VERSION
3
- } from "../chunk-6JKUYCPL.js";
3
+ } from "../chunk-FD4FVDOC.js";
4
4
  import {
5
5
  readLiveTokensConfig,
6
6
  resolveDataDirs
@@ -42,6 +42,9 @@ var KIND_RULES = [
42
42
  { kind: "dot-size", suffix: ["-dot-size"] },
43
43
  { kind: "blur", suffix: ["-blur"], prefix: ["--blur-"] },
44
44
  { kind: "scale", suffix: ["-scale"], prefix: ["--scale-"] },
45
+ // A strength from 0 to 1 that the component mixes into a colour where it
46
+ // paints. A palette picker here writes a colour into a number.
47
+ { kind: "opacity", suffix: ["-opacity"], prefix: ["--scrim-opacity"] },
45
48
  { kind: "shadow", suffix: ["-shadow"], prefix: ["--shadow-"] },
46
49
  { kind: "padding", suffix: ["-padding", "-margin"] },
47
50
  { kind: "gap", suffix: ["-gap"] },
@@ -63,8 +66,7 @@ var KIND_RULES = [
63
66
  "-indicator",
64
67
  "-thumb",
65
68
  "-color",
66
- "-tint",
67
- "-opacity"
69
+ "-tint"
68
70
  ],
69
71
  prefix: ["--surface-", "--tint", "--color-"]
70
72
  }
@@ -639,6 +639,26 @@ var tokensCssMigration_2026_09_01_tintScale = {
639
639
  }
640
640
  };
641
641
 
642
+ // vite-plugin/tokensCssMigrations/migrations/2026-09-20-scrim-color-and-opacity.ts
643
+ var ENTRIES2 = [
644
+ { name: "--scrim-color", value: "rgb(20, 3, 0)" },
645
+ { name: "--scrim-opacity-low", value: "0.38" },
646
+ { name: "--scrim-opacity", value: "0.51" },
647
+ { name: "--scrim-opacity-high", value: "0.64" }
648
+ ];
649
+ var tokensCssMigration_2026_09_20_scrimColorAndOpacity = {
650
+ id: "2026-09-20-scrim-color-and-opacity",
651
+ kind: "additive",
652
+ description: "Add --scrim-color and --scrim-opacity-*; a scrim's colour and strength are separate tokens",
653
+ apply(css) {
654
+ return ensureScale(css, {
655
+ entries: ENTRIES2,
656
+ sectionComment: "Scrim colour and strength, which each screen mixes where it paints",
657
+ anchorPrefixes: ["--scrim"]
658
+ });
659
+ }
660
+ };
661
+
642
662
  // vite-plugin/files/dataPaths.ts
643
663
  var import_fs = __toESM(require("fs"), 1);
644
664
  var import_path = __toESM(require("path"), 1);
@@ -691,7 +711,8 @@ var TOKENS_CSS_MIGRATIONS = [
691
711
  tokensCssMigration_2026_08_27_editorialSizeSteps,
692
712
  tokensCssMigration_2026_08_27_editorialLargeSteps,
693
713
  tokensCssMigration_2026_09_01_scrimRename,
694
- tokensCssMigration_2026_09_01_tintScale
714
+ tokensCssMigration_2026_09_01_tintScale,
715
+ tokensCssMigration_2026_09_20_scrimColorAndOpacity
695
716
  ];
696
717
  function runTokensCssMigrations(css) {
697
718
  return foldMigrations(css, () => true);
@@ -13,7 +13,7 @@ import {
13
13
  runTokensCssMigrations,
14
14
  semverBumpType,
15
15
  validateTokensCss
16
- } from "../chunk-RFVYPNRO.js";
16
+ } from "../chunk-V2OVSC5Z.js";
17
17
  import "../chunk-7TQQTHI6.js";
18
18
  import {
19
19
  readLiveTokensConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motion-proto/live-tokens",
3
- "version": "0.83.0",
3
+ "version": "0.84.0",
4
4
  "type": "module",
5
5
  "description": "Design token editor with live CSS variable editing. Svelte 5 + Vite 8.",
6
6
  "keywords": [
@@ -16,7 +16,8 @@
16
16
  // Button styling lives in Button.svelte — the dialog only owns its own chrome.
17
17
  const frameStates: Record<string, Token[]> = {
18
18
  scrim: [
19
- { label: 'scrim color', groupKey: 'surface', variable: '--dialog-scrim-surface' },
19
+ { label: 'scrim color', groupKey: 'surface', variable: '--dialog-scrim-color' },
20
+ { label: 'scrim opacity', variable: '--dialog-scrim-opacity' },
20
21
  ],
21
22
  dialog: [
22
23
  { label: 'surface color', variable: '--dialog-surface' },
@@ -15,7 +15,8 @@
15
15
  { label: 'tile shadow', variable: '--imagelightbox-tile-shadow' },
16
16
  ],
17
17
  overlay: [
18
- { label: 'scrim color', groupKey: 'surface', variable: '--imagelightbox-scrim-surface' },
18
+ { label: 'scrim color', groupKey: 'surface', variable: '--imagelightbox-scrim-color' },
19
+ { label: 'scrim opacity', variable: '--imagelightbox-scrim-opacity' },
19
20
  ],
20
21
  chrome: [
21
22
  { label: 'surface color', groupKey: 'surface', variable: '--imagelightbox-chrome-surface' },
@@ -9,7 +9,7 @@
9
9
  import UIPaddingSelector from '../../ui/UIPaddingSelector.svelte';
10
10
  import UILetterSpacingSelector from '../../ui/UILetterSpacingSelector.svelte';
11
11
  import UIEasingSelector from '../../ui/UIEasingSelector.svelte';
12
- import { BLUR, BORDER_WIDTH, DOT_SIZE, DURATION, RADIUS, SCALE, SHADOW, TRACK_HEIGHT, HAIRLINE_INSET } from '../../ui/variantScales';
12
+ import { BLUR, BORDER_WIDTH, DOT_SIZE, DURATION, RADIUS, SCALE, SCRIM_OPACITY, SHADOW, TRACK_HEIGHT, HAIRLINE_INSET } from '../../ui/variantScales';
13
13
  import {
14
14
  editorState,
15
15
  getComponentPropertySiblings,
@@ -80,6 +80,7 @@
80
80
  'easing',
81
81
  'blur',
82
82
  'scale',
83
+ 'opacity',
83
84
  'shadow',
84
85
  'text-color',
85
86
  'surface',
@@ -160,6 +161,7 @@
160
161
  'easing': { component: UIEasingSelector },
161
162
  'blur': { component: UIVariantSelector, extra: () => ({ ...BLUR }) },
162
163
  'scale': { component: UIVariantSelector, extra: () => ({ ...SCALE }) },
164
+ 'opacity': { component: UIVariantSelector, extra: () => ({ ...SCRIM_OPACITY }) },
163
165
  'shadow': { component: UIVariantSelector, extra: () => ({ ...SHADOW }) },
164
166
  'surface': { component: UIPaletteSelector, extra: paletteExtra },
165
167
  'border': { component: UIPaletteSelector, extra: paletteExtra },
@@ -190,6 +192,7 @@
190
192
  'easing',
191
193
  'blur',
192
194
  'scale',
195
+ 'opacity',
193
196
  'shadow',
194
197
  'surface',
195
198
  'border-width',
@@ -11,6 +11,7 @@ export type TokenKind =
11
11
  | 'length'
12
12
  | 'blur'
13
13
  | 'scale'
14
+ | 'opacity'
14
15
  | 'shadow'
15
16
  | 'font-family'
16
17
  | 'font-weight'
@@ -59,6 +60,9 @@ export const KIND_RULES: ReadonlyArray<{
59
60
  { kind: 'dot-size', suffix: ['-dot-size'] },
60
61
  { kind: 'blur', suffix: ['-blur'], prefix: ['--blur-'] },
61
62
  { kind: 'scale', suffix: ['-scale'], prefix: ['--scale-'] },
63
+ // A strength from 0 to 1 that the component mixes into a colour where it
64
+ // paints. A palette picker here writes a colour into a number.
65
+ { kind: 'opacity', suffix: ['-opacity'], prefix: ['--scrim-opacity'] },
62
66
  { kind: 'shadow', suffix: ['-shadow'], prefix: ['--shadow-'] },
63
67
  { kind: 'padding', suffix: ['-padding', '-margin'] },
64
68
  { kind: 'gap', suffix: ['-gap'] },
@@ -73,7 +77,7 @@ export const KIND_RULES: ReadonlyArray<{
73
77
  // Fills. A tint is a wash over a surface, so it takes the surface picker: the
74
78
  // full palette with an alpha, not just the tint stops it defaults to.
75
79
  { kind: 'surface', suffix: ['-surface', '-fill', '-indicator',
76
- '-thumb', '-color', '-tint', '-opacity'],
80
+ '-thumb', '-color', '-tint'],
77
81
  prefix: ['--surface-', '--tint', '--color-'] },
78
82
  ];
79
83
 
@@ -186,7 +186,7 @@ const PART_SPECS: readonly PartSpec[] = [
186
186
  { sel: '.image-lightbox-thumb', stem: 'imagelightbox-tile', positioned: true, clips: true },
187
187
  // A fixed full-viewport scrim behind the open modal; no border of its own.
188
188
  {
189
- sel: '.image-lightbox-overlay', fill: 'var(--imagelightbox-scrim-surface)',
189
+ sel: '.image-lightbox-overlay', fill: 'color-mix(in srgb, var(--imagelightbox-scrim-color) calc(var(--imagelightbox-scrim-opacity) * 100%), transparent)',
190
190
  stroke: 'transparent', positioned: true, unmasked: true,
191
191
  },
192
192
  // Close and the two nav chevrons all carry this class; each is fixed and