@times-components/ts-components 1.35.1 → 1.35.4
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 +24 -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/dist/index.d.ts +0 -1
- package/dist/index.js +1 -3
- package/package.json +13 -13
- 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/index.ts +0 -22
- package/src/types/externs.d.ts +69 -39
- package/dist/components/styleguide/Styleguide.d.ts +0 -193
- package/dist/components/styleguide/Styleguide.js +0 -24
- package/dist/components/styleguide/__tests__/breakpoints.test.d.ts +0 -1
- package/dist/components/styleguide/__tests__/breakpoints.test.js +0 -46
- package/dist/components/styleguide/__tests__/styleguide.test.d.ts +0 -1
- package/dist/components/styleguide/__tests__/styleguide.test.js +0 -48
- package/dist/components/styleguide/__tests__/themeFactory.test.d.ts +0 -1
- package/dist/components/styleguide/__tests__/themeFactory.test.js +0 -41
- package/dist/components/styleguide/breakpoints.d.ts +0 -37
- package/dist/components/styleguide/breakpoints.js +0 -42
- package/dist/components/styleguide/colours/colours.d.ts +0 -103
- package/dist/components/styleguide/colours/colours.js +0 -8
- package/dist/components/styleguide/colours/functional.d.ts +0 -32
- package/dist/components/styleguide/colours/functional.js +0 -33
- package/dist/components/styleguide/colours/section.d.ts +0 -68
- package/dist/components/styleguide/colours/section.js +0 -78
- package/dist/components/styleguide/components/Animations.d.ts +0 -6
- package/dist/components/styleguide/components/Animations.js +0 -19
- package/dist/components/styleguide/components/TcText.d.ts +0 -6
- package/dist/components/styleguide/components/TcText.js +0 -22
- package/dist/components/styleguide/components/TcView.d.ts +0 -6
- package/dist/components/styleguide/components/TcView.js +0 -21
- package/dist/components/styleguide/components/index.d.ts +0 -4
- package/dist/components/styleguide/components/index.js +0 -5
- package/dist/components/styleguide/fonts/font-factory.d.ts +0 -10
- package/dist/components/styleguide/fonts/font-factory.js +0 -12
- package/dist/components/styleguide/fonts/font-sizes.d.ts +0 -47
- package/dist/components/styleguide/fonts/font-sizes.js +0 -47
- package/dist/components/styleguide/fonts/font-styles.d.ts +0 -13
- package/dist/components/styleguide/fonts/font-styles.js +0 -13
- package/dist/components/styleguide/fonts/fonts.d.ts +0 -4
- package/dist/components/styleguide/fonts/fonts.js +0 -5
- package/dist/components/styleguide/helpers/storybookStyles.d.ts +0 -2
- package/dist/components/styleguide/helpers/storybookStyles.js +0 -54
- package/dist/components/styleguide/lineHeight.d.ts +0 -7
- package/dist/components/styleguide/lineHeight.js +0 -65
- package/dist/components/styleguide/scales.d.ts +0 -6
- package/dist/components/styleguide/scales.js +0 -6
- package/dist/components/styleguide/spacing.d.ts +0 -11
- package/dist/components/styleguide/spacing.js +0 -17
- package/dist/components/styleguide/styleguide.stories.d.ts +0 -1
- package/dist/components/styleguide/styleguide.stories.js +0 -71
- package/dist/components/styleguide/themeFactory.d.ts +0 -8
- package/dist/components/styleguide/themeFactory.js +0 -59
- package/src/components/styleguide/Styleguide.tsx +0 -54
- package/src/components/styleguide/__tests__/breakpoints.test.ts +0 -67
- package/src/components/styleguide/__tests__/styleguide.test.tsx +0 -68
- package/src/components/styleguide/__tests__/themeFactory.test.ts +0 -44
- package/src/components/styleguide/breakpoints.tsx +0 -52
- package/src/components/styleguide/colours/colours.tsx +0 -8
- package/src/components/styleguide/colours/functional.tsx +0 -32
- package/src/components/styleguide/colours/section.tsx +0 -81
- package/src/components/styleguide/components/Animations.tsx +0 -22
- package/src/components/styleguide/components/TcText.tsx +0 -32
- package/src/components/styleguide/components/TcView.tsx +0 -27
- package/src/components/styleguide/components/index.tsx +0 -5
- package/src/components/styleguide/fonts/font-factory.tsx +0 -18
- package/src/components/styleguide/fonts/font-sizes.tsx +0 -46
- package/src/components/styleguide/fonts/font-styles.tsx +0 -12
- package/src/components/styleguide/fonts/fonts.tsx +0 -5
- package/src/components/styleguide/helpers/storybookStyles.ts +0 -55
- package/src/components/styleguide/lineHeight.tsx +0 -73
- package/src/components/styleguide/scales.tsx +0 -5
- package/src/components/styleguide/spacing.tsx +0 -19
- package/src/components/styleguide/styleguide.stories.tsx +0 -143
- package/src/components/styleguide/themeFactory.tsx +0 -82
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
import { TcScrollView } from '@times-components/utils';
|
|
4
|
-
import { TcText, TcView } from './components';
|
|
5
|
-
import timesStyleguide, { Animations, colours, fonts } from './Styleguide';
|
|
6
|
-
import styles from './helpers/storybookStyles';
|
|
7
|
-
const getStories = (colourMap) => {
|
|
8
|
-
const colourBoxes = Object.keys(colourMap).map(colourName => (React.createElement(TcView, { style: styles.container },
|
|
9
|
-
React.createElement(TcView, { style: { ...styles.box, backgroundColor: colourMap[colourName] } }),
|
|
10
|
-
React.createElement(TcText, { style: styles.text },
|
|
11
|
-
colourName,
|
|
12
|
-
" - ",
|
|
13
|
-
colourMap[colourName]))));
|
|
14
|
-
return React.createElement(TcView, { style: styles.display }, colourBoxes);
|
|
15
|
-
};
|
|
16
|
-
const fontDisplayer = (fontFamily, phrase, fontSizes) => Object.keys(fontSizes).map(fontSize => (React.createElement(Fragment, { key: fontSize },
|
|
17
|
-
React.createElement(TcText, { style: styles.subHeadline }, fontSize),
|
|
18
|
-
React.createElement(TcText, { style: {
|
|
19
|
-
...styles.showoffFonts,
|
|
20
|
-
fontFamily,
|
|
21
|
-
fontSize: fontSizes[fontSize]
|
|
22
|
-
} }, phrase))));
|
|
23
|
-
const fontFixture = () => {
|
|
24
|
-
const styleguide = timesStyleguide();
|
|
25
|
-
const phrase = 'The Quick Brown Fox Jumps Over the Lazy Dog';
|
|
26
|
-
return (React.createElement(TcScrollView, null,
|
|
27
|
-
React.createElement(TcView, { style: styles.showoffFontsContainer },
|
|
28
|
-
React.createElement(TcText, { style: styles.headline }, "Body"),
|
|
29
|
-
fontDisplayer(fonts.body, phrase, styleguide.fontSizes)),
|
|
30
|
-
React.createElement(TcView, { style: styles.showoffFontsContainer },
|
|
31
|
-
React.createElement(TcText, { style: styles.headline }, "Body Regular"),
|
|
32
|
-
React.createElement(TcText, null, "Used for the body copy of articles or as the teaser copy on article links."),
|
|
33
|
-
fontDisplayer(fonts.bodyRegular, phrase, styleguide.fontSizes)),
|
|
34
|
-
React.createElement(TcView, { style: styles.showoffFontsContainer },
|
|
35
|
-
React.createElement(TcText, { style: styles.headline }, "Body Regular Small Caps"),
|
|
36
|
-
React.createElement(TcText, null, "Always used as a lowercase font, it is typically used to support the headline font. It\u2019s used in various different places e.g. Journalist pages for the Journalist job title, article flags and show more buttons on the homepage."),
|
|
37
|
-
fontDisplayer(fonts.bodyRegularSmallCaps, phrase.toLowerCase(), styleguide.fontSizes)),
|
|
38
|
-
React.createElement(TcView, { style: styles.showoffFontsContainer },
|
|
39
|
-
React.createElement(TcText, { style: styles.headline }, "Headline"),
|
|
40
|
-
React.createElement(TcText, null, "Used as the headline for components and articles across the site."),
|
|
41
|
-
fontDisplayer(fonts.headline, phrase, styleguide.fontSizes)),
|
|
42
|
-
React.createElement(TcView, { style: styles.showoffFontsContainer },
|
|
43
|
-
React.createElement(TcText, { style: styles.headline }, "Headline Regular"),
|
|
44
|
-
React.createElement(TcText, null, "Used primarily to style subheadings for components and stand firsts on the homepage and articles."),
|
|
45
|
-
fontDisplayer(fonts.headlineRegular, phrase, styleguide.fontSizes)),
|
|
46
|
-
React.createElement(TcView, { style: styles.showoffFontsContainer },
|
|
47
|
-
React.createElement(TcText, { style: styles.headline }, "Supporting"),
|
|
48
|
-
React.createElement(TcText, null, "Used as a supporting typeface in a variety of places including messaging banners, buttons, links, homepage labels and tags."),
|
|
49
|
-
fontDisplayer(fonts.supporting, phrase, styleguide.fontSizes)),
|
|
50
|
-
React.createElement(TcView, { style: styles.showoffFontsContainer },
|
|
51
|
-
React.createElement(TcText, { style: styles.headline }, "Style Magazine (Century Gothic Bold)"),
|
|
52
|
-
React.createElement(TcText, null, "Used for theme specific headlines, drop caps and pull-quotes in the Style magazine"),
|
|
53
|
-
fontDisplayer(fonts.styleMagazine, phrase, styleguide.fontSizes)),
|
|
54
|
-
React.createElement(TcView, { style: styles.showoffFontsContainer },
|
|
55
|
-
React.createElement(TcText, { style: styles.headline }, "Culture Magazine (Flama Bold)"),
|
|
56
|
-
React.createElement(TcText, null, "Used for theme specific headlines, drop caps and pull-quotes in the Culture magazine"),
|
|
57
|
-
fontDisplayer(fonts.cultureMagazine, phrase, styleguide.fontSizes)),
|
|
58
|
-
React.createElement(TcView, { style: styles.showoffFontsContainer },
|
|
59
|
-
React.createElement(TcText, { style: styles.headline }, "Sunday Times Magazine (Tiempos Headline Bold)"),
|
|
60
|
-
React.createElement(TcText, null, "Used for theme specific headlines, drop caps and pull-quotes in the Sunday Times Magazine"),
|
|
61
|
-
fontDisplayer(fonts.stMagazine, phrase, styleguide.fontSizes))));
|
|
62
|
-
};
|
|
63
|
-
storiesOf('Typescript Component/styleguide', module)
|
|
64
|
-
.add('Fonts', () => fontFixture())
|
|
65
|
-
.add('Animations', () => (React.createElement(Animations.FadeIn, null,
|
|
66
|
-
React.createElement(TcView, { style: styles.animationBox },
|
|
67
|
-
React.createElement(TcText, { style: styles.text }, "Fade In")))))
|
|
68
|
-
.add('Section Colours', () => getStories(colours.section))
|
|
69
|
-
.add('Functional colours', () => getStories(colours.functional))
|
|
70
|
-
.add('Secondary Section Colours', () => getStories(colours.secondarySectionColours));
|
|
71
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3R5bGVndWlkZS5zdG9yaWVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc3R5bGVndWlkZS9zdHlsZWd1aWRlLnN0b3JpZXMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLEVBQUUsUUFBUSxFQUFFLE1BQU0sT0FBTyxDQUFDO0FBQ3hDLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxrQk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xFQUFFLENBQUMsQ0FDdkIsb0JBQUMsVUFBVSxDQUFDLE1BQU07SUFDaEIsb0JBQUMsTUFBTSxJQUFDLEtBQUssRUFBRSxNQUFNLENBQUMsWUFBWTtRQUNoQyxvQkFBQyxNQUFNLElBQUMsS0FBSyxFQUFFLE1BQU0sQ0FBQyxJQUFJLGNBQWtCLENBQ3JDLENBQ1MsQ0FDckIsQ0FBQztLQUNELEdBQUcsQ0FBQyxpQkFBaUIsRUFBRSxHQUFHLEVBQUUsQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0tBQ3pELEdBQUcsQ0FBQyxvQkFBb0IsRUFBRSxHQUFHLEVBQUUsQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0tBQy9ELEdBQUcsQ0FBQywyQkFBMkIsRUFBRSxHQUFHLEVBQUUsQ0FDckMsVUFBVSxDQUFDLE9BQU8sQ0FBQyx1QkFBdUIsQ0FBQyxDQUM1QyxDQUFDIn0=
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { sectionColours, secondarySectionColours } from './colours/section';
|
|
2
|
-
const sectionColourPickerConfig = {
|
|
3
|
-
indepth: {},
|
|
4
|
-
magazinecomment: {
|
|
5
|
-
...sectionColours,
|
|
6
|
-
...secondarySectionColours
|
|
7
|
-
},
|
|
8
|
-
magazinestandard: {
|
|
9
|
-
...sectionColours,
|
|
10
|
-
...secondarySectionColours
|
|
11
|
-
},
|
|
12
|
-
maincomment: {
|
|
13
|
-
...sectionColours
|
|
14
|
-
},
|
|
15
|
-
mainstandard: {
|
|
16
|
-
...sectionColours
|
|
17
|
-
},
|
|
18
|
-
takeoverpage: {}
|
|
19
|
-
};
|
|
20
|
-
const magazineSections = {
|
|
21
|
-
culture: 'cultureMagazine',
|
|
22
|
-
Culture: 'cultureMagazine',
|
|
23
|
-
style: 'styleMagazine',
|
|
24
|
-
Style: 'styleMagazine',
|
|
25
|
-
'The Sunday Times Magazine': 'stMagazine',
|
|
26
|
-
thesundaytimesmagazine: 'stMagazine',
|
|
27
|
-
'the sunday times magazine': 'stMagazine'
|
|
28
|
-
};
|
|
29
|
-
const magazineSectionsConfig = {
|
|
30
|
-
indepth: magazineSections,
|
|
31
|
-
magazinecomment: magazineSections,
|
|
32
|
-
magazinestandard: magazineSections,
|
|
33
|
-
maincomment: {},
|
|
34
|
-
mainstandard: {},
|
|
35
|
-
takeoverpage: {}
|
|
36
|
-
};
|
|
37
|
-
const sectionColourPicker = (section, template) => {
|
|
38
|
-
return sectionColourPickerConfig[template][section];
|
|
39
|
-
};
|
|
40
|
-
const magazineFontPicker = (defaultFont, section, template) => {
|
|
41
|
-
return magazineSectionsConfig[template][section] || defaultFont;
|
|
42
|
-
};
|
|
43
|
-
const headlineCasePicker = (section, template) => section &&
|
|
44
|
-
section.toLowerCase() === 'style' &&
|
|
45
|
-
['indepth', 'magazinestandard', 'magazinecomment'].includes(template)
|
|
46
|
-
? 'uppercase'
|
|
47
|
-
: null;
|
|
48
|
-
export default (sectionParam, templateParam) => {
|
|
49
|
-
const section = sectionParam || 'default';
|
|
50
|
-
const template = templateParam || 'mainstandard';
|
|
51
|
-
return {
|
|
52
|
-
dropCapFont: magazineFontPicker('dropCap', section, template),
|
|
53
|
-
headlineFont: magazineFontPicker('headline', section, template),
|
|
54
|
-
pullQuoteFont: magazineFontPicker('headlineRegular', section, template),
|
|
55
|
-
sectionColour: sectionColourPicker(section, template),
|
|
56
|
-
headlineCase: headlineCasePicker(section, template)
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGhlbWVGYWN0b3J5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc3R5bGVndWlkZS90aGVtZUZhY3RvcnkudHN4Il0sIm5hbWVzIjpbXSwibWFwcGlu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QUFPLEVBQUUsUUFBUSxDQUFDO0tBQ3BELENBQUM7QUFDSixDQUFDLENBQUMifQ==
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import 'react';
|
|
2
|
-
import colours from './colours/colours';
|
|
3
|
-
import Animations from './components/Animations';
|
|
4
|
-
|
|
5
|
-
import breakpoints, {
|
|
6
|
-
editionBreakpoints,
|
|
7
|
-
editionMaxWidth,
|
|
8
|
-
getEditionBreakpoint,
|
|
9
|
-
editionBreakpointWidths,
|
|
10
|
-
sliceContentMaxWidth
|
|
11
|
-
} from './breakpoints';
|
|
12
|
-
import lineHeight from './lineHeight';
|
|
13
|
-
import { timesFontFactory, timesFontSizes, fontStyles } from './fonts/fonts';
|
|
14
|
-
import themeFactory from './themeFactory';
|
|
15
|
-
|
|
16
|
-
import scales from './scales';
|
|
17
|
-
import spacing, { globalSpacingStyles } from './spacing';
|
|
18
|
-
|
|
19
|
-
const { nativeTablet, nativeTabletWide } = breakpoints;
|
|
20
|
-
|
|
21
|
-
export const tabletRowPadding = 20;
|
|
22
|
-
|
|
23
|
-
export default () => {
|
|
24
|
-
return {
|
|
25
|
-
Animations,
|
|
26
|
-
colours,
|
|
27
|
-
fontFactory: timesFontFactory,
|
|
28
|
-
fonts: fontStyles,
|
|
29
|
-
fontSizes: timesFontSizes,
|
|
30
|
-
lineHeight,
|
|
31
|
-
spacing
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
Animations,
|
|
37
|
-
breakpoints,
|
|
38
|
-
colours,
|
|
39
|
-
editionBreakpoints,
|
|
40
|
-
editionBreakpointWidths,
|
|
41
|
-
editionMaxWidth,
|
|
42
|
-
sliceContentMaxWidth,
|
|
43
|
-
fontStyles as fonts,
|
|
44
|
-
timesFontFactory as fontFactory,
|
|
45
|
-
timesFontSizes as fontSizes,
|
|
46
|
-
getEditionBreakpoint,
|
|
47
|
-
lineHeight,
|
|
48
|
-
scales,
|
|
49
|
-
spacing,
|
|
50
|
-
globalSpacingStyles,
|
|
51
|
-
nativeTablet as tabletWidth,
|
|
52
|
-
nativeTabletWide as tabletWidthMax,
|
|
53
|
-
themeFactory
|
|
54
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import '@testing-library/react';
|
|
2
|
-
|
|
3
|
-
import breakpoints, {
|
|
4
|
-
editionBreakpointWidths,
|
|
5
|
-
editionBreakpoints
|
|
6
|
-
} from '../breakpoints';
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
getEditionBreakpoint,
|
|
10
|
-
sliceContentMaxWidth,
|
|
11
|
-
editionMaxWidth,
|
|
12
|
-
globalSpacingStyles,
|
|
13
|
-
editionBreakpointWidths as styleguideEditionBreakpointWidths,
|
|
14
|
-
editionBreakpoints as styleguideEditionBreakpoints
|
|
15
|
-
} from '../Styleguide';
|
|
16
|
-
|
|
17
|
-
describe('breakpoints', () => {
|
|
18
|
-
it('should return correct globalSpacingStyles value', () => {
|
|
19
|
-
expect(globalSpacingStyles).toEqual({
|
|
20
|
-
tabletHeadline: { marginBottom: 5 },
|
|
21
|
-
tabletTeaser: { marginTop: 5 }
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
it('should return correct sliceContentMaxWidth value', () => {
|
|
25
|
-
expect(sliceContentMaxWidth).toEqual(1180);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('should return correct sliceContentMaxWidth value', () => {
|
|
29
|
-
expect(sliceContentMaxWidth).toEqual(1180);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('should return correct editionBreakpointWidths value', () => {
|
|
33
|
-
expect(editionBreakpointWidths.wide).toEqual(1024);
|
|
34
|
-
expect(styleguideEditionBreakpointWidths.wide).toEqual(1024);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('should return correct editionMaxWidth value', () => {
|
|
38
|
-
expect(editionMaxWidth).toEqual(1366);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('should return correct breakpoint width value', () => {
|
|
42
|
-
expect(breakpoints.huge).toEqual(1320);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it('should retun correct editionBreakpoints value', () => {
|
|
46
|
-
expect(editionBreakpoints.huge).toEqual('huge');
|
|
47
|
-
expect(styleguideEditionBreakpoints.huge).toEqual('huge');
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
describe('getEditionBreakpoint()', () => {
|
|
51
|
-
it('should return correct getEditionBreakpoint value', () => {
|
|
52
|
-
expect(getEditionBreakpoint(600)).toEqual('small');
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('should return correct getEditionBreakpoint value', () => {
|
|
56
|
-
expect(getEditionBreakpoint(900)).toEqual('medium');
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('should return correct getEditionBreakpoint value', () => {
|
|
60
|
-
expect(getEditionBreakpoint(1100)).toEqual('wide');
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('should return correct getEditionBreakpoint value', () => {
|
|
64
|
-
expect(getEditionBreakpoint(1500)).toEqual('huge');
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
|
|
4
|
-
import styleguide, { colours, fonts, spacing } from '../Styleguide';
|
|
5
|
-
import { Animations, TcText, TcView } from '../components';
|
|
6
|
-
|
|
7
|
-
import styles from '../helpers/storybookStyles';
|
|
8
|
-
|
|
9
|
-
describe('styleguide', () => {
|
|
10
|
-
it('should return correct storybook style', () => {
|
|
11
|
-
expect(styles.box.height).toEqual(100);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('should render the object of section colours', () => {
|
|
15
|
-
expect(typeof colours.section).toBe('object');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should render the object of functional colours', () => {
|
|
19
|
-
expect(typeof colours.functional).toBe('object');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should multiply spacing values and add px property', () => {
|
|
23
|
-
expect(spacing(10)).toEqual('50px');
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe('fonts', () => {
|
|
27
|
-
it('should render the font sizes at the default scale', () => {
|
|
28
|
-
expect(styleguide().fontSizes.bodyMobile).toEqual(17);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('should render the line height factory default scale', () => {
|
|
32
|
-
expect(
|
|
33
|
-
styleguide().lineHeight({
|
|
34
|
-
font: 'body',
|
|
35
|
-
fontSize: 'secondary'
|
|
36
|
-
})
|
|
37
|
-
).toEqual(27);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('should render the object of font references', () => {
|
|
41
|
-
expect(typeof fonts).toBe('object');
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('should return object when fontFactory is called', () => {
|
|
45
|
-
expect(
|
|
46
|
-
styleguide().fontFactory({ font: 'headline', fontSize: 'body' })
|
|
47
|
-
).toEqual({
|
|
48
|
-
fontFamily: 'TimesModern-Bold',
|
|
49
|
-
fontSize: 18,
|
|
50
|
-
lineHeight: undefined
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
describe('components', () => {
|
|
56
|
-
it('should render the Animations component', () => {
|
|
57
|
-
expect(
|
|
58
|
-
render(
|
|
59
|
-
<Animations.FadeIn>
|
|
60
|
-
<TcView style={styles.container}>
|
|
61
|
-
<TcText style={styles.text}>Hello World</TcText>
|
|
62
|
-
</TcView>
|
|
63
|
-
</Animations.FadeIn>
|
|
64
|
-
)
|
|
65
|
-
).toBeTruthy();
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import '@testing-library/react';
|
|
2
|
-
import themeFactory from '../themeFactory';
|
|
3
|
-
|
|
4
|
-
describe('themeFactory()', () => {
|
|
5
|
-
it('should return correct theme when section nor template is provided', () => {
|
|
6
|
-
expect(themeFactory()).toEqual({
|
|
7
|
-
dropCapFont: 'dropCap',
|
|
8
|
-
headlineCase: null,
|
|
9
|
-
headlineFont: 'headline',
|
|
10
|
-
pullQuoteFont: 'headlineRegular',
|
|
11
|
-
sectionColour: '#1D1D1B'
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('should return correct theme for an indepth style page', () => {
|
|
16
|
-
expect(themeFactory('Style', 'indepth')).toEqual({
|
|
17
|
-
dropCapFont: 'styleMagazine',
|
|
18
|
-
headlineFont: 'styleMagazine',
|
|
19
|
-
pullQuoteFont: 'styleMagazine',
|
|
20
|
-
sectionColour: undefined,
|
|
21
|
-
headlineCase: 'uppercase'
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should return correct theme for a maincomment style page', () => {
|
|
26
|
-
expect(themeFactory('Style', 'maincomment')).toEqual({
|
|
27
|
-
dropCapFont: 'dropCap',
|
|
28
|
-
headlineFont: 'headline',
|
|
29
|
-
pullQuoteFont: 'headlineRegular',
|
|
30
|
-
sectionColour: '#BC3385',
|
|
31
|
-
headlineCase: null
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('should return correct theme for an indepth cultureMagazine page', () => {
|
|
36
|
-
expect(themeFactory('culture', 'indepth')).toEqual({
|
|
37
|
-
dropCapFont: 'cultureMagazine',
|
|
38
|
-
headlineFont: 'cultureMagazine',
|
|
39
|
-
pullQuoteFont: 'cultureMagazine',
|
|
40
|
-
sectionColour: undefined,
|
|
41
|
-
headlineCase: null
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
const widths = {
|
|
2
|
-
huge: 1320,
|
|
3
|
-
medium: 768,
|
|
4
|
-
nativeTablet: 660,
|
|
5
|
-
nativeTabletWide: 1194,
|
|
6
|
-
small: 520,
|
|
7
|
-
wide: 1024
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const editionBreakpoints = {
|
|
11
|
-
huge: 'huge',
|
|
12
|
-
medium: 'medium',
|
|
13
|
-
small: 'small',
|
|
14
|
-
wide: 'wide'
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const editionBreakpointWidths = {
|
|
18
|
-
huge: 1366,
|
|
19
|
-
medium: 768,
|
|
20
|
-
wide: 1024
|
|
21
|
-
};
|
|
22
|
-
const editionMaxWidth = editionBreakpointWidths.huge;
|
|
23
|
-
const sliceContentMaxWidth = 1180;
|
|
24
|
-
|
|
25
|
-
const getEditionBreakpoint = (width: {}) => {
|
|
26
|
-
if (width < editionBreakpointWidths.medium) {
|
|
27
|
-
return editionBreakpoints.small;
|
|
28
|
-
}
|
|
29
|
-
if (width < editionBreakpointWidths.wide) {
|
|
30
|
-
return editionBreakpoints.medium;
|
|
31
|
-
}
|
|
32
|
-
if (width < editionBreakpointWidths.huge) {
|
|
33
|
-
return editionBreakpoints.wide;
|
|
34
|
-
}
|
|
35
|
-
return editionBreakpoints.huge;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export {
|
|
39
|
-
editionBreakpoints,
|
|
40
|
-
editionMaxWidth,
|
|
41
|
-
editionBreakpointWidths,
|
|
42
|
-
sliceContentMaxWidth,
|
|
43
|
-
getEditionBreakpoint
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export default {
|
|
47
|
-
editionBreakpoints,
|
|
48
|
-
editionMaxWidth,
|
|
49
|
-
editionBreakpointWidths,
|
|
50
|
-
sliceContentMaxWidth,
|
|
51
|
-
...widths
|
|
52
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export const functionalColours = {
|
|
2
|
-
action: '#006699',
|
|
3
|
-
actionPressed: '#0077B3',
|
|
4
|
-
articleFlagExclusive: '#C51D24',
|
|
5
|
-
articleFlagNew: '#E34605',
|
|
6
|
-
articleFlagUpdated: '#3C81BE',
|
|
7
|
-
backgroundPrimary: '#F9F9F9',
|
|
8
|
-
backgroundSecondary: '#EDEDED',
|
|
9
|
-
black: '#000000',
|
|
10
|
-
border: '#F0F0F0',
|
|
11
|
-
brandColour: '#1D1D1B',
|
|
12
|
-
bullet: '#103546',
|
|
13
|
-
contrast: '#FFFFFF',
|
|
14
|
-
darkSupplement: '#272D34',
|
|
15
|
-
greyLabel: '#CCC',
|
|
16
|
-
greyStickyBarBoxShadow: '#c9c7c7ed',
|
|
17
|
-
greyStickyBarBorderBottom: '#ffffffdb',
|
|
18
|
-
gutter: '#f0f0f0',
|
|
19
|
-
keyline: '#DBDBDB',
|
|
20
|
-
modalBackground: '#000000',
|
|
21
|
-
newsletterPuffBackground: '#F9F8F3',
|
|
22
|
-
overlayGradientEnd: '#00000000',
|
|
23
|
-
overlayGradientFallback: '#000000B3',
|
|
24
|
-
overlayGradientStart: '#000000E6',
|
|
25
|
-
primary: '#333333',
|
|
26
|
-
secondary: '#696969',
|
|
27
|
-
tertiary: '#4D4D4D',
|
|
28
|
-
transparentBlack: 'rgba(0, 0, 0, 0.6)',
|
|
29
|
-
transparentWhite: 'rgba(255, 255, 255, 0.3)',
|
|
30
|
-
white: '#FFFFFF',
|
|
31
|
-
whiteGrey: '#F5F5F5'
|
|
32
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
const primaryColoursBase = {
|
|
2
|
-
artsfeatures: '#622956',
|
|
3
|
-
bricksmortar: '#006469',
|
|
4
|
-
business: '#005B8D',
|
|
5
|
-
comment: '#850029',
|
|
6
|
-
culture: '#7B0046',
|
|
7
|
-
default: '#1D1D1B',
|
|
8
|
-
defcon: '#FF1D25',
|
|
9
|
-
driving: '#C04605',
|
|
10
|
-
focus: '#CC0000',
|
|
11
|
-
gardening: '#00313B',
|
|
12
|
-
home: '#8D724D',
|
|
13
|
-
ireland: '#004E45',
|
|
14
|
-
law: '#691D26',
|
|
15
|
-
money: '#006A74',
|
|
16
|
-
news: '#13354E',
|
|
17
|
-
newsreview: '#004D6D',
|
|
18
|
-
puzzle: '#C74600',
|
|
19
|
-
register: '#6C6C69',
|
|
20
|
-
saturdayreview: '#A31D24',
|
|
21
|
-
scotland: '#00233E',
|
|
22
|
-
sport: '#008347',
|
|
23
|
-
style: '#BC3385',
|
|
24
|
-
techgames: '#1A1F24',
|
|
25
|
-
thedish: '#DB133B',
|
|
26
|
-
thegame: '#006469',
|
|
27
|
-
thesundaytimesmagazine: '#1D1D1D',
|
|
28
|
-
thetimesmagazine: '#1D1D1D',
|
|
29
|
-
times2: '#622956',
|
|
30
|
-
todaysmagazines: '#1D1D1B',
|
|
31
|
-
travel: '#2C79AD',
|
|
32
|
-
weekend: '#05829A',
|
|
33
|
-
world: '#636C17'
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const primaryColours = {
|
|
37
|
-
'Arts & Features': primaryColoursBase.artsfeatures,
|
|
38
|
-
'Bricks & Mortar': primaryColoursBase.bricksmortar,
|
|
39
|
-
Business: primaryColoursBase.business,
|
|
40
|
-
Comment: primaryColoursBase.comment,
|
|
41
|
-
Culture: primaryColoursBase.culture,
|
|
42
|
-
Driving: primaryColoursBase.driving,
|
|
43
|
-
Focus: primaryColoursBase.focus,
|
|
44
|
-
Gardening: primaryColoursBase.gardening,
|
|
45
|
-
Home: primaryColoursBase.home,
|
|
46
|
-
Ireland: primaryColoursBase.ireland,
|
|
47
|
-
Law: primaryColoursBase.law,
|
|
48
|
-
Money: primaryColoursBase.money,
|
|
49
|
-
News: primaryColoursBase.news,
|
|
50
|
-
'News Review': primaryColoursBase.newsreview,
|
|
51
|
-
Puzzles: primaryColoursBase.puzzle,
|
|
52
|
-
Register: primaryColoursBase.register,
|
|
53
|
-
'Saturday Review': primaryColoursBase.saturdayreview,
|
|
54
|
-
Scotland: primaryColoursBase.scotland,
|
|
55
|
-
Sport: primaryColoursBase.sport,
|
|
56
|
-
Style: primaryColoursBase.style,
|
|
57
|
-
'Tech & Games': primaryColoursBase.techgames,
|
|
58
|
-
'The Dish': primaryColoursBase.thedish,
|
|
59
|
-
'The Game': primaryColoursBase.thegame,
|
|
60
|
-
'The Sunday Times Magazine': primaryColoursBase.thesundaytimesmagazine,
|
|
61
|
-
'The Times Magazine': primaryColoursBase.thetimesmagazine,
|
|
62
|
-
Times2: primaryColoursBase.times2,
|
|
63
|
-
"Today's Magazines": primaryColoursBase.todaysmagazines,
|
|
64
|
-
Travel: primaryColoursBase.travel,
|
|
65
|
-
Weekend: primaryColoursBase.weekend,
|
|
66
|
-
World: primaryColoursBase.world
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const secondaryColoursBase = {
|
|
70
|
-
thesundaytimesmagazine: '#F13D00'
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const secondaryColours = {
|
|
74
|
-
'The Sunday Times Magazine': secondaryColoursBase.thesundaytimesmagazine
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const sectionColours = { ...primaryColoursBase, ...primaryColours };
|
|
78
|
-
export const secondarySectionColours = {
|
|
79
|
-
...secondaryColoursBase,
|
|
80
|
-
...secondaryColours
|
|
81
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { TcView } from '@times-components/utils';
|
|
2
|
-
import styled, { keyframes } from 'styled-components';
|
|
3
|
-
|
|
4
|
-
const fadingAnimation = keyframes`
|
|
5
|
-
from {
|
|
6
|
-
opacity: 0;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
to {
|
|
10
|
-
opacity: 1;
|
|
11
|
-
}
|
|
12
|
-
`;
|
|
13
|
-
|
|
14
|
-
const FadeIn = styled(TcView)`
|
|
15
|
-
animation: ${fadingAnimation} 0.3s ease-in-out;
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
const Animations = {
|
|
19
|
-
FadeIn
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default Animations;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
// not sure how else to put the default styles, this the default style for a React Native <Text/> component
|
|
3
|
-
import { CSSProperties } from 'react';
|
|
4
|
-
|
|
5
|
-
type Style = CSSProperties | undefined;
|
|
6
|
-
|
|
7
|
-
export default styled.div<{ style?: Style }>`
|
|
8
|
-
border: 0px solid black;
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
color: ${({ style }) =>
|
|
11
|
-
style && style.color ? style.color : 'rgb(0, 0, 0)'};
|
|
12
|
-
display: inline;
|
|
13
|
-
font: 14px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
14
|
-
Ubuntu, 'Helvetica Neue', sans-serif;
|
|
15
|
-
margin: 0px;
|
|
16
|
-
padding: 0px;
|
|
17
|
-
white-space: pre-wrap;
|
|
18
|
-
overflow-wrap: break-word;
|
|
19
|
-
font-size: ${({ style }) =>
|
|
20
|
-
style && style.fontSize ? style.fontSize : '14px'};
|
|
21
|
-
font-weight: ${({ style }) => style && style.fontWeight && style.fontWeight};
|
|
22
|
-
margin-bottom: ${({ style }) =>
|
|
23
|
-
style && style.marginBottom ? style.marginBottom : '0px'};
|
|
24
|
-
margin-left: ${({ style }) =>
|
|
25
|
-
style && style.marginLeft ? style.marginLeft : '0px'};
|
|
26
|
-
margin-top: ${({ style }) =>
|
|
27
|
-
style && style.marginTop ? style.marginTop : '0px'};
|
|
28
|
-
font-family: ${({ style }) =>
|
|
29
|
-
style && style.fontFamily
|
|
30
|
-
? style.fontFamily
|
|
31
|
-
: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif'};
|
|
32
|
-
`;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { CSSProperties } from 'react';
|
|
3
|
-
|
|
4
|
-
type Style = CSSProperties | undefined;
|
|
5
|
-
|
|
6
|
-
export default styled.div<{ style?: Style }>`
|
|
7
|
-
border: 0px solid black;
|
|
8
|
-
box-sizing: border-box;
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
margin: ${({ style }) => (style && style.margin ? style.margin : '0px')};
|
|
12
|
-
border-bottom-color: ${({ style }) =>
|
|
13
|
-
style && style.borderBottomColor ? style.borderBottomColor : 'black'};
|
|
14
|
-
border-bottom-width: ${({ style }) =>
|
|
15
|
-
style && style.borderBottomWidth ? style.borderBottomWidth : '0px'};
|
|
16
|
-
border-radius: ${({ style }) =>
|
|
17
|
-
style && style.borderRadius && style.borderRadius};
|
|
18
|
-
overflow: ${({ style }) => style && style.overflow && style.overflow};
|
|
19
|
-
height: ${({ style }) => style && style.height && style.height};
|
|
20
|
-
width: ${({ style }) => style && style.width && style.width};
|
|
21
|
-
margin: 0px;
|
|
22
|
-
min-height: 0px;
|
|
23
|
-
min-width: 0px;
|
|
24
|
-
padding: 0px;
|
|
25
|
-
position: relative;
|
|
26
|
-
z-index: 0;
|
|
27
|
-
`;
|