feat(uix): v2 demo layout (shared harness) + Button palette-color pilot
Replace the v1 demo template (which only exposed variant/size/role) with a
9-tab layout that surfaces the whole system: the full 31-scale palette on the
real `color` prop, border/shape/radius, the foundation axes
(density/scaling/mode/dir/border), the motion catalog, and the sema firma with
audible sound.
- Button `color` accepts the 31 palette scales as a REAL prop (THEMING §25.5,
the Radix `color="teal"` per-instance override), gated by the intent↔color
doctrine. PALETTE_SCALES/PaletteScale/ComponentColor/HierarchyColorRole in
eidos lib/types; soma `color` widened (layer-pure); eidos `color?:
ComponentColor`; recipe `palette-*` extended with the 31-scale cascade via
paletteScaleDecls/paletteContrastDecls (graceful fallback to primary so apps
without generated/palette.css degrade, not break). Pilot of
pendiente_color_demos.md; base.css regenerated.
- Shared harness in web/routes/uix/lib/: harness.svelte.ts (constants +
DemoTrace + signatureFor), PalettePicker, SystemAxes, MotionPanel, SemaPanel
+ uix.css primitives (swatches/firma/motion).
- Button canary rewritten to the 9-tab layout; DEMO_AUTHORING_GUIDE rewritten.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 months ago
|
|
|
|
<script lang="ts">
|
|
|
|
|
|
/**
|
|
|
|
|
|
* System axes — the FOUNDATION knobs that are not component props, applied
|
|
|
|
|
|
* to the live stage so you can see any component under any system setting:
|
|
|
|
|
|
* density · scaling (zoom) · mode (light/dark, local to the stage) · dir
|
|
|
|
|
|
* (RTL) · border-width. The page binds these and applies them to the stage
|
|
|
|
|
|
* wrapper (see the canary). Radius / shape / depth that a component exposes
|
|
|
|
|
|
* as a prop belong in the Live tab, not here.
|
|
|
|
|
|
*/
|
|
|
|
|
|
import { DENSITIES } from './harness.svelte';
|
|
|
|
|
|
|
|
|
|
|
|
let {
|
|
|
|
|
|
density = $bindable('comfortable'),
|
|
|
|
|
|
scaling = $bindable(1),
|
|
|
|
|
|
mode = $bindable('inherit'),
|
|
|
|
|
|
dir = $bindable('ltr'),
|
|
|
|
|
|
borderWidth = $bindable(1)
|
|
|
|
|
|
}: {
|
|
|
|
|
|
density?: string;
|
|
|
|
|
|
scaling?: number;
|
|
|
|
|
|
mode?: 'inherit' | 'light' | 'dark';
|
|
|
|
|
|
dir?: 'ltr' | 'rtl';
|
|
|
|
|
|
borderWidth?: number;
|
|
|
|
|
|
} = $props();
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<div data-uix-controls>
|
|
|
|
|
|
<label data-uix-control>
|
|
|
|
|
|
<span data-uix-control-label>density <span data-uix-control-hint>data-density</span></span>
|
|
|
|
|
|
<span data-uix-chips role="radiogroup">
|
|
|
|
|
|
{#each DENSITIES as d}
|
|
|
|
|
|
<button data-uix-chip data-active={density === d} onclick={() => (density = d)}>{d}</button>
|
|
|
|
|
|
{/each}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
|
|
<label data-uix-control>
|
|
|
|
|
|
<span data-uix-control-label>scaling <span data-uix-control-hint>{scaling.toFixed(2)}× · global zoom</span></span>
|
|
|
|
|
|
<input type="range" min="0.85" max="1.25" step="0.05" bind:value={scaling} />
|
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
|
|
<label data-uix-control>
|
|
|
|
|
|
<span data-uix-control-label>mode <span data-uix-control-hint>local to this stage</span></span>
|
|
|
|
|
|
<span data-uix-chips role="radiogroup">
|
|
|
|
|
|
{#each ['inherit', 'light', 'dark'] as m}
|
|
|
|
|
|
<button data-uix-chip data-active={mode === m} onclick={() => (mode = m as typeof mode)}>{m}</button>
|
|
|
|
|
|
{/each}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
|
|
<label data-uix-control>
|
|
|
|
|
|
<span data-uix-control-label>direction <span data-uix-control-hint>RTL flips logical props</span></span>
|
|
|
|
|
|
<span data-uix-chips role="radiogroup">
|
|
|
|
|
|
{#each ['ltr', 'rtl'] as d}
|
|
|
|
|
|
<button data-uix-chip data-active={dir === d} onclick={() => (dir = d as typeof dir)}>{d}</button>
|
|
|
|
|
|
{/each}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
|
|
<label data-uix-control>
|
|
|
|
|
|
<span data-uix-control-label>border width <span data-uix-control-hint>{borderWidth}px · --border-width</span></span>
|
|
|
|
|
|
<input type="range" min="0" max="4" step="0.5" bind:value={borderWidth} />
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|