@newskit-render/core 1.42.3 → 1.45.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/CHANGELOG.md +95 -0
- package/__tests__/pages/[articleSlug].test.tsx +59 -18
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +46 -21
- package/components/article/Highlights.tsx +4 -33
- package/components/article/RelatedArticles.tsx +4 -53
- package/components/article/__tests__/__snapshots__/index.test.tsx.snap +99 -64
- package/components/common/NewskitLogo.tsx +5 -3
- package/components/common/NewskitLogoShort.tsx +6 -4
- package/components/common/iconNavLink/IconNavLink.tsx +70 -0
- package/components/common/iconNavLink/__tests__/IconNavLink.test.tsx +35 -0
- package/components/common/iconNavLink/index.ts +3 -0
- package/components/common/iconNavLink/types.ts +24 -0
- package/components/common/icons/IconAccount.tsx +13 -0
- package/components/footer/__snapshots__/index.test.tsx.snap +6 -4
- package/components/header/index.test.tsx +17 -0
- package/components/header/index.tsx +32 -18
- package/cypress/e2e/account/account-page.spec.js +27 -1
- package/cypress/e2e/account/account-subscription.spec.js +45 -0
- package/cypress/e2e/account/main-api.spec.js +4 -4
- package/cypress/support/commands.js +7 -3
- package/package.json +8 -7
- package/pages/[section]/[articleId]/[articleSlug].tsx +14 -3
- package/pages/api/news-sitemap.ts +10 -2
- package/pages/api/sitemap.ts +10 -6
- package/temp/_app.tsx +209 -0
- package/temp/header.tsx +32 -18
package/temp/_app.tsx
CHANGED
|
@@ -13,6 +13,215 @@ if (!process.browser) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const GlobalStyling = css`
|
|
16
|
+
@font-face {
|
|
17
|
+
font-family: GillSansMTStd-Medium;
|
|
18
|
+
src: url('/fonts/GillSansMTStd-Medium.otf');
|
|
19
|
+
}
|
|
20
|
+
@font-face {
|
|
21
|
+
font-family: TimesModern-Bold;
|
|
22
|
+
src: url('/fonts/TimesDigital-Bold.ttf') format('truetype');
|
|
23
|
+
}
|
|
24
|
+
@font-face {
|
|
25
|
+
font-family: TimesModern-Regular;
|
|
26
|
+
src: url('/fonts/TimesDigital-Regular.ttf') format('truetype');
|
|
27
|
+
}
|
|
28
|
+
@font-face {
|
|
29
|
+
font-family: TimesDigitalW04-Regular;
|
|
30
|
+
src: url('/fonts/TimesDigitalW04-Regular.ttf') format('truetype');
|
|
31
|
+
}
|
|
32
|
+
@font-face {
|
|
33
|
+
font-family: Montserrat;
|
|
34
|
+
src: url('/fonts/Montserrat-Regular.ttf') format('truetype');
|
|
35
|
+
}
|
|
36
|
+
@font-face {
|
|
37
|
+
font-family: TheSun-Bold;
|
|
38
|
+
src: url('/fonts/TheSun-Bold.ttf') format('truetype');
|
|
39
|
+
}
|
|
40
|
+
@font-face {
|
|
41
|
+
font-family: TheSun-HeavyNarrow;
|
|
42
|
+
src: url('/fonts/TheSun-HeavyNarrow.ttf') format('truetype');
|
|
43
|
+
}
|
|
44
|
+
@font-face {
|
|
45
|
+
font-family: TheSun-Regular;
|
|
46
|
+
src: url('/fonts/TheSun-Regular.ttf') format('truetype');
|
|
47
|
+
}
|
|
48
|
+
@font-face {
|
|
49
|
+
font-family: TheSun-Medium;
|
|
50
|
+
src: url('/fonts/TheSun-Medium.ttf') format('truetype');
|
|
51
|
+
}
|
|
52
|
+
@font-face {
|
|
53
|
+
font-family: 'DM Sans';
|
|
54
|
+
src: url('/fonts/dmsans-regular-webfont.woff2') format('woff2'),
|
|
55
|
+
url('/fonts/dmsans-regular-webfont.woff') format('woff');
|
|
56
|
+
font-style: normal;
|
|
57
|
+
font-weight: 400;
|
|
58
|
+
font-display: swap;
|
|
59
|
+
}
|
|
60
|
+
@font-face {
|
|
61
|
+
font-family: 'DM Sans';
|
|
62
|
+
src: url('/fonts/dmsans-italic-webfont.woff2') format('woff2'),
|
|
63
|
+
url('/fonts/dmsans-italic-webfont.woff') format('woff');
|
|
64
|
+
font-style: italic;
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
font-display: swap;
|
|
67
|
+
}
|
|
68
|
+
@font-face {
|
|
69
|
+
font-family: 'DM Sans';
|
|
70
|
+
src: url('/fonts/dmsans-medium-webfont.woff2') format('woff2'),
|
|
71
|
+
url('/fonts/dmsans-medium-webfont.woff') format('woff');
|
|
72
|
+
font-style: normal;
|
|
73
|
+
font-weight: 500;
|
|
74
|
+
font-display: swap;
|
|
75
|
+
}
|
|
76
|
+
@font-face {
|
|
77
|
+
font-family: 'DM Sans';
|
|
78
|
+
src: url('/fonts/dmsans-mediumitalic-webfont.woff2') format('woff2'),
|
|
79
|
+
url('/fonts/dmsans-mediumitalic-webfont.woff') format('woff');
|
|
80
|
+
font-style: italic;
|
|
81
|
+
font-weight: 500;
|
|
82
|
+
font-display: swap;
|
|
83
|
+
}
|
|
84
|
+
@font-face {
|
|
85
|
+
font-family: 'DM Sans';
|
|
86
|
+
src: url('/fonts/dmsans-bold-webfont.woff2') format('woff2'),
|
|
87
|
+
url('/fonts/dmsans-bold-webfont.woff') format('woff');
|
|
88
|
+
font-style: normal;
|
|
89
|
+
font-weight: 700;
|
|
90
|
+
font-display: swap;
|
|
91
|
+
}
|
|
92
|
+
@font-face {
|
|
93
|
+
font-family: 'DM Sans';
|
|
94
|
+
src: url('/fonts/dmsans-bolditalic-webfont.woff2') format('woff2'),
|
|
95
|
+
url('/fonts/dmsans-bolditalic-webfont.woff') format('woff');
|
|
96
|
+
font-style: italic;
|
|
97
|
+
font-weight: 700;
|
|
98
|
+
font-display: swap;
|
|
99
|
+
}
|
|
100
|
+
@font-face {
|
|
101
|
+
font-family: 'Poppins';
|
|
102
|
+
src: url('/fonts/poppins-bold-webfont.woff2') format('woff2'),
|
|
103
|
+
url('/fonts/poppins-bold-webfont.woff') format('woff');
|
|
104
|
+
font-weight: 700;
|
|
105
|
+
font-style: normal;
|
|
106
|
+
}
|
|
107
|
+
@font-face {
|
|
108
|
+
font-family: 'Poppins';
|
|
109
|
+
src: url('/fonts/poppins-bolditalic-webfont.woff2') format('woff2'),
|
|
110
|
+
url('/fonts/poppins-bolditalic-webfont.woff') format('woff');
|
|
111
|
+
font-weight: normal;
|
|
112
|
+
font-style: italic;
|
|
113
|
+
}
|
|
114
|
+
@font-face {
|
|
115
|
+
font-family: 'Poppins';
|
|
116
|
+
src: url('/fonts/poppins-extrabold-webfont.woff2') format('woff2'),
|
|
117
|
+
url('/fonts/poppins-extrabold-webfont.woff') format('woff');
|
|
118
|
+
font-weight: 800;
|
|
119
|
+
font-style: normal;
|
|
120
|
+
}
|
|
121
|
+
@font-face {
|
|
122
|
+
font-family: 'Poppins';
|
|
123
|
+
src: url('/fonts/poppins-extrabolditalic-webfont.woff2') format('woff2'),
|
|
124
|
+
url('/fonts/poppins-extrabolditalic-webfont.woff') format('woff');
|
|
125
|
+
font-weight: 800;
|
|
126
|
+
font-style: italic;
|
|
127
|
+
}
|
|
128
|
+
@font-face {
|
|
129
|
+
font-family: 'Poppins';
|
|
130
|
+
src: url('/fonts/poppins-italic-webfont.woff2') format('woff2'),
|
|
131
|
+
url('/fonts/poppins-italic-webfont.woff') format('woff');
|
|
132
|
+
font-weight: 400;
|
|
133
|
+
font-style: italic;
|
|
134
|
+
}
|
|
135
|
+
@font-face {
|
|
136
|
+
font-family: 'Poppins';
|
|
137
|
+
src: url('/fonts/poppins-light-webfont.woff2') format('woff2'),
|
|
138
|
+
url('/fonts/poppins-light-webfont.woff') format('woff');
|
|
139
|
+
font-weight: 300;
|
|
140
|
+
font-style: normal;
|
|
141
|
+
}
|
|
142
|
+
@font-face {
|
|
143
|
+
font-family: 'Poppins';
|
|
144
|
+
src: url('/fonts/poppins-lightitalic-webfont.woff2') format('woff2'),
|
|
145
|
+
url('/fonts/poppins-lightitalic-webfont.woff') format('woff');
|
|
146
|
+
font-weight: 300;
|
|
147
|
+
font-style: italic;
|
|
148
|
+
}
|
|
149
|
+
@font-face {
|
|
150
|
+
font-family: 'Poppins';
|
|
151
|
+
src: url('/fonts/poppins-medium-webfont.woff2') format('woff2'),
|
|
152
|
+
url('/fonts/poppins-medium-webfont.woff') format('woff');
|
|
153
|
+
font-weight: 500;
|
|
154
|
+
font-style: normal;
|
|
155
|
+
}
|
|
156
|
+
@font-face {
|
|
157
|
+
font-family: 'Poppins';
|
|
158
|
+
src: url('/fonts/poppins-mediumitalic-webfont.woff2') format('woff2'),
|
|
159
|
+
url('/fonts/poppins-mediumitalic-webfont.woff') format('woff');
|
|
160
|
+
font-weight: 500;
|
|
161
|
+
font-style: italic;
|
|
162
|
+
}
|
|
163
|
+
@font-face {
|
|
164
|
+
font-family: 'Poppins';
|
|
165
|
+
src: url('/fonts/poppins-regular-webfont.woff2') format('woff2'),
|
|
166
|
+
url('/fonts/poppins-regular-webfont.woff') format('woff');
|
|
167
|
+
font-weight: 400;
|
|
168
|
+
font-style: normal;
|
|
169
|
+
}
|
|
170
|
+
@font-face {
|
|
171
|
+
font-family: 'Poppins';
|
|
172
|
+
src: url('/fonts/poppins-semibold-webfont.woff2') format('woff2'),
|
|
173
|
+
url('/fonts/poppins-semibold-webfont.woff') format('woff');
|
|
174
|
+
font-weight: 600;
|
|
175
|
+
font-style: normal;
|
|
176
|
+
}
|
|
177
|
+
@font-face {
|
|
178
|
+
font-family: 'Poppins';
|
|
179
|
+
src: url('/fonts/poppins-semibolditalic-webfont.woff2') format('woff2'),
|
|
180
|
+
url('/fonts/poppins-semibolditalic-webfont.woff') format('woff');
|
|
181
|
+
font-weight: 600;
|
|
182
|
+
font-style: italic;
|
|
183
|
+
}
|
|
184
|
+
@font-face {
|
|
185
|
+
font-family: 'DM Mono';
|
|
186
|
+
src: url('/fonts/dmmono-medium.woff2') format('woff2'),
|
|
187
|
+
url('/fonts/dmmono-medium.woff') format('woff');
|
|
188
|
+
font-style: normal;
|
|
189
|
+
font-weight: 500;
|
|
190
|
+
font-display: swap;
|
|
191
|
+
}
|
|
192
|
+
@font-face {
|
|
193
|
+
font-family: 'Bitter';
|
|
194
|
+
src: url('/fonts/bitter-regular.woff2') format('woff2'),
|
|
195
|
+
url('/fonts/bitter-regular.woff') format('woff');
|
|
196
|
+
font-style: normal;
|
|
197
|
+
font-weight: 400;
|
|
198
|
+
font-display: swap;
|
|
199
|
+
}
|
|
200
|
+
@font-face {
|
|
201
|
+
font-family: 'Bitter';
|
|
202
|
+
src: url('/fonts/bitter-medium.woff2') format('woff2'),
|
|
203
|
+
url('/fonts/bitter-medium.woff') format('woff');
|
|
204
|
+
font-style: normal;
|
|
205
|
+
font-weight: 500;
|
|
206
|
+
font-display: swap;
|
|
207
|
+
}
|
|
208
|
+
@font-face {
|
|
209
|
+
font-family: 'Bitter';
|
|
210
|
+
src: url('/fonts/bitter-mediumitalic.woff2') format('woff2'),
|
|
211
|
+
url('/fonts/bitter-mediumitalic.woff') format('woff');
|
|
212
|
+
font-style: italic;
|
|
213
|
+
font-weight: 500;
|
|
214
|
+
font-display: swap;
|
|
215
|
+
}
|
|
216
|
+
@font-face {
|
|
217
|
+
font-family: 'Bitter';
|
|
218
|
+
src: url('/fonts/bitter-semibold.woff2') format('woff2'),
|
|
219
|
+
url('/fonts/bitter-semibold.woff') format('woff');
|
|
220
|
+
font-style: normal;
|
|
221
|
+
font-weight: 600;
|
|
222
|
+
font-display: swap;
|
|
223
|
+
}
|
|
224
|
+
|
|
16
225
|
html,
|
|
17
226
|
body {
|
|
18
227
|
padding: 0;
|
package/temp/header.tsx
CHANGED
|
@@ -18,12 +18,14 @@ import NewsKitLogoFull from '../common/NewskitLogo'
|
|
|
18
18
|
import NewsKitLogoShort from '../common/NewskitLogoShort'
|
|
19
19
|
import NavLink from '../common/NavLink'
|
|
20
20
|
import { handleEnterKeyPress } from '../../helpers/a11y'
|
|
21
|
+
import IconNavLink from '../common/iconNavLink'
|
|
22
|
+
import { IconAccount } from '../common/icons/IconAccount'
|
|
21
23
|
|
|
22
|
-
export const headerSize = '
|
|
24
|
+
export const headerSize = 'sizing100'
|
|
23
25
|
|
|
24
26
|
const StyledHeader = styled.div`
|
|
25
27
|
${getSizingCssFromTheme('height', headerSize)}
|
|
26
|
-
${getColorCssFromTheme('backgroundColor', '
|
|
28
|
+
${getColorCssFromTheme('backgroundColor', 'interfaceBrand010')};
|
|
27
29
|
a,
|
|
28
30
|
a:visited:not(:disabled) {
|
|
29
31
|
${getColorCssFromTheme('color', 'white')};
|
|
@@ -31,14 +33,14 @@ const StyledHeader = styled.div`
|
|
|
31
33
|
line-height: ${getFontsFromTheme('fontLineHeight040')};
|
|
32
34
|
}
|
|
33
35
|
${getMediaQueryFromTheme('xs')} {
|
|
34
|
-
${getSizingCssFromTheme('paddingTop', '
|
|
35
|
-
${getSizingCssFromTheme('paddingBottom', '
|
|
36
|
+
${getSizingCssFromTheme('paddingTop', 'sizing040')};
|
|
37
|
+
${getSizingCssFromTheme('paddingBottom', 'sizing040')};
|
|
36
38
|
${getSizingCssFromTheme('paddingLeft', 'sizing000')};
|
|
37
39
|
${getSizingCssFromTheme('paddingRight', 'sizing000')};
|
|
38
40
|
}
|
|
39
41
|
${getMediaQueryFromTheme('lg')} {
|
|
40
|
-
${getSizingCssFromTheme('paddingTop', '
|
|
41
|
-
${getSizingCssFromTheme('paddingBottom', '
|
|
42
|
+
${getSizingCssFromTheme('paddingTop', 'sizing040')};
|
|
43
|
+
${getSizingCssFromTheme('paddingBottom', 'sizing040')};
|
|
42
44
|
${getSizingCssFromTheme('paddingLeft', 'sizing090')};
|
|
43
45
|
${getSizingCssFromTheme('paddingRight', 'sizing090')};
|
|
44
46
|
}
|
|
@@ -53,14 +55,14 @@ const NavigationContainer = styled.div<NavigationProps>`
|
|
|
53
55
|
overflow: auto;
|
|
54
56
|
width: 100%;
|
|
55
57
|
min-height: 100vh;
|
|
56
|
-
${getColorCssFromTheme('backgroundColor', '
|
|
58
|
+
${getColorCssFromTheme('backgroundColor', 'interfaceBrand010')};
|
|
57
59
|
left: 0;
|
|
58
60
|
${getSizingCssFromTheme('top', headerSize)}
|
|
59
|
-
z-index:
|
|
61
|
+
z-index: 2;
|
|
60
62
|
display: ${(props) => (props.show ? 'block' : 'none')};
|
|
61
63
|
|
|
62
64
|
${getMediaQueryFromTheme('md')} {
|
|
63
|
-
display:
|
|
65
|
+
display: flex;
|
|
64
66
|
position: relative;
|
|
65
67
|
overflow: auto;
|
|
66
68
|
width: initial;
|
|
@@ -69,6 +71,7 @@ const NavigationContainer = styled.div<NavigationProps>`
|
|
|
69
71
|
left: initial;
|
|
70
72
|
top: initial;
|
|
71
73
|
z-index: 1;
|
|
74
|
+
${getSizingCssFromTheme('height', 'sizing080')}
|
|
72
75
|
}
|
|
73
76
|
`
|
|
74
77
|
|
|
@@ -133,12 +136,10 @@ const BannerContainer = styled(Block)`
|
|
|
133
136
|
const NavButton = ({
|
|
134
137
|
buttonText,
|
|
135
138
|
href,
|
|
136
|
-
isMobile,
|
|
137
139
|
ariaLabel,
|
|
138
140
|
}: {
|
|
139
141
|
buttonText: string
|
|
140
142
|
href: string
|
|
141
|
-
isMobile: boolean
|
|
142
143
|
isLast?: boolean
|
|
143
144
|
ariaLabel?: string
|
|
144
145
|
}) => (
|
|
@@ -146,9 +147,12 @@ const NavButton = ({
|
|
|
146
147
|
as="span"
|
|
147
148
|
spaceInline={{
|
|
148
149
|
xs: 'space000',
|
|
149
|
-
md: '
|
|
150
|
+
md: 'space040',
|
|
151
|
+
}}
|
|
152
|
+
spaceStack={{
|
|
153
|
+
xs: 'space050',
|
|
154
|
+
md: 'space000',
|
|
150
155
|
}}
|
|
151
|
-
spaceStack={isMobile && 'space050'}
|
|
152
156
|
>
|
|
153
157
|
<NavLink href={href} ariaLabel={ariaLabel} buttonText={buttonText} />
|
|
154
158
|
</Block>
|
|
@@ -191,8 +195,11 @@ const Header: React.FC<{ user: UserData }> = ({ user }) => {
|
|
|
191
195
|
stackDistribution="flex-end"
|
|
192
196
|
wrap="nowrap"
|
|
193
197
|
>
|
|
194
|
-
<NavigationContainer
|
|
195
|
-
|
|
198
|
+
<NavigationContainer
|
|
199
|
+
show={showMenu}
|
|
200
|
+
data-testid="NavigationContainer"
|
|
201
|
+
>
|
|
202
|
+
<Navigation data-testid="Navigation">
|
|
196
203
|
{showMenu && (
|
|
197
204
|
<Block
|
|
198
205
|
spaceStack="space050"
|
|
@@ -202,21 +209,28 @@ const Header: React.FC<{ user: UserData }> = ({ user }) => {
|
|
|
202
209
|
<NavButton
|
|
203
210
|
buttonText="Section One"
|
|
204
211
|
href="/section-one"
|
|
205
|
-
isMobile={showMenu}
|
|
206
212
|
ariaLabel="Section One Link"
|
|
207
213
|
/>
|
|
208
214
|
<NavButton
|
|
209
215
|
buttonText="Section Two"
|
|
210
216
|
href="/section-two"
|
|
211
|
-
isMobile={showMenu}
|
|
212
217
|
ariaLabel="Section Two Link"
|
|
213
218
|
/>
|
|
214
219
|
<NavButton
|
|
215
220
|
buttonText="Section Three"
|
|
216
221
|
href="/section-three"
|
|
217
|
-
isMobile={showMenu}
|
|
218
222
|
ariaLabel="Section Three Link"
|
|
219
223
|
/>
|
|
224
|
+
{user && (
|
|
225
|
+
<IconNavLink
|
|
226
|
+
icon={<IconAccount data-testid="account-link" />}
|
|
227
|
+
href="/account"
|
|
228
|
+
text="Account"
|
|
229
|
+
spaceInline="space040"
|
|
230
|
+
typographyPreset="utilityMeta020"
|
|
231
|
+
stylePreset="linkStandaloneInverse"
|
|
232
|
+
/>
|
|
233
|
+
)}
|
|
220
234
|
</Navigation>
|
|
221
235
|
</NavigationContainer>
|
|
222
236
|
<Visible xs sm>
|