@atlaskit/page-layout 1.2.6 → 1.2.7

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 (95) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/__perf__/utils/perf-example.tsx +2 -2
  3. package/__perf__/utils/product-integration/{AtlassianNavigation.tsx → atlassian-navigation.tsx} +4 -4
  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} +0 -0
  7. package/__perf__/utils/product-integration/{ProfilePopup.tsx → profile-popup.tsx} +2 -1
  8. package/__perf__/utils/product-integration/{SampleFooter.tsx → sample-footer.tsx} +1 -0
  9. package/__perf__/utils/product-integration/{SampleHeader.tsx → sample-header.tsx} +2 -0
  10. package/__perf__/utils/product-integration/{SideNavigation.tsx → side-navigation.tsx} +2 -2
  11. package/dist/cjs/common/safe-local-storage.js +1 -0
  12. package/dist/cjs/components/resize-control/grab-area.js +4 -2
  13. package/dist/cjs/components/resize-control/index.js +2 -1
  14. package/dist/cjs/components/resize-control/resize-button.js +4 -2
  15. package/dist/cjs/components/resize-control/shadow.js +2 -1
  16. package/dist/cjs/components/skip-links/skip-link-components.js +4 -2
  17. package/dist/cjs/components/slots/banner.js +8 -0
  18. package/dist/cjs/components/slots/content.js +8 -0
  19. package/dist/cjs/components/slots/internal/left-sidebar-inner.js +2 -1
  20. package/dist/cjs/components/slots/internal/resizable-children-wrapper.js +2 -1
  21. package/dist/cjs/components/slots/left-panel.js +8 -0
  22. package/dist/cjs/components/slots/left-sidebar-without-resize.js +9 -0
  23. package/dist/cjs/components/slots/left-sidebar.js +10 -1
  24. package/dist/cjs/components/slots/main.js +8 -0
  25. package/dist/cjs/components/slots/page-layout.js +8 -0
  26. package/dist/cjs/components/slots/right-panel.js +8 -0
  27. package/dist/cjs/components/slots/right-sidebar.js +8 -0
  28. package/dist/cjs/components/slots/top-navigation.js +8 -0
  29. package/dist/cjs/controllers/sidebar-resize-context.js +8 -7
  30. package/dist/cjs/controllers/sidebar-resize-controller.js +5 -4
  31. package/dist/cjs/controllers/skip-link-context.js +6 -3
  32. package/dist/cjs/controllers/skip-link-controller.js +2 -1
  33. package/dist/cjs/version.json +1 -1
  34. package/dist/es2019/common/safe-local-storage.js +1 -0
  35. package/dist/es2019/components/resize-control/grab-area.js +4 -2
  36. package/dist/es2019/components/resize-control/index.js +2 -1
  37. package/dist/es2019/components/resize-control/resize-button.js +4 -2
  38. package/dist/es2019/components/resize-control/shadow.js +2 -1
  39. package/dist/es2019/components/skip-links/skip-link-components.js +4 -2
  40. package/dist/es2019/components/slots/banner.js +8 -0
  41. package/dist/es2019/components/slots/content.js +8 -0
  42. package/dist/es2019/components/slots/internal/left-sidebar-inner.js +2 -1
  43. package/dist/es2019/components/slots/internal/resizable-children-wrapper.js +2 -1
  44. package/dist/es2019/components/slots/left-panel.js +8 -0
  45. package/dist/es2019/components/slots/left-sidebar-without-resize.js +8 -0
  46. package/dist/es2019/components/slots/left-sidebar.js +10 -1
  47. package/dist/es2019/components/slots/main.js +8 -0
  48. package/dist/es2019/components/slots/page-layout.js +8 -0
  49. package/dist/es2019/components/slots/right-panel.js +8 -0
  50. package/dist/es2019/components/slots/right-sidebar.js +8 -0
  51. package/dist/es2019/components/slots/top-navigation.js +8 -0
  52. package/dist/es2019/controllers/sidebar-resize-context.js +4 -5
  53. package/dist/es2019/controllers/sidebar-resize-controller.js +3 -3
  54. package/dist/es2019/controllers/skip-link-context.js +2 -3
  55. package/dist/es2019/controllers/skip-link-controller.js +2 -1
  56. package/dist/es2019/version.json +1 -1
  57. package/dist/esm/common/safe-local-storage.js +1 -0
  58. package/dist/esm/components/resize-control/grab-area.js +4 -2
  59. package/dist/esm/components/resize-control/index.js +2 -1
  60. package/dist/esm/components/resize-control/resize-button.js +4 -2
  61. package/dist/esm/components/resize-control/shadow.js +2 -1
  62. package/dist/esm/components/skip-links/skip-link-components.js +4 -2
  63. package/dist/esm/components/slots/banner.js +8 -0
  64. package/dist/esm/components/slots/content.js +8 -0
  65. package/dist/esm/components/slots/internal/left-sidebar-inner.js +2 -1
  66. package/dist/esm/components/slots/internal/resizable-children-wrapper.js +2 -1
  67. package/dist/esm/components/slots/left-panel.js +8 -0
  68. package/dist/esm/components/slots/left-sidebar-without-resize.js +8 -0
  69. package/dist/esm/components/slots/left-sidebar.js +10 -1
  70. package/dist/esm/components/slots/main.js +8 -0
  71. package/dist/esm/components/slots/page-layout.js +8 -0
  72. package/dist/esm/components/slots/right-panel.js +8 -0
  73. package/dist/esm/components/slots/right-sidebar.js +8 -0
  74. package/dist/esm/components/slots/top-navigation.js +8 -0
  75. package/dist/esm/controllers/sidebar-resize-context.js +4 -5
  76. package/dist/esm/controllers/sidebar-resize-controller.js +3 -3
  77. package/dist/esm/controllers/skip-link-context.js +2 -3
  78. package/dist/esm/controllers/skip-link-controller.js +2 -1
  79. package/dist/esm/version.json +1 -1
  80. package/dist/types/common/types.d.ts +61 -21
  81. package/dist/types/common/utils.d.ts +1 -1
  82. package/dist/types/components/slots/banner.d.ts +8 -0
  83. package/dist/types/components/slots/content.d.ts +12 -2
  84. package/dist/types/components/slots/left-panel.d.ts +8 -0
  85. package/dist/types/components/slots/left-sidebar-without-resize.d.ts +8 -0
  86. package/dist/types/components/slots/left-sidebar.d.ts +8 -0
  87. package/dist/types/components/slots/main.d.ts +8 -0
  88. package/dist/types/components/slots/page-layout.d.ts +8 -0
  89. package/dist/types/components/slots/right-panel.d.ts +8 -0
  90. package/dist/types/components/slots/right-sidebar.d.ts +8 -0
  91. package/dist/types/components/slots/top-navigation.d.ts +8 -0
  92. package/dist/types/controllers/sidebar-resize-context.d.ts +1 -1
  93. package/dist/types/controllers/types.d.ts +9 -3
  94. package/package.json +8 -6
  95. package/report.api.md +219 -0
@@ -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,4 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { SlotHeightProps } from '../../common/types';
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
+ */
3
11
  declare const Banner: (props: SlotHeightProps) => JSX.Element;
4
12
  export default Banner;
@@ -1,12 +1,22 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactNode } from 'react';
3
3
  interface ContentProps {
4
- /** React children! */
4
+ /**
5
+ * React children
6
+ */
5
7
  children: ReactNode;
6
8
  /**
7
9
  * 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
- **/
10
+ */
9
11
  testId?: string;
10
12
  }
13
+ /**
14
+ * __Content__
15
+ *
16
+ * Provides a slot for your application content within the PageLayout.
17
+ *
18
+ * - [Examples](https://atlassian.design/components/page-layout/examples)
19
+ * - [Code](https://atlassian.design/components/page-layout/code)
20
+ */
11
21
  declare const Content: (props: ContentProps) => JSX.Element;
12
22
  export default Content;
@@ -1,4 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { SlotWidthProps } from '../../common/types';
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
+ */
3
11
  declare const LeftPanel: (props: SlotWidthProps) => JSX.Element;
4
12
  export default LeftPanel;
@@ -1,4 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { SlotWidthProps } from '../../common/types';
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
+ */
3
11
  declare const LeftSidebarWithoutResize: (props: SlotWidthProps) => JSX.Element;
4
12
  export default LeftSidebarWithoutResize;
@@ -1,4 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { LeftSidebarProps } from '../../common/types';
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
+ */
3
11
  declare const LeftSidebar: (props: LeftSidebarProps) => JSX.Element;
4
12
  export default LeftSidebar;
@@ -1,4 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { SlotWidthProps } from '../../common/types';
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
+ */
3
11
  declare const Main: (props: SlotWidthProps) => JSX.Element;
4
12
  export default Main;
@@ -1,4 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { PageLayoutProps } from '../../common/types';
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
+ */
3
11
  declare const PageLayout: ({ skipLinksLabel, children, testId, onLeftSidebarExpand, onLeftSidebarCollapse, }: PageLayoutProps) => JSX.Element;
4
12
  export default PageLayout;
@@ -1,4 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { SlotWidthProps } from '../../common/types';
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
+ */
3
11
  declare const RightPanel: (props: SlotWidthProps) => JSX.Element;
4
12
  export default RightPanel;
@@ -1,4 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { SlotWidthProps } from '../../common/types';
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
+ */
3
11
  declare const RightSidebar: (props: SlotWidthProps) => JSX.Element;
4
12
  export default RightSidebar;
@@ -1,4 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { SlotHeightProps } from '../../common/types';
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
+ */
3
11
  declare const TopNavigation: (props: SlotHeightProps) => 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.2.7",
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,8 +25,9 @@
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/motion": "^1.2.0",
30
31
  "@atlaskit/theme": "^12.1.0",
31
32
  "@atlaskit/tokens": "^0.10.0",
32
33
  "@babel/runtime": "^7.0.0",
@@ -45,12 +46,12 @@
45
46
  "@atlaskit/docs": "*",
46
47
  "@atlaskit/drawer": "^7.1.0",
47
48
  "@atlaskit/icon": "*",
48
- "@atlaskit/logo": "^13.7.0",
49
+ "@atlaskit/logo": "^13.8.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",
53
+ "@atlaskit/onboarding": "^10.5.0",
54
+ "@atlaskit/popup": "^1.4.0",
54
55
  "@atlaskit/section-message": "^6.0.0",
55
56
  "@atlaskit/side-navigation": "^1.2.0",
56
57
  "@atlaskit/ssr": "*",
@@ -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
+ ```