@times-components/ts-components 1.35.1 → 1.35.2
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/article-flag/ArticleFlag.js +2 -2
- package/dist/components/article-flag/styles.js +2 -2
- package/dist/components/article-header/styles.js +2 -2
- package/dist/components/carousel/styles.js +2 -2
- package/dist/components/common-styles.js +2 -2
- package/dist/components/in-article-big-numbers/styles.js +2 -2
- package/dist/components/in-article-info-card/InfoCard.js +2 -2
- package/dist/components/in-article-info-card/styles.js +2 -2
- package/dist/components/in-article-info-card-bulletpoints/InfoCardBulletPoints.js +2 -2
- package/dist/components/in-article-info-card-bulletpoints/styles.js +2 -2
- package/dist/components/in-article-link/styles.js +2 -2
- package/dist/components/in-article-puff/styles.js +2 -2
- package/dist/components/in-article-related-articles/InArticleRelatedArticles.stories.js +3 -2
- package/dist/components/in-article-related-articles/SingleRelatedArticle.styles.js +2 -2
- package/dist/components/in-article-related-articles/styles.js +2 -2
- package/dist/components/in-article-timelines/styles.js +2 -2
- package/dist/components/inline-dialog/styles.js +2 -2
- package/dist/components/inline-message/styles.js +2 -2
- package/dist/components/newsletter-puff/NewsletterPuffLink.js +2 -2
- package/dist/components/newsletter-puff/styles.js +2 -2
- package/dist/components/olympics/medal-table/styles.js +3 -3
- package/dist/components/olympics/schedule/styles.js +2 -2
- package/dist/components/olympics/shared-styles.js +2 -2
- package/dist/components/opta/football/fixtures/styles.js +2 -2
- package/dist/components/opta/football/match-stats/styles.js +2 -2
- package/dist/components/opta/football/shared-styles.js +2 -2
- package/dist/components/opta/football/standings/styles.js +2 -2
- package/dist/components/opta/football/summary/styles.js +2 -2
- package/dist/components/opta/rugby/fixtures/styles.js +2 -2
- package/dist/components/opta/rugby/match-stats/styles.js +2 -2
- package/dist/components/opta/rugby/shared-styles.js +2 -2
- package/dist/components/opta/rugby/standings/styles.js +2 -2
- package/dist/components/opta/rugby/summary/styles.js +2 -2
- package/dist/components/related-article-slice/styles.js +2 -2
- package/dist/components/updated-timestamp/styles.js +2 -2
- package/dist/fixtures/article-harness/styles.js +2 -2
- package/package.json +12 -12
- package/rnw.js +1 -1
- package/src/components/article-flag/ArticleFlag.tsx +1 -1
- package/src/components/article-flag/styles.ts +1 -1
- package/src/components/article-header/styles.ts +1 -1
- package/src/components/carousel/styles.ts +1 -1
- package/src/components/common-styles.ts +1 -1
- package/src/components/in-article-big-numbers/styles.ts +1 -1
- package/src/components/in-article-info-card/InfoCard.tsx +1 -1
- package/src/components/in-article-info-card/styles.ts +1 -1
- package/src/components/in-article-info-card-bulletpoints/InfoCardBulletPoints.tsx +1 -1
- package/src/components/in-article-info-card-bulletpoints/styles.ts +1 -1
- package/src/components/in-article-link/styles.ts +1 -1
- package/src/components/in-article-puff/styles.ts +1 -1
- package/src/components/in-article-related-articles/InArticleRelatedArticles.stories.tsx +2 -1
- package/src/components/in-article-related-articles/SingleRelatedArticle.styles.ts +1 -1
- package/src/components/in-article-related-articles/styles.ts +1 -1
- package/src/components/in-article-timelines/styles.ts +1 -1
- package/src/components/inline-dialog/styles.ts +1 -1
- package/src/components/inline-message/styles.ts +1 -1
- package/src/components/newsletter-puff/NewsletterPuffLink.tsx +1 -1
- package/src/components/newsletter-puff/styles.ts +1 -1
- package/src/components/olympics/__tests__/__snapshots__/OlympicsMedalTable.test.tsx.snap +4 -0
- package/src/components/olympics/medal-table/styles.ts +2 -2
- package/src/components/olympics/schedule/styles.ts +1 -1
- package/src/components/olympics/shared-styles.ts +1 -1
- package/src/components/opta/football/fixtures/styles.ts +1 -1
- package/src/components/opta/football/match-stats/styles.ts +1 -1
- package/src/components/opta/football/shared-styles.ts +1 -1
- package/src/components/opta/football/standings/styles.ts +1 -1
- package/src/components/opta/football/summary/styles.ts +1 -1
- package/src/components/opta/rugby/fixtures/styles.ts +1 -1
- package/src/components/opta/rugby/match-stats/styles.ts +1 -1
- package/src/components/opta/rugby/shared-styles.ts +1 -1
- package/src/components/opta/rugby/standings/styles.ts +1 -1
- package/src/components/opta/rugby/summary/styles.ts +1 -1
- package/src/components/related-article-slice/styles.ts +1 -1
- package/src/components/updated-timestamp/styles.ts +1 -1
- package/src/fixtures/article-harness/styles.ts +1 -1
- package/src/types/externs.d.ts +69 -39
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { keyframes } from 'styled-components';
|
|
2
|
-
import { fonts } from '@times-components/styleguide';
|
|
2
|
+
import { fonts } from '@times-components/ts-styleguide';
|
|
3
3
|
import { FlagType } from './ArticleFlag';
|
|
4
4
|
import { gqlRgbaToStyle } from '@times-components/utils';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { breakpoints, colours, fonts } from '@times-components/styleguide';
|
|
2
|
+
import { breakpoints, colours, fonts } from '@times-components/ts-styleguide';
|
|
3
3
|
|
|
4
4
|
export const Container = styled.div<{ isBreaking: boolean }>`
|
|
5
5
|
display: flex;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { fonts, colours, breakpoints } from '@times-components/styleguide';
|
|
2
|
+
import { fonts, colours, breakpoints } from '@times-components/ts-styleguide';
|
|
3
3
|
import ReactElasticCarousel from 'react-elastic-carousel';
|
|
4
4
|
|
|
5
5
|
export const Headline = styled.div<{ isWide: boolean }>`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { breakpoints, fonts, colours } from '@times-components/styleguide';
|
|
2
|
+
import { breakpoints, fonts, colours } from '@times-components/ts-styleguide';
|
|
3
3
|
|
|
4
4
|
export const PlaceholderContainer = styled.div`
|
|
5
5
|
position: relative;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { breakpoints, colours, fonts } from '@times-components/styleguide';
|
|
2
|
+
import { breakpoints, colours, fonts } from '@times-components/ts-styleguide';
|
|
3
3
|
import { ShowAllButton } from '../common-styles';
|
|
4
4
|
|
|
5
5
|
export const Container = styled.div<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { Placeholder } from '@times-components/image';
|
|
3
|
-
import { breakpoints } from '@times-components/styleguide';
|
|
3
|
+
import { breakpoints } from '@times-components/ts-styleguide';
|
|
4
4
|
import { Card } from './Card';
|
|
5
5
|
import {
|
|
6
6
|
InfoCardContainer,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { fonts, colours, breakpoints } from '@times-components/styleguide';
|
|
2
|
+
import { fonts, colours, breakpoints } from '@times-components/ts-styleguide';
|
|
3
3
|
import ReactElasticCarousel from 'react-elastic-carousel';
|
|
4
4
|
|
|
5
5
|
export const Headline = styled.div`
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
TrackingContextProvider
|
|
7
7
|
} from '../../helpers/tracking/TrackingContextProvider';
|
|
8
8
|
import { sanitiseCopy } from '../../helpers/text-formatting/SanitiseCopy';
|
|
9
|
-
import { breakpoints } from '@times-components/styleguide';
|
|
9
|
+
import { breakpoints } from '@times-components/ts-styleguide';
|
|
10
10
|
import {
|
|
11
11
|
Container,
|
|
12
12
|
ContentContainer,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { breakpoints, colours, fonts } from '@times-components/styleguide';
|
|
2
|
+
import { breakpoints, colours, fonts } from '@times-components/ts-styleguide';
|
|
3
3
|
|
|
4
4
|
export const Container = styled.div<{ sectionColour: string }>`
|
|
5
5
|
margin: 0 auto 20px auto;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { breakpoints, colours, fonts } from '@times-components/styleguide';
|
|
2
|
+
import { breakpoints, colours, fonts } from '@times-components/ts-styleguide';
|
|
3
3
|
|
|
4
4
|
export const Container = styled.div<{ sectionColour: string }>`
|
|
5
5
|
display: flex;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { storiesOf } from '@storybook/react';
|
|
4
4
|
import { boolean, select } from '@storybook/addon-knobs';
|
|
5
|
-
import { colours } from '@times-components/styleguide';
|
|
5
|
+
import { colours } from '@times-components/ts-styleguide';
|
|
6
6
|
|
|
7
7
|
import { InArticleRelatedArticles } from './InArticleRelatedArticles';
|
|
8
8
|
|
|
@@ -63,6 +63,7 @@ storiesOf('Typescript Component/In Article/Related Articles', module)
|
|
|
63
63
|
{ Three: 3, Two: 2, One: 1 },
|
|
64
64
|
3
|
|
65
65
|
);
|
|
66
|
+
// @ts-ignore
|
|
66
67
|
const sectionColor = select('Section', colours.section, '#636C17');
|
|
67
68
|
return (
|
|
68
69
|
<InArticleRelatedArticles
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { breakpoints, colours, fonts } from '@times-components/styleguide';
|
|
2
|
+
import { breakpoints, colours, fonts } from '@times-components/ts-styleguide';
|
|
3
3
|
|
|
4
4
|
export const SingleRelatedArticleContainer = styled.div`
|
|
5
5
|
display: flex;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { breakpoints, fonts, colours } from '@times-components/styleguide';
|
|
2
|
+
import { breakpoints, fonts, colours } from '@times-components/ts-styleguide';
|
|
3
3
|
|
|
4
4
|
export const Container = styled.div<{ sectionColour: string }>`
|
|
5
5
|
display: flex;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { breakpoints, colours, fonts } from '@times-components/styleguide';
|
|
2
|
+
import { breakpoints, colours, fonts } from '@times-components/ts-styleguide';
|
|
3
3
|
import { ShowAllButton } from '../common-styles';
|
|
4
4
|
|
|
5
5
|
export const Container = styled.div<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Link from '@times-components/link';
|
|
3
3
|
import { IconForwardArrow } from '@times-components/icons';
|
|
4
|
-
import { colours } from '@times-components/styleguide';
|
|
4
|
+
import { colours } from '@times-components/ts-styleguide';
|
|
5
5
|
|
|
6
6
|
import { TrackingContextProvider } from '../../helpers/tracking/TrackingContextProvider';
|
|
7
7
|
|
|
@@ -52,6 +52,7 @@ exports[`<OlympicsMedalTable> click show all 1`] = `
|
|
|
52
52
|
|
|
53
53
|
.c0 .pa-medaltable .pa_MedalTableView_medaltable {
|
|
54
54
|
font-size: 16px;
|
|
55
|
+
color: #1D1D1B;
|
|
55
56
|
font-family: TimesModern-Bold;
|
|
56
57
|
background-color: #F9F9F9;
|
|
57
58
|
padding-bottom: 60px;
|
|
@@ -233,6 +234,7 @@ exports[`<OlympicsMedalTable> renders 1`] = `
|
|
|
233
234
|
|
|
234
235
|
.c0 .pa-medaltable .pa_MedalTableView_medaltable {
|
|
235
236
|
font-size: 16px;
|
|
237
|
+
color: #1D1D1B;
|
|
236
238
|
font-family: TimesModern-Bold;
|
|
237
239
|
background-color: #F9F9F9;
|
|
238
240
|
padding-bottom: 60px;
|
|
@@ -414,6 +416,7 @@ exports[`<OlympicsMedalTable> renders default keys 1`] = `
|
|
|
414
416
|
|
|
415
417
|
.c0 .pa-medaltable .pa_MedalTableView_medaltable {
|
|
416
418
|
font-size: 16px;
|
|
419
|
+
color: #1D1D1B;
|
|
417
420
|
font-family: TimesModern-Bold;
|
|
418
421
|
background-color: #F9F9F9;
|
|
419
422
|
padding-bottom: 60px;
|
|
@@ -595,6 +598,7 @@ exports[`<OlympicsMedalTable> renders outside of article 1`] = `
|
|
|
595
598
|
|
|
596
599
|
.c0 .pa-medaltable .pa_MedalTableView_medaltable {
|
|
597
600
|
font-size: 16px;
|
|
601
|
+
color: #1D1D1B;
|
|
598
602
|
font-family: TimesModern-Bold;
|
|
599
603
|
background-color: #F9F9F9;
|
|
600
604
|
padding-bottom: 60px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { breakpoints, colours, fonts } from '@times-components/styleguide';
|
|
2
|
+
import { breakpoints, colours, fonts } from '@times-components/ts-styleguide';
|
|
3
3
|
import { olympicColour } from '../shared-styles';
|
|
4
4
|
|
|
5
5
|
const highlightColour = '#e4e4e4';
|
|
@@ -22,7 +22,7 @@ export const Container = styled.div<{
|
|
|
22
22
|
.pa-medaltable {
|
|
23
23
|
.pa_MedalTableView_medaltable {
|
|
24
24
|
font-size: 16px;
|
|
25
|
-
color: ${
|
|
25
|
+
color: ${colours.functional.brandColour};
|
|
26
26
|
font-family: ${fonts.headline};
|
|
27
27
|
background-color: ${colours.functional.backgroundPrimary};
|
|
28
28
|
padding-bottom: 60px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { breakpoints, colours, fonts } from '@times-components/styleguide';
|
|
2
|
+
import { breakpoints, colours, fonts } from '@times-components/ts-styleguide';
|
|
3
3
|
import { olympicColour } from '../shared-styles';
|
|
4
4
|
|
|
5
5
|
export const Container = styled.div<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { breakpoints, colours, fonts } from '@times-components/styleguide';
|
|
2
|
+
import { breakpoints, colours, fonts } from '@times-components/ts-styleguide';
|
|
3
3
|
|
|
4
4
|
export const Container = styled.div<{ border: boolean; fullWidth?: boolean }>`
|
|
5
5
|
margin: 0 auto 20px auto;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { breakpoints, colours, fonts } from '@times-components/styleguide';
|
|
2
|
+
import { breakpoints, colours, fonts } from '@times-components/ts-styleguide';
|
|
3
3
|
|
|
4
4
|
export const Container = styled.div<{ border: boolean; fullWidth?: boolean }>`
|
|
5
5
|
margin: 0 auto 20px auto;
|
package/src/types/externs.d.ts
CHANGED
|
@@ -19,48 +19,37 @@ declare module '@times-components/tracking' {
|
|
|
19
19
|
export function withTrackEvents<T>(component: FC<T>, attr: any): FC<T>;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
declare module '@times-components/
|
|
23
|
-
|
|
24
|
-
type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
declare module '@times-components/ts-slices' {
|
|
23
|
+
export const Slice = React.FC;
|
|
24
|
+
export type SliceArticle = {
|
|
25
|
+
id?: string;
|
|
26
|
+
url?: string;
|
|
27
|
+
label?: string;
|
|
28
|
+
byline?: string;
|
|
29
|
+
headline: string;
|
|
30
|
+
standfirst?: string;
|
|
31
|
+
summary?: string;
|
|
32
|
+
cta?: string;
|
|
33
|
+
datePublished?: string;
|
|
34
|
+
dateUpdated?: string;
|
|
35
|
+
template?: string;
|
|
36
|
+
images: {
|
|
37
|
+
alt?: string;
|
|
38
|
+
crops: Array<{
|
|
39
|
+
url: string;
|
|
40
|
+
ratio: string;
|
|
41
|
+
}>;
|
|
42
|
+
};
|
|
28
43
|
};
|
|
29
|
-
export
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export const Placeholder: FC;
|
|
37
|
-
const Image: FC<{
|
|
38
|
-
aspectRatio: number;
|
|
39
|
-
uri: string;
|
|
40
|
-
}>;
|
|
41
|
-
export default Image;
|
|
44
|
+
export type ClickHandlerType = (
|
|
45
|
+
event: MouseEventType,
|
|
46
|
+
article: SliceArticle,
|
|
47
|
+
position?: string
|
|
48
|
+
) => void;
|
|
49
|
+
export type MouseEventType = React.MouseEvent<HTMLAnchorElement, MouseEvent>;
|
|
42
50
|
}
|
|
43
51
|
|
|
44
|
-
declare module '@times-components/
|
|
45
|
-
export const delay: (ms: number) => Promise<never>;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
declare module '@times-components/utils' {
|
|
49
|
-
type appendToImageURL = (
|
|
50
|
-
url: string,
|
|
51
|
-
key: string,
|
|
52
|
-
value: string | number
|
|
53
|
-
) => string;
|
|
54
|
-
|
|
55
|
-
export const TcView: React.FC<{ style?: React.CSSProperties }>;
|
|
56
|
-
export const TcText: React.FC<{ style?: React.CSSProperties }>;
|
|
57
|
-
export const TcScrollView: React.FC<{ style?: React.CSSProperties }>;
|
|
58
|
-
export const capitalise: (s: string) => string;
|
|
59
|
-
export const stripTags: (input: string, replaceWith: string) => string;
|
|
60
|
-
export const gqlRgbaToStyle: (colour: string | undefined) => string | null;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
declare module '@times-components/styleguide' {
|
|
52
|
+
declare module '@times-components/ts-styleguide' {
|
|
64
53
|
type ColourMap = Record<string, string>;
|
|
65
54
|
type Colours = Record<string, ColourMap>;
|
|
66
55
|
|
|
@@ -112,6 +101,47 @@ declare module '@times-components/styleguide' {
|
|
|
112
101
|
export default styleguide;
|
|
113
102
|
}
|
|
114
103
|
|
|
104
|
+
declare module '@times-components/icons' {
|
|
105
|
+
import { FC } from 'react';
|
|
106
|
+
type IconProps = {
|
|
107
|
+
fillColour: string | null;
|
|
108
|
+
height?: number;
|
|
109
|
+
width?: number;
|
|
110
|
+
};
|
|
111
|
+
export const IconForwardChevron: FC<IconProps>;
|
|
112
|
+
export const IconForwardArrow: FC<IconProps>;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
declare module '@times-components/image' {
|
|
116
|
+
import { FC } from 'react';
|
|
117
|
+
|
|
118
|
+
export const Placeholder: FC;
|
|
119
|
+
const Image: FC<{
|
|
120
|
+
aspectRatio: number;
|
|
121
|
+
uri: string;
|
|
122
|
+
}>;
|
|
123
|
+
export default Image;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
declare module '@times-components/test-utils' {
|
|
127
|
+
export const delay: (ms: number) => Promise<never>;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
declare module '@times-components/utils' {
|
|
131
|
+
type appendToImageURL = (
|
|
132
|
+
url: string,
|
|
133
|
+
key: string,
|
|
134
|
+
value: string | number
|
|
135
|
+
) => string;
|
|
136
|
+
|
|
137
|
+
export const TcView: React.FC<{ style?: React.CSSProperties }>;
|
|
138
|
+
export const TcText: React.FC<{ style?: React.CSSProperties }>;
|
|
139
|
+
export const TcScrollView: React.FC<{ style?: React.CSSProperties }>;
|
|
140
|
+
export const capitalise: (s: string) => string;
|
|
141
|
+
export const stripTags: (input: string, replaceWith: string) => string;
|
|
142
|
+
export const gqlRgbaToStyle: (colour: string | undefined) => string | null;
|
|
143
|
+
}
|
|
144
|
+
|
|
115
145
|
declare module '@times-components/button' {
|
|
116
146
|
import { FC } from 'react';
|
|
117
147
|
|