You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte-kit-vice/web/routes/uix/lib/SystemAxes.svelte

65 lines
2.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<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('auto'),
borderWidth = $bindable(1)
}: {
density?: string;
scaling?: number;
mode?: 'inherit' | 'light' | 'dark';
dir?: 'auto' | '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>auto = inherit from prefs</span></span>
<span data-uix-chips role="radiogroup">
{#each ['auto', '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>

Powered by TurnKey Linux.