8000 feat: improve renderer controls · romhml/compodium@4f260b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4f260b9

Browse files
committed
feat: improve renderer controls
1 parent 7e77281 commit 4f260b9

1 file changed

Lines changed: 31 additions & 19 deletions

File tree

‎devtools/app/pages/components/[id].vue‎

Original file line numberDiff line numberDiff line change
@@ -156,23 +156,20 @@ const visibleProps = computed(() => new Set(fuseResults.value?.map(result => res
156156
<div class="relative flex grow">
157157
<ComponentPreview class="grow h-full" />
158158
<div class="flex gap-2 absolute top-2 right-2">
159-
<UButton
160-
v-if="componentMeta?.docUrl"
161-
icon="lucide:book-open"
162-
variant="link"
163-
class="rounded-full"
164-
color="neutral"
165-
:href="componentMeta?.docUrl"
166-
target="_blank"
167-
/>
168-
<UButton
169-
icon="lucide:rotate-cw"
170-
variant="link"
171-
color="neutral"
172-
class="rounded-full"
173-
:class="{ 'animate-rotate': isRotated }"
174-
@click="onResetState"
175-
/>
159+
<UTooltip
160+
text="Open docs"
161+
:content="{ side: 'left' }"
162+
>
163+
<UButton
164+
v-if="componentMeta?.docUrl"
165+
icon="lucide:book-open"
166+
variant="link"
167+
class="rounded-full"
168+
color="neutral"
169+
:href="componentMeta?.docUrl"
170+
target="_blank"
171+
/>
172+
</UTooltip>
176173
<UButton
177174
:icon="isDark ? 'lucide:moon' : 'lucide:sun'"
178175
variant="link"
@@ -192,14 +189,29 @@ const visibleProps = computed(() => new Set(fuseResults.value?.map(result => res
192189
>
193190
<template #props>
194191
<div class="overflow-y-scroll h-full">
195-
<div class="bg-(--ui-bg) p-0.5 border-y border-(--ui-border) sticky top-0 z-1">
192+
<div class="bg-(--ui-bg) p-0.5 border-y border-(--ui-border) sticky top-0 z-1 flex gap-2">
196193
<UInput
197194
v-model="propsSearchTerm"
198195
placeholder="Search props..."
199-
trailing-icon="lucide:search"
196+
icon="lucide:search"
200197
variant="none"
201198
class="w-full"
202199
/>
200+
201+
<UTooltip
202+
text="Reset props"
203+
:content="{ side: 'left' }"
204+
>
205+
<UButton
206+
icon="lucide:rotate-cw"
207+
variant="link"
208+
color="neutral"
209+
class="rounded-full"
210+
size="sm"
211+
:class="{ 'animate-rotate': isRotated }"
212+
@click="onResetState"
213+
/>
214+
</UTooltip>
203215
</div>
204216
<div
205217
v-for="prop in componentMeta?.meta.props"