@times-components/ts-components 1.24.0 → 1.26.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 +35 -0
- package/dist/__mocks__/isomorphic-unfetch.d.ts +3 -0
- package/dist/__mocks__/isomorphic-unfetch.js +4 -0
- package/dist/components/article-flag/LiveArticleFlag.js +5 -5
- package/dist/components/article-flag/styles.d.ts +4 -3
- package/dist/components/article-flag/styles.js +30 -26
- package/dist/components/article-header/ArticleHeader.js +11 -2
- package/dist/components/common-styles.d.ts +13 -0
- package/dist/components/common-styles.js +54 -10
- package/dist/components/in-article-big-numbers/BigNumbers.js +4 -4
- package/dist/components/in-article-big-numbers/styles.d.ts +1 -13
- package/dist/components/in-article-big-numbers/styles.js +3 -52
- package/dist/components/in-article-timelines/Timelines.d.ts +4 -0
- package/dist/components/in-article-timelines/Timelines.js +70 -0
- package/dist/components/in-article-timelines/Timelines.stories.d.ts +1 -0
- package/dist/components/in-article-timelines/Timelines.stories.js +21 -0
- package/dist/components/in-article-timelines/__tests__/Timelines.test.d.ts +2 -0
- package/dist/components/in-article-timelines/__tests__/Timelines.test.js +256 -0
- package/dist/components/in-article-timelines/styles.d.ts +15 -0
- package/dist/components/in-article-timelines/styles.js +115 -0
- package/dist/components/opta/football/fixtures/OptaFootballFixtures.js +5 -4
- package/dist/components/opta/football/fixtures/__tests__/OptaFootballFixtures.test.d.ts +2 -0
- package/dist/components/opta/football/fixtures/__tests__/OptaFootballFixtures.test.js +41 -0
- package/dist/components/opta/football/match-stats/OptaFootballMatchStats.js +4 -3
- package/dist/components/opta/football/match-stats/__tests__/OptaFootballMatchStats.test.d.ts +2 -0
- package/dist/components/opta/football/match-stats/__tests__/OptaFootballMatchStats.test.js +40 -0
- package/dist/components/opta/football/standings/OptaFootballStandings.js +4 -3
- package/dist/components/opta/football/standings/__tests__/OptaFootballStandings.test.d.ts +2 -0
- package/dist/components/opta/football/standings/__tests__/OptaFootballStandings.test.js +39 -0
- package/dist/components/opta/football/summary/OptaFootballSummary.js +4 -3
- package/dist/components/opta/football/summary/__tests__/OptaFootballSummary.test.d.ts +2 -0
- package/dist/components/opta/football/summary/__tests__/OptaFootballSummary.test.js +40 -0
- package/dist/components/opta/rugby/fixtures/OptaRugbyFixtures.d.ts +8 -0
- package/dist/components/opta/rugby/fixtures/OptaRugbyFixtures.js +54 -0
- package/dist/components/opta/rugby/fixtures/OptaRugbyFixtures.stories.d.ts +1 -0
- package/dist/components/opta/rugby/fixtures/OptaRugbyFixtures.stories.js +26 -0
- package/dist/components/opta/rugby/fixtures/__tests__/OptaRugbyFixtures.test.d.ts +2 -0
- package/dist/components/opta/rugby/fixtures/__tests__/OptaRugbyFixtures.test.js +41 -0
- package/dist/components/opta/rugby/fixtures/styles.d.ts +2 -0
- package/dist/components/opta/rugby/fixtures/styles.js +255 -0
- package/dist/components/opta/rugby/match-stats/OptaRugbyMatchStats.d.ts +7 -0
- package/dist/components/opta/rugby/match-stats/OptaRugbyMatchStats.js +43 -0
- package/dist/components/opta/rugby/match-stats/OptaRugbyMatchStats.stories.d.ts +1 -0
- package/dist/components/opta/rugby/match-stats/OptaRugbyMatchStats.stories.js +26 -0
- package/dist/components/opta/rugby/match-stats/__tests__/OptaRugbyMatchStats.test.d.ts +2 -0
- package/dist/components/opta/rugby/match-stats/__tests__/OptaRugbyMatchStats.test.js +40 -0
- package/dist/components/opta/rugby/match-stats/styles.d.ts +1 -0
- package/dist/components/opta/rugby/match-stats/styles.js +153 -0
- package/dist/components/opta/rugby/shared-styles.d.ts +6 -0
- package/dist/components/opta/rugby/shared-styles.js +72 -0
- package/dist/components/opta/rugby/standings/OptaRugbyStandings.d.ts +8 -0
- package/dist/components/opta/rugby/standings/OptaRugbyStandings.js +36 -0
- package/dist/components/opta/rugby/standings/OptaRugbyStandings.stories.d.ts +1 -0
- package/dist/components/opta/rugby/standings/OptaRugbyStandings.stories.js +36 -0
- package/dist/components/opta/rugby/standings/__tests__/OptaRugbyStandings.test.d.ts +2 -0
- package/dist/components/opta/rugby/standings/__tests__/OptaRugbyStandings.test.js +39 -0
- package/dist/components/opta/rugby/standings/styles.d.ts +1 -0
- package/dist/components/opta/rugby/standings/styles.js +247 -0
- package/dist/components/opta/rugby/summary/OptaRugbySummary.d.ts +7 -0
- package/dist/components/opta/rugby/summary/OptaRugbySummary.js +44 -0
- package/dist/components/opta/rugby/summary/OptaRugbySummary.stories.d.ts +1 -0
- package/dist/components/opta/rugby/summary/OptaRugbySummary.stories.js +26 -0
- package/dist/components/opta/rugby/summary/__tests__/OptaRugbySummary.test.d.ts +2 -0
- package/dist/components/opta/rugby/summary/__tests__/OptaRugbySummary.test.js +40 -0
- package/dist/components/opta/rugby/summary/styles.d.ts +1 -0
- package/dist/components/opta/rugby/summary/styles.js +152 -0
- package/dist/components/opta/utils/__tests__/config.test.d.ts +1 -0
- package/dist/components/opta/utils/__tests__/config.test.js +24 -0
- package/dist/components/opta/utils/config.d.ts +1 -1
- package/dist/components/opta/utils/config.js +12 -3
- package/dist/helpers/fetch/FetchProvider.js +3 -3
- package/dist/helpers/fetch/__tests__/FetchProvider.test.d.ts +0 -1
- package/dist/helpers/fetch/__tests__/FetchProvider.test.js +17 -23
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/jest.config.js +4 -4
- package/package.json +6 -5
- package/rnw.js +1 -1
- package/src/__mocks__/isomorphic-unfetch.ts +3 -0
- package/src/components/article-flag/LiveArticleFlag.tsx +7 -6
- package/src/components/article-flag/__tests__/__snapshots__/ArticleFlag.test.tsx.snap +100 -100
- package/src/components/article-flag/__tests__/__snapshots__/LiveArticleFlag.test.tsx.snap +33 -33
- package/src/components/article-flag/styles.ts +32 -27
- package/src/components/article-header/ArticleHeader.tsx +10 -2
- package/src/components/article-header/__tests__/__snapshots__/ArticleHeader.test.tsx.snap +14 -11
- package/src/components/carousel/__tests__/__snapshots__/GalleryCarousel.test.tsx.snap +3 -3
- package/src/components/common-styles.ts +66 -7
- package/src/components/in-article-big-numbers/BigNumbers.tsx +11 -8
- package/src/components/in-article-big-numbers/__tests__/__snapshots__/BigNumbers.test.tsx.snap +67 -67
- package/src/components/in-article-big-numbers/styles.ts +2 -65
- package/src/components/in-article-info-card/__tests__/__snapshots__/InfoCard.test.tsx.snap +8 -8
- package/src/components/in-article-info-card-bulletpoints/__tests__/__snapshots__/InfoCardBulletPoints.test.tsx.snap +2 -2
- package/src/components/in-article-puff/__tests__/__snapshots__/InArticlePuff.test.tsx.snap +10 -10
- package/src/components/in-article-timelines/Timelines.stories.tsx +33 -0
- package/src/components/in-article-timelines/Timelines.tsx +160 -0
- package/src/components/in-article-timelines/__tests__/Timelines.test.tsx +309 -0
- package/src/components/in-article-timelines/__tests__/__snapshots__/Timelines.test.tsx.snap +727 -0
- package/src/components/in-article-timelines/styles.ts +127 -0
- package/src/components/opta/football/fixtures/OptaFootballFixtures.tsx +5 -3
- package/src/components/opta/football/fixtures/__tests__/OptaFootballFixtures.test.tsx +53 -0
- package/src/components/opta/football/fixtures/__tests__/__snapshots__/OptaFootballFixtures.test.tsx.snap +34 -0
- package/src/components/opta/football/match-stats/OptaFootballMatchStats.tsx +4 -2
- package/src/components/opta/football/match-stats/__tests__/OptaFootballMatchStats.test.tsx +52 -0
- package/src/components/opta/football/match-stats/__tests__/__snapshots__/OptaFootballMatchStats.test.tsx.snap +34 -0
- package/src/components/opta/football/standings/OptaFootballStandings.tsx +4 -2
- package/src/components/opta/football/standings/__tests__/OptaFootballStandings.test.tsx +51 -0
- package/src/components/opta/football/standings/__tests__/__snapshots__/OptaFootballStandings.test.tsx.snap +34 -0
- package/src/components/opta/football/summary/OptaFootballSummary.tsx +4 -2
- package/src/components/opta/football/summary/__tests__/OptaFootballSummary.test.tsx +52 -0
- package/src/components/opta/football/summary/__tests__/__snapshots__/OptaFootballSummary.test.tsx.snap +34 -0
- package/src/components/opta/rugby/fixtures/OptaRugbyFixtures.stories.tsx +44 -0
- package/src/components/opta/rugby/fixtures/OptaRugbyFixtures.tsx +86 -0
- package/src/components/opta/rugby/fixtures/__tests__/OptaRugbyFixtures.test.tsx +53 -0
- package/src/components/opta/rugby/fixtures/__tests__/__snapshots__/OptaRugbyFixtures.test.tsx.snap +34 -0
- package/src/components/opta/rugby/fixtures/styles.ts +257 -0
- package/src/components/opta/rugby/match-stats/OptaRugbyMatchStats.stories.tsx +34 -0
- package/src/components/opta/rugby/match-stats/OptaRugbyMatchStats.tsx +71 -0
- package/src/components/opta/rugby/match-stats/__tests__/OptaRugbyMatchStats.test.tsx +52 -0
- package/src/components/opta/rugby/match-stats/__tests__/__snapshots__/OptaRugbyMatchStats.test.tsx.snap +34 -0
- package/src/components/opta/rugby/match-stats/styles.ts +154 -0
- package/src/components/opta/rugby/shared-styles.ts +75 -0
- package/src/components/opta/rugby/standings/OptaRugbyStandings.stories.tsx +49 -0
- package/src/components/opta/rugby/standings/OptaRugbyStandings.tsx +66 -0
- package/src/components/opta/rugby/standings/__tests__/OptaRugbyStandings.test.tsx +51 -0
- package/src/components/opta/rugby/standings/__tests__/__snapshots__/OptaRugbyStandings.test.tsx.snap +34 -0
- package/src/components/opta/rugby/standings/styles.ts +248 -0
- package/src/components/opta/rugby/summary/OptaRugbySummary.stories.tsx +34 -0
- package/src/components/opta/rugby/summary/OptaRugbySummary.tsx +71 -0
- package/src/components/opta/rugby/summary/__tests__/OptaRugbySummary.test.tsx +52 -0
- package/src/components/opta/rugby/summary/__tests__/__snapshots__/OptaRugbySummary.test.tsx.snap +34 -0
- package/src/components/opta/rugby/summary/styles.ts +153 -0
- package/src/components/opta/utils/__tests__/config.test.tsx +38 -0
- package/src/components/opta/utils/config.ts +13 -3
- package/src/helpers/fetch/FetchProvider.tsx +2 -2
- package/src/helpers/fetch/__tests__/FetchProvider.test.tsx +21 -31
- package/src/helpers/fetch/__tests__/__snapshots__/FetchProvider.test.tsx.snap +10 -2
- package/src/index.ts +1 -0
|
@@ -3,37 +3,59 @@ import { fonts } from '@times-components/styleguide';
|
|
|
3
3
|
import { FlagType } from './ArticleFlag';
|
|
4
4
|
import { gqlRgbaToStyle } from '@times-components/utils';
|
|
5
5
|
|
|
6
|
+
export const LiveArticleFlagContainer = styled.div`
|
|
7
|
+
background-color: #9f0000;
|
|
8
|
+
height: 24px;
|
|
9
|
+
padding: 7px 7px 7px 9px;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
width: fit-content;
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
export const LiveArticleFlagText = styled.span`
|
|
16
|
+
font-family: ${fonts.supporting};
|
|
17
|
+
color: #ffffff;
|
|
18
|
+
font-weight: 500;
|
|
19
|
+
font-size: 12px;
|
|
20
|
+
letter-spacing: 0.1em;
|
|
21
|
+
`;
|
|
22
|
+
|
|
6
23
|
const flashing = keyframes`
|
|
7
24
|
0% {
|
|
8
|
-
color: #ffffff;
|
|
25
|
+
background-color: #ffffff;
|
|
9
26
|
}
|
|
10
27
|
|
|
11
28
|
50% {
|
|
12
|
-
|
|
29
|
+
background-color: #9f0000;
|
|
13
30
|
}
|
|
14
31
|
|
|
15
32
|
100% {
|
|
16
|
-
color: #ffffff;
|
|
33
|
+
background-color: #ffffff;
|
|
17
34
|
}`;
|
|
18
35
|
|
|
19
|
-
export const
|
|
36
|
+
export const LiveArticleFlagIconContainer = styled.div`
|
|
37
|
+
height: 100%;
|
|
20
38
|
display: flex;
|
|
21
39
|
align-items: center;
|
|
22
|
-
|
|
40
|
+
margin-right: 7px;
|
|
23
41
|
`;
|
|
24
42
|
|
|
25
|
-
export const
|
|
43
|
+
export const LiveArticleFlagIcon = styled.div`
|
|
44
|
+
height: 6px;
|
|
45
|
+
width: 6px;
|
|
46
|
+
animation: ${flashing} 2000ms infinite;
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
export const ArticleFlagContainer = styled.div`
|
|
26
50
|
display: flex;
|
|
27
51
|
align-items: center;
|
|
28
52
|
flex-direction: row;
|
|
29
53
|
`;
|
|
30
54
|
|
|
31
|
-
export const
|
|
55
|
+
export const LiveFlagAndTimestampContainer = styled.div`
|
|
32
56
|
display: flex;
|
|
33
|
-
height: 24px;
|
|
34
|
-
padding: 2px 7px 1px 9px;
|
|
35
|
-
background-color: #9f0000;
|
|
36
57
|
align-items: center;
|
|
58
|
+
flex-direction: row;
|
|
37
59
|
`;
|
|
38
60
|
|
|
39
61
|
export const ArticleFlagBullet = styled.div`
|
|
@@ -43,14 +65,6 @@ export const ArticleFlagBullet = styled.div`
|
|
|
43
65
|
background-color: ${({ color }) => gqlRgbaToStyle(color) || color};
|
|
44
66
|
`;
|
|
45
67
|
|
|
46
|
-
export const LiveIconContainer = styled.div`
|
|
47
|
-
margin-right: 7px;
|
|
48
|
-
color: #ffffff;
|
|
49
|
-
font-size: 18px;
|
|
50
|
-
align-self: self-end;
|
|
51
|
-
animation: ${flashing} 2000ms infinite;
|
|
52
|
-
`;
|
|
53
|
-
|
|
54
68
|
export const ArticleFlagTextContainer = styled.div`
|
|
55
69
|
font-family: TimesDigitalW04-RegularSC;
|
|
56
70
|
font-size: 12px;
|
|
@@ -61,15 +75,6 @@ export const ArticleFlagTextContainer = styled.div`
|
|
|
61
75
|
color: ${({ color }) => gqlRgbaToStyle(color) || color};
|
|
62
76
|
`;
|
|
63
77
|
|
|
64
|
-
export const LiveArticleFlagText = styled.span`
|
|
65
|
-
font-family: ${fonts.supporting};
|
|
66
|
-
color: #ffffff;
|
|
67
|
-
font-weight: 500;
|
|
68
|
-
font-size: 12px;
|
|
69
|
-
letter-spacing: 0.1em;
|
|
70
|
-
line-height: 16px;
|
|
71
|
-
`;
|
|
72
|
-
|
|
73
78
|
export const FlagPadding = styled.div<{ allFlags: FlagType }>`
|
|
74
79
|
margin-right: ${({ allFlags }) => (allFlags.length > 1 ? '15px' : 0)};
|
|
75
80
|
`;
|
|
@@ -33,18 +33,26 @@ const ArticleHeader: React.FC<{
|
|
|
33
33
|
roundingMethod: 'floor'
|
|
34
34
|
}) + ' ago';
|
|
35
35
|
const diffInSeconds = differenceInSeconds(currentDateTime, updatedDate);
|
|
36
|
+
const anchorString = (updateTxt = '', headlineTxt = '') => {
|
|
37
|
+
const onlyNumbersReg = /\D+/g;
|
|
38
|
+
const onlyNumbers = updateTxt.replace(onlyNumbersReg, '');
|
|
39
|
+
const acronymReg = /\b(\w)/g;
|
|
40
|
+
const acronymMatch = headlineTxt.match(acronymReg);
|
|
41
|
+
const acronym = acronymMatch === null ? '' : acronymMatch.join('');
|
|
42
|
+
return `u_${onlyNumbers}${acronym}`;
|
|
43
|
+
};
|
|
36
44
|
|
|
37
45
|
const isLessThan1Minute = diffInSeconds < 60;
|
|
38
46
|
const isLessThan1Hour = diffInSeconds < 60 * 60;
|
|
39
47
|
const isLessThan13Hours = diffInSeconds < 60 * 60 * 13;
|
|
40
48
|
const isDaysAgo = differenceInCalendarDays(currentDateTime, updatedDate) >= 1;
|
|
41
|
-
|
|
49
|
+
const anchorPoint = anchorString(updated, headline);
|
|
42
50
|
const isBreaking = breaking
|
|
43
51
|
? Boolean(breaking.toLowerCase() === 'true')
|
|
44
52
|
: false;
|
|
45
53
|
|
|
46
54
|
return (
|
|
47
|
-
<Container isBreaking={isBreaking && isLessThan1Hour}>
|
|
55
|
+
<Container isBreaking={isBreaking && isLessThan1Hour} id={anchorPoint}>
|
|
48
56
|
<UpdatesContainer>
|
|
49
57
|
<UpdatedTimeItems>
|
|
50
58
|
{isBreaking && isLessThan1Hour ? (
|
|
@@ -5,6 +5,7 @@ exports[`ArticleHeader In one calendar day Within the first minute of update - B
|
|
|
5
5
|
<div>
|
|
6
6
|
<div
|
|
7
7
|
class="sc-bdVaJa cQBRMp"
|
|
8
|
+
id="u_20211231063000T222"
|
|
8
9
|
>
|
|
9
10
|
<div
|
|
10
11
|
class="sc-bwzfXH htoLMg"
|
|
@@ -16,23 +17,23 @@ exports[`ArticleHeader In one calendar day Within the first minute of update - B
|
|
|
16
17
|
class="sc-dnqmqq bGasAc"
|
|
17
18
|
>
|
|
18
19
|
<div
|
|
19
|
-
class="sc-
|
|
20
|
+
class="sc-fjdhpX Vdnui"
|
|
20
21
|
>
|
|
21
22
|
<div
|
|
22
|
-
class="sc-
|
|
23
|
+
class="sc-iwsKbI fqYeBv"
|
|
23
24
|
>
|
|
24
25
|
<div
|
|
25
|
-
class="sc-
|
|
26
|
+
class="sc-gqjmRU cTMoEm"
|
|
26
27
|
>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<span
|
|
31
|
-
class="sc-jzJRlG erbwEj"
|
|
32
|
-
>
|
|
33
|
-
BREAKING
|
|
34
|
-
</span>
|
|
28
|
+
<div
|
|
29
|
+
class="sc-VigVT rGeCL"
|
|
30
|
+
/>
|
|
35
31
|
</div>
|
|
32
|
+
<span
|
|
33
|
+
class="sc-gZMcBi iBeFrd"
|
|
34
|
+
>
|
|
35
|
+
BREAKING
|
|
36
|
+
</span>
|
|
36
37
|
</div>
|
|
37
38
|
</div>
|
|
38
39
|
</div>
|
|
@@ -59,6 +60,7 @@ exports[`ArticleHeader In one calendar day Within the first minute of update - N
|
|
|
59
60
|
<div>
|
|
60
61
|
<div
|
|
61
62
|
class="sc-bdVaJa fLcQHz"
|
|
63
|
+
id="u_20211231063000"
|
|
62
64
|
>
|
|
63
65
|
<div
|
|
64
66
|
class="sc-bwzfXH htoLMg"
|
|
@@ -84,6 +86,7 @@ exports[`ArticleHeader In one calendar day Within the first minute of update - N
|
|
|
84
86
|
<div>
|
|
85
87
|
<div
|
|
86
88
|
class="sc-bdVaJa fLcQHz"
|
|
89
|
+
id="u_20211231063000T222"
|
|
87
90
|
>
|
|
88
91
|
<div
|
|
89
92
|
class="sc-bwzfXH htoLMg"
|
|
@@ -36,7 +36,7 @@ exports[`GalleryCarousel should render the component 1`] = `
|
|
|
36
36
|
tabindex="0"
|
|
37
37
|
>
|
|
38
38
|
<div
|
|
39
|
-
class="sc-
|
|
39
|
+
class="sc-eHgmQL cjLcJm"
|
|
40
40
|
>
|
|
41
41
|
<img
|
|
42
42
|
src="https://www.thetimes.co.uk/imageserver/image/%2Fmethode%2Ftimes%2Fprod%2Fweb%2Fbin%2F46cebe30-c82d-11eb-b6f5-fed739e7c1ca.jpg?crop=6676%2C3755%2C65%2C707&resize=1180"
|
|
@@ -58,7 +58,7 @@ exports[`GalleryCarousel should render the component 1`] = `
|
|
|
58
58
|
tabindex="-1"
|
|
59
59
|
>
|
|
60
60
|
<div
|
|
61
|
-
class="sc-
|
|
61
|
+
class="sc-eHgmQL cjLcJm"
|
|
62
62
|
>
|
|
63
63
|
<img
|
|
64
64
|
src="https://www.thetimes.co.uk/imageserver/image/%2Fmethode%2Fsundaytimes%2Fprod%2Fweb%2Fbin%2F0f831cea-0317-11eb-910e-49261a8ea333.jpg?crop=2250%2C1500%2C0%2C0&resize=1500"
|
|
@@ -78,7 +78,7 @@ exports[`GalleryCarousel should render the component 1`] = `
|
|
|
78
78
|
class="sc-kAzzGY eTzlhe"
|
|
79
79
|
>
|
|
80
80
|
<div
|
|
81
|
-
class="sc-ckVGcZ
|
|
81
|
+
class="sc-ckVGcZ pKgO"
|
|
82
82
|
>
|
|
83
83
|
Label 1
|
|
84
84
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { breakpoints, fonts } from '@times-components/styleguide';
|
|
2
|
+
import { breakpoints, fonts, colours } from '@times-components/styleguide';
|
|
3
3
|
|
|
4
4
|
export const PlaceholderContainer = styled.div`
|
|
5
5
|
position: relative;
|
|
@@ -21,18 +21,77 @@ export const Label = styled.div<{ sectionColour: string }>`
|
|
|
21
21
|
line-height: 16px;
|
|
22
22
|
text-transform: uppercase;
|
|
23
23
|
color: ${({ sectionColour }) => `${sectionColour}`};
|
|
24
|
-
padding-bottom:
|
|
24
|
+
padding-bottom: 5px;
|
|
25
25
|
letter-spacing: 1px;
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
export const HiddenDiv = styled.div`
|
|
29
|
+
display: none;
|
|
30
|
+
`;
|
|
26
31
|
|
|
32
|
+
export const Copy = styled.div`
|
|
33
|
+
color: ${colours.functional.secondary};
|
|
34
|
+
font-family: ${fonts.body};
|
|
35
|
+
font-size: 16px;
|
|
36
|
+
line-height: 24px;
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
export const List = styled.ul`
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-wrap: wrap;
|
|
42
|
+
margin: 0 -2px -1px -15px;
|
|
43
|
+
list-style: none;
|
|
44
|
+
padding: 0;
|
|
27
45
|
@media (min-width: ${breakpoints.medium}px) {
|
|
28
|
-
padding-bottom: 6px;
|
|
29
46
|
}
|
|
47
|
+
`;
|
|
30
48
|
|
|
31
|
-
|
|
32
|
-
|
|
49
|
+
export const ListContainer = styled.div<{
|
|
50
|
+
showAll: boolean;
|
|
51
|
+
maxHeight: number;
|
|
52
|
+
displayShowAll: boolean;
|
|
53
|
+
}>`
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
max-height: ${({ showAll, maxHeight, displayShowAll }) =>
|
|
59
|
+
!showAll && displayShowAll ? maxHeight + 'px' : 'none'};
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
export const ShowAllContainer = styled.div<{
|
|
63
|
+
showAll: boolean;
|
|
64
|
+
displayShowAll: boolean;
|
|
65
|
+
}>`
|
|
66
|
+
display: flex;
|
|
67
|
+
border-top: 1px solid ${colours.functional.keyline};
|
|
68
|
+
padding: 5px;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
display: ${({ displayShowAll: displayShowAll }) =>
|
|
71
|
+
displayShowAll ? 'flex' : 'none'};
|
|
72
|
+
`;
|
|
73
|
+
|
|
74
|
+
export const Headline = styled.div`
|
|
75
|
+
font-family: ${fonts.headline};
|
|
76
|
+
font-size: 24px;
|
|
77
|
+
line-height: 24px;
|
|
78
|
+
color: ${colours.functional.brandColour};
|
|
79
|
+
margin: 0 0 6px;
|
|
80
|
+
@media (min-width: ${breakpoints.medium}px) {
|
|
81
|
+
font-size: 32px;
|
|
82
|
+
line-height: 32px;
|
|
33
83
|
}
|
|
34
84
|
`;
|
|
35
85
|
|
|
36
|
-
export const
|
|
37
|
-
|
|
86
|
+
export const ShowAllButton = styled.button`
|
|
87
|
+
font-family: ${fonts.supporting};
|
|
88
|
+
font-weight: 500;
|
|
89
|
+
line-height: 20px;
|
|
90
|
+
border: 1px solid ${colours.functional.primary};
|
|
91
|
+
background: transparent;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
&:active {
|
|
94
|
+
border: 1px solid ${colours.functional.action};
|
|
95
|
+
color: ${colours.functional.action};
|
|
96
|
+
}
|
|
38
97
|
`;
|
|
@@ -9,16 +9,19 @@ import { sanitiseCopy } from '../../helpers/text-formatting/SanitiseCopy';
|
|
|
9
9
|
import {
|
|
10
10
|
Container,
|
|
11
11
|
ContentContainer,
|
|
12
|
+
ListItem,
|
|
13
|
+
NumberContainer,
|
|
14
|
+
StyledShowAllButton
|
|
15
|
+
} from './styles';
|
|
16
|
+
import {
|
|
17
|
+
PlaceholderContainer,
|
|
18
|
+
Label,
|
|
12
19
|
Headline,
|
|
13
20
|
ListContainer,
|
|
14
21
|
List,
|
|
15
|
-
ListItem,
|
|
16
|
-
NumberContainer,
|
|
17
22
|
Copy,
|
|
18
|
-
ShowAllContainer
|
|
19
|
-
|
|
20
|
-
} from './styles';
|
|
21
|
-
import { PlaceholderContainer, Label } from '../common-styles';
|
|
23
|
+
ShowAllContainer
|
|
24
|
+
} from '../common-styles';
|
|
22
25
|
import { isStandard, isWide } from '../../helpers/layout-size/layoutSize';
|
|
23
26
|
import { DeckData } from '../../helpers/fetch/types';
|
|
24
27
|
|
|
@@ -135,7 +138,7 @@ export const BigNumbers: React.FC<{
|
|
|
135
138
|
</ListContainer>
|
|
136
139
|
</ContentContainer>
|
|
137
140
|
<ShowAllContainer showAll={showAll} displayShowAll={displayShowAll}>
|
|
138
|
-
<
|
|
141
|
+
<StyledShowAllButton
|
|
139
142
|
onClick={() =>
|
|
140
143
|
handleShowAll(
|
|
141
144
|
fireAnalyticsEvent,
|
|
@@ -144,7 +147,7 @@ export const BigNumbers: React.FC<{
|
|
|
144
147
|
}
|
|
145
148
|
>
|
|
146
149
|
{showAll ? 'Collapse' : 'Show all'}
|
|
147
|
-
</
|
|
150
|
+
</StyledShowAllButton>
|
|
148
151
|
</ShowAllContainer>
|
|
149
152
|
</Container>
|
|
150
153
|
)}
|