add ARIA tab roles, pressed states, and labels to settings dialog
This commit is contained in:
@@ -132,10 +132,12 @@ export function SettingsDialog({ open, onOpenChange }: SettingsDialogProps) {
|
|||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
|
||||||
{/* Tab bar */}
|
{/* Tab bar */}
|
||||||
<div className="flex gap-1 border-b border-border pb-2">
|
<div className="flex gap-1 border-b border-border pb-2" role="tablist" aria-label="Settings sections">
|
||||||
{TABS.map((t) => (
|
{TABS.map((t) => (
|
||||||
<Button
|
<Button
|
||||||
key={t.value}
|
key={t.value}
|
||||||
|
role="tab"
|
||||||
|
aria-selected={tab === t.value}
|
||||||
variant={tab === t.value ? "secondary" : "ghost"}
|
variant={tab === t.value ? "secondary" : "ghost"}
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => setTab(t.value)}
|
onClick={() => setTab(t.value)}
|
||||||
@@ -150,6 +152,8 @@ export function SettingsDialog({ open, onOpenChange }: SettingsDialogProps) {
|
|||||||
<AnimatePresence mode="popLayout" initial={false}>
|
<AnimatePresence mode="popLayout" initial={false}>
|
||||||
<motion.div
|
<motion.div
|
||||||
key={tab}
|
key={tab}
|
||||||
|
role="tabpanel"
|
||||||
|
aria-label={`${tab} settings`}
|
||||||
className="flex flex-col gap-5"
|
className="flex flex-col gap-5"
|
||||||
initial={{ opacity: 0 }}
|
initial={{ opacity: 0 }}
|
||||||
animate={{ opacity: 1 }}
|
animate={{ opacity: 1 }}
|
||||||
@@ -166,6 +170,7 @@ export function SettingsDialog({ open, onOpenChange }: SettingsDialogProps) {
|
|||||||
<Button
|
<Button
|
||||||
key={value}
|
key={value}
|
||||||
type="button"
|
type="button"
|
||||||
|
aria-pressed={settings.theme === value}
|
||||||
variant={settings.theme === value ? "default" : "outline"}
|
variant={settings.theme === value ? "default" : "outline"}
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => setTheme(value)}
|
onClick={() => setTheme(value)}
|
||||||
@@ -193,6 +198,7 @@ export function SettingsDialog({ open, onOpenChange }: SettingsDialogProps) {
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon-xs"
|
size="icon-xs"
|
||||||
onClick={() => setUiZoom(1)}
|
onClick={() => setUiZoom(1)}
|
||||||
|
aria-label="Reset zoom"
|
||||||
className="text-pylon-text-secondary hover:text-pylon-text"
|
className="text-pylon-text-secondary hover:text-pylon-text"
|
||||||
>
|
>
|
||||||
<RotateCcw className="size-3" />
|
<RotateCcw className="size-3" />
|
||||||
@@ -207,6 +213,7 @@ export function SettingsDialog({ open, onOpenChange }: SettingsDialogProps) {
|
|||||||
step="0.05"
|
step="0.05"
|
||||||
value={settings.uiZoom}
|
value={settings.uiZoom}
|
||||||
onChange={(e) => setUiZoom(parseFloat(e.target.value))}
|
onChange={(e) => setUiZoom(parseFloat(e.target.value))}
|
||||||
|
aria-label="UI Zoom level"
|
||||||
className="w-full accent-pylon-accent"
|
className="w-full accent-pylon-accent"
|
||||||
/>
|
/>
|
||||||
<div className="mt-1 flex justify-between font-mono text-[10px] text-pylon-text-secondary">
|
<div className="mt-1 flex justify-between font-mono text-[10px] text-pylon-text-secondary">
|
||||||
@@ -259,6 +266,7 @@ export function SettingsDialog({ open, onOpenChange }: SettingsDialogProps) {
|
|||||||
<Button
|
<Button
|
||||||
key={value}
|
key={value}
|
||||||
type="button"
|
type="button"
|
||||||
|
aria-pressed={settings.density === value}
|
||||||
variant={settings.density === value ? "default" : "outline"}
|
variant={settings.density === value ? "default" : "outline"}
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => setDensity(value)}
|
onClick={() => setDensity(value)}
|
||||||
@@ -283,6 +291,7 @@ export function SettingsDialog({ open, onOpenChange }: SettingsDialogProps) {
|
|||||||
<Button
|
<Button
|
||||||
key={String(value)}
|
key={String(value)}
|
||||||
type="button"
|
type="button"
|
||||||
|
aria-pressed={settings.reduceMotion === value}
|
||||||
variant={settings.reduceMotion === value ? "default" : "outline"}
|
variant={settings.reduceMotion === value ? "default" : "outline"}
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => setReduceMotion(value)}
|
onClick={() => setReduceMotion(value)}
|
||||||
@@ -304,6 +313,7 @@ export function SettingsDialog({ open, onOpenChange }: SettingsDialogProps) {
|
|||||||
<Button
|
<Button
|
||||||
key={value}
|
key={value}
|
||||||
type="button"
|
type="button"
|
||||||
|
aria-pressed={settings.defaultColumnWidth === value}
|
||||||
variant={settings.defaultColumnWidth === value ? "default" : "outline"}
|
variant={settings.defaultColumnWidth === value ? "default" : "outline"}
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => setDefaultColumnWidth(value)}
|
onClick={() => setDefaultColumnWidth(value)}
|
||||||
|
|||||||
Reference in New Issue
Block a user