[web] The web UI: hosts, add/edit with apply progress, undo, history and restore, share links, engine switch, certificates and device installs, signing by hand, settings and tokens; smoke test counts every §4 flow's clicks
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
||||
<script lang="ts" generics="T extends string">
|
||||
// Handoff §2.10: a radio group in a fieldset; arrows move and select (native radios).
|
||||
let {
|
||||
legend,
|
||||
name,
|
||||
options,
|
||||
value = $bindable(),
|
||||
disabled = [],
|
||||
describedby,
|
||||
onchange,
|
||||
}: {
|
||||
legend: string;
|
||||
name: string;
|
||||
options: { value: T; label: string }[];
|
||||
value: T;
|
||||
disabled?: T[];
|
||||
describedby?: string;
|
||||
onchange?: (v: T) => void;
|
||||
} = $props();
|
||||
</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>
|
||||
</fieldset>
|
||||
Reference in New Issue
Block a user