small ui polish: loading state, relative timestamps, log-marker formatting, wider tooltips, type tidy-ups
This commit is contained in:
9 files changed
+106
-26
No files matched your search
@@ -0,0 +1,3 @@
|
||||
import LoadingState from './loading-state.svelte';
|
||||
|
||||
export { LoadingState };
|
||||
@@ -0,0 +1,22 @@
|
||||
<script lang="ts">
|
||||
import { Loader2 } from 'lucide-svelte';
|
||||
import { cn } from '$lib/utils.js';
|
||||
|
||||
interface Props {
|
||||
/** Optional label under the spinner, e.g. "Loading snapshots...". */
|
||||
label?: string;
|
||||
/** Extra classes on the wrapper (e.g. `h-full` to fill a flex parent). */
|
||||
class?: string;
|
||||
/** Spinner size class. Defaults to a large centered spinner. */
|
||||
spinnerClass?: string;
|
||||
}
|
||||
|
||||
let { label, class: className, spinnerClass = 'w-10 h-10' }: Props = $props();
|
||||
</script>
|
||||
|
||||
<div class={cn('flex min-h-[200px] flex-col items-center justify-center gap-3 text-muted-foreground', className)}>
|
||||
<Loader2 class={cn('animate-spin', spinnerClass)} />
|
||||
{#if label}
|
||||
<span class="text-sm">{label}</span>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -21,7 +21,7 @@
|
||||
{sideOffset}
|
||||
{side}
|
||||
class={cn(
|
||||
"bg-popover text-popover-foreground border shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 origin-(--bits-tooltip-content-transform-origin) z-[200] w-fit fixed text-balance rounded-md px-3 py-1.5 text-xs",
|
||||
"bg-popover text-popover-foreground border shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 origin-(--bits-tooltip-content-transform-origin) z-[200] w-max max-w-lg fixed whitespace-normal rounded-md px-3 py-1.5 text-xs",
|
||||
className
|
||||
)}
|
||||
{...restProps}
|
||||
|
||||
Reference in new issue
Block a user