@atlaskit/page-layout 1.2.4 → 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.
- package/CHANGELOG.md +19 -0
- package/__perf__/utils/perf-example.tsx +2 -2
- package/__perf__/utils/product-integration/{AtlassianNavigation.tsx → atlassian-navigation.tsx} +4 -4
- package/__perf__/utils/product-integration/{Create.tsx → create.tsx} +2 -1
- package/__perf__/utils/product-integration/{HelpPopup.tsx → help-popup.tsx} +1 -0
- package/__perf__/utils/product-integration/{NotificationsPopup.tsx → notifications-popup.tsx} +0 -0
- package/__perf__/utils/product-integration/{ProfilePopup.tsx → profile-popup.tsx} +2 -1
- package/__perf__/utils/product-integration/{SampleFooter.tsx → sample-footer.tsx} +1 -0
- package/__perf__/utils/product-integration/{SampleHeader.tsx → sample-header.tsx} +2 -0
- package/__perf__/utils/product-integration/{SideNavigation.tsx → side-navigation.tsx} +2 -2
- package/dist/cjs/common/safe-local-storage.js +1 -0
- package/dist/cjs/components/resize-control/grab-area.js +4 -2
- package/dist/cjs/components/resize-control/index.js +21 -7
- package/dist/cjs/components/resize-control/resize-button.js +4 -2
- package/dist/cjs/components/resize-control/shadow.js +2 -1
- package/dist/cjs/components/skip-links/skip-link-components.js +4 -2
- package/dist/cjs/components/slots/banner.js +8 -0
- package/dist/cjs/components/slots/content.js +8 -0
- package/dist/cjs/components/slots/internal/left-sidebar-inner.js +2 -1
- package/dist/cjs/components/slots/internal/resizable-children-wrapper.js +2 -1
- package/dist/cjs/components/slots/left-panel.js +8 -0
- package/dist/cjs/components/slots/left-sidebar-without-resize.js +9 -0
- package/dist/cjs/components/slots/left-sidebar.js +10 -1
- package/dist/cjs/components/slots/main.js +8 -0
- package/dist/cjs/components/slots/page-layout.js +8 -0
- package/dist/cjs/components/slots/right-panel.js +8 -0
- package/dist/cjs/components/slots/right-sidebar.js +8 -0
- package/dist/cjs/components/slots/top-navigation.js +8 -0
- package/dist/cjs/controllers/sidebar-resize-context.js +8 -7
- package/dist/cjs/controllers/sidebar-resize-controller.js +7 -4
- package/dist/cjs/controllers/skip-link-context.js +6 -3
- package/dist/cjs/controllers/skip-link-controller.js +2 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/common/safe-local-storage.js +1 -0
- package/dist/es2019/components/resize-control/grab-area.js +4 -2
- package/dist/es2019/components/resize-control/index.js +19 -7
- package/dist/es2019/components/resize-control/resize-button.js +4 -2
- package/dist/es2019/components/resize-control/shadow.js +2 -1
- package/dist/es2019/components/skip-links/skip-link-components.js +6 -2
- package/dist/es2019/components/slots/banner.js +8 -0
- package/dist/es2019/components/slots/content.js +8 -0
- package/dist/es2019/components/slots/internal/left-sidebar-inner.js +2 -1
- package/dist/es2019/components/slots/internal/resizable-children-wrapper.js +2 -1
- package/dist/es2019/components/slots/left-panel.js +8 -0
- package/dist/es2019/components/slots/left-sidebar-without-resize.js +8 -0
- package/dist/es2019/components/slots/left-sidebar.js +12 -1
- package/dist/es2019/components/slots/main.js +8 -0
- package/dist/es2019/components/slots/page-layout.js +8 -0
- package/dist/es2019/components/slots/right-panel.js +8 -0
- package/dist/es2019/components/slots/right-sidebar.js +8 -0
- package/dist/es2019/components/slots/top-navigation.js +8 -0
- package/dist/es2019/controllers/sidebar-resize-context.js +4 -5
- package/dist/es2019/controllers/sidebar-resize-controller.js +5 -3
- package/dist/es2019/controllers/skip-link-context.js +2 -3
- package/dist/es2019/controllers/skip-link-controller.js +2 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/common/safe-local-storage.js +1 -0
- package/dist/esm/components/resize-control/grab-area.js +4 -2
- package/dist/esm/components/resize-control/index.js +20 -7
- package/dist/esm/components/resize-control/resize-button.js +4 -2
- package/dist/esm/components/resize-control/shadow.js +2 -1
- package/dist/esm/components/skip-links/skip-link-components.js +6 -2
- package/dist/esm/components/slots/banner.js +8 -0
- package/dist/esm/components/slots/content.js +8 -0
- package/dist/esm/components/slots/internal/left-sidebar-inner.js +2 -1
- package/dist/esm/components/slots/internal/resizable-children-wrapper.js +2 -1
- package/dist/esm/components/slots/left-panel.js +8 -0
- package/dist/esm/components/slots/left-sidebar-without-resize.js +8 -0
- package/dist/esm/components/slots/left-sidebar.js +12 -1
- package/dist/esm/components/slots/main.js +8 -0
- package/dist/esm/components/slots/page-layout.js +8 -0
- package/dist/esm/components/slots/right-panel.js +8 -0
- package/dist/esm/components/slots/right-sidebar.js +8 -0
- package/dist/esm/components/slots/top-navigation.js +8 -0
- package/dist/esm/controllers/sidebar-resize-context.js +4 -5
- package/dist/esm/controllers/sidebar-resize-controller.js +5 -3
- package/dist/esm/controllers/skip-link-context.js +2 -3
- package/dist/esm/controllers/skip-link-controller.js +2 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/common/types.d.ts +61 -21
- package/dist/types/common/utils.d.ts +1 -1
- package/dist/types/components/slots/banner.d.ts +8 -0
- package/dist/types/components/slots/content.d.ts +12 -2
- package/dist/types/components/slots/left-panel.d.ts +8 -0
- package/dist/types/components/slots/left-sidebar-without-resize.d.ts +8 -0
- package/dist/types/components/slots/left-sidebar.d.ts +8 -0
- package/dist/types/components/slots/main.d.ts +8 -0
- package/dist/types/components/slots/page-layout.d.ts +8 -0
- package/dist/types/components/slots/right-panel.d.ts +8 -0
- package/dist/types/components/slots/right-sidebar.d.ts +8 -0
- package/dist/types/components/slots/top-navigation.d.ts +8 -0
- package/dist/types/controllers/sidebar-resize-context.d.ts +1 -1
- package/dist/types/controllers/types.d.ts +9 -3
- package/package.json +12 -7
- package/report.api.md +219 -0
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
|
+
```
|