Files
Virtnet.bond/extensions/Servers/Proxmox/views/components/ui/copyable.blade.php
Joseph.Rawlings abff5a381f Migrate UI components from AdminLTE to LucentUI Theme using Tailwind CSS
- 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.
2026-02-01 14:16:57 -05:00

59 lines
2.4 KiB
PHP

{{--
Copyable Text Component - LucentUI Theme
Migrated from AdminLTE to Tailwind
Text field with copy to clipboard functionality
Usage:
<x-proxmox::ui.copyable label="IPv4 Address" value="192.168.1.1" />
--}}
@props([
'label' => null,
'value',
'masked' => false,
])
<div class="flex flex-col gap-2">
@if($label)
<label class="text-sm font-medium text-base/80">{{ $label }}</label>
@endif
<div
x-data="{
copied: false,
showValue: @js(!$masked),
copyText: @js($value),
copyToClipboard() {
navigator.clipboard.writeText(this.copyText);
this.copied = true;
setTimeout(() => this.copied = false, 2000);
}
}"
class="flex items-center gap-2.5 px-4 py-2.5 bg-background-secondary border border-neutral rounded-lg text-sm transition-colors duration-200"
>
@if($masked)
<span class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-base" x-text="showValue ? copyText : '••••••••••••'"></span>
<button
@click="showValue = !showValue"
type="button"
class="relative inline-flex items-center justify-center size-5 shrink-0 p-0 bg-transparent border-none text-base/50 cursor-pointer transition-colors duration-200 hover:text-primary"
:aria-label="showValue ? 'Hide value' : 'Show value'"
>
<x-ri-eye-line class="size-4 absolute" x-show="!showValue" />
<x-ri-eye-off-line class="size-4 absolute" x-show="showValue" x-cloak />
</button>
@else
<span class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-base">{{ $value }}</span>
@endif
<button
@click="copyToClipboard()"
type="button"
class="relative inline-flex items-center justify-center size-5 shrink-0 p-0 bg-transparent border-none text-base/50 cursor-pointer transition-colors duration-200 hover:text-primary"
:class="copied ? 'text-success' : ''"
aria-label="Copy to clipboard"
>
<x-ri-check-fill class="size-4 absolute" x-show="copied" x-transition x-cloak />
<x-ri-file-copy-line class="size-4 absolute" x-show="!copied" x-transition />
</button>
</div>
</div>