-
Notifications
You must be signed in to change notification settings - Fork 20
fix: improve ARIA roles, semantic HTML, and touch targets #599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -253,7 +253,7 @@ const OrchestratorList = ({ | |||||
| </Box> | ||||||
| } | ||||||
| > | ||||||
| <Box>Orchestrator</Box> | ||||||
| <Box role="button">Orchestrator</Box> | ||||||
|
||||||
| <Box role="button">Orchestrator</Box> | |
| <Box>Orchestrator</Box> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,49 +3,56 @@ import { ChevronRightIcon } from "@modulz/radix-icons"; | |
| import Link from "next/link"; | ||
|
|
||
| const PopoverLink = ({ href, children, newWindow = false }) => { | ||
| return ( | ||
| <A | ||
| as={Link} | ||
| href={href} | ||
| passHref | ||
| {...(newWindow | ||
| ? { | ||
| target: "_blank", | ||
| rel: "noopener noreferrer", | ||
| } | ||
| : {})} | ||
| css={{ | ||
| display: "flex", | ||
| alignItems: "center", | ||
| justifyContent: "space-between", | ||
| textDecoration: "none", | ||
| borderRadius: "$2", | ||
| cursor: "pointer", | ||
| marginBottom: "$1", | ||
| paddingLeft: "$3", | ||
| paddingRight: "$3", | ||
| paddingTop: "$1", | ||
| paddingBottom: "$1", | ||
| const linkStyles = { | ||
| display: "flex", | ||
| alignItems: "center", | ||
| justifyContent: "space-between", | ||
| textDecoration: "none", | ||
| borderRadius: "$2", | ||
| cursor: "pointer", | ||
| marginBottom: "$1", | ||
| paddingLeft: "$3", | ||
| paddingRight: "$3", | ||
| paddingTop: "$1", | ||
| paddingBottom: "$1", | ||
| transition: ".2s transform", | ||
| "&:last-child": { | ||
| marginBottom: 0, | ||
| }, | ||
| svg: { | ||
| transition: ".2s transform", | ||
| transform: "translateX(0px)", | ||
| }, | ||
| "&:hover": { | ||
| bc: "$neutral6", | ||
| svg: { | ||
| transition: ".2s transform", | ||
| "&:last-child": { | ||
| marginBottom: 0, | ||
| }, | ||
| svg: { | ||
| transition: ".2s transform", | ||
| transform: "translateX(0px)", | ||
| }, | ||
| "&:hover": { | ||
| bc: "$neutral6", | ||
| svg: { | ||
| transition: ".2s transform", | ||
| transform: "translateX(6px)", | ||
| }, | ||
| }, | ||
| }} | ||
| > | ||
| transform: "translateX(6px)", | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| // For external links, use regular anchor tag to avoid Next.js Link issues | ||
| if (newWindow || href.startsWith("http")) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| return ( | ||
| <A href={href} target="_blank" rel="noopener noreferrer" css={linkStyles}> | ||
| {children} | ||
| <Box | ||
| as={ChevronRightIcon} | ||
| aria-hidden="true" | ||
| css={{ marginLeft: "$2", width: 16, height: 16 }} | ||
| /> | ||
| </A> | ||
| ); | ||
| } | ||
|
|
||
| // For internal links, use Next.js Link | ||
| return ( | ||
| <A as={Link} href={href} passHref css={linkStyles}> | ||
| {children} | ||
| <Box | ||
| as={ChevronRightIcon} | ||
| aria-hidden="true" | ||
| css={{ marginLeft: "$2", width: 16, height: 16 }} | ||
| /> | ||
| </A> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,7 +122,7 @@ const Index = ({ | |
| </Box> | ||
| } | ||
| > | ||
| <Flex> | ||
| <Flex role="group"> | ||
| <Text | ||
| css={{ | ||
| fontWeight: 600, | ||
|
|
@@ -136,6 +136,7 @@ const Index = ({ | |
| {isRoundLocked ? ( | ||
| <Box | ||
| as={Cross1Icon} | ||
| aria-hidden="true" | ||
| css={{ | ||
| marginLeft: "$2", | ||
| width: 20, | ||
|
|
@@ -146,6 +147,7 @@ const Index = ({ | |
| ) : ( | ||
| <Box | ||
| as={CheckIcon} | ||
| aria-hidden="true" | ||
| css={{ | ||
| marginLeft: "$1", | ||
| width: 20, | ||
|
|
@@ -246,6 +248,7 @@ const Index = ({ | |
| </Text> | ||
| </Box> | ||
| <ExplorerTooltip | ||
| role="group" | ||
| multiline | ||
|
Comment on lines
248
to
252
|
||
| content={ | ||
| <Box> | ||
|
|
@@ -304,6 +307,7 @@ const Index = ({ | |
| </Flex> | ||
| </ExplorerTooltip> | ||
| <ExplorerTooltip | ||
| role="group" | ||
| multiline | ||
|
Comment on lines
307
to
311
|
||
| content={ | ||
| <Box> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
Boxis now rendered as a<button>, but its styles don’t reset default button UI (background, border, padding), which can cause inconsistent appearance across browsers. In this codebase, otherBox as="button"usages explicitly setbackground: "none"andborder: "none"(e.g.components/Table/Pagination.tsx:35-45). Consider applying the same reset here.