@comicrelief/component-library 8.12.0 → 8.13.0
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 +12 -0
- package/dist/components/Atoms/SocialIcons/Icon/Icon.js +50 -8
- package/dist/components/Atoms/SocialIcons/SocialIcons.js +2 -1
- package/dist/components/Atoms/SocialIcons/SocialIcons.md +9 -6
- package/dist/components/Atoms/SocialIcons/Utils/Links.js +8 -4
- package/dist/components/Atoms/SocialIcons/__snapshots__/SocialIcons.test.js.snap +15 -117
- package/dist/components/Molecules/Logos/Logos.js +37 -15
- package/dist/components/Molecules/ShareButton/ShareButton.js +2 -1
- package/dist/components/Molecules/ShareButton/ShareButton.test.js +2 -2
- package/dist/components/Organisms/Footer/Nav/Nav.js +3 -3
- package/dist/components/Organisms/Footer/__snapshots__/Footer.test.js.snap +155 -189
- package/dist/components/Organisms/Header/Header.md +4 -0
- package/dist/components/Organisms/Header/HeaderNav/HeaderNav.js +163 -0
- package/dist/components/Organisms/Header/HeaderNav/HeaderNav.style.js +237 -0
- package/dist/components/Organisms/Header/HeaderNav/Menu-Group-Icon.svg +3 -0
- package/dist/components/Organisms/Header/HeaderNav/arrow-right.png +0 -0
- package/dist/components/Organisms/Header/HeaderNav/arrow.svg +6 -0
- package/dist/components/Organisms/Header/HeaderNav/chevron-down.svg +3 -0
- package/dist/components/Organisms/Header/Nav/Nav.js +3 -3
- package/dist/components/Organisms/Header/annoying.css +14 -0
- package/dist/components/Organisms/Header/assets/Post.svg +3 -0
- package/dist/components/Organisms/Header/data/data-extended.js +236 -0
- package/dist/components/Organisms/Header/data/data-live.js +126 -0
- package/dist/components/Organisms/Header2025/Burger/BurgerMenu.js +28 -0
- package/dist/components/Organisms/Header2025/Burger/BurgerMenu.style.js +76 -0
- package/dist/components/Organisms/Header2025/Header2025.js +40 -0
- package/dist/components/Organisms/Header2025/Header2025.md +554 -0
- package/dist/components/Organisms/Header2025/Header2025.style.js +72 -0
- package/dist/components/Organisms/Header2025/HeaderNav2025/HeaderNav2025.js +175 -0
- package/dist/components/Organisms/Header2025/HeaderNav2025/HeaderNav2025.style.js +308 -0
- package/dist/components/Organisms/Header2025/HeaderNav2025/HeaderNavItem2025.js +79 -0
- package/dist/components/Organisms/Header2025/HeaderNav2025/Menu-Group-Icon.svg +3 -0
- package/dist/components/Organisms/Header2025/HeaderNav2025/MoreNav.js +93 -0
- package/dist/components/Organisms/Header2025/HeaderNav2025/MoreNav.style.js +108 -0
- package/dist/components/Organisms/Header2025/HeaderNav2025/arrow-right.png +0 -0
- package/dist/components/Organisms/Header2025/HeaderNav2025/arrow.svg +6 -0
- package/dist/components/Organisms/Header2025/HeaderNav2025/chevron-down.svg +3 -0
- package/dist/components/Organisms/Header2025/annoying.css +14 -0
- package/dist/components/Organisms/Header2025/assets/PayIn.svg +3 -0
- package/dist/components/Organisms/Header2025/assets/Post.svg +3 -0
- package/dist/components/Organisms/Header2025/assets/icon--mail--2023.svg +3 -0
- package/dist/components/Organisms/Header2025/assets/icon--search--2023.svg +3 -0
- package/dist/components/Organisms/Header2025/assets/icon--shop--2023.svg +3 -0
- package/dist/components/Organisms/Header2025/data/data-extended.js +236 -0
- package/dist/components/Organisms/Header2025/data/data-live.js +126 -0
- package/dist/components/Organisms/Header2025/data/data.js +156 -0
- package/dist/components/Organisms/Header2025/header2025.test.js +25 -0
- package/dist/index.js +7 -0
- package/dist/styleguide/data/data.js +19 -19
- package/dist/theme/shared/allBreakpoints.js +1 -0
- package/dist/utils/navHelper.js +24 -2
- package/package.json +1 -1
- package/playwright.config.js +13 -6
- package/src/components/Atoms/SocialIcons/Icon/Icon.js +84 -5
- package/src/components/Atoms/SocialIcons/SocialIcons.js +1 -0
- package/src/components/Atoms/SocialIcons/SocialIcons.md +9 -6
- package/src/components/Atoms/SocialIcons/Utils/Links.js +8 -4
- package/src/components/Atoms/SocialIcons/__snapshots__/SocialIcons.test.js.snap +15 -117
- package/src/components/Molecules/Logos/Logos.js +35 -15
- package/src/components/Molecules/ShareButton/ShareButton.js +1 -0
- package/src/components/Molecules/ShareButton/ShareButton.test.js +8 -32
- package/src/components/Organisms/Footer/Nav/Nav.js +2 -2
- package/src/components/Organisms/Footer/__snapshots__/Footer.test.js.snap +155 -189
- package/src/components/Organisms/Header/Header.md +4 -0
- package/src/components/Organisms/Header/HeaderNav/HeaderNav.js +213 -0
- package/src/components/Organisms/Header/HeaderNav/HeaderNav.style.js +391 -0
- package/src/components/Organisms/Header/HeaderNav/Menu-Group-Icon.svg +3 -0
- package/src/components/Organisms/Header/HeaderNav/arrow-right.png +0 -0
- package/src/components/Organisms/Header/HeaderNav/arrow.svg +6 -0
- package/src/components/Organisms/Header/HeaderNav/chevron-down.svg +3 -0
- package/src/components/Organisms/Header/Nav/Nav.js +1 -1
- package/src/components/Organisms/Header/annoying.css +14 -0
- package/src/components/Organisms/Header/assets/Post.svg +3 -0
- package/src/components/Organisms/Header/data/data-extended.js +280 -0
- package/src/components/Organisms/Header/data/data-live.js +149 -0
- package/src/components/Organisms/Header2025/Burger/BurgerMenu.js +28 -0
- package/src/components/Organisms/Header2025/Burger/BurgerMenu.style.js +99 -0
- package/src/components/Organisms/Header2025/Header2025.js +62 -0
- package/src/components/Organisms/Header2025/Header2025.md +554 -0
- package/src/components/Organisms/Header2025/Header2025.style.js +131 -0
- package/src/components/Organisms/Header2025/HeaderNav2025/HeaderNav2025.js +192 -0
- package/src/components/Organisms/Header2025/HeaderNav2025/HeaderNav2025.style.js +462 -0
- package/src/components/Organisms/Header2025/HeaderNav2025/HeaderNavItem2025.js +142 -0
- package/src/components/Organisms/Header2025/HeaderNav2025/Menu-Group-Icon.svg +3 -0
- package/src/components/Organisms/Header2025/HeaderNav2025/MoreNav.js +171 -0
- package/src/components/Organisms/Header2025/HeaderNav2025/MoreNav.style.js +190 -0
- package/src/components/Organisms/Header2025/HeaderNav2025/arrow-right.png +0 -0
- package/src/components/Organisms/Header2025/HeaderNav2025/arrow.svg +6 -0
- package/src/components/Organisms/Header2025/HeaderNav2025/chevron-down.svg +3 -0
- package/src/components/Organisms/Header2025/annoying.css +14 -0
- package/src/components/Organisms/Header2025/assets/PayIn.svg +3 -0
- package/src/components/Organisms/Header2025/assets/Post.svg +3 -0
- package/src/components/Organisms/Header2025/assets/icon--mail--2023.svg +3 -0
- package/src/components/Organisms/Header2025/assets/icon--search--2023.svg +3 -0
- package/src/components/Organisms/Header2025/assets/icon--shop--2023.svg +3 -0
- package/src/components/Organisms/Header2025/data/data-extended.js +280 -0
- package/src/components/Organisms/Header2025/data/data-live.js +149 -0
- package/src/components/Organisms/Header2025/data/data.js +184 -0
- package/src/components/Organisms/Header2025/header2025.test.js +23 -0
- package/src/index.js +1 -0
- package/src/styleguide/data/data.js +19 -19
- package/src/theme/shared/allBreakpoints.js +1 -0
- package/src/utils/navHelper.js +24 -1
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
11
|
+
var _BurgerMenu = _interopRequireDefault(require("../Burger/BurgerMenu"));
|
|
12
|
+
var _MoreNav = _interopRequireDefault(require("./MoreNav"));
|
|
13
|
+
var _allBreakpoints = require("../../../../theme/shared/allBreakpoints");
|
|
14
|
+
var _navHelper = require("../../../../utils/navHelper");
|
|
15
|
+
var _internalLinkHelper = require("../../../../utils/internalLinkHelper");
|
|
16
|
+
var _allowListed = _interopRequireDefault(require("../../../../utils/allowListed"));
|
|
17
|
+
var _HeaderNavItem = _interopRequireDefault(require("./HeaderNavItem2025"));
|
|
18
|
+
var _HeaderNav = require("./HeaderNav2025.style");
|
|
19
|
+
const HeaderNav2025 = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
navItems = {},
|
|
22
|
+
metaIcons,
|
|
23
|
+
donateButton = null,
|
|
24
|
+
characterLimit
|
|
25
|
+
} = _ref;
|
|
26
|
+
const {
|
|
27
|
+
menuGroups
|
|
28
|
+
} = navItems;
|
|
29
|
+
const [isExpandable, setIsExpandable] = (0, _react.useState)(false);
|
|
30
|
+
const [openedSubMenu, setOpenedSubMenu] = (0, _react.useState)({});
|
|
31
|
+
const [isNotDesktop, setIsNotDesktop] = (0, _react.useState)(null);
|
|
32
|
+
const [processedItems, setProcessedItems] = (0, _react.useState)(null);
|
|
33
|
+
const [showMoreNav, setShowMoreNav] = (0, _react.useState)(false);
|
|
34
|
+
let theseGroups = null;
|
|
35
|
+
const toggleBurgerMenu = e => {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
setIsExpandable(!isExpandable);
|
|
38
|
+
|
|
39
|
+
// If we've just closed the nav, collapse any open submenus:
|
|
40
|
+
if (isExpandable) {
|
|
41
|
+
setOpenedSubMenu({});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// Toggle the open/not-open value of the specific submenu passed
|
|
46
|
+
const toggleSubMenu = (e, item) => {
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
setOpenedSubMenu({
|
|
49
|
+
[item]: !openedSubMenu[item]
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// Called by eventHandler to reset the nav on a specific mouse interaction
|
|
54
|
+
const resetMoreNavMouse = () => {
|
|
55
|
+
// Remove active 'opened' state for any open More Nav submenus
|
|
56
|
+
setOpenedSubMenu({});
|
|
57
|
+
// And also remove the focus state so the 'focus-within' nav rules don't apply:
|
|
58
|
+
document.activeElement.blur();
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// Process the nav items on initial mount:
|
|
62
|
+
(0, _react.useEffect)(() => {
|
|
63
|
+
// Divide up nav items accordingly and determine breakpoint,
|
|
64
|
+
// assigned as local vars since useState won't be ready in time below:
|
|
65
|
+
const theseItems = (0, _navHelper.MoreNavPreProcess)(menuGroups, characterLimit);
|
|
66
|
+
const notDesktop = window.innerWidth < _allBreakpoints.breakpointValues.Nav;
|
|
67
|
+
setProcessedItems(theseItems);
|
|
68
|
+
setIsNotDesktop(notDesktop);
|
|
69
|
+
|
|
70
|
+
// Use these flags to detemine if we render the More nav or not:
|
|
71
|
+
setShowMoreNav(!notDesktop && theseItems.moreNavGroups.length);
|
|
72
|
+
}, [menuGroups, characterLimit]);
|
|
73
|
+
|
|
74
|
+
// Attach eventListener on mount and after potential changes
|
|
75
|
+
// to showMoreNav triggered by a window resize:
|
|
76
|
+
(0, _react.useEffect)(() => {
|
|
77
|
+
if (processedItems && showMoreNav) {
|
|
78
|
+
document.getElementById('more-nav-ul').addEventListener('mouseleave', resetMoreNavMouse);
|
|
79
|
+
}
|
|
80
|
+
}, [processedItems, showMoreNav]);
|
|
81
|
+
|
|
82
|
+
// Custom function to let us update the nav dynamically:
|
|
83
|
+
const screenResizeNav = (0, _react.useCallback)(() => {
|
|
84
|
+
// Grab the current width:
|
|
85
|
+
const currentScreenWidth = typeof window !== 'undefined' ? window.innerWidth : null;
|
|
86
|
+
|
|
87
|
+
// Compare to our breakpoint:
|
|
88
|
+
const isCurrentlyNotDesktop = currentScreenWidth < _allBreakpoints.breakpointValues.Nav;
|
|
89
|
+
|
|
90
|
+
// Only if the screen size has *changed*, update the state:
|
|
91
|
+
if (currentScreenWidth !== null && isNotDesktop !== isCurrentlyNotDesktop) {
|
|
92
|
+
// If we've changed from desktop to not, remove any previously-attached MoreNav event
|
|
93
|
+
// listeners, BEFORE we update the flag that'd remove the elements from the DOM:
|
|
94
|
+
if (isCurrentlyNotDesktop) {
|
|
95
|
+
document.getElementById('more-nav-ul').removeEventListener('mouseleave', resetMoreNavMouse);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Update our desktop flag to prevent any further calls:
|
|
99
|
+
setIsNotDesktop(isCurrentlyNotDesktop);
|
|
100
|
+
|
|
101
|
+
// And since we've changed breakpoints, use these flags
|
|
102
|
+
// to determine if we should render the More nav or not,
|
|
103
|
+
setShowMoreNav(Boolean(!isCurrentlyNotDesktop && processedItems.moreNavGroups));
|
|
104
|
+
}
|
|
105
|
+
}, [isNotDesktop, processedItems]);
|
|
106
|
+
|
|
107
|
+
// Hook into browser's own onresize event to call our custom wrapper function:
|
|
108
|
+
(0, _react.useEffect)(() => {
|
|
109
|
+
if (typeof window !== 'undefined') window.onresize = screenResizeNav;
|
|
110
|
+
}, [screenResizeNav]);
|
|
111
|
+
|
|
112
|
+
// Once we've processed the items, assign according to breakpoint; sub-desktop 'Nav'
|
|
113
|
+
// breakpoints use 'raw' unprocessed menu groups, Desktop ('Nav' breakpoint and up)
|
|
114
|
+
// uses the divided-up versions:
|
|
115
|
+
if (processedItems) theseGroups = isNotDesktop ? menuGroups : processedItems.standardGroups;
|
|
116
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_HeaderNav.Nav, {
|
|
117
|
+
"aria-label": "main-menu",
|
|
118
|
+
isExpandable: isExpandable,
|
|
119
|
+
role: "navigation",
|
|
120
|
+
id: "main-nav"
|
|
121
|
+
}, /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
122
|
+
id: "main-menu",
|
|
123
|
+
tag: "h2"
|
|
124
|
+
}, "Main navigation"), processedItems &&
|
|
125
|
+
/*#__PURE__*/
|
|
126
|
+
// First level of the navigation (ul tag): Parent
|
|
127
|
+
_react.default.createElement(_HeaderNav.NavMenu, {
|
|
128
|
+
role: "menubar"
|
|
129
|
+
}, theseGroups.map((group, index) => {
|
|
130
|
+
/* Grab the first links properties to use for our parent/button */
|
|
131
|
+
const thisFirstChild = group.links[0];
|
|
132
|
+
const thisID = group.id;
|
|
133
|
+
/* Determine which field represents our url path */
|
|
134
|
+
let thisUrl = (0, _navHelper.NavHelper)(thisFirstChild);
|
|
135
|
+
const relNoopener = !(0, _allowListed.default)(thisUrl) && 'noopener' || null;
|
|
136
|
+
const hasSubMenu = group.links && group.links.length > 1;
|
|
137
|
+
const hasPopUp = hasSubMenu ? 'true' : null;
|
|
138
|
+
thisUrl = (0, _internalLinkHelper.InternalLinkHelper)(thisUrl);
|
|
139
|
+
|
|
140
|
+
// Renders the first menugroup item to act as the parent; a button for the dropdown
|
|
141
|
+
// on mobile, a clickable LINK on desktop but hover to reveal the submenu:
|
|
142
|
+
return /*#__PURE__*/_react.default.createElement(_HeaderNavItem.default, {
|
|
143
|
+
thisID: thisID,
|
|
144
|
+
key: "".concat(thisID, "--item"),
|
|
145
|
+
index: index,
|
|
146
|
+
hasSubMenu: hasSubMenu,
|
|
147
|
+
openedSubMenu: openedSubMenu,
|
|
148
|
+
toggleSubMenu: toggleSubMenu,
|
|
149
|
+
hasPopUp: hasPopUp,
|
|
150
|
+
isNotDesktop: isNotDesktop,
|
|
151
|
+
thisUrl: thisUrl,
|
|
152
|
+
group: group,
|
|
153
|
+
thisFirstChild: thisFirstChild,
|
|
154
|
+
navHelper: _navHelper.NavHelper,
|
|
155
|
+
internalLinkHelper: _internalLinkHelper.InternalLinkHelper,
|
|
156
|
+
relNoopener: relNoopener
|
|
157
|
+
});
|
|
158
|
+
}), showMoreNav && /*#__PURE__*/_react.default.createElement(_MoreNav.default, {
|
|
159
|
+
processedItems: processedItems,
|
|
160
|
+
openedSubMenu: openedSubMenu,
|
|
161
|
+
toggleSubMenu: toggleSubMenu,
|
|
162
|
+
navHelper: _navHelper.NavHelper,
|
|
163
|
+
allowListed: _allowListed.default,
|
|
164
|
+
internalLinkHelper: _internalLinkHelper.InternalLinkHelper
|
|
165
|
+
})), /*#__PURE__*/_react.default.createElement(_HeaderNav.NavMetaIcons, {
|
|
166
|
+
isHeader: true,
|
|
167
|
+
"data-testid": "meta-icons--mobile"
|
|
168
|
+
}, metaIcons), /*#__PURE__*/_react.default.createElement(_HeaderNav.DonateButtonWrapperBottom, {
|
|
169
|
+
"data-testid": "donate-button--mobile"
|
|
170
|
+
}, donateButton)), /*#__PURE__*/_react.default.createElement(_BurgerMenu.default, {
|
|
171
|
+
toggle: toggleBurgerMenu,
|
|
172
|
+
isExpandable: isExpandable
|
|
173
|
+
}, "Open"));
|
|
174
|
+
};
|
|
175
|
+
var _default = exports.default = HeaderNav2025;
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.SubNavMenu = exports.SubNavLink = exports.SubNavItem = exports.StyledText = exports.NavMetaIcons = exports.NavMenu = exports.NavLink = exports.NavItem = exports.Nav = exports.DonateButtonWrapperBottom = exports.DesktopNavLink = exports.ChevronWrapper = void 0;
|
|
9
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
10
|
+
var _Link = _interopRequireDefault(require("../../../Atoms/Link/Link"));
|
|
11
|
+
var _hideVisually = _interopRequireDefault(require("../../../../theme/shared/hideVisually"));
|
|
12
|
+
var _zIndex = _interopRequireDefault(require("../../../../theme/shared/zIndex"));
|
|
13
|
+
var _arrowRight = _interopRequireDefault(require("./arrow-right.png"));
|
|
14
|
+
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
15
|
+
const transitionDuration = 0.2;
|
|
16
|
+
const NavLinkClass = (0, _styledComponents.default)(_Link.default).withConfig({
|
|
17
|
+
displayName: "HeaderNav2025style__NavLinkClass",
|
|
18
|
+
componentId: "sc-xflhtq-0"
|
|
19
|
+
})(["display:inline-block;border:0;padding:25px;line-height:1rem;height:auto;font-weight:700;width:100%;color:", ";transition:color ", "s ease;:hover,:focus,:focus-within{border:0;}@media ", "{:hover,:focus{color:", ";background-color:", ";font-weight:inherit;}:focus-within{background-color:", ";&:hover{background-color:", ";}}}> div{height:auto;transition:transform 0.35s cubic-bezier(0.41,1.64,0.41,0.8);", "}"], _ref => {
|
|
20
|
+
let {
|
|
21
|
+
theme
|
|
22
|
+
} = _ref;
|
|
23
|
+
return theme.color('black');
|
|
24
|
+
}, transitionDuration, _ref2 => {
|
|
25
|
+
let {
|
|
26
|
+
theme
|
|
27
|
+
} = _ref2;
|
|
28
|
+
return theme.allBreakpoints('M');
|
|
29
|
+
}, _ref3 => {
|
|
30
|
+
let {
|
|
31
|
+
theme
|
|
32
|
+
} = _ref3;
|
|
33
|
+
return theme.color('red');
|
|
34
|
+
}, _ref4 => {
|
|
35
|
+
let {
|
|
36
|
+
theme
|
|
37
|
+
} = _ref4;
|
|
38
|
+
return theme.color('grey_extra_light');
|
|
39
|
+
}, _ref5 => {
|
|
40
|
+
let {
|
|
41
|
+
theme
|
|
42
|
+
} = _ref5;
|
|
43
|
+
return theme.color('white');
|
|
44
|
+
}, _ref6 => {
|
|
45
|
+
let {
|
|
46
|
+
theme
|
|
47
|
+
} = _ref6;
|
|
48
|
+
return theme.color('grey_extra_light');
|
|
49
|
+
}, _ref7 => {
|
|
50
|
+
let {
|
|
51
|
+
isExpanded
|
|
52
|
+
} = _ref7;
|
|
53
|
+
return isExpanded && (0, _styledComponents.css)(["transform:rotate(-180deg);"]);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Navigation menu
|
|
58
|
+
*/
|
|
59
|
+
const Nav = exports.Nav = _styledComponents.default.nav.withConfig({
|
|
60
|
+
displayName: "HeaderNav2025style__Nav",
|
|
61
|
+
componentId: "sc-xflhtq-1"
|
|
62
|
+
})(["display:", ";width:100%;position:absolute;top:75px;left:0;", ";background-color:", ";box-shadow:0px 20px 20px 5px rgba(0,0,0,0.25);@media ", "{width:50%;right:0;left:inherit;box-shadow:-20px 15px 20px 0px rgba(0,0,0,0.25);}@media ", "{", ";position:relative;top:0;display:block;margin:0;width:auto;height:100%;box-shadow:none;}@media ", "{margin:0 10px;}> h2{", ";}"], _ref8 => {
|
|
63
|
+
let {
|
|
64
|
+
isExpandable
|
|
65
|
+
} = _ref8;
|
|
66
|
+
return isExpandable ? 'block' : 'none';
|
|
67
|
+
}, (0, _zIndex.default)('higher'), _ref9 => {
|
|
68
|
+
let {
|
|
69
|
+
theme
|
|
70
|
+
} = _ref9;
|
|
71
|
+
return theme.color('white');
|
|
72
|
+
}, _ref10 => {
|
|
73
|
+
let {
|
|
74
|
+
theme
|
|
75
|
+
} = _ref10;
|
|
76
|
+
return theme.allBreakpoints('M');
|
|
77
|
+
}, _ref11 => {
|
|
78
|
+
let {
|
|
79
|
+
theme
|
|
80
|
+
} = _ref11;
|
|
81
|
+
return theme.allBreakpoints('Nav');
|
|
82
|
+
}, (0, _zIndex.default)('medium'), _ref12 => {
|
|
83
|
+
let {
|
|
84
|
+
theme
|
|
85
|
+
} = _ref12;
|
|
86
|
+
return theme.allBreakpoints('NavWide');
|
|
87
|
+
}, _hideVisually.default);
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Sub Navigation Menu (second level)
|
|
91
|
+
*/
|
|
92
|
+
const SubNavMenu = exports.SubNavMenu = _styledComponents.default.ul.withConfig({
|
|
93
|
+
displayName: "HeaderNav2025style__SubNavMenu",
|
|
94
|
+
componentId: "sc-xflhtq-2"
|
|
95
|
+
})(["visibility:", ";display:", ";padding:0;position:relative;list-style:none outside;left:0;top:0;flex-direction:column;justify-content:center;align-items:center;background-color:", ";overflow:hidden;border-top:1px solid ", ";@media ", "{display:flex;width:330px;height:auto;padding:0;position:absolute;top:86px;left:-5px;border-radius:0 0 25px 25px;transition:opacity ", "s ease;opacity:0;box-shadow:0px 20px 20px 5px rgba(0,0,0,0.25);}"], _ref13 => {
|
|
96
|
+
let {
|
|
97
|
+
isSubMenuOpen
|
|
98
|
+
} = _ref13;
|
|
99
|
+
return isSubMenuOpen ? 'visible' : 'hidden';
|
|
100
|
+
}, _ref14 => {
|
|
101
|
+
let {
|
|
102
|
+
isSubMenuOpen
|
|
103
|
+
} = _ref14;
|
|
104
|
+
return isSubMenuOpen ? 'flex' : 'none';
|
|
105
|
+
}, _ref15 => {
|
|
106
|
+
let {
|
|
107
|
+
theme
|
|
108
|
+
} = _ref15;
|
|
109
|
+
return theme.color('white');
|
|
110
|
+
}, _ref16 => {
|
|
111
|
+
let {
|
|
112
|
+
theme
|
|
113
|
+
} = _ref16;
|
|
114
|
+
return theme.color('grey_medium');
|
|
115
|
+
}, _ref17 => {
|
|
116
|
+
let {
|
|
117
|
+
theme
|
|
118
|
+
} = _ref17;
|
|
119
|
+
return theme.allBreakpoints('Nav');
|
|
120
|
+
}, transitionDuration);
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Sub Menu list items
|
|
124
|
+
*/
|
|
125
|
+
const SubNavItem = exports.SubNavItem = _styledComponents.default.li.withConfig({
|
|
126
|
+
displayName: "HeaderNav2025style__SubNavItem",
|
|
127
|
+
componentId: "sc-xflhtq-3"
|
|
128
|
+
})(["padding:0;height:100%;width:100%;border-top:1px solid ", ";;position:relative;transition:background-color ", "s ease;&:first-of-type{border-top:none;}span{font-weight:100;}"], _ref18 => {
|
|
129
|
+
let {
|
|
130
|
+
theme
|
|
131
|
+
} = _ref18;
|
|
132
|
+
return theme.color('grey_medium');
|
|
133
|
+
}, transitionDuration);
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Sub menu link item
|
|
137
|
+
*/
|
|
138
|
+
const SubNavLink = exports.SubNavLink = (0, _styledComponents.default)(NavLinkClass).withConfig({
|
|
139
|
+
displayName: "HeaderNav2025style__SubNavLink",
|
|
140
|
+
componentId: "sc-xflhtq-4"
|
|
141
|
+
})(["padding:20px 25px 22px 42px;color:", ";height:auto;position:relative;"], _ref19 => {
|
|
142
|
+
let {
|
|
143
|
+
theme
|
|
144
|
+
} = _ref19;
|
|
145
|
+
return theme.color('black');
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Navigation Menu (first level)
|
|
150
|
+
*/
|
|
151
|
+
const NavMenu = exports.NavMenu = _styledComponents.default.ul.withConfig({
|
|
152
|
+
displayName: "HeaderNav2025style__NavMenu",
|
|
153
|
+
componentId: "sc-xflhtq-5"
|
|
154
|
+
})(["background-color:", ";list-style:none outside;padding:0;margin:0;@media ", "{position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;background-color:", ";}"], _ref20 => {
|
|
155
|
+
let {
|
|
156
|
+
theme
|
|
157
|
+
} = _ref20;
|
|
158
|
+
return theme.color('white');
|
|
159
|
+
}, _ref21 => {
|
|
160
|
+
let {
|
|
161
|
+
theme
|
|
162
|
+
} = _ref21;
|
|
163
|
+
return theme.allBreakpoints('Nav');
|
|
164
|
+
}, _ref22 => {
|
|
165
|
+
let {
|
|
166
|
+
theme
|
|
167
|
+
} = _ref22;
|
|
168
|
+
return theme.color('white');
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Menu item link
|
|
173
|
+
*/
|
|
174
|
+
const NavLink = exports.NavLink = (0, _styledComponents.default)(NavLinkClass).withConfig({
|
|
175
|
+
displayName: "HeaderNav2025style__NavLink",
|
|
176
|
+
componentId: "sc-xflhtq-6"
|
|
177
|
+
})(["display:flex;gap:4px;font-family:", ";", " @media ", "{padding:10px 0px 10px 0;height:auto;", " :hover,:focus-within,:focus{+ ", "{display:flex;opacity:1;}}}@media ", "{", "}"], _ref23 => {
|
|
178
|
+
let {
|
|
179
|
+
theme
|
|
180
|
+
} = _ref23;
|
|
181
|
+
return theme.fontFamilies(theme.font.regular);
|
|
182
|
+
}, _ref24 => {
|
|
183
|
+
let {
|
|
184
|
+
isExpanded,
|
|
185
|
+
theme
|
|
186
|
+
} = _ref24;
|
|
187
|
+
return isExpanded && (0, _styledComponents.css)(["&,&:hover,&:focus-within,&:focus{color:", ";}"], theme.color('red'));
|
|
188
|
+
}, _ref25 => {
|
|
189
|
+
let {
|
|
190
|
+
theme
|
|
191
|
+
} = _ref25;
|
|
192
|
+
return theme.allBreakpoints('Nav');
|
|
193
|
+
}, _ref26 => {
|
|
194
|
+
let {
|
|
195
|
+
hasSubMenu
|
|
196
|
+
} = _ref26;
|
|
197
|
+
return hasSubMenu && (0, _styledComponents.css)(["padding:10px 14px 10px 0;"]);
|
|
198
|
+
}, SubNavMenu, _ref27 => {
|
|
199
|
+
let {
|
|
200
|
+
theme
|
|
201
|
+
} = _ref27;
|
|
202
|
+
return theme.allBreakpoints('NavWide');
|
|
203
|
+
}, _ref28 => {
|
|
204
|
+
let {
|
|
205
|
+
hasSubMenu
|
|
206
|
+
} = _ref28;
|
|
207
|
+
return hasSubMenu && (0, _styledComponents.css)(["padding:10px 16px 10px 0;"]);
|
|
208
|
+
});
|
|
209
|
+
const DesktopNavLink = exports.DesktopNavLink = (0, _styledComponents.default)(NavLink).withConfig({
|
|
210
|
+
displayName: "HeaderNav2025style__DesktopNavLink",
|
|
211
|
+
componentId: "sc-xflhtq-7"
|
|
212
|
+
})(["&,&:hover,&:focus,&:focus-within{background-color:", ";}"], _ref29 => {
|
|
213
|
+
let {
|
|
214
|
+
theme
|
|
215
|
+
} = _ref29;
|
|
216
|
+
return theme.color('white');
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Menu list items
|
|
221
|
+
*/
|
|
222
|
+
const NavItem = exports.NavItem = _styledComponents.default.li.withConfig({
|
|
223
|
+
displayName: "HeaderNav2025style__NavItem",
|
|
224
|
+
componentId: "sc-xflhtq-8"
|
|
225
|
+
})(["", ";position:relative;font-weight:700;border-bottom:1px solid ", ";li{span{border-bottom:none;padding-bottom:0;}:hover,:focus,:focus-within{span{border-bottom:none;padding-bottom:0;}}}span > a > div{transition:transform 0.35s cubic-bezier(0.41,1.64,0.41,0.8);}:hover,:focus,:focus-within{li{span{border-bottom:none;padding-bottom:0;}}span > a{color:", ";> div{transform:rotate(-180deg);img{filter:invert(0.5) sepia(1) saturate(100) hue-rotate(20deg);}}}}@media ", "{margin:0 22px 0 0;padding:25px 0px;border-bottom:none;:hover,:focus,:focus-within{> ", ",:focus-within > ", "{visibility:visible;opacity:1;display:flex;}}:hover,:focus,:focus-within{background-color:transparent;", ";span{border-bottom:2px solid ", ";padding-bottom:2px;}", "{display:flex;opacity:1;visibility:visible;flex-direction:column;}}}@media ", "{margin:0 20px 0 0;}"], (0, _zIndex.default)('medium'), _ref30 => {
|
|
226
|
+
let {
|
|
227
|
+
theme
|
|
228
|
+
} = _ref30;
|
|
229
|
+
return theme.color('grey_medium');
|
|
230
|
+
}, _ref31 => {
|
|
231
|
+
let {
|
|
232
|
+
theme
|
|
233
|
+
} = _ref31;
|
|
234
|
+
return theme.color('red');
|
|
235
|
+
}, _ref32 => {
|
|
236
|
+
let {
|
|
237
|
+
theme
|
|
238
|
+
} = _ref32;
|
|
239
|
+
return theme.allBreakpoints('Nav');
|
|
240
|
+
}, SubNavMenu, SubNavMenu, (0, _zIndex.default)('high'), _ref33 => {
|
|
241
|
+
let {
|
|
242
|
+
theme
|
|
243
|
+
} = _ref33;
|
|
244
|
+
return theme.color('black');
|
|
245
|
+
}, SubNavMenu, _ref34 => {
|
|
246
|
+
let {
|
|
247
|
+
theme
|
|
248
|
+
} = _ref34;
|
|
249
|
+
return theme.allBreakpoints('NavWide');
|
|
250
|
+
});
|
|
251
|
+
const ChevronWrapper = exports.ChevronWrapper = _styledComponents.default.div.withConfig({
|
|
252
|
+
displayName: "HeaderNav2025style__ChevronWrapper",
|
|
253
|
+
componentId: "sc-xflhtq-9"
|
|
254
|
+
})(["width:16px;position:absolute;top:20px;right:22px;height:16px;img{width:100%;display:block;height:auto;}@media ", "{position:absolute;top:10px;right:0;width:10px;}"], _ref35 => {
|
|
255
|
+
let {
|
|
256
|
+
theme
|
|
257
|
+
} = _ref35;
|
|
258
|
+
return theme.allBreakpoints('Nav');
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
// This represents the 'non-desktop'/mobile nav icons:
|
|
262
|
+
const NavMetaIcons = exports.NavMetaIcons = _styledComponents.default.div.withConfig({
|
|
263
|
+
displayName: "HeaderNav2025style__NavMetaIcons",
|
|
264
|
+
componentId: "sc-xflhtq-10"
|
|
265
|
+
})(["width:auto;display:flex;align-items:center;flex-direction:column;background-color:inherit;> div{height:60px;width:100%;display:flex;border-bottom:1px solid ", ";> a{height:inherit;width:100%;padding:15px 20px;position:relative;&:after{position:absolute;right:20px;top:50%;transform:translateY(-50%);content:\"\";width:20px;height:20px;background-image:url(", ");background-size:100%;background-repeat:no-repeat;}img{padding:5px;height:35px;width:35px;}span{transition:color 0.15s ease-out;}@media ", "{&:focus,&:hover{span{color:", ";}}}}&:first-child{margin-top:20px;}}@media ", "{display:none;}"], _ref36 => {
|
|
266
|
+
let {
|
|
267
|
+
theme
|
|
268
|
+
} = _ref36;
|
|
269
|
+
return theme.color('grey_medium');
|
|
270
|
+
}, _arrowRight.default, _ref37 => {
|
|
271
|
+
let {
|
|
272
|
+
theme
|
|
273
|
+
} = _ref37;
|
|
274
|
+
return theme.allBreakpoints('M');
|
|
275
|
+
}, _ref38 => {
|
|
276
|
+
let {
|
|
277
|
+
theme
|
|
278
|
+
} = _ref38;
|
|
279
|
+
return theme.color('red');
|
|
280
|
+
}, _ref39 => {
|
|
281
|
+
let {
|
|
282
|
+
theme
|
|
283
|
+
} = _ref39;
|
|
284
|
+
return theme.allBreakpoints('Nav');
|
|
285
|
+
});
|
|
286
|
+
const StyledText = exports.StyledText = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
287
|
+
displayName: "HeaderNav2025style__StyledText",
|
|
288
|
+
componentId: "sc-xflhtq-11"
|
|
289
|
+
})(["@media ", "{font-size:15px;}@media ", "{font-size:1rem;}"], _ref40 => {
|
|
290
|
+
let {
|
|
291
|
+
theme
|
|
292
|
+
} = _ref40;
|
|
293
|
+
return theme.allBreakpoints('Nav');
|
|
294
|
+
}, _ref41 => {
|
|
295
|
+
let {
|
|
296
|
+
theme
|
|
297
|
+
} = _ref41;
|
|
298
|
+
return theme.allBreakpoints('NavWide');
|
|
299
|
+
});
|
|
300
|
+
const DonateButtonWrapperBottom = exports.DonateButtonWrapperBottom = _styledComponents.default.div.withConfig({
|
|
301
|
+
displayName: "HeaderNav2025style__DonateButtonWrapperBottom",
|
|
302
|
+
componentId: "sc-xflhtq-12"
|
|
303
|
+
})(["display:flex;justify-content:center;padding:35px 20px;background-color:inherit;a{width:calc(100% - 10px);transition:width 0.35s cubic-bezier(0.5,1.5,0.5,0.9);&:hover,&:focus{width:100%;box-shadow:rgba(0,0,0,0.1) 0 0 20px 0;}}@media ", "{display:none;}"], _ref42 => {
|
|
304
|
+
let {
|
|
305
|
+
theme
|
|
306
|
+
} = _ref42;
|
|
307
|
+
return theme.allBreakpoints('Nav');
|
|
308
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
10
|
+
var _HeaderNav = require("./HeaderNav2025.style");
|
|
11
|
+
var _MenuGroupIcon = _interopRequireDefault(require("./Menu-Group-Icon.svg"));
|
|
12
|
+
const HeaderNavItem2025 = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
thisID,
|
|
15
|
+
relNoopener,
|
|
16
|
+
hasSubMenu,
|
|
17
|
+
index,
|
|
18
|
+
openedSubMenu,
|
|
19
|
+
isNotDesktop,
|
|
20
|
+
hasPopUp,
|
|
21
|
+
thisUrl,
|
|
22
|
+
toggleSubMenu,
|
|
23
|
+
group,
|
|
24
|
+
thisFirstChild,
|
|
25
|
+
navHelper,
|
|
26
|
+
internalLinkHelper,
|
|
27
|
+
...rest
|
|
28
|
+
} = _ref;
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_HeaderNav.NavItem, {
|
|
30
|
+
role: "none",
|
|
31
|
+
key: "".concat(index, "-").concat(thisID, "--item"),
|
|
32
|
+
index: index,
|
|
33
|
+
isSubMenuOpen: !!openedSubMenu
|
|
34
|
+
}, isNotDesktop ? /*#__PURE__*/_react.default.createElement(_HeaderNav.NavLink, {
|
|
35
|
+
href: hasPopUp ? '#' : thisUrl,
|
|
36
|
+
inline: true,
|
|
37
|
+
rel: relNoopener,
|
|
38
|
+
"aria-expanded": !!openedSubMenu[thisID],
|
|
39
|
+
"aria-haspopup": hasPopUp,
|
|
40
|
+
onClick: hasPopUp ? e => toggleSubMenu(e, thisID) : null,
|
|
41
|
+
role: "button",
|
|
42
|
+
key: "".concat(index, "-").concat(thisID, "--link"),
|
|
43
|
+
isExpanded: !!openedSubMenu[thisID]
|
|
44
|
+
}, thisFirstChild.title, hasSubMenu && /*#__PURE__*/_react.default.createElement(_HeaderNav.ChevronWrapper, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
45
|
+
src: _MenuGroupIcon.default,
|
|
46
|
+
alt: "chevron down icon"
|
|
47
|
+
}))) : /*#__PURE__*/_react.default.createElement(_HeaderNav.StyledText, null, /*#__PURE__*/_react.default.createElement(_HeaderNav.DesktopNavLink, Object.assign({
|
|
48
|
+
href: thisUrl,
|
|
49
|
+
inline: true,
|
|
50
|
+
rel: relNoopener,
|
|
51
|
+
"aria-haspopup": hasPopUp,
|
|
52
|
+
key: "".concat(index, "-").concat(thisID),
|
|
53
|
+
hasSubMenu: hasSubMenu
|
|
54
|
+
}, rest), thisFirstChild.title, hasSubMenu && /*#__PURE__*/_react.default.createElement(_HeaderNav.ChevronWrapper, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
55
|
+
src: _MenuGroupIcon.default,
|
|
56
|
+
alt: "chevron down icon"
|
|
57
|
+
})))), hasSubMenu && /*#__PURE__*/_react.default.createElement(_HeaderNav.SubNavMenu, {
|
|
58
|
+
role: "list",
|
|
59
|
+
isSubMenuOpen: !!openedSubMenu[thisID],
|
|
60
|
+
key: "".concat(index, "-").concat(thisID, "--sub-item")
|
|
61
|
+
}, group.links.map((child, childIndex) => {
|
|
62
|
+
let thisSubUrl = navHelper(child);
|
|
63
|
+
thisSubUrl = internalLinkHelper(thisSubUrl);
|
|
64
|
+
|
|
65
|
+
// Skip the very first child on desktop, since
|
|
66
|
+
// we've already made a 'button' version above:
|
|
67
|
+
if (childIndex === 0 && !isNotDesktop) return null;
|
|
68
|
+
|
|
69
|
+
// Otherwise, render out as usual:
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement(_HeaderNav.SubNavItem, {
|
|
71
|
+
key: "".concat(index, "-").concat(thisSubUrl)
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_HeaderNav.SubNavLink, {
|
|
73
|
+
href: thisSubUrl,
|
|
74
|
+
inline: true,
|
|
75
|
+
role: "menuitem"
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement(_Text.default, null, child.title)));
|
|
77
|
+
})));
|
|
78
|
+
};
|
|
79
|
+
var _default = exports.default = HeaderNavItem2025;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="14" height="24" viewBox="0 0 14 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M7 16.5002C6.744 16.5002 6.48849 16.4027 6.29299 16.2072L0.29288 10.207C-0.0976268 9.81649 -0.0976268 9.18347 0.29288 8.79296C0.683387 8.40245 1.3164 8.40245 1.70691 8.79296L7 14.0856L12.2931 8.79296C12.6836 8.40245 13.3166 8.40245 13.7071 8.79296C14.0976 9.18347 14.0976 9.81649 13.7071 10.207L7.70701 16.2072C7.51151 16.4027 7.256 16.5002 7 16.5002Z" fill="#222222"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
10
|
+
var _HeaderNav = require("./HeaderNav2025.style");
|
|
11
|
+
var _MenuGroupIcon = _interopRequireDefault(require("./Menu-Group-Icon.svg"));
|
|
12
|
+
var _MoreNav = require("./MoreNav.style");
|
|
13
|
+
const MoreNav = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
processedItems,
|
|
16
|
+
openedSubMenu,
|
|
17
|
+
toggleSubMenu,
|
|
18
|
+
navHelper,
|
|
19
|
+
allowListed,
|
|
20
|
+
internalLinkHelper
|
|
21
|
+
} = _ref;
|
|
22
|
+
const handleNestedLinkClick = (e, childID, hasPopUp) => {
|
|
23
|
+
if (hasPopUp) {
|
|
24
|
+
// Toggle the state for this item:
|
|
25
|
+
toggleSubMenu(e, childID);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return /*#__PURE__*/_react.default.createElement(_MoreNav.MoreNavItem, {
|
|
29
|
+
id: "more-nav"
|
|
30
|
+
}, /*#__PURE__*/_react.default.createElement(_MoreNav.MoreNavLabel
|
|
31
|
+
// Used to target focus/blur handlers
|
|
32
|
+
, {
|
|
33
|
+
id: "more-nav-label"
|
|
34
|
+
// Ensure we can tab to this normally non-foccusable element:
|
|
35
|
+
,
|
|
36
|
+
tabIndex: "0"
|
|
37
|
+
// Shrug off any click-fire focus events to not mess with other events:
|
|
38
|
+
,
|
|
39
|
+
onClick: e => e.target.blur(),
|
|
40
|
+
"aria-haspopup": "true"
|
|
41
|
+
}, "More", /*#__PURE__*/_react.default.createElement(_HeaderNav.ChevronWrapper, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
42
|
+
src: _MenuGroupIcon.default,
|
|
43
|
+
alt: "Chevron icon"
|
|
44
|
+
}))), /*#__PURE__*/_react.default.createElement(_MoreNav.MoreSubNavMenu, {
|
|
45
|
+
role: "list",
|
|
46
|
+
id: "more-nav-ul",
|
|
47
|
+
key: "more-nav-ul"
|
|
48
|
+
}, processedItems.moreNavGroups.map(child => {
|
|
49
|
+
/* Grab the first links properties to use for our parent/button */
|
|
50
|
+
const thisFirstChild = child.links[0];
|
|
51
|
+
let thisUrl = navHelper(thisFirstChild);
|
|
52
|
+
const relNoopener = !allowListed(thisUrl) && 'noopener' || null;
|
|
53
|
+
const hasSubMenu = child.links && child.links.length > 1;
|
|
54
|
+
const hasPopUp = hasSubMenu ? 'true' : null;
|
|
55
|
+
thisUrl = internalLinkHelper(thisUrl);
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement(_MoreNav.MoreSubNavItem, {
|
|
57
|
+
key: child.title
|
|
58
|
+
}, /*#__PURE__*/_react.default.createElement(_MoreNav.MoreNavNestedLink, {
|
|
59
|
+
href: hasPopUp ? '#' : thisUrl,
|
|
60
|
+
inline: true,
|
|
61
|
+
rel: relNoopener,
|
|
62
|
+
"aria-haspopup": hasPopUp,
|
|
63
|
+
role: hasPopUp ? 'button' : 'link',
|
|
64
|
+
onClick: e => handleNestedLinkClick(e, child.id, hasPopUp),
|
|
65
|
+
isSubMenuOpen: Boolean(openedSubMenu[child.id]),
|
|
66
|
+
"aria-expanded": Boolean(openedSubMenu[child.id])
|
|
67
|
+
}, thisFirstChild.title, hasSubMenu && /*#__PURE__*/_react.default.createElement(_HeaderNav.ChevronWrapper, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
68
|
+
src: _MenuGroupIcon.default,
|
|
69
|
+
alt: "Chevron icon"
|
|
70
|
+
}))), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, hasSubMenu && /*#__PURE__*/_react.default.createElement(_MoreNav.MoreNestedSubNavMenu, {
|
|
71
|
+
role: "list",
|
|
72
|
+
isSubMenuOpen: Boolean(openedSubMenu[child.id])
|
|
73
|
+
}, child.links.map(subChild => {
|
|
74
|
+
const thisSubUrl = navHelper(subChild);
|
|
75
|
+
return (
|
|
76
|
+
/*#__PURE__*/
|
|
77
|
+
// 'More Nav' sub item:
|
|
78
|
+
_react.default.createElement(_MoreNav.MoreSubNavItem, {
|
|
79
|
+
key: thisSubUrl
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement(_MoreNav.MoreSubNavLink, {
|
|
81
|
+
href: thisSubUrl,
|
|
82
|
+
inline: true,
|
|
83
|
+
role: "menuitem"
|
|
84
|
+
// Allows us to avoid using the 'display:none'
|
|
85
|
+
// approach so we can animate properly:
|
|
86
|
+
,
|
|
87
|
+
tabIndex: openedSubMenu[child.id] ? '0' : '-1'
|
|
88
|
+
}, /*#__PURE__*/_react.default.createElement(_Text.default, null, subChild.title)))
|
|
89
|
+
);
|
|
90
|
+
}))));
|
|
91
|
+
})));
|
|
92
|
+
};
|
|
93
|
+
var _default = exports.default = MoreNav;
|