@atlaskit/page-layout 1.2.6 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/__perf__/utils/perf-example.tsx +3 -3
  3. package/__perf__/utils/product-integration/{AtlassianNavigation.tsx → atlassian-navigation.tsx} +5 -5
  4. package/__perf__/utils/product-integration/{Create.tsx → create.tsx} +2 -1
  5. package/__perf__/utils/product-integration/{HelpPopup.tsx → help-popup.tsx} +1 -0
  6. package/__perf__/utils/product-integration/{NotificationsPopup.tsx → notifications-popup.tsx} +1 -1
  7. package/__perf__/utils/product-integration/{ProfilePopup.tsx → profile-popup.tsx} +2 -1
  8. package/__perf__/utils/product-integration/{SampleFooter.tsx → sample-footer.tsx} +2 -1
  9. package/__perf__/utils/product-integration/{SampleHeader.tsx → sample-header.tsx} +3 -1
  10. package/__perf__/utils/product-integration/{SideNavigation.tsx → side-navigation.tsx} +3 -3
  11. package/dist/cjs/common/safe-local-storage.js +1 -0
  12. package/dist/cjs/components/resize-control/grab-area.js +10 -8
  13. package/dist/cjs/components/resize-control/index.js +9 -8
  14. package/dist/cjs/components/resize-control/resize-button.js +11 -9
  15. package/dist/cjs/components/resize-control/shadow.js +6 -5
  16. package/dist/cjs/components/skip-links/skip-link-components.js +14 -12
  17. package/dist/cjs/components/slots/banner.js +14 -6
  18. package/dist/cjs/components/slots/content.js +11 -3
  19. package/dist/cjs/components/slots/internal/left-sidebar-inner.js +9 -8
  20. package/dist/cjs/components/slots/internal/left-sidebar-outer.js +9 -9
  21. package/dist/cjs/components/slots/internal/resizable-children-wrapper.js +9 -8
  22. package/dist/cjs/components/slots/internal/slot-focus-ring.js +4 -4
  23. package/dist/cjs/components/slots/left-panel.js +14 -6
  24. package/dist/cjs/components/slots/left-sidebar-without-resize.js +13 -4
  25. package/dist/cjs/components/slots/left-sidebar.js +16 -7
  26. package/dist/cjs/components/slots/main.js +15 -7
  27. package/dist/cjs/components/slots/page-layout.js +13 -5
  28. package/dist/cjs/components/slots/right-panel.js +14 -6
  29. package/dist/cjs/components/slots/right-sidebar.js +17 -9
  30. package/dist/cjs/components/slots/top-navigation.js +14 -6
  31. package/dist/cjs/controllers/sidebar-resize-context.js +8 -7
  32. package/dist/cjs/controllers/sidebar-resize-controller.js +5 -4
  33. package/dist/cjs/controllers/skip-link-context.js +6 -3
  34. package/dist/cjs/controllers/skip-link-controller.js +2 -1
  35. package/dist/cjs/version.json +1 -1
  36. package/dist/es2019/common/safe-local-storage.js +1 -0
  37. package/dist/es2019/components/resize-control/grab-area.js +5 -3
  38. package/dist/es2019/components/resize-control/index.js +3 -2
  39. package/dist/es2019/components/resize-control/resize-button.js +5 -3
  40. package/dist/es2019/components/resize-control/shadow.js +3 -2
  41. package/dist/es2019/components/skip-links/skip-link-components.js +5 -3
  42. package/dist/es2019/components/slots/banner.js +9 -1
  43. package/dist/es2019/components/slots/content.js +9 -1
  44. package/dist/es2019/components/slots/internal/left-sidebar-inner.js +3 -2
  45. package/dist/es2019/components/slots/internal/left-sidebar-outer.js +1 -1
  46. package/dist/es2019/components/slots/internal/resizable-children-wrapper.js +3 -2
  47. package/dist/es2019/components/slots/internal/slot-focus-ring.js +1 -1
  48. package/dist/es2019/components/slots/left-panel.js +9 -1
  49. package/dist/es2019/components/slots/left-sidebar-without-resize.js +9 -1
  50. package/dist/es2019/components/slots/left-sidebar.js +11 -2
  51. package/dist/es2019/components/slots/main.js +9 -1
  52. package/dist/es2019/components/slots/page-layout.js +9 -1
  53. package/dist/es2019/components/slots/right-panel.js +9 -1
  54. package/dist/es2019/components/slots/right-sidebar.js +9 -1
  55. package/dist/es2019/components/slots/top-navigation.js +9 -1
  56. package/dist/es2019/controllers/sidebar-resize-context.js +4 -5
  57. package/dist/es2019/controllers/sidebar-resize-controller.js +3 -3
  58. package/dist/es2019/controllers/skip-link-context.js +2 -3
  59. package/dist/es2019/controllers/skip-link-controller.js +2 -1
  60. package/dist/es2019/version.json +1 -1
  61. package/dist/esm/common/safe-local-storage.js +1 -0
  62. package/dist/esm/components/resize-control/grab-area.js +5 -3
  63. package/dist/esm/components/resize-control/index.js +3 -2
  64. package/dist/esm/components/resize-control/resize-button.js +5 -3
  65. package/dist/esm/components/resize-control/shadow.js +3 -2
  66. package/dist/esm/components/skip-links/skip-link-components.js +5 -3
  67. package/dist/esm/components/slots/banner.js +9 -1
  68. package/dist/esm/components/slots/content.js +9 -1
  69. package/dist/esm/components/slots/internal/left-sidebar-inner.js +3 -2
  70. package/dist/esm/components/slots/internal/left-sidebar-outer.js +1 -1
  71. package/dist/esm/components/slots/internal/resizable-children-wrapper.js +3 -2
  72. package/dist/esm/components/slots/internal/slot-focus-ring.js +1 -1
  73. package/dist/esm/components/slots/left-panel.js +9 -1
  74. package/dist/esm/components/slots/left-sidebar-without-resize.js +9 -1
  75. package/dist/esm/components/slots/left-sidebar.js +11 -2
  76. package/dist/esm/components/slots/main.js +9 -1
  77. package/dist/esm/components/slots/page-layout.js +9 -1
  78. package/dist/esm/components/slots/right-panel.js +9 -1
  79. package/dist/esm/components/slots/right-sidebar.js +9 -1
  80. package/dist/esm/components/slots/top-navigation.js +9 -1
  81. package/dist/esm/controllers/sidebar-resize-context.js +4 -5
  82. package/dist/esm/controllers/sidebar-resize-controller.js +3 -3
  83. package/dist/esm/controllers/skip-link-context.js +2 -3
  84. package/dist/esm/controllers/skip-link-controller.js +2 -1
  85. package/dist/esm/version.json +1 -1
  86. package/dist/types/common/types.d.ts +61 -21
  87. package/dist/types/common/utils.d.ts +1 -1
  88. package/dist/types/components/resize-control/grab-area.d.ts +2 -1
  89. package/dist/types/components/resize-control/index.d.ts +2 -2
  90. package/dist/types/components/resize-control/resize-button.d.ts +2 -2
  91. package/dist/types/components/resize-control/shadow.d.ts +2 -2
  92. package/dist/types/components/skip-links/skip-link-components.d.ts +3 -2
  93. package/dist/types/components/slots/banner.d.ts +10 -2
  94. package/dist/types/components/slots/content.d.ts +14 -3
  95. package/dist/types/components/slots/internal/left-sidebar-inner.d.ts +2 -1
  96. package/dist/types/components/slots/internal/resizable-children-wrapper.d.ts +2 -1
  97. package/dist/types/components/slots/internal/slot-focus-ring.d.ts +2 -1
  98. package/dist/types/components/slots/left-panel.d.ts +10 -2
  99. package/dist/types/components/slots/left-sidebar-without-resize.d.ts +10 -2
  100. package/dist/types/components/slots/left-sidebar.d.ts +10 -2
  101. package/dist/types/components/slots/main.d.ts +10 -2
  102. package/dist/types/components/slots/page-layout.d.ts +10 -2
  103. package/dist/types/components/slots/right-panel.d.ts +10 -2
  104. package/dist/types/components/slots/right-sidebar.d.ts +10 -2
  105. package/dist/types/components/slots/top-navigation.d.ts +10 -2
  106. package/dist/types/controllers/sidebar-resize-context.d.ts +1 -1
  107. package/dist/types/controllers/types.d.ts +9 -3
  108. package/package.json +13 -11
  109. package/report.api.md +219 -0
@@ -13,6 +13,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
13
13
 
14
14
  var _react = _interopRequireWildcard(require("react"));
15
15
 
16
+ var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
17
+
16
18
  var _motion = require("@atlaskit/motion");
17
19
 
18
20
  var _constants = require("../common/constants");
@@ -25,15 +27,14 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
25
27
 
26
28
  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; }
27
29
 
28
- var noop = function noop() {};
29
-
30
30
  var handleDataAttributesAndCb = function handleDataAttributesAndCb() {
31
- var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;
31
+ var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _noop.default;
32
32
  var isLeftSidebarCollapsed = arguments.length > 1 ? arguments[1] : undefined;
33
33
  var leftSidebarState = arguments.length > 2 ? arguments[2] : undefined;
34
34
  document.documentElement.removeAttribute(_constants.IS_SIDEBAR_COLLAPSING);
35
35
  callback(leftSidebarState);
36
- };
36
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
37
+
37
38
 
38
39
  var SidebarResizeController = function SidebarResizeController(_ref) {
39
40
  var children = _ref.children,
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -7,12 +9,13 @@ exports.useSkipLinks = exports.useSkipLink = exports.SkipLinksContext = void 0;
7
9
 
8
10
  var _react = require("react");
9
11
 
10
- var noop = function noop() {};
12
+ var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
11
13
 
14
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
12
15
  var SkipLinksContext = /*#__PURE__*/(0, _react.createContext)({
13
16
  skipLinksData: [],
14
- registerSkipLink: noop,
15
- unregisterSkipLink: noop
17
+ registerSkipLink: _noop.default,
18
+ unregisterSkipLink: _noop.default
16
19
  });
17
20
  exports.SkipLinksContext = SkipLinksContext;
18
21
 
@@ -47,7 +47,8 @@ var byDOMOrder = function byDOMOrder(a, b) {
47
47
  }
48
48
 
49
49
  return indexA - indexB;
50
- };
50
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
51
+
51
52
 
52
53
  var SkipLinksController = function SkipLinksController(_ref) {
53
54
  var children = _ref.children;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/page-layout",
3
- "version": "1.2.6",
3
+ "version": "1.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -4,6 +4,7 @@
4
4
  const isLocalStorageSupported = () => {
5
5
  try {
6
6
  // use an random key to test
7
+ // eslint-disable-next-line @repo/internal/react/disallow-unstable-values
7
8
  const testKey = `__test_${Date.now()}__`;
8
9
  localStorage.setItem(testKey, testKey);
9
10
  localStorage.removeItem(testKey);
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
- import { css, jsx } from '@emotion/core';
4
+ import { css, jsx } from '@emotion/react';
5
5
  import { B100, B200 } from '@atlaskit/theme/colors';
6
6
  import { GRAB_AREA_LINE_SELECTOR, GRAB_AREA_SELECTOR } from '../../common/constants';
7
7
 
@@ -60,9 +60,11 @@ const GrabArea = ({
60
60
  }) => jsx("button", _extends({}, grabAreaSelector, {
61
61
  "data-testid": testId,
62
62
  type: "button",
63
- css: [grabAreaStyles, isLeftSidebarCollapsed && grabAreaCollapsedStyles]
63
+ css: [grabAreaStyles, isLeftSidebarCollapsed && grabAreaCollapsedStyles] // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
64
+
64
65
  }, rest), jsx("span", _extends({
65
66
  css: lineStyles
66
- }, grabAreaLineSelector)));
67
+ }, grabAreaLineSelector))); // eslint-disable-next-line @repo/internal/react/require-jsdoc
68
+
67
69
 
68
70
  export default GrabArea;
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { useCallback, useContext, useMemo, useRef, useState } from 'react';
5
- import { css, jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { bindAll } from 'bind-event-listener';
7
7
  import rafSchd from 'raf-schd';
8
8
  import { COLLAPSED_LEFT_SIDEBAR_WIDTH, DEFAULT_LEFT_SIDEBAR_WIDTH, IS_SIDEBAR_DRAGGING, MIN_LEFT_SIDEBAR_DRAG_THRESHOLD, RESIZE_BUTTON_SELECTOR, RESIZE_CONTROL_SELECTOR, VAR_LEFT_SIDEBAR_WIDTH } from '../../common/constants';
@@ -274,6 +274,7 @@ const ResizeControl = ({
274
274
  testId: testId && `${testId}-resize-button`
275
275
  }));
276
276
  /* eslint-enable jsx-a11y/role-supports-aria-props */
277
- };
277
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
278
+
278
279
 
279
280
  export default ResizeControl;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
- import { css, jsx } from '@emotion/core';
4
+ import { css, jsx } from '@emotion/react';
5
5
  import ChevronRight from '@atlaskit/icon/glyph/chevron-right';
6
6
  import { easeOut } from '@atlaskit/motion/curves';
7
7
  import { mediumDurationMs, smallDurationMs } from '@atlaskit/motion/durations';
@@ -83,11 +83,13 @@ const ResizeButton = ({
83
83
  "data-testid": testId // Prevents focus staying attached to the button
84
84
  // when pressed
85
85
  ,
86
- onMouseDown: preventDefault
86
+ onMouseDown: preventDefault // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
87
+
87
88
  }, props), jsx(ChevronRight, {
88
89
  label: ""
89
90
  }), jsx("div", {
90
91
  css: increaseHitAreaStyles
91
- }));
92
+ })); // eslint-disable-next-line @repo/internal/react/require-jsdoc
93
+
92
94
 
93
95
  export default ResizeButton;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { easeOut } from '@atlaskit/motion';
4
4
  import { useIsSidebarDragging } from '../../common/hooks';
5
5
  const colorStops = `
@@ -38,6 +38,7 @@ const Shadow = ({
38
38
  "data-testid": testId,
39
39
  css: [shadowStyles, isDragging && draggingStyles]
40
40
  });
41
- };
41
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
42
+
42
43
 
43
44
  export default Shadow;
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
2
2
 
3
3
  /** @jsx jsx */
4
- import { css, jsx } from '@emotion/core';
4
+ import { css, jsx } from '@emotion/react';
5
5
  import { easeOut, prefersReducedMotion } from '@atlaskit/motion';
6
6
  import { N30A, N60A } from '@atlaskit/theme/colors';
7
7
  import { PAGE_LAYOUT_CONTAINER_SELECTOR } from '../../common/constants';
@@ -50,7 +50,8 @@ const assignIndex = (num, arr) => {
50
50
  }
51
51
 
52
52
  return assignIndex(num + 1, arr);
53
- };
53
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
54
+
54
55
 
55
56
  export const SkipLinkWrapper = ({
56
57
  skipLinksLabel
@@ -144,7 +145,8 @@ const focusTargetRef = href => event => {
144
145
  }
145
146
 
146
147
  return false;
147
- };
148
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
149
+
148
150
 
149
151
  export const SkipLink = ({
150
152
  href,
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { useEffect } from 'react';
5
- import { css, jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { BANNER, BANNER_HEIGHT, DEFAULT_BANNER_HEIGHT, LEFT_PANEL_WIDTH, RIGHT_PANEL_WIDTH, VAR_BANNER_HEIGHT } from '../../common/constants';
7
7
  import { getPageLayoutSlotSelector, resolveDimension } from '../../common/utils';
8
8
  import { publishGridState, useSkipLink } from '../../controllers';
@@ -19,6 +19,14 @@ const bannerFixedStyles = css({
19
19
  right: RIGHT_PANEL_WIDTH,
20
20
  left: LEFT_PANEL_WIDTH
21
21
  });
22
+ /**
23
+ * __Banner__
24
+ *
25
+ * Provides a slot for a Banner within the PageLayout.
26
+ *
27
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
28
+ * - [Code](https://atlassian.design/components/page-layout/code)
29
+ */
22
30
 
23
31
  const Banner = props => {
24
32
  const {
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { CONTENT } from '../../common/constants';
4
4
  const contentStyles = css({
5
5
  display: 'flex',
@@ -7,6 +7,14 @@ const contentStyles = css({
7
7
  position: 'relative',
8
8
  gridArea: CONTENT
9
9
  });
10
+ /**
11
+ * __Content__
12
+ *
13
+ * Provides a slot for your application content within the PageLayout.
14
+ *
15
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
16
+ * - [Code](https://atlassian.design/components/page-layout/code)
17
+ */
10
18
 
11
19
  const Content = props => {
12
20
  const {
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { easeOut, prefersReducedMotion } from '@atlaskit/motion';
4
4
  import { BANNER_HEIGHT, LEFT_PANEL_WIDTH, LEFT_SIDEBAR_FLYOUT_WIDTH, LEFT_SIDEBAR_WIDTH, TOP_NAVIGATION_HEIGHT, TRANSITION_DURATION } from '../../../common/constants';
5
5
  import { useIsSidebarDragging } from '../../../common/hooks';
@@ -47,6 +47,7 @@ const LeftSidebarInner = ({
47
47
  return jsx("div", {
48
48
  css: [!isFixed && staticInnerStyles, isFixed && fixedInnerStyles, isFixed && isFlyoutOpen && fixedInnerFlyoutStyles, isDragging && draggingStyles, prefersReducedMotionStyles]
49
49
  }, children);
50
- };
50
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
51
+
51
52
 
52
53
  export default LeftSidebarInner;
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { forwardRef } from 'react';
5
- import { css, jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { easeOut, prefersReducedMotion } from '@atlaskit/motion';
7
7
  import { COLLAPSED_LEFT_SIDEBAR_WIDTH, LEFT_SIDEBAR_FLYOUT_WIDTH, LEFT_SIDEBAR_WIDTH, TRANSITION_DURATION } from '../../../common/constants';
8
8
  import { useIsSidebarDragging } from '../../../common/hooks';
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { prefersReducedMotion } from '@atlaskit/motion';
4
4
  import { TRANSITION_DURATION } from '../../../common/constants';
5
5
  import { useIsSidebarCollapsing } from '../../../common/hooks';
@@ -44,6 +44,7 @@ const ResizableChildrenWrapper = ({
44
44
  }, jsx("div", {
45
45
  css: fixedChildrenWrapperStyles
46
46
  }, children));
47
- };
47
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
48
+
48
49
 
49
50
  export default ResizableChildrenWrapper;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { ClassNames, css, jsx } from '@emotion/core';
2
+ import { ClassNames, css, jsx } from '@emotion/react';
3
3
  import { B100 } from '@atlaskit/theme/colors';
4
4
  const focusStyles = css({
5
5
  ':focus': {
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { useEffect } from 'react';
5
- import { css, jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { DEFAULT_LEFT_PANEL_WIDTH, LEFT_PANEL, LEFT_PANEL_WIDTH, VAR_LEFT_PANEL_WIDTH } from '../../common/constants';
7
7
  import { getPageLayoutSlotSelector, resolveDimension } from '../../common/utils';
8
8
  import { publishGridState, useSkipLink } from '../../controllers';
@@ -18,6 +18,14 @@ const leftPanelFixedStyles = css({
18
18
  bottom: 0,
19
19
  left: 0
20
20
  });
21
+ /**
22
+ * __Left panel__
23
+ *
24
+ * Provides a slot for a left panel within the PageLayout.
25
+ *
26
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
27
+ * - [Code](https://atlassian.design/components/page-layout/code)
28
+ */
21
29
 
22
30
  const LeftPanel = props => {
23
31
  const {
@@ -1,12 +1,20 @@
1
1
  /** @jsx jsx */
2
2
  import { useEffect } from 'react';
3
- import { jsx } from '@emotion/core';
3
+ import { jsx } from '@emotion/react';
4
4
  import { VAR_LEFT_SIDEBAR_WIDTH } from '../../common/constants';
5
5
  import { resolveDimension } from '../../common/utils';
6
6
  import { publishGridState, useSkipLink } from '../../controllers';
7
7
  import LeftSidebarInner from './internal/left-sidebar-inner';
8
8
  import LeftSidebarOuter from './internal/left-sidebar-outer';
9
9
  import SlotDimensions from './slot-dimensions';
10
+ /**
11
+ * __Left sidebar without resize__
12
+ *
13
+ * Provides a slot for a left sidebar without resize within the PageLayout.
14
+ *
15
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
16
+ * - [Code](https://atlassian.design/components/page-layout/code)
17
+ */
10
18
 
11
19
  const LeftSidebarWithoutResize = props => {
12
20
  const {
@@ -2,7 +2,7 @@
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { useContext, useEffect, useRef } from 'react';
5
- import { jsx } from '@emotion/core';
5
+ import { jsx } from '@emotion/react';
6
6
  import { COLLAPSED_LEFT_SIDEBAR_WIDTH, DEFAULT_LEFT_SIDEBAR_WIDTH, FLYOUT_DELAY, RESIZE_BUTTON_SELECTOR, VAR_LEFT_SIDEBAR_FLYOUT, VAR_LEFT_SIDEBAR_WIDTH } from '../../common/constants';
7
7
  import { getGridStateFromStorage, mergeGridStateIntoStorage, resolveDimension } from '../../common/utils';
8
8
  import { publishGridState, SidebarResizeContext, useSkipLink } from '../../controllers';
@@ -11,6 +11,14 @@ import LeftSidebarInner from './internal/left-sidebar-inner';
11
11
  import LeftSidebarOuter from './internal/left-sidebar-outer';
12
12
  import ResizableChildrenWrapper from './internal/resizable-children-wrapper';
13
13
  import SlotDimensions from './slot-dimensions';
14
+ /**
15
+ * __Left sidebar__
16
+ *
17
+ * Provides a slot for a left sidebar within the PageLayout.
18
+ *
19
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
20
+ * - [Code](https://atlassian.design/components/page-layout/code)
21
+ */
14
22
 
15
23
  const LeftSidebar = props => {
16
24
  const {
@@ -226,7 +234,8 @@ const LeftSidebar = props => {
226
234
  }, children), jsx(ResizeControl, {
227
235
  testId: testId,
228
236
  resizeGrabAreaLabel: resizeGrabAreaLabel,
229
- resizeButtonLabel: resizeButtonLabel,
237
+ resizeButtonLabel: resizeButtonLabel // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
238
+ ,
230
239
  overrides: overrides,
231
240
  onCollapse: onCollapse,
232
241
  onExpand: onExpand,
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { useContext } from 'react';
5
- import { css, jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { prefersReducedMotion } from '@atlaskit/motion/accessibility';
7
7
  import { easeOut } from '@atlaskit/motion/curves';
8
8
  import { COLLAPSED_LEFT_SIDEBAR_WIDTH, DEFAULT_LEFT_SIDEBAR_FLYOUT_WIDTH, TRANSITION_DURATION, VAR_LEFT_SIDEBAR_FLYOUT } from '../../common/constants';
@@ -35,6 +35,14 @@ const draggingStyles = css({
35
35
  const flyoutStyles = css({
36
36
  marginLeft: `calc(-1 * var(--${VAR_LEFT_SIDEBAR_FLYOUT}, ${DEFAULT_LEFT_SIDEBAR_FLYOUT_WIDTH}px) + ${COLLAPSED_LEFT_SIDEBAR_WIDTH}px)`
37
37
  });
38
+ /**
39
+ * __Main__
40
+ *
41
+ * Provides a slot for main content within the PageLayout.
42
+ *
43
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
44
+ * - [Code](https://atlassian.design/components/page-layout/code)
45
+ */
38
46
 
39
47
  const Main = props => {
40
48
  const {
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { Fragment } from 'react';
5
- import { css, jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { BANNER, BANNER_HEIGHT, CONTENT, DEFAULT_I18N_PROPS_SKIP_LINKS, LEFT_PANEL, LEFT_PANEL_WIDTH, PAGE_LAYOUT_CONTAINER_SELECTOR, RIGHT_PANEL, RIGHT_PANEL_WIDTH, TOP_NAVIGATION, TOP_NAVIGATION_HEIGHT } from '../../common/constants';
7
7
  import { SidebarResizeController, SkipLinksController } from '../../controllers';
8
8
  import { SkipLinkWrapper } from '../skip-links';
@@ -22,6 +22,14 @@ const gridStyles = css({
22
22
  gridTemplateRows: `${BANNER_HEIGHT} ${TOP_NAVIGATION_HEIGHT} auto`,
23
23
  outline: 'none'
24
24
  });
25
+ /**
26
+ * __Page layout__
27
+ *
28
+ * A collection of components which let you compose an application's page layout.
29
+ *
30
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
31
+ * - [Code](https://atlassian.design/components/page-layout/code)
32
+ */
25
33
 
26
34
  const PageLayout = ({
27
35
  skipLinksLabel = DEFAULT_I18N_PROPS_SKIP_LINKS,
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { useEffect } from 'react';
5
- import { css, jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { DEFAULT_RIGHT_PANEL_WIDTH, RIGHT_PANEL, RIGHT_PANEL_WIDTH, VAR_RIGHT_PANEL_WIDTH } from '../../common/constants';
7
7
  import { getPageLayoutSlotSelector, resolveDimension } from '../../common/utils';
8
8
  import { publishGridState, useSkipLink } from '../../controllers';
@@ -18,6 +18,14 @@ const fixedStyles = css({
18
18
  right: 0,
19
19
  bottom: 0
20
20
  });
21
+ /**
22
+ * __Right panel__
23
+ *
24
+ * Provides a slot for a right panel within the PageLayout.
25
+ *
26
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
27
+ * - [Code](https://atlassian.design/components/page-layout/code)
28
+ */
21
29
 
22
30
  const RightPanel = props => {
23
31
  const {
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { useEffect } from 'react';
5
- import { css, jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { BANNER_HEIGHT, DEFAULT_RIGHT_SIDEBAR_WIDTH, RIGHT_PANEL_WIDTH, RIGHT_SIDEBAR_WIDTH, TOP_NAVIGATION_HEIGHT, VAR_RIGHT_SIDEBAR_WIDTH } from '../../common/constants';
7
7
  import { getPageLayoutSlotSelector, resolveDimension } from '../../common/utils';
8
8
  import { publishGridState, useSkipLink } from '../../controllers';
@@ -45,6 +45,14 @@ const fixedOuterStyles = css({
45
45
  content: "''"
46
46
  }
47
47
  });
48
+ /**
49
+ * __Right sidebar__
50
+ *
51
+ * Provides a slot for a right sidebar within the PageLayout.
52
+ *
53
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
54
+ * - [Code](https://atlassian.design/components/page-layout/code)
55
+ */
48
56
 
49
57
  const RightSidebar = props => {
50
58
  const {
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { useEffect } from 'react';
5
- import { css, jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { BANNER_HEIGHT, DEFAULT_TOP_NAVIGATION_HEIGHT, LEFT_PANEL_WIDTH, RIGHT_PANEL_WIDTH, TOP_NAVIGATION, TOP_NAVIGATION_HEIGHT, VAR_TOP_NAVIGATION_HEIGHT } from '../../common/constants';
7
7
  import { getPageLayoutSlotSelector, resolveDimension } from '../../common/utils';
8
8
  import { publishGridState, useSkipLink } from '../../controllers';
@@ -19,6 +19,14 @@ const fixedStyles = css({
19
19
  right: RIGHT_PANEL_WIDTH,
20
20
  left: LEFT_PANEL_WIDTH
21
21
  });
22
+ /**
23
+ * __Top navigation__
24
+ *
25
+ * Provides a slot for top navigation within the PageLayout.
26
+ *
27
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
28
+ * - [Code](https://atlassian.design/components/page-layout/code)
29
+ */
22
30
 
23
31
  const TopNavigation = props => {
24
32
  const {
@@ -1,7 +1,5 @@
1
1
  import { createContext, useContext, useEffect } from 'react';
2
-
3
- const noop = () => {};
4
-
2
+ import noop from '@atlaskit/ds-lib/noop';
5
3
  const leftSidebarState = {
6
4
  isFlyoutOpen: false,
7
5
  isResizing: false,
@@ -10,7 +8,8 @@ const leftSidebarState = {
10
8
  lastLeftSidebarWidth: 0,
11
9
  flyoutLockCount: 0,
12
10
  isFixed: true
13
- };
11
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
12
+
14
13
  export const SidebarResizeContext = /*#__PURE__*/createContext({
15
14
  isLeftSidebarCollapsed: false,
16
15
  expandLeftSidebar: noop,
@@ -26,7 +25,7 @@ export const usePageLayoutResize = () => {
26
25
  return context;
27
26
  };
28
27
  /**
29
- * **WARNING:** This hook is intended as a temporary solution and
28
+ * _**WARNING:**_ This hook is intended as a temporary solution and
30
29
  * is likely to be removed in a future version of page-layout.
31
30
  *
32
31
  * ---
@@ -1,15 +1,15 @@
1
1
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
+ import noop from '@atlaskit/ds-lib/noop';
2
3
  import { isReducedMotion } from '@atlaskit/motion';
3
4
  import { COLLAPSED_LEFT_SIDEBAR_WIDTH, DEFAULT_LEFT_SIDEBAR_WIDTH, GRAB_AREA_SELECTOR, IS_SIDEBAR_COLLAPSING } from '../common/constants';
4
5
  import { getPageLayoutSlotCSSSelector } from '../common/utils';
5
6
  import { SidebarResizeContext } from './sidebar-resize-context';
6
7
 
7
- const noop = () => {};
8
-
9
8
  const handleDataAttributesAndCb = (callback = noop, isLeftSidebarCollapsed, leftSidebarState) => {
10
9
  document.documentElement.removeAttribute(IS_SIDEBAR_COLLAPSING);
11
10
  callback(leftSidebarState);
12
- };
11
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
12
+
13
13
 
14
14
  export const SidebarResizeController = ({
15
15
  children,
@@ -1,7 +1,6 @@
1
1
  import { createContext, useContext, useEffect } from 'react';
2
-
3
- const noop = () => {};
4
-
2
+ import noop from '@atlaskit/ds-lib/noop';
3
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
5
4
  export const SkipLinksContext = /*#__PURE__*/createContext({
6
5
  skipLinksData: [],
7
6
  registerSkipLink: noop,
@@ -26,7 +26,8 @@ const byDOMOrder = (a, b) => {
26
26
  }
27
27
 
28
28
  return indexA - indexB;
29
- };
29
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
30
+
30
31
 
31
32
  export const SkipLinksController = ({
32
33
  children
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/page-layout",
3
- "version": "1.2.6",
3
+ "version": "1.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -4,6 +4,7 @@
4
4
  var isLocalStorageSupported = function isLocalStorageSupported() {
5
5
  try {
6
6
  // use an random key to test
7
+ // eslint-disable-next-line @repo/internal/react/disallow-unstable-values
7
8
  var testKey = "__test_".concat(Date.now(), "__");
8
9
  localStorage.setItem(testKey, testKey);
9
10
  localStorage.removeItem(testKey);
@@ -4,7 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  var _excluded = ["testId", "isLeftSidebarCollapsed"];
5
5
 
6
6
  /** @jsx jsx */
7
- import { css, jsx } from '@emotion/core';
7
+ import { css, jsx } from '@emotion/react';
8
8
  import { B100, B200 } from '@atlaskit/theme/colors';
9
9
  import { GRAB_AREA_LINE_SELECTOR, GRAB_AREA_SELECTOR } from '../../common/constants';
10
10
 
@@ -59,10 +59,12 @@ var GrabArea = function GrabArea(_ref) {
59
59
  return jsx("button", _extends({}, grabAreaSelector, {
60
60
  "data-testid": testId,
61
61
  type: "button",
62
- css: [grabAreaStyles, isLeftSidebarCollapsed && grabAreaCollapsedStyles]
62
+ css: [grabAreaStyles, isLeftSidebarCollapsed && grabAreaCollapsedStyles] // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
63
+
63
64
  }, rest), jsx("span", _extends({
64
65
  css: lineStyles
65
66
  }, grabAreaLineSelector)));
66
- };
67
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
68
+
67
69
 
68
70
  export default GrabArea;
@@ -8,7 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
8
8
 
9
9
  /** @jsx jsx */
10
10
  import { useCallback, useContext, useMemo, useRef, useState } from 'react';
11
- import { css, jsx } from '@emotion/core';
11
+ import { css, jsx } from '@emotion/react';
12
12
  import { bindAll } from 'bind-event-listener';
13
13
  import rafSchd from 'raf-schd';
14
14
  import { COLLAPSED_LEFT_SIDEBAR_WIDTH, DEFAULT_LEFT_SIDEBAR_WIDTH, IS_SIDEBAR_DRAGGING, MIN_LEFT_SIDEBAR_DRAG_THRESHOLD, RESIZE_BUTTON_SELECTOR, RESIZE_CONTROL_SELECTOR, VAR_LEFT_SIDEBAR_WIDTH } from '../../common/constants';
@@ -286,6 +286,7 @@ var ResizeControl = function ResizeControl(_ref) {
286
286
  testId: testId && "".concat(testId, "-resize-button")
287
287
  }));
288
288
  /* eslint-enable jsx-a11y/role-supports-aria-props */
289
- };
289
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
290
+
290
291
 
291
292
  export default ResizeControl;