@comicrelief/component-library 8.13.1 → 8.13.2

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.
@@ -16,10 +16,12 @@ const Header2025 = _ref => {
16
16
  campaign = 'Comic Relief',
17
17
  donateButton = null,
18
18
  characterLimit = 60,
19
+ showBoxShadow = false,
19
20
  ...rest
20
21
  } = _ref;
21
22
  return /*#__PURE__*/_react.default.createElement(_Header.Header2025Wrapper, Object.assign({
22
- navItems: true
23
+ navItems: true,
24
+ showBoxShadow: showBoxShadow
23
25
  }, rest), /*#__PURE__*/_react.default.createElement(_Header.InnerWrapper, null, /*#__PURE__*/_react.default.createElement(_Header.Brand, null, /*#__PURE__*/_react.default.createElement(_Logos.default, {
24
26
  campaign: campaign,
25
27
  sizeSm: "50px",
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.InnerWrapper = exports.Header2025Wrapper = exports.Header2025MetaIcons = exports.DonateButtonWrapperTop = exports.ButtonsAndIcons = exports.Brand = void 0;
8
- var _styledComponents = _interopRequireDefault(require("styled-components"));
9
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
10
  var _zIndex = _interopRequireDefault(require("../../../theme/shared/zIndex"));
10
11
  var _containers = _interopRequireDefault(require("../../../theme/shared/containers"));
11
12
  require("./annoying.css");
@@ -14,7 +15,7 @@ const Header2025Wrapper = exports.Header2025Wrapper = _styledComponents.default.
14
15
  })).withConfig({
15
16
  displayName: "Header2025style__Header2025Wrapper",
16
17
  componentId: "sc-7gs40r-0"
17
- })(["position:relative;background-color:", ";padding:0;height:75px;@media ", "{height:auto;}"], _ref => {
18
+ })(["position:relative;background-color:", ";padding:0;height:75px;@media ", "{height:auto;}", ";"], _ref => {
18
19
  let {
19
20
  theme
20
21
  } = _ref;
@@ -24,23 +25,33 @@ const Header2025Wrapper = exports.Header2025Wrapper = _styledComponents.default.
24
25
  theme
25
26
  } = _ref2;
26
27
  return theme.allBreakpoints('Nav');
28
+ }, _ref3 => {
29
+ let {
30
+ showBoxShadow
31
+ } = _ref3;
32
+ return showBoxShadow && (0, _styledComponents.css)(["box-shadow:0 5px 15px 0 ", ";"], _ref4 => {
33
+ let {
34
+ theme
35
+ } = _ref4;
36
+ return theme.color('grey_4');
37
+ });
27
38
  });
28
39
  const InnerWrapper = exports.InnerWrapper = _styledComponents.default.div.withConfig({
29
40
  displayName: "Header2025style__InnerWrapper",
30
41
  componentId: "sc-7gs40r-1"
31
- })(["display:flex;align-items:center;height:100%;padding:0 12px;cursor:pointer;max-width:", ";@media ", "{margin:0 auto;}"], _containers.default.large, _ref3 => {
42
+ })(["display:flex;align-items:center;height:100%;padding:0 12px;cursor:pointer;max-width:", ";@media ", "{margin:0 auto;}"], _containers.default.large, _ref5 => {
32
43
  let {
33
44
  theme
34
- } = _ref3;
45
+ } = _ref5;
35
46
  return theme.allBreakpoints('Nav');
36
47
  });
37
48
  const Brand = exports.Brand = _styledComponents.default.div.withConfig({
38
49
  displayName: "Header2025style__Brand",
39
50
  componentId: "sc-7gs40r-2"
40
- })(["", ";margin-right:auto;display:flex;align-items:center;a{border:0;color:transparent;margin-right:25px;img{width:100%;object-fit:contain;}:hover{border:0;}}@media ", "{margin-right:0}"], (0, _zIndex.default)('high'), _ref4 => {
51
+ })(["", ";margin-right:auto;display:flex;align-items:center;a{border:0;color:transparent;margin-right:25px;img{width:100%;object-fit:contain;}:hover{border:0;}}@media ", "{margin-right:0}"], (0, _zIndex.default)('high'), _ref6 => {
41
52
  let {
42
53
  theme
43
- } = _ref4;
54
+ } = _ref6;
44
55
  return theme.allBreakpoints('Nav');
45
56
  });
46
57
  const DonateButtonWrapperTop = exports.DonateButtonWrapperTop = _styledComponents.default.div.withConfig({
@@ -50,20 +61,20 @@ const DonateButtonWrapperTop = exports.DonateButtonWrapperTop = _styledComponent
50
61
  const Header2025MetaIcons = exports.Header2025MetaIcons = _styledComponents.default.div.withConfig({
51
62
  displayName: "Header2025style__Header2025MetaIcons",
52
63
  componentId: "sc-7gs40r-4"
53
- })(["display:none;@media ", "{width:auto;align-items:center;> div{height:35px;width:auto;display:inline-block;> a{height:inherit;width:inherit;margin-right:6px;img{padding:5px 7px;height:inherit;width:inherit;}}}position:relative;display:flex;align-items:center;background-color:", ";margin-right:0px;right:0px;}@media ", "{> div > a{margin-right:20px;}}"], _ref5 => {
64
+ })(["display:none;@media ", "{width:auto;align-items:center;> div{height:35px;width:auto;display:inline-block;> a{height:inherit;width:inherit;margin-right:6px;img{padding:5px 7px;height:inherit;width:inherit;}}}position:relative;display:flex;align-items:center;background-color:", ";margin-right:0px;right:0px;}@media ", "{> div > a{margin-right:20px;}}"], _ref7 => {
54
65
  let {
55
66
  theme
56
- } = _ref5;
67
+ } = _ref7;
57
68
  return theme.allBreakpoints('Nav');
58
- }, _ref6 => {
69
+ }, _ref8 => {
59
70
  let {
60
71
  theme
61
- } = _ref6;
72
+ } = _ref8;
62
73
  return theme.color('white');
63
- }, _ref7 => {
74
+ }, _ref9 => {
64
75
  let {
65
76
  theme
66
- } = _ref7;
77
+ } = _ref9;
67
78
  return theme.allBreakpoints('NavWide');
68
79
  });
69
80
  const ButtonsAndIcons = exports.ButtonsAndIcons = _styledComponents.default.div.withConfig({
@@ -125,7 +125,7 @@ const SubNavMenu = exports.SubNavMenu = _styledComponents.default.ul.withConfig(
125
125
  const SubNavItem = exports.SubNavItem = _styledComponents.default.li.withConfig({
126
126
  displayName: "HeaderNav2025style__SubNavItem",
127
127
  componentId: "sc-xflhtq-3"
128
- })(["padding:0;height:100%;width:100%;border-top:1px solid ", ";;position:relative;transition:background-color ", "s ease;&:first-of-type{border-top:none;}span{font-weight:100;}"], _ref18 => {
128
+ })(["padding:0;height:100%;width:100%;border-top:1px solid ", ";;position:relative;transition:background-color ", "s ease;span{font-weight:100;}"], _ref18 => {
129
129
  let {
130
130
  theme
131
131
  } = _ref18;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comicrelief/component-library",
3
3
  "author": "Comic Relief Engineering Team",
4
- "version": "8.13.1",
4
+ "version": "8.13.2",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -9,9 +9,10 @@ import {
9
9
  } from './Header2025.style';
10
10
 
11
11
  const Header2025 = ({
12
- navItems = {}, metaIcons, campaign = 'Comic Relief', donateButton = null, characterLimit = 60, ...rest
12
+ navItems = {}, metaIcons, campaign = 'Comic Relief', donateButton = null,
13
+ characterLimit = 60, showBoxShadow = false, ...rest
13
14
  }) => (
14
- <Header2025Wrapper navItems {...rest}>
15
+ <Header2025Wrapper navItems showBoxShadow={showBoxShadow} {...rest}>
15
16
  <InnerWrapper>
16
17
  <Brand>
17
18
  <Logos
@@ -56,7 +57,8 @@ Header2025.propTypes = {
56
57
  // ... and is supplied separately to allow more render control:
57
58
  donateButton: PropTypes.node,
58
59
  campaign: PropTypes.string,
59
- characterLimit: PropTypes.number
60
+ characterLimit: PropTypes.number,
61
+ showBoxShadow: PropTypes.bool
60
62
  };
61
63
 
62
64
  export default Header2025;
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import styled, { css } from 'styled-components';
2
2
 
3
3
  import zIndex from '../../../theme/shared/zIndex';
4
4
  import containers from '../../../theme/shared/containers';
@@ -16,6 +16,10 @@ const Header2025Wrapper = styled.header.attrs(() => ({
16
16
  @media ${({ theme }) => theme.allBreakpoints('Nav')} {
17
17
  height: auto;
18
18
  }
19
+
20
+ ${({ showBoxShadow }) => showBoxShadow && css`
21
+ box-shadow: 0 5px 15px 0 ${({ theme }) => theme.color('grey_4')};
22
+ `};
19
23
  `;
20
24
 
21
25
  const InnerWrapper = styled.div`
@@ -140,10 +140,6 @@ const SubNavItem = styled.li`
140
140
  position: relative;
141
141
  transition: background-color ${transitionDuration}s ease;
142
142
 
143
- &:first-of-type {
144
- border-top: none;
145
- }
146
-
147
143
  span {
148
144
  font-weight: 100;
149
145
  }