@motion-proto/live-tokens 0.87.1 → 0.89.1
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 +40 -0
- package/package.json +1 -1
- package/src/demo/TestingLoops.svelte +100 -0
- package/src/demo/evalResults.ts +62 -0
- package/src/editor/component-editor/ImageEditor.svelte +25 -14
- package/src/editor/skill-atlas/SkillAtlas.svelte +44 -65
- package/src/live-tokens/data/themes/autumn.json +4 -0
- package/src/live-tokens/data/themes/halloween.json +4 -0
- package/src/live-tokens/data/themes/midnight-study.json +4 -0
- package/src/live-tokens/data/themes/ocean.json +4 -0
- package/src/live-tokens/data/themes/royal-velvet.json +4 -0
- package/src/live-tokens/data/themes/sketchy.json +4 -0
- package/src/live-tokens/data/themes/spring-meadow.json +4 -0
- package/src/live-tokens/data/themes/sunset.json +4 -0
- package/src/system/components/Image.svelte +18 -4
- package/src/testing-js/{chunk-FTLASW2R.js → chunk-7VSUGI2C.js} +15 -12
- package/src/testing-js/chunk-7VSUGI2C.js.map +1 -0
- package/src/testing-js/{chunk-NXRFTTVL.js → chunk-YFNMYU54.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/editor/skill-atlas/SkillValue.svelte +0 -202
- package/src/editor/skill-atlas/evalResults.ts +0 -46
- package/src/testing-js/chunk-FTLASW2R.js.map +0 -1
- /package/src/testing-js/{chunk-NXRFTTVL.js.map → chunk-YFNMYU54.js.map} +0 -0
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
constraints: ['Page CSS paints decoration.'],
|
|
11
11
|
props: {
|
|
12
12
|
variant:
|
|
13
|
-
|
|
13
|
+
'`default` frames the picture with a border and shadow. `bare` drops the frame for pictures that carry their own edge, such as cut-out art or screenshots.',
|
|
14
|
+
size: "`default` keeps the picture's own proportions, `banner` gives it a tall frame, `medium` and `compact` shorter ones.",
|
|
14
15
|
},
|
|
15
16
|
} satisfies CatalogueEntry;
|
|
16
17
|
</script>
|
|
@@ -19,7 +20,8 @@
|
|
|
19
20
|
interface Props {
|
|
20
21
|
src: string;
|
|
21
22
|
alt: string;
|
|
22
|
-
variant?: 'default' | '
|
|
23
|
+
variant?: 'default' | 'bare';
|
|
24
|
+
size?: 'default' | 'banner' | 'medium' | 'compact';
|
|
23
25
|
height?: string | undefined;
|
|
24
26
|
/** Zoom the contents on hover (frame stays fixed). `undefined` inherits the editor's
|
|
25
27
|
global "Use zoom" default; `true`/`false` force this instance on/off. */
|
|
@@ -42,6 +44,7 @@
|
|
|
42
44
|
src,
|
|
43
45
|
alt,
|
|
44
46
|
variant = 'default',
|
|
47
|
+
size = 'default',
|
|
45
48
|
height = undefined,
|
|
46
49
|
zoom = undefined,
|
|
47
50
|
overflowScaling = undefined,
|
|
@@ -52,14 +55,14 @@
|
|
|
52
55
|
forceHover = false,
|
|
53
56
|
}: Props = $props();
|
|
54
57
|
|
|
55
|
-
const
|
|
58
|
+
const sizeHeights: Record<string, string | undefined> = {
|
|
56
59
|
default: undefined,
|
|
57
60
|
banner: '360px',
|
|
58
61
|
medium: '240px',
|
|
59
62
|
compact: '180px',
|
|
60
63
|
};
|
|
61
64
|
|
|
62
|
-
let resolvedHeight = $derived(height ??
|
|
65
|
+
let resolvedHeight = $derived(height ?? sizeHeights[size]);
|
|
63
66
|
|
|
64
67
|
// Per-instance override of the global zoom intrinsics. `undefined` for a variable leaves
|
|
65
68
|
// :root in charge. Exactly one of the two transforms is ever the scale (the other `none`),
|
|
@@ -80,6 +83,7 @@
|
|
|
80
83
|
|
|
81
84
|
<div
|
|
82
85
|
class="image"
|
|
86
|
+
class:bare={variant === 'bare'}
|
|
83
87
|
class:force-hover={forceHover}
|
|
84
88
|
style:height={resolvedHeight}
|
|
85
89
|
style:--image-zoom-enabled={contentHover}
|
|
@@ -94,6 +98,10 @@
|
|
|
94
98
|
--image-default-border: var(--border-neutral);
|
|
95
99
|
--image-default-border-width: var(--border-width-1);
|
|
96
100
|
--image-default-shadow: var(--shadow-md);
|
|
101
|
+
--image-bare-radius: var(--radius-none);
|
|
102
|
+
--image-bare-border: var(--color-transparent);
|
|
103
|
+
--image-bare-border-width: var(--border-width-0);
|
|
104
|
+
--image-bare-shadow: var(--shadow-none);
|
|
97
105
|
--image-zoom-scale: var(--scale-sm);
|
|
98
106
|
/* Hover-scale targets. Contained mode (`overflowScaling`) scales the content within the
|
|
99
107
|
masked frame; grow mode scales the whole frame so it grows past its box. Each is `none`
|
|
@@ -111,6 +119,12 @@
|
|
|
111
119
|
transition: transform var(--duration-300) var(--ease-out-cubic);
|
|
112
120
|
}
|
|
113
121
|
|
|
122
|
+
.image.bare {
|
|
123
|
+
border-radius: var(--image-bare-radius);
|
|
124
|
+
border: var(--image-bare-border-width) solid var(--image-bare-border);
|
|
125
|
+
box-shadow: var(--image-bare-shadow);
|
|
126
|
+
}
|
|
127
|
+
|
|
114
128
|
img {
|
|
115
129
|
width: 100%;
|
|
116
130
|
height: 100%;
|
|
@@ -1022,29 +1022,32 @@ var iconButtonContract = {
|
|
|
1022
1022
|
};
|
|
1023
1023
|
|
|
1024
1024
|
// src/testing/contracts/image.ts
|
|
1025
|
+
function framePaints(v) {
|
|
1026
|
+
return {
|
|
1027
|
+
root: {
|
|
1028
|
+
borderTopColor: `--image-${v}-border`,
|
|
1029
|
+
borderTopWidth: `--image-${v}-border-width`,
|
|
1030
|
+
borderRadius: `--image-${v}-radius`,
|
|
1031
|
+
boxShadow: `--image-${v}-shadow`
|
|
1032
|
+
}
|
|
1033
|
+
};
|
|
1034
|
+
}
|
|
1025
1035
|
var imageContract = {
|
|
1026
1036
|
id: "image",
|
|
1027
1037
|
origin: "system",
|
|
1038
|
+
view: { variant: "Default" },
|
|
1028
1039
|
root: "root",
|
|
1029
1040
|
parts: {
|
|
1030
1041
|
root: ".image",
|
|
1031
1042
|
img: ".image img"
|
|
1032
1043
|
},
|
|
1033
1044
|
properties: [
|
|
1034
|
-
{
|
|
1035
|
-
|
|
1036
|
-
root: {
|
|
1037
|
-
borderTopColor: "--image-default-border",
|
|
1038
|
-
borderTopWidth: "--image-default-border-width",
|
|
1039
|
-
borderRadius: "--image-default-radius",
|
|
1040
|
-
boxShadow: "--image-default-shadow"
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1045
|
+
{ variant: "Default", paints: framePaints("default") },
|
|
1046
|
+
{ variant: "Bare", paints: framePaints("bare") }
|
|
1044
1047
|
],
|
|
1045
1048
|
states: {
|
|
1046
1049
|
applicable: false,
|
|
1047
|
-
reason: "
|
|
1050
|
+
reason: "each variant is one frame preset with one state, so the editor renders no state strip"
|
|
1048
1051
|
},
|
|
1049
1052
|
uncovered: {
|
|
1050
1053
|
"--image-zoom-scale": "consumed inside transform: scale(), never appears verbatim in a computed style"
|
|
@@ -3732,4 +3735,4 @@ export {
|
|
|
3732
3735
|
allContracts,
|
|
3733
3736
|
selectedContracts
|
|
3734
3737
|
};
|
|
3735
|
-
//# sourceMappingURL=chunk-
|
|
3738
|
+
//# sourceMappingURL=chunk-7VSUGI2C.js.map
|