@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.
- package/CHANGELOG.md +31 -0
- package/dist-plugin/{chunk-6JKUYCPL.js → chunk-FD4FVDOC.js} +31 -1
- package/dist-plugin/{chunk-LBZISJPG.js → chunk-M6BWSS6C.js} +1 -1
- package/dist-plugin/{chunk-RFVYPNRO.js → chunk-V2OVSC5Z.js} +22 -1
- package/dist-plugin/index.cjs +53 -2
- package/dist-plugin/index.js +3 -3
- package/dist-plugin/migrateData/index.cjs +31 -1
- package/dist-plugin/migrateData/index.js +2 -2
- package/dist-plugin/setColors/index.cjs +31 -1
- package/dist-plugin/setColors/index.js +1 -1
- package/dist-plugin/setGeometry/index.cjs +35 -3
- 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 +1 -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/core/components/aliasKinds.ts +5 -1
- package/src/editor/core/sketch/sketchLayer.ts +1 -1
- package/src/editor/core/themes/migrations/2026-09-20-scrim-color-and-opacity.ts +45 -0
- package/src/editor/core/themes/migrations/index.ts +2 -0
- package/src/editor/ui/UIVariantSelector.svelte +1 -1
- package/src/editor/ui/variantScales.ts +11 -0
- package/src/live-tokens/data/themes/autumn.json +5 -3
- package/src/live-tokens/data/themes/halloween.json +5 -3
- package/src/live-tokens/data/themes/midnight-study.json +5 -3
- package/src/live-tokens/data/themes/ocean.json +5 -3
- package/src/live-tokens/data/themes/royal-velvet.json +5 -3
- package/src/live-tokens/data/themes/sketchy.json +5 -3
- package/src/live-tokens/data/themes/spring-meadow.json +5 -3
- package/src/live-tokens/data/themes/sunset.json +5 -3
- package/src/system/components/Dialog.svelte +7 -2
- package/src/system/components/ImageLightbox.svelte +16 -19
- package/src/system/styles/tokens.css +12 -4
- package/src/testing-js/{chunk-RDHCBQ6I.js → chunk-WQJ6QB6Y.js} +8 -4
- package/src/testing-js/chunk-WQJ6QB6Y.js.map +1 -0
- package/src/testing-js/{chunk-XV5CYADO.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-RDHCBQ6I.js.map +0 -1
- /package/src/testing-js/{chunk-XV5CYADO.js.map → chunk-XXABJNUU.js.map} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Migration } from './index';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A scrim's colour and its strength, apart (2026-09-20).
|
|
5
|
+
*
|
|
6
|
+
* `-scrim-surface` held one composed fill, so a theme that wanted a paler
|
|
7
|
+
* screen had to restate the colour to change the strength, and a light scrim
|
|
8
|
+
* meant hand-writing a `color-mix()`. The pair splits them: `-scrim-color`
|
|
9
|
+
* takes any colour, `-scrim-opacity` how much of it covers the page.
|
|
10
|
+
*
|
|
11
|
+
* The three `--scrim-*` stops still exist, composed from the two, so a value
|
|
12
|
+
* that named one maps to that stop's opacity and the scale's colour. Anything
|
|
13
|
+
* else was a hand-written fill: it becomes the colour, at full strength, which
|
|
14
|
+
* preserves what a reader saw when the old value was already opaque and
|
|
15
|
+
* otherwise leaves a value a person chose rather than guessing at its alpha.
|
|
16
|
+
*/
|
|
17
|
+
const STOPS: Record<string, string> = {
|
|
18
|
+
'--scrim-low': '--scrim-opacity-low',
|
|
19
|
+
'--scrim': '--scrim-opacity',
|
|
20
|
+
'--scrim-high': '--scrim-opacity-high',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const SURFACE = /^--(imagelightbox|dialog)-scrim-surface$/;
|
|
24
|
+
|
|
25
|
+
export const componentMigration_2026_09_20_scrimColorAndOpacity: Migration = {
|
|
26
|
+
id: '2026-09-20-scrim-color-and-opacity',
|
|
27
|
+
fromVersion: 36,
|
|
28
|
+
toVersion: 37,
|
|
29
|
+
appliesTo: 'component-config',
|
|
30
|
+
apply(rawVars) {
|
|
31
|
+
const out: Record<string, string> = {};
|
|
32
|
+
for (const [key, value] of Object.entries(rawVars)) {
|
|
33
|
+
const match = SURFACE.exec(key);
|
|
34
|
+
if (!match) {
|
|
35
|
+
out[key] = value;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const stem = `--${match[1]}-scrim`;
|
|
39
|
+
const stop = STOPS[value];
|
|
40
|
+
out[`${stem}-color`] = stop ? '--scrim-color' : value;
|
|
41
|
+
out[`${stem}-opacity`] = stop ?? '1';
|
|
42
|
+
}
|
|
43
|
+
return out;
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -80,6 +80,7 @@ import { componentMigration_2026_09_13_hairline } from './2026-09-13-hairline';
|
|
|
80
80
|
import { componentMigration_2026_09_13_indicator } from './2026-09-13-indicator';
|
|
81
81
|
import { componentMigration_2026_09_13_sectiondividerSurface } from './2026-09-13-sectiondivider-surface';
|
|
82
82
|
import { componentMigration_2026_09_20_imagelightboxScrim } from './2026-09-20-imagelightbox-scrim';
|
|
83
|
+
import { componentMigration_2026_09_20_scrimColorAndOpacity } from './2026-09-20-scrim-color-and-opacity';
|
|
83
84
|
import { componentMigration_2026_09_13_cornerbadgePrefix } from './2026-09-13-cornerbadge-prefix';
|
|
84
85
|
import { componentMigration_2026_09_13_toggleLabel } from './2026-09-13-toggle-label';
|
|
85
86
|
import { componentMigration_2026_09_13_collapsiblesectionOpen } from './2026-09-13-collapsiblesection-open';
|
|
@@ -134,6 +135,7 @@ export const MIGRATIONS: Migration[] = [
|
|
|
134
135
|
componentMigration_2026_09_13_collapsiblesectionOpen,
|
|
135
136
|
componentMigration_2026_09_13_badgeBrand,
|
|
136
137
|
componentMigration_2026_09_20_imagelightboxScrim,
|
|
138
|
+
componentMigration_2026_09_20_scrimColorAndOpacity,
|
|
137
139
|
];
|
|
138
140
|
|
|
139
141
|
function countFor(kind: 'colors-and-type' | 'component-config'): number {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
let validKeys = $derived(new Set(options.map((o) => o.key)));
|
|
56
56
|
let refMatcher = $derived.by(() => {
|
|
57
57
|
const escaped = varPrefix.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
58
|
-
return new RegExp(`var\\((${escaped}[^)\\s]
|
|
58
|
+
return new RegExp(`var\\((${escaped}[^)\\s]*)\\)`);
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
function parseRef(value: string): string | null {
|
|
@@ -45,6 +45,17 @@ export const SCALE: VariantScaleEntry = {
|
|
|
45
45
|
],
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
/** The scrim's three strengths. The middle stop has no suffix, as `--scrim`
|
|
49
|
+
* and `--tint` have none, so its key is empty. */
|
|
50
|
+
export const SCRIM_OPACITY: VariantScaleEntry = {
|
|
51
|
+
varPrefix: '--scrim-opacity',
|
|
52
|
+
options: [
|
|
53
|
+
{ key: '-low', label: 'Low', value: '0.38' },
|
|
54
|
+
{ key: '', label: 'Medium', value: '0.51' },
|
|
55
|
+
{ key: '-high', label: 'High', value: '0.64' },
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
|
|
48
59
|
export const BORDER_WIDTH: VariantScaleEntry = {
|
|
49
60
|
varPrefix: '--border-width-',
|
|
50
61
|
options: [
|
|
@@ -2996,7 +2996,8 @@
|
|
|
2996
2996
|
"createdAt": "2026-05-10T20:05:24.719Z",
|
|
2997
2997
|
"updatedAt": "2026-08-19T22:39:32.785Z",
|
|
2998
2998
|
"aliases": {
|
|
2999
|
-
"--dialog-scrim-
|
|
2999
|
+
"--dialog-scrim-color": "--scrim-color",
|
|
3000
|
+
"--dialog-scrim-opacity": "--scrim-opacity-high",
|
|
3000
3001
|
"--dialog-surface": "--surface-neutral-lowest",
|
|
3001
3002
|
"--dialog-border": "--border-neutral-strong",
|
|
3002
3003
|
"--dialog-border-width": "--border-width-2",
|
|
@@ -3140,7 +3141,8 @@
|
|
|
3140
3141
|
"--imagelightbox-tile-border": "--color-transparent",
|
|
3141
3142
|
"--imagelightbox-tile-border-width": "--border-width-0",
|
|
3142
3143
|
"--imagelightbox-tile-shadow": "--shadow-md",
|
|
3143
|
-
"--imagelightbox-scrim-
|
|
3144
|
+
"--imagelightbox-scrim-color": "color-mix(in srgb, var(--color-neutral-950) 76%, transparent)",
|
|
3145
|
+
"--imagelightbox-scrim-opacity": "1",
|
|
3144
3146
|
"--imagelightbox-chrome-surface": "--surface-neutral-low",
|
|
3145
3147
|
"--imagelightbox-chrome-border": "--border-brand",
|
|
3146
3148
|
"--imagelightbox-chrome-border-width": "--border-width-1",
|
|
@@ -3994,5 +3996,5 @@
|
|
|
3994
3996
|
}
|
|
3995
3997
|
}
|
|
3996
3998
|
},
|
|
3997
|
-
"componentSchemaVersion":
|
|
3999
|
+
"componentSchemaVersion": 37
|
|
3998
4000
|
}
|
|
@@ -3035,7 +3035,8 @@
|
|
|
3035
3035
|
"createdAt": "2026-05-10T20:05:24.719Z",
|
|
3036
3036
|
"updatedAt": "2026-08-19T22:39:32.785Z",
|
|
3037
3037
|
"aliases": {
|
|
3038
|
-
"--dialog-scrim-
|
|
3038
|
+
"--dialog-scrim-color": "--scrim-color",
|
|
3039
|
+
"--dialog-scrim-opacity": "--scrim-opacity-high",
|
|
3039
3040
|
"--dialog-surface": "--surface-neutral-lowest",
|
|
3040
3041
|
"--dialog-border": "--border-neutral-strong",
|
|
3041
3042
|
"--dialog-border-width": "--border-width-4",
|
|
@@ -3179,7 +3180,8 @@
|
|
|
3179
3180
|
"--imagelightbox-tile-border": "--color-transparent",
|
|
3180
3181
|
"--imagelightbox-tile-border-width": "--border-width-2",
|
|
3181
3182
|
"--imagelightbox-tile-shadow": "--shadow-md",
|
|
3182
|
-
"--imagelightbox-scrim-
|
|
3183
|
+
"--imagelightbox-scrim-color": "color-mix(in srgb, var(--color-neutral-950) 76%, transparent)",
|
|
3184
|
+
"--imagelightbox-scrim-opacity": "1",
|
|
3183
3185
|
"--imagelightbox-chrome-surface": "--surface-neutral-low",
|
|
3184
3186
|
"--imagelightbox-chrome-border": "--border-brand",
|
|
3185
3187
|
"--imagelightbox-chrome-border-width": "--border-width-3",
|
|
@@ -4033,5 +4035,5 @@
|
|
|
4033
4035
|
}
|
|
4034
4036
|
}
|
|
4035
4037
|
},
|
|
4036
|
-
"componentSchemaVersion":
|
|
4038
|
+
"componentSchemaVersion": 37
|
|
4037
4039
|
}
|
|
@@ -3053,7 +3053,8 @@
|
|
|
3053
3053
|
"createdAt": "2026-05-10T20:05:24.719Z",
|
|
3054
3054
|
"updatedAt": "2026-08-19T22:39:32.785Z",
|
|
3055
3055
|
"aliases": {
|
|
3056
|
-
"--dialog-scrim-
|
|
3056
|
+
"--dialog-scrim-color": "--scrim-color",
|
|
3057
|
+
"--dialog-scrim-opacity": "--scrim-opacity-high",
|
|
3057
3058
|
"--dialog-surface": "--surface-neutral-lowest",
|
|
3058
3059
|
"--dialog-border": "--border-neutral-strong",
|
|
3059
3060
|
"--dialog-border-width": "--border-width-2",
|
|
@@ -3197,7 +3198,8 @@
|
|
|
3197
3198
|
"--imagelightbox-tile-border": "--color-transparent",
|
|
3198
3199
|
"--imagelightbox-tile-border-width": "--border-width-0",
|
|
3199
3200
|
"--imagelightbox-tile-shadow": "--shadow-md",
|
|
3200
|
-
"--imagelightbox-scrim-
|
|
3201
|
+
"--imagelightbox-scrim-color": "color-mix(in srgb, var(--color-neutral-950) 76%, transparent)",
|
|
3202
|
+
"--imagelightbox-scrim-opacity": "1",
|
|
3201
3203
|
"--imagelightbox-chrome-surface": "--surface-neutral-low",
|
|
3202
3204
|
"--imagelightbox-chrome-border": "--border-brand",
|
|
3203
3205
|
"--imagelightbox-chrome-border-width": "--border-width-1",
|
|
@@ -4052,5 +4054,5 @@
|
|
|
4052
4054
|
}
|
|
4053
4055
|
}
|
|
4054
4056
|
},
|
|
4055
|
-
"componentSchemaVersion":
|
|
4057
|
+
"componentSchemaVersion": 37
|
|
4056
4058
|
}
|
|
@@ -2995,7 +2995,8 @@
|
|
|
2995
2995
|
"createdAt": "2026-05-10T20:05:24.719Z",
|
|
2996
2996
|
"updatedAt": "2026-08-19T22:39:32.785Z",
|
|
2997
2997
|
"aliases": {
|
|
2998
|
-
"--dialog-scrim-
|
|
2998
|
+
"--dialog-scrim-color": "--scrim-color",
|
|
2999
|
+
"--dialog-scrim-opacity": "--scrim-opacity-high",
|
|
2999
3000
|
"--dialog-surface": "--surface-neutral-lowest",
|
|
3000
3001
|
"--dialog-border": "--border-neutral-strong",
|
|
3001
3002
|
"--dialog-border-width": "--border-width-2",
|
|
@@ -3139,7 +3140,8 @@
|
|
|
3139
3140
|
"--imagelightbox-tile-border": "--color-transparent",
|
|
3140
3141
|
"--imagelightbox-tile-border-width": "--border-width-0",
|
|
3141
3142
|
"--imagelightbox-tile-shadow": "--shadow-md",
|
|
3142
|
-
"--imagelightbox-scrim-
|
|
3143
|
+
"--imagelightbox-scrim-color": "color-mix(in srgb, var(--color-neutral-950) 76%, transparent)",
|
|
3144
|
+
"--imagelightbox-scrim-opacity": "1",
|
|
3143
3145
|
"--imagelightbox-chrome-surface": "--surface-neutral-low",
|
|
3144
3146
|
"--imagelightbox-chrome-border": "--border-brand",
|
|
3145
3147
|
"--imagelightbox-chrome-border-width": "--border-width-1",
|
|
@@ -3993,5 +3995,5 @@
|
|
|
3993
3995
|
}
|
|
3994
3996
|
}
|
|
3995
3997
|
},
|
|
3996
|
-
"componentSchemaVersion":
|
|
3998
|
+
"componentSchemaVersion": 37
|
|
3997
3999
|
}
|
|
@@ -3026,7 +3026,8 @@
|
|
|
3026
3026
|
"createdAt": "2026-05-10T20:05:24.719Z",
|
|
3027
3027
|
"updatedAt": "2026-08-19T22:39:32.785Z",
|
|
3028
3028
|
"aliases": {
|
|
3029
|
-
"--dialog-scrim-
|
|
3029
|
+
"--dialog-scrim-color": "--scrim-color",
|
|
3030
|
+
"--dialog-scrim-opacity": "--scrim-opacity-high",
|
|
3030
3031
|
"--dialog-surface": "--surface-neutral-lowest",
|
|
3031
3032
|
"--dialog-border": "--border-neutral-strong",
|
|
3032
3033
|
"--dialog-border-width": "--border-width-3",
|
|
@@ -3170,7 +3171,8 @@
|
|
|
3170
3171
|
"--imagelightbox-tile-border": "--color-transparent",
|
|
3171
3172
|
"--imagelightbox-tile-border-width": "--border-width-1",
|
|
3172
3173
|
"--imagelightbox-tile-shadow": "--shadow-md",
|
|
3173
|
-
"--imagelightbox-scrim-
|
|
3174
|
+
"--imagelightbox-scrim-color": "color-mix(in srgb, var(--color-neutral-950) 76%, transparent)",
|
|
3175
|
+
"--imagelightbox-scrim-opacity": "1",
|
|
3174
3176
|
"--imagelightbox-chrome-surface": "--surface-neutral-low",
|
|
3175
3177
|
"--imagelightbox-chrome-border": "--border-brand",
|
|
3176
3178
|
"--imagelightbox-chrome-border-width": "--border-width-2",
|
|
@@ -4024,5 +4026,5 @@
|
|
|
4024
4026
|
}
|
|
4025
4027
|
}
|
|
4026
4028
|
},
|
|
4027
|
-
"componentSchemaVersion":
|
|
4029
|
+
"componentSchemaVersion": 37
|
|
4028
4030
|
}
|
|
@@ -3009,7 +3009,8 @@
|
|
|
3009
3009
|
"createdAt": "2026-05-10T20:05:24.719Z",
|
|
3010
3010
|
"updatedAt": "2026-08-25T01:13:11.520Z",
|
|
3011
3011
|
"aliases": {
|
|
3012
|
-
"--dialog-scrim-
|
|
3012
|
+
"--dialog-scrim-color": "--scrim-color",
|
|
3013
|
+
"--dialog-scrim-opacity": "--scrim-opacity-high",
|
|
3013
3014
|
"--dialog-surface": "--surface-neutral-lowest",
|
|
3014
3015
|
"--dialog-border": "--border-neutral-strong",
|
|
3015
3016
|
"--dialog-border-width": "--border-width-2",
|
|
@@ -3153,7 +3154,8 @@
|
|
|
3153
3154
|
"--imagelightbox-tile-border": "--color-transparent",
|
|
3154
3155
|
"--imagelightbox-tile-border-width": "--border-width-1",
|
|
3155
3156
|
"--imagelightbox-tile-shadow": "--shadow-md",
|
|
3156
|
-
"--imagelightbox-scrim-
|
|
3157
|
+
"--imagelightbox-scrim-color": "color-mix(in srgb, var(--color-neutral-950) 76%, transparent)",
|
|
3158
|
+
"--imagelightbox-scrim-opacity": "1",
|
|
3157
3159
|
"--imagelightbox-chrome-surface": "--surface-neutral-low",
|
|
3158
3160
|
"--imagelightbox-chrome-border": "--border-brand",
|
|
3159
3161
|
"--imagelightbox-chrome-border-width": "--border-width-1",
|
|
@@ -4007,5 +4009,5 @@
|
|
|
4007
4009
|
}
|
|
4008
4010
|
}
|
|
4009
4011
|
},
|
|
4010
|
-
"componentSchemaVersion":
|
|
4012
|
+
"componentSchemaVersion": 37
|
|
4011
4013
|
}
|
|
@@ -2982,7 +2982,8 @@
|
|
|
2982
2982
|
"createdAt": "2026-05-10T20:05:24.719Z",
|
|
2983
2983
|
"updatedAt": "2026-08-19T22:39:32.785Z",
|
|
2984
2984
|
"aliases": {
|
|
2985
|
-
"--dialog-scrim-
|
|
2985
|
+
"--dialog-scrim-color": "--scrim-color",
|
|
2986
|
+
"--dialog-scrim-opacity": "--scrim-opacity-high",
|
|
2986
2987
|
"--dialog-surface": "--surface-neutral-lowest",
|
|
2987
2988
|
"--dialog-border": "--border-neutral-strong",
|
|
2988
2989
|
"--dialog-border-width": "--border-width-2",
|
|
@@ -3126,7 +3127,8 @@
|
|
|
3126
3127
|
"--imagelightbox-tile-border": "--color-transparent",
|
|
3127
3128
|
"--imagelightbox-tile-border-width": "--border-width-0",
|
|
3128
3129
|
"--imagelightbox-tile-shadow": "--shadow-md",
|
|
3129
|
-
"--imagelightbox-scrim-
|
|
3130
|
+
"--imagelightbox-scrim-color": "color-mix(in srgb, var(--color-neutral-950) 76%, transparent)",
|
|
3131
|
+
"--imagelightbox-scrim-opacity": "1",
|
|
3130
3132
|
"--imagelightbox-chrome-surface": "--surface-neutral-low",
|
|
3131
3133
|
"--imagelightbox-chrome-border": "--border-brand",
|
|
3132
3134
|
"--imagelightbox-chrome-border-width": "--border-width-1",
|
|
@@ -3980,5 +3982,5 @@
|
|
|
3980
3982
|
}
|
|
3981
3983
|
}
|
|
3982
3984
|
},
|
|
3983
|
-
"componentSchemaVersion":
|
|
3985
|
+
"componentSchemaVersion": 37
|
|
3984
3986
|
}
|
|
@@ -3034,7 +3034,8 @@
|
|
|
3034
3034
|
"createdAt": "2026-05-10T20:05:24.719Z",
|
|
3035
3035
|
"updatedAt": "2026-08-19T22:39:32.785Z",
|
|
3036
3036
|
"aliases": {
|
|
3037
|
-
"--dialog-scrim-
|
|
3037
|
+
"--dialog-scrim-color": "--scrim-color",
|
|
3038
|
+
"--dialog-scrim-opacity": "--scrim-opacity-high",
|
|
3038
3039
|
"--dialog-surface": "--surface-neutral-lowest",
|
|
3039
3040
|
"--dialog-border": "--border-neutral-strong",
|
|
3040
3041
|
"--dialog-border-width": "--border-width-2",
|
|
@@ -3178,7 +3179,8 @@
|
|
|
3178
3179
|
"--imagelightbox-tile-border": "--color-transparent",
|
|
3179
3180
|
"--imagelightbox-tile-border-width": "--border-width-0",
|
|
3180
3181
|
"--imagelightbox-tile-shadow": "--shadow-md",
|
|
3181
|
-
"--imagelightbox-scrim-
|
|
3182
|
+
"--imagelightbox-scrim-color": "color-mix(in srgb, var(--color-neutral-950) 76%, transparent)",
|
|
3183
|
+
"--imagelightbox-scrim-opacity": "1",
|
|
3182
3184
|
"--imagelightbox-chrome-surface": "--surface-neutral-low",
|
|
3183
3185
|
"--imagelightbox-chrome-border": "--border-brand",
|
|
3184
3186
|
"--imagelightbox-chrome-border-width": "--border-width-1",
|
|
@@ -4032,5 +4034,5 @@
|
|
|
4032
4034
|
}
|
|
4033
4035
|
}
|
|
4034
4036
|
},
|
|
4035
|
-
"componentSchemaVersion":
|
|
4037
|
+
"componentSchemaVersion": 37
|
|
4036
4038
|
}
|
|
@@ -180,7 +180,8 @@
|
|
|
180
180
|
<style>
|
|
181
181
|
:global(:root) {
|
|
182
182
|
/* Scrim */
|
|
183
|
-
--dialog-scrim-
|
|
183
|
+
--dialog-scrim-color: var(--scrim-color);
|
|
184
|
+
--dialog-scrim-opacity: var(--scrim-opacity-high);
|
|
184
185
|
|
|
185
186
|
/* Dialog frame */
|
|
186
187
|
--dialog-surface: var(--surface-neutral-lowest);
|
|
@@ -227,7 +228,11 @@
|
|
|
227
228
|
left: 0;
|
|
228
229
|
width: 100%;
|
|
229
230
|
height: 100%;
|
|
230
|
-
background:
|
|
231
|
+
background: color-mix(
|
|
232
|
+
in srgb,
|
|
233
|
+
var(--dialog-scrim-color) calc(var(--dialog-scrim-opacity) * 100%),
|
|
234
|
+
transparent
|
|
235
|
+
);
|
|
231
236
|
display: flex;
|
|
232
237
|
justify-content: center;
|
|
233
238
|
align-items: center;
|
|
@@ -57,13 +57,14 @@
|
|
|
57
57
|
/** The width of that line, as any CSS length. Overrides
|
|
58
58
|
`--imagelightbox-tile-border-width`. */
|
|
59
59
|
borderWidth?: string | undefined;
|
|
60
|
-
/** The scrim behind the open image, for this instance
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
/** The scrim's colour behind the open image, for this instance. Overrides
|
|
61
|
+
`--imagelightbox-scrim-color`. The modal portals to <body>, out of reach
|
|
62
|
+
of a wrapper around the tile, so a page that wants its own scrim has to
|
|
63
|
+
say so here. */
|
|
64
64
|
scrim?: string | undefined;
|
|
65
|
-
/** How much of
|
|
66
|
-
|
|
65
|
+
/** How much of that colour covers the page, 0 to 1. Overrides
|
|
66
|
+
`--imagelightbox-scrim-opacity`, and stands on its own: the colour it
|
|
67
|
+
mixes with is whatever the theme holds. */
|
|
67
68
|
scrimOpacity?: number | undefined;
|
|
68
69
|
/** When true, shows a bottom toolbar (zoom in/out + percent) and a top-right close button, and enables wheel/drag zoom inside the open modal. When false, click anywhere closes. */
|
|
69
70
|
extended?: boolean;
|
|
@@ -107,16 +108,6 @@
|
|
|
107
108
|
capNatural = false,
|
|
108
109
|
}: Props = $props();
|
|
109
110
|
|
|
110
|
-
// An opacity is mixed into the colour, so the two arrive as one fill. Without
|
|
111
|
-
// a colour there is nothing to mix, and the theme's scrim stands.
|
|
112
|
-
const scrimFill = $derived(
|
|
113
|
-
scrim == null
|
|
114
|
-
? undefined
|
|
115
|
-
: scrimOpacity == null
|
|
116
|
-
? scrim
|
|
117
|
-
: `color-mix(in srgb, ${scrim} ${scrimOpacity * 100}%, transparent)`,
|
|
118
|
-
);
|
|
119
|
-
|
|
120
111
|
const items = $derived(
|
|
121
112
|
images && images.length
|
|
122
113
|
? images
|
|
@@ -667,7 +658,8 @@
|
|
|
667
658
|
<div
|
|
668
659
|
bind:this={overlayEl}
|
|
669
660
|
class="image-lightbox-overlay"
|
|
670
|
-
style:--imagelightbox-scrim-
|
|
661
|
+
style:--imagelightbox-scrim-color={scrim}
|
|
662
|
+
style:--imagelightbox-scrim-opacity={scrimOpacity}
|
|
671
663
|
class:active={open}
|
|
672
664
|
aria-hidden="true"
|
|
673
665
|
onclick={closeLightbox}
|
|
@@ -791,7 +783,8 @@
|
|
|
791
783
|
--imagelightbox-tile-object-fit: contain;
|
|
792
784
|
|
|
793
785
|
/* overlay */
|
|
794
|
-
--imagelightbox-scrim-
|
|
786
|
+
--imagelightbox-scrim-color: var(--scrim-color);
|
|
787
|
+
--imagelightbox-scrim-opacity: var(--scrim-opacity-high);
|
|
795
788
|
|
|
796
789
|
/* chrome (toolbar + close button) */
|
|
797
790
|
--imagelightbox-chrome-surface: var(--surface-neutral-low);
|
|
@@ -917,7 +910,11 @@
|
|
|
917
910
|
.image-lightbox-overlay {
|
|
918
911
|
position: fixed;
|
|
919
912
|
inset: 0;
|
|
920
|
-
background:
|
|
913
|
+
background: color-mix(
|
|
914
|
+
in srgb,
|
|
915
|
+
var(--imagelightbox-scrim-color) calc(var(--imagelightbox-scrim-opacity) * 100%),
|
|
916
|
+
transparent
|
|
917
|
+
);
|
|
921
918
|
backdrop-filter: blur(var(--blur-md));
|
|
922
919
|
z-index: var(--z-overlay);
|
|
923
920
|
opacity: 0;
|
|
@@ -267,10 +267,18 @@
|
|
|
267
267
|
--surface-danger-highest: oklch(0.6696 0.1423 24.72);
|
|
268
268
|
|
|
269
269
|
/* Scrims — translucent layers that dim what sits behind them. A scrim is not
|
|
270
|
-
a tint: it darkens the content underneath, it does not shade a surface.
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
270
|
+
a tint: it darkens the content underneath, it does not shade a surface.
|
|
271
|
+
Colour and strength are separate, so a theme can hold one and move the
|
|
272
|
+
other: set --scrim-color to a light value for a scrim that pales the page
|
|
273
|
+
instead of darkening it. The three stops stay, composed from the two, for
|
|
274
|
+
anywhere that wants one value. */
|
|
275
|
+
--scrim-color: rgb(20, 3, 0);
|
|
276
|
+
--scrim-opacity-low: 0.38;
|
|
277
|
+
--scrim-opacity: 0.51;
|
|
278
|
+
--scrim-opacity-high: 0.64;
|
|
279
|
+
--scrim-low: color-mix(in srgb, var(--scrim-color) calc(var(--scrim-opacity-low) * 100%), transparent);
|
|
280
|
+
--scrim: color-mix(in srgb, var(--scrim-color) calc(var(--scrim-opacity) * 100%), transparent);
|
|
281
|
+
--scrim-high: color-mix(in srgb, var(--scrim-color) calc(var(--scrim-opacity-high) * 100%), transparent);
|
|
274
282
|
|
|
275
283
|
/* Tints — translucent washes that shade the surface they sit on, for a hover
|
|
276
284
|
or an active row. The theme aliases these to the text color, so a tint
|
|
@@ -783,7 +783,6 @@ var dialogContract = {
|
|
|
783
783
|
properties: [
|
|
784
784
|
{
|
|
785
785
|
paints: {
|
|
786
|
-
backdrop: { backgroundColor: "--dialog-scrim-surface" },
|
|
787
786
|
root: {
|
|
788
787
|
backgroundColor: "--dialog-surface",
|
|
789
788
|
borderTopColor: "--dialog-border",
|
|
@@ -832,7 +831,9 @@ var dialogContract = {
|
|
|
832
831
|
{ state: "footer" }
|
|
833
832
|
],
|
|
834
833
|
uncovered: {
|
|
835
|
-
"--dialog-blur": "consumed via backdrop-filter: blur(), which no probe covers"
|
|
834
|
+
"--dialog-blur": "consumed via backdrop-filter: blur(), which no probe covers",
|
|
835
|
+
"--dialog-scrim-color": "composed into the fill through color-mix(), so no computed style reports the token verbatim",
|
|
836
|
+
"--dialog-scrim-opacity": "composed into the fill through color-mix(), so no computed style reports the token verbatim"
|
|
836
837
|
},
|
|
837
838
|
persistence: {
|
|
838
839
|
cases: [
|
|
@@ -1117,7 +1118,6 @@ var imageLightboxContract = {
|
|
|
1117
1118
|
borderRadius: "--imagelightbox-tile-radius",
|
|
1118
1119
|
boxShadow: "--imagelightbox-tile-shadow"
|
|
1119
1120
|
},
|
|
1120
|
-
overlay: { backgroundColor: "--imagelightbox-scrim-surface" },
|
|
1121
1121
|
closeButton: {
|
|
1122
1122
|
backgroundColor: "--imagelightbox-chrome-surface",
|
|
1123
1123
|
borderTopColor: "--imagelightbox-chrome-border",
|
|
@@ -1137,6 +1137,10 @@ var imageLightboxContract = {
|
|
|
1137
1137
|
}
|
|
1138
1138
|
],
|
|
1139
1139
|
states: [{ state: "tile" }, { state: "overlay" }, { state: "chrome" }],
|
|
1140
|
+
uncovered: {
|
|
1141
|
+
"--imagelightbox-scrim-color": "composed into the fill through color-mix(), so no computed style reports the token verbatim",
|
|
1142
|
+
"--imagelightbox-scrim-opacity": "composed into the fill through color-mix(), so no computed style reports the token verbatim"
|
|
1143
|
+
},
|
|
1140
1144
|
persistence: {
|
|
1141
1145
|
cases: [
|
|
1142
1146
|
{
|
|
@@ -3368,4 +3372,4 @@ export {
|
|
|
3368
3372
|
allContracts,
|
|
3369
3373
|
selectedContracts
|
|
3370
3374
|
};
|
|
3371
|
-
//# sourceMappingURL=chunk-
|
|
3375
|
+
//# sourceMappingURL=chunk-WQJ6QB6Y.js.map
|