@uoguelph/web-components 0.0.7

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.
Files changed (76) hide show
  1. package/README.md +4 -0
  2. package/dist/cjs/index-160752dd.js +1825 -0
  3. package/dist/cjs/index.cjs.js +2 -0
  4. package/dist/cjs/loader.cjs.js +22 -0
  5. package/dist/cjs/uofg-footer_3.cjs.entry.js +528 -0
  6. package/dist/cjs/uofg-web-components.cjs.js +26 -0
  7. package/dist/collection/collection-manifest.json +14 -0
  8. package/dist/collection/components/uofg-footer/footer-links.js +5 -0
  9. package/dist/collection/components/uofg-footer/improve-life.svg +4 -0
  10. package/dist/collection/components/uofg-footer/social-links.js +5 -0
  11. package/dist/collection/components/uofg-footer/uofg-footer.css +173 -0
  12. package/dist/collection/components/uofg-footer/uofg-footer.js +23 -0
  13. package/dist/collection/components/uofg-header/decoration.svg +1 -0
  14. package/dist/collection/components/uofg-header/global-links.js +2 -0
  15. package/dist/collection/components/uofg-header/hello-you.js +4 -0
  16. package/dist/collection/components/uofg-header/logo-full-size.svg +1 -0
  17. package/dist/collection/components/uofg-header/logo-reduced-size.svg +1 -0
  18. package/dist/collection/components/uofg-header/page-specific.js +15 -0
  19. package/dist/collection/components/uofg-header/search.js +4 -0
  20. package/dist/collection/components/uofg-header/single-sign-on.js +2 -0
  21. package/dist/collection/components/uofg-header/uofg-header.css +548 -0
  22. package/dist/collection/components/uofg-header/uofg-header.js +131 -0
  23. package/dist/collection/components/uofg-menu/uofg-menu.js +440 -0
  24. package/dist/collection/index.js +1 -0
  25. package/dist/collection/utils/feature-check.js +2 -0
  26. package/dist/collection/utils/font-awesome-icon.js +7 -0
  27. package/dist/components/index.d.ts +36 -0
  28. package/dist/components/index.js +4 -0
  29. package/dist/components/index2.js +82 -0
  30. package/dist/components/uofg-footer.d.ts +11 -0
  31. package/dist/components/uofg-footer.js +100 -0
  32. package/dist/components/uofg-header.d.ts +11 -0
  33. package/dist/components/uofg-header.js +156 -0
  34. package/dist/components/uofg-menu.d.ts +11 -0
  35. package/dist/components/uofg-menu.js +6 -0
  36. package/dist/components/uofg-menu2.js +264 -0
  37. package/dist/esm/index-48bb3110.js +1796 -0
  38. package/dist/esm/index.js +1 -0
  39. package/dist/esm/loader.js +18 -0
  40. package/dist/esm/polyfills/core-js.js +11 -0
  41. package/dist/esm/polyfills/css-shim.js +1 -0
  42. package/dist/esm/polyfills/dom.js +79 -0
  43. package/dist/esm/polyfills/es5-html-element.js +1 -0
  44. package/dist/esm/polyfills/index.js +34 -0
  45. package/dist/esm/polyfills/system.js +6 -0
  46. package/dist/esm/uofg-footer_3.entry.js +522 -0
  47. package/dist/esm/uofg-web-components.js +21 -0
  48. package/dist/index.cjs.js +1 -0
  49. package/dist/index.js +1 -0
  50. package/dist/loader/cdn.js +3 -0
  51. package/dist/loader/index.cjs.js +3 -0
  52. package/dist/loader/index.d.ts +21 -0
  53. package/dist/loader/index.es2017.js +3 -0
  54. package/dist/loader/index.js +4 -0
  55. package/dist/loader/package.json +11 -0
  56. package/dist/types/components/uofg-footer/footer-links.d.ts +2 -0
  57. package/dist/types/components/uofg-footer/social-links.d.ts +2 -0
  58. package/dist/types/components/uofg-footer/uofg-footer.d.ts +3 -0
  59. package/dist/types/components/uofg-header/global-links.d.ts +2 -0
  60. package/dist/types/components/uofg-header/hello-you.d.ts +6 -0
  61. package/dist/types/components/uofg-header/page-specific.d.ts +17 -0
  62. package/dist/types/components/uofg-header/search.d.ts +2 -0
  63. package/dist/types/components/uofg-header/single-sign-on.d.ts +2 -0
  64. package/dist/types/components/uofg-header/uofg-header.d.ts +19 -0
  65. package/dist/types/components/uofg-menu/uofg-menu.d.ts +67 -0
  66. package/dist/types/components.d.ts +132 -0
  67. package/dist/types/index.d.ts +1 -0
  68. package/dist/types/stencil-public-runtime.d.ts +1640 -0
  69. package/dist/types/utils/feature-check.d.ts +2 -0
  70. package/dist/types/utils/font-awesome-icon.d.ts +5 -0
  71. package/dist/uofg-web-components/index.esm.js +0 -0
  72. package/dist/uofg-web-components/p-24bd712c.entry.js +1 -0
  73. package/dist/uofg-web-components/p-b6a9700a.js +2 -0
  74. package/dist/uofg-web-components/uofg-web-components.css +1 -0
  75. package/dist/uofg-web-components/uofg-web-components.esm.js +1 -0
  76. package/package.json +51 -0
@@ -0,0 +1,548 @@
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ :focus-visible {
6
+ outline: 2px solid #ffc72a;
7
+ outline-offset: 0.5rem;
8
+ }
9
+
10
+ a {
11
+ display: flex;
12
+ align-items: center;
13
+ text-decoration: none;
14
+ color: inherit;
15
+ transition-property: color, background-color;
16
+ transition-duration: 0.2s;
17
+ transition-timing-function: ease-in-out;
18
+ }
19
+
20
+ ul {
21
+ list-style: none;
22
+ margin: 0;
23
+ padding: 0;
24
+ }
25
+ ul > li {
26
+ display: contents;
27
+ }
28
+
29
+ button {
30
+ border: none;
31
+ background: none;
32
+ cursor: pointer;
33
+ font-size: inherit;
34
+ font-family: inherit;
35
+ color: inherit;
36
+ transition-property: color, background-color;
37
+ transition-duration: 0.2s;
38
+ transition-timing-function: ease-in-out;
39
+ }
40
+ button[type=submit] {
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ background-color: #d50029;
45
+ color: #fff;
46
+ padding: 0.5rem;
47
+ font-size: inherit;
48
+ font-family: inherit;
49
+ }
50
+
51
+ input[type=text],
52
+ input[type=password] {
53
+ background-color: #eff6f7;
54
+ border: 1px solid #69a3b9;
55
+ padding: 1rem;
56
+ color: #555555;
57
+ font-size: inherit;
58
+ font-family: inherit;
59
+ }
60
+ input[type=text]:focus-visible, input[type=text]:focus,
61
+ input[type=password]:focus-visible,
62
+ input[type=password]:focus {
63
+ outline: none;
64
+ background-color: #fffdf7;
65
+ }
66
+
67
+ uofg-menu {
68
+ --uofg-menu-animation-type: slide;
69
+ --uofg-menu-animation-duration: 0.2s;
70
+ --uofg-menu-animation-easing: ease-in-out;
71
+ display: block;
72
+ position: relative;
73
+ }
74
+ uofg-menu > [slot=button] {
75
+ display: flex;
76
+ align-items: center;
77
+ gap: 0.5rem;
78
+ height: 100%;
79
+ padding: 0 1rem;
80
+ }
81
+ uofg-menu > [slot=button] > svg {
82
+ height: 1em;
83
+ fill: currentColor;
84
+ transition-property: transform;
85
+ transition-duration: 0.2s;
86
+ transition-timing-function: ease-in-out;
87
+ }
88
+ uofg-menu > [slot=content] {
89
+ display: flex;
90
+ flex-direction: column;
91
+ position: absolute;
92
+ z-index: 1;
93
+ min-width: 20rem;
94
+ right: 0;
95
+ background-color: #fff;
96
+ color: #000;
97
+ box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0px 1px 5px 0px rgba(0, 0, 0, 0.2);
98
+ }
99
+
100
+ #uofg-header {
101
+ position: relative;
102
+ width: 100%;
103
+ z-index: 10000;
104
+ font-size: 1.6rem;
105
+ font-family: "Roboto Condensed", Arial, sans-serif;
106
+ }
107
+
108
+ #uofg-header-top-content-container,
109
+ #uofg-header-main-content-container,
110
+ #uofg-header-sub-content-container {
111
+ display: flex;
112
+ position: relative;
113
+ align-items: center;
114
+ justify-content: flex-end;
115
+ width: 100%;
116
+ padding: 0 calc((100vw - 1500px) / 2);
117
+ }
118
+
119
+ #uofg-header-top-content-container {
120
+ height: 3.5rem;
121
+ background-color: #fff;
122
+ color: #000;
123
+ z-index: 3;
124
+ }
125
+ #uofg-header-top-content-container > ul {
126
+ display: flex;
127
+ align-items: center;
128
+ height: 100%;
129
+ }
130
+ #uofg-header-top-content-container > ul > li > a {
131
+ height: 100%;
132
+ padding: 0 1rem;
133
+ }
134
+ #uofg-header-top-content-container > ul > li > a:hover, #uofg-header-top-content-container > ul > li > a:focus-visible, #uofg-header-top-content-container > ul > li > a[aria-expanded=true] {
135
+ background-color: #ddd;
136
+ }
137
+ #uofg-header-top-content-container > uofg-menu {
138
+ height: 100%;
139
+ }
140
+ #uofg-header-top-content-container > uofg-menu > [slot=button] {
141
+ padding: 0 1rem;
142
+ background-color: #ffc72a;
143
+ color: #000;
144
+ font-weight: bold;
145
+ }
146
+ #uofg-header-top-content-container > uofg-menu > [slot=button]:hover, #uofg-header-top-content-container > uofg-menu > [slot=button]:focus-visible, #uofg-header-top-content-container > uofg-menu > [slot=button][aria-expanded=true] {
147
+ background-color: #ccc;
148
+ color: #000;
149
+ }
150
+ #uofg-header-top-content-container > uofg-menu > [slot=button][aria-expanded=true] > svg {
151
+ transform: rotate(180deg);
152
+ }
153
+ #uofg-header-top-content-container > uofg-menu > [slot=content] {
154
+ background-color: #ddd;
155
+ color: #000;
156
+ }
157
+ #uofg-header-top-content-container > uofg-menu > [slot=content] a {
158
+ height: 100%;
159
+ padding: 0.75rem;
160
+ border-bottom: 1px solid rgba(0, 0, 0, 0.4);
161
+ }
162
+ #uofg-header-top-content-container > uofg-menu > [slot=content] a:hover, #uofg-header-top-content-container > uofg-menu > [slot=content] a:focus-visible {
163
+ background-color: #ffc72a;
164
+ }
165
+
166
+ #uofg-header-main-content-container {
167
+ height: 5rem;
168
+ background-color: #000;
169
+ color: #fff;
170
+ z-index: 2;
171
+ }
172
+ #uofg-header-main-content-container > * {
173
+ height: 100%;
174
+ }
175
+ #uofg-header-main-content-container.full-height {
176
+ height: 8rem;
177
+ }
178
+
179
+ #uofg-header-logo-container {
180
+ display: flex;
181
+ height: 100%;
182
+ margin-right: auto;
183
+ overflow: hidden;
184
+ }
185
+ #uofg-header-logo-container > * {
186
+ height: 100%;
187
+ }
188
+ #uofg-header-logo-container svg {
189
+ width: auto;
190
+ }
191
+
192
+ #uofg-header-decorative-img {
193
+ position: absolute;
194
+ left: 0;
195
+ }
196
+ #uofg-header-decorative-img > svg {
197
+ height: 100%;
198
+ }
199
+ @media screen and (max-width: 1500px) {
200
+ #uofg-header-decorative-img {
201
+ position: static;
202
+ }
203
+ }
204
+
205
+ #uofg-header-logo {
206
+ height: 100%;
207
+ position: relative;
208
+ margin-left: 1rem;
209
+ transition: opacity 0.2s ease-in-out;
210
+ }
211
+ #uofg-header-logo > svg {
212
+ height: 100%;
213
+ }
214
+ #uofg-header-logo:hover, #uofg-header-logo:focus-visible {
215
+ opacity: 0.8;
216
+ }
217
+ @media screen and (min-width: 1500px) and (max-width: calc(1500px + 7rem)) {
218
+ #uofg-header-logo {
219
+ position: absolute;
220
+ left: 0;
221
+ margin-left: 7rem;
222
+ }
223
+ }
224
+
225
+ #uofg-header-full-main-content,
226
+ #uofg-header-reduced-main-content {
227
+ display: flex;
228
+ }
229
+ #uofg-header-full-main-content svg,
230
+ #uofg-header-reduced-main-content svg {
231
+ height: 1em;
232
+ fill: currentColor;
233
+ }
234
+
235
+ #uofg-header-full-main-content > ul {
236
+ display: flex;
237
+ align-items: center;
238
+ }
239
+ #uofg-header-full-main-content > ul > li > a,
240
+ #uofg-header-full-main-content > a,
241
+ #uofg-header-full-main-content > uofg-menu > [slot=button] {
242
+ display: flex;
243
+ align-items: center;
244
+ justify-content: center;
245
+ height: 100%;
246
+ padding: 0 1.5rem;
247
+ font-size: 1.8rem;
248
+ transition-property: color, background-color;
249
+ transition-duration: 0.2s;
250
+ transition-timing-function: ease-in-out;
251
+ }
252
+ #uofg-header-full-main-content > ul > li > a:hover, #uofg-header-full-main-content > ul > li > a:focus-visible,
253
+ #uofg-header-full-main-content > a:hover,
254
+ #uofg-header-full-main-content > a:focus-visible,
255
+ #uofg-header-full-main-content > uofg-menu > [slot=button]:hover,
256
+ #uofg-header-full-main-content > uofg-menu > [slot=button]:focus-visible {
257
+ background-color: #333;
258
+ color: #ffc72a;
259
+ }
260
+ #uofg-header-full-main-content > uofg-menu > [slot=button] {
261
+ color: #ffc72a;
262
+ }
263
+ #uofg-header-full-main-content > uofg-menu > [slot=content] {
264
+ color: #000;
265
+ background-color: #fff;
266
+ padding: 2rem;
267
+ width: 35rem;
268
+ }
269
+ #uofg-header-full-main-content > uofg-menu > [slot=content] > span {
270
+ display: block;
271
+ font-size: 2.4rem;
272
+ font-weight: bold;
273
+ padding: 1rem 0;
274
+ }
275
+ #uofg-header-full-main-content > a {
276
+ color: #ffc72a;
277
+ }
278
+
279
+ #uofg-header-reduced-main-content > uofg-menu > [slot=button],
280
+ #uofg-header-reduced-main-content > a {
281
+ justify-content: center;
282
+ padding: 0 1.5rem;
283
+ font-size: 2rem;
284
+ border-left: 1px solid rgba(255, 255, 255, 0.15);
285
+ }
286
+ #uofg-header-reduced-main-content > uofg-menu > [slot=button]:hover, #uofg-header-reduced-main-content > uofg-menu > [slot=button]:focus-visible, #uofg-header-reduced-main-content > uofg-menu > [slot=button][aria-expanded=true],
287
+ #uofg-header-reduced-main-content > a:hover,
288
+ #uofg-header-reduced-main-content > a:focus-visible,
289
+ #uofg-header-reduced-main-content > a[aria-expanded=true] {
290
+ background-color: #fff;
291
+ color: #000;
292
+ }
293
+ #uofg-header-reduced-main-content > uofg-menu {
294
+ position: static;
295
+ height: 100%;
296
+ }
297
+ #uofg-header-reduced-main-content > uofg-menu > [slot=content] {
298
+ background-color: #fff;
299
+ color: #000;
300
+ width: 100%;
301
+ padding: 1rem 2rem 2rem;
302
+ }
303
+ #uofg-header-reduced-main-content > uofg-menu > [slot=content] > span {
304
+ display: block;
305
+ font-size: 2.4rem;
306
+ font-weight: bold;
307
+ padding: 1rem 0;
308
+ }
309
+
310
+ #uofg-header-main-menu > [slot=content] {
311
+ overflow-y: auto;
312
+ max-height: calc(100vh - 5rem);
313
+ }
314
+ #uofg-header-main-menu uofg-menu {
315
+ position: relative;
316
+ }
317
+ #uofg-header-main-menu uofg-menu > [slot=button] {
318
+ display: flex;
319
+ padding: 0.75rem;
320
+ height: auto;
321
+ width: 100%;
322
+ color: inherit;
323
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
324
+ }
325
+ #uofg-header-main-menu uofg-menu > [slot=button] > svg {
326
+ margin-left: auto;
327
+ }
328
+ #uofg-header-main-menu uofg-menu > [slot=button]:hover, #uofg-header-main-menu uofg-menu > [slot=button]:focus-visible, #uofg-header-main-menu uofg-menu > [slot=button][aria-expanded=true] {
329
+ background-color: rgba(0, 0, 0, 0.1);
330
+ }
331
+ #uofg-header-main-menu uofg-menu > [slot=button][aria-expanded=true] > svg {
332
+ transform: rotate(180deg);
333
+ }
334
+ #uofg-header-main-menu uofg-menu > [slot=content] {
335
+ position: relative;
336
+ box-shadow: none;
337
+ padding: 0;
338
+ }
339
+ #uofg-header-main-menu uofg-menu > [slot=content] > li > a {
340
+ padding: 0.75rem;
341
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
342
+ transition-property: color, background-color;
343
+ transition-duration: 0.2s;
344
+ transition-timing-function: ease-in-out;
345
+ }
346
+ #uofg-header-main-menu uofg-menu > [slot=content] > li > a:hover, #uofg-header-main-menu uofg-menu > [slot=content] > li > a:focus-visible {
347
+ background-color: rgba(0, 0, 0, 0.1);
348
+ }
349
+ #uofg-header-main-menu uofg-menu.uofg-header-hello-you-menu > [slot=button] {
350
+ background-color: #ffc72a;
351
+ color: #000;
352
+ font-weight: bold;
353
+ }
354
+ #uofg-header-main-menu uofg-menu.uofg-header-hello-you-menu > [slot=content] {
355
+ background-color: rgba(0, 0, 0, 0.1);
356
+ color: #000;
357
+ }
358
+ #uofg-header-main-menu ul > li > a {
359
+ padding: 0.75rem;
360
+ width: 100%;
361
+ color: inherit;
362
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
363
+ transition-property: color, background-color;
364
+ transition-duration: 0.2s;
365
+ transition-timing-function: ease-in-out;
366
+ }
367
+ #uofg-header-main-menu ul > li > a:hover, #uofg-header-main-menu ul > li > a:focus-visible, #uofg-header-main-menu ul > li > a[aria-expanded=true] {
368
+ background-color: rgba(0, 0, 0, 0.1);
369
+ }
370
+
371
+ /*
372
+ .uofg-header-account-menu {
373
+ .uofg-header-single-sign-on {
374
+ display: flex;
375
+ flex-direction: column;
376
+ width: 100%;
377
+ gap: 1rem;
378
+
379
+ label {
380
+ display: flex;
381
+ flex-direction: column;
382
+ gap: 0.5rem;
383
+ }
384
+
385
+ > input[type='text'],
386
+ > input[type='password'] {
387
+ height: 4rem;
388
+ width: 100%;
389
+ }
390
+
391
+ > button[type='submit'] {
392
+ height: 4rem;
393
+ width: 100%;
394
+ margin-top: 1rem;
395
+ }
396
+
397
+ > a {
398
+ color: #69a3b9;
399
+ text-decoration: underline;
400
+ }
401
+ }
402
+ }
403
+ */
404
+ .uofg-header-search-menu .uofg-header-search-bar {
405
+ display: flex;
406
+ align-items: center;
407
+ justify-content: center;
408
+ }
409
+ .uofg-header-search-menu .uofg-header-search-bar > input {
410
+ flex: 1;
411
+ }
412
+ .uofg-header-search-menu .uofg-header-search-bar > button[type=submit] {
413
+ width: 4rem;
414
+ height: 4rem;
415
+ }
416
+
417
+ #uofg-header-sub-content-container {
418
+ height: 4rem;
419
+ background-color: #ddd;
420
+ color: #000;
421
+ z-index: 1;
422
+ }
423
+ #uofg-header-sub-content-container #uofg-header-page-title {
424
+ display: flex;
425
+ align-items: center;
426
+ margin-right: auto;
427
+ padding: 0 1rem;
428
+ height: 100%;
429
+ font-weight: bold;
430
+ }
431
+ #uofg-header-sub-content-container uofg-menu {
432
+ position: relative;
433
+ height: 100%;
434
+ }
435
+ #uofg-header-sub-content-container uofg-menu > [slot=button] {
436
+ color: inherit;
437
+ }
438
+ #uofg-header-sub-content-container uofg-menu > [slot=button]:hover, #uofg-header-sub-content-container uofg-menu > [slot=button]:focus-visible, #uofg-header-sub-content-container uofg-menu > [slot=button][aria-expanded=true] {
439
+ background-color: #ffc72a;
440
+ color: #000;
441
+ }
442
+ #uofg-header-sub-content-container uofg-menu > [slot=content] {
443
+ position: absolute;
444
+ background-color: #ddd;
445
+ color: #000;
446
+ }
447
+ #uofg-header-sub-content-container uofg-menu > [slot=content] > li:not(:last-child) > a {
448
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
449
+ }
450
+ #uofg-header-sub-content-container uofg-menu > [slot=content] > li > a {
451
+ padding: 0.75rem;
452
+ justify-content: flex-start;
453
+ }
454
+ #uofg-header-sub-content-container a {
455
+ display: flex;
456
+ align-items: center;
457
+ justify-content: center;
458
+ height: 100%;
459
+ transition-property: color, background-color;
460
+ transition-duration: 0.2s;
461
+ transition-timing-function: ease-in-out;
462
+ }
463
+ #uofg-header-sub-content-container a:hover, #uofg-header-sub-content-container a:focus-visible {
464
+ background-color: #ffc72a;
465
+ color: #000;
466
+ }
467
+
468
+ #uofg-header-full-sub-content,
469
+ #uofg-header-reduced-sub-content {
470
+ height: 100%;
471
+ }
472
+ #uofg-header-full-sub-content a,
473
+ #uofg-header-reduced-sub-content a {
474
+ padding: 0 0.5rem;
475
+ }
476
+
477
+ #uofg-header-full-sub-content {
478
+ height: 100%;
479
+ }
480
+ #uofg-header-full-sub-content > ul {
481
+ display: flex;
482
+ align-items: center;
483
+ }
484
+ #uofg-header-full-sub-content uofg-menu > [slot=button][aria-expanded=true] > svg {
485
+ transform: rotate(180deg);
486
+ }
487
+ #uofg-header-full-sub-content .uofg-header-page-specific {
488
+ display: flex;
489
+ height: 100%;
490
+ align-items: center;
491
+ }
492
+
493
+ #uofg-header-reduced-sub-content > uofg-menu {
494
+ position: static;
495
+ }
496
+ #uofg-header-reduced-sub-content > uofg-menu > [slot=button] {
497
+ font-size: 2rem;
498
+ padding: 0 1.5rem;
499
+ }
500
+ #uofg-header-reduced-sub-content > uofg-menu > [slot=content] {
501
+ background-color: #fff;
502
+ color: #000;
503
+ padding: 2rem;
504
+ overflow-y: auto;
505
+ max-height: calc(100vh - 5rem - 4rem);
506
+ width: 100%;
507
+ }
508
+ #uofg-header-reduced-sub-content > uofg-menu > [slot=content] > span {
509
+ display: block;
510
+ font-size: 2.4rem;
511
+ font-weight: bold;
512
+ padding: 1rem 0;
513
+ }
514
+ #uofg-header-reduced-sub-content > uofg-menu > [slot=content] a {
515
+ height: auto;
516
+ padding: 1rem;
517
+ width: 100%;
518
+ align-items: flex-start;
519
+ justify-content: flex-start;
520
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
521
+ }
522
+ #uofg-header-reduced-sub-content > uofg-menu > [slot=content] a:hover, #uofg-header-reduced-sub-content > uofg-menu > [slot=content] a:focus-visible {
523
+ background-color: rgba(0, 0, 0, 0.1);
524
+ color: #000;
525
+ }
526
+ #uofg-header-reduced-sub-content > uofg-menu > [slot=content] uofg-menu {
527
+ height: auto;
528
+ }
529
+ #uofg-header-reduced-sub-content > uofg-menu > [slot=content] uofg-menu > [slot=button] {
530
+ width: 100%;
531
+ padding: 1rem;
532
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
533
+ }
534
+ #uofg-header-reduced-sub-content > uofg-menu > [slot=content] uofg-menu > [slot=button] > svg {
535
+ margin-left: auto;
536
+ }
537
+ #uofg-header-reduced-sub-content > uofg-menu > [slot=content] uofg-menu > [slot=button]:hover, #uofg-header-reduced-sub-content > uofg-menu > [slot=content] uofg-menu > [slot=button]:focus-visible, #uofg-header-reduced-sub-content > uofg-menu > [slot=content] uofg-menu > [slot=button][aria-expanded=true] {
538
+ background-color: rgba(0, 0, 0, 0.2);
539
+ color: #000;
540
+ }
541
+ #uofg-header-reduced-sub-content > uofg-menu > [slot=content] uofg-menu > [slot=button][aria-expanded=true] > svg {
542
+ transform: rotate(180deg);
543
+ }
544
+ #uofg-header-reduced-sub-content > uofg-menu > [slot=content] uofg-menu > [slot=content] {
545
+ position: static;
546
+ background-color: rgba(0, 0, 0, 0.1);
547
+ box-shadow: none;
548
+ }
@@ -0,0 +1,131 @@
1
+ import { h } from '@stencil/core';
2
+ import { PageSpecific } from './page-specific';
3
+ import Decoration from './decoration.svg';
4
+ import FullSizeLogo from './logo-full-size.svg';
5
+ import ReducedSizeLogo from './logo-reduced-size.svg';
6
+ import { GlobalLinks } from './global-links';
7
+ import { FontAwesomeIcon } from '../../utils/font-awesome-icon';
8
+ import { faBars, faRightToBracket, faSearch } from '@fortawesome/pro-solid-svg-icons';
9
+ import { HelloYou } from './hello-you';
10
+ import { SearchBar } from './search';
11
+ export class UofgHeader {
12
+ constructor() {
13
+ this.pageTitle = '';
14
+ this.pageUrl = '';
15
+ this.isFullSize = false;
16
+ this.pageSpecificContent = undefined;
17
+ }
18
+ connectedCallback() {
19
+ var _a;
20
+ this.updateFullSize();
21
+ this.updatePageSpecificContent();
22
+ (_a = this.observer) !== null && _a !== void 0 ? _a : (this.observer = new MutationObserver(() => {
23
+ this.updatePageSpecificContent();
24
+ }));
25
+ this.observer.observe(this.el, { childList: true });
26
+ }
27
+ updateFullSize() {
28
+ this.isFullSize = window.innerWidth >= 1024;
29
+ }
30
+ updatePageSpecificContent() {
31
+ var _a;
32
+ const aToPageSpecificLink = (a) => {
33
+ const attributes = {};
34
+ a.getAttributeNames()
35
+ .filter((name) => name !== 'href')
36
+ .forEach((name) => (attributes[name] = a.getAttribute(name)));
37
+ return {
38
+ href: a.getAttribute('href'),
39
+ text: a.textContent,
40
+ attributes
41
+ };
42
+ };
43
+ const firstChild = (_a = this.el) === null || _a === void 0 ? void 0 : _a.firstElementChild;
44
+ const root = (firstChild === null || firstChild === void 0 ? void 0 : firstChild.tagName) == 'TEMPLATE' ? firstChild === null || firstChild === void 0 ? void 0 : firstChild.content : this.el;
45
+ this.pageSpecificContent = Array.from(root.children)
46
+ .filter((child) => child.tagName === 'A' || child.tagName === 'UL')
47
+ .map((child) => {
48
+ switch (child.tagName) {
49
+ case 'A':
50
+ return aToPageSpecificLink(child);
51
+ case 'UL':
52
+ return {
53
+ title: child.getAttribute('data-title'),
54
+ links: Array.from(child.querySelectorAll('a')).map(aToPageSpecificLink)
55
+ };
56
+ }
57
+ });
58
+ }
59
+ render() {
60
+ return (h("header", { id: "uofg-header" }, this.isFullSize && (h("div", { id: "uofg-header-top-content-container" }, h("ul", null, h("li", null, h("a", { href: "https://bbis.alumni.uoguelph.ca/BBIS_Cannon/give/uofg" }, "GIVE")), h("li", null, h("a", { href: "/new-header/apply" }, "APPLY")), h("li", null, h("a", { href: "https://news.uoguelph.ca/" }, "NEWS"))), h(HelloYou, { autoCollapse: true }))), h("div", { id: "uofg-header-main-content-container", class: { 'full-height': this.isFullSize } }, h("div", { id: "uofg-header-logo-container" }, this.isFullSize && h("div", { id: "uofg-header-decorative-img", innerHTML: Decoration }), h("a", { id: "uofg-header-logo", href: "https://www.uoguelph.ca", innerHTML: this.isFullSize ? FullSizeLogo : ReducedSizeLogo, "aria-label": "University of Guelph Home Page" })), this.isFullSize ? (h("div", { id: "uofg-header-full-main-content", class: "uofg-header-main-content" }, h(GlobalLinks, null), h("a", { href: "https://intranet.uoguelph.ca", "aria-label": "Intranet" }, h(FontAwesomeIcon, { icon: faRightToBracket })), h("uofg-menu", { class: "uofg-header-search-menu", "auto-collapse": true }, h("button", { slot: "button", "aria-label": "Search Menu" }, h(FontAwesomeIcon, { icon: faSearch })), h("div", { slot: "content" }, h("span", null, "Search the University of Guelph"), h(SearchBar, null))))) : (h("div", { id: "uofg-header-reduced-main-content", class: "uofg-header-main-content" }, h("a", { href: "https://intranet.uoguelph.ca", "aria-label": "Intranet" }, h(FontAwesomeIcon, { icon: faRightToBracket })), h("uofg-menu", { class: "uofg-header-search-menu", "auto-collapse": true }, h("button", { slot: "button", "aria-label": "Search Menu" }, h(FontAwesomeIcon, { icon: faSearch })), h("div", { slot: "content" }, h("span", null, "Search the University of Guelph"), h(SearchBar, null))), h("uofg-menu", { id: "uofg-header-main-menu", "auto-collapse": true }, h("button", { slot: "button", "aria-label": "Main Menu" }, h(FontAwesomeIcon, { icon: faBars })), h("div", { slot: "content" }, h("span", null, "University of Guelph"), h(GlobalLinks, null), h(HelloYou, { autoCollapse: false })))))), this.pageSpecificContent.length > 0 && (h("div", { id: "uofg-header-sub-content-container" }, this.pageTitle &&
61
+ (this.pageUrl ? (h("a", { id: "uofg-header-page-title", href: this.pageUrl }, this.pageTitle)) : (h("span", { id: "uofg-header-page-title" }, this.pageTitle))), this.isFullSize ? (h("div", { id: "uofg-header-full-sub-content", class: "uofg-header-sub-content" }, h(PageSpecific, { content: this.pageSpecificContent, autoCollapseMenus: true }))) : (h("div", { id: "uofg-header-reduced-sub-content", class: "uofg-header-sub-content" }, h("uofg-menu", { id: "uofg-header-sub-menu", "auto-collapse": true }, h("button", { slot: "button", "aria-label": this.pageTitle + ' Menu' }, h(FontAwesomeIcon, { icon: faBars })), h("div", { slot: "content" }, h(PageSpecific, { content: this.pageSpecificContent })))))))));
62
+ }
63
+ static get is() { return "uofg-header"; }
64
+ static get encapsulation() { return "shadow"; }
65
+ static get originalStyleUrls() {
66
+ return {
67
+ "$": ["uofg-header.scss"]
68
+ };
69
+ }
70
+ static get styleUrls() {
71
+ return {
72
+ "$": ["uofg-header.css"]
73
+ };
74
+ }
75
+ static get properties() {
76
+ return {
77
+ "pageTitle": {
78
+ "type": "string",
79
+ "mutable": false,
80
+ "complexType": {
81
+ "original": "string",
82
+ "resolved": "string",
83
+ "references": {}
84
+ },
85
+ "required": false,
86
+ "optional": false,
87
+ "docs": {
88
+ "tags": [],
89
+ "text": "The title of the pages that the header is being used on. For example, for the Convocation pages, this would be set to \"Convocation\"."
90
+ },
91
+ "attribute": "page-title",
92
+ "reflect": false,
93
+ "defaultValue": "''"
94
+ },
95
+ "pageUrl": {
96
+ "type": "string",
97
+ "mutable": false,
98
+ "complexType": {
99
+ "original": "string",
100
+ "resolved": "string",
101
+ "references": {}
102
+ },
103
+ "required": false,
104
+ "optional": false,
105
+ "docs": {
106
+ "tags": [],
107
+ "text": "The URL to the home/landing page for the pages the header is being used on. For example, for the Convocation pages, this would be set to \"https://www.uoguelph.ca/convocation/\"."
108
+ },
109
+ "attribute": "page-url",
110
+ "reflect": false,
111
+ "defaultValue": "''"
112
+ }
113
+ };
114
+ }
115
+ static get states() {
116
+ return {
117
+ "isFullSize": {},
118
+ "pageSpecificContent": {}
119
+ };
120
+ }
121
+ static get elementRef() { return "el"; }
122
+ static get listeners() {
123
+ return [{
124
+ "name": "resize",
125
+ "method": "updateFullSize",
126
+ "target": "window",
127
+ "capture": false,
128
+ "passive": true
129
+ }];
130
+ }
131
+ }