@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
@@ -1,10 +1,11 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  import { SkipLinkWrapperProps } from './types';
4
- export declare const SkipLinkWrapper: ({ skipLinksLabel }: SkipLinkWrapperProps) => JSX.Element | null;
5
+ export declare const SkipLinkWrapper: ({ skipLinksLabel }: SkipLinkWrapperProps) => jsx.JSX.Element | null;
5
6
  export declare const SkipLink: ({ href, children, isFocusable, title, }: {
6
7
  href: string;
7
8
  children: ReactNode;
8
9
  isFocusable: boolean;
9
10
  title: string;
10
- }) => JSX.Element;
11
+ }) => jsx.JSX.Element;
@@ -1,4 +1,12 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { SlotHeightProps } from '../../common/types';
3
- declare const Banner: (props: SlotHeightProps) => JSX.Element;
3
+ /**
4
+ * __Banner__
5
+ *
6
+ * Provides a slot for a Banner within the PageLayout.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
9
+ * - [Code](https://atlassian.design/components/page-layout/code)
10
+ */
11
+ declare const Banner: (props: SlotHeightProps) => jsx.JSX.Element;
4
12
  export default Banner;
@@ -1,12 +1,23 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  interface ContentProps {
4
- /** React children! */
5
+ /**
6
+ * React children
7
+ */
5
8
  children: ReactNode;
6
9
  /**
7
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.
8
- **/
11
+ */
9
12
  testId?: string;
10
13
  }
11
- declare const Content: (props: ContentProps) => JSX.Element;
14
+ /**
15
+ * __Content__
16
+ *
17
+ * Provides a slot for your application content within the PageLayout.
18
+ *
19
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
20
+ * - [Code](https://atlassian.design/components/page-layout/code)
21
+ */
22
+ declare const Content: (props: ContentProps) => jsx.JSX.Element;
12
23
  export default Content;
@@ -1,9 +1,10 @@
1
1
  /** @jsx jsx */
2
2
  import type { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  declare type LeftSidebarInnerProps = {
4
5
  children: ReactNode;
5
6
  isFixed?: boolean;
6
7
  isFlyoutOpen?: boolean;
7
8
  };
8
- declare const LeftSidebarInner: ({ children, isFixed, isFlyoutOpen, }: LeftSidebarInnerProps) => JSX.Element;
9
+ declare const LeftSidebarInner: ({ children, isFixed, isFlyoutOpen, }: LeftSidebarInnerProps) => jsx.JSX.Element;
9
10
  export default LeftSidebarInner;
@@ -1,10 +1,11 @@
1
1
  /** @jsx jsx */
2
2
  import type { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  declare type ResizableChildrenWrapperProps = {
4
5
  children: ReactNode;
5
6
  isFlyoutOpen?: boolean;
6
7
  isLeftSidebarCollapsed?: boolean;
7
8
  hasCollapsedState?: boolean;
8
9
  };
9
- declare const ResizableChildrenWrapper: ({ children, isLeftSidebarCollapsed, hasCollapsedState, isFlyoutOpen, }: ResizableChildrenWrapperProps) => JSX.Element;
10
+ declare const ResizableChildrenWrapper: ({ children, isLeftSidebarCollapsed, hasCollapsedState, isFlyoutOpen, }: ResizableChildrenWrapperProps) => jsx.JSX.Element;
10
11
  export default ResizableChildrenWrapper;
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import type { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  declare type SlotFocusRingProps = {
4
5
  children: (props: {
5
6
  className: string;
@@ -15,5 +16,5 @@ declare type SlotFocusRingProps = {
15
16
  * 2. We cannot wrap `children` in `FocusRing`,
16
17
  * because there's no guarantee the passed child takes `className`.
17
18
  */
18
- declare const SlotFocusRing: ({ children, isSidebar }: SlotFocusRingProps) => JSX.Element;
19
+ declare const SlotFocusRing: ({ children, isSidebar }: SlotFocusRingProps) => jsx.JSX.Element;
19
20
  export default SlotFocusRing;
@@ -1,4 +1,12 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { SlotWidthProps } from '../../common/types';
3
- declare const LeftPanel: (props: SlotWidthProps) => JSX.Element;
3
+ /**
4
+ * __Left panel__
5
+ *
6
+ * Provides a slot for a left panel within the PageLayout.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
9
+ * - [Code](https://atlassian.design/components/page-layout/code)
10
+ */
11
+ declare const LeftPanel: (props: SlotWidthProps) => jsx.JSX.Element;
4
12
  export default LeftPanel;
@@ -1,4 +1,12 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { SlotWidthProps } from '../../common/types';
3
- declare const LeftSidebarWithoutResize: (props: SlotWidthProps) => JSX.Element;
3
+ /**
4
+ * __Left sidebar without resize__
5
+ *
6
+ * Provides a slot for a left sidebar without resize within the PageLayout.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
9
+ * - [Code](https://atlassian.design/components/page-layout/code)
10
+ */
11
+ declare const LeftSidebarWithoutResize: (props: SlotWidthProps) => jsx.JSX.Element;
4
12
  export default LeftSidebarWithoutResize;
@@ -1,4 +1,12 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { LeftSidebarProps } from '../../common/types';
3
- declare const LeftSidebar: (props: LeftSidebarProps) => JSX.Element;
3
+ /**
4
+ * __Left sidebar__
5
+ *
6
+ * Provides a slot for a left sidebar within the PageLayout.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
9
+ * - [Code](https://atlassian.design/components/page-layout/code)
10
+ */
11
+ declare const LeftSidebar: (props: LeftSidebarProps) => jsx.JSX.Element;
4
12
  export default LeftSidebar;
@@ -1,4 +1,12 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { SlotWidthProps } from '../../common/types';
3
- declare const Main: (props: SlotWidthProps) => JSX.Element;
3
+ /**
4
+ * __Main__
5
+ *
6
+ * Provides a slot for main content within the PageLayout.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
9
+ * - [Code](https://atlassian.design/components/page-layout/code)
10
+ */
11
+ declare const Main: (props: SlotWidthProps) => jsx.JSX.Element;
4
12
  export default Main;
@@ -1,4 +1,12 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { PageLayoutProps } from '../../common/types';
3
- declare const PageLayout: ({ skipLinksLabel, children, testId, onLeftSidebarExpand, onLeftSidebarCollapse, }: PageLayoutProps) => JSX.Element;
3
+ /**
4
+ * __Page layout__
5
+ *
6
+ * A collection of components which let you compose an application's page layout.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
9
+ * - [Code](https://atlassian.design/components/page-layout/code)
10
+ */
11
+ declare const PageLayout: ({ skipLinksLabel, children, testId, onLeftSidebarExpand, onLeftSidebarCollapse, }: PageLayoutProps) => jsx.JSX.Element;
4
12
  export default PageLayout;
@@ -1,4 +1,12 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { SlotWidthProps } from '../../common/types';
3
- declare const RightPanel: (props: SlotWidthProps) => JSX.Element;
3
+ /**
4
+ * __Right panel__
5
+ *
6
+ * Provides a slot for a right panel within the PageLayout.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
9
+ * - [Code](https://atlassian.design/components/page-layout/code)
10
+ */
11
+ declare const RightPanel: (props: SlotWidthProps) => jsx.JSX.Element;
4
12
  export default RightPanel;
@@ -1,4 +1,12 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { SlotWidthProps } from '../../common/types';
3
- declare const RightSidebar: (props: SlotWidthProps) => JSX.Element;
3
+ /**
4
+ * __Right sidebar__
5
+ *
6
+ * Provides a slot for a right sidebar within the PageLayout.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
9
+ * - [Code](https://atlassian.design/components/page-layout/code)
10
+ */
11
+ declare const RightSidebar: (props: SlotWidthProps) => jsx.JSX.Element;
4
12
  export default RightSidebar;
@@ -1,4 +1,12 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { SlotHeightProps } from '../../common/types';
3
- declare const TopNavigation: (props: SlotHeightProps) => JSX.Element;
3
+ /**
4
+ * __Top navigation__
5
+ *
6
+ * Provides a slot for top navigation within the PageLayout.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
9
+ * - [Code](https://atlassian.design/components/page-layout/code)
10
+ */
11
+ declare const TopNavigation: (props: SlotHeightProps) => jsx.JSX.Element;
4
12
  export default TopNavigation;
@@ -23,7 +23,7 @@ export declare const usePageLayoutResize: () => {
23
23
  leftSidebarState: LeftSidebarState;
24
24
  };
25
25
  /**
26
- * **WARNING:** This hook is intended as a temporary solution and
26
+ * _**WARNING:**_ This hook is intended as a temporary solution and
27
27
  * is likely to be removed in a future version of page-layout.
28
28
  *
29
29
  * ---
@@ -4,11 +4,17 @@ export declare type SkipLinkContextProps = {
4
4
  unregisterSkipLink: (id: string | undefined) => void;
5
5
  };
6
6
  export declare type SkipLinkData = {
7
- /** id for the element that will be skipped to */
7
+ /**
8
+ * id for the element that will be skipped to
9
+ */
8
10
  id: string;
9
- /** Text for the link that will appear in the skip link menu */
11
+ /**
12
+ * Text for the link that will appear in the skip link menu
13
+ */
10
14
  skipLinkTitle: string;
11
- /** Desired position in the skip link menu */
15
+ /**
16
+ * Desired position in the skip link menu
17
+ */
12
18
  listIndex?: number;
13
19
  };
14
20
  export declare type SkipLinkI18n = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/page-layout",
3
- "version": "1.2.6",
3
+ "version": "1.3.0",
4
4
  "description": "A collection of components which let you compose an application's page layout.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -13,7 +13,7 @@
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
15
  "sideEffects": false,
16
- "atlaskit:src": "src/index.ts",
16
+ "atlaskit:src": "src/index.tsx",
17
17
  "atlassian": {
18
18
  "team": "Design System Team",
19
19
  "deprecatedAutoEntryPoints": true,
@@ -25,12 +25,13 @@
25
25
  },
26
26
  "homepage": "https://atlassian.design/components/page-layout/",
27
27
  "dependencies": {
28
+ "@atlaskit/ds-lib": "^2.1.0",
28
29
  "@atlaskit/icon": "^21.10.0",
29
- "@atlaskit/motion": "^1.1.0",
30
- "@atlaskit/theme": "^12.1.0",
30
+ "@atlaskit/motion": "^1.2.0",
31
+ "@atlaskit/theme": "^12.2.0",
31
32
  "@atlaskit/tokens": "^0.10.0",
32
33
  "@babel/runtime": "^7.0.0",
33
- "@emotion/core": "^10.0.9",
34
+ "@emotion/react": "^11.7.1",
34
35
  "bind-event-listener": "^2.1.1",
35
36
  "raf-schd": "^4.0.3"
36
37
  },
@@ -43,15 +44,15 @@
43
44
  "@atlaskit/atlassian-notifications": "^0.3.0",
44
45
  "@atlaskit/button": "^16.3.0",
45
46
  "@atlaskit/docs": "*",
46
- "@atlaskit/drawer": "^7.1.0",
47
+ "@atlaskit/drawer": "^7.2.0",
47
48
  "@atlaskit/icon": "*",
48
- "@atlaskit/logo": "^13.7.0",
49
+ "@atlaskit/logo": "^13.9.0",
49
50
  "@atlaskit/menu": "^1.3.0",
50
51
  "@atlaskit/notification-indicator": "^9.0.0",
51
52
  "@atlaskit/notification-log-client": "^6.0.0",
52
- "@atlaskit/onboarding": "^10.4.0",
53
- "@atlaskit/popup": "^1.3.0",
54
- "@atlaskit/section-message": "^6.0.0",
53
+ "@atlaskit/onboarding": "^10.5.0",
54
+ "@atlaskit/popup": "^1.4.0",
55
+ "@atlaskit/section-message": "^6.2.0",
55
56
  "@atlaskit/side-navigation": "^1.2.0",
56
57
  "@atlaskit/ssr": "*",
57
58
  "@atlaskit/tooltip": "*",
@@ -65,7 +66,7 @@
65
66
  "jest-emotion": "^10.0.32",
66
67
  "raf-stub": "^2.0.1",
67
68
  "storybook-addon-performance": "^0.16.0",
68
- "typescript": "4.2.4"
69
+ "typescript": "4.3.5"
69
70
  },
70
71
  "keywords": [
71
72
  "atlaskit",
@@ -78,6 +79,7 @@
78
79
  },
79
80
  "@repo/internal": {
80
81
  "dom-events": "use-bind-event-listener",
82
+ "design-system": "v1",
81
83
  "ui-components": [
82
84
  "lite-mode"
83
85
  ],
package/report.api.md ADDED
@@ -0,0 +1,219 @@
1
+ ## API Report File for "@atlaskit/page-layout"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+ /// <reference types="react" />
7
+
8
+ import { ButtonHTMLAttributes } from 'react';
9
+ import { ElementType } from 'react';
10
+ import { KeyboardEvent as KeyboardEvent_2 } from 'react';
11
+ import { MouseEvent as MouseEvent_2 } from 'react';
12
+ import { ReactElement } from 'react';
13
+ import { ReactNode } from 'react';
14
+
15
+ export declare const Banner: (props: SlotHeightProps) => JSX.Element;
16
+
17
+ export declare const BANNER_HEIGHT: string;
18
+
19
+ export declare const Content: (props: ContentProps) => JSX.Element;
20
+
21
+ declare interface ContentProps {
22
+ /** React children! */
23
+ children: ReactNode;
24
+ /**
25
+ * 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.
26
+ **/
27
+ testId?: string;
28
+ }
29
+
30
+ declare type DimensionNames =
31
+ | 'leftPanelWidth'
32
+ | 'bannerHeight'
33
+ | 'topNavigationHeight'
34
+ | 'leftSidebarWidth'
35
+ | 'leftSidebarFlyoutWidth'
36
+ | 'rightSidebarWidth'
37
+ | 'rightPanelWidth';
38
+
39
+ export declare type Dimensions = Partial<Record<DimensionNames, number>>;
40
+
41
+ export declare const LEFT_PANEL_WIDTH: string;
42
+
43
+ export declare const LEFT_SIDEBAR_WIDTH: string;
44
+
45
+ export declare const LeftPanel: (props: SlotWidthProps) => JSX.Element;
46
+
47
+ export declare const LeftSidebar: (props: LeftSidebarProps) => JSX.Element;
48
+
49
+ declare interface LeftSidebarProps extends SlotWidthProps {
50
+ /**
51
+ * 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.
52
+ */
53
+ testId?: string;
54
+ /** You can override prop(s) for the mentioned component(s). */
55
+ overrides?: {
56
+ ResizeButton?: {
57
+ render?: (
58
+ Component: ElementType<ResizeButtonProps>,
59
+ props: ResizeButtonProps,
60
+ ) => ReactElement;
61
+ };
62
+ };
63
+ /** Display label for grab area. This will be announced to the screenreaders when the grab area receives focus */
64
+ resizeGrabAreaLabel?: string;
65
+ /** Display label for resize button. */
66
+ resizeButtonLabel?: string;
67
+ /** Called when left-sidebar is collapsed. */
68
+ onCollapse?: () => void;
69
+ /** Called when left-sidebar is expanded. */
70
+ onExpand?: () => void;
71
+ /** Called when left-sidebar resize starts using mouse or touch. */
72
+ onResizeStart?: (leftSidebarState: LeftSidebarState) => void;
73
+ /** Called when left-sidebar resize ends using mouse or touch. */
74
+ onResizeEnd?: (leftSidebarState: LeftSidebarState) => void;
75
+ /** Called when left-sidebar is collapsed and mouse leaves the area. */
76
+ onFlyoutCollapse?: () => void;
77
+ /** Called after flyout delay when left-sidebar is collapsed and mouse enters the area. */
78
+ onFlyoutExpand?: () => void;
79
+ /** Controls whether the LeftSidebar mounts in a collapsed state, this will override the setting in localStorage */
80
+ collapsedState?: 'collapsed' | 'expanded';
81
+ /** Controls the width when LeftSidebar mounts, this will override the setting in localStorage */
82
+ width?: number;
83
+ }
84
+
85
+ export declare type LeftSidebarState = {
86
+ isFlyoutOpen: boolean;
87
+ isResizing: boolean;
88
+ isLeftSidebarCollapsed: boolean;
89
+ leftSidebarWidth: number;
90
+ lastLeftSidebarWidth: number;
91
+ flyoutLockCount: number;
92
+ isFixed: boolean;
93
+ };
94
+
95
+ export declare const LeftSidebarWithoutResize: (
96
+ props: SlotWidthProps,
97
+ ) => JSX.Element;
98
+
99
+ export declare const Main: (props: SlotWidthProps) => JSX.Element;
100
+
101
+ export declare const PageLayout: ({
102
+ skipLinksLabel,
103
+ children,
104
+ testId,
105
+ onLeftSidebarExpand,
106
+ onLeftSidebarCollapse,
107
+ }: PageLayoutProps) => JSX.Element;
108
+
109
+ declare interface PageLayoutProps extends SidebarResizeControllerProps {
110
+ /** React children! */
111
+ children: ReactNode;
112
+ skipLinksLabel?: string;
113
+ /**
114
+ * 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.
115
+ **/
116
+ testId?: string;
117
+ }
118
+
119
+ declare type ResizeButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
120
+ isLeftSidebarCollapsed: boolean;
121
+ label: string;
122
+ testId?: string;
123
+ };
124
+
125
+ export declare const RIGHT_PANEL_WIDTH: string;
126
+
127
+ export declare const RIGHT_SIDEBAR_WIDTH: string;
128
+
129
+ export declare const RightPanel: (props: SlotWidthProps) => JSX.Element;
130
+
131
+ export declare const RightSidebar: (props: SlotWidthProps) => JSX.Element;
132
+
133
+ declare type SidebarResizeControllerProps = {
134
+ /** Called when left-sidebar expanded. */
135
+ onLeftSidebarExpand?: (leftSidebarState: LeftSidebarState) => void;
136
+ /** Called when left-sidebar collapsed. */
137
+ onLeftSidebarCollapse?: (leftSidebarState: LeftSidebarState) => void;
138
+ };
139
+
140
+ declare type SkipLinkData = {
141
+ /** id for the element that will be skipped to */
142
+ id: string;
143
+ /** Text for the link that will appear in the skip link menu */
144
+ skipLinkTitle: string;
145
+ /** Desired position in the skip link menu */
146
+ listIndex?: number;
147
+ };
148
+
149
+ export declare interface SlotHeightProps extends SlotProps {
150
+ /** It save height in local storage. */
151
+ shouldPersistHeight?: boolean;
152
+ /** Height! */
153
+ height?: number;
154
+ }
155
+
156
+ declare interface SlotProps {
157
+ /** Sets positon to fixed. */
158
+ isFixed?: boolean;
159
+ /**
160
+ * 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 .
161
+ */
162
+ testId?: string;
163
+ /** React Children! */
164
+ children: ReactNode;
165
+ id?: string;
166
+ skipLinkTitle?: string;
167
+ }
168
+
169
+ export declare interface SlotWidthProps extends SlotProps {
170
+ /** It save width in local storage. */
171
+ shouldPersistWidth?: boolean;
172
+ /** Width! */
173
+ width?: number;
174
+ }
175
+
176
+ export declare const TOP_NAVIGATION_HEIGHT: string;
177
+
178
+ export declare const TopNavigation: (props: SlotHeightProps) => JSX.Element;
179
+
180
+ export declare const useCustomSkipLink: (
181
+ id: SkipLinkData['id'],
182
+ skipLinkTitle: SkipLinkData['skipLinkTitle'],
183
+ listIndex?: SkipLinkData['listIndex'],
184
+ ) => void;
185
+
186
+ /**
187
+ * **WARNING:** This hook is intended as a temporary solution and
188
+ * is likely to be removed in a future version of page-layout.
189
+ *
190
+ * ---
191
+ *
192
+ * This hook will prevent the left sidebar from automatically collapsing
193
+ * when it is in a flyout state.
194
+ *
195
+ * The intended use case for this hook is to allow popup menus in the
196
+ * left sidebar to be usable while it is in a flyout state.
197
+ *
198
+ * ## Usage
199
+ * The intended usage is to use this hook within the popup component
200
+ * you are rendering. This way the left sidebar will be locked for
201
+ * as long as the popup is open.
202
+ */
203
+ export declare const useLeftSidebarFlyoutLock: () => void;
204
+
205
+ export declare const usePageLayoutResize: () => {
206
+ isLeftSidebarCollapsed: boolean;
207
+ expandLeftSidebar: () => void;
208
+ collapseLeftSidebar: (
209
+ event?:
210
+ | MouseEvent_2<Element, globalThis.MouseEvent>
211
+ | KeyboardEvent_2<Element>
212
+ | undefined,
213
+ collapseWithoutTransition?: boolean | undefined,
214
+ ) => void;
215
+ leftSidebarState: LeftSidebarState;
216
+ };
217
+
218
+ export {};
219
+ ```