From d7a84aff0dec798ee14602f4a37993e14a73e6aa Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Sat, 16 May 2026 15:31:38 +0200 Subject: [PATCH] SearchableTextBlock: animated accordion, tag counts, empty state, focus-visible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace
with Svelte-controlled accordion + slide transition (180ms) - Close all items on search/tag filter change - Live tag counts per filter showing matches for current search query - Visual empty state with reset button when no results - focus-visible ring on all interactive elements (was focus: — shows on click too) - Tag.svelte: remove ring-0, add focus-visible:ring-2 - Card.svelte: add focus-visible ring to linked cards Co-Authored-By: Claude Sonnet 4.6 --- src/lib/components/Card.svelte | 2 +- src/lib/components/Tag.svelte | 2 +- .../blocks/SearchableTextBlock.svelte | 232 +++++++++++------- 3 files changed, 151 insertions(+), 85 deletions(-) diff --git a/src/lib/components/Card.svelte b/src/lib/components/Card.svelte index fe3b2ea..4309557 100644 --- a/src/lib/components/Card.svelte +++ b/src/lib/components/Card.svelte @@ -47,7 +47,7 @@ variants: { variant: { callout: "cursor-pointer transition-colors no-underline text-inherit hover:bg-wald-100", - tile: "transition-[transform,box-shadow,border-color] duration-200 no-underline hover:-translate-y-0.5 hover:shadow-md hover:border-wald-300", + tile: "transition-[transform,box-shadow,border-color] duration-200 no-underline hover:-translate-y-0.5 hover:shadow-md hover:border-wald-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-wald-500 focus-visible:ring-offset-2", }, }, defaultVariants: { variant: "tile" }, diff --git a/src/lib/components/Tag.svelte b/src/lib/components/Tag.svelte index d386bee..0a31ad3 100644 --- a/src/lib/components/Tag.svelte +++ b/src/lib/components/Tag.svelte @@ -54,7 +54,7 @@ } const baseClass = - "inline-flex shrink-0 items-center gap-1 whitespace-nowrap border-0 py-1 px-2.5 text-[.6rem] rounded-full transition-[opacity,filter] no-underline shadow-none outline-none ring-0"; + "inline-flex shrink-0 items-center gap-1 whitespace-nowrap border-0 py-1 px-2.5 text-[.6rem] rounded-full transition-[opacity,filter] no-underline shadow-none outline-none focus-visible:ring-2 focus-visible:ring-wald-500 focus-visible:ring-offset-1"; const variantClass = $derived.by(() => { if (customColor?.trim()) { return ""; diff --git a/src/lib/components/blocks/SearchableTextBlock.svelte b/src/lib/components/blocks/SearchableTextBlock.svelte index a5d089b..7719abe 100644 --- a/src/lib/components/blocks/SearchableTextBlock.svelte +++ b/src/lib/components/blocks/SearchableTextBlock.svelte @@ -1,5 +1,7 @@