@comicrelief/component-library 7.9.0 → 7.10.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.
@@ -45,7 +45,7 @@ var Container = _styledComponents.default.div.withConfig({
45
45
  var Image = _styledComponents.default.div.withConfig({
46
46
  displayName: "CardDs__Image",
47
47
  componentId: "sc-mayd3d-1"
48
- })(["height:auto;margin:0 -", " 0 ", ";img{border-radius:1rem;box-shadow:0px 0px 20px rgba(0,0,0,0.15);}"], (0, _spacing.default)('m'), (0, _spacing.default)('m'));
48
+ })(["height:auto;margin:0 -", " 0 ", ";img{border-radius:", ";box-shadow:0 0 ", " rgba(0,0,0,0.15);}"], (0, _spacing.default)('m'), (0, _spacing.default)('m'), (0, _spacing.default)('md'), (0, _spacing.default)('md'));
49
49
 
50
50
  var MediaLink = _styledComponents.default.a.withConfig({
51
51
  displayName: "CardDs__MediaLink",
@@ -61,10 +61,10 @@ var MediaLink = _styledComponents.default.a.withConfig({
61
61
  var Copy = _styledComponents.default.div.withConfig({
62
62
  displayName: "CardDs__Copy",
63
63
  componentId: "sc-mayd3d-3"
64
- })(["padding:", ";", ";display:flex;flex-direction:column;border-radius:1rem;box-shadow:0px 0px 20px rgba(0,0,0,0.15);background:", ";width:100%;@media ", "{height:100%;}", ";", ";"], (0, _spacing.default)('l'), function (_ref6) {
64
+ })(["padding:", ";", ";display:flex;flex-direction:column;border-radius:", ";box-shadow:0 0 ", " rgba(0,0,0,0.15);background:", ";width:100%;@media ", "{height:100%;}", ";", ";"], (0, _spacing.default)('l'), function (_ref6) {
65
65
  var hasLink = _ref6.hasLink;
66
66
  return hasLink && "padding-bottom: ".concat((0, _spacing.default)('xl'));
67
- }, function (_ref7) {
67
+ }, (0, _spacing.default)('md'), (0, _spacing.default)('md'), function (_ref7) {
68
68
  var theme = _ref7.theme,
69
69
  backgroundColor = _ref7.backgroundColor;
70
70
  return theme.color(backgroundColor);
@@ -82,7 +82,7 @@ exports[`renders correctly 1`] = `
82
82
 
83
83
  .c2 img {
84
84
  border-radius: 1rem;
85
- box-shadow: 0px 0px 20px rgba(0,0,0,0.15);
85
+ box-shadow: 0 0 1rem rgba(0,0,0,0.15);
86
86
  }
87
87
 
88
88
  .c1 {
@@ -100,7 +100,7 @@ exports[`renders correctly 1`] = `
100
100
  -ms-flex-direction: column;
101
101
  flex-direction: column;
102
102
  border-radius: 1rem;
103
- box-shadow: 0px 0px 20px rgba(0,0,0,0.15);
103
+ box-shadow: 0 0 1rem rgba(0,0,0,0.15);
104
104
  background: #FFFFFF;
105
105
  width: 100%;
106
106
  z-index: 1;
@@ -54,9 +54,9 @@ var mpValidationSchemaCustom = mpValidationCustom.mpValidationSchema,
54
54
  mpValidationOptionsCustom = mpValidationCustom.mpValidationOptions;
55
55
 
56
56
  var MarketingPreferencesDSForm = function MarketingPreferencesDSForm() {
57
- function customSubmitHandler() {
57
+ function customSubmitHandler(formData) {
58
58
  // eslint-disable-next-line no-console
59
- console.log('Successful submission');
59
+ console.log('Successful submission', formData);
60
60
  } // For our default instance:
61
61
 
62
62
 
@@ -28,12 +28,15 @@ var CheckAnswer = function CheckAnswer(_ref) {
28
28
  if (e.target.checked) {
29
29
  newVal = e.target.value;
30
30
  } else {
31
- newVal = ''; // To ensure we're not letting invalid values get passed, reset any associated fields:
32
-
33
- var theseFields = _AssociatedFields.default[name].fieldNames;
34
- theseFields.forEach(function (fieldName) {
35
- setValue(fieldName, '');
36
- });
31
+ newVal = ''; // To ensure we're not letting invalid values get passed, reset any associated fields
32
+ // but only when it's not a hidden "passed values behind the scenes" field:
33
+
34
+ if (!mpValidationOptions[name].hideInput) {
35
+ var theseFields = _AssociatedFields.default[name].fieldNames;
36
+ theseFields.forEach(function (fieldName) {
37
+ setValue(fieldName, '');
38
+ });
39
+ }
37
40
  } // Update the checkbox field itself
38
41
 
39
42
 
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var whiteList = ['https://giftaid.comicrelief.com', 'https://donation.comicrelief.com', 'https://www.comicrelief.com', 'https://www.sportrelief.com', 'https://app.beapplied.com/org/comic-relief'];
7
+ var whiteList = ['https://giftaid.comicrelief.com', 'https://donation.comicrelief.com', 'https://www.comicrelief.com', 'https://www.sportrelief.com', 'https://app.beapplied.com/org/comic-relief', 'http://stories.comicrelief.com'];
8
8
 
9
9
  var whiteListed = function whiteListed(url) {
10
10
  if (url !== undefined && url !== null && whiteList.some(function (v) {
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": "7.9.0",
4
+ "version": "7.10.0",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -27,8 +27,8 @@ const Image = styled.div`
27
27
  margin: 0 -${spacing('m')} 0 ${spacing('m')};
28
28
 
29
29
  img {
30
- border-radius: 1rem;
31
- box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.15);
30
+ border-radius: ${spacing('md')};
31
+ box-shadow: 0 0 ${spacing('md')} rgba(0, 0, 0, 0.15);
32
32
  }
33
33
  `;
34
34
 
@@ -47,8 +47,8 @@ const Copy = styled.div`
47
47
  ${({ hasLink }) => hasLink && `padding-bottom: ${spacing('xl')}`};
48
48
  display: flex;
49
49
  flex-direction: column;
50
- border-radius: 1rem;
51
- box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.15);
50
+ border-radius: ${spacing('md')};
51
+ box-shadow: 0 0 ${spacing('md')} rgba(0, 0, 0, 0.15);
52
52
  background: ${({ theme, backgroundColor }) => theme.color(backgroundColor)};
53
53
  width: 100%;
54
54
  @media ${({ theme }) => theme.breakpoint('large')} {
@@ -82,7 +82,7 @@ exports[`renders correctly 1`] = `
82
82
 
83
83
  .c2 img {
84
84
  border-radius: 1rem;
85
- box-shadow: 0px 0px 20px rgba(0,0,0,0.15);
85
+ box-shadow: 0 0 1rem rgba(0,0,0,0.15);
86
86
  }
87
87
 
88
88
  .c1 {
@@ -100,7 +100,7 @@ exports[`renders correctly 1`] = `
100
100
  -ms-flex-direction: column;
101
101
  flex-direction: column;
102
102
  border-radius: 1rem;
103
- box-shadow: 0px 0px 20px rgba(0,0,0,0.15);
103
+ box-shadow: 0 0 1rem rgba(0,0,0,0.15);
104
104
  background: #FFFFFF;
105
105
  width: 100%;
106
106
  z-index: 1;
@@ -41,9 +41,9 @@ const {
41
41
  } = mpValidationCustom;
42
42
 
43
43
  const MarketingPreferencesDSForm = () => {
44
- function customSubmitHandler() {
44
+ function customSubmitHandler(formData) {
45
45
  // eslint-disable-next-line no-console
46
- console.log('Successful submission');
46
+ console.log('Successful submission', formData);
47
47
  }
48
48
 
49
49
  // For our default instance:
@@ -20,11 +20,14 @@ const CheckAnswer = ({
20
20
  } else {
21
21
  newVal = '';
22
22
 
23
- // To ensure we're not letting invalid values get passed, reset any associated fields:
24
- const theseFields = AssociatedFields[name].fieldNames;
25
- theseFields.forEach(fieldName => {
26
- setValue(fieldName, '');
27
- });
23
+ // To ensure we're not letting invalid values get passed, reset any associated fields
24
+ // but only when it's not a hidden "passed values behind the scenes" field:
25
+ if (!mpValidationOptions[name].hideInput) {
26
+ const theseFields = AssociatedFields[name].fieldNames;
27
+ theseFields.forEach(fieldName => {
28
+ setValue(fieldName, '');
29
+ });
30
+ }
28
31
  }
29
32
 
30
33
  // Update the checkbox field itself
@@ -3,7 +3,8 @@ const whiteList = [
3
3
  'https://donation.comicrelief.com',
4
4
  'https://www.comicrelief.com',
5
5
  'https://www.sportrelief.com',
6
- 'https://app.beapplied.com/org/comic-relief'
6
+ 'https://app.beapplied.com/org/comic-relief',
7
+ 'http://stories.comicrelief.com'
7
8
  ];
8
9
 
9
10
  const whiteListed = url => {