Files
ianitor/packages/ui/src/Details.svelte
T
mnovak c9aa55ec99 [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.
2026-11-23 00:52:19 +01:00

33 lines
1.0 KiB
Svelte

<!-- SPDX-License-Identifier: CPAL-1.0
- 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">
// Handoff §2.14: the technical text behind "Show details". It never holds a secret.
let { detail, reference }: { detail: string; reference?: string } = $props();
let open = $state(false);
const id = "det-" + Math.random().toString(36).slice(2, 9);
const text = $derived(detail + (reference ? `\nReference: ${reference}` : ""));
</script>
<div class="ia-details">
<button
type="button"
class="ia-link"
aria-expanded={open}
aria-controls={id}
onclick={() => (open = !open)}
>
{open ? "Hide details" : "Show details"}
</button>
{#if open}
<div {id}>
<pre>{text}</pre>
<button
type="button"
class="domi-btn small"
onclick={() => navigator.clipboard?.writeText(text)}>Copy details</button
>
</div>
{/if}
</div>