feat: add aria-label attributes to various components for improved accessibility

This commit is contained in:
sebseb7
2025-07-20 15:12:09 +02:00
parent a68d912c99
commit e0da7ed312
7 changed files with 18 additions and 2 deletions

View File

@@ -216,6 +216,7 @@ class AddToCartButton extends Component {
<IconButton <IconButton
color="inherit" color="inherit"
onClick={this.handleDecrement} onClick={this.handleDecrement}
aria-label="Menge verringern"
sx={{ width: "28px", borderRadius: 0, flexGrow: 1 }} sx={{ width: "28px", borderRadius: 0, flexGrow: 1 }}
> >
<RemoveIcon /> <RemoveIcon />
@@ -265,6 +266,7 @@ class AddToCartButton extends Component {
<IconButton <IconButton
color="inherit" color="inherit"
onClick={this.handleIncrement} onClick={this.handleIncrement}
aria-label="Menge erhöhen"
sx={{ width: "28px", borderRadius: 0, flexGrow: 1 }} sx={{ width: "28px", borderRadius: 0, flexGrow: 1 }}
> >
<AddIcon /> <AddIcon />
@@ -274,6 +276,7 @@ class AddToCartButton extends Component {
<IconButton <IconButton
color="inherit" color="inherit"
onClick={this.handleClearCart} onClick={this.handleClearCart}
aria-label={this.props.t ? this.props.t('cart.removeFromCart') : 'Aus dem Warenkorb entfernen'}
sx={{ sx={{
borderRadius: 0, borderRadius: 0,
"&:hover": { color: "error.light" }, "&:hover": { color: "error.light" },
@@ -287,6 +290,7 @@ class AddToCartButton extends Component {
<IconButton <IconButton
color="inherit" color="inherit"
onClick={this.toggleCart} onClick={this.toggleCart}
aria-label={this.props.t ? this.props.t('cart.openCart') : 'Warenkorb öffnen'}
sx={{ sx={{
borderRadius: 0, borderRadius: 0,
"&:hover": { color: "primary.light" }, "&:hover": { color: "primary.light" },
@@ -363,6 +367,7 @@ class AddToCartButton extends Component {
<IconButton <IconButton
color="inherit" color="inherit"
onClick={this.handleDecrement} onClick={this.handleDecrement}
aria-label="Menge verringern"
sx={{ width: "28px", borderRadius: 0, flexGrow: 1 }} sx={{ width: "28px", borderRadius: 0, flexGrow: 1 }}
> >
<RemoveIcon /> <RemoveIcon />
@@ -412,6 +417,7 @@ class AddToCartButton extends Component {
<IconButton <IconButton
color="inherit" color="inherit"
onClick={this.handleIncrement} onClick={this.handleIncrement}
aria-label="Menge erhöhen"
sx={{ width: "28px", borderRadius: 0, flexGrow: 1 }} sx={{ width: "28px", borderRadius: 0, flexGrow: 1 }}
> >
<AddIcon /> <AddIcon />
@@ -421,6 +427,7 @@ class AddToCartButton extends Component {
<IconButton <IconButton
color="inherit" color="inherit"
onClick={this.handleClearCart} onClick={this.handleClearCart}
aria-label={this.props.t ? this.props.t('cart.removeFromCart') : 'Aus dem Warenkorb entfernen'}
sx={{ sx={{
borderRadius: 0, borderRadius: 0,
"&:hover": { color: "error.light" }, "&:hover": { color: "error.light" },
@@ -434,6 +441,7 @@ class AddToCartButton extends Component {
<IconButton <IconButton
color="inherit" color="inherit"
onClick={this.toggleCart} onClick={this.toggleCart}
aria-label={this.props.t ? this.props.t('cart.openCart') : 'Warenkorb öffnen'}
sx={{ sx={{
borderRadius: 0, borderRadius: 0,
"&:hover": { color: "primary.light" }, "&:hover": { color: "primary.light" },

View File

@@ -518,7 +518,7 @@ class ChatAssistant extends Component {
<Typography component="span" color={this.state.atDatabase ? "error" : "text.disabled"} sx={{ display: 'inline' }}>🛢</Typography> <Typography component="span" color={this.state.atDatabase ? "error" : "text.disabled"} sx={{ display: 'inline' }}>🛢</Typography>
<Typography component="span" color={this.state.atWeb ? "error" : "text.disabled"} sx={{ display: 'inline' }}>🌐</Typography> <Typography component="span" color={this.state.atWeb ? "error" : "text.disabled"} sx={{ display: 'inline' }}>🌐</Typography>
</Typography> </Typography>
<IconButton onClick={onClose} size="small" sx={{ color: 'primary.contrastText' }}> <IconButton onClick={onClose} size="small" aria-label="Assistent schließen" sx={{ color: 'primary.contrastText' }}>
<CloseIcon /> <CloseIcon />
</IconButton> </IconButton>
</Box> </Box>
@@ -623,6 +623,7 @@ class ChatAssistant extends Component {
<IconButton <IconButton
color="error" color="error"
onClick={this.stopRecording} onClick={this.stopRecording}
aria-label="Aufnahme stoppen"
sx={{ ml: 1 }} sx={{ ml: 1 }}
> >
<StopIcon /> <StopIcon />
@@ -631,6 +632,7 @@ class ChatAssistant extends Component {
<IconButton <IconButton
color="primary" color="primary"
onClick={this.startRecording} onClick={this.startRecording}
aria-label="Sprachaufnahme starten"
sx={{ ml: 1 }} sx={{ ml: 1 }}
disabled={isTyping || inputsDisabled} disabled={isTyping || inputsDisabled}
> >
@@ -641,6 +643,7 @@ class ChatAssistant extends Component {
<IconButton <IconButton
color="primary" color="primary"
onClick={this.handleImageUpload} onClick={this.handleImageUpload}
aria-label="Bild hochladen"
sx={{ ml: 1 }} sx={{ ml: 1 }}
disabled={isTyping || isRecording || inputsDisabled} disabled={isTyping || isRecording || inputsDisabled}
> >

View File

@@ -267,7 +267,7 @@ class Filter extends Component {
)} )}
</Typography> </Typography>
{isXsScreen && ( {isXsScreen && (
<IconButton size="small" sx={{ p: 0 }}> <IconButton size="small" aria-label={isCollapsed ? "Filter erweitern" : "Filter einklappen"} sx={{ p: 0 }}>
{isCollapsed ? <ExpandMoreIcon /> : <ExpandLessIcon />} {isCollapsed ? <ExpandMoreIcon /> : <ExpandLessIcon />}
</IconButton> </IconButton>
)} )}

View File

@@ -389,6 +389,7 @@ class Product extends Component {
component={Link} component={Link}
to={`/Artikel/${seoName}`} to={`/Artikel/${seoName}`}
size="small" size="small"
aria-label="Produktdetails anzeigen"
sx={{ mr: 1, color: 'text.secondary' }} sx={{ mr: 1, color: 'text.secondary' }}
> >
<ZoomInIcon /> <ZoomInIcon />

View File

@@ -131,6 +131,7 @@ class ButtonGroup extends Component {
<IconButton <IconButton
color="inherit" color="inherit"
onClick={this.toggleCart} onClick={this.toggleCart}
aria-label="Warenkorb öffnen"
sx={{ ml: 1 }} sx={{ ml: 1 }}
> >
<Badge badgeContent={this.state.badgeNumber} color="error"> <Badge badgeContent={this.state.badgeNumber} color="error">
@@ -156,6 +157,7 @@ class ButtonGroup extends Component {
<IconButton <IconButton
onClick={this.toggleCart} onClick={this.toggleCart}
size="small" size="small"
aria-label="Warenkorb schließen"
sx={{ sx={{
bgcolor: 'primary.main', bgcolor: 'primary.main',
color: 'primary.contrastText', color: 'primary.contrastText',

View File

@@ -261,6 +261,7 @@ const SearchBar = () => {
<IconButton <IconButton
size="small" size="small"
onClick={handleEnterClick} onClick={handleEnterClick}
aria-label="Suche starten"
sx={{ sx={{
ml: loadingSuggestions ? 0.5 : 0, ml: loadingSuggestions ? 0.5 : 0,
p: 0.5, p: 0.5,

View File

@@ -382,6 +382,7 @@ class SettingsTab extends Component {
{this.state.apiKeyDisplay !== '************' && this.state.apiKey && ( {this.state.apiKeyDisplay !== '************' && this.state.apiKey && (
<IconButton <IconButton
onClick={this.handleCopyToClipboard} onClick={this.handleCopyToClipboard}
aria-label={this.props.t ? this.props.t('settings.copyToClipboard') : 'In Zwischenablage kopieren'}
sx={{ sx={{
color: '#2e7d32', color: '#2e7d32',
'&:hover': { bgcolor: 'rgba(46, 125, 50, 0.1)' } '&:hover': { bgcolor: 'rgba(46, 125, 50, 0.1)' }