From ecc8f67fc434a6ba36acaec65e66a103f2161875 Mon Sep 17 00:00:00 2001 From: pluja Date: Thu, 22 May 2025 22:58:18 +0000 Subject: [PATCH] Release 2025-05-22-XDxe --- web/src/components/Button.astro | 25 +++++- .../components/ServicesSearchResults.astro | 82 +++++++++++++++---- 2 files changed, 87 insertions(+), 20 deletions(-) diff --git a/web/src/components/Button.astro b/web/src/components/Button.astro index 9b87bd2..74af12e 100644 --- a/web/src/components/Button.astro +++ b/web/src/components/Button.astro @@ -27,7 +27,7 @@ export type ButtonProps = Props const button = tv({ slots: { - base: 'inline-flex items-center justify-center gap-2 rounded-lg border transition-colors duration-100 focus-visible:ring-2 focus-visible:ring-current focus-visible:ring-offset-2 focus-visible:ring-offset-black focus-visible:outline-hidden', + base: 'inline-flex shrink-0 items-center justify-center gap-2 rounded-lg border transition-colors duration-100 focus-visible:ring-2 focus-visible:ring-current focus-visible:ring-offset-2 focus-visible:ring-offset-black focus-visible:outline-hidden', icon: 'size-4 shrink-0', label: 'text-left whitespace-nowrap', endIcon: 'size-4 shrink-0', @@ -52,6 +52,11 @@ const button = tv({ label: 'font-bold tracking-wider uppercase', }, }, + iconOnly: { + true: { + base: 'p-0', + }, + }, color: { black: { base: 'border-night-500 bg-night-800 hover:bg-night-900 hover:text-day-200 focus-visible:bg-night-500 text-white/50 focus-visible:text-white focus-visible:ring-white', @@ -122,12 +127,28 @@ const button = tv({ shadow: true, class: 'shadow-blue-500/30', }, + { + iconOnly: true, + size: 'sm', + class: 'w-8', + }, + { + iconOnly: true, + size: 'md', + class: 'w-9', + }, + { + iconOnly: true, + size: 'lg', + class: 'w-10', + }, ], defaultVariants: { size: 'md', color: 'black', shadow: false, disabled: false, + iconOnly: false, }, }) @@ -153,7 +174,7 @@ const { icon: iconSlot, label: labelSlot, endIcon: endIconSlot, -} = button({ size, color, shadow, disabled }) +} = button({ size, color, shadow, disabled, iconOnly: !label && !(!!icon && !!endIcon) }) const ActualTag = disabled && Tag === 'a' ? 'span' : Tag --- diff --git a/web/src/components/ServicesSearchResults.astro b/web/src/components/ServicesSearchResults.astro index 459074c..0ac294f 100644 --- a/web/src/components/ServicesSearchResults.astro +++ b/web/src/components/ServicesSearchResults.astro @@ -65,31 +65,63 @@ const extraIfIncludingCommunity = Math.max(0, (countIfIncludingCommunity ?? 0) -
- + {total.toLocaleString()} {pluralize('result', total)} + + { extraIfIncludingCommunity > 0 && ( -
@@ -207,4 +243,14 @@ const extraIfIncludingCommunity = Math.max(0, (countIfIncludingCommunity ?? 0) - ) } +
+