[web] Domi UI: the web UI on @domi/ui v1.0.4, vendored (CPAL-1.0), with the Built on Domi credit (PR #14, squashed)
@domi/ui v1.0.4 vendored unchanged in packages/domi-ui by domi-design's tools/vendor.mjs and used as workspace:*, so the Nix build fetches nothing from Gitea (web.nix sources the folder; fetchPnpmDeps hash from the NixOS runner). Its fonts, roles (data-domi-room="ianitor", the same hex) and controls replace Ianitor's copies: Button through Ianitor's adapter (desktop sizes kept), every text field a TextField with its seal, Checkbox, Select, Segmented. Ianitor's 22 role names renamed to --domi-*. <DomiCredit /> on every screen and in About, with the CPAL section 15 note beside the source link; the README names the vendored package. Disabled buttons are natively disabled.
This commit was merged in pull request #14.
This commit is contained in:
@@ -2,10 +2,14 @@
|
||||
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||
<script lang="ts" generics="T extends string">
|
||||
// Handoff §2.10: a radio group in a fieldset; arrows move and select (native radios).
|
||||
import { Segmented as DomiSegmented } from "@domi/ui";
|
||||
|
||||
// Handoff §2.10: a few choices of one thing, with its name shown above them. The control is @domi/ui's Segmented
|
||||
// (a radio group with one Tab stop; arrows, Home and End move the choice); Ianitor keeps the visible name.
|
||||
// `name` is kept for the call sites; @domi/ui's group needs none.
|
||||
let {
|
||||
legend,
|
||||
name,
|
||||
name: _name,
|
||||
options,
|
||||
value = $bindable(),
|
||||
disabled = [],
|
||||
@@ -20,26 +24,19 @@
|
||||
describedby?: string;
|
||||
onchange?: (v: T) => void;
|
||||
} = $props();
|
||||
|
||||
const uid = $props.id();
|
||||
const choices = $derived(options.map((o) => ({ value: o.value, label: o.label, disabled: disabled.includes(o.value) })));
|
||||
</script>
|
||||
|
||||
<fieldset class="domi-field" aria-describedby={describedby}>
|
||||
<legend class="domi-field-label">{legend}</legend>
|
||||
<div class="ia-seg">
|
||||
{#each options as o (o.value)}
|
||||
<label>
|
||||
<input
|
||||
type="radio"
|
||||
{name}
|
||||
value={o.value}
|
||||
checked={value === o.value}
|
||||
disabled={disabled.includes(o.value)}
|
||||
onchange={() => {
|
||||
value = o.value;
|
||||
onchange?.(o.value);
|
||||
}}
|
||||
/>
|
||||
{o.label}
|
||||
</label>
|
||||
{/each}
|
||||
<div class="ia-field" role="group" aria-labelledby="ia-seg-{uid}" aria-describedby={describedby}>
|
||||
<span class="ia-field-label" id="ia-seg-{uid}">{legend}</span>
|
||||
<div>
|
||||
<DomiSegmented
|
||||
label={legend}
|
||||
options={choices}
|
||||
bind:value={() => value, (v) => (value = v as T)}
|
||||
onchange={(v) => onchange?.(v as T)}
|
||||
/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user