You've already forked Atomcms-edit
18 lines
1.2 KiB
PHP
Executable File
18 lines
1.2 KiB
PHP
Executable File
@props(['errorBag' => '', 'classes' => '', 'name', 'type' => 'text', 'value' => '', 'placeholder' => '', 'required' => true, 'autofocus' => false, 'readonly' => false])
|
|
|
|
<input
|
|
class="{{ $classes }} focus:ring-0 border-2 rounded-lg w-full px-4 py-2.5 transition-all duration-200 @error($name, $errorBag) border-red-500 ring-red-500 @enderror"
|
|
style="background-color: var(--color-background); color: var(--color-text); border-color: var(--input-border-color, var(--color-text-muted)); --tw-ring-color: var(--color-primary);"
|
|
id="{{ $name }}" type="{{ $type }}" name="{{ $name }}" value="{{ $value }}"
|
|
autocomplete="{{ $name }}" placeholder="{{ $placeholder }}" @if ($required) required @endif
|
|
@if ($autofocus) autofocus="{{ $name }}" @endif
|
|
@if ($readonly) readonly @endif
|
|
onfocus="this.style.borderColor='var(--color-primary)'; this.style.boxShadow='0 0 0 3px color-mix(in srgb, var(--color-primary) 20%, transparent)'"
|
|
onblur="this.style.borderColor='var(--input-border-color, var(--color-text-muted))'; this.style.boxShadow='none'">
|
|
|
|
@error($name, $errorBag)
|
|
<p class="mt-1.5 text-xs font-medium" style="color: var(--button-danger-color, #ef4444);">
|
|
{{ $message }}
|
|
</p>
|
|
@enderror
|