diff --git a/.Jules/changelog.md b/.Jules/changelog.md index 11fc864..d2cef69 100644 --- a/.Jules/changelog.md +++ b/.Jules/changelog.md @@ -6,6 +6,9 @@ ## [Unreleased] +### Changed +- **Button Focus States:** Added consistent `focus-visible` styles to `Button` component and inline buttons (`Modal`, `Toast`, `Input`) for better keyboard navigation across both Neobrutalism and Glassmorphism themes. + ### Added - **Password Strength Meter:** Added a visual password strength indicator to the signup form. - **Features:** diff --git a/.Jules/todo.md b/.Jules/todo.md index ebb0c7a..c52bcbb 100644 --- a/.Jules/todo.md +++ b/.Jules/todo.md @@ -78,7 +78,8 @@ ### Web -- [ ] **[style]** Consistent hover/focus states across all buttons +- [x] **[style]** Consistent hover/focus states across all buttons + - Completed: 2026-03-01 - Files: `web/components/ui/Button.tsx`, usage across pages - Context: Ensure all buttons have proper hover + focus-visible styles - Impact: Professional feel, keyboard users know where they are diff --git a/web/components/ui/Button.tsx b/web/components/ui/Button.tsx index f80c514..e4678e5 100644 --- a/web/components/ui/Button.tsx +++ b/web/components/ui/Button.tsx @@ -20,7 +20,7 @@ export const Button: React.FC = ({ }) => { const { style } = useTheme(); - const baseStyles = "transition-all duration-200 font-bold flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed"; + const baseStyles = "transition-all duration-200 font-bold flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900"; const sizeStyles = { sm: "px-3 py-1.5 text-sm", @@ -31,7 +31,7 @@ export const Button: React.FC = ({ let themeStyles = ""; if (style === THEMES.NEOBRUTALISM) { - themeStyles = "border-2 border-black shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] active:translate-x-[4px] active:translate-y-[4px] active:shadow-none rounded-none uppercase tracking-wider font-mono"; + themeStyles = "border-2 border-black shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] active:translate-x-[4px] active:translate-y-[4px] active:shadow-none rounded-none uppercase tracking-wider font-mono focus-visible:ring-black dark:focus-visible:ring-white"; if (variant === 'primary') themeStyles += " bg-neo-main text-white"; if (variant === 'secondary') themeStyles += " bg-neo-second text-black"; @@ -42,10 +42,10 @@ export const Button: React.FC = ({ // Glassmorphism themeStyles = "rounded-xl backdrop-blur-md border border-white/20 shadow-lg hover:shadow-xl active:scale-95"; - if (variant === 'primary') themeStyles += " bg-gradient-to-r from-blue-500 to-purple-600 text-white shadow-blue-500/30"; - if (variant === 'secondary') themeStyles += " bg-white/10 text-white hover:bg-white/20"; - if (variant === 'danger') themeStyles += " bg-gradient-to-r from-red-500 to-pink-600 text-white shadow-red-500/30"; - if (variant === 'ghost') themeStyles += " bg-transparent border-none shadow-none hover:bg-white/10 text-current"; + if (variant === 'primary') themeStyles += " bg-gradient-to-r from-blue-500 to-purple-600 text-white shadow-blue-500/30 focus-visible:ring-blue-500"; + if (variant === 'secondary') themeStyles += " bg-white/10 text-white hover:bg-white/20 focus-visible:ring-white/50"; + if (variant === 'danger') themeStyles += " bg-gradient-to-r from-red-500 to-pink-600 text-white shadow-red-500/30 focus-visible:ring-red-500"; + if (variant === 'ghost') themeStyles += " bg-transparent border-none shadow-none hover:bg-white/10 text-current focus-visible:ring-gray-400"; } return ( diff --git a/web/components/ui/Input.tsx b/web/components/ui/Input.tsx index 80e7fff..1ef90c2 100644 --- a/web/components/ui/Input.tsx +++ b/web/components/ui/Input.tsx @@ -46,10 +46,10 @@ export const Input: React.FC = ({ label, error, className = '', type diff --git a/web/components/ui/Toast.tsx b/web/components/ui/Toast.tsx index 056ebb8..6828450 100644 --- a/web/components/ui/Toast.tsx +++ b/web/components/ui/Toast.tsx @@ -57,7 +57,7 @@ const ToastItem: React.FC<{ toast: Toast }> = ({ toast }) => {