tecitheme 0.15.0 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Stats.svelte +45 -17
- package/package.json +1 -1
|
@@ -1,35 +1,63 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { getColorStyles, makeIdString } from '../utils'
|
|
2
|
+
import { getColorStyles, getGridSizeStyles, makeIdString } from '../utils'
|
|
3
3
|
export let data = {};
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
name,
|
|
7
|
+
heading,
|
|
8
|
+
subheading,
|
|
9
|
+
color,
|
|
10
|
+
image,
|
|
11
|
+
imageAltText,
|
|
12
|
+
columns,
|
|
13
|
+
rows,
|
|
14
|
+
stats,
|
|
15
|
+
} = data;
|
|
16
|
+
|
|
17
|
+
columns = columns ? columns : 3 //Overrides default Grid column count (1 -> 3)
|
|
18
|
+
|
|
19
|
+
let id = makeIdString(name);
|
|
5
20
|
</script>
|
|
6
21
|
|
|
7
22
|
<section {id} class="bg-gray-50">
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
23
|
+
<!-- Headings -->
|
|
24
|
+
{#if heading || subheading}
|
|
25
|
+
<div class="mx-auto max-w-7xl p-6 lg:p-8">
|
|
26
|
+
<div class="mx-auto max-w-4xl text-center">
|
|
27
|
+
{#if heading}
|
|
28
|
+
<h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">{@html heading}</h2>
|
|
29
|
+
{/if}
|
|
30
|
+
{#if subheading}
|
|
31
|
+
<p class="mt-3 text-xl text-gray-500 sm:mt-4">{@html subheading}</p>
|
|
32
|
+
{/if}
|
|
33
|
+
</div>
|
|
14
34
|
</div>
|
|
15
|
-
|
|
35
|
+
{/if}
|
|
36
|
+
|
|
37
|
+
<!-- Stats & Image -->
|
|
16
38
|
<div class="bg-white">
|
|
17
39
|
<div class="relative">
|
|
18
40
|
<div class="absolute inset-0 bg-gray-50"></div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
41
|
+
|
|
42
|
+
<!-- Stats -->
|
|
43
|
+
<div class="relative mx-auto max-w-7xl px-6 lg:px-8 ">
|
|
44
|
+
<div class="mx-auto max-w-4xl ">
|
|
45
|
+
<dl class="bg-white shadow ring-1 ring-black/5 grid {getGridSizeStyles(columns, rows)}">
|
|
46
|
+
{#each stats as stat, i}
|
|
23
47
|
<div id="stat-{i}" class="flex flex-col border-b border-gray-100 p-6 text-center sm:border-0 sm:border-r sm:border-l">
|
|
24
48
|
<dt class="order-2 mt-2 text-lg font-medium leading-6 text-gray-500">{stat.label}</dt>
|
|
25
|
-
<dd class="order-1 text-5xl font-bold tracking-tight {getColorStyles('text',
|
|
49
|
+
<dd class="order-1 text-5xl font-bold tracking-tight {getColorStyles('text', color)}">{stat.value}</dd>
|
|
26
50
|
</div>
|
|
27
51
|
{/each}
|
|
28
52
|
</dl>
|
|
29
53
|
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
54
|
+
|
|
55
|
+
<!-- Image -->
|
|
56
|
+
{#if image}
|
|
57
|
+
<figure>
|
|
58
|
+
<img class="w-full" alt="{(imageAltText ? imageAltText : heading)}" src="https://files.thunderheadeng.com/www/images/{image}?w=1152&fit=crop&auto=compress&auto=format">
|
|
59
|
+
</figure>
|
|
60
|
+
{/if}
|
|
33
61
|
</div>
|
|
34
62
|
</div>
|
|
35
63
|
</div>
|