@times-components/ts-components 1.25.1 → 1.26.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.
Files changed (101) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/__mocks__/isomorphic-unfetch.d.ts +3 -0
  3. package/dist/__mocks__/isomorphic-unfetch.js +4 -0
  4. package/dist/components/opta/football/fixtures/OptaFootballFixtures.js +5 -4
  5. package/dist/components/opta/football/fixtures/__tests__/OptaFootballFixtures.test.d.ts +2 -0
  6. package/dist/components/opta/football/fixtures/__tests__/OptaFootballFixtures.test.js +41 -0
  7. package/dist/components/opta/football/match-stats/OptaFootballMatchStats.js +4 -3
  8. package/dist/components/opta/football/match-stats/__tests__/OptaFootballMatchStats.test.d.ts +2 -0
  9. package/dist/components/opta/football/match-stats/__tests__/OptaFootballMatchStats.test.js +40 -0
  10. package/dist/components/opta/football/standings/OptaFootballStandings.js +4 -3
  11. package/dist/components/opta/football/standings/__tests__/OptaFootballStandings.test.d.ts +2 -0
  12. package/dist/components/opta/football/standings/__tests__/OptaFootballStandings.test.js +39 -0
  13. package/dist/components/opta/football/summary/OptaFootballSummary.js +4 -3
  14. package/dist/components/opta/football/summary/__tests__/OptaFootballSummary.test.d.ts +2 -0
  15. package/dist/components/opta/football/summary/__tests__/OptaFootballSummary.test.js +40 -0
  16. package/dist/components/opta/rugby/fixtures/OptaRugbyFixtures.d.ts +8 -0
  17. package/dist/components/opta/rugby/fixtures/OptaRugbyFixtures.js +54 -0
  18. package/dist/components/opta/rugby/fixtures/OptaRugbyFixtures.stories.d.ts +1 -0
  19. package/dist/components/opta/rugby/fixtures/OptaRugbyFixtures.stories.js +26 -0
  20. package/dist/components/opta/rugby/fixtures/__tests__/OptaRugbyFixtures.test.d.ts +2 -0
  21. package/dist/components/opta/rugby/fixtures/__tests__/OptaRugbyFixtures.test.js +41 -0
  22. package/dist/components/opta/rugby/fixtures/styles.d.ts +2 -0
  23. package/dist/components/opta/rugby/fixtures/styles.js +255 -0
  24. package/dist/components/opta/rugby/match-stats/OptaRugbyMatchStats.d.ts +7 -0
  25. package/dist/components/opta/rugby/match-stats/OptaRugbyMatchStats.js +43 -0
  26. package/dist/components/opta/rugby/match-stats/OptaRugbyMatchStats.stories.d.ts +1 -0
  27. package/dist/components/opta/rugby/match-stats/OptaRugbyMatchStats.stories.js +26 -0
  28. package/dist/components/opta/rugby/match-stats/__tests__/OptaRugbyMatchStats.test.d.ts +2 -0
  29. package/dist/components/opta/rugby/match-stats/__tests__/OptaRugbyMatchStats.test.js +40 -0
  30. package/dist/components/opta/rugby/match-stats/styles.d.ts +1 -0
  31. package/dist/components/opta/rugby/match-stats/styles.js +153 -0
  32. package/dist/components/opta/rugby/shared-styles.d.ts +6 -0
  33. package/dist/components/opta/rugby/shared-styles.js +72 -0
  34. package/dist/components/opta/rugby/standings/OptaRugbyStandings.d.ts +8 -0
  35. package/dist/components/opta/rugby/standings/OptaRugbyStandings.js +36 -0
  36. package/dist/components/opta/rugby/standings/OptaRugbyStandings.stories.d.ts +1 -0
  37. package/dist/components/opta/rugby/standings/OptaRugbyStandings.stories.js +36 -0
  38. package/dist/components/opta/rugby/standings/__tests__/OptaRugbyStandings.test.d.ts +2 -0
  39. package/dist/components/opta/rugby/standings/__tests__/OptaRugbyStandings.test.js +39 -0
  40. package/dist/components/opta/rugby/standings/styles.d.ts +1 -0
  41. package/dist/components/opta/rugby/standings/styles.js +247 -0
  42. package/dist/components/opta/rugby/summary/OptaRugbySummary.d.ts +7 -0
  43. package/dist/components/opta/rugby/summary/OptaRugbySummary.js +44 -0
  44. package/dist/components/opta/rugby/summary/OptaRugbySummary.stories.d.ts +1 -0
  45. package/dist/components/opta/rugby/summary/OptaRugbySummary.stories.js +26 -0
  46. package/dist/components/opta/rugby/summary/__tests__/OptaRugbySummary.test.d.ts +2 -0
  47. package/dist/components/opta/rugby/summary/__tests__/OptaRugbySummary.test.js +40 -0
  48. package/dist/components/opta/rugby/summary/styles.d.ts +1 -0
  49. package/dist/components/opta/rugby/summary/styles.js +152 -0
  50. package/dist/components/opta/utils/__tests__/config.test.d.ts +1 -0
  51. package/dist/components/opta/utils/__tests__/config.test.js +24 -0
  52. package/dist/components/opta/utils/config.d.ts +1 -1
  53. package/dist/components/opta/utils/config.js +12 -3
  54. package/dist/helpers/fetch/FetchProvider.js +3 -3
  55. package/dist/helpers/fetch/__tests__/FetchProvider.test.d.ts +0 -1
  56. package/dist/helpers/fetch/__tests__/FetchProvider.test.js +17 -23
  57. package/dist/index.d.ts +4 -0
  58. package/dist/index.js +5 -1
  59. package/jest.config.js +4 -4
  60. package/package.json +6 -5
  61. package/rnw.js +1 -1
  62. package/src/__mocks__/isomorphic-unfetch.ts +3 -0
  63. package/src/components/opta/football/fixtures/OptaFootballFixtures.tsx +5 -3
  64. package/src/components/opta/football/fixtures/__tests__/OptaFootballFixtures.test.tsx +53 -0
  65. package/src/components/opta/football/fixtures/__tests__/__snapshots__/OptaFootballFixtures.test.tsx.snap +34 -0
  66. package/src/components/opta/football/match-stats/OptaFootballMatchStats.tsx +4 -2
  67. package/src/components/opta/football/match-stats/__tests__/OptaFootballMatchStats.test.tsx +52 -0
  68. package/src/components/opta/football/match-stats/__tests__/__snapshots__/OptaFootballMatchStats.test.tsx.snap +34 -0
  69. package/src/components/opta/football/standings/OptaFootballStandings.tsx +4 -2
  70. package/src/components/opta/football/standings/__tests__/OptaFootballStandings.test.tsx +51 -0
  71. package/src/components/opta/football/standings/__tests__/__snapshots__/OptaFootballStandings.test.tsx.snap +34 -0
  72. package/src/components/opta/football/summary/OptaFootballSummary.tsx +4 -2
  73. package/src/components/opta/football/summary/__tests__/OptaFootballSummary.test.tsx +52 -0
  74. package/src/components/opta/football/summary/__tests__/__snapshots__/OptaFootballSummary.test.tsx.snap +34 -0
  75. package/src/components/opta/rugby/fixtures/OptaRugbyFixtures.stories.tsx +44 -0
  76. package/src/components/opta/rugby/fixtures/OptaRugbyFixtures.tsx +86 -0
  77. package/src/components/opta/rugby/fixtures/__tests__/OptaRugbyFixtures.test.tsx +53 -0
  78. package/src/components/opta/rugby/fixtures/__tests__/__snapshots__/OptaRugbyFixtures.test.tsx.snap +34 -0
  79. package/src/components/opta/rugby/fixtures/styles.ts +257 -0
  80. package/src/components/opta/rugby/match-stats/OptaRugbyMatchStats.stories.tsx +34 -0
  81. package/src/components/opta/rugby/match-stats/OptaRugbyMatchStats.tsx +71 -0
  82. package/src/components/opta/rugby/match-stats/__tests__/OptaRugbyMatchStats.test.tsx +52 -0
  83. package/src/components/opta/rugby/match-stats/__tests__/__snapshots__/OptaRugbyMatchStats.test.tsx.snap +34 -0
  84. package/src/components/opta/rugby/match-stats/styles.ts +154 -0
  85. package/src/components/opta/rugby/shared-styles.ts +75 -0
  86. package/src/components/opta/rugby/standings/OptaRugbyStandings.stories.tsx +49 -0
  87. package/src/components/opta/rugby/standings/OptaRugbyStandings.tsx +66 -0
  88. package/src/components/opta/rugby/standings/__tests__/OptaRugbyStandings.test.tsx +51 -0
  89. package/src/components/opta/rugby/standings/__tests__/__snapshots__/OptaRugbyStandings.test.tsx.snap +34 -0
  90. package/src/components/opta/rugby/standings/styles.ts +248 -0
  91. package/src/components/opta/rugby/summary/OptaRugbySummary.stories.tsx +34 -0
  92. package/src/components/opta/rugby/summary/OptaRugbySummary.tsx +71 -0
  93. package/src/components/opta/rugby/summary/__tests__/OptaRugbySummary.test.tsx +52 -0
  94. package/src/components/opta/rugby/summary/__tests__/__snapshots__/OptaRugbySummary.test.tsx.snap +34 -0
  95. package/src/components/opta/rugby/summary/styles.ts +153 -0
  96. package/src/components/opta/utils/__tests__/config.test.tsx +38 -0
  97. package/src/components/opta/utils/config.ts +13 -3
  98. package/src/helpers/fetch/FetchProvider.tsx +2 -2
  99. package/src/helpers/fetch/__tests__/FetchProvider.test.tsx +21 -31
  100. package/src/helpers/fetch/__tests__/__snapshots__/FetchProvider.test.tsx.snap +10 -2
  101. package/src/index.ts +14 -0
@@ -0,0 +1,257 @@
1
+ import styled from 'styled-components';
2
+ import { breakpoints, colours, fonts } from '@times-components/styleguide';
3
+
4
+ import { WidgetContainerBase } from '../shared-styles';
5
+
6
+ export const WidgetContainerOverride = styled(WidgetContainerBase)`
7
+ .Opta {
8
+ h2 {
9
+ margin: 20px 0 0 0 !important;
10
+ }
11
+
12
+ .Opta-js-main {
13
+ table {
14
+ tbody {
15
+ td.Opta-title {
16
+ background-color: transparent !important;
17
+ border-bottom: 1px solid #e4e4e4;
18
+
19
+ h3 {
20
+ margin: 20px 0 0 0 !important;
21
+ font-family: ${fonts.headline} !important;
22
+ font-size: 16px !important;
23
+ line-height: 30px !important;
24
+ text-align: center;
25
+
26
+ span {
27
+ font-size: inherit;
28
+ }
29
+
30
+ @media (min-width: ${breakpoints.medium}px) {
31
+ font-size: 18px !important;
32
+ line-height: 40px !important;
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ `;
41
+
42
+ export const WidgetContainer = styled(WidgetContainerBase)`
43
+ .Opta {
44
+ .Opta-js-main {
45
+ padding: 0;
46
+ background-color: transparent;
47
+
48
+ table {
49
+ tbody {
50
+ td.Opta-title {
51
+ height: 40px;
52
+ background-color: ${colours.functional.backgroundSecondary};
53
+
54
+ h3 {
55
+ height: auto;
56
+ margin: 0 0 0 10px;
57
+ color: ${colours.functional.brandColour};
58
+ font-family: ${fonts.supporting};
59
+ font-size: 14px;
60
+ line-height: 14px;
61
+ font-weight: normal;
62
+ background-color: transparent;
63
+ border-bottom: 0;
64
+
65
+ span {
66
+ float: none;
67
+ padding: 0;
68
+ }
69
+
70
+ @media (min-width: ${breakpoints.medium}px) {
71
+ margin: 0 0 0 20px;
72
+ }
73
+ }
74
+ }
75
+
76
+ tr.Opta-Scoreline {
77
+ height: 40px;
78
+ background-color: transparent !important;
79
+ border-bottom: 1px solid #e4e4e4;
80
+
81
+ @media (min-width: ${breakpoints.medium}px) {
82
+ height: 50px;
83
+ }
84
+
85
+ td {
86
+ max-width: none !important;
87
+ padding: 3px 0 0 0;
88
+ color: ${colours.functional.brandColour} !important;
89
+ font-family: ${fonts.headline};
90
+ font-size: 14px;
91
+ line-height: 14px;
92
+ background-color: transparent;
93
+
94
+ &.Opta-Time {
95
+ width: 50px !important;
96
+ padding: 6px 0 0 10px;
97
+ color: ${colours.section.sport} !important;
98
+ font-family: ${fonts.supporting};
99
+
100
+ abbr {
101
+ font-size: inherit;
102
+ line-height: inherit;
103
+ text-decoration: none;
104
+ }
105
+
106
+ @media (min-width: ${breakpoints.medium}px) {
107
+ width: 60px !important;
108
+ padding: 6px 0 0 20px;
109
+ font-size: 14px;
110
+ line-height: 14px;
111
+ }
112
+ }
113
+
114
+ &.Opta-Team {
115
+ width: 30% !important;
116
+ padding-left: 10px;
117
+
118
+ &.Opta-Home {
119
+ padding-right: 10px;
120
+ padding-left: 0;
121
+ text-align: right;
122
+ }
123
+
124
+ @media (min-width: ${breakpoints.medium}px) {
125
+ padding-left: 15px;
126
+
127
+ &.Opta-Home {
128
+ padding-right: 15px;
129
+ padding-left: 0;
130
+ }
131
+ }
132
+ }
133
+
134
+ &.Opta-Score {
135
+ width: 25px !important;
136
+ font-size: 16px;
137
+ line-height: 16px;
138
+ text-align: left !important;
139
+
140
+ &.Opta-Home {
141
+ text-align: right !important;
142
+ }
143
+
144
+ span {
145
+ font-size: inherit;
146
+ line-height: inherit;
147
+ }
148
+
149
+ @media (min-width: ${breakpoints.medium}px) {
150
+ width: 30px !important;
151
+ font-size: 24px;
152
+ line-height: 24px;
153
+ }
154
+ }
155
+
156
+ &.Opta-Crest {
157
+ width: 20px !important;
158
+ margin-top: -3px;
159
+
160
+ img {
161
+ width: 20px;
162
+ }
163
+ }
164
+
165
+ &.Opta-Divider {
166
+ width: 20px !important;
167
+ text-align: center;
168
+
169
+ abbr {
170
+ font-size: inherit;
171
+ line-height: inherit;
172
+ text-decoration: none;
173
+ }
174
+ }
175
+
176
+ &.Opta-Outer:not(.Opta-Time) {
177
+ width: 50px !important;
178
+ padding: 0 10px 0 0;
179
+
180
+ @media (min-width: ${breakpoints.medium}px) {
181
+ width: 60px !important;
182
+ padding: 0 20px 0 0;
183
+ }
184
+ }
185
+
186
+ @media (min-width: ${breakpoints.medium}px) {
187
+ font-size: 16px;
188
+ line-height: 16px;
189
+ }
190
+ }
191
+ }
192
+
193
+ tr.Opta-agg {
194
+ background-color: transparent !important;
195
+
196
+ td {
197
+ padding: 10px;
198
+ color: ${colours.functional.primary};
199
+ font-family: ${fonts.supporting};
200
+ font-size: 14px;
201
+ line-height: 16px;
202
+ background-color: transparent;
203
+
204
+ span {
205
+ font-size: inherit;
206
+ line-height: inherit;
207
+ }
208
+
209
+ span.Opta-agg-text {
210
+ text-transform: uppercase;
211
+ }
212
+ }
213
+ }
214
+
215
+ tr {
216
+ td.Opta-Nest {
217
+ padding: 0;
218
+
219
+ .Opta_W {
220
+ > .Opta-Cf {
221
+ background-color: transparent;
222
+ border-bottom: 1px solid #e4e4e4;
223
+
224
+ .Opta-Events {
225
+ padding: 10px 0 2px 0;
226
+
227
+ li {
228
+ padding: 0 0 8px 0;
229
+
230
+ .Opta-Event-Text {
231
+ color: ${colours.functional.primary};
232
+ font-family: ${fonts.supporting};
233
+ font-size: 14px;
234
+ line-height: 16px;
235
+
236
+ .Opta-Event-Player,
237
+ .Opta-Event-Time,
238
+ .Opta-Event-Text-Type {
239
+ font-size: inherit;
240
+ line-height: inherit;
241
+ }
242
+
243
+ .Opta-Event-Time {
244
+ color: ${colours.section.sport};
245
+ }
246
+ }
247
+ }
248
+ }
249
+ }
250
+ }
251
+ }
252
+ }
253
+ }
254
+ }
255
+ }
256
+ }
257
+ `;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { showcaseConverter } from '@times-components/storybook';
3
+
4
+ import { ArticleHarness } from '../../../../fixtures/article-harness/ArticleHarness';
5
+ import { OptaRugbyMatchStats } from './OptaRugbyMatchStats';
6
+
7
+ const showcase = {
8
+ children: [
9
+ {
10
+ decorator: (storyFn: () => React.ReactNode) => (
11
+ <ArticleHarness>{storyFn()}</ArticleHarness>
12
+ ),
13
+ type: 'decorator'
14
+ },
15
+ {
16
+ component: () => (
17
+ <OptaRugbyMatchStats season="2022" competition="209" match="921100" />
18
+ ),
19
+ name: 'MatchStats',
20
+ type: 'story'
21
+ },
22
+ {
23
+ component: () => (
24
+ <OptaRugbyMatchStats season="2022" competition="209" match="921087" />
25
+ ),
26
+ name: 'MatchStats (results)',
27
+ type: 'story'
28
+ }
29
+ ],
30
+ name: 'Typescript Component/In Article/Rugby/MatchStats'
31
+ };
32
+
33
+ // @ts-ignore
34
+ showcaseConverter(module, showcase);
@@ -0,0 +1,71 @@
1
+ import React, { useState, useEffect } from 'react';
2
+
3
+ import { Placeholder } from '@times-components/image';
4
+
5
+ import {
6
+ initSettings,
7
+ initStyleSheet,
8
+ initScript,
9
+ initElement,
10
+ initComponent
11
+ } from '../../utils/config';
12
+
13
+ import { Container, PlaceholderContainer } from '../shared-styles';
14
+ import { WidgetContainer } from './styles';
15
+
16
+ export const OptaRugbyMatchStats: React.FC<{
17
+ season: string;
18
+ competition: string;
19
+ match: string;
20
+ full_width?: boolean;
21
+ }> = React.memo(({ season, competition, match, full_width }) => {
22
+ const ref = React.createRef<HTMLDivElement>();
23
+
24
+ const [isReady, setIsReady] = useState<boolean>(false);
25
+
26
+ useEffect(() => {
27
+ const sport = 'rugby';
28
+
29
+ initSettings();
30
+ initStyleSheet(sport);
31
+
32
+ initScript().then(() => {
33
+ if (ref.current) {
34
+ ref.current.innerHTML = initElement('opta-widget', {
35
+ sport,
36
+ widget: 'matchstats',
37
+ season,
38
+ competition,
39
+ match,
40
+ template: 'custom',
41
+ graph_style: 'relative',
42
+ stats_categories:
43
+ 'Category 1|tries,passes,tackles,carries,metres,lineouts_won_percent,scrums_won_percent,turnovers_conceded,yellow_cards,red_cards',
44
+ live: true,
45
+ show_match_header: true,
46
+ show_halftime_score: true,
47
+ show_competition_name: true,
48
+ show_date: true,
49
+ show_crests: true,
50
+ date_format: 'DD/MM/YYYY',
51
+ breakpoints: '520'
52
+ }).outerHTML;
53
+
54
+ initComponent();
55
+ setIsReady(true);
56
+ }
57
+ });
58
+ }, []);
59
+
60
+ return (
61
+ <Container border={isReady} fullWidth={full_width}>
62
+ <WidgetContainer ref={ref} />
63
+
64
+ {!isReady && (
65
+ <PlaceholderContainer>
66
+ <Placeholder />
67
+ </PlaceholderContainer>
68
+ )}
69
+ </Container>
70
+ );
71
+ });
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { render, waitForElementToBeRemoved } from '@testing-library/react';
3
+
4
+ import 'regenerator-runtime';
5
+ import '@testing-library/jest-dom';
6
+
7
+ jest.mock('@times-components/image', () => ({
8
+ Placeholder: () => <>Placeholder</>
9
+ }));
10
+
11
+ const mockInitSettings = jest.fn();
12
+ const mockInitStyleSheet = jest.fn();
13
+ const mockInitComponent = jest.fn();
14
+
15
+ const mockInitElement = () => {
16
+ const element = document.createElement('div');
17
+ element.appendChild(document.createTextNode('Widget'));
18
+ return element;
19
+ };
20
+
21
+ jest.mock('../../../utils/config', () => ({
22
+ initSettings: mockInitSettings,
23
+ initStyleSheet: mockInitStyleSheet,
24
+ initScript: () => new Promise(resolve => resolve({})),
25
+ initElement: mockInitElement,
26
+ initComponent: mockInitComponent
27
+ }));
28
+
29
+ import { OptaRugbyMatchStats } from '../OptaRugbyMatchStats';
30
+
31
+ const requiredProps = {
32
+ season: '2022',
33
+ competition: '209',
34
+ match: '921100'
35
+ };
36
+
37
+ describe('OptaRugbyMatchStats', () => {
38
+ it('should render correctly', async () => {
39
+ const { asFragment, getByText } = render(
40
+ <OptaRugbyMatchStats {...requiredProps} />
41
+ );
42
+ expect(asFragment()).toMatchSnapshot();
43
+
44
+ await waitForElementToBeRemoved(getByText('Placeholder'));
45
+
46
+ expect(mockInitSettings).toHaveBeenCalledTimes(1);
47
+ expect(mockInitStyleSheet).toHaveBeenCalledTimes(1);
48
+ expect(mockInitComponent).toHaveBeenCalledTimes(1);
49
+
50
+ expect(asFragment()).toMatchSnapshot();
51
+ });
52
+ });
@@ -0,0 +1,34 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`OptaRugbyMatchStats should render correctly 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="sc-bdVaJa giUBsz"
7
+ >
8
+ <div
9
+ class="sc-htpNat sc-bxivhb ljTAFU"
10
+ />
11
+ <div
12
+ class="sc-bwzfXH kVYHKf"
13
+ >
14
+ Placeholder
15
+ </div>
16
+ </div>
17
+ </DocumentFragment>
18
+ `;
19
+
20
+ exports[`OptaRugbyMatchStats should render correctly 2`] = `
21
+ <DocumentFragment>
22
+ <div
23
+ class="sc-bdVaJa hGXeaj"
24
+ >
25
+ <div
26
+ class="sc-htpNat sc-bxivhb ljTAFU"
27
+ >
28
+ <div>
29
+ Widget
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </DocumentFragment>
34
+ `;
@@ -0,0 +1,154 @@
1
+ import styled from 'styled-components';
2
+ import { breakpoints, colours, fonts } from '@times-components/styleguide';
3
+
4
+ import { WidgetContainerBase } from '../shared-styles';
5
+
6
+ export const WidgetContainer = styled(WidgetContainerBase)`
7
+ .Opta {
8
+ h2 {
9
+ margin: 20px 0 10px 0 !important;
10
+ }
11
+
12
+ .Opta-Cf {
13
+ padding: 0;
14
+ background-color: transparent;
15
+
16
+ table {
17
+ tbody {
18
+ tr {
19
+ th.Opta-Stats-Bars-Text {
20
+ height: auto;
21
+ padding: 20px 0 0 0;
22
+ color: ${colours.functional.brandColour};
23
+ font-family: ${fonts.supporting};
24
+ font-size: 14px;
25
+ line-height: 14px;
26
+ }
27
+
28
+ td {
29
+ height: auto;
30
+ color: ${colours.functional.brandColour};
31
+ font-family: ${fonts.headline};
32
+ font-size: 18px;
33
+ line-height: 18px;
34
+ padding: 0;
35
+
36
+ &.Opta-Crest {
37
+ text-align: left;
38
+
39
+ &.Opta-Home {
40
+ text-align: right;
41
+ }
42
+
43
+ img {
44
+ width: 40px;
45
+ }
46
+ }
47
+
48
+ &.Opta-Team {
49
+ padding-left: 10px;
50
+ font-size: 18px;
51
+ line-height: 18px;
52
+
53
+ &.Opta-Home {
54
+ padding-right: 10px;
55
+ padding-left: 0;
56
+ text-align: right;
57
+ }
58
+ }
59
+
60
+ &.Opta-Score {
61
+ width: 20px;
62
+ font-size: 24px;
63
+ line-height: 24px;
64
+ text-align: left;
65
+
66
+ &.Opta-Home {
67
+ text-align: right;
68
+ }
69
+
70
+ span {
71
+ min-width: 0;
72
+ padding: 0;
73
+ color: inherit;
74
+ font-family: inherit;
75
+ font-size: inherit;
76
+ line-height: inherit;
77
+ text-align: inherit;
78
+ background-color: transparent !important;
79
+ }
80
+
81
+ @media (min-width: ${breakpoints.medium}px) {
82
+ width: 30px;
83
+ font-size: 32px;
84
+ line-height: 32px;
85
+ }
86
+ }
87
+
88
+ &.Opta-Divider {
89
+ width: 20px;
90
+ text-align: center;
91
+
92
+ abbr {
93
+ font-size: inherit;
94
+ line-height: inherit;
95
+ text-decoration: none;
96
+ }
97
+ }
98
+
99
+ .Opta-Bars {
100
+ margin: 0;
101
+
102
+ .Opta-Percent.Opta-Home {
103
+ background-color: ${colours.section.sport};
104
+ }
105
+
106
+ .Opta-Percent.Opta-Away {
107
+ background-color: ${colours.section.sport};
108
+ opacity: 0.5;
109
+ }
110
+ }
111
+ }
112
+
113
+ &.Opta-Score-Extras {
114
+ td {
115
+ color: ${colours.functional.brandColour};
116
+ font-family: ${fonts.supporting};
117
+ font-size: 14px;
118
+ line-height: 28px;
119
+
120
+ span {
121
+ color: inherit;
122
+ font-size: inherit;
123
+ }
124
+ }
125
+ }
126
+
127
+ &.Opta-MatchHeader-Details {
128
+ div {
129
+ padding: 0;
130
+ color: ${colours.section.sport};
131
+ font-family: ${fonts.supporting};
132
+ font-size: 12px;
133
+ line-height: 12px;
134
+ letter-spacing: 1px;
135
+ text-transform: uppercase;
136
+ background-color: transparent;
137
+
138
+ span {
139
+ margin: 0 6px;
140
+ color: inherit;
141
+ font-size: inherit;
142
+ }
143
+ }
144
+ }
145
+ }
146
+ }
147
+
148
+ &.Opta-Stats-Bars {
149
+ margin-bottom: 20px;
150
+ }
151
+ }
152
+ }
153
+ }
154
+ `;
@@ -0,0 +1,75 @@
1
+ import styled from 'styled-components';
2
+ import { breakpoints, colours, fonts } from '@times-components/styleguide';
3
+
4
+ export const Container = styled.div<{ border: boolean; fullWidth?: boolean }>`
5
+ margin: 0 auto 20px auto;
6
+ background-color: ${colours.functional.backgroundPrimary};
7
+ border-top: ${({ border }) =>
8
+ border ? `2px solid ${colours.section.sport}` : 'none'};
9
+
10
+ a {
11
+ text-decoration: none;
12
+ }
13
+
14
+ @media (min-width: ${breakpoints.medium}px) {
15
+ flex-direction: row;
16
+ width: ${({ fullWidth }) => (fullWidth ? '100%' : '80.8%')};
17
+ }
18
+
19
+ @media (min-width: ${breakpoints.wide}px) {
20
+ width: ${({ fullWidth }) => (fullWidth ? '100%' : '56.2%')};
21
+ }
22
+ `;
23
+
24
+ export const PlaceholderContainer = styled.div`
25
+ position: relative;
26
+ height: 200px;
27
+ `;
28
+
29
+ export const WidgetContainerBase = styled.div`
30
+ .Opta {
31
+ .Opta_W {
32
+ margin: 0;
33
+ background-color: transparent;
34
+
35
+ h2 {
36
+ height: auto;
37
+ margin: 20px 0;
38
+ color: ${colours.section.sport};
39
+ font-family: ${fonts.supporting};
40
+ font-size: 12px;
41
+ line-height: 14px;
42
+ font-weight: normal;
43
+ letter-spacing: 1px;
44
+ text-align: center;
45
+ text-transform: uppercase;
46
+ background-color: transparent;
47
+
48
+ span {
49
+ height: auto;
50
+ font-size: 12px;
51
+ line-height: 14px;
52
+ font-weight: normal;
53
+ }
54
+ }
55
+
56
+ table {
57
+ width: 100%;
58
+ margin: 0;
59
+ border-collapse: collapse;
60
+ border-spacing: 0;
61
+ }
62
+ }
63
+
64
+ p {
65
+ margin: 20px 0 0 0 !important;
66
+ padding: 0 0 20px 0 !important;
67
+ color: ${colours.functional.brandColour};
68
+ font-family: ${fonts.supporting};
69
+ font-size: 14px;
70
+ line-height: 14px;
71
+ text-align: center;
72
+ background: transparent !important;
73
+ }
74
+ }
75
+ `;