@comicrelief/component-library 8.51.5 → 8.51.6

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.
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
@@ -8,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
8
7
  exports.default = exports.CardsSection = exports.CardsQueryWrapper = exports.CardsInner = void 0;
9
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
10
9
  var _allBreakpoints = require("../../../../theme/shared/allBreakpoints");
11
- var _spacing = _interopRequireDefault(require("../../../../theme/shared/spacing"));
12
10
  const CardsQueryWrapper = exports.CardsQueryWrapper = _styledComponents.default.div.withConfig({
13
11
  displayName: "CTAMultiCardstyle__CardsQueryWrapper",
14
12
  componentId: "sc-gsdqzv-0"
@@ -36,44 +34,65 @@ const CardsSection = exports.CardsSection = _styledComponents.default.div.withCo
36
34
  const CardsInner = exports.CardsInner = _styledComponents.default.div.withConfig({
37
35
  displayName: "CTAMultiCardstyle__CardsInner",
38
36
  componentId: "sc-gsdqzv-2"
39
- })(["width:100%;max-width:1152px;margin:0 auto;", ""], _ref4 => {
37
+ })(["width:100%;max-width:1152px;margin:0 auto;", " ", ""], _ref4 => {
40
38
  let {
41
39
  isCarousel
42
40
  } = _ref4;
43
- return !isCarousel && (0, _styledComponents.css)(["@media (max-width:", "px){padding-left:", ";padding-right:", ";}"], _allBreakpoints.breakpointValues.M - 1, (0, _spacing.default)('md'), (0, _spacing.default)('md'));
41
+ return !isCarousel && (0, _styledComponents.css)(["padding-inline:1rem;@media ", "{padding-inline:2rem;}"], _ref5 => {
42
+ let {
43
+ theme
44
+ } = _ref5;
45
+ return theme.allBreakpoints('M');
46
+ });
47
+ }, _ref6 => {
48
+ let {
49
+ isCarousel
50
+ } = _ref6;
51
+ return isCarousel && (0, _styledComponents.css)(["@media ", "{padding-inline:2rem;}"], _ref7 => {
52
+ let {
53
+ theme
54
+ } = _ref7;
55
+ return theme.allBreakpoints('L');
56
+ });
44
57
  });
45
58
  const CardsContainer = _styledComponents.default.div.withConfig({
46
59
  displayName: "CTAMultiCardstyle__CardsContainer",
47
60
  componentId: "sc-gsdqzv-3"
48
- })(["display:flex;flex-direction:column;width:100%;gap:1rem;@media ", "{flex-direction:row;flex-wrap:wrap;justify-content:center;align-items:stretch;width:fit-content;max-width:100%;margin:0 auto;}@media ", "{column-gap:2rem;}", " @media ", "{", "}"], _ref5 => {
61
+ })(["display:flex;flex-direction:column;width:100%;gap:1rem;@media ", "{flex-direction:row;flex-wrap:wrap;justify-content:center;align-items:stretch;width:100%;max-width:100%;margin:0 auto;}@media ", "{column-gap:2rem;}", " ", " @media ", "{", "}"], _ref8 => {
49
62
  let {
50
63
  theme
51
- } = _ref5;
64
+ } = _ref8;
52
65
  return theme.allBreakpoints('M');
53
- }, _ref6 => {
66
+ }, _ref9 => {
54
67
  let {
55
68
  theme
56
- } = _ref6;
69
+ } = _ref9;
57
70
  return theme.allBreakpoints('L');
58
- }, _ref7 => {
71
+ }, _ref10 => {
72
+ let {
73
+ isCarousel,
74
+ columns
75
+ } = _ref10;
76
+ return !isCarousel && columns === 2 && (0, _styledComponents.css)(["@media (min-width:", "px){display:grid;grid-template-columns:repeat(2,minmax(443px,560px));justify-content:center;align-items:stretch;column-gap:2rem;row-gap:2rem;width:100%;max-width:100%;margin:0;& > *:last-child:nth-child(odd){grid-column:1 / -1;justify-self:center;width:min(100%,560px);}}"], _allBreakpoints.breakpointValues.L);
77
+ }, _ref11 => {
59
78
  let {
60
79
  isCarousel
61
- } = _ref7;
62
- return isCarousel && (0, _styledComponents.css)(["@media (max-width:", "px){", "}"], _allBreakpoints.breakpointValues.L - 1, _ref8 => {
80
+ } = _ref11;
81
+ return isCarousel && (0, _styledComponents.css)(["@media (max-width:", "px){", "}"], _allBreakpoints.breakpointValues.L - 1, _ref12 => {
63
82
  let {
64
83
  useSplideCarousel
65
- } = _ref8;
84
+ } = _ref12;
66
85
  return useSplideCarousel ? (0, _styledComponents.css)(["display:block;cursor:grab;width:100%;margin:0;max-width:100%;padding:0.75rem 1rem;gap:0;.splide__list{align-items:stretch;}.splide__slide{display:flex;height:auto;}"]) : (0, _styledComponents.css)(["flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;width:100%;margin:0;max-width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scroll-snap-type:x mandatory;padding:0.75rem 1rem;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none;}"]);
67
86
  });
68
- }, _ref9 => {
87
+ }, _ref13 => {
69
88
  let {
70
89
  theme
71
- } = _ref9;
90
+ } = _ref13;
72
91
  return theme.allBreakpoints('XL');
73
- }, _ref10 => {
92
+ }, _ref14 => {
74
93
  let {
75
94
  columns
76
- } = _ref10;
95
+ } = _ref14;
77
96
  return columns === 3 && (0, _styledComponents.css)(["display:grid;justify-content:center;align-items:stretch;grid-template-columns:repeat(3,minmax(0,363px));width:100%;margin:0 auto;max-width:100%;"]);
78
97
  });
79
98
  var _default = exports.default = CardsContainer;
@@ -8,13 +8,13 @@ exports[`handles data structure correctly 1`] = `
8
8
  className="CTAMultiCardstyle__CardsSection-sc-gsdqzv-1 ehBqzi"
9
9
  >
10
10
  <div
11
- className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 bvGqKF"
11
+ className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 jdzsUU"
12
12
  >
13
13
  <div
14
- className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 dneGvf"
14
+ className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 cVaqKX"
15
15
  >
16
16
  <div
17
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
17
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
18
18
  >
19
19
  <a
20
20
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -95,7 +95,7 @@ exports[`handles data structure correctly 1`] = `
95
95
  </a>
96
96
  </div>
97
97
  <div
98
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
98
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
99
99
  >
100
100
  <div
101
101
  className="CTACardstyle__CardLink-sc-si8xx1-4 lbrljd"
@@ -141,7 +141,7 @@ exports[`handles data structure correctly 1`] = `
141
141
  </div>
142
142
  </div>
143
143
  <div
144
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
144
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
145
145
  >
146
146
  <a
147
147
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -222,7 +222,7 @@ exports[`handles data structure correctly 1`] = `
222
222
  </a>
223
223
  </div>
224
224
  <div
225
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
225
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
226
226
  >
227
227
  <a
228
228
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -291,13 +291,13 @@ exports[`renders 2 columns layout correctly 1`] = `
291
291
  className="CTAMultiCardstyle__CardsSection-sc-gsdqzv-1 eznbgX"
292
292
  >
293
293
  <div
294
- className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 bvGqKF"
294
+ className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 jdzsUU"
295
295
  >
296
296
  <div
297
- className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 jZvayd"
297
+ className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 kZJZoQ"
298
298
  >
299
299
  <div
300
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iBfhjM"
300
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 ipBvGj"
301
301
  >
302
302
  <a
303
303
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -378,7 +378,7 @@ exports[`renders 2 columns layout correctly 1`] = `
378
378
  </a>
379
379
  </div>
380
380
  <div
381
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iBfhjM"
381
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 ipBvGj"
382
382
  >
383
383
  <div
384
384
  className="CTACardstyle__CardLink-sc-si8xx1-4 lbrljd"
@@ -424,7 +424,7 @@ exports[`renders 2 columns layout correctly 1`] = `
424
424
  </div>
425
425
  </div>
426
426
  <div
427
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iBfhjM"
427
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 ipBvGj"
428
428
  >
429
429
  <a
430
430
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -505,7 +505,7 @@ exports[`renders 2 columns layout correctly 1`] = `
505
505
  </a>
506
506
  </div>
507
507
  <div
508
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iBfhjM"
508
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 ipBvGj"
509
509
  >
510
510
  <a
511
511
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -574,13 +574,13 @@ exports[`renders carousel mode correctly 1`] = `
574
574
  className="CTAMultiCardstyle__CardsSection-sc-gsdqzv-1 eznbgX"
575
575
  >
576
576
  <div
577
- className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 bDNuWh"
577
+ className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 fEcgRr"
578
578
  >
579
579
  <div
580
- className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 gPXAnw"
580
+ className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 dhfXac"
581
581
  >
582
582
  <div
583
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 hIVGPb"
583
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 kgXkPu"
584
584
  >
585
585
  <a
586
586
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -661,7 +661,7 @@ exports[`renders carousel mode correctly 1`] = `
661
661
  </a>
662
662
  </div>
663
663
  <div
664
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 hIVGPb"
664
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 kgXkPu"
665
665
  >
666
666
  <div
667
667
  className="CTACardstyle__CardLink-sc-si8xx1-4 lbrljd"
@@ -707,7 +707,7 @@ exports[`renders carousel mode correctly 1`] = `
707
707
  </div>
708
708
  </div>
709
709
  <div
710
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 hIVGPb"
710
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 kgXkPu"
711
711
  >
712
712
  <a
713
713
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -788,7 +788,7 @@ exports[`renders carousel mode correctly 1`] = `
788
788
  </a>
789
789
  </div>
790
790
  <div
791
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 hIVGPb"
791
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 kgXkPu"
792
792
  >
793
793
  <a
794
794
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -857,13 +857,13 @@ exports[`renders correctly with data prop 1`] = `
857
857
  className="CTAMultiCardstyle__CardsSection-sc-gsdqzv-1 eznbgX"
858
858
  >
859
859
  <div
860
- className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 bvGqKF"
860
+ className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 jdzsUU"
861
861
  >
862
862
  <div
863
- className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 dneGvf"
863
+ className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 cVaqKX"
864
864
  >
865
865
  <div
866
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
866
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
867
867
  >
868
868
  <a
869
869
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -944,7 +944,7 @@ exports[`renders correctly with data prop 1`] = `
944
944
  </a>
945
945
  </div>
946
946
  <div
947
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
947
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
948
948
  >
949
949
  <div
950
950
  className="CTACardstyle__CardLink-sc-si8xx1-4 lbrljd"
@@ -990,7 +990,7 @@ exports[`renders correctly with data prop 1`] = `
990
990
  </div>
991
991
  </div>
992
992
  <div
993
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
993
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
994
994
  >
995
995
  <a
996
996
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -1071,7 +1071,7 @@ exports[`renders correctly with data prop 1`] = `
1071
1071
  </a>
1072
1072
  </div>
1073
1073
  <div
1074
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
1074
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
1075
1075
  >
1076
1076
  <a
1077
1077
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -47,7 +47,7 @@ const exampleCard = {
47
47
  external: null
48
48
  };
49
49
 
50
- <div style={{ padding: '2rem', background: '#E1E2E3' }}>
50
+ <div style={{ background: '#E1E2E3' }}>
51
51
  <CTASingleCard data={{ card: exampleCard, backgroundColour: 'Transparent', paddingAbove: '1rem', paddingBelow: '2rem' }} />
52
52
  </div>;
53
53
  ```
@@ -63,7 +63,7 @@ const exampleCard = {
63
63
  label: 'Example Label',
64
64
  body: (
65
65
  <Text tag="p">
66
- Single card with background colour set on the full-width section
66
+ Single card
67
67
  </Text>
68
68
  ),
69
69
  link: "/test",
@@ -76,7 +76,7 @@ const exampleCard = {
76
76
  external: null
77
77
  };
78
78
 
79
- <div style={{ padding: '2rem', background: '#E1E2E3' }}>
79
+ <div style={{ background: '#E1E2E3' }}>
80
80
  <CTASingleCard data={{ card: exampleCard, backgroundColour: 'grey_medium', paddingAbove: '1rem', paddingBelow: '2rem' }} />
81
81
  </div>;
82
82
  ```
@@ -95,7 +95,7 @@ const exampleCardWithLongText = {
95
95
  body: (
96
96
  <>
97
97
  <Text tag="p">
98
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
98
+ Single card with background colour set on the full-width section
99
99
  </Text>
100
100
  <Text tag="p">
101
101
  Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
@@ -9,7 +9,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
  const SingleCardSection = exports.SingleCardSection = _styledComponents.default.div.withConfig({
10
10
  displayName: "CTASingleCardstyle__SingleCardSection",
11
11
  componentId: "sc-15wjhr6-0"
12
- })(["padding-top:", ";padding-bottom:", ";width:100%;background:", ";"], _ref => {
12
+ })(["padding-top:", ";padding-bottom:", ";padding-inline:1rem;@media ", "{padding-inline:2rem;}@media ", "{padding-inline:4rem;}width:100%;background:", ";"], _ref => {
13
13
  let {
14
14
  paddingAbove
15
15
  } = _ref;
@@ -20,10 +20,20 @@ const SingleCardSection = exports.SingleCardSection = _styledComponents.default.
20
20
  } = _ref2;
21
21
  return paddingBelow;
22
22
  }, _ref3 => {
23
+ let {
24
+ theme
25
+ } = _ref3;
26
+ return theme.breakpoints2026('M');
27
+ }, _ref4 => {
28
+ let {
29
+ theme
30
+ } = _ref4;
31
+ return theme.breakpoints2026('L');
32
+ }, _ref5 => {
23
33
  let {
24
34
  theme,
25
35
  backgroundColor
26
- } = _ref3;
36
+ } = _ref5;
27
37
  return theme.color(backgroundColor);
28
38
  });
29
39
  const SingleCardInner = exports.SingleCardInner = _styledComponents.default.div.withConfig({
@@ -137,7 +137,7 @@ exports[`renders correctly with data prop 1`] = `
137
137
  }
138
138
 
139
139
  .c2 {
140
- width: 100%;
140
+ width: auto;
141
141
  -webkit-flex-shrink: 0;
142
142
  -ms-flex-negative: 0;
143
143
  flex-shrink: 0;
@@ -191,7 +191,6 @@ exports[`renders correctly with data prop 1`] = `
191
191
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
192
192
  font-size: 14px;
193
193
  color: #969598;
194
- margin-bottom: 1rem;
195
194
  }
196
195
 
197
196
  .c12 {
@@ -218,6 +217,7 @@ exports[`renders correctly with data prop 1`] = `
218
217
  .c0 {
219
218
  padding-top: 1rem;
220
219
  padding-bottom: 2rem;
220
+ padding-inline: 1rem;
221
221
  width: 100%;
222
222
  background: transparent;
223
223
  }
@@ -411,6 +411,18 @@ exports[`renders correctly with data prop 1`] = `
411
411
  }
412
412
  }
413
413
 
414
+ @media (min-width:740px) {
415
+ .c0 {
416
+ padding-inline: 2rem;
417
+ }
418
+ }
419
+
420
+ @media (min-width:1024px) {
421
+ .c0 {
422
+ padding-inline: 4rem;
423
+ }
424
+ }
425
+
414
426
  <div
415
427
  className="c0"
416
428
  >
@@ -613,7 +625,7 @@ exports[`renders correctly without image 1`] = `
613
625
  }
614
626
 
615
627
  .c2 {
616
- width: 100%;
628
+ width: auto;
617
629
  -webkit-flex-shrink: 0;
618
630
  -ms-flex-negative: 0;
619
631
  flex-shrink: 0;
@@ -667,7 +679,6 @@ exports[`renders correctly without image 1`] = `
667
679
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
668
680
  font-size: 14px;
669
681
  color: #969598;
670
- margin-bottom: 1rem;
671
682
  }
672
683
 
673
684
  .c8 {
@@ -694,6 +705,7 @@ exports[`renders correctly without image 1`] = `
694
705
  .c0 {
695
706
  padding-top: 1rem;
696
707
  padding-bottom: 2rem;
708
+ padding-inline: 1rem;
697
709
  width: 100%;
698
710
  background: transparent;
699
711
  }
@@ -843,6 +855,18 @@ exports[`renders correctly without image 1`] = `
843
855
  }
844
856
  }
845
857
 
858
+ @media (min-width:740px) {
859
+ .c0 {
860
+ padding-inline: 2rem;
861
+ }
862
+ }
863
+
864
+ @media (min-width:1024px) {
865
+ .c0 {
866
+ padding-inline: 4rem;
867
+ }
868
+ }
869
+
846
870
  <div
847
871
  className="c0"
848
872
  >
@@ -130,7 +130,7 @@ const CardLink = exports.CardLink = _styledComponents.default.a.withConfig({
130
130
  const CardWrapper = exports.CardWrapper = _styledComponents.default.div.withConfig({
131
131
  displayName: "CTACardstyle__CardWrapper",
132
132
  componentId: "sc-si8xx1-5"
133
- })(["width:100%;flex-shrink:0;display:flex;flex-direction:column;align-self:stretch;", " ", " ", " ", ""], _ref20 => {
133
+ })(["width:auto;flex-shrink:0;display:flex;flex-direction:column;align-self:stretch;", " ", " ", " ", ""], _ref20 => {
134
134
  let {
135
135
  isFullWidth
136
136
  } = _ref20;
@@ -171,11 +171,11 @@ const CardWrapper = exports.CardWrapper = _styledComponents.default.div.withConf
171
171
  let {
172
172
  isFullWidth
173
173
  } = _ref27;
174
- return !isFullWidth && (0, _styledComponents.css)(["@media (min-width:", "px) and (max-width:", "px){", " align-self:stretch;}@media ", "{flex-basis:unset;width:", ";align-self:stretch;}"], _allBreakpoints.breakpointValues.L, _allBreakpoints.breakpointValues.XL - 1, _ref28 => {
174
+ return !isFullWidth && (0, _styledComponents.css)(["@media (min-width:", "px) and (max-width:", "px){", " align-self:stretch;}@media ", "{", "}"], _allBreakpoints.breakpointValues.L, _allBreakpoints.breakpointValues.XL - 1, _ref28 => {
175
175
  let {
176
176
  columns
177
177
  } = _ref28;
178
- return columns === 3 ? (0, _styledComponents.css)(["flex-basis:calc(33.333% - 1rem);min-width:286px;max-width:363px;"]) : (0, _styledComponents.css)(["flex-basis:calc(50% - 1rem);min-width:443px;max-width:560px;"]);
178
+ return columns === 3 ? (0, _styledComponents.css)(["flex:0 1 auto;width:clamp(286px,calc((100% - 4rem) / 3),363px);"]) : (0, _styledComponents.css)(["flex:0 1 auto;width:100%;"]);
179
179
  }, _ref29 => {
180
180
  let {
181
181
  theme
@@ -185,7 +185,7 @@ const CardWrapper = exports.CardWrapper = _styledComponents.default.div.withConf
185
185
  let {
186
186
  columns
187
187
  } = _ref30;
188
- return columns === 3 ? '363px' : '560px';
188
+ return columns === 3 && (0, _styledComponents.css)(["width:100%;max-width:363px;"]);
189
189
  });
190
190
  });
191
191
  const CopyAndLinkSection = exports.CopyAndLinkSection = _styledComponents.default.div.withConfig({
@@ -224,7 +224,7 @@ const Copy = exports.Copy = _styledComponents.default.div.withConfig({
224
224
  const CardLabel = exports.CardLabel = _styledComponents.default.div.withConfig({
225
225
  displayName: "CTACardstyle__CardLabel",
226
226
  componentId: "sc-si8xx1-8"
227
- })(["font-family:", ";font-size:14px;color:", ";margin-bottom:1rem;"], _ref36 => {
227
+ })(["font-family:", ";font-size:14px;color:", ";"], _ref36 => {
228
228
  let {
229
229
  theme
230
230
  } = _ref36;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comicrelief/component-library",
3
3
  "author": "Comic Relief Engineering Team",
4
- "version": "8.51.5",
4
+ "version": "8.51.6",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -1,6 +1,5 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import { breakpointValues } from '../../../../theme/shared/allBreakpoints';
3
- import spacing from '../../../../theme/shared/spacing';
4
3
 
5
4
  export const CardsQueryWrapper = styled.div`
6
5
  /* Container for “single card per row” sizing.
@@ -24,11 +23,16 @@ export const CardsInner = styled.div`
24
23
  max-width: 1152px;
25
24
  margin: 0 auto;
26
25
 
27
- /* Provide mobile gutters for non-carousel stack mode. */
28
26
  ${({ isCarousel }) => !isCarousel && css`
29
- @media (max-width: ${breakpointValues.M - 1}px) {
30
- padding-left: ${spacing('md')};
31
- padding-right: ${spacing('md')};
27
+ padding-inline: 1rem;
28
+ @media ${({ theme }) => theme.allBreakpoints('M')} {
29
+ padding-inline: 2rem;
30
+ }
31
+ `}
32
+
33
+ ${({ isCarousel }) => isCarousel && css`
34
+ @media ${({ theme }) => theme.allBreakpoints('L')} {
35
+ padding-inline: 2rem;
32
36
  }
33
37
  `}
34
38
  `;
@@ -45,7 +49,7 @@ const CardsContainer = styled.div`
45
49
  flex-wrap: wrap;
46
50
  justify-content: center;
47
51
  align-items: stretch;
48
- width: fit-content;
52
+ width: 100%;
49
53
  max-width: 100%;
50
54
  margin: 0 auto;
51
55
  }
@@ -54,6 +58,28 @@ const CardsContainer = styled.div`
54
58
  column-gap: 2rem;
55
59
  }
56
60
 
61
+ /* Ensure 2-column layout behaves itself at L+ */
62
+ ${({ isCarousel, columns }) => !isCarousel && columns === 2 && css`
63
+ @media (min-width: ${breakpointValues.L}px) {
64
+ display: grid;
65
+ grid-template-columns: repeat(2, minmax(443px, 560px));
66
+ justify-content: center;
67
+ align-items: stretch;
68
+ column-gap: 2rem;
69
+ row-gap: 2rem;
70
+ width: 100%;
71
+ max-width: 100%;
72
+ margin: 0;
73
+
74
+ /* if there's an odd "orphan" card on the last row, center it. */
75
+ & > *:last-child:nth-child(odd) {
76
+ grid-column: 1 / -1;
77
+ justify-self: center;
78
+ width: min(100%, 560px);
79
+ }
80
+ }
81
+ `}
82
+
57
83
  // Carousel mode - horizontal scroll container (M and below)
58
84
  ${({ isCarousel }) => isCarousel && css`
59
85
  @media (max-width: ${breakpointValues.L - 1}px) {
@@ -8,13 +8,13 @@ exports[`handles data structure correctly 1`] = `
8
8
  className="CTAMultiCardstyle__CardsSection-sc-gsdqzv-1 ehBqzi"
9
9
  >
10
10
  <div
11
- className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 bvGqKF"
11
+ className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 jdzsUU"
12
12
  >
13
13
  <div
14
- className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 dneGvf"
14
+ className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 cVaqKX"
15
15
  >
16
16
  <div
17
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
17
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
18
18
  >
19
19
  <a
20
20
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -95,7 +95,7 @@ exports[`handles data structure correctly 1`] = `
95
95
  </a>
96
96
  </div>
97
97
  <div
98
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
98
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
99
99
  >
100
100
  <div
101
101
  className="CTACardstyle__CardLink-sc-si8xx1-4 lbrljd"
@@ -141,7 +141,7 @@ exports[`handles data structure correctly 1`] = `
141
141
  </div>
142
142
  </div>
143
143
  <div
144
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
144
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
145
145
  >
146
146
  <a
147
147
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -222,7 +222,7 @@ exports[`handles data structure correctly 1`] = `
222
222
  </a>
223
223
  </div>
224
224
  <div
225
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
225
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
226
226
  >
227
227
  <a
228
228
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -291,13 +291,13 @@ exports[`renders 2 columns layout correctly 1`] = `
291
291
  className="CTAMultiCardstyle__CardsSection-sc-gsdqzv-1 eznbgX"
292
292
  >
293
293
  <div
294
- className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 bvGqKF"
294
+ className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 jdzsUU"
295
295
  >
296
296
  <div
297
- className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 jZvayd"
297
+ className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 kZJZoQ"
298
298
  >
299
299
  <div
300
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iBfhjM"
300
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 ipBvGj"
301
301
  >
302
302
  <a
303
303
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -378,7 +378,7 @@ exports[`renders 2 columns layout correctly 1`] = `
378
378
  </a>
379
379
  </div>
380
380
  <div
381
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iBfhjM"
381
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 ipBvGj"
382
382
  >
383
383
  <div
384
384
  className="CTACardstyle__CardLink-sc-si8xx1-4 lbrljd"
@@ -424,7 +424,7 @@ exports[`renders 2 columns layout correctly 1`] = `
424
424
  </div>
425
425
  </div>
426
426
  <div
427
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iBfhjM"
427
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 ipBvGj"
428
428
  >
429
429
  <a
430
430
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -505,7 +505,7 @@ exports[`renders 2 columns layout correctly 1`] = `
505
505
  </a>
506
506
  </div>
507
507
  <div
508
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iBfhjM"
508
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 ipBvGj"
509
509
  >
510
510
  <a
511
511
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -574,13 +574,13 @@ exports[`renders carousel mode correctly 1`] = `
574
574
  className="CTAMultiCardstyle__CardsSection-sc-gsdqzv-1 eznbgX"
575
575
  >
576
576
  <div
577
- className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 bDNuWh"
577
+ className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 fEcgRr"
578
578
  >
579
579
  <div
580
- className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 gPXAnw"
580
+ className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 dhfXac"
581
581
  >
582
582
  <div
583
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 hIVGPb"
583
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 kgXkPu"
584
584
  >
585
585
  <a
586
586
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -661,7 +661,7 @@ exports[`renders carousel mode correctly 1`] = `
661
661
  </a>
662
662
  </div>
663
663
  <div
664
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 hIVGPb"
664
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 kgXkPu"
665
665
  >
666
666
  <div
667
667
  className="CTACardstyle__CardLink-sc-si8xx1-4 lbrljd"
@@ -707,7 +707,7 @@ exports[`renders carousel mode correctly 1`] = `
707
707
  </div>
708
708
  </div>
709
709
  <div
710
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 hIVGPb"
710
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 kgXkPu"
711
711
  >
712
712
  <a
713
713
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -788,7 +788,7 @@ exports[`renders carousel mode correctly 1`] = `
788
788
  </a>
789
789
  </div>
790
790
  <div
791
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 hIVGPb"
791
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 kgXkPu"
792
792
  >
793
793
  <a
794
794
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -857,13 +857,13 @@ exports[`renders correctly with data prop 1`] = `
857
857
  className="CTAMultiCardstyle__CardsSection-sc-gsdqzv-1 eznbgX"
858
858
  >
859
859
  <div
860
- className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 bvGqKF"
860
+ className="CTAMultiCardstyle__CardsInner-sc-gsdqzv-2 jdzsUU"
861
861
  >
862
862
  <div
863
- className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 dneGvf"
863
+ className="CTAMultiCardstyle__CardsContainer-sc-gsdqzv-3 cVaqKX"
864
864
  >
865
865
  <div
866
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
866
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
867
867
  >
868
868
  <a
869
869
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -944,7 +944,7 @@ exports[`renders correctly with data prop 1`] = `
944
944
  </a>
945
945
  </div>
946
946
  <div
947
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
947
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
948
948
  >
949
949
  <div
950
950
  className="CTACardstyle__CardLink-sc-si8xx1-4 lbrljd"
@@ -990,7 +990,7 @@ exports[`renders correctly with data prop 1`] = `
990
990
  </div>
991
991
  </div>
992
992
  <div
993
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
993
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
994
994
  >
995
995
  <a
996
996
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -1071,7 +1071,7 @@ exports[`renders correctly with data prop 1`] = `
1071
1071
  </a>
1072
1072
  </div>
1073
1073
  <div
1074
- className="CTACardstyle__CardWrapper-sc-si8xx1-5 iHfpaV"
1074
+ className="CTACardstyle__CardWrapper-sc-si8xx1-5 zWgWI"
1075
1075
  >
1076
1076
  <a
1077
1077
  className="CTACardstyle__CardLink-sc-si8xx1-4 cQAxla"
@@ -47,7 +47,7 @@ const exampleCard = {
47
47
  external: null
48
48
  };
49
49
 
50
- <div style={{ padding: '2rem', background: '#E1E2E3' }}>
50
+ <div style={{ background: '#E1E2E3' }}>
51
51
  <CTASingleCard data={{ card: exampleCard, backgroundColour: 'Transparent', paddingAbove: '1rem', paddingBelow: '2rem' }} />
52
52
  </div>;
53
53
  ```
@@ -63,7 +63,7 @@ const exampleCard = {
63
63
  label: 'Example Label',
64
64
  body: (
65
65
  <Text tag="p">
66
- Single card with background colour set on the full-width section
66
+ Single card
67
67
  </Text>
68
68
  ),
69
69
  link: "/test",
@@ -76,7 +76,7 @@ const exampleCard = {
76
76
  external: null
77
77
  };
78
78
 
79
- <div style={{ padding: '2rem', background: '#E1E2E3' }}>
79
+ <div style={{ background: '#E1E2E3' }}>
80
80
  <CTASingleCard data={{ card: exampleCard, backgroundColour: 'grey_medium', paddingAbove: '1rem', paddingBelow: '2rem' }} />
81
81
  </div>;
82
82
  ```
@@ -95,7 +95,7 @@ const exampleCardWithLongText = {
95
95
  body: (
96
96
  <>
97
97
  <Text tag="p">
98
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
98
+ Single card with background colour set on the full-width section
99
99
  </Text>
100
100
  <Text tag="p">
101
101
  Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
@@ -3,6 +3,13 @@ import styled from 'styled-components';
3
3
  export const SingleCardSection = styled.div`
4
4
  padding-top: ${({ paddingAbove }) => paddingAbove};
5
5
  padding-bottom: ${({ paddingBelow }) => paddingBelow};
6
+ padding-inline: 1rem;
7
+ @media ${({ theme }) => theme.breakpoints2026('M')} {
8
+ padding-inline: 2rem;
9
+ }
10
+ @media ${({ theme }) => theme.breakpoints2026('L')} {
11
+ padding-inline: 4rem;
12
+ }
6
13
  width: 100%;
7
14
  background: ${({ theme, backgroundColor }) => theme.color(backgroundColor)};
8
15
  `;
@@ -137,7 +137,7 @@ exports[`renders correctly with data prop 1`] = `
137
137
  }
138
138
 
139
139
  .c2 {
140
- width: 100%;
140
+ width: auto;
141
141
  -webkit-flex-shrink: 0;
142
142
  -ms-flex-negative: 0;
143
143
  flex-shrink: 0;
@@ -191,7 +191,6 @@ exports[`renders correctly with data prop 1`] = `
191
191
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
192
192
  font-size: 14px;
193
193
  color: #969598;
194
- margin-bottom: 1rem;
195
194
  }
196
195
 
197
196
  .c12 {
@@ -218,6 +217,7 @@ exports[`renders correctly with data prop 1`] = `
218
217
  .c0 {
219
218
  padding-top: 1rem;
220
219
  padding-bottom: 2rem;
220
+ padding-inline: 1rem;
221
221
  width: 100%;
222
222
  background: transparent;
223
223
  }
@@ -411,6 +411,18 @@ exports[`renders correctly with data prop 1`] = `
411
411
  }
412
412
  }
413
413
 
414
+ @media (min-width:740px) {
415
+ .c0 {
416
+ padding-inline: 2rem;
417
+ }
418
+ }
419
+
420
+ @media (min-width:1024px) {
421
+ .c0 {
422
+ padding-inline: 4rem;
423
+ }
424
+ }
425
+
414
426
  <div
415
427
  className="c0"
416
428
  >
@@ -613,7 +625,7 @@ exports[`renders correctly without image 1`] = `
613
625
  }
614
626
 
615
627
  .c2 {
616
- width: 100%;
628
+ width: auto;
617
629
  -webkit-flex-shrink: 0;
618
630
  -ms-flex-negative: 0;
619
631
  flex-shrink: 0;
@@ -667,7 +679,6 @@ exports[`renders correctly without image 1`] = `
667
679
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
668
680
  font-size: 14px;
669
681
  color: #969598;
670
- margin-bottom: 1rem;
671
682
  }
672
683
 
673
684
  .c8 {
@@ -694,6 +705,7 @@ exports[`renders correctly without image 1`] = `
694
705
  .c0 {
695
706
  padding-top: 1rem;
696
707
  padding-bottom: 2rem;
708
+ padding-inline: 1rem;
697
709
  width: 100%;
698
710
  background: transparent;
699
711
  }
@@ -843,6 +855,18 @@ exports[`renders correctly without image 1`] = `
843
855
  }
844
856
  }
845
857
 
858
+ @media (min-width:740px) {
859
+ .c0 {
860
+ padding-inline: 2rem;
861
+ }
862
+ }
863
+
864
+ @media (min-width:1024px) {
865
+ .c0 {
866
+ padding-inline: 4rem;
867
+ }
868
+ }
869
+
846
870
  <div
847
871
  className="c0"
848
872
  >
@@ -155,7 +155,7 @@ const CardLink = styled.a`
155
155
  `;
156
156
 
157
157
  const CardWrapper = styled.div`
158
- width: 100%;
158
+ width: auto;
159
159
  flex-shrink: 0;
160
160
  display: flex;
161
161
  flex-direction: column;
@@ -233,30 +233,31 @@ const CardWrapper = styled.div`
233
233
  `)}
234
234
  `}
235
235
 
236
- // L breakpoint: min/max rules vary by layout
237
236
  ${({ isFullWidth }) => !isFullWidth && css`
238
237
  @media (min-width: ${breakpointValues.L}px) and (max-width: ${breakpointValues.XL - 1}px) {
239
238
  ${({ columns }) => (
240
239
  columns === 3
241
240
  ? css`
242
- flex-basis: calc(33.333% - 1rem);
243
- min-width: 286px;
244
- max-width: 363px;
241
+ flex: 0 1 auto;
242
+ width: clamp(286px, calc((100% - 4rem) / 3), 363px);
245
243
  `
246
244
  : css`
247
- flex-basis: calc(50% - 1rem);
248
- min-width: 443px;
249
- max-width: 560px;
245
+ flex: 0 1 auto;
246
+ /*
247
+ * In 2-col mode at L+, the parent container uses CSS grid to enforce 2-up.
248
+ * See the multi card style file.
249
+ */
250
+ width: 100%;
250
251
  `
251
252
  )}
252
253
  align-self: stretch;
253
254
  }
254
255
 
255
- // XL breakpoint and above: fixed widths vary by layout
256
256
  @media ${({ theme }) => theme.allBreakpoints('XL')} {
257
- flex-basis: unset;
258
- width: ${({ columns }) => (columns === 3 ? '363px' : '560px')};
259
- align-self: stretch;
257
+ ${({ columns }) => columns === 3 && css`
258
+ width: 100%;
259
+ max-width: 363px;
260
+ `}
260
261
  }
261
262
  `}
262
263
  `;
@@ -303,7 +304,6 @@ const CardLabel = styled.div`
303
304
  font-family: ${({ theme }) => theme.fontFamilies('Montserrat')};
304
305
  font-size: 14px;
305
306
  color: ${({ theme }) => theme.color('grey_3')};
306
- margin-bottom: 1rem;
307
307
  `;
308
308
 
309
309
  const CTA = styled.div`