Skip to content

Commit 783dc16

Browse files
committed
fix: resolve 3 a11y test failures — contrast, mobile nav label, token input label
- Fix color contrast on /invoice/new: tab buttons used text-indigo-300/text-gray-400 (dark-only colors) on white light-mode background; add dark: variants so they meet 4.5:1 WCAG AA in both modes - Fix Stepper step labels: text-gray-200 fails contrast on white; change to text-gray-700 dark:text-gray-200 - Fix Navbar hamburger aria-label from "Open navigation menu" to "Open menu" so getByRole('button', { name: /open menu/i }) finds it - Add aria-label="Token address" directly on token input so getByLabel test is reliable regardless of i18n context - Move serverExternalPackages to experimental.serverComponentsExternalPackages (correct Next.js 14 location; removes config warning)
1 parent c35ded6 commit 783dc16

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

next.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ const { withSentryConfig } = require("@sentry/nextjs");
55

66
/** @type {import('next').NextConfig} */
77
const nextConfig = {
8-
serverExternalPackages: ["@stellar/stellar-sdk", "@vercel/blob"],
8+
experimental: {
9+
serverComponentsExternalPackages: ["@stellar/stellar-sdk", "@vercel/blob"],
10+
},
911
images: {
1012
// Recipient avatars fall back to Gravatar; served unoptimized so no image
1113
// requests are proxied through the Next.js optimizer.

src/app/invoice/new/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@ function NewInvoiceForm() {
748748
>
749749
<input
750750
type="text"
751+
aria-label="Token address"
751752
value={token}
752753
onChange={(e) => setToken(e.target.value)}
753754
onFocus={() => setFocusedField("token-address")}
@@ -1216,8 +1217,8 @@ function NewInvoiceForm() {
12161217
onClick={() => setFormMode("create")}
12171218
className={`px-4 py-2 text-sm font-medium transition-colors rounded-t-lg -mb-px border-b-2 ${
12181219
formMode === "create"
1219-
? "border-indigo-500 text-indigo-300"
1220-
: "border-transparent text-gray-400 hover:text-gray-200"
1220+
? "border-indigo-500 text-indigo-600 dark:text-indigo-300"
1221+
: "border-transparent text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200"
12211222
}`}
12221223
>
12231224
Create New

src/components/Navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default function Navbar() {
8989
<button
9090
ref={hamburgerRef}
9191
className="lg:hidden ml-1 flex items-center justify-center h-9 w-9 rounded-md text-slate-400 hover:text-white hover:bg-white/[0.06] transition-colors"
92-
aria-label="Open navigation menu"
92+
aria-label="Open menu"
9393
aria-expanded={sidebarOpen}
9494
aria-controls="mobile-sidebar"
9595
onClick={() => setSidebarOpen(true)}

src/components/ui/Stepper.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default function Stepper({ steps, onStepClick, className = "" }: StepperP
4141
className={className}
4242
>
4343
{/* Mobile: collapsed summary */}
44-
<p className="md:hidden text-sm font-medium text-gray-300">
44+
<p className="md:hidden text-sm font-medium text-gray-700 dark:text-gray-300">
4545
Step {activeIndex + 1} of {steps.length}{activeStep.label}
4646
</p>
4747

@@ -92,11 +92,13 @@ function StepMarker({
9292
step.status === "complete"
9393
? "bg-indigo-600 border-indigo-500 text-white"
9494
: step.status === "current"
95-
? "border-indigo-400 text-indigo-300"
95+
? "border-indigo-500 text-indigo-600 dark:border-indigo-400 dark:text-indigo-300"
9696
: "border-gray-700 text-gray-500";
9797

9898
const labelClass =
99-
step.status === "upcoming" ? "text-gray-500" : "text-gray-200";
99+
step.status === "upcoming"
100+
? "text-gray-500 dark:text-gray-500"
101+
: "text-gray-700 dark:text-gray-200";
100102

101103
const content = (
102104
<>

0 commit comments

Comments
 (0)