From f511334fcfbf691227ae4e0d723b5c6d99c6ab75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20=C5=A0=C4=87eki=C4=87?= Date: Fri, 3 Jul 2026 16:17:54 +0200 Subject: [PATCH 1/7] fix(mobile): add size='touch' variant and IconButton wrapper - Add size='touch' (44dp) to the Button primitive for entry points that need a comfortable tap target. - Add an IconButton typed wrapper that requires accessibilityLabel at the type level so icon-only buttons always have a screen-reader name. --- apps/mobile/src/components/ui/button.tsx | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/apps/mobile/src/components/ui/button.tsx b/apps/mobile/src/components/ui/button.tsx index 05f3730c2d..fc9aa45daf 100644 --- a/apps/mobile/src/components/ui/button.tsx +++ b/apps/mobile/src/components/ui/button.tsx @@ -22,6 +22,7 @@ const buttonVariants = cva( sm: 'h-9 gap-1.5 rounded-md px-3', lg: 'h-11 rounded-md px-6', icon: 'h-10 w-10', + touch: 'h-11 min-w-11 px-4 py-2', }, }, defaultVariants: { @@ -47,6 +48,7 @@ const buttonTextVariants = cva('text-foreground text-sm font-semibold', { sm: '', lg: '', icon: '', + touch: '', }, }, defaultVariants: { @@ -71,5 +73,21 @@ function Button({ className, variant, size, ...props }: ButtonProps) { ); } -export { Button, buttonTextVariants, buttonVariants }; -export type { ButtonProps }; +type IconButtonProps = Omit & { + /** Required — icon-only buttons must announce their action. */ + accessibilityLabel: string; + children: React.ReactNode; +}; + +/** + * Icon-only `Button`. Requires `accessibilityLabel` at the type level so + * VoiceOver / TalkBack always has a name. Use for dense toolbars; consider + * adding `hitSlop` to reach a 44dp effective target where the visual is + * smaller than 44dp. + */ +function IconButton({ className, variant = 'outline', size = 'icon', ...props }: IconButtonProps) { + return