@comicrelief/component-library 8.54.0 → 8.55.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/dist/components/Atoms/Logo/Logo.js +0 -5
- package/dist/components/Atoms/Logo/Logo.test.js +1 -1
- package/dist/components/Atoms/LogoNav2026/LogoNav2026.test.js +94 -0
- package/dist/components/Atoms/LogoNav2026/_LogoNav2026.js +63 -0
- package/dist/components/Atoms/LogoNav2026/assets/cr-logo-mob.svg +14 -0
- package/dist/components/Atoms/LogoNav2026/assets/cr-logo.svg +14 -0
- package/dist/components/Molecules/CTA/CTAMultiCard/__snapshots__/CTAMultiCard.test.js.snap +12 -12
- package/dist/components/Molecules/CTA/CTASingleCard/CTASingleCard.md +2 -2
- package/dist/components/Molecules/CTA/CTASingleCard/__snapshots__/CTASingleCard.test.js.snap +2 -2
- package/dist/components/Molecules/CTA/shared/CTACard.style.js +1 -1
- package/dist/components/Molecules/LogoLinked/LogoLinked.md +6 -1
- package/dist/components/Organisms/Header/HeaderNav/HeaderNav.style.js +3 -3
- package/dist/components/Organisms/Header2025/Header2025.md +1 -1
- package/dist/components/Organisms/Header2025/HeaderNav2025/HeaderNav2025.js +1 -1
- package/dist/components/Organisms/Header2025/HeaderNav2025/HeaderNav2025.style.js +3 -3
- package/dist/components/Organisms/Header2026/Burger/BurgerMenu.js +25 -0
- package/dist/components/Organisms/Header2026/Burger/BurgerMenu.style.js +58 -0
- package/dist/components/Organisms/Header2026/Header2026.js +148 -0
- package/dist/components/Organisms/Header2026/Header2026.md +14 -0
- package/dist/components/Organisms/Header2026/Header2026.style.js +129 -0
- package/dist/components/Organisms/Header2026/Navs/Navs.js +209 -0
- package/dist/components/Organisms/Header2026/Navs/Navs.style.js +104 -0
- package/dist/components/Organisms/Header2026/Navs/PrimaryNavItem.js +227 -0
- package/dist/components/Organisms/Header2026/Navs/PrimaryNavItem.style.js +401 -0
- package/dist/components/Organisms/Header2026/Navs/arrow-right.png +0 -0
- package/dist/components/Organisms/Header2026/Navs/arrow.svg +6 -0
- package/dist/components/Organisms/Header2026/Navs/chevron-down.svg +3 -0
- package/dist/components/Organisms/Header2026/assets/arrow-icon.svg +3 -0
- package/dist/components/Organisms/Header2026/assets/chevron-icon.svg +3 -0
- package/dist/components/Organisms/Header2026/assets/search-icon.svg +10 -0
- package/dist/components/Organisms/Header2026/header2026.test.js +24 -0
- package/dist/components/Organisms/Header2026/mockData/mockData.json +569 -0
- package/dist/components/Organisms/Header2026/mockData/query.graphql +64 -0
- package/dist/theme/shared/animations.js +6 -1
- package/dist/utils/navHelper.js +75 -3
- package/dist/utils/remove-extra-styles-in-preview.css +14 -0
- package/dist/utils/urlHelper.js +30 -0
- package/package.json +1 -1
- package/src/components/Atoms/Logo/Logo.js +0 -4
- package/src/components/Atoms/Logo/Logo.test.js +5 -5
- package/src/components/Atoms/LogoNav2026/LogoNav2026.test.js +91 -0
- package/src/components/Atoms/LogoNav2026/_LogoNav2026.js +75 -0
- package/src/components/Atoms/LogoNav2026/assets/cr-logo-mob.svg +14 -0
- package/src/components/Atoms/LogoNav2026/assets/cr-logo.svg +14 -0
- package/src/components/Molecules/CTA/CTAMultiCard/__snapshots__/CTAMultiCard.test.js.snap +12 -12
- package/src/components/Molecules/CTA/CTASingleCard/CTASingleCard.md +2 -2
- package/src/components/Molecules/CTA/CTASingleCard/__snapshots__/CTASingleCard.test.js.snap +2 -2
- package/src/components/Molecules/CTA/shared/CTACard.style.js +1 -1
- package/src/components/Molecules/LogoLinked/LogoLinked.md +6 -1
- package/src/components/Organisms/Header/HeaderNav/HeaderNav.style.js +2 -2
- package/src/components/Organisms/Header2025/Header2025.md +1 -1
- package/src/components/Organisms/Header2025/HeaderNav2025/HeaderNav2025.js +1 -1
- package/src/components/Organisms/Header2025/HeaderNav2025/HeaderNav2025.style.js +2 -2
- package/src/components/Organisms/Header2026/Burger/BurgerMenu.js +26 -0
- package/src/components/Organisms/Header2026/Burger/BurgerMenu.style.js +104 -0
- package/src/components/Organisms/Header2026/Header2026.js +215 -0
- package/src/components/Organisms/Header2026/Header2026.md +14 -0
- package/src/components/Organisms/Header2026/Header2026.style.js +195 -0
- package/src/components/Organisms/Header2026/Navs/Navs.js +251 -0
- package/src/components/Organisms/Header2026/Navs/Navs.style.js +168 -0
- package/src/components/Organisms/Header2026/Navs/PrimaryNavItem.js +354 -0
- package/src/components/Organisms/Header2026/Navs/PrimaryNavItem.style.js +658 -0
- package/src/components/Organisms/Header2026/Navs/arrow-right.png +0 -0
- package/src/components/Organisms/Header2026/Navs/arrow.svg +6 -0
- package/src/components/Organisms/Header2026/Navs/chevron-down.svg +3 -0
- package/src/components/Organisms/Header2026/assets/arrow-icon.svg +3 -0
- package/src/components/Organisms/Header2026/assets/chevron-icon.svg +3 -0
- package/src/components/Organisms/Header2026/assets/search-icon.svg +10 -0
- package/src/components/Organisms/Header2026/header2026.test.js +22 -0
- package/src/components/Organisms/Header2026/mockData/mockData.json +569 -0
- package/src/components/Organisms/Header2026/mockData/query.graphql +64 -0
- package/src/theme/crTheme/theme.js +0 -1
- package/src/theme/shared/animations.js +43 -2
- package/src/utils/navHelper.js +82 -2
- package/src/utils/remove-extra-styles-in-preview.css +14 -0
- package/src/utils/urlHelper.js +27 -0
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import Link from '../../../Atoms/Link/Link';
|
|
4
|
+
import zIndex from '../../../../theme/shared/zIndex';
|
|
5
|
+
import Text from '../../../Atoms/Text/Text';
|
|
6
|
+
import arrowIcon from '../assets/arrow-icon.svg';
|
|
7
|
+
|
|
8
|
+
const transitionDuration = 0.2;
|
|
9
|
+
|
|
10
|
+
const NavLinkClass = styled(Link)`
|
|
11
|
+
display: inline-block;
|
|
12
|
+
border: 0;
|
|
13
|
+
padding: 20px 25px;
|
|
14
|
+
line-height: 1rem;
|
|
15
|
+
height: auto;
|
|
16
|
+
font-weight: 600;
|
|
17
|
+
width: 100%;
|
|
18
|
+
color: ${({ theme }) => theme.color('black')};
|
|
19
|
+
transition: color ${transitionDuration}s ease;
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
outline-offset: -3px;
|
|
22
|
+
|
|
23
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
24
|
+
outline-offset: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:hover,
|
|
28
|
+
:focus,
|
|
29
|
+
:focus-within {
|
|
30
|
+
border: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:hover,
|
|
34
|
+
:focus {
|
|
35
|
+
color: ${({ theme }) => theme.color('red')};
|
|
36
|
+
background-color: ${({ theme }) => theme.color('grey_extra_light')};
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:focus-within {
|
|
41
|
+
// Reset the colour of a parent...
|
|
42
|
+
background-color: ${({ theme }) => theme.color('white')};
|
|
43
|
+
|
|
44
|
+
// ...unless it's also being hovered
|
|
45
|
+
&:hover {
|
|
46
|
+
background-color: ${({ theme }) => theme.color('grey_extra_light')};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
const SecondaryNavMenu = styled.ul`
|
|
52
|
+
display: flex;
|
|
53
|
+
padding: 0;
|
|
54
|
+
list-style: none outside;
|
|
55
|
+
left: 0;
|
|
56
|
+
top: 0;
|
|
57
|
+
|
|
58
|
+
position: absolute;
|
|
59
|
+
width: 100%;
|
|
60
|
+
${zIndex('higher')};
|
|
61
|
+
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
align-items: center;
|
|
65
|
+
background-color: ${({ theme }) => theme.color('white')};
|
|
66
|
+
border-top: 1px solid ${({ theme }) => theme.color('grey_medium')};
|
|
67
|
+
|
|
68
|
+
/* Mobile slide-in animation */
|
|
69
|
+
transform: ${({ isSubMenuOpen }) => (isSubMenuOpen ? 'translateX(0)' : 'translateX(100%)')};
|
|
70
|
+
transition: transform 0.15s ease-out;
|
|
71
|
+
visibility: ${({ isSubMenuOpen }) => (isSubMenuOpen ? 'visible' : 'hidden')};
|
|
72
|
+
border-radius: 16px;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.05);
|
|
75
|
+
|
|
76
|
+
/* Remove border from first item only on mobile */
|
|
77
|
+
> div:first-of-type > li:first-of-type {
|
|
78
|
+
border-top: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* When tertiary menu is open, hide the entire secondary menu on mobile */
|
|
82
|
+
${({ isTertiaryOpen }) => isTertiaryOpen && css`
|
|
83
|
+
display: none;
|
|
84
|
+
`}
|
|
85
|
+
|
|
86
|
+
/* First link rounded corners to match menu */
|
|
87
|
+
> li:first-of-type > a {
|
|
88
|
+
border-radius: 16px 16px 0 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Last link rounded corners to match menu */
|
|
92
|
+
> div:last-of-type > li:last-of-type > a {
|
|
93
|
+
border-radius: 0 0 16px 16px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// DESKTOP:
|
|
97
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
98
|
+
background-color: ${({ theme }) => theme.color('white')};
|
|
99
|
+
display: grid;
|
|
100
|
+
grid-template-columns: repeat(3, 1fr);
|
|
101
|
+
width: 100%;
|
|
102
|
+
height: auto;
|
|
103
|
+
padding: 8px 0 0 0;
|
|
104
|
+
position: absolute;
|
|
105
|
+
top: 100%;
|
|
106
|
+
left: 0;
|
|
107
|
+
border-radius: 0 0 25px 25px;
|
|
108
|
+
overflow: visible;
|
|
109
|
+
transition: opacity 0.4s linear, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
|
|
110
|
+
transform: scaleY(0);
|
|
111
|
+
transform-origin: top;
|
|
112
|
+
opacity: 0;
|
|
113
|
+
visibility: hidden;
|
|
114
|
+
box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.05);
|
|
115
|
+
align-items: stretch;
|
|
116
|
+
|
|
117
|
+
// Invisible bridge above dropdown to maintain hover state
|
|
118
|
+
&::before {
|
|
119
|
+
content: '';
|
|
120
|
+
position: absolute;
|
|
121
|
+
top: -20px;
|
|
122
|
+
left: 0;
|
|
123
|
+
width: 100%;
|
|
124
|
+
height: 20px;
|
|
125
|
+
background: transparent;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
129
|
+
|
|
130
|
+
const ColumnWrapper = styled.div`
|
|
131
|
+
display: contents;
|
|
132
|
+
|
|
133
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-direction: column;
|
|
136
|
+
justify-content: flex-start;
|
|
137
|
+
border-right: 1px solid ${({ theme }) => theme.color('grey_medium')};
|
|
138
|
+
opacity: 0;
|
|
139
|
+
transform: translateY(-10px);
|
|
140
|
+
transition: opacity 0.3s ease-out 0.15s, transform 0.3s ease-out 0.15s;
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
padding-top: 3px;
|
|
143
|
+
|
|
144
|
+
&:last-of-type {
|
|
145
|
+
border-right: none;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
`;
|
|
149
|
+
|
|
150
|
+
const SecondaryNavItem = styled.li`
|
|
151
|
+
padding: 0;
|
|
152
|
+
height: 100%;
|
|
153
|
+
width: 100%;
|
|
154
|
+
border-top: 1px solid ${({ theme }) => theme.color('grey_medium')};
|
|
155
|
+
position: relative;
|
|
156
|
+
transition: background-color ${transitionDuration}s ease;
|
|
157
|
+
|
|
158
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
159
|
+
height: auto;
|
|
160
|
+
border-top: none;
|
|
161
|
+
|
|
162
|
+
span {
|
|
163
|
+
font-weight: ${({ $isSecondary }) => ($isSecondary ? 700 : 500)};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
${({ $isSecondary }) => $isSecondary && css`
|
|
167
|
+
border-top: 1px solid ${({ theme }) => theme.color('grey_medium')};
|
|
168
|
+
margin-top: 8px;
|
|
169
|
+
padding-top: 8px;
|
|
170
|
+
|
|
171
|
+
&:first-of-type {
|
|
172
|
+
border-top: none;
|
|
173
|
+
margin-top: 0;
|
|
174
|
+
padding-top: 0;
|
|
175
|
+
}
|
|
176
|
+
`}
|
|
177
|
+
}
|
|
178
|
+
`;
|
|
179
|
+
|
|
180
|
+
const SecondaryNavLink = styled(NavLinkClass)`
|
|
181
|
+
padding: 20px 25px 20px 42px;
|
|
182
|
+
color: ${({ theme }) => theme.color('black')};
|
|
183
|
+
height: auto;
|
|
184
|
+
position: relative;
|
|
185
|
+
|
|
186
|
+
span {
|
|
187
|
+
font-weight: 600;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
191
|
+
padding: 12px 30px;
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
justify-content: space-between;
|
|
195
|
+
font-size: 1rem;
|
|
196
|
+
transform: translateX(0);
|
|
197
|
+
transition: transform 0.35s cubic-bezier(0.34, 2.12, 0.64, 1);
|
|
198
|
+
|
|
199
|
+
span {
|
|
200
|
+
font-size: 1rem;
|
|
201
|
+
font-weight: ${({ $isSecondary }) => ($isSecondary ? 700 : 500)};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&:hover:not(:focus-visible) {
|
|
205
|
+
background-color: transparent;
|
|
206
|
+
transform: translateX(5px);
|
|
207
|
+
transition: transform 0.35s cubic-bezier(0.34, 2.12, 0.64, 1);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
&:focus-visible {
|
|
211
|
+
background-color: transparent;
|
|
212
|
+
transform: translateX(0);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&::after {
|
|
216
|
+
content: '';
|
|
217
|
+
width: 12px;
|
|
218
|
+
height: 12px;
|
|
219
|
+
mask-image: url(${arrowIcon});
|
|
220
|
+
mask-size: contain;
|
|
221
|
+
mask-repeat: no-repeat;
|
|
222
|
+
mask-position: center;
|
|
223
|
+
-webkit-mask-image: url(${arrowIcon});
|
|
224
|
+
-webkit-mask-size: contain;
|
|
225
|
+
-webkit-mask-repeat: no-repeat;
|
|
226
|
+
-webkit-mask-position: center;
|
|
227
|
+
background-color: ${({ theme }) => theme.color('red')};
|
|
228
|
+
opacity: 0;
|
|
229
|
+
transition: opacity 0.15s ease-out;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&:hover::after,
|
|
233
|
+
&:focus::after {
|
|
234
|
+
opacity: 1;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
`;
|
|
239
|
+
|
|
240
|
+
const NavLink = styled(NavLinkClass)`
|
|
241
|
+
font-family: ${({ theme }) => theme.fontFamilies(theme.font.regular)};
|
|
242
|
+
|
|
243
|
+
${({ isExpanded, theme }) => (isExpanded && css`
|
|
244
|
+
&,
|
|
245
|
+
&:hover,
|
|
246
|
+
&:focus-within,
|
|
247
|
+
&:focus {
|
|
248
|
+
color: ${theme.color('red')};
|
|
249
|
+
}
|
|
250
|
+
`)}
|
|
251
|
+
|
|
252
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
253
|
+
height: auto;
|
|
254
|
+
|
|
255
|
+
:hover, :focus-within, :focus {
|
|
256
|
+
+ ${SecondaryNavMenu} {
|
|
257
|
+
display: flex;
|
|
258
|
+
opacity: 1;
|
|
259
|
+
}}
|
|
260
|
+
|
|
261
|
+
${({ hasSubMenu }) => (hasSubMenu && css`
|
|
262
|
+
padding: 10px 16px 10px 0;
|
|
263
|
+
`)}
|
|
264
|
+
}
|
|
265
|
+
`;
|
|
266
|
+
|
|
267
|
+
const DesktopNavLink = styled(NavLink)`
|
|
268
|
+
&,
|
|
269
|
+
&:hover,
|
|
270
|
+
&:focus,
|
|
271
|
+
&:focus-within {
|
|
272
|
+
background-color: ${({ theme }) => theme.color('white')};
|
|
273
|
+
}
|
|
274
|
+
`;
|
|
275
|
+
|
|
276
|
+
const StyledNavItem = styled.li`
|
|
277
|
+
${zIndex('medium')};
|
|
278
|
+
position: static;
|
|
279
|
+
font-weight: 700;
|
|
280
|
+
border-top: 1px solid ${({ theme }) => theme.color('grey_medium')};
|
|
281
|
+
|
|
282
|
+
&:first-of-type {
|
|
283
|
+
border-top: none;
|
|
284
|
+
|
|
285
|
+
/* First link rounded corners to match menu */
|
|
286
|
+
> a {
|
|
287
|
+
border-radius: 16px 16px 0 0;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
292
|
+
border-top: none;
|
|
293
|
+
|
|
294
|
+
&:first-of-type > a {
|
|
295
|
+
border-radius: 0;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
li {
|
|
300
|
+
span {
|
|
301
|
+
border-bottom: none;
|
|
302
|
+
padding-bottom: 0;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
:hover,
|
|
306
|
+
:focus,
|
|
307
|
+
:focus-within {
|
|
308
|
+
span {
|
|
309
|
+
border-bottom: none;
|
|
310
|
+
padding-bottom: 0;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Chevron icon:
|
|
316
|
+
span > a > div {
|
|
317
|
+
opacity: 1;
|
|
318
|
+
transition: opacity 0.3s ease-out;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
:hover,
|
|
322
|
+
:focus,
|
|
323
|
+
:focus-within {
|
|
324
|
+
li {
|
|
325
|
+
span {
|
|
326
|
+
border-bottom: none;
|
|
327
|
+
padding-bottom: 0;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Chevron icon colour:
|
|
332
|
+
span > a {
|
|
333
|
+
color: ${({ theme }) => theme.color('red')};
|
|
334
|
+
> div {
|
|
335
|
+
opacity: 1;
|
|
336
|
+
img {
|
|
337
|
+
filter: invert(0.5) sepia(1) saturate(100) hue-rotate(20deg);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
345
|
+
|
|
346
|
+
// Chevron icon rotation - desktop only:
|
|
347
|
+
:hover,
|
|
348
|
+
:focus,
|
|
349
|
+
:focus-within {
|
|
350
|
+
span > a > div {
|
|
351
|
+
transform: rotate(-180deg);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
height: 100%;
|
|
355
|
+
display: flex;
|
|
356
|
+
align-items: center;
|
|
357
|
+
border-bottom: none;
|
|
358
|
+
position: static;
|
|
359
|
+
|
|
360
|
+
:hover,
|
|
361
|
+
:focus,
|
|
362
|
+
:focus-within {
|
|
363
|
+
> ${SecondaryNavMenu}, :focus-within > ${SecondaryNavMenu} {
|
|
364
|
+
visibility: visible;
|
|
365
|
+
opacity: 1;
|
|
366
|
+
display: grid;
|
|
367
|
+
transform: scaleY(1);
|
|
368
|
+
|
|
369
|
+
${ColumnWrapper} {
|
|
370
|
+
opacity: 1;
|
|
371
|
+
transform: translateY(0);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// Base state for span with pseudo-element border at bottom of header
|
|
377
|
+
> span {
|
|
378
|
+
position: relative;
|
|
379
|
+
|
|
380
|
+
&::after {
|
|
381
|
+
content: '';
|
|
382
|
+
position: absolute;
|
|
383
|
+
bottom: -14px;
|
|
384
|
+
left: 0;
|
|
385
|
+
width: 100%;
|
|
386
|
+
height: 2px;
|
|
387
|
+
background-color: ${({ theme }) => theme.color('red')};
|
|
388
|
+
transform: scaleX(0);
|
|
389
|
+
transform-origin: center;
|
|
390
|
+
transition: transform 0.3s ease-out;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
:hover,
|
|
395
|
+
:focus,
|
|
396
|
+
:focus-within {
|
|
397
|
+
background-color: transparent;
|
|
398
|
+
${zIndex('high')};
|
|
399
|
+
|
|
400
|
+
> span::after {
|
|
401
|
+
transform: scaleX(1);
|
|
402
|
+
transition: transform 0.15s ease-out;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
`;
|
|
407
|
+
|
|
408
|
+
const ChevronWrapper = styled.div`
|
|
409
|
+
position: absolute;
|
|
410
|
+
top: 50%;
|
|
411
|
+
transform: translateY(-50%);
|
|
412
|
+
right: 30px;
|
|
413
|
+
width: 8px;
|
|
414
|
+
|
|
415
|
+
img {
|
|
416
|
+
width: 100%;
|
|
417
|
+
display: block;
|
|
418
|
+
height: auto;
|
|
419
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
420
|
+
transform: rotate(90deg);
|
|
421
|
+
filter: brightness(0);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
426
|
+
top: 12px;
|
|
427
|
+
transform: none;
|
|
428
|
+
right: 0;
|
|
429
|
+
width: 7px;
|
|
430
|
+
}
|
|
431
|
+
`;
|
|
432
|
+
|
|
433
|
+
const StyledText = styled(Text)`
|
|
434
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
435
|
+
font-size: 1rem;
|
|
436
|
+
}
|
|
437
|
+
`;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Tertiary Navigation Menu (3rd level) - separate sibling to SecondaryNavMenu
|
|
441
|
+
*/
|
|
442
|
+
const TertiaryNavMenu = styled.ul`
|
|
443
|
+
display: flex;
|
|
444
|
+
flex-direction: column;
|
|
445
|
+
padding: 0;
|
|
446
|
+
list-style: none outside;
|
|
447
|
+
width: 100%;
|
|
448
|
+
${zIndex('higher')};
|
|
449
|
+
|
|
450
|
+
background-color: ${({ theme }) => theme.color('white')};
|
|
451
|
+
|
|
452
|
+
/* When closed: absolute and off-screen. When open: relative for dynamic height */
|
|
453
|
+
position: ${({ isOpen }) => (isOpen ? 'relative' : 'absolute')};
|
|
454
|
+
left: 0;
|
|
455
|
+
top: 0;
|
|
456
|
+
|
|
457
|
+
/* Mobile slide-in animation */
|
|
458
|
+
transform: ${({ isOpen }) => (isOpen ? 'translateX(0)' : 'translateX(100%)')};
|
|
459
|
+
transition: transform 0.15s ease-out;
|
|
460
|
+
visibility: ${({ isOpen }) => (isOpen ? 'visible' : 'hidden')};
|
|
461
|
+
border-radius: 16px;
|
|
462
|
+
overflow: hidden;
|
|
463
|
+
border-top: 1px solid ${({ theme }) => theme.color('grey_medium')};
|
|
464
|
+
box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.05);
|
|
465
|
+
|
|
466
|
+
/* First link rounded corners to match menu */
|
|
467
|
+
> li:first-of-type > a {
|
|
468
|
+
border-radius: 16px 16px 0 0;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/* Last link rounded corners to match menu */
|
|
472
|
+
> li:last-of-type > a {
|
|
473
|
+
border-radius: 0 0 16px 16px;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// hide on desktop
|
|
477
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
478
|
+
display: none;
|
|
479
|
+
}
|
|
480
|
+
`;
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Tertiary Nav Item
|
|
484
|
+
*/
|
|
485
|
+
const TertiaryNavItem = styled.li`
|
|
486
|
+
padding: 0;
|
|
487
|
+
height: auto;
|
|
488
|
+
width: 100%;
|
|
489
|
+
flex: 0 0 auto;
|
|
490
|
+
border-top: 1px solid ${({ theme }) => theme.color('grey_medium')};
|
|
491
|
+
position: relative;
|
|
492
|
+
transition: background-color ${transitionDuration}s ease;
|
|
493
|
+
|
|
494
|
+
&:first-of-type {
|
|
495
|
+
border-top: none;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
500
|
+
span {
|
|
501
|
+
font-weight: 100;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
`;
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Tertiary menu link item
|
|
508
|
+
*/
|
|
509
|
+
const TertiaryNavLink = styled(NavLinkClass)`
|
|
510
|
+
padding: 20px 25px 20px 42px;
|
|
511
|
+
color: ${({ theme }) => theme.color('black')};
|
|
512
|
+
height: auto;
|
|
513
|
+
position: relative;
|
|
514
|
+
|
|
515
|
+
span {
|
|
516
|
+
font-weight: ${({ $isParent }) => ($isParent ? 600 : 500)};
|
|
517
|
+
}
|
|
518
|
+
`;
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Secondary link with nested children - adds chevron styling
|
|
522
|
+
*/
|
|
523
|
+
const SecondaryNavLinkWithChildren = styled(SecondaryNavLink)`
|
|
524
|
+
display: flex;
|
|
525
|
+
justify-content: space-between;
|
|
526
|
+
align-items: center;
|
|
527
|
+
padding-right: 30px;
|
|
528
|
+
`;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Chevron for secondary nav items with children
|
|
532
|
+
*/
|
|
533
|
+
const SecondaryChevronWrapper = styled.div`
|
|
534
|
+
width: 8px;
|
|
535
|
+
flex-shrink: 0;
|
|
536
|
+
|
|
537
|
+
img {
|
|
538
|
+
width: 100%;
|
|
539
|
+
display: block;
|
|
540
|
+
height: auto;
|
|
541
|
+
}
|
|
542
|
+
`;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Nav Card for column 3 (desktop only)
|
|
546
|
+
*/
|
|
547
|
+
const NavCard = styled.a`
|
|
548
|
+
display: none;
|
|
549
|
+
|
|
550
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
551
|
+
display: flex;
|
|
552
|
+
flex-direction: row;
|
|
553
|
+
align-items: flex-start;
|
|
554
|
+
gap: 12px;
|
|
555
|
+
text-decoration: none;
|
|
556
|
+
color: ${({ theme }) => theme.color('black')};
|
|
557
|
+
padding: 16px 20px;
|
|
558
|
+
outline-offset: -3px;
|
|
559
|
+
transform: translateX(0);
|
|
560
|
+
transition: transform 0.35s cubic-bezier(0.34, 2.12, 0.64, 1);
|
|
561
|
+
|
|
562
|
+
&:hover:not(:focus-visible) {
|
|
563
|
+
transform: translateX(5px);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
&:focus-visible {
|
|
567
|
+
transform: translateX(0);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
`;
|
|
571
|
+
|
|
572
|
+
const NavCardImage = styled.div`
|
|
573
|
+
flex-shrink: 0;
|
|
574
|
+
width: 80px;
|
|
575
|
+
height: 80px;
|
|
576
|
+
border-radius: 6px;
|
|
577
|
+
overflow: hidden;
|
|
578
|
+
|
|
579
|
+
img {
|
|
580
|
+
width: 100%;
|
|
581
|
+
height: 100%;
|
|
582
|
+
object-fit: cover;
|
|
583
|
+
display: block;
|
|
584
|
+
}
|
|
585
|
+
`;
|
|
586
|
+
|
|
587
|
+
const NavCardContent = styled.div`
|
|
588
|
+
display: flex;
|
|
589
|
+
flex-direction: column;
|
|
590
|
+
flex: 1;
|
|
591
|
+
`;
|
|
592
|
+
|
|
593
|
+
const NavCardTitle = styled.span`
|
|
594
|
+
display: block;
|
|
595
|
+
font-family: Montserrat, sans-serif;
|
|
596
|
+
font-weight: 700;
|
|
597
|
+
font-size: 16px;
|
|
598
|
+
margin-bottom: 4px;
|
|
599
|
+
color: ${({ theme }) => theme.color('black')};
|
|
600
|
+
`;
|
|
601
|
+
|
|
602
|
+
const NavCardDescription = styled.span`
|
|
603
|
+
display: block;
|
|
604
|
+
font-family: Montserrat, sans-serif;
|
|
605
|
+
font-weight: 400;
|
|
606
|
+
font-size: 14px;
|
|
607
|
+
color: ${({ theme }) => theme.color('grey_dark')};
|
|
608
|
+
line-height: 1.4;
|
|
609
|
+
`;
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Primary link shown at top of secondary menu (mobile only)
|
|
613
|
+
*/
|
|
614
|
+
const SecondaryMenuPrimaryLink = styled.li`
|
|
615
|
+
padding: 0;
|
|
616
|
+
width: 100%;
|
|
617
|
+
border-bottom: 1px solid ${({ theme }) => theme.color('grey_medium')};
|
|
618
|
+
display: block;
|
|
619
|
+
|
|
620
|
+
@media ${({ theme }) => theme.breakpoints2026('L')} {
|
|
621
|
+
display: none;
|
|
622
|
+
}
|
|
623
|
+
`;
|
|
624
|
+
|
|
625
|
+
const SecondaryMenuPrimaryLinkAnchor = styled(NavLinkClass)`
|
|
626
|
+
padding: 20px 25px 20px 42px;
|
|
627
|
+
color: ${({ theme }) => theme.color('black')};
|
|
628
|
+
height: auto;
|
|
629
|
+
position: relative;
|
|
630
|
+
|
|
631
|
+
span {
|
|
632
|
+
font-weight: 600;
|
|
633
|
+
}
|
|
634
|
+
`;
|
|
635
|
+
|
|
636
|
+
export {
|
|
637
|
+
StyledNavItem,
|
|
638
|
+
NavLink,
|
|
639
|
+
DesktopNavLink,
|
|
640
|
+
SecondaryNavMenu,
|
|
641
|
+
SecondaryNavItem,
|
|
642
|
+
SecondaryNavLink,
|
|
643
|
+
SecondaryNavLinkWithChildren,
|
|
644
|
+
SecondaryChevronWrapper,
|
|
645
|
+
ChevronWrapper,
|
|
646
|
+
StyledText,
|
|
647
|
+
ColumnWrapper,
|
|
648
|
+
TertiaryNavMenu,
|
|
649
|
+
TertiaryNavItem,
|
|
650
|
+
TertiaryNavLink,
|
|
651
|
+
NavCard,
|
|
652
|
+
NavCardImage,
|
|
653
|
+
NavCardContent,
|
|
654
|
+
NavCardTitle,
|
|
655
|
+
NavCardDescription,
|
|
656
|
+
SecondaryMenuPrimaryLink,
|
|
657
|
+
SecondaryMenuPrimaryLinkAnchor
|
|
658
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
+
viewBox="0 0 96 96"
|
|
4
|
+
>
|
|
5
|
+
<path transform="rotate(-180 47.998626708984375,48.00019836425781) " id="arrow" d="m90.871,50.776c-0.016,0.016 -0.026,0.036 -0.043,0.052l-32,32c-0.781,0.781 -1.804,1.172 -2.828,1.172s-2.047,-0.391 -2.829,-1.171a4,4 0 0 1 0,-5.657l25.172,-25.172l-70.343,0a4,4 0 0 1 0,-8l70.343,0l-25.172,-25.171a4,4 0 0 1 5.657,-5.657l32,32c0.016,0.016 0.027,0.036 0.043,0.052c0.167,0.172 0.321,0.357 0.455,0.557c0.069,0.104 0.118,0.216 0.176,0.325c0.065,0.121 0.138,0.236 0.191,0.364c0.057,0.137 0.09,0.279 0.13,0.42c0.032,0.109 0.074,0.214 0.097,0.327a4.017,4.017 0 0 1 0,1.568c-0.023,0.113 -0.065,0.217 -0.097,0.327c-0.041,0.141 -0.074,0.283 -0.13,0.42c-0.053,0.128 -0.126,0.243 -0.191,0.364c-0.059,0.109 -0.107,0.221 -0.176,0.325a4.035,4.035 0 0 1 -0.455,0.555z" />
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="11" height="10" viewBox="0 0 11 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M3.90332 1.9823C3.07723 0.742637 4.69728 -0.657921 5.80469 0.338745L9.93164 4.05261C10.4907 4.55574 10.4906 5.43223 9.93164 5.93542L5.80469 9.65027C4.69721 10.647 3.07684 9.24546 3.90332 8.00574L5.06641 6.26062H1.26758C0.56802 6.26062 6.11573e-08 5.69358 0 4.99402C0.000188457 4.29478 0.567384 3.72768 1.2666 3.72742H5.06641L3.90332 1.9823Z" fill="black"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 7 11" fill="none">
|
|
2
|
+
<path d="M6.40115 4.14768C6.97328 4.66259 6.97328 5.55972 6.40115 6.07463L2.1777 9.87573C1.04437 10.8957 -0.613719 9.46189 0.232052 8.19324L1.80744 5.83015C2.09771 5.39475 2.09771 4.82752 1.80744 4.39212L0.232089 2.02909C-0.613683 0.760435 1.04442 -0.673391 2.17774 0.346605L6.40115 4.14768Z" fill="black"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
2
|
+
<g clip-path="url(#clip0_4311_2166)">
|
|
3
|
+
<path d="M16.776 13.413C16.3074 12.9444 14.8304 11.8539 13.3639 11.0094C13.348 11.0333 13.3322 11.0571 13.3162 11.0836C14.9707 8.41798 14.6451 4.86827 12.3289 2.5521C9.62889 -0.145255 5.2533 -0.145255 2.5533 2.5521C-0.146696 5.25474 -0.144049 9.62768 2.5533 12.3277C4.8483 14.6201 8.35036 14.9668 11.008 13.3627C11.773 14.6915 12.8874 16.2507 13.4142 16.7774C14.3407 17.7039 15.8495 17.7012 16.776 16.7748C17.7024 15.8456 17.7024 14.3421 16.776 13.413ZM10.5077 10.5065C8.81363 12.198 6.07127 12.198 4.37715 10.5039C2.68568 8.81239 2.68304 6.07004 4.37715 4.37592C6.06862 2.68445 8.81363 2.68445 10.5051 4.37592C12.1992 6.07004 12.1992 8.81504 10.5077 10.5065Z" fill="black"/>
|
|
4
|
+
</g>
|
|
5
|
+
<defs>
|
|
6
|
+
<clipPath id="clip0_4311_2166">
|
|
7
|
+
<rect width="18" height="18" fill="white"/>
|
|
8
|
+
</clipPath>
|
|
9
|
+
</defs>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
import 'jest-styled-components';
|
|
3
|
+
// import renderWithTheme from '../../../../tests/hoc/shallowWithTheme';
|
|
4
|
+
// import Header from './Header';
|
|
5
|
+
|
|
6
|
+
// import data from './data/data';
|
|
7
|
+
// import Link from '../../Atoms/Link/Link';
|
|
8
|
+
|
|
9
|
+
it('renders correctly', () => {
|
|
10
|
+
// const tree = renderWithTheme(
|
|
11
|
+
// <Header
|
|
12
|
+
// navItems={data}
|
|
13
|
+
// metaIcons={
|
|
14
|
+
// <Link color="green" type="button" href="/donation">
|
|
15
|
+
// Donate
|
|
16
|
+
// </Link>
|
|
17
|
+
// }
|
|
18
|
+
// />
|
|
19
|
+
// ).toJSON();
|
|
20
|
+
|
|
21
|
+
// expect(tree).toMatchSnapshot();
|
|
22
|
+
});
|