@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
@@ -4,7 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  var _excluded = ["isLeftSidebarCollapsed", "label", "testId"];
5
5
 
6
6
  /** @jsx jsx */
7
- import { css, jsx } from '@emotion/core';
7
+ import { css, jsx } from '@emotion/react';
8
8
  import ChevronRight from '@atlaskit/icon/glyph/chevron-right';
9
9
  import { easeOut } from '@atlaskit/motion/curves';
10
10
  import { mediumDurationMs, smallDurationMs } from '@atlaskit/motion/durations';
@@ -83,12 +83,14 @@ var ResizeButton = function ResizeButton(_ref) {
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
  }));
92
- };
93
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
94
+
93
95
 
94
96
  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
  var colorStops = "\n rgba(0, 0, 0, 0.2) 0px,\n rgba(0, 0, 0, 0.2) 1px,\n rgba(0, 0, 0, 0.1) 1px,\n rgba(0, 0, 0, 0) 100%\n ";
@@ -32,6 +32,7 @@ var Shadow = function Shadow(_ref) {
32
32
  "data-testid": testId,
33
33
  css: [shadowStyles, isDragging && draggingStyles]
34
34
  });
35
- };
35
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
36
+
36
37
 
37
38
  export default Shadow;
@@ -8,7 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
8
8
  /* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
9
9
 
10
10
  /** @jsx jsx */
11
- import { css, jsx } from '@emotion/core';
11
+ import { css, jsx } from '@emotion/react';
12
12
  import { easeOut, prefersReducedMotion } from '@atlaskit/motion';
13
13
  import { N30A, N60A } from '@atlaskit/theme/colors';
14
14
  import { PAGE_LAYOUT_CONTAINER_SELECTOR } from '../../common/constants';
@@ -57,7 +57,8 @@ var assignIndex = function assignIndex(num, arr) {
57
57
  }
58
58
 
59
59
  return assignIndex(num + 1, arr);
60
- };
60
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
61
+
61
62
 
62
63
  export var SkipLinkWrapper = function SkipLinkWrapper(_ref) {
63
64
  var skipLinksLabel = _ref.skipLinksLabel;
@@ -165,7 +166,8 @@ var focusTargetRef = function focusTargetRef(href) {
165
166
 
166
167
  return false;
167
168
  };
168
- };
169
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
170
+
169
171
 
170
172
  export var SkipLink = function SkipLink(_ref3) {
171
173
  var href = _ref3.href,
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
 
4
4
  /** @jsx jsx */
5
5
  import { useEffect } from 'react';
6
- import { css, jsx } from '@emotion/core';
6
+ import { css, jsx } from '@emotion/react';
7
7
  import { BANNER, BANNER_HEIGHT, DEFAULT_BANNER_HEIGHT, LEFT_PANEL_WIDTH, RIGHT_PANEL_WIDTH, VAR_BANNER_HEIGHT } from '../../common/constants';
8
8
  import { getPageLayoutSlotSelector, resolveDimension } from '../../common/utils';
9
9
  import { publishGridState, useSkipLink } from '../../controllers';
@@ -20,6 +20,14 @@ var bannerFixedStyles = css({
20
20
  right: RIGHT_PANEL_WIDTH,
21
21
  left: LEFT_PANEL_WIDTH
22
22
  });
23
+ /**
24
+ * __Banner__
25
+ *
26
+ * Provides a slot for a Banner within the PageLayout.
27
+ *
28
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
29
+ * - [Code](https://atlassian.design/components/page-layout/code)
30
+ */
23
31
 
24
32
  var Banner = function Banner(props) {
25
33
  var children = props.children,
@@ -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
  var contentStyles = css({
5
5
  display: 'flex',
@@ -7,6 +7,14 @@ var 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
  var Content = function Content(props) {
12
20
  var children = props.children,
@@ -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';
@@ -48,6 +48,7 @@ var LeftSidebarInner = function LeftSidebarInner(_ref) {
48
48
  return jsx("div", {
49
49
  css: [!isFixed && staticInnerStyles, isFixed && fixedInnerStyles, isFixed && isFlyoutOpen && fixedInnerFlyoutStyles, isDragging && draggingStyles, prefersReducedMotionStyles]
50
50
  }, children);
51
- };
51
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
52
+
52
53
 
53
54
  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';
@@ -46,6 +46,7 @@ var ResizableChildrenWrapper = function ResizableChildrenWrapper(_ref) {
46
46
  }, jsx("div", {
47
47
  css: fixedChildrenWrapperStyles
48
48
  }, children));
49
- };
49
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
50
+
50
51
 
51
52
  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
  var focusStyles = css({
5
5
  ':focus': {
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
 
4
4
  /** @jsx jsx */
5
5
  import { useEffect } from 'react';
6
- import { css, jsx } from '@emotion/core';
6
+ import { css, jsx } from '@emotion/react';
7
7
  import { DEFAULT_LEFT_PANEL_WIDTH, LEFT_PANEL, LEFT_PANEL_WIDTH, VAR_LEFT_PANEL_WIDTH } from '../../common/constants';
8
8
  import { getPageLayoutSlotSelector, resolveDimension } from '../../common/utils';
9
9
  import { publishGridState, useSkipLink } from '../../controllers';
@@ -19,6 +19,14 @@ var leftPanelFixedStyles = css({
19
19
  bottom: 0,
20
20
  left: 0
21
21
  });
22
+ /**
23
+ * __Left panel__
24
+ *
25
+ * Provides a slot for a left panel 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
  var LeftPanel = function LeftPanel(props) {
24
32
  var children = props.children,
@@ -2,13 +2,21 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { useEffect } from 'react';
5
- import { jsx } from '@emotion/core';
5
+ import { jsx } from '@emotion/react';
6
6
  import { VAR_LEFT_SIDEBAR_WIDTH } from '../../common/constants';
7
7
  import { resolveDimension } from '../../common/utils';
8
8
  import { publishGridState, useSkipLink } from '../../controllers';
9
9
  import LeftSidebarInner from './internal/left-sidebar-inner';
10
10
  import LeftSidebarOuter from './internal/left-sidebar-outer';
11
11
  import SlotDimensions from './slot-dimensions';
12
+ /**
13
+ * __Left sidebar without resize__
14
+ *
15
+ * Provides a slot for a left sidebar without resize within the PageLayout.
16
+ *
17
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
18
+ * - [Code](https://atlassian.design/components/page-layout/code)
19
+ */
12
20
 
13
21
  var LeftSidebarWithoutResize = function LeftSidebarWithoutResize(props) {
14
22
  var children = props.children,
@@ -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 { useContext, useEffect, useRef } from 'react';
11
- import { jsx } from '@emotion/core';
11
+ import { jsx } from '@emotion/react';
12
12
  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';
13
13
  import { getGridStateFromStorage, mergeGridStateIntoStorage, resolveDimension } from '../../common/utils';
14
14
  import { publishGridState, SidebarResizeContext, useSkipLink } from '../../controllers';
@@ -17,6 +17,14 @@ import LeftSidebarInner from './internal/left-sidebar-inner';
17
17
  import LeftSidebarOuter from './internal/left-sidebar-outer';
18
18
  import ResizableChildrenWrapper from './internal/resizable-children-wrapper';
19
19
  import SlotDimensions from './slot-dimensions';
20
+ /**
21
+ * __Left sidebar__
22
+ *
23
+ * Provides a slot for a left sidebar within the PageLayout.
24
+ *
25
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
26
+ * - [Code](https://atlassian.design/components/page-layout/code)
27
+ */
20
28
 
21
29
  var LeftSidebar = function LeftSidebar(props) {
22
30
  var children = props.children,
@@ -235,7 +243,8 @@ var LeftSidebar = function LeftSidebar(props) {
235
243
  }, children), jsx(ResizeControl, {
236
244
  testId: testId,
237
245
  resizeGrabAreaLabel: resizeGrabAreaLabel,
238
- resizeButtonLabel: resizeButtonLabel,
246
+ resizeButtonLabel: resizeButtonLabel // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
247
+ ,
239
248
  overrides: overrides,
240
249
  onCollapse: onCollapse,
241
250
  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 @@ var draggingStyles = css({
35
35
  var flyoutStyles = css({
36
36
  marginLeft: "calc(-1 * var(--".concat(VAR_LEFT_SIDEBAR_FLYOUT, ", ").concat(DEFAULT_LEFT_SIDEBAR_FLYOUT_WIDTH, "px) + ").concat(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
  var Main = function Main(props) {
40
48
  var children = props.children,
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
 
4
4
  /** @jsx jsx */
5
5
  import { Fragment } from 'react';
6
- import { css, jsx } from '@emotion/core';
6
+ import { css, jsx } from '@emotion/react';
7
7
  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';
8
8
  import { SidebarResizeController, SkipLinksController } from '../../controllers';
9
9
  import { SkipLinkWrapper } from '../skip-links';
@@ -19,6 +19,14 @@ var gridStyles = css({
19
19
  gridTemplateRows: "".concat(BANNER_HEIGHT, " ").concat(TOP_NAVIGATION_HEIGHT, " auto"),
20
20
  outline: 'none'
21
21
  });
22
+ /**
23
+ * __Page layout__
24
+ *
25
+ * A collection of components which let you compose an application's page layout.
26
+ *
27
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
28
+ * - [Code](https://atlassian.design/components/page-layout/code)
29
+ */
22
30
 
23
31
  var PageLayout = function PageLayout(_ref) {
24
32
  var _ref$skipLinksLabel = _ref.skipLinksLabel,
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
 
4
4
  /** @jsx jsx */
5
5
  import { useEffect } from 'react';
6
- import { css, jsx } from '@emotion/core';
6
+ import { css, jsx } from '@emotion/react';
7
7
  import { DEFAULT_RIGHT_PANEL_WIDTH, RIGHT_PANEL, RIGHT_PANEL_WIDTH, VAR_RIGHT_PANEL_WIDTH } from '../../common/constants';
8
8
  import { getPageLayoutSlotSelector, resolveDimension } from '../../common/utils';
9
9
  import { publishGridState, useSkipLink } from '../../controllers';
@@ -19,6 +19,14 @@ var fixedStyles = css({
19
19
  right: 0,
20
20
  bottom: 0
21
21
  });
22
+ /**
23
+ * __Right panel__
24
+ *
25
+ * Provides a slot for a right panel 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
  var RightPanel = function RightPanel(props) {
24
32
  var children = props.children,
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
 
4
4
  /** @jsx jsx */
5
5
  import { useEffect } from 'react';
6
- import { css, jsx } from '@emotion/core';
6
+ import { css, jsx } from '@emotion/react';
7
7
  import { BANNER_HEIGHT, DEFAULT_RIGHT_SIDEBAR_WIDTH, RIGHT_PANEL_WIDTH, RIGHT_SIDEBAR_WIDTH, TOP_NAVIGATION_HEIGHT, VAR_RIGHT_SIDEBAR_WIDTH } from '../../common/constants';
8
8
  import { getPageLayoutSlotSelector, resolveDimension } from '../../common/utils';
9
9
  import { publishGridState, useSkipLink } from '../../controllers';
@@ -46,6 +46,14 @@ var fixedOuterStyles = css({
46
46
  content: "''"
47
47
  }
48
48
  });
49
+ /**
50
+ * __Right sidebar__
51
+ *
52
+ * Provides a slot for a right sidebar within the PageLayout.
53
+ *
54
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
55
+ * - [Code](https://atlassian.design/components/page-layout/code)
56
+ */
49
57
 
50
58
  var RightSidebar = function RightSidebar(props) {
51
59
  var children = props.children,
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
 
4
4
  /** @jsx jsx */
5
5
  import { useEffect } from 'react';
6
- import { css, jsx } from '@emotion/core';
6
+ import { css, jsx } from '@emotion/react';
7
7
  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';
8
8
  import { getPageLayoutSlotSelector, resolveDimension } from '../../common/utils';
9
9
  import { publishGridState, useSkipLink } from '../../controllers';
@@ -20,6 +20,14 @@ var fixedStyles = css({
20
20
  right: RIGHT_PANEL_WIDTH,
21
21
  left: LEFT_PANEL_WIDTH
22
22
  });
23
+ /**
24
+ * __Top navigation__
25
+ *
26
+ * Provides a slot for top navigation within the PageLayout.
27
+ *
28
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
29
+ * - [Code](https://atlassian.design/components/page-layout/code)
30
+ */
23
31
 
24
32
  var TopNavigation = function TopNavigation(props) {
25
33
  var children = props.children,
@@ -7,9 +7,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
7
7
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
8
 
9
9
  import { createContext, useContext, useEffect } from 'react';
10
-
11
- var noop = function noop() {};
12
-
10
+ import noop from '@atlaskit/ds-lib/noop';
13
11
  var leftSidebarState = {
14
12
  isFlyoutOpen: false,
15
13
  isResizing: false,
@@ -18,7 +16,8 @@ var leftSidebarState = {
18
16
  lastLeftSidebarWidth: 0,
19
17
  flyoutLockCount: 0,
20
18
  isFixed: true
21
- };
19
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
20
+
22
21
  export var SidebarResizeContext = /*#__PURE__*/createContext({
23
22
  isLeftSidebarCollapsed: false,
24
23
  expandLeftSidebar: noop,
@@ -34,7 +33,7 @@ export var usePageLayoutResize = function usePageLayoutResize() {
34
33
  return context;
35
34
  };
36
35
  /**
37
- * **WARNING:** This hook is intended as a temporary solution and
36
+ * _**WARNING:**_ This hook is intended as a temporary solution and
38
37
  * is likely to be removed in a future version of page-layout.
39
38
  *
40
39
  * ---
@@ -1,19 +1,19 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
3
+ import noop from '@atlaskit/ds-lib/noop';
3
4
  import { isReducedMotion } from '@atlaskit/motion';
4
5
  import { COLLAPSED_LEFT_SIDEBAR_WIDTH, DEFAULT_LEFT_SIDEBAR_WIDTH, GRAB_AREA_SELECTOR, IS_SIDEBAR_COLLAPSING } from '../common/constants';
5
6
  import { getPageLayoutSlotCSSSelector } from '../common/utils';
6
7
  import { SidebarResizeContext } from './sidebar-resize-context';
7
8
 
8
- var noop = function noop() {};
9
-
10
9
  var handleDataAttributesAndCb = function handleDataAttributesAndCb() {
11
10
  var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;
12
11
  var isLeftSidebarCollapsed = arguments.length > 1 ? arguments[1] : undefined;
13
12
  var leftSidebarState = arguments.length > 2 ? arguments[2] : undefined;
14
13
  document.documentElement.removeAttribute(IS_SIDEBAR_COLLAPSING);
15
14
  callback(leftSidebarState);
16
- };
15
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
16
+
17
17
 
18
18
  export var SidebarResizeController = function SidebarResizeController(_ref) {
19
19
  var children = _ref.children,
@@ -1,7 +1,6 @@
1
1
  import { createContext, useContext, useEffect } from 'react';
2
-
3
- var noop = function noop() {};
4
-
2
+ import noop from '@atlaskit/ds-lib/noop';
3
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
5
4
  export var SkipLinksContext = /*#__PURE__*/createContext({
6
5
  skipLinksData: [],
7
6
  registerSkipLink: noop,
@@ -28,7 +28,8 @@ var byDOMOrder = function byDOMOrder(a, b) {
28
28
  }
29
29
 
30
30
  return indexA - indexB;
31
- };
31
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
32
+
32
33
 
33
34
  export var SkipLinksController = function SkipLinksController(_ref) {
34
35
  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
  }
@@ -2,27 +2,39 @@ import { ElementType, ReactElement, ReactNode } from 'react';
2
2
  import { ResizeButtonProps } from '../components/resize-control/types';
3
3
  import { LeftSidebarState } from '../controllers/sidebar-resize-context';
4
4
  interface SlotProps {
5
- /** Sets positon to fixed. */
5
+ /**
6
+ * Sets positon to fixed.
7
+ */
6
8
  isFixed?: boolean;
7
9
  /**
8
10
  * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests .
9
11
  */
10
12
  testId?: string;
11
- /** React Children! */
13
+ /**
14
+ * React Children!
15
+ */
12
16
  children: ReactNode;
13
17
  id?: string;
14
18
  skipLinkTitle?: string;
15
19
  }
16
20
  export interface SlotHeightProps extends SlotProps {
17
- /** It save height in local storage. */
21
+ /**
22
+ * It save height in local storage.
23
+ */
18
24
  shouldPersistHeight?: boolean;
19
- /** Height! */
25
+ /**
26
+ * Height!
27
+ */
20
28
  height?: number;
21
29
  }
22
30
  export interface SlotWidthProps extends SlotProps {
23
- /** It save width in local storage. */
31
+ /**
32
+ * It save width in local storage.
33
+ */
24
34
  shouldPersistWidth?: boolean;
25
- /** Width! */
35
+ /**
36
+ * Width!
37
+ */
26
38
  width?: number;
27
39
  }
28
40
  export interface LeftSidebarProps extends SlotWidthProps {
@@ -30,48 +42,76 @@ export interface LeftSidebarProps extends SlotWidthProps {
30
42
  * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
31
43
  */
32
44
  testId?: string;
33
- /** You can override prop(s) for the mentioned component(s). */
45
+ /**
46
+ * You can override prop(s) for the mentioned component(s).
47
+ */
34
48
  overrides?: {
35
49
  ResizeButton?: {
36
50
  render?: (Component: ElementType<ResizeButtonProps>, props: ResizeButtonProps) => ReactElement;
37
51
  };
38
52
  };
39
- /** Display label for grab area. This will be announced to the screenreaders when the grab area receives focus */
53
+ /**
54
+ * Display label for grab area. This will be announced to the screenreaders when the grab area receives focus
55
+ */
40
56
  resizeGrabAreaLabel?: string;
41
- /** Display label for resize button. */
57
+ /**
58
+ * Display label for resize button.
59
+ */
42
60
  resizeButtonLabel?: string;
43
- /** Called when left-sidebar is collapsed. */
61
+ /**
62
+ * Called when left-sidebar is collapsed.
63
+ */
44
64
  onCollapse?: () => void;
45
- /** Called when left-sidebar is expanded. */
65
+ /**
66
+ * Called when left-sidebar is expanded.
67
+ */
46
68
  onExpand?: () => void;
47
- /** Called when left-sidebar resize starts using mouse or touch. */
69
+ /**
70
+ * Called when left-sidebar resize starts using mouse or touch.
71
+ */
48
72
  onResizeStart?: (leftSidebarState: LeftSidebarState) => void;
49
- /** Called when left-sidebar resize ends using mouse or touch. */
73
+ /**
74
+ * Called when left-sidebar resize ends using mouse or touch.
75
+ */
50
76
  onResizeEnd?: (leftSidebarState: LeftSidebarState) => void;
51
- /** Called when left-sidebar is collapsed and mouse leaves the area. */
77
+ /**
78
+ * Called when left-sidebar is collapsed and mouse leaves the area.
79
+ */
52
80
  onFlyoutCollapse?: () => void;
53
- /** Called after flyout delay when left-sidebar is collapsed and mouse enters the area. */
81
+ /**
82
+ * Called after flyout delay when left-sidebar is collapsed and mouse enters the area.
83
+ */
54
84
  onFlyoutExpand?: () => void;
55
- /** Controls whether the LeftSidebar mounts in a collapsed state, this will override the setting in localStorage */
85
+ /**
86
+ * Controls whether the LeftSidebar mounts in a collapsed state, this will override the setting in localStorage
87
+ */
56
88
  collapsedState?: 'collapsed' | 'expanded';
57
- /** Controls the width when LeftSidebar mounts, this will override the setting in localStorage */
89
+ /**
90
+ * Controls the width when LeftSidebar mounts, this will override the setting in localStorage
91
+ */
58
92
  width?: number;
59
93
  }
60
94
  export declare type SidebarResizeControllerProps = {
61
- /** Called when left-sidebar expanded. */
95
+ /**
96
+ * Called when left-sidebar expanded.
97
+ */
62
98
  onLeftSidebarExpand?: (leftSidebarState: LeftSidebarState) => void;
63
- /** Called when left-sidebar collapsed. */
99
+ /**
100
+ * Called when left-sidebar collapsed.
101
+ */
64
102
  onLeftSidebarCollapse?: (leftSidebarState: LeftSidebarState) => void;
65
103
  };
66
104
  export declare type DimensionNames = 'leftPanelWidth' | 'bannerHeight' | 'topNavigationHeight' | 'leftSidebarWidth' | 'leftSidebarFlyoutWidth' | 'rightSidebarWidth' | 'rightPanelWidth';
67
105
  export declare type Dimensions = Partial<Record<DimensionNames, number>>;
68
106
  export interface PageLayoutProps extends SidebarResizeControllerProps {
69
- /** React children! */
107
+ /**
108
+ * React children!
109
+ */
70
110
  children: ReactNode;
71
111
  skipLinksLabel?: string;
72
112
  /**
73
113
  * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
74
- **/
114
+ */
75
115
  testId?: string;
76
116
  }
77
117
  export type { LeftSidebarState } from '../controllers/sidebar-resize-context';
@@ -1,4 +1,4 @@
1
- import { DimensionNames, Dimensions } from '../common/types';
1
+ import { DimensionNames, Dimensions } from './types';
2
2
  declare const emptyGridState: Dimensions;
3
3
  declare const mergeGridStateIntoStorage: (key: string, value: any) => void;
4
4
  declare const getGridStateFromStorage: (key: string) => any;
@@ -1,8 +1,9 @@
1
1
  /** @jsx jsx */
2
2
  import { ComponentProps } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  export declare type GrabAreaProps = {
4
5
  testId?: string;
5
6
  isLeftSidebarCollapsed: boolean;
6
7
  } & ComponentProps<'button'>;
7
- declare const GrabArea: ({ testId, isLeftSidebarCollapsed, ...rest }: GrabAreaProps) => JSX.Element;
8
+ declare const GrabArea: ({ testId, isLeftSidebarCollapsed, ...rest }: GrabAreaProps) => jsx.JSX.Element;
8
9
  export default GrabArea;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { ResizeControlProps } from './types';
3
- declare const ResizeControl: ({ testId, overrides, resizeButtonLabel, resizeGrabAreaLabel, onResizeStart, onResizeEnd, }: ResizeControlProps) => JSX.Element;
3
+ declare const ResizeControl: ({ testId, overrides, resizeButtonLabel, resizeGrabAreaLabel, onResizeStart, onResizeEnd, }: ResizeControlProps) => jsx.JSX.Element;
4
4
  export default ResizeControl;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { ResizeButtonProps } from './types';
3
- declare const ResizeButton: ({ isLeftSidebarCollapsed, label, testId, ...props }: ResizeButtonProps) => JSX.Element;
3
+ declare const ResizeButton: ({ isLeftSidebarCollapsed, label, testId, ...props }: ResizeButtonProps) => jsx.JSX.Element;
4
4
  export default ResizeButton;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
- /// <reference types="react" />
2
+ import { jsx } from '@emotion/react';
3
3
  declare const Shadow: ({ testId }: {
4
4
  testId?: string | undefined;
5
- }) => JSX.Element;
5
+ }) => jsx.JSX.Element;
6
6
  export default Shadow;