fix(a11y): corriger accessibilité pages login et register
- Améliorer le contraste des labels (text-gray-700 → text-gray-900) - Ajouter aria-label sur les boutons show/hide password - Ajouter aria-hidden sur les icônes SVG décoratives - Ajouter sr-only pour les champs obligatoires 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
6b03ad8053
commit
788b2a17e7
|
|
@ -116,8 +116,9 @@ export default function LoginPage() {
|
|||
|
||||
{/* Email */}
|
||||
<div>
|
||||
<label htmlFor="email" className="block text-sm font-semibold text-gray-700 mb-2">
|
||||
Email <span className="text-red-500">*</span>
|
||||
<label htmlFor="email" className="block text-sm font-semibold text-gray-900 mb-2">
|
||||
Email <span className="text-red-500" aria-hidden="true">*</span>
|
||||
<span className="sr-only">(obligatoire)</span>
|
||||
</label>
|
||||
<input
|
||||
id="email"
|
||||
|
|
@ -133,8 +134,9 @@ export default function LoginPage() {
|
|||
|
||||
{/* Password */}
|
||||
<div>
|
||||
<label htmlFor="password" className="block text-sm font-semibold text-gray-700 mb-2">
|
||||
Mot de passe <span className="text-red-500">*</span>
|
||||
<label htmlFor="password" className="block text-sm font-semibold text-gray-900 mb-2">
|
||||
Mot de passe <span className="text-red-500" aria-hidden="true">*</span>
|
||||
<span className="sr-only">(obligatoire)</span>
|
||||
</label>
|
||||
<div className="relative">
|
||||
<input
|
||||
|
|
@ -148,13 +150,14 @@ export default function LoginPage() {
|
|||
type="button"
|
||||
onClick={() => setShowPassword(!showPassword)}
|
||||
className="absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700"
|
||||
aria-label={showPassword ? "Masquer le mot de passe" : "Afficher le mot de passe"}
|
||||
>
|
||||
{showPassword ? (
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />
|
||||
</svg>
|
||||
) : (
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
|
||||
</svg>
|
||||
|
|
|
|||
|
|
@ -136,8 +136,9 @@ export default function RegisterPage() {
|
|||
{/* Prénom et Nom */}
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label htmlFor="firstName" className="block text-sm font-semibold text-gray-700 mb-2">
|
||||
Prénom <span className="text-red-500">*</span>
|
||||
<label htmlFor="firstName" className="block text-sm font-semibold text-gray-900 mb-2">
|
||||
Prénom <span className="text-red-500" aria-hidden="true">*</span>
|
||||
<span className="sr-only">(obligatoire)</span>
|
||||
</label>
|
||||
<input
|
||||
id="firstName"
|
||||
|
|
@ -152,8 +153,9 @@ export default function RegisterPage() {
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<label htmlFor="lastName" className="block text-sm font-semibold text-gray-700 mb-2">
|
||||
Nom <span className="text-red-500">*</span>
|
||||
<label htmlFor="lastName" className="block text-sm font-semibold text-gray-900 mb-2">
|
||||
Nom <span className="text-red-500" aria-hidden="true">*</span>
|
||||
<span className="sr-only">(obligatoire)</span>
|
||||
</label>
|
||||
<input
|
||||
id="lastName"
|
||||
|
|
@ -170,8 +172,9 @@ export default function RegisterPage() {
|
|||
|
||||
{/* Email */}
|
||||
<div>
|
||||
<label htmlFor="email" className="block text-sm font-semibold text-gray-700 mb-2">
|
||||
Email <span className="text-red-500">*</span>
|
||||
<label htmlFor="email" className="block text-sm font-semibold text-gray-900 mb-2">
|
||||
Email <span className="text-red-500" aria-hidden="true">*</span>
|
||||
<span className="sr-only">(obligatoire)</span>
|
||||
</label>
|
||||
<div className="relative">
|
||||
<input
|
||||
|
|
@ -224,8 +227,8 @@ export default function RegisterPage() {
|
|||
|
||||
{/* Téléphone */}
|
||||
<div>
|
||||
<label htmlFor="phone" className="block text-sm font-semibold text-gray-700 mb-2">
|
||||
Téléphone
|
||||
<label htmlFor="phone" className="block text-sm font-semibold text-gray-900 mb-2">
|
||||
Téléphone <span className="sr-only">(optionnel)</span>
|
||||
</label>
|
||||
<input
|
||||
id="phone"
|
||||
|
|
@ -242,8 +245,9 @@ export default function RegisterPage() {
|
|||
|
||||
{/* Mot de passe */}
|
||||
<div>
|
||||
<label htmlFor="password" className="block text-sm font-semibold text-gray-700 mb-2">
|
||||
Mot de passe <span className="text-red-500">*</span>
|
||||
<label htmlFor="password" className="block text-sm font-semibold text-gray-900 mb-2">
|
||||
Mot de passe <span className="text-red-500" aria-hidden="true">*</span>
|
||||
<span className="sr-only">(obligatoire)</span>
|
||||
</label>
|
||||
<div className="relative">
|
||||
<input
|
||||
|
|
@ -257,20 +261,21 @@ export default function RegisterPage() {
|
|||
type="button"
|
||||
onClick={() => setShowPassword(!showPassword)}
|
||||
className="absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700"
|
||||
aria-label={showPassword ? "Masquer le mot de passe" : "Afficher le mot de passe"}
|
||||
>
|
||||
{showPassword ? (
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />
|
||||
</svg>
|
||||
) : (
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
|
||||
</svg>
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
<p className="mt-1 text-xs text-gray-500">Min. 8 caractères, 1 majuscule, 1 minuscule, 1 chiffre</p>
|
||||
<p className="mt-1 text-xs text-gray-600">Min. 8 caractères, 1 majuscule, 1 minuscule, 1 chiffre</p>
|
||||
{errors.password && (
|
||||
<p className="mt-1 text-sm text-red-500">{errors.password.message}</p>
|
||||
)}
|
||||
|
|
@ -278,8 +283,9 @@ export default function RegisterPage() {
|
|||
|
||||
{/* Confirmer mot de passe */}
|
||||
<div>
|
||||
<label htmlFor="confirmPassword" className="block text-sm font-semibold text-gray-700 mb-2">
|
||||
Confirmer le mot de passe <span className="text-red-500">*</span>
|
||||
<label htmlFor="confirmPassword" className="block text-sm font-semibold text-gray-900 mb-2">
|
||||
Confirmer le mot de passe <span className="text-red-500" aria-hidden="true">*</span>
|
||||
<span className="sr-only">(obligatoire)</span>
|
||||
</label>
|
||||
<div className="relative">
|
||||
<input
|
||||
|
|
@ -293,13 +299,14 @@ export default function RegisterPage() {
|
|||
type="button"
|
||||
onClick={() => setShowConfirmPassword(!showConfirmPassword)}
|
||||
className="absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700"
|
||||
aria-label={showConfirmPassword ? "Masquer la confirmation du mot de passe" : "Afficher la confirmation du mot de passe"}
|
||||
>
|
||||
{showConfirmPassword ? (
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />
|
||||
</svg>
|
||||
) : (
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
|
||||
</svg>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user