chore: new arrow key navigation (#3229)

* rebuild keyboard navigation lists
* add new keyboard navigation components
* remove references to boundless-arrow-key-navigation
* fix aria-labels on paginated lists everywhere
This commit is contained in:
Nan Yu
2022-03-15 10:36:10 -07:00
committed by GitHub
parent 093158cb11
commit d1b28499c6
18 changed files with 270 additions and 112 deletions

View File

@@ -3,7 +3,7 @@ import styled, { useTheme } from "styled-components";
import Flex from "~/components/Flex";
import NavLink from "~/components/NavLink";
type Props = {
export type Props = {
image?: React.ReactNode;
to?: string;
exact?: boolean;
@@ -63,13 +63,13 @@ const ListItem = (
}
return (
<Wrapper $border={border} $small={small} {...rest}>
<Wrapper ref={ref} $border={border} $small={small} {...rest}>
{content(false)}
</Wrapper>
);
};
const Wrapper = styled.div<{ $small?: boolean; $border?: boolean }>`
const Wrapper = styled.a<{ $small?: boolean; $border?: boolean; to?: string }>`
display: flex;
padding: ${(props) => (props.$border === false ? 0 : "8px 0")};
margin: ${(props) =>
@@ -81,6 +81,8 @@ const Wrapper = styled.div<{ $small?: boolean; $border?: boolean }>`
&:last-child {
border-bottom: 0;
}
cursor: ${({ to }) => (to ? "pointer" : "default")};
`;
const Image = styled(Flex)`