web-player: unify primitive link/button rendering, add onEscape action and self-contained AccountMenu

This commit is contained in:
2026-09-24 05:27:25 +02:00
parent 5cda7cb4c1
commit 8cb9386447
12 changed files with 103 additions and 128 deletions
@@ -4,6 +4,7 @@
import IconButton from '../primitives/IconButton.svelte';
import { fade } from 'svelte/transition';
import { pop } from '$lib/utils/transitions';
import { onEscape } from '$lib/actions/onEscape';
interface Props {
open: boolean;
@@ -48,12 +49,7 @@
}
function onWindowKeydown(event: KeyboardEvent) {
if (!open) return;
if (event.key === 'Escape') {
onClose();
return;
}
if (event.key !== 'Tab') return;
if (!open || event.key !== 'Tab') return;
const elements = focusableElements();
if (elements.length === 0) return;
const first = elements[0];
@@ -79,6 +75,7 @@
>
<div
bind:this={panel}
use:onEscape={onClose}
transition:pop={{ duration: 200 }}
class="glass-panel max-h-[85dvh] w-full glow-drift overflow-y-auto {maxWidth} rounded-panel p-5 outline-none sm:p-6 {panelClass}"
role="dialog"