Refactor modal close behavior and improve styling
- Changed modal close event from `@click.away` to `@click.self` for better control over closing modals. - Updated various modal button styles for consistency and improved accessibility. - Adjusted transition durations for modal animations to enhance user experience. - Added aria-labels to close buttons for better screen reader support.
This commit is contained in:
@@ -31,14 +31,14 @@
|
||||
];
|
||||
$sizeClass = $sizeClasses[$size] ?? $sizeClasses['md'];
|
||||
|
||||
$inputClasses = 'w-full px-4 py-2 text-sm text-primary dark:text-gray-100 bg-background dark:bg-gray-900 border border-neutral dark:border-gray-600 rounded-lg placeholder:text-secondary/50 dark:placeholder:text-gray-500 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/25 transition-all duration-150 disabled:opacity-50 disabled:cursor-not-allowed';
|
||||
$inputClasses = 'w-full px-4 py-2 text-sm text-primary dark:text-base/90 bg-background dark:bg-background-secondary border border-neutral rounded-lg placeholder:text-secondary/50 dark:placeholder:text-base/30 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/25 transition-all duration-150 disabled:opacity-50 disabled:cursor-not-allowed';
|
||||
|
||||
$errorClasses = $error ? 'border-error focus:border-error focus:ring-error/25' : '';
|
||||
@endphp
|
||||
|
||||
<div {{ $attributes->only('class')->class(['mb-3']) }}>
|
||||
@if($label)
|
||||
<label @if($name) for="{{ $name }}" @endif class="block mb-2 font-medium text-sm text-secondary dark:text-gray-300">
|
||||
<label @if($name) for="{{ $name }}" @endif class="block mb-2 font-medium text-sm text-secondary dark:text-base/60">
|
||||
{{ $label }}
|
||||
@if($required)
|
||||
<span class="text-error">*</span>
|
||||
@@ -49,7 +49,7 @@
|
||||
@if($icon || $iconRight)
|
||||
<div class="relative flex items-stretch">
|
||||
@if($icon)
|
||||
<span class="flex items-center px-3 bg-background-secondary dark:bg-gray-800 border border-r-0 border-neutral dark:border-gray-600 rounded-l-lg text-secondary dark:text-gray-400">
|
||||
<span class="flex items-center px-3 bg-background-secondary border border-r-0 border-neutral rounded-l-lg text-secondary dark:text-base/50">
|
||||
<x-dynamic-component :component="$icon" class="size-4" />
|
||||
</span>
|
||||
@endif
|
||||
@@ -66,7 +66,7 @@
|
||||
/>
|
||||
|
||||
@if($iconRight)
|
||||
<span class="flex items-center px-3 bg-background-secondary dark:bg-gray-800 border border-l-0 border-neutral dark:border-gray-600 rounded-r-lg text-secondary dark:text-gray-400">
|
||||
<span class="flex items-center px-3 bg-background-secondary border border-l-0 border-neutral rounded-r-lg text-secondary dark:text-base/50">
|
||||
<x-dynamic-component :component="$iconRight" class="size-4" />
|
||||
</span>
|
||||
@endif
|
||||
@@ -87,6 +87,6 @@
|
||||
@if($error)
|
||||
<div class="mt-1 text-sm text-error">{{ $error }}</div>
|
||||
@elseif($hint)
|
||||
<div class="mt-1 text-sm text-secondary dark:text-gray-400">{{ $hint }}</div>
|
||||
<div class="mt-1 text-sm text-secondary dark:text-base/50">{{ $hint }}</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user