mirror of
https://github.com/remvze/moodist.git
synced 2025-09-29 15:30:49 -04:00
feat: add better aria labels
This commit is contained in:
parent
9774532308
commit
98e5021f56
@ -29,6 +29,7 @@ export function Item({
|
||||
className={styles.item}
|
||||
disabled={disabled}
|
||||
{...(href ? { href, target: '_blank' } : {})}
|
||||
aria-label={label}
|
||||
>
|
||||
<span className={styles.label}>
|
||||
<span className={styles.icon}>{icon}</span> {label}
|
||||
|
@ -4,16 +4,17 @@ import styles from './range.module.css';
|
||||
|
||||
interface RangeProps {
|
||||
id: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export function Range({ id }: RangeProps) {
|
||||
export function Range({ id, label }: RangeProps) {
|
||||
const setVolume = useSoundStore(state => state.setVolume);
|
||||
const volume = useSoundStore(state => state.sounds[id].volume);
|
||||
const isSelected = useSoundStore(state => state.sounds[id].isSelected);
|
||||
|
||||
return (
|
||||
<input
|
||||
aria-labelledby={id}
|
||||
aria-label={`${label} sound volume`}
|
||||
autoComplete="off"
|
||||
className={styles.range}
|
||||
disabled={!isSelected}
|
||||
|
@ -105,7 +105,7 @@ export function Sound({
|
||||
<div className={styles.label} id={id}>
|
||||
{label}
|
||||
</div>
|
||||
<Range id={id} />
|
||||
<Range id={id} label={label} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user