@times-components/ts-components 1.115.1-alpha.10 → 1.115.1-alpha.11

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 (35) hide show
  1. package/dist/components/newsletter-puff/InlineNewsletterPuff.js +2 -2
  2. package/dist/components/newsletter-puff/styles.js +4 -1
  3. package/dist/components/opta/cricket/scorecard/OptaCricketScorecard.d.ts +1 -0
  4. package/dist/components/opta/cricket/scorecard/OptaCricketScorecard.js +4 -4
  5. package/dist/components/opta/cricket/scorecard/OptaCricketScorecard.stories.js +3 -3
  6. package/dist/components/opta/cricket/shared-styles.d.ts +4 -1
  7. package/dist/components/opta/cricket/shared-styles.js +3 -3
  8. package/dist/components/opta/football/match-stats/OptaFootballMatchStats.d.ts +1 -0
  9. package/dist/components/opta/football/match-stats/OptaFootballMatchStats.js +4 -4
  10. package/dist/components/opta/football/player-stats/OptaFootballPlayerStats.d.ts +1 -0
  11. package/dist/components/opta/football/player-stats/OptaFootballPlayerStats.js +4 -4
  12. package/dist/components/opta/football/shared-styles.d.ts +1 -0
  13. package/dist/components/opta/football/shared-styles.js +2 -2
  14. package/dist/components/opta/football/standings/OptaFootballStandings.d.ts +1 -0
  15. package/dist/components/opta/football/standings/OptaFootballStandings.js +4 -4
  16. package/dist/components/opta/football/standings/OptaFootballStandings.stories.js +6 -1
  17. package/package.json +3 -3
  18. package/rnw.js +1 -1
  19. package/src/components/newsletter-puff/InlineNewsletterPuff.tsx +1 -1
  20. package/src/components/newsletter-puff/styles.ts +3 -0
  21. package/src/components/opta/cricket/scorecard/OptaCricketScorecard.stories.tsx +2 -2
  22. package/src/components/opta/cricket/scorecard/OptaCricketScorecard.tsx +4 -3
  23. package/src/components/opta/cricket/scorecard/__tests__/__snapshots__/OptaCricketScorecard.test.tsx.snap +3 -3
  24. package/src/components/opta/cricket/shared-styles.ts +9 -4
  25. package/src/components/opta/football/fixtures/__tests__/__snapshots__/OptaFootballFixtures.test.tsx.snap +2 -2
  26. package/src/components/opta/football/fixtures-tournament/__tests__/__snapshots__/OptaFootballFixturesTournament.test.tsx.snap +8 -8
  27. package/src/components/opta/football/match-stats/OptaFootballMatchStats.tsx +4 -3
  28. package/src/components/opta/football/match-stats/__tests__/__snapshots__/OptaFootballMatchStats.test.tsx.snap +4 -3
  29. package/src/components/opta/football/player-stats/OptaFootballPlayerStats.tsx +10 -3
  30. package/src/components/opta/football/player-stats/__tests__/__snapshots__/OptaFootballPlayerStats.test.tsx.snap +2 -2
  31. package/src/components/opta/football/shared-styles.ts +7 -2
  32. package/src/components/opta/football/standings/OptaFootballStandings.stories.tsx +7 -0
  33. package/src/components/opta/football/standings/OptaFootballStandings.tsx +10 -3
  34. package/src/components/opta/football/standings/__tests__/__snapshots__/OptaFootballStandings.test.tsx.snap +4 -4
  35. package/src/components/opta/football/summary/__tests__/__snapshots__/OptaFootballSummary.test.tsx.snap +2 -2
@@ -39,7 +39,7 @@ export const InlineNewsletterPuff = ({
39
39
 
40
40
  if (isLoading || !newsletter) {
41
41
  return (
42
- <InpContainer style={{ height: 257 }}>
42
+ <InpContainer>
43
43
  <Placeholder />
44
44
  </InpContainer>
45
45
  );
@@ -43,13 +43,16 @@ export const InpContainer = styled(View)<{ section?: string }>`
43
43
  margin-right: ${spacing(2)};
44
44
  margin-bottom: ${spacing(4)};
45
45
  margin-left: ${spacing(2)};
46
+ height: 157.5px;
46
47
 
47
48
  @media (min-width: ${breakpoints.medium}px) {
48
49
  margin: 0 auto ${spacing(4)};
49
50
  width: 80.8%;
51
+ height: 157.5px;
50
52
  }
51
53
  @media (min-width: ${breakpoints.wide}px) {
52
54
  width: 56.2%;
55
+ height: 117.5px;
53
56
  }
54
57
  `;
55
58
 
@@ -21,9 +21,9 @@ const showcase = {
21
21
  },
22
22
  {
23
23
  component: () => (
24
- <OptaCricketScorecard competition="3071" match="55391" />
24
+ <OptaCricketScorecard competition="3071" match="55391" height={905} />
25
25
  ),
26
- name: 'Scorecard (1st inns)',
26
+ name: 'Scorecard (1st inns) with set height',
27
27
  type: 'story'
28
28
  }
29
29
  ],
@@ -17,7 +17,8 @@ export const OptaCricketScorecard: React.FC<{
17
17
  competition: string;
18
18
  match: string;
19
19
  full_width?: boolean;
20
- }> = React.memo(({ competition, match, full_width }) => {
20
+ height?: number;
21
+ }> = React.memo(({ competition, match, full_width, height }) => {
21
22
  const ref = React.createRef<HTMLDivElement>();
22
23
 
23
24
  const [isReady, setIsReady] = useState<boolean>(false);
@@ -68,11 +69,11 @@ export const OptaCricketScorecard: React.FC<{
68
69
  }, []);
69
70
 
70
71
  return (
71
- <Container border={isReady} fullWidth={full_width}>
72
+ <Container border={isReady} fullWidth={full_width} $height={height}>
72
73
  <WidgetContainer ref={ref} />
73
74
 
74
75
  {!isReady && (
75
- <PlaceholderContainer>
76
+ <PlaceholderContainer height={height}>
76
77
  <Placeholder />
77
78
  </PlaceholderContainer>
78
79
  )}
@@ -3,13 +3,13 @@
3
3
  exports[`OptaCricketScorecard should render correctly 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
- class="sc-bdVaJa giUBsz"
6
+ class="sc-bdVaJa laZDmH"
7
7
  >
8
8
  <div
9
9
  class="sc-htpNat sc-bxivhb cDDLep"
10
10
  />
11
11
  <div
12
- class="sc-bwzfXH kVYHKf"
12
+ class="sc-bwzfXH iCdzAV"
13
13
  >
14
14
  Placeholder
15
15
  </div>
@@ -20,7 +20,7 @@ exports[`OptaCricketScorecard should render correctly 1`] = `
20
20
  exports[`OptaCricketScorecard should render correctly 2`] = `
21
21
  <DocumentFragment>
22
22
  <div
23
- class="sc-bdVaJa hGXeaj"
23
+ class="sc-bdVaJa Ssmqo"
24
24
  >
25
25
  <div
26
26
  class="sc-htpNat sc-bxivhb cDDLep"
@@ -1,8 +1,13 @@
1
1
  import styled from 'styled-components';
2
2
  import { breakpoints, colours, fonts } from '@times-components/ts-styleguide';
3
3
 
4
- export const Container = styled.div<{ border: boolean; fullWidth?: boolean }>`
5
- margin: 0 auto 20px auto;
4
+ export const Container = styled.div<{
5
+ border: boolean;
6
+ fullWidth?: boolean;
7
+ $height?: number;
8
+ }>`
9
+ ${({ $height }) =>
10
+ $height && `height: ${$height}px;`} margin: 0 auto 20px auto;
6
11
  background-color: ${colours.functional.backgroundPrimary};
7
12
  border-top: ${({ border }) =>
8
13
  border ? `2px solid ${colours.section.sport}` : 'none'};
@@ -21,9 +26,9 @@ export const Container = styled.div<{ border: boolean; fullWidth?: boolean }>`
21
26
  }
22
27
  `;
23
28
 
24
- export const PlaceholderContainer = styled.div`
29
+ export const PlaceholderContainer = styled.div<{ height?: number }>`
30
+ height: ${({ height }) => height || 200}px;
25
31
  position: relative;
26
- height: 200px;
27
32
  `;
28
33
 
29
34
  export const WidgetContainerBase = styled.div`
@@ -3,7 +3,7 @@
3
3
  exports[`OptaFootballFixtures should render correctly 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
- class="sc-bdVaJa giUBsz"
6
+ class="sc-bdVaJa laZDmH"
7
7
  >
8
8
  <div
9
9
  class="sc-htpNat sc-ifAKCX kRuyQz"
@@ -20,7 +20,7 @@ exports[`OptaFootballFixtures should render correctly 1`] = `
20
20
  exports[`OptaFootballFixtures should render correctly 2`] = `
21
21
  <DocumentFragment>
22
22
  <div
23
- class="sc-bdVaJa hGXeaj"
23
+ class="sc-bdVaJa Ssmqo"
24
24
  >
25
25
  <div
26
26
  class="sc-htpNat sc-ifAKCX kRuyQz"
@@ -3,7 +3,7 @@
3
3
  exports[`OptaFootballFixturesTournament should render full width correctly 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
- class="sc-bdVaJa bzdUzT"
6
+ class="sc-bdVaJa gCTnDg"
7
7
  >
8
8
  <div
9
9
  class="sc-htpNat sc-ifAKCX dniyMN team-flags"
@@ -20,7 +20,7 @@ exports[`OptaFootballFixturesTournament should render full width correctly 1`] =
20
20
  exports[`OptaFootballFixturesTournament should render full width correctly 2`] = `
21
21
  <DocumentFragment>
22
22
  <div
23
- class="sc-bdVaJa jODlXD"
23
+ class="sc-bdVaJa ecgEcY"
24
24
  >
25
25
  <div
26
26
  class="sc-htpNat sc-ifAKCX dniyMN team-flags"
@@ -36,7 +36,7 @@ exports[`OptaFootballFixturesTournament should render full width correctly 2`] =
36
36
  exports[`OptaFootballFixturesTournament should render national competitions correctly 1`] = `
37
37
  <DocumentFragment>
38
38
  <div
39
- class="sc-bdVaJa giUBsz"
39
+ class="sc-bdVaJa laZDmH"
40
40
  >
41
41
  <div
42
42
  class="sc-htpNat sc-ifAKCX dniyMN team-flags"
@@ -53,7 +53,7 @@ exports[`OptaFootballFixturesTournament should render national competitions corr
53
53
  exports[`OptaFootballFixturesTournament should render national competitions correctly 2`] = `
54
54
  <DocumentFragment>
55
55
  <div
56
- class="sc-bdVaJa hGXeaj"
56
+ class="sc-bdVaJa Ssmqo"
57
57
  >
58
58
  <div
59
59
  class="sc-htpNat sc-ifAKCX dniyMN team-flags"
@@ -69,7 +69,7 @@ exports[`OptaFootballFixturesTournament should render national competitions corr
69
69
  exports[`OptaFootballFixturesTournament should render national competitions correctly with single column 1`] = `
70
70
  <DocumentFragment>
71
71
  <div
72
- class="sc-bdVaJa giUBsz"
72
+ class="sc-bdVaJa laZDmH"
73
73
  >
74
74
  <div
75
75
  class="sc-htpNat sc-ifAKCX UELGY team-flags"
@@ -86,7 +86,7 @@ exports[`OptaFootballFixturesTournament should render national competitions corr
86
86
  exports[`OptaFootballFixturesTournament should render national competitions correctly with single column 2`] = `
87
87
  <DocumentFragment>
88
88
  <div
89
- class="sc-bdVaJa hGXeaj"
89
+ class="sc-bdVaJa Ssmqo"
90
90
  >
91
91
  <div
92
92
  class="sc-htpNat sc-ifAKCX UELGY team-flags"
@@ -102,7 +102,7 @@ exports[`OptaFootballFixturesTournament should render national competitions corr
102
102
  exports[`OptaFootballFixturesTournament should render other competitions correctly 1`] = `
103
103
  <DocumentFragment>
104
104
  <div
105
- class="sc-bdVaJa giUBsz"
105
+ class="sc-bdVaJa laZDmH"
106
106
  >
107
107
  <div
108
108
  class="sc-htpNat sc-ifAKCX bqOljm"
@@ -119,7 +119,7 @@ exports[`OptaFootballFixturesTournament should render other competitions correct
119
119
  exports[`OptaFootballFixturesTournament should render other competitions correctly 2`] = `
120
120
  <DocumentFragment>
121
121
  <div
122
- class="sc-bdVaJa hGXeaj"
122
+ class="sc-bdVaJa Ssmqo"
123
123
  >
124
124
  <div
125
125
  class="sc-htpNat sc-ifAKCX bqOljm"
@@ -18,7 +18,8 @@ export const OptaFootballMatchStats: React.FC<{
18
18
  competition: string;
19
19
  match: string;
20
20
  full_width?: boolean;
21
- }> = React.memo(({ season, competition, match, full_width }) => {
21
+ height?: number;
22
+ }> = React.memo(({ season, competition, match, full_width, height = 640 }) => {
22
23
  const ref = React.createRef<HTMLDivElement>();
23
24
 
24
25
  const [isReady, setIsReady] = useState<boolean>(false);
@@ -58,11 +59,11 @@ export const OptaFootballMatchStats: React.FC<{
58
59
  }, []);
59
60
 
60
61
  return (
61
- <Container border={isReady} fullWidth={full_width}>
62
+ <Container border={isReady} fullWidth={full_width} $height={height}>
62
63
  <WidgetContainer ref={ref} />
63
64
 
64
65
  {!isReady && (
65
- <PlaceholderContainer>
66
+ <PlaceholderContainer height={height}>
66
67
  <Placeholder />
67
68
  </PlaceholderContainer>
68
69
  )}
@@ -3,13 +3,14 @@
3
3
  exports[`OptaFootballMatchStats should render correctly 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
- class="sc-bdVaJa giUBsz"
6
+ class="sc-bdVaJa fmzSUJ"
7
7
  >
8
8
  <div
9
9
  class="sc-htpNat sc-bxivhb deUMuZ"
10
10
  />
11
11
  <div
12
- class="sc-bwzfXH kVYHKf"
12
+ class="sc-bwzfXH bpOSjf"
13
+ height="640"
13
14
  >
14
15
  Placeholder
15
16
  </div>
@@ -20,7 +21,7 @@ exports[`OptaFootballMatchStats should render correctly 1`] = `
20
21
  exports[`OptaFootballMatchStats should render correctly 2`] = `
21
22
  <DocumentFragment>
22
23
  <div
23
- class="sc-bdVaJa hGXeaj"
24
+ class="sc-bdVaJa jRWzmN"
24
25
  >
25
26
  <div
26
27
  class="sc-htpNat sc-bxivhb deUMuZ"
@@ -23,6 +23,7 @@ export const OptaFootballPlayerStats: React.FC<{
23
23
  hide_zeroes?: boolean;
24
24
  show_title?: boolean;
25
25
  full_width?: boolean;
26
+ height?: number;
26
27
  }> = React.memo(
27
28
  ({
28
29
  season,
@@ -31,7 +32,8 @@ export const OptaFootballPlayerStats: React.FC<{
31
32
  hide_zeroes = true,
32
33
  show_title = true,
33
34
  visible_categories,
34
- classes
35
+ classes,
36
+ height
35
37
  }) => {
36
38
  const ref = React.createRef<HTMLDivElement>();
37
39
 
@@ -78,11 +80,16 @@ export const OptaFootballPlayerStats: React.FC<{
78
80
  isNationalComp && useUpdateNationalTeamDetails(ref, 'Opta-Image-Team');
79
81
 
80
82
  return (
81
- <Container border={isReady} fullWidth={full_width} className={classes}>
83
+ <Container
84
+ border={isReady}
85
+ fullWidth={full_width}
86
+ className={classes}
87
+ $height={height}
88
+ >
82
89
  <WidgetContainer ref={ref} />
83
90
 
84
91
  {!isReady && (
85
- <PlaceholderContainer>
92
+ <PlaceholderContainer height={height}>
86
93
  <Placeholder />
87
94
  </PlaceholderContainer>
88
95
  )}
@@ -3,7 +3,7 @@
3
3
  exports[`OptaFootballPlayerStats should render correctly 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
- class="sc-bdVaJa giUBsz"
6
+ class="sc-bdVaJa laZDmH"
7
7
  >
8
8
  <div
9
9
  class="sc-htpNat sc-bxivhb deUMuZ team-flags"
@@ -20,7 +20,7 @@ exports[`OptaFootballPlayerStats should render correctly 1`] = `
20
20
  exports[`OptaFootballPlayerStats should render correctly 2`] = `
21
21
  <DocumentFragment>
22
22
  <div
23
- class="sc-bdVaJa hGXeaj"
23
+ class="sc-bdVaJa Ssmqo"
24
24
  >
25
25
  <div
26
26
  class="sc-htpNat sc-bxivhb deUMuZ team-flags"
@@ -81,8 +81,13 @@ const flagStyles = Object.keys(countries).map(
81
81
  `
82
82
  );
83
83
 
84
- export const Container = styled.div<{ border: boolean; fullWidth?: boolean }>`
85
- margin: 0 auto 20px auto;
84
+ export const Container = styled.div<{
85
+ border: boolean;
86
+ fullWidth?: boolean;
87
+ $height?: number;
88
+ }>`
89
+ ${({ $height }) =>
90
+ $height && `height: ${$height}px;`} margin: 0 auto 20px auto;
86
91
  background-color: ${colours.functional.backgroundPrimary};
87
92
  border-top: ${({ border }) =>
88
93
  border ? `2px solid ${colours.section.sport}` : 'none'};
@@ -17,6 +17,13 @@ const showcase = {
17
17
  name: 'Standings',
18
18
  type: 'story'
19
19
  },
20
+ {
21
+ component: () => (
22
+ <OptaFootballStandings season="2024" competition="10" height={1057} />
23
+ ),
24
+ name: 'Standings (with height)',
25
+ type: 'story'
26
+ },
20
27
  {
21
28
  component: () => (
22
29
  <OptaFootballStandings
@@ -24,6 +24,7 @@ export const OptaFootballStandings: React.FC<{
24
24
  full_width?: boolean;
25
25
  show_title?: boolean;
26
26
  columns?: boolean;
27
+ height?: number;
27
28
  }> = React.memo(
28
29
  ({
29
30
  season,
@@ -33,7 +34,8 @@ export const OptaFootballStandings: React.FC<{
33
34
  navigation,
34
35
  show_title = true,
35
36
  full_width,
36
- columns
37
+ columns,
38
+ height
37
39
  }) => {
38
40
  const ref = React.createRef<HTMLDivElement>();
39
41
 
@@ -71,11 +73,16 @@ export const OptaFootballStandings: React.FC<{
71
73
  isNationalComp && useUpdateNationalTeamDetails(ref, 'Opta-Team');
72
74
 
73
75
  return (
74
- <Container border={isReady} fullWidth={full_width} className={classes}>
76
+ <Container
77
+ border={isReady}
78
+ fullWidth={full_width}
79
+ className={classes}
80
+ $height={height}
81
+ >
75
82
  <WidgetContainer ref={ref} columns={columns} />
76
83
 
77
84
  {!isReady && (
78
- <PlaceholderContainer>
85
+ <PlaceholderContainer height={height}>
79
86
  <Placeholder />
80
87
  </PlaceholderContainer>
81
88
  )}
@@ -3,7 +3,7 @@
3
3
  exports[`OptaFootballStandings should render correctly 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
- class="sc-bdVaJa giUBsz"
6
+ class="sc-bdVaJa laZDmH"
7
7
  >
8
8
  <div
9
9
  class="sc-htpNat sc-bxivhb gJKBih team-flags"
@@ -20,7 +20,7 @@ exports[`OptaFootballStandings should render correctly 1`] = `
20
20
  exports[`OptaFootballStandings should render correctly 2`] = `
21
21
  <DocumentFragment>
22
22
  <div
23
- class="sc-bdVaJa hGXeaj"
23
+ class="sc-bdVaJa Ssmqo"
24
24
  >
25
25
  <div
26
26
  class="sc-htpNat sc-bxivhb gJKBih team-flags"
@@ -36,7 +36,7 @@ exports[`OptaFootballStandings should render correctly 2`] = `
36
36
  exports[`OptaFootballStandings should render correctly, with columns 1`] = `
37
37
  <DocumentFragment>
38
38
  <div
39
- class="sc-bdVaJa giUBsz"
39
+ class="sc-bdVaJa laZDmH"
40
40
  >
41
41
  <div
42
42
  class="sc-htpNat sc-bxivhb jPAjPs team-flags"
@@ -53,7 +53,7 @@ exports[`OptaFootballStandings should render correctly, with columns 1`] = `
53
53
  exports[`OptaFootballStandings should render correctly, with columns 2`] = `
54
54
  <DocumentFragment>
55
55
  <div
56
- class="sc-bdVaJa hGXeaj"
56
+ class="sc-bdVaJa Ssmqo"
57
57
  >
58
58
  <div
59
59
  class="sc-htpNat sc-bxivhb jPAjPs team-flags"
@@ -3,7 +3,7 @@
3
3
  exports[`OptaFootballSummary should render correctly 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
- class="sc-bdVaJa giUBsz"
6
+ class="sc-bdVaJa laZDmH"
7
7
  >
8
8
  <div
9
9
  class="sc-htpNat sc-bxivhb kRDlKQ"
@@ -20,7 +20,7 @@ exports[`OptaFootballSummary should render correctly 1`] = `
20
20
  exports[`OptaFootballSummary should render correctly 2`] = `
21
21
  <DocumentFragment>
22
22
  <div
23
- class="sc-bdVaJa hGXeaj"
23
+ class="sc-bdVaJa Ssmqo"
24
24
  >
25
25
  <div
26
26
  class="sc-htpNat sc-bxivhb kRDlKQ"