@motion-proto/live-tokens 0.78.0 → 0.80.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 (172) hide show
  1. package/.claude/skills/live-tokens-check-compliance/SKILL.md +49 -38
  2. package/.claude/skills/live-tokens-create-component/SKILL.md +23 -28
  3. package/.claude/skills/live-tokens-create-component/references/contract-tests.md +61 -0
  4. package/.claude/skills/live-tokens-create-component/references/sketch-mode.md +2 -2
  5. package/.claude/skills/live-tokens-create-component/references/token-naming.md +6 -15
  6. package/.claude/skills/live-tokens-create-page/SKILL.md +6 -4
  7. package/.claude/skills/live-tokens-create-theme/references/design-directions.md +1 -1
  8. package/.claude/skills/live-tokens-pick-component/SKILL.md +3 -3
  9. package/.claude/skills/live-tokens-set-colors/references/color-anchors.md +1 -1
  10. package/.claude/skills/live-tokens-set-geometry/SKILL.md +1 -1
  11. package/.claude/skills/live-tokens-set-geometry/references/geometry-anchors.md +1 -1
  12. package/CHANGELOG.md +271 -0
  13. package/README.md +10 -16
  14. package/bin/check-component.mjs +154 -551
  15. package/bin/check-page.mjs +57 -541
  16. package/bin/cli.mjs +93 -16
  17. package/bin/contractRunner.mjs +37 -91
  18. package/bin/lib/buildChecks.mjs +32 -0
  19. package/bin/lib/catalogue.mjs +161 -34
  20. package/bin/lib/componentSource.mjs +152 -0
  21. package/bin/lib/cssValues.mjs +9 -0
  22. package/bin/lib/dataDir.mjs +126 -0
  23. package/bin/lib/findings.mjs +103 -12
  24. package/bin/lib/fixers.mjs +64 -0
  25. package/bin/lib/geometry.mjs +92 -0
  26. package/bin/lib/pageSource.mjs +230 -0
  27. package/bin/lib/report.mjs +57 -59
  28. package/bin/lib/tokenVocabulary.mjs +104 -34
  29. package/bin/migrate-build-script.mjs +66 -0
  30. package/bin/migrate.mjs +5 -0
  31. package/bin/rules/componentStructure.mjs +344 -0
  32. package/bin/rules/componentUse.mjs +313 -0
  33. package/bin/rules/importsAndRoutes.mjs +136 -0
  34. package/bin/rules/testRuns.mjs +122 -0
  35. package/bin/rules/tokens.mjs +426 -0
  36. package/bin/setup-claude.mjs +1 -2
  37. package/dist-plugin/{chunk-PDNL4NC5.js → chunk-D4WRIKEZ.js} +7 -2
  38. package/dist-plugin/{chunk-SWXRVZKT.js → chunk-REBHE3ZM.js} +414 -1
  39. package/dist-plugin/index.cjs +470 -19
  40. package/dist-plugin/index.d.cts +1 -0
  41. package/dist-plugin/index.d.ts +1 -0
  42. package/dist-plugin/index.js +87 -55
  43. package/dist-plugin/migrateData/index.cjs +422 -4
  44. package/dist-plugin/migrateData/index.js +2 -2
  45. package/dist-plugin/setColors/index.cjs +414 -1
  46. package/dist-plugin/setColors/index.d.cts +1 -1
  47. package/dist-plugin/setColors/index.d.ts +1 -1
  48. package/dist-plugin/setColors/index.js +1 -1
  49. package/dist-plugin/setGeometry/index.cjs +423 -13
  50. package/dist-plugin/setGeometry/index.d.cts +3 -3
  51. package/dist-plugin/setGeometry/index.d.ts +3 -3
  52. package/dist-plugin/setGeometry/index.js +10 -13
  53. package/dist-plugin/setType/index.d.cts +1 -1
  54. package/dist-plugin/setType/index.d.ts +1 -1
  55. package/dist-plugin/{themeTypes-BxRtuN5V.d.cts → themeTypes-B8_Idrp4.d.cts} +2 -2
  56. package/dist-plugin/{themeTypes-BxRtuN5V.d.ts → themeTypes-B8_Idrp4.d.ts} +2 -2
  57. package/package.json +2 -2
  58. package/src/editor/component-editor/CalloutEditor.svelte +2 -2
  59. package/src/editor/component-editor/CollapsibleSectionEditor.svelte +14 -15
  60. package/src/editor/component-editor/CornerBadgeEditor.svelte +14 -14
  61. package/src/editor/component-editor/DialogEditor.svelte +5 -5
  62. package/src/editor/component-editor/InlineEditActionsEditor.svelte +2 -2
  63. package/src/editor/component-editor/RadioButtonEditor.svelte +21 -21
  64. package/src/editor/component-editor/SectionDividerEditor.svelte +7 -7
  65. package/src/editor/component-editor/SegmentedControlEditor.svelte +5 -5
  66. package/src/editor/component-editor/SideNavigationEditor.svelte +25 -25
  67. package/src/editor/component-editor/TabBarEditor.svelte +6 -6
  68. package/src/editor/component-editor/TableEditor.svelte +6 -6
  69. package/src/editor/component-editor/ToggleEditor.svelte +2 -2
  70. package/src/editor/component-editor/index.ts +3 -0
  71. package/src/editor/component-editor/registry.ts +57 -1
  72. package/src/editor/component-editor/scaffolding/TokenLayout.svelte +14 -14
  73. package/src/editor/component-editor/scaffolding/VariantGroup.svelte +3 -0
  74. package/src/editor/component-editor/scaffolding/types.ts +15 -0
  75. package/src/editor/core/components/adjustAliases.ts +4 -4
  76. package/src/editor/core/components/aliasKinds.ts +20 -19
  77. package/src/editor/core/sketch/sketchLayer.ts +3 -3
  78. package/src/editor/core/themes/migrateComponentConfig.ts +14 -6
  79. package/src/editor/core/themes/migrations/2026-09-13-badge-brand.ts +42 -0
  80. package/src/editor/core/themes/migrations/2026-09-13-collapsiblesection-open.ts +33 -0
  81. package/src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts +70 -0
  82. package/src/editor/core/themes/migrations/2026-09-13-hairline.ts +92 -0
  83. package/src/editor/core/themes/migrations/2026-09-13-indicator.ts +54 -0
  84. package/src/editor/core/themes/migrations/2026-09-13-sectiondivider-surface.ts +36 -0
  85. package/src/editor/core/themes/migrations/2026-09-13-selected-state.ts +124 -0
  86. package/src/editor/core/themes/migrations/2026-09-13-toggle-label.ts +31 -0
  87. package/src/editor/core/themes/migrations/index.ts +16 -0
  88. package/src/editor/core/themes/themeService.ts +3 -3
  89. package/src/editor/core/themes/themeTypes.ts +13 -15
  90. package/src/editor/docs/Docs.svelte +1 -1
  91. package/src/editor/docs/content/light-and-dark.md +3 -3
  92. package/src/editor/docs/content.generated.ts +1 -1
  93. package/src/editor/index.ts +1 -0
  94. package/src/editor/overlay/LiveEditorOverlay.svelte +15 -0
  95. package/src/editor/skill-atlas/SkillAtlas.svelte +4 -4
  96. package/src/editor/skill-atlas/TreeNodeCard.svelte +4 -4
  97. package/src/editor/skill-atlas/skillSources.generated.ts +11 -14
  98. package/src/editor/skill-atlas/skillTrees.ts +1 -3
  99. package/src/editor/skill-atlas/trees/check-compliance.ts +37 -149
  100. package/src/editor/skill-atlas/trees/create-component.ts +62 -64
  101. package/src/editor/skill-atlas/trees/create-page.ts +38 -17
  102. package/src/editor/skill-atlas/trees/pick-component.ts +3 -3
  103. package/src/editor/skill-atlas/trees/set-geometry.ts +1 -1
  104. package/src/editor/ui/UIPaletteSelector.svelte +11 -15
  105. package/src/editor/ui/variantScales.ts +8 -8
  106. package/src/live-tokens/data/themes/autumn.json +188 -188
  107. package/src/live-tokens/data/themes/halloween.json +188 -188
  108. package/src/live-tokens/data/themes/midnight-study.json +245 -245
  109. package/src/live-tokens/data/themes/ocean.json +188 -188
  110. package/src/live-tokens/data/themes/royal-velvet.json +188 -188
  111. package/src/live-tokens/data/themes/sketchy.json +188 -188
  112. package/src/live-tokens/data/themes/spring-meadow.json +188 -188
  113. package/src/live-tokens/data/themes/sunset.json +188 -188
  114. package/src/system/components/Badge.svelte +27 -23
  115. package/src/system/components/Button.svelte +13 -7
  116. package/src/system/components/Callout.svelte +16 -11
  117. package/src/system/components/Card.svelte +22 -15
  118. package/src/system/components/CodeSnippet.svelte +10 -6
  119. package/src/system/components/CollapsibleSection.svelte +81 -76
  120. package/src/system/components/CornerBadge.svelte +78 -72
  121. package/src/system/components/Dialog.svelte +21 -18
  122. package/src/system/components/IconButton.svelte +13 -9
  123. package/src/system/components/Image.svelte +14 -8
  124. package/src/system/components/ImageLightbox.svelte +10 -6
  125. package/src/system/components/InlineEditActions.svelte +17 -14
  126. package/src/system/components/Input.svelte +13 -7
  127. package/src/system/components/MenuSelect.svelte +13 -7
  128. package/src/system/components/Notification.svelte +17 -11
  129. package/src/system/components/Panel.svelte +13 -6
  130. package/src/system/components/ProgressBar.svelte +10 -5
  131. package/src/system/components/RadioButton.svelte +33 -30
  132. package/src/system/components/SectionDivider.svelte +28 -21
  133. package/src/system/components/SegmentedControl.svelte +27 -23
  134. package/src/system/components/SideNavigation.svelte +175 -171
  135. package/src/system/components/Slider.svelte +11 -7
  136. package/src/system/components/TabBar.svelte +53 -49
  137. package/src/system/components/Table.svelte +20 -15
  138. package/src/system/components/Toggle.svelte +14 -10
  139. package/src/system/components/Tooltip.svelte +10 -6
  140. package/src/system/styles/CONVENTIONS.md +3 -4
  141. package/src/testing-js/chunk-3UKGXCDL.js +48 -0
  142. package/src/testing-js/chunk-3UKGXCDL.js.map +1 -0
  143. package/src/testing-js/{chunk-FAFOAWYL.js → chunk-Q3YIAAG3.js} +17 -3
  144. package/src/testing-js/chunk-Q3YIAAG3.js.map +1 -0
  145. package/src/testing-js/{chunk-GNIUPIU2.js → chunk-U7OJE5DU.js} +18 -18
  146. package/src/testing-js/chunk-U7OJE5DU.js.map +1 -0
  147. package/src/testing-js/{chunk-4JQX6WWL.js → chunk-ZMZQZ33J.js} +474 -166
  148. package/src/testing-js/chunk-ZMZQZ33J.js.map +1 -0
  149. package/src/testing-js/component-behavior.contract.js +155 -0
  150. package/src/testing-js/component-behavior.contract.js.map +1 -0
  151. package/src/testing-js/component-editor.contract.js +6 -4
  152. package/src/testing-js/component-editor.contract.js.map +1 -1
  153. package/src/testing-js/component-render.contract.js +14 -10
  154. package/src/testing-js/component-render.contract.js.map +1 -1
  155. package/src/testing-js/index.d.ts +44 -4
  156. package/src/testing-js/index.js +13 -7
  157. package/src/testing-js/index.js.map +1 -1
  158. package/src/testing-js/page-compliance.contract.js +48 -10
  159. package/src/testing-js/page-compliance.contract.js.map +1 -1
  160. package/src/testing-js/registry.contract.js +5 -3
  161. package/src/testing-js/registry.contract.js.map +1 -1
  162. package/src/testing-js/{vitest-C-wNWcoA.d.ts → vitest-BMLIbDs2.d.ts} +8 -2
  163. package/src/testing-js/vitest.d.ts +1 -1
  164. package/src/testing-js/vitest.js +2 -1
  165. package/template/package.json +1 -2
  166. package/template/vite.config.ts +3 -2
  167. package/.claude/skills/live-tokens-create-component/SKILL copy.md +0 -196
  168. package/.claude/skills/live-tokens-fix-findings/SKILL.md +0 -105
  169. package/src/editor/skill-atlas/trees/fix-findings.ts +0 -504
  170. package/src/testing-js/chunk-4JQX6WWL.js.map +0 -1
  171. package/src/testing-js/chunk-FAFOAWYL.js.map +0 -1
  172. package/src/testing-js/chunk-GNIUPIU2.js.map +0 -1
@@ -1,10 +1,16 @@
1
- <!--
2
- CornerBadge.svelte. A badge that sits on a corner of its parent.
3
- Use for: a count or status marker that sits on the thing it describes.
4
- Not for: a label in the text flow (Badge); feedback after an action
5
- (Notification).
6
- -->
7
1
  <script module lang="ts">
2
+ import type { CatalogueEntry } from '../../editor/component-editor/scaffolding/types';
3
+
4
+ export const catalogue = {
5
+ description: 'A badge that sits on a corner of its parent.',
6
+ useFor: 'a count or status marker that sits on the thing it describes.',
7
+ notFor: 'a label in the text flow (Badge); feedback after an action (Notification).',
8
+ props: {
9
+ variant: '`brand`, `accent`, `special`, `alternate`, `canvas`, and `neutral` paint a color family; `success`, `warning`, `danger`, and `info` carry a status.',
10
+ anchor: 'the corner the badge sits on; `bottom-right` unless named.',
11
+ },
12
+ } satisfies CatalogueEntry;
13
+
8
14
  export type CornerAnchor = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
9
15
  </script>
10
16
 
@@ -32,7 +38,7 @@
32
38
  }: Props = $props();
33
39
  </script>
34
40
 
35
- <span class="corner-badge corner-badge-{anchor} corner-badge-{variant}">
41
+ <span class="cornerbadge cornerbadge-{anchor} cornerbadge-{variant}">
36
42
  <Badge {variant} {size} {icon} {iconSlot}>
37
43
  {@render children?.()}
38
44
  </Badge>
@@ -41,7 +47,7 @@
41
47
  <style lang="scss">
42
48
  @use '../styles/padding' as *;
43
49
 
44
- $variants: primary, accent, neutral, alternate, canvas, special, success, warning, danger, info;
50
+ $variants: brand, accent, neutral, alternate, canvas, special, success, warning, danger, info;
45
51
 
46
52
  // Shape, offset, and type are uniform across variants — one flat token set
47
53
  // owns them. Colors are per-variant so authors can tune CornerBadge to read
@@ -50,110 +56,110 @@
50
56
  // re-targets the previewed variant so authors only see 3 color rows at a
51
57
  // time, scoped to whatever variant they're previewing.
52
58
  :global(:root) {
53
- --corner-badge-margin: var(--space-0);
54
- --corner-badge-outer-radius: var(--radius-none);
55
- --corner-badge-inner-radius: var(--radius-none);
56
- --corner-badge-h-axis-radius: var(--radius-none);
57
- --corner-badge-v-axis-radius: var(--radius-none);
58
- --corner-badge-padding: var(--space-6);
59
- --corner-badge-text-font-family: var(--font-sans);
60
- --corner-badge-text-font-size: var(--font-size-sm);
61
- --corner-badge-text-font-weight: var(--font-weight-medium);
62
- --corner-badge-text-line-height: var(--line-height-none);
59
+ --cornerbadge-margin: var(--space-0);
60
+ --cornerbadge-outer-radius: var(--radius-none);
61
+ --cornerbadge-inner-radius: var(--radius-none);
62
+ --cornerbadge-h-axis-radius: var(--radius-none);
63
+ --cornerbadge-v-axis-radius: var(--radius-none);
64
+ --cornerbadge-padding: var(--space-6);
65
+ --cornerbadge-text-font-family: var(--font-sans);
66
+ --cornerbadge-text-font-size: var(--font-size-sm);
67
+ --cornerbadge-text-font-weight: var(--font-weight-medium);
68
+ --cornerbadge-text-line-height: var(--line-height-none);
63
69
 
64
70
  /* Per-variant color overrides. Default = inherit the same family/level the
65
71
  inner Badge uses; author can swap to a different level (e.g. -low) to
66
72
  reduce contrast against the host surface. */
67
- --corner-badge-primary-surface: var(--surface-brand);
68
- --corner-badge-primary-border: var(--border-brand);
69
- --corner-badge-primary-text: var(--text-brand);
70
- --corner-badge-accent-surface: var(--surface-accent);
71
- --corner-badge-accent-border: var(--border-accent);
72
- --corner-badge-accent-text: var(--text-accent);
73
- --corner-badge-neutral-surface: var(--surface-neutral);
74
- --corner-badge-neutral-border: var(--border-neutral);
75
- --corner-badge-neutral-text: var(--text-primary);
76
- --corner-badge-alternate-surface: var(--surface-alternate);
77
- --corner-badge-alternate-border: var(--border-alternate);
78
- --corner-badge-alternate-text: var(--text-alternate);
79
- --corner-badge-canvas-surface: var(--surface-canvas);
80
- --corner-badge-canvas-border: var(--border-canvas);
81
- --corner-badge-canvas-text: var(--text-canvas);
82
- --corner-badge-special-surface: var(--surface-special);
83
- --corner-badge-special-border: var(--border-special);
84
- --corner-badge-special-text: var(--text-special);
85
- --corner-badge-success-surface: var(--surface-success);
86
- --corner-badge-success-border: var(--border-success);
87
- --corner-badge-success-text: var(--text-success);
88
- --corner-badge-warning-surface: var(--surface-warning);
89
- --corner-badge-warning-border: var(--border-warning);
90
- --corner-badge-warning-text: var(--text-warning);
91
- --corner-badge-danger-surface: var(--surface-danger);
92
- --corner-badge-danger-border: var(--border-danger);
93
- --corner-badge-danger-text: var(--text-danger);
94
- --corner-badge-info-surface: var(--surface-info);
95
- --corner-badge-info-border: var(--border-info);
96
- --corner-badge-info-text: var(--text-info);
73
+ --cornerbadge-brand-surface: var(--surface-brand);
74
+ --cornerbadge-brand-border: var(--border-brand);
75
+ --cornerbadge-brand-text: var(--text-brand);
76
+ --cornerbadge-accent-surface: var(--surface-accent);
77
+ --cornerbadge-accent-border: var(--border-accent);
78
+ --cornerbadge-accent-text: var(--text-accent);
79
+ --cornerbadge-neutral-surface: var(--surface-neutral);
80
+ --cornerbadge-neutral-border: var(--border-neutral);
81
+ --cornerbadge-neutral-text: var(--text-primary);
82
+ --cornerbadge-alternate-surface: var(--surface-alternate);
83
+ --cornerbadge-alternate-border: var(--border-alternate);
84
+ --cornerbadge-alternate-text: var(--text-alternate);
85
+ --cornerbadge-canvas-surface: var(--surface-canvas);
86
+ --cornerbadge-canvas-border: var(--border-canvas);
87
+ --cornerbadge-canvas-text: var(--text-canvas);
88
+ --cornerbadge-special-surface: var(--surface-special);
89
+ --cornerbadge-special-border: var(--border-special);
90
+ --cornerbadge-special-text: var(--text-special);
91
+ --cornerbadge-success-surface: var(--surface-success);
92
+ --cornerbadge-success-border: var(--border-success);
93
+ --cornerbadge-success-text: var(--text-success);
94
+ --cornerbadge-warning-surface: var(--surface-warning);
95
+ --cornerbadge-warning-border: var(--border-warning);
96
+ --cornerbadge-warning-text: var(--text-warning);
97
+ --cornerbadge-danger-surface: var(--surface-danger);
98
+ --cornerbadge-danger-border: var(--border-danger);
99
+ --cornerbadge-danger-text: var(--text-danger);
100
+ --cornerbadge-info-surface: var(--surface-info);
101
+ --cornerbadge-info-border: var(--border-info);
102
+ --cornerbadge-info-text: var(--text-info);
97
103
  }
98
104
 
99
- .corner-badge {
105
+ .cornerbadge {
100
106
  position: absolute;
101
107
  z-index: 1;
102
108
  pointer-events: none;
103
109
  // Pull public tokens into private vars so anchor mappings below stay generic.
104
- --_margin: var(--corner-badge-margin);
105
- --_outer-radius: var(--corner-badge-outer-radius);
106
- --_inner-radius: var(--corner-badge-inner-radius);
107
- --_h-axis-radius: var(--corner-badge-h-axis-radius);
108
- --_v-axis-radius: var(--corner-badge-v-axis-radius);
110
+ --_margin: var(--cornerbadge-margin);
111
+ --_outer-radius: var(--cornerbadge-outer-radius);
112
+ --_inner-radius: var(--cornerbadge-inner-radius);
113
+ --_h-axis-radius: var(--cornerbadge-h-axis-radius);
114
+ --_v-axis-radius: var(--cornerbadge-v-axis-radius);
109
115
 
110
116
  // Forward padding + font onto the inner Badge to override Badge's own
111
117
  // `.badge-#{$v}` rule. Specificity (0,2,0) beats Badge's (0,1,0).
112
118
  :global(.badge) {
113
- @include themed-padding(--corner-badge-padding, $h: 2);
114
- font-family: var(--corner-badge-text-font-family);
115
- font-size: var(--corner-badge-text-font-size);
116
- font-weight: var(--corner-badge-text-font-weight);
117
- line-height: var(--corner-badge-text-line-height);
119
+ @include themed-padding(--cornerbadge-padding, $h: 2);
120
+ font-family: var(--cornerbadge-text-font-family);
121
+ font-size: var(--cornerbadge-text-font-size);
122
+ font-weight: var(--cornerbadge-text-font-weight);
123
+ line-height: var(--cornerbadge-text-line-height);
118
124
  }
119
125
  }
120
126
 
121
127
  // Per-variant color overrides: rebind Badge's per-variant CSS vars inside
122
- // the corner-badge scope so the inner Badge picks up CornerBadge's color
128
+ // the cornerbadge scope so the inner Badge picks up CornerBadge's color
123
129
  // tokens without CornerBadge having to re-implement the painting rules.
124
130
  @each $v in $variants {
125
- .corner-badge-#{$v} {
126
- --badge-#{$v}-surface: var(--corner-badge-#{$v}-surface);
127
- --badge-#{$v}-border: var(--corner-badge-#{$v}-border);
128
- --badge-#{$v}-text: var(--corner-badge-#{$v}-text);
131
+ .cornerbadge-#{$v} {
132
+ --badge-#{$v}-surface: var(--cornerbadge-#{$v}-surface);
133
+ --badge-#{$v}-border: var(--cornerbadge-#{$v}-border);
134
+ --badge-#{$v}-text: var(--cornerbadge-#{$v}-text);
129
135
  }
130
136
  }
131
137
 
132
- .corner-badge-bottom-right { bottom: var(--_margin); right: var(--_margin); }
133
- .corner-badge-bottom-left { bottom: var(--_margin); left: var(--_margin); }
134
- .corner-badge-top-right { top: var(--_margin); right: var(--_margin); }
135
- .corner-badge-top-left { top: var(--_margin); left: var(--_margin); }
138
+ .cornerbadge-bottom-right { bottom: var(--_margin); right: var(--_margin); }
139
+ .cornerbadge-bottom-left { bottom: var(--_margin); left: var(--_margin); }
140
+ .cornerbadge-top-right { top: var(--_margin); right: var(--_margin); }
141
+ .cornerbadge-top-left { top: var(--_margin); left: var(--_margin); }
136
142
 
137
143
  /* Logical roles to physical corners, per anchor. */
138
- .corner-badge-bottom-right :global(.badge) {
144
+ .cornerbadge-bottom-right :global(.badge) {
139
145
  border-top-left-radius: var(--_inner-radius);
140
146
  border-top-right-radius: var(--_v-axis-radius);
141
147
  border-bottom-right-radius: var(--_outer-radius);
142
148
  border-bottom-left-radius: var(--_h-axis-radius);
143
149
  }
144
- .corner-badge-bottom-left :global(.badge) {
150
+ .cornerbadge-bottom-left :global(.badge) {
145
151
  border-top-left-radius: var(--_v-axis-radius);
146
152
  border-top-right-radius: var(--_inner-radius);
147
153
  border-bottom-right-radius: var(--_h-axis-radius);
148
154
  border-bottom-left-radius: var(--_outer-radius);
149
155
  }
150
- .corner-badge-top-right :global(.badge) {
156
+ .cornerbadge-top-right :global(.badge) {
151
157
  border-top-left-radius: var(--_h-axis-radius);
152
158
  border-top-right-radius: var(--_outer-radius);
153
159
  border-bottom-right-radius: var(--_v-axis-radius);
154
160
  border-bottom-left-radius: var(--_inner-radius);
155
161
  }
156
- .corner-badge-top-left :global(.badge) {
162
+ .cornerbadge-top-left :global(.badge) {
157
163
  border-top-left-radius: var(--_outer-radius);
158
164
  border-top-right-radius: var(--_h-axis-radius);
159
165
  border-bottom-right-radius: var(--_inner-radius);
@@ -1,10 +1,13 @@
1
- <!--
2
- Dialog.svelte. A modal window that blocks the page.
3
- Use for: a decision the page cannot continue without, such as a destructive
4
- confirmation or a sign-in.
5
- Not for: a routine form (Panel); a message that asks nothing of the reader
6
- (Notification).
7
- -->
1
+ <script module lang="ts">
2
+ import type { CatalogueEntry } from '../../editor/component-editor/scaffolding/types';
3
+
4
+ export const catalogue = {
5
+ description: 'A modal window that blocks the page.',
6
+ useFor: 'a decision the page cannot continue without, such as a destructive confirmation or a sign-in.',
7
+ notFor: 'a routine form (Panel); a message that asks nothing of the reader (Notification).',
8
+ } satisfies CatalogueEntry;
9
+ </script>
10
+
8
11
  <script lang="ts">
9
12
  import { createEventDispatcher, tick } from 'svelte';
10
13
  import type { Snippet } from 'svelte';
@@ -30,7 +33,7 @@
30
33
  let cancelVarValue = $state(readCssVar('--dialog-cancel-variant'));
31
34
 
32
35
  interface Props {
33
- show?: boolean;
36
+ open?: boolean;
34
37
  title?: string;
35
38
  width?: string;
36
39
  /** When true, the dialog renders inline within its parent rather than as a fixed-position overlay. Used by the editor preview. */
@@ -47,7 +50,7 @@
47
50
  }
48
51
 
49
52
  let {
50
- show = $bindable(false),
53
+ open = $bindable(false),
51
54
  title = '',
52
55
  width = '500px',
53
56
  inline = false,
@@ -82,7 +85,7 @@
82
85
 
83
86
  // Focus the primary button when dialog opens (skip in inline mode so the editor doesn't steal focus).
84
87
  $effect(() => {
85
- if (show && !inline) {
88
+ if (open && !inline) {
86
89
  tick().then(() => {
87
90
  if (confirm && confirmButtonRef && !confirm.disabled) {
88
91
  confirmButtonRef.focus();
@@ -107,12 +110,12 @@
107
110
  } else {
108
111
  onclose?.();
109
112
  dispatch('close');
110
- show = false;
113
+ open = false;
111
114
  }
112
115
  }
113
116
  </script>
114
117
 
115
- {#if show}
118
+ {#if open}
116
119
  <!-- The fixed backdrop portals to <body> to escape transformed/isolated
117
120
  ancestors; the inline preview variant stays in flow. -->
118
121
  <div class="dialog-backdrop" class:inline use:portal={!inline}>
@@ -186,8 +189,8 @@
186
189
 
187
190
  /* Header */
188
191
  --dialog-header-surface: var(--surface-neutral-lower);
189
- --dialog-header-divider: var(--border-neutral-subtle);
190
- --dialog-header-divider-width: var(--border-width-1);
192
+ --dialog-header-hairline-color: var(--border-neutral-subtle);
193
+ --dialog-header-hairline-width: var(--border-width-1);
191
194
  --dialog-header-padding: var(--space-8);
192
195
 
193
196
  /* Title */
@@ -210,8 +213,8 @@
210
213
  --dialog-body-line-height: var(--line-height-normal);
211
214
 
212
215
  /* Footer */
213
- --dialog-footer-divider: var(--border-neutral-subtle);
214
- --dialog-footer-divider-width: var(--border-width-1);
216
+ --dialog-footer-hairline-color: var(--border-neutral-subtle);
217
+ --dialog-footer-hairline-width: var(--border-width-1);
215
218
  --dialog-footer-padding: var(--space-16);
216
219
  }
217
220
 
@@ -271,7 +274,7 @@
271
274
  var(--dialog-header-padding-right, calc(var(--dialog-header-padding) * 3))
272
275
  var(--dialog-header-padding-bottom, var(--dialog-header-padding))
273
276
  var(--dialog-header-padding-left, calc(var(--dialog-header-padding) * 3));
274
- border-bottom: var(--dialog-header-divider-width) solid var(--dialog-header-divider);
277
+ border-bottom: var(--dialog-header-hairline-width) solid var(--dialog-header-hairline-color);
275
278
  background: var(--dialog-header-surface);
276
279
  display: flex;
277
280
  justify-content: space-between;
@@ -327,7 +330,7 @@
327
330
  var(--dialog-footer-padding-right, var(--dialog-footer-padding))
328
331
  var(--dialog-footer-padding-bottom, var(--dialog-footer-padding))
329
332
  var(--dialog-footer-padding-left, var(--dialog-footer-padding));
330
- border-top: var(--dialog-footer-divider-width) solid var(--dialog-footer-divider);
333
+ border-top: var(--dialog-footer-hairline-width) solid var(--dialog-footer-hairline-color);
331
334
  display: flex;
332
335
  justify-content: space-between;
333
336
  align-items: center;
@@ -1,12 +1,16 @@
1
- <!--
2
- IconButton.svelte. An action that an icon alone carries.
3
- Use for: an action whose meaning is plain from the glyph, such as close,
4
- edit, or delete.
5
- Not for: an action that needs a word (Button); the confirm-and-cancel pair
6
- after an inline edit (InlineEditActions).
7
- Emphasis: one primary per page; secondary for the rest; outline for a
8
- tertiary action; danger for a destructive one.
9
- -->
1
+ <script module lang="ts">
2
+ import type { CatalogueEntry } from '../../editor/component-editor/scaffolding/types';
3
+
4
+ export const catalogue = {
5
+ description: 'An action that an icon alone carries.',
6
+ useFor: 'an action whose meaning is plain from the glyph, such as close, edit, or delete.',
7
+ notFor: 'an action that needs a word (Button); the confirm-and-cancel pair after an inline edit (InlineEditActions).',
8
+ props: {
9
+ variant: 'one primary per page; secondary for the rest; outline for a tertiary action; danger for a destructive one.',
10
+ },
11
+ } satisfies CatalogueEntry;
12
+ </script>
13
+
10
14
  <script lang="ts">
11
15
  interface Props {
12
16
  /** Wash the hovered surface with the theme's tint. `undefined` inherits the
@@ -1,11 +1,17 @@
1
- <!--
2
- Image.svelte. A framed picture in the page flow.
3
- Use for: any picture the page shows.
4
- Not for: a picture whose detail the reader must open (ImageLightbox);
5
- decoration that page CSS paints.
6
- Variant: `default` keeps the picture's own proportions, `banner` gives it a
7
- tall frame, `medium` and `compact` shorter ones.
8
- -->
1
+ <script module lang="ts">
2
+ import type { CatalogueEntry } from '../../editor/component-editor/scaffolding/types';
3
+
4
+ export const catalogue = {
5
+ description: 'A framed picture in the page flow.',
6
+ useFor: 'any picture the page shows.',
7
+ notFor: 'a picture whose detail the reader must open (ImageLightbox); decoration that page CSS paints.',
8
+ props: {
9
+ variant:
10
+ "`default` keeps the picture's own proportions, `banner` gives it a tall frame, `medium` and `compact` shorter ones.",
11
+ },
12
+ } satisfies CatalogueEntry;
13
+ </script>
14
+
9
15
  <script lang="ts">
10
16
  interface Props {
11
17
  src: string;
@@ -1,9 +1,13 @@
1
- <!--
2
- ImageLightbox.svelte. A picture that opens to a full view on click.
3
- Use for: a screenshot, artwork, or chart whose detail is the point, and for
4
- a gallery of them.
5
- Not for: decoration or a picture the reader takes in at a glance (Image).
6
- -->
1
+ <script module lang="ts">
2
+ import type { CatalogueEntry } from '../../editor/component-editor/scaffolding/types';
3
+
4
+ export const catalogue = {
5
+ description: 'A picture that opens to a full view on click.',
6
+ useFor: 'a screenshot, artwork, or chart whose detail is the point, and for a gallery of them.',
7
+ notFor: 'decoration or a picture the reader takes in at a glance (Image).',
8
+ } satisfies CatalogueEntry;
9
+ </script>
10
+
7
11
  <script lang="ts">
8
12
  import { onMount, tick } from 'svelte';
9
13
  import { portal } from '../internal/portal';
@@ -1,20 +1,23 @@
1
- <!--
2
- InlineEditActions.svelte. The confirm-and-cancel pair that ends an inline
3
- edit.
4
- Use for: the two actions that close an in-place rename or value edit.
5
- Not for: the actions of a form or a dialog (Button); a lone action on a row
6
- (IconButton).
7
- -->
1
+ <script module lang="ts">
2
+ import type { CatalogueEntry } from '../../editor/component-editor/scaffolding/types';
3
+
4
+ export const catalogue = {
5
+ description: 'The confirm-and-cancel pair that ends an inline edit.',
6
+ useFor: 'the two actions that close an in-place rename or value edit.',
7
+ notFor: 'the actions of a form or a dialog (Button); a lone action on a row (IconButton).',
8
+ } satisfies CatalogueEntry;
9
+ </script>
10
+
8
11
  <script lang="ts">
9
-
12
+
10
13
 
11
14
  interface Props {
12
15
  /**
13
16
  * Reusable inline edit action buttons (confirm/cancel)
14
17
  * Used for inline editing throughout the app
15
18
  */
16
- onSave: () => void | Promise<void>;
17
- onCancel: () => void;
19
+ onsave: () => void | Promise<void>;
20
+ oncancel: () => void;
18
21
  disabled?: boolean;
19
22
  saveTitle?: string;
20
23
  cancelTitle?: string;
@@ -22,8 +25,8 @@
22
25
  }
23
26
 
24
27
  let {
25
- onSave,
26
- onCancel,
28
+ onsave,
29
+ oncancel,
27
30
  disabled = false,
28
31
  saveTitle = "Save",
29
32
  cancelTitle = "Cancel",
@@ -36,7 +39,7 @@
36
39
  <button
37
40
  class="save-btn"
38
41
  type="button"
39
- onclick={onSave}
42
+ onclick={onsave}
40
43
  {disabled}
41
44
  title={saveTitle}
42
45
  >
@@ -45,7 +48,7 @@
45
48
  <button
46
49
  class="cancel-btn"
47
50
  type="button"
48
- onclick={onCancel}
51
+ onclick={oncancel}
49
52
  disabled={disabled}
50
53
  title={cancelTitle}
51
54
  >
@@ -1,10 +1,16 @@
1
- <!--
2
- Input.svelte. A text field with its label, hint, and error line.
3
- Use for: an answer the page cannot list, such as a name, an amount, or a
4
- search string.
5
- Not for: a choice from a set the page can write down (MenuSelect); an on/off
6
- setting (Toggle).
7
- -->
1
+ <script module lang="ts">
2
+ import type { CatalogueEntry } from '../../editor/component-editor/scaffolding/types';
3
+
4
+ export const catalogue = {
5
+ description: 'A text field with its label, hint, and error line.',
6
+ useFor: 'an answer the page cannot list, such as a name, an amount, or a search string.',
7
+ notFor: 'a choice from a set the page can write down (MenuSelect); an on/off setting (Toggle).',
8
+ props: {
9
+ type: '`number` for an amount, `search` for a query, `password` for a secret; `text` otherwise.',
10
+ },
11
+ } satisfies CatalogueEntry;
12
+ </script>
13
+
8
14
  <script lang="ts">
9
15
  import { createEventDispatcher } from 'svelte';
10
16
 
@@ -1,10 +1,16 @@
1
- <!--
2
- MenuSelect.svelte. A list of options with one checked.
3
- Use for: single selection from a set too long to sit in a row, dropped from
4
- a Button.
5
- Not for: two to four inline alternatives (SegmentedControl); a form-style
6
- list read in full (RadioButton).
7
- -->
1
+ <script module lang="ts">
2
+ import type { CatalogueEntry } from '../../editor/component-editor/scaffolding/types';
3
+
4
+ export const catalogue = {
5
+ description: 'A list of options with one checked.',
6
+ useFor: 'single selection from a set too long to sit in a row, dropped from a Button.',
7
+ notFor: 'two to four inline alternatives (SegmentedControl); a form-style list read in full (RadioButton).',
8
+ props: {
9
+ role: '`listbox` for a select; `menu` for a command menu.',
10
+ },
11
+ } satisfies CatalogueEntry;
12
+ </script>
13
+
8
14
  <script lang="ts">
9
15
  import { createEventDispatcher } from 'svelte';
10
16
 
@@ -1,10 +1,16 @@
1
- <!--
2
- Notification.svelte. Feedback about something that just happened.
3
- Use for: the outcome of an action or a system event, which the reader can
4
- dismiss.
5
- Not for: standing content in a section (Callout); a decision that blocks the
6
- page (Dialog).
7
- -->
1
+ <script module lang="ts">
2
+ import type { CatalogueEntry } from '../../editor/component-editor/scaffolding/types';
3
+
4
+ export const catalogue = {
5
+ description: 'Feedback about something that just happened.',
6
+ useFor: 'the outcome of an action or a system event, which the reader can dismiss.',
7
+ notFor: 'standing content in a section (Callout); a decision that blocks the page (Dialog).',
8
+ props: {
9
+ variant: '`info` notes, `success` confirms, `warning` cautions, `danger` flags harm.',
10
+ },
11
+ } satisfies CatalogueEntry;
12
+ </script>
13
+
8
14
  <script lang="ts">
9
15
  import { createEventDispatcher } from 'svelte';
10
16
  import Button from './Button.svelte';
@@ -14,7 +20,7 @@
14
20
  title: string;
15
21
  description: string;
16
22
  variant?: 'info' | 'warning' | 'danger' | 'success';
17
- size?: 'normal' | 'compact';
23
+ size?: 'default' | 'small';
18
24
  icon?: string;
19
25
  dismissible?: boolean;
20
26
  emphasis?: boolean;
@@ -28,7 +34,7 @@
28
34
  title,
29
35
  description,
30
36
  variant = 'info',
31
- size = 'normal',
37
+ size = 'default',
32
38
  icon = '',
33
39
  dismissible = false,
34
40
  emphasis = false,
@@ -56,7 +62,7 @@
56
62
  }
57
63
  </script>
58
64
 
59
- <div class="notification" class:info={variant === 'info'} class:warning={variant === 'warning'} class:danger={variant === 'danger'} class:success={variant === 'success'} class:emphasis={emphasis} class:compact={size === 'compact'}>
65
+ <div class="notification" class:info={variant === 'info'} class:warning={variant === 'warning'} class:danger={variant === 'danger'} class:success={variant === 'success'} class:emphasis={emphasis} class:small={size === 'small'}>
60
66
  <div class="notification-header" class:has-action={actions.header}>
61
67
  <i class={displayIcon}></i>
62
68
  <span class="notification-title">{title}</span>
@@ -214,7 +220,7 @@
214
220
  border-left-width: 0.375rem;
215
221
  }
216
222
 
217
- &.compact {
223
+ &.small {
218
224
  font-size: var(--font-size-sm);
219
225
 
220
226
  .notification-description,
@@ -1,9 +1,16 @@
1
- <!--
2
- Panel.svelte. A frame around one section of the page's content.
3
- Use for: a stage, a list, a form, or a block of copy that reads as one
4
- region. `minHeight` holds the height while the content changes.
5
- Not for: one item in a set (Card); a modal surface (Dialog).
6
- -->
1
+ <script module lang="ts">
2
+ import type { CatalogueEntry } from '../../editor/component-editor/scaffolding/types';
3
+
4
+ export const catalogue = {
5
+ description: "A frame around one section of the page's content.",
6
+ useFor: 'a stage, a list, a form, or a block of copy that forms one section.',
7
+ notFor: 'one item in a set (Card); a modal window (Dialog).',
8
+ props: {
9
+ minHeight: 'holds the height while the content changes.',
10
+ },
11
+ } satisfies CatalogueEntry;
12
+ </script>
13
+
7
14
  <script lang="ts">
8
15
  import type { Snippet } from 'svelte';
9
16
 
@@ -1,8 +1,13 @@
1
- <!--
2
- ProgressBar.svelte. A read-out of progress against a labelled track.
3
- Use for: reporting how far a task has run.
4
- Not for: a number the reader sets (Slider); a standing status label (Badge).
5
- -->
1
+ <script module lang="ts">
2
+ import type { CatalogueEntry } from '../../editor/component-editor/scaffolding/types';
3
+
4
+ export const catalogue = {
5
+ description: 'A read-out of progress against a labelled track.',
6
+ useFor: 'reporting how far a task has run.',
7
+ notFor: 'a number the reader sets (Slider); a standing status label (Badge).',
8
+ } satisfies CatalogueEntry;
9
+ </script>
10
+
6
11
  <script lang="ts">
7
12
  interface Props {
8
13
  value?: number;