Refactor form inputs and labels

This commit is contained in:
Andras Bacsai 2024-04-03 15:10:21 +02:00
parent 0b34207148
commit d31f75d1ec
4 changed files with 17 additions and 16 deletions

View File

@ -8,24 +8,25 @@
<div class="p-6 space-y-4 md:space-y-6 sm:p-8">
<form action="/login" method="POST" class="flex flex-col gap-2">
@csrf
{{-- @env('local')
<x-forms.input value="test@example.com" type="email" name="email" required
@env('local')
<x-forms.input value="test@example.com" type="email" autocomplete="email" name="email"
required label="{{ __('input.email') }}" autofocus />
<x-forms.input value="password" type="password" autocomplete="current-password" name="password"
required label="{{ __('input.password') }}" />
<a href="/forgot-password" class="text-xs">
{{ __('auth.forgot_password') }}?
</a>
@else
<x-forms.input type="email" name="email" autocomplete="email" required
label="{{ __('input.email') }}" autofocus />
<x-forms.input value="password" type="password" name="password" required
<x-forms.input type="password" name="password" autocomplete="current-password" required
label="{{ __('input.password') }}" />
<a href="/forgot-password" class="text-xs">
{{ __('auth.forgot_password') }}?
</a>
@else --}}
<x-forms.input type="email" name="email" autocomplete="email" required label="{{ __('input.email') }}"
autofocus />
<x-forms.input type="password" name="password" autocomplete="current-password" required label="{{ __('input.password') }}" />
<a href="/forgot-password" class="text-xs">
{{ __('auth.forgot_password') }}?
</a>
{{-- @endenv --}}
@endenv
<x-forms.button class="mt-10" type="submit">{{ __('auth.login') }}</x-forms.button>
@if (!$is_registration_enabled)

View File

@ -3,7 +3,7 @@
'w-full' => !$isMultiline,
])>
@if ($label)
<label for="small-input" class="flex items-center gap-1 mb-1 text-sm font-medium">{{ $label }}
<label class="flex items-center gap-1 mb-1 text-sm font-medium">{{ $label }}
@if ($required)
<x-highlighted text="*" />
@endif

View File

@ -1,6 +1,6 @@
<div class="w-full">
@if ($label)
<label for="small-input" class="flex items-center gap-1 mb-1 text-sm font-medium">{{ $label }}
<label class="flex items-center gap-1 mb-1 text-sm font-medium">{{ $label }}
@if ($required)
<x-highlighted text="*" />
@endif

View File

@ -1,6 +1,6 @@
<div class="flex-1 form-control">
@if ($label)
<label for="small-input" class="flex items-center gap-1 mb-1 text-sm font-medium">{{ $label }}
<label class="flex items-center gap-1 mb-1 text-sm font-medium">{{ $label }}
@if ($required)
<x-highlighted text="*" />
@endif