Skip to content

Commit 1bb26fc

Browse files
committed
fix(a11y): add aria attributes to TokenStep
1 parent 53ee871 commit 1bb26fc

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

frontend/src/components/stream-creation/TokenStep.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,26 @@ export const TokenStep: React.FC<TokenStepProps> = ({
2121
return (
2222
<div className="space-y-4">
2323
<div>
24-
<h3 className="text-xl font-semibold mb-2">Select Token</h3>
24+
<h3 id="token-group-label" className="text-xl font-semibold mb-2">Select Token</h3>
2525
<p className="text-sm text-slate-400 mb-4">
2626
Choose the token you want to stream to the recipient.
2727
</p>
2828
</div>
2929

30-
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
30+
<div
31+
className="grid grid-cols-1 md:grid-cols-3 gap-4"
32+
role="radiogroup"
33+
aria-labelledby="token-group-label"
34+
aria-describedby={error ? "token-error" : undefined}
35+
>
3136
{TOKENS.map((token) => {
3237
const isSelected = value === token.id;
3338
return (
3439
<button
3540
key={token.id}
3641
type="button"
42+
role="radio"
43+
aria-checked={isSelected}
3744
onClick={() => onChange(token.id)}
3845
className={`p-4 rounded-lg border-2 transition-all text-left ${
3946
isSelected
@@ -68,6 +75,7 @@ export const TokenStep: React.FC<TokenStepProps> = ({
6875

6976
{error && (
7077
<p
78+
id="token-error"
7179
className="mt-2 text-sm text-red-400 flex items-center gap-1"
7280
role="alert"
7381
>

0 commit comments

Comments
 (0)