@motion-proto/live-tokens 0.85.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +55 -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 +108 -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 +97 -0
  13. package/src/live-tokens/data/themes/halloween.json +97 -0
  14. package/src/live-tokens/data/themes/midnight-study.json +97 -0
  15. package/src/live-tokens/data/themes/ocean.json +97 -0
  16. package/src/live-tokens/data/themes/royal-velvet.json +97 -0
  17. package/src/live-tokens/data/themes/sketchy.json +97 -0
  18. package/src/live-tokens/data/themes/spring-meadow.json +97 -0
  19. package/src/live-tokens/data/themes/sunset.json +97 -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 +454 -0
  29. package/src/testing-js/{chunk-RDHCBQ6I.js → chunk-FTLASW2R.js} +366 -2
  30. package/src/testing-js/chunk-FTLASW2R.js.map +1 -0
  31. package/src/testing-js/{chunk-XV5CYADO.js → chunk-NXRFTTVL.js} +10 -6
  32. package/src/testing-js/chunk-NXRFTTVL.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,367 @@ 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
+ badge: ".videolightbox-badge",
3324
+ badgeIcon: ".videolightbox-badge svg",
3325
+ overlay: ".videolightbox-modal.inline",
3326
+ closeButton: ".videolightbox-modal.inline .videolightbox-close",
3327
+ closeIcon: ".videolightbox-modal.inline .videolightbox-close svg"
3328
+ },
3329
+ properties: [
3330
+ {
3331
+ paints: {
3332
+ root: {
3333
+ backgroundColor: "--videolightbox-tile-surface",
3334
+ borderTopColor: "--videolightbox-tile-border",
3335
+ borderTopWidth: "--videolightbox-tile-border-width",
3336
+ borderRadius: "--videolightbox-tile-radius",
3337
+ boxShadow: "--videolightbox-tile-shadow"
3338
+ },
3339
+ overlay: {
3340
+ backgroundColor: "--videolightbox-scrim-surface",
3341
+ paddingTop: "--videolightbox-overlay-padding"
3342
+ },
3343
+ closeButton: {
3344
+ backgroundColor: "--videolightbox-chrome-surface",
3345
+ borderTopColor: "--videolightbox-chrome-border",
3346
+ borderTopWidth: "--videolightbox-chrome-border-width",
3347
+ borderRadius: "--videolightbox-chrome-radius",
3348
+ color: "--videolightbox-chrome-icon"
3349
+ },
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
+ }
3369
+ }
3370
+ },
3371
+ // The inline close button has no handler, so the click leaves the pointer
3372
+ // resting on it and its real :hover rule applies.
3373
+ {
3374
+ setup: [{ kind: "click", part: "closeButton" }],
3375
+ paints: { closeButton: { backgroundColor: "--videolightbox-chrome-hover-surface" } }
3376
+ }
3377
+ ],
3378
+ states: [{ state: "default" }, { state: "hover" }],
3379
+ uncovered: {
3380
+ "--videolightbox-overlay-duration": "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"
3384
+ },
3385
+ persistence: {
3386
+ cases: [
3387
+ {
3388
+ shape: "token",
3389
+ variable: "--videolightbox-tile-border-width",
3390
+ observe: { part: "root", css: "borderTopWidth" }
3391
+ }
3392
+ ],
3393
+ resetVariable: "--videolightbox-tile-border-width"
3394
+ },
3395
+ theme: {
3396
+ theme: "halloween",
3397
+ changed: [
3398
+ "--videolightbox-tile-border-width",
3399
+ "--videolightbox-tile-radius",
3400
+ "--videolightbox-chrome-border-width",
3401
+ "--videolightbox-chrome-radius"
3402
+ ],
3403
+ unchanged: ["--videolightbox-tile-shadow"],
3404
+ aliasedTo: {
3405
+ "--videolightbox-tile-border-width": "--border-width-2",
3406
+ "--videolightbox-tile-radius": "--radius-none"
3407
+ },
3408
+ observe: { part: "root", css: "borderTopWidth", variable: "--videolightbox-tile-border-width" }
3409
+ },
3410
+ interaction: {
3411
+ part: "trigger",
3412
+ role: "button",
3413
+ cases: [
3414
+ {
3415
+ name: "clicking the still opens the lightbox",
3416
+ action: { kind: "click", part: "trigger" },
3417
+ expect: { kind: "attribute", part: "trigger", name: "aria-expanded", value: "true" }
3418
+ }
3419
+ ]
3420
+ },
3421
+ behavior: {
3422
+ applicable: false,
3423
+ reason: "the lightbox declares no callback prop; opening portals a modal and plays media, which happy-dom cannot run"
3424
+ },
3425
+ sketch: {
3426
+ style: "pencil",
3427
+ parts: [
3428
+ { part: "root", fill: "--videolightbox-tile-surface", stroke: "--videolightbox-tile-border" }
3429
+ ]
3430
+ }
3431
+ };
3432
+
3433
+ // src/testing/contracts/videoframe.ts
3434
+ var videoFrameContract = {
3435
+ id: "videoframe",
3436
+ origin: "system",
3437
+ root: "root",
3438
+ parts: {
3439
+ root: ".videoframe-frame",
3440
+ clip: ".videoframe-clip",
3441
+ trigger: ".videoframe-trigger",
3442
+ badge: ".videoframe-badge",
3443
+ badgeIcon: ".videoframe-badge svg"
3444
+ },
3445
+ properties: [
3446
+ {
3447
+ paints: {
3448
+ root: {
3449
+ backgroundColor: "--videoframe-frame-surface",
3450
+ borderTopColor: "--videoframe-frame-border",
3451
+ borderTopWidth: "--videoframe-frame-border-width",
3452
+ borderRadius: "--videoframe-frame-radius"
3453
+ },
3454
+ clip: { backgroundColor: "--videoframe-clip-surface" },
3455
+ badge: {
3456
+ backgroundColor: "--videoframe-badge-default-surface",
3457
+ borderTopColor: "--videoframe-badge-default-border",
3458
+ borderTopWidth: "--videoframe-badge-default-border-width",
3459
+ width: "--videoframe-badge-default-size",
3460
+ color: "--videoframe-badge-default-icon"
3461
+ },
3462
+ badgeIcon: { width: "--videoframe-badge-default-icon-size" }
3463
+ }
3464
+ },
3465
+ {
3466
+ state: "hover",
3467
+ paints: {
3468
+ badge: {
3469
+ backgroundColor: "--videoframe-badge-hover-surface",
3470
+ borderTopColor: "--videoframe-badge-hover-border",
3471
+ color: "--videoframe-badge-hover-icon"
3472
+ }
3473
+ }
3474
+ }
3475
+ ],
3476
+ states: [{ state: "default" }, { state: "hover" }],
3477
+ uncovered: {
3478
+ "--videoframe-badge-duration": "consumed inside the badge transition shorthand, never a standalone computed value",
3479
+ "--videoframe-badge-easing": "consumed inside the badge transition shorthand, never a standalone computed value"
3480
+ },
3481
+ persistence: {
3482
+ cases: [
3483
+ {
3484
+ shape: "token",
3485
+ variable: "--videoframe-frame-border-width",
3486
+ observe: { part: "root", css: "borderTopWidth" }
3487
+ }
3488
+ ],
3489
+ resetVariable: "--videoframe-frame-border-width"
3490
+ },
3491
+ theme: {
3492
+ theme: "halloween",
3493
+ changed: ["--videoframe-frame-border-width", "--videoframe-frame-radius"],
3494
+ unchanged: ["--videoframe-badge-default-size"],
3495
+ aliasedTo: {
3496
+ "--videoframe-frame-border-width": "--border-width-3",
3497
+ "--videoframe-frame-radius": "--radius-none"
3498
+ },
3499
+ observe: { part: "root", css: "borderTopWidth", variable: "--videoframe-frame-border-width" }
3500
+ },
3501
+ interaction: {
3502
+ part: "trigger",
3503
+ role: "button",
3504
+ cases: [
3505
+ {
3506
+ name: "clicking the poster starts the clip",
3507
+ action: { kind: "click", part: "trigger" },
3508
+ expect: { kind: "attribute", part: "root", name: "data-playing", value: "true" }
3509
+ }
3510
+ ]
3511
+ },
3512
+ behavior: {
3513
+ applicable: false,
3514
+ reason: "the frame declares no callback prop; playback is the browser's own media element"
3515
+ },
3516
+ sketch: {
3517
+ style: "pencil",
3518
+ parts: [{ part: "root", fill: "--videoframe-frame-surface", stroke: "--videoframe-frame-border" }]
3519
+ }
3520
+ };
3521
+
3522
+ // src/testing/contracts/slidepager.ts
3523
+ var behaviorSlides = [
3524
+ { src: "a.webp", alt: "First slide" },
3525
+ { src: "b.webp", alt: "Second slide" },
3526
+ { src: "c.webp", alt: "Third slide" }
3527
+ ];
3528
+ var slidePagerContract = {
3529
+ id: "slidepager",
3530
+ origin: "system",
3531
+ root: "root",
3532
+ // The editor renders an `inline` copy of the full-screen read beside the
3533
+ // pager, so the overlay and its close button are measurable in place.
3534
+ parts: {
3535
+ root: ".slidepager",
3536
+ frame: ".slidepager .slidepager-frame",
3537
+ stage: ".slidepager .slidepager-stage",
3538
+ bar: ".slidepager > .slidepager-bar",
3539
+ prevControl: '.slidepager > .slidepager-bar [data-nav="prev"]',
3540
+ nextControl: '.slidepager > .slidepager-bar [data-nav="next"]',
3541
+ controlIcon: '.slidepager > .slidepager-bar [data-nav="next"] svg',
3542
+ counter: ".slidepager > .slidepager-bar .slidepager-counter",
3543
+ overlay: ".slidepager-modal.inline",
3544
+ closeButton: ".slidepager-modal.inline .slidepager-close"
3545
+ },
3546
+ properties: [
3547
+ {
3548
+ paints: {
3549
+ frame: {
3550
+ backgroundColor: "--slidepager-frame-surface",
3551
+ borderTopColor: "--slidepager-frame-border",
3552
+ borderTopWidth: "--slidepager-frame-border-width",
3553
+ borderRadius: "--slidepager-frame-radius",
3554
+ boxShadow: "--slidepager-frame-shadow"
3555
+ },
3556
+ bar: { columnGap: "--slidepager-bar-gap", paddingTop: "--slidepager-bar-padding" },
3557
+ nextControl: {
3558
+ backgroundColor: "--slidepager-control-surface",
3559
+ borderTopColor: "--slidepager-control-border",
3560
+ borderTopWidth: "--slidepager-control-border-width",
3561
+ borderRadius: "--slidepager-control-radius",
3562
+ width: "--slidepager-control-size",
3563
+ color: "--slidepager-control-icon"
3564
+ },
3565
+ controlIcon: { width: "--slidepager-control-icon-size" },
3566
+ counter: {
3567
+ color: "--slidepager-counter-text",
3568
+ fontFamily: "--slidepager-counter-font-family",
3569
+ fontSize: "--slidepager-counter-font-size",
3570
+ fontWeight: "--slidepager-counter-font-weight",
3571
+ lineHeight: "--slidepager-counter-line-height",
3572
+ letterSpacing: "--slidepager-counter-letter-spacing"
3573
+ },
3574
+ overlay: {
3575
+ backgroundColor: "--slidepager-scrim-surface",
3576
+ paddingTop: "--slidepager-overlay-padding"
3577
+ },
3578
+ closeButton: { top: "--slidepager-close-margin" }
3579
+ }
3580
+ },
3581
+ // The inline close button has no handler, so the click leaves the pointer
3582
+ // resting on it and its real :hover rule applies.
3583
+ {
3584
+ setup: [{ kind: "click", part: "closeButton" }],
3585
+ paints: {
3586
+ closeButton: {
3587
+ backgroundColor: "--slidepager-control-hover-surface",
3588
+ borderTopColor: "--slidepager-control-hover-border",
3589
+ color: "--slidepager-control-hover-icon"
3590
+ }
3591
+ }
3592
+ },
3593
+ // The preview opens on the middle slide, so one click back lands on the
3594
+ // first and disables the control under the pointer.
3595
+ {
3596
+ setup: [{ kind: "click", part: "prevControl" }],
3597
+ paints: {
3598
+ prevControl: {
3599
+ backgroundColor: "--slidepager-control-disabled-surface",
3600
+ borderTopColor: "--slidepager-control-disabled-border",
3601
+ color: "--slidepager-control-disabled-icon"
3602
+ }
3603
+ }
3604
+ }
3605
+ ],
3606
+ states: [{ state: "default" }, { state: "hover" }, { state: "disabled" }],
3607
+ uncovered: {
3608
+ "--slidepager-overlay-duration": "consumed inside the opacity transition shorthand, never a standalone computed value",
3609
+ "--slidepager-overlay-easing": "consumed inside the opacity transition shorthand, never a standalone computed value"
3610
+ },
3611
+ persistence: {
3612
+ cases: [
3613
+ {
3614
+ shape: "token",
3615
+ variable: "--slidepager-frame-border-width",
3616
+ observe: { part: "frame", css: "borderTopWidth" }
3617
+ }
3618
+ ],
3619
+ resetVariable: "--slidepager-frame-border-width"
3620
+ },
3621
+ theme: {
3622
+ theme: "halloween",
3623
+ changed: [
3624
+ "--slidepager-frame-border-width",
3625
+ "--slidepager-frame-radius",
3626
+ "--slidepager-control-border-width",
3627
+ "--slidepager-control-radius"
3628
+ ],
3629
+ unchanged: ["--slidepager-control-size"],
3630
+ aliasedTo: {
3631
+ "--slidepager-frame-border-width": "--border-width-3",
3632
+ "--slidepager-frame-radius": "--radius-none"
3633
+ },
3634
+ observe: { part: "frame", css: "borderTopWidth", variable: "--slidepager-frame-border-width" }
3635
+ },
3636
+ interaction: {
3637
+ part: "stage",
3638
+ role: "button",
3639
+ cases: [
3640
+ {
3641
+ name: "the next chevron moves the frame to the next slide",
3642
+ action: { kind: "click", part: "nextControl" },
3643
+ expect: { kind: "attribute", part: "stage", name: "aria-label", value: "Open slide 3 full screen" }
3644
+ }
3645
+ ]
3646
+ },
3647
+ behavior: {
3648
+ cases: [
3649
+ {
3650
+ name: "the next chevron reports the slide it moved to",
3651
+ props: { slides: behaviorSlides, index: 0 },
3652
+ action: { kind: "click", part: "nextControl" },
3653
+ expect: { kind: "callback", prop: "onchange", args: [1] }
3654
+ },
3655
+ {
3656
+ name: "the previous chevron is silent on the first slide",
3657
+ props: { slides: behaviorSlides, index: 0 },
3658
+ action: { kind: "click", part: "prevControl" },
3659
+ expect: { kind: "no-callback", prop: "onchange" }
3660
+ },
3661
+ {
3662
+ name: "the counter names the slide index opens on",
3663
+ props: { slides: behaviorSlides, index: 2 },
3664
+ expect: { kind: "text", part: "counter", value: "3 / 3" }
3665
+ }
3666
+ ]
3667
+ },
3668
+ sketch: {
3669
+ style: "pencil",
3670
+ parts: [{ part: "frame", fill: "--slidepager-frame-surface", stroke: "--slidepager-frame-border" }]
3671
+ }
3672
+ };
3673
+
3313
3674
  // src/testing/contracts/index.ts
3314
3675
  var shippedContracts = [
3315
3676
  badgeContract,
@@ -3337,7 +3698,10 @@ var shippedContracts = [
3337
3698
  tabBarContract,
3338
3699
  tableContract,
3339
3700
  toggleContract,
3340
- tooltipContract
3701
+ tooltipContract,
3702
+ videoLightboxContract,
3703
+ videoFrameContract,
3704
+ slidePagerContract
3341
3705
  ];
3342
3706
  var CONTRACTS_MODULE_ENV = "LIVE_TOKENS_CONTRACTS_MODULE";
3343
3707
  async function loadCustomContracts() {
@@ -3368,4 +3732,4 @@ export {
3368
3732
  allContracts,
3369
3733
  selectedContracts
3370
3734
  };
3371
- //# sourceMappingURL=chunk-RDHCBQ6I.js.map
3735
+ //# sourceMappingURL=chunk-FTLASW2R.js.map