tecitheme 0.0.12 → 0.0.13

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.
@@ -1,18 +1,13 @@
1
1
  <script>
2
2
  import Icon from "./Icon.svelte";
3
- import { scale } from 'svelte/transition';
4
3
  import { slide } from 'svelte/transition';
5
- import { cubicIn, cubicOut } from 'svelte/easing';
4
+ import { cubicIn, cubicOut, bounceIn, bounceOut } from 'svelte/easing';
6
5
 
7
- let mobileOpen = false;
8
- let productsOpen = false;
9
- let supportOpen = false;
10
- let eventsOpen = false;
11
- let companyOpen = false;
6
+ let openMenu = '';
12
7
 
13
8
  export function clickOutside(node) {
14
9
  const handleClick = (event) => {
15
- if (!node.contains(event.target)) {
10
+ if ((!node.contains(event.target)) && (event.target.innerText.toLowerCase() != node.parentElement.id)) {
16
11
  node.dispatchEvent(new CustomEvent("outclick"));
17
12
  }
18
13
  };
@@ -26,11 +21,7 @@
26
21
 
27
22
  function handleEscape({key}) {
28
23
  if (key === 'Escape') {
29
- mobileOpen = false;
30
- productsOpen = false;
31
- supportOpen = false;
32
- eventsOpen = false;
33
- companyOpen = false;
24
+ openMenu = '';
34
25
  }
35
26
  }
36
27
  </script>
@@ -52,18 +43,14 @@
52
43
  <div class="hidden md:flex-1 md:flex md:items-center md:justify-between">
53
44
  <nav class="flex md:space-x-6 lg:space-x-10">
54
45
  <!-- Products -->
55
- <div use:clickOutside on:outclick={() => (productsOpen = false)}>
56
- <!-- Item active: "text-gray-900", Item inactive: "text-gray-500" -->
57
- <button type="button" on:click={() => productsOpen = !productsOpen}
46
+ <div id="products">
47
+
48
+ <button type="button" on:click={() => ( openMenu == 'products' ? openMenu = '' : openMenu = 'products' )}
58
49
  class="text-gray-500 group bg-white inline-flex items-center text-base font-medium hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-teci-blue-light"
59
- aria-expanded="false">
60
- <span>Products</span>
61
- <!--
62
- Heroicon name: solid/chevron-down
63
-
64
- Item active: "text-gray-600", Item inactive: "text-gray-400"
65
- -->
66
- <svg class="text-gray-400 ml-2 h-5 w-5 group-hover:text-gray-500"
50
+ aria-expanded="{openMenu == 'products'}">
51
+ <span class:text-gray-900="{openMenu == 'products'}">Products</span>
52
+ <!-- Heroicon name: solid/chevron-down -->
53
+ <svg class="ml-2 h-5 w-5 group-hover:text-gray-900 {openMenu === 'products' ? 'text-gray-900 rotate-180' : 'text-gray-400'}"
67
54
  xmlns="http://www.w3.org/2000/svg"
68
55
  viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
69
56
  <path fill-rule="evenodd"
@@ -73,10 +60,11 @@
73
60
  </button>
74
61
 
75
62
  <!-- Flyout menu -->
76
- {#if productsOpen}
77
- <div class="absolute z-10 top-full inset-x-0 transform shadow-lg bg-white"
78
- in:slide={{ duration: 500, easing: cubicOut }}
79
- out:slide={{ duration: 300, easing: cubicIn }}
63
+ {#if openMenu == 'products'}
64
+ <div class="absolute z-10 top-full inset-x-0 transform shadow-lg bg-white"
65
+ use:clickOutside on:outclick={() => (openMenu = '')}
66
+ in:slide={{ duration: 250, easing: cubicOut }}
67
+ out:slide={{ duration: 150, easing: cubicIn }}
80
68
  >
81
69
  <div class="max-w-7xl mx-auto grid gap-y-8 px-4 py-8 sm:grid-cols-2 sm:gap-8 sm:px-6 lg:grid-cols-3 lg:px-8">
82
70
  <a href="https://www.thunderheadeng.com/pyrosim/" class="-m-3 p-3 flex flex-col justify-between hover:bg-gray-50">
@@ -141,32 +129,6 @@
141
129
  </div>
142
130
  </div>
143
131
  </a>
144
- <!--
145
- <a href="#" class="-m-3 p-3 flex flex-col justify-between hover:bg-gray-50">
146
- <div class="flex md:h-full lg:flex-col">
147
- <div class="flex-shrink-0">
148
- <span
149
- class="inline-flex items-center justify-center h-10 w-10 bg-teci-blue-light text-white sm:h-12 sm:w-12">
150
- <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
151
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.871 4A17.926 17.926 0 003 12c0 2.874.673 5.59 1.871 8m14.13 0a17.926 17.926 0 001.87-8c0-2.874-.673-5.59-1.87-8M9 9h1.246a1 1 0 01.961.725l1.586 5.55a1 1 0 00.961.725H15m1-7h-.08a2 2 0 00-1.519.698L9.6 15.302A2 2 0 018.08 16H8" />
152
- </svg>
153
- </span>
154
- </div>
155
- <div class="ml-4 md:flex-1 md:flex md:flex-col md:justify-between lg:ml-0 lg:mt-4">
156
- <div>
157
- <p class="text-base font-medium text-gray-900">
158
- Other Tools
159
- </p>
160
- <p class="mt-1 text-sm text-gray-500">
161
- Useful tools and resources distrubuted by Thunderhead.
162
- </p>
163
- </div>
164
- <p class="mt-2 text-sm font-medium text-teci-blue-light lg:mt-4">Learn more <span
165
- aria-hidden="true">&rarr;</span></p>
166
- </div>
167
- </div>
168
- </a>
169
- -->
170
132
  </div>
171
133
 
172
134
  <!-- Action Buttons -->
@@ -217,18 +179,14 @@
217
179
  </div>
218
180
 
219
181
  <!-- Support -->
220
- <div class="relative" use:clickOutside on:outclick={() => (supportOpen = false)}>
221
- <!-- Item active: "text-gray-900", Item inactive: "text-gray-500" -->
222
- <button type="button" on:click={() => supportOpen = !supportOpen}
182
+ <div id="support" class="relative">
183
+
184
+ <button type="button" on:click={() => ( openMenu == 'support' ? openMenu = '' : openMenu = 'support' )}
223
185
  class="text-gray-500 group bg-white inline-flex items-center text-base font-medium hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-teci-blue-light"
224
- aria-expanded="false">
225
- <span>Support</span>
226
- <!--
227
- Heroicon name: solid/chevron-down
228
-
229
- Item active: "text-gray-600", Item inactive: "text-gray-400"
230
- -->
231
- <svg class="text-gray-400 ml-2 h-5 w-5 group-hover:text-gray-500"
186
+ aria-expanded="{openMenu == 'support'}">
187
+ <span class:text-gray-900="{openMenu == 'support'}">Support</span>
188
+ <!-- Heroicon name: solid/chevron-down -->
189
+ <svg class="ml-2 h-5 w-5 group-hover:text-gray-900 {openMenu === 'support' ? 'text-gray-900 rotate-180' : 'text-gray-400'}"
232
190
  xmlns="http://www.w3.org/2000/svg"
233
191
  viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
234
192
  <path fill-rule="evenodd"
@@ -236,10 +194,12 @@
236
194
  clip-rule="evenodd" />
237
195
  </svg>
238
196
  </button>
239
- {#if supportOpen}
197
+
198
+ {#if openMenu == 'support'}
240
199
  <div class="absolute z-40 left-1/2 transform -translate-x-1/2 mt-3 px-2 w-screen max-w-md sm:px-0 shadow-lg ring-1 ring-black ring-opacity-5 overflow-hidden"
241
- in:slide={{ duration: 500, easing: cubicOut }}
242
- out:slide={{ duration: 300, easing: cubicIn }}
200
+ use:clickOutside on:outclick={() => (openMenu = '')}
201
+ in:slide={{ duration: 250, easing: cubicOut }}
202
+ out:slide={{ duration: 150, easing: cubicIn }}
243
203
  >
244
204
  <div class="relative grid gap-6 bg-white px-5 py-6 sm:gap-8 sm:p-8">
245
205
  <a href="https://support.thunderheadeng.com/docs/"
@@ -347,18 +307,14 @@
347
307
  </div>
348
308
 
349
309
  <!-- Events -->
350
- <div class="relative" use:clickOutside on:outclick={() => (eventsOpen = false)}>
351
- <!-- Item active: "text-gray-900", Item inactive: "text-gray-500" -->
352
- <button type="button" on:click={() => eventsOpen = !eventsOpen}
310
+ <div id="events" class="relative">
311
+
312
+ <button type="button" on:click={() => ( openMenu == 'events' ? openMenu = '' : openMenu = 'events' )}
353
313
  class="text-gray-500 group bg-white inline-flex items-center text-base font-medium hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-teci-blue-light"
354
- aria-expanded="false">
355
- <span>Events</span>
356
- <!--
357
- Heroicon name: solid/chevron-down
358
-
359
- Item active: "text-gray-600", Item inactive: "text-gray-400"
360
- -->
361
- <svg class="text-gray-400 ml-2 h-5 w-5 group-hover:text-gray-500"
314
+ aria-expanded="{openMenu == 'events'}">
315
+ <span class:text-gray-900="{openMenu == 'events'}">Events</span>
316
+ <!-- Heroicon name: solid/chevron-down -->
317
+ <svg class="text-gray-400 ml-2 h-5 w-5 group-hover:text-gray-900 {openMenu === 'events' ? 'text-gray-900 rotate-180' : 'text-gray-400'}"
362
318
  xmlns="http://www.w3.org/2000/svg"
363
319
  viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
364
320
  <path fill-rule="evenodd"
@@ -366,10 +322,12 @@
366
322
  clip-rule="evenodd" />
367
323
  </svg>
368
324
  </button>
369
- {#if eventsOpen}
325
+
326
+ {#if openMenu == 'events'}
370
327
  <div class="absolute z-40 left-1/2 transform -translate-x-1/2 mt-3 px-2 w-screen max-w-md sm:px-0 shadow-lg ring-1 ring-black ring-opacity-5 overflow-hidden"
371
- in:slide={{ duration: 500, easing: cubicOut }}
372
- out:slide={{ duration: 300, easing: cubicIn }}
328
+ use:clickOutside on:outclick={() => (openMenu = '')}
329
+ in:slide={{ duration: 250, easing: cubicOut }}
330
+ out:slide={{ duration: 150, easing: cubicIn }}
373
331
  >
374
332
  <div class="relative grid gap-6 bg-white px-5 py-6 sm:gap-8 sm:p-8">
375
333
  <a href="https://www.thunderheadeng.com/training/"
@@ -459,18 +417,14 @@
459
417
  </div>
460
418
 
461
419
  <!-- Company -->
462
- <div class="relative" use:clickOutside on:outclick={() => (companyOpen = false)}>
463
- <!-- Item active: "text-gray-900", Item inactive: "text-gray-500" -->
464
- <button type="button" on:click={() => companyOpen = !companyOpen}
420
+ <div id="company" class="relative">
421
+
422
+ <button type="button" on:click={() => ( openMenu == 'company' ? openMenu = '' : openMenu = 'company' )}
465
423
  class="text-gray-500 group bg-white inline-flex items-center text-base font-medium hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-teci-blue-light"
466
- aria-expanded="false">
467
- <span>Company</span>
468
- <!--
469
- Heroicon name: solid/chevron-down
470
-
471
- Item active: "text-gray-600", Item inactive: "text-gray-400"
472
- -->
473
- <svg class="text-gray-400 ml-2 h-5 w-5 group-hover:text-gray-500"
424
+ aria-expanded="{openMenu == 'company'}">
425
+ <span class:text-gray-900="{openMenu == 'company'}">Company</span>
426
+ <!-- Heroicon name: solid/chevron-down -->
427
+ <svg class="ml-2 h-5 w-5 group-hover:text-gray-900 {openMenu === 'company' ? 'text-gray-900 rotate-180' : 'text-gray-400'}"
474
428
  xmlns="http://www.w3.org/2000/svg"
475
429
  viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
476
430
  <path fill-rule="evenodd"
@@ -478,10 +432,12 @@
478
432
  clip-rule="evenodd" />
479
433
  </svg>
480
434
  </button>
481
- {#if companyOpen}
435
+
436
+ {#if openMenu == 'company'}
482
437
  <div class="absolute z-40 left-1/2 transform -translate-x-1/2 mt-3 px-2 w-screen max-w-md sm:px-0 shadow-lg ring-1 ring-black ring-opacity-5 overflow-hidden"
483
- in:slide={{ duration: 500, easing: cubicOut }}
484
- out:slide={{ duration: 300, easing: cubicIn }}
438
+ use:clickOutside on:outclick={() => (openMenu = '')}
439
+ in:slide={{ duration: 250, easing: cubicOut }}
440
+ out:slide={{ duration: 150, easing: cubicIn }}
485
441
  >
486
442
  <div class="relative grid gap-6 bg-white px-5 py-6 sm:gap-8 sm:p-8">
487
443
  <a href="https://www.thunderheadeng.com/about/"
@@ -611,10 +567,10 @@
611
567
 
612
568
  <!-- Mobile Menu Button-->
613
569
  <div class="md:hidden">
614
- <button type="button" on:click={() => mobileOpen = !mobileOpen}
570
+ <button type="button" on:click={() => openMenu = 'mobile'}
615
571
  class="bg-white p-2 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-teci-blue-light"
616
- aria-expanded="false">
617
- <span class="sr-only">Open menu</span>
572
+ aria-expanded="{openMenu == 'mobile'}">
573
+ <span class="sr-only">Open mobile menu</span>
618
574
  <!-- Heroicon name: outline/menu -->
619
575
  <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"
620
576
  aria-hidden="true">
@@ -625,22 +581,20 @@
625
581
  </div>
626
582
 
627
583
  <!-- Mobile menu, show/hide based on mobile menu state.-->
628
- {#if mobileOpen}
629
- <div use:clickOutside on:outclick={() => (mobileOpen = false)}
630
- in:slide={{ duration: 500, easing: cubicOut }}
631
- out:slide={{ duration: 300, easing: cubicIn }}
632
- class="absolute z-30 top-0 inset-x-0 md:hidden shadow-lg ring-1 ring-black ring-opacity-5 bg-white divide-y-2 divide-gray-50"
584
+ {#if openMenu == 'mobile'}
585
+ <div class="absolute z-30 top-0 inset-x-0 md:hidden shadow-lg ring-1 ring-black ring-opacity-5 bg-white divide-y-2 divide-gray-50"
586
+ use:clickOutside on:outclick={() => (openMenu = '')}
587
+ in:slide={{ duration: 250, easing: cubicOut }}
588
+ out:slide={{ duration: 150, easing: cubicIn }}
633
589
  >
634
590
  <div class="pt-5 pb-6 px-4 sm:pb-8">
635
591
  <div class="flex items-center justify-between">
636
- <div on:click={() => mobileOpen = !mobileOpen}>
637
- <a href="https://www.thunderheadeng.com">
638
- <img class="h-10 w-auto" src="https://files.thunderheadeng.com/support/images/te_logo.svg"
639
- alt="Thunderhead Engineering" />
640
- </a>
641
- </div>
592
+ <a class="block" href="https://www.thunderheadeng.com">
593
+ <img class="h-10 w-auto" src="https://files.thunderheadeng.com/support/images/te_logo.svg"
594
+ alt="Thunderhead Engineering" />
595
+ </a>
642
596
 
643
- <button type="button" on:click={() => mobileOpen = false}
597
+ <button type="button" on:click={() => openMenu = ''}
644
598
  class="bg-white p-2 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-teci-blue-light">
645
599
  <span class="sr-only">Close menu</span>
646
600
  <!-- Heroicon name: outline/x -->
@@ -650,7 +604,7 @@
650
604
  </svg>
651
605
  </button>
652
606
  </div>
653
- <div on:click={() => mobileOpen = !mobileOpen} class="mt-6 sm:mt-8">
607
+ <div on:click={() => openMenu = ''} class="mt-6 sm:mt-8">
654
608
  <nav>
655
609
  <div class="grid gap-7 sm:grid-cols-2 sm:gap-y-8 sm:gap-x-4">
656
610
  <a href="/product" class="-m-3 flex items-center p-3 hover:bg-gray-50">
@@ -713,7 +667,7 @@
713
667
  </nav>
714
668
  </div>
715
669
  </div>
716
- <div on:click={() => mobileOpen = !mobileOpen} class="py-6 px-5">
670
+ <div on:click={() => openMenu = ''} class="py-6 px-5">
717
671
  <div class="grid grid-cols-2 gap-4">
718
672
  <a href="https://www.thunderheadeng.com/news/" class="text-base font-medium text-gray-900 hover:text-gray-700">
719
673
  News
@@ -4,33 +4,59 @@
4
4
  export let classes;
5
5
  </script>
6
6
 
7
- <div>
8
7
  {#if icon == 'pyrosim'}
9
- <img
10
- class={classes}
11
- src="https://files.thunderheadeng.com/www/images/pyrosim_icon.svg"
12
- alt="PyroSim"
13
- title="PyroSim Icon"
14
- />
8
+ <span class="not-prose">
9
+ <img
10
+ class={classes}
11
+ src="https://files.thunderheadeng.com/www/images/pyrosim_icon.svg"
12
+ alt="PyroSim"
13
+ title="PyroSim Icon"
14
+ />
15
+ </span>
16
+ {:else if icon == 'pyrosim-results'}
17
+ <span class="not-prose">
18
+ <img
19
+ class={classes}
20
+ src="https://files.thunderheadeng.com/www/images/pyrosim-results_icon.svg"
21
+ alt="PyroSim Results"
22
+ title="PyroSim Results Icon"
23
+ />
24
+ </span>
15
25
  {:else if icon == 'pathfinder'}
16
- <img
17
- class={classes}
18
- src="https://files.thunderheadeng.com/www/images/pathfinder_icon.svg"
19
- alt="Pathfinder"
20
- title="Pathfinder Icon"
21
- />
26
+ <span class="not-prose">
27
+ <img
28
+ class={classes}
29
+ src="https://files.thunderheadeng.com/www/images/pathfinder_icon.svg"
30
+ alt="Pathfinder"
31
+ title="Pathfinder Icon"
32
+ />
33
+ </span>
34
+ {:else if icon == 'pathfinder-results'}
35
+ <span class="not-prose">
36
+ <img
37
+ class={classes}
38
+ src="https://files.thunderheadeng.com/www/images/pathfinder-results_icon.svg"
39
+ alt="Pathfinder Results"
40
+ title="Pathfinder Results Icon"
41
+ />
42
+ </span>
22
43
  {:else if icon == 'petrasim'}
44
+ <span class="not-prose">
23
45
  <img
24
46
  class={classes}
25
47
  src="https://files.thunderheadeng.com/www/images/petrasim_icon.svg"
26
48
  alt="PetraSim"
27
- title="PetraSim Icon"
49
+ title="PetraSim Icon"
28
50
  />
51
+ </span>
29
52
  {:else if icon?.startsWith("icon-")}
30
- <div class="{classes} w-12 bg-teci-blue-dark flex flex-col justify-center items-center">
53
+ <span class="not-prose">
54
+ <div class="{classes} bg-teci-blue-dark flex flex-col justify-center items-center">
31
55
  <span class="material-icons block text-4xl text-white">{icon?.slice(5)}</span>
32
56
  </div>
57
+ </span>
33
58
  {:else}
59
+ <span class="not-prose">
34
60
  <svg class={classes} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 250 250">
35
61
  <path
36
62
  style="fill:#0c3879;fill-rule:evenodd;stroke:none"
@@ -48,5 +74,5 @@
48
74
  transform="matrix(2.5596 0 0 2.5596 -225.533 -564.483)"
49
75
  />
50
76
  </svg>
51
- {/if}
52
- </div>
77
+ </span>
78
+ {/if}
@@ -51,7 +51,7 @@
51
51
  {/if}
52
52
  <div class="flex flex-row items-start space-x-4">
53
53
  {#if col.icon}
54
- <Icon classes="h-12 w-auto" icon={col.icon} />
54
+ <Icon classes="h-12 w-12" icon={col.icon} />
55
55
  {/if}
56
56
  <div class="leading-none font-medium flex flex-col">
57
57
  <h3 class="text-2xl leading-none">{col.heading}</h3>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tecitheme",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "svelte": true,
5
5
  "devDependencies": {
6
6
  "@jsdevtools/rehype-toc": "^3.0.2",