File size: 946 Bytes
c1d186b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<script lang="ts">
    let expanded = false;
  
    function toggleExpanded() {
      expanded = !expanded;
    }
  </script>
  
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="box" on:click={toggleExpanded}>
    <div class="title">
        <div class="icon">
            💥
        </div>
        <span>{'Error'}</span>
    </div>
    {#if expanded}
        <div class="content">
        <slot></slot>
        </div>
    {/if}
</div>
  
<style>
    .box {
        border-radius: 4px;
        cursor: pointer;
        max-width: max-content;
        background: var(--color-accent-soft)
    }

    .title {
        display: flex;
        align-items: center;
        padding: 8px;
        color: var(--color-red-50);
    }

    .icon {
        width: 18px;
        height: 18px;
        margin-right: 8px;
    }

    .content {
        padding: 8px;
    }
</style>