Skip to content

Commit f704e37

Browse files
committed
feat: add accessibility attributes to buttons in CopyButton, Navbar, and SchemaSearch components
1 parent 2f58900 commit f704e37

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/components/CopyButton.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ const CopyButton = ({
6363
onMouseEnter={handleMouseEnter}
6464
onMouseLeave={handleMouseLeave}
6565
className="hover:before:bg-muted active:before:bg-secondary relative z-0 -mx-1 -my-1 flex items-center gap-1 px-1 py-1 transition-colors before:absolute before:inset-0 before:-z-10 before:rounded-lg before:duration-200 active:before:scale-x-[0.98] active:before:scale-y-[0.94]"
66+
id="copy-button"
67+
type="button"
68+
aria-label="Copy"
6669
>
6770
{buttonText && <span className="mr-1 text-sm">{buttonText}</span>}
6871
<Copy className="size-4 flex-none" />

src/components/navbar/NavBar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ export function Navbar() {
5050

5151
<button
5252
type="button"
53+
id="logout-button"
54+
aria-label="Logout"
5355
className="hover:drop-shadow-link-hover p-1"
5456
onClick={() => logout()}
5557
>
@@ -93,6 +95,8 @@ export function Navbar() {
9395

9496
<button
9597
type="button"
98+
id="logout-button"
99+
aria-label="Logout"
96100
className="hover:drop-shadow-link-hover p-1"
97101
onClick={() => logout()}
98102
>

src/modules/datasets/SchemaSearch.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export function SchemaSearch({
4646
return (
4747
<div className="rounded-2xl border">
4848
<button
49+
id="schema-search-button"
50+
aria-label="Toggle schema search filters"
4951
className={cn('flex w-full items-center gap-2 px-10 py-6 duration-200')}
5052
onClick={() => setIsOpen(!isOpen)}
5153
>
@@ -103,7 +105,12 @@ export function SchemaSearch({
103105
>
104106
<span className={cn('inline-block')}>{schema.path}</span>
105107
<span className={cn('inline-block')}>: {schema.type}</span>
106-
<button onClick={() => onRemoveFilter(index)}>
108+
<button
109+
type="button"
110+
id={`remove-filter-${index}`}
111+
aria-label={`Remove filter ${schema.path} of type ${schema.type}`}
112+
onClick={() => onRemoveFilter(index)}
113+
>
107114
<X className="ml-1" size={12} />
108115
</button>
109116
</span>

0 commit comments

Comments
 (0)