@times-components/ts-styleguide 1.40.4 → 1.41.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 +11 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/styleguide/Styleguide.d.ts +14 -2
- package/dist/styleguide/Styleguide.js +4 -3
- package/dist/styleguide/__tests__/styleguide.test.js +9 -3
- package/dist/styleguide/components/TsTcText.js +2 -6
- package/dist/styleguide/fonts/font-factory.js +2 -2
- package/dist/styleguide/fonts/font-styles-with-fallback.d.ts +13 -0
- package/dist/styleguide/fonts/font-styles-with-fallback.js +13 -0
- package/dist/styleguide/fonts/fonts.d.ts +2 -1
- package/dist/styleguide/fonts/fonts.js +3 -2
- package/package.json +4 -4
- package/rnw.js +1 -1
- package/src/index.ts +1 -0
- package/src/styleguide/Styleguide.tsx +8 -1
- package/src/styleguide/__tests__/styleguide.test.tsx +17 -2
- package/src/styleguide/components/TsTcText.tsx +1 -5
- package/src/styleguide/fonts/font-factory.tsx +1 -1
- package/src/styleguide/fonts/font-styles-with-fallback.tsx +14 -0
- package/src/styleguide/fonts/fonts.tsx +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.41.0](https://github.com/newsuk/times-components/compare/@times-components/ts-styleguide@1.40.4...@times-components/ts-styleguide@1.41.0) (2023-03-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **TDP-3084:** updated fallback font settings for overrides ([#3292](https://github.com/newsuk/times-components/issues/3292)) ([12f9c6c](https://github.com/newsuk/times-components/commit/12f9c6c06fdfaf52b7b28bbcc2bbeb8b39d29d57))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.40.4](https://github.com/newsuk/times-components/compare/@times-components/ts-styleguide@1.40.3...@times-components/ts-styleguide@1.40.4) (2023-03-20)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @times-components/ts-styleguide
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as styleguide, Animations, breakpoints, colours, editionBreakpoints, editionBreakpointWidths, editionMaxWidth, sliceContentMaxWidth, fonts, fontFactory, fontSizes, getEditionBreakpoint, lineHeight, scales, spacing, globalSpacingStyles, tabletRowPadding, tabletWidth, tabletWidthMax, themeFactory } from './styleguide/Styleguide';
|
|
1
|
+
export { default as styleguide, Animations, breakpoints, colours, editionBreakpoints, editionBreakpointWidths, editionMaxWidth, sliceContentMaxWidth, fonts, fontFactory, fontSizes, fontsWithFallback, getEditionBreakpoint, lineHeight, scales, spacing, globalSpacingStyles, tabletRowPadding, tabletWidth, tabletWidthMax, themeFactory } from './styleguide/Styleguide';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// ts-styleguide
|
|
2
|
-
export { default as styleguide, Animations, breakpoints, colours, editionBreakpoints, editionBreakpointWidths, editionMaxWidth, sliceContentMaxWidth, fonts, fontFactory, fontSizes, getEditionBreakpoint, lineHeight, scales, spacing, globalSpacingStyles, tabletRowPadding, tabletWidth, tabletWidthMax, themeFactory } from './styleguide/Styleguide';
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
export { default as styleguide, Animations, breakpoints, colours, editionBreakpoints, editionBreakpointWidths, editionMaxWidth, sliceContentMaxWidth, fonts, fontFactory, fontSizes, fontsWithFallback, getEditionBreakpoint, lineHeight, scales, spacing, globalSpacingStyles, tabletRowPadding, tabletWidth, tabletWidthMax, themeFactory } from './styleguide/Styleguide';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0JBQWdCO0FBQ2hCLE9BQU8sRUFDTCxPQUFPLElBQUksVUFBVSxFQUNyQixVQUFVLEVBQ1YsV0FBVyxFQUNYLE9BQU8sRUFDUCxrQkFBa0IsRUFDbEIsdUJBQXVCLEVBQ3ZCLGVBQWUsRUFDZixvQkFBb0IsRUFDcEIsS0FBSyxFQUNMLFdBQVcsRUFDWCxTQUFTLEVBQ1QsaUJBQWlCLEVBQ2pCLG9CQUFvQixFQUNwQixVQUFVLEVBQ1YsTUFBTSxFQUNOLE9BQU8sRUFDUCxtQkFBbUIsRUFDbkIsZ0JBQWdCLEVBQ2hCLFdBQVcsRUFDWCxjQUFjLEVBQ2QsWUFBWSxFQUNiLE1BQU0seUJBQXlCLENBQUMifQ==
|
|
@@ -3,7 +3,7 @@ import colours from './colours/colours';
|
|
|
3
3
|
import Animations from './components/Animations';
|
|
4
4
|
import breakpoints, { editionBreakpoints, editionMaxWidth, getEditionBreakpoint, editionBreakpointWidths, sliceContentMaxWidth } from './breakpoints';
|
|
5
5
|
import lineHeight from './lineHeight';
|
|
6
|
-
import { timesFontFactory, timesFontSizes, fontStyles } from './fonts/fonts';
|
|
6
|
+
import { timesFontFactory, timesFontSizes, fontStyles, fontStylesWithFallback } from './fonts/fonts';
|
|
7
7
|
import themeFactory from './themeFactory';
|
|
8
8
|
import scales from './scales';
|
|
9
9
|
import spacing, { globalSpacingStyles } from './spacing';
|
|
@@ -137,6 +137,18 @@ declare const _default: () => {
|
|
|
137
137
|
styleMagazine: string;
|
|
138
138
|
supporting: string;
|
|
139
139
|
};
|
|
140
|
+
fontsWithFallback: {
|
|
141
|
+
body: string;
|
|
142
|
+
bodyRegular: string;
|
|
143
|
+
bodyRegularSmallCaps: string;
|
|
144
|
+
cultureMagazine: string;
|
|
145
|
+
dropCap: string;
|
|
146
|
+
headline: string;
|
|
147
|
+
headlineRegular: string;
|
|
148
|
+
stMagazine: string;
|
|
149
|
+
styleMagazine: string;
|
|
150
|
+
supporting: string;
|
|
151
|
+
};
|
|
140
152
|
fontSizes: {
|
|
141
153
|
articleHeadline: number;
|
|
142
154
|
articleMeta: number;
|
|
@@ -192,4 +204,4 @@ declare const _default: () => {
|
|
|
192
204
|
spacing: (multiple: number) => string;
|
|
193
205
|
};
|
|
194
206
|
export default _default;
|
|
195
|
-
export { Animations, breakpoints, colours, editionBreakpoints, editionBreakpointWidths, editionMaxWidth, sliceContentMaxWidth, fontStyles as fonts, timesFontFactory as fontFactory, timesFontSizes as fontSizes, getEditionBreakpoint, lineHeight, scales, spacing, globalSpacingStyles, nativeTablet as tabletWidth, nativeTabletWide as tabletWidthMax, themeFactory };
|
|
207
|
+
export { Animations, breakpoints, colours, editionBreakpoints, editionBreakpointWidths, editionMaxWidth, sliceContentMaxWidth, fontStyles as fonts, fontStylesWithFallback as fontsWithFallback, timesFontFactory as fontFactory, timesFontSizes as fontSizes, getEditionBreakpoint, lineHeight, scales, spacing, globalSpacingStyles, nativeTablet as tabletWidth, nativeTabletWide as tabletWidthMax, themeFactory };
|
|
@@ -3,7 +3,7 @@ import colours from './colours/colours';
|
|
|
3
3
|
import Animations from './components/Animations';
|
|
4
4
|
import breakpoints, { editionBreakpoints, editionMaxWidth, getEditionBreakpoint, editionBreakpointWidths, sliceContentMaxWidth } from './breakpoints';
|
|
5
5
|
import lineHeight from './lineHeight';
|
|
6
|
-
import { timesFontFactory, timesFontSizes, fontStyles } from './fonts/fonts';
|
|
6
|
+
import { timesFontFactory, timesFontSizes, fontStyles, fontStylesWithFallback } from './fonts/fonts';
|
|
7
7
|
import themeFactory from './themeFactory';
|
|
8
8
|
import scales from './scales';
|
|
9
9
|
import spacing, { globalSpacingStyles } from './spacing';
|
|
@@ -15,10 +15,11 @@ export default () => {
|
|
|
15
15
|
colours,
|
|
16
16
|
fontFactory: timesFontFactory,
|
|
17
17
|
fonts: fontStyles,
|
|
18
|
+
fontsWithFallback: fontStylesWithFallback,
|
|
18
19
|
fontSizes: timesFontSizes,
|
|
19
20
|
lineHeight,
|
|
20
21
|
spacing
|
|
21
22
|
};
|
|
22
23
|
};
|
|
23
|
-
export { Animations, breakpoints, colours, editionBreakpoints, editionBreakpointWidths, editionMaxWidth, sliceContentMaxWidth, fontStyles as fonts, timesFontFactory as fontFactory, timesFontSizes as fontSizes, getEditionBreakpoint, lineHeight, scales, spacing, globalSpacingStyles, nativeTablet as tabletWidth, nativeTabletWide as tabletWidthMax, themeFactory };
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
export { Animations, breakpoints, colours, editionBreakpoints, editionBreakpointWidths, editionMaxWidth, sliceContentMaxWidth, fontStyles as fonts, fontStylesWithFallback as fontsWithFallback, timesFontFactory as fontFactory, timesFontSizes as fontSizes, getEditionBreakpoint, lineHeight, scales, spacing, globalSpacingStyles, nativeTablet as tabletWidth, nativeTabletWide as tabletWidthMax, themeFactory };
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3R5bGVndWlkZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHlsZWd1aWRlL1N0eWxlZ3VpZGUudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sT0FBTyxDQUFDO0FBQ2YsT0FBTyxPQUFPLE1BQU0sbUJBQW1CLENBQUM7QUFDeEMsT0FBTyxVQUFVLE1BQU0seUJBQXlCLENBQUM7QUFFakQsT0FBTyxXQUFXLEVBQUUsRUFDbEIsa0JBQWtCLEVBQ2xCLGVBQWUsRUFDZixvQkFBb0IsRUFDcEIsdUJBQXVCLEVBQ3ZCLG9CQUFvQixFQUNyQixNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLFVBQVUsTUFBTSxjQUFjLENBQUM7QUFDdEMsT0FBTyx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+1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
|
-
import styleguide, { colours, fonts, spacing } from '../Styleguide';
|
|
3
|
+
import styleguide, { colours, fonts, fontsWithFallback, spacing } from '../Styleguide';
|
|
4
4
|
import { Animations, TsTcText, TsTcView } from '../components';
|
|
5
5
|
import styles from '../helpers/storybookStyles';
|
|
6
6
|
describe('styleguide', () => {
|
|
@@ -29,9 +29,15 @@ describe('styleguide', () => {
|
|
|
29
29
|
it('should render the object of font references', () => {
|
|
30
30
|
expect(typeof fonts).toBe('object');
|
|
31
31
|
});
|
|
32
|
+
it('should render the object of font and fallback references', () => {
|
|
33
|
+
expect(typeof fontsWithFallback).toBe('object');
|
|
34
|
+
});
|
|
35
|
+
it('should render the supporting font roboto should correctly show font and fallback references', () => {
|
|
36
|
+
expect(fontsWithFallback.supporting).toEqual('Roboto-Regular, Roboto-Regular-fallback, sans-serif');
|
|
37
|
+
});
|
|
32
38
|
it('should return object when fontFactory is called', () => {
|
|
33
39
|
expect(styleguide().fontFactory({ font: 'headline', fontSize: 'body' })).toEqual({
|
|
34
|
-
fontFamily: 'TimesModern-Bold',
|
|
40
|
+
fontFamily: 'TimesModern-Bold, TimesModern-Bold-fallback, serif',
|
|
35
41
|
fontSize: 18,
|
|
36
42
|
lineHeight: undefined
|
|
37
43
|
});
|
|
@@ -45,4 +51,4 @@ describe('styleguide', () => {
|
|
|
45
51
|
});
|
|
46
52
|
});
|
|
47
53
|
});
|
|
48
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3R5bGVndWlkZS50ZXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0eWxlZ3VpZGUvX190ZXN0c19fL3N0eWxlZ3VpZGUudGVzdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkF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FBRSxDQUFDLGlEQUFpRCxFQUFFLEdBQUcsRUFBRTtZQUN6RCxNQUFNLENBQ0osVUFBVSxFQUFFLENBQUMsV0FBVyxDQUFDLEVBQUUsSUFBSSxFQUFFLFVBQVUsRUFBRSxRQUFRLEVBQUUsTUFBTSxFQUFFLENBQUMsQ0FDakUsQ0FBQyxPQUFPLENBQUM7Z0JBQ1IsVUFBVSxFQUFFLG9EQUFvRDtnQkFDaEUsUUFBUSxFQUFFLEVBQUU7Z0JBQ1osVUFBVSxFQUFFLFNBQVM7YUFDdEIsQ0FBQyxDQUFDO1FBQ0wsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDLENBQUMsQ0FBQztJQUVILFFBQVEsQ0FBQyxZQUFZLEVBQUUsR0FBRyxFQUFFO1FBQzFCLEVBQUUsQ0FBQyx3Q0FBd0MsRUFBRSxHQUFHLEVBQUU7WUFDaEQsTUFBTSxDQUNKLE1BQU0sQ0FDSixvQkFBQyxVQUFVLENBQUMsTUFBTTtnQkFDaEIsb0JBQUMsUUFBUSxJQUFDLEtBQUssRUFBRSxNQUFNLENBQUMsU0FBUztvQkFDL0Isb0JBQUMsUUFBUSxJQUFDLEtBQUssRUFBRSxNQUFNLENBQUMsSUFBSSxrQkFBd0IsQ0FDM0MsQ0FDTyxDQUNyQixDQUNGLENBQUMsVUFBVSxFQUFFLENBQUM7UUFDakIsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDLENBQUMsQ0FBQztBQUNMLENBQUMsQ0FBQyxDQUFDIn0=
|
|
@@ -4,8 +4,6 @@ export default styled.div `
|
|
|
4
4
|
box-sizing: border-box;
|
|
5
5
|
color: ${({ style }) => style && style.color ? style.color : 'rgb(0, 0, 0)'};
|
|
6
6
|
display: inline;
|
|
7
|
-
font: 14px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
8
|
-
Ubuntu, 'Helvetica Neue', sans-serif;
|
|
9
7
|
margin: 0px;
|
|
10
8
|
padding: 0px;
|
|
11
9
|
white-space: pre-wrap;
|
|
@@ -15,8 +13,6 @@ export default styled.div `
|
|
|
15
13
|
margin-bottom: ${({ style }) => style && style.marginBottom ? style.marginBottom : '0px'};
|
|
16
14
|
margin-left: ${({ style }) => style && style.marginLeft ? style.marginLeft : '0px'};
|
|
17
15
|
margin-top: ${({ style }) => style && style.marginTop ? style.marginTop : '0px'};
|
|
18
|
-
font-family: ${({ style }) => style && style.fontFamily
|
|
19
|
-
? style.fontFamily
|
|
20
|
-
: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif'};
|
|
16
|
+
font-family: ${({ style }) => style && style.fontFamily ? style.fontFamily : 'sans-serif'};
|
|
21
17
|
`;
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVHNUY1RleHQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3R5bGVndWlkZS9jb21wb25lbnRzL1RzVGNUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLE1BQU0sTUFBTSxtQkFBbUIsQ0FBQztBQUt2QyxlQUFlLE1BQU0sQ0FBQyxHQUFHLENBQW1COzs7V0FHakMsQ0FBQyxFQUFFLEtBQUssRUFBRSxFQUFFLEVBQUUsQ0FDckIsS0FBSyxJQUFJLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLGNBQWM7Ozs7OztlQU14QyxDQUFDLEVBQUUsS0FBSyxFQUFFLEVBQUUsRUFBRSxDQUN6QixLQUFLLElBQUksS0FBSyxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsTUFBTTtpQkFDcEMsQ0FBQyxFQUFFLEtBQUssRUFBRSxFQUFFLEVBQUUsQ0FBQyxLQUFLLElBQUksS0FBSyxDQUFDLFVBQVUsSUFBSSxLQUFLLENBQUMsVUFBVTttQkFDMUQsQ0FBQyxFQUFFLEtBQUssRUFBRSxFQUFFLEVBQUUsQ0FDN0IsS0FBSyxJQUFJLEtBQUssQ0FBQyxZQUFZLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxZQUFZLENBQUMsQ0FBQyxDQUFDLEtBQUs7aUJBQzNDLENBQUMsRUFBRSxLQUFLLEVBQUUsRUFBRSxFQUFFLENBQzNCLEtBQUssSUFBSSxLQUFLLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQyxLQUFLO2dCQUN4QyxDQUFDLEVBQUUsS0FBSyxFQUFFLEVBQUUsRUFBRSxDQUMxQixLQUFLLElBQUksS0FBSyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsS0FBSztpQkFDckMsQ0FBQyxFQUFFLEtBQUssRUFBRSxFQUFFLEVBQUUsQ0FDM0IsS0FBSyxJQUFJLEtBQUssQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLFlBQVk7Q0FDOUQsQ0FBQyJ9
|
|
@@ -4,9 +4,9 @@ import lineHeight from '../lineHeight';
|
|
|
4
4
|
export default ({ font, fontSize }) => {
|
|
5
5
|
const styles = styleguide();
|
|
6
6
|
return {
|
|
7
|
-
fontFamily: styles.
|
|
7
|
+
fontFamily: styles.fontsWithFallback[font],
|
|
8
8
|
fontSize: timesFontSizes[fontSize],
|
|
9
9
|
lineHeight: lineHeight({ font, fontSize })
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9udC1mYWN0b3J5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0eWxlZ3VpZGUvZm9udHMvZm9udC1mYWN0b3J5LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLFVBQVUsTUFBTSxlQUFlLENBQUM7QUFDdkMsT0FBTyxFQUFFLGNBQWMsRUFBYyxNQUFNLFNBQVMsQ0FBQztBQUNyRCxPQUFPLFVBQVUsTUFBTSxlQUFlLENBQUM7QUFFdkMsZUFBZSxDQUFDLEVBQ2QsSUFBSSxFQUNKLFFBQVEsRUFJVCxFQUFFLEVBQUU7SUFDSCxNQUFNLE1BQU0sR0FBRyxVQUFVLEVBQUUsQ0FBQztJQUM1QixPQUFPO1FBQ0wsVUFBVSxFQUFFLE1BQU0sQ0FBQyxpQkFBaUIsQ0FBQyxJQUFJLENBQUM7UUFDMUMsUUFBUSxFQUFFLGNBQWMsQ0FBQyxRQUFRLENBQUM7UUFDbEMsVUFBVSxFQUFFLFVBQVUsQ0FBQyxFQUFFLElBQUksRUFBRSxRQUFRLEVBQUUsQ0FBQztLQUMzQyxDQUFDO0FBQ0osQ0FBQyxDQUFDIn0=
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
body: string;
|
|
3
|
+
bodyRegular: string;
|
|
4
|
+
bodyRegularSmallCaps: string;
|
|
5
|
+
cultureMagazine: string;
|
|
6
|
+
dropCap: string;
|
|
7
|
+
headline: string;
|
|
8
|
+
headlineRegular: string;
|
|
9
|
+
stMagazine: string;
|
|
10
|
+
styleMagazine: string;
|
|
11
|
+
supporting: string;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
body: 'TimesDigitalW04, TimesDigitalW04-fallback, serif',
|
|
3
|
+
bodyRegular: 'TimesDigitalW04-Regular, TimesDigitalW04-Regular-fallback, serif',
|
|
4
|
+
bodyRegularSmallCaps: 'TimesDigitalW04-RegularSC, TimesDigitalW04-RegularSC-fallback, serif',
|
|
5
|
+
cultureMagazine: 'TimesModern-Bold, TimesModern-Bold-fallback, serif',
|
|
6
|
+
dropCap: 'TimesModern-Regular, TimesModern-Regular-fallback, serif',
|
|
7
|
+
headline: 'TimesModern-Bold, TimesModern-Bold-fallback, serif',
|
|
8
|
+
headlineRegular: 'TimesModern-Regular, TimesModern-Regular-fallback, serif',
|
|
9
|
+
stMagazine: 'TimesModern-Bold, TimesModern-Bold-fallback, serif',
|
|
10
|
+
styleMagazine: 'TimesModern-Bold, TimesModern-Bold-fallback, serif',
|
|
11
|
+
supporting: 'Roboto-Regular, Roboto-Regular-fallback, sans-serif'
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9udC1zdHlsZXMtd2l0aC1mYWxsYmFjay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdHlsZWd1aWRlL2ZvbnRzL2ZvbnQtc3R5bGVzLXdpdGgtZmFsbGJhY2sudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQWU7SUFDYixJQUFJLEVBQUUsa0RBQWtEO0lBQ3hELFdBQVcsRUFDVCxrRUFBa0U7SUFDcEUsb0JBQW9CLEVBQ2xCLHNFQUFzRTtJQUN4RSxlQUFlLEVBQUUsb0RBQW9EO0lBQ3JFLE9BQU8sRUFBRSwwREFBMEQ7SUFDbkUsUUFBUSxFQUFFLG9EQUFvRDtJQUM5RCxlQUFlLEVBQUUsMERBQTBEO0lBQzNFLFVBQVUsRUFBRSxvREFBb0Q7SUFDaEUsYUFBYSxFQUFFLG9EQUFvRDtJQUNuRSxVQUFVLEVBQUUscURBQXFEO0NBQ2xFLENBQUMifQ==
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fontStyles from './font-styles';
|
|
2
|
+
import fontStylesWithFallback from './font-styles-with-fallback';
|
|
2
3
|
import timesFontFactory from './font-factory';
|
|
3
4
|
import timesFontSizes from './font-sizes';
|
|
4
|
-
export { fontStyles, timesFontSizes, timesFontFactory };
|
|
5
|
+
export { fontStyles, timesFontSizes, timesFontFactory, fontStylesWithFallback };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fontStyles from './font-styles';
|
|
2
|
+
import fontStylesWithFallback from './font-styles-with-fallback';
|
|
2
3
|
import timesFontFactory from './font-factory';
|
|
3
4
|
import timesFontSizes from './font-sizes';
|
|
4
|
-
export { fontStyles, timesFontSizes, timesFontFactory };
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
export { fontStyles, timesFontSizes, timesFontFactory, fontStylesWithFallback };
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9udHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3R5bGVndWlkZS9mb250cy9mb250cy50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxVQUFVLE1BQU0sZUFBZSxDQUFDO0FBQ3ZDLE9BQU8sc0JBQXNCLE1BQU0sNkJBQTZCLENBQUM7QUFDakUsT0FBTyxnQkFBZ0IsTUFBTSxnQkFBZ0IsQ0FBQztBQUM5QyxPQUFPLGNBQWMsTUFBTSxjQUFjLENBQUM7QUFFMUMsT0FBTyxFQUFFLFVBQVUsRUFBRSxjQUFjLEVBQUUsZ0JBQWdCLEVBQUUsc0JBQXNCLEVBQUUsQ0FBQyJ9
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/ts-styleguide",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.41.0",
|
|
4
4
|
"description": "Reuseable Typescript React Components styleguide",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"dev": "dist/index.js",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"node": ">=8.9"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@times-components/link": "3.
|
|
55
|
-
"@times-components/utils": "6.
|
|
54
|
+
"@times-components/link": "3.12.0",
|
|
55
|
+
"@times-components/utils": "6.16.0",
|
|
56
56
|
"react": "16.9.0",
|
|
57
57
|
"styled-components": "4.3.2"
|
|
58
58
|
},
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"@testing-library/jest-dom/extend-expect"
|
|
82
82
|
]
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "c26e915d900f103440c55fbf3806a4db4b274a12"
|
|
85
85
|
}
|
package/rnw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=require("styled-components")},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";n.r(t);n(1);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const o={artsfeatures:"#622956",bricksmortar:"#006469",business:"#005B8D",comment:"#850029",culture:"#7B0046",default:"#1D1D1B",defcon:"#FF1D25",driving:"#C04605",focus:"#CC0000",gardening:"#00313B",home:"#8D724D",ireland:"#004E45",law:"#691D26",money:"#006A74",news:"#13354E",newsreview:"#004D6D",puzzle:"#C74600",register:"#6C6C69",saturdayreview:"#A31D24",scotland:"#00233E",sport:"#008347",style:"#BC3385",techgames:"#1A1F24",thedish:"#DB133B",thegame:"#006469",thesundaytimesmagazine:"#1D1D1D",thetimesmagazine:"#1D1D1D",times2:"#622956",todaysmagazines:"#1D1D1B",travel:"#2C79AD",weekend:"#05829A",world:"#636C17"},l={"Arts & Features":o.artsfeatures,"Bricks & Mortar":o.bricksmortar,Business:o.business,Comment:o.comment,Culture:o.culture,Driving:o.driving,Focus:o.focus,Gardening:o.gardening,Home:o.home,Ireland:o.ireland,Law:o.law,Money:o.money,News:o.news,"News Review":o.newsreview,Puzzles:o.puzzle,Register:o.register,"Saturday Review":o.saturdayreview,Scotland:o.scotland,Sport:o.sport,Style:o.style,"Tech & Games":o.techgames,"The Dish":o.thedish,"The Game":o.thegame,"The Sunday Times Magazine":o.thesundaytimesmagazine,"The Times Magazine":o.thetimesmagazine,Times2:o.times2,"Today's Magazines":o.todaysmagazines,Travel:o.travel,Weekend:o.weekend,World:o.world},d={thesundaytimesmagazine:"#F13D00"},u={"The Sunday Times Magazine":d.thesundaytimesmagazine},s=i(i({},o),l),c=i(i({},d),u);var g={functional:{action:"#006699",actionPressed:"#0077B3",articleFlagExclusive:"#C51D24",articleFlagNew:"#E34605",articleFlagUpdated:"#3C81BE",backgroundPrimary:"#F9F9F9",backgroundSecondary:"#EDEDED",black:"#000000",border:"#F0F0F0",brandColour:"#1D1D1B",bullet:"#103546",contrast:"#FFFFFF",darkSupplement:"#272D34",greyLabel:"#CCC",greyStickyBarBoxShadow:"#c9c7c7ed",greyStickyBarBorderBottom:"#ffffffdb",gutter:"#f0f0f0",keyline:"#DBDBDB",modalBackground:"#000000",newsletterPuffBackground:"#F9F8F3",overlayGradientEnd:"#00000000",overlayGradientFallback:"#000000B3",overlayGradientStart:"#000000E6",primary:"#333333",secondary:"#696969",tertiary:"#4D4D4D",transparentBlack:"rgba(0, 0, 0, 0.6)",transparentWhite:"rgba(255, 255, 255, 0.3)",white:"#FFFFFF",whiteGrey:"#F5F5F5"},secondarySectionColours:c,section:s},m=n(0),f=n.n(m),p=f.a.div.withConfig({displayName:"TsTcView",componentId:"sc-154dp5w-0"})(["border:0px solid black;box-sizing:border-box;display:flex;flex-direction:column;margin:",";border-bottom-color:",";border-bottom-width:",";border-radius:",";overflow:",";height:",";width:",";margin:0px;min-height:0px;min-width:0px;padding:0px;position:relative;z-index:0;"],e=>{let t=e.style;return t&&t.margin?t.margin:"0px"},e=>{let t=e.style;return t&&t.borderBottomColor?t.borderBottomColor:"black"},e=>{let t=e.style;return t&&t.borderBottomWidth?t.borderBottomWidth:"0px"},e=>{let t=e.style;return t&&t.borderRadius&&t.borderRadius},e=>{let t=e.style;return t&&t.overflow&&t.overflow},e=>{let t=e.style;return t&&t.height&&t.height},e=>{let t=e.style;return t&&t.width&&t.width});const b=Object(m.keyframes)(["from{opacity:0;}to{opacity:1;}"]);var y={FadeIn:f()(p).withConfig({displayName:"Animations__FadeIn",componentId:"w31u4-0"})(["animation:"," 0.3s ease-in-out;"],b)};function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const O={huge:"huge",medium:"medium",small:"small",wide:"wide"},v={huge:1366,medium:768,wide:1024},M=v.huge,D=e=>e<v.medium?O.small:e<v.wide?O.medium:e<v.huge?O.wide:O.huge;var z=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({editionBreakpoints:O,editionMaxWidth:M,editionBreakpointWidths:v,sliceContentMaxWidth:1180},{huge:1320,medium:768,nativeTablet:660,nativeTabletWide:1194,small:520,wide:1024});const j={body:{bodyMobile:30,puffLink:15,secondary:27,teaser:20,tertiary:26},bodyRegular:{infoSubText:23,infoTitle:30,pageComponentHeadline:25},bodyRegularSmallCaps:{cardMetaMobile:12,meta:14},cultureMagazine:{headline:35,pageHeadline:42},headline:{articleHeadline:45,commentsHeadline:29,headline:33,infoTitle:22,leadHeadline:26,pageComponentHeadline:27,pageHeadline:40,smallHeadline:27,tileLeadHeadline:35,heading2Mobile:26,heading3Mobile:26,heading4Mobile:26,heading5Mobile:26},headlineRegular:{pageComponentHeadline:30,smallestHeadline:26,strapline:24},stMagazine:{headline:35,pageHeadline:42},styleMagazine:{headline:35,pageHeadline:42},supporting:{button:16,caption:13,cardMeta:15,cardMetaMobile:14,keyFactsTitle:18,link:13,linkTopic:12,meta:14,pagingMeta:15,tertiary:17}};var F=e=>{let t=e.font,n=e.fontSize;return j[t][n]},T={body:"TimesDigitalW04",bodyRegular:"TimesDigitalW04-Regular",bodyRegularSmallCaps:"TimesDigitalW04-RegularSC",cultureMagazine:"TimesModern-Bold",dropCap:"TimesModern-Regular",headline:"TimesModern-Bold",headlineRegular:"TimesModern-Regular",stMagazine:"TimesModern-Bold",styleMagazine:"TimesModern-Bold",supporting:"Roboto-Regular"},P=e=>{let t=e.font,n=e.fontSize;return{fontFamily:Q().fonts[t],fontSize:S[n],lineHeight:F({font:t,fontSize:n})}},S={articleHeadline:45,articleMeta:15,body:18,bodyMobile:17,button:15,caption:12,cardHeadline:27,cardMeta:12,cardMetaMobile:12,commentsGuidelines:12,commentsHeadline:27,credits:9,headline:30,imageOverlayTextSmall:11,infoTitle:22,keyFactsTitle:24,leadHeadline:26,link:13,linkTopic:12,meta:13,newsletterPuffLabel:12,newsletterPuffHeadline:28,newsletterPuffCopy:15,pageComponentHeadline:25,pageHeadline:40,pageHeadlineLarge:50,pagingMeta:14,puffLink:11,secondary:16,sliceHeadline:32,smallestHeadline:20,smallHeadline:22,strapline:22,teaser:14,tertiary:15,tertiaryTwitter:14,tileLeadHeadline:35,heading2Mobile:25,heading3Mobile:22,heading4Mobile:19,heading5Mobile:17,infoSubText:18,heading2:28,heading3:24,heading4:20,heading5:19};function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const x={indepth:{},magazinecomment:B(B({},s),c),magazinestandard:B(B({},s),c),maincomment:B({},s),mainstandard:B({},s),takeoverpage:{}},H={culture:"cultureMagazine",Culture:"cultureMagazine",style:"styleMagazine",Style:"styleMagazine","The Sunday Times Magazine":"stMagazine",thesundaytimesmagazine:"stMagazine","the sunday times magazine":"stMagazine"},R={indepth:H,magazinecomment:H,magazinestandard:H,maincomment:{},mainstandard:{},takeoverpage:{}},E=(e,t)=>x[t][e],W=(e,t,n)=>R[n][t]||e,A=(e,t)=>e&&"style"===e.toLowerCase()&&["indepth","magazinestandard","magazinecomment"].includes(t)?"none":null;var L=(e,t)=>{const n=e||"default",r=t||"mainstandard";return{dropCapFont:W("dropCap",n,r),headlineFont:W("headline",n,r),pullQuoteFont:W("headlineRegular",n,r),sectionColour:E(n,r),headlineCase:n.length?A(n,r):null}},G=Object.freeze({large:"large",medium:"medium",xlarge:"xlarge"});const _={tabletHeadline:{marginBottom:5},tabletTeaser:{marginTop:5}};var I=e=>"".concat((e=>5*e)(e),"px");const N=z.nativeTablet,q=z.nativeTabletWide;var Q=()=>({Animations:y,colours:g,fontFactory:P,fonts:T,fontSizes:S,lineHeight:F,spacing:I});n.d(t,"styleguide",(function(){return Q})),n.d(t,"Animations",(function(){return y})),n.d(t,"breakpoints",(function(){return z})),n.d(t,"colours",(function(){return g})),n.d(t,"editionBreakpoints",(function(){return O})),n.d(t,"editionBreakpointWidths",(function(){return v})),n.d(t,"editionMaxWidth",(function(){return M})),n.d(t,"sliceContentMaxWidth",(function(){return 1180})),n.d(t,"fonts",(function(){return T})),n.d(t,"fontFactory",(function(){return P})),n.d(t,"fontSizes",(function(){return S})),n.d(t,"getEditionBreakpoint",(function(){return D})),n.d(t,"lineHeight",(function(){return F})),n.d(t,"scales",(function(){return G})),n.d(t,"spacing",(function(){return I})),n.d(t,"globalSpacingStyles",(function(){return _})),n.d(t,"tabletRowPadding",(function(){return 20})),n.d(t,"tabletWidth",(function(){return N})),n.d(t,"tabletWidthMax",(function(){return q})),n.d(t,"themeFactory",(function(){return L}))}]);
|
|
1
|
+
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=require("styled-components")},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";n.r(t);n(1);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const o={artsfeatures:"#622956",bricksmortar:"#006469",business:"#005B8D",comment:"#850029",culture:"#7B0046",default:"#1D1D1B",defcon:"#FF1D25",driving:"#C04605",focus:"#CC0000",gardening:"#00313B",home:"#8D724D",ireland:"#004E45",law:"#691D26",money:"#006A74",news:"#13354E",newsreview:"#004D6D",puzzle:"#C74600",register:"#6C6C69",saturdayreview:"#A31D24",scotland:"#00233E",sport:"#008347",style:"#BC3385",techgames:"#1A1F24",thedish:"#DB133B",thegame:"#006469",thesundaytimesmagazine:"#1D1D1D",thetimesmagazine:"#1D1D1D",times2:"#622956",todaysmagazines:"#1D1D1B",travel:"#2C79AD",weekend:"#05829A",world:"#636C17"},l={"Arts & Features":o.artsfeatures,"Bricks & Mortar":o.bricksmortar,Business:o.business,Comment:o.comment,Culture:o.culture,Driving:o.driving,Focus:o.focus,Gardening:o.gardening,Home:o.home,Ireland:o.ireland,Law:o.law,Money:o.money,News:o.news,"News Review":o.newsreview,Puzzles:o.puzzle,Register:o.register,"Saturday Review":o.saturdayreview,Scotland:o.scotland,Sport:o.sport,Style:o.style,"Tech & Games":o.techgames,"The Dish":o.thedish,"The Game":o.thegame,"The Sunday Times Magazine":o.thesundaytimesmagazine,"The Times Magazine":o.thetimesmagazine,Times2:o.times2,"Today's Magazines":o.todaysmagazines,Travel:o.travel,Weekend:o.weekend,World:o.world},d={thesundaytimesmagazine:"#F13D00"},s={"The Sunday Times Magazine":d.thesundaytimesmagazine},u=a(a({},o),l),c=a(a({},d),s);var g={functional:{action:"#006699",actionPressed:"#0077B3",articleFlagExclusive:"#C51D24",articleFlagNew:"#E34605",articleFlagUpdated:"#3C81BE",backgroundPrimary:"#F9F9F9",backgroundSecondary:"#EDEDED",black:"#000000",border:"#F0F0F0",brandColour:"#1D1D1B",bullet:"#103546",contrast:"#FFFFFF",darkSupplement:"#272D34",greyLabel:"#CCC",greyStickyBarBoxShadow:"#c9c7c7ed",greyStickyBarBorderBottom:"#ffffffdb",gutter:"#f0f0f0",keyline:"#DBDBDB",modalBackground:"#000000",newsletterPuffBackground:"#F9F8F3",overlayGradientEnd:"#00000000",overlayGradientFallback:"#000000B3",overlayGradientStart:"#000000E6",primary:"#333333",secondary:"#696969",tertiary:"#4D4D4D",transparentBlack:"rgba(0, 0, 0, 0.6)",transparentWhite:"rgba(255, 255, 255, 0.3)",white:"#FFFFFF",whiteGrey:"#F5F5F5"},secondarySectionColours:c,section:u},m=n(0),f=n.n(m),b=f.a.div.withConfig({displayName:"TsTcView",componentId:"sc-154dp5w-0"})(["border:0px solid black;box-sizing:border-box;display:flex;flex-direction:column;margin:",";border-bottom-color:",";border-bottom-width:",";border-radius:",";overflow:",";height:",";width:",";margin:0px;min-height:0px;min-width:0px;padding:0px;position:relative;z-index:0;"],e=>{let t=e.style;return t&&t.margin?t.margin:"0px"},e=>{let t=e.style;return t&&t.borderBottomColor?t.borderBottomColor:"black"},e=>{let t=e.style;return t&&t.borderBottomWidth?t.borderBottomWidth:"0px"},e=>{let t=e.style;return t&&t.borderRadius&&t.borderRadius},e=>{let t=e.style;return t&&t.overflow&&t.overflow},e=>{let t=e.style;return t&&t.height&&t.height},e=>{let t=e.style;return t&&t.width&&t.width});const p=Object(m.keyframes)(["from{opacity:0;}to{opacity:1;}"]);var y={FadeIn:f()(b).withConfig({displayName:"Animations__FadeIn",componentId:"w31u4-0"})(["animation:"," 0.3s ease-in-out;"],p)};function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const M={huge:"huge",medium:"medium",small:"small",wide:"wide"},O={huge:1366,medium:768,wide:1024},T=O.huge,v=e=>e<O.medium?M.small:e<O.wide?M.medium:e<O.huge?M.wide:M.huge;var D=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({editionBreakpoints:M,editionMaxWidth:T,editionBreakpointWidths:O,sliceContentMaxWidth:1180},{huge:1320,medium:768,nativeTablet:660,nativeTabletWide:1194,small:520,wide:1024});const k={body:{bodyMobile:30,puffLink:15,secondary:27,teaser:20,tertiary:26},bodyRegular:{infoSubText:23,infoTitle:30,pageComponentHeadline:25},bodyRegularSmallCaps:{cardMetaMobile:12,meta:14},cultureMagazine:{headline:35,pageHeadline:42},headline:{articleHeadline:45,commentsHeadline:29,headline:33,infoTitle:22,leadHeadline:26,pageComponentHeadline:27,pageHeadline:40,smallHeadline:27,tileLeadHeadline:35,heading2Mobile:26,heading3Mobile:26,heading4Mobile:26,heading5Mobile:26},headlineRegular:{pageComponentHeadline:30,smallestHeadline:26,strapline:24},stMagazine:{headline:35,pageHeadline:42},styleMagazine:{headline:35,pageHeadline:42},supporting:{button:16,caption:13,cardMeta:15,cardMetaMobile:14,keyFactsTitle:18,link:13,linkTopic:12,meta:14,pagingMeta:15,tertiary:17}};var z=e=>{let t=e.font,n=e.fontSize;return k[t][n]},F={body:"TimesDigitalW04",bodyRegular:"TimesDigitalW04-Regular",bodyRegularSmallCaps:"TimesDigitalW04-RegularSC",cultureMagazine:"TimesModern-Bold",dropCap:"TimesModern-Regular",headline:"TimesModern-Bold",headlineRegular:"TimesModern-Regular",stMagazine:"TimesModern-Bold",styleMagazine:"TimesModern-Bold",supporting:"Roboto-Regular"},B={body:"TimesDigitalW04, TimesDigitalW04-fallback, serif",bodyRegular:"TimesDigitalW04-Regular, TimesDigitalW04-Regular-fallback, serif",bodyRegularSmallCaps:"TimesDigitalW04-RegularSC, TimesDigitalW04-RegularSC-fallback, serif",cultureMagazine:"TimesModern-Bold, TimesModern-Bold-fallback, serif",dropCap:"TimesModern-Regular, TimesModern-Regular-fallback, serif",headline:"TimesModern-Bold, TimesModern-Bold-fallback, serif",headlineRegular:"TimesModern-Regular, TimesModern-Regular-fallback, serif",stMagazine:"TimesModern-Bold, TimesModern-Bold-fallback, serif",styleMagazine:"TimesModern-Bold, TimesModern-Bold-fallback, serif",supporting:"Roboto-Regular, Roboto-Regular-fallback, sans-serif"},j=e=>{let t=e.font,n=e.fontSize;return{fontFamily:U().fontsWithFallback[t],fontSize:C[n],lineHeight:z({font:t,fontSize:n})}},C={articleHeadline:45,articleMeta:15,body:18,bodyMobile:17,button:15,caption:12,cardHeadline:27,cardMeta:12,cardMetaMobile:12,commentsGuidelines:12,commentsHeadline:27,credits:9,headline:30,imageOverlayTextSmall:11,infoTitle:22,keyFactsTitle:24,leadHeadline:26,link:13,linkTopic:12,meta:13,newsletterPuffLabel:12,newsletterPuffHeadline:28,newsletterPuffCopy:15,pageComponentHeadline:25,pageHeadline:40,pageHeadlineLarge:50,pagingMeta:14,puffLink:11,secondary:16,sliceHeadline:32,smallestHeadline:20,smallHeadline:22,strapline:22,teaser:14,tertiary:15,tertiaryTwitter:14,tileLeadHeadline:35,heading2Mobile:25,heading3Mobile:22,heading4Mobile:19,heading5Mobile:17,infoSubText:18,heading2:28,heading3:24,heading4:20,heading5:19};function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const x={indepth:{},magazinecomment:P(P({},u),c),magazinestandard:P(P({},u),c),maincomment:P({},u),mainstandard:P({},u),takeoverpage:{}},H={culture:"cultureMagazine",Culture:"cultureMagazine",style:"styleMagazine",Style:"styleMagazine","The Sunday Times Magazine":"stMagazine",thesundaytimesmagazine:"stMagazine","the sunday times magazine":"stMagazine"},W={indepth:H,magazinecomment:H,magazinestandard:H,maincomment:{},mainstandard:{},takeoverpage:{}},E=(e,t)=>x[t][e],A=(e,t,n)=>W[n][t]||e,L=(e,t)=>e&&"style"===e.toLowerCase()&&["indepth","magazinestandard","magazinecomment"].includes(t)?"none":null;var G=(e,t)=>{const n=e||"default",r=t||"mainstandard";return{dropCapFont:A("dropCap",n,r),headlineFont:A("headline",n,r),pullQuoteFont:A("headlineRegular",n,r),sectionColour:E(n,r),headlineCase:n.length?L(n,r):null}},_=Object.freeze({large:"large",medium:"medium",xlarge:"xlarge"});const I={tabletHeadline:{marginBottom:5},tabletTeaser:{marginTop:5}};var N=e=>"".concat((e=>5*e)(e),"px");const q=D.nativeTablet,Q=D.nativeTabletWide;var U=()=>({Animations:y,colours:g,fontFactory:j,fonts:F,fontsWithFallback:B,fontSizes:C,lineHeight:z,spacing:N});n.d(t,"styleguide",(function(){return U})),n.d(t,"Animations",(function(){return y})),n.d(t,"breakpoints",(function(){return D})),n.d(t,"colours",(function(){return g})),n.d(t,"editionBreakpoints",(function(){return M})),n.d(t,"editionBreakpointWidths",(function(){return O})),n.d(t,"editionMaxWidth",(function(){return T})),n.d(t,"sliceContentMaxWidth",(function(){return 1180})),n.d(t,"fonts",(function(){return F})),n.d(t,"fontFactory",(function(){return j})),n.d(t,"fontSizes",(function(){return C})),n.d(t,"fontsWithFallback",(function(){return B})),n.d(t,"getEditionBreakpoint",(function(){return v})),n.d(t,"lineHeight",(function(){return z})),n.d(t,"scales",(function(){return _})),n.d(t,"spacing",(function(){return N})),n.d(t,"globalSpacingStyles",(function(){return I})),n.d(t,"tabletRowPadding",(function(){return 20})),n.d(t,"tabletWidth",(function(){return q})),n.d(t,"tabletWidthMax",(function(){return Q})),n.d(t,"themeFactory",(function(){return G}))}]);
|
package/src/index.ts
CHANGED
|
@@ -10,7 +10,12 @@ import breakpoints, {
|
|
|
10
10
|
sliceContentMaxWidth
|
|
11
11
|
} from './breakpoints';
|
|
12
12
|
import lineHeight from './lineHeight';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
timesFontFactory,
|
|
15
|
+
timesFontSizes,
|
|
16
|
+
fontStyles,
|
|
17
|
+
fontStylesWithFallback
|
|
18
|
+
} from './fonts/fonts';
|
|
14
19
|
import themeFactory from './themeFactory';
|
|
15
20
|
|
|
16
21
|
import scales from './scales';
|
|
@@ -26,6 +31,7 @@ export default () => {
|
|
|
26
31
|
colours,
|
|
27
32
|
fontFactory: timesFontFactory,
|
|
28
33
|
fonts: fontStyles,
|
|
34
|
+
fontsWithFallback: fontStylesWithFallback,
|
|
29
35
|
fontSizes: timesFontSizes,
|
|
30
36
|
lineHeight,
|
|
31
37
|
spacing
|
|
@@ -41,6 +47,7 @@ export {
|
|
|
41
47
|
editionMaxWidth,
|
|
42
48
|
sliceContentMaxWidth,
|
|
43
49
|
fontStyles as fonts,
|
|
50
|
+
fontStylesWithFallback as fontsWithFallback,
|
|
44
51
|
timesFontFactory as fontFactory,
|
|
45
52
|
timesFontSizes as fontSizes,
|
|
46
53
|
getEditionBreakpoint,
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
|
|
4
|
-
import styleguide, {
|
|
4
|
+
import styleguide, {
|
|
5
|
+
colours,
|
|
6
|
+
fonts,
|
|
7
|
+
fontsWithFallback,
|
|
8
|
+
spacing
|
|
9
|
+
} from '../Styleguide';
|
|
5
10
|
import { Animations, TsTcText, TsTcView } from '../components';
|
|
6
11
|
|
|
7
12
|
import styles from '../helpers/storybookStyles';
|
|
@@ -41,11 +46,21 @@ describe('styleguide', () => {
|
|
|
41
46
|
expect(typeof fonts).toBe('object');
|
|
42
47
|
});
|
|
43
48
|
|
|
49
|
+
it('should render the object of font and fallback references', () => {
|
|
50
|
+
expect(typeof fontsWithFallback).toBe('object');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('should render the supporting font roboto should correctly show font and fallback references', () => {
|
|
54
|
+
expect(fontsWithFallback.supporting).toEqual(
|
|
55
|
+
'Roboto-Regular, Roboto-Regular-fallback, sans-serif'
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
|
|
44
59
|
it('should return object when fontFactory is called', () => {
|
|
45
60
|
expect(
|
|
46
61
|
styleguide().fontFactory({ font: 'headline', fontSize: 'body' })
|
|
47
62
|
).toEqual({
|
|
48
|
-
fontFamily: 'TimesModern-Bold',
|
|
63
|
+
fontFamily: 'TimesModern-Bold, TimesModern-Bold-fallback, serif',
|
|
49
64
|
fontSize: 18,
|
|
50
65
|
lineHeight: undefined
|
|
51
66
|
});
|
|
@@ -9,8 +9,6 @@ export default styled.div<{ style?: Style }>`
|
|
|
9
9
|
color: ${({ style }) =>
|
|
10
10
|
style && style.color ? style.color : 'rgb(0, 0, 0)'};
|
|
11
11
|
display: inline;
|
|
12
|
-
font: 14px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
13
|
-
Ubuntu, 'Helvetica Neue', sans-serif;
|
|
14
12
|
margin: 0px;
|
|
15
13
|
padding: 0px;
|
|
16
14
|
white-space: pre-wrap;
|
|
@@ -25,7 +23,5 @@ export default styled.div<{ style?: Style }>`
|
|
|
25
23
|
margin-top: ${({ style }) =>
|
|
26
24
|
style && style.marginTop ? style.marginTop : '0px'};
|
|
27
25
|
font-family: ${({ style }) =>
|
|
28
|
-
style && style.fontFamily
|
|
29
|
-
? style.fontFamily
|
|
30
|
-
: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif'};
|
|
26
|
+
style && style.fontFamily ? style.fontFamily : 'sans-serif'};
|
|
31
27
|
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
body: 'TimesDigitalW04, TimesDigitalW04-fallback, serif',
|
|
3
|
+
bodyRegular:
|
|
4
|
+
'TimesDigitalW04-Regular, TimesDigitalW04-Regular-fallback, serif',
|
|
5
|
+
bodyRegularSmallCaps:
|
|
6
|
+
'TimesDigitalW04-RegularSC, TimesDigitalW04-RegularSC-fallback, serif',
|
|
7
|
+
cultureMagazine: 'TimesModern-Bold, TimesModern-Bold-fallback, serif',
|
|
8
|
+
dropCap: 'TimesModern-Regular, TimesModern-Regular-fallback, serif',
|
|
9
|
+
headline: 'TimesModern-Bold, TimesModern-Bold-fallback, serif',
|
|
10
|
+
headlineRegular: 'TimesModern-Regular, TimesModern-Regular-fallback, serif',
|
|
11
|
+
stMagazine: 'TimesModern-Bold, TimesModern-Bold-fallback, serif',
|
|
12
|
+
styleMagazine: 'TimesModern-Bold, TimesModern-Bold-fallback, serif',
|
|
13
|
+
supporting: 'Roboto-Regular, Roboto-Regular-fallback, sans-serif'
|
|
14
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fontStyles from './font-styles';
|
|
2
|
+
import fontStylesWithFallback from './font-styles-with-fallback';
|
|
2
3
|
import timesFontFactory from './font-factory';
|
|
3
4
|
import timesFontSizes from './font-sizes';
|
|
4
5
|
|
|
5
|
-
export { fontStyles, timesFontSizes, timesFontFactory };
|
|
6
|
+
export { fontStyles, timesFontSizes, timesFontFactory, fontStylesWithFallback };
|