This commit is contained in:
Timothy J. Baek
2024-10-03 21:10:33 -07:00
parent 6747478f67
commit b862dff185
9 changed files with 263 additions and 154 deletions

View File

@@ -9,8 +9,7 @@
const dispatch = createEventDispatcher();
export let className = 'w-60';
export let colorClassName =
'bg-white dark:bg-gray-850 border border-gray-50 dark:border-gray-850';
export let colorClassName = 'bg-white dark:bg-gray-850 border border-gray-50 dark:border-white/5';
export let url: string | null = null;
export let dismissible = false;
@@ -31,7 +30,7 @@
{/if}
<button
class="relative group p-1 {className} flex items-center {colorClassName} rounded-2xl text-left"
class="relative group p-1.5 {className} flex items-center {colorClassName} rounded-2xl text-left"
type="button"
on:click={async () => {
if (file?.file?.content) {
@@ -106,7 +105,7 @@
{/if}
</div>
<div class="flex flex-col justify-center -space-y-0.5 px-2 w-full">
<div class="flex flex-col justify-center -space-y-0.5 px-2.5 w-full">
<div class=" dark:text-gray-100 text-sm font-medium line-clamp-1 mb-1">
{name}
</div>
@@ -128,16 +127,34 @@
</div>
{#if dismissible}
<div class=" pr-2">
<div class=" absolute -top-2 -right-2">
<button
class=" px-2 py-2 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl group-hover:visible invisible transition"
class=" bg-gray-400 text-white border border-white rounded-full group-hover:visible invisible transition"
type="button"
on:click={() => {
dispatch('dismiss');
}}
>
<GarbageBin />
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
class="w-4 h-4"
>
<path
d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
/>
</svg>
</button>
<!-- <button
class=" p-1 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-full group-hover:visible invisible transition"
type="button"
on:click={() => {
}}
>
<GarbageBin />
</button> -->
</div>
{/if}
</button>