Remove desktop header search from app topbars.
Deploy Ladill Link / deploy (push) Successful in 1m11s
Deploy Ladill Link / deploy (push) Successful in 1m11s
Drop the lg+ topbar search field; mobile search entry points are unchanged.
This commit is contained in:
@@ -42,69 +42,6 @@
|
|||||||
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/></svg>
|
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/></svg>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{{-- Search Bar --}}
|
|
||||||
<div class="relative hidden w-full max-w-md lg:block" x-data="topbarSearch()" @click.outside="open = false" @keydown.escape.window="open = false">
|
|
||||||
<div class="relative">
|
|
||||||
<svg class="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"/></svg>
|
|
||||||
<input data-ladill-search-input type="text"
|
|
||||||
x-model="query"
|
|
||||||
@focus="onFocus()"
|
|
||||||
@input.debounce.200ms="search()"
|
|
||||||
@keydown.arrow-down.prevent="moveDown()"
|
|
||||||
@keydown.arrow-up.prevent="moveUp()"
|
|
||||||
@keydown.enter.prevent="go()"
|
|
||||||
placeholder="Search domains, hosting, email, SMTP…"
|
|
||||||
class="w-full rounded-xl border border-slate-200 bg-slate-50 py-2 pl-9 pr-10 text-sm text-slate-700 placeholder-slate-400 transition focus:border-indigo-300 focus:bg-white focus:ring-2 focus:ring-indigo-100 focus:outline-none">
|
|
||||||
<kbd class="pointer-events-none absolute right-3 top-1/2 hidden -translate-y-1/2 rounded-md border border-slate-200 bg-white px-1.5 py-0.5 text-[10px] font-medium text-slate-400 sm:inline-block">/</kbd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{-- Results dropdown --}}
|
|
||||||
<div x-show="open && (results.length > 0 || (query.length >= 2 && !loading))"
|
|
||||||
x-cloak
|
|
||||||
x-transition.opacity.duration.150ms
|
|
||||||
class="absolute left-0 top-full z-30 mt-1.5 w-full overflow-hidden rounded-xl border border-slate-200 bg-white shadow-lg">
|
|
||||||
<template x-if="loading">
|
|
||||||
<div class="px-4 py-3 text-center text-xs text-slate-400">Searching…</div>
|
|
||||||
</template>
|
|
||||||
<template x-if="!loading && results.length === 0 && query.length >= 2">
|
|
||||||
<div class="px-4 py-3 text-center text-xs text-slate-500">No results for "<span x-text="query" class="font-medium"></span>"</div>
|
|
||||||
</template>
|
|
||||||
<template x-if="!loading && results.length > 0">
|
|
||||||
<ul class="max-h-72 overflow-y-auto py-1">
|
|
||||||
<template x-for="(item, idx) in results" :key="item.url">
|
|
||||||
<li>
|
|
||||||
<a :href="item.url"
|
|
||||||
:class="idx === active ? 'bg-indigo-50 text-indigo-700' : 'text-slate-700'"
|
|
||||||
@mouseenter="active = idx"
|
|
||||||
class="flex items-center gap-3 px-4 py-2.5 text-sm transition hover:bg-indigo-50">
|
|
||||||
<span class="flex h-7 w-7 shrink-0 items-center justify-center rounded-lg"
|
|
||||||
:class="{
|
|
||||||
'bg-blue-100 text-blue-600': item.type === 'domain',
|
|
||||||
'bg-teal-100 text-teal-600': item.type === 'hosting',
|
|
||||||
'bg-sky-100 text-sky-600': item.type === 'email',
|
|
||||||
'bg-violet-100 text-violet-600': item.type === 'smtp',
|
|
||||||
'bg-amber-100 text-amber-600': item.type === 'ticket',
|
|
||||||
'bg-orange-100 text-orange-600': item.type === 'order',
|
|
||||||
'bg-slate-100 text-slate-600': !['domain','hosting','email','smtp','ticket','order'].includes(item.type),
|
|
||||||
}">
|
|
||||||
<template x-if="item.type === 'domain'">
|
|
||||||
<svg class="h-3.5 w-3.5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"/></svg>
|
|
||||||
</template>
|
|
||||||
<template x-if="item.type !== 'domain'">
|
|
||||||
<svg class="h-3.5 w-3.5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"/></svg>
|
|
||||||
</template>
|
|
||||||
</span>
|
|
||||||
<span class="min-w-0 flex-1">
|
|
||||||
<span class="block truncate font-medium leading-tight" x-text="item.title"></span>
|
|
||||||
<span class="block truncate text-xs text-slate-400" x-text="item.subtitle"></span>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</template>
|
|
||||||
</ul>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center gap-3">
|
<div class="flex items-center gap-3">
|
||||||
|
|||||||
Reference in New Issue
Block a user