@comicrelief/component-library 7.41.0 → 7.43.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/Text/Text.js +2 -2
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.style.js +11 -7
- package/dist/components/Molecules/Banner/Banner.js +2 -2
- package/dist/components/Molecules/Promo/Promo.js +2 -2
- package/dist/components/Molecules/Promo/Promo.style.js +2 -2
- package/dist/components/Molecules/SingleMessage/SingleMessage.style.js +2 -2
- package/dist/components/Organisms/Donate/Donate.js +2 -2
- package/dist/components/Organisms/Footer/Nav/Nav.js +3 -3
- package/dist/components/Organisms/Header/Header.style.js +2 -2
- package/dist/components/Organisms/Header/Nav/Nav.js +2 -2
- package/dist/components/Organisms/Header/Nav/Nav.style.js +45 -41
- package/dist/components/Organisms/WYMDCarousel/WYMDCarousel.js +3 -3
- package/dist/index.js +3 -29
- package/dist/theme/crTheme/theme.js +0 -2
- package/dist/theme/shared/allBreakpoints.js +7 -3
- package/dist/theme/shared/{allContainers.js → containers.js} +3 -2
- package/dist/theme/srTheme/theme.js +2 -2
- package/docs/utils.md +32 -17
- package/package.json +1 -1
- package/src/components/Atoms/Text/Text.js +2 -2
- package/src/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.style.js +1 -2
- package/src/components/Molecules/Banner/Banner.js +2 -2
- package/src/components/Molecules/Promo/Promo.js +2 -2
- package/src/components/Molecules/Promo/Promo.style.js +2 -2
- package/src/components/Molecules/SingleMessage/SingleMessage.style.js +2 -2
- package/src/components/Organisms/Donate/Donate.js +2 -2
- package/src/components/Organisms/Footer/Nav/Nav.js +3 -3
- package/src/components/Organisms/Header/Header.style.js +2 -2
- package/src/components/Organisms/Header/Nav/Nav.js +2 -2
- package/src/components/Organisms/Header/Nav/Nav.style.js +1 -2
- package/src/components/Organisms/WYMDCarousel/WYMDCarousel.js +3 -3
- package/src/index.js +1 -3
- package/src/theme/crTheme/theme.js +0 -2
- package/src/theme/shared/allBreakpoints.js +6 -2
- package/src/theme/shared/containers.js +8 -0
- package/src/theme/srTheme/theme.js +2 -2
- package/dist/theme/shared/breakpoint.js +0 -19
- package/dist/theme/shared/size.js +0 -23
- package/src/theme/shared/allContainers.js +0 -7
- package/src/theme/shared/breakpoint.js +0 -13
- package/src/theme/shared/size.js +0 -20
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = exports.BaseText = void 0;
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
-
var
|
|
11
|
+
var _allBreakpoints = require("../../../theme/shared/allBreakpoints");
|
|
12
12
|
/** Text component */
|
|
13
13
|
const BaseText = exports.BaseText = _styledComponents.default.span.withConfig({
|
|
14
14
|
displayName: "Text__BaseText",
|
|
@@ -73,7 +73,7 @@ const BaseText = exports.BaseText = _styledComponents.default.span.withConfig({
|
|
|
73
73
|
mobileColor,
|
|
74
74
|
theme
|
|
75
75
|
} = _ref11;
|
|
76
|
-
return mobileColor && (0, _styledComponents.css)(["@media (max-width:", "px){color:", ";}"],
|
|
76
|
+
return mobileColor && (0, _styledComponents.css)(["@media (max-width:", "px){color:", ";}"], _allBreakpoints.breakpointValues.L - 1, theme.color(mobileColor));
|
|
77
77
|
}, _ref12 => {
|
|
78
78
|
let {
|
|
79
79
|
size,
|
|
@@ -8,7 +8,6 @@ exports.TextItalic = exports.DropdownList = exports.DropdownItemSelectable = exp
|
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
10
10
|
var _zIndex = _interopRequireDefault(require("../../../theme/shared/zIndex"));
|
|
11
|
-
var _size = require("../../../theme/shared/size");
|
|
12
11
|
var _Text = _interopRequireDefault(require("../Text/Text"));
|
|
13
12
|
const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
14
13
|
displayName: "TextInputWithDropdownstyle__Container",
|
|
@@ -17,7 +16,7 @@ const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
|
17
16
|
const Dropdown = exports.Dropdown = _styledComponents.default.div.withConfig({
|
|
18
17
|
displayName: "TextInputWithDropdownstyle__Dropdown",
|
|
19
18
|
componentId: "sc-1s4bv7m-1"
|
|
20
|
-
})(["", " font-family:", ";position:absolute;left:0;max-height:300px;overflow:auto;background-color:", ";border:1px solid;margin-top:-1px;width:100%;@media
|
|
19
|
+
})(["", " font-family:", ";position:absolute;left:0;max-height:300px;overflow:auto;background-color:", ";border:1px solid;margin-top:-1px;width:100%;@media ", "{max-width:500px;}"], (0, _zIndex.default)('high'), _ref => {
|
|
21
20
|
let {
|
|
22
21
|
theme
|
|
23
22
|
} = _ref;
|
|
@@ -27,7 +26,12 @@ const Dropdown = exports.Dropdown = _styledComponents.default.div.withConfig({
|
|
|
27
26
|
theme
|
|
28
27
|
} = _ref2;
|
|
29
28
|
return theme.color('white');
|
|
30
|
-
},
|
|
29
|
+
}, _ref3 => {
|
|
30
|
+
let {
|
|
31
|
+
theme
|
|
32
|
+
} = _ref3;
|
|
33
|
+
return theme.allBreakpoints('M');
|
|
34
|
+
});
|
|
31
35
|
const DropdownList = exports.DropdownList = _styledComponents.default.ul.withConfig({
|
|
32
36
|
displayName: "TextInputWithDropdownstyle__DropdownList",
|
|
33
37
|
componentId: "sc-1s4bv7m-2"
|
|
@@ -39,15 +43,15 @@ const DropdownItem = exports.DropdownItem = _styledComponents.default.li.withCon
|
|
|
39
43
|
const DropdownItemSelectable = exports.DropdownItemSelectable = (0, _styledComponents.default)(DropdownItem).withConfig({
|
|
40
44
|
displayName: "TextInputWithDropdownstyle__DropdownItemSelectable",
|
|
41
45
|
componentId: "sc-1s4bv7m-4"
|
|
42
|
-
})(["cursor:pointer;border-top:1px solid ", ";&:hover,&:focus{background-color:", ";}"],
|
|
46
|
+
})(["cursor:pointer;border-top:1px solid ", ";&:hover,&:focus{background-color:", ";}"], _ref4 => {
|
|
43
47
|
let {
|
|
44
48
|
theme
|
|
45
|
-
} =
|
|
49
|
+
} = _ref4;
|
|
46
50
|
return theme.color('grey_light');
|
|
47
|
-
},
|
|
51
|
+
}, _ref5 => {
|
|
48
52
|
let {
|
|
49
53
|
theme
|
|
50
|
-
} =
|
|
54
|
+
} = _ref5;
|
|
51
55
|
return theme.color('grey_light');
|
|
52
56
|
});
|
|
53
57
|
const TextItalic = exports.TextItalic = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
10
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
11
|
-
var
|
|
11
|
+
var _allBreakpoints = require("../../../theme/shared/allBreakpoints");
|
|
12
12
|
const Wrapper = _styledComponents.default.div.withConfig({
|
|
13
13
|
displayName: "Banner__Wrapper",
|
|
14
14
|
componentId: "sc-14ows70-0"
|
|
@@ -22,7 +22,7 @@ const Wrapper = _styledComponents.default.div.withConfig({
|
|
|
22
22
|
const Container = _styledComponents.default.div.withConfig({
|
|
23
23
|
displayName: "Banner__Container",
|
|
24
24
|
componentId: "sc-14ows70-1"
|
|
25
|
-
})(["text-align:center;padding:calc(", " * 2) ", ";margin:0 auto;max-width:", ";@media ", "{padding:", " ", ";}@media ", "{padding:", " ", ";}"], (0, _spacing.default)('m'), (0, _spacing.default)('m'),
|
|
25
|
+
})(["text-align:center;padding:calc(", " * 2) ", ";margin:0 auto;max-width:", "px;@media ", "{padding:", " ", ";}@media ", "{padding:", " ", ";}"], (0, _spacing.default)('m'), (0, _spacing.default)('m'), _allBreakpoints.breakpointValues.XL, _ref2 => {
|
|
26
26
|
let {
|
|
27
27
|
theme
|
|
28
28
|
} = _ref2;
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _PromoVideo = _interopRequireDefault(require("./_PromoVideo"));
|
|
11
|
-
var
|
|
11
|
+
var _allBreakpoints = require("../../../theme/shared/allBreakpoints");
|
|
12
12
|
var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
13
13
|
var _Promo = require("./Promo.style");
|
|
14
14
|
const Promo = _ref => {
|
|
@@ -45,7 +45,7 @@ const Promo = _ref => {
|
|
|
45
45
|
(0, _react.useEffect)(() => {
|
|
46
46
|
if (hasVideo) {
|
|
47
47
|
// Checks size on load ONLY; don't want to mess about with listeners:
|
|
48
|
-
const isDesktop = window.innerWidth >=
|
|
48
|
+
const isDesktop = window.innerWidth >= _allBreakpoints.breakpointValues.Nav; // 1024+ px
|
|
49
49
|
let currentPoster;
|
|
50
50
|
let currentSrc;
|
|
51
51
|
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.Wrapper = exports.Video = exports.Media = exports.Gradient = exports.Copy = exports.Container = void 0;
|
|
9
9
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
10
|
-
var
|
|
10
|
+
var _containers = _interopRequireDefault(require("../../../theme/shared/containers"));
|
|
11
11
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
12
12
|
var _zIndex = _interopRequireDefault(require("../../../theme/shared/zIndex"));
|
|
13
13
|
const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
@@ -58,7 +58,7 @@ const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
|
58
58
|
const Wrapper = exports.Wrapper = _styledComponents.default.div.withConfig({
|
|
59
59
|
displayName: "Promostyle__Wrapper",
|
|
60
60
|
componentId: "sc-kk4nna-1"
|
|
61
|
-
})(["width:100%;max-width:", ";height:100%;left:0;right:0;margin:0 auto;display:flex;align-items:center;position:relative;", ";@media ", "{min-height:calc(100vh - 90px);}"],
|
|
61
|
+
})(["width:100%;max-width:", ";height:100%;left:0;right:0;margin:0 auto;display:flex;align-items:center;position:relative;", ";@media ", "{min-height:calc(100vh - 90px);}"], _containers.default.medium, _ref9 => {
|
|
62
62
|
let {
|
|
63
63
|
copyLeft
|
|
64
64
|
} = _ref9;
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.VideoWrapper = exports.PlayButton = exports.Media = exports.Image = exports.Copy = exports.Container = void 0;
|
|
9
9
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
10
10
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
11
|
-
var
|
|
11
|
+
var _containers = _interopRequireDefault(require("../../../theme/shared/containers"));
|
|
12
12
|
var _zIndex = _interopRequireDefault(require("../../../theme/shared/zIndex"));
|
|
13
13
|
var _videoPlayIcon = _interopRequireDefault(require("./assets/video--play-icon.svg"));
|
|
14
14
|
var _videoPlayIcon__hover = _interopRequireDefault(require("./assets/video--play-icon__hover.svg"));
|
|
@@ -92,7 +92,7 @@ const Copy = exports.Copy = _styledComponents.default.div.withConfig({
|
|
|
92
92
|
theme
|
|
93
93
|
} = _ref13;
|
|
94
94
|
return theme.allBreakpoints('M');
|
|
95
|
-
},
|
|
95
|
+
}, _containers.default.small, (0, _spacing.default)('xl'), (0, _spacing.default)('md')), _ref14 => {
|
|
96
96
|
let {
|
|
97
97
|
theme
|
|
98
98
|
} = _ref14;
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactResponsive = require("react-responsive");
|
|
11
|
-
var
|
|
11
|
+
var _allBreakpoints = require("../../../theme/shared/allBreakpoints");
|
|
12
12
|
var _Text = _interopRequireDefault(require("../../Atoms/Text/Text"));
|
|
13
13
|
var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
14
14
|
var _Form = _interopRequireDefault(require("./Form/Form"));
|
|
@@ -53,7 +53,7 @@ const Donate = _ref => {
|
|
|
53
53
|
monthlyOtherAmountText: monthlyOther
|
|
54
54
|
} = _ref;
|
|
55
55
|
let isDesktop = (0, _reactResponsive.useMediaQuery)({
|
|
56
|
-
query: "(min-width: ".concat(
|
|
56
|
+
query: "(min-width: ".concat(_allBreakpoints.breakpointValues.L, "px)")
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
// To let us store any updated override, and force a re-render
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
11
|
-
var
|
|
11
|
+
var _allBreakpoints = require("../../../../theme/shared/allBreakpoints");
|
|
12
12
|
var _navHelper = _interopRequireDefault(require("../../../../utils/navHelper"));
|
|
13
13
|
var _internalLinkHelper = require("../../../../utils/internalLinkHelper");
|
|
14
14
|
var _Nav = require("./Nav.style");
|
|
@@ -28,7 +28,7 @@ const FooterNav = _ref => {
|
|
|
28
28
|
const resize = () => {
|
|
29
29
|
const screenSize = typeof window !== 'undefined' ? window.innerWidth : null;
|
|
30
30
|
if (screenSize !== null) {
|
|
31
|
-
setIsSmallBreakpoint(screenSize < parseFloat(
|
|
31
|
+
setIsSmallBreakpoint(screenSize < parseFloat(_allBreakpoints.breakpointValues.M));
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
if (typeof window !== 'undefined') {
|
|
@@ -50,7 +50,7 @@ const FooterNav = _ref => {
|
|
|
50
50
|
(0, _react.useEffect)(() => {
|
|
51
51
|
// Detect window screen size when page load
|
|
52
52
|
const width = typeof window !== 'undefined' ? window.innerWidth : null;
|
|
53
|
-
setIsSmallBreakpoint(width < parseFloat(
|
|
53
|
+
setIsSmallBreakpoint(width < parseFloat(_allBreakpoints.breakpointValues.M));
|
|
54
54
|
}, []);
|
|
55
55
|
return /*#__PURE__*/_react.default.createElement(_Nav.Nav, {
|
|
56
56
|
"aria-label": "main-menu",
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.MetaIcons = exports.InnerWrapper = exports.HeaderWrapper = exports.Brand = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
var _zIndex = _interopRequireDefault(require("../../../theme/shared/zIndex"));
|
|
10
|
-
var
|
|
10
|
+
var _containers = _interopRequireDefault(require("../../../theme/shared/containers"));
|
|
11
11
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
12
12
|
const HeaderWrapper = exports.HeaderWrapper = _styledComponents.default.header.attrs(() => ({
|
|
13
13
|
role: 'banner'
|
|
@@ -28,7 +28,7 @@ const HeaderWrapper = exports.HeaderWrapper = _styledComponents.default.header.a
|
|
|
28
28
|
const InnerWrapper = exports.InnerWrapper = _styledComponents.default.div.withConfig({
|
|
29
29
|
displayName: "Headerstyle__InnerWrapper",
|
|
30
30
|
componentId: "sc-11ghppe-1"
|
|
31
|
-
})(["display:flex;align-items:center;height:100%;padding:0 12px;cursor:pointer;max-width:", ";@media ", "{margin:0 auto;}"],
|
|
31
|
+
})(["display:flex;align-items:center;height:100%;padding:0 12px;cursor:pointer;max-width:", ";@media ", "{margin:0 auto;}"], _containers.default.large, _ref3 => {
|
|
32
32
|
let {
|
|
33
33
|
theme
|
|
34
34
|
} = _ref3;
|
|
@@ -9,7 +9,7 @@ exports.default = void 0;
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
11
11
|
var _BurgerMenu = _interopRequireDefault(require("../Burger/BurgerMenu"));
|
|
12
|
-
var
|
|
12
|
+
var _allBreakpoints = require("../../../../theme/shared/allBreakpoints");
|
|
13
13
|
var _navHelper = _interopRequireDefault(require("../../../../utils/navHelper"));
|
|
14
14
|
var _internalLinkHelper = require("../../../../utils/internalLinkHelper");
|
|
15
15
|
var _allowListed = _interopRequireDefault(require("../../../../utils/allowListed"));
|
|
@@ -51,7 +51,7 @@ const MainNav = _ref => {
|
|
|
51
51
|
};
|
|
52
52
|
(0, _react.useEffect)(() => {
|
|
53
53
|
const width = window.innerWidth;
|
|
54
|
-
setIsMobile(width <
|
|
54
|
+
setIsMobile(width < _allBreakpoints.breakpointValues.Nav);
|
|
55
55
|
window.addEventListener('onkeyup', setIsKeyPressed);
|
|
56
56
|
return () => {
|
|
57
57
|
window.removeEventListener('onkeyup', setIsKeyPressed);
|
|
@@ -9,7 +9,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
9
9
|
var _Link = _interopRequireDefault(require("../../../Atoms/Link/Link"));
|
|
10
10
|
var _hideVisually = _interopRequireDefault(require("../../../../theme/shared/hideVisually"));
|
|
11
11
|
var _zIndex = _interopRequireDefault(require("../../../../theme/shared/zIndex"));
|
|
12
|
-
var _size = require("../../../../theme/shared/size");
|
|
13
12
|
const NavLinkClass = (0, _styledComponents.default)(_Link.default).withConfig({
|
|
14
13
|
displayName: "Navstyle__NavLinkClass",
|
|
15
14
|
componentId: "sc-1ss3uk2-0"
|
|
@@ -31,15 +30,20 @@ const NavLinkClass = (0, _styledComponents.default)(_Link.default).withConfig({
|
|
|
31
30
|
const Nav = exports.Nav = _styledComponents.default.nav.withConfig({
|
|
32
31
|
displayName: "Navstyle__Nav",
|
|
33
32
|
componentId: "sc-1ss3uk2-1"
|
|
34
|
-
})(["display:", ";width:100%;position:absolute;top:75px;left:0;", ";@media
|
|
33
|
+
})(["display:", ";width:100%;position:absolute;top:75px;left:0;", ";@media ", "{width:50%;right:0;left:inherit;}@media ", "{", ";position:relative;top:0;display:block;margin:0 10px;width:auto;height:100%;}> h2{", ";}"], _ref3 => {
|
|
35
34
|
let {
|
|
36
35
|
isExpandable
|
|
37
36
|
} = _ref3;
|
|
38
37
|
return isExpandable ? 'block' : 'none';
|
|
39
|
-
}, (0, _zIndex.default)('higher'),
|
|
38
|
+
}, (0, _zIndex.default)('higher'), _ref4 => {
|
|
40
39
|
let {
|
|
41
40
|
theme
|
|
42
41
|
} = _ref4;
|
|
42
|
+
return theme.allBreakpoints('M');
|
|
43
|
+
}, _ref5 => {
|
|
44
|
+
let {
|
|
45
|
+
theme
|
|
46
|
+
} = _ref5;
|
|
43
47
|
return theme.allBreakpoints('Nav');
|
|
44
48
|
}, (0, _zIndex.default)('medium'), _hideVisually.default);
|
|
45
49
|
|
|
@@ -49,25 +53,25 @@ const Nav = exports.Nav = _styledComponents.default.nav.withConfig({
|
|
|
49
53
|
const SubNavMenu = exports.SubNavMenu = _styledComponents.default.ul.withConfig({
|
|
50
54
|
displayName: "Navstyle__SubNavMenu",
|
|
51
55
|
componentId: "sc-1ss3uk2-2"
|
|
52
|
-
})(["display:", ";padding:0;position:relative;list-style:none outside;left:0;top:0;flex-direction:column;justify-content:center;align-items:center;background-color:", ";@media ", "{display:none;display:", ";top:90px;position:absolute;padding:0 0 20px;width:250px;height:auto;}"],
|
|
56
|
+
})(["display:", ";padding:0;position:relative;list-style:none outside;left:0;top:0;flex-direction:column;justify-content:center;align-items:center;background-color:", ";@media ", "{display:none;display:", ";top:90px;position:absolute;padding:0 0 20px;width:250px;height:auto;}"], _ref6 => {
|
|
53
57
|
let {
|
|
54
58
|
isSubMenuOpen
|
|
55
|
-
} =
|
|
59
|
+
} = _ref6;
|
|
56
60
|
return isSubMenuOpen ? 'flex' : 'none';
|
|
57
|
-
},
|
|
61
|
+
}, _ref7 => {
|
|
58
62
|
let {
|
|
59
63
|
theme
|
|
60
|
-
} =
|
|
64
|
+
} = _ref7;
|
|
61
65
|
return theme.color('deep_violet_dark');
|
|
62
|
-
},
|
|
66
|
+
}, _ref8 => {
|
|
63
67
|
let {
|
|
64
68
|
theme
|
|
65
|
-
} =
|
|
69
|
+
} = _ref8;
|
|
66
70
|
return theme.allBreakpoints('Nav');
|
|
67
|
-
},
|
|
71
|
+
}, _ref9 => {
|
|
68
72
|
let {
|
|
69
73
|
isKeyPressed
|
|
70
|
-
} =
|
|
74
|
+
} = _ref9;
|
|
71
75
|
return isKeyPressed ? 'flex' : 'none';
|
|
72
76
|
});
|
|
73
77
|
|
|
@@ -77,15 +81,15 @@ const SubNavMenu = exports.SubNavMenu = _styledComponents.default.ul.withConfig(
|
|
|
77
81
|
const SubNavItem = exports.SubNavItem = _styledComponents.default.li.withConfig({
|
|
78
82
|
displayName: "Navstyle__SubNavItem",
|
|
79
83
|
componentId: "sc-1ss3uk2-3"
|
|
80
|
-
})(["padding:0;height:100%;width:100%;:hover{background-color:", ";span{border-bottom:0;padding-bottom:2px;color:", ";}}"],
|
|
84
|
+
})(["padding:0;height:100%;width:100%;:hover{background-color:", ";span{border-bottom:0;padding-bottom:2px;color:", ";}}"], _ref10 => {
|
|
81
85
|
let {
|
|
82
86
|
theme
|
|
83
|
-
} =
|
|
87
|
+
} = _ref10;
|
|
84
88
|
return theme.color('deep_violet_light');
|
|
85
|
-
},
|
|
89
|
+
}, _ref11 => {
|
|
86
90
|
let {
|
|
87
91
|
theme
|
|
88
|
-
} =
|
|
92
|
+
} = _ref11;
|
|
89
93
|
return theme.color('white');
|
|
90
94
|
});
|
|
91
95
|
|
|
@@ -95,10 +99,10 @@ const SubNavItem = exports.SubNavItem = _styledComponents.default.li.withConfig(
|
|
|
95
99
|
const SubNavLink = exports.SubNavLink = (0, _styledComponents.default)(NavLinkClass).withConfig({
|
|
96
100
|
displayName: "Navstyle__SubNavLink",
|
|
97
101
|
componentId: "sc-1ss3uk2-4"
|
|
98
|
-
})(["padding:14px 14px 7px 21px;color:", ";height:auto;position:relative;"],
|
|
102
|
+
})(["padding:14px 14px 7px 21px;color:", ";height:auto;position:relative;"], _ref12 => {
|
|
99
103
|
let {
|
|
100
104
|
theme
|
|
101
|
-
} =
|
|
105
|
+
} = _ref12;
|
|
102
106
|
return theme.color('white');
|
|
103
107
|
});
|
|
104
108
|
|
|
@@ -108,25 +112,25 @@ const SubNavLink = exports.SubNavLink = (0, _styledComponents.default)(NavLinkCl
|
|
|
108
112
|
const SubNavLinkUnderline = exports.SubNavLinkUnderline = (0, _styledComponents.default)(SubNavLink).withConfig({
|
|
109
113
|
displayName: "Navstyle__SubNavLinkUnderline",
|
|
110
114
|
componentId: "sc-1ss3uk2-5"
|
|
111
|
-
})(["padding:26px 21px;::after{content:'';position:absolute;width:14px;border-bottom:2px solid ", ";left:12px;top:auto;bottom:10px;margin:0 10px;}@media ", "{::before{display:block;position:absolute;content:'';left:34px;width:10px;height:10px;border:11px solid transparent;border-bottom-color:", ";top:-22px;}:hover::before{border-bottom-color:", ";}}"],
|
|
112
|
-
let {
|
|
113
|
-
theme
|
|
114
|
-
} = _ref12;
|
|
115
|
-
return theme.color('white');
|
|
116
|
-
}, _ref13 => {
|
|
115
|
+
})(["padding:26px 21px;::after{content:'';position:absolute;width:14px;border-bottom:2px solid ", ";left:12px;top:auto;bottom:10px;margin:0 10px;}@media ", "{::before{display:block;position:absolute;content:'';left:34px;width:10px;height:10px;border:11px solid transparent;border-bottom-color:", ";top:-22px;}:hover::before{border-bottom-color:", ";}}"], _ref13 => {
|
|
117
116
|
let {
|
|
118
117
|
theme
|
|
119
118
|
} = _ref13;
|
|
120
|
-
return theme.
|
|
119
|
+
return theme.color('white');
|
|
121
120
|
}, _ref14 => {
|
|
122
121
|
let {
|
|
123
122
|
theme
|
|
124
123
|
} = _ref14;
|
|
125
|
-
return theme.
|
|
124
|
+
return theme.allBreakpoints('Nav');
|
|
126
125
|
}, _ref15 => {
|
|
127
126
|
let {
|
|
128
127
|
theme
|
|
129
128
|
} = _ref15;
|
|
129
|
+
return theme.color('deep_violet_dark');
|
|
130
|
+
}, _ref16 => {
|
|
131
|
+
let {
|
|
132
|
+
theme
|
|
133
|
+
} = _ref16;
|
|
130
134
|
return theme.color('deep_violet_light');
|
|
131
135
|
});
|
|
132
136
|
|
|
@@ -136,20 +140,20 @@ const SubNavLinkUnderline = exports.SubNavLinkUnderline = (0, _styledComponents.
|
|
|
136
140
|
const NavMenu = exports.NavMenu = _styledComponents.default.ul.withConfig({
|
|
137
141
|
displayName: "Navstyle__NavMenu",
|
|
138
142
|
componentId: "sc-1ss3uk2-6"
|
|
139
|
-
})(["background-color:", ";list-style:none outside;padding:0;margin:0;@media ", "{position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;background-color:", ";}"],
|
|
143
|
+
})(["background-color:", ";list-style:none outside;padding:0;margin:0;@media ", "{position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;background-color:", ";}"], _ref17 => {
|
|
140
144
|
let {
|
|
141
145
|
theme
|
|
142
|
-
} =
|
|
146
|
+
} = _ref17;
|
|
143
147
|
return theme.color('grey_extra_light');
|
|
144
|
-
},
|
|
148
|
+
}, _ref18 => {
|
|
145
149
|
let {
|
|
146
150
|
theme
|
|
147
|
-
} =
|
|
151
|
+
} = _ref18;
|
|
148
152
|
return theme.allBreakpoints('Nav');
|
|
149
|
-
},
|
|
153
|
+
}, _ref19 => {
|
|
150
154
|
let {
|
|
151
155
|
theme
|
|
152
|
-
} =
|
|
156
|
+
} = _ref19;
|
|
153
157
|
return theme.color('white');
|
|
154
158
|
});
|
|
155
159
|
|
|
@@ -159,15 +163,15 @@ const NavMenu = exports.NavMenu = _styledComponents.default.ul.withConfig({
|
|
|
159
163
|
const NavLink = exports.NavLink = (0, _styledComponents.default)(NavLinkClass).withConfig({
|
|
160
164
|
displayName: "Navstyle__NavLink",
|
|
161
165
|
componentId: "sc-1ss3uk2-7"
|
|
162
|
-
})(["display:flex;gap:4px;font-family:", ";@media ", "{padding:10px 0;height:auto;:focus + ", "{display:flex;}}"],
|
|
166
|
+
})(["display:flex;gap:4px;font-family:", ";@media ", "{padding:10px 0;height:auto;:focus + ", "{display:flex;}}"], _ref20 => {
|
|
163
167
|
let {
|
|
164
168
|
theme
|
|
165
|
-
} =
|
|
169
|
+
} = _ref20;
|
|
166
170
|
return theme.fontFamilies(theme.font.regular);
|
|
167
|
-
},
|
|
171
|
+
}, _ref21 => {
|
|
168
172
|
let {
|
|
169
173
|
theme
|
|
170
|
-
} =
|
|
174
|
+
} = _ref21;
|
|
171
175
|
return theme.allBreakpoints('Nav');
|
|
172
176
|
}, SubNavMenu);
|
|
173
177
|
|
|
@@ -177,20 +181,20 @@ const NavLink = exports.NavLink = (0, _styledComponents.default)(NavLinkClass).w
|
|
|
177
181
|
const NavItem = exports.NavItem = _styledComponents.default.li.withConfig({
|
|
178
182
|
displayName: "Navstyle__NavItem",
|
|
179
183
|
componentId: "sc-1ss3uk2-8"
|
|
180
|
-
})(["", ";position:relative;font-weight:700;:hover{li{span{border-bottom:none;padding-bottom:0;}}}li{span{border-bottom:none;padding-bottom:0;}:hover{span{border-bottom:none;padding-bottom:0;}}}:hover{background-color:", ";}@media ", "{margin:0 4px;padding:25px 5px;:hover > ", ",:focus-within > ", "{visibility:visible;opacity:1;display:flex;}:hover{background-color:transparent;", ";span{border-bottom:2px solid ", ";padding-bottom:2px;}", "{display:flex;flex-direction:column;}}}"], (0, _zIndex.default)('medium'),
|
|
184
|
+
})(["", ";position:relative;font-weight:700;:hover{li{span{border-bottom:none;padding-bottom:0;}}}li{span{border-bottom:none;padding-bottom:0;}:hover{span{border-bottom:none;padding-bottom:0;}}}:hover{background-color:", ";}@media ", "{margin:0 4px;padding:25px 5px;:hover > ", ",:focus-within > ", "{visibility:visible;opacity:1;display:flex;}:hover{background-color:transparent;", ";span{border-bottom:2px solid ", ";padding-bottom:2px;}", "{display:flex;flex-direction:column;}}}"], (0, _zIndex.default)('medium'), _ref22 => {
|
|
181
185
|
let {
|
|
182
186
|
theme
|
|
183
|
-
} =
|
|
187
|
+
} = _ref22;
|
|
184
188
|
return theme.color('teal_light');
|
|
185
|
-
},
|
|
189
|
+
}, _ref23 => {
|
|
186
190
|
let {
|
|
187
191
|
theme
|
|
188
|
-
} =
|
|
192
|
+
} = _ref23;
|
|
189
193
|
return theme.allBreakpoints('Nav');
|
|
190
|
-
}, SubNavMenu, SubNavMenu, (0, _zIndex.default)('high'),
|
|
194
|
+
}, SubNavMenu, SubNavMenu, (0, _zIndex.default)('high'), _ref24 => {
|
|
191
195
|
let {
|
|
192
196
|
theme
|
|
193
|
-
} =
|
|
197
|
+
} = _ref24;
|
|
194
198
|
return theme.color('black');
|
|
195
199
|
}, SubNavMenu);
|
|
196
200
|
const ChevronWrapper = exports.ChevronWrapper = _styledComponents.default.div.withConfig({
|
|
@@ -12,7 +12,7 @@ var _utils = _interopRequireDefault(require("./_utils"));
|
|
|
12
12
|
require("pure-react-carousel/dist/react-carousel.es.css");
|
|
13
13
|
var _WYMDCarousel = require("./WYMDCarousel.style");
|
|
14
14
|
var _Text = _interopRequireDefault(require("../../Atoms/Text/Text"));
|
|
15
|
-
var
|
|
15
|
+
var _allBreakpoints = require("../../../theme/shared/allBreakpoints");
|
|
16
16
|
const WYMDCarousel = _ref => {
|
|
17
17
|
let {
|
|
18
18
|
data,
|
|
@@ -30,7 +30,7 @@ const WYMDCarousel = _ref => {
|
|
|
30
30
|
// Custom function to let us update the carousel config dynamically
|
|
31
31
|
const screenResize = (0, _react.useCallback)(() => {
|
|
32
32
|
const screenSize = typeof window !== 'undefined' ? window.innerWidth : null;
|
|
33
|
-
const isCurrentlyMobile = window.innerWidth <
|
|
33
|
+
const isCurrentlyMobile = window.innerWidth < _allBreakpoints.breakpointValues.M;
|
|
34
34
|
if (screenSize !== null && isMobile !== isCurrentlyMobile) {
|
|
35
35
|
setIsMobile(isCurrentlyMobile);
|
|
36
36
|
setVisibleSlides(isCurrentlyMobile ? 1 : 3);
|
|
@@ -43,7 +43,7 @@ const WYMDCarousel = _ref => {
|
|
|
43
43
|
setTheseItems((0, _utils.default)(data));
|
|
44
44
|
}, [setTheseItems, data]);
|
|
45
45
|
(0, _react.useEffect)(() => {
|
|
46
|
-
if (window !== 'undefined' && window.innerWidth >=
|
|
46
|
+
if (window !== 'undefined' && window.innerWidth >= _allBreakpoints.breakpointValues.M) {
|
|
47
47
|
// On inital render, update carousel plugin config
|
|
48
48
|
// to suit the non-mobile layout and functionality:
|
|
49
49
|
setIsMobile(false);
|
package/dist/index.js
CHANGED
|
@@ -334,24 +334,12 @@ Object.defineProperty(exports, "allBreakpoints", {
|
|
|
334
334
|
return _allBreakpoints.default;
|
|
335
335
|
}
|
|
336
336
|
});
|
|
337
|
-
Object.defineProperty(exports, "allContainers", {
|
|
338
|
-
enumerable: true,
|
|
339
|
-
get: function () {
|
|
340
|
-
return _allContainers.default;
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
337
|
Object.defineProperty(exports, "allowListed", {
|
|
344
338
|
enumerable: true,
|
|
345
339
|
get: function () {
|
|
346
340
|
return _allowListed.default;
|
|
347
341
|
}
|
|
348
342
|
});
|
|
349
|
-
Object.defineProperty(exports, "breakpoint", {
|
|
350
|
-
enumerable: true,
|
|
351
|
-
get: function () {
|
|
352
|
-
return _breakpoint.default;
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
343
|
Object.defineProperty(exports, "buildEsuValidationSchema", {
|
|
356
344
|
enumerable: true,
|
|
357
345
|
get: function () {
|
|
@@ -364,10 +352,10 @@ Object.defineProperty(exports, "buildValidationSchema", {
|
|
|
364
352
|
return _MarketingPreferencesDS.buildValidationSchema;
|
|
365
353
|
}
|
|
366
354
|
});
|
|
367
|
-
Object.defineProperty(exports, "
|
|
355
|
+
Object.defineProperty(exports, "containers", {
|
|
368
356
|
enumerable: true,
|
|
369
357
|
get: function () {
|
|
370
|
-
return
|
|
358
|
+
return _containers.default;
|
|
371
359
|
}
|
|
372
360
|
});
|
|
373
361
|
Object.defineProperty(exports, "crTheme", {
|
|
@@ -382,18 +370,6 @@ Object.defineProperty(exports, "hideVisually", {
|
|
|
382
370
|
return _hideVisually.default;
|
|
383
371
|
}
|
|
384
372
|
});
|
|
385
|
-
Object.defineProperty(exports, "media", {
|
|
386
|
-
enumerable: true,
|
|
387
|
-
get: function () {
|
|
388
|
-
return _size.media;
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
Object.defineProperty(exports, "screen", {
|
|
392
|
-
enumerable: true,
|
|
393
|
-
get: function () {
|
|
394
|
-
return _size.screen;
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
373
|
Object.defineProperty(exports, "setInitialValues", {
|
|
398
374
|
enumerable: true,
|
|
399
375
|
get: function () {
|
|
@@ -425,10 +401,8 @@ var _hideVisually = _interopRequireDefault(require("./theme/shared/hideVisually"
|
|
|
425
401
|
var _zIndex = _interopRequireDefault(require("./theme/shared/zIndex"));
|
|
426
402
|
var _allowListed = _interopRequireDefault(require("./utils/allowListed"));
|
|
427
403
|
var _spacing = _interopRequireDefault(require("./theme/shared/spacing"));
|
|
428
|
-
var _breakpoint = _interopRequireDefault(require("./theme/shared/breakpoint"));
|
|
429
404
|
var _allBreakpoints = _interopRequireDefault(require("./theme/shared/allBreakpoints"));
|
|
430
|
-
var
|
|
431
|
-
var _allContainers = _interopRequireDefault(require("./theme/shared/allContainers"));
|
|
405
|
+
var _containers = _interopRequireDefault(require("./theme/shared/containers"));
|
|
432
406
|
var _Text = _interopRequireDefault(require("./components/Atoms/Text/Text"));
|
|
433
407
|
var _Logo = _interopRequireDefault(require("./components/Atoms/Logo/Logo"));
|
|
434
408
|
var _Picture = _interopRequireDefault(require("./components/Atoms/Picture/Picture"));
|
|
@@ -9,7 +9,6 @@ var _colors = _interopRequireDefault(require("./colors"));
|
|
|
9
9
|
var _buttonColors = _interopRequireDefault(require("./buttonColors"));
|
|
10
10
|
var _linkStyles = _interopRequireDefault(require("./linkStyles"));
|
|
11
11
|
var _fontSizes = _interopRequireDefault(require("./fontSizes"));
|
|
12
|
-
var _breakpoint = _interopRequireDefault(require("../shared/breakpoint"));
|
|
13
12
|
var _allBreakpoints = _interopRequireDefault(require("../shared/allBreakpoints"));
|
|
14
13
|
var _fontFamilies = _interopRequireDefault(require("../shared/fontFamilies"));
|
|
15
14
|
var _default = exports.default = {
|
|
@@ -17,7 +16,6 @@ var _default = exports.default = {
|
|
|
17
16
|
buttonColors: _buttonColors.default,
|
|
18
17
|
linkStyles: _linkStyles.default,
|
|
19
18
|
fontSize: _fontSizes.default,
|
|
20
|
-
breakpoint: _breakpoint.default,
|
|
21
19
|
allBreakpoints: _allBreakpoints.default,
|
|
22
20
|
fontFamilies: _fontFamilies.default,
|
|
23
21
|
font: {
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
6
|
+
exports.default = exports.breakpointValues = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* For usage and examples see utils.md
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const breakpointValues = exports.breakpointValues = {
|
|
8
12
|
S: 0,
|
|
9
13
|
M: 740,
|
|
10
14
|
L: 1024,
|
|
@@ -13,7 +17,7 @@ const sizes = exports.sizes = {
|
|
|
13
17
|
};
|
|
14
18
|
var _default = size => {
|
|
15
19
|
if (size) {
|
|
16
|
-
return "(min-width: ".concat(
|
|
20
|
+
return "(min-width: ".concat(breakpointValues[size], "px)");
|
|
17
21
|
}
|
|
18
22
|
return 'inherit';
|
|
19
23
|
};
|
|
@@ -4,9 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
7
|
+
// These are used in a max-width context
|
|
8
|
+
const containers = {
|
|
8
9
|
small: '880px',
|
|
9
10
|
medium: '1200px',
|
|
10
11
|
large: '1440px'
|
|
11
12
|
};
|
|
12
|
-
var _default = exports.default =
|
|
13
|
+
var _default = exports.default = containers;
|
|
@@ -9,14 +9,14 @@ var _colors = _interopRequireDefault(require("./colors"));
|
|
|
9
9
|
var _buttonColors = _interopRequireDefault(require("./buttonColors"));
|
|
10
10
|
var _linkStyles = _interopRequireDefault(require("./linkStyles"));
|
|
11
11
|
var _fontSizes = _interopRequireDefault(require("./fontSizes"));
|
|
12
|
-
var
|
|
12
|
+
var _allBreakpoints = _interopRequireDefault(require("../shared/allBreakpoints"));
|
|
13
13
|
var _fontFamilies = _interopRequireDefault(require("../shared/fontFamilies"));
|
|
14
14
|
var _default = exports.default = {
|
|
15
15
|
color: _colors.default,
|
|
16
16
|
buttonColors: _buttonColors.default,
|
|
17
17
|
linkStyles: _linkStyles.default,
|
|
18
18
|
fontSize: _fontSizes.default,
|
|
19
|
-
|
|
19
|
+
allBreakpoints: _allBreakpoints.default,
|
|
20
20
|
fontFamilies: _fontFamilies.default,
|
|
21
21
|
font: {
|
|
22
22
|
regular: 'Founders',
|
package/docs/utils.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
## hideVisually
|
|
2
2
|
|
|
3
3
|
`import { hideVisually } from '@comicrelief/component-library';`
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
How to use in your styled component
|
|
6
6
|
`export const Component = styled.span'${hideVisually};';`
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## allowListed
|
|
9
9
|
|
|
10
10
|
`import { allowListed } from '@comicrelief/component-library';`
|
|
11
11
|
|
|
@@ -13,14 +13,14 @@ _allowListed_
|
|
|
13
13
|
|
|
14
14
|
Check if a url is allowListed. Used to check links and change link target.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
## zIndex
|
|
17
17
|
|
|
18
18
|
`import { zIndex } from '@comicrelief/component-library';`
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
How to use in your styled component
|
|
21
21
|
`export const Component = styled.span'${zIndex('high')};';`
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
## spacing
|
|
24
24
|
|
|
25
25
|
`import { spacing } from '@comicrelief/component-library';`
|
|
26
26
|
|
|
@@ -37,25 +37,40 @@ Default spacing scale
|
|
|
37
37
|
| xxl | 8rem |
|
|
38
38
|
| xxxl | 16rem |
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
How to use in your styled component
|
|
41
41
|
|
|
42
42
|
`export const Component = styled.span'`
|
|
43
43
|
`padding: ${spacing('md)'} ${spacing('l)'};';`
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
## allBreakpoints, and { breakpointValues } within allBreakpoints
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
| S | M | L | Nav | XL |
|
|
48
|
+
|:----:|------:| ------:| -----:| ------:|
|
|
49
|
+
| 0 | 740 | 1024 | 1150 | 1440 |
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
### Usage within Component Library itself
|
|
52
|
+
#### media queries (no need to import):
|
|
53
|
+
`@media ${({ theme }) => theme.allBreakpoints('M')} {`
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
#### screen sizes:
|
|
56
|
+
```
|
|
57
|
+
import { breakpointValues } from '../../../theme/shared/allBreakpoints';
|
|
58
|
+
...
|
|
59
|
+
max-width: ${breakpointValues.M}px;
|
|
60
|
+
```
|
|
55
61
|
|
|
56
|
-
|
|
62
|
+
### Usage within Component Library
|
|
63
|
+
```
|
|
64
|
+
import { breakpointValues } from '@comicrelief/component-library/src/theme/shared/allBreakpoints';
|
|
65
|
+
...
|
|
66
|
+
max-width: ${breakpointValues.M}px);
|
|
67
|
+
```
|
|
57
68
|
|
|
58
|
-
`const BreakPoint = styled.div'${media('small')}{ font-size: 16px}'`
|
|
59
69
|
|
|
60
|
-
|
|
70
|
+
## containers from containers.js
|
|
71
|
+
| small | medium | large |
|
|
72
|
+
|:-------:|--------:| ------:|
|
|
73
|
+
| 800px | 1200px | 1440px |
|
|
61
74
|
|
|
75
|
+
### Note: These are used in a max-width context:
|
|
76
|
+
`max-width: ${containers.small}`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import {
|
|
4
|
+
import { breakpointValues } from '../../../theme/shared/allBreakpoints';
|
|
5
5
|
|
|
6
6
|
/** Text component */
|
|
7
7
|
export const BaseText = styled.span`
|
|
@@ -33,7 +33,7 @@ export const BaseText = styled.span`
|
|
|
33
33
|
`
|
|
34
34
|
: null)};
|
|
35
35
|
${({ mobileColor, theme }) => mobileColor && css`
|
|
36
|
-
@media (max-width: ${
|
|
36
|
+
@media (max-width: ${breakpointValues.L - 1}px) {
|
|
37
37
|
color: ${theme.color(mobileColor)};
|
|
38
38
|
}
|
|
39
39
|
`};
|
|
@@ -2,7 +2,6 @@ import styled from 'styled-components';
|
|
|
2
2
|
|
|
3
3
|
import spacing from '../../../theme/shared/spacing';
|
|
4
4
|
import zIndex from '../../../theme/shared/zIndex';
|
|
5
|
-
import { screen } from '../../../theme/shared/size';
|
|
6
5
|
import Text from '../Text/Text';
|
|
7
6
|
|
|
8
7
|
const Container = styled.div`
|
|
@@ -21,7 +20,7 @@ const Dropdown = styled.div`
|
|
|
21
20
|
margin-top: -1px;
|
|
22
21
|
width: 100%;
|
|
23
22
|
|
|
24
|
-
@media (
|
|
23
|
+
@media ${({ theme }) => theme.allBreakpoints('M')} {
|
|
25
24
|
max-width: 500px;
|
|
26
25
|
}
|
|
27
26
|
`;
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
5
5
|
import spacing from '../../../theme/shared/spacing';
|
|
6
|
-
import {
|
|
6
|
+
import { breakpointValues } from '../../../theme/shared/allBreakpoints';
|
|
7
7
|
|
|
8
8
|
const Wrapper = styled.div`
|
|
9
9
|
background: ${({ theme, backgroundColor }) => theme.color(backgroundColor)};
|
|
@@ -13,7 +13,7 @@ const Container = styled.div`
|
|
|
13
13
|
text-align: center;
|
|
14
14
|
padding: calc(${spacing('m')} * 2) ${spacing('m')};
|
|
15
15
|
margin: 0 auto;
|
|
16
|
-
max-width: ${
|
|
16
|
+
max-width: ${breakpointValues.XL}px;
|
|
17
17
|
|
|
18
18
|
@media ${({ theme }) => theme.allBreakpoints('M')} {
|
|
19
19
|
padding: ${spacing('xl')} ${spacing('l')};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import PromoVideo from './_PromoVideo';
|
|
4
|
-
import {
|
|
4
|
+
import { breakpointValues } from '../../../theme/shared/allBreakpoints';
|
|
5
5
|
|
|
6
6
|
import Picture from '../../Atoms/Picture/Picture';
|
|
7
7
|
|
|
@@ -42,7 +42,7 @@ const Promo = ({
|
|
|
42
42
|
useEffect(() => {
|
|
43
43
|
if (hasVideo) {
|
|
44
44
|
// Checks size on load ONLY; don't want to mess about with listeners:
|
|
45
|
-
const isDesktop = window.innerWidth >=
|
|
45
|
+
const isDesktop = window.innerWidth >= breakpointValues.Nav; // 1024+ px
|
|
46
46
|
let currentPoster; let currentSrc;
|
|
47
47
|
|
|
48
48
|
// If we've got both desktop AND mobile videos, let the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import
|
|
2
|
+
import containers from '../../../theme/shared/containers';
|
|
3
3
|
import spacing from '../../../theme/shared/spacing';
|
|
4
4
|
import zIndex from '../../../theme/shared/zIndex';
|
|
5
5
|
|
|
@@ -37,7 +37,7 @@ const Container = styled.div`
|
|
|
37
37
|
|
|
38
38
|
const Wrapper = styled.div`
|
|
39
39
|
width: 100%;
|
|
40
|
-
max-width: ${
|
|
40
|
+
max-width: ${containers.medium};
|
|
41
41
|
height: 100%;
|
|
42
42
|
left: 0;
|
|
43
43
|
right: 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import spacing from '../../../theme/shared/spacing';
|
|
3
|
-
import
|
|
3
|
+
import containers from '../../../theme/shared/containers';
|
|
4
4
|
import zIndex from '../../../theme/shared/zIndex';
|
|
5
5
|
import playIcon from './assets/video--play-icon.svg';
|
|
6
6
|
import playIconHover from './assets/video--play-icon__hover.svg';
|
|
@@ -68,7 +68,7 @@ const Copy = styled.div`
|
|
|
68
68
|
: css`
|
|
69
69
|
@media ${({ theme }) => theme.allBreakpoints('M')} {
|
|
70
70
|
width: 100%;
|
|
71
|
-
max-width ${
|
|
71
|
+
max-width ${containers.small};
|
|
72
72
|
padding: ${spacing('xl')};
|
|
73
73
|
}
|
|
74
74
|
margin: auto;
|
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
|
|
|
2
2
|
import { useMediaQuery } from 'react-responsive';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { breakpointValues } from '../../../theme/shared/allBreakpoints';
|
|
6
6
|
import Text from '../../Atoms/Text/Text';
|
|
7
7
|
import Picture from '../../Atoms/Picture/Picture';
|
|
8
8
|
import Form from './Form/Form';
|
|
@@ -53,7 +53,7 @@ const Donate = ({
|
|
|
53
53
|
monthlyChooseAmountText: monthlyChoose,
|
|
54
54
|
monthlyOtherAmountText: monthlyOther
|
|
55
55
|
}) => {
|
|
56
|
-
let isDesktop = useMediaQuery({ query: `(min-width: ${
|
|
56
|
+
let isDesktop = useMediaQuery({ query: `(min-width: ${breakpointValues.L}px)` });
|
|
57
57
|
|
|
58
58
|
// To let us store any updated override, and force a re-render
|
|
59
59
|
const [overrideValue, setOverrideValue] = useState(null);
|
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
4
|
import Text from '../../../Atoms/Text/Text';
|
|
5
|
-
import {
|
|
5
|
+
import { breakpointValues } from '../../../../theme/shared/allBreakpoints';
|
|
6
6
|
import NavHelper from '../../../../utils/navHelper';
|
|
7
7
|
import { InternalLinkHelper } from '../../../../utils/internalLinkHelper';
|
|
8
8
|
|
|
@@ -26,7 +26,7 @@ const FooterNav = ({ navItems, ...rest }) => {
|
|
|
26
26
|
const resize = () => {
|
|
27
27
|
const screenSize = typeof window !== 'undefined' ? window.innerWidth : null;
|
|
28
28
|
if (screenSize !== null) {
|
|
29
|
-
setIsSmallBreakpoint(screenSize < parseFloat(
|
|
29
|
+
setIsSmallBreakpoint(screenSize < parseFloat(breakpointValues.M));
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
|
|
@@ -48,7 +48,7 @@ const FooterNav = ({ navItems, ...rest }) => {
|
|
|
48
48
|
useEffect(() => {
|
|
49
49
|
// Detect window screen size when page load
|
|
50
50
|
const width = typeof window !== 'undefined' ? window.innerWidth : null;
|
|
51
|
-
setIsSmallBreakpoint(width < parseFloat(
|
|
51
|
+
setIsSmallBreakpoint(width < parseFloat(breakpointValues.M));
|
|
52
52
|
}, []);
|
|
53
53
|
|
|
54
54
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
3
|
import zIndex from '../../../theme/shared/zIndex';
|
|
4
|
-
import
|
|
4
|
+
import containers from '../../../theme/shared/containers';
|
|
5
5
|
import spacing from '../../../theme/shared/spacing';
|
|
6
6
|
|
|
7
7
|
const HeaderWrapper = styled.header.attrs(() => ({
|
|
@@ -23,7 +23,7 @@ const InnerWrapper = styled.div`
|
|
|
23
23
|
height: 100%;
|
|
24
24
|
padding: 0 12px;
|
|
25
25
|
cursor: pointer;
|
|
26
|
-
max-width: ${
|
|
26
|
+
max-width: ${containers.large};
|
|
27
27
|
|
|
28
28
|
@media ${({ theme }) => theme.allBreakpoints('Nav')} {
|
|
29
29
|
margin: 0 auto;
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
|
|
4
4
|
import Text from '../../../Atoms/Text/Text';
|
|
5
5
|
import BurgerMenu from '../Burger/BurgerMenu';
|
|
6
|
-
import {
|
|
6
|
+
import { breakpointValues } from '../../../../theme/shared/allBreakpoints';
|
|
7
7
|
import NavHelper from '../../../../utils/navHelper';
|
|
8
8
|
import { InternalLinkHelper } from '../../../../utils/internalLinkHelper';
|
|
9
9
|
import allowListed from '../../../../utils/allowListed';
|
|
@@ -55,7 +55,7 @@ const MainNav = ({ navItems }) => {
|
|
|
55
55
|
|
|
56
56
|
useEffect(() => {
|
|
57
57
|
const width = window.innerWidth;
|
|
58
|
-
setIsMobile(width <
|
|
58
|
+
setIsMobile(width < breakpointValues.Nav);
|
|
59
59
|
window.addEventListener('onkeyup', setIsKeyPressed);
|
|
60
60
|
|
|
61
61
|
return () => {
|
|
@@ -3,7 +3,6 @@ import styled from 'styled-components';
|
|
|
3
3
|
import Link from '../../../Atoms/Link/Link';
|
|
4
4
|
import hideVisually from '../../../../theme/shared/hideVisually';
|
|
5
5
|
import zIndex from '../../../../theme/shared/zIndex';
|
|
6
|
-
import { screen } from '../../../../theme/shared/size';
|
|
7
6
|
|
|
8
7
|
const NavLinkClass = styled(Link)`
|
|
9
8
|
display: inline-block;
|
|
@@ -32,7 +31,7 @@ const Nav = styled.nav`
|
|
|
32
31
|
left: 0;
|
|
33
32
|
${zIndex('higher')};
|
|
34
33
|
|
|
35
|
-
@media (
|
|
34
|
+
@media ${({ theme }) => theme.allBreakpoints('M')} {
|
|
36
35
|
width: 50%;
|
|
37
36
|
right: 0;
|
|
38
37
|
left: inherit;
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
CarouselWrapper, ImageWrapper, AmountWrapper, CopyWrapper, Heading, PeopleHelpedText, Including
|
|
12
12
|
} from './WYMDCarousel.style';
|
|
13
13
|
import Text from '../../Atoms/Text/Text';
|
|
14
|
-
import {
|
|
14
|
+
import { breakpointValues } from '../../../theme/shared/allBreakpoints';
|
|
15
15
|
|
|
16
16
|
const WYMDCarousel = ({ data, data: { autoPlay, contentful_id: thisID } }) => {
|
|
17
17
|
// Defaults to mobile config:
|
|
@@ -23,7 +23,7 @@ const WYMDCarousel = ({ data, data: { autoPlay, contentful_id: thisID } }) => {
|
|
|
23
23
|
// Custom function to let us update the carousel config dynamically
|
|
24
24
|
const screenResize = useCallback(() => {
|
|
25
25
|
const screenSize = typeof window !== 'undefined' ? window.innerWidth : null;
|
|
26
|
-
const isCurrentlyMobile = window.innerWidth <
|
|
26
|
+
const isCurrentlyMobile = window.innerWidth < breakpointValues.M;
|
|
27
27
|
|
|
28
28
|
if (screenSize !== null && (isMobile !== isCurrentlyMobile)) {
|
|
29
29
|
setIsMobile(isCurrentlyMobile);
|
|
@@ -38,7 +38,7 @@ const WYMDCarousel = ({ data, data: { autoPlay, contentful_id: thisID } }) => {
|
|
|
38
38
|
}, [setTheseItems, data]);
|
|
39
39
|
|
|
40
40
|
useEffect(() => {
|
|
41
|
-
if (window !== 'undefined' && window.innerWidth >=
|
|
41
|
+
if (window !== 'undefined' && window.innerWidth >= breakpointValues.M) {
|
|
42
42
|
// On inital render, update carousel plugin config
|
|
43
43
|
// to suit the non-mobile layout and functionality:
|
|
44
44
|
setIsMobile(false);
|
package/src/index.js
CHANGED
|
@@ -8,10 +8,8 @@ export { default as hideVisually } from './theme/shared/hideVisually';
|
|
|
8
8
|
export { default as zIndex } from './theme/shared/zIndex';
|
|
9
9
|
export { default as allowListed } from './utils/allowListed';
|
|
10
10
|
export { default as spacing } from './theme/shared/spacing';
|
|
11
|
-
export { default as breakpoint } from './theme/shared/breakpoint';
|
|
12
11
|
export { default as allBreakpoints } from './theme/shared/allBreakpoints';
|
|
13
|
-
export {
|
|
14
|
-
export { default as allContainers } from './theme/shared/allContainers';
|
|
12
|
+
export { default as containers } from './theme/shared/containers';
|
|
15
13
|
|
|
16
14
|
/* Atoms */
|
|
17
15
|
export { default as Text } from './components/Atoms/Text/Text';
|
|
@@ -2,7 +2,6 @@ import color from './colors';
|
|
|
2
2
|
import buttonColors from './buttonColors';
|
|
3
3
|
import linkStyles from './linkStyles';
|
|
4
4
|
import fontSize from './fontSizes';
|
|
5
|
-
import breakpoint from '../shared/breakpoint';
|
|
6
5
|
import allBreakpoints from '../shared/allBreakpoints';
|
|
7
6
|
import fontFamilies from '../shared/fontFamilies';
|
|
8
7
|
|
|
@@ -11,7 +10,6 @@ export default {
|
|
|
11
10
|
buttonColors,
|
|
12
11
|
linkStyles,
|
|
13
12
|
fontSize,
|
|
14
|
-
breakpoint,
|
|
15
13
|
allBreakpoints,
|
|
16
14
|
fontFamilies,
|
|
17
15
|
font: {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* For usage and examples see utils.md
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const breakpointValues = {
|
|
2
6
|
S: 0,
|
|
3
7
|
M: 740,
|
|
4
8
|
L: 1024,
|
|
@@ -8,7 +12,7 @@ export const sizes = {
|
|
|
8
12
|
|
|
9
13
|
export default size => {
|
|
10
14
|
if (size) {
|
|
11
|
-
return `(min-width: ${
|
|
15
|
+
return `(min-width: ${breakpointValues[size]}px)`;
|
|
12
16
|
}
|
|
13
17
|
return 'inherit';
|
|
14
18
|
};
|
|
@@ -2,7 +2,7 @@ import color from './colors';
|
|
|
2
2
|
import buttonColors from './buttonColors';
|
|
3
3
|
import linkStyles from './linkStyles';
|
|
4
4
|
import fontSize from './fontSizes';
|
|
5
|
-
import
|
|
5
|
+
import allBreakpoints from '../shared/allBreakpoints';
|
|
6
6
|
import fontFamilies from '../shared/fontFamilies';
|
|
7
7
|
|
|
8
8
|
export default {
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
buttonColors,
|
|
11
11
|
linkStyles,
|
|
12
12
|
fontSize,
|
|
13
|
-
|
|
13
|
+
allBreakpoints,
|
|
14
14
|
fontFamilies,
|
|
15
15
|
font: {
|
|
16
16
|
regular: 'Founders',
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.sizes = exports.default = void 0;
|
|
7
|
-
const sizes = exports.sizes = {
|
|
8
|
-
small: 740,
|
|
9
|
-
medium: 1024,
|
|
10
|
-
nav: 1150,
|
|
11
|
-
large: 1440
|
|
12
|
-
};
|
|
13
|
-
var _default = size => {
|
|
14
|
-
if (size) {
|
|
15
|
-
return "(min-width: ".concat(sizes[size], "px)");
|
|
16
|
-
}
|
|
17
|
-
return 'inherit';
|
|
18
|
-
};
|
|
19
|
-
exports.default = _default;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.screen = exports.media = exports.container = void 0;
|
|
7
|
-
const screen = exports.screen = {
|
|
8
|
-
small: '740px',
|
|
9
|
-
medium: '1024px',
|
|
10
|
-
large: '1440px'
|
|
11
|
-
};
|
|
12
|
-
const media = size => {
|
|
13
|
-
if (size) {
|
|
14
|
-
return "@media (min-width: ".concat(screen[size], ")");
|
|
15
|
-
}
|
|
16
|
-
return 'inherit';
|
|
17
|
-
};
|
|
18
|
-
exports.media = media;
|
|
19
|
-
const container = exports.container = {
|
|
20
|
-
small: '880px',
|
|
21
|
-
medium: '1200px',
|
|
22
|
-
large: '1440px'
|
|
23
|
-
};
|
package/src/theme/shared/size.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const screen = {
|
|
2
|
-
small: '740px',
|
|
3
|
-
medium: '1024px',
|
|
4
|
-
large: '1440px'
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
const media = size => {
|
|
8
|
-
if (size) {
|
|
9
|
-
return `@media (min-width: ${screen[size]})`;
|
|
10
|
-
}
|
|
11
|
-
return 'inherit';
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const container = {
|
|
15
|
-
small: '880px',
|
|
16
|
-
medium: '1200px',
|
|
17
|
-
large: '1440px'
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { media, screen, container };
|