tecitheme 0.0.17 → 0.0.18

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/README.md CHANGED
@@ -5,3 +5,24 @@ SvelteKit Design System for Thunderhead web properties.
5
5
  NPM package available at: https://www.npmjs.com/package/tecitheme
6
6
 
7
7
  See https://tecitheme.netlify.app/ for demo, documentation and component details.
8
+
9
+ ## How to update the NPM package
10
+
11
+ This theme system is released on NPM to make it easier to include in all Thunderhead web properties.
12
+ ### Authenticate to NPM
13
+
14
+ 1. `npm adduser`
15
+ 2. Enter username and password for the npm account.
16
+ 3. Enter email address
17
+ 3. Enter 2FA Code
18
+
19
+ ### Update the package version
20
+
21
+ 1. Edit package.json with the next version.
22
+ 2. Commit and push to origin.
23
+
24
+ ### Package the project and publish
25
+
26
+ 1. `npm run package`
27
+ 2. `cd package`
28
+ 3. `npm publish`
@@ -18,8 +18,8 @@
18
18
  {#if data.links}
19
19
  <div class="flex flex-col space-x-0 space-y-8 justify-center items-center md:space-x-8 md:space-y-0 md:flex-row md:justify-around">
20
20
  {#each data.links as link}
21
- <div class="inline-flex shadow w-full max-w-xs">
22
- <a href={link.linkURL} class="whitespace-nowrap w-full inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-medium text-white bg-teci-blue-light hover:bg-teci-blue-dark">{link.linkText}</a>
21
+ <div class="inline-flex shadow-sm w-full max-w-xs">
22
+ <a href={link.linkURL} class="btn w-full inline-flex items-center px-5 py-3 text-base">{link.linkText}</a>
23
23
  </div>
24
24
  {/each}
25
25
  </div>
@@ -1,20 +1,23 @@
1
1
  <script>
2
2
  //Allows icons from https://fonts.google.com/icons?selected=Material+Icons by name in the format 'icon-XXXX'.
3
-
4
3
  import Icon from './Icon.svelte';
4
+ import Wrap from './Wrap.svelte';
5
5
  export let data;
6
6
  export let halfHeight;
7
7
  </script>
8
8
 
9
- <div class="group space-y-4">
9
+ <Wrap tag='a' when={!data.links} href={data.cardURL}>
10
+ <div class="group space-y-4 p-2 border border-gray-100 hover:border-gray-200 hover:shadow-md">
10
11
  {#if data.image}
11
- <div class="w-full {halfHeight ? 'aspect-video' : 'aspect-square'} bg-cover bg-no-repeat shadow-md border border-gray-200 flex items-center justify-center"
12
- style="background-image: url({data.image});"
13
- >
14
- <div class="md:group-hover:backdrop-grayscale py-8 flex flex-col w-full h-full justify-center items-center {halfHeight ? 'space-y-4' : 'space-y-8'} transition">
15
- {#each data.links as link}
16
- <a href={link.linkURL} class="whitespace-nowrap hidden md:group-hover:block btn w-3/4 text-center">{link.linkText}</a>
17
- {/each}
12
+ <div style="background-image: url({data.image});" class="w-full {halfHeight ? 'aspect-video' : 'aspect-square'} bg-cover bg-no-repeat border border-gray-200 flex items-center justify-center">
13
+ <div class="{halfHeight ? 'space-y-4' : 'space-y-8'} p-4 flex flex-col w-full h-full justify-center items-center">
14
+ {#if data.links}
15
+ {#each data.links as link}
16
+ <a href={link.linkURL} class="whitespace-nowrap text-sm btn w-3/4 text-center">{link.linkText}</a>
17
+ {/each}
18
+ {:else}
19
+ <span>&#8203;</span>
20
+ {/if}
18
21
  </div>
19
22
  </div>
20
23
  {/if}
@@ -36,11 +39,14 @@
36
39
  </div>
37
40
  </div>
38
41
  {#if data.text}
39
- <div class="text-lg">
42
+ <div class="text-lg w-full">
40
43
  <p class="text-gray-500">{data.text}</p>
41
- <span class="text-sm font-medium text-teci-blue-light lg:mt-4">{data.cardLinkText}<span aria-hidden="true">&nbsp;→</span></span>
44
+ <div class="w-full flex flex-col items-end">
45
+ <span class="inline-block max-w-sm text-center text-sm font-medium text-white mt-1 btn">{data.cardLinkText}</span>
46
+ </div>
42
47
  </div>
43
48
  {/if}
44
49
  </a>
45
50
  </div>
46
- </div>
51
+ </div>
52
+ </Wrap>
@@ -48,7 +48,7 @@
48
48
  </a>
49
49
  </li>
50
50
  <li>
51
- <a href="https://www.thunderheadeng.com/" class="text-base text-gray-300 hover:text-white">
51
+ <a href="https://www.thunderheadeng.com/other" class="text-base text-gray-300 hover:text-white">
52
52
  Other Tools
53
53
  </a>
54
54
  </li>
@@ -1,23 +1,28 @@
1
1
  <script>
2
2
  //Based on: https://tailwindui.com/components/marketing/sections/header#component-2c3b25e7b9e4490edd7b6950692c0a11
3
-
4
- export let data = {
5
- toptext: 'Small Top Text ',
6
- title: 'Big Title Text',
7
- subtitle: 'Subtitle Text - Fairly long to see where the text wraps for this element, because who knows where things will end up.'
8
- };
3
+ import Icon from "./Icon.svelte";
4
+ export let data;
9
5
  </script>
10
6
 
11
7
  <!-- This example requires Tailwind CSS v2.0+ -->
12
8
  <div class="w-full text-center">
13
9
  {#if data.toptext}
14
- <h2 class="text-base font-semibold text-teci-blue-dark tracking-wide uppercase">
10
+ <p class="text-base font-semibold text-teci-blue-dark uppercase">
15
11
  {data.toptext}
16
- </h2>
12
+ </p>
13
+ {/if}
14
+ {#if (data.title || data.logo)}
15
+ {#if data.logo}
16
+ <div class="grid place-items-center">
17
+ <h1 class="sr-only">{data.title}</h1>
18
+ <Icon classes={data.classes} icon={data.logo} />
19
+ </div>
20
+ {:else}
21
+ <h1 class="mt-1 text-4xl font-bold text-gray-900 sm:text-5xl sm:tracking-tight lg:text-6xl">
22
+ {data.title}
23
+ </h1>
24
+ {/if}
17
25
  {/if}
18
- <p class="mt-1 text-4xl font-bold text-gray-900 sm:text-5xl sm:tracking-tight lg:text-6xl">
19
- {data.title}
20
- </p>
21
26
  {#if data.subtitle}
22
27
  <p class="max-w-4xl mt-5 mx-auto text-xl text-gray-500">
23
28
  {data.subtitle}
@@ -2,11 +2,7 @@
2
2
  /** @typedef {typeof __propDef.events} HeadingCenteredEvents */
3
3
  /** @typedef {typeof __propDef.slots} HeadingCenteredSlots */
4
4
  export default class HeadingCentered extends SvelteComponentTyped<{
5
- data?: {
6
- toptext: string;
7
- title: string;
8
- subtitle: string;
9
- };
5
+ data: any;
10
6
  }, {
11
7
  [evt: string]: CustomEvent<any>;
12
8
  }, {}> {
@@ -17,11 +13,7 @@ export type HeadingCenteredSlots = typeof __propDef.slots;
17
13
  import { SvelteComponentTyped } from "svelte";
18
14
  declare const __propDef: {
19
15
  props: {
20
- data?: {
21
- toptext: string;
22
- title: string;
23
- subtitle: string;
24
- };
16
+ data: any;
25
17
  };
26
18
  events: {
27
19
  [evt: string]: CustomEvent<any>;
@@ -22,6 +22,15 @@
22
22
  title="PyroSim Results Icon"
23
23
  />
24
24
  </span>
25
+ {:else if icon == 'pyrosim-logo'}
26
+ <span class="not-prose">
27
+ <img
28
+ class={classes}
29
+ src="https://files.thunderheadeng.com/www/images/pyrosim_logo.svg"
30
+ alt="PyroSim Logo"
31
+ title="PyroSim Logo"
32
+ />
33
+ </span>
25
34
  {:else if icon == 'pathfinder'}
26
35
  <span class="not-prose">
27
36
  <img
@@ -40,6 +49,15 @@
40
49
  title="Pathfinder Results Icon"
41
50
  />
42
51
  </span>
52
+ {:else if icon == 'pathfinder-logo'}
53
+ <span class="not-prose">
54
+ <img
55
+ class={classes}
56
+ src="https://files.thunderheadeng.com/www/images/pathfinder_logo.svg"
57
+ alt="Pathfinder Logo"
58
+ title="Pathfinder Logo"
59
+ />
60
+ </span>
43
61
  {:else if icon == 'petrasim'}
44
62
  <span class="not-prose">
45
63
  <img
@@ -49,6 +67,44 @@
49
67
  title="PetraSim Icon"
50
68
  />
51
69
  </span>
70
+ {:else if icon == 'petrasim-logo'}
71
+ <span class="not-prose">
72
+ <img
73
+ class={classes}
74
+ src="https://files.thunderheadeng.com/www/images/petrasim_logo.svg"
75
+ alt="PetraSim Logo"
76
+ title="PetraSim Logo"
77
+ />
78
+ </span>
79
+ {:else if icon == 'teci-logo'}
80
+ <span class="not-prose">
81
+ <img
82
+ class={classes}
83
+ src="https://files.thunderheadeng.com/www/images/teci_logo.svg"
84
+ alt="Thunderhead Logo"
85
+ title="Thunderhead Logo"
86
+ />
87
+ </span>
88
+ {:else if icon == 'teci-icon'}
89
+ <span class="not-prose">
90
+ <svg class={classes} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 250 250">
91
+ <path
92
+ style="fill:#0c3879;fill-rule:evenodd;stroke:none"
93
+ d="M88.113 220.536h97.672v97.672H88.113z"
94
+ transform="matrix(2.5596 0 0 2.5596 -225.533 -564.483)"
95
+ />
96
+ <path
97
+ style="fill:#fff;fill-rule:evenodd;stroke:none"
98
+ d="M145.864 260.176h22.042c2.792 0 4.883.835 6.559 2.651 1.532 1.673 2.232 3.764 2.232 6.278 0 2.37-.7 4.464-2.232 6.277-1.676 1.675-3.767 2.651-6.559 2.651h-22.042v-17.857m0 23.159h22.042c2.792 0 4.883.838 6.559 2.65 1.532 1.674 2.232 3.768 2.232 6.278 0 2.373-.7 4.464-2.232 6.278-1.676 1.675-3.767 2.65-6.559 2.65h-22.042v-17.856"
99
+ transform="matrix(2.5596 0 0 2.5596 -225.533 -564.483)"
100
+ />
101
+ <path
102
+ style="fill:#fff;fill-rule:evenodd;stroke:none"
103
+ d="M132.471 301.192c-5.861 0-8.79-3.07-8.79-8.929l-.138-37.389-20.648-.14c-7.116-1.254-10.185-9.626-5.165-15.206 1.535-1.535 3.63-2.373 6.14-2.651h26.926l1.675.14h35.435c2.792 0 4.883.836 6.559 2.649 1.532 1.675 2.232 3.767 2.232 6.28 0 2.37-.7 4.464-2.232 6.277-1.676 1.673-3.767 2.651-6.559 2.651H141.26V301.192h-8.788"
104
+ transform="matrix(2.5596 0 0 2.5596 -225.533 -564.483)"
105
+ />
106
+ </svg>
107
+ </span>
52
108
  {:else if icon?.startsWith("icon-")}
53
109
  <span class="material-icons-outlined {classes}">{icon?.slice(5)}</span>
54
110
  {:else}
@@ -1,35 +1,73 @@
1
1
  <script>
2
2
  import { DateTime } from "luxon";
3
3
  import { getContext } from 'svelte';
4
+ import { paginate, LightPaginationNav } from 'svelte-paginate'
4
5
 
5
6
  export let data;
7
+
6
8
  const posts = getContext('newsPosts');
9
+ let filteredPosts = [];
10
+ let items = [];
11
+ let currentPage = 1;
12
+ let pageSize = data.pageSize;
13
+
14
+ function termExists(arr, terms) {
15
+ return terms.some(value => {
16
+ return arr.includes(value)
17
+ });
18
+ }
19
+
20
+ function filterPosts(arr, terms) {
21
+ for (let i = 0; i < arr.length;) {
22
+ if (termExists(arr[i].meta.categories, terms)) {
23
+ i++;
24
+ continue
25
+ };
26
+ arr.splice(i,1)
27
+ };
28
+ return arr;
29
+ };
30
+
31
+ if (data.filter) {
32
+ items = filterPosts(posts, data.filter);
33
+ } else {
34
+ items = posts;
35
+ }
36
+
37
+ $: paginatedItems = paginate({ items, pageSize, currentPage })
7
38
  </script>
8
39
 
9
- <div class="relative mx-auto w-full divide-y-2 divide-gray-200">
10
- <div class="flex flex-col sm:flex-row justify-between sm:items-end space-y-4 sm:space-y-0">
40
+ <div class="relative mx-auto w-full">
41
+ <div class="flex flex-col sm:flex-row justify-between sm:items-end space-y-4 sm:space-y-0 pb-4 border-b-2 border-gray-200">
11
42
  <div>
12
43
  <h1 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">{data.title}</h1>
13
44
  <p class="text-xl text-gray-500">{data.subtitle}</p>
14
45
  </div>
15
46
  <div class="w-32">
16
- <button class="w-full flex items-center justify-center px-4 py-2 border border-transparent text-base leading-6 font-medium text-white hover:bg-teci-blue-dark bg-teci-blue-light focus:outline-none focus:border-teci-blue-dark transition duration-150 ease-in-out"
17
- data-token="1cb5a0d7baa67f6265665b6f911f3487" onclick="mjOpenPopin(event, this)"
18
- >
19
- Subscribe
20
- </button>
47
+ <data id="mj-w-res-data" data-token="f594659941689957f270ca278a80dc7d" class="mj-w-data" data-apikey="3aOX" data-w-id="Fbu" data-lang="en_US" data-base="https://app.mailjet.com" data-width="640" data-height="480" data-statics="statics"></data>
48
+ <button class="w-full flex items-center justify-center px-4 py-2 border border-transparent text-base leading-6 font-medium text-white hover:bg-teci-blue-dark bg-teci-blue-light focus:outline-none focus:border-teci-blue-dark transition duration-150 ease-in-out" data-token="f594659941689957f270ca278a80dc7d" onclick="mjOpenPopin(event, this)">Subscribe</button>
21
49
  </div>
22
50
  </div>
23
51
  <div class="mt-6 grid gap-16 pt-10 md:grid-cols-2 lg:grid-cols-3 lg:gap-x-5 lg:gap-y-12">
24
- {#each posts as post}
52
+ {#each paginatedItems as post}
25
53
  <a class="block h-full" href={post.path}>
26
54
  <div class="flex flex-col items-stretch h-full">
27
55
  <time class="block mb-1 text-sm text-gray-500" datetime={post.meta.date}>{DateTime.fromISO(post.meta.date).toLocaleString()}</time>
28
56
  <p class="mb-2 text-xl font-semibold text-gray-900">{post.meta.title}</p>
29
- <p class="flex-1 mb-2 text-base text-gray-500">{post.meta.summary}</p>
57
+ <p class="flex-1 mb-2 text-base text-gray-500">{post.meta.summary.length > 190 ? post.meta.summary.substring(0,190) + " ..." : post.meta.summary}</p>
30
58
  <p class="text-sm font-semibold text-teci-blue-light hover:text-teci-blue-dark">Read full article<span aria-hidden="true">&nbsp;→</span></p>
31
59
  </div>
32
60
  </a>
33
61
  {/each}
34
62
  </div>
35
- </div>
63
+ <div class="pt-8 w-auto max-w-sm mx-auto">
64
+ <LightPaginationNav
65
+ totalItems="{items.length}"
66
+ pageSize="{pageSize ? pageSize : 6}"
67
+ currentPage="{currentPage}"
68
+ limit="{1}"
69
+ showStepOptions="{true}"
70
+ on:setPage="{(e) => currentPage = e.detail.page}"
71
+ />
72
+ </div>
73
+ </div>
@@ -1,4 +1,4 @@
1
- <script >import CountrySelector from './CountrySelector.svelte';
1
+ <script>import CountrySelector from './CountrySelector.svelte';
2
2
  import Icon from './Icon.svelte';
3
3
  import { onMount } from 'svelte';
4
4
  import { scrollTo, validateEmail } from '../utils.js';
@@ -242,7 +242,7 @@ const submitForm = async () => {
242
242
  </div>
243
243
  </div>
244
244
 
245
- <style >
245
+ <style>
246
246
  .confident {
247
247
  @apply hidden;
248
248
  }
@@ -0,0 +1,12 @@
1
+ <script>
2
+ export let tag = 'div';
3
+ export let when = true;
4
+ </script>
5
+
6
+ {#if when}
7
+ <svelte:element this={tag} {...$$restProps}>
8
+ <slot/>
9
+ </svelte:element>
10
+ {:else}
11
+ <slot/>
12
+ {/if}
@@ -0,0 +1,31 @@
1
+ /** @typedef {typeof __propDef.props} WrapProps */
2
+ /** @typedef {typeof __propDef.events} WrapEvents */
3
+ /** @typedef {typeof __propDef.slots} WrapSlots */
4
+ export default class Wrap extends SvelteComponentTyped<{
5
+ [x: string]: any;
6
+ tag?: string;
7
+ when?: boolean;
8
+ }, {
9
+ [evt: string]: CustomEvent<any>;
10
+ }, {
11
+ default: {};
12
+ }> {
13
+ }
14
+ export type WrapProps = typeof __propDef.props;
15
+ export type WrapEvents = typeof __propDef.events;
16
+ export type WrapSlots = typeof __propDef.slots;
17
+ import { SvelteComponentTyped } from "svelte";
18
+ declare const __propDef: {
19
+ props: {
20
+ [x: string]: any;
21
+ tag?: string;
22
+ when?: boolean;
23
+ };
24
+ events: {
25
+ [evt: string]: CustomEvent<any>;
26
+ };
27
+ slots: {
28
+ default: {};
29
+ };
30
+ };
31
+ export {};
@@ -37,9 +37,9 @@
37
37
  <article class="flex flex-col space-y-12 {layout}">
38
38
  {#each page_sections as section}
39
39
  {#if (section) && (section.fieldGroup === "sidebar-content")}
40
- <svelte:component this={blocks.find(obj=>obj.ref===section.fieldGroup).component} bind:data={section} {title} {date} {lastmod}><slot/></svelte:component>
40
+ <svelte:component this={blocks.find(obj=>obj.ref===section.fieldGroup).component} data={section} {title} {date} {lastmod}><slot/></svelte:component>
41
41
  {:else if (section) && (section.fieldGroup != "sidebar-content")}
42
- <svelte:component this={blocks.find(obj=>obj.ref===section.fieldGroup).component} bind:data={section} />
42
+ <svelte:component this={blocks.find(obj=>obj.ref===section.fieldGroup).component} data={section} />
43
43
  {/if}
44
44
  {/each}
45
45
  </article>
package/package.json CHANGED
@@ -1,43 +1,44 @@
1
1
  {
2
2
  "name": "tecitheme",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "svelte": true,
5
5
  "devDependencies": {
6
6
  "@jsdevtools/rehype-toc": "^3.0.2",
7
7
  "@sveltejs/adapter-auto": "next",
8
8
  "@sveltejs/adapter-netlify": "next",
9
9
  "@sveltejs/kit": "next",
10
- "@tailwindcss/forms": "^0.5.0",
10
+ "@tailwindcss/forms": "^0.5.1",
11
11
  "@tailwindcss/typography": "^0.5.2",
12
- "@types/cookie": "^0.5.0",
12
+ "@types/cookie": "^0.5.1",
13
13
  "@typescript-eslint/eslint-plugin": "^5.19.0",
14
- "@typescript-eslint/parser": "^5.19.0",
15
- "autoprefixer": "^10.4.4",
14
+ "@typescript-eslint/parser": "^5.22.0",
15
+ "autoprefixer": "^10.4.7",
16
16
  "dotenv": "^16.0.0",
17
17
  "encoding": "^0.1.13",
18
- "eslint": "^8.13.0",
18
+ "eslint": "^8.14.0",
19
19
  "eslint-config-prettier": "^8.5.0",
20
20
  "eslint-plugin-svelte3": "^3.4.1",
21
- "luxon": "^2.3.1",
21
+ "luxon": "^2.3.2",
22
22
  "mdsvex": "^0.10.5",
23
- "postcss": "^8.4.12",
23
+ "postcss": "^8.4.13",
24
24
  "prettier": "^2.6.2",
25
- "prettier-plugin-tailwindcss": "^0.1.9",
25
+ "prettier-plugin-tailwindcss": "^0.1.10",
26
26
  "rehype-parse": "^8.0.4",
27
27
  "rehype-slug": "^5.0.1",
28
28
  "rehype-stringify": "^9.0.3",
29
29
  "stream": "^0.0.2",
30
- "svelte": "^3.47.0",
30
+ "svelte": "^3.48.0",
31
31
  "svelte-check": "^2.7.0",
32
32
  "svelte-cubed": "^0.2.1",
33
+ "svelte-paginate": "^0.0.1",
33
34
  "svelte-preprocess": "^4.10.6",
34
35
  "svelte2tsx": "^0.5.9",
35
36
  "tailwindcss": "^3.0.24",
36
- "three": "^0.139.2",
37
- "tslib": "^2.3.1",
38
- "typescript": "^4.6.3",
39
- "vite": "^2.9.5",
40
- "vite-plugin-autoimport": "^1.6.3"
37
+ "three": "^0.140.0",
38
+ "tslib": "^2.4.0",
39
+ "typescript": "^4.6.4",
40
+ "vite": "^2.9.8",
41
+ "vite-plugin-autoimport": "^1.6.6"
41
42
  },
42
43
  "type": "module",
43
44
  "dependencies": {
@@ -66,6 +67,7 @@
66
67
  "./components/ThreeColumn.svelte": "./components/ThreeColumn.svelte",
67
68
  "./components/TrialForm.svelte": "./components/TrialForm.svelte",
68
69
  "./components/Video.svelte": "./components/Video.svelte",
70
+ "./components/Wrap.svelte": "./components/Wrap.svelte",
69
71
  "./layouts/blocks.svelte": "./layouts/blocks.svelte",
70
72
  "./req_utils": "./req_utils.js",
71
73
  "./utils": "./utils.js",