From 6a1069f9087ab790327b347d646f32503007ebc3 Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Thu, 21 May 2026 14:33:34 +0200 Subject: [PATCH] fix(form): shrink sm inputs to text-xs, align consent checkbox top - TextInput/Textarea size="sm": text-xs, tighter padding (h-9, px-2.5 py-1.5) so placeholder/value match label scale. - Checkbox: new size prop (sm = h-4 w-4 + text-xs leading-snug). Switched container to flex/items-start so multi-line labels align with checkbox top instead of vertically centering and pushing the box halfway down the paragraph. - ContactForm: consent checkbox uses size="sm"; privacy note + error hint at text-[0.7rem] leading-snug to match. Co-Authored-By: Claude Sonnet 4.6 --- .../internal/ContactFormComponent.svelte | 5 +++-- src/lib/ui/Checkbox.svelte | 16 +++++++++++++--- src/lib/ui/TextInput.svelte | 2 +- src/lib/ui/Textarea.svelte | 2 +- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/lib/components/internal/ContactFormComponent.svelte b/src/lib/components/internal/ContactFormComponent.svelte index d20d8d6..7a71522 100644 --- a/src/lib/components/internal/ContactFormComponent.svelte +++ b/src/lib/components/internal/ContactFormComponent.svelte @@ -266,14 +266,15 @@
{#if showError("consent")} - + {/if} -

{t(T.contact_privacy_note)}

+

{t(T.contact_privacy_note)}

{#if TURNSTILE_ENABLED} diff --git a/src/lib/ui/Checkbox.svelte b/src/lib/ui/Checkbox.svelte index 470fe48..cb29d4e 100644 --- a/src/lib/ui/Checkbox.svelte +++ b/src/lib/ui/Checkbox.svelte @@ -5,19 +5,29 @@ label = '', name = '', value = '', + size = 'md' as 'sm' | 'md', } = $props(); + + const boxClass = $derived( + size === 'sm' + ? 'h-4 w-4 mt-0.5 rounded-sm border-[1.5px]' + : 'h-5 w-5 rounded border-[1.5px]', + ); + const textClass = $derived( + size === 'sm' ? 'ml-2 text-xs leading-snug text-stein-700' : 'ml-2 text-base text-stein-700', + ); -