@atlaskit/mobile-header 6.0.0 → 6.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/mobile-header
2
2
 
3
+ ## 6.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 6.0.1
14
+
15
+ ### Patch Changes
16
+
17
+ - [`005b25fd40d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/005b25fd40d) - Moved `@emotion/styled` to dependency to ensure correct version (v11) is resolved.
18
+
3
19
  ## 6.0.0
4
20
 
5
21
  ### Major Changes
@@ -1,58 +1,35 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports.default = void 0;
11
-
12
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
-
14
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
-
16
11
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
17
-
18
12
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
-
20
13
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
-
22
14
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
23
-
24
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
-
26
16
  var _react = _interopRequireWildcard(require("react"));
27
-
28
17
  var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
29
-
30
18
  var _menu = _interopRequireDefault(require("@atlaskit/icon/glyph/menu"));
31
-
32
19
  var styles = _interopRequireWildcard(require("../styled"));
33
-
34
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
-
36
21
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
-
38
22
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
39
-
40
23
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
41
-
42
24
  var MobileHeader = /*#__PURE__*/function (_PureComponent) {
43
25
  (0, _inherits2.default)(MobileHeader, _PureComponent);
44
-
45
26
  var _super = _createSuper(MobileHeader);
46
-
47
27
  function MobileHeader() {
48
28
  var _this;
49
-
50
29
  (0, _classCallCheck2.default)(this, MobileHeader);
51
-
52
30
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
53
31
  args[_key] = arguments[_key];
54
32
  }
55
-
56
33
  _this = _super.call.apply(_super, [this].concat(args));
57
34
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
58
35
  isAnimatingNavigation: false,
@@ -78,7 +55,6 @@ var MobileHeader = /*#__PURE__*/function (_PureComponent) {
78
55
  });
79
56
  return _this;
80
57
  }
81
-
82
58
  (0, _createClass2.default)(MobileHeader, [{
83
59
  key: "UNSAFE_componentWillReceiveProps",
84
60
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
@@ -98,16 +74,15 @@ var MobileHeader = /*#__PURE__*/function (_PureComponent) {
98
74
  key: "render",
99
75
  value: function render() {
100
76
  var _this$state = this.state,
101
- isAnimatingNavigation = _this$state.isAnimatingNavigation,
102
- isAnimatingSidebar = _this$state.isAnimatingSidebar;
77
+ isAnimatingNavigation = _this$state.isAnimatingNavigation,
78
+ isAnimatingSidebar = _this$state.isAnimatingSidebar;
103
79
  var _this$props = this.props,
104
- drawerState = _this$props.drawerState,
105
- menuIconLabel = _this$props.menuIconLabel,
106
- customMenu = _this$props.customMenu,
107
- topOffset = _this$props.topOffset;
80
+ drawerState = _this$props.drawerState,
81
+ menuIconLabel = _this$props.menuIconLabel,
82
+ customMenu = _this$props.customMenu,
83
+ topOffset = _this$props.topOffset;
108
84
  var isNavigationOpen = drawerState === 'navigation';
109
85
  var isSidebarOpen = drawerState === 'sidebar';
110
-
111
86
  var menu = customMenu || /*#__PURE__*/_react.default.createElement(_customThemeButton.default, {
112
87
  appearance: "subtle",
113
88
  iconBefore: /*#__PURE__*/_react.default.createElement(_menu.default, {
@@ -116,7 +91,6 @@ var MobileHeader = /*#__PURE__*/function (_PureComponent) {
116
91
  }),
117
92
  onClick: this.props.onNavigationOpen
118
93
  });
119
-
120
94
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(styles.MobilePageHeader, null, /*#__PURE__*/_react.default.createElement(styles.MobilePageHeaderContent, {
121
95
  topOffset: topOffset
122
96
  }, menu, /*#__PURE__*/_react.default.createElement(styles.PageHeading, null, this.props.pageHeading), this.props.secondaryContent)), this.renderSlider(isNavigationOpen, isAnimatingNavigation, this.handleNavSlideFinish, 'left', this.props.navigation, topOffset), this.renderSlider(isSidebarOpen, isAnimatingSidebar, this.handleSidebarSlideFinish, 'right', this.props.sidebar, topOffset), (isNavigationOpen || isSidebarOpen || isAnimatingNavigation || isAnimatingSidebar) && /*#__PURE__*/_react.default.createElement(styles.FakeBlanket, {
@@ -127,7 +101,6 @@ var MobileHeader = /*#__PURE__*/function (_PureComponent) {
127
101
  }]);
128
102
  return MobileHeader;
129
103
  }(_react.PureComponent);
130
-
131
104
  (0, _defineProperty2.default)(MobileHeader, "defaultProps", {
132
105
  topOffset: 0,
133
106
  pageHeading: '',
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -11,5 +10,4 @@ Object.defineProperty(exports, "default", {
11
10
  return _MobileHeader.default;
12
11
  }
13
12
  });
14
-
15
13
  var _MobileHeader = _interopRequireDefault(require("./components/MobileHeader"));
@@ -1,73 +1,60 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.PageHeading = exports.MobilePageHeaderContent = exports.MobilePageHeader = exports.MobileNavSlider = exports.FakeBlanket = void 0;
9
-
10
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
-
12
9
  var _react = require("@emotion/react");
13
-
14
10
  var _styled = _interopRequireDefault(require("@emotion/styled"));
15
-
16
11
  var _theme = require("@atlaskit/theme");
12
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9; // AFP-2532 TODO: Fix automatic suppressions below
13
+ // eslint-disable-next-line @atlassian/tangerine/import/entry-points
14
+ var gridSize = (0, _theme.gridSize)();
17
15
 
18
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
19
-
20
- var gridSize = (0, _theme.gridSize)(); // @atlaskit/navigation has a specific z-index, so we need to layer the header
16
+ // @atlaskit/navigation has a specific z-index, so we need to layer the header
21
17
  // components relative to that.
22
-
23
18
  var navLayer = _theme.layers.navigation();
24
-
25
19
  var layers = {
26
20
  header: navLayer - 10,
27
21
  blanket: navLayer - 5,
28
22
  slider: navLayer + 5
29
23
  };
30
24
  var mobileHeaderHeight = 54;
31
-
32
25
  var xPositioning = function xPositioning(_ref) {
33
26
  var side = _ref.side,
34
- isOpen = _ref.isOpen;
27
+ isOpen = _ref.isOpen;
35
28
  return side === 'right' ? (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n right: 0;\n transform: translateX(", ");\n "])), isOpen ? '0' : '100vw') : (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n left: 0;\n transform: translateX(", ");\n "])), isOpen ? '0' : '-100vw');
36
29
  };
37
-
38
30
  var MobileNavSlider = _styled.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n height: ", ";\n position: fixed;\n top: ", "px;\n transition: transform 0.2s ease-out;\n z-index: ", ";\n ", ";\n"])), function (props) {
39
31
  return "calc(100vh - ".concat(props.topOffset, "px)");
40
32
  }, function (props) {
41
33
  return props.topOffset;
42
- }, layers.slider, xPositioning); // make space so content below doesn't slip beneath the header
43
- // since the content is `position: fixed`
44
-
34
+ }, layers.slider, xPositioning);
45
35
 
36
+ // make space so content below doesn't slip beneath the header
37
+ // since the content is `position: fixed`
46
38
  exports.MobileNavSlider = MobileNavSlider;
47
-
48
39
  var MobilePageHeader = _styled.default.header(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n height: ", "px;\n"])), mobileHeaderHeight);
49
-
50
40
  exports.MobilePageHeader = MobilePageHeader;
51
-
52
41
  var MobilePageHeaderContent = _styled.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n background-color: ", ";\n box-sizing: border-box;\n display: flex;\n height: ", "px;\n padding: ", "px;\n position: fixed;\n top: ", "px;\n width: 100%;\n z-index: ", ";\n"])), (0, _theme.themed)({
53
42
  light: _theme.colors.N20,
54
43
  dark: _theme.colors.DN10
55
44
  }), mobileHeaderHeight, gridSize, function (props) {
56
45
  return props.topOffset;
57
46
  }, layers.header);
58
-
59
47
  exports.MobilePageHeaderContent = MobilePageHeaderContent;
60
48
  var opacityIn = (0, _react.keyframes)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n from { opacity: 0; }\n to { opacity: 1; }\n"])));
61
- var opacityOut = (0, _react.keyframes)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n from { opacity: 1; }\n to { opacity: 0; }\n"]))); // @atlaskit/blanket has a z-index *higher* than @atlaskit/navigation,
62
- // so we can't display the AK blanket underneath the navigation.
49
+ var opacityOut = (0, _react.keyframes)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n from { opacity: 1; }\n to { opacity: 0; }\n"])));
63
50
 
51
+ // @atlaskit/blanket has a z-index *higher* than @atlaskit/navigation,
52
+ // so we can't display the AK blanket underneath the navigation.
64
53
  var FakeBlanket = _styled.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n bottom: 0;\n left: 0;\n position: fixed;\n right: 0;\n top: 0;\n z-index: ", ";\n animation: ", " 0.2s ease-out;\n"])), _theme.colors.N100A, layers.blanket, function (p) {
65
54
  return p.isOpen ? opacityIn : opacityOut;
66
- }); // use proper h1 and header styles but for mobile we don't want a top margin
67
-
55
+ });
68
56
 
57
+ // use proper h1 and header styles but for mobile we don't want a top margin
69
58
  exports.FakeBlanket = FakeBlanket;
70
-
71
59
  var PageHeading = _styled.default.h1(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n margin-left: ", "px;\n ", ";\n && {\n margin-top: 0;\n }\n"])), gridSize, _theme.typography.h500);
72
-
73
60
  exports.PageHeading = PageHeading;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/mobile-header",
3
- "version": "6.0.0"
3
+ "version": "6.1.0"
4
4
  }
@@ -3,28 +3,23 @@ import React, { Fragment, PureComponent } from 'react';
3
3
  import Button from '@atlaskit/button/custom-theme-button';
4
4
  import MenuIcon from '@atlaskit/icon/glyph/menu';
5
5
  import * as styles from '../styled';
6
-
7
6
  class MobileHeader extends PureComponent {
8
7
  constructor(...args) {
9
8
  super(...args);
10
-
11
9
  _defineProperty(this, "state", {
12
10
  isAnimatingNavigation: false,
13
11
  isAnimatingSidebar: false
14
12
  });
15
-
16
13
  _defineProperty(this, "handleNavSlideFinish", () => {
17
14
  this.setState({
18
15
  isAnimatingNavigation: false
19
16
  });
20
17
  });
21
-
22
18
  _defineProperty(this, "handleSidebarSlideFinish", () => {
23
19
  this.setState({
24
20
  isAnimatingSidebar: false
25
21
  });
26
22
  });
27
-
28
23
  _defineProperty(this, "renderSlider", (isOpen, isAnimating, onTransitionEnd, side, renderFn, topOffset) => /*#__PURE__*/React.createElement(styles.MobileNavSlider, {
29
24
  isOpen: isOpen,
30
25
  onTransitionEnd: onTransitionEnd,
@@ -32,7 +27,6 @@ class MobileHeader extends PureComponent {
32
27
  topOffset: topOffset
33
28
  }, (isOpen || isAnimating) && renderFn && renderFn(isOpen)));
34
29
  }
35
-
36
30
  UNSAFE_componentWillReceiveProps(nextProps) {
37
31
  if (nextProps.drawerState === 'none') {
38
32
  if (this.props.drawerState === 'navigation') {
@@ -46,7 +40,6 @@ class MobileHeader extends PureComponent {
46
40
  }
47
41
  }
48
42
  }
49
-
50
43
  render() {
51
44
  const {
52
45
  isAnimatingNavigation,
@@ -75,14 +68,11 @@ class MobileHeader extends PureComponent {
75
68
  onClick: this.props.onDrawerClose
76
69
  }));
77
70
  }
78
-
79
71
  }
80
-
81
72
  _defineProperty(MobileHeader, "defaultProps", {
82
73
  topOffset: 0,
83
74
  pageHeading: '',
84
75
  menuIconLabel: 'Menu',
85
76
  drawerState: ''
86
77
  });
87
-
88
78
  export default MobileHeader;
@@ -1,11 +1,13 @@
1
1
  import { css, keyframes } from '@emotion/react';
2
- import styled from '@emotion/styled'; // AFP-2532 TODO: Fix automatic suppressions below
3
- // eslint-disable-next-line @atlassian/tangerine/import/entry-points
2
+ import styled from '@emotion/styled';
4
3
 
4
+ // AFP-2532 TODO: Fix automatic suppressions below
5
+ // eslint-disable-next-line @atlassian/tangerine/import/entry-points
5
6
  import { gridSize as akGridSize, layers as akLayers, colors, themed, typography } from '@atlaskit/theme';
6
- const gridSize = akGridSize(); // @atlaskit/navigation has a specific z-index, so we need to layer the header
7
- // components relative to that.
7
+ const gridSize = akGridSize();
8
8
 
9
+ // @atlaskit/navigation has a specific z-index, so we need to layer the header
10
+ // components relative to that.
9
11
  const navLayer = akLayers.navigation();
10
12
  const layers = {
11
13
  header: navLayer - 10,
@@ -13,7 +15,6 @@ const layers = {
13
15
  slider: navLayer + 5
14
16
  };
15
17
  const mobileHeaderHeight = 54;
16
-
17
18
  const xPositioning = ({
18
19
  side,
19
20
  isOpen
@@ -24,7 +25,6 @@ const xPositioning = ({
24
25
  left: 0;
25
26
  transform: translateX(${isOpen ? '0' : '-100vw'});
26
27
  `;
27
-
28
28
  export const MobileNavSlider = styled.div`
29
29
  height: ${props => `calc(100vh - ${props.topOffset}px)`};
30
30
  position: fixed;
@@ -32,9 +32,10 @@ export const MobileNavSlider = styled.div`
32
32
  transition: transform 0.2s ease-out;
33
33
  z-index: ${layers.slider};
34
34
  ${xPositioning};
35
- `; // make space so content below doesn't slip beneath the header
36
- // since the content is `position: fixed`
35
+ `;
37
36
 
37
+ // make space so content below doesn't slip beneath the header
38
+ // since the content is `position: fixed`
38
39
  export const MobilePageHeader = styled.header`
39
40
  height: ${mobileHeaderHeight}px;
40
41
  `;
@@ -60,9 +61,10 @@ const opacityIn = keyframes`
60
61
  const opacityOut = keyframes`
61
62
  from { opacity: 1; }
62
63
  to { opacity: 0; }
63
- `; // @atlaskit/blanket has a z-index *higher* than @atlaskit/navigation,
64
- // so we can't display the AK blanket underneath the navigation.
64
+ `;
65
65
 
66
+ // @atlaskit/blanket has a z-index *higher* than @atlaskit/navigation,
67
+ // so we can't display the AK blanket underneath the navigation.
66
68
  export const FakeBlanket = styled.div`
67
69
  background: ${colors.N100A};
68
70
  bottom: 0;
@@ -72,8 +74,9 @@ export const FakeBlanket = styled.div`
72
74
  top: 0;
73
75
  z-index: ${layers.blanket};
74
76
  animation: ${p => p.isOpen ? opacityIn : opacityOut} 0.2s ease-out;
75
- `; // use proper h1 and header styles but for mobile we don't want a top margin
77
+ `;
76
78
 
79
+ // use proper h1 and header styles but for mobile we don't want a top margin
77
80
  export const PageHeading = styled.h1`
78
81
  flex-grow: 1;
79
82
  margin-left: ${gridSize}px;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/mobile-header",
3
- "version": "6.0.0"
3
+ "version": "6.1.0"
4
4
  }
@@ -5,49 +5,36 @@ import _inherits from "@babel/runtime/helpers/inherits";
5
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
-
9
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
-
11
9
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
-
13
10
  import React, { Fragment, PureComponent } from 'react';
14
11
  import Button from '@atlaskit/button/custom-theme-button';
15
12
  import MenuIcon from '@atlaskit/icon/glyph/menu';
16
13
  import * as styles from '../styled';
17
-
18
14
  var MobileHeader = /*#__PURE__*/function (_PureComponent) {
19
15
  _inherits(MobileHeader, _PureComponent);
20
-
21
16
  var _super = _createSuper(MobileHeader);
22
-
23
17
  function MobileHeader() {
24
18
  var _this;
25
-
26
19
  _classCallCheck(this, MobileHeader);
27
-
28
20
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
29
21
  args[_key] = arguments[_key];
30
22
  }
31
-
32
23
  _this = _super.call.apply(_super, [this].concat(args));
33
-
34
24
  _defineProperty(_assertThisInitialized(_this), "state", {
35
25
  isAnimatingNavigation: false,
36
26
  isAnimatingSidebar: false
37
27
  });
38
-
39
28
  _defineProperty(_assertThisInitialized(_this), "handleNavSlideFinish", function () {
40
29
  _this.setState({
41
30
  isAnimatingNavigation: false
42
31
  });
43
32
  });
44
-
45
33
  _defineProperty(_assertThisInitialized(_this), "handleSidebarSlideFinish", function () {
46
34
  _this.setState({
47
35
  isAnimatingSidebar: false
48
36
  });
49
37
  });
50
-
51
38
  _defineProperty(_assertThisInitialized(_this), "renderSlider", function (isOpen, isAnimating, onTransitionEnd, side, renderFn, topOffset) {
52
39
  return /*#__PURE__*/React.createElement(styles.MobileNavSlider, {
53
40
  isOpen: isOpen,
@@ -56,10 +43,8 @@ var MobileHeader = /*#__PURE__*/function (_PureComponent) {
56
43
  topOffset: topOffset
57
44
  }, (isOpen || isAnimating) && renderFn && renderFn(isOpen));
58
45
  });
59
-
60
46
  return _this;
61
47
  }
62
-
63
48
  _createClass(MobileHeader, [{
64
49
  key: "UNSAFE_componentWillReceiveProps",
65
50
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
@@ -79,13 +64,13 @@ var MobileHeader = /*#__PURE__*/function (_PureComponent) {
79
64
  key: "render",
80
65
  value: function render() {
81
66
  var _this$state = this.state,
82
- isAnimatingNavigation = _this$state.isAnimatingNavigation,
83
- isAnimatingSidebar = _this$state.isAnimatingSidebar;
67
+ isAnimatingNavigation = _this$state.isAnimatingNavigation,
68
+ isAnimatingSidebar = _this$state.isAnimatingSidebar;
84
69
  var _this$props = this.props,
85
- drawerState = _this$props.drawerState,
86
- menuIconLabel = _this$props.menuIconLabel,
87
- customMenu = _this$props.customMenu,
88
- topOffset = _this$props.topOffset;
70
+ drawerState = _this$props.drawerState,
71
+ menuIconLabel = _this$props.menuIconLabel,
72
+ customMenu = _this$props.customMenu,
73
+ topOffset = _this$props.topOffset;
89
74
  var isNavigationOpen = drawerState === 'navigation';
90
75
  var isSidebarOpen = drawerState === 'sidebar';
91
76
  var menu = customMenu || /*#__PURE__*/React.createElement(Button, {
@@ -104,15 +89,12 @@ var MobileHeader = /*#__PURE__*/function (_PureComponent) {
104
89
  }));
105
90
  }
106
91
  }]);
107
-
108
92
  return MobileHeader;
109
93
  }(PureComponent);
110
-
111
94
  _defineProperty(MobileHeader, "defaultProps", {
112
95
  topOffset: 0,
113
96
  pageHeading: '',
114
97
  menuIconLabel: 'Menu',
115
98
  drawerState: ''
116
99
  });
117
-
118
100
  export default MobileHeader;
@@ -1,15 +1,15 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
2
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
4
-
5
3
  import { css, keyframes } from '@emotion/react';
6
- import styled from '@emotion/styled'; // AFP-2532 TODO: Fix automatic suppressions below
7
- // eslint-disable-next-line @atlassian/tangerine/import/entry-points
4
+ import styled from '@emotion/styled';
8
5
 
6
+ // AFP-2532 TODO: Fix automatic suppressions below
7
+ // eslint-disable-next-line @atlassian/tangerine/import/entry-points
9
8
  import { gridSize as akGridSize, layers as akLayers, colors, themed, typography } from '@atlaskit/theme';
10
- var gridSize = akGridSize(); // @atlaskit/navigation has a specific z-index, so we need to layer the header
11
- // components relative to that.
9
+ var gridSize = akGridSize();
12
10
 
11
+ // @atlaskit/navigation has a specific z-index, so we need to layer the header
12
+ // components relative to that.
13
13
  var navLayer = akLayers.navigation();
14
14
  var layers = {
15
15
  header: navLayer - 10,
@@ -17,20 +17,19 @@ var layers = {
17
17
  slider: navLayer + 5
18
18
  };
19
19
  var mobileHeaderHeight = 54;
20
-
21
20
  var xPositioning = function xPositioning(_ref) {
22
21
  var side = _ref.side,
23
- isOpen = _ref.isOpen;
22
+ isOpen = _ref.isOpen;
24
23
  return side === 'right' ? css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n right: 0;\n transform: translateX(", ");\n "])), isOpen ? '0' : '100vw') : css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n left: 0;\n transform: translateX(", ");\n "])), isOpen ? '0' : '-100vw');
25
24
  };
26
-
27
25
  export var MobileNavSlider = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: ", ";\n position: fixed;\n top: ", "px;\n transition: transform 0.2s ease-out;\n z-index: ", ";\n ", ";\n"])), function (props) {
28
26
  return "calc(100vh - ".concat(props.topOffset, "px)");
29
27
  }, function (props) {
30
28
  return props.topOffset;
31
- }, layers.slider, xPositioning); // make space so content below doesn't slip beneath the header
32
- // since the content is `position: fixed`
29
+ }, layers.slider, xPositioning);
33
30
 
31
+ // make space so content below doesn't slip beneath the header
32
+ // since the content is `position: fixed`
34
33
  export var MobilePageHeader = styled.header(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n height: ", "px;\n"])), mobileHeaderHeight);
35
34
  export var MobilePageHeaderContent = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n align-items: center;\n background-color: ", ";\n box-sizing: border-box;\n display: flex;\n height: ", "px;\n padding: ", "px;\n position: fixed;\n top: ", "px;\n width: 100%;\n z-index: ", ";\n"])), themed({
36
35
  light: colors.N20,
@@ -39,11 +38,13 @@ export var MobilePageHeaderContent = styled.div(_templateObject5 || (_templateOb
39
38
  return props.topOffset;
40
39
  }, layers.header);
41
40
  var opacityIn = keyframes(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n from { opacity: 0; }\n to { opacity: 1; }\n"])));
42
- var opacityOut = keyframes(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n from { opacity: 1; }\n to { opacity: 0; }\n"]))); // @atlaskit/blanket has a z-index *higher* than @atlaskit/navigation,
43
- // so we can't display the AK blanket underneath the navigation.
41
+ var opacityOut = keyframes(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n from { opacity: 1; }\n to { opacity: 0; }\n"])));
44
42
 
43
+ // @atlaskit/blanket has a z-index *higher* than @atlaskit/navigation,
44
+ // so we can't display the AK blanket underneath the navigation.
45
45
  export var FakeBlanket = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n background: ", ";\n bottom: 0;\n left: 0;\n position: fixed;\n right: 0;\n top: 0;\n z-index: ", ";\n animation: ", " 0.2s ease-out;\n"])), colors.N100A, layers.blanket, function (p) {
46
46
  return p.isOpen ? opacityIn : opacityOut;
47
- }); // use proper h1 and header styles but for mobile we don't want a top margin
47
+ });
48
48
 
49
+ // use proper h1 and header styles but for mobile we don't want a top margin
49
50
  export var PageHeading = styled.h1(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n flex-grow: 1;\n margin-left: ", "px;\n ", ";\n && {\n margin-top: 0;\n }\n"])), gridSize, typography.h500);
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/mobile-header",
3
- "version": "6.0.0"
3
+ "version": "6.1.0"
4
4
  }
@@ -1,16 +1,29 @@
1
1
  /// <reference types="react" />
2
- export declare const MobileNavSlider: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
2
+ export declare const MobileNavSlider: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ } & {
3
6
  topOffset: number | undefined;
4
7
  isOpen: boolean;
5
8
  side: string;
6
- }, object>;
7
- export declare const MobilePageHeader: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, Pick<import("react").ClassAttributes<HTMLElement> & import("react").HTMLAttributes<HTMLElement>, keyof import("react").HTMLAttributes<HTMLElement>>, object>;
8
- export declare const MobilePageHeaderContent: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const MobilePageHeader: import("@emotion/styled").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
14
+ export declare const MobilePageHeaderContent: import("@emotion/styled").StyledComponent<{
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any> | undefined;
17
+ } & {
9
18
  topOffset: number | undefined;
10
- }, object>;
11
- export declare const FakeBlanket: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
19
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
20
+ export declare const FakeBlanket: import("@emotion/styled").StyledComponent<{
21
+ theme?: import("@emotion/react").Theme | undefined;
22
+ as?: import("react").ElementType<any> | undefined;
23
+ } & {
12
24
  isOpen: boolean;
13
- }, object>;
14
- export declare const PageHeading: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, Pick<import("@emotion/styled-base/types/helper").Overwrapped<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, import("@atlaskit/theme").ThemeProps | undefined>, never>, {
15
- __ATLASKIT_THEME__: import("@atlaskit/theme").Theme;
16
- }>;
25
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
26
+ export declare const PageHeading: import("@emotion/styled").StyledComponent<{
27
+ theme?: import("@emotion/react").Theme | undefined;
28
+ as?: import("react").ElementType<any> | undefined;
29
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/mobile-header",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "A React component rendering a mobile header",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -22,18 +22,18 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "@atlaskit/button": "^16.4.0",
26
- "@atlaskit/icon": "^21.11.0",
27
- "@atlaskit/theme": "^12.2.0",
28
- "@babel/runtime": "^7.0.0"
25
+ "@atlaskit/button": "^16.7.0",
26
+ "@atlaskit/icon": "^21.12.0",
27
+ "@atlaskit/theme": "^12.5.0",
28
+ "@babel/runtime": "^7.0.0",
29
+ "@emotion/styled": "^11.0.0"
29
30
  },
30
31
  "peerDependencies": {
31
32
  "@emotion/react": "^11.0.0",
32
- "@emotion/styled": "^11.0.0",
33
33
  "react": "^16.8.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@atlaskit/banner": "^12.0.0",
36
+ "@atlaskit/banner": "^12.1.0",
37
37
  "@atlaskit/docs": "*",
38
38
  "@atlaskit/navigation": "^37.0.0",
39
39
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
package/report.api.md CHANGED
@@ -8,6 +8,7 @@
8
8
  ### Table of contents
9
9
 
10
10
  - [Main Entry Types](#main-entry-types)
11
+ - [Peer Dependencies](#peer-dependencies)
11
12
 
12
13
  ### Main Entry Types
13
14
 
@@ -90,3 +91,16 @@ interface MobileHeaderState {
90
91
  ```
91
92
 
92
93
  <!--SECTION END: Main Entry Types-->
94
+
95
+ ### Peer Dependencies
96
+
97
+ <!--SECTION START: Peer Dependencies-->
98
+
99
+ ```json
100
+ {
101
+ "@emotion/react": "^11.0.0",
102
+ "react": "^16.8.0"
103
+ }
104
+ ```
105
+
106
+ <!--SECTION END: Peer Dependencies-->
@@ -1,72 +0,0 @@
1
- ## API Report File for "@atlaskit/mobile-header"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- import { PureComponent } from 'react';
8
- import { default as React_2 } from 'react';
9
- import { ReactNode } from 'react';
10
-
11
- // @public (undocumented)
12
- class MobileHeader extends PureComponent<MobileHeaderProps, MobileHeaderState> {
13
- // (undocumented)
14
- static defaultProps: {
15
- topOffset: number;
16
- pageHeading: string;
17
- menuIconLabel: string;
18
- drawerState: string;
19
- };
20
- // (undocumented)
21
- handleNavSlideFinish: () => void;
22
- // (undocumented)
23
- handleSidebarSlideFinish: () => void;
24
- // (undocumented)
25
- render(): JSX.Element;
26
- // (undocumented)
27
- renderSlider: (isOpen: boolean, isAnimating: boolean, onTransitionEnd: ((event: React_2.TransitionEvent<HTMLDivElement>) => void) | undefined, side: string, renderFn?: ((isOpen: boolean) => ReactNode) | undefined, topOffset?: number | undefined) => JSX.Element;
28
- // (undocumented)
29
- state: {
30
- isAnimatingNavigation: boolean;
31
- isAnimatingSidebar: boolean;
32
- };
33
- // (undocumented)
34
- UNSAFE_componentWillReceiveProps(nextProps: MobileHeaderProps): void;
35
- }
36
- export default MobileHeader;
37
-
38
- // @public (undocumented)
39
- interface MobileHeaderProps {
40
- // (undocumented)
41
- customMenu?: ReactNode;
42
- // (undocumented)
43
- drawerState: 'navigation' | 'none' | 'sidebar' | string;
44
- // (undocumented)
45
- menuIconLabel: string;
46
- // (undocumented)
47
- navigation?: (isOpen: boolean) => ReactNode;
48
- // (undocumented)
49
- onDrawerClose?: () => void;
50
- // (undocumented)
51
- onNavigationOpen?: () => void;
52
- // (undocumented)
53
- pageHeading: ReactNode;
54
- // (undocumented)
55
- secondaryContent?: ReactNode;
56
- // (undocumented)
57
- sidebar?: (isOpen: boolean) => ReactNode;
58
- // (undocumented)
59
- topOffset?: number;
60
- }
61
-
62
- // @public (undocumented)
63
- interface MobileHeaderState {
64
- // (undocumented)
65
- isAnimatingNavigation: boolean;
66
- // (undocumented)
67
- isAnimatingSidebar: boolean;
68
- }
69
-
70
- // (No @packageDocumentation comment for this package)
71
-
72
- ```