@motion-proto/live-tokens 0.86.0 → 0.87.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,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.87.0 — VideoLightbox play badge
4
+
5
+ ### Added
6
+
7
+ - **`VideoLightbox` takes `chrome="badge"`.** A play badge sits over the
8
+ thumbnail, so a still reads as a clip before anyone clicks it. The default,
9
+ `none`, shows the still alone, as before. The badge has its own
10
+ `--videolightbox-badge-*` tokens with a hover state, editable in the
11
+ component editor. Every shipped theme takes its values from that theme's
12
+ VideoFrame badge, so the two match.
13
+
3
14
  ## 0.86.0 — Video and slides ship as components
4
15
 
5
16
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motion-proto/live-tokens",
3
- "version": "0.86.0",
3
+ "version": "0.87.0",
4
4
  "type": "module",
5
5
  "description": "Design token editor with live CSS variable editing. Svelte 5 + Vite 8.",
6
6
  "keywords": [
@@ -19,9 +19,20 @@
19
19
  { label: 'border width', canBeLinked: true, element: 'close', variable: '--videolightbox-chrome-border-width' },
20
20
  { label: 'corner radius', canBeLinked: true, element: 'close', variable: '--videolightbox-chrome-radius' },
21
21
  { label: 'icon color', element: 'close', variable: '--videolightbox-chrome-icon' },
22
+ { label: 'surface color', element: 'badge', variable: '--videolightbox-badge-default-surface' },
23
+ { label: 'border color', element: 'badge', variable: '--videolightbox-badge-default-border' },
24
+ { label: 'border width', canBeLinked: true, element: 'badge', variable: '--videolightbox-badge-default-border-width' },
25
+ { label: 'size', canBeLinked: true, element: 'badge', variable: '--videolightbox-badge-default-size' },
26
+ { label: 'icon color', element: 'badge', variable: '--videolightbox-badge-default-icon' },
27
+ { label: 'icon size', canBeLinked: true, element: 'badge', variable: '--videolightbox-badge-default-icon-size' },
28
+ { label: 'hover duration', element: 'badge', variable: '--videolightbox-badge-duration' },
29
+ { label: 'hover easing', element: 'badge', variable: '--videolightbox-badge-easing' },
22
30
  ],
23
31
  hover: [
24
32
  { label: 'surface color', element: 'close', variable: '--videolightbox-chrome-hover-surface' },
33
+ { label: 'surface color', element: 'badge', variable: '--videolightbox-badge-hover-surface' },
34
+ { label: 'border color', element: 'badge', variable: '--videolightbox-badge-hover-border' },
35
+ { label: 'icon color', element: 'badge', variable: '--videolightbox-badge-hover-icon' },
25
36
  ],
26
37
  };
27
38
 
@@ -39,7 +50,7 @@
39
50
  <ComponentEditorBase
40
51
  {component}
41
52
  title="Video Lightbox"
42
- description="A small still that fades the page away and plays its clip in the middle of the screen. Click anywhere, the close button, or Escape to close it. The open preview beside the tile shows the overlay and close button in place."
53
+ description="A small still that fades the page away and plays its clip in the middle of the screen. The play badge over the still is optional. Click anywhere, the close button, or Escape to close it. The open preview beside the tile shows the overlay and close button in place."
43
54
  tokens={allTokens}
44
55
  >
45
56
  <VariantGroup
@@ -47,7 +58,7 @@
47
58
  title="Video Lightbox"
48
59
  {states}
49
60
  {component}
50
- elementOrder={['tile', 'overlay', 'close']}
61
+ elementOrder={['tile', 'badge', 'overlay', 'close']}
51
62
  >
52
63
  {#snippet children({ activeState })}
53
64
  <div class="videolightbox-demo">
@@ -58,6 +69,8 @@
58
69
  alt="Navigation running on a smartwatch"
59
70
  width={480}
60
71
  height={552}
72
+ chrome="badge"
73
+ class={activeState === 'hover' ? 'force-hover' : ''}
61
74
  />
62
75
  </div>
63
76
  <div class="videolightbox-demo-open">
@@ -4015,7 +4015,18 @@
4015
4015
  "--videolightbox-chrome-border-width": "--border-width-1",
4016
4016
  "--videolightbox-chrome-radius": "--radius-full",
4017
4017
  "--videolightbox-chrome-icon": "--text-primary",
4018
- "--videolightbox-chrome-hover-surface": "--surface-brand-high"
4018
+ "--videolightbox-chrome-hover-surface": "--surface-brand-high",
4019
+ "--videolightbox-badge-default-surface": "--surface-brand-lower",
4020
+ "--videolightbox-badge-default-border": "--border-brand-medium",
4021
+ "--videolightbox-badge-default-border-width": "--border-width-2",
4022
+ "--videolightbox-badge-default-icon": "--text-primary",
4023
+ "--videolightbox-badge-default-size": "--space-64",
4024
+ "--videolightbox-badge-default-icon-size": "--icon-size-4xl",
4025
+ "--videolightbox-badge-duration": "--duration-200",
4026
+ "--videolightbox-badge-easing": "--ease-out-quad",
4027
+ "--videolightbox-badge-hover-surface": "--surface-brand",
4028
+ "--videolightbox-badge-hover-border": "--border-brand-strong",
4029
+ "--videolightbox-badge-hover-icon": "--text-primary"
4019
4030
  }
4020
4031
  },
4021
4032
  "videoframe": {
@@ -4054,7 +4054,18 @@
4054
4054
  "--videolightbox-chrome-border-width": "--border-width-3",
4055
4055
  "--videolightbox-chrome-radius": "--radius-none",
4056
4056
  "--videolightbox-chrome-icon": "--text-primary",
4057
- "--videolightbox-chrome-hover-surface": "--surface-brand-high"
4057
+ "--videolightbox-chrome-hover-surface": "--surface-brand-high",
4058
+ "--videolightbox-badge-default-surface": "--surface-brand-lower",
4059
+ "--videolightbox-badge-default-border": "--border-brand-medium",
4060
+ "--videolightbox-badge-default-border-width": "--border-width-2",
4061
+ "--videolightbox-badge-default-icon": "--text-primary",
4062
+ "--videolightbox-badge-default-size": "--space-64",
4063
+ "--videolightbox-badge-default-icon-size": "--icon-size-4xl",
4064
+ "--videolightbox-badge-duration": "--duration-200",
4065
+ "--videolightbox-badge-easing": "--ease-out-quad",
4066
+ "--videolightbox-badge-hover-surface": "--surface-brand",
4067
+ "--videolightbox-badge-hover-border": "--border-brand-strong",
4068
+ "--videolightbox-badge-hover-icon": "--text-primary"
4058
4069
  }
4059
4070
  },
4060
4071
  "videoframe": {
@@ -4073,7 +4073,18 @@
4073
4073
  "--videolightbox-chrome-border-width": "--border-width-1",
4074
4074
  "--videolightbox-chrome-radius": "--radius-full",
4075
4075
  "--videolightbox-chrome-icon": "--text-primary",
4076
- "--videolightbox-chrome-hover-surface": "--surface-brand-high"
4076
+ "--videolightbox-chrome-hover-surface": "--surface-brand-high",
4077
+ "--videolightbox-badge-default-surface": "--surface-brand-lower",
4078
+ "--videolightbox-badge-default-border": "--border-brand-medium",
4079
+ "--videolightbox-badge-default-border-width": "--border-width-2",
4080
+ "--videolightbox-badge-default-icon": "--text-primary",
4081
+ "--videolightbox-badge-default-size": "--space-64",
4082
+ "--videolightbox-badge-default-icon-size": "--icon-size-4xl",
4083
+ "--videolightbox-badge-duration": "--duration-200",
4084
+ "--videolightbox-badge-easing": "--ease-out-quad",
4085
+ "--videolightbox-badge-hover-surface": "--surface-brand",
4086
+ "--videolightbox-badge-hover-border": "--border-brand-strong",
4087
+ "--videolightbox-badge-hover-icon": "--text-primary"
4077
4088
  }
4078
4089
  },
4079
4090
  "videoframe": {
@@ -4014,7 +4014,18 @@
4014
4014
  "--videolightbox-chrome-border-width": "--border-width-1",
4015
4015
  "--videolightbox-chrome-radius": "--radius-full",
4016
4016
  "--videolightbox-chrome-icon": "--text-primary",
4017
- "--videolightbox-chrome-hover-surface": "--surface-brand-high"
4017
+ "--videolightbox-chrome-hover-surface": "--surface-brand-high",
4018
+ "--videolightbox-badge-default-surface": "--surface-brand-lower",
4019
+ "--videolightbox-badge-default-border": "--border-brand-medium",
4020
+ "--videolightbox-badge-default-border-width": "--border-width-2",
4021
+ "--videolightbox-badge-default-icon": "--text-primary",
4022
+ "--videolightbox-badge-default-size": "--space-64",
4023
+ "--videolightbox-badge-default-icon-size": "--icon-size-4xl",
4024
+ "--videolightbox-badge-duration": "--duration-200",
4025
+ "--videolightbox-badge-easing": "--ease-out-quad",
4026
+ "--videolightbox-badge-hover-surface": "--surface-brand",
4027
+ "--videolightbox-badge-hover-border": "--border-brand-strong",
4028
+ "--videolightbox-badge-hover-icon": "--text-primary"
4018
4029
  }
4019
4030
  },
4020
4031
  "videoframe": {
@@ -4045,7 +4045,18 @@
4045
4045
  "--videolightbox-chrome-border-width": "--border-width-2",
4046
4046
  "--videolightbox-chrome-radius": "--radius-full",
4047
4047
  "--videolightbox-chrome-icon": "--text-primary",
4048
- "--videolightbox-chrome-hover-surface": "--surface-brand-high"
4048
+ "--videolightbox-chrome-hover-surface": "--surface-brand-high",
4049
+ "--videolightbox-badge-default-surface": "--surface-brand-lower",
4050
+ "--videolightbox-badge-default-border": "--border-brand-medium",
4051
+ "--videolightbox-badge-default-border-width": "--border-width-2",
4052
+ "--videolightbox-badge-default-icon": "--text-primary",
4053
+ "--videolightbox-badge-default-size": "--space-64",
4054
+ "--videolightbox-badge-default-icon-size": "--icon-size-4xl",
4055
+ "--videolightbox-badge-duration": "--duration-200",
4056
+ "--videolightbox-badge-easing": "--ease-out-quad",
4057
+ "--videolightbox-badge-hover-surface": "--surface-brand",
4058
+ "--videolightbox-badge-hover-border": "--border-brand-strong",
4059
+ "--videolightbox-badge-hover-icon": "--text-primary"
4049
4060
  }
4050
4061
  },
4051
4062
  "videoframe": {
@@ -4028,7 +4028,18 @@
4028
4028
  "--videolightbox-chrome-border-width": "--border-width-1",
4029
4029
  "--videolightbox-chrome-radius": "--radius-none",
4030
4030
  "--videolightbox-chrome-icon": "--text-primary",
4031
- "--videolightbox-chrome-hover-surface": "--surface-brand-high"
4031
+ "--videolightbox-chrome-hover-surface": "--surface-brand-high",
4032
+ "--videolightbox-badge-default-surface": "--surface-brand-lower",
4033
+ "--videolightbox-badge-default-border": "--border-brand-medium",
4034
+ "--videolightbox-badge-default-border-width": "--border-width-2",
4035
+ "--videolightbox-badge-default-icon": "--text-primary",
4036
+ "--videolightbox-badge-default-size": "--space-64",
4037
+ "--videolightbox-badge-default-icon-size": "--icon-size-4xl",
4038
+ "--videolightbox-badge-duration": "--duration-200",
4039
+ "--videolightbox-badge-easing": "--ease-out-quad",
4040
+ "--videolightbox-badge-hover-surface": "--surface-brand",
4041
+ "--videolightbox-badge-hover-border": "--border-brand-strong",
4042
+ "--videolightbox-badge-hover-icon": "--text-primary"
4032
4043
  }
4033
4044
  },
4034
4045
  "videoframe": {
@@ -4001,7 +4001,18 @@
4001
4001
  "--videolightbox-chrome-border-width": "--border-width-1",
4002
4002
  "--videolightbox-chrome-radius": "--radius-full",
4003
4003
  "--videolightbox-chrome-icon": "--text-primary",
4004
- "--videolightbox-chrome-hover-surface": "--surface-brand-high"
4004
+ "--videolightbox-chrome-hover-surface": "--surface-brand-high",
4005
+ "--videolightbox-badge-default-surface": "--surface-brand-lower",
4006
+ "--videolightbox-badge-default-border": "--border-brand-medium",
4007
+ "--videolightbox-badge-default-border-width": "--border-width-2",
4008
+ "--videolightbox-badge-default-icon": "--text-primary",
4009
+ "--videolightbox-badge-default-size": "--space-64",
4010
+ "--videolightbox-badge-default-icon-size": "--icon-size-4xl",
4011
+ "--videolightbox-badge-duration": "--duration-200",
4012
+ "--videolightbox-badge-easing": "--ease-out-quad",
4013
+ "--videolightbox-badge-hover-surface": "--surface-brand",
4014
+ "--videolightbox-badge-hover-border": "--border-brand-strong",
4015
+ "--videolightbox-badge-hover-icon": "--text-primary"
4005
4016
  }
4006
4017
  },
4007
4018
  "videoframe": {
@@ -4053,7 +4053,18 @@
4053
4053
  "--videolightbox-chrome-border-width": "--border-width-1",
4054
4054
  "--videolightbox-chrome-radius": "--radius-full",
4055
4055
  "--videolightbox-chrome-icon": "--text-primary",
4056
- "--videolightbox-chrome-hover-surface": "--surface-brand-high"
4056
+ "--videolightbox-chrome-hover-surface": "--surface-brand-high",
4057
+ "--videolightbox-badge-default-surface": "--surface-brand-lower",
4058
+ "--videolightbox-badge-default-border": "--border-brand-medium",
4059
+ "--videolightbox-badge-default-border-width": "--border-width-2",
4060
+ "--videolightbox-badge-default-icon": "--text-primary",
4061
+ "--videolightbox-badge-default-size": "--space-64",
4062
+ "--videolightbox-badge-default-icon-size": "--icon-size-4xl",
4063
+ "--videolightbox-badge-duration": "--duration-200",
4064
+ "--videolightbox-badge-easing": "--ease-out-quad",
4065
+ "--videolightbox-badge-hover-surface": "--surface-brand",
4066
+ "--videolightbox-badge-hover-border": "--border-brand-strong",
4067
+ "--videolightbox-badge-hover-icon": "--text-primary"
4057
4068
  }
4058
4069
  },
4059
4070
  "videoframe": {
@@ -11,6 +11,8 @@
11
11
  { when: 'footage that plays in the layout at full size, with no thumbnail to open.', use: 'videoframe' }
12
12
  ],
13
13
  props: {
14
+ chrome:
15
+ '`badge` lays a play badge over the thumbnail, so a still reads as a clip. `none` shows the still alone.',
14
16
  inline: 'true renders the open lightbox in flow, without the thumbnail. The editor preview uses it.',
15
17
  loop: 'true repeats the clip.',
16
18
  hoverPlay:
@@ -40,6 +42,8 @@
40
42
  width?: number;
41
43
  height?: number;
42
44
  loop?: boolean;
45
+ /** "badge" lays a play badge over the thumbnail. */
46
+ chrome?: 'badge' | 'none';
43
47
  /** Renders the open lightbox in flow, without the thumbnail. Used by the editor preview. */
44
48
  inline?: boolean;
45
49
  /** Plays the thumbnail muted under the pointer. Still for reduced motion. */
@@ -52,7 +56,7 @@
52
56
  thumbFit?: 'contain' | 'cover';
53
57
  /** Seconds in that the hover preview starts. The open clip still plays from 0. */
54
58
  previewStart?: number;
55
- /** Editor preview hook: `force-hover` on an `inline` lightbox paints the close button's hover. */
59
+ /** Editor preview hook: `force-hover` paints the hover of the close button on an `inline` lightbox, and of the badge on a tile. */
56
60
  class?: string;
57
61
  }
58
62
 
@@ -63,6 +67,7 @@
63
67
  width = undefined,
64
68
  height = undefined,
65
69
  loop = false,
70
+ chrome = 'none',
66
71
  inline = false,
67
72
  hoverPlay = false,
68
73
  stretch = false,
@@ -195,6 +200,11 @@
195
200
  {:else}
196
201
  <img src={poster} alt="" {width} {height} draggable="false" />
197
202
  {/if}
203
+ {#if chrome === 'badge'}
204
+ <span class="videolightbox-badge sketch-chip" aria-hidden="true">
205
+ <svg viewBox="0 0 24 24" fill="currentColor"><path d="M8 5.5v13l11-6.5z" /></svg>
206
+ </span>
207
+ {/if}
198
208
  </button>
199
209
  </div>
200
210
 
@@ -253,6 +263,19 @@
253
263
  --videolightbox-chrome-radius: var(--radius-full);
254
264
  --videolightbox-chrome-icon: var(--text-primary);
255
265
  --videolightbox-chrome-hover-surface: var(--surface-brand-high);
266
+
267
+ --videolightbox-badge-default-surface: var(--surface-brand-lower);
268
+ --videolightbox-badge-default-border: var(--border-brand-medium);
269
+ --videolightbox-badge-default-border-width: var(--border-width-2);
270
+ --videolightbox-badge-default-icon: var(--text-primary);
271
+ --videolightbox-badge-default-size: var(--space-64);
272
+ --videolightbox-badge-default-icon-size: var(--icon-size-4xl);
273
+ --videolightbox-badge-duration: var(--duration-200);
274
+ --videolightbox-badge-easing: var(--ease-out-quad);
275
+
276
+ --videolightbox-badge-hover-surface: var(--surface-brand);
277
+ --videolightbox-badge-hover-border: var(--border-brand-strong);
278
+ --videolightbox-badge-hover-icon: var(--text-primary);
256
279
  }
257
280
 
258
281
  .videolightbox {
@@ -265,8 +288,11 @@
265
288
 
266
289
  /* The clip lives one level in: the sketch layer forces the drawn part's
267
290
  overflow visible, which would let the picture's square corners escape. */
291
+ /* One grid cell stacks the badge on the still without positioning the
292
+ trigger, which would capture a `stretch` pad meant for the ancestor. */
268
293
  .videolightbox-trigger {
269
- display: block;
294
+ display: grid;
295
+ grid-template: minmax(0, 1fr) / minmax(0, 1fr);
270
296
  width: 100%;
271
297
  height: 100%;
272
298
  padding: 0;
@@ -297,6 +323,7 @@
297
323
 
298
324
  .videolightbox-trigger img,
299
325
  .videolightbox-trigger .videolightbox-thumb {
326
+ grid-area: 1 / 1;
300
327
  display: block;
301
328
  width: 100%;
302
329
  height: 100%;
@@ -304,6 +331,52 @@
304
331
  user-select: none;
305
332
  }
306
333
 
334
+ .videolightbox-badge {
335
+ grid-area: 1 / 1;
336
+ place-self: center;
337
+ box-sizing: border-box;
338
+ display: flex;
339
+ align-items: center;
340
+ justify-content: center;
341
+ width: var(--videolightbox-badge-default-size);
342
+ height: var(--videolightbox-badge-default-size);
343
+ color: var(--videolightbox-badge-default-icon);
344
+ background: var(--videolightbox-badge-default-surface);
345
+ border: var(--videolightbox-badge-default-border-width) solid
346
+ var(--videolightbox-badge-default-border);
347
+ border-radius: var(--radius-full);
348
+ transition:
349
+ background var(--videolightbox-badge-duration) var(--videolightbox-badge-easing),
350
+ border-color var(--videolightbox-badge-duration) var(--videolightbox-badge-easing),
351
+ color var(--videolightbox-badge-duration) var(--videolightbox-badge-easing);
352
+
353
+ --sketch-fill: var(--videolightbox-badge-default-surface);
354
+ --sketch-stroke: var(--videolightbox-badge-default-border);
355
+ --sketch-hatch-color: var(--videolightbox-badge-default-border);
356
+ --sketch-radius: var(--radius-full);
357
+ --sketch-shadow: none;
358
+ /* Travel is stated in px, and the play triangle is small enough to tear. */
359
+ --sketch-icon-off: var(--sketch-icon-soft);
360
+ }
361
+
362
+ .videolightbox-badge svg {
363
+ width: var(--videolightbox-badge-default-icon-size);
364
+ height: var(--videolightbox-badge-default-icon-size);
365
+ /* The triangle's mass sits left of centre; nudge it back onto the axis. */
366
+ margin-inline-start: 6%;
367
+ }
368
+
369
+ .videolightbox-trigger:hover .videolightbox-badge,
370
+ .videolightbox:global(.force-hover) .videolightbox-badge {
371
+ color: var(--videolightbox-badge-hover-icon);
372
+ background: var(--videolightbox-badge-hover-surface);
373
+ border-color: var(--videolightbox-badge-hover-border);
374
+
375
+ --sketch-fill: var(--videolightbox-badge-hover-surface);
376
+ --sketch-stroke: var(--videolightbox-badge-hover-border);
377
+ --sketch-hatch-color: var(--videolightbox-badge-hover-border);
378
+ }
379
+
307
380
  .videolightbox-modal {
308
381
  position: fixed;
309
382
  inset: 0;
@@ -3320,6 +3320,8 @@ var videoLightboxContract = {
3320
3320
  parts: {
3321
3321
  root: ".videolightbox",
3322
3322
  trigger: ".videolightbox-trigger",
3323
+ badge: ".videolightbox-badge",
3324
+ badgeIcon: ".videolightbox-badge svg",
3323
3325
  overlay: ".videolightbox-modal.inline",
3324
3326
  closeButton: ".videolightbox-modal.inline .videolightbox-close",
3325
3327
  closeIcon: ".videolightbox-modal.inline .videolightbox-close svg"
@@ -3345,7 +3347,25 @@ var videoLightboxContract = {
3345
3347
  borderRadius: "--videolightbox-chrome-radius",
3346
3348
  color: "--videolightbox-chrome-icon"
3347
3349
  },
3348
- closeIcon: { stroke: "--videolightbox-chrome-icon" }
3350
+ closeIcon: { stroke: "--videolightbox-chrome-icon" },
3351
+ badge: {
3352
+ backgroundColor: "--videolightbox-badge-default-surface",
3353
+ borderTopColor: "--videolightbox-badge-default-border",
3354
+ borderTopWidth: "--videolightbox-badge-default-border-width",
3355
+ width: "--videolightbox-badge-default-size",
3356
+ color: "--videolightbox-badge-default-icon"
3357
+ },
3358
+ badgeIcon: { width: "--videolightbox-badge-default-icon-size" }
3359
+ }
3360
+ },
3361
+ {
3362
+ state: "hover",
3363
+ paints: {
3364
+ badge: {
3365
+ backgroundColor: "--videolightbox-badge-hover-surface",
3366
+ borderTopColor: "--videolightbox-badge-hover-border",
3367
+ color: "--videolightbox-badge-hover-icon"
3368
+ }
3349
3369
  }
3350
3370
  },
3351
3371
  // The inline close button has no handler, so the click leaves the pointer
@@ -3358,7 +3378,9 @@ var videoLightboxContract = {
3358
3378
  states: [{ state: "default" }, { state: "hover" }],
3359
3379
  uncovered: {
3360
3380
  "--videolightbox-overlay-duration": "consumed inside the opacity transition shorthand, never a standalone computed value",
3361
- "--videolightbox-overlay-easing": "consumed inside the opacity transition shorthand, never a standalone computed value"
3381
+ "--videolightbox-overlay-easing": "consumed inside the opacity transition shorthand, never a standalone computed value",
3382
+ "--videolightbox-badge-duration": "consumed inside the badge transition shorthand, never a standalone computed value",
3383
+ "--videolightbox-badge-easing": "consumed inside the badge transition shorthand, never a standalone computed value"
3362
3384
  },
3363
3385
  persistence: {
3364
3386
  cases: [
@@ -3710,4 +3732,4 @@ export {
3710
3732
  allContracts,
3711
3733
  selectedContracts
3712
3734
  };
3713
- //# sourceMappingURL=chunk-OHU5BHGZ.js.map
3735
+ //# sourceMappingURL=chunk-FTLASW2R.js.map