[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,48 @@
|
||||
<!-- 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">
|
||||
import type { Snippet } from "svelte";
|
||||
import Icon from "./Icon.svelte";
|
||||
import type { IconName } from "./icons";
|
||||
|
||||
// Handoff §2.8. `live` is set only for banners that appear while the user is on the page.
|
||||
let {
|
||||
tone = "notice",
|
||||
icon,
|
||||
live,
|
||||
label,
|
||||
title,
|
||||
children,
|
||||
actions,
|
||||
ondismiss,
|
||||
}: {
|
||||
tone?: "notice" | "kept" | "down";
|
||||
icon?: IconName;
|
||||
live?: "alert" | "status";
|
||||
label?: string;
|
||||
title?: Snippet;
|
||||
children?: Snippet;
|
||||
actions?: Snippet;
|
||||
ondismiss?: () => void;
|
||||
} = $props();
|
||||
const shown: IconName = $derived(
|
||||
icon ?? (tone === "kept" ? "check" : tone === "down" ? "ring" : "clock"),
|
||||
);
|
||||
</script>
|
||||
|
||||
<section class="ia-banner {tone === 'notice' ? '' : tone}" role={live} aria-label={label}>
|
||||
<Icon name={shown} class="ia-banner-icon" />
|
||||
<div class="body">
|
||||
{#if title}<div>{@render title()}</div>{/if}
|
||||
{#if children}<div class="line2">{@render children()}</div>{/if}
|
||||
</div>
|
||||
{#if actions || ondismiss}
|
||||
<div class="actions">
|
||||
{@render actions?.()}
|
||||
{#if ondismiss}
|
||||
<button type="button" class="ia-icon-btn" aria-label="Dismiss" onclick={ondismiss}><Icon name="close" /></button>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
Reference in New Issue
Block a user