@motion-proto/live-tokens 0.1.0 → 0.3.1

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 (225) hide show
  1. package/README.md +160 -21
  2. package/dist-plugin/index.cjs +823 -336
  3. package/dist-plugin/index.d.cts +9 -7
  4. package/dist-plugin/index.d.ts +9 -7
  5. package/dist-plugin/index.js +822 -335
  6. package/package.json +51 -23
  7. package/src/assets/newspaper.webp +0 -0
  8. package/src/assets/offering.webp +0 -0
  9. package/src/component-editor/BadgeEditor.svelte +170 -0
  10. package/src/component-editor/CalloutEditor.svelte +103 -0
  11. package/src/component-editor/CardEditor.svelte +184 -0
  12. package/src/component-editor/CollapsibleSectionEditor.svelte +167 -0
  13. package/src/component-editor/CornerBadgeEditor.svelte +207 -0
  14. package/src/component-editor/DialogEditor.svelte +172 -0
  15. package/src/component-editor/ImageEditor.svelte +72 -0
  16. package/src/component-editor/InlineEditActionsEditor.svelte +83 -0
  17. package/src/component-editor/NotificationEditor.svelte +160 -0
  18. package/src/component-editor/ProgressBarEditor.svelte +124 -0
  19. package/src/component-editor/RadioButtonEditor.svelte +140 -0
  20. package/src/component-editor/SectionDividerEditor.svelte +263 -0
  21. package/src/component-editor/SegmentedControlEditor.svelte +154 -0
  22. package/src/component-editor/StandardButtonsEditor.svelte +178 -0
  23. package/src/component-editor/TabBarEditor.svelte +137 -0
  24. package/src/component-editor/TableEditor.svelte +128 -0
  25. package/src/component-editor/TooltipEditor.svelte +122 -0
  26. package/src/component-editor/editorTokens.test.ts +93 -0
  27. package/src/component-editor/groupKeySlots.test.ts +67 -0
  28. package/src/component-editor/groupKeySnapshot.test.ts +52 -0
  29. package/src/component-editor/index.ts +5 -0
  30. package/src/component-editor/registry.ts +246 -0
  31. package/src/component-editor/scaffolding/AngleDial.svelte +185 -0
  32. package/src/component-editor/scaffolding/ComponentEditorBase.svelte +96 -0
  33. package/src/component-editor/scaffolding/ComponentFileManager.svelte +682 -0
  34. package/src/component-editor/scaffolding/ComponentFileMenu.svelte +312 -0
  35. package/src/component-editor/scaffolding/ComponentsTab.svelte +69 -0
  36. package/src/component-editor/scaffolding/CopyFromMenu.svelte +246 -0
  37. package/src/component-editor/scaffolding/DemoHeader.svelte +21 -0
  38. package/src/component-editor/scaffolding/DividerEditor.svelte +81 -0
  39. package/src/component-editor/scaffolding/FieldsetWrapper.svelte +46 -0
  40. package/src/component-editor/scaffolding/GradientCard.svelte +291 -0
  41. package/src/component-editor/scaffolding/LinkageChart.svelte +297 -0
  42. package/src/component-editor/scaffolding/LinkedBlock.svelte +418 -0
  43. package/src/component-editor/scaffolding/NonStylableConfig.svelte +57 -0
  44. package/src/component-editor/scaffolding/SaveAsDialog.svelte +177 -0
  45. package/src/component-editor/scaffolding/ShadowBackdrop.svelte +25 -0
  46. package/src/component-editor/scaffolding/ShadowBackdropControls.svelte +56 -0
  47. package/src/component-editor/scaffolding/StateBlock.svelte +115 -0
  48. package/src/component-editor/scaffolding/TokenLayout.svelte +511 -0
  49. package/src/component-editor/scaffolding/TypeEditor.svelte +82 -0
  50. package/src/component-editor/scaffolding/VariantGroup.svelte +277 -0
  51. package/src/component-editor/scaffolding/buildTypeGroupTokens.ts +97 -0
  52. package/src/component-editor/scaffolding/componentSectionType.ts +8 -0
  53. package/src/component-editor/scaffolding/componentSources.ts +9 -0
  54. package/src/component-editor/scaffolding/defaultSections.ts +16 -0
  55. package/src/component-editor/scaffolding/editorContext.ts +44 -0
  56. package/src/component-editor/scaffolding/linkedBlock.ts +226 -0
  57. package/src/component-editor/scaffolding/siblings.ts +33 -0
  58. package/src/component-editor/scaffolding/types.ts +39 -0
  59. package/src/components/Badge.svelte +231 -42
  60. package/src/components/Button.svelte +324 -124
  61. package/src/components/Callout.svelte +145 -0
  62. package/src/components/Card.svelte +123 -25
  63. package/src/components/CollapsibleSection.svelte +213 -35
  64. package/src/components/CornerBadge.svelte +224 -0
  65. package/src/components/Dialog.svelte +137 -114
  66. package/src/components/Image.svelte +43 -0
  67. package/src/components/InlineEditActions.svelte +74 -14
  68. package/src/components/Notification.svelte +184 -163
  69. package/src/components/ProgressBar.svelte +216 -22
  70. package/src/components/RadioButton.svelte +110 -40
  71. package/src/components/SectionDivider.svelte +428 -74
  72. package/src/components/SegmentedControl.svelte +203 -0
  73. package/src/components/TabBar.svelte +146 -21
  74. package/src/components/Table.svelte +102 -0
  75. package/src/components/Tooltip.svelte +45 -19
  76. package/src/components/types.ts +51 -0
  77. package/src/data/google-fonts.json +75 -0
  78. package/src/lib/ColumnsOverlay.svelte +20 -7
  79. package/src/lib/LiveEditorOverlay.svelte +265 -82
  80. package/src/lib/columnsOverlay.ts +21 -17
  81. package/src/lib/componentConfig.test.ts +204 -0
  82. package/src/lib/componentConfigKeys.ts +19 -0
  83. package/src/lib/componentConfigService.ts +88 -0
  84. package/src/lib/copyPopover.ts +30 -0
  85. package/src/lib/cssVarSync.ts +59 -7
  86. package/src/lib/editorConfigStore.ts +0 -10
  87. package/src/lib/editorCore.ts +402 -0
  88. package/src/lib/editorKeybindings.ts +52 -0
  89. package/src/lib/editorPersistence.ts +106 -0
  90. package/src/lib/editorRenderer.ts +74 -0
  91. package/src/lib/editorStore.test.ts +328 -0
  92. package/src/lib/editorStore.ts +412 -0
  93. package/src/lib/editorTypes.ts +100 -0
  94. package/src/lib/editorViewStore.ts +55 -0
  95. package/src/lib/files/versionedFileResource.ts +140 -0
  96. package/src/lib/fontLoader.ts +130 -0
  97. package/src/lib/fontMigration.ts +140 -0
  98. package/src/lib/fontParse.ts +168 -0
  99. package/src/lib/index.ts +48 -31
  100. package/src/lib/lazyConfig.test.ts +54 -0
  101. package/src/lib/migrations/2026-04-24-component-prefix-and-suffix-renames.ts +64 -0
  102. package/src/lib/migrations/2026-04-24-legacy-keys-and-bg-to-canvas.ts +71 -0
  103. package/src/lib/migrations/2026-04-27-segmentedcontrol-disabled-flatten.ts +43 -0
  104. package/src/lib/migrations/2026-05-08-collapsiblesection-frame-and-cleanup.ts +68 -0
  105. package/src/lib/migrations/2026-05-08-collapsiblesection-variant-namespace.ts +35 -0
  106. package/src/lib/migrations/2026-05-10-sectiondivider-gradient-stops.ts +50 -0
  107. package/src/lib/migrations/2026-05-13-primary-to-brand.ts +90 -0
  108. package/src/lib/migrations/index.ts +93 -0
  109. package/src/lib/migrations/migrations.test.ts +341 -0
  110. package/src/lib/navLinkTypes.ts +1 -0
  111. package/src/lib/overlayState.ts +3 -0
  112. package/src/lib/paletteDerivation.ts +300 -0
  113. package/src/lib/parentRouteStore.ts +42 -0
  114. package/src/lib/parsers/globalRootBlock.ts +32 -0
  115. package/src/lib/presetService.ts +94 -0
  116. package/src/lib/router.ts +49 -0
  117. package/src/lib/scrollSection.ts +45 -0
  118. package/src/lib/slices/columns.ts +59 -0
  119. package/src/lib/slices/components.ts +362 -0
  120. package/src/lib/slices/domainVars.ts +15 -0
  121. package/src/lib/slices/fonts.ts +30 -0
  122. package/src/lib/slices/gradients.ts +153 -0
  123. package/src/lib/slices/overlays.ts +132 -0
  124. package/src/lib/slices/palettes.ts +26 -0
  125. package/src/lib/slices/shadows.ts +123 -0
  126. package/src/lib/storage.ts +88 -0
  127. package/src/lib/themeInit.ts +74 -0
  128. package/src/lib/themeService.ts +101 -0
  129. package/src/lib/themeTypes.ts +146 -0
  130. package/src/lib/tokenRegistry.ts +148 -0
  131. package/src/pages/ComponentEditorPage.svelte +384 -0
  132. package/src/pages/ComponentEditorPage.svelte.d.ts +2 -0
  133. package/src/pages/Editor.svelte +98 -0
  134. package/src/pages/Editor.svelte.d.ts +2 -0
  135. package/src/pages/EditorShell.svelte +348 -0
  136. package/src/styles/_padding.scss +34 -0
  137. package/src/styles/fonts/Fraunces/Fraunces-italic-latin-ext.woff2 +0 -0
  138. package/src/styles/fonts/Fraunces/Fraunces-italic-latin.woff2 +0 -0
  139. package/src/styles/fonts/Fraunces/Fraunces-roman-latin-ext.woff2 +0 -0
  140. package/src/styles/fonts/Fraunces/Fraunces-roman-latin.woff2 +0 -0
  141. package/src/styles/fonts/Manrope/Manrope-latin-ext.woff2 +0 -0
  142. package/src/styles/fonts/Manrope/Manrope-latin.woff2 +0 -0
  143. package/src/styles/fonts.css +22 -10
  144. package/src/styles/form-controls.css +14 -16
  145. package/src/styles/tokens.css +1322 -0
  146. package/src/styles/ui-editor.css +126 -0
  147. package/src/{showcase → ui}/BezierCurveEditor.svelte +14 -14
  148. package/src/{showcase → ui}/ColorEditPanel.svelte +42 -36
  149. package/src/ui/EditorViewSwitcher.svelte +180 -0
  150. package/src/ui/FontStackEditor.svelte +360 -0
  151. package/src/ui/GradientEditor.svelte +461 -0
  152. package/src/ui/GradientStopPicker.svelte +74 -0
  153. package/src/ui/PaletteEditor.svelte +1590 -0
  154. package/src/ui/PaletteEditor.test.ts +108 -0
  155. package/src/ui/PresetFileManager.svelte +567 -0
  156. package/src/ui/ProjectFontsSection.svelte +645 -0
  157. package/src/{showcase → ui}/SurfacesTab.svelte +39 -41
  158. package/src/{showcase → ui}/TextTab.svelte +27 -29
  159. package/src/{showcase/TokenFileManager.svelte → ui/ThemeFileManager.svelte} +196 -112
  160. package/src/ui/Toggle.svelte +108 -0
  161. package/src/ui/UICopyPopover.svelte +78 -0
  162. package/src/{showcase/EditorDialog.svelte → ui/UIDialog.svelte} +66 -25
  163. package/src/ui/UIFontFamilySelector.svelte +309 -0
  164. package/src/ui/UIFontSizeSelector.svelte +165 -0
  165. package/src/ui/UIFontWeightSelector.svelte +52 -0
  166. package/src/ui/UILineHeightSelector.svelte +47 -0
  167. package/src/ui/UILinkToggle.svelte +60 -0
  168. package/src/ui/UIOptionItem.svelte +74 -0
  169. package/src/ui/UIOptionList.svelte +27 -0
  170. package/src/ui/UIPaddingSelector.svelte +661 -0
  171. package/src/ui/UIPaletteSelector.svelte +1084 -0
  172. package/src/ui/UIRadio.svelte +72 -0
  173. package/src/ui/UIRadioGroup.svelte +59 -0
  174. package/src/ui/UIRelinkConfirmPopover.svelte +235 -0
  175. package/src/ui/UITokenSelector.svelte +509 -0
  176. package/src/ui/UIVariantSelector.svelte +145 -0
  177. package/src/ui/VariablesTab.svelte +252 -0
  178. package/src/ui/index.ts +31 -0
  179. package/src/ui/keepInViewport.ts +84 -0
  180. package/src/ui/palette/GradientStopEditor.svelte +482 -0
  181. package/src/ui/palette/OverridesPanel.svelte +526 -0
  182. package/src/ui/palette/PaletteBase.svelte +165 -0
  183. package/src/ui/palette/ScaleCurveEditor.svelte +38 -0
  184. package/src/ui/palette/paletteEditorState.ts +89 -0
  185. package/src/ui/sections/ColumnsSection.svelte +273 -0
  186. package/src/ui/sections/GradientsSection.svelte +147 -0
  187. package/src/ui/sections/OverlaysSection.svelte +670 -0
  188. package/src/ui/sections/ShadowsSection.svelte +1250 -0
  189. package/src/ui/sections/TokenScaleTable.svelte +332 -0
  190. package/src/ui/sections/tokenScales.ts +81 -0
  191. package/src/ui/variantScales.ts +108 -0
  192. package/src/components/DetailNav.svelte +0 -78
  193. package/src/components/Toggle.svelte +0 -86
  194. package/src/lib/pageSource.ts +0 -6
  195. package/src/lib/tokenInit.ts +0 -29
  196. package/src/lib/tokenService.ts +0 -144
  197. package/src/lib/tokenTypes.ts +0 -45
  198. package/src/pages/Admin.svelte +0 -100
  199. package/src/pages/ShowcasePage.svelte +0 -146
  200. package/src/showcase/BackupBrowser.svelte +0 -617
  201. package/src/showcase/ComponentsTab.svelte +0 -107
  202. package/src/showcase/PaletteEditor.svelte +0 -2579
  203. package/src/showcase/PaletteSelector.svelte +0 -627
  204. package/src/showcase/TokenMap.svelte +0 -54
  205. package/src/showcase/VariablesTab.svelte +0 -2657
  206. package/src/showcase/VisualsTab.svelte +0 -233
  207. package/src/showcase/demos/BadgeDemo.svelte +0 -58
  208. package/src/showcase/demos/CardDemo.svelte +0 -52
  209. package/src/showcase/demos/ChoiceButtonsDemo.svelte +0 -194
  210. package/src/showcase/demos/CollapsibleSectionDemo.svelte +0 -56
  211. package/src/showcase/demos/DialogDemo.svelte +0 -42
  212. package/src/showcase/demos/InlineEditActionsDemo.svelte +0 -27
  213. package/src/showcase/demos/NotificationDemo.svelte +0 -149
  214. package/src/showcase/demos/ProgressBarDemo.svelte +0 -56
  215. package/src/showcase/demos/RadioButtonDemo.svelte +0 -58
  216. package/src/showcase/demos/SectionDividerDemo.svelte +0 -79
  217. package/src/showcase/demos/StandardButtonsDemo.svelte +0 -457
  218. package/src/showcase/demos/TabBarDemo.svelte +0 -60
  219. package/src/showcase/demos/TooltipDemo.svelte +0 -54
  220. package/src/showcase/editor.css +0 -93
  221. package/src/showcase/index.ts +0 -17
  222. package/src/styles/fonts/Domine/Domine-VariableFont_wght.ttf +0 -0
  223. package/src/styles/fonts/Domine/OFL.txt +0 -97
  224. package/src/styles/fonts/Domine/README.txt +0 -66
  225. /package/src/{showcase → ui}/curveEngine.ts +0 -0
@@ -1,457 +0,0 @@
1
- <script lang="ts">
2
- import { onMount } from 'svelte';
3
- import Button from '../../components/Button.svelte';
4
- import TokenMap from '../TokenMap.svelte';
5
- import { removeCssVar } from '../../lib/cssVarSync';
6
-
7
- const variantTokens: Record<string, { label: string; variable: string }[]> = {
8
- primary: [
9
- { label: 'BG', variable: '--surface-primary-high' },
10
- { label: 'Border', variable: '--border-primary' },
11
- { label: 'Text', variable: '--text-primary' },
12
- { label: 'Hover BG', variable: '--surface-primary-higher' },
13
- { label: 'Hover Border', variable: '--border-primary-strong' },
14
- ],
15
- secondary: [
16
- { label: 'BG', variable: '--surface-neutral-high' },
17
- { label: 'Border', variable: '--border-neutral-default' },
18
- { label: 'Hover BG', variable: '--surface-neutral-higher' },
19
- { label: 'Hover Border', variable: '--border-neutral-strong' },
20
- ],
21
- outline: [
22
- { label: 'Border', variable: '--border-neutral-default' },
23
- { label: 'Hover BG', variable: '--hover-low' },
24
- { label: 'Hover Border', variable: '--border-neutral-strong' },
25
- ],
26
- small_secondary: [
27
- { label: 'BG', variable: '--hover' },
28
- { label: 'Border', variable: '--border-neutral-default' },
29
- { label: 'Hover BG', variable: '--hover-high' },
30
- { label: 'Hover Border', variable: '--border-neutral-strong' },
31
- ],
32
- success: [
33
- { label: 'BG', variable: '--surface-success-low' },
34
- { label: 'Border', variable: '--border-success' },
35
- { label: 'Text', variable: '--text-success' },
36
- ],
37
- danger: [
38
- { label: 'BG', variable: '--surface-danger-low' },
39
- { label: 'Border', variable: '--border-danger' },
40
- { label: 'Text', variable: '--text-danger' },
41
- ],
42
- warning: [
43
- { label: 'BG', variable: '--surface-warning-low' },
44
- { label: 'Border', variable: '--border-warning' },
45
- { label: 'Text', variable: '--text-warning' },
46
- ],
47
- };
48
-
49
- let resetKeys: Record<string, number> = {};
50
-
51
- function resetVariant(key: string) {
52
- for (const t of variantTokens[key]) {
53
- removeCssVar(t.variable);
54
- }
55
- resetKeys[key] = (resetKeys[key] || 0) + 1;
56
- resetKeys = resetKeys;
57
- }
58
-
59
- let copiedPrompts: Record<string, string> = {};
60
-
61
- function copyVariantPrompt(key: string) {
62
- const tokens = variantTokens[key];
63
- const changes: string[] = [];
64
- for (const t of tokens) {
65
- const override = document.documentElement.style.getPropertyValue(t.variable).trim();
66
- if (override) {
67
- changes.push(`- Change ${t.label.toLowerCase()} from \`var(${t.variable})\` to \`${override}\``);
68
- }
69
- }
70
- if (changes.length === 0) {
71
- copiedPrompts[key] = '';
72
- copiedPrompts = copiedPrompts;
73
- return;
74
- }
75
- const prompt = `In \`src/components/Button.svelte\`, update the **${key}** variant:\n${changes.join('\n')}`;
76
- navigator.clipboard.writeText(prompt);
77
- copiedPrompts[key] = prompt;
78
- copiedPrompts = copiedPrompts;
79
- }
80
-
81
- function variantHasOverrides(key: string): boolean {
82
- for (const t of variantTokens[key]) {
83
- if (document.documentElement.style.getPropertyValue(t.variable).trim()) return true;
84
- }
85
- return false;
86
- }
87
-
88
- let dirtyVariants: Record<string, boolean> = {};
89
-
90
- function updateDirtyState() {
91
- const next: Record<string, boolean> = {};
92
- for (const key of Object.keys(variantTokens)) {
93
- next[key] = variantHasOverrides(key);
94
- }
95
- dirtyVariants = next;
96
- }
97
-
98
- onMount(updateDirtyState);
99
-
100
- $: if (resetKeys) updateDirtyState();
101
- </script>
102
-
103
- <div class="demo-block">
104
- <h2 class="component-title">Standard Button Component</h2>
105
- <p class="demo-description">
106
- Reusable button component with multiple variants and sizes. Import from <code>components/Button.svelte</code>
107
- </p>
108
-
109
- <div class="demo-section variant-group">
110
- <div class="variant-header">
111
- <h3 class="demo-subtitle">Primary</h3>
112
- <div class="variant-actions">
113
- <button class="variant-action-btn" on:click={() => resetVariant('primary')} title="Reset to defaults">
114
- <i class="fas fa-undo"></i> Reset
115
- </button>
116
- <button class="variant-action-btn" on:click={() => copyVariantPrompt('primary')} title="Copy prompt" disabled={!dirtyVariants['primary']}>
117
- <i class="fas fa-copy"></i> Copy
118
- </button>
119
- </div>
120
- </div>
121
- <div class="button-showcase-grid">
122
- <div class="button-showcase-item">
123
- <Button variant="primary">Primary</Button>
124
- <span class="variant-label">primary</span>
125
- </div>
126
- <div class="button-showcase-item">
127
- <Button variant="primary" icon="fas fa-star" iconPosition="left">With Icon</Button>
128
- </div>
129
- <div class="button-showcase-item">
130
- <Button variant="primary" size="default">Default Size</Button>
131
- <span class="variant-label">size="default"</span>
132
- </div>
133
- <div class="button-showcase-item">
134
- <Button variant="primary" size="small">Small Size</Button>
135
- <span class="variant-label">size="small"</span>
136
- </div>
137
- <div class="button-showcase-item">
138
- <Button variant="primary" disabled>Disabled</Button>
139
- <span class="variant-label">disabled</span>
140
- </div>
141
- <div class="button-showcase-item">
142
- <Button variant="primary" fullWidth>Full Width</Button>
143
- <span class="variant-label">fullWidth</span>
144
- </div>
145
- </div>
146
- {#key resetKeys['primary']}
147
- <TokenMap title="primary" tokens={variantTokens['primary']} on:change={updateDirtyState} />
148
- {/key}
149
- {#if copiedPrompts['primary']}
150
- <div class="prompt-preview-wrapper">
151
- <button class="prompt-close" on:click={() => { copiedPrompts['primary'] = ''; copiedPrompts = copiedPrompts; }}><i class="fas fa-times"></i></button>
152
- <pre class="prompt-preview">{copiedPrompts['primary']}</pre>
153
- </div>
154
- {/if}
155
- </div>
156
-
157
- <div class="demo-section variant-group">
158
- <div class="variant-header">
159
- <h3 class="demo-subtitle">Secondary</h3>
160
- <div class="variant-actions">
161
- <button class="variant-action-btn" on:click={() => resetVariant('secondary')} title="Reset to defaults">
162
- <i class="fas fa-undo"></i> Reset
163
- </button>
164
- <button class="variant-action-btn" on:click={() => copyVariantPrompt('secondary')} title="Copy prompt" disabled={!dirtyVariants['secondary']}>
165
- <i class="fas fa-copy"></i> Copy
166
- </button>
167
- </div>
168
- </div>
169
- <div class="button-showcase-grid">
170
- <div class="button-showcase-item">
171
- <Button variant="secondary">Secondary</Button>
172
- <span class="variant-label">secondary</span>
173
- </div>
174
- <div class="button-showcase-item">
175
- <Button variant="secondary" icon="fas fa-check" iconPosition="right">Icon Right</Button>
176
- </div>
177
- </div>
178
- {#key resetKeys['secondary']}
179
- <TokenMap title="secondary" tokens={variantTokens['secondary']} on:change={updateDirtyState} />
180
- {/key}
181
- {#if copiedPrompts['secondary']}
182
- <div class="prompt-preview-wrapper">
183
- <button class="prompt-close" on:click={() => { copiedPrompts['secondary'] = ''; copiedPrompts = copiedPrompts; }}><i class="fas fa-times"></i></button>
184
- <pre class="prompt-preview">{copiedPrompts['secondary']}</pre>
185
- </div>
186
- {/if}
187
- </div>
188
-
189
- <div class="demo-section variant-group">
190
- <div class="variant-header">
191
- <h3 class="demo-subtitle">Outline</h3>
192
- <div class="variant-actions">
193
- <button class="variant-action-btn" on:click={() => resetVariant('outline')} title="Reset to defaults">
194
- <i class="fas fa-undo"></i> Reset
195
- </button>
196
- <button class="variant-action-btn" on:click={() => copyVariantPrompt('outline')} title="Copy prompt" disabled={!dirtyVariants['outline']}>
197
- <i class="fas fa-copy"></i> Copy
198
- </button>
199
- </div>
200
- </div>
201
- <div class="button-showcase-grid">
202
- <div class="button-showcase-item">
203
- <Button variant="outline">Outline</Button>
204
- <span class="variant-label">outline</span>
205
- </div>
206
- </div>
207
- {#key resetKeys['outline']}
208
- <TokenMap title="outline" tokens={variantTokens['outline']} on:change={updateDirtyState} />
209
- {/key}
210
- {#if copiedPrompts['outline']}
211
- <div class="prompt-preview-wrapper">
212
- <button class="prompt-close" on:click={() => { copiedPrompts['outline'] = ''; copiedPrompts = copiedPrompts; }}><i class="fas fa-times"></i></button>
213
- <pre class="prompt-preview">{copiedPrompts['outline']}</pre>
214
- </div>
215
- {/if}
216
- </div>
217
-
218
- <div class="demo-section variant-group">
219
- <div class="variant-header">
220
- <h3 class="demo-subtitle">Small Secondary</h3>
221
- <div class="variant-actions">
222
- <button class="variant-action-btn" on:click={() => resetVariant('small_secondary')} title="Reset to defaults">
223
- <i class="fas fa-undo"></i> Reset
224
- </button>
225
- <button class="variant-action-btn" on:click={() => copyVariantPrompt('small_secondary')} title="Copy prompt" disabled={!dirtyVariants['small_secondary']}>
226
- <i class="fas fa-copy"></i> Copy
227
- </button>
228
- </div>
229
- </div>
230
- <div class="button-showcase-grid">
231
- <div class="button-showcase-item">
232
- <Button variant="small_secondary">Small Secondary</Button>
233
- <span class="variant-label">small_secondary</span>
234
- </div>
235
- </div>
236
- {#key resetKeys['small_secondary']}
237
- <TokenMap title="small_secondary" tokens={variantTokens['small_secondary']} on:change={updateDirtyState} />
238
- {/key}
239
- {#if copiedPrompts['small_secondary']}
240
- <div class="prompt-preview-wrapper">
241
- <button class="prompt-close" on:click={() => { copiedPrompts['small_secondary'] = ''; copiedPrompts = copiedPrompts; }}><i class="fas fa-times"></i></button>
242
- <pre class="prompt-preview">{copiedPrompts['small_secondary']}</pre>
243
- </div>
244
- {/if}
245
- </div>
246
-
247
- <div class="demo-section variant-group">
248
- <div class="variant-header">
249
- <h3 class="demo-subtitle">Success</h3>
250
- <div class="variant-actions">
251
- <button class="variant-action-btn" on:click={() => resetVariant('success')} title="Reset to defaults">
252
- <i class="fas fa-undo"></i> Reset
253
- </button>
254
- <button class="variant-action-btn" on:click={() => copyVariantPrompt('success')} title="Copy prompt" disabled={!dirtyVariants['success']}>
255
- <i class="fas fa-copy"></i> Copy
256
- </button>
257
- </div>
258
- </div>
259
- <div class="button-showcase-grid">
260
- <div class="button-showcase-item">
261
- <Button variant="success">Success</Button>
262
- <span class="variant-label">success</span>
263
- </div>
264
- <div class="button-showcase-item">
265
- <Button variant="success" icon="fas fa-plus">Add Item</Button>
266
- </div>
267
- </div>
268
- {#key resetKeys['success']}
269
- <TokenMap title="success" tokens={variantTokens['success']} on:change={updateDirtyState} />
270
- {/key}
271
- {#if copiedPrompts['success']}
272
- <div class="prompt-preview-wrapper">
273
- <button class="prompt-close" on:click={() => { copiedPrompts['success'] = ''; copiedPrompts = copiedPrompts; }}><i class="fas fa-times"></i></button>
274
- <pre class="prompt-preview">{copiedPrompts['success']}</pre>
275
- </div>
276
- {/if}
277
- </div>
278
-
279
- <div class="demo-section variant-group">
280
- <div class="variant-header">
281
- <h3 class="demo-subtitle">Danger</h3>
282
- <div class="variant-actions">
283
- <button class="variant-action-btn" on:click={() => resetVariant('danger')} title="Reset to defaults">
284
- <i class="fas fa-undo"></i> Reset
285
- </button>
286
- <button class="variant-action-btn" on:click={() => copyVariantPrompt('danger')} title="Copy prompt" disabled={!dirtyVariants['danger']}>
287
- <i class="fas fa-copy"></i> Copy
288
- </button>
289
- </div>
290
- </div>
291
- <div class="button-showcase-grid">
292
- <div class="button-showcase-item">
293
- <Button variant="danger">Danger</Button>
294
- <span class="variant-label">danger</span>
295
- </div>
296
- <div class="button-showcase-item">
297
- <Button variant="danger" icon="fas fa-trash">Delete</Button>
298
- </div>
299
- </div>
300
- {#key resetKeys['danger']}
301
- <TokenMap title="danger" tokens={variantTokens['danger']} on:change={updateDirtyState} />
302
- {/key}
303
- {#if copiedPrompts['danger']}
304
- <div class="prompt-preview-wrapper">
305
- <button class="prompt-close" on:click={() => { copiedPrompts['danger'] = ''; copiedPrompts = copiedPrompts; }}><i class="fas fa-times"></i></button>
306
- <pre class="prompt-preview">{copiedPrompts['danger']}</pre>
307
- </div>
308
- {/if}
309
- </div>
310
-
311
- <div class="demo-section variant-group">
312
- <div class="variant-header">
313
- <h3 class="demo-subtitle">Warning</h3>
314
- <div class="variant-actions">
315
- <button class="variant-action-btn" on:click={() => resetVariant('warning')} title="Reset to defaults">
316
- <i class="fas fa-undo"></i> Reset
317
- </button>
318
- <button class="variant-action-btn" on:click={() => copyVariantPrompt('warning')} title="Copy prompt" disabled={!dirtyVariants['warning']}>
319
- <i class="fas fa-copy"></i> Copy
320
- </button>
321
- </div>
322
- </div>
323
- <div class="button-showcase-grid">
324
- <div class="button-showcase-item">
325
- <Button variant="warning">Warning</Button>
326
- <span class="variant-label">warning</span>
327
- </div>
328
- </div>
329
- {#key resetKeys['warning']}
330
- <TokenMap title="warning" tokens={variantTokens['warning']} on:change={updateDirtyState} />
331
- {/key}
332
- {#if copiedPrompts['warning']}
333
- <div class="prompt-preview-wrapper">
334
- <button class="prompt-close" on:click={() => { copiedPrompts['warning'] = ''; copiedPrompts = copiedPrompts; }}><i class="fas fa-times"></i></button>
335
- <pre class="prompt-preview">{copiedPrompts['warning']}</pre>
336
- </div>
337
- {/if}
338
- </div>
339
- </div>
340
-
341
- <style>
342
- @import '../../styles/variables.css';
343
-
344
- .variant-group {
345
- padding: var(--space-16);
346
- background: var(--ui-surface-low);
347
- border: 1px solid var(--ui-border-faint);
348
- border-radius: var(--radius-md);
349
- gap: var(--space-12);
350
- }
351
-
352
- .variant-header {
353
- display: flex;
354
- align-items: center;
355
- justify-content: space-between;
356
- }
357
-
358
- .variant-header .demo-subtitle {
359
- margin: 0;
360
- }
361
-
362
- .variant-actions {
363
- display: flex;
364
- gap: var(--space-4);
365
- }
366
-
367
- .variant-action-btn {
368
- display: flex;
369
- align-items: center;
370
- gap: var(--space-4);
371
- padding: var(--space-4) var(--space-8);
372
- background: none;
373
- border: 1px solid var(--ui-border-subtle);
374
- border-radius: var(--radius-sm);
375
- color: var(--ui-text-muted);
376
- font-size: var(--font-xs);
377
- cursor: pointer;
378
- transition: all var(--transition-fast);
379
- }
380
-
381
- .variant-action-btn:hover:not(:disabled) {
382
- background: var(--ui-hover);
383
- color: var(--ui-text-primary);
384
- border-color: var(--ui-border-default);
385
- }
386
-
387
- .variant-action-btn:disabled {
388
- opacity: 0.3;
389
- cursor: not-allowed;
390
- }
391
-
392
- .prompt-preview-wrapper {
393
- position: relative;
394
- }
395
-
396
- .prompt-close {
397
- position: absolute;
398
- top: var(--space-4);
399
- right: var(--space-4);
400
- display: flex;
401
- align-items: center;
402
- justify-content: center;
403
- width: 1.25rem;
404
- height: 1.25rem;
405
- padding: 0;
406
- background: none;
407
- border: none;
408
- border-radius: var(--radius-sm);
409
- color: var(--ui-text-muted);
410
- font-size: 0.625rem;
411
- cursor: pointer;
412
- transition: all var(--transition-fast);
413
- }
414
-
415
- .prompt-close:hover {
416
- background: var(--ui-hover);
417
- color: var(--ui-text-primary);
418
- }
419
-
420
- .prompt-preview {
421
- margin: 0;
422
- padding: var(--space-8) var(--space-10);
423
- padding-right: var(--space-24);
424
- background: var(--ui-surface-lowest);
425
- border: 1px solid var(--ui-border-subtle);
426
- border-radius: var(--radius-sm);
427
- color: var(--ui-text-secondary);
428
- font-size: 0.625rem;
429
- font-family: var(--ui-font-mono);
430
- white-space: pre-wrap;
431
- word-break: break-word;
432
- line-height: 1.5;
433
- }
434
-
435
- .button-showcase-grid {
436
- display: flex;
437
- flex-wrap: wrap;
438
- gap: var(--space-16);
439
- align-items: start;
440
- }
441
-
442
- .button-showcase-item {
443
- display: flex;
444
- flex-direction: column;
445
- gap: var(--space-8);
446
- align-items: flex-start;
447
- }
448
-
449
- .variant-label {
450
- font-size: var(--font-xs);
451
- color: var(--ui-text-tertiary);
452
- font-family: var(--ui-font-mono);
453
- background: var(--ui-surface-lowest);
454
- padding: var(--space-2) var(--space-6);
455
- border-radius: var(--radius-sm);
456
- }
457
- </style>
@@ -1,60 +0,0 @@
1
- <script lang="ts">
2
- import TabBar from '../../components/TabBar.svelte';
3
- import TokenMap from '../TokenMap.svelte';
4
-
5
- let selectedDemoTab = 'overview';
6
- const demoTabs = [
7
- { id: 'overview', label: 'Overview', icon: 'fas fa-home' },
8
- { id: 'details', label: 'Details', icon: 'fas fa-info-circle' },
9
- { id: 'settings', label: 'Settings', icon: 'fas fa-cog' },
10
- { id: 'disabled', label: 'Disabled', icon: 'fas fa-ban', disabled: true }
11
- ];
12
- </script>
13
-
14
- <div class="demo-block">
15
- <h2 class="component-title">Tab Bar Component</h2>
16
- <p class="demo-description">
17
- Tab navigation with icon support and disabled state. Import from <code>components/TabBar.svelte</code>
18
- </p>
19
-
20
- <div class="demo-section">
21
- <TabBar
22
- tabs={demoTabs}
23
- selectedTab={selectedDemoTab}
24
- on:tabChange={(e) => selectedDemoTab = e.detail}
25
- />
26
- <div class="tab-content-demo">
27
- {#if selectedDemoTab === 'overview'}
28
- <p style="margin: 0;">Overview tab content</p>
29
- {:else if selectedDemoTab === 'details'}
30
- <p style="margin: 0;">Details tab content</p>
31
- {:else if selectedDemoTab === 'settings'}
32
- <p style="margin: 0;">Settings tab content</p>
33
- {/if}
34
- </div>
35
- </div>
36
-
37
- <div class="demo-section">
38
- <h3 class="demo-subtitle">Tokens</h3>
39
- <TokenMap tokens={[
40
- { label: 'Default Text', variable: '--text-tertiary' },
41
- { label: 'Hover Text', variable: '--text-secondary' },
42
- { label: 'Active Text', variable: '--text-primary' },
43
- { label: 'Active Border', variable: '--color-primary-500' },
44
- { label: 'Divider', variable: '--border-neutral-subtle' },
45
- ]} />
46
- </div>
47
- </div>
48
-
49
- <style>
50
- @import '../../styles/variables.css';
51
-
52
- .tab-content-demo {
53
- padding: var(--space-16);
54
- color: var(--ui-text-secondary);
55
- background: var(--ui-surface-low);
56
- border: 1px solid var(--ui-border-faint);
57
- border-top: none;
58
- border-radius: 0 0 var(--radius-md) var(--radius-md);
59
- }
60
- </style>
@@ -1,54 +0,0 @@
1
- <script lang="ts">
2
- import Button from '../../components/Button.svelte';
3
- import Tooltip from '../../components/Tooltip.svelte';
4
- import TokenMap from '../TokenMap.svelte';
5
- </script>
6
-
7
- <div class="demo-block">
8
- <h2 class="component-title">Tooltip Component</h2>
9
- <p class="demo-description">
10
- Hover tooltip with configurable position. Import from <code>components/Tooltip.svelte</code>
11
- </p>
12
-
13
- <div class="demo-section">
14
- <div class="tooltip-demo-row">
15
- <Tooltip text="This is a top tooltip">
16
- <Button variant="outline">Hover me (top)</Button>
17
- </Tooltip>
18
-
19
- <Tooltip text="Bottom tooltip" position="bottom">
20
- <Button variant="outline">Hover me (bottom)</Button>
21
- </Tooltip>
22
-
23
- <Tooltip text="Tooltips work on any element">
24
- <span class="tooltip-demo-text">Hover this text</span>
25
- </Tooltip>
26
- </div>
27
- </div>
28
-
29
- <div class="demo-section">
30
- <h3 class="demo-subtitle">Tokens</h3>
31
- <TokenMap tokens={[
32
- { label: 'Background', variable: '--surface-neutral-highest' },
33
- { label: 'Text', variable: '--text-primary' },
34
- ]} />
35
- </div>
36
- </div>
37
-
38
- <style>
39
- @import '../../styles/variables.css';
40
-
41
- .tooltip-demo-row {
42
- display: flex;
43
- gap: var(--space-24);
44
- align-items: center;
45
- padding-top: var(--space-32);
46
- }
47
-
48
- .tooltip-demo-text {
49
- color: var(--ui-text-secondary);
50
- text-decoration: underline;
51
- text-decoration-style: dotted;
52
- cursor: help;
53
- }
54
- </style>
@@ -1,93 +0,0 @@
1
- /*
2
- * Design System Editor — UI Chrome
3
- *
4
- * Opaque grayscale palette for the editor itself.
5
- * Protected from the design-token system — these never change.
6
- *
7
- * Every showcase/editor component references these via var(--ui-*).
8
- * The --ui-gray-* ramp is the source of truth; semantic aliases
9
- * (--ui-surface-*, --ui-text-*, --ui-border-*) point into it.
10
- */
11
-
12
- .admin-page {
13
-
14
- /* ── Fonts ────────────────────────────────────────────── */
15
-
16
- /* System sans for all editor chrome — no app custom fonts */
17
- --ui-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
18
-
19
- /* System monospace for variable names, hex values, code */
20
- --ui-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
21
-
22
- font-family: var(--ui-font-sans);
23
- }
24
-
25
- /* Override the global :where(*) { font-family: var(--font-sans) }
26
- from variables.css which applies directly to every element */
27
- .admin-page *:not([class*="fa-"]) {
28
- font-family: inherit;
29
- }
30
-
31
- .admin-page {
32
-
33
- /* ═══════════════════════════════════════════════════════
34
- GRAYSCALE PALETTE — opaque, protected from token system
35
- Lower number = darker. Derived from the old alpha-on-black
36
- values so every existing reference resolves identically.
37
- ═══════════════════════════════════════════════════════ */
38
-
39
- --ui-gray-50: #050505;
40
- --ui-gray-100: #0a0a0a;
41
- --ui-gray-150: #0f0f0f;
42
- --ui-gray-200: #141414;
43
- --ui-gray-250: #1a1a1a;
44
- --ui-gray-300: #212121;
45
- --ui-gray-350: #292929;
46
- --ui-gray-400: #333333;
47
- --ui-gray-500: #4d4d4d;
48
- --ui-gray-600: #666666;
49
- --ui-gray-700: #808080;
50
- --ui-gray-750: #999999;
51
- --ui-gray-800: #bfbfbf;
52
- --ui-gray-850: #c7c7c7;
53
- --ui-gray-950: #f2f2f2;
54
-
55
-
56
- /* ── Text ────────────────────────────────────────────── */
57
-
58
- --ui-text-primary: #ffffff;
59
- --ui-text-secondary: var(--ui-gray-800);
60
- --ui-text-tertiary: var(--ui-gray-700);
61
- --ui-text-muted: var(--ui-gray-500);
62
- --ui-text-disabled: var(--ui-gray-400);
63
- --ui-text-accent: var(--ui-gray-950);
64
- --ui-text-success: var(--ui-gray-850);
65
-
66
-
67
- /* ── Borders ─────────────────────────────────────────── */
68
-
69
- --ui-border-faint: var(--ui-gray-400);
70
- --ui-border-subtle: var(--ui-gray-500);
71
- --ui-border-default: var(--ui-gray-600);
72
- --ui-border-medium: var(--ui-gray-700);
73
- --ui-border-strong: var(--ui-gray-800);
74
-
75
-
76
- /* ── Surfaces ────────────────────────────────────────── */
77
-
78
- --ui-surface-lowest: var(--ui-gray-50);
79
- --ui-surface-lower: var(--ui-gray-100);
80
- --ui-surface-low: var(--ui-gray-150);
81
- --ui-surface: var(--ui-gray-200);
82
- --ui-surface-high: var(--ui-gray-250);
83
- --ui-surface-higher: var(--ui-gray-300);
84
- --ui-surface-highest: var(--ui-gray-350);
85
-
86
- --ui-toggle: var(--ui-gray-750);
87
-
88
-
89
- /* ── Hover ───────────────────────────────────────────── */
90
-
91
- --ui-hover: var(--ui-gray-150);
92
- --ui-hover-high: var(--ui-gray-250);
93
- }
@@ -1,17 +0,0 @@
1
- export { default as VisualsTab } from './VisualsTab.svelte';
2
- export { default as VariablesTab } from './VariablesTab.svelte';
3
- export { default as ComponentsTab, defaultSections } from './ComponentsTab.svelte';
4
- export type { ComponentSection } from './ComponentsTab.svelte';
5
-
6
- export { default as PaletteEditor } from './PaletteEditor.svelte';
7
- export { default as PaletteSelector } from './PaletteSelector.svelte';
8
- export { default as ColorEditPanel } from './ColorEditPanel.svelte';
9
- export { default as BezierCurveEditor } from './BezierCurveEditor.svelte';
10
-
11
- export { default as TokenFileManager } from './TokenFileManager.svelte';
12
- export { default as BackupBrowser } from './BackupBrowser.svelte';
13
- export { default as EditorDialog } from './EditorDialog.svelte';
14
- export { default as TokenMap } from './TokenMap.svelte';
15
-
16
- export { default as TextTab } from './TextTab.svelte';
17
- export { default as SurfacesTab } from './SurfacesTab.svelte';