Skip to content

Commit

Permalink
Add focus style for Card component. (#19367)
Browse files Browse the repository at this point in the history
  • Loading branch information
linuspahl committed May 16, 2024
1 parent d4020fd commit 825b4dc
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions graylog2-web-interface/src/components/common/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,40 @@ import { Card as MantineCard } from '@mantine/core';
const Container = styled(MantineCard)(({ theme }) => css`
background-color: ${theme.colors.cards.background};
border-color: ${theme.colors.cards.border};
&:focus {
outline: 5px auto Highlight;
outline: 5px auto -webkit-focus-ring-color;
}
`);

type Props = React.PropsWithChildren<{
className?: string,
padding?: 'sm',
id?: string,
tabIndex?: number
}>

/**
* Simple card component.
*/
const Card = ({ children, className, padding }: Props) => (
<Container className={className} shadow="sm" padding={padding} radius="md" withBorder>
const Card = ({ children, className, padding, id, tabIndex }: Props) => (
<Container className={className}
shadow="sm"
padding={padding}
radius="md"
withBorder
tabIndex={tabIndex}
id={id}>
{children}
</Container>
);

Card.defaultProps = {
className: undefined,
id: undefined,
padding: undefined,
tabIndex: undefined,
};

export default Card;

0 comments on commit 825b4dc

Please sign in to comment.