@comicrelief/component-library 6.2.0 → 6.3.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.
- package/dist/components/Atoms/Picture/Picture.md +6 -9
- package/dist/components/Atoms/Picture/Picture.test.js +5 -5
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.md +6 -8
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +3 -3
- package/dist/components/Molecules/Box/Box.md +5 -7
- package/dist/components/Molecules/Box/Box.test.js +3 -3
- package/dist/components/Molecules/Card/Card.md +5 -7
- package/dist/components/Molecules/Card/Card.test.js +5 -5
- package/dist/components/Molecules/CardDs/CardDs.md +8 -12
- package/dist/components/Molecules/CardDs/CardDs.test.js +3 -3
- package/dist/components/Molecules/PartnerLink/PartnerLink.md +2 -3
- package/dist/components/Molecules/PartnerLink/PartnerLink.test.js +3 -3
- package/dist/components/Molecules/Promo/Promo.md +13 -14
- package/dist/components/Molecules/Promo/Promo.test.js +5 -5
- package/dist/components/Molecules/SearchResult/SearchResult.md +12 -16
- package/dist/components/Molecules/SearchResult/SearchResult.test.js +5 -5
- package/dist/components/Molecules/SingleMessage/SingleMessage.md +37 -48
- package/dist/components/Molecules/SingleMessage/SingleMessage.test.js +15 -15
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.md +15 -20
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +3 -3
- package/dist/components/Organisms/Donate/Donate.js +35 -7
- package/dist/components/Organisms/Donate/Donate.md +148 -14
- package/dist/components/Organisms/Donate/Donate.style.js +61 -45
- package/dist/components/Organisms/Donate/Donate.test.js +7 -7
- package/dist/components/Organisms/Donate/Form/Form.js +6 -1
- package/dist/components/Organisms/Donate/Form/PopUpComponent.js +74 -0
- package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +344 -388
- package/dist/components/Organisms/Donate/assets/close.svg +3 -0
- package/dist/components/Organisms/Membership/Membership.md +6 -6
- package/dist/components/Organisms/Membership/Membership.test.js +5 -5
- package/dist/styleguide/data/data.js +9 -3
- package/package.json +2 -1
- package/src/components/Atoms/Picture/Picture.md +6 -9
- package/src/components/Atoms/Picture/Picture.test.js +4 -5
- package/src/components/Molecules/ArticleTeaser/ArticleTeaser.md +6 -8
- package/src/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +3 -4
- package/src/components/Molecules/Box/Box.md +5 -7
- package/src/components/Molecules/Box/Box.test.js +2 -3
- package/src/components/Molecules/Card/Card.md +5 -7
- package/src/components/Molecules/Card/Card.test.js +3 -4
- package/src/components/Molecules/CardDs/CardDs.md +8 -12
- package/src/components/Molecules/CardDs/CardDs.test.js +3 -4
- package/src/components/Molecules/PartnerLink/PartnerLink.md +2 -3
- package/src/components/Molecules/PartnerLink/PartnerLink.test.js +2 -3
- package/src/components/Molecules/Promo/Promo.md +13 -14
- package/src/components/Molecules/Promo/Promo.test.js +5 -6
- package/src/components/Molecules/SearchResult/SearchResult.md +12 -16
- package/src/components/Molecules/SearchResult/SearchResult.test.js +5 -5
- package/src/components/Molecules/SingleMessage/SingleMessage.md +37 -48
- package/src/components/Molecules/SingleMessage/SingleMessage.test.js +15 -16
- package/src/components/Molecules/SingleMessageDS/SingleMessageDs.md +15 -20
- package/src/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +3 -4
- package/src/components/Organisms/Donate/Donate.js +91 -50
- package/src/components/Organisms/Donate/Donate.md +148 -14
- package/src/components/Organisms/Donate/Donate.style.js +16 -1
- package/src/components/Organisms/Donate/Donate.test.js +7 -7
- package/src/components/Organisms/Donate/Form/Form.js +9 -1
- package/src/components/Organisms/Donate/Form/PopUpComponent.js +63 -0
- package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +344 -388
- package/src/components/Organisms/Donate/assets/close.svg +3 -0
- package/src/components/Organisms/Membership/Membership.md +6 -6
- package/src/components/Organisms/Membership/Membership.test.js +9 -14
- package/src/styleguide/data/data.js +12 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M5.70694 4.99994L9.85344 0.853438C10.0487 0.658188 10.0487 0.341688 9.85344 0.146437C9.65819 -0.0488125 9.34169 -0.0488125 9.14644 0.146437L4.99994 4.29294L0.853438 0.146437C0.658188 -0.0488125 0.341688 -0.0488125 0.146437 0.146437C-0.0488125 0.341688 -0.0488125 0.658188 0.146437 0.853438L4.29294 4.99994L0.146437 9.14644C-0.0488125 9.34169 -0.0488125 9.65819 0.146437 9.85344C0.244188 9.95119 0.371938 9.99994 0.499938 9.99994C0.627937 9.99994 0.755688 9.95119 0.853438 9.85344L4.99994 5.70694L9.14644 9.85344C9.24419 9.95119 9.37194 9.99994 9.49994 9.99994C9.62794 9.99994 9.75569 9.95119 9.85344 9.85344C10.0487 9.65819 10.0487 9.34169 9.85344 9.14644L5.70694 4.99994Z" fill="#222222"/>
|
|
3
|
+
</svg>
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
import data from './dev-data/data';
|
|
7
|
-
const
|
|
7
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;
|
|
8
8
|
|
|
9
9
|
<Membership
|
|
10
10
|
alt="Background image"
|
|
11
11
|
backgroundColor="orange_light"
|
|
12
12
|
formAligntRight={true}
|
|
13
|
-
imageLow={
|
|
14
|
-
images={
|
|
13
|
+
imageLow={defaultData.imageLow}
|
|
14
|
+
images={defaultData.images}
|
|
15
15
|
data={data}
|
|
16
16
|
mbshipID="mship-1"
|
|
17
17
|
donateLink="https://donation.comicrelief.com/"
|
|
@@ -26,13 +26,13 @@ const pictures = require('../../../styleguide/data/data').default;
|
|
|
26
26
|
|
|
27
27
|
```js
|
|
28
28
|
import data from './dev-data/data';
|
|
29
|
-
const
|
|
29
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;
|
|
30
30
|
|
|
31
31
|
<Membership
|
|
32
32
|
backgroundColor="orange_light"
|
|
33
33
|
formAligntRight={false}
|
|
34
|
-
imageLow={
|
|
35
|
-
images={
|
|
34
|
+
imageLow={defaultData.imageLow}
|
|
35
|
+
images={defaultData.images}
|
|
36
36
|
data={data}
|
|
37
37
|
mbshipID="mship-1"
|
|
38
38
|
donateLink="https://donation.comicrelief.com/"
|
|
@@ -10,17 +10,17 @@ var _shallowWithTheme = _interopRequireDefault(require("../../../hoc/shallowWith
|
|
|
10
10
|
|
|
11
11
|
var _Membership = _interopRequireDefault(require("./Membership"));
|
|
12
12
|
|
|
13
|
-
var _data =
|
|
13
|
+
var _data = require("../../../styleguide/data/data");
|
|
14
14
|
|
|
15
15
|
var _data2 = _interopRequireDefault(require("./dev-data/data"));
|
|
16
16
|
|
|
17
|
-
it(
|
|
17
|
+
it("renders correctly", function () {
|
|
18
18
|
var tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Membership.default, {
|
|
19
19
|
alt: "Background image",
|
|
20
20
|
backgroundColor: "orange_light",
|
|
21
21
|
formAligntRight: false,
|
|
22
|
-
imageLow: _data.
|
|
23
|
-
images: _data.
|
|
22
|
+
imageLow: _data.defaultData.pictures.imageLow,
|
|
23
|
+
images: _data.defaultData.pictures.images,
|
|
24
24
|
data: _data2.default,
|
|
25
25
|
mbshipID: "mship-1",
|
|
26
26
|
donateLink: "https://donation.comicrelief.com/",
|
|
@@ -29,5 +29,5 @@ it('renders correctly', function () {
|
|
|
29
29
|
subtitle: "Jordan was close to suicide - which is now the biggest killer of men under 45 in the UK. Join now and help save lives.",
|
|
30
30
|
otherDescription: "Your donation will help us fund amazing projects in the UK and around the world."
|
|
31
31
|
})).toJSON();
|
|
32
|
-
expect(tree).toMatchInlineSnapshot("\n .c6 {\n font-size: 1.5rem;\n line-height: 1.5rem;\n text-transform: inherit;\n font-weight: 800;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c7 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c12 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c16 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n font-weight: bold;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c22 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n font-weight: 500;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c1 {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n }\n\n .c3 {\n width: 100%;\n height: 100%;\n display: block;\n object-fit: cover;\n }\n\n .c14 {\n position: relative;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n color: #5C5C5E;\n width: 100%;\n }\n\n .c17 {\n margin-bottom: 0.5rem;\n }\n\n .c19 {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: 48px;\n padding: 1rem 1.5rem;\n background-color: #F4F3F5;\n border: 1px solid;\n border-color: #E1E2E3;\n box-shadow: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n color: #000000;\n border-radius: 0.5rem;\n font-size: inherit;\n z-index: 2;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c19:focus {\n border: 1px solid #666;\n }\n\n .c18 {\n position: relative;\n font-size: 1.25rem;\n }\n\n .c0 {\n background-color: #FEE3CC;\n position: relative;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n -ms-flex-pack: center;\n justify-content: center;\n min-height: 100vh;\n }\n\n .c2 {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: auto;\n }\n\n .c2:before {\n color: #FEE3CC;\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n box-shadow: inset 0px 4rem 2rem -2rem;\n }\n\n .c4 {\n position: relative;\n max-width: 320px;\n text-align: center;\n margin-bottom: 50%;\n }\n\n .c5 {\n padding: 2rem 1rem 0;\n margin-bottom: 2rem;\n }\n\n .c8 {\n background-color: #FFFFFF;\n box-shadow: 0px 1rem 4rem rgba(0,0,0,0.3);\n height: 450px;\n }\n\n .c9 {\n padding: 1rem;\n }\n\n .c9 h3 {\n margin-top: 1rem;\n }\n\n .c9 input {\n max-width: 100%;\n margin: 0;\n }\n\n .c10 {\n padding: 0;\n margin: 0;\n border: none;\n }\n\n .c10 >:not(:last-child):not(legend) {\n margin-bottom: 2rem;\n }\n\n .c11 {\n margin: 0;\n padding: 0;\n }\n\n .c13 {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: justify;\n -webkit-justify-content: space-between;\n -ms-flex-pack: justify;\n justify-content: space-between;\n }\n\n .c13 label {\n -webkit-flex: 0 0 30%;\n -ms-flex: 0 0 30%;\n flex: 0 0 30%;\n }\n\n .c13 label input {\n cursor: pointer;\n padding: 1rem;\n }\n\n .c13 label:hover input {\n border-color: #E52630;\n }\n\n .c21 {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n }\n\n .c23 {\n margin-right: auto;\n }\n\n .c24 {\n position: relative;\n -webkit-flex: 0 0 50%;\n -ms-flex: 0 0 50%;\n flex: 0 0 50%;\n font-weight: 400;\n display: block;\n }\n\n .c24 span {\n position: absolute;\n padding: 0px 15px;\n font-size: 20px;\n top: 50%;\n -webkit-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n left: 0px;\n font-weight: 500;\n }\n\n .c24 input {\n border: 2px solid #E1E2E3;\n background: transparent;\n padding: 0.5rem 1rem 0.5rem 2rem;\n }\n\n .c24 input:focus {\n border: 2px solid #E52630;\n }\n\n .c26 {\n line-height: 1.5;\n }\n\n .c25 {\n width: 100%;\n color: #FFFFFF;\n font-size: 1rem;\n font-weight: bold;\n cursor: pointer;\n padding: 1rem 0.5rem;\n background: #E52630;\n border: none;\n border-radius: 100px;\n }\n\n .c25:active,\n .c25:focus,\n .c25:hover {\n background-color: #961D35;\n }\n\n .c15 {\n display: block;\n }\n\n .c15 input {\n border: 2px solid #E1E2E3;\n font-size: 1.5rem;\n font-weight: 800;\n -webkit-letter-spacing: -2px;\n -moz-letter-spacing: -2px;\n -ms-letter-spacing: -2px;\n letter-spacing: -2px;\n height: auto;\n }\n\n .c20 {\n display: block;\n }\n\n .c20 input {\n border: 2px solid #E1E2E3;\n font-size: 1.5rem;\n font-weight: 800;\n -webkit-letter-spacing: -2px;\n -moz-letter-spacing: -2px;\n -ms-letter-spacing: -2px;\n letter-spacing: -2px;\n height: auto;\n border-color: #E52630;\n background-color: #E52630;\n color: #FFFFFF;\n }\n\n @media (min-width:740px) {\n .c19 {\n max-width: 290px;\n }\n }\n\n @media (min-width:1024px) {\n .c0 {\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: inherit;\n -webkit-justify-content: inherit;\n -ms-flex-pack: inherit;\n justify-content: inherit;\n min-height: 750px;\n height: 100vh;\n max-height: 900px;\n -webkit-flex-direction: row;\n -ms-flex-direction: row;\n flex-direction: row;\n }\n }\n\n @media (min-width:1024px) {\n .c2 {\n height: 100%;\n }\n\n .c2:before {\n content: none;\n }\n }\n\n @media (min-width:1024px) {\n .c4 {\n margin: 0 8rem;\n max-width: 420px;\n }\n }\n\n @media (min-width:1024px) {\n .c8 {\n height: 430px;\n }\n }\n\n @media (min-width:1024px) {\n .c24 {\n -webkit-flex: 0 0 60%;\n -ms-flex: 0 0 60%;\n flex: 0 0 60%;\n }\n }\n\n @media (min-width:1024px) {\n .c25 {\n width: auto;\n padding: 1rem 2rem;\n margin: 0 auto 2rem;\n }\n }\n\n <div\n className=\"c0\"\n id=\"mship-1\"\n >\n <div\n className=\"c1 c2\"\n height=\"100%\"\n width=\"100%\"\n >\n <img\n alt=\"Background image\"\n className=\"c3 lazyload\"\n data-lowsrc=\"http://images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=100&h=50&q=100\"\n data-sizes=\"auto\"\n data-src={null}\n data-srcset=\"//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=200&h=150&q=50 200w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=400&h=300&q=50 400w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=800&h=600&q=50 800w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=1200&h=900&q=50 1200w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=1440&h=1080&q=50 1440w\"\n height=\"100%\"\n src={null}\n srcSet=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"\n width=\"100%\"\n />\n </div>\n <div\n className=\"c4\"\n >\n <div\n className=\"c5\"\n >\n <h2\n className=\"c6\"\n color=\"inherit\"\n size=\"l\"\n >\n Help someone like Jordan see a better tomorrow\n </h2>\n <p\n className=\"c7\"\n color=\"inherit\"\n size=\"s\"\n >\n Jordan was close to suicide - which is now the biggest killer of men under 45 in the UK. Join now and help save lives.\n </p>\n </div>\n <div\n className=\"c8\"\n >\n <form\n className=\"c9\"\n onSubmit={[Function]}\n >\n <fieldset\n className=\"c10\"\n >\n <legend\n className=\"c11\"\n >\n <h3\n className=\"c12\"\n color=\"inherit\"\n size=\"s\"\n >\n Choose your monthly donation\n </h3>\n </legend>\n <div\n className=\"c13\"\n >\n <label\n className=\"c14 c15\"\n htmlFor=\"mship-1--moneyBuy-box1\"\n >\n <span\n className=\"c16 c17\"\n color=\"inherit\"\n dangerouslySetInnerHTML={\n Object {\n \"__html\": \"\",\n }\n }\n size=\"s\"\n />\n <div\n className=\"c18\"\n >\n \n <input\n aria-describedby=\"mship-1--moneyBuy-box1\"\n aria-label=\"\xA35\"\n className=\"c19\"\n id=\"mship-1--moneyBuy-box1\"\n name=\"mship-1--moneyBuy1\"\n onClick={[Function]}\n placeholder=\"\"\n required={false}\n type=\"button\"\n value=\"\xA3 5\"\n />\n </div>\n \n </label>\n <label\n className=\"c14 c20\"\n htmlFor=\"mship-1--moneyBuy-box2\"\n >\n <span\n className=\"c16 c17\"\n color=\"inherit\"\n dangerouslySetInnerHTML={\n Object {\n \"__html\": \"\",\n }\n }\n size=\"s\"\n />\n <div\n className=\"c18\"\n >\n \n <input\n aria-describedby=\"mship-1--moneyBuy-box2\"\n aria-label=\"\xA310\"\n className=\"c19\"\n id=\"mship-1--moneyBuy-box2\"\n name=\"mship-1--moneyBuy2\"\n onClick={[Function]}\n placeholder=\"\"\n required={false}\n type=\"button\"\n value=\"\xA3 10\"\n />\n </div>\n \n </label>\n <label\n className=\"c14 c15\"\n htmlFor=\"mship-1--moneyBuy-box3\"\n >\n <span\n className=\"c16 c17\"\n color=\"inherit\"\n dangerouslySetInnerHTML={\n Object {\n \"__html\": \"\",\n }\n }\n size=\"s\"\n />\n <div\n className=\"c18\"\n >\n \n <input\n aria-describedby=\"mship-1--moneyBuy-box3\"\n aria-label=\"\xA320\"\n className=\"c19\"\n id=\"mship-1--moneyBuy-box3\"\n name=\"mship-1--moneyBuy3\"\n onClick={[Function]}\n placeholder=\"\"\n required={false}\n type=\"button\"\n value=\"\xA3 20\"\n />\n </div>\n \n </label>\n </div>\n <div\n className=\"c21\"\n >\n <span\n className=\"c22 c23\"\n color=\"inherit\"\n size=\"s\"\n >\n Other amount\n </span>\n <label\n className=\"c14 c24\"\n htmlFor=\"mship-1--MoneyBuy-userInput\"\n >\n <span\n className=\"c16 c17\"\n color=\"inherit\"\n dangerouslySetInnerHTML={\n Object {\n \"__html\": \"\xA3\",\n }\n }\n size=\"s\"\n />\n <div\n className=\"c18\"\n >\n \n <input\n aria-describedby=\"mship-1--MoneyBuy-userInput\"\n aria-label=\"Input a different amount\"\n className=\"c19\"\n id=\"mship-1--MoneyBuy-userInput\"\n max=\"20000\"\n min=\"1\"\n name=\"membership_amount\"\n onChange={[Function]}\n onClick={[Function]}\n onKeyPress={[Function]}\n pattern=\"[^[0-9]+([,.][0-9]+)?$]\"\n placeholder=\"0.00\"\n required={false}\n step=\"0.01\"\n type=\"number\"\n value=\"\"\n />\n </div>\n \n </label>\n </div>\n <input\n className=\"c25\"\n type=\"submit\"\n value=\"Donate\"\n />\n <p\n className=\"c26\"\n />\n </fieldset>\n </form>\n </div>\n </div>\n </div>\n ");
|
|
32
|
+
expect(tree).toMatchInlineSnapshot("\n .c6 {\n font-size: 1.5rem;\n line-height: 1.5rem;\n text-transform: inherit;\n font-weight: 800;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c7 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c12 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c16 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n font-weight: bold;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c22 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n font-weight: 500;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c1 {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n }\n\n .c3 {\n width: 100%;\n height: 100%;\n display: block;\n object-fit: cover;\n }\n\n .c14 {\n position: relative;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n color: #5C5C5E;\n width: 100%;\n }\n\n .c17 {\n margin-bottom: 0.5rem;\n }\n\n .c19 {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: 48px;\n padding: 1rem 1.5rem;\n background-color: #F4F3F5;\n border: 1px solid;\n border-color: #E1E2E3;\n box-shadow: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n color: #000000;\n border-radius: 0.5rem;\n font-size: inherit;\n z-index: 2;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c19:focus {\n border: 1px solid #666;\n }\n\n .c18 {\n position: relative;\n font-size: 1.25rem;\n }\n\n .c0 {\n background-color: #FEE3CC;\n position: relative;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n -ms-flex-pack: center;\n justify-content: center;\n min-height: 100vh;\n }\n\n .c2 {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: auto;\n }\n\n .c2:before {\n color: #FEE3CC;\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n box-shadow: inset 0px 4rem 2rem -2rem;\n }\n\n .c4 {\n position: relative;\n max-width: 320px;\n text-align: center;\n margin-bottom: 50%;\n }\n\n .c5 {\n padding: 2rem 1rem 0;\n margin-bottom: 2rem;\n }\n\n .c8 {\n background-color: #FFFFFF;\n box-shadow: 0px 1rem 4rem rgba(0,0,0,0.3);\n height: 450px;\n }\n\n .c9 {\n padding: 1rem;\n }\n\n .c9 h3 {\n margin-top: 1rem;\n }\n\n .c9 input {\n max-width: 100%;\n margin: 0;\n }\n\n .c10 {\n padding: 0;\n margin: 0;\n border: none;\n }\n\n .c10 >:not(:last-child):not(legend) {\n margin-bottom: 2rem;\n }\n\n .c11 {\n margin: 0;\n padding: 0;\n }\n\n .c13 {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: justify;\n -webkit-justify-content: space-between;\n -ms-flex-pack: justify;\n justify-content: space-between;\n }\n\n .c13 label {\n -webkit-flex: 0 0 30%;\n -ms-flex: 0 0 30%;\n flex: 0 0 30%;\n }\n\n .c13 label input {\n cursor: pointer;\n padding: 1rem;\n }\n\n .c13 label:hover input {\n border-color: #E52630;\n }\n\n .c21 {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n }\n\n .c23 {\n margin-right: auto;\n }\n\n .c24 {\n position: relative;\n -webkit-flex: 0 0 50%;\n -ms-flex: 0 0 50%;\n flex: 0 0 50%;\n font-weight: 400;\n display: block;\n }\n\n .c24 span {\n position: absolute;\n padding: 0px 15px;\n font-size: 20px;\n top: 50%;\n -webkit-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n left: 0px;\n font-weight: 500;\n }\n\n .c24 input {\n border: 2px solid #E1E2E3;\n background: transparent;\n padding: 0.5rem 1rem 0.5rem 2rem;\n }\n\n .c24 input:focus {\n border: 2px solid #E52630;\n }\n\n .c26 {\n line-height: 1.5;\n }\n\n .c25 {\n width: 100%;\n color: #FFFFFF;\n font-size: 1rem;\n font-weight: bold;\n cursor: pointer;\n padding: 1rem 0.5rem;\n background: #E52630;\n border: none;\n border-radius: 100px;\n }\n\n .c25:active,\n .c25:focus,\n .c25:hover {\n background-color: #961D35;\n }\n\n .c15 {\n display: block;\n }\n\n .c15 input {\n border: 2px solid #E1E2E3;\n font-size: 1.5rem;\n font-weight: 800;\n -webkit-letter-spacing: -2px;\n -moz-letter-spacing: -2px;\n -ms-letter-spacing: -2px;\n letter-spacing: -2px;\n height: auto;\n }\n\n .c20 {\n display: block;\n }\n\n .c20 input {\n border: 2px solid #E1E2E3;\n font-size: 1.5rem;\n font-weight: 800;\n -webkit-letter-spacing: -2px;\n -moz-letter-spacing: -2px;\n -ms-letter-spacing: -2px;\n letter-spacing: -2px;\n height: auto;\n border-color: #E52630;\n background-color: #E52630;\n color: #FFFFFF;\n }\n\n @media (min-width:740px) {\n .c19 {\n max-width: 290px;\n }\n }\n\n @media (min-width:1024px) {\n .c0 {\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: inherit;\n -webkit-justify-content: inherit;\n -ms-flex-pack: inherit;\n justify-content: inherit;\n min-height: 750px;\n height: 100vh;\n max-height: 900px;\n -webkit-flex-direction: row;\n -ms-flex-direction: row;\n flex-direction: row;\n }\n }\n\n @media (min-width:1024px) {\n .c2 {\n height: 100%;\n }\n\n .c2:before {\n content: none;\n }\n }\n\n @media (min-width:1024px) {\n .c4 {\n margin: 0 8rem;\n max-width: 420px;\n }\n }\n\n @media (min-width:1024px) {\n .c8 {\n height: 430px;\n }\n }\n\n @media (min-width:1024px) {\n .c24 {\n -webkit-flex: 0 0 60%;\n -ms-flex: 0 0 60%;\n flex: 0 0 60%;\n }\n }\n\n @media (min-width:1024px) {\n .c25 {\n width: auto;\n padding: 1rem 2rem;\n margin: 0 auto 2rem;\n }\n }\n\n <div\n className=\"c0\"\n id=\"mship-1\"\n >\n <div\n className=\"c1 c2\"\n height=\"100%\"\n width=\"100%\"\n >\n <img\n alt=\"Background image\"\n className=\"c3 lazyload\"\n data-src={null}\n height=\"100%\"\n width=\"100%\"\n />\n </div>\n <div\n className=\"c4\"\n >\n <div\n className=\"c5\"\n >\n <h2\n className=\"c6\"\n color=\"inherit\"\n size=\"l\"\n >\n Help someone like Jordan see a better tomorrow\n </h2>\n <p\n className=\"c7\"\n color=\"inherit\"\n size=\"s\"\n >\n Jordan was close to suicide - which is now the biggest killer of men under 45 in the UK. Join now and help save lives.\n </p>\n </div>\n <div\n className=\"c8\"\n >\n <form\n className=\"c9\"\n onSubmit={[Function]}\n >\n <fieldset\n className=\"c10\"\n >\n <legend\n className=\"c11\"\n >\n <h3\n className=\"c12\"\n color=\"inherit\"\n size=\"s\"\n >\n Choose your monthly donation\n </h3>\n </legend>\n <div\n className=\"c13\"\n >\n <label\n className=\"c14 c15\"\n htmlFor=\"mship-1--moneyBuy-box1\"\n >\n <span\n className=\"c16 c17\"\n color=\"inherit\"\n dangerouslySetInnerHTML={\n Object {\n \"__html\": \"\",\n }\n }\n size=\"s\"\n />\n <div\n className=\"c18\"\n >\n \n <input\n aria-describedby=\"mship-1--moneyBuy-box1\"\n aria-label=\"\xA35\"\n className=\"c19\"\n id=\"mship-1--moneyBuy-box1\"\n name=\"mship-1--moneyBuy1\"\n onClick={[Function]}\n placeholder=\"\"\n required={false}\n type=\"button\"\n value=\"\xA3 5\"\n />\n </div>\n \n </label>\n <label\n className=\"c14 c20\"\n htmlFor=\"mship-1--moneyBuy-box2\"\n >\n <span\n className=\"c16 c17\"\n color=\"inherit\"\n dangerouslySetInnerHTML={\n Object {\n \"__html\": \"\",\n }\n }\n size=\"s\"\n />\n <div\n className=\"c18\"\n >\n \n <input\n aria-describedby=\"mship-1--moneyBuy-box2\"\n aria-label=\"\xA310\"\n className=\"c19\"\n id=\"mship-1--moneyBuy-box2\"\n name=\"mship-1--moneyBuy2\"\n onClick={[Function]}\n placeholder=\"\"\n required={false}\n type=\"button\"\n value=\"\xA3 10\"\n />\n </div>\n \n </label>\n <label\n className=\"c14 c15\"\n htmlFor=\"mship-1--moneyBuy-box3\"\n >\n <span\n className=\"c16 c17\"\n color=\"inherit\"\n dangerouslySetInnerHTML={\n Object {\n \"__html\": \"\",\n }\n }\n size=\"s\"\n />\n <div\n className=\"c18\"\n >\n \n <input\n aria-describedby=\"mship-1--moneyBuy-box3\"\n aria-label=\"\xA320\"\n className=\"c19\"\n id=\"mship-1--moneyBuy-box3\"\n name=\"mship-1--moneyBuy3\"\n onClick={[Function]}\n placeholder=\"\"\n required={false}\n type=\"button\"\n value=\"\xA3 20\"\n />\n </div>\n \n </label>\n </div>\n <div\n className=\"c21\"\n >\n <span\n className=\"c22 c23\"\n color=\"inherit\"\n size=\"s\"\n >\n Other amount\n </span>\n <label\n className=\"c14 c24\"\n htmlFor=\"mship-1--MoneyBuy-userInput\"\n >\n <span\n className=\"c16 c17\"\n color=\"inherit\"\n dangerouslySetInnerHTML={\n Object {\n \"__html\": \"\xA3\",\n }\n }\n size=\"s\"\n />\n <div\n className=\"c18\"\n >\n \n <input\n aria-describedby=\"mship-1--MoneyBuy-userInput\"\n aria-label=\"Input a different amount\"\n className=\"c19\"\n id=\"mship-1--MoneyBuy-userInput\"\n max=\"20000\"\n min=\"1\"\n name=\"membership_amount\"\n onChange={[Function]}\n onClick={[Function]}\n onKeyPress={[Function]}\n pattern=\"[^[0-9]+([,.][0-9]+)?$]\"\n placeholder=\"0.00\"\n required={false}\n step=\"0.01\"\n type=\"number\"\n value=\"\"\n />\n </div>\n \n </label>\n </div>\n <input\n className=\"c25\"\n type=\"submit\"\n value=\"Donate\"\n />\n <p\n className=\"c26\"\n />\n </fieldset>\n </form>\n </div>\n </div>\n </div>\n ");
|
|
33
33
|
});
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
6
|
+
exports.mobileImages = exports.defaultData = void 0;
|
|
7
|
+
var defaultData = {
|
|
8
8
|
title: 'What your money does',
|
|
9
9
|
text: 'When you donate to Comic Relief or Sport Relief, you’re supporting vulnerable people and communities in the UK and internationally.',
|
|
10
10
|
pictures: {
|
|
@@ -18,4 +18,10 @@ var _default = {
|
|
|
18
18
|
image: 'http://images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg',
|
|
19
19
|
images: '//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=200&h=150&q=50 200w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=400&h=300&q=50 400w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=800&h=600&q=50 800w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=1200&h=900&q=50 1200w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=1440&h=1080&q=50 1440w'
|
|
20
20
|
};
|
|
21
|
-
exports.
|
|
21
|
+
exports.defaultData = defaultData;
|
|
22
|
+
var mobileImages = {
|
|
23
|
+
imageLow: 'http://images.ctfassets.net/zsfivwzfgl3t/54DHIEgtwbr9TDkf70lToB/ffe8d6a8e9bbc224343f475a5c55c832/-CROP-Promo-Des_2000x945-_Kate.jpg?w=100&h=50&q=100',
|
|
24
|
+
image: 'https://images.ctfassets.net/zsfivwzfgl3t/54DHIEgtwbr9TDkf70lToB/ffe8d6a8e9bbc224343f475a5c55c832/-CROP-Promo-Des_2000x945-_Kate.jpg',
|
|
25
|
+
images: '//https://images.ctfassets.net/zsfivwzfgl3t/54DHIEgtwbr9TDkf70lToB/ffe8d6a8e9bbc224343f475a5c55c832/-CROP-Promo-Des_2000x945-_Kate.jpg?w=200&h=150&q=50 200w,//images.ctfassets.net/zsfivwzfgl3t/54DHIEgtwbr9TDkf70lToB/ffe8d6a8e9bbc224343f475a5c55c832/-CROP-Promo-Des_2000x945-_Kate.jpg?w=400&h=300&q=50 400w,//images.ctfassets.net/zsfivwzfgl3t/54DHIEgtwbr9TDkf70lToB/ffe8d6a8e9bbc224343f475a5c55c832/-CROP-Promo-Des_2000x945-_Kate.jpg?w=800&h=600&q=50 800w,//images.ctfassets.net/zsfivwzfgl3t/54DHIEgtwbr9TDkf70lToB/ffe8d6a8e9bbc224343f475a5c55c832/-CROP-Promo-Des_2000x945-_Kate.jpg?w=1200&h=900&q=50 1200w,//images.ctfassets.net/zsfivwzfgl3t/54DHIEgtwbr9TDkf70lToB/ffe8d6a8e9bbc224343f475a5c55c832/-CROP-Promo-Des_2000x945-_Kate.jpg?w=1440&h=1080&q=50 1440w'
|
|
26
|
+
};
|
|
27
|
+
exports.mobileImages = mobileImages;
|
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": "6.
|
|
4
|
+
"version": "6.3.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"jest": {
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"react-dom": "^17.0.2",
|
|
35
35
|
"react-hook-form": "^6.3.0",
|
|
36
36
|
"react-modal": "^3.14.3",
|
|
37
|
+
"react-responsive": "^9.0.0",
|
|
37
38
|
"react-scripts": "4.0.3",
|
|
38
39
|
"react-spinners": "^0.11.0",
|
|
39
40
|
"react-styleguidist": "^11.1.7",
|
|
@@ -3,19 +3,17 @@ Picture has depenciy of <a href="https://github.com/aFarkas/lazysizes#readme" st
|
|
|
3
3
|
Picture
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
<Picture alt="test Image" imageLow={data.imageLow} images={data.images} />;
|
|
6
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;
|
|
7
|
+
<Picture alt="test Image" imageLow={defaultData.imageLow} images={defaultData.images} />;
|
|
9
8
|
```
|
|
10
9
|
|
|
11
10
|
Custom Size.
|
|
12
11
|
|
|
13
12
|
```js
|
|
14
|
-
const
|
|
15
|
-
<Picture
|
|
13
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;<Picture
|
|
16
14
|
alt="test Image"
|
|
17
|
-
imageLow={
|
|
18
|
-
images={
|
|
15
|
+
imageLow={defaultData.imageLow}
|
|
16
|
+
images={defaultData.images}
|
|
19
17
|
objectFit="cover"
|
|
20
18
|
width="300px"
|
|
21
19
|
height="200px"
|
|
@@ -25,6 +23,5 @@ const data = require('../../../styleguide/data/data').default;
|
|
|
25
23
|
Single image
|
|
26
24
|
|
|
27
25
|
```js
|
|
28
|
-
const
|
|
29
|
-
<Picture alt="test Image" image={data.image} objectFit="cover" />;
|
|
26
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;<Picture alt="test Image" image={defaultData.image} objectFit="cover" />;
|
|
30
27
|
```
|
|
@@ -2,11 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import 'jest-styled-components';
|
|
3
3
|
import renderWithTheme from '../../../hoc/shallowWithTheme';
|
|
4
4
|
import Picture from './Picture';
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import { defaultData } from '../../../styleguide/data/data';
|
|
7
6
|
it('renders correctly', () => {
|
|
8
7
|
const tree = renderWithTheme(
|
|
9
|
-
<Picture images={
|
|
8
|
+
<Picture images={defaultData.images} image={defaultData.image} alt="Test images" />
|
|
10
9
|
).toJSON();
|
|
11
10
|
|
|
12
11
|
expect(tree).toMatchInlineSnapshot(`
|
|
@@ -48,8 +47,8 @@ it('renders correctly', () => {
|
|
|
48
47
|
it('renders correctly with custom props', () => {
|
|
49
48
|
const tree = renderWithTheme(
|
|
50
49
|
<Picture
|
|
51
|
-
images={
|
|
52
|
-
image={
|
|
50
|
+
images={defaultData.images}
|
|
51
|
+
image={defaultData.image}
|
|
53
52
|
objectFit="cover"
|
|
54
53
|
width="200px"
|
|
55
54
|
height="100px"
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
### Article teaser
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
|
-
const
|
|
5
|
-
<div style={{ display: 'flex', background: '#E1E2E3' }}>
|
|
4
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;<div style={{ display: 'flex', background: '#E1E2E3' }}>
|
|
6
5
|
<div style={{ margin: '1rem', width: '300px' }}>
|
|
7
6
|
<ArticleTeaser
|
|
8
7
|
href="/test"
|
|
9
|
-
images={
|
|
10
|
-
imageLow={
|
|
8
|
+
images={defaultData.images}
|
|
9
|
+
imageLow={defaultData.imageLow}
|
|
11
10
|
date=" 01 July 2019"
|
|
12
11
|
title="News article"
|
|
13
12
|
alt="Image's description"
|
|
@@ -17,8 +16,8 @@ const data = require('../../../styleguide/data/data').default;
|
|
|
17
16
|
<div style={{ margin: '1rem', width: '300px' }}>
|
|
18
17
|
<ArticleTeaser
|
|
19
18
|
href="/test"
|
|
20
|
-
images={
|
|
21
|
-
imageLow={
|
|
19
|
+
images={defaultData.images}
|
|
20
|
+
imageLow={defaultData.imageLow}
|
|
22
21
|
date=" 01 July 2019"
|
|
23
22
|
title="News article News article"
|
|
24
23
|
alt="Image's description"
|
|
@@ -31,8 +30,7 @@ const data = require('../../../styleguide/data/data').default;
|
|
|
31
30
|
### Article teaser: Press release
|
|
32
31
|
|
|
33
32
|
```js
|
|
34
|
-
const
|
|
35
|
-
<ArticleTeaser
|
|
33
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;<ArticleTeaser
|
|
36
34
|
href="/test"
|
|
37
35
|
category=""
|
|
38
36
|
date=" 01 July 2019"
|
|
@@ -2,14 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import 'jest-styled-components';
|
|
3
3
|
import renderWithTheme from '../../../hoc/shallowWithTheme';
|
|
4
4
|
import ArticleTeaser from './ArticleTeaser';
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import { defaultData } from '../../../styleguide/data/data';
|
|
7
6
|
it('renders article teaser correctly', () => {
|
|
8
7
|
const tree = renderWithTheme(
|
|
9
8
|
<ArticleTeaser
|
|
10
9
|
href="/test"
|
|
11
|
-
images={
|
|
12
|
-
image={
|
|
10
|
+
images={defaultData.images}
|
|
11
|
+
image={defaultData.image}
|
|
13
12
|
date=" 01 July 2019"
|
|
14
13
|
title="News article"
|
|
15
14
|
copy="News article copy"
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
## Flexible container only (‘invisible’ to user)
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
|
-
const
|
|
7
|
-
import Text from '../../Atoms/Text/Text';
|
|
6
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;import Text from '../../Atoms/Text/Text';
|
|
8
7
|
import Link from '../../Atoms/Link/Link';
|
|
9
8
|
<div style={{ display: 'flex', background: '#E1E2E3' }}>
|
|
10
9
|
<div style={{ width: '50%', margin: '1rem' }}>
|
|
11
|
-
<Box imageLow={
|
|
10
|
+
<Box imageLow={defaultData.image} images={defaultData.images} height="auto">
|
|
12
11
|
<Text tag="h3" family="Anton" color="black" size="xl" uppercase>
|
|
13
12
|
Title
|
|
14
13
|
</Text>
|
|
@@ -16,7 +15,7 @@ import Link from '../../Atoms/Link/Link';
|
|
|
16
15
|
</Box>
|
|
17
16
|
</div>
|
|
18
17
|
<div style={{ width: '50%', margin: '1rem' }}>
|
|
19
|
-
<Box imageLow={
|
|
18
|
+
<Box imageLow={defaultData.image} images={defaultData.images} height="auto">
|
|
20
19
|
<Text tag="h3" family="Anton" color="black" size="xl" uppercase>
|
|
21
20
|
Title
|
|
22
21
|
</Text>
|
|
@@ -29,7 +28,6 @@ import Link from '../../Atoms/Link/Link';
|
|
|
29
28
|
### Box no body
|
|
30
29
|
|
|
31
30
|
```js
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
<Box imageLow={data.image} images={data.image} />;
|
|
31
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;
|
|
32
|
+
<Box imageLow={defaultData.image} images={defaultData.image} />;
|
|
35
33
|
```
|
|
@@ -2,11 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import 'jest-styled-components';
|
|
3
3
|
import renderWithTheme from '../../../hoc/shallowWithTheme';
|
|
4
4
|
import Box from './Box';
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import { defaultData } from '../../../styleguide/data/data';
|
|
7
6
|
it('renders correctly', () => {
|
|
8
7
|
const tree = renderWithTheme(
|
|
9
|
-
<Box imageLow={
|
|
8
|
+
<Box imageLow={defaultData.image} images={defaultData.image}>
|
|
10
9
|
<h2>Title</h2>
|
|
11
10
|
<p>Description</p>
|
|
12
11
|
</Box>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
# Card
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
|
-
const
|
|
5
|
-
import Text from '../../Atoms/Text/Text';
|
|
4
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;import Text from '../../Atoms/Text/Text';
|
|
6
5
|
import Link from '../../Atoms/Link/Link';
|
|
7
6
|
|
|
8
7
|
<Card
|
|
9
|
-
imageLow={
|
|
10
|
-
images={
|
|
8
|
+
imageLow={defaultData.image}
|
|
9
|
+
images={defaultData.images}
|
|
11
10
|
backgroundColor="yellow"
|
|
12
11
|
height="auto"
|
|
13
12
|
>
|
|
@@ -21,7 +20,6 @@ import Link from '../../Atoms/Link/Link';
|
|
|
21
20
|
### Card no body
|
|
22
21
|
|
|
23
22
|
```js
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
<Card imageLow={data.image} images={data.image} />;
|
|
23
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;
|
|
24
|
+
<Card imageLow={defaultData.image} images={defaultData.image} />;
|
|
27
25
|
```
|
|
@@ -2,11 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import 'jest-styled-components';
|
|
3
3
|
import renderWithTheme from '../../../hoc/shallowWithTheme';
|
|
4
4
|
import Card from './Card';
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import { defaultData } from '../../../styleguide/data/data';
|
|
7
6
|
it('renders correctly', () => {
|
|
8
7
|
const tree = renderWithTheme(
|
|
9
|
-
<Card image={
|
|
8
|
+
<Card image={defaultData.image} images={defaultData.image} backgroundColor="yellow">
|
|
10
9
|
<h2>Title</h2>
|
|
11
10
|
<p>Description</p>
|
|
12
11
|
</Card>
|
|
@@ -17,7 +16,7 @@ it('renders correctly', () => {
|
|
|
17
16
|
|
|
18
17
|
it('renders correctly with no body', () => {
|
|
19
18
|
const tree = renderWithTheme(
|
|
20
|
-
<Card imageLow={
|
|
19
|
+
<Card imageLow={defaultData.image} images={defaultData.image} backgroundColor="yellow" />
|
|
21
20
|
).toJSON();
|
|
22
21
|
|
|
23
22
|
expect(tree).toMatchSnapshot();
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
### CardDs: Image, Text & Link
|
|
6
6
|
```js
|
|
7
|
-
const
|
|
8
|
-
import Text from '../../Atoms/Text/Text';
|
|
7
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;import Text from '../../Atoms/Text/Text';
|
|
9
8
|
import Link from '../../Atoms/Link/Link';
|
|
10
9
|
import { Internal } from '../../Atoms/Icons/index';
|
|
11
10
|
|
|
@@ -21,8 +20,8 @@ import { Internal } from '../../Atoms/Icons/index';
|
|
|
21
20
|
target="_blank"
|
|
22
21
|
link="/home"
|
|
23
22
|
linkLabel="find out more"
|
|
24
|
-
imageLow={
|
|
25
|
-
images={
|
|
23
|
+
imageLow={defaultData.image}
|
|
24
|
+
images={defaultData.images}
|
|
26
25
|
imageAltText="Happy man going to work"
|
|
27
26
|
backgroundColor="white"
|
|
28
27
|
height="auto"
|
|
@@ -39,8 +38,7 @@ import { Internal } from '../../Atoms/Icons/index';
|
|
|
39
38
|
|
|
40
39
|
### CardDs: Text & Link
|
|
41
40
|
```js
|
|
42
|
-
const
|
|
43
|
-
import Text from '../../Atoms/Text/Text';
|
|
41
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;import Text from '../../Atoms/Text/Text';
|
|
44
42
|
import Link from '../../Atoms/Link/Link';
|
|
45
43
|
import { Download } from '../../Atoms/Icons/index';
|
|
46
44
|
|
|
@@ -70,8 +68,7 @@ import { Download } from '../../Atoms/Icons/index';
|
|
|
70
68
|
|
|
71
69
|
### CardDs: Text only
|
|
72
70
|
```js
|
|
73
|
-
const
|
|
74
|
-
import Text from '../../Atoms/Text/Text';
|
|
71
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;import Text from '../../Atoms/Text/Text';
|
|
75
72
|
import Link from '../../Atoms/Link/Link';
|
|
76
73
|
<div
|
|
77
74
|
style={{
|
|
@@ -92,8 +89,7 @@ import Link from '../../Atoms/Link/Link';
|
|
|
92
89
|
|
|
93
90
|
### CardDs: Image & Text, No Link
|
|
94
91
|
```js
|
|
95
|
-
const
|
|
96
|
-
import Text from '../../Atoms/Text/Text';
|
|
92
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;import Text from '../../Atoms/Text/Text';
|
|
97
93
|
import Link from '../../Atoms/Link/Link';
|
|
98
94
|
import { Internal } from '../../Atoms/Icons/index';
|
|
99
95
|
|
|
@@ -107,8 +103,8 @@ import { Internal } from '../../Atoms/Icons/index';
|
|
|
107
103
|
>
|
|
108
104
|
<CardDs
|
|
109
105
|
target="_blank"
|
|
110
|
-
imageLow={
|
|
111
|
-
images={
|
|
106
|
+
imageLow={defaultData.image}
|
|
107
|
+
images={defaultData.images}
|
|
112
108
|
imageAltText="Happy man going to work"
|
|
113
109
|
backgroundColor="white"
|
|
114
110
|
height="auto"
|
|
@@ -2,8 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import 'jest-styled-components';
|
|
3
3
|
import renderWithTheme from '../../../hoc/shallowWithTheme';
|
|
4
4
|
import CardDs from './CardDs';
|
|
5
|
-
import
|
|
6
|
-
import { Internal } from '../../Atoms/Icons/index';
|
|
5
|
+
import { defaultData } from '../../../styleguide/data/data';import { Internal } from '../../Atoms/Icons/index';
|
|
7
6
|
|
|
8
7
|
it('renders correctly', () => {
|
|
9
8
|
const tree = renderWithTheme(
|
|
@@ -11,8 +10,8 @@ it('renders correctly', () => {
|
|
|
11
10
|
target="_blank"
|
|
12
11
|
link="/home"
|
|
13
12
|
linkLabel="Find out more"
|
|
14
|
-
imageLow={
|
|
15
|
-
images={
|
|
13
|
+
imageLow={defaultData.image}
|
|
14
|
+
images={defaultData.images}
|
|
16
15
|
backgroundColor="white"
|
|
17
16
|
height="auto"
|
|
18
17
|
icon={<Internal colour="white" />}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# Partner Link
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
|
-
const
|
|
5
|
-
import Picture from '../../Atoms/Picture/Picture';
|
|
4
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;import Picture from '../../Atoms/Picture/Picture';
|
|
6
5
|
<PartnerLink link="https://www.comicrelief.com">
|
|
7
|
-
<Picture alt="test Image" imageLow={
|
|
6
|
+
<Picture alt="test Image" imageLow={defaultData.imageLow} images={defaultData.images} />
|
|
8
7
|
</PartnerLink>;
|
|
9
8
|
```
|
|
@@ -4,12 +4,11 @@ import 'jest-styled-components';
|
|
|
4
4
|
import renderWithTheme from '../../../hoc/shallowWithTheme';
|
|
5
5
|
import PartnerLink from './PartnerLink';
|
|
6
6
|
import Picture from '../../Atoms/Picture/Picture';
|
|
7
|
-
import
|
|
8
|
-
|
|
7
|
+
import { defaultData } from '../../../styleguide/data/data';
|
|
9
8
|
it('renders correctly', () => {
|
|
10
9
|
const tree = renderWithTheme(
|
|
11
10
|
<PartnerLink link="https://www.comicrelief.com">
|
|
12
|
-
<Picture alt="test Image" imageLow={
|
|
11
|
+
<Picture alt="test Image" imageLow={defaultData.imageLow} images={defaultData.images} />
|
|
13
12
|
</PartnerLink>
|
|
14
13
|
).toJSON();
|
|
15
14
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
Promo
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
|
-
const
|
|
5
|
-
import Text from '../../Atoms/Text/Text';
|
|
4
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;import Text from '../../Atoms/Text/Text';
|
|
6
5
|
import Link from '../../Atoms/Link/Link';
|
|
7
6
|
|
|
8
7
|
<div>
|
|
@@ -11,9 +10,9 @@ import Link from '../../Atoms/Link/Link';
|
|
|
11
10
|
</Text>
|
|
12
11
|
<Promo
|
|
13
12
|
backgroundColor="blue_dark"
|
|
14
|
-
imageSet={
|
|
15
|
-
image={
|
|
16
|
-
imageLow={
|
|
13
|
+
imageSet={defaultData.promoImage}
|
|
14
|
+
image={defaultData.promoImage}
|
|
15
|
+
imageLow={defaultData.promoImage}
|
|
17
16
|
imageAltText=""
|
|
18
17
|
copyFirst={true}
|
|
19
18
|
hasOverlay={true}
|
|
@@ -47,9 +46,9 @@ import Link from '../../Atoms/Link/Link';
|
|
|
47
46
|
</Text>
|
|
48
47
|
<Promo
|
|
49
48
|
backgroundColor="blue_dark"
|
|
50
|
-
imageSet={
|
|
51
|
-
image={
|
|
52
|
-
imageLow={
|
|
49
|
+
imageSet={defaultData.promoImage}
|
|
50
|
+
image={defaultData.promoImage}
|
|
51
|
+
imageLow={defaultData.promoImage}
|
|
53
52
|
imageAltText=""
|
|
54
53
|
copyFirst={true}
|
|
55
54
|
hasOverlay={true}
|
|
@@ -83,9 +82,9 @@ import Link from '../../Atoms/Link/Link';
|
|
|
83
82
|
</Text>
|
|
84
83
|
<Promo
|
|
85
84
|
backgroundColor="blue_dark"
|
|
86
|
-
imageSet={
|
|
87
|
-
image={
|
|
88
|
-
imageLow={
|
|
85
|
+
imageSet={defaultData.promoImage}
|
|
86
|
+
image={defaultData.promoImage}
|
|
87
|
+
imageLow={defaultData.promoImage}
|
|
89
88
|
imageAltText=""
|
|
90
89
|
copyFirst={true}
|
|
91
90
|
hasOverlay={true}
|
|
@@ -119,9 +118,9 @@ import Link from '../../Atoms/Link/Link';
|
|
|
119
118
|
</Text>
|
|
120
119
|
<Promo
|
|
121
120
|
backgroundColor="blue_dark"
|
|
122
|
-
imageSet={
|
|
123
|
-
image={
|
|
124
|
-
imageLow={
|
|
121
|
+
imageSet={defaultData.promoImage}
|
|
122
|
+
image={defaultData.promoImage}
|
|
123
|
+
imageLow={defaultData.promoImage}
|
|
125
124
|
imageAltText=""
|
|
126
125
|
copyFirst={true}
|
|
127
126
|
hasOverlay={true}
|
|
@@ -5,14 +5,13 @@ import Promo from './Promo';
|
|
|
5
5
|
import Text from '../../Atoms/Text/Text';
|
|
6
6
|
import Link from '../../Atoms/Link/Link';
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;
|
|
10
9
|
it('renders Promo correctly', () => {
|
|
11
10
|
const tree = renderWithTheme(
|
|
12
11
|
<Promo
|
|
13
12
|
backgroundColor="blue_dark"
|
|
14
|
-
imageSet={
|
|
15
|
-
image={
|
|
13
|
+
imageSet={defaultData.promoImage}
|
|
14
|
+
image={defaultData.promoImage}
|
|
16
15
|
imageAltText=""
|
|
17
16
|
copyFirst={false}
|
|
18
17
|
>
|
|
@@ -45,8 +44,8 @@ it('renders Promo correctly end position', () => {
|
|
|
45
44
|
const tree = renderWithTheme(
|
|
46
45
|
<Promo
|
|
47
46
|
backgroundColor="blue_dark"
|
|
48
|
-
imageSet={
|
|
49
|
-
image={
|
|
47
|
+
imageSet={defaultData.promoImage}
|
|
48
|
+
image={defaultData.promoImage}
|
|
50
49
|
imageAltText=""
|
|
51
50
|
copyFirst={false}
|
|
52
51
|
position="end"
|