@motion-proto/live-tokens 0.6.2 → 0.7.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.
- package/README.md +14 -13
- package/dist-plugin/index.cjs +147 -136
- package/dist-plugin/index.d.cts +1 -1
- package/dist-plugin/index.d.ts +1 -1
- package/dist-plugin/index.js +145 -135
- package/package.json +25 -40
- package/src/{component-editor → editor/component-editor}/BadgeEditor.svelte +8 -82
- package/src/{component-editor → editor/component-editor}/CalloutEditor.svelte +4 -4
- package/src/{component-editor → editor/component-editor}/CardEditor.svelte +28 -76
- package/src/{component-editor → editor/component-editor}/CollapsibleSectionEditor.svelte +3 -3
- package/src/{component-editor → editor/component-editor}/CornerBadgeEditor.svelte +31 -93
- package/src/{component-editor → editor/component-editor}/DialogEditor.svelte +60 -57
- package/src/editor/component-editor/ImageEditor.svelte +30 -0
- package/src/{component-editor → editor/component-editor}/InlineEditActionsEditor.svelte +6 -4
- package/src/editor/component-editor/MenuSelectEditor.svelte +160 -0
- package/src/{component-editor → editor/component-editor}/NotificationEditor.svelte +64 -37
- package/src/{component-editor → editor/component-editor}/ProgressBarEditor.svelte +5 -4
- package/src/{component-editor → editor/component-editor}/RadioButtonEditor.svelte +3 -3
- package/src/{component-editor → editor/component-editor}/SectionDividerEditor.svelte +57 -84
- package/src/{component-editor → editor/component-editor}/SegmentedControlEditor.svelte +2 -2
- package/src/{component-editor → editor/component-editor}/StandardButtonsEditor.svelte +16 -20
- package/src/{component-editor → editor/component-editor}/TabBarEditor.svelte +9 -14
- package/src/{component-editor → editor/component-editor}/TableEditor.svelte +9 -18
- package/src/{component-editor → editor/component-editor}/TooltipEditor.svelte +11 -47
- package/src/{component-editor → editor/component-editor}/registry.ts +28 -18
- package/src/{component-editor → editor/component-editor}/scaffolding/AngleDial.svelte +2 -2
- package/src/{component-editor → editor/component-editor}/scaffolding/ComponentEditorBase.svelte +3 -51
- package/src/{component-editor → editor/component-editor}/scaffolding/ComponentFileManager.svelte +144 -416
- package/src/{component-editor → editor/component-editor}/scaffolding/ComponentFileMenu.svelte +18 -170
- package/src/{component-editor → editor/component-editor}/scaffolding/ComponentsTab.svelte +2 -2
- package/src/{component-editor → editor/component-editor}/scaffolding/CopyFromMenu.svelte +44 -4
- package/src/{component-editor → editor/component-editor}/scaffolding/DividerEditor.svelte +1 -1
- package/src/{component-editor → editor/component-editor}/scaffolding/FieldsetWrapper.svelte +1 -1
- package/src/{component-editor → editor/component-editor}/scaffolding/GradientCard.svelte +6 -6
- package/src/{component-editor → editor/component-editor}/scaffolding/LinkageChart.svelte +6 -6
- package/src/{component-editor → editor/component-editor}/scaffolding/LinkedBlock.svelte +6 -11
- package/src/editor/component-editor/scaffolding/NonStylableConfig.svelte +38 -0
- package/src/{component-editor → editor/component-editor}/scaffolding/SaveAsDialog.svelte +66 -12
- package/src/editor/component-editor/scaffolding/ShadowBackdrop.svelte +72 -0
- package/src/editor/component-editor/scaffolding/ShadowBackdropControls.svelte +132 -0
- package/src/editor/component-editor/scaffolding/StateBlock.svelte +257 -0
- package/src/{component-editor → editor/component-editor}/scaffolding/TokenLayout.svelte +9 -7
- package/src/editor/component-editor/scaffolding/VariantGroup.svelte +644 -0
- package/src/{component-editor → editor/component-editor}/scaffolding/editorContext.ts +19 -9
- package/src/{component-editor → editor/component-editor}/scaffolding/linkedBlock.ts +2 -2
- package/src/{component-editor → editor/component-editor}/scaffolding/types.ts +14 -0
- package/src/{lib → editor/core/components}/componentConfigService.ts +2 -2
- package/src/{lib → editor/core/components}/componentPersist.ts +5 -5
- package/src/editor/core/flashStatus.ts +30 -0
- package/src/{lib → editor/core/fonts}/fontLoader.ts +2 -2
- package/src/{lib → editor/core/fonts}/fontMigration.ts +4 -4
- package/src/{lib → editor/core/fonts}/fontParse.ts +1 -1
- package/src/editor/core/manifests/manifestService.ts +116 -0
- package/src/{lib → editor/core/palettes}/paletteDerivation.ts +2 -2
- package/src/{lib → editor/core/palettes}/tokenRegistry.ts +5 -5
- package/src/editor/core/productionPulse.ts +37 -0
- package/src/{lib → editor/core/routing}/router.ts +1 -1
- package/src/{lib/files/versionedFileResource.ts → editor/core/storage/files/versionedFileResourceClient.ts} +8 -1
- package/src/{lib → editor/core/store}/editorCore.ts +24 -8
- package/src/{lib → editor/core/store}/editorPersistence.ts +3 -3
- package/src/{lib → editor/core/store}/editorRenderer.ts +2 -2
- package/src/{lib → editor/core/store}/editorStore.ts +17 -17
- package/src/{lib → editor/core/store}/editorTypes.ts +1 -1
- package/src/{lib → editor/core/themes}/slices/columns.ts +2 -2
- package/src/{lib → editor/core/themes}/slices/components.ts +2 -2
- package/src/{lib → editor/core/themes}/slices/fonts.ts +1 -1
- package/src/{lib → editor/core/themes}/slices/gradients.ts +2 -2
- package/src/{lib → editor/core/themes}/slices/overlays.ts +1 -1
- package/src/{lib → editor/core/themes}/slices/palettes.ts +1 -1
- package/src/{lib → editor/core/themes}/slices/shadows.ts +3 -3
- package/src/{lib → editor/core/themes}/themeInit.ts +6 -6
- package/src/{lib → editor/core/themes}/themeService.ts +6 -6
- package/src/{lib → editor/core/themes}/themeTypes.ts +11 -7
- package/src/editor/index.ts +69 -0
- package/src/{lib → editor/overlay}/LiveEditorOverlay.svelte +79 -125
- package/src/{lib → editor/overlay}/columnsOverlay.ts +2 -2
- package/src/{pages → editor/pages}/ComponentEditorPage.svelte +12 -12
- package/src/{pages → editor/pages}/Editor.svelte +4 -4
- package/src/{pages → editor/pages}/EditorShell.svelte +18 -36
- package/src/{styles → editor/styles}/ui-editor.css +41 -21
- package/src/{styles → editor/styles}/ui-form-controls.css +8 -8
- package/src/{ui → editor/ui}/BezierCurveEditor.svelte +8 -8
- package/src/{ui → editor/ui}/ColorEditPanel.svelte +13 -13
- package/src/{ui → editor/ui}/EditorViewSwitcher.svelte +8 -6
- package/src/editor/ui/FileLoadList.svelte +350 -0
- package/src/editor/ui/FilePill.svelte +80 -0
- package/src/{ui → editor/ui}/FontStackEditor.svelte +7 -7
- package/src/{ui → editor/ui}/GradientEditor.svelte +11 -11
- package/src/{ui → editor/ui}/GradientStopPicker.svelte +1 -1
- package/src/editor/ui/ManifestFileManager.svelte +371 -0
- package/src/{ui → editor/ui}/PaletteEditor.svelte +132 -598
- package/src/{ui → editor/ui}/ProjectFontsSection.svelte +102 -144
- package/src/{ui → editor/ui}/SurfacesTab.svelte +3 -3
- package/src/{ui → editor/ui}/TextTab.svelte +3 -3
- package/src/{ui → editor/ui}/ThemeFileManager.svelte +286 -519
- package/src/{ui → editor/ui}/UICopyPopover.svelte +4 -4
- package/src/{ui → editor/ui}/UIFontFamilySelector.svelte +6 -6
- package/src/{ui → editor/ui}/UIFontSizeSelector.svelte +1 -1
- package/src/editor/ui/UIInfoPopover.svelte +244 -0
- package/src/{ui → editor/ui}/UILineHeightSelector.svelte +5 -5
- package/src/{ui → editor/ui}/UILinkToggle.svelte +2 -2
- package/src/{ui → editor/ui}/UIPaddingSelector.svelte +6 -6
- package/src/{ui → editor/ui}/UIPaletteSelector.svelte +26 -26
- package/src/editor/ui/UIPillButton.svelte +138 -0
- package/src/{ui → editor/ui}/UIRadio.svelte +2 -2
- package/src/{ui → editor/ui}/UIRelinkConfirmPopover.svelte +4 -4
- package/src/editor/ui/UISquareButton.svelte +172 -0
- package/src/{ui → editor/ui}/UITokenSelector.svelte +10 -10
- package/src/{ui → editor/ui}/UIVariantSelector.svelte +1 -1
- package/src/{ui → editor/ui}/VariablesTab.svelte +31 -8
- package/src/{ui → editor/ui}/palette/GradientStopEditor.svelte +13 -13
- package/src/{ui → editor/ui}/palette/OverridesPanel.svelte +13 -13
- package/src/{ui → editor/ui}/palette/PaletteBase.svelte +8 -5
- package/src/{ui → editor/ui}/palette/paletteEditorState.ts +1 -1
- package/src/editor/ui/palette/paletteMath.ts +275 -0
- package/src/{ui → editor/ui}/sections/ColumnsSection.svelte +137 -17
- package/src/{ui → editor/ui}/sections/GradientsSection.svelte +7 -7
- package/src/{ui → editor/ui}/sections/OverlaysSection.svelte +17 -17
- package/src/{ui → editor/ui}/sections/ShadowsSection.svelte +22 -22
- package/src/{ui → editor/ui}/sections/TokenScaleTable.svelte +3 -3
- package/src/{components → system/components}/Badge.svelte +0 -36
- package/src/{components → system/components}/Card.svelte +8 -62
- package/src/{components → system/components}/CornerBadge.svelte +8 -24
- package/src/{components → system/components}/Dialog.svelte +1 -1
- package/src/system/components/FloatingTokenTags.css +256 -0
- package/src/system/components/FloatingTokenTags.svelte +592 -0
- package/src/{components → system/components}/InlineEditActions.svelte +6 -4
- package/src/system/components/MenuSelect.svelte +229 -0
- package/src/{components → system/components}/ProgressBar.svelte +29 -11
- package/src/{components → system/components}/SegmentedControl.svelte +49 -43
- package/src/{components → system/components}/TabBar.svelte +81 -65
- package/src/{components → system/components}/Table.svelte +17 -3
- package/src/{components → system/components}/Tooltip.svelte +6 -4
- package/src/system/styles/CONVENTIONS.md +178 -0
- package/src/{styles → system/styles}/fonts.css +6 -3
- package/src/{styles → system/styles}/tokens.css +149 -29
- package/src/component-editor/ImageEditor.svelte +0 -74
- package/src/component-editor/scaffolding/NonStylableConfig.svelte +0 -62
- package/src/component-editor/scaffolding/ShadowBackdrop.svelte +0 -37
- package/src/component-editor/scaffolding/ShadowBackdropControls.svelte +0 -61
- package/src/component-editor/scaffolding/StateBlock.svelte +0 -132
- package/src/component-editor/scaffolding/VariantGroup.svelte +0 -310
- package/src/data/google-fonts.json +0 -75
- package/src/lib/index.ts +0 -68
- package/src/lib/presetService.ts +0 -214
- package/src/lib/productionPulse.ts +0 -32
- package/src/ui/PresetFileManager.svelte +0 -1116
- package/src/ui/UnsavedComponentsDialog.svelte +0 -315
- /package/src/{styles → app}/site.css +0 -0
- /package/src/{component-editor → editor/component-editor}/index.ts +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/DemoHeader.svelte +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/TypeEditor.svelte +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/buildTypeGroupTokens.ts +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/componentSectionType.ts +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/componentSources.ts +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/defaultSections.ts +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/siblings.ts +0 -0
- /package/src/{lib → editor/core/components}/componentConfigKeys.ts +0 -0
- /package/src/{lib → editor/core}/cssVarSync.ts +0 -0
- /package/src/{lib → editor/core/palettes}/oklch.ts +0 -0
- /package/src/{lib → editor/core/routing}/navLinkTypes.ts +0 -0
- /package/src/{lib → editor/core/routing}/parentRouteStore.ts +0 -0
- /package/src/{lib → editor/core/storage}/storage.ts +0 -0
- /package/src/{lib → editor/core/store}/editorConfig.ts +0 -0
- /package/src/{lib → editor/core/store}/editorConfigStore.ts +0 -0
- /package/src/{lib → editor/core/store}/editorKeybindings.ts +0 -0
- /package/src/{lib → editor/core/store}/editorViewStore.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-04-24-component-prefix-and-suffix-renames.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-04-24-legacy-keys-and-bg-to-canvas.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-04-27-segmentedcontrol-disabled-flatten.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-05-08-collapsiblesection-frame-and-cleanup.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-05-08-collapsiblesection-variant-namespace.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-05-10-sectiondivider-gradient-stops.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-05-13-primary-to-brand.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/index.ts +0 -0
- /package/src/{lib → editor/core/themes}/parsers/globalRootBlock.ts +0 -0
- /package/src/{lib → editor/core/themes}/slices/domainVars.ts +0 -0
- /package/src/{lib → editor/overlay}/ColumnsOverlay.svelte +0 -0
- /package/src/{lib → editor/overlay}/overlayState.ts +0 -0
- /package/src/{pages → editor/pages}/ComponentEditorPage.svelte.d.ts +0 -0
- /package/src/{pages → editor/pages}/Editor.svelte.d.ts +0 -0
- /package/src/{ui → editor/ui}/Toggle.svelte +0 -0
- /package/src/{ui → editor/ui}/UIDialog.svelte +0 -0
- /package/src/{ui → editor/ui}/UIFontWeightSelector.svelte +0 -0
- /package/src/{ui → editor/ui}/UIOptionItem.svelte +0 -0
- /package/src/{ui → editor/ui}/UIOptionList.svelte +0 -0
- /package/src/{ui → editor/ui}/UIRadioGroup.svelte +0 -0
- /package/src/{lib → editor/ui}/copyPopover.ts +0 -0
- /package/src/{ui → editor/ui}/curveEngine.ts +0 -0
- /package/src/{ui → editor/ui}/index.ts +0 -0
- /package/src/{ui → editor/ui}/keepInViewport.ts +0 -0
- /package/src/{ui → editor/ui}/palette/ScaleCurveEditor.svelte +0 -0
- /package/src/{lib → editor/ui}/scrollSection.ts +0 -0
- /package/src/{ui → editor/ui}/sections/tokenScales.ts +0 -0
- /package/src/{ui → editor/ui}/variantScales.ts +0 -0
- /package/src/{assets → system/assets}/newspaper.webp +0 -0
- /package/src/{assets → system/assets}/offering.webp +0 -0
- /package/src/{components → system/components}/Button.svelte +0 -0
- /package/src/{components → system/components}/Callout.svelte +0 -0
- /package/src/{components → system/components}/CollapsibleSection.svelte +0 -0
- /package/src/{components → system/components}/Image.svelte +0 -0
- /package/src/{components → system/components}/Notification.svelte +0 -0
- /package/src/{components → system/components}/RadioButton.svelte +0 -0
- /package/src/{components → system/components}/SectionDivider.svelte +0 -0
- /package/src/{components → system/components}/types.ts +0 -0
- /package/src/{styles → system/styles}/_padding.scss +0 -0
- /package/src/{styles → system/styles}/fonts/Fraunces/Fraunces-italic-latin-ext.woff2 +0 -0
- /package/src/{styles → system/styles}/fonts/Fraunces/Fraunces-italic-latin.woff2 +0 -0
- /package/src/{styles → system/styles}/fonts/Fraunces/Fraunces-roman-latin-ext.woff2 +0 -0
- /package/src/{styles → system/styles}/fonts/Fraunces/Fraunces-roman-latin.woff2 +0 -0
- /package/src/{styles → system/styles}/fonts/Manrope/Manrope-latin-ext.woff2 +0 -0
- /package/src/{styles → system/styles}/fonts/Manrope/Manrope-latin.woff2 +0 -0
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
* per-state token grid. */
|
|
21
21
|
function frameTokens(v: Variant): Token[] {
|
|
22
22
|
return [
|
|
23
|
-
|
|
23
|
+
// Padding is routed through an internal `--_divider-padding` aggregator
|
|
24
|
+
// per variant — split mode would require per-side forwarding in every
|
|
25
|
+
// variant rule. Until that lands, present single-value only.
|
|
26
|
+
{ label: 'padding', canBeLinked: true, groupKey: 'padding', variable: `--sectiondivider-${v}-padding`, splittable: false },
|
|
24
27
|
{ label: 'corner radius', canBeLinked: true, groupKey: 'radius', variable: `--sectiondivider-${v}-radius` },
|
|
25
28
|
{ label: 'border color', canBeLinked: true, groupKey: 'border', variable: `--sectiondivider-${v}-border` },
|
|
26
29
|
{ label: 'border width', canBeLinked: true, groupKey: 'border-width', variable: `--sectiondivider-${v}-border-width` },
|
|
@@ -50,6 +53,20 @@
|
|
|
50
53
|
return [...frameTokens(v), ...titleOutlineTokens(v), ...gradientTokens(v)];
|
|
51
54
|
}
|
|
52
55
|
|
|
56
|
+
/** Token list passed to VariantGroup.states + sibling builder so Copy-from
|
|
57
|
+
* iterates ALL tokens (frame + outline + gradient), not just the visible
|
|
58
|
+
* frame. Outline + gradient are flagged `hidden` so the property grid still
|
|
59
|
+
* shows only frame tokens — outline renders inside the title TypeEditor,
|
|
60
|
+
* gradient renders in GradientCard. Mismatch between this list and the
|
|
61
|
+
* sibling list would mis-align positional copy. */
|
|
62
|
+
function stateTokens(v: Variant): Token[] {
|
|
63
|
+
return [
|
|
64
|
+
...frameTokens(v),
|
|
65
|
+
...titleOutlineTokens(v).map((t) => ({ ...t, hidden: true })),
|
|
66
|
+
...gradientTokens(v).map((t) => ({ ...t, hidden: true })),
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
|
|
53
70
|
/** Two type groups per variant: title and description. The TypeEditor
|
|
54
71
|
* fieldset visually groups each color with its font-shape props. The
|
|
55
72
|
* title fieldset also nests the SVG-text outline width + color so those
|
|
@@ -122,59 +139,25 @@
|
|
|
122
139
|
</script>
|
|
123
140
|
|
|
124
141
|
<script lang="ts">
|
|
125
|
-
import
|
|
126
|
-
import SectionDivider from '../components/SectionDivider.svelte';
|
|
142
|
+
import SectionDivider from '../../system/components/SectionDivider.svelte';
|
|
127
143
|
import VariantGroup from './scaffolding/VariantGroup.svelte';
|
|
128
144
|
import ComponentEditorBase from './scaffolding/ComponentEditorBase.svelte';
|
|
129
145
|
import GradientCard from './scaffolding/GradientCard.svelte';
|
|
130
|
-
import
|
|
131
|
-
import UIPaletteSelector from '../ui/UIPaletteSelector.svelte';
|
|
132
|
-
import { editorState } from '../lib/editorStore';
|
|
133
|
-
import { setCssVar } from '../lib/cssVarSync';
|
|
146
|
+
import { editorState } from '../core/store/editorStore';
|
|
134
147
|
import { computeLinkedBlock, withLinkedDisabled } from './scaffolding/linkedBlock';
|
|
135
148
|
|
|
136
149
|
let testTitle = $state('Section Title');
|
|
137
150
|
let showDescription = $state(true);
|
|
138
151
|
let descriptionText = $state('This text is meant to provide additional context or meaning.');
|
|
139
152
|
|
|
140
|
-
const bgVar = '--backdrop-sectiondivider-surface';
|
|
141
|
-
|
|
142
|
-
onMount(() => {
|
|
143
|
-
if (!document.documentElement.style.getPropertyValue(bgVar)) {
|
|
144
|
-
setCssVar(bgVar, 'var(--surface-canvas)');
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
|
|
148
153
|
let linked = $derived(computeLinkedBlock(component, linkableContexts, allTokens, $editorState));
|
|
149
|
-
//
|
|
150
|
-
//
|
|
151
|
-
//
|
|
152
|
-
let visibleVariantTokens = $derived((v: Variant) => withLinkedDisabled(
|
|
154
|
+
// Pass the full stateTokens list (with outline/gradient hidden) so positional
|
|
155
|
+
// Copy-from covers every variable. TokenLayout filters hidden tokens from the
|
|
156
|
+
// grid render path, so the user still sees only frame tokens.
|
|
157
|
+
let visibleVariantTokens = $derived((v: Variant) => withLinkedDisabled(stateTokens(v), linked.varSet));
|
|
153
158
|
</script>
|
|
154
159
|
|
|
155
|
-
<ComponentEditorBase {component} title="Section Divider" description="Full-width section banner with display font and palette variants.
|
|
156
|
-
{#snippet config()}
|
|
157
|
-
|
|
158
|
-
<label class="text-field">
|
|
159
|
-
<span>Test title</span>
|
|
160
|
-
<input type="text" bind:value={testTitle} placeholder="Section Title" />
|
|
161
|
-
</label>
|
|
162
|
-
<label class="checkbox-field">
|
|
163
|
-
<input type="checkbox" bind:checked={showDescription} />
|
|
164
|
-
<span>Show description</span>
|
|
165
|
-
</label>
|
|
166
|
-
<label class="text-field text-field-wide">
|
|
167
|
-
<span>Description text</span>
|
|
168
|
-
<input type="text" bind:value={descriptionText} placeholder="Description text" />
|
|
169
|
-
</label>
|
|
170
|
-
<label class="backdrop-config">
|
|
171
|
-
<span>Sample background</span>
|
|
172
|
-
<div class="picker-slot">
|
|
173
|
-
<UIPaletteSelector variable={bgVar} />
|
|
174
|
-
</div>
|
|
175
|
-
</label>
|
|
176
|
-
|
|
177
|
-
{/snippet}
|
|
160
|
+
<ComponentEditorBase {component} title="Section Divider" description="Full-width section banner with display font and palette variants." tokens={allTokens} {linked} variants={variantOptions}>
|
|
178
161
|
{#each variants as v}
|
|
179
162
|
<VariantGroup
|
|
180
163
|
name={v.key}
|
|
@@ -185,17 +168,33 @@
|
|
|
185
168
|
siblings={buildSiblings(
|
|
186
169
|
variants.map((x) => x.key),
|
|
187
170
|
v.key,
|
|
188
|
-
(sv) => ({ [sv]:
|
|
171
|
+
(sv) => ({ [sv]: stateTokens(sv) }),
|
|
189
172
|
(sv) => ({ [sv]: variantTypeGroups(sv) }),
|
|
190
173
|
)}
|
|
174
|
+
backdropPadding="32px"
|
|
191
175
|
>
|
|
192
|
-
|
|
176
|
+
{#snippet canvasToolbarExtras()}
|
|
177
|
+
<hr class="canvas-toolbar-divider" />
|
|
178
|
+
<label class="toolbar-field">
|
|
179
|
+
<span>Test title</span>
|
|
180
|
+
<input type="text" class="canvas-toolbar-input" bind:value={testTitle} placeholder="Section Title" />
|
|
181
|
+
</label>
|
|
182
|
+
<label class="toolbar-check">
|
|
183
|
+
<input type="checkbox" bind:checked={showDescription} />
|
|
184
|
+
<span>Show description</span>
|
|
185
|
+
</label>
|
|
186
|
+
<label class="toolbar-field">
|
|
187
|
+
<span>Description text</span>
|
|
188
|
+
<input type="text" class="canvas-toolbar-input" bind:value={descriptionText} placeholder="Description text" />
|
|
189
|
+
</label>
|
|
190
|
+
{/snippet}
|
|
191
|
+
<div class="section-divider-stage">
|
|
193
192
|
<SectionDivider
|
|
194
193
|
title={testTitle || v.title}
|
|
195
194
|
variant={v.key}
|
|
196
195
|
description={showDescription ? descriptionText : undefined}
|
|
197
196
|
/>
|
|
198
|
-
</
|
|
197
|
+
</div>
|
|
199
198
|
{#snippet compositeControls(_stateName)}
|
|
200
199
|
<span class="gradient-section-label">Gradient</span>
|
|
201
200
|
<GradientCard {component} prefix={`--sectiondivider-${v.key}`} />
|
|
@@ -205,54 +204,28 @@
|
|
|
205
204
|
</ComponentEditorBase>
|
|
206
205
|
|
|
207
206
|
<style>
|
|
208
|
-
.
|
|
209
|
-
.checkbox-field {
|
|
207
|
+
.toolbar-check {
|
|
210
208
|
display: inline-flex;
|
|
211
209
|
align-items: center;
|
|
212
|
-
gap: var(--ui-space-
|
|
213
|
-
font-size: var(--ui-font-size-
|
|
214
|
-
color:
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
.checkbox-field {
|
|
210
|
+
gap: var(--ui-space-6);
|
|
211
|
+
font-size: var(--ui-font-size-sm);
|
|
212
|
+
color: rgba(255, 255, 255, 0.78);
|
|
218
213
|
cursor: pointer;
|
|
219
|
-
user-select: none;
|
|
220
214
|
}
|
|
221
215
|
|
|
222
|
-
.
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
.text-field input {
|
|
228
|
-
padding: var(--ui-space-4) var(--ui-space-8);
|
|
229
|
-
background: var(--ui-surface-input);
|
|
230
|
-
color: var(--ui-text-primary);
|
|
231
|
-
border: 1px solid var(--ui-border-subtle);
|
|
232
|
-
border-radius: var(--ui-radius-sm);
|
|
233
|
-
font-family: var(--ui-font-mono);
|
|
216
|
+
.toolbar-field {
|
|
217
|
+
display: flex;
|
|
218
|
+
flex-direction: column;
|
|
219
|
+
gap: var(--ui-space-4);
|
|
234
220
|
font-size: var(--ui-font-size-xs);
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.text-field-wide input {
|
|
239
|
-
min-width: 28rem;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.backdrop-config {
|
|
243
|
-
display: inline-flex;
|
|
244
|
-
align-items: center;
|
|
245
|
-
gap: var(--ui-space-8);
|
|
246
|
-
font-size: var(--ui-font-size-xs);
|
|
247
|
-
color: var(--ui-text-secondary);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.picker-slot {
|
|
251
|
-
min-width: 8rem;
|
|
221
|
+
color: rgba(255, 255, 255, 0.6);
|
|
252
222
|
}
|
|
253
223
|
|
|
254
|
-
|
|
224
|
+
/* Floor the preview width so the divider always reads as a banner, even
|
|
225
|
+
when the canvas gets cramped (e.g. on narrower editor viewports). */
|
|
226
|
+
.section-divider-stage {
|
|
255
227
|
width: 100%;
|
|
228
|
+
min-width: 32rem;
|
|
256
229
|
}
|
|
257
230
|
|
|
258
231
|
.gradient-section-label {
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
</script>
|
|
102
102
|
|
|
103
103
|
<script lang="ts">
|
|
104
|
-
import SegmentedControl from '
|
|
104
|
+
import SegmentedControl from '../../system/components/SegmentedControl.svelte';
|
|
105
105
|
import VariantGroup from './scaffolding/VariantGroup.svelte';
|
|
106
106
|
import ComponentEditorBase from './scaffolding/ComponentEditorBase.svelte';
|
|
107
|
-
import { editorState } from '../
|
|
107
|
+
import { editorState } from '../core/store/editorStore';
|
|
108
108
|
import { computeLinkedBlock, withLinkedDisabled } from './scaffolding/linkedBlock';
|
|
109
109
|
|
|
110
110
|
type Segment = { value: string; label: string; icon?: string; disabled?: boolean };
|
|
@@ -11,10 +11,8 @@
|
|
|
11
11
|
function statePrefix(v: Variant, s: StateName): string {
|
|
12
12
|
return s === 'default' ? `--button-${v}` : `--button-${v}-${s}`;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* carries the full font shape (family/weight/size/line-height); hover and
|
|
17
|
-
* disabled only override text color, so they keep just the color row. */
|
|
14
|
+
// Single text slot: typography props are peer rows, not a TypeEditor fieldset.
|
|
15
|
+
// Default carries the full font shape; hover/disabled only override text color.
|
|
18
16
|
function variantStateTokens(v: Variant, s: StateName): Token[] {
|
|
19
17
|
const p = statePrefix(v, s);
|
|
20
18
|
const tokens: Token[] = [
|
|
@@ -46,9 +44,8 @@
|
|
|
46
44
|
Object.values(variantStates(v)).flat(),
|
|
47
45
|
);
|
|
48
46
|
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
// - typography props link across all six variants.
|
|
47
|
+
// Shape props link across every variant × state (buttons share one geometry).
|
|
48
|
+
// Typography props link across all variants.
|
|
52
49
|
const linkableContexts = new Map<string, string>([
|
|
53
50
|
...variants.flatMap((v) => stateNames.flatMap((s) => [
|
|
54
51
|
[`${statePrefix(v, s)}-border-width`, `${v} ${s}`] as const,
|
|
@@ -68,11 +65,11 @@
|
|
|
68
65
|
</script>
|
|
69
66
|
|
|
70
67
|
<script lang="ts">
|
|
71
|
-
import Button from '
|
|
68
|
+
import Button from '../../system/components/Button.svelte';
|
|
72
69
|
import Toggle from '../ui/Toggle.svelte';
|
|
73
70
|
import VariantGroup from './scaffolding/VariantGroup.svelte';
|
|
74
71
|
import ComponentEditorBase from './scaffolding/ComponentEditorBase.svelte';
|
|
75
|
-
import { editorState, setComponentAlias } from '../
|
|
72
|
+
import { editorState, setComponentAlias } from '../core/store/editorStore';
|
|
76
73
|
import { computeLinkedBlock, withLinkedDisabled } from './scaffolding/linkedBlock';
|
|
77
74
|
|
|
78
75
|
let shimmerRef = $derived($editorState.components.button?.aliases['--button-shimmer']);
|
|
@@ -89,15 +86,7 @@
|
|
|
89
86
|
) as Record<string, Token[]>);
|
|
90
87
|
</script>
|
|
91
88
|
|
|
92
|
-
<ComponentEditorBase {component} title="Button" description="Reusable button component with multiple variants and sizes.
|
|
93
|
-
{#snippet config()}
|
|
94
|
-
|
|
95
|
-
<label>
|
|
96
|
-
<span>Hover shimmer</span>
|
|
97
|
-
<Toggle checked={shimmerEnabled} onchange={handleShimmerChange} />
|
|
98
|
-
</label>
|
|
99
|
-
|
|
100
|
-
{/snippet}
|
|
89
|
+
<ComponentEditorBase {component} title="Button" description="Reusable button component with multiple variants and sizes." tokens={allTokens} {linked} variants={variantOptions}>
|
|
101
90
|
{#each variants as v}
|
|
102
91
|
<VariantGroup
|
|
103
92
|
name={v}
|
|
@@ -106,8 +95,15 @@
|
|
|
106
95
|
{component}
|
|
107
96
|
columns={2}
|
|
108
97
|
siblings={buildSiblings(variants, v, variantStates)}
|
|
109
|
-
|
|
110
98
|
>
|
|
99
|
+
{#snippet extraPropertyRows(stateName)}
|
|
100
|
+
{#if stateName === 'hover'}
|
|
101
|
+
<div class="property-row">
|
|
102
|
+
<span class="property-label">hover shimmer</span>
|
|
103
|
+
<Toggle checked={shimmerEnabled} onchange={handleShimmerChange} />
|
|
104
|
+
</div>
|
|
105
|
+
{/if}
|
|
106
|
+
{/snippet}
|
|
111
107
|
{#snippet children({ activeState })}
|
|
112
108
|
{@const forceClass = activeState === 'hover' ? 'force-hover' : ''}
|
|
113
109
|
{@const isDisabled = activeState === 'disabled'}
|
|
@@ -150,7 +146,7 @@
|
|
|
150
146
|
|
|
151
147
|
.size-divider {
|
|
152
148
|
width: 1px;
|
|
153
|
-
background: var(--ui-border-
|
|
149
|
+
background: var(--ui-border-low);
|
|
154
150
|
align-self: stretch;
|
|
155
151
|
}
|
|
156
152
|
|
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
{ label: 'divider thickness', groupKey: 'bar-divider-thickness', variable: '--tabbar-bar-divider-thickness' },
|
|
38
38
|
{ label: 'indicator thickness', groupKey: 'bar-indicator-thickness', variable: '--tabbar-bar-indicator-thickness' },
|
|
39
39
|
{ label: 'space above', groupKey: 'bar-top-margin', variable: '--tabbar-bar-top-margin' },
|
|
40
|
-
|
|
40
|
+
// Consumed via `padding-bottom: var(--tabbar-bar-bottom-padding)` — a
|
|
41
|
+
// one-axis read. Splitting would produce top/left/right values that have
|
|
42
|
+
// nowhere to render.
|
|
43
|
+
{ label: 'space below tabs', groupKey: 'bar-bottom-padding', variable: '--tabbar-bar-bottom-padding', splittable: false },
|
|
41
44
|
{ label: 'space under divider', groupKey: 'bar-bottom-margin', variable: '--tabbar-bar-bottom-margin' },
|
|
42
45
|
{ label: 'tab gap', groupKey: 'tab-gap', variable: '--tabbar-tab-gap' },
|
|
43
46
|
],
|
|
@@ -81,10 +84,10 @@
|
|
|
81
84
|
</script>
|
|
82
85
|
|
|
83
86
|
<script lang="ts">
|
|
84
|
-
import TabBar from '
|
|
87
|
+
import TabBar from '../../system/components/TabBar.svelte';
|
|
85
88
|
import VariantGroup from './scaffolding/VariantGroup.svelte';
|
|
86
89
|
import ComponentEditorBase from './scaffolding/ComponentEditorBase.svelte';
|
|
87
|
-
import { editorState } from '../
|
|
90
|
+
import { editorState } from '../core/store/editorStore';
|
|
88
91
|
import { computeLinkedBlock, withLinkedDisabled } from './scaffolding/linkedBlock';
|
|
89
92
|
|
|
90
93
|
let selectedDemoTab = $state('overview');
|
|
@@ -102,7 +105,7 @@
|
|
|
102
105
|
) as Record<string, Token[]>);
|
|
103
106
|
</script>
|
|
104
107
|
|
|
105
|
-
<ComponentEditorBase {component} title="Tab Bar" description="Tab navigation with icon support and disabled state.
|
|
108
|
+
<ComponentEditorBase {component} title="Tab Bar" description="Tab navigation with icon support and disabled state." tokens={allTokens} {linked}>
|
|
106
109
|
<VariantGroup
|
|
107
110
|
name="tabbar"
|
|
108
111
|
title="Tab Bar"
|
|
@@ -115,13 +118,7 @@
|
|
|
115
118
|
{@const forceClass = activeState === 'hover tab' ? 'force-hover' : ''}
|
|
116
119
|
<TabBar tabs={demoTabs} selectedTab={selectedDemoTab} class={forceClass} on:tabChange={(e) => (selectedDemoTab = e.detail)} />
|
|
117
120
|
<div class="tab-content-demo">
|
|
118
|
-
|
|
119
|
-
<p style="margin: 0;">Overview tab content</p>
|
|
120
|
-
{:else if selectedDemoTab === 'details'}
|
|
121
|
-
<p style="margin: 0;">Details tab content</p>
|
|
122
|
-
{:else if selectedDemoTab === 'settings'}
|
|
123
|
-
<p style="margin: 0;">Settings tab content</p>
|
|
124
|
-
{/if}
|
|
121
|
+
<p style="margin: 0;">placeholder tab content</p>
|
|
125
122
|
</div>
|
|
126
123
|
{/snippet}
|
|
127
124
|
</VariantGroup>
|
|
@@ -129,11 +126,9 @@
|
|
|
129
126
|
|
|
130
127
|
<style>
|
|
131
128
|
.tab-content-demo {
|
|
129
|
+
width: 100%;
|
|
132
130
|
padding: var(--space-16);
|
|
133
131
|
color: var(--ui-text-secondary);
|
|
134
132
|
background: var(--ui-surface-low);
|
|
135
|
-
border: 1px solid var(--ui-border-faint);
|
|
136
|
-
border-top: none;
|
|
137
|
-
border-radius: 0 0 var(--radius-md) var(--radius-md);
|
|
138
133
|
}
|
|
139
134
|
</style>
|
|
@@ -3,15 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
export const component = 'table';
|
|
5
5
|
|
|
6
|
-
//
|
|
7
|
-
// a user can lock "all lines on the table" to the same swatch + weight with
|
|
8
|
-
// one move, then break out individual surfaces when needed. Every other
|
|
9
|
-
// groupKey is slot-unique so header/cell/stripe stay independent — header bg
|
|
10
|
-
// vs zebra stripe, header pad vs cell pad, header text vs cell text all
|
|
11
|
-
// serve different visual roles. (Sharing a groupKey would silently declare
|
|
12
|
-
// them as siblings without surfacing the link in the LinkedBlock.)
|
|
6
|
+
// Shared border/width groupKeys link all table lines; other groupKeys are slot-unique to keep surfaces independent.
|
|
13
7
|
const states: Record<string, Token[]> = {
|
|
14
8
|
wrapper: [
|
|
9
|
+
{ label: 'surface color', groupKey: 'wrapper-surface', variable: '--table-default-surface' },
|
|
15
10
|
{ label: 'border color', canBeLinked: true, groupKey: 'border', variable: '--table-default-border' },
|
|
16
11
|
{ label: 'border width', canBeLinked: true, groupKey: 'width', variable: '--table-default-border-width' },
|
|
17
12
|
{ label: 'corner radius', groupKey: 'radius', variable: '--table-default-radius' },
|
|
@@ -27,9 +22,10 @@
|
|
|
27
22
|
{ label: 'padding', groupKey: 'cell-padding', variable: '--table-default-cell-padding' },
|
|
28
23
|
],
|
|
29
24
|
row: [
|
|
25
|
+
{ label: 'surface color', groupKey: 'row-surface', variable: '--table-default-row-surface' },
|
|
26
|
+
{ label: 'stripe surface', groupKey: 'row-stripe-surface', variable: '--table-default-row-stripe-surface' },
|
|
30
27
|
{ label: 'divider color', canBeLinked: true, groupKey: 'border', variable: '--table-default-row-divider' },
|
|
31
28
|
{ label: 'divider width', canBeLinked: true, groupKey: 'width', variable: '--table-default-row-divider-width' },
|
|
32
|
-
{ label: 'stripe surface', groupKey: 'row-stripe-surface', variable: '--table-default-row-stripe-surface' },
|
|
33
29
|
],
|
|
34
30
|
column: [
|
|
35
31
|
{ label: 'divider color', canBeLinked: true, groupKey: 'border', variable: '--table-default-column-divider' },
|
|
@@ -37,8 +33,7 @@
|
|
|
37
33
|
],
|
|
38
34
|
};
|
|
39
35
|
|
|
40
|
-
// State name
|
|
41
|
-
// wrapper/header/row/column for each shared groupKey.
|
|
36
|
+
// State name as context label so LinkageChart rows read wrapper/header/row/column.
|
|
42
37
|
const linkableContexts = new Map<string, string>(
|
|
43
38
|
Object.entries(states).flatMap(([state, tokens]) =>
|
|
44
39
|
tokens
|
|
@@ -65,11 +60,7 @@
|
|
|
65
60
|
lineHeightVariable: '--table-default-cell-line-height',
|
|
66
61
|
}],
|
|
67
62
|
};
|
|
68
|
-
//
|
|
69
|
-
// generic `buildTypeGroupColorTokens` helper isn't used here because it
|
|
70
|
-
// derives groupKey from the variable's last-dash suffix, which collapses
|
|
71
|
-
// both `--table-...-header-text` and `--table-...-cell-text` onto a shared
|
|
72
|
-
// `text` groupKey — phantom-linking the two slots.
|
|
63
|
+
// Hand-rolled (not buildTypeGroupColorTokens) because its suffix-derived groupKey would phantom-link header-text and cell-text.
|
|
73
64
|
const typeGroupColorTokens: Token[] = [
|
|
74
65
|
{ label: 'color', groupKey: 'header-text', variable: '--table-default-header-text' },
|
|
75
66
|
{ label: 'color', groupKey: 'cell-text', variable: '--table-default-cell-text' },
|
|
@@ -93,10 +84,10 @@
|
|
|
93
84
|
</script>
|
|
94
85
|
|
|
95
86
|
<script lang="ts">
|
|
96
|
-
import Table from '
|
|
87
|
+
import Table from '../../system/components/Table.svelte';
|
|
97
88
|
import VariantGroup from './scaffolding/VariantGroup.svelte';
|
|
98
89
|
import ComponentEditorBase from './scaffolding/ComponentEditorBase.svelte';
|
|
99
|
-
import { editorState } from '../
|
|
90
|
+
import { editorState } from '../core/store/editorStore';
|
|
100
91
|
import { computeLinkedBlock, withLinkedDisabled } from './scaffolding/linkedBlock';
|
|
101
92
|
|
|
102
93
|
let linked = $derived(computeLinkedBlock(component, linkableContexts, allTokens, $editorState));
|
|
@@ -105,7 +96,7 @@
|
|
|
105
96
|
) as Record<string, Token[]>);
|
|
106
97
|
</script>
|
|
107
98
|
|
|
108
|
-
<ComponentEditorBase {component} title="Table" description="Styled wrapper around <code><table></code> with horizontal scroll on narrow viewports.
|
|
99
|
+
<ComponentEditorBase {component} title="Table" description="Styled wrapper around <code><table></code> with horizontal scroll on narrow viewports." tokens={allTokens} {linked}>
|
|
109
100
|
<VariantGroup name="table" title="Table" states={visibleStates} {typeGroups} {component}>
|
|
110
101
|
<Table>
|
|
111
102
|
<table>
|
|
@@ -40,35 +40,14 @@
|
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
42
|
<script lang="ts">
|
|
43
|
-
import
|
|
44
|
-
import Tooltip from '../components/Tooltip.svelte';
|
|
43
|
+
import Tooltip from '../../system/components/Tooltip.svelte';
|
|
45
44
|
import VariantGroup from './scaffolding/VariantGroup.svelte';
|
|
46
45
|
import ComponentEditorBase from './scaffolding/ComponentEditorBase.svelte';
|
|
47
|
-
import ShadowBackdrop from './scaffolding/ShadowBackdrop.svelte';
|
|
48
|
-
import UIPaletteSelector from '../ui/UIPaletteSelector.svelte';
|
|
49
|
-
import { setCssVar } from '../lib/cssVarSync';
|
|
50
46
|
|
|
51
|
-
const bgVar = '--backdrop-tooltip-surface';
|
|
52
47
|
const hintText = 'Helpful Hint';
|
|
53
|
-
|
|
54
|
-
onMount(() => {
|
|
55
|
-
if (!document.documentElement.style.getPropertyValue(bgVar)) {
|
|
56
|
-
setCssVar(bgVar, 'var(--surface-canvas)');
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
48
|
</script>
|
|
60
49
|
|
|
61
|
-
<ComponentEditorBase {component} title="Tooltip" description="Hover tooltip with configurable position.
|
|
62
|
-
{#snippet config()}
|
|
63
|
-
|
|
64
|
-
<label class="backdrop-config">
|
|
65
|
-
<span>Sample background</span>
|
|
66
|
-
<div class="picker-slot">
|
|
67
|
-
<UIPaletteSelector variable={bgVar} />
|
|
68
|
-
</div>
|
|
69
|
-
</label>
|
|
70
|
-
|
|
71
|
-
{/snippet}
|
|
50
|
+
<ComponentEditorBase {component} title="Tooltip" description="Hover tooltip with configurable position." tokens={allTokens}>
|
|
72
51
|
<VariantGroup
|
|
73
52
|
name="tooltip"
|
|
74
53
|
title="Tooltip"
|
|
@@ -76,16 +55,14 @@
|
|
|
76
55
|
{typeGroups}
|
|
77
56
|
{component}
|
|
78
57
|
>
|
|
79
|
-
<
|
|
80
|
-
<
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
</div>
|
|
88
|
-
</ShadowBackdrop>
|
|
58
|
+
<div class="tooltip-demo-row">
|
|
59
|
+
<Tooltip text={hintText} open>
|
|
60
|
+
<span class="tooltip-demo-target">Helpful Hint</span>
|
|
61
|
+
</Tooltip>
|
|
62
|
+
<Tooltip text={hintText} position="bottom">
|
|
63
|
+
<span class="tooltip-demo-target">Hover me</span>
|
|
64
|
+
</Tooltip>
|
|
65
|
+
</div>
|
|
89
66
|
</VariantGroup>
|
|
90
67
|
</ComponentEditorBase>
|
|
91
68
|
|
|
@@ -103,22 +80,9 @@
|
|
|
103
80
|
padding: var(--space-8) var(--space-16);
|
|
104
81
|
color: var(--ui-text-secondary);
|
|
105
82
|
font-size: var(--font-size-sm);
|
|
106
|
-
border: 1px dashed var(--ui-border-
|
|
83
|
+
border: 1px dashed var(--ui-border-low);
|
|
107
84
|
border-radius: var(--radius-sm);
|
|
108
85
|
background: transparent;
|
|
109
86
|
}
|
|
110
87
|
|
|
111
|
-
.backdrop-config {
|
|
112
|
-
display: inline-flex;
|
|
113
|
-
align-items: center;
|
|
114
|
-
gap: var(--ui-space-8);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.picker-slot {
|
|
118
|
-
min-width: 8rem;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.picker-slot :global(.ui-token-selector) {
|
|
122
|
-
width: 100%;
|
|
123
|
-
}
|
|
124
88
|
</style>
|