summaryrefslogtreecommitdiffstats
path: root/apps/web-shared/src/components/link-card.svelte
blob: 85738c7b0ed629cbc56f20b3564e6c9169bd9f3d (plain) (blame)
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
<script>
	export let text = "View";
	export let name;
	export let description = null;
	export let href = null;
	export let target;
	export let title = null;
</script>

<a class="link-card flex flex-column bg-light cursor-pointer radius-sm inner-glow {$$restProps.class??''}"
   {href}
   {target}
   {title}
   on:click
   aria-label="Link label">
    <div class="padding-sm">
        <div class="flex flex-wrap gap-xs items-center">
            <slot name="icon"></slot>
            <div class="line-height-xs">
                <p class="text-lg font-semibold color-contrast-higher">{name}</p>
                {#if description}
                    <p class="color-contrast-low margin-top-xxxs">{description}</p>
                {/if}
            </div>
        </div>
    </div>
    <div class="link-card__footer margin-top-auto border-top border-contrast-lower">
        <p class="text-sm">{text}</p>
        <div>
            <svg class="icon icon--sm"
                 viewBox="0 0 24 24">
                <g fill="none"
                   stroke="currentColor"
                   stroke-linecap="round"
                   stroke-linejoin="round"
                   stroke-width="2">
                    <line x1="3"
                          y1="12"
                          x2="21"
                          y2="12"/>
                    <polyline points="15 6 21 12 15 18"/>
                </g>
            </svg>
        </div>
    </div>
</a>