@motion-proto/live-tokens 0.95.0 → 0.96.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.96.0 — Lightbox zoom readout in natural pixels
4
+
5
+ ### Changed
6
+
7
+ - **The `ImageLightbox` zoom readout measures the image against its natural
8
+ resolution.** 100% shows one source pixel per CSS pixel, the unit `maxZoom`
9
+ already takes. A 2880px image fitted into a 960px box opens at 33%, and
10
+ `maxZoom={1}` tops out at 100%. The readout used to call the fitted view
11
+ 100% whatever the image's size. Until the natural size is known, from
12
+ `width`/`height` or the loaded image, the readout measures against the
13
+ fitted view as before. The zoom steps and caps stay the same.
14
+
15
+ ### Fixed
16
+
17
+ - **The Testing loops page keeps its diagram text crisp in sketch mode.** The
18
+ text lies in its own svg above the boxes and arrows, so the sketch filter
19
+ roughens the shapes and leaves the labels legible.
20
+
3
21
  ## 0.95.0 — Responsive columns and production CSS
4
22
 
5
23
  ### Changed (breaking)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motion-proto/live-tokens",
3
- "version": "0.95.0",
3
+ "version": "0.96.0",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -121,12 +121,11 @@
121
121
  <div class="figure-stage">
122
122
  <!-- svelte-ignore a11y_no_noninteractive_tabindex (Keyboard users need to scroll the diagram.) -->
123
123
  <div class="figure-scroll" role="region" aria-label="Figure 1" tabindex="0">
124
+ <div class="dg-stack">
124
125
  <svg class="dg" viewBox="20 12 1160 866" role="img" aria-label="The skill builds a page or component and runs the checks. The CLI checker checks the code, makes the routine repairs, tests the result, and reports the findings. The skill repairs each finding and runs the checks again until every check passes.">
125
126
  <rect class="lane-checker" x="20" y="12" width="1160" height="866" rx="8" />
126
127
  <path class="lane-skill" d="M28,12 H600 V878 H28 A8,8 0 0 1 20,870 V20 A8,8 0 0 1 28,12 Z" />
127
128
  <path class="lane-shade" d="M600,12 H1172 A8,8 0 0 1 1180,20 V870 A8,8 0 0 1 1172,878 H600 Z" />
128
- <text class="lane-title" x="80" y="52">Claude Skill</text>
129
- <text class="lane-title" x="660" y="52">CLI checker</text>
130
129
  <path class="flow" d="M540,148 L876,148 Q890,148 890,162 L890,225" />
131
130
  <path class="flow" d="M890,320 L890,353" />
132
131
  <path class="flow" d="M890,448 L890,481" />
@@ -135,33 +134,38 @@
135
134
  <path class="flow" d="M890,728 L890,781" />
136
135
  <path class="back" d="M310,640 L310,290 Q310,276 324,276 L653,276" />
137
136
  <rect class="box-lead" x="80" y="104" width="460" height="88" rx="4" />
137
+ <rect class="box" x="660" y="232" width="460" height="88" rx="4" />
138
+ <rect class="box" x="660" y="360" width="460" height="88" rx="4" />
139
+ <rect class="box" x="660" y="488" width="460" height="112" rx="4" />
140
+ <rect class="box" x="660" y="640" width="460" height="88" rx="4" />
141
+ <rect class="box" x="80" y="640" width="460" height="88" rx="4" />
142
+ <rect class="box-lead" x="660" y="788" width="460" height="72" rx="4" />
143
+ </svg>
144
+ <svg class="dg dg-text" viewBox="20 12 1160 866" aria-hidden="true">
145
+ <text class="lane-title" x="80" y="52">Claude Skill</text>
146
+ <text class="lane-title" x="660" y="52">CLI checker</text>
138
147
  <text class="t" x="101.3" y="138">Build a page or component</text>
139
148
  <text class="s" x="101.3" y="166">from the catalogue and design tokens</text>
140
- <rect class="box" x="660" y="232" width="460" height="88" rx="4" />
141
149
  <text class="t" x="681.3" y="266">Check the code</text>
142
150
  <text class="tag" x="1098.7" y="266" text-anchor="end">Static check</text>
143
151
  <text class="s" x="681.3" y="294">design tokens, components, and props</text>
144
- <rect class="box" x="660" y="360" width="460" height="88" rx="4" />
145
152
  <text class="t" x="681.3" y="394">Make the routine repairs</text>
146
153
  <text class="s" x="681.3" y="422">fixes with one right answer</text>
147
- <rect class="box" x="660" y="488" width="460" height="112" rx="4" />
148
154
  <text class="t" x="681.3" y="522">Test the result</text>
149
155
  <text class="tag" x="1098.7" y="522" text-anchor="end">Vitest · Playwright</text>
150
156
  <text class="s" x="681.3" y="550">Test component interactions, rendering, and themes.</text>
151
157
  <text class="s" x="681.3" y="574">Check page layout, contrast, and typography.</text>
152
- <rect class="box" x="660" y="640" width="460" height="88" rx="4" />
153
158
  <text class="t" x="681.3" y="674">Report the findings</text>
154
159
  <text class="s" x="681.3" y="702">each with guidance for its repair</text>
155
- <rect class="box" x="80" y="640" width="460" height="88" rx="4" />
156
160
  <text class="t" x="101.3" y="674">Repair each finding</text>
157
161
  <text class="s" x="101.3" y="702">make the choice or write the code</text>
158
- <rect class="box-lead" x="660" y="788" width="460" height="72" rx="4" />
159
162
  <text class="t" x="890" y="830" text-anchor="middle">Every check passes</text>
160
163
  <text class="lbl" x="715" y="136" text-anchor="middle">run the checks</text>
161
164
  <text class="lbl" x="600" y="672" text-anchor="middle">findings</text>
162
165
  <text class="lbl" x="906" y="759">none remain</text>
163
166
  <text class="rule" x="479" y="262" text-anchor="middle">check again</text>
164
167
  </svg>
168
+ </div>
165
169
  </div>
166
170
  </div>
167
171
  </figure>
@@ -179,12 +183,11 @@
179
183
  <div class="figure-stage">
180
184
  <!-- svelte-ignore a11y_no_noninteractive_tabindex (Keyboard users need to scroll the diagram.) -->
181
185
  <div class="figure-scroll" role="region" aria-label="Figure 2" tabindex="0">
186
+ <div class="dg-stack">
182
187
  <svg class="dg" viewBox="20 12 1160 916" role="img" aria-label="Read the project, plan the sections, and choose components. When no component fits, create one and check it until every check passes, and it joins the catalogue. Assemble the page and check it. Repair each finding until every check passes, then review the page.">
183
188
  <rect class="lane-checker" x="20" y="12" width="1160" height="916" rx="8" />
184
189
  <path class="lane-skill" d="M28,12 H600 V928 H28 A8,8 0 0 1 20,920 V20 A8,8 0 0 1 28,12 Z" />
185
190
  <path class="lane-shade" d="M600,12 H1172 A8,8 0 0 1 1180,20 V920 A8,8 0 0 1 1172,928 H600 Z" />
186
- <text class="lane-title" x="80" y="52">Page</text>
187
- <text class="lane-title" x="660" y="52">New component</text>
188
191
  <path class="flow" d="M310,192 L310,225" />
189
192
  <path class="flow" d="M310,320 L310,353" />
190
193
  <path class="flow" d="M310,448 L310,545" />
@@ -194,25 +197,29 @@
194
197
  <path class="back" d="M540,724 L556,724 Q570,724 570,710 L570,629 Q570,620 561,620 L547,620" />
195
198
  <path class="flow" d="M310,768 L310,813" />
196
199
  <rect class="box-lead" x="80" y="104" width="460" height="88" rx="4" />
200
+ <rect class="box" x="80" y="232" width="460" height="88" rx="4" />
201
+ <rect class="box" x="80" y="360" width="460" height="88" rx="4" />
202
+ <rect class="box" x="660" y="360" width="460" height="112" rx="4" />
203
+ <rect class="box" x="80" y="552" width="460" height="88" rx="4" />
204
+ <rect class="box" x="80" y="680" width="460" height="88" rx="4" />
205
+ <rect class="box-lead" x="80" y="820" width="460" height="88" rx="4" />
206
+ </svg>
207
+ <svg class="dg dg-text" viewBox="20 12 1160 916" aria-hidden="true">
208
+ <text class="lane-title" x="80" y="52">Page</text>
209
+ <text class="lane-title" x="660" y="52">New component</text>
197
210
  <text class="t" x="101.3" y="138">Read the project</text>
198
211
  <text class="s" x="101.3" y="166">routes, grid, and the component catalogue</text>
199
- <rect class="box" x="80" y="232" width="460" height="88" rx="4" />
200
212
  <text class="t" x="101.3" y="266">Plan the sections</text>
201
213
  <text class="s" x="101.3" y="294">one section per purpose</text>
202
- <rect class="box" x="80" y="360" width="460" height="88" rx="4" />
203
214
  <text class="t" x="101.3" y="394">Choose components</text>
204
215
  <text class="s" x="101.3" y="422">from the catalogue first</text>
205
- <rect class="box" x="660" y="360" width="460" height="112" rx="4" />
206
216
  <text class="t" x="681.3" y="394">Create the component</text>
207
217
  <text class="s" x="681.3" y="422">check it and repair it</text>
208
218
  <text class="s" x="681.3" y="446">until every check passes</text>
209
- <rect class="box" x="80" y="552" width="460" height="88" rx="4" />
210
219
  <text class="t" x="101.3" y="586">Assemble the page</text>
211
220
  <text class="s" x="101.3" y="614">components, tokens, and text styles</text>
212
- <rect class="box" x="80" y="680" width="460" height="88" rx="4" />
213
221
  <text class="t" x="101.3" y="714">Check the page</text>
214
222
  <text class="s" x="101.3" y="742">review the code and test it in the browser</text>
215
- <rect class="box-lead" x="80" y="820" width="460" height="88" rx="4" />
216
223
  <text class="t" x="101.3" y="854">Review the page</text>
217
224
  <text class="s" x="101.3" y="882">read it the way a visitor would</text>
218
225
  <text class="lbl" x="326" y="499">a shipped component fits</text>
@@ -221,6 +228,7 @@
221
228
  <text class="rule" x="584" y="677">repair</text>
222
229
  <text class="lbl" x="326" y="793">every check passes</text>
223
230
  </svg>
231
+ </div>
224
232
  </div>
225
233
  </div>
226
234
  </figure>
@@ -832,6 +840,21 @@
832
840
  color: var(--text-primary);
833
841
  }
834
842
 
843
+ /* Sketch mode filters every inline svg as artwork, which smears type. The
844
+ text gets its own svg over the shapes, so the boxes stay drawn and the
845
+ labels crisp. */
846
+ .dg-stack {
847
+ display: grid;
848
+ }
849
+
850
+ .dg-stack > .dg {
851
+ grid-area: 1 / 1;
852
+ }
853
+
854
+ .dg-text {
855
+ --sketch-icon-off: none;
856
+ }
857
+
835
858
  .dg :global(.lane-checker) {
836
859
  fill: none;
837
860
  stroke: var(--border-neutral-subtle);
@@ -70,7 +70,7 @@
70
70
  The modal portals to <body>, out of reach of a wrapper around the tile,
71
71
  so a page that wants its own scrim has to say so here. */
72
72
  scrim?: string | undefined;
73
- /** When true, shows a bottom toolbar (zoom in/out + percent) and enables wheel/drag zoom inside the open modal. Either way, a click on the unzoomed image closes. */
73
+ /** When true, shows a bottom toolbar (zoom in/out + percent) and enables wheel/drag zoom inside the open modal. Either way, a click on the unzoomed image closes. The percent measures the image against its natural resolution: 100% shows one source pixel per CSS pixel, so a large image opens fitted below 100%. Until the natural size is known it measures against the fitted view. */
74
74
  extended?: boolean;
75
75
  /** Maximum zoom, as a multiple of the image's natural resolution: `1` = 100%
76
76
  of the source's real pixels (1 source px = 1 screen px), `2` = 200%. The
@@ -664,7 +664,14 @@
664
664
  };
665
665
  });
666
666
 
667
- let percentLabel = $derived(`${Math.round(scale * 100)}%`);
667
+ // `scale` is relative to the fitted stage; the readout reports the share of
668
+ // the source's real pixels, the unit `maxZoom` takes.
669
+ let percentLabel = $derived.by(() => {
670
+ const nw = naturalWidthOf(current);
671
+ const fitW = viewportTarget().width;
672
+ const ratio = nw && fitW ? (scale * fitW) / nw : scale;
673
+ return `${Math.round(ratio * 100)}%`;
674
+ });
668
675
  </script>
669
676
 
670
677
  <div