tecitheme 0.5.0 → 0.5.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/Accordion.svelte +74 -0
- package/dist/components/Accordion.svelte.d.ts +27 -0
- package/dist/components/Hero.svelte +7 -3
- package/dist/components/NewsGrid.svelte +10 -8
- package/dist/get-content.js +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/layouts/blocks.svelte +2 -0
- package/package.json +17 -17
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { slide } from "svelte/transition";
|
|
3
|
+
import { cubicIn, cubicOut } from "svelte/easing";
|
|
4
|
+
|
|
5
|
+
export let data={};
|
|
6
|
+
export let prompts=[];
|
|
7
|
+
export let title="";
|
|
8
|
+
|
|
9
|
+
let promptsArray;
|
|
10
|
+
let accordionTitle;
|
|
11
|
+
let openPrompts=[];
|
|
12
|
+
|
|
13
|
+
if (data.prompts) {
|
|
14
|
+
promptsArray = data.prompts;
|
|
15
|
+
} else if (prompts) {
|
|
16
|
+
promptsArray = prompts;
|
|
17
|
+
} else {
|
|
18
|
+
promptsArray = [];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (title) {
|
|
22
|
+
accordionTitle = title;
|
|
23
|
+
} else if (data.title) {
|
|
24
|
+
accordionTitle = data.title;
|
|
25
|
+
} else {
|
|
26
|
+
accordionTitle = "";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function addPrompt(id) {
|
|
30
|
+
openPrompts = [...openPrompts, id];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function removePrompt(id) {
|
|
34
|
+
openPrompts = openPrompts.filter((x) => x !== id);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<section class="mx-auto mb-8 w-full max-w-4xl divide-y divide-gray-900/10">
|
|
40
|
+
{#if accordionTitle}
|
|
41
|
+
<span class="text-2xl font-bold tracking-tight text-gray-900 mb-8">{accordionTitle}</span>
|
|
42
|
+
{/if}
|
|
43
|
+
<dl class="space-y-6 divide-y divide-gray-900/10">
|
|
44
|
+
{#each promptsArray as prompt, i}
|
|
45
|
+
<div id="prompt-{i}" class="pt-6">
|
|
46
|
+
<dt>
|
|
47
|
+
<button type="button"
|
|
48
|
+
on:click={() => openPrompts.includes(`prompt-${i}`) ? removePrompt(`prompt-${i}`) : addPrompt(`prompt-${i}`)}
|
|
49
|
+
class="flex w-full items-start justify-between text-left text-gray-900"
|
|
50
|
+
aria-controls="prompt-content-{i}"
|
|
51
|
+
aria-expanded={openPrompts.includes(`prompt-${i}`)}>
|
|
52
|
+
<span class="text-base font-semibold leading-7">{prompt.title}</span>
|
|
53
|
+
<span class="ml-6 flex h-7 items-center">
|
|
54
|
+
{#if (openPrompts.includes(`prompt-${i}`))}
|
|
55
|
+
<svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
56
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M18 12H6" />
|
|
57
|
+
</svg>
|
|
58
|
+
{:else}
|
|
59
|
+
<svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
60
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 6v12m6-6H6" />
|
|
61
|
+
</svg>
|
|
62
|
+
{/if}
|
|
63
|
+
</span>
|
|
64
|
+
</button>
|
|
65
|
+
</dt>
|
|
66
|
+
<dd id="prompt-content-{i}" class="mt-2 pr-12 transition-opacity ease-in duration-100 opacity-100 {openPrompts.includes(`prompt-${i}`) ? "opacity-100" : "opacity-0"}">
|
|
67
|
+
<p class="text-base leading-7 text-gray-600" class:hidden={!openPrompts.includes(`prompt-${i}`)}>
|
|
68
|
+
{@html prompt.content}
|
|
69
|
+
</p>
|
|
70
|
+
</dd>
|
|
71
|
+
</div>
|
|
72
|
+
{/each}
|
|
73
|
+
</dl>
|
|
74
|
+
</section>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} AccordionProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} AccordionEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} AccordionSlots */
|
|
4
|
+
export default class Accordion extends SvelteComponentTyped<{
|
|
5
|
+
data?: {};
|
|
6
|
+
title?: string;
|
|
7
|
+
prompts?: any[];
|
|
8
|
+
}, {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
}, {}> {
|
|
11
|
+
}
|
|
12
|
+
export type AccordionProps = typeof __propDef.props;
|
|
13
|
+
export type AccordionEvents = typeof __propDef.events;
|
|
14
|
+
export type AccordionSlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponentTyped } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
data?: {};
|
|
19
|
+
title?: string;
|
|
20
|
+
prompts?: any[];
|
|
21
|
+
};
|
|
22
|
+
events: {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
};
|
|
25
|
+
slots: {};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -22,9 +22,13 @@ import Icon from './Icon.svelte'
|
|
|
22
22
|
</h1>
|
|
23
23
|
{/if}
|
|
24
24
|
{#if data.banner_text}
|
|
25
|
-
<div class="mt-6 sm:mt-8 lg:mt-4">
|
|
26
|
-
<a href={data.
|
|
27
|
-
<span class="rounded-full bg-gray-300/10 px-3 py-1 text-sm font-semibold leading-6 {(data.color == "pyrosim" ? "text-pyrosim" : (data.color == "pathfinder" ? "text-pathfinder" : (data.color == "ventus" ? "text-ventus" : "text-teci-blue-dark")))} ring-1 ring-inset {(data.color == "pyrosim" ? "ring-pyrosim/20" : (data.color == "pathfinder" ? "ring-pathfinder/20" : (data.color == "ventus" ? "ring-ventus/20" : "ring-teci-blue-dark/20")))}">
|
|
25
|
+
<div class="mt-6 sm:mt-8 lg:mt-4 inline-flex space-x-6">
|
|
26
|
+
<a href={data.banner_url}>
|
|
27
|
+
<span class="rounded-full bg-gray-300/10 px-3 py-1 text-sm font-semibold leading-6 {(data.color == "pyrosim" ? "text-pyrosim" : (data.color == "pathfinder" ? "text-pathfinder" : (data.color == "ventus" ? "text-ventus" : "text-teci-blue-dark")))} ring-1 ring-inset {(data.color == "pyrosim" ? "ring-pyrosim/20" : (data.color == "pathfinder" ? "ring-pathfinder/20" : (data.color == "ventus" ? "ring-ventus/20" : "ring-teci-blue-dark/20")))}">
|
|
28
|
+
{data.banner_text}
|
|
29
|
+
</span>
|
|
30
|
+
</a>
|
|
31
|
+
<a href={data.banner_link_url}>
|
|
28
32
|
<span class="inline-flex items-center space-x-1 text-sm font-medium leading-6 text-gray-400">
|
|
29
33
|
<span>{data.banner_link_text}</span>
|
|
30
34
|
<!-- Heroicon name: mini/chevron-right -->
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
let filteredPosts = [];
|
|
10
10
|
let items = [];
|
|
11
11
|
let currentPage = 1;
|
|
12
|
-
let pageSize = data.pageSize;
|
|
12
|
+
let pageSize = (data.pageSize?data.pageSize:6);
|
|
13
13
|
let postLimit = data.limit;
|
|
14
|
-
let
|
|
14
|
+
let showArrows = (data.showArrows?data.showArrows:false);
|
|
15
|
+
let rangeLimit = (data.rangeLimit?data.rangeLimit:1)
|
|
16
|
+
let showPagination = (data.showPagination?data.showPagination:false);
|
|
15
17
|
let id
|
|
16
18
|
|
|
17
19
|
if (data.name) {
|
|
@@ -88,10 +90,10 @@
|
|
|
88
90
|
<div class="paginator mx-auto flex justify-center pt-4">
|
|
89
91
|
<PaginationNav
|
|
90
92
|
totalItems={items.length}
|
|
91
|
-
|
|
93
|
+
{pageSize}
|
|
92
94
|
{currentPage}
|
|
93
|
-
limit={
|
|
94
|
-
showStepOptions={
|
|
95
|
+
limit={rangeLimit}
|
|
96
|
+
showStepOptions={showArrows}
|
|
95
97
|
on:setPage={(e) => (currentPage = e.detail.page)}
|
|
96
98
|
/>
|
|
97
99
|
</div>
|
|
@@ -161,10 +163,10 @@
|
|
|
161
163
|
<div class="paginator mx-auto flex justify-center pt-8">
|
|
162
164
|
<PaginationNav
|
|
163
165
|
totalItems={items.length}
|
|
164
|
-
|
|
166
|
+
{pageSize}
|
|
165
167
|
{currentPage}
|
|
166
|
-
limit={
|
|
167
|
-
showStepOptions={
|
|
168
|
+
limit={rangeLimit}
|
|
169
|
+
showStepOptions={showArrows}
|
|
168
170
|
on:setPage={(e) => (currentPage = e.detail.page)}
|
|
169
171
|
/>
|
|
170
172
|
</div>
|
package/dist/get-content.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// get-content.js
|
|
2
2
|
// HTML parser from https://github.com/html-to-text/node-html-to-text
|
|
3
3
|
import { convert } from "html-to-text";
|
|
4
|
-
import {
|
|
4
|
+
import { PUBLIC_BUILD_MODE } from '$env/static/public';
|
|
5
5
|
|
|
6
6
|
const getContent = async (content='') => {
|
|
7
7
|
|
|
@@ -31,8 +31,8 @@ const getContent = async (content='') => {
|
|
|
31
31
|
|
|
32
32
|
if (
|
|
33
33
|
metadata.notIndexed ||
|
|
34
|
-
(
|
|
35
|
-
(
|
|
34
|
+
(PUBLIC_BUILD_MODE=='development' ? false : metadata.draft) ||
|
|
35
|
+
(PUBLIC_BUILD_MODE=='development' ? false : new Date(metadata.date) > today)
|
|
36
36
|
) {
|
|
37
37
|
return;
|
|
38
38
|
} else {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./utils.js";
|
|
2
2
|
export { default as getContent } from "./get-content.js";
|
|
3
|
+
export { default as Accordion } from "./components/Accordion.svelte";
|
|
3
4
|
export { default as Banner } from "./components/Banner.svelte";
|
|
4
5
|
export { default as Button } from "./components/Button.svelte";
|
|
5
6
|
export { default as Card } from "./components/Card.svelte";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './utils.js';
|
|
2
2
|
export { default as getContent } from './get-content.js';
|
|
3
|
+
export { default as Accordion } from './components/Accordion.svelte';
|
|
3
4
|
export { default as Banner } from './components/Banner.svelte';
|
|
4
5
|
export { default as Button } from './components/Button.svelte';
|
|
5
6
|
export { default as Card } from './components/Card.svelte';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import Accordion from "../components/Accordion.svelte";
|
|
2
3
|
import CTA from "../components/CTA.svelte";
|
|
3
4
|
import HeadingCentered from "../components/HeadingCentered.svelte";
|
|
4
5
|
import MediaFeature from "../components/MediaFeature.svelte";
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
import Testimonial from "../components/Testimonial.svelte";
|
|
20
21
|
|
|
21
22
|
let blocks = [
|
|
23
|
+
{ ref: "accordion", component: Accordion},
|
|
22
24
|
{ ref: "cta-center", component: CTA },
|
|
23
25
|
{ ref: "heading-centered", component: HeadingCentered },
|
|
24
26
|
{ ref: "media-feature", component: MediaFeature },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tecitheme",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev",
|
|
@@ -34,38 +34,38 @@
|
|
|
34
34
|
"@fontsource/inter": "^4.5.15",
|
|
35
35
|
"@fontsource/material-icons-outlined": "^4.5.4",
|
|
36
36
|
"@sveltejs/adapter-static": "2.0.1",
|
|
37
|
-
"@sveltejs/kit": "^1.
|
|
37
|
+
"@sveltejs/kit": "^1.15.2",
|
|
38
38
|
"@sveltejs/package": "^2.0.2",
|
|
39
39
|
"@tailwindcss/forms": "^0.5.3",
|
|
40
40
|
"@tailwindcss/typography": "^0.5.9",
|
|
41
|
-
"@tsconfig/svelte": "^
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
43
|
-
"@typescript-eslint/parser": "^5.
|
|
44
|
-
"autoprefixer": "^10.4.
|
|
45
|
-
"eslint": "^8.
|
|
46
|
-
"eslint-config-prettier": "^8.
|
|
41
|
+
"@tsconfig/svelte": "^4.0.1",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
|
43
|
+
"@typescript-eslint/parser": "^5.58.0",
|
|
44
|
+
"autoprefixer": "^10.4.14",
|
|
45
|
+
"eslint": "^8.38.0",
|
|
46
|
+
"eslint-config-prettier": "^8.8.0",
|
|
47
47
|
"eslint-plugin-svelte3": "^4.0.0",
|
|
48
|
-
"html-to-text": "^9.0.
|
|
48
|
+
"html-to-text": "^9.0.5",
|
|
49
49
|
"markdown-yaml-metadata-parser": "^3.0.0",
|
|
50
50
|
"mdsvex": "^0.10.6",
|
|
51
51
|
"postcss": "^8.4.21",
|
|
52
|
-
"prettier": "^2.8.
|
|
53
|
-
"prettier-plugin-tailwindcss": "^0.2.
|
|
52
|
+
"prettier": "^2.8.7",
|
|
53
|
+
"prettier-plugin-tailwindcss": "^0.2.7",
|
|
54
54
|
"rehype-slug": "^5.1.0",
|
|
55
|
-
"svelte": "^3.
|
|
56
|
-
"svelte-check": "^3.
|
|
55
|
+
"svelte": "^3.58.0",
|
|
56
|
+
"svelte-check": "^3.2.0",
|
|
57
57
|
"svelte-paginate": "^0.1.0",
|
|
58
58
|
"svelte-preprocess": "^5.0.3",
|
|
59
|
-
"svelte2tsx": "^0.6.
|
|
59
|
+
"svelte2tsx": "^0.6.11",
|
|
60
60
|
"sveltekit-autoimport": "^1.7.0",
|
|
61
|
-
"tailwindcss": "^3.
|
|
61
|
+
"tailwindcss": "^3.3.1",
|
|
62
62
|
"tslib": "^2.5.0",
|
|
63
|
-
"typescript": "^
|
|
63
|
+
"typescript": "^5.0.4",
|
|
64
64
|
"uuid-by-string": "^4.0.0",
|
|
65
65
|
"vite": "^4.2.1"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"katex": "^0.16.4",
|
|
69
|
-
"svelte": "^3.
|
|
69
|
+
"svelte": "^3.58.0"
|
|
70
70
|
}
|
|
71
71
|
}
|