mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-01-28 07:43:18 +00:00
🎨 Add new Flux icons: implement multiple reusable icon components (e.g., hand-raised, hand-thumb-up, heart, hashtag, home) with variant support for improved UI consistency.
This commit is contained in:
38
resources/views/flux/textarea.blade.php
Normal file
38
resources/views/flux/textarea.blade.php
Normal file
@@ -0,0 +1,38 @@
|
||||
@props([
|
||||
'name' => $attributes->whereStartsWith('wire:model')->first(),
|
||||
'resize' => 'vertical',
|
||||
'invalid' => null,
|
||||
'rows' => 4,
|
||||
])
|
||||
|
||||
@php
|
||||
$invalid ??= ($name && $errors->has($name));
|
||||
|
||||
$classes = Flux::classes()
|
||||
->add('block p-3 w-full')
|
||||
->add('shadow-xs disabled:shadow-none border rounded-lg')
|
||||
->add('bg-white dark:bg-white/10 dark:disabled:bg-white/[7%]')
|
||||
->add($resize ? 'resize-y' : 'resize-none')
|
||||
->add('text-base sm:text-sm text-zinc-700 disabled:text-zinc-500 placeholder-zinc-400 disabled:placeholder-zinc-400/70 dark:text-zinc-300 dark:disabled:text-zinc-400 dark:placeholder-zinc-400 dark:disabled:placeholder-zinc-500')
|
||||
->add($invalid ? 'border-red-500' : 'border-zinc-200 border-b-zinc-300/80 dark:border-white/10')
|
||||
;
|
||||
|
||||
$resizeStyle = match ($resize) {
|
||||
'none' => 'resize: none',
|
||||
'both' => 'resize: both',
|
||||
'horizontal' => 'resize: horizontal',
|
||||
'vertical' => 'resize: vertical',
|
||||
};
|
||||
@endphp
|
||||
|
||||
<flux:with-field :$attributes>
|
||||
<textarea
|
||||
{{ $attributes->class($classes) }}
|
||||
rows="{{ $rows }}"
|
||||
style="{{ $resizeStyle }}; {{ $rows === 'auto' ? 'field-sizing: content' : '' }}"
|
||||
@isset ($name) name="{{ $name }}" @endisset
|
||||
@if ($invalid) aria-invalid="true" data-invalid @endif
|
||||
data-flux-control
|
||||
data-flux-textarea
|
||||
>{{ $slot }}</textarea>
|
||||
</flux:with-field>
|
||||
Reference in New Issue
Block a user