tecitheme 0.11.6 → 0.11.8
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.
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { makeIdString } from "../utils";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export let data = {};
|
|
6
|
+
let id = makeIdString(data.name);
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div id={id} class="bg-white">
|
|
10
|
+
<div class="mx-auto max-w-7xl divide-y divide-gray-900/10 px-6 lg:px-8">
|
|
11
|
+
<h2 class="text-2xl font-bold leading-10 tracking-tight text-gray-900">Frequently asked questions</h2>
|
|
12
|
+
<dl class="mt-10 space-y-8 divide-y divide-gray-900/10">
|
|
13
|
+
<div class="pt-8 lg:grid lg:grid-cols-12 lg:gap-8">
|
|
14
|
+
|
|
15
|
+
{#each data.items as item}
|
|
16
|
+
<dt class="text-base font-semibold leading-7 text-gray-900 lg:col-span-5">{@html item.label}</dt>
|
|
17
|
+
<dd class="mt-4 lg:col-span-7 lg:mt-0">
|
|
18
|
+
<p class="text-base leading-7 text-gray-600">{@html item.description}</p>
|
|
19
|
+
</dd>
|
|
20
|
+
{/each}
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<!-- More questions... -->
|
|
24
|
+
</dl>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} FaqListProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} FaqListEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} FaqListSlots */
|
|
4
|
+
export default class FaqList extends SvelteComponent<{
|
|
5
|
+
data?: {};
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {}> {
|
|
9
|
+
}
|
|
10
|
+
export type FaqListProps = typeof __propDef.props;
|
|
11
|
+
export type FaqListEvents = typeof __propDef.events;
|
|
12
|
+
export type FaqListSlots = typeof __propDef.slots;
|
|
13
|
+
import { SvelteComponent } from "svelte";
|
|
14
|
+
declare const __propDef: {
|
|
15
|
+
props: {
|
|
16
|
+
data?: {};
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {};
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import { goto } from "$app/navigation";
|
|
3
|
+
import { page } from "$app/stores";
|
|
2
4
|
import { getColorStyles, makeIdString } from "../utils";
|
|
3
|
-
|
|
5
|
+
import { onMount } from "svelte";
|
|
6
|
+
import { writable } from "svelte/store";
|
|
4
7
|
|
|
5
8
|
export let data = {};
|
|
6
9
|
let id = makeIdString(data.name);
|
|
@@ -38,21 +41,21 @@
|
|
|
38
41
|
* }
|
|
39
42
|
*/
|
|
40
43
|
let tables = {};
|
|
41
|
-
data.groups.forEach(
|
|
42
|
-
if (
|
|
44
|
+
data.groups.forEach(group => {
|
|
45
|
+
if (group.options)
|
|
43
46
|
{
|
|
44
|
-
tables[
|
|
47
|
+
tables[group.name] = {name: group.name, columns: [], categories: []}; //Initialize key for the section object
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
group.options.forEach(option => {
|
|
47
50
|
|
|
48
|
-
tables[
|
|
51
|
+
tables[group.name]["columns"].push({name: option.name, description: option.description, highlightOption: option.highlightOption});
|
|
49
52
|
|
|
50
53
|
if (option.features) {
|
|
51
54
|
option.features.forEach(category => {
|
|
52
55
|
|
|
53
56
|
// Big 'ole ternary to retrieve or initialize category data
|
|
54
|
-
let catData = tables[
|
|
55
|
-
? tables[
|
|
57
|
+
let catData = tables[group.name]["categories"][category.name]
|
|
58
|
+
? tables[group.name]["categories"][category.name]
|
|
56
59
|
: {name: category.name, features: {}};
|
|
57
60
|
|
|
58
61
|
category.features.forEach((feature, index) => {
|
|
@@ -73,7 +76,7 @@
|
|
|
73
76
|
});
|
|
74
77
|
|
|
75
78
|
//Store category data
|
|
76
|
-
tables[
|
|
79
|
+
tables[group.name]["categories"][category.name] = catData;
|
|
77
80
|
|
|
78
81
|
});
|
|
79
82
|
}
|
|
@@ -82,17 +85,17 @@
|
|
|
82
85
|
}
|
|
83
86
|
});
|
|
84
87
|
|
|
85
|
-
let
|
|
88
|
+
let selectedGroup = writable({});
|
|
86
89
|
let selectedTable = writable({});
|
|
87
90
|
|
|
88
91
|
//Initialize data stores
|
|
89
92
|
if (data.groups) {
|
|
90
|
-
|
|
91
|
-
selectedTable.update(val => tables[$
|
|
93
|
+
selectedGroup.update(val => data.groups[0]);
|
|
94
|
+
selectedTable.update(val => tables[$selectedGroup.name]);
|
|
92
95
|
}
|
|
93
96
|
|
|
94
97
|
//Update table store when new button is selected
|
|
95
|
-
|
|
98
|
+
selectedGroup.subscribe(val => selectedTable.update(table => tables[val.name]))
|
|
96
99
|
|
|
97
100
|
/**
|
|
98
101
|
*
|
|
@@ -123,32 +126,43 @@
|
|
|
123
126
|
}
|
|
124
127
|
}
|
|
125
128
|
|
|
129
|
+
onMount(() => {
|
|
130
|
+
let initialGroupParam = $page.url.searchParams.get("group");
|
|
131
|
+
if (initialGroupParam != null) {
|
|
132
|
+
let initialGroup = data.groups.filter(group => group.name === initialGroupParam)[0];
|
|
133
|
+
selectedGroup.update(_ => initialGroup);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
selectedGroup.subscribe(newGroup => {
|
|
137
|
+
$page.url.searchParams.set("group", newGroup.name);
|
|
138
|
+
goto($page.url.toString(), {noScroll: true});
|
|
139
|
+
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
let anchorElement = document.getElementById($page.url.hash.slice(1,));
|
|
142
|
+
if (anchorElement) anchorElement.scrollIntoView(true);
|
|
143
|
+
}, 300)
|
|
144
|
+
})
|
|
145
|
+
})
|
|
146
|
+
|
|
126
147
|
</script>
|
|
127
148
|
|
|
128
149
|
<div id={id} class="relative flex flex-col space-y-4">
|
|
129
150
|
|
|
130
151
|
<!-- Hero -->
|
|
131
|
-
<div class="flow-root bg-
|
|
152
|
+
<div class="flow-root bg-white py-8">
|
|
132
153
|
<div class="mx-auto max-w-7xl px-6 lg:px-8">
|
|
133
154
|
|
|
134
155
|
<!-- Title, Text, and Buttons -->
|
|
135
156
|
<div class="relative z-10">
|
|
136
|
-
<!-- Title -->
|
|
137
|
-
{#if data.heading}
|
|
138
|
-
<h1 class="mx-auto max-w-4xl text-center text-5xl font-bold tracking-tight text-white break-words hyphens-auto">{data.heading}</h1>
|
|
139
|
-
{/if}
|
|
140
|
-
<!-- Hero Text -->
|
|
141
|
-
{#if data.subheading}
|
|
142
|
-
<p class="mx-auto mt-4 max-w-2xl text-center text-lg leading-8 text-white">{@html data.subheading}</p>
|
|
143
|
-
{/if}
|
|
144
|
-
|
|
145
157
|
<!-- Buttons -->
|
|
146
|
-
<div class="
|
|
147
|
-
<fieldset class="flex flex-row bg-white/5 text-center text-xs font-semibold leading-5
|
|
148
|
-
<legend class="sr-only">
|
|
149
|
-
|
|
158
|
+
<div class="flex justify-center">
|
|
159
|
+
<fieldset class="flex flex-row bg-white/5 text-center text-xs font-semibold leading-5 shadow-lg ring ring-gray-200/50">
|
|
160
|
+
<legend class="sr-only">Group Selector</legend>
|
|
150
161
|
{#each data.groups as btn}
|
|
151
|
-
<button class="{$
|
|
162
|
+
<button class="{$selectedGroup === btn ? getColorStyles("background", data.color) : getColorStyles("button", "white")} px-4 py-2 transition ease-in-out duration-300" on:click={() => {
|
|
163
|
+
selectedGroup.update(_ => btn);
|
|
164
|
+
goto($page.url.pathname + $page.url.search);
|
|
165
|
+
}}>
|
|
152
166
|
{btn.name}
|
|
153
167
|
</button>
|
|
154
168
|
{/each}
|
|
@@ -162,8 +176,8 @@
|
|
|
162
176
|
|
|
163
177
|
<div class="hidden lg:absolute lg:inset-x-px lg:bottom-0 lg:top-4 lg:block" aria-hidden="true"></div>
|
|
164
178
|
|
|
165
|
-
{#if $
|
|
166
|
-
{#each $
|
|
179
|
+
{#if $selectedGroup.options}
|
|
180
|
+
{#each $selectedGroup.options as card}
|
|
167
181
|
|
|
168
182
|
<div class="relative ring-1 ring-white/30 lg:pb-14 {card.highlightOption ? getColorStyles("background", data.color) : "bg-white"} w-full shadow-lg">
|
|
169
183
|
<div class="p-8 lg:pt-12 xl:p-10 xl:pt-14">
|
|
@@ -233,10 +247,17 @@
|
|
|
233
247
|
{#each Object.values($selectedTable.categories) as category, categoryIndex}
|
|
234
248
|
|
|
235
249
|
<!-- Category Name -->
|
|
236
|
-
<
|
|
250
|
+
<div class="hidden sm:flex sticky top-32 z-20 bg-transparent flex-row">
|
|
251
|
+
|
|
252
|
+
<h4 id={makeIdString($selectedTable.name + " " + category.name)} class="scroll-mt-24 bg-white font-semibold leading-6 text-gray-900 pl-4 mr-8 py-2 w-full"><a href={"#"+makeIdString($selectedTable.name + " " + category.name)}>{category.name}</a></h4>
|
|
253
|
+
|
|
254
|
+
{#each $selectedTable.columns as col}
|
|
255
|
+
<div class="w-full"></div>
|
|
256
|
+
{/each}
|
|
257
|
+
</div>
|
|
237
258
|
|
|
238
259
|
<!-- Table -->
|
|
239
|
-
<div class="hidden relative sm:flex flex-col w-full
|
|
260
|
+
<div class="hidden relative sm:flex flex-col w-full shadow-lg">
|
|
240
261
|
{#each sortFeaturesByOrder(category.features) as feature, featureIndex}
|
|
241
262
|
<div class="w-full flex flex-row items-center justify-center {featureIndex !== Object.values(category.features).length - 1 ? "border-b" : ""} space-x-8">
|
|
242
263
|
<!-- Row Header -->
|
|
@@ -288,7 +309,7 @@
|
|
|
288
309
|
{/each}
|
|
289
310
|
|
|
290
311
|
<!-- Dummy div for background rings around features -->
|
|
291
|
-
<div class="pointer-events-none absolute flex flex-row before:block w-full h-full space-x-8 top-0
|
|
312
|
+
<div class="pointer-events-none absolute flex flex-row before:block w-full h-full space-x-8 top-0" aria-hidden="true">
|
|
292
313
|
<div class="w-full"></div>
|
|
293
314
|
{#each $selectedTable.columns as column}
|
|
294
315
|
<div class="w-full ring-gray-900/10 ring-inset {column.highlightOption ? getColorStyles("ring", data.color) + " ring-2" : "ring-1"}"></div>
|
|
@@ -320,7 +341,7 @@
|
|
|
320
341
|
{#if sortFeaturesByOrder(category.features, column.name).length > 0}
|
|
321
342
|
|
|
322
343
|
<!-- Category Headings -->
|
|
323
|
-
<h4 class="sticky top-44 sm:hidden block font-semibold leading-6 text-gray-900 w-full bg-white z-20 py-2">{category.name}</h4>
|
|
344
|
+
<h4 id={makeIdString(column.name + " " + category.name)} class="sticky top-44 sm:hidden block font-semibold leading-6 text-gray-900 w-full bg-white z-20 py-2 scroll-mt-36"><a href={"#" + makeIdString(column.name + " " + category.name)}>{category.name}</a></h4>
|
|
324
345
|
|
|
325
346
|
<div class="sm:hidden relative flex flex-col">
|
|
326
347
|
<!-- Tables -->
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { default as ContentTwoColumns } from "./components/ContentTwoColumns.sve
|
|
|
10
10
|
export { default as CountrySelector } from "./components/CountrySelector.svelte";
|
|
11
11
|
export { default as CTA } from "./components/CTA.svelte";
|
|
12
12
|
export { default as CTASplitImage } from "./components/CTASplitImage.svelte";
|
|
13
|
+
export { default as FaqTable } from "./components/FAQList.svelte";
|
|
13
14
|
export { default as FeatureGrid } from "./components/FeatureGrid.svelte";
|
|
14
15
|
export { default as FeatureTable } from "./components/FeatureTable.svelte";
|
|
15
16
|
export { default as Figure } from "./components/Figure.svelte";
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { default as ContentTwoColumns } from './components/ContentTwoColumns.sve
|
|
|
10
10
|
export { default as CountrySelector } from './components/CountrySelector.svelte';
|
|
11
11
|
export { default as CTA } from './components/CTA.svelte';
|
|
12
12
|
export { default as CTASplitImage } from './components/CTASplitImage.svelte';
|
|
13
|
+
export { default as FaqTable } from './components/FAQList.svelte';
|
|
13
14
|
export { default as FeatureGrid } from './components/FeatureGrid.svelte';
|
|
14
15
|
export { default as FeatureTable } from './components/FeatureTable.svelte';
|
|
15
16
|
export { default as Figure } from './components/Figure.svelte';
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
import PageNav from "../components/PageNav.svelte";
|
|
21
21
|
import Testimonial from "../components/Testimonial.svelte";
|
|
22
22
|
import PartnersList from "../components/PartnersList.svelte";
|
|
23
|
+
import FaqList from "../components/FAQList.svelte";
|
|
23
24
|
|
|
24
25
|
let blocks = [
|
|
25
26
|
{ ref: "accordion", component: Accordion},
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
{ ref: "pageNav", component: PageNav },
|
|
44
45
|
{ ref: "testimonial", component: Testimonial },
|
|
45
46
|
{ ref: "partners", component: PartnersList },
|
|
47
|
+
{ ref: "faq-list", component: FaqList }
|
|
46
48
|
];
|
|
47
49
|
|
|
48
50
|
export let data = {};
|