|
37 | 37 | import StylePresetRow from './StylePresetRow.svelte'; |
38 | 38 | import ColorAssignments from './ColorAssignments.svelte'; |
39 | 39 | import ShadeRamp from './ShadeRamp.svelte'; |
40 | | - import DomainPreview from './DomainPreview.svelte'; |
41 | 40 | import SmartSettings from './SmartSettings.svelte'; |
| 41 | + import HeadingEditor from './HeadingEditor.svelte'; |
| 42 | + import RadiusEditor from './RadiusEditor.svelte'; |
| 43 | + import ContainerBars from './ContainerBars.svelte'; |
42 | 44 | import Icon from './Icon.svelte'; |
43 | | - import { DOMAIN_PREVIEWS } from '../lib/domainPreviews.js'; |
44 | 45 |
|
45 | 46 | /** @type {{ domain: { id:string, label:string, icon:string, blurb:string, intro?:string, scaleIntro?:string, essentials?:string[], basicGenerators?:string[], brandColors?:boolean, docsPath?:string } }} */ |
46 | 47 | let { domain } = $props(); |
|
105 | 106 | let showColorRoles = $state(true); |
106 | 107 | let showShadeRamp = $state(false); |
107 | 108 |
|
108 | | - // Preview disclosure (open by default; for generator domains it appears below generators). |
109 | | - let showPreview = $state(true); |
110 | | -
|
111 | | - const previewSpec = $derived(DOMAIN_PREVIEWS[domain.id]); |
112 | | -
|
113 | 109 | const BRAND_PRIMARY = BRAND_COLOR_KEYS.filter((c) => ['base', 'neutral', 'primary'].includes(c.key)); |
114 | 110 | const BRAND_SECONDARY = BRAND_COLOR_KEYS.filter((c) => ['secondary', 'tertiary', 'action'].includes(c.key)); |
115 | 111 | const BRAND_STATUS = BRAND_COLOR_KEYS.filter((c) => c.group === 'status'); |
|
231 | 227 | {@render catalogue()} |
232 | 228 | {:else} |
233 | 229 |
|
234 | | - <!-- ── ZONE 1: LIVE PREVIEW (always leads the panel) ───────────────── |
235 | | - Colors: Semantic-roles swatch grid. |
236 | | - All token domains: DomainPreview card, open by default. |
237 | | - For generator domains (typography/spacing) the generators are |
238 | | - placed immediately BELOW the preview so the specimen updates in |
239 | | - direct visual response to Apply — no scrolling required. |
| 230 | + <!-- ── ZONE 1: CONTROLS (live preview now lives in the right Preview Hub) ── |
| 231 | + Colors: Semantic-roles swatch grid (editing UI, not just preview). |
| 232 | + Generators (typography/spacing): collapsible ScaleGenerator. |
| 233 | + All domains: QuickKnobs (scaling multipliers) if present. |
240 | 234 | ─────────────────────────────────────────────────────────────────────── --> |
241 | 235 |
|
242 | 236 | {#if domain.brandColors} |
243 | 237 | <details class="cfg-card panel__card panel__card--lead" bind:open={showColorRoles}> |
244 | 238 | {@render expandSummary('Semantic roles', 'How your brand colors surface')} |
245 | 239 | <ColorAssignments /> |
246 | 240 | </details> |
247 | | - <!-- Contrast/focus knobs right after the roles they control --> |
248 | 241 | {#if knobs.length} |
249 | 242 | <QuickKnobs {knobs} title="Scaling" blurb={domain.scaleIntro ?? ''} /> |
250 | 243 | {/if} |
251 | 244 |
|
252 | | - {:else if previewSpec} |
253 | | - <!-- Preview leads for every token domain — generator or not --> |
254 | | - <details class="cfg-card panel__card panel__card--lead" bind:open={showPreview}> |
255 | | - {@render expandSummary('Preview', previewSpec.blurb)} |
256 | | - <DomainPreview domain={domain.id} /> |
257 | | - </details> |
258 | | -
|
259 | | - <!-- Generator domains: scale generators immediately below the preview |
260 | | - so the specimen is in direct view while the user tunes the ramp. --> |
261 | | - {#if hasGenerators} |
262 | | - {#each generators as g (g)} |
263 | | - <ScaleGenerator kinds={[g]} /> |
264 | | - {/each} |
265 | | - <!-- Scaling knobs follow the generator controls --> |
266 | | - {#if knobs.length} |
267 | | - <QuickKnobs {knobs} title="Scaling" blurb={domain.scaleIntro ?? ''} /> |
268 | | - {/if} |
269 | | - {:else} |
270 | | - <!-- Non-generator domains: knobs follow the preview directly --> |
271 | | - {#if knobs.length} |
272 | | - <QuickKnobs {knobs} title="Scaling" blurb={domain.scaleIntro ?? ''} /> |
273 | | - {/if} |
| 245 | + {:else if hasGenerators} |
| 246 | + {#each generators as g (g)} |
| 247 | + <ScaleGenerator kinds={[g]} collapsible /> |
| 248 | + {/each} |
| 249 | + {#if knobs.length} |
| 250 | + <QuickKnobs {knobs} title="Scaling" blurb={domain.scaleIntro ?? ''} /> |
274 | 251 | {/if} |
| 252 | +
|
| 253 | + {:else if knobs.length} |
| 254 | + <QuickKnobs {knobs} title="Scaling" blurb={domain.scaleIntro ?? ''} /> |
275 | 255 | {/if} |
276 | 256 |
|
277 | 257 | <!-- ── ZONE 2: SETTINGS (inputs-first) ────────────────────────────── --> |
|
349 | 329 | <ShadeRamp /> |
350 | 330 | </details> |
351 | 331 |
|
| 332 | + {:else if domain.id === 'typography'} |
| 333 | + <!-- Heading-level tab editor replaces flat basicGroups --> |
| 334 | + <HeadingEditor /> |
| 335 | +
|
| 336 | + {:else if domain.id === 'borders'} |
| 337 | + <!-- Radius level tab editor with shape specimens --> |
| 338 | + <RadiusEditor /> |
| 339 | +
|
| 340 | + {:else if domain.id === 'layout'} |
| 341 | + <!-- Container width comparison bars --> |
| 342 | + <ContainerBars /> |
| 343 | +
|
352 | 344 | {:else if basicGroups.length} |
353 | 345 | <!-- Curated groups — each group is now a collapsible card --> |
354 | 346 | {#each basicGroups as group (group.title)} |
|
0 commit comments