@uoguelph/web-components 0.0.16 → 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 +8 -0
- package/dist/cjs/{index-f0452ddd.js → index-52617c57.js} +11 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{uofg-footer_3.cjs.entry.js → uofg-alert_6.cjs.entry.js} +230 -82
- package/dist/cjs/uofg-web-components.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/uofg-alert/uofg-alert.css +46 -0
- package/dist/collection/components/uofg-alert/uofg-alert.js +20 -0
- package/dist/collection/components/uofg-back-to-top/uofg-back-to-top.css +40 -0
- package/dist/collection/components/uofg-back-to-top/uofg-back-to-top.js +68 -0
- package/dist/collection/components/uofg-header/uofg-header.js +2 -2
- package/dist/collection/components/uofg-menu/uofg-menu.js +28 -50
- package/dist/collection/components/uofg-modal/uofg-modal.css +80 -0
- package/dist/collection/components/uofg-modal/uofg-modal.js +325 -0
- package/dist/collection/utils/utils.js +6 -0
- package/dist/components/font-awesome-icon.js +10 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index2.js +12 -10
- package/dist/components/uofg-alert.d.ts +11 -0
- package/dist/components/uofg-alert.js +40 -0
- package/dist/components/uofg-back-to-top.d.ts +11 -0
- package/dist/components/uofg-back-to-top.js +48 -0
- package/dist/components/uofg-footer.js +2 -1
- package/dist/components/uofg-header.js +2 -1
- package/dist/components/uofg-menu2.js +31 -46
- package/dist/components/uofg-modal.d.ts +11 -0
- package/dist/components/uofg-modal.js +139 -0
- package/dist/components/utils.js +8 -0
- package/dist/esm/{index-24999f13.js → index-ebf79156.js} +11 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{uofg-footer_3.entry.js → uofg-alert_6.entry.js} +228 -83
- package/dist/esm/uofg-web-components.js +3 -3
- package/dist/types/components/uofg-alert/uofg-alert.d.ts +3 -0
- package/dist/types/components/uofg-back-to-top/uofg-back-to-top.d.ts +10 -0
- package/dist/types/components/uofg-header/uofg-header.d.ts +2 -2
- package/dist/types/components/uofg-menu/uofg-menu.d.ts +4 -4
- package/dist/types/components/uofg-modal/uofg-modal.d.ts +61 -0
- package/dist/types/components.d.ts +116 -4
- package/dist/types/utils/{feature-check.d.ts → utils.d.ts} +1 -0
- package/dist/uofg-web-components/p-2c75433c.entry.js +1 -0
- package/dist/uofg-web-components/p-bc82feb9.js +2 -0
- package/dist/uofg-web-components/uofg-web-components.css +1 -1
- package/dist/uofg-web-components/uofg-web-components.esm.js +1 -1
- package/package.json +4 -3
- package/dist/collection/utils/feature-check.js +0 -2
- package/dist/uofg-web-components/p-b7dfbfdc.js +0 -2
- package/dist/uofg-web-components/p-d87070ab.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, r as registerInstance, g as getElement, c as createEvent, H as Host } from './index-
|
|
1
|
+
import { h, r as registerInstance, g as getElement, c as createEvent, H as Host } from './index-ebf79156.js';
|
|
2
2
|
|
|
3
3
|
const FontAwesomeIcon = props => {
|
|
4
4
|
const width = props.icon.icon[0];
|
|
@@ -7,49 +7,23 @@ const FontAwesomeIcon = props => {
|
|
|
7
7
|
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: `0 0 ${width} ${height}` }, Array.isArray(iconPathData) ? (iconPathData.map(path => h("path", { d: path }))) : (h("path", { d: iconPathData }))));
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
prefix: '
|
|
12
|
-
iconName: '
|
|
13
|
-
icon: [
|
|
14
|
-
};
|
|
15
|
-
var faTwitterSquare = faSquareTwitter;
|
|
16
|
-
var faTiktok = {
|
|
17
|
-
prefix: 'fab',
|
|
18
|
-
iconName: 'tiktok',
|
|
19
|
-
icon: [448, 512, [], "e07b", "M448,209.91a210.06,210.06,0,0,1-122.77-39.25V349.38A162.55,162.55,0,1,1,185,188.31V278.2a74.62,74.62,0,1,0,52.23,71.18V0l88,0a121.18,121.18,0,0,0,1.86,22.17h0A122.18,122.18,0,0,0,381,102.39a121.43,121.43,0,0,0,67,20.14Z"]
|
|
20
|
-
};
|
|
21
|
-
var faSquareFacebook = {
|
|
22
|
-
prefix: 'fab',
|
|
23
|
-
iconName: 'square-facebook',
|
|
24
|
-
icon: [448, 512, ["facebook-square"], "f082", "M400 32H48A48 48 0 0 0 0 80v352a48 48 0 0 0 48 48h137.25V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.27c-30.81 0-40.42 19.12-40.42 38.73V256h68.78l-11 71.69h-57.78V480H400a48 48 0 0 0 48-48V80a48 48 0 0 0-48-48z"]
|
|
25
|
-
};
|
|
26
|
-
var faFacebookSquare = faSquareFacebook;
|
|
27
|
-
var faLinkedin = {
|
|
28
|
-
prefix: 'fab',
|
|
29
|
-
iconName: 'linkedin',
|
|
30
|
-
icon: [448, 512, [], "f08c", "M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"]
|
|
31
|
-
};
|
|
32
|
-
var faInstagram = {
|
|
33
|
-
prefix: 'fab',
|
|
34
|
-
iconName: 'instagram',
|
|
35
|
-
icon: [448, 512, [], "f16d", "M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"]
|
|
36
|
-
};
|
|
37
|
-
var faYoutube = {
|
|
38
|
-
prefix: 'fab',
|
|
39
|
-
iconName: 'youtube',
|
|
40
|
-
icon: [576, 512, [61802], "f167", "M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"]
|
|
10
|
+
var faCircleExclamation = {
|
|
11
|
+
prefix: 'far',
|
|
12
|
+
iconName: 'circle-exclamation',
|
|
13
|
+
icon: [512, 512, ["exclamation-circle"], "f06a", "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c-13.3 0-24 10.7-24 24V264c0 13.3 10.7 24 24 24s24-10.7 24-24V152c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
|
|
41
14
|
};
|
|
42
15
|
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
16
|
+
const uofgAlertCss = ":host{display:block}*{box-sizing:border-box}#uofg-alert{display:flex;flex-direction:column;font-size:2rem}#uofg-alert #uofg-alert-title{display:flex;align-items:center;font-size:2.25rem;padding:2rem;color:white;background-color:#C10631}#uofg-alert #uofg-alert-title>svg{margin-right:1rem;fill:currentColor;height:1.5em}#uofg-alert #uofg-alert-body{display:flex;flex-direction:column;padding:1.5rem 2rem;background-color:white}#uofg-alert #uofg-alert-body slot[name=subtitle]::slotted(*){font-size:2rem;margin-bottom:2rem;font-weight:bold}#uofg-alert #uofg-alert-body slot[name=message]::slotted(*){font-size:1.6rem}#uofg-alert #uofg-alert-footer{display:flex;padding:1rem 2rem;background-color:#DDDDDD;font-size:1.4rem}";
|
|
17
|
+
|
|
18
|
+
const UofgAlert = class {
|
|
19
|
+
constructor(hostRef) {
|
|
20
|
+
registerInstance(this, hostRef);
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return (h("div", { id: "uofg-alert" }, h("div", { id: "uofg-alert-title" }, h(FontAwesomeIcon, { icon: faCircleExclamation }), h("slot", { name: "title" })), h("div", { id: "uofg-alert-body" }, h("slot", { name: "subtitle" }), h("slot", { name: "message" })), h("div", { id: "uofg-alert-footer" }, h("slot", { name: "footer" }))));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
UofgAlert.style = uofgAlertCss;
|
|
53
27
|
|
|
54
28
|
var faTrees = {
|
|
55
29
|
prefix: 'fas',
|
|
@@ -71,6 +45,11 @@ var faList = {
|
|
|
71
45
|
iconName: 'list',
|
|
72
46
|
icon: [512, 512, ["list-squares"], "f03a", "M40 48C26.7 48 16 58.7 16 72v48c0 13.3 10.7 24 24 24H88c13.3 0 24-10.7 24-24V72c0-13.3-10.7-24-24-24H40zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zM16 232v48c0 13.3 10.7 24 24 24H88c13.3 0 24-10.7 24-24V232c0-13.3-10.7-24-24-24H40c-13.3 0-24 10.7-24 24zM40 368c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24H88c13.3 0 24-10.7 24-24V392c0-13.3-10.7-24-24-24H40z"]
|
|
73
47
|
};
|
|
48
|
+
var faChevronUp = {
|
|
49
|
+
prefix: 'fas',
|
|
50
|
+
iconName: 'chevron-up',
|
|
51
|
+
icon: [512, 512, [], "f077", "M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"]
|
|
52
|
+
};
|
|
74
53
|
var faKey = {
|
|
75
54
|
prefix: 'fas',
|
|
76
55
|
iconName: 'key',
|
|
@@ -117,12 +96,84 @@ var faMagnifyingGlass = {
|
|
|
117
96
|
icon: [512, 512, [128269, "search"], "f002", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]
|
|
118
97
|
};
|
|
119
98
|
var faSearch = faMagnifyingGlass;
|
|
99
|
+
var faXmark = {
|
|
100
|
+
prefix: 'fas',
|
|
101
|
+
iconName: 'xmark',
|
|
102
|
+
icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]
|
|
103
|
+
};
|
|
104
|
+
var faTimes = faXmark;
|
|
120
105
|
var faBriefcase = {
|
|
121
106
|
prefix: 'fas',
|
|
122
107
|
iconName: 'briefcase',
|
|
123
108
|
icon: [512, 512, [128188], "f0b1", "M184 48H328c4.4 0 8 3.6 8 8V96H176V56c0-4.4 3.6-8 8-8zm-56 8V96H64C28.7 96 0 124.7 0 160v96H192 320 512V160c0-35.3-28.7-64-64-64H384V56c0-30.9-25.1-56-56-56H184c-30.9 0-56 25.1-56 56zM512 288H320v32c0 17.7-14.3 32-32 32H224c-17.7 0-32-14.3-32-32V288H0V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V288z"]
|
|
124
109
|
};
|
|
125
110
|
|
|
111
|
+
const uofgBackToTopCss = ":host{display:block}:focus-visible{outline:2px solid #ffc72a;outline-offset:0.5rem}#uofg-back-to-top{position:fixed;margin:10px;height:35px;width:35px;right:0;bottom:0;z-index:1000;cursor:pointer;background-color:black;color:white;transition-duration:0.3s;transition-timing-function:ease-in-out;transition-property:opacity, visibility, background-color;opacity:0;visibility:hidden;border-radius:50%;border:1px solid #fff}#uofg-back-to-top:hover{background-color:#d50029}#uofg-back-to-top>svg{width:1em;height:1em;fill:currentColor}#uofg-back-to-top.visible{opacity:1;visibility:visible}";
|
|
112
|
+
|
|
113
|
+
const UofgBackToTop = class {
|
|
114
|
+
constructor(hostRef) {
|
|
115
|
+
registerInstance(this, hostRef);
|
|
116
|
+
this.threshold = 50;
|
|
117
|
+
this.isVisible = false;
|
|
118
|
+
}
|
|
119
|
+
connectedCallback() {
|
|
120
|
+
this.onScroll();
|
|
121
|
+
}
|
|
122
|
+
onScroll() {
|
|
123
|
+
this.isVisible = window.scrollY >= this.threshold;
|
|
124
|
+
}
|
|
125
|
+
render() {
|
|
126
|
+
return (h("button", { id: "uofg-back-to-top", "aria-label": "Go back to the top", class: { visible: this.isVisible }, onClick: () => {
|
|
127
|
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
128
|
+
} }, h(FontAwesomeIcon, { icon: faChevronUp })));
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
UofgBackToTop.style = uofgBackToTopCss;
|
|
132
|
+
|
|
133
|
+
var faSquareTwitter = {
|
|
134
|
+
prefix: 'fab',
|
|
135
|
+
iconName: 'square-twitter',
|
|
136
|
+
icon: [448, 512, ["twitter-square"], "f081", "M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-48.9 158.8c.2 2.8.2 5.7.2 8.5 0 86.7-66 186.6-186.6 186.6-37.2 0-71.7-10.8-100.7-29.4 5.3.6 10.4.8 15.8.8 30.7 0 58.9-10.4 81.4-28-28.8-.6-53-19.5-61.3-45.5 10.1 1.5 19.2 1.5 29.6-1.2-30-6.1-52.5-32.5-52.5-64.4v-.8c8.7 4.9 18.9 7.9 29.6 8.3a65.447 65.447 0 0 1-29.2-54.6c0-12.2 3.2-23.4 8.9-33.1 32.3 39.8 80.8 65.8 135.2 68.6-9.3-44.5 24-80.6 64-80.6 18.9 0 35.9 7.9 47.9 20.7 14.8-2.8 29-8.3 41.6-15.8-4.9 15.2-15.2 28-28.8 36.1 13.2-1.4 26-5.1 37.8-10.2-8.9 13.1-20.1 24.7-32.9 34z"]
|
|
137
|
+
};
|
|
138
|
+
var faTwitterSquare = faSquareTwitter;
|
|
139
|
+
var faTiktok = {
|
|
140
|
+
prefix: 'fab',
|
|
141
|
+
iconName: 'tiktok',
|
|
142
|
+
icon: [448, 512, [], "e07b", "M448,209.91a210.06,210.06,0,0,1-122.77-39.25V349.38A162.55,162.55,0,1,1,185,188.31V278.2a74.62,74.62,0,1,0,52.23,71.18V0l88,0a121.18,121.18,0,0,0,1.86,22.17h0A122.18,122.18,0,0,0,381,102.39a121.43,121.43,0,0,0,67,20.14Z"]
|
|
143
|
+
};
|
|
144
|
+
var faSquareFacebook = {
|
|
145
|
+
prefix: 'fab',
|
|
146
|
+
iconName: 'square-facebook',
|
|
147
|
+
icon: [448, 512, ["facebook-square"], "f082", "M400 32H48A48 48 0 0 0 0 80v352a48 48 0 0 0 48 48h137.25V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.27c-30.81 0-40.42 19.12-40.42 38.73V256h68.78l-11 71.69h-57.78V480H400a48 48 0 0 0 48-48V80a48 48 0 0 0-48-48z"]
|
|
148
|
+
};
|
|
149
|
+
var faFacebookSquare = faSquareFacebook;
|
|
150
|
+
var faLinkedin = {
|
|
151
|
+
prefix: 'fab',
|
|
152
|
+
iconName: 'linkedin',
|
|
153
|
+
icon: [448, 512, [], "f08c", "M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"]
|
|
154
|
+
};
|
|
155
|
+
var faInstagram = {
|
|
156
|
+
prefix: 'fab',
|
|
157
|
+
iconName: 'instagram',
|
|
158
|
+
icon: [448, 512, [], "f16d", "M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"]
|
|
159
|
+
};
|
|
160
|
+
var faYoutube = {
|
|
161
|
+
prefix: 'fab',
|
|
162
|
+
iconName: 'youtube',
|
|
163
|
+
icon: [576, 512, [61802], "f167", "M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"]
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const SocialLink = props => (h("li", null,
|
|
167
|
+
h("a", { href: props.url, "aria-label": props.name },
|
|
168
|
+
h(FontAwesomeIcon, { icon: props.icon }))));
|
|
169
|
+
const SocialLinks = () => (h("ul", { id: "uofg-footer-social-links" },
|
|
170
|
+
h(SocialLink, { name: "Twitter", url: "https://twitter.com/uofg", icon: faTwitterSquare }),
|
|
171
|
+
h(SocialLink, { name: "Facebook", url: "https://www.facebook.com/uofguelph", icon: faFacebookSquare }),
|
|
172
|
+
h(SocialLink, { name: "Instagram", url: "https://www.instagram.com/uofguelph/", icon: faInstagram }),
|
|
173
|
+
h(SocialLink, { name: "Youtube", url: "https://www.youtube.com/user/uofguelph", icon: faYoutube }),
|
|
174
|
+
h(SocialLink, { name: "LinkedIn", url: "https://www.linkedin.com/school/university-of-guelph/", icon: faLinkedin }),
|
|
175
|
+
h(SocialLink, { name: "TikTok", url: "https://www.tiktok.com/@uofguelph", icon: faTiktok })));
|
|
176
|
+
|
|
126
177
|
const FooterLink = props => (h("li", null,
|
|
127
178
|
h("a", { href: props.url, title: props.title },
|
|
128
179
|
h(FontAwesomeIcon, { icon: props.icon }),
|
|
@@ -280,17 +331,13 @@ UofgHeader.style = uofgHeaderCss;
|
|
|
280
331
|
|
|
281
332
|
const WEB_ANIMATIONS_SUPPORTED = 'animate' in HTMLElement.prototype;
|
|
282
333
|
const PREFERS_REDUCED_MOTION = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
334
|
+
const getAllFocusableElements = (container) => {
|
|
335
|
+
const query = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [contenteditable], audio[controls], video[controls], details, summary, [tabindex]:not([tabindex="-1"])';
|
|
336
|
+
return Array.from(container.querySelectorAll(query));
|
|
337
|
+
};
|
|
283
338
|
|
|
284
339
|
const DURATION_REGEX = /^(\d*\.?\d+)(s|ms)$/;
|
|
285
340
|
const EASING_FUNCTION_REGEX = /^cubic-bezier\((\s*-?\d*\.?\d+\s*,){3}\s*-?\d*\.?\d+\s*\)$|^steps\(\s*\d+\s*(,\s*(start|end))?\s*\)$/;
|
|
286
|
-
const observer = new MutationObserver(mutations => {
|
|
287
|
-
for (const mutation of mutations) {
|
|
288
|
-
mutation.target.dispatchEvent(new CustomEvent('childListChange', { bubbles: false }));
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
const observerConfig = {
|
|
292
|
-
childList: true,
|
|
293
|
-
};
|
|
294
341
|
const UofgMenu = class {
|
|
295
342
|
constructor(hostRef) {
|
|
296
343
|
registerInstance(this, hostRef);
|
|
@@ -302,50 +349,31 @@ const UofgMenu = class {
|
|
|
302
349
|
this.button = null;
|
|
303
350
|
this.content = null;
|
|
304
351
|
this.contentComputedStyle = null;
|
|
352
|
+
this.observer = new MutationObserver(this.handleMutation);
|
|
305
353
|
this.isExpanded = false;
|
|
306
354
|
this.autoCollapse = false;
|
|
307
355
|
}
|
|
308
356
|
connectedCallback() {
|
|
309
357
|
// Bind functions so that "this" correctly refers to the component's instance.
|
|
310
|
-
this.
|
|
311
|
-
this.
|
|
312
|
-
this.updateContent = this.updateContent.bind(this);
|
|
313
|
-
this.handleButtonClick = this.handleButtonClick.bind(this);
|
|
358
|
+
this.handleMutation = this.handleMutation.bind(this);
|
|
359
|
+
this.handleClick = this.handleClick.bind(this);
|
|
314
360
|
this.handleFocusout = this.handleFocusout.bind(this);
|
|
315
361
|
this.handleKeyUp = this.handleKeyUp.bind(this);
|
|
316
362
|
this.computedStyle = window.getComputedStyle(this.el);
|
|
317
|
-
this.
|
|
318
|
-
this.
|
|
319
|
-
observer.observe(this.el, observerConfig);
|
|
363
|
+
this.handleMutation();
|
|
364
|
+
this.observer.observe(this.el, { childList: true });
|
|
320
365
|
}
|
|
321
|
-
|
|
322
|
-
this.
|
|
323
|
-
this.updateContent();
|
|
366
|
+
disconnectedCallback() {
|
|
367
|
+
this.observer.disconnect();
|
|
324
368
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
this.isExpanded = false;
|
|
328
|
-
if (e.target !== this.button) {
|
|
329
|
-
e.stopPropagation();
|
|
330
|
-
this.isExpanded = false;
|
|
331
|
-
this.button && this.button.focus();
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
updateButton() {
|
|
336
|
-
var _a, _b, _c;
|
|
369
|
+
handleMutation() {
|
|
370
|
+
// Update the button element
|
|
337
371
|
const button = this.el.querySelector('[slot="button"]');
|
|
338
|
-
// Clean up the old button before setting the new one
|
|
339
|
-
(_a = this.button) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', this.handleButtonClick);
|
|
340
|
-
(_b = this.button) === null || _b === void 0 ? void 0 : _b.removeAttribute('aria-expanded');
|
|
341
|
-
(_c = this.button) === null || _c === void 0 ? void 0 : _c.removeAttribute('aria-haspopup');
|
|
342
372
|
// Set up the new button
|
|
343
373
|
button === null || button === void 0 ? void 0 : button.setAttribute('aria-expanded', this.isExpanded ? 'true' : 'false');
|
|
344
374
|
button === null || button === void 0 ? void 0 : button.setAttribute('aria-haspopup', 'true');
|
|
345
|
-
button === null || button === void 0 ? void 0 : button.addEventListener('click', this.handleButtonClick);
|
|
346
375
|
this.button = button;
|
|
347
|
-
|
|
348
|
-
updateContent() {
|
|
376
|
+
// Update the content element
|
|
349
377
|
const content = this.el.querySelector('[slot="content"]');
|
|
350
378
|
if (content == null) {
|
|
351
379
|
this.content = null;
|
|
@@ -357,8 +385,22 @@ const UofgMenu = class {
|
|
|
357
385
|
this.contentComputedStyle = window.getComputedStyle(this.content);
|
|
358
386
|
}
|
|
359
387
|
}
|
|
360
|
-
|
|
361
|
-
|
|
388
|
+
handleKeyUp(e) {
|
|
389
|
+
if (e.key === 'Escape') {
|
|
390
|
+
this.isExpanded = false;
|
|
391
|
+
if (e.target !== this.button) {
|
|
392
|
+
e.stopPropagation();
|
|
393
|
+
this.isExpanded = false;
|
|
394
|
+
this.button && this.button.focus();
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
handleClick(e) {
|
|
399
|
+
//Check if the click was on the button or a descendant of the button
|
|
400
|
+
if (this.button && this.button.contains(e.target)) {
|
|
401
|
+
this.isExpanded = !this.isExpanded;
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
362
404
|
}
|
|
363
405
|
handleFocusout(e) {
|
|
364
406
|
if (this.autoCollapse && !this.el.contains(e.relatedTarget)) {
|
|
@@ -484,7 +526,7 @@ const UofgMenu = class {
|
|
|
484
526
|
};
|
|
485
527
|
}
|
|
486
528
|
render() {
|
|
487
|
-
return (h(Host, {
|
|
529
|
+
return (h(Host, { "data-expanded": this.isExpanded, tabindex: -1, onFocusout: this.handleFocusout, onKeyUp: this.handleKeyUp, onClick: this.handleClick }));
|
|
488
530
|
}
|
|
489
531
|
/**
|
|
490
532
|
* Get the current expanded state of the menu.
|
|
@@ -528,4 +570,107 @@ const UofgMenu = class {
|
|
|
528
570
|
}; }
|
|
529
571
|
};
|
|
530
572
|
|
|
531
|
-
|
|
573
|
+
const uofgModalCss = ":host{visibility:visible !important;position:relative !important}:focus-visible{outline:2px solid #ffc72a}*{box-sizing:border-box}#uofg-modal{display:flex;position:fixed;top:0;left:0;z-index:10000;width:100vw;height:100vh;background-color:rgba(0, 0, 0, 0.5);visibility:hidden;opacity:0;padding:2rem;transition-duration:0.3s;transition-timing-function:ease-in-out;transition-property:visibility, opacity}#uofg-modal #uofg-modal-dismiss{display:flex;justify-content:center;align-items:center;position:absolute;top:0;right:0;padding:0.5rem;height:3.5rem;width:3.5rem;font-size:2rem;line-height:1;color:var(--uofg-modal-dismiss-color, #fff);background-color:transparent;border:none;cursor:pointer;z-index:2}#uofg-modal #uofg-modal-dismiss>svg{display:block;height:1em;fill:currentColor}#uofg-modal>#uofg-modal-content{position:absolute;left:50%;transition:transform 0.3s ease-in-out;transform:translate(-50%, -50px);z-index:1}@media (prefers-reduced-motion: reduce){#uofg-modal>#uofg-modal-content{transition:none}}#uofg-modal>#uofg-modal-content.centered{top:50%;transform:translate(-50%, calc(-50% - 50px))}#uofg-modal.open{visibility:visible;opacity:1}#uofg-modal.open #uofg-modal-content{visibility:visible;opacity:1;transform:translate(-50%, 0)}#uofg-modal.open #uofg-modal-content.centered{transform:translate(-50%, -50%)}";
|
|
574
|
+
|
|
575
|
+
const UofgModal = class {
|
|
576
|
+
constructor(hostRef) {
|
|
577
|
+
registerInstance(this, hostRef);
|
|
578
|
+
this.label = undefined;
|
|
579
|
+
this.alertDialog = false;
|
|
580
|
+
this.centered = false;
|
|
581
|
+
this.staticBackdrop = false;
|
|
582
|
+
this.autoOpen = false;
|
|
583
|
+
this.isOpen = false;
|
|
584
|
+
}
|
|
585
|
+
connectedCallback() {
|
|
586
|
+
// Bind event handlers so that 'this' is always the component instance.
|
|
587
|
+
this.handleClick = this.handleClick.bind(this);
|
|
588
|
+
this.handleKeyUp = this.handleKeyUp.bind(this);
|
|
589
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
590
|
+
if (this.autoOpen) {
|
|
591
|
+
this.isOpen = true;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
handleClick(e) {
|
|
595
|
+
if (!this.staticBackdrop && e.target === e.currentTarget) {
|
|
596
|
+
this.isOpen = false;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
handleKeyUp(e) {
|
|
600
|
+
if (e.key === 'Escape') {
|
|
601
|
+
this.isOpen = false;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
handleKeyDown(e) {
|
|
605
|
+
if (e.key === 'Tab') {
|
|
606
|
+
const focusableElements = getAllFocusableElements(this.el);
|
|
607
|
+
const firstFocusable = this.dismissButton; // The dismiss button is always the first focusable element in the modal.
|
|
608
|
+
const lastFocusable = focusableElements[focusableElements.length - 1];
|
|
609
|
+
if (e.target === firstFocusable && e.shiftKey) {
|
|
610
|
+
e.preventDefault();
|
|
611
|
+
lastFocusable === null || lastFocusable === void 0 ? void 0 : lastFocusable.focus();
|
|
612
|
+
}
|
|
613
|
+
else if (e.target === lastFocusable && !e.shiftKey) {
|
|
614
|
+
e.preventDefault();
|
|
615
|
+
firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
handleIsOpenChange(newValue) {
|
|
620
|
+
if (newValue === true) {
|
|
621
|
+
window.requestAnimationFrame(() => {
|
|
622
|
+
window.requestAnimationFrame(() => {
|
|
623
|
+
window.requestAnimationFrame(() => {
|
|
624
|
+
this.dismissButton.focus();
|
|
625
|
+
});
|
|
626
|
+
});
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
render() {
|
|
631
|
+
return (h("div", { id: "uofg-modal", class: { open: this.isOpen }, role: this.isOpen ? (this.alertDialog ? 'alertdialog' : 'dialog') : '', "aria-modal": this.isOpen, "aria-label": this.label, "aria-hidden": !this.isOpen, tabIndex: -1, onClick: this.handleClick, onKeyUp: this.handleKeyUp, onKeyDown: this.handleKeyDown }, h("div", { id: "uofg-modal-content", class: { centered: this.centered } }, h("button", { id: "uofg-modal-dismiss", "aria-label": "Close modal", ref: (el) => (this.dismissButton = el), onClick: () => (this.isOpen = false) }, h(FontAwesomeIcon, { icon: faTimes })), h("slot", null))));
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Get the current state of the modal.
|
|
635
|
+
* @returns A promise which will resolve to true when the modal is open, or false when the modal is closed.
|
|
636
|
+
*/
|
|
637
|
+
async getState() {
|
|
638
|
+
return this.isOpen;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Set the state of the modal.
|
|
642
|
+
* @param value The new state, set it to true to open the modal, or false to close the modal.
|
|
643
|
+
*/
|
|
644
|
+
async setState(value) {
|
|
645
|
+
this.isOpen = value;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Toggle the state of the modal.
|
|
649
|
+
* @returns A promise which will resolve to true (if the modal opened) or false (if the modal closed).
|
|
650
|
+
*/
|
|
651
|
+
async toggle() {
|
|
652
|
+
this.isOpen = !this.isOpen;
|
|
653
|
+
return this.isOpen;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Closes the modal.
|
|
657
|
+
* @returns empty Promise.
|
|
658
|
+
*/
|
|
659
|
+
async close() {
|
|
660
|
+
this.isOpen = false;
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Opens the modal.
|
|
664
|
+
* @returns empty Promise.
|
|
665
|
+
*/
|
|
666
|
+
async open() {
|
|
667
|
+
this.isOpen = true;
|
|
668
|
+
}
|
|
669
|
+
get el() { return getElement(this); }
|
|
670
|
+
static get watchers() { return {
|
|
671
|
+
"isOpen": ["handleIsOpenChange"]
|
|
672
|
+
}; }
|
|
673
|
+
};
|
|
674
|
+
UofgModal.style = uofgModalCss;
|
|
675
|
+
|
|
676
|
+
export { UofgAlert as uofg_alert, UofgBackToTop as uofg_back_to_top, UofgFooter as uofg_footer, UofgHeader as uofg_header, UofgMenu as uofg_menu, UofgModal as uofg_modal };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-ebf79156.js';
|
|
2
|
+
export { s as setNonce } from './index-ebf79156.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Patch Browser v4.0.1 | MIT Licensed | https://stenciljs.com
|
|
@@ -14,5 +14,5 @@ const patchBrowser = () => {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
patchBrowser().then(options => {
|
|
17
|
-
return bootstrapLazy([["uofg-
|
|
17
|
+
return bootstrapLazy([["uofg-alert_6",[[1,"uofg-header",{"pageTitle":[1,"page-title"],"pageUrl":[1,"page-url"],"isFullSize":[32],"pageSpecificContent":[32]},[[9,"resize","updateFullSize"]]],[1,"uofg-alert"],[1,"uofg-back-to-top",{"threshold":[2],"isVisible":[32]},[[9,"scroll","onScroll"]]],[1,"uofg-footer"],[1,"uofg-modal",{"label":[1],"alertDialog":[4,"alert-dialog"],"centered":[4],"staticBackdrop":[4,"static-backdrop"],"autoOpen":[4,"auto-open"],"isOpen":[32],"getState":[64],"setState":[64],"toggle":[64],"close":[64],"open":[64]}],[0,"uofg-menu",{"autoCollapse":[4,"auto-collapse"],"isExpanded":[32],"getExpanded":[64],"setExpanded":[64],"toggle":[64],"collapse":[64],"expand":[64]}]]]], options);
|
|
18
18
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type PageSpecificContent } from './page-specific';
|
|
2
2
|
export declare class UofgHeader {
|
|
3
3
|
/**
|
|
4
|
-
* The title of the
|
|
4
|
+
* The title of the department/topic that the header is being used for. For example, for the Convocation pages, this would be set to "Convocation".
|
|
5
5
|
*/
|
|
6
6
|
pageTitle: string;
|
|
7
7
|
/**
|
|
8
|
-
* The URL to the home/landing page
|
|
8
|
+
* The URL to the home/landing page of the department/topic the header is being used for. For example, for the Convocation pages, this would be set to "https://www.uoguelph.ca/convocation/".
|
|
9
9
|
*/
|
|
10
10
|
pageUrl: string;
|
|
11
11
|
el: HTMLUofgHeaderElement;
|
|
@@ -26,12 +26,12 @@ export declare class UofgMenu {
|
|
|
26
26
|
private button;
|
|
27
27
|
private content;
|
|
28
28
|
private contentComputedStyle;
|
|
29
|
+
private observer;
|
|
29
30
|
connectedCallback(): void;
|
|
30
|
-
|
|
31
|
+
disconnectedCallback(): void;
|
|
32
|
+
private handleMutation;
|
|
31
33
|
private handleKeyUp;
|
|
32
|
-
private
|
|
33
|
-
private updateContent;
|
|
34
|
-
private handleButtonClick;
|
|
34
|
+
private handleClick;
|
|
35
35
|
private handleFocusout;
|
|
36
36
|
handleIsExpandedChange(newValue: boolean): void;
|
|
37
37
|
private getAnimationType;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export declare class UofgModal {
|
|
2
|
+
/**
|
|
3
|
+
* The label for the modal. It is recommended that you set this to describe the modal's content.
|
|
4
|
+
* This is required for accessibility.
|
|
5
|
+
*/
|
|
6
|
+
label: string;
|
|
7
|
+
/**
|
|
8
|
+
* Used to determine whether the modal should be rendered as an alert dialog.
|
|
9
|
+
* This is useful for when you want to use the modal to alert the user of something, rather than to ask the user to make a decision.
|
|
10
|
+
* If this is set to true, the modal will be rendered with a role of "alertdialog" instead of "dialog".
|
|
11
|
+
*/
|
|
12
|
+
alertDialog: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Used to determine whether the modal content is centered vertically.
|
|
15
|
+
*/
|
|
16
|
+
centered: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Used to determine whether clicking on the backdrop of the modal will close the modal.
|
|
19
|
+
* If this is set to true, clicking on the backdrop will NOT close the modal.
|
|
20
|
+
*/
|
|
21
|
+
staticBackdrop: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Used to determine whether the modal should open automatically when the component is first rendered.
|
|
24
|
+
* It is important to ensure this is only set to true for ONE modal on the page.
|
|
25
|
+
*/
|
|
26
|
+
autoOpen: boolean;
|
|
27
|
+
isOpen: boolean;
|
|
28
|
+
el: HTMLUofgModalElement;
|
|
29
|
+
private dismissButton;
|
|
30
|
+
connectedCallback(): void;
|
|
31
|
+
handleClick(e: MouseEvent): void;
|
|
32
|
+
handleKeyUp(e: KeyboardEvent): void;
|
|
33
|
+
handleKeyDown(e: KeyboardEvent): void;
|
|
34
|
+
handleIsOpenChange(newValue: boolean): void;
|
|
35
|
+
render(): any;
|
|
36
|
+
/**
|
|
37
|
+
* Get the current state of the modal.
|
|
38
|
+
* @returns A promise which will resolve to true when the modal is open, or false when the modal is closed.
|
|
39
|
+
*/
|
|
40
|
+
getState(): Promise<boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* Set the state of the modal.
|
|
43
|
+
* @param value The new state, set it to true to open the modal, or false to close the modal.
|
|
44
|
+
*/
|
|
45
|
+
setState(value: boolean): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Toggle the state of the modal.
|
|
48
|
+
* @returns A promise which will resolve to true (if the modal opened) or false (if the modal closed).
|
|
49
|
+
*/
|
|
50
|
+
toggle(): Promise<boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* Closes the modal.
|
|
53
|
+
* @returns empty Promise.
|
|
54
|
+
*/
|
|
55
|
+
close(): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Opens the modal.
|
|
58
|
+
* @returns empty Promise.
|
|
59
|
+
*/
|
|
60
|
+
open(): Promise<void>;
|
|
61
|
+
}
|