Skip to content
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

fix: a11y issues in react-dev-overlay #49460

Merged
merged 2 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const LeftRightDialogHeader: React.FC<LeftRightDialogHeaderProps> =
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<title>previous</title>
<path
d="M6.99996 1.16666L1.16663 6.99999L6.99996 12.8333M12.8333 6.99999H1.99996H12.8333Z"
stroke="currentColor"
Expand All @@ -135,6 +136,7 @@ const LeftRightDialogHeader: React.FC<LeftRightDialogHeaderProps> =
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<title>next</title>
<path
d="M6.99996 1.16666L12.8333 6.99999L6.99996 12.8333M1.16663 6.99999H12H1.16663Z"
stroke="currentColor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,12 @@ export const styles = css`
color: var(--color-ansi-red);
}

.nextjs-container-errors-body > h5:not(:first-child) {
.nextjs-container-errors-body > h2:not(:first-child) {
margin-top: calc(var(--size-gap-double) + var(--size-gap));
}
.nextjs-container-errors-body > h5 {
.nextjs-container-errors-body > h2 {
margin-bottom: var(--size-gap);
font-size: var(--size-font-big);
}

.nextjs-toast-errors-parent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const CallStackFrame: React.FC<{

return (
<div data-nextjs-call-stack-frame>
<h6 data-nextjs-frame-expanded={Boolean(frame.expanded)}>
<h3 data-nextjs-frame-expanded={Boolean(frame.expanded)}>
{f.methodName}
</h6>
</h3>
<div
data-has-source={hasSource ? 'true' : undefined}
tabIndex={hasSource ? 10 : undefined}
Expand Down Expand Up @@ -126,7 +126,7 @@ const RuntimeError: React.FC<RuntimeErrorProps> = function RuntimeError({
<React.Fragment>
{firstFrame ? (
<React.Fragment>
<h5>Source</h5>
<h2>Source</h2>
{leadingFrames.map((frame, index) => (
<CallStackFrame
key={`leading-frame-${index}-${all}`}
Expand All @@ -142,18 +142,18 @@ const RuntimeError: React.FC<RuntimeErrorProps> = function RuntimeError({

{error.componentStack ? (
<>
<h5>Component Stack</h5>
<h2>Component Stack</h2>
{error.componentStack.map((component, index) => (
<div key={index} data-nextjs-component-stack-frame>
<h6>{component}</h6>
<h3>{component}</h3>
</div>
))}
</>
) : null}

{visibleCallStackFrames.length ? (
<React.Fragment>
<h5>Call Stack</h5>
<h2>Call Stack</h2>
{visibleCallStackFrames.map((frame, index) => (
<CallStackFrame key={`call-stack-${index}-${all}`} frame={frame} />
))}
Expand Down Expand Up @@ -191,14 +191,15 @@ export const styles = css`
margin-bottom: var(--size-gap-double);
}

[data-nextjs-call-stack-frame] > h6,
[data-nextjs-component-stack-frame] > h6 {
[data-nextjs-call-stack-frame] > h3,
[data-nextjs-component-stack-frame] > h3 {
margin-top: 0;
margin-bottom: var(--size-gap);
font-family: var(--font-stack-monospace);
font-size: var(--size-font);
color: #222;
}
[data-nextjs-call-stack-frame] > h6[data-nextjs-frame-expanded='false'] {
[data-nextjs-call-stack-frame] > h3[data-nextjs-frame-expanded='false'] {
color: #666;
}
[data-nextjs-call-stack-frame] > div {
Expand Down