@motion-proto/live-tokens 0.61.0 → 0.62.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 (36) hide show
  1. package/.claude/skills/live-tokens-build-page/SKILL.md +1 -1
  2. package/.claude/skills/live-tokens-pair-fonts/SKILL.md +1 -1
  3. package/CHANGELOG.md +73 -0
  4. package/dist-plugin/{chunk-OIOXU7FR.js → chunk-OPYOK2CA.js} +45 -25
  5. package/dist-plugin/index.cjs +45 -25
  6. package/dist-plugin/index.js +1 -1
  7. package/dist-plugin/tokensCssMigrations/index.cjs +45 -25
  8. package/dist-plugin/tokensCssMigrations/index.js +1 -1
  9. package/package.json +1 -1
  10. package/src/app/site.css +16 -0
  11. package/src/editor/component-editor/CardEditor.svelte +7 -1
  12. package/src/editor/component-editor/scaffolding/VariantGroup.svelte +25 -2
  13. package/src/editor/core/sketch/maskField.ts +70 -34
  14. package/src/editor/core/sketch/sketchLayer.ts +24 -3
  15. package/src/editor/core/sketch/sketchPresets.ts +10 -11
  16. package/src/editor/core/sketch/sketchStore.ts +89 -18
  17. package/src/editor/docs/content/sketch-mode.md +7 -2
  18. package/src/editor/docs/content.generated.ts +1 -1
  19. package/src/editor/overlay/LiveTokensRouter.svelte +8 -0
  20. package/src/editor/ui/sections/textStyles.ts +15 -1
  21. package/src/editor/ui/sketch/SketchTab.svelte +33 -81
  22. package/src/live-tokens/data/colors-and-type/midnight-study.json +40 -30
  23. package/src/live-tokens/data/themes/autumn.json +3 -3
  24. package/src/live-tokens/data/themes/halloween.json +3 -3
  25. package/src/live-tokens/data/themes/midnight-study.json +61 -49
  26. package/src/live-tokens/data/themes/ocean.json +3 -3
  27. package/src/live-tokens/data/themes/royal-velvet.json +3 -3
  28. package/src/live-tokens/data/themes/sketchy.json +3 -3
  29. package/src/live-tokens/data/themes/spring-meadow.json +3 -3
  30. package/src/live-tokens/data/themes/sunset.json +3 -3
  31. package/src/system/components/Card.svelte +27 -9
  32. package/src/system/components/ImageLightbox.svelte +5 -2
  33. package/src/system/components/SectionDivider.svelte +3 -3
  34. package/src/system/components/SegmentedControl.svelte +11 -9
  35. package/src/system/styles/tokens.css +13 -5
  36. package/template/src/pages/Home.svelte +1 -11
@@ -3516,7 +3516,7 @@
3516
3516
  "--sectiondivider-lg-description": "--text-alternate",
3517
3517
  "--sectiondivider-lg-eyebrow": "--text-brand",
3518
3518
  "--sectiondivider-lg-border": "--color-transparent",
3519
- "--sectiondivider-lg-title-outline-color": "--surface-canvas-lowest",
3519
+ "--sectiondivider-lg-title-outline-color": "transparent",
3520
3520
  "--sectiondivider-lg-hairline-color": "--border-brand-medium",
3521
3521
  "--sectiondivider-md-title-font-family": "--font-display",
3522
3522
  "--sectiondivider-md-title-font-weight": "--font-weight-bold",
@@ -3545,7 +3545,7 @@
3545
3545
  "--sectiondivider-md-description": "--text-secondary",
3546
3546
  "--sectiondivider-md-eyebrow": "--text-tertiary",
3547
3547
  "--sectiondivider-md-border": "--color-transparent",
3548
- "--sectiondivider-md-title-outline-color": "--surface-accent-lowest",
3548
+ "--sectiondivider-md-title-outline-color": "transparent",
3549
3549
  "--sectiondivider-md-hairline-color": "--border-brand-medium",
3550
3550
  "--sectiondivider-sm-title-font-family": "--font-display",
3551
3551
  "--sectiondivider-sm-title-font-weight": "--font-weight-medium",
@@ -3574,7 +3574,7 @@
3574
3574
  "--sectiondivider-sm-description": "--text-secondary",
3575
3575
  "--sectiondivider-sm-eyebrow": "--text-tertiary",
3576
3576
  "--sectiondivider-sm-border": "--color-transparent",
3577
- "--sectiondivider-sm-title-outline-color": "color-mix(in srgb, var(--surface-neutral-lowest) 25%, transparent)",
3577
+ "--sectiondivider-sm-title-outline-color": "transparent",
3578
3578
  "--sectiondivider-sm-hairline-color": "color-mix(in srgb, var(--border-brand-medium) 50%, transparent)"
3579
3579
  }
3580
3580
  },
@@ -3568,7 +3568,7 @@
3568
3568
  "--sectiondivider-lg-description": "--text-alternate",
3569
3569
  "--sectiondivider-lg-eyebrow": "--text-brand",
3570
3570
  "--sectiondivider-lg-border": "--color-transparent",
3571
- "--sectiondivider-lg-title-outline-color": "--surface-canvas-lowest",
3571
+ "--sectiondivider-lg-title-outline-color": "transparent",
3572
3572
  "--sectiondivider-lg-hairline-color": "--border-brand-medium",
3573
3573
  "--sectiondivider-md-title-font-family": "--font-display",
3574
3574
  "--sectiondivider-md-title-font-weight": "--font-weight-bold",
@@ -3597,7 +3597,7 @@
3597
3597
  "--sectiondivider-md-description": "--text-secondary",
3598
3598
  "--sectiondivider-md-eyebrow": "--text-tertiary",
3599
3599
  "--sectiondivider-md-border": "--color-transparent",
3600
- "--sectiondivider-md-title-outline-color": "--surface-accent-lowest",
3600
+ "--sectiondivider-md-title-outline-color": "transparent",
3601
3601
  "--sectiondivider-md-hairline-color": "--border-brand-medium",
3602
3602
  "--sectiondivider-sm-title-font-family": "--font-display",
3603
3603
  "--sectiondivider-sm-title-font-weight": "--font-weight-medium",
@@ -3626,7 +3626,7 @@
3626
3626
  "--sectiondivider-sm-description": "--text-secondary",
3627
3627
  "--sectiondivider-sm-eyebrow": "--text-tertiary",
3628
3628
  "--sectiondivider-sm-border": "--color-transparent",
3629
- "--sectiondivider-sm-title-outline-color": "color-mix(in srgb, var(--surface-neutral-lowest) 25%, transparent)",
3629
+ "--sectiondivider-sm-title-outline-color": "transparent",
3630
3630
  "--sectiondivider-sm-hairline-color": "color-mix(in srgb, var(--border-brand-medium) 50%, transparent)"
3631
3631
  }
3632
3632
  },
@@ -3,6 +3,9 @@
3
3
  icon?: string;
4
4
  iconColor?: string;
5
5
  title?: string;
6
+ /** `bare` drops the header. The frame and body keep every token the default
7
+ variant uses, so padding, stroke and fill stay editable. */
8
+ variant?: 'default' | 'bare';
6
9
  size?: 'default' | 'compact';
7
10
  /** false → the card stops pinning body typography so the consumer fully owns slotted content's styling. */
8
11
  prose?: boolean;
@@ -20,6 +23,7 @@
20
23
  icon = '',
21
24
  iconColor = 'var(--text-secondary)',
22
25
  title = '',
26
+ variant = 'default',
23
27
  size = 'default',
24
28
  prose = true,
25
29
  flush = false,
@@ -35,16 +39,25 @@
35
39
  let hoverShadow = $derived(
36
40
  hover === undefined ? undefined : hover ? 'var(--card-hover-shadow)' : 'var(--card-default-shadow)',
37
41
  );
42
+
43
+ let showHeader = $derived(variant !== 'bare' && Boolean(icon || title));
44
+
45
+ $effect(() => {
46
+ if (import.meta.env.DEV && variant === 'default' && !icon && !title) {
47
+ console.warn('[live-tokens] <Card> has no icon or title. Use variant="bare" to declare a headerless card.');
48
+ }
49
+ });
38
50
  </script>
39
51
 
40
52
  <div
41
53
  class="card {className}"
54
+ class:bare={variant === 'bare'}
42
55
  class:compact={size === 'compact'}
43
56
  style:--card-color={iconColor}
44
57
  style:--card-hover-border-active={hoverBorder}
45
58
  style:--card-hover-shadow-active={hoverShadow}
46
59
  >
47
- {#if icon || title}
60
+ {#if showHeader}
48
61
  <div class="card-header">
49
62
  {#if icon}
50
63
  <i class="{icon} card-icon"></i>
@@ -68,17 +81,22 @@
68
81
  --card-default-border: var(--border-neutral);
69
82
  --card-default-border-width: var(--border-width-1);
70
83
  --card-default-radius: var(--radius-lg);
84
+ /* Every side tracks its base. A declared side always beats the fallback
85
+ themed-padding emits, so naming a literal step here left the base token
86
+ inert: merging split padding back to one value cleared the side aliases
87
+ and the card kept the old geometry. The asymmetry is a themed choice now,
88
+ carried by per-side aliases that override these outright. */
71
89
  --card-default-header-padding: var(--space-16);
72
- --card-default-header-padding-top: var(--space-12);
73
- --card-default-header-padding-right: var(--space-20);
74
- --card-default-header-padding-bottom: var(--space-12);
75
- --card-default-header-padding-left: var(--space-20);
90
+ --card-default-header-padding-top: var(--card-default-header-padding);
91
+ --card-default-header-padding-right: var(--card-default-header-padding);
92
+ --card-default-header-padding-bottom: var(--card-default-header-padding);
93
+ --card-default-header-padding-left: var(--card-default-header-padding);
76
94
  --card-default-header-gap: var(--space-8);
77
95
  --card-default-body-padding: var(--space-16);
78
- --card-default-body-padding-top: var(--space-16);
79
- --card-default-body-padding-right: var(--space-20);
80
- --card-default-body-padding-bottom: var(--space-16);
81
- --card-default-body-padding-left: var(--space-20);
96
+ --card-default-body-padding-top: var(--card-default-body-padding);
97
+ --card-default-body-padding-right: var(--card-default-body-padding);
98
+ --card-default-body-padding-bottom: var(--card-default-body-padding);
99
+ --card-default-body-padding-left: var(--card-default-body-padding);
82
100
  --card-default-shadow: var(--shadow-sm);
83
101
  --card-default-blur: var(--blur-none);
84
102
  --card-default-header-surface: color-mix(in srgb, var(--surface-neutral-lowest) 80%, transparent);
@@ -728,7 +728,8 @@
728
728
 
729
729
  <style>
730
730
  :global(:root) {
731
- /* thumbnail (closed inline) + animated modal stage */
731
+ /* thumbnail (closed inline) + animated modal stage; the fill is the
732
+ thumbnail's alone — the open stage rides the overlay */
732
733
  --imagelightbox-tile-surface: var(--color-transparent);
733
734
  --imagelightbox-tile-radius: var(--radius-2xl);
734
735
  --imagelightbox-tile-border: var(--color-transparent);
@@ -813,13 +814,15 @@
813
814
  border: 0;
814
815
  }
815
816
 
817
+ /* No tile fill here: the open stage sits on the near-opaque overlay, which
818
+ already backs transparent art. Painting the fill too would band the scrim
819
+ wherever the image's aspect leaves the stage box unfilled. */
816
820
  .image-lightbox-stage {
817
821
  position: fixed;
818
822
  z-index: var(--z-modal);
819
823
  cursor: zoom-out;
820
824
  border: var(--imagelightbox-tile-border-width) solid var(--imagelightbox-tile-border);
821
825
  border-radius: var(--imagelightbox-tile-radius);
822
- background: var(--imagelightbox-tile-surface);
823
826
  }
824
827
 
825
828
  .image-lightbox-clip {
@@ -243,7 +243,7 @@
243
243
  --sectiondivider-lg-description: var(--text-alternate);
244
244
  --sectiondivider-lg-eyebrow: var(--text-brand);
245
245
  --sectiondivider-lg-border: var(--color-transparent);
246
- --sectiondivider-lg-title-outline-color: var(--surface-canvas-lowest);
246
+ --sectiondivider-lg-title-outline-color: var(--color-transparent);
247
247
  --sectiondivider-lg-hairline-color: var(--border-brand-medium);
248
248
 
249
249
  /* Medium */
@@ -274,7 +274,7 @@
274
274
  --sectiondivider-md-description: var(--text-secondary);
275
275
  --sectiondivider-md-eyebrow: var(--text-tertiary);
276
276
  --sectiondivider-md-border: var(--color-transparent);
277
- --sectiondivider-md-title-outline-color: var(--surface-accent-lowest);
277
+ --sectiondivider-md-title-outline-color: var(--color-transparent);
278
278
  --sectiondivider-md-hairline-color: var(--border-brand-medium);
279
279
 
280
280
  /* Small */
@@ -305,7 +305,7 @@
305
305
  --sectiondivider-sm-description: var(--text-secondary);
306
306
  --sectiondivider-sm-eyebrow: var(--text-tertiary);
307
307
  --sectiondivider-sm-border: var(--color-transparent);
308
- --sectiondivider-sm-title-outline-color: color-mix(in srgb, var(--surface-neutral-lowest) 25%, transparent);
308
+ --sectiondivider-sm-title-outline-color: var(--color-transparent);
309
309
  --sectiondivider-sm-hairline-color: color-mix(in srgb, var(--border-brand-medium) 50%, transparent);
310
310
 
311
311
  /* Intrinsic defaults. These keys cascade to `:root` via the editor's
@@ -152,25 +152,27 @@
152
152
  icon size) all read through these default names, so rebinding them
153
153
  here is enough — no per-state small token explosion. Per-side padding
154
154
  overrides are rebound too so split-padding edits at small don't leak
155
- through to default size. Font-weight and color are intentionally NOT
155
+ through to default size; each carries the same fallback themed-padding
156
+ emits, so merging the small padding back to one value leaves the base
157
+ token in charge instead of binding to a name nothing sets. Font-weight and color are intentionally NOT
156
158
  rebound: weight differences are state-driven (selected = semibold),
157
159
  colors are state-driven too. */
158
160
  .segmented-control.small {
159
161
  --segmentedcontrol-bar-padding: var(--segmentedcontrol-bar-small-padding);
160
- --segmentedcontrol-bar-padding-top: var(--segmentedcontrol-bar-small-padding-top);
161
- --segmentedcontrol-bar-padding-right: var(--segmentedcontrol-bar-small-padding-right);
162
- --segmentedcontrol-bar-padding-bottom: var(--segmentedcontrol-bar-small-padding-bottom);
163
- --segmentedcontrol-bar-padding-left: var(--segmentedcontrol-bar-small-padding-left);
162
+ --segmentedcontrol-bar-padding-top: var(--segmentedcontrol-bar-small-padding-top, var(--segmentedcontrol-bar-small-padding));
163
+ --segmentedcontrol-bar-padding-right: var(--segmentedcontrol-bar-small-padding-right, var(--segmentedcontrol-bar-small-padding));
164
+ --segmentedcontrol-bar-padding-bottom: var(--segmentedcontrol-bar-small-padding-bottom, var(--segmentedcontrol-bar-small-padding));
165
+ --segmentedcontrol-bar-padding-left: var(--segmentedcontrol-bar-small-padding-left, var(--segmentedcontrol-bar-small-padding));
164
166
  --segmentedcontrol-bar-radius: var(--segmentedcontrol-bar-small-radius);
165
167
 
166
168
  --segmentedcontrol-divider-inset: var(--segmentedcontrol-small-divider-inset);
167
169
  --segmentedcontrol-divider-thickness: var(--segmentedcontrol-small-divider-thickness);
168
170
 
169
171
  --segmentedcontrol-option-padding: var(--segmentedcontrol-option-small-padding);
170
- --segmentedcontrol-option-padding-top: var(--segmentedcontrol-option-small-padding-top);
171
- --segmentedcontrol-option-padding-right: var(--segmentedcontrol-option-small-padding-right);
172
- --segmentedcontrol-option-padding-bottom: var(--segmentedcontrol-option-small-padding-bottom);
173
- --segmentedcontrol-option-padding-left: var(--segmentedcontrol-option-small-padding-left);
172
+ --segmentedcontrol-option-padding-top: var(--segmentedcontrol-option-small-padding-top, var(--segmentedcontrol-option-small-padding));
173
+ --segmentedcontrol-option-padding-right: var(--segmentedcontrol-option-small-padding-right, var(--segmentedcontrol-option-small-padding));
174
+ --segmentedcontrol-option-padding-bottom: var(--segmentedcontrol-option-small-padding-bottom, var(--segmentedcontrol-option-small-padding));
175
+ --segmentedcontrol-option-padding-left: var(--segmentedcontrol-option-small-padding-left, var(--segmentedcontrol-option-small-padding));
174
176
  --segmentedcontrol-option-gap: var(--segmentedcontrol-option-small-gap);
175
177
 
176
178
  /* Icon size has a single source-of-truth token now; text size/line-height
@@ -681,11 +681,19 @@
681
681
  --code-line-height: var(--line-height-normal);
682
682
  --code-letter-spacing: var(--letter-spacing-normal);
683
683
 
684
- --editorial-font-family: var(--font-editorial);
685
- --editorial-font-size: var(--font-size-md);
686
- --editorial-font-weight: var(--font-weight-normal);
687
- --editorial-line-height: var(--line-height-normal);
688
- --editorial-letter-spacing: var(--letter-spacing-normal);
684
+ /* Editorial — the long-reading role. Each step mirrors its body counterpart
685
+ until the stack is repointed. */
686
+ --editorial-md-font-family: var(--font-editorial);
687
+ --editorial-md-font-size: var(--font-size-md);
688
+ --editorial-md-font-weight: var(--font-weight-normal);
689
+ --editorial-md-line-height: var(--line-height-normal);
690
+ --editorial-md-letter-spacing: var(--letter-spacing-normal);
691
+
692
+ --editorial-sm-font-family: var(--font-editorial);
693
+ --editorial-sm-font-size: var(--font-size-sm);
694
+ --editorial-sm-font-weight: var(--font-weight-normal);
695
+ --editorial-sm-line-height: var(--line-height-tight);
696
+ --editorial-sm-letter-spacing: var(--letter-spacing-normal);
689
697
 
690
698
  /* Eyebrow — values track the existing .eyebrow class in src/app/Home.svelte. */
691
699
  --eyebrow-font-family: var(--font-sans);
@@ -12,8 +12,7 @@
12
12
 
13
13
  <div class="home">
14
14
  <section class="stub">
15
- <Card>
16
- <span class="eyebrow">Your app lives here</span>
15
+ <Card variant="bare">
17
16
  <h1>Home</h1>
18
17
  <p>
19
18
  Replace this with your own content. Edit <code>src/pages/Home.svelte</code>
@@ -46,15 +45,6 @@
46
45
  grid-column: 4 / span 6;
47
46
  }
48
47
 
49
- .eyebrow {
50
- display: block;
51
- font-size: var(--font-size-sm);
52
- font-weight: var(--font-weight-normal);
53
- text-transform: uppercase;
54
- color: var(--text-tertiary);
55
- margin-bottom: var(--space-8);
56
- }
57
-
58
48
  h1 {
59
49
  font-family: var(--font-display);
60
50
  font-size: var(--font-size-4xl);