@comicrelief/component-library 5.8.5 → 6.0.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.
@@ -1,8 +1,30 @@
1
- Type: patch
1
+ ### PR Titles
2
+ #### To pass testing pipeline, these need to follow Conventional Commits spec:
3
+ https://www.conventionalcommits.org/en/v1.0.0/
4
+ e.g.
5
+ `feat: create NewForm component`
6
+ or
7
+ `fix: update broken link in NewForm component`
2
8
 
3
- Fixes #
4
9
 
5
- ## Changes proposed in this PR
10
+ ### PR description
11
+ #### What is it doing?
12
+ Tell us what it is doing from a technical perspective.
6
13
 
7
- - Briefly describe the changes in this PR
8
- - Do you have some test asserting this behavior?
14
+ #### Why is this required?
15
+ Tell us why this is required from a business/product perspective.
16
+
17
+ #### link to Jira ticket:
18
+ Add a link to the Jira ticket.
19
+
20
+
21
+ ### Quick Checklist:
22
+ - [ ] My PR title follows the Conventional Commit spec.
23
+
24
+ - [ ] I have filled out the PR description as per the template above.
25
+
26
+ - [ ] I have added tests to cover new or changed behaviour.
27
+
28
+ - [ ] I have updated any relevant documentation.
29
+
30
+ ### Important! - lastly, make sure to squash merge...
@@ -102,7 +102,7 @@ exports.CTA = CTA;
102
102
  var Copy = _styledComponents.default.div.withConfig({
103
103
  displayName: "SingleMessageDsstyle__Copy",
104
104
  componentId: "sc-s8zd7s-8"
105
- })(["position:relative;height:auto;padding:", ";", ";display:flex;flex-direction:column;border-radius:1rem;", ";background:", ";", ";", ";@media ", "{height:448px;width:calc(50% + 1.5rem);flex-grow:0;flex-shrink:0;flex-basis:calc(50% + 1.5rem);padding:", ";", ";", ";}@media ", "{padding:calc(", " * 2);", ";margin:", ";}"], (0, _spacing.default)('m'), (0, _zIndex.default)('low'), boxShadow, function (_ref10) {
105
+ })(["position:relative;height:auto;padding:", ";", ";display:flex;flex-direction:column;border-radius:1rem;", ";background:", ";", ";", ";@media ", "{min-height:448px;height:auto;width:calc(50% + 1.5rem);flex-grow:0;flex-shrink:0;flex-basis:calc(50% + 1.5rem);padding:", ";", ";", ";}@media ", "{padding:calc(", " * 2);", ";margin:", ";}"], (0, _spacing.default)('m'), (0, _zIndex.default)('low'), boxShadow, function (_ref10) {
106
106
  var theme = _ref10.theme,
107
107
  backgroundColor = _ref10.backgroundColor;
108
108
  return theme.color(backgroundColor);
@@ -200,7 +200,8 @@ exports[`renders correctly 1`] = `
200
200
 
201
201
  @media (min-width:740px) {
202
202
  .c5 {
203
- height: 448px;
203
+ min-height: 448px;
204
+ height: auto;
204
205
  width: calc(50% + 1.5rem);
205
206
  -webkit-box-flex: 0;
206
207
  -webkit-flex-grow: 0;
@@ -62,8 +62,12 @@ var Signup = function Signup(_ref) {
62
62
  setMoneyBuyCopy = _useState8[1];
63
63
 
64
64
  (0, _react.useEffect)(function () {
65
- var givingData = givingType === 'single' ? singleGiving : regularGiving;
66
- setAmountDonate(parseFloat(givingData.moneybuys[1].value));
65
+ var givingData = givingType === 'single' ? singleGiving : regularGiving; // Check the 2nd moneybuy exists before using it;
66
+ // 'philantrophy' carts have been set up to use a single moneybuy.
67
+ // See ENG-1685 for more details
68
+
69
+ var thisAmount = givingData.moneybuys[1] ? givingData.moneybuys[1].value : givingData.moneybuys[0].value;
70
+ setAmountDonate(parseFloat(thisAmount));
67
71
  }, [givingType, singleGiving, regularGiving]);
68
72
  (0, _react.useEffect)(function () {
69
73
  var givingData = givingType === 'single' ? singleGiving : regularGiving;
package/dist/index.js CHANGED
@@ -101,7 +101,7 @@ Object.defineProperty(exports, "Button", {
101
101
  return _Button.default;
102
102
  }
103
103
  });
104
- Object.defineProperty(exports, "Radio", {
104
+ Object.defineProperty(exports, "RadioButton", {
105
105
  enumerable: true,
106
106
  get: function get() {
107
107
  return _RadioButton.default;
@@ -3,10 +3,10 @@
3
3
  CR-CL has a dependency of Styled-components.
4
4
 
5
5
  #### Install the package
6
- `yarn add @comicrelief/component-library`
6
+ `yarn add @comicrelief/component-library`
7
7
 
8
8
  #### Wrap your app with the ThemeProvider and crTheme
9
- `import { ThemeProvider, theme as crTheme } from '@comic-relief/component-library';`
9
+ `import { ThemeProvider, crTheme } from '@comicrelief/component-library';`
10
10
 
11
11
  #### Import components
12
- `import { HeroBanner } from '@comic-relief/component-library';`
12
+ `import { HeroBanner } from '@comicrelief/component-library';`
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": "5.8.5",
4
+ "version": "6.0.0",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -134,7 +134,8 @@ const Copy = styled.div`
134
134
 
135
135
 
136
136
  @media ${({ theme }) => theme.breakpoint('small')} {
137
- height: 448px;
137
+ min-height: 448px;
138
+ height: auto;
138
139
  width: calc(50% + 1.5rem);
139
140
  flex-grow: 0;
140
141
  flex-shrink: 0;
@@ -200,7 +200,8 @@ exports[`renders correctly 1`] = `
200
200
 
201
201
  @media (min-width:740px) {
202
202
  .c5 {
203
- height: 448px;
203
+ min-height: 448px;
204
+ height: auto;
204
205
  width: calc(50% + 1.5rem);
205
206
  -webkit-box-flex: 0;
206
207
  -webkit-flex-grow: 0;
@@ -40,7 +40,14 @@ const Signup = ({
40
40
  useEffect(() => {
41
41
  const givingData = givingType === 'single' ? singleGiving : regularGiving;
42
42
 
43
- setAmountDonate(parseFloat(givingData.moneybuys[1].value));
43
+ // Check the 2nd moneybuy exists before using it;
44
+ // 'philantrophy' carts have been set up to use a single moneybuy.
45
+ // See ENG-1685 for more details
46
+ const thisAmount = givingData.moneybuys[1]
47
+ ? givingData.moneybuys[1].value
48
+ : givingData.moneybuys[0].value;
49
+
50
+ setAmountDonate(parseFloat(thisAmount));
44
51
  }, [givingType, singleGiving, regularGiving]);
45
52
 
46
53
  useEffect(() => {
package/src/index.js CHANGED
@@ -18,7 +18,7 @@ export { default as Logo } from './components/Atoms/Logo/Logo';
18
18
  export { default as Picture } from './components/Atoms/Picture/Picture';
19
19
  export { default as Link } from './components/Atoms/Link/Link';
20
20
  export { default as Button } from './components/Atoms/Button/Button';
21
- export { default as Radio } from './components/Atoms/RadioButton/RadioButton';
21
+ export { default as RadioButton } from './components/Atoms/RadioButton/RadioButton';
22
22
  export { default as Checkbox } from './components/Atoms/Checkbox/Checkbox';
23
23
  export { default as Input } from './components/Atoms/Input/Input';
24
24
  export { default as Select } from './components/Atoms/Select/Select';
@@ -3,7 +3,7 @@ const path = require('path');
3
3
  module.exports = {
4
4
  getComponentPathLine(componentPath) {
5
5
  const name = path.basename(componentPath, '.js');
6
- return `import { ${name} } from '@comic-relief/component-library';`;
6
+ return `import { ${name} } from '@comicrelief/component-library';`;
7
7
  },
8
8
  assetsDir: 'src/styleguide/assets/',
9
9
  styleguideComponents: {