@motion-proto/live-tokens 0.85.0 → 0.86.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 (43) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/src/editor/component-editor/SlidePagerEditor.svelte +118 -0
  5. package/src/editor/component-editor/VideoFrameEditor.svelte +73 -0
  6. package/src/editor/component-editor/VideoLightboxEditor.svelte +95 -0
  7. package/src/editor/component-editor/registry.ts +40 -1
  8. package/src/editor/core/sketch/sketchLayer.ts +7 -0
  9. package/src/editor/overlay/LiveEditorOverlay.svelte +45 -52
  10. package/src/editor/pages/ComponentEditorPage.svelte +1 -1
  11. package/src/editor/ui/ThemePanel.svelte +9 -53
  12. package/src/live-tokens/data/themes/autumn.json +86 -0
  13. package/src/live-tokens/data/themes/halloween.json +86 -0
  14. package/src/live-tokens/data/themes/midnight-study.json +86 -0
  15. package/src/live-tokens/data/themes/ocean.json +86 -0
  16. package/src/live-tokens/data/themes/royal-velvet.json +86 -0
  17. package/src/live-tokens/data/themes/sketchy.json +86 -0
  18. package/src/live-tokens/data/themes/spring-meadow.json +86 -0
  19. package/src/live-tokens/data/themes/sunset.json +86 -0
  20. package/src/system/assets/slide-04.webp +0 -0
  21. package/src/system/assets/slide-05.webp +0 -0
  22. package/src/system/assets/slide-06.webp +0 -0
  23. package/src/system/assets/watch-navigation-poster.webp +0 -0
  24. package/src/system/assets/watch-navigation.mp4 +0 -0
  25. package/src/system/components/ImageLightbox.svelte +20 -21
  26. package/src/system/components/SlidePager.svelte +516 -0
  27. package/src/system/components/VideoFrame.svelte +284 -0
  28. package/src/system/components/VideoLightbox.svelte +381 -0
  29. package/src/testing-js/{chunk-RDHCBQ6I.js → chunk-OHU5BHGZ.js} +344 -2
  30. package/src/testing-js/chunk-OHU5BHGZ.js.map +1 -0
  31. package/src/testing-js/{chunk-XV5CYADO.js → chunk-Y6R7Z7VK.js} +10 -6
  32. package/src/testing-js/chunk-Y6R7Z7VK.js.map +1 -0
  33. package/src/testing-js/component-behavior.contract.js +1 -1
  34. package/src/testing-js/component-editor.contract.js +1 -1
  35. package/src/testing-js/component-render.contract.js +1 -1
  36. package/src/testing-js/index.d.ts +2 -2
  37. package/src/testing-js/index.js +2 -2
  38. package/src/testing-js/page-compliance.contract.js +1 -1
  39. package/src/testing-js/{vitest-BMLIbDs2.d.ts → vitest-5vWtqwWe.d.ts} +2 -2
  40. package/src/testing-js/vitest.d.ts +1 -1
  41. package/src/testing-js/vitest.js +2 -2
  42. package/src/testing-js/chunk-RDHCBQ6I.js.map +0 -1
  43. package/src/testing-js/chunk-XV5CYADO.js.map +0 -1
@@ -3310,6 +3310,345 @@ var tooltipContract = {
3310
3310
  }
3311
3311
  };
3312
3312
 
3313
+ // src/testing/contracts/videolightbox.ts
3314
+ var videoLightboxContract = {
3315
+ id: "videolightbox",
3316
+ origin: "system",
3317
+ root: "root",
3318
+ // The editor renders an `inline` copy of the open lightbox beside the tile,
3319
+ // so the overlay and close button are measurable without opening a modal.
3320
+ parts: {
3321
+ root: ".videolightbox",
3322
+ trigger: ".videolightbox-trigger",
3323
+ overlay: ".videolightbox-modal.inline",
3324
+ closeButton: ".videolightbox-modal.inline .videolightbox-close",
3325
+ closeIcon: ".videolightbox-modal.inline .videolightbox-close svg"
3326
+ },
3327
+ properties: [
3328
+ {
3329
+ paints: {
3330
+ root: {
3331
+ backgroundColor: "--videolightbox-tile-surface",
3332
+ borderTopColor: "--videolightbox-tile-border",
3333
+ borderTopWidth: "--videolightbox-tile-border-width",
3334
+ borderRadius: "--videolightbox-tile-radius",
3335
+ boxShadow: "--videolightbox-tile-shadow"
3336
+ },
3337
+ overlay: {
3338
+ backgroundColor: "--videolightbox-scrim-surface",
3339
+ paddingTop: "--videolightbox-overlay-padding"
3340
+ },
3341
+ closeButton: {
3342
+ backgroundColor: "--videolightbox-chrome-surface",
3343
+ borderTopColor: "--videolightbox-chrome-border",
3344
+ borderTopWidth: "--videolightbox-chrome-border-width",
3345
+ borderRadius: "--videolightbox-chrome-radius",
3346
+ color: "--videolightbox-chrome-icon"
3347
+ },
3348
+ closeIcon: { stroke: "--videolightbox-chrome-icon" }
3349
+ }
3350
+ },
3351
+ // The inline close button has no handler, so the click leaves the pointer
3352
+ // resting on it and its real :hover rule applies.
3353
+ {
3354
+ setup: [{ kind: "click", part: "closeButton" }],
3355
+ paints: { closeButton: { backgroundColor: "--videolightbox-chrome-hover-surface" } }
3356
+ }
3357
+ ],
3358
+ states: [{ state: "default" }, { state: "hover" }],
3359
+ uncovered: {
3360
+ "--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"
3362
+ },
3363
+ persistence: {
3364
+ cases: [
3365
+ {
3366
+ shape: "token",
3367
+ variable: "--videolightbox-tile-border-width",
3368
+ observe: { part: "root", css: "borderTopWidth" }
3369
+ }
3370
+ ],
3371
+ resetVariable: "--videolightbox-tile-border-width"
3372
+ },
3373
+ theme: {
3374
+ theme: "halloween",
3375
+ changed: [
3376
+ "--videolightbox-tile-border-width",
3377
+ "--videolightbox-tile-radius",
3378
+ "--videolightbox-chrome-border-width",
3379
+ "--videolightbox-chrome-radius"
3380
+ ],
3381
+ unchanged: ["--videolightbox-tile-shadow"],
3382
+ aliasedTo: {
3383
+ "--videolightbox-tile-border-width": "--border-width-2",
3384
+ "--videolightbox-tile-radius": "--radius-none"
3385
+ },
3386
+ observe: { part: "root", css: "borderTopWidth", variable: "--videolightbox-tile-border-width" }
3387
+ },
3388
+ interaction: {
3389
+ part: "trigger",
3390
+ role: "button",
3391
+ cases: [
3392
+ {
3393
+ name: "clicking the still opens the lightbox",
3394
+ action: { kind: "click", part: "trigger" },
3395
+ expect: { kind: "attribute", part: "trigger", name: "aria-expanded", value: "true" }
3396
+ }
3397
+ ]
3398
+ },
3399
+ behavior: {
3400
+ applicable: false,
3401
+ reason: "the lightbox declares no callback prop; opening portals a modal and plays media, which happy-dom cannot run"
3402
+ },
3403
+ sketch: {
3404
+ style: "pencil",
3405
+ parts: [
3406
+ { part: "root", fill: "--videolightbox-tile-surface", stroke: "--videolightbox-tile-border" }
3407
+ ]
3408
+ }
3409
+ };
3410
+
3411
+ // src/testing/contracts/videoframe.ts
3412
+ var videoFrameContract = {
3413
+ id: "videoframe",
3414
+ origin: "system",
3415
+ root: "root",
3416
+ parts: {
3417
+ root: ".videoframe-frame",
3418
+ clip: ".videoframe-clip",
3419
+ trigger: ".videoframe-trigger",
3420
+ badge: ".videoframe-badge",
3421
+ badgeIcon: ".videoframe-badge svg"
3422
+ },
3423
+ properties: [
3424
+ {
3425
+ paints: {
3426
+ root: {
3427
+ backgroundColor: "--videoframe-frame-surface",
3428
+ borderTopColor: "--videoframe-frame-border",
3429
+ borderTopWidth: "--videoframe-frame-border-width",
3430
+ borderRadius: "--videoframe-frame-radius"
3431
+ },
3432
+ clip: { backgroundColor: "--videoframe-clip-surface" },
3433
+ badge: {
3434
+ backgroundColor: "--videoframe-badge-default-surface",
3435
+ borderTopColor: "--videoframe-badge-default-border",
3436
+ borderTopWidth: "--videoframe-badge-default-border-width",
3437
+ width: "--videoframe-badge-default-size",
3438
+ color: "--videoframe-badge-default-icon"
3439
+ },
3440
+ badgeIcon: { width: "--videoframe-badge-default-icon-size" }
3441
+ }
3442
+ },
3443
+ {
3444
+ state: "hover",
3445
+ paints: {
3446
+ badge: {
3447
+ backgroundColor: "--videoframe-badge-hover-surface",
3448
+ borderTopColor: "--videoframe-badge-hover-border",
3449
+ color: "--videoframe-badge-hover-icon"
3450
+ }
3451
+ }
3452
+ }
3453
+ ],
3454
+ states: [{ state: "default" }, { state: "hover" }],
3455
+ uncovered: {
3456
+ "--videoframe-badge-duration": "consumed inside the badge transition shorthand, never a standalone computed value",
3457
+ "--videoframe-badge-easing": "consumed inside the badge transition shorthand, never a standalone computed value"
3458
+ },
3459
+ persistence: {
3460
+ cases: [
3461
+ {
3462
+ shape: "token",
3463
+ variable: "--videoframe-frame-border-width",
3464
+ observe: { part: "root", css: "borderTopWidth" }
3465
+ }
3466
+ ],
3467
+ resetVariable: "--videoframe-frame-border-width"
3468
+ },
3469
+ theme: {
3470
+ theme: "halloween",
3471
+ changed: ["--videoframe-frame-border-width", "--videoframe-frame-radius"],
3472
+ unchanged: ["--videoframe-badge-default-size"],
3473
+ aliasedTo: {
3474
+ "--videoframe-frame-border-width": "--border-width-3",
3475
+ "--videoframe-frame-radius": "--radius-none"
3476
+ },
3477
+ observe: { part: "root", css: "borderTopWidth", variable: "--videoframe-frame-border-width" }
3478
+ },
3479
+ interaction: {
3480
+ part: "trigger",
3481
+ role: "button",
3482
+ cases: [
3483
+ {
3484
+ name: "clicking the poster starts the clip",
3485
+ action: { kind: "click", part: "trigger" },
3486
+ expect: { kind: "attribute", part: "root", name: "data-playing", value: "true" }
3487
+ }
3488
+ ]
3489
+ },
3490
+ behavior: {
3491
+ applicable: false,
3492
+ reason: "the frame declares no callback prop; playback is the browser's own media element"
3493
+ },
3494
+ sketch: {
3495
+ style: "pencil",
3496
+ parts: [{ part: "root", fill: "--videoframe-frame-surface", stroke: "--videoframe-frame-border" }]
3497
+ }
3498
+ };
3499
+
3500
+ // src/testing/contracts/slidepager.ts
3501
+ var behaviorSlides = [
3502
+ { src: "a.webp", alt: "First slide" },
3503
+ { src: "b.webp", alt: "Second slide" },
3504
+ { src: "c.webp", alt: "Third slide" }
3505
+ ];
3506
+ var slidePagerContract = {
3507
+ id: "slidepager",
3508
+ origin: "system",
3509
+ root: "root",
3510
+ // The editor renders an `inline` copy of the full-screen read beside the
3511
+ // pager, so the overlay and its close button are measurable in place.
3512
+ parts: {
3513
+ root: ".slidepager",
3514
+ frame: ".slidepager .slidepager-frame",
3515
+ stage: ".slidepager .slidepager-stage",
3516
+ bar: ".slidepager > .slidepager-bar",
3517
+ prevControl: '.slidepager > .slidepager-bar [data-nav="prev"]',
3518
+ nextControl: '.slidepager > .slidepager-bar [data-nav="next"]',
3519
+ controlIcon: '.slidepager > .slidepager-bar [data-nav="next"] svg',
3520
+ counter: ".slidepager > .slidepager-bar .slidepager-counter",
3521
+ overlay: ".slidepager-modal.inline",
3522
+ closeButton: ".slidepager-modal.inline .slidepager-close"
3523
+ },
3524
+ properties: [
3525
+ {
3526
+ paints: {
3527
+ frame: {
3528
+ backgroundColor: "--slidepager-frame-surface",
3529
+ borderTopColor: "--slidepager-frame-border",
3530
+ borderTopWidth: "--slidepager-frame-border-width",
3531
+ borderRadius: "--slidepager-frame-radius",
3532
+ boxShadow: "--slidepager-frame-shadow"
3533
+ },
3534
+ bar: { columnGap: "--slidepager-bar-gap", paddingTop: "--slidepager-bar-padding" },
3535
+ nextControl: {
3536
+ backgroundColor: "--slidepager-control-surface",
3537
+ borderTopColor: "--slidepager-control-border",
3538
+ borderTopWidth: "--slidepager-control-border-width",
3539
+ borderRadius: "--slidepager-control-radius",
3540
+ width: "--slidepager-control-size",
3541
+ color: "--slidepager-control-icon"
3542
+ },
3543
+ controlIcon: { width: "--slidepager-control-icon-size" },
3544
+ counter: {
3545
+ color: "--slidepager-counter-text",
3546
+ fontFamily: "--slidepager-counter-font-family",
3547
+ fontSize: "--slidepager-counter-font-size",
3548
+ fontWeight: "--slidepager-counter-font-weight",
3549
+ lineHeight: "--slidepager-counter-line-height",
3550
+ letterSpacing: "--slidepager-counter-letter-spacing"
3551
+ },
3552
+ overlay: {
3553
+ backgroundColor: "--slidepager-scrim-surface",
3554
+ paddingTop: "--slidepager-overlay-padding"
3555
+ },
3556
+ closeButton: { top: "--slidepager-close-margin" }
3557
+ }
3558
+ },
3559
+ // The inline close button has no handler, so the click leaves the pointer
3560
+ // resting on it and its real :hover rule applies.
3561
+ {
3562
+ setup: [{ kind: "click", part: "closeButton" }],
3563
+ paints: {
3564
+ closeButton: {
3565
+ backgroundColor: "--slidepager-control-hover-surface",
3566
+ borderTopColor: "--slidepager-control-hover-border",
3567
+ color: "--slidepager-control-hover-icon"
3568
+ }
3569
+ }
3570
+ },
3571
+ // The preview opens on the middle slide, so one click back lands on the
3572
+ // first and disables the control under the pointer.
3573
+ {
3574
+ setup: [{ kind: "click", part: "prevControl" }],
3575
+ paints: {
3576
+ prevControl: {
3577
+ backgroundColor: "--slidepager-control-disabled-surface",
3578
+ borderTopColor: "--slidepager-control-disabled-border",
3579
+ color: "--slidepager-control-disabled-icon"
3580
+ }
3581
+ }
3582
+ }
3583
+ ],
3584
+ states: [{ state: "default" }, { state: "hover" }, { state: "disabled" }],
3585
+ uncovered: {
3586
+ "--slidepager-overlay-duration": "consumed inside the opacity transition shorthand, never a standalone computed value",
3587
+ "--slidepager-overlay-easing": "consumed inside the opacity transition shorthand, never a standalone computed value"
3588
+ },
3589
+ persistence: {
3590
+ cases: [
3591
+ {
3592
+ shape: "token",
3593
+ variable: "--slidepager-frame-border-width",
3594
+ observe: { part: "frame", css: "borderTopWidth" }
3595
+ }
3596
+ ],
3597
+ resetVariable: "--slidepager-frame-border-width"
3598
+ },
3599
+ theme: {
3600
+ theme: "halloween",
3601
+ changed: [
3602
+ "--slidepager-frame-border-width",
3603
+ "--slidepager-frame-radius",
3604
+ "--slidepager-control-border-width",
3605
+ "--slidepager-control-radius"
3606
+ ],
3607
+ unchanged: ["--slidepager-control-size"],
3608
+ aliasedTo: {
3609
+ "--slidepager-frame-border-width": "--border-width-3",
3610
+ "--slidepager-frame-radius": "--radius-none"
3611
+ },
3612
+ observe: { part: "frame", css: "borderTopWidth", variable: "--slidepager-frame-border-width" }
3613
+ },
3614
+ interaction: {
3615
+ part: "stage",
3616
+ role: "button",
3617
+ cases: [
3618
+ {
3619
+ name: "the next chevron moves the frame to the next slide",
3620
+ action: { kind: "click", part: "nextControl" },
3621
+ expect: { kind: "attribute", part: "stage", name: "aria-label", value: "Open slide 3 full screen" }
3622
+ }
3623
+ ]
3624
+ },
3625
+ behavior: {
3626
+ cases: [
3627
+ {
3628
+ name: "the next chevron reports the slide it moved to",
3629
+ props: { slides: behaviorSlides, index: 0 },
3630
+ action: { kind: "click", part: "nextControl" },
3631
+ expect: { kind: "callback", prop: "onchange", args: [1] }
3632
+ },
3633
+ {
3634
+ name: "the previous chevron is silent on the first slide",
3635
+ props: { slides: behaviorSlides, index: 0 },
3636
+ action: { kind: "click", part: "prevControl" },
3637
+ expect: { kind: "no-callback", prop: "onchange" }
3638
+ },
3639
+ {
3640
+ name: "the counter names the slide index opens on",
3641
+ props: { slides: behaviorSlides, index: 2 },
3642
+ expect: { kind: "text", part: "counter", value: "3 / 3" }
3643
+ }
3644
+ ]
3645
+ },
3646
+ sketch: {
3647
+ style: "pencil",
3648
+ parts: [{ part: "frame", fill: "--slidepager-frame-surface", stroke: "--slidepager-frame-border" }]
3649
+ }
3650
+ };
3651
+
3313
3652
  // src/testing/contracts/index.ts
3314
3653
  var shippedContracts = [
3315
3654
  badgeContract,
@@ -3337,7 +3676,10 @@ var shippedContracts = [
3337
3676
  tabBarContract,
3338
3677
  tableContract,
3339
3678
  toggleContract,
3340
- tooltipContract
3679
+ tooltipContract,
3680
+ videoLightboxContract,
3681
+ videoFrameContract,
3682
+ slidePagerContract
3341
3683
  ];
3342
3684
  var CONTRACTS_MODULE_ENV = "LIVE_TOKENS_CONTRACTS_MODULE";
3343
3685
  async function loadCustomContracts() {
@@ -3368,4 +3710,4 @@ export {
3368
3710
  allContracts,
3369
3711
  selectedContracts
3370
3712
  };
3371
- //# sourceMappingURL=chunk-RDHCBQ6I.js.map
3713
+ //# sourceMappingURL=chunk-OHU5BHGZ.js.map