5.5: <x-password-input> + 6 Auth-Passwortfelder umgestellt

Self-contained Alpine-Toggle (Anzeigen/Verbergen) pro Feld; Props name/label/
autocomplete/placeholder/required/autofocus/show-error, id default auth-<name>,
Slot :labelAction fuer den 'Passwort vergessen?'-Link (login). Ersetzt die
field-pw-wrap-Bloecke in login, register (2), reset-password (2), confirm-
password (1). Die nun ungenutzten form-level x-data={showPassword...} entfernt.

Nebeneffekt/Bugfix: register+reset nutzten :placeholder="__(...)" auf rohem
<input> -> wurde als Alpine-Bind woertlich ausgegeben und schlug fehl (leerer
Platzhalter). Als Component-Prop wird __() korrekt in PHP aufgeloest, der
Hinweistext (z. B. 'Mindestens 8 Zeichen') erscheint jetzt.

Bestaetigungsfelder ohne Fehleranzeige (show-error=false, wie zuvor).
116 Auth-Tests gruen, alle Views kompilieren.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-07-02 09:04:26 +00:00
parent 1729e35943
commit 9fadfe6458
5 changed files with 112 additions and 143 deletions

View file

@ -56,7 +56,7 @@ new #[Layout('components.layouts.auth.pressekonto', ['heading' => 'Konto erstell
<div>
<x-session-status class="mb-4" />
<form wire:submit="register" class="space-y-[18px]" x-data="{ showPassword: false, showPasswordConfirmation: false }" novalidate>
<form wire:submit="register" class="space-y-[18px]" novalidate>
<div>
<label class="field-label" for="auth-name">{{ __('Name') }}</label>
@ -93,51 +93,20 @@ new #[Layout('components.layouts.auth.pressekonto', ['heading' => 'Konto erstell
@enderror
</div>
<div>
<label class="field-label" for="auth-password">{{ __('Passwort') }}</label>
<div class="field-pw-wrap">
<input
id="auth-password"
wire:model="password"
:type="showPassword ? 'text' : 'password'"
required
autocomplete="new-password"
class="field-input pr-[72px]"
:placeholder="__('Mindestens 8 Zeichen')"
@error('password') aria-invalid="true" @enderror
/>
<button
type="button"
class="field-affix"
@click="showPassword = !showPassword"
x-text="showPassword ? '{{ __('Verbergen') }}' : '{{ __('Anzeigen') }}'"
>{{ __('Anzeigen') }}</button>
</div>
@error('password')
<p class="field-error">{{ $message }}</p>
@enderror
</div>
<x-password-input
name="password"
:label="__('Passwort')"
autocomplete="new-password"
:placeholder="__('Mindestens 8 Zeichen')"
/>
<div>
<label class="field-label" for="auth-password-confirmation">{{ __('Passwort bestätigen') }}</label>
<div class="field-pw-wrap">
<input
id="auth-password-confirmation"
wire:model="password_confirmation"
:type="showPasswordConfirmation ? 'text' : 'password'"
required
autocomplete="new-password"
class="field-input pr-[72px]"
:placeholder="__('Passwort wiederholen')"
/>
<button
type="button"
class="field-affix"
@click="showPasswordConfirmation = !showPasswordConfirmation"
x-text="showPasswordConfirmation ? '{{ __('Verbergen') }}' : '{{ __('Anzeigen') }}'"
>{{ __('Anzeigen') }}</button>
</div>
</div>
<x-password-input
name="password_confirmation"
:label="__('Passwort bestätigen')"
autocomplete="new-password"
:placeholder="__('Passwort wiederholen')"
:show-error="false"
/>
<div class="!mt-5">
<label for="auth-terms" class="flex items-start gap-3 cursor-pointer select-none">