@undrr/undrr-mangrove 1.2.1
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/LICENSE +201 -0
- package/README.md +209 -0
- package/dist/assets/css/style-gutenberg.css +150 -0
- package/dist/assets/css/style-gutenberg.css.map +1 -0
- package/dist/assets/css/style-irp.css +480 -0
- package/dist/assets/css/style-irp.css.map +1 -0
- package/dist/assets/css/style-mcr.css +480 -0
- package/dist/assets/css/style-mcr.css.map +1 -0
- package/dist/assets/css/style-preventionweb.css +480 -0
- package/dist/assets/css/style-preventionweb.css.map +1 -0
- package/dist/assets/css/style.css +473 -0
- package/dist/assets/css/style.css.map +1 -0
- package/dist/assets/fonts/mangrove-icon-set/LICENSE.txt +21 -0
- package/dist/assets/fonts/mangrove-icon-set/README.txt +75 -0
- package/dist/assets/fonts/mangrove-icon-set/config.json +336 -0
- package/dist/assets/fonts/mangrove-icon-set/demo.html +403 -0
- package/dist/assets/fonts/mangrove-icon-set/font/mangrove-icon-set.eot +0 -0
- package/dist/assets/fonts/mangrove-icon-set/font/mangrove-icon-set.svg +116 -0
- package/dist/assets/fonts/mangrove-icon-set/font/mangrove-icon-set.ttf +0 -0
- package/dist/assets/fonts/mangrove-icon-set/font/mangrove-icon-set.woff +0 -0
- package/dist/assets/fonts/mangrove-icon-set/font/mangrove-icon-set.woff2 +0 -0
- package/dist/assets/fonts/roboto/README.md +12 -0
- package/dist/assets/fonts/roboto/fonts/Black/Roboto-Black.woff +0 -0
- package/dist/assets/fonts/roboto/fonts/Black/Roboto-Black.woff2 +0 -0
- package/dist/assets/fonts/roboto/fonts/BlackItalic/Roboto-BlackItalic.woff +0 -0
- package/dist/assets/fonts/roboto/fonts/BlackItalic/Roboto-BlackItalic.woff2 +0 -0
- package/dist/assets/fonts/roboto/fonts/Bold/Roboto-Bold.woff +0 -0
- package/dist/assets/fonts/roboto/fonts/Bold/Roboto-Bold.woff2 +0 -0
- package/dist/assets/fonts/roboto/fonts/BoldItalic/Roboto-BoldItalic.woff +0 -0
- package/dist/assets/fonts/roboto/fonts/BoldItalic/Roboto-BoldItalic.woff2 +0 -0
- package/dist/assets/fonts/roboto/fonts/COPYRIGHT.txt +1 -0
- package/dist/assets/fonts/roboto/fonts/DESCRIPTION.en_us.html +13 -0
- package/dist/assets/fonts/roboto/fonts/Italic/Roboto-Italic.woff +0 -0
- package/dist/assets/fonts/roboto/fonts/Italic/Roboto-Italic.woff2 +0 -0
- package/dist/assets/fonts/roboto/fonts/LICENSE.txt +202 -0
- package/dist/assets/fonts/roboto/fonts/Light/Roboto-Light.woff +0 -0
- package/dist/assets/fonts/roboto/fonts/Light/Roboto-Light.woff2 +0 -0
- package/dist/assets/fonts/roboto/fonts/LightItalic/Roboto-LightItalic.woff +0 -0
- package/dist/assets/fonts/roboto/fonts/LightItalic/Roboto-LightItalic.woff2 +0 -0
- package/dist/assets/fonts/roboto/fonts/METADATA.pb +121 -0
- package/dist/assets/fonts/roboto/fonts/Medium/Roboto-Medium.woff +0 -0
- package/dist/assets/fonts/roboto/fonts/Medium/Roboto-Medium.woff2 +0 -0
- package/dist/assets/fonts/roboto/fonts/MediumItalic/Roboto-MediumItalic.woff +0 -0
- package/dist/assets/fonts/roboto/fonts/MediumItalic/Roboto-MediumItalic.woff2 +0 -0
- package/dist/assets/fonts/roboto/fonts/Regular/Roboto-Regular.woff +0 -0
- package/dist/assets/fonts/roboto/fonts/Regular/Roboto-Regular.woff2 +0 -0
- package/dist/assets/fonts/roboto/fonts/Thin/Roboto-Thin.woff +0 -0
- package/dist/assets/fonts/roboto/fonts/Thin/Roboto-Thin.woff2 +0 -0
- package/dist/assets/fonts/roboto/fonts/ThinItalic/Roboto-ThinItalic.woff +0 -0
- package/dist/assets/fonts/roboto/fonts/ThinItalic/Roboto-ThinItalic.woff2 +0 -0
- package/dist/assets/fonts/roboto/roboto.scss +15 -0
- package/dist/assets/fonts/roboto/sass/_Black.scss +10 -0
- package/dist/assets/fonts/roboto/sass/_BlackItalic.scss +10 -0
- package/dist/assets/fonts/roboto/sass/_Bold.scss +19 -0
- package/dist/assets/fonts/roboto/sass/_BoldItalic.scss +19 -0
- package/dist/assets/fonts/roboto/sass/_Italic.scss +19 -0
- package/dist/assets/fonts/roboto/sass/_Light.scss +10 -0
- package/dist/assets/fonts/roboto/sass/_LightItalic.scss +10 -0
- package/dist/assets/fonts/roboto/sass/_Medium.scss +10 -0
- package/dist/assets/fonts/roboto/sass/_MediumItalic.scss +10 -0
- package/dist/assets/fonts/roboto/sass/_Regular.scss +19 -0
- package/dist/assets/fonts/roboto/sass/_Thin.scss +10 -0
- package/dist/assets/fonts/roboto/sass/_ThinItalic.scss +10 -0
- package/dist/assets/fonts/roboto/sass/_mixins.scss +5 -0
- package/dist/assets/fonts/roboto/sass/_variables.scss +2 -0
- package/dist/assets/fonts/roboto/sass/roboto.scss +15 -0
- package/dist/assets/fonts/roboto-condensed/LICENSE +201 -0
- package/dist/assets/fonts/roboto-condensed/README.md +8 -0
- package/dist/assets/fonts/roboto-condensed/fonts/Bold/RobotoCondensed-Bold.woff +0 -0
- package/dist/assets/fonts/roboto-condensed/fonts/Bold/RobotoCondensed-Bold.woff2 +0 -0
- package/dist/assets/fonts/roboto-condensed/fonts/BoldItalic/RobotoCondensed-BoldItalic.woff +0 -0
- package/dist/assets/fonts/roboto-condensed/fonts/BoldItalic/RobotoCondensed-BoldItalic.woff2 +0 -0
- package/dist/assets/fonts/roboto-condensed/fonts/COPYRIGHT.txt +1 -0
- package/dist/assets/fonts/roboto-condensed/fonts/DESCRIPTION.en_us.html +13 -0
- package/dist/assets/fonts/roboto-condensed/fonts/Italic/RobotoCondensed-Italic.woff +0 -0
- package/dist/assets/fonts/roboto-condensed/fonts/Italic/RobotoCondensed-Italic.woff2 +0 -0
- package/dist/assets/fonts/roboto-condensed/fonts/LICENSE.txt +202 -0
- package/dist/assets/fonts/roboto-condensed/fonts/Light/RobotoCondensed-Light.woff +0 -0
- package/dist/assets/fonts/roboto-condensed/fonts/Light/RobotoCondensed-Light.woff2 +0 -0
- package/dist/assets/fonts/roboto-condensed/fonts/LightItalic/RobotoCondensed-LightItalic.woff +0 -0
- package/dist/assets/fonts/roboto-condensed/fonts/LightItalic/RobotoCondensed-LightItalic.woff2 +0 -0
- package/dist/assets/fonts/roboto-condensed/fonts/METADATA.pb +67 -0
- package/dist/assets/fonts/roboto-condensed/fonts/Regular/RobotoCondensed-Regular.woff +0 -0
- package/dist/assets/fonts/roboto-condensed/fonts/Regular/RobotoCondensed-Regular.woff2 +0 -0
- package/dist/assets/fonts/roboto-condensed/roboto-condensed.scss +8 -0
- package/dist/assets/fonts/roboto-condensed/sass/_Bold.scss +11 -0
- package/dist/assets/fonts/roboto-condensed/sass/_BoldItalic.scss +11 -0
- package/dist/assets/fonts/roboto-condensed/sass/_Italic.scss +11 -0
- package/dist/assets/fonts/roboto-condensed/sass/_Light.scss +11 -0
- package/dist/assets/fonts/roboto-condensed/sass/_LightItalic.scss +11 -0
- package/dist/assets/fonts/roboto-condensed/sass/_Regular.scss +11 -0
- package/dist/assets/fonts/roboto-condensed/sass/_mixins.scss +5 -0
- package/dist/assets/fonts/roboto-condensed/sass/_variables.scss +1 -0
- package/dist/assets/icons/arrow-left.svg +3 -0
- package/dist/assets/icons/arrow-right.svg +3 -0
- package/dist/assets/icons/chevron-left-circle.svg +11 -0
- package/dist/assets/icons/chevron-right-circle.svg +11 -0
- package/dist/assets/images/author.png +0 -0
- package/dist/assets/images/card-image.png +0 -0
- package/dist/assets/images/figcaption.jpg +0 -0
- package/dist/assets/images/hero_background.png +0 -0
- package/dist/assets/images/sample_image-lg.jpg +0 -0
- package/dist/assets/images/sample_image-md.jpg +0 -0
- package/dist/assets/images/sample_image-sm.jpg +0 -0
- package/dist/assets/images/undrr-logo-blue.svg +22 -0
- package/dist/assets/images/undrr-logo-square-blue.svg +24 -0
- package/dist/assets/images/undrr-logo-square-white.svg +24 -0
- package/dist/assets/images/undrr-logo-white.svg +21 -0
- package/dist/assets/js/fitText.js +23 -0
- package/dist/assets/js/show-more.js +43 -0
- package/dist/assets/js/tabs.js +243 -0
- package/dist/assets/js/undrr.js +26 -0
- package/dist/assets/scss/_breakpoints.scss +28 -0
- package/dist/assets/scss/_components.scss +69 -0
- package/dist/assets/scss/_fonts.scss +9 -0
- package/dist/assets/scss/_foundational.scss +322 -0
- package/dist/assets/scss/_mixins.scss +522 -0
- package/dist/assets/scss/_utility.scss +148 -0
- package/dist/assets/scss/_variables-irp.scss +40 -0
- package/dist/assets/scss/_variables-mcr.scss +55 -0
- package/dist/assets/scss/_variables-preventionweb.scss +39 -0
- package/dist/assets/scss/_variables.scss +345 -0
- package/dist/assets/scss/style-gutenberg.scss +28 -0
- package/dist/assets/scss/style-irp.scss +8 -0
- package/dist/assets/scss/style-mcr.scss +8 -0
- package/dist/assets/scss/style-preventionweb.scss +8 -0
- package/dist/assets/scss/style.scss +7 -0
- package/dist/components/64859daad6c1e719d2b3.png +1 -0
- package/dist/components/871deead6fbe28d9b668.png +1 -0
- package/dist/components/BarChart.js +6 -0
- package/dist/components/BarChart.js.LICENSE.txt +9 -0
- package/dist/components/Fetcher.js +6 -0
- package/dist/components/Fetcher.js.LICENSE.txt +11 -0
- package/dist/components/MapComponent.js +6 -0
- package/dist/components/MapComponent.js.LICENSE.txt +16 -0
- package/dist/components/MegaMenu.js +6 -0
- package/dist/components/MegaMenu.js.LICENSE.txt +9 -0
- package/dist/components/QuoteHighlight.js +6 -0
- package/dist/components/QuoteHighlight.js.LICENSE.txt +9 -0
- package/dist/components/ScrollContainer.js +6 -0
- package/dist/components/ScrollContainer.js.LICENSE.txt +9 -0
- package/dist/components/ShareButtons.js +6 -0
- package/dist/components/ShareButtons.js.LICENSE.txt +9 -0
- package/dist/components/assets/2b3e1faf89f94a4835397e7a43b4f77d.png +0 -0
- package/dist/components/assets/416d91365b44e4b4f4777663e6f009f3.png +0 -0
- package/dist/components/assets/680f69f3c2e6b90c1812a813edf67fd7.png +0 -0
- package/dist/components/assets/8f2c4d11474275fbc1614b9098334eae.png +0 -0
- package/dist/components/assets/a0c6cc1401c107b501efee6477816891.png +0 -0
- package/dist/components/cab155b6ee25ecd4541b.png +1 -0
- package/package.json +16 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
// mg-tabs
|
|
2
|
+
/**
|
|
3
|
+
* Initialize tabs on a page
|
|
4
|
+
* @param {boolean} [activateDeepLinkOnLoad] - if deep linked tabs should be activated on page load, defaults to true
|
|
5
|
+
* @example mgTabs();
|
|
6
|
+
*/
|
|
7
|
+
export function mgTabs(scope, activateDeepLinkOnLoad = true) {
|
|
8
|
+
const tabContainers = scope || document.querySelectorAll("[data-mg-js-tabs]");
|
|
9
|
+
tabContainers.forEach((container) => {
|
|
10
|
+
mgTabsRuntime(container, activateDeepLinkOnLoad);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Finds all tabs on a page and activates them
|
|
16
|
+
* @param {object} [scope] - the html scope to process, optional, defaults to `document`
|
|
17
|
+
* @param {boolean} [activateDeepLinkOnLoad] - if deep linked tabs should be activated on page load, defaults to true
|
|
18
|
+
* @example mgTabs(document.querySelectorAll('.mg-component__container')[0]);
|
|
19
|
+
*/
|
|
20
|
+
export function mgTabsRuntime(scope, activateDeepLinkOnLoad) {
|
|
21
|
+
var scope = scope || document;
|
|
22
|
+
var activateDeepLinkOnLoad = activateDeepLinkOnLoad || true;
|
|
23
|
+
|
|
24
|
+
// Get relevant elements and collections
|
|
25
|
+
if (scope.hasAttribute("data-mg-js-tabs")) {
|
|
26
|
+
var tabsList = scope;
|
|
27
|
+
} else {
|
|
28
|
+
var tabsList =
|
|
29
|
+
scope.querySelectorAll("[data-mg-js-tabs]") || newTab.closest(".mg-tabs"); // compatibility with v1 tabs
|
|
30
|
+
}
|
|
31
|
+
const tabs = scope.querySelectorAll(".mg-tabs__link");
|
|
32
|
+
var panels = scope.querySelectorAll('[id^="mg-tabs__section"]');
|
|
33
|
+
// v1 compatibility
|
|
34
|
+
// If panels is empty, try finding them in data-mg-js-tabs-content
|
|
35
|
+
if (!panels.length) {
|
|
36
|
+
const tabContent = scope
|
|
37
|
+
.closest(".mg-tabs")
|
|
38
|
+
.querySelector("[data-mg-js-tabs-content]");
|
|
39
|
+
if (tabContent) {
|
|
40
|
+
panels = tabContent.querySelectorAll('[id^="mg-tabs__section"]');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// console.log("debug: All panels");
|
|
45
|
+
// console.log("Tab list: " , tabsList);
|
|
46
|
+
// console.log("Panel List: ", panelsList);
|
|
47
|
+
// console.log("Panels: ", panels);
|
|
48
|
+
// console.log("Tabs: ", tabs);
|
|
49
|
+
// console.log("End Debug: All panels");
|
|
50
|
+
|
|
51
|
+
if (!tabsList || !panels || !tabs) {
|
|
52
|
+
// exit: either tabs or tabbed content not found
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (tabsList.length == 0 || panels.length == 0 || tabs.length == 0) {
|
|
56
|
+
// exit: either tabs or tabbed content not found
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Check if tabs have already been initialized
|
|
61
|
+
if (tabsList.hasAttribute("data-mg-tabs-initialized")) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
tabsList.setAttribute("data-mg-tabs-initialized", "true");
|
|
65
|
+
|
|
66
|
+
// Add semantics are remove user focusability for each tab
|
|
67
|
+
Array.prototype.forEach.call(tabs, (tab, i) => {
|
|
68
|
+
const tabId = tab.href.split("#")[1]; // calculate an ID based off the tab href (todo: add support for a data-vf-js-tab-id, and if set use that)
|
|
69
|
+
tab.setAttribute("role", "tab");
|
|
70
|
+
tab.setAttribute("id", tabId);
|
|
71
|
+
tab.setAttribute("data-tabs__item", tabId);
|
|
72
|
+
tab.setAttribute("tabindex", "-1");
|
|
73
|
+
tab.parentNode.setAttribute("role", "presentation");
|
|
74
|
+
|
|
75
|
+
// Reset any active tabs from a previous JS call
|
|
76
|
+
tab.removeAttribute("aria-selected");
|
|
77
|
+
tab.setAttribute("tabindex", "-1");
|
|
78
|
+
tab.classList.remove("is-active");
|
|
79
|
+
|
|
80
|
+
// Handle clicking of tabs for mouse users
|
|
81
|
+
tab.addEventListener("click", (e) => {
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
mgTabsSwitch(e.currentTarget, panels);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// Handle keydown events for keyboard users
|
|
87
|
+
tab.addEventListener("keydown", (e) => {
|
|
88
|
+
// Get the index of the current tab in the tabs node list
|
|
89
|
+
let index = Array.prototype.indexOf.call(tabs, e.currentTarget);
|
|
90
|
+
// Work out which key the user is pressing and
|
|
91
|
+
// Calculate the new tab's index where appropriate
|
|
92
|
+
let dir =
|
|
93
|
+
e.which === 37
|
|
94
|
+
? index - 1
|
|
95
|
+
: e.which === 39
|
|
96
|
+
? index + 1
|
|
97
|
+
: e.which === 40
|
|
98
|
+
? "down"
|
|
99
|
+
: null;
|
|
100
|
+
if (dir !== null) {
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
// If the down key is pressed, move focus to the open panel,
|
|
103
|
+
// otherwise switch to the adjacent tab
|
|
104
|
+
dir === "down"
|
|
105
|
+
? panels[i].focus({ preventScroll: true })
|
|
106
|
+
: tabs[dir]
|
|
107
|
+
? mgTabsSwitch(tabs[dir], panels)
|
|
108
|
+
: void 0;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// Add tab panel semantics and hide them all
|
|
114
|
+
Array.prototype.forEach.call(panels, (panel) => {
|
|
115
|
+
panel.setAttribute("role", "tabpanel");
|
|
116
|
+
panel.setAttribute("tabindex", "-1");
|
|
117
|
+
// let id = panel.getAttribute("id");
|
|
118
|
+
panel.setAttribute("aria-labelledby", panel.id);
|
|
119
|
+
panel.hidden = true;
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// Add the tabsList role to the first <ul> in the .tabbed container
|
|
123
|
+
Array.prototype.forEach.call(tabsList, (tabsListset) => {
|
|
124
|
+
tabsListset.setAttribute("role", "tablist");
|
|
125
|
+
// Show the first tab (if the parent tabset is not stacked and screen is not narrow)
|
|
126
|
+
if (
|
|
127
|
+
tabsListset.dataset.mgJsTabsVariant != "stacked" &&
|
|
128
|
+
window.innerWidth >= 600
|
|
129
|
+
) {
|
|
130
|
+
// Initially activate the first tab
|
|
131
|
+
let firstTab = tabsListset.querySelectorAll(".mg-tabs__link")[0];
|
|
132
|
+
firstTab.removeAttribute("tabindex");
|
|
133
|
+
firstTab.setAttribute("aria-selected", "true");
|
|
134
|
+
firstTab.classList.add("is-active");
|
|
135
|
+
|
|
136
|
+
// Initially reveal the first tab panel
|
|
137
|
+
const panelsList = tabsListset.querySelectorAll(
|
|
138
|
+
"[data-mg-js-tabs-content]",
|
|
139
|
+
);
|
|
140
|
+
Array.prototype.forEach.call(panelsList, (panel) => {
|
|
141
|
+
let firstPanel = tabsListset.querySelectorAll(".mg-tabs__section")[0];
|
|
142
|
+
firstPanel.hidden = false;
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// Activate any deep links to a specific tab
|
|
148
|
+
if (activateDeepLinkOnLoad) {
|
|
149
|
+
mgTabsDeepLinkOnLoad(tabs, panels);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// The tab switching function
|
|
154
|
+
const mgTabsSwitch = (newTab, panels) => {
|
|
155
|
+
// get the parent ul of the clicked tab
|
|
156
|
+
let parentTabContainer =
|
|
157
|
+
newTab.closest("[data-mg-js-tabs]") || newTab.closest(".mg-tabs"); // compatibility with v1 tabs
|
|
158
|
+
let oldTab = parentTabContainer.querySelector("[aria-selected]");
|
|
159
|
+
const behaveAsHorizontalTabs =
|
|
160
|
+
parentTabContainer.dataset.mgJsTabsVariant != "stacked" &&
|
|
161
|
+
window.innerWidth >= 600;
|
|
162
|
+
|
|
163
|
+
// if it is marked as stacked or small screen (this is not an inverse of behaveAsHorizontalTabs)
|
|
164
|
+
if (
|
|
165
|
+
parentTabContainer.dataset.mgJsTabsVariant == "stacked" ||
|
|
166
|
+
window.innerWidth <= 600
|
|
167
|
+
) {
|
|
168
|
+
for (let item = 0; item < panels.length; item++) {
|
|
169
|
+
const panel = panels[item];
|
|
170
|
+
if (panel.id === newTab.id) {
|
|
171
|
+
panel.hidden = !panel.hidden;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (oldTab) {
|
|
177
|
+
oldTab.removeAttribute("aria-selected");
|
|
178
|
+
oldTab.setAttribute("tabindex", "-1");
|
|
179
|
+
oldTab.classList.remove("is-active");
|
|
180
|
+
|
|
181
|
+
if (behaveAsHorizontalTabs) {
|
|
182
|
+
// normal horizontal tabs
|
|
183
|
+
for (let item = 0; item < panels.length; item++) {
|
|
184
|
+
const panel = panels[item];
|
|
185
|
+
if (panel.id === oldTab.id) {
|
|
186
|
+
panel.hidden = true;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
newTab.focus({ preventScroll: true });
|
|
193
|
+
// Make the active tab focusable by the user (Tab key)
|
|
194
|
+
newTab.removeAttribute("tabindex");
|
|
195
|
+
// Set the selected state
|
|
196
|
+
newTab.setAttribute("aria-selected", "true");
|
|
197
|
+
newTab.classList.add("is-active");
|
|
198
|
+
newTab.classList.toggle("mg-tabs__stacked--open"); // we always track the user's open state, even if not stacked as we may switch to mobile view // Get the indices of the new tab to find the correct tab panel to show
|
|
199
|
+
if (behaveAsHorizontalTabs) {
|
|
200
|
+
for (let item = 0; item < panels.length; item++) {
|
|
201
|
+
const panel = panels[item];
|
|
202
|
+
if (panel.id === newTab.id) {
|
|
203
|
+
panel.hidden = false;
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}};
|
|
208
|
+
|
|
209
|
+
function mgTabsDeepLinkOnLoad(tabs, panels) {
|
|
210
|
+
var mgTabAnchorFound = false;
|
|
211
|
+
|
|
212
|
+
if (window.location.hash) {
|
|
213
|
+
// 1. See if there is a `#mg-tabs__section--88888`
|
|
214
|
+
var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
|
|
215
|
+
|
|
216
|
+
// 2. loop through all tabs, if a match then activate
|
|
217
|
+
Array.prototype.forEach.call(tabs, (tab) => {
|
|
218
|
+
let tabId = tab.getAttribute("data-tabs__item");
|
|
219
|
+
if (tabId == hash) {
|
|
220
|
+
document.getElementById(hash)?.scrollIntoView({ behavior: "smooth" });
|
|
221
|
+
mgTabsSwitch(tab, panels);
|
|
222
|
+
mgTabAnchorFound = true;
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (!mgTabAnchorFound) {
|
|
229
|
+
// No hash found - look for default tab
|
|
230
|
+
let defaultTabFound = false;
|
|
231
|
+
Array.from(tabs).forEach((tab) => {
|
|
232
|
+
if (tab.getAttribute("data-mg-js-tabs-default") === "true") {
|
|
233
|
+
mgTabsSwitch(tab, panels);
|
|
234
|
+
defaultTabFound = true;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
// If no default tab is found, activate the first tab
|
|
239
|
+
if (!defaultTabFound && tabs.length > 0) {
|
|
240
|
+
mgTabsSwitch(tabs[0], panels);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const UNDRR = window.UNDRR || {};
|
|
2
|
+
|
|
3
|
+
UNDRR.keyCode = {
|
|
4
|
+
TAB: 9,
|
|
5
|
+
RETURN: 13,
|
|
6
|
+
ESC: 27,
|
|
7
|
+
SPACE: 32,
|
|
8
|
+
LEFT: 37,
|
|
9
|
+
UP: 38,
|
|
10
|
+
RIGHT: 39,
|
|
11
|
+
DOWN: 40,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
UNDRR.breakpoints = {
|
|
15
|
+
TINY: 320,
|
|
16
|
+
SMALL: 767,
|
|
17
|
+
MEDIUM: 768,
|
|
18
|
+
LARGE: 1024,
|
|
19
|
+
EXTRALARGE: 1440,
|
|
20
|
+
MEDIUMTAB: 1439,
|
|
21
|
+
TABLET: 834,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
window.UNDRR = window.UNDRR || UNDRR;
|
|
25
|
+
|
|
26
|
+
export const desktopView = window.innerWidth > 1439;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@mixin devicebreak($point) {
|
|
2
|
+
@if $point == small {
|
|
3
|
+
/* small design */
|
|
4
|
+
@media (width <= 47.9375em) {
|
|
5
|
+
@content;
|
|
6
|
+
}
|
|
7
|
+
} @else if $point == mediumonlytab {
|
|
8
|
+
/* medium design tab */
|
|
9
|
+
@media (width <= 89.9375em) {
|
|
10
|
+
@content;
|
|
11
|
+
}
|
|
12
|
+
} @else if $point == medium {
|
|
13
|
+
/* medium design */
|
|
14
|
+
@media (width >= 48em) {
|
|
15
|
+
@content;
|
|
16
|
+
}
|
|
17
|
+
} @else if $point == large {
|
|
18
|
+
/* medium design */
|
|
19
|
+
@media (width >= 64em) {
|
|
20
|
+
@content;
|
|
21
|
+
}
|
|
22
|
+
} @else if $point == xlarge {
|
|
23
|
+
/* large design */
|
|
24
|
+
@media (width >= 90em) {
|
|
25
|
+
@content;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// A rollup of all Mangrove components
|
|
2
|
+
|
|
3
|
+
// Normalize
|
|
4
|
+
@import "../../Utilities/Normalize/normalize";
|
|
5
|
+
|
|
6
|
+
// Atom
|
|
7
|
+
@import "../../Atom/BaseTypography/Abbr/abbr";
|
|
8
|
+
@import "../../Atom/BaseTypography/Blockquote/blockquote";
|
|
9
|
+
@import "../../Atom/BaseTypography/Cite/cite";
|
|
10
|
+
@import "../../Atom/BaseTypography/Code/code";
|
|
11
|
+
@import "../../Atom/BaseTypography/Mark/mark";
|
|
12
|
+
@import "../../Atom/BaseTypography/Quotation/quotation";
|
|
13
|
+
@import "../../Atom/BaseTypography/Small/small";
|
|
14
|
+
@import "../../Atom/Colors/color";
|
|
15
|
+
@import "../../Atom/Icons/icons";
|
|
16
|
+
@import "../../Atom/Images/AuthorImage/author-image";
|
|
17
|
+
@import "../../Atom/Images/Image/image";
|
|
18
|
+
@import "../../Atom/Images/ImageCaptionCredit/image-caption-credit";
|
|
19
|
+
@import "../../Atom/Images/ImageCredit/image-credit";
|
|
20
|
+
@import "../../Atom/Layout/Container/container";
|
|
21
|
+
@import "../../Atom/Layout/Grid/grid";
|
|
22
|
+
@import "../../Atom/Layout/Spacing/spacing";
|
|
23
|
+
@import "../../Atom/Navigation/Breadcrumb/breadcrumb";
|
|
24
|
+
@import "../../Atom/Navigation/LanguageSwitcherRow/language-switcher-row";
|
|
25
|
+
@import "../../Atom/Navigation/MenuItems/menu-items";
|
|
26
|
+
@import "../../Atom/Navigation/ProgressBarNavigation/progress-bar-navigation";
|
|
27
|
+
@import "../../Atom/Navigation/SidebarFirstLevel/sidebar-first-level";
|
|
28
|
+
@import "../../Atom/ReachElement/Details/details";
|
|
29
|
+
@import "../../Atom/ReachElement/Figcaption/figcaption";
|
|
30
|
+
@import "../../Atom/Table/table";
|
|
31
|
+
@import "../../Atom/Video/video";
|
|
32
|
+
|
|
33
|
+
// Components
|
|
34
|
+
@import "../../Components/Boilerplate/boilerplate";
|
|
35
|
+
@import "../../Components/Forms/Checkbox/checkbox";
|
|
36
|
+
@import "../../Components/Forms/Dropdowns/CustomSelect/custom-select";
|
|
37
|
+
@import "../../Components/Forms/Dropdowns/Multiselect/multi-select";
|
|
38
|
+
@import "../../Components/Forms/InputFields/input-fields";
|
|
39
|
+
@import "../../Components/Forms/Radio/radio";
|
|
40
|
+
@import "../../Components/Forms/Select/select";
|
|
41
|
+
@import "../../Components/Breadcrumbs/breadcrumbs";
|
|
42
|
+
@import "../../Components/Pagination/pagination";
|
|
43
|
+
@import "../../Components/QuoteHighlight/quote-highlight";
|
|
44
|
+
@import "../../Components/Sidebar/sidebar";
|
|
45
|
+
@import "../../Components/Accordion/accordion";
|
|
46
|
+
@import "../../Components/Buttons/Chips/chips";
|
|
47
|
+
@import "../../Components/Buttons/CtaButton/buttons";
|
|
48
|
+
@import "../../Components/Buttons/CtaLink/cta-link";
|
|
49
|
+
@import "../../Components/Buttons/ShareButtons/share-buttons";
|
|
50
|
+
@import "../../Components/MegaMenu/megamenu";
|
|
51
|
+
@import "../../Components/PageHeader/page-header";
|
|
52
|
+
@import "../../Components/Cards/Card/card";
|
|
53
|
+
@import "../../Components/Cards/StatsCards/stats-cards";
|
|
54
|
+
@import "../../Components/Snackbar/snackbar";
|
|
55
|
+
@import "../../Components/Hero/hero";
|
|
56
|
+
@import "../../Components/LanguageSwitcher/language-switcher";
|
|
57
|
+
@import "../../Components/ScrollContainer/scroll-container";
|
|
58
|
+
@import "../../Components/Tab/tab";
|
|
59
|
+
@import "../../Components/TableOfContents/TableOfContents";
|
|
60
|
+
@import "../../Components/BlockquoteComponent/blockquotecomp";
|
|
61
|
+
|
|
62
|
+
// Molecules
|
|
63
|
+
@import "../../Molecules/ImageCaption/image-caption";
|
|
64
|
+
@import "../../Molecules/SidebarData/sidebar-data";
|
|
65
|
+
|
|
66
|
+
// Utilities
|
|
67
|
+
@import "../../Utilities/Loader/loader";
|
|
68
|
+
@import "../../Utilities/FullWidth/FullWidth";
|
|
69
|
+
@import "../../Utilities/ShowMore/ShowMore";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* Roboto */
|
|
2
|
+
$font-path-roboto: "../fonts/roboto/fonts" !default;
|
|
3
|
+
|
|
4
|
+
@import "../fonts/roboto/roboto";
|
|
5
|
+
|
|
6
|
+
/* Roboto Condensed */
|
|
7
|
+
$font-path-roboto-condensed: "../fonts/roboto-condensed/fonts" !default;
|
|
8
|
+
|
|
9
|
+
@import "../fonts/roboto-condensed/roboto-condensed";
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
/* typography start */
|
|
2
|
+
|
|
3
|
+
html {
|
|
4
|
+
font-size: 10px;
|
|
5
|
+
-webkit-tap-highlight-color: transparent;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
body {
|
|
9
|
+
color: $mg-color-black;
|
|
10
|
+
font-family: $mg-font-family;
|
|
11
|
+
font-size: $mg-font-size-300;
|
|
12
|
+
line-height: $mg-font-line-height-500;
|
|
13
|
+
|
|
14
|
+
@include devicebreak(medium) {
|
|
15
|
+
font-size: $mg-font-size-300;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
button {
|
|
20
|
+
font-family: $mg-font-family;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
h1,
|
|
24
|
+
h2,
|
|
25
|
+
h3,
|
|
26
|
+
h4,
|
|
27
|
+
h5,
|
|
28
|
+
h6,
|
|
29
|
+
caption {
|
|
30
|
+
margin: $mg-spacing-0;
|
|
31
|
+
margin-bottom: $mg-spacing-25;
|
|
32
|
+
padding: $mg-spacing-0;
|
|
33
|
+
|
|
34
|
+
@include devicebreak(medium) {
|
|
35
|
+
margin-bottom: $mg-font-size-300;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
h1 {
|
|
40
|
+
font-family: $mg-font-family;
|
|
41
|
+
font-size: $mg-font-size-600;
|
|
42
|
+
letter-spacing: 0.06rem;
|
|
43
|
+
line-height: 1.08;
|
|
44
|
+
text-wrap: balance;
|
|
45
|
+
|
|
46
|
+
@include devicebreak(medium) {
|
|
47
|
+
font-size: 5.125rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@include devicebreak(large) {
|
|
51
|
+
font-size: 6.25rem;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
h2 {
|
|
56
|
+
font-size: 2.5rem;
|
|
57
|
+
font-weight: 700;
|
|
58
|
+
line-height: 1.1;
|
|
59
|
+
|
|
60
|
+
@include devicebreak(medium) {
|
|
61
|
+
font-size: 2.813rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@include devicebreak(large) {
|
|
65
|
+
font-size: 3.438rem;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
h3 {
|
|
70
|
+
font-size: 1.875rem;
|
|
71
|
+
font-weight: 600;
|
|
72
|
+
line-height: 1.15;
|
|
73
|
+
|
|
74
|
+
@include devicebreak(medium) {
|
|
75
|
+
font-size: 2.188rem;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
h4 {
|
|
80
|
+
font-size: 1.563rem;
|
|
81
|
+
font-weight: 400;
|
|
82
|
+
line-height: 1.15;
|
|
83
|
+
|
|
84
|
+
@include devicebreak(medium) {
|
|
85
|
+
font-size: 2.188rem;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
h5 {
|
|
90
|
+
font-size: $mg-font-size-200;
|
|
91
|
+
font-weight: 400;
|
|
92
|
+
line-height: 1.15;
|
|
93
|
+
|
|
94
|
+
@include devicebreak(medium) {
|
|
95
|
+
font-size: 1.563rem;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
h6 {
|
|
100
|
+
font-size: $mg-font-size-100;
|
|
101
|
+
font-weight: 700;
|
|
102
|
+
letter-spacing: 0.03rem;
|
|
103
|
+
line-height: 1.15;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
p {
|
|
107
|
+
margin-top: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
ul,
|
|
111
|
+
ol {
|
|
112
|
+
margin: 0;
|
|
113
|
+
padding-left: 1.125rem;
|
|
114
|
+
|
|
115
|
+
@include devicebreak(medium) {
|
|
116
|
+
padding-left: 1.313rem;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
li {
|
|
120
|
+
margin-bottom: $mg-spacing-0;
|
|
121
|
+
padding-left: $mg-spacing-0;
|
|
122
|
+
|
|
123
|
+
@include devicebreak(medium) {
|
|
124
|
+
margin-bottom: $mg-spacing-0;
|
|
125
|
+
padding-left: $mg-spacing-25;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
ul li::marker {
|
|
131
|
+
font-size: 1.125rem;
|
|
132
|
+
|
|
133
|
+
@include devicebreak(medium) {
|
|
134
|
+
font-size: 1.313rem;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
ol {
|
|
139
|
+
li {
|
|
140
|
+
margin-bottom: 1.063rem;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
dl {
|
|
145
|
+
font-size: 0.875rem;
|
|
146
|
+
line-height: 1.37;
|
|
147
|
+
margin: $mg-spacing-0;
|
|
148
|
+
|
|
149
|
+
@include devicebreak(medium) {
|
|
150
|
+
font-size: 1.25rem;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
dt {
|
|
155
|
+
margin-bottom: $mg-spacing-25;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
dd {
|
|
159
|
+
margin-bottom: $mg-spacing-50;
|
|
160
|
+
margin-inline-start: $mg-spacing-200;
|
|
161
|
+
|
|
162
|
+
@include devicebreak(medium) {
|
|
163
|
+
margin-bottom: $mg-spacing-100;
|
|
164
|
+
margin-inline-start: $mg-spacing-300;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
hr {
|
|
169
|
+
// border-width: 2px;
|
|
170
|
+
border: 1px solid $mg-color-black;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// link animation
|
|
174
|
+
@keyframes line-loop-animation {
|
|
175
|
+
0% {
|
|
176
|
+
background-position: 100% 100%, -30px 100%;
|
|
177
|
+
background-size: 100% 2px, 0 2px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
100% {
|
|
181
|
+
background-position: calc(100% + 30px) 100%, 0 100%;
|
|
182
|
+
background-size: 0 2px, 100% 2px;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
a {
|
|
187
|
+
// @extend %paragraph-font-300 !optional;
|
|
188
|
+
// @extend %animate-link !optional;
|
|
189
|
+
|
|
190
|
+
color: $mg-color-interactive;
|
|
191
|
+
text-decoration: none;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
a:hover {
|
|
195
|
+
color: $mg-color-interactive-active;
|
|
196
|
+
text-decoration: underline;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// burmese lang
|
|
200
|
+
:lang(my) {
|
|
201
|
+
body {
|
|
202
|
+
font-family: $mg-font-family;
|
|
203
|
+
line-height: 1.7;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
h1,
|
|
207
|
+
h2,
|
|
208
|
+
h3,
|
|
209
|
+
h4,
|
|
210
|
+
h5,
|
|
211
|
+
h6 {
|
|
212
|
+
line-height: 1.7;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
h1 {
|
|
216
|
+
font-family: $mg-font-family;
|
|
217
|
+
font-size: 2.625rem;
|
|
218
|
+
|
|
219
|
+
@include devicebreak(medium) {
|
|
220
|
+
font-size: 3.875rem;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@include devicebreak(large) {
|
|
224
|
+
font-size: 5rem;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
h2 {
|
|
229
|
+
font-size: 2rem;
|
|
230
|
+
|
|
231
|
+
@include devicebreak(medium) {
|
|
232
|
+
font-size: 2.188rem;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@include devicebreak(large) {
|
|
236
|
+
font-size: 2.813rem;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
h4 {
|
|
241
|
+
font-size: 1.3rem;
|
|
242
|
+
|
|
243
|
+
@include devicebreak(medium) {
|
|
244
|
+
font-size: 1.8rem;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
h5 {
|
|
249
|
+
font-size: $mg-font-size-400;
|
|
250
|
+
|
|
251
|
+
@include devicebreak(medium) {
|
|
252
|
+
font-size: 1.375rem;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
p {
|
|
257
|
+
font-size: $mg-font-size-200;
|
|
258
|
+
line-height: 1.7;
|
|
259
|
+
|
|
260
|
+
@include devicebreak(medium) {
|
|
261
|
+
font-size: $mg-font-size-300;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
ul li,
|
|
266
|
+
ol li,
|
|
267
|
+
dl {
|
|
268
|
+
font-size: 0.875rem;
|
|
269
|
+
line-height: 1.9;
|
|
270
|
+
|
|
271
|
+
@include devicebreak(medium) {
|
|
272
|
+
font-size: 1.125rem;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.sbdocs {
|
|
277
|
+
.sbdocs-content,
|
|
278
|
+
h1,
|
|
279
|
+
h2,
|
|
280
|
+
h3,
|
|
281
|
+
h4,
|
|
282
|
+
h5,
|
|
283
|
+
h6,
|
|
284
|
+
p {
|
|
285
|
+
font-family: $mg-font-family;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.sbdocs-h1 {
|
|
289
|
+
font-size: $mg-spacing-150;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
[dir="rtl"] {
|
|
295
|
+
ul,
|
|
296
|
+
ol {
|
|
297
|
+
padding-left: 0;
|
|
298
|
+
padding-right: 1.125rem;
|
|
299
|
+
|
|
300
|
+
@include devicebreak(medium) {
|
|
301
|
+
padding-right: 1.313rem;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
li {
|
|
305
|
+
padding-left: 0;
|
|
306
|
+
padding-right: 0.875rem;
|
|
307
|
+
|
|
308
|
+
@include devicebreak(medium) {
|
|
309
|
+
padding-right: $mg-spacing-25;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* Cyrillic scripts */
|
|
316
|
+
#{$cyrillic} {
|
|
317
|
+
h1 {
|
|
318
|
+
font-family: $mg-font-family;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* typography end */
|