- Refactored select component to align with shadcn design principles. - Updated server status indicator component for consistency with shadcn style. - Modified spinner component to follow shadcn design guidelines. - Enhanced stat card component with shadcn-inspired styles. - Adjusted tab panel component to reflect shadcn design updates. - Revamped table row and table data cell components to match shadcn aesthetics. - Updated table header cell component for improved styling consistency. - Refined table component to align with shadcn design principles. - Enhanced tabs component with shadcn-inspired styles. - Updated toggle component to follow shadcn design guidelines. - Refactored tooltip component to align with shadcn design principles. - Updated server card component to reflect shadcn-inspired design.
57 lines
2.0 KiB
PHP
57 lines
2.0 KiB
PHP
{{--
|
|
Copyable Text Component - shadcn-style
|
|
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="space-y-2">
|
|
@if($label)
|
|
<label class="text-sm font-medium leading-none">{{ $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 rounded-md border bg-transparent px-3 py-2 text-sm transition-colors duration-150"
|
|
>
|
|
@if($masked)
|
|
<span class="truncate flex-1 font-mono" x-text="showValue ? copyText : '••••••••••••'"></span>
|
|
<button
|
|
@click="showValue = !showValue"
|
|
type="button"
|
|
class="text-muted-foreground hover:text-foreground transition-colors duration-150"
|
|
:aria-label="showValue ? 'Hide value' : 'Show value'"
|
|
>
|
|
<x-ri-eye-line x-show="!showValue" class="size-4" />
|
|
<x-ri-eye-off-line x-show="showValue" x-cloak class="size-4" />
|
|
</button>
|
|
@else
|
|
<span class="truncate flex-1 font-mono">{{ $value }}</span>
|
|
@endif
|
|
<button
|
|
@click="copyToClipboard()"
|
|
type="button"
|
|
class="text-muted-foreground hover:text-foreground transition-colors duration-150 relative inline-flex items-center justify-center size-4"
|
|
aria-label="Copy to clipboard"
|
|
>
|
|
<x-ri-check-fill x-show="copied" x-transition x-cloak class="absolute size-4 text-success" />
|
|
<x-ri-file-copy-line x-show="!copied" x-transition class="absolute size-4" />
|
|
</button>
|
|
</div>
|
|
</div>
|