@motion-proto/live-tokens 0.1.1 → 0.3.2
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.
- package/README.md +168 -21
- package/dist-plugin/index.cjs +823 -336
- package/dist-plugin/index.d.cts +9 -7
- package/dist-plugin/index.d.ts +9 -7
- package/dist-plugin/index.js +822 -335
- package/package.json +46 -20
- package/src/assets/newspaper.webp +0 -0
- package/src/assets/offering.webp +0 -0
- package/src/component-editor/BadgeEditor.svelte +170 -0
- package/src/component-editor/CalloutEditor.svelte +103 -0
- package/src/component-editor/CardEditor.svelte +184 -0
- package/src/component-editor/CollapsibleSectionEditor.svelte +167 -0
- package/src/component-editor/CornerBadgeEditor.svelte +207 -0
- package/src/component-editor/DialogEditor.svelte +172 -0
- package/src/component-editor/ImageEditor.svelte +72 -0
- package/src/component-editor/InlineEditActionsEditor.svelte +83 -0
- package/src/component-editor/NotificationEditor.svelte +160 -0
- package/src/component-editor/ProgressBarEditor.svelte +124 -0
- package/src/component-editor/RadioButtonEditor.svelte +140 -0
- package/src/component-editor/SectionDividerEditor.svelte +263 -0
- package/src/component-editor/SegmentedControlEditor.svelte +154 -0
- package/src/component-editor/StandardButtonsEditor.svelte +178 -0
- package/src/component-editor/TabBarEditor.svelte +137 -0
- package/src/component-editor/TableEditor.svelte +128 -0
- package/src/component-editor/TooltipEditor.svelte +122 -0
- package/src/component-editor/editorTokens.test.ts +93 -0
- package/src/component-editor/groupKeySlots.test.ts +67 -0
- package/src/component-editor/groupKeySnapshot.test.ts +52 -0
- package/src/component-editor/index.ts +5 -0
- package/src/component-editor/registry.ts +246 -0
- package/src/component-editor/scaffolding/AngleDial.svelte +185 -0
- package/src/component-editor/scaffolding/ComponentEditorBase.svelte +96 -0
- package/src/component-editor/scaffolding/ComponentFileManager.svelte +682 -0
- package/src/component-editor/scaffolding/ComponentFileMenu.svelte +312 -0
- package/src/component-editor/scaffolding/ComponentsTab.svelte +69 -0
- package/src/component-editor/scaffolding/CopyFromMenu.svelte +246 -0
- package/src/component-editor/scaffolding/DemoHeader.svelte +21 -0
- package/src/component-editor/scaffolding/DividerEditor.svelte +81 -0
- package/src/component-editor/scaffolding/FieldsetWrapper.svelte +46 -0
- package/src/component-editor/scaffolding/GradientCard.svelte +291 -0
- package/src/component-editor/scaffolding/LinkageChart.svelte +297 -0
- package/src/component-editor/scaffolding/LinkedBlock.svelte +418 -0
- package/src/component-editor/scaffolding/NonStylableConfig.svelte +57 -0
- package/src/component-editor/scaffolding/SaveAsDialog.svelte +177 -0
- package/src/component-editor/scaffolding/ShadowBackdrop.svelte +25 -0
- package/src/component-editor/scaffolding/ShadowBackdropControls.svelte +56 -0
- package/src/component-editor/scaffolding/StateBlock.svelte +115 -0
- package/src/component-editor/scaffolding/TokenLayout.svelte +511 -0
- package/src/component-editor/scaffolding/TypeEditor.svelte +82 -0
- package/src/component-editor/scaffolding/VariantGroup.svelte +277 -0
- package/src/component-editor/scaffolding/buildTypeGroupTokens.ts +97 -0
- package/src/component-editor/scaffolding/componentSectionType.ts +8 -0
- package/src/component-editor/scaffolding/componentSources.ts +9 -0
- package/src/component-editor/scaffolding/defaultSections.ts +16 -0
- package/src/component-editor/scaffolding/editorContext.ts +44 -0
- package/src/component-editor/scaffolding/linkedBlock.ts +226 -0
- package/src/component-editor/scaffolding/siblings.ts +33 -0
- package/src/component-editor/scaffolding/types.ts +39 -0
- package/src/components/Badge.svelte +231 -42
- package/src/components/Button.svelte +324 -124
- package/src/components/Callout.svelte +145 -0
- package/src/components/Card.svelte +123 -25
- package/src/components/CollapsibleSection.svelte +213 -35
- package/src/components/CornerBadge.svelte +224 -0
- package/src/components/Dialog.svelte +137 -114
- package/src/components/Image.svelte +43 -0
- package/src/components/InlineEditActions.svelte +74 -14
- package/src/components/Notification.svelte +184 -163
- package/src/components/ProgressBar.svelte +216 -22
- package/src/components/RadioButton.svelte +110 -40
- package/src/components/SectionDivider.svelte +428 -74
- package/src/components/SegmentedControl.svelte +203 -0
- package/src/components/TabBar.svelte +146 -21
- package/src/components/Table.svelte +102 -0
- package/src/components/Tooltip.svelte +45 -19
- package/src/components/types.ts +51 -0
- package/src/data/google-fonts.json +75 -0
- package/src/lib/ColumnsOverlay.svelte +20 -7
- package/src/lib/LiveEditorOverlay.svelte +257 -78
- package/src/lib/columnsOverlay.ts +21 -17
- package/src/lib/componentConfig.test.ts +204 -0
- package/src/lib/componentConfigKeys.ts +19 -0
- package/src/lib/componentConfigService.ts +88 -0
- package/src/lib/copyPopover.ts +30 -0
- package/src/lib/cssVarSync.ts +59 -7
- package/src/lib/editorConfigStore.ts +0 -10
- package/src/lib/editorCore.ts +402 -0
- package/src/lib/editorKeybindings.ts +52 -0
- package/src/lib/editorPersistence.ts +106 -0
- package/src/lib/editorRenderer.ts +74 -0
- package/src/lib/editorStore.test.ts +328 -0
- package/src/lib/editorStore.ts +412 -0
- package/src/lib/editorTypes.ts +100 -0
- package/src/lib/editorViewStore.ts +55 -0
- package/src/lib/files/versionedFileResource.ts +140 -0
- package/src/lib/fontLoader.ts +130 -0
- package/src/lib/fontMigration.ts +140 -0
- package/src/lib/fontParse.ts +168 -0
- package/src/lib/index.ts +48 -30
- package/src/lib/lazyConfig.test.ts +54 -0
- package/src/lib/migrations/2026-04-24-component-prefix-and-suffix-renames.ts +64 -0
- package/src/lib/migrations/2026-04-24-legacy-keys-and-bg-to-canvas.ts +71 -0
- package/src/lib/migrations/2026-04-27-segmentedcontrol-disabled-flatten.ts +43 -0
- package/src/lib/migrations/2026-05-08-collapsiblesection-frame-and-cleanup.ts +68 -0
- package/src/lib/migrations/2026-05-08-collapsiblesection-variant-namespace.ts +35 -0
- package/src/lib/migrations/2026-05-10-sectiondivider-gradient-stops.ts +50 -0
- package/src/lib/migrations/2026-05-13-primary-to-brand.ts +90 -0
- package/src/lib/migrations/index.ts +93 -0
- package/src/lib/migrations/migrations.test.ts +341 -0
- package/src/lib/navLinkTypes.ts +1 -0
- package/src/lib/overlayState.ts +3 -0
- package/src/lib/paletteDerivation.ts +300 -0
- package/src/lib/parentRouteStore.ts +42 -0
- package/src/lib/parsers/globalRootBlock.ts +32 -0
- package/src/lib/presetService.ts +94 -0
- package/src/lib/router.ts +42 -10
- package/src/lib/scrollSection.ts +45 -0
- package/src/lib/slices/columns.ts +59 -0
- package/src/lib/slices/components.ts +362 -0
- package/src/lib/slices/domainVars.ts +15 -0
- package/src/lib/slices/fonts.ts +30 -0
- package/src/lib/slices/gradients.ts +153 -0
- package/src/lib/slices/overlays.ts +132 -0
- package/src/lib/slices/palettes.ts +26 -0
- package/src/lib/slices/shadows.ts +123 -0
- package/src/lib/storage.ts +88 -0
- package/src/lib/themeInit.ts +74 -0
- package/src/lib/themeService.ts +101 -0
- package/src/lib/themeTypes.ts +146 -0
- package/src/lib/tokenRegistry.ts +148 -0
- package/src/pages/ComponentEditorPage.svelte +384 -0
- package/src/pages/ComponentEditorPage.svelte.d.ts +2 -0
- package/src/pages/Editor.svelte +98 -0
- package/src/pages/Editor.svelte.d.ts +2 -0
- package/src/pages/EditorShell.svelte +348 -0
- package/src/styles/_padding.scss +34 -0
- package/src/styles/fonts/Fraunces/Fraunces-italic-latin-ext.woff2 +0 -0
- package/src/styles/fonts/Fraunces/Fraunces-italic-latin.woff2 +0 -0
- package/src/styles/fonts/Fraunces/Fraunces-roman-latin-ext.woff2 +0 -0
- package/src/styles/fonts/Fraunces/Fraunces-roman-latin.woff2 +0 -0
- package/src/styles/fonts/Manrope/Manrope-latin-ext.woff2 +0 -0
- package/src/styles/fonts/Manrope/Manrope-latin.woff2 +0 -0
- package/src/styles/fonts.css +22 -10
- package/src/styles/form-controls.css +14 -16
- package/src/styles/tokens.css +1322 -0
- package/src/styles/ui-editor.css +126 -0
- package/src/{showcase → ui}/BezierCurveEditor.svelte +14 -14
- package/src/{showcase → ui}/ColorEditPanel.svelte +42 -36
- package/src/ui/EditorViewSwitcher.svelte +180 -0
- package/src/ui/FontStackEditor.svelte +360 -0
- package/src/ui/GradientEditor.svelte +461 -0
- package/src/ui/GradientStopPicker.svelte +74 -0
- package/src/ui/PaletteEditor.svelte +1590 -0
- package/src/ui/PaletteEditor.test.ts +108 -0
- package/src/ui/PresetFileManager.svelte +567 -0
- package/src/ui/ProjectFontsSection.svelte +645 -0
- package/src/{showcase → ui}/SurfacesTab.svelte +39 -39
- package/src/{showcase → ui}/TextTab.svelte +27 -27
- package/src/{showcase/TokenFileManager.svelte → ui/ThemeFileManager.svelte} +196 -112
- package/src/ui/Toggle.svelte +108 -0
- package/src/ui/UICopyPopover.svelte +78 -0
- package/src/{showcase/EditorDialog.svelte → ui/UIDialog.svelte} +66 -25
- package/src/ui/UIFontFamilySelector.svelte +309 -0
- package/src/ui/UIFontSizeSelector.svelte +165 -0
- package/src/ui/UIFontWeightSelector.svelte +52 -0
- package/src/ui/UILineHeightSelector.svelte +47 -0
- package/src/ui/UILinkToggle.svelte +60 -0
- package/src/ui/UIOptionItem.svelte +74 -0
- package/src/ui/UIOptionList.svelte +27 -0
- package/src/ui/UIPaddingSelector.svelte +661 -0
- package/src/ui/UIPaletteSelector.svelte +1084 -0
- package/src/ui/UIRadio.svelte +72 -0
- package/src/ui/UIRadioGroup.svelte +59 -0
- package/src/ui/UIRelinkConfirmPopover.svelte +235 -0
- package/src/ui/UITokenSelector.svelte +509 -0
- package/src/ui/UIVariantSelector.svelte +145 -0
- package/src/ui/VariablesTab.svelte +252 -0
- package/src/ui/index.ts +31 -0
- package/src/ui/keepInViewport.ts +84 -0
- package/src/ui/palette/GradientStopEditor.svelte +482 -0
- package/src/ui/palette/OverridesPanel.svelte +526 -0
- package/src/ui/palette/PaletteBase.svelte +165 -0
- package/src/ui/palette/ScaleCurveEditor.svelte +38 -0
- package/src/ui/palette/paletteEditorState.ts +89 -0
- package/src/ui/sections/ColumnsSection.svelte +273 -0
- package/src/ui/sections/GradientsSection.svelte +147 -0
- package/src/ui/sections/OverlaysSection.svelte +670 -0
- package/src/ui/sections/ShadowsSection.svelte +1250 -0
- package/src/ui/sections/TokenScaleTable.svelte +332 -0
- package/src/ui/sections/tokenScales.ts +81 -0
- package/src/ui/variantScales.ts +108 -0
- package/src/components/DetailNav.svelte +0 -78
- package/src/components/Toggle.svelte +0 -86
- package/src/lib/tokenInit.ts +0 -29
- package/src/lib/tokenService.ts +0 -144
- package/src/lib/tokenTypes.ts +0 -45
- package/src/pages/Admin.svelte +0 -100
- package/src/pages/ShowcasePage.svelte +0 -144
- package/src/showcase/BackupBrowser.svelte +0 -617
- package/src/showcase/ComponentsTab.svelte +0 -105
- package/src/showcase/PaletteEditor.svelte +0 -2579
- package/src/showcase/PaletteSelector.svelte +0 -627
- package/src/showcase/TokenMap.svelte +0 -54
- package/src/showcase/VariablesTab.svelte +0 -2655
- package/src/showcase/VisualsTab.svelte +0 -231
- package/src/showcase/demos/BadgeDemo.svelte +0 -56
- package/src/showcase/demos/CardDemo.svelte +0 -50
- package/src/showcase/demos/ChoiceButtonsDemo.svelte +0 -192
- package/src/showcase/demos/CollapsibleSectionDemo.svelte +0 -54
- package/src/showcase/demos/DialogDemo.svelte +0 -42
- package/src/showcase/demos/InlineEditActionsDemo.svelte +0 -25
- package/src/showcase/demos/NotificationDemo.svelte +0 -147
- package/src/showcase/demos/ProgressBarDemo.svelte +0 -54
- package/src/showcase/demos/RadioButtonDemo.svelte +0 -56
- package/src/showcase/demos/SectionDividerDemo.svelte +0 -77
- package/src/showcase/demos/StandardButtonsDemo.svelte +0 -455
- package/src/showcase/demos/TabBarDemo.svelte +0 -58
- package/src/showcase/demos/TooltipDemo.svelte +0 -52
- package/src/showcase/editor.css +0 -93
- package/src/showcase/index.ts +0 -17
- package/src/styles/fonts/Domine/Domine-VariableFont_wght.ttf +0 -0
- package/src/styles/fonts/Domine/OFL.txt +0 -97
- package/src/styles/fonts/Domine/README.txt +0 -66
- /package/src/{showcase → ui}/curveEngine.ts +0 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount, onDestroy } from 'svelte';
|
|
3
|
+
import { get } from 'svelte/store';
|
|
4
|
+
import VariablesTab from '../ui/VariablesTab.svelte';
|
|
5
|
+
import ThemeFileManager from '../ui/ThemeFileManager.svelte';
|
|
6
|
+
import EditorViewSwitcher from '../ui/EditorViewSwitcher.svelte';
|
|
7
|
+
import ComponentsTab from '../component-editor/scaffolding/ComponentsTab.svelte';
|
|
8
|
+
import PresetFileManager from '../ui/PresetFileManager.svelte';
|
|
9
|
+
import { persistTheme, hydrateTheme } from '../lib/themeService';
|
|
10
|
+
import { scrollSectionIntoView } from '../lib/scrollSection';
|
|
11
|
+
import { editorState } from '../lib/editorStore';
|
|
12
|
+
import { editorView, sidebarCondensed, selectedComponent } from '../lib/editorViewStore';
|
|
13
|
+
import { componentRegistryEntries, validateRegistryAgainstServerScan } from '../component-editor/registry';
|
|
14
|
+
import { listComponents } from '../lib/componentConfigService';
|
|
15
|
+
|
|
16
|
+
const tokenNavItems = [
|
|
17
|
+
{ id: 'palette-editor', label: 'Palette Editor', icon: 'fas fa-palette' },
|
|
18
|
+
{ id: 'spacing', label: 'Spacing & Borders', icon: 'fas fa-ruler-combined' },
|
|
19
|
+
{ id: 'columns', label: 'Columns', icon: 'fas fa-columns' },
|
|
20
|
+
{ id: 'border-radius', label: 'Border Radius', icon: 'fas fa-border-style' },
|
|
21
|
+
{ id: 'typography', label: 'Typography', icon: 'fas fa-font' },
|
|
22
|
+
{ id: 'icon-sizes', label: 'Icon Sizes', icon: 'fas fa-expand' },
|
|
23
|
+
{ id: 'shadows', label: 'Shadows', icon: 'fas fa-cloud' },
|
|
24
|
+
{ id: 'overlays', label: 'Overlays', icon: 'fas fa-layer-group' },
|
|
25
|
+
{ id: 'gradients', label: 'Gradients', icon: 'fas fa-droplet' },
|
|
26
|
+
{ id: 'utility-tokens', label: 'Utility Tokens', icon: 'fas fa-sliders' }
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
const componentNavItems = componentRegistryEntries.map(({ id, label, icon }) => ({ id, label, icon }));
|
|
30
|
+
|
|
31
|
+
let selectedTokenSection: string | null = null;
|
|
32
|
+
let saveStatus: 'idle' | 'saving' | 'saved' | 'error' = 'idle';
|
|
33
|
+
|
|
34
|
+
let shellEl: HTMLElement | null = null;
|
|
35
|
+
let shellWidth = 1024;
|
|
36
|
+
const CONDENSE_BELOW = 520;
|
|
37
|
+
|
|
38
|
+
$: condensed = $sidebarCondensed === 'auto' ? shellWidth < CONDENSE_BELOW : $sidebarCondensed;
|
|
39
|
+
|
|
40
|
+
const HINT_DELAY_MS = 80;
|
|
41
|
+
let hintLabel: string | null = null;
|
|
42
|
+
let hintTop = 0;
|
|
43
|
+
let hintTimer: ReturnType<typeof setTimeout> | null = null;
|
|
44
|
+
|
|
45
|
+
function showHint(label: string, target: HTMLElement) {
|
|
46
|
+
if (!condensed) return;
|
|
47
|
+
if (hintTimer) clearTimeout(hintTimer);
|
|
48
|
+
const top = target.getBoundingClientRect().top + target.offsetHeight / 2;
|
|
49
|
+
hintTimer = setTimeout(() => {
|
|
50
|
+
hintLabel = label;
|
|
51
|
+
hintTop = top;
|
|
52
|
+
}, HINT_DELAY_MS);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function hideHint() {
|
|
56
|
+
if (hintTimer) {
|
|
57
|
+
clearTimeout(hintTimer);
|
|
58
|
+
hintTimer = null;
|
|
59
|
+
}
|
|
60
|
+
hintLabel = null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
$: if (!condensed) hideHint();
|
|
64
|
+
|
|
65
|
+
function scrollToSection(sectionId: string) {
|
|
66
|
+
selectedTokenSection = sectionId;
|
|
67
|
+
const el = document.getElementById(sectionId);
|
|
68
|
+
if (el) scrollSectionIntoView(el);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function selectComponent(id: string) {
|
|
72
|
+
selectedComponent.set(id);
|
|
73
|
+
hideHint();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function toggleCondensed() {
|
|
77
|
+
sidebarCondensed.update((v) => {
|
|
78
|
+
const isCondensedNow = v === 'auto' ? shellWidth < CONDENSE_BELOW : v;
|
|
79
|
+
return !isCondensedNow;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async function handleSave(e: CustomEvent<{ fileName: string; displayName: string }>) {
|
|
84
|
+
const { fileName, displayName } = e.detail;
|
|
85
|
+
saveStatus = 'saving';
|
|
86
|
+
try {
|
|
87
|
+
await persistTheme(get(editorState), fileName, displayName);
|
|
88
|
+
saveStatus = 'saved';
|
|
89
|
+
setTimeout(() => { saveStatus = 'idle'; }, 2000);
|
|
90
|
+
} catch {
|
|
91
|
+
saveStatus = 'error';
|
|
92
|
+
setTimeout(() => { saveStatus = 'idle'; }, 3000);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async function handleLoad(e: CustomEvent<{ fileName: string }>) {
|
|
97
|
+
try {
|
|
98
|
+
await hydrateTheme(e.detail.fileName);
|
|
99
|
+
} catch {
|
|
100
|
+
// silent
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
let ro: ResizeObserver | null = null;
|
|
105
|
+
onMount(async () => {
|
|
106
|
+
if (shellEl && typeof ResizeObserver !== 'undefined') {
|
|
107
|
+
ro = new ResizeObserver((entries) => {
|
|
108
|
+
const w = entries[0]?.contentRect.width;
|
|
109
|
+
if (typeof w === 'number') shellWidth = w;
|
|
110
|
+
});
|
|
111
|
+
ro.observe(shellEl);
|
|
112
|
+
shellWidth = shellEl.clientWidth;
|
|
113
|
+
}
|
|
114
|
+
try {
|
|
115
|
+
const summaries = await listComponents();
|
|
116
|
+
validateRegistryAgainstServerScan(summaries.map((s) => s.name));
|
|
117
|
+
} catch {
|
|
118
|
+
// server unreachable — skip validation
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
onDestroy(() => {
|
|
123
|
+
ro?.disconnect();
|
|
124
|
+
});
|
|
125
|
+
</script>
|
|
126
|
+
|
|
127
|
+
<div class="layout" class:condensed bind:this={shellEl}>
|
|
128
|
+
<nav class="sidebar" class:condensed>
|
|
129
|
+
<div class="rail-toggle-row">
|
|
130
|
+
<button
|
|
131
|
+
type="button"
|
|
132
|
+
class="rail-toggle"
|
|
133
|
+
aria-label={condensed ? 'Expand sidebar' : 'Collapse sidebar'}
|
|
134
|
+
aria-expanded={!condensed}
|
|
135
|
+
on:click={toggleCondensed}
|
|
136
|
+
>
|
|
137
|
+
<i class="fas {condensed ? 'fa-arrow-right' : 'fa-arrow-left'}"></i>
|
|
138
|
+
</button>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
<EditorViewSwitcher {condensed} />
|
|
142
|
+
|
|
143
|
+
{#if $editorView === 'tokens'}
|
|
144
|
+
<div class="nav-items">
|
|
145
|
+
{#each tokenNavItems as item}
|
|
146
|
+
<button
|
|
147
|
+
class="nav-item"
|
|
148
|
+
class:active={selectedTokenSection === item.id}
|
|
149
|
+
on:mouseenter={(e) => showHint(item.label, e.currentTarget)}
|
|
150
|
+
on:mouseleave={hideHint}
|
|
151
|
+
on:click={() => scrollToSection(item.id)}
|
|
152
|
+
>
|
|
153
|
+
<i class={item.icon}></i>
|
|
154
|
+
<span class="nav-label">{item.label}</span>
|
|
155
|
+
</button>
|
|
156
|
+
{/each}
|
|
157
|
+
</div>
|
|
158
|
+
{#if !condensed}
|
|
159
|
+
<div class="sidebar-footer">
|
|
160
|
+
<ThemeFileManager {saveStatus} on:save={handleSave} on:load={handleLoad} />
|
|
161
|
+
</div>
|
|
162
|
+
{/if}
|
|
163
|
+
{:else}
|
|
164
|
+
<div class="nav-items">
|
|
165
|
+
{#each componentNavItems as item}
|
|
166
|
+
<button
|
|
167
|
+
class="nav-item"
|
|
168
|
+
class:active={$selectedComponent === item.id}
|
|
169
|
+
on:mouseenter={(e) => showHint(item.label, e.currentTarget)}
|
|
170
|
+
on:mouseleave={hideHint}
|
|
171
|
+
on:click={() => selectComponent(item.id)}
|
|
172
|
+
>
|
|
173
|
+
<i class={item.icon}></i>
|
|
174
|
+
<span class="nav-label">{item.label}</span>
|
|
175
|
+
</button>
|
|
176
|
+
{/each}
|
|
177
|
+
</div>
|
|
178
|
+
{#if !condensed}
|
|
179
|
+
<div class="sidebar-footer">
|
|
180
|
+
<PresetFileManager />
|
|
181
|
+
</div>
|
|
182
|
+
{/if}
|
|
183
|
+
{/if}
|
|
184
|
+
</nav>
|
|
185
|
+
|
|
186
|
+
<main class="content">
|
|
187
|
+
{#if $editorView === 'tokens'}
|
|
188
|
+
<VariablesTab />
|
|
189
|
+
{:else}
|
|
190
|
+
<ComponentsTab selectedComponent={$selectedComponent} />
|
|
191
|
+
{/if}
|
|
192
|
+
</main>
|
|
193
|
+
|
|
194
|
+
{#if hintLabel !== null && condensed}
|
|
195
|
+
<div class="rail-hint" style="top: {hintTop}px">{hintLabel}</div>
|
|
196
|
+
{/if}
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<style>
|
|
200
|
+
.layout {
|
|
201
|
+
--sidebar-w: 240px;
|
|
202
|
+
display: grid;
|
|
203
|
+
grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
|
|
204
|
+
min-height: 100vh;
|
|
205
|
+
width: 100%;
|
|
206
|
+
max-width: 1920px;
|
|
207
|
+
box-sizing: border-box;
|
|
208
|
+
transition: grid-template-columns 220ms ease;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.layout.condensed {
|
|
212
|
+
--sidebar-w: 48px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.sidebar {
|
|
216
|
+
position: sticky;
|
|
217
|
+
top: 0;
|
|
218
|
+
height: 100vh;
|
|
219
|
+
overflow-y: auto;
|
|
220
|
+
overflow-x: hidden;
|
|
221
|
+
background: black;
|
|
222
|
+
border-right: 1px solid var(--ui-border-faint);
|
|
223
|
+
display: flex;
|
|
224
|
+
z-index: 1;
|
|
225
|
+
flex-direction: column;
|
|
226
|
+
min-width: 0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.rail-toggle-row {
|
|
230
|
+
display: flex;
|
|
231
|
+
justify-content: flex-end;
|
|
232
|
+
border-bottom: 1px solid var(--ui-border-faint);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.rail-toggle {
|
|
236
|
+
display: flex;
|
|
237
|
+
align-items: center;
|
|
238
|
+
justify-content: center;
|
|
239
|
+
width: 48px;
|
|
240
|
+
height: 36px;
|
|
241
|
+
background: none;
|
|
242
|
+
border: none;
|
|
243
|
+
color: var(--ui-text-primary);
|
|
244
|
+
cursor: pointer;
|
|
245
|
+
transition: background var(--ui-transition-fast);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.rail-toggle:hover {
|
|
249
|
+
background: var(--ui-hover);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.nav-items {
|
|
253
|
+
display: flex;
|
|
254
|
+
flex-direction: column;
|
|
255
|
+
gap: var(--ui-space-2);
|
|
256
|
+
padding: var(--ui-space-4) 0 var(--ui-space-16);
|
|
257
|
+
flex-shrink: 0;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.nav-item {
|
|
261
|
+
display: grid;
|
|
262
|
+
grid-template-columns: 48px 1fr;
|
|
263
|
+
align-items: center;
|
|
264
|
+
width: 100%;
|
|
265
|
+
height: 36px;
|
|
266
|
+
padding: 0;
|
|
267
|
+
background: none;
|
|
268
|
+
border: none;
|
|
269
|
+
color: var(--ui-text-tertiary);
|
|
270
|
+
font-size: var(--ui-font-size-md);
|
|
271
|
+
cursor: pointer;
|
|
272
|
+
text-align: left;
|
|
273
|
+
overflow: hidden;
|
|
274
|
+
transition: color 60ms ease, background 60ms ease;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.nav-item i {
|
|
278
|
+
justify-self: center;
|
|
279
|
+
width: 1.25rem;
|
|
280
|
+
text-align: center;
|
|
281
|
+
font-size: var(--ui-font-size-md);
|
|
282
|
+
opacity: 0.85;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.nav-label {
|
|
286
|
+
white-space: nowrap;
|
|
287
|
+
overflow: hidden;
|
|
288
|
+
opacity: 1;
|
|
289
|
+
transition: opacity 180ms ease;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.layout.condensed .nav-label {
|
|
293
|
+
opacity: 0;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.nav-item:hover {
|
|
297
|
+
color: var(--ui-text-secondary);
|
|
298
|
+
background: var(--ui-hover);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.nav-item.active {
|
|
302
|
+
color: var(--ui-text-primary);
|
|
303
|
+
background: var(--ui-surface-high);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.content {
|
|
307
|
+
padding: var(--ui-space-24) var(--ui-space-32);
|
|
308
|
+
overflow-y: auto;
|
|
309
|
+
background: black;
|
|
310
|
+
min-width: 0;
|
|
311
|
+
isolation: isolate;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
@media (max-width: 1280px) {
|
|
315
|
+
.content {
|
|
316
|
+
padding: var(--ui-space-20) var(--ui-space-20);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
@media (max-width: 1024px) {
|
|
321
|
+
.content {
|
|
322
|
+
padding: var(--ui-space-16) var(--ui-space-12);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.sidebar-footer {
|
|
327
|
+
flex-shrink: 0;
|
|
328
|
+
margin-top: auto;
|
|
329
|
+
padding: var(--ui-space-12) var(--ui-space-8) var(--ui-space-16);
|
|
330
|
+
border-top: 1px solid var(--ui-border-faint);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.rail-hint {
|
|
334
|
+
position: fixed;
|
|
335
|
+
left: calc(var(--sidebar-w) + var(--ui-space-6));
|
|
336
|
+
transform: translateY(-50%);
|
|
337
|
+
z-index: 50;
|
|
338
|
+
padding: var(--ui-space-4) var(--ui-space-8);
|
|
339
|
+
background: var(--ui-surface-low);
|
|
340
|
+
border: 1px solid var(--ui-border-default);
|
|
341
|
+
border-radius: var(--ui-radius-sm);
|
|
342
|
+
color: var(--ui-text-primary);
|
|
343
|
+
font-size: var(--ui-font-size-sm);
|
|
344
|
+
white-space: nowrap;
|
|
345
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
|
|
346
|
+
pointer-events: none;
|
|
347
|
+
}
|
|
348
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Themed padding helper.
|
|
2
|
+
//
|
|
3
|
+
// Components that expose a single `--<X>-padding` token but want to support
|
|
4
|
+
// the editor's split-into-sides mode must read four per-side overrides
|
|
5
|
+
// (`--<X>-padding-top|right|bottom|left`) and fall back to the parent token
|
|
6
|
+
// when no override is set. Spelling out that four-line var(...) pattern at
|
|
7
|
+
// every call site is noisy and easy to forget — this mixin emits it once.
|
|
8
|
+
//
|
|
9
|
+
// Optional `$h` / `$v` multipliers preserve the historical "horizontal is
|
|
10
|
+
// N× vertical" formula some components encode in their unsplit form
|
|
11
|
+
// (buttons use 2, notifications use 1.33). Pass `$v: 0` for components like
|
|
12
|
+
// TabBar's bar that hardcode zero vertical padding when unsplit.
|
|
13
|
+
//
|
|
14
|
+
// Usage:
|
|
15
|
+
// @include themed-padding(--button-primary-padding, $h: 2);
|
|
16
|
+
// @include themed-padding(--segmentedcontrol-bar-padding);
|
|
17
|
+
// @include themed-padding(--tabbar-bar-padding, $v: 0);
|
|
18
|
+
|
|
19
|
+
@function _padding-side($base, $factor) {
|
|
20
|
+
@if $factor == 1 {
|
|
21
|
+
@return var(#{$base});
|
|
22
|
+
}
|
|
23
|
+
@return calc(var(#{$base}) * #{$factor});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@mixin themed-padding($base, $h: 1, $v: 1) {
|
|
27
|
+
$h-val: _padding-side($base, $h);
|
|
28
|
+
$v-val: _padding-side($base, $v);
|
|
29
|
+
padding:
|
|
30
|
+
var(#{$base}-top, #{$v-val})
|
|
31
|
+
var(#{$base}-right, #{$h-val})
|
|
32
|
+
var(#{$base}-bottom, #{$v-val})
|
|
33
|
+
var(#{$base}-left, #{$h-val});
|
|
34
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/styles/fonts.css
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
1
|
-
/*
|
|
2
|
-
/*
|
|
3
|
-
/* Both fonts.css and fonts/ are in dist/, so use relative paths */
|
|
1
|
+
/* Generated from the production theme by syncFontsToCss. Do not edit. */
|
|
2
|
+
/* Both fonts.css and fonts/ are in dist/, so relative paths work at runtime. */
|
|
4
3
|
|
|
5
|
-
/*
|
|
4
|
+
/* Adobe Typekit — fira-code */
|
|
6
5
|
@import url('https://use.typekit.net/jes8oow.css');
|
|
7
6
|
|
|
8
|
-
/*
|
|
9
|
-
@
|
|
7
|
+
/* Local — Fraunces */
|
|
8
|
+
@font-face {
|
|
9
|
+
font-family: "Fraunces";
|
|
10
|
+
src: url('/src/styles/fonts/Fraunces/Fraunces-roman-latin.woff2') format('woff2');
|
|
11
|
+
font-weight: 100 900;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-display: swap;
|
|
14
|
+
}
|
|
15
|
+
@font-face {
|
|
16
|
+
font-family: "Fraunces";
|
|
17
|
+
src: url('/src/styles/fonts/Fraunces/Fraunces-italic-latin.woff2') format('woff2');
|
|
18
|
+
font-weight: 100 900;
|
|
19
|
+
font-style: italic;
|
|
20
|
+
font-display: swap;
|
|
21
|
+
}
|
|
10
22
|
|
|
11
|
-
/*
|
|
23
|
+
/* Local — Manrope */
|
|
12
24
|
@font-face {
|
|
13
|
-
font-family: "
|
|
14
|
-
src: url('
|
|
15
|
-
font-weight:
|
|
25
|
+
font-family: "Manrope";
|
|
26
|
+
src: url('/src/styles/fonts/Manrope/Manrope-latin.woff2') format('woff2');
|
|
27
|
+
font-weight: 200 800;
|
|
16
28
|
font-style: normal;
|
|
17
29
|
font-display: swap;
|
|
18
30
|
}
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
|
|
17
17
|
.form-label {
|
|
18
18
|
margin-bottom: 0;
|
|
19
|
-
font-size: var(--font-md);
|
|
19
|
+
font-size: var(--font-size-md);
|
|
20
20
|
color: var(--text-primary);
|
|
21
|
-
font-weight: var(--font-weight-
|
|
21
|
+
font-weight: var(--font-weight-light);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/* Horizontal Layout - Label Beside Input/Select */
|
|
@@ -63,16 +63,16 @@
|
|
|
63
63
|
padding: 0 var(--space-16);
|
|
64
64
|
min-height: 2.375rem; /* ~38px to match button height */
|
|
65
65
|
background: var(--surface-neutral-lowest) !important;
|
|
66
|
-
border: 1px solid var(--border-neutral
|
|
66
|
+
border: 1px solid var(--border-neutral) !important;
|
|
67
67
|
border-radius: var(--radius-md);
|
|
68
68
|
color: var(--text-primary) !important;
|
|
69
69
|
font-family: var(--font-sans);
|
|
70
|
-
font-size: var(--font-md);
|
|
71
|
-
font-weight: var(--font-weight-
|
|
70
|
+
font-size: var(--font-size-md);
|
|
71
|
+
font-weight: var(--font-weight-light);
|
|
72
72
|
line-height: var(--line-height-relaxed);
|
|
73
73
|
vertical-align: middle;
|
|
74
74
|
cursor: pointer;
|
|
75
|
-
transition: all var(--
|
|
75
|
+
transition: all var(--duration-150);
|
|
76
76
|
/* Prevent clipping */
|
|
77
77
|
overflow: visible !important;
|
|
78
78
|
box-sizing: border-box !important;
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
.form-select:focus-visible {
|
|
102
|
-
outline: 2px solid var(--color-
|
|
102
|
+
outline: 2px solid var(--color-brand-500);
|
|
103
103
|
outline-offset: 2px;
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -111,7 +111,6 @@
|
|
|
111
111
|
background-color: var(--surface-neutral-lowest) !important;
|
|
112
112
|
border-color: var(--border-neutral-faint) !important;
|
|
113
113
|
color: var(--text-disabled) !important;
|
|
114
|
-
opacity: var(--opacity-disabled);
|
|
115
114
|
cursor: not-allowed;
|
|
116
115
|
}
|
|
117
116
|
|
|
@@ -123,7 +122,7 @@
|
|
|
123
122
|
color: var(--text-primary) !important;
|
|
124
123
|
padding: var(--space-8) var(--space-12);
|
|
125
124
|
min-height: 2rem;
|
|
126
|
-
font-size: var(--font-md);
|
|
125
|
+
font-size: var(--font-size-md);
|
|
127
126
|
font-family: var(--font-sans);
|
|
128
127
|
line-height: var(--line-height-relaxed);
|
|
129
128
|
}
|
|
@@ -131,19 +130,18 @@
|
|
|
131
130
|
/* Disabled options */
|
|
132
131
|
.form-select option:disabled {
|
|
133
132
|
color: var(--text-disabled) !important;
|
|
134
|
-
opacity: var(--opacity-disabled);
|
|
135
133
|
}
|
|
136
134
|
|
|
137
135
|
/* Input Field Styling */
|
|
138
136
|
.form-input {
|
|
139
137
|
padding: var(--space-8);
|
|
140
138
|
background: var(--surface-neutral-lowest);
|
|
141
|
-
border: 1px solid var(--border-neutral
|
|
139
|
+
border: 1px solid var(--border-neutral);
|
|
142
140
|
border-radius: var(--radius-md);
|
|
143
141
|
color: var(--text-primary);
|
|
144
142
|
font-family: var(--font-sans);
|
|
145
|
-
font-size: var(--font-md);
|
|
146
|
-
transition: border-color var(--
|
|
143
|
+
font-size: var(--font-size-md);
|
|
144
|
+
transition: border-color var(--duration-150);
|
|
147
145
|
}
|
|
148
146
|
|
|
149
147
|
.form-input:hover:not(:disabled) {
|
|
@@ -158,14 +156,15 @@
|
|
|
158
156
|
}
|
|
159
157
|
|
|
160
158
|
.form-input:disabled {
|
|
161
|
-
|
|
159
|
+
background: var(--surface-neutral-lowest);
|
|
160
|
+
border-color: var(--border-neutral-faint);
|
|
161
|
+
color: var(--text-disabled);
|
|
162
162
|
cursor: not-allowed;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
/* Placeholder text styling */
|
|
166
166
|
.form-input::placeholder {
|
|
167
167
|
color: var(--text-muted);
|
|
168
|
-
opacity: var(--opacity-muted);
|
|
169
168
|
}
|
|
170
169
|
|
|
171
170
|
/* Number input spinner buttons */
|
|
@@ -186,5 +185,4 @@
|
|
|
186
185
|
.form-checkbox:disabled,
|
|
187
186
|
.form-radio:disabled {
|
|
188
187
|
cursor: not-allowed;
|
|
189
|
-
opacity: var(--opacity-disabled);
|
|
190
188
|
}
|