@times-components/ts-components 1.25.0 → 1.25.1
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 +8 -0
- 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/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/package.json +3 -3
- package/rnw.js +1 -1
- 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/index.ts +1 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { breakpoints, colours, fonts } from '@times-components/styleguide';
|
|
3
|
+
import { ShowAllButton } from '../common-styles';
|
|
4
|
+
|
|
5
|
+
export const Container = styled.div<{
|
|
6
|
+
sectionColour: string;
|
|
7
|
+
}>`
|
|
8
|
+
margin: 0 auto 20px auto;
|
|
9
|
+
padding: 20px 0 0;
|
|
10
|
+
background-color: ${colours.functional.backgroundPrimary};
|
|
11
|
+
border-top: ${({ sectionColour }) => `2px solid ${sectionColour}`};
|
|
12
|
+
width: 100%;
|
|
13
|
+
|
|
14
|
+
@media (min-width: ${breakpoints.medium}px) {
|
|
15
|
+
width: 80.8%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@media (min-width: ${breakpoints.wide}px) {
|
|
19
|
+
width: 56.2%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
a {
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const ContentContainer = styled.div`
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
padding: 0 16px;
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
export const StyledShowAllButton = styled(ShowAllButton)`
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
margin: 11px 0;
|
|
37
|
+
padding: 12px 15px 10px;
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
export const ListItem = styled.li`
|
|
41
|
+
padding: 12px 0 13px;
|
|
42
|
+
width: 100%;
|
|
43
|
+
position: relative;
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
export const LeftPanel = styled.div<{
|
|
47
|
+
sectionColour: string;
|
|
48
|
+
circularImage: string;
|
|
49
|
+
}>`
|
|
50
|
+
display: table;
|
|
51
|
+
float: left;
|
|
52
|
+
width: ${({ circularImage }) => (circularImage ? '80px' : '40px')};
|
|
53
|
+
text-align: center;
|
|
54
|
+
padding-right: ${({ circularImage }) => (circularImage ? '16px' : '24px')};
|
|
55
|
+
height: 100%;
|
|
56
|
+
|
|
57
|
+
& img {
|
|
58
|
+
border-radius: 100%;
|
|
59
|
+
height: 50px;
|
|
60
|
+
width: 50px;
|
|
61
|
+
position: relative;
|
|
62
|
+
margin-left: 16px;
|
|
63
|
+
z-index: 2;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
& :before {
|
|
67
|
+
content: '';
|
|
68
|
+
background: ${({ sectionColour }) => `${sectionColour}`};
|
|
69
|
+
position: relative;
|
|
70
|
+
top: 0px;
|
|
71
|
+
left: 15px;
|
|
72
|
+
width: 8px;
|
|
73
|
+
height: 8px;
|
|
74
|
+
border-radius: 100%;
|
|
75
|
+
z-index: 1;
|
|
76
|
+
display: ${({ circularImage }) => (circularImage ? 'none' : 'block')};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
& :after {
|
|
80
|
+
content: '';
|
|
81
|
+
border-right: 1px solid #ccc;
|
|
82
|
+
height: 100%;
|
|
83
|
+
display: block;
|
|
84
|
+
position: absolute;
|
|
85
|
+
top: ${({ circularImage }) => (circularImage ? '60px' : '20px')};
|
|
86
|
+
left: ${({ circularImage }) => (circularImage ? '42px' : '19px')};
|
|
87
|
+
z-index: 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@media (min-width: ${breakpoints.medium}px) {
|
|
91
|
+
width: ${({ circularImage }) => (circularImage ? '100px' : '39px')};
|
|
92
|
+
padding-right: ${({ circularImage }) => (circularImage ? '16px' : '24px')};
|
|
93
|
+
& img {
|
|
94
|
+
height: 76px;
|
|
95
|
+
width: 76px;
|
|
96
|
+
}
|
|
97
|
+
& :after {
|
|
98
|
+
top: ${({ circularImage }) => (circularImage ? '74px' : '20px')};
|
|
99
|
+
left: ${({ circularImage }) => (circularImage ? '52px' : '19px')};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
103
|
+
|
|
104
|
+
export const RightPanel = styled.div`
|
|
105
|
+
display: grid;
|
|
106
|
+
`;
|
|
107
|
+
|
|
108
|
+
export const Date = styled.div<{ sectionColour: string }>`
|
|
109
|
+
font-family: ${fonts.supporting};
|
|
110
|
+
text-transform: uppercase;
|
|
111
|
+
font-size: 12px;
|
|
112
|
+
line-height: 16px;
|
|
113
|
+
margin-bottom: 8px;
|
|
114
|
+
color: ${({ sectionColour }) => `${sectionColour}`};
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
export const SubHeading = styled.div`
|
|
118
|
+
font-size: 20px;
|
|
119
|
+
line-height: 20px;
|
|
120
|
+
color: ${colours.functional.brandColour};
|
|
121
|
+
font-family: ${fonts.headline};
|
|
122
|
+
margin-bottom: 6px;
|
|
123
|
+
@media (min-width: ${breakpoints.medium}px) {
|
|
124
|
+
font-size: 24px;
|
|
125
|
+
line-height: 24px;
|
|
126
|
+
}
|
|
127
|
+
`;
|