diff --git a/src/components/atoms/Button/Button.tsx b/src/components/atoms/Button/Button.tsx index 5fd6bd9..a0e3418 100644 --- a/src/components/atoms/Button/Button.tsx +++ b/src/components/atoms/Button/Button.tsx @@ -50,6 +50,7 @@ export const Button = React.forwardRef( variant={variant} size={size} disabled={loading || disabled} + aria-busy={loading || undefined} sx={[ underline && variant === 'text' && { @@ -63,12 +64,30 @@ export const Button = React.forwardRef( > {children} {loading && ( - + <> + + + Loading + + )} ); diff --git a/src/components/atoms/Card/Card.tsx b/src/components/atoms/Card/Card.tsx index 5e00b05..a7e8091 100644 --- a/src/components/atoms/Card/Card.tsx +++ b/src/components/atoms/Card/Card.tsx @@ -2,6 +2,7 @@ import React from 'react'; import MuiCard from '@mui/material/Card'; import type { CardProps as MuiCardProps } from '@mui/material/Card'; import CardContent from '@mui/material/CardContent'; +import type { Theme } from '@mui/material/styles'; // ─── Types ─────────────────────────────────────────────────────────────────── @@ -56,11 +57,17 @@ export const Card = React.forwardRef( // Map FA variant names to MUI Card variant const muiVariant = variant === 'outlined' ? 'outlined' : undefined; + // Interactive cards need keyboard operability + const interactiveProps = interactive + ? { tabIndex: 0 as const, role: 'button' as const } + : {}; + return ( ( // Focus-visible for keyboard accessibility on interactive cards interactive && { '&:focus-visible': { - outline: (theme: Record) => + outline: (theme: Theme) => `2px solid ${theme.palette.primary.main}`, outlineOffset: '2px', },