@motion-proto/live-tokens 0.74.0 → 0.76.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 (171) hide show
  1. package/.claude/skills/live-tokens-check-compliance/SKILL.md +33 -38
  2. package/.claude/skills/live-tokens-create-component/SKILL copy.md +196 -0
  3. package/.claude/skills/live-tokens-create-component/SKILL.md +198 -146
  4. package/.claude/skills/live-tokens-create-component/references/contract-tests.md +95 -52
  5. package/.claude/skills/live-tokens-create-component/references/intrinsics.md +2 -2
  6. package/.claude/skills/live-tokens-create-component/references/linked-siblings.md +2 -2
  7. package/.claude/skills/live-tokens-create-component/references/sketch-mode.md +12 -12
  8. package/.claude/skills/live-tokens-create-component/references/token-naming.md +2 -1
  9. package/.claude/skills/live-tokens-create-page/SKILL.md +187 -0
  10. package/.claude/skills/live-tokens-create-page/references/interaction-sources.md +66 -0
  11. package/.claude/skills/live-tokens-create-page/references/layout-sources.md +87 -0
  12. package/.claude/skills/live-tokens-create-theme/SKILL.md +52 -48
  13. package/.claude/skills/live-tokens-create-theme/references/design-directions.md +1 -1
  14. package/.claude/skills/live-tokens-fix-findings/SKILL.md +69 -60
  15. package/.claude/skills/live-tokens-pick-component/SKILL.md +64 -79
  16. package/.claude/skills/live-tokens-set-colors/SKILL.md +47 -38
  17. package/.claude/skills/live-tokens-set-geometry/SKILL.md +58 -35
  18. package/.claude/skills/live-tokens-set-geometry/references/geometry-anchors.md +5 -3
  19. package/.claude/skills/live-tokens-set-type/SKILL.md +30 -30
  20. package/CHANGELOG.md +138 -0
  21. package/README.md +17 -7
  22. package/bin/check-component.mjs +91 -19
  23. package/bin/check-page.mjs +102 -21
  24. package/bin/cli.mjs +87 -113
  25. package/bin/contractRunner.mjs +945 -0
  26. package/bin/create.mjs +1 -1
  27. package/bin/lib/catalogue.mjs +37 -30
  28. package/bin/lib/findings.mjs +46 -15
  29. package/bin/lib/report.mjs +3 -3
  30. package/bin/lib/tokenVocabulary.mjs +4 -4
  31. package/bin/migrate-routes.mjs +5 -5
  32. package/bin/migrate.mjs +4 -4
  33. package/bin/save-theme.mjs +8 -9
  34. package/bin/set-colors.mjs +9 -11
  35. package/bin/set-geometry.mjs +7 -7
  36. package/bin/set-type.mjs +5 -7
  37. package/bin/setup-claude.mjs +110 -0
  38. package/dist-plugin/{chunk-W6Y4BWFB.js → chunk-6WGFOJXO.js} +22 -0
  39. package/dist-plugin/{chunk-7VRTBGJT.js → chunk-PDNL4NC5.js} +9 -2
  40. package/dist-plugin/{chunk-V3YF6CGT.js → chunk-SWXRVZKT.js} +43 -1
  41. package/dist-plugin/{dataPaths-BhWzd5cL.d.cts → dataPaths-BpIK_Obx.d.cts} +1 -0
  42. package/dist-plugin/{dataPaths-BhWzd5cL.d.ts → dataPaths-BpIK_Obx.d.ts} +1 -0
  43. package/dist-plugin/index.cjs +310 -147
  44. package/dist-plugin/index.d.cts +1 -1
  45. package/dist-plugin/index.d.ts +1 -1
  46. package/dist-plugin/index.js +218 -122
  47. package/dist-plugin/migrateData/index.cjs +66 -2
  48. package/dist-plugin/migrateData/index.d.cts +1 -1
  49. package/dist-plugin/migrateData/index.d.ts +1 -1
  50. package/dist-plugin/migrateData/index.js +3 -3
  51. package/dist-plugin/setColors/index.cjs +61 -4
  52. package/dist-plugin/setColors/index.d.cts +1 -1
  53. package/dist-plugin/setColors/index.d.ts +1 -1
  54. package/dist-plugin/setColors/index.js +5 -5
  55. package/dist-plugin/setGeometry/index.cjs +107 -44
  56. package/dist-plugin/setGeometry/index.d.cts +5 -5
  57. package/dist-plugin/setGeometry/index.d.ts +5 -5
  58. package/dist-plugin/setGeometry/index.js +51 -45
  59. package/dist-plugin/setType/index.cjs +15 -0
  60. package/dist-plugin/setType/index.d.cts +1 -1
  61. package/dist-plugin/setType/index.d.ts +1 -1
  62. package/dist-plugin/setType/index.js +1 -1
  63. package/dist-plugin/tokensCssMigrations/index.d.cts +1 -1
  64. package/dist-plugin/tokensCssMigrations/index.d.ts +1 -1
  65. package/dist-plugin/tokensCssMigrations/index.js +1 -1
  66. package/package.json +35 -8
  67. package/src/app/site.css +19 -9
  68. package/src/editor/bootstrap.ts +2 -0
  69. package/src/editor/component-editor/CollapsibleSectionEditor.svelte +4 -4
  70. package/src/editor/component-editor/DialogEditor.svelte +4 -4
  71. package/src/editor/component-editor/MenuSelectEditor.svelte +4 -1
  72. package/src/editor/component-editor/SegmentedControlEditor.svelte +6 -1
  73. package/src/editor/component-editor/TabBarEditor.svelte +1 -1
  74. package/src/editor/component-editor/TableEditor.svelte +2 -2
  75. package/src/editor/component-editor/scaffolding/TokenLayout.svelte +6 -3
  76. package/src/editor/component-editor/scaffolding/VariantGroup.svelte +41 -20
  77. package/src/editor/core/components/adjustAliases.ts +59 -45
  78. package/src/editor/core/components/aliasKinds.ts +9 -5
  79. package/src/editor/core/preview/themePreview.ts +9 -2
  80. package/src/editor/core/sketch/sketchLayer.ts +22 -0
  81. package/src/editor/core/store/editorStore.ts +10 -1
  82. package/src/editor/core/themes/buildColors.ts +3 -3
  83. package/src/editor/core/themes/liveStateStream.ts +26 -0
  84. package/src/editor/core/themes/migrations/2026-09-07-stroke-role-renames.ts +52 -0
  85. package/src/editor/core/themes/migrations/index.ts +2 -0
  86. package/src/editor/core/themes/themeDocumentSync.ts +22 -11
  87. package/src/editor/core/themes/themeService.ts +9 -2
  88. package/src/editor/pages/ComponentEditorPage.svelte +17 -1
  89. package/src/editor/pages/liveTokensEditorHandle.ts +23 -0
  90. package/src/editor/skill-atlas/SkillAtlas.svelte +75 -573
  91. package/src/editor/skill-atlas/TreeCanvas.svelte +263 -0
  92. package/src/editor/skill-atlas/TreeNodeCard.svelte +136 -53
  93. package/src/editor/skill-atlas/edges.ts +31 -0
  94. package/src/editor/skill-atlas/skillSources.generated.ts +20 -19
  95. package/src/editor/skill-atlas/skillTrees.ts +19 -3840
  96. package/src/editor/skill-atlas/trees/check-compliance.ts +183 -0
  97. package/src/editor/skill-atlas/trees/create-component.ts +275 -0
  98. package/src/editor/skill-atlas/trees/create-page.ts +320 -0
  99. package/src/editor/skill-atlas/trees/create-theme.ts +255 -0
  100. package/src/editor/skill-atlas/trees/fix-findings.ts +469 -0
  101. package/src/editor/skill-atlas/trees/pick-component.ts +300 -0
  102. package/src/editor/skill-atlas/trees/set-colors.ts +148 -0
  103. package/src/editor/skill-atlas/trees/set-geometry.ts +136 -0
  104. package/src/editor/skill-atlas/trees/set-type.ts +142 -0
  105. package/src/editor/skill-atlas/types.ts +3 -4
  106. package/src/editor/skill-atlas/wireLayout.ts +287 -0
  107. package/src/live-tokens/data/themes/autumn.json +15 -15
  108. package/src/live-tokens/data/themes/halloween.json +15 -15
  109. package/src/live-tokens/data/themes/midnight-study.json +15 -15
  110. package/src/live-tokens/data/themes/ocean.json +15 -15
  111. package/src/live-tokens/data/themes/royal-velvet.json +15 -15
  112. package/src/live-tokens/data/themes/sketchy.json +15 -15
  113. package/src/live-tokens/data/themes/spring-meadow.json +15 -15
  114. package/src/live-tokens/data/themes/sunset.json +15 -15
  115. package/src/system/components/Badge.svelte +7 -0
  116. package/src/system/components/Button.svelte +7 -0
  117. package/src/system/components/Callout.svelte +10 -6
  118. package/src/system/components/Card.svelte +23 -4
  119. package/src/system/components/CodeSnippet.svelte +4 -3
  120. package/src/system/components/CollapsibleSection.svelte +23 -8
  121. package/src/system/components/CornerBadge.svelte +6 -0
  122. package/src/system/components/Dialog.svelte +13 -6
  123. package/src/system/components/IconButton.svelte +9 -0
  124. package/src/system/components/Image.svelte +8 -0
  125. package/src/system/components/ImageLightbox.svelte +6 -0
  126. package/src/system/components/InlineEditActions.svelte +7 -0
  127. package/src/system/components/Input.svelte +7 -0
  128. package/src/system/components/MenuSelect.svelte +7 -0
  129. package/src/system/components/Notification.svelte +7 -0
  130. package/src/system/components/Panel.svelte +6 -0
  131. package/src/system/components/ProgressBar.svelte +5 -0
  132. package/src/system/components/RadioButton.svelte +11 -5
  133. package/src/system/components/SectionDivider.svelte +8 -0
  134. package/src/system/components/SegmentedControl.svelte +6 -0
  135. package/src/system/components/SideNavigation.svelte +6 -0
  136. package/src/system/components/Slider.svelte +7 -4
  137. package/src/system/components/TabBar.svelte +15 -9
  138. package/src/system/components/Table.svelte +8 -3
  139. package/src/system/components/Toggle.svelte +4 -4
  140. package/src/system/components/Tooltip.svelte +6 -0
  141. package/src/testing-js/chunk-AO7EZHYV.js +776 -0
  142. package/src/testing-js/chunk-AO7EZHYV.js.map +1 -0
  143. package/src/testing-js/chunk-FAFOAWYL.js +39 -0
  144. package/src/testing-js/chunk-FAFOAWYL.js.map +1 -0
  145. package/src/testing-js/chunk-L73N4NSO.js +23 -0
  146. package/src/testing-js/chunk-L73N4NSO.js.map +1 -0
  147. package/src/testing-js/chunk-LXR3MN6N.js +3063 -0
  148. package/src/testing-js/chunk-LXR3MN6N.js.map +1 -0
  149. package/src/testing-js/chunk-ZMSX6CXR.js +53 -0
  150. package/src/testing-js/chunk-ZMSX6CXR.js.map +1 -0
  151. package/src/testing-js/component-alias.contract.js +81 -0
  152. package/src/testing-js/component-alias.contract.js.map +1 -0
  153. package/src/testing-js/component-editor.contract.js +62 -0
  154. package/src/testing-js/component-editor.contract.js.map +1 -0
  155. package/src/testing-js/component-render.contract.js +568 -0
  156. package/src/testing-js/component-render.contract.js.map +1 -0
  157. package/src/testing-js/index.d.ts +293 -0
  158. package/src/testing-js/index.js +222 -0
  159. package/src/testing-js/index.js.map +1 -0
  160. package/src/testing-js/registry.contract.js +39 -0
  161. package/src/testing-js/registry.contract.js.map +1 -0
  162. package/src/testing-js/vitest-BE6uGF31.d.ts +73 -0
  163. package/src/testing-js/vitest.d.ts +3 -0
  164. package/src/testing-js/vitest.js +13 -0
  165. package/src/testing-js/vitest.js.map +1 -0
  166. package/template/README.md +13 -0
  167. package/template/_gitignore +6 -0
  168. package/template/package.json +3 -1
  169. package/template/src/pages/Home.svelte +4 -18
  170. package/.claude/skills/live-tokens-build-page/SKILL.md +0 -103
  171. package/.claude/skills/live-tokens-build-page/references/layout-sources.md +0 -48
@@ -1,3 +1,9 @@
1
+ <!--
2
+ Callout.svelte. A standing message that sits inside a section.
3
+ Use for: something the reader must know about the content around it.
4
+ Not for: feedback after an action (Notification); a hint that hangs off one
5
+ element (Tooltip).
6
+ -->
1
7
  <script module lang="ts">
2
8
  export const calloutVariants = ['info', 'success', 'warning', 'danger'] as const;
3
9
  export type CalloutVariant = typeof calloutVariants[number];
@@ -29,7 +35,7 @@
29
35
  --callout-info-surface: var(--surface-info-lowest);
30
36
  --callout-info-border: var(--border-info-medium);
31
37
  --callout-info-border-width: var(--border-width-1);
32
- --callout-info-accent-width: var(--border-width-4);
38
+ --callout-info-accent-width: var(--border-width-1);
33
39
  --callout-info-radius: var(--radius-lg);
34
40
  --callout-info-padding: var(--space-12);
35
41
  --callout-info-label: var(--text-primary);
@@ -47,7 +53,7 @@
47
53
  --callout-success-surface: var(--surface-success-lowest);
48
54
  --callout-success-border: var(--border-success-subtle);
49
55
  --callout-success-border-width: var(--border-width-1);
50
- --callout-success-accent-width: var(--border-width-4);
56
+ --callout-success-accent-width: var(--border-width-1);
51
57
  --callout-success-radius: var(--radius-lg);
52
58
  --callout-success-padding: var(--space-12);
53
59
  --callout-success-label: var(--text-primary);
@@ -65,7 +71,7 @@
65
71
  --callout-warning-surface: var(--surface-warning-lowest);
66
72
  --callout-warning-border: var(--border-warning-subtle);
67
73
  --callout-warning-border-width: var(--border-width-1);
68
- --callout-warning-accent-width: var(--border-width-4);
74
+ --callout-warning-accent-width: var(--border-width-1);
69
75
  --callout-warning-radius: var(--radius-lg);
70
76
  --callout-warning-padding: var(--space-12);
71
77
  --callout-warning-label: var(--text-primary);
@@ -83,7 +89,7 @@
83
89
  --callout-danger-surface: var(--surface-danger-lowest);
84
90
  --callout-danger-border: var(--border-danger-subtle);
85
91
  --callout-danger-border-width: var(--border-width-1);
86
- --callout-danger-accent-width: var(--border-width-4);
92
+ --callout-danger-accent-width: var(--border-width-1);
87
93
  --callout-danger-radius: var(--radius-lg);
88
94
  --callout-danger-padding: var(--space-12);
89
95
  --callout-danger-label: var(--text-primary);
@@ -99,8 +105,6 @@
99
105
  }
100
106
 
101
107
  .callout {
102
- margin: var(--space-24) 0;
103
-
104
108
  :global(p) {
105
109
  margin: 0;
106
110
  display: inline;
@@ -1,3 +1,10 @@
1
+ <!--
2
+ Card.svelte. One item with a title.
3
+ Use for: an item on its own, or each item in a set: a product, a record, a
4
+ plan the reader may act on.
5
+ Not for: a section of the page's content (Panel); content the reader opens
6
+ on demand (CollapsibleSection); a decision that blocks the page (Dialog).
7
+ -->
1
8
  <script lang="ts">
2
9
  interface Props {
3
10
  icon?: string;
@@ -16,6 +23,8 @@
16
23
  default; `true`/`false` force this instance on/off. */
17
24
  hover?: boolean | undefined;
18
25
  class?: string;
26
+ /** Content at the header's trailing edge: a badge, a count, an action. */
27
+ aside?: import('svelte').Snippet;
19
28
  children?: import('svelte').Snippet;
20
29
  }
21
30
 
@@ -29,6 +38,7 @@
29
38
  flush = false,
30
39
  hover = undefined,
31
40
  class: className = '',
41
+ aside,
32
42
  children
33
43
  }: Props = $props();
34
44
 
@@ -40,7 +50,7 @@
40
50
  hover === undefined ? undefined : hover ? 'var(--card-hover-shadow)' : 'var(--card-default-shadow)',
41
51
  );
42
52
 
43
- let showHeader = $derived(variant !== 'bare' && Boolean(icon || title));
53
+ let showHeader = $derived(variant !== 'bare' && Boolean(icon || title || aside));
44
54
 
45
55
  $effect(() => {
46
56
  if (import.meta.env.DEV && variant === 'default' && !icon && !title) {
@@ -65,6 +75,9 @@
65
75
  {#if title}
66
76
  <span class="card-title">{title}</span>
67
77
  {/if}
78
+ {#if aside}
79
+ <div class="card-aside">{@render aside()}</div>
80
+ {/if}
68
81
  </div>
69
82
  {/if}
70
83
  <div class="card-body" class:prose class:flush>
@@ -142,10 +155,11 @@
142
155
  box-shadow: var(--card-hover-shadow-enabled);
143
156
  }
144
157
 
145
- /* Editor preview hook: paint hover tokens directly, ignoring the on/off gate. */
158
+ /* Editor preview hook. Reads the same gated tokens as the real :hover rule,
159
+ so turning "Use hover" off shows the resting card the page will draw. */
146
160
  .card.force-hover {
147
- border-color: var(--card-hover-border);
148
- box-shadow: var(--card-hover-shadow);
161
+ border-color: var(--card-hover-border-enabled);
162
+ box-shadow: var(--card-hover-shadow-enabled);
149
163
  }
150
164
 
151
165
  .card-header {
@@ -156,6 +170,11 @@
156
170
  background: var(--card-default-header-surface);
157
171
  }
158
172
 
173
+ .card-aside {
174
+ flex-shrink: 0;
175
+ margin-left: auto;
176
+ }
177
+
159
178
  .card.compact .card-header,
160
179
  .card.compact .card-body {
161
180
  padding: var(--space-8) var(--space-12);
@@ -1,7 +1,8 @@
1
1
  <!--
2
- CodeSnippet.svelte — code display with a copy button pinned top-right. Click
3
- the button to copy `code` to the clipboard; a Tooltip-rendered confirmation
4
- ("Copied") flashes briefly above the button.
2
+ CodeSnippet.svelte. A command or value with a copy button.
3
+ Use for: text the reader is meant to run or paste somewhere else.
4
+ Not for: prose the reader only reads (a paragraph in its Card or Panel); a
5
+ value the reader edits (Input).
5
6
  -->
6
7
  <script lang="ts">
7
8
  import Tooltip from './Tooltip.svelte';
@@ -1,3 +1,11 @@
1
+ <!--
2
+ CollapsibleSection.svelte. A section the reader opens and closes.
3
+ Use for: secondary content that most readers skip.
4
+ Not for: content every reader needs (Card); moving between pages
5
+ (SideNavigation).
6
+ Variant: `chromeless` sits inside other content, `divider` rules a line
7
+ under the header, `container` frames the whole section.
8
+ -->
1
9
  <script lang="ts">
2
10
  import { createEventDispatcher } from 'svelte';
3
11
 
@@ -60,10 +68,17 @@
60
68
  {@render summary?.()}
61
69
  </div>
62
70
  {:else}
63
- <!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_noninteractive_element_interactions, a11y_no_static_element_interactions -->
64
- <div class="section-header" class:expanded onclick={fireToggle}>
71
+ <div class="section-header" class:expanded>
65
72
  <div class="section-toggle">
66
- <i class="fas fa-chevron-right toggle-icon"></i>
73
+ <button
74
+ type="button"
75
+ class="section-toggle-button"
76
+ onclick={fireToggle}
77
+ aria-label={expanded ? 'Collapse section' : 'Expand section'}
78
+ aria-expanded={expanded}
79
+ >
80
+ <i class="fas fa-chevron-right toggle-icon"></i>
81
+ </button>
67
82
  <span class="section-label">{label}</span>
68
83
  </div>
69
84
  {@render summary?.()}
@@ -106,8 +121,8 @@
106
121
 
107
122
  /* Divider — default */
108
123
  --collapsiblesection-divider-default-surface: var(--color-transparent);
109
- --collapsiblesection-divider-default-border: var(--border-brand);
110
- --collapsiblesection-divider-default-border-width: var(--border-width-1);
124
+ --collapsiblesection-divider-default-hairline-color: var(--border-brand);
125
+ --collapsiblesection-divider-default-hairline-thickness: var(--border-width-1);
111
126
  --collapsiblesection-divider-default-padding: var(--space-4);
112
127
  --collapsiblesection-divider-default-label: var(--text-primary);
113
128
  --collapsiblesection-divider-default-label-font-family: var(--font-sans);
@@ -118,8 +133,8 @@
118
133
  --collapsiblesection-divider-default-icon-size: var(--icon-size-xs);
119
134
  /* Divider — hover */
120
135
  --collapsiblesection-divider-hover-surface: var(--color-transparent);
121
- --collapsiblesection-divider-hover-border: var(--border-neutral);
122
- --collapsiblesection-divider-hover-border-width: var(--border-width-1);
136
+ --collapsiblesection-divider-hover-hairline-color: var(--border-neutral);
137
+ --collapsiblesection-divider-hover-hairline-thickness: var(--border-width-1);
123
138
  --collapsiblesection-divider-hover-padding: var(--space-4);
124
139
  --collapsiblesection-divider-hover-label: var(--text-primary);
125
140
  --collapsiblesection-divider-hover-label-font-family: var(--font-sans);
@@ -237,7 +252,7 @@
237
252
  }
238
253
 
239
254
  @mixin divider-bottom($state) {
240
- border-bottom: var(--collapsiblesection-divider-#{$state}-border-width) solid var(--collapsiblesection-divider-#{$state}-border);
255
+ border-bottom: var(--collapsiblesection-divider-#{$state}-hairline-thickness) solid var(--collapsiblesection-divider-#{$state}-hairline-color);
241
256
  }
242
257
 
243
258
  .es-root.variant-chromeless {
@@ -1,3 +1,9 @@
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
+ -->
1
7
  <script module lang="ts">
2
8
  export type CornerAnchor = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
3
9
  </script>
@@ -1,3 +1,10 @@
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
8
  <script lang="ts">
2
9
  import { createEventDispatcher, tick } from 'svelte';
3
10
  import type { Snippet } from 'svelte';
@@ -179,8 +186,8 @@
179
186
 
180
187
  /* Header */
181
188
  --dialog-header-surface: var(--surface-neutral-lower);
182
- --dialog-header-border: var(--border-neutral-subtle);
183
- --dialog-header-border-width: var(--border-width-1);
189
+ --dialog-header-divider: var(--border-neutral-subtle);
190
+ --dialog-header-divider-width: var(--border-width-1);
184
191
  --dialog-header-padding: var(--space-8);
185
192
 
186
193
  /* Title */
@@ -203,8 +210,8 @@
203
210
  --dialog-body-line-height: var(--line-height-normal);
204
211
 
205
212
  /* Footer */
206
- --dialog-footer-border: var(--border-neutral-subtle);
207
- --dialog-footer-border-width: var(--border-width-1);
213
+ --dialog-footer-divider: var(--border-neutral-subtle);
214
+ --dialog-footer-divider-width: var(--border-width-1);
208
215
  --dialog-footer-padding: var(--space-16);
209
216
  }
210
217
 
@@ -264,7 +271,7 @@
264
271
  var(--dialog-header-padding-right, calc(var(--dialog-header-padding) * 3))
265
272
  var(--dialog-header-padding-bottom, var(--dialog-header-padding))
266
273
  var(--dialog-header-padding-left, calc(var(--dialog-header-padding) * 3));
267
- border-bottom: var(--dialog-header-border-width) solid var(--dialog-header-border);
274
+ border-bottom: var(--dialog-header-divider-width) solid var(--dialog-header-divider);
268
275
  background: var(--dialog-header-surface);
269
276
  display: flex;
270
277
  justify-content: space-between;
@@ -320,7 +327,7 @@
320
327
  var(--dialog-footer-padding-right, var(--dialog-footer-padding))
321
328
  var(--dialog-footer-padding-bottom, var(--dialog-footer-padding))
322
329
  var(--dialog-footer-padding-left, var(--dialog-footer-padding));
323
- border-top: var(--dialog-footer-border-width) solid var(--dialog-footer-border);
330
+ border-top: var(--dialog-footer-divider-width) solid var(--dialog-footer-divider);
324
331
  display: flex;
325
332
  justify-content: space-between;
326
333
  align-items: center;
@@ -1,3 +1,12 @@
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
10
  <script lang="ts">
2
11
  interface Props {
3
12
  /** Wash the hovered surface with the theme's tint. `undefined` inherits the
@@ -1,3 +1,11 @@
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
9
  <script lang="ts">
2
10
  interface Props {
3
11
  src: string;
@@ -1,3 +1,9 @@
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
7
  <script lang="ts">
2
8
  import { onMount, tick } from 'svelte';
3
9
  import { portal } from '../internal/portal';
@@ -1,3 +1,10 @@
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
8
  <script lang="ts">
2
9
 
3
10
 
@@ -1,3 +1,10 @@
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
8
  <script lang="ts">
2
9
  import { createEventDispatcher } from 'svelte';
3
10
 
@@ -1,3 +1,10 @@
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
8
  <script lang="ts">
2
9
  import { createEventDispatcher } from 'svelte';
3
10
 
@@ -1,3 +1,10 @@
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
8
  <script lang="ts">
2
9
  import { createEventDispatcher } from 'svelte';
3
10
  import Button from './Button.svelte';
@@ -1,3 +1,9 @@
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
7
  <script lang="ts">
2
8
  import type { Snippet } from 'svelte';
3
9
 
@@ -1,3 +1,8 @@
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
6
  <script lang="ts">
2
7
  interface Props {
3
8
  value?: number;
@@ -1,3 +1,10 @@
1
+ <!--
2
+ RadioButton.svelte. A form row that selects one option.
3
+ Use for: a choice the reader reviews as text before committing to a larger
4
+ form.
5
+ Not for: an inline switch between views (SegmentedControl); a setting that
6
+ takes effect at once (Toggle).
7
+ -->
1
8
  <script lang="ts">
2
9
  import { createEventDispatcher } from 'svelte';
3
10
 
@@ -33,7 +40,7 @@
33
40
  style={color ? `--radiobutton-color: ${color};` : ''}
34
41
  onclick={fireClick}
35
42
  >
36
- <span class="radio-dot"></span>
43
+ <span class="radio-dot"><span class="radio-dot-fill"></span></span>
37
44
  <span class="radio-label">{label}</span>
38
45
  </button>
39
46
 
@@ -103,7 +110,7 @@
103
110
  .radio-dot {
104
111
  border: var(--radiobutton-hover-dot-border-width) solid var(--radiobutton-color, var(--radiobutton-hover-dot-border-color));
105
112
 
106
- &::after {
113
+ .radio-dot-fill {
107
114
  width: var(--radiobutton-hover-dot-size);
108
115
  height: var(--radiobutton-hover-dot-size);
109
116
  background: var(--radiobutton-color, var(--radiobutton-hover-dot-fill));
@@ -130,7 +137,7 @@
130
137
  .radio-dot {
131
138
  border: var(--radiobutton-active-dot-border-width) solid var(--radiobutton-color, var(--radiobutton-active-dot-border-color));
132
139
 
133
- &::after {
140
+ .radio-dot-fill {
134
141
  width: var(--radiobutton-active-dot-size);
135
142
  height: var(--radiobutton-active-dot-size);
136
143
  background: var(--radiobutton-color, var(--radiobutton-active-dot-fill));
@@ -149,8 +156,7 @@
149
156
  flex-shrink: 0;
150
157
  transition: all var(--duration-200);
151
158
 
152
- &::after {
153
- content: '';
159
+ .radio-dot-fill {
154
160
  position: absolute;
155
161
  top: 50%;
156
162
  left: 50%;
@@ -1,3 +1,11 @@
1
+ <!--
2
+ SectionDivider.svelte. A titled break between the sections of a page.
3
+ Use for: naming the band that follows it.
4
+ Not for: moving between pages (SideNavigation); a title inside a container
5
+ (Card).
6
+ Level: `md` titles a page and `sm` titles a section; `eyebrow` is an opt-in
7
+ label above the title.
8
+ -->
1
9
  <script lang="ts">
2
10
  /** Size variant. Each variant owns everything that defines its style:
3
11
  * typography, geometry, colors AND the intrinsic display properties
@@ -1,3 +1,9 @@
1
+ <!--
2
+ SegmentedControl.svelte. An inline switch between named alternatives.
3
+ Use for: two to four short labels that pick one view of the same data.
4
+ Not for: swapping the page's content area (TabBar); labels long enough to
5
+ wrap (RadioButton).
6
+ -->
1
7
  <script lang="ts">
2
8
  import { createEventDispatcher } from 'svelte';
3
9
 
@@ -1,3 +1,9 @@
1
+ <!--
2
+ SideNavigation.svelte. The rail that moves between the pages of a site.
3
+ Use for: navigation that follows the current path.
4
+ Not for: switching panels inside one page (TabBar); a menu of actions
5
+ (MenuSelect).
6
+ -->
1
7
  <script lang="ts">
2
8
  import { createEventDispatcher } from 'svelte';
3
9
  import CollapsibleSection from './CollapsibleSection.svelte';
@@ -1,8 +1,9 @@
1
1
  <!--
2
- Slider.svelte — a number chosen by position on a track. `single` moves one
3
- thumb to a value; `range` moves two thumbs to a low and a high bound. Both
4
- variants share the track, fill, and thumb tokens, linked in the editor so an
5
- edit to one moves the other unless deliberately unlinked.
2
+ Slider.svelte. A number the reader picks by position on a track.
3
+ Use for: a volume, a price band, or a percentage, where the position carries
4
+ the meaning.
5
+ Not for: an exact number the reader would rather type (Input); an on/off
6
+ setting (Toggle).
6
7
  -->
7
8
  <script module lang="ts">
8
9
  export const sliderVariants = ['single', 'range'] as const;
@@ -118,6 +119,8 @@
118
119
 
119
120
  <style>
120
121
  :global(:root) {
122
+ /* SliderEditor declares the two variant sets linkable, so an editor change
123
+ to one moves the other until the designer unlinks it. */
121
124
  /* Single: one thumb. */
122
125
  --slider-single-track-surface: var(--surface-neutral-lowest);
123
126
  --slider-single-track-border: var(--border-neutral-subtle);
@@ -1,3 +1,9 @@
1
+ <!--
2
+ TabBar.svelte. Tabs that swap the content below them.
3
+ Use for: two to seven panels the reader moves between inside one page.
4
+ Not for: one switch among others in a row (SegmentedControl); navigation
5
+ that changes the URL (SideNavigation).
6
+ -->
1
7
  <script lang="ts">
2
8
  import { createEventDispatcher } from 'svelte';
3
9
 
@@ -100,7 +106,7 @@
100
106
  --tabbar-default-tab-border-width: var(--border-width-0);
101
107
  --tabbar-default-tab-top-radius: var(--radius-none);
102
108
  --tabbar-default-tab-bottom-radius: var(--radius-none);
103
- --tabbar-default-indicator-border-width: var(--border-width-2);
109
+ --tabbar-default-indicator-width: var(--border-width-2);
104
110
 
105
111
  /* Hover tab */
106
112
  --tabbar-hover-text: var(--text-secondary);
@@ -116,7 +122,7 @@
116
122
  --tabbar-hover-tab-border-width: var(--border-width-0);
117
123
  --tabbar-hover-tab-top-radius: var(--radius-none);
118
124
  --tabbar-hover-tab-bottom-radius: var(--radius-none);
119
- --tabbar-hover-indicator-border-width: var(--border-width-2);
125
+ --tabbar-hover-indicator-width: var(--border-width-2);
120
126
 
121
127
  /* Active tab */
122
128
  --tabbar-active-text: var(--text-primary);
@@ -132,7 +138,7 @@
132
138
  --tabbar-active-tab-border-width: var(--border-width-0);
133
139
  --tabbar-active-tab-top-radius: var(--radius-none);
134
140
  --tabbar-active-tab-bottom-radius: var(--radius-none);
135
- --tabbar-active-indicator-border-width: var(--border-width-2);
141
+ --tabbar-active-indicator-width: var(--border-width-2);
136
142
 
137
143
  /* Disabled tab */
138
144
  --tabbar-disabled-text: var(--text-disabled);
@@ -148,7 +154,7 @@
148
154
  --tabbar-disabled-tab-border-width: var(--border-width-0);
149
155
  --tabbar-disabled-tab-top-radius: var(--radius-none);
150
156
  --tabbar-disabled-tab-bottom-radius: var(--radius-none);
151
- --tabbar-disabled-indicator-border-width: var(--border-width-2);
157
+ --tabbar-disabled-indicator-width: var(--border-width-2);
152
158
  }
153
159
 
154
160
  .tab-bar {
@@ -177,7 +183,7 @@
177
183
  --_icon-size: var(--tabbar-default-icon-size);
178
184
  --_surface: var(--tabbar-default-surface);
179
185
  --_indicator-color: var(--tabbar-default-border);
180
- --_indicator-width: var(--tabbar-default-indicator-border-width);
186
+ --_indicator-width: var(--tabbar-default-indicator-width);
181
187
  --_padding: var(--tabbar-default-padding);
182
188
  --_border-color: var(--tabbar-default-tab-border-color);
183
189
  --_border-width: var(--tabbar-default-tab-border-width);
@@ -191,7 +197,7 @@
191
197
  background: var(--_surface);
192
198
  border: var(--_border-width) solid var(--_border-color);
193
199
  /* Indicator accent owns the bottom edge. Both width and color rebind
194
- per state — `--tabbar-{state}-indicator-border-width` and
200
+ per state — `--tabbar-{state}-indicator-width` and
195
201
  `--tabbar-{state}-border` (the indicator color slot). */
196
202
  border-bottom: var(--_indicator-width) solid var(--_indicator-color);
197
203
  border-radius: var(--_top-radius) var(--_top-radius) var(--_bottom-radius) var(--_bottom-radius);
@@ -223,7 +229,7 @@
223
229
  --_icon-size: var(--tabbar-hover-icon-size);
224
230
  --_surface: var(--tabbar-hover-surface);
225
231
  --_indicator-color: var(--tabbar-hover-border);
226
- --_indicator-width: var(--tabbar-hover-indicator-border-width);
232
+ --_indicator-width: var(--tabbar-hover-indicator-width);
227
233
  --_padding: var(--tabbar-hover-padding);
228
234
  --_border-color: var(--tabbar-hover-tab-border-color);
229
235
  --_border-width: var(--tabbar-hover-tab-border-width);
@@ -240,7 +246,7 @@
240
246
  --_icon-size: var(--tabbar-active-icon-size);
241
247
  --_surface: var(--tabbar-active-surface);
242
248
  --_indicator-color: var(--tabbar-active-border);
243
- --_indicator-width: var(--tabbar-active-indicator-border-width);
249
+ --_indicator-width: var(--tabbar-active-indicator-width);
244
250
  --_padding: var(--tabbar-active-padding);
245
251
  --_border-color: var(--tabbar-active-tab-border-color);
246
252
  --_border-width: var(--tabbar-active-tab-border-width);
@@ -257,7 +263,7 @@
257
263
  --_icon-size: var(--tabbar-disabled-icon-size);
258
264
  --_surface: var(--tabbar-disabled-surface);
259
265
  --_indicator-color: var(--tabbar-disabled-border);
260
- --_indicator-width: var(--tabbar-disabled-indicator-border-width);
266
+ --_indicator-width: var(--tabbar-disabled-indicator-width);
261
267
  --_padding: var(--tabbar-disabled-padding);
262
268
  --_border-color: var(--tabbar-disabled-tab-border-color);
263
269
  --_border-width: var(--tabbar-disabled-tab-border-width);
@@ -1,3 +1,8 @@
1
+ <!--
2
+ Table.svelte. A themed frame around the rows and cells the page writes.
3
+ Use for: records the reader scans and compares.
4
+ Not for: a set of things the reader acts on (Card).
5
+ -->
1
6
  <script lang="ts">
2
7
  interface Props {
3
8
  children?: import('svelte').Snippet;
@@ -29,8 +34,8 @@
29
34
  --table-default-header-font-weight: var(--font-weight-semibold);
30
35
  --table-default-header-line-height: var(--line-height-none);
31
36
  --table-default-header-padding: var(--space-12);
32
- --table-default-header-border: var(--border-neutral);
33
- --table-default-header-border-width: var(--border-width-1);
37
+ --table-default-header-divider: var(--border-neutral);
38
+ --table-default-header-divider-width: var(--border-width-1);
34
39
 
35
40
  /* Cell */
36
41
  --table-default-cell-text: var(--text-secondary);
@@ -77,7 +82,7 @@
77
82
  line-height: var(--table-default-header-line-height);
78
83
  @include themed-padding(--table-default-header-padding);
79
84
  text-align: left;
80
- border-bottom: var(--table-default-header-border-width) solid var(--table-default-header-border);
85
+ border-bottom: var(--table-default-header-divider-width) solid var(--table-default-header-divider);
81
86
  border-right: var(--table-default-column-divider-width) solid var(--table-default-column-divider);
82
87
  white-space: nowrap;
83
88
  }
@@ -1,8 +1,8 @@
1
1
  <!--
2
- Toggle.svelte — Cloudscape-style on/off switch. The default state is "off",
3
- whose tokens carry the baseline appearance plus all geometry and label
4
- typography. "On" is a state that recolors track + thumb when the toggle is
5
- checked; hover and disabled layer over the active component state.
2
+ Toggle.svelte. An on/off switch that names the setting it controls.
3
+ Use for: a setting that takes effect the moment it flips.
4
+ Not for: a choice between two named alternatives (SegmentedControl); a
5
+ yes/no answer inside a form (RadioButton).
6
6
  -->
7
7
  <script lang="ts">
8
8
  interface Props {
@@ -1,3 +1,9 @@
1
+ <!--
2
+ Tooltip.svelte. A hint that appears on an element on hover or focus.
3
+ Use for: a definition or a shortcut the reader can do without.
4
+ Not for: content the reader must not miss (Callout); feedback after an
5
+ action (Notification).
6
+ -->
1
7
  <script lang="ts">
2
8
  interface Props {
3
9
  text?: string;