@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,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = exports.default = {
|
|
8
|
+
title: 'Header',
|
|
9
|
+
menuGroups: [{
|
|
10
|
+
title: 'GROUP1',
|
|
11
|
+
id: 'group1',
|
|
12
|
+
links: [{
|
|
13
|
+
title: 'Sport Relief',
|
|
14
|
+
path: 'https://www.comicrelief.com/fundraising/pay-in-your-money',
|
|
15
|
+
internal: {
|
|
16
|
+
type: 'ContentfulPageLandingPage'
|
|
17
|
+
}
|
|
18
|
+
}, {
|
|
19
|
+
title: 'Run 30 Miles in June',
|
|
20
|
+
path: 'https://www.comicrelief.com/rednoseday',
|
|
21
|
+
internal: {
|
|
22
|
+
type: 'ContentfulPageLandingPage'
|
|
23
|
+
}
|
|
24
|
+
}, {
|
|
25
|
+
title: 'Be a Good Sport: Schools',
|
|
26
|
+
path: 'https://www.comicrelief.com/join',
|
|
27
|
+
internal: {
|
|
28
|
+
type: 'ContentfulPageLandingPage'
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
title: 'Win a trip to New York with Major League Baseball',
|
|
32
|
+
path: 'https://www.comicrelief.com/squads',
|
|
33
|
+
internal: {
|
|
34
|
+
type: 'ContentfulPageLandingPage'
|
|
35
|
+
}
|
|
36
|
+
}]
|
|
37
|
+
}, {
|
|
38
|
+
title: 'GROUP2',
|
|
39
|
+
id: 'group2',
|
|
40
|
+
links: [{
|
|
41
|
+
title: 'Red Nose Day',
|
|
42
|
+
path: 'https://www.comicrelief.com/rednoseday/schools',
|
|
43
|
+
internal: {
|
|
44
|
+
type: 'ContentfulPageLandingPage'
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
title: 'The New Red Nose',
|
|
48
|
+
path: 'https://www.comicrelief.com/rednoseday/schools',
|
|
49
|
+
internal: {
|
|
50
|
+
type: 'ContentfulPageLandingPage'
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
title: 'Schools',
|
|
54
|
+
path: 'https://www.comicrelief.com/rednoseday/schools',
|
|
55
|
+
internal: {
|
|
56
|
+
type: 'ContentfulPageLandingPage'
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
title: 'The Red Nose Day Nosey Awards',
|
|
60
|
+
path: 'https://www.comicrelief.com/rednoseday/schools',
|
|
61
|
+
internal: {
|
|
62
|
+
type: 'ContentfulPageLandingPage'
|
|
63
|
+
}
|
|
64
|
+
}]
|
|
65
|
+
}, {
|
|
66
|
+
title: 'GROUP3',
|
|
67
|
+
id: 'group3',
|
|
68
|
+
links: [{
|
|
69
|
+
title: 'Funding',
|
|
70
|
+
path: 'https://www.comicrelief.com/what-your-money-does',
|
|
71
|
+
internal: {
|
|
72
|
+
type: 'ContentfulPageLandingPage'
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
title: 'Our Funding Practice',
|
|
76
|
+
path: 'https://www.comicrelief.com/our-legacy',
|
|
77
|
+
internal: {
|
|
78
|
+
type: 'ContentfulPageLandingPage'
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
title: 'Funding opportunities',
|
|
82
|
+
path: 'https://www.comicrelief.com/our-legacy',
|
|
83
|
+
internal: {
|
|
84
|
+
type: 'ContentfulPageLandingPage'
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
title: 'Our Funding strategy',
|
|
88
|
+
path: 'https://www.comicrelief.com/our-legacy',
|
|
89
|
+
internal: {
|
|
90
|
+
type: 'ContentfulPageLandingPage'
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
title: 'Managing your funding',
|
|
94
|
+
path: 'https://www.comicrelief.com/our-legacy',
|
|
95
|
+
internal: {
|
|
96
|
+
type: 'ContentfulPageLandingPage'
|
|
97
|
+
}
|
|
98
|
+
}]
|
|
99
|
+
}, {
|
|
100
|
+
title: 'GROUP4',
|
|
101
|
+
id: 'group4',
|
|
102
|
+
links: [{
|
|
103
|
+
title: 'What Your Money Does',
|
|
104
|
+
path: 'https://www.comicrelief.com/rednoseday/schools/primary-schools',
|
|
105
|
+
internal: {
|
|
106
|
+
type: 'ContentfulPageLandingPage'
|
|
107
|
+
}
|
|
108
|
+
}, {
|
|
109
|
+
title: 'Reports & Publications',
|
|
110
|
+
path: 'https://www.comicrelief.com/rednoseday/schools/secondary-schools',
|
|
111
|
+
internal: {
|
|
112
|
+
type: 'ContentfulPageLandingPage'
|
|
113
|
+
}
|
|
114
|
+
}]
|
|
115
|
+
}, {
|
|
116
|
+
title: 'GROUP5',
|
|
117
|
+
id: 'group5',
|
|
118
|
+
links: [{
|
|
119
|
+
title: 'Get Involved',
|
|
120
|
+
url: 'https://www.comicrelief.com/working-with-us/',
|
|
121
|
+
internal: {
|
|
122
|
+
type: 'ContentfulComponentLink'
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
title: 'Do your own fundraising',
|
|
126
|
+
url: 'https://www.comicrelief.com/404/',
|
|
127
|
+
internal: {
|
|
128
|
+
type: 'ContentfulComponentLink'
|
|
129
|
+
}
|
|
130
|
+
}, {
|
|
131
|
+
title: 'Regular Donations',
|
|
132
|
+
url: 'https://www.comicrelief.com/404/',
|
|
133
|
+
internal: {
|
|
134
|
+
type: 'ContentfulComponentLink'
|
|
135
|
+
}
|
|
136
|
+
}, {
|
|
137
|
+
title: 'Run for Comic Relief',
|
|
138
|
+
url: 'https://www.comicrelief.com/404/',
|
|
139
|
+
internal: {
|
|
140
|
+
type: 'ContentfulComponentLink'
|
|
141
|
+
}
|
|
142
|
+
}, {
|
|
143
|
+
title: 'How to pay in your fundraising money',
|
|
144
|
+
url: 'https://www.comicrelief.com/404/',
|
|
145
|
+
internal: {
|
|
146
|
+
type: 'ContentfulComponentLink'
|
|
147
|
+
}
|
|
148
|
+
}, {
|
|
149
|
+
title: 'Partners',
|
|
150
|
+
url: 'https://www.comicrelief.com/404/',
|
|
151
|
+
internal: {
|
|
152
|
+
type: 'ContentfulComponentLink'
|
|
153
|
+
}
|
|
154
|
+
}]
|
|
155
|
+
}]
|
|
156
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("jest-styled-components");
|
|
4
|
+
/* eslint-disable react/jsx-wrap-multilines */
|
|
5
|
+
// import React from 'react';
|
|
6
|
+
|
|
7
|
+
// import renderWithTheme from '../../../../tests/hoc/shallowWithTheme';
|
|
8
|
+
// import Header from './Header';
|
|
9
|
+
|
|
10
|
+
// import data from './data/data';
|
|
11
|
+
// import Link from '../../Atoms/Link/Link';
|
|
12
|
+
it('renders correctly', () => {
|
|
13
|
+
// const tree = renderWithTheme(
|
|
14
|
+
// <Header
|
|
15
|
+
// navItems={data}
|
|
16
|
+
// metaIcons={
|
|
17
|
+
// <Link color="green" type="button" href="/donation">
|
|
18
|
+
// Donate
|
|
19
|
+
// </Link>
|
|
20
|
+
// }
|
|
21
|
+
// />
|
|
22
|
+
// ).toJSON();
|
|
23
|
+
|
|
24
|
+
// expect(tree).toMatchSnapshot();
|
|
25
|
+
});
|
package/dist/index.js
CHANGED
|
@@ -136,6 +136,12 @@ Object.defineProperty(exports, "Header", {
|
|
|
136
136
|
return _Header.default;
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
|
+
Object.defineProperty(exports, "Header2025", {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
get: function () {
|
|
142
|
+
return _Header2.default;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
139
145
|
Object.defineProperty(exports, "HeroBanner", {
|
|
140
146
|
enumerable: true,
|
|
141
147
|
get: function () {
|
|
@@ -449,6 +455,7 @@ var _CardDs = _interopRequireDefault(require("./components/Molecules/CardDs/Card
|
|
|
449
455
|
var _Box = _interopRequireDefault(require("./components/Molecules/Box/Box"));
|
|
450
456
|
var _ArticleTeaser = _interopRequireDefault(require("./components/Molecules/ArticleTeaser/ArticleTeaser"));
|
|
451
457
|
var _Header = _interopRequireDefault(require("./components/Organisms/Header/Header"));
|
|
458
|
+
var _Header2 = _interopRequireDefault(require("./components/Organisms/Header2025/Header2025"));
|
|
452
459
|
var _Donate = _interopRequireDefault(require("./components/Organisms/Donate/Donate"));
|
|
453
460
|
var _DoubleCopy = _interopRequireDefault(require("./components/Molecules/DoubleCopy/DoubleCopy"));
|
|
454
461
|
var _PartnerLink = _interopRequireDefault(require("./components/Molecules/PartnerLink/PartnerLink"));
|
|
@@ -53,63 +53,63 @@ const carouselItemsComplete = exports.carouselItemsComplete = {
|
|
|
53
53
|
node1Amount: '1,000',
|
|
54
54
|
node1Image: {
|
|
55
55
|
file: {
|
|
56
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
56
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
node2Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
60
60
|
node2Amount: '750,000',
|
|
61
61
|
node2Image: {
|
|
62
62
|
file: {
|
|
63
|
-
url: '
|
|
63
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
node3Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
67
67
|
node3Amount: '3,000',
|
|
68
68
|
node3Image: {
|
|
69
69
|
file: {
|
|
70
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
70
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
node4Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
74
74
|
node4Amount: '4,000',
|
|
75
75
|
node4Image: {
|
|
76
76
|
file: {
|
|
77
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
77
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
node5Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
81
81
|
node5Amount: '5,000',
|
|
82
82
|
node5Image: {
|
|
83
83
|
file: {
|
|
84
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
84
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
node6Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
88
88
|
node6Amount: '6,000',
|
|
89
89
|
node6Image: {
|
|
90
90
|
file: {
|
|
91
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
91
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
node7Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
95
95
|
node7Amount: '7,000',
|
|
96
96
|
node7Image: {
|
|
97
97
|
file: {
|
|
98
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
98
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
node8Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
102
102
|
node8Amount: '8,000',
|
|
103
103
|
node8Image: {
|
|
104
104
|
file: {
|
|
105
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
105
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
node9Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
109
109
|
node9Amount: '9,000',
|
|
110
110
|
node9Image: {
|
|
111
111
|
file: {
|
|
112
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
112
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
};
|
|
@@ -126,34 +126,34 @@ const carouselItemsIncomplete = exports.carouselItemsIncomplete = {
|
|
|
126
126
|
node1Amount: '1,000',
|
|
127
127
|
node1Image: {
|
|
128
128
|
file: {
|
|
129
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
129
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
132
|
node2Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
133
133
|
node2Amount: '750,000',
|
|
134
134
|
node2Image: {
|
|
135
135
|
file: {
|
|
136
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
136
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
137
137
|
}
|
|
138
138
|
},
|
|
139
139
|
node3Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
140
140
|
node3Amount: '3,000',
|
|
141
141
|
node3Image: {
|
|
142
142
|
file: {
|
|
143
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
143
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
146
|
node4Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
147
147
|
node4Amount: '4,000',
|
|
148
148
|
node4Image: {
|
|
149
149
|
file: {
|
|
150
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
150
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
153
|
node5Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
154
154
|
node5Image: {
|
|
155
155
|
file: {
|
|
156
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
156
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
159
|
node6Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
@@ -166,7 +166,7 @@ const carouselItemsIncomplete = exports.carouselItemsIncomplete = {
|
|
|
166
166
|
node8Amount: null,
|
|
167
167
|
node8Image: {
|
|
168
168
|
file: {
|
|
169
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
169
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
170
170
|
}
|
|
171
171
|
},
|
|
172
172
|
node9_Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
@@ -186,28 +186,28 @@ const carouselItemsMinimal = exports.carouselItemsMinimal = {
|
|
|
186
186
|
node1Amount: '1,000',
|
|
187
187
|
node1Image: {
|
|
188
188
|
file: {
|
|
189
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
189
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
190
190
|
}
|
|
191
191
|
},
|
|
192
192
|
node2Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
193
193
|
node2Amount: '750,000',
|
|
194
194
|
node2Image: {
|
|
195
195
|
file: {
|
|
196
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
196
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
197
197
|
}
|
|
198
198
|
},
|
|
199
199
|
node3Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
200
200
|
node3Amount: '3,000',
|
|
201
201
|
node3Image: {
|
|
202
202
|
file: {
|
|
203
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
203
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
204
204
|
}
|
|
205
205
|
},
|
|
206
206
|
node4Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
207
207
|
node4Amount: '4,000',
|
|
208
208
|
node4Image: {
|
|
209
209
|
file: {
|
|
210
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/
|
|
210
|
+
url: '//images.ctfassets.net/zsfivwzfgl3t/6ZsS5CpukQwXRcMSUlbOM1/be31c7ff09891d14232e7c3dbe9fa8a2/028-love_1.png'
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
};
|
package/dist/utils/navHelper.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.NavHelper = exports.MoreNavPreProcess = void 0;
|
|
7
7
|
/* Determine where to grab the URL, depending on the component type and values supplied */
|
|
8
8
|
const NavHelper = navItem => {
|
|
9
9
|
/* Default url path location for 'Pages' */
|
|
@@ -13,4 +13,26 @@ const NavHelper = navItem => {
|
|
|
13
13
|
}
|
|
14
14
|
return thisUrl;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
exports.NavHelper = NavHelper;
|
|
17
|
+
const MoreNavPreProcess = (menuGroups, characterLimit) => {
|
|
18
|
+
let characterCount = 0;
|
|
19
|
+
const overLimit = false;
|
|
20
|
+
const standardGroups = [];
|
|
21
|
+
const moreNavGroups = [];
|
|
22
|
+
menuGroups.map(group => {
|
|
23
|
+
// As this first item is used as our top level parent 'button' link,
|
|
24
|
+
// look to this to grab the amount of copied rendered:
|
|
25
|
+
const thisFirstChild = group.links[0];
|
|
26
|
+
|
|
27
|
+
// Keep track of how many characters our nav has in total:
|
|
28
|
+
characterCount += thisFirstChild.title.length;
|
|
29
|
+
|
|
30
|
+
// Assign groups to the relevant array if we're over the limit
|
|
31
|
+
return characterCount > characterLimit !== overLimit ? moreNavGroups.push(group) : standardGroups.push(group);
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
standardGroups,
|
|
35
|
+
moreNavGroups
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
exports.MoreNavPreProcess = MoreNavPreProcess;
|
package/package.json
CHANGED
package/playwright.config.js
CHANGED
|
@@ -19,7 +19,7 @@ module.exports = defineConfig({
|
|
|
19
19
|
workers: 2,
|
|
20
20
|
timeout: 60 * 1000,
|
|
21
21
|
expect: {
|
|
22
|
-
timeout: 60 * 1000
|
|
22
|
+
timeout: 60 * 1000
|
|
23
23
|
},
|
|
24
24
|
reporter: [
|
|
25
25
|
['list'],
|
|
@@ -28,15 +28,22 @@ module.exports = defineConfig({
|
|
|
28
28
|
use: {
|
|
29
29
|
actionTimeout: 0,
|
|
30
30
|
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
31
|
-
trace: 'on-first-retry'
|
|
31
|
+
trace: 'on-first-retry'
|
|
32
32
|
},
|
|
33
33
|
|
|
34
34
|
/* Configure projects for major browsers */
|
|
35
35
|
projects: [
|
|
36
36
|
{
|
|
37
37
|
name: 'chromium',
|
|
38
|
-
use: {
|
|
39
|
-
|
|
38
|
+
use: {
|
|
39
|
+
...devices['Desktop Chrome'],
|
|
40
|
+
viewport: {
|
|
41
|
+
// Match our widest nav:
|
|
42
|
+
width: 1300,
|
|
43
|
+
height: 1000
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
40
47
|
],
|
|
41
48
|
|
|
42
49
|
/* Run your local dev server before starting the tests */
|
|
@@ -44,6 +51,6 @@ module.exports = defineConfig({
|
|
|
44
51
|
command: 'yarn styleguide',
|
|
45
52
|
port: '6060',
|
|
46
53
|
timeout: 120000,
|
|
47
|
-
reuseExistingServer: true
|
|
48
|
-
}
|
|
54
|
+
reuseExistingServer: true
|
|
55
|
+
}
|
|
49
56
|
});
|
|
@@ -1,18 +1,89 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { kebabCase } from 'lodash';
|
|
4
5
|
import hideVisually from '../../../../theme/shared/hideVisually';
|
|
6
|
+
import Text from '../../Text/Text';
|
|
7
|
+
|
|
8
|
+
const RevealTextWidth = 55;
|
|
9
|
+
const RevealTextSpeed = 0.35;
|
|
5
10
|
|
|
6
11
|
const StyledLink = styled.a`
|
|
7
12
|
text-decoration: none;
|
|
8
13
|
cursor: pointer;
|
|
9
14
|
display: block;
|
|
15
|
+
position: relative;
|
|
10
16
|
transition: opacity 0.2s;
|
|
11
17
|
|
|
12
18
|
&:hover,
|
|
13
19
|
&:focus {
|
|
14
20
|
opacity: 0.6;
|
|
15
21
|
}
|
|
22
|
+
|
|
23
|
+
// 'isHeader' is only set and passed in Header2025, so the pre-existing Header isn't affected:
|
|
24
|
+
${({ isHeader }) => isHeader && css`
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
padding-right: 0px;
|
|
27
|
+
transition: padding-right ${RevealTextSpeed}s cubic-bezier(0.5, 1.5, 0.5, 0.75);
|
|
28
|
+
|
|
29
|
+
&:hover,
|
|
30
|
+
&:focus {
|
|
31
|
+
opacity: 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// No hover state for mobile, so targetting Medium+:
|
|
35
|
+
@media ${({ theme }) => theme.allBreakpoints('M')} {
|
|
36
|
+
&:hover,
|
|
37
|
+
&:focus {
|
|
38
|
+
img {
|
|
39
|
+
filter: invert(0.5) sepia(1) saturate(100) hue-rotate(20deg);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@media ${({ theme }) => theme.allBreakpoints('NavWide')} {
|
|
45
|
+
&:hover,
|
|
46
|
+
&:focus {
|
|
47
|
+
// Default
|
|
48
|
+
padding-right: ${RevealTextWidth}px;
|
|
49
|
+
|
|
50
|
+
// Tweak for ESU's longer text:
|
|
51
|
+
&[data-testid="header-esu"] {
|
|
52
|
+
padding-right: 92px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Tweak for Shop's shorter text:
|
|
56
|
+
&[data-testid="header-shop"] {
|
|
57
|
+
padding-right: 48px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Show the Reveal text
|
|
61
|
+
img + span {
|
|
62
|
+
display: block;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
`}
|
|
66
|
+
};
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
const RevealText = styled(Text)`
|
|
70
|
+
width: auto;
|
|
71
|
+
color: ${({ theme }) => theme.color('black')};
|
|
72
|
+
position: absolute;
|
|
73
|
+
top: 50%;
|
|
74
|
+
transform: translateY(-50%);
|
|
75
|
+
left: 70px;
|
|
76
|
+
|
|
77
|
+
@media ${({ theme }) => theme.allBreakpoints('Nav')} {
|
|
78
|
+
width: 100%;
|
|
79
|
+
text-align: center;
|
|
80
|
+
position: absolute;
|
|
81
|
+
top: 8px;
|
|
82
|
+
left: 15px;
|
|
83
|
+
transform: translateX(0);
|
|
84
|
+
display: none;
|
|
85
|
+
color: ${({ theme }) => theme.color('red')};
|
|
86
|
+
}
|
|
16
87
|
`;
|
|
17
88
|
|
|
18
89
|
const StyledImage = styled.img`
|
|
@@ -24,7 +95,7 @@ const HelperText = styled.span`
|
|
|
24
95
|
`;
|
|
25
96
|
|
|
26
97
|
const Icon = ({
|
|
27
|
-
href, target, icon, brand, title, ...restProps
|
|
98
|
+
href, target, icon, brand, title, isHeader = false, id, ...restProps
|
|
28
99
|
}) => (
|
|
29
100
|
<StyledLink
|
|
30
101
|
href={href}
|
|
@@ -32,10 +103,16 @@ const Icon = ({
|
|
|
32
103
|
{...restProps}
|
|
33
104
|
title={title}
|
|
34
105
|
rel="noopener noreferrer"
|
|
35
|
-
data-
|
|
106
|
+
data-testid={`${isHeader ? 'header' : 'icon'}-${kebabCase(id)}`}
|
|
107
|
+
isHeader={isHeader}
|
|
36
108
|
>
|
|
37
109
|
<StyledImage src={icon} alt={brand} />
|
|
38
|
-
|
|
110
|
+
|
|
111
|
+
{ isHeader && (
|
|
112
|
+
<RevealText>{title}</RevealText>
|
|
113
|
+
)}
|
|
114
|
+
|
|
115
|
+
{id === 'esu' && (
|
|
39
116
|
<HelperText>(opens in new window)</HelperText>
|
|
40
117
|
)}
|
|
41
118
|
</StyledLink>
|
|
@@ -46,7 +123,9 @@ Icon.propTypes = {
|
|
|
46
123
|
href: PropTypes.string.isRequired,
|
|
47
124
|
target: PropTypes.string.isRequired,
|
|
48
125
|
icon: PropTypes.string.isRequired,
|
|
49
|
-
title: PropTypes.string.isRequired
|
|
126
|
+
title: PropTypes.string.isRequired,
|
|
127
|
+
isHeader: PropTypes.bool,
|
|
128
|
+
id: PropTypes.string.isRequired
|
|
50
129
|
};
|
|
51
130
|
|
|
52
131
|
export default Icon;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
### Comic Relief
|
|
2
|
-
|
|
3
2
|
```js
|
|
4
|
-
<
|
|
3
|
+
<div style={{ background: "black", padding: "10px"}}>
|
|
4
|
+
<SocialIcons campaign="comicrelief" />
|
|
5
|
+
</div>
|
|
5
6
|
```
|
|
6
7
|
|
|
7
8
|
### Red Nose Day
|
|
8
|
-
|
|
9
9
|
```js
|
|
10
|
-
<
|
|
10
|
+
<div style={{ background: "black", padding: "10px"}}>
|
|
11
|
+
<SocialIcons campaign="rednoseday" />
|
|
12
|
+
</div>
|
|
11
13
|
```
|
|
12
14
|
|
|
13
15
|
### Sport Relief with self target
|
|
14
|
-
|
|
15
16
|
```js
|
|
16
|
-
<
|
|
17
|
+
<div style={{ background: "black", padding: "10px"}}>
|
|
18
|
+
<SocialIcons campaign="sportrelief" target="self" />
|
|
19
|
+
</div>
|
|
17
20
|
```
|
|
@@ -6,18 +6,22 @@
|
|
|
6
6
|
export default campaign => ({
|
|
7
7
|
facebook: {
|
|
8
8
|
url: `https://www.facebook.com/${campaign}`,
|
|
9
|
-
title: 'Check out our Facebook page'
|
|
9
|
+
title: 'Check out our Facebook page',
|
|
10
|
+
id: 'facebook'
|
|
10
11
|
},
|
|
11
12
|
twitter: {
|
|
12
13
|
url: `https://twitter.com/${campaign}`,
|
|
13
|
-
title: 'Check out our Twitter account'
|
|
14
|
+
title: 'Check out our Twitter account',
|
|
15
|
+
id: 'twitter'
|
|
14
16
|
},
|
|
15
17
|
youtube: {
|
|
16
18
|
url: 'https://www.youtube.com/channel/UCdF5u0ggeSETozc8fsprjcw',
|
|
17
|
-
title: 'Check out our YouTube channel'
|
|
19
|
+
title: 'Check out our YouTube channel',
|
|
20
|
+
id: 'youtube'
|
|
18
21
|
},
|
|
19
22
|
instagram: {
|
|
20
23
|
url: `https://www.instagram.com/${campaign}`,
|
|
21
|
-
title: 'Check out our Instagram account'
|
|
24
|
+
title: 'Check out our Instagram account',
|
|
25
|
+
id: 'instagram'
|
|
22
26
|
}
|
|
23
27
|
});
|