- Updated tab-panel component to use Tailwind for styling and transitions. - Refactored table-row component to implement Tailwind classes for hover effects and borders. - Converted table-td component to utilize Tailwind for alignment and text styles. - Changed table-th component to apply Tailwind for header styling and sorting indicators. - Revised table component to adopt Tailwind for layout, borders, and responsive design. - Enhanced tabs component with Tailwind for navigation styles and transitions. - Updated toggle component to use Tailwind for switch styles and accessibility. - Refactored tooltip component to implement Tailwind for positioning and styling. - Added visual enhancements to app.css for improved UI interactions and animations.
93 lines
3.6 KiB
PHP
93 lines
3.6 KiB
PHP
{{--
|
|
Input Component - LucentUI Theme
|
|
Migrated from AdminLTE to Tailwind
|
|
|
|
Usage:
|
|
<x-proxmox::ui.input name="email" label="Email" />
|
|
<x-proxmox::ui.input name="search" placeholder="Search..." icon="ri-search-line" />
|
|
<x-proxmox::ui.input name="password" type="password" label="Password" error="Password is required" />
|
|
--}}
|
|
|
|
@props([
|
|
'type' => 'text',
|
|
'name' => null,
|
|
'label' => null,
|
|
'placeholder' => null,
|
|
'icon' => null,
|
|
'iconRight' => null,
|
|
'error' => null,
|
|
'hint' => null,
|
|
'disabled' => false,
|
|
'readonly' => false,
|
|
'required' => false,
|
|
'size' => 'md',
|
|
])
|
|
|
|
@php
|
|
$sizeClasses = [
|
|
'sm' => 'h-8 text-xs',
|
|
'md' => 'h-10',
|
|
'lg' => 'h-12 text-base',
|
|
];
|
|
$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';
|
|
|
|
$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($required)
|
|
<span class="text-error">*</span>
|
|
@endif
|
|
</label>
|
|
@endif
|
|
|
|
@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">
|
|
<x-dynamic-component :component="$icon" class="size-4" />
|
|
</span>
|
|
@endif
|
|
|
|
<input
|
|
type="{{ $type }}"
|
|
@if($name) name="{{ $name }}" id="{{ $name }}" @endif
|
|
@if($placeholder) placeholder="{{ $placeholder }}" @endif
|
|
@if($disabled) disabled @endif
|
|
@if($readonly) readonly @endif
|
|
@if($required) required @endif
|
|
class="{{ $inputClasses }} {{ $sizeClass }} {{ $errorClasses }} {{ $icon ? 'rounded-l-none' : '' }} {{ $iconRight ? 'rounded-r-none' : '' }}"
|
|
{{ $attributes->except('class') }}
|
|
/>
|
|
|
|
@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">
|
|
<x-dynamic-component :component="$iconRight" class="size-4" />
|
|
</span>
|
|
@endif
|
|
</div>
|
|
@else
|
|
<input
|
|
type="{{ $type }}"
|
|
@if($name) name="{{ $name }}" id="{{ $name }}" @endif
|
|
@if($placeholder) placeholder="{{ $placeholder }}" @endif
|
|
@if($disabled) disabled @endif
|
|
@if($readonly) readonly @endif
|
|
@if($required) required @endif
|
|
class="{{ $inputClasses }} {{ $sizeClass }} {{ $errorClasses }}"
|
|
{{ $attributes->except('class') }}
|
|
/>
|
|
@endif
|
|
|
|
@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>
|
|
@endif
|
|
</div>
|