Skip to content

armgit / boop

Public Imported from GitHub
0

A tiny, self-hosted notification inbox for developers. Something happened in one of your apps; Boop tells you on your phone.

HTML
1.1 KB
Raw Blame
<script lang="ts">
  import type { Snippet } from 'svelte'
  let { title, action, children, flush = false, compact = false }: { title?: string; action?: Snippet; children: Snippet; flush?: boolean; compact?: boolean } = $props()
</script>

<section class="card" class:flush class:compact>
  {#if title || action}
    <header class:only-action={!title}>
      {#if title}<h2>{title}</h2>{/if}
      {#if action}<div>{@render action()}</div>{/if}
    </header>
  {/if}
  {@render children()}
</section>

<style>
  .card {
    background: var(--up-bg);
    border: 1px solid var(--up-border-hairline);
    border-radius: var(--up-radius-card);
    padding: var(--up-space-5);
  }
  .flush { padding: var(--up-space-2); padding-top: var(--up-space-4); }
  .compact { padding: 14px var(--up-space-4); }
  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--up-space-3);
    margin-bottom: var(--up-space-4);
  }
  .flush header { padding: 0 var(--up-space-4); }
  header.only-action { justify-content: flex-end; margin-bottom: var(--up-space-2); }
  h2 { font: var(--up-type-setting); color: var(--up-ink); }
</style>