@atlaskit/page-layout 1.8.4 → 2.0.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.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/components/slots/left-sidebar.js +2 -8
- package/dist/es2019/components/slots/left-sidebar.js +2 -8
- package/dist/esm/components/slots/left-sidebar.js +2 -8
- package/dist/types/common/types.d.ts +0 -8
- package/dist/types-ts4.5/common/types.d.ts +0 -8
- package/package.json +3 -3
- package/tmp/api-report-tmp.d.ts +0 -175
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/page-layout
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#56597](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/56597) [`162c25fea4d3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/162c25fea4d3) - Remove `onExpand` and `onCollapse` props on `LeftSidebar` component. These props were non-functional. Use `onLeftSidebarExpand` and `onLeftSidebarCollapse` props on `PageLayout` component instead.
|
|
8
|
+
|
|
3
9
|
## 1.8.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -58,8 +58,6 @@ var LeftSidebar = function LeftSidebar(props) {
|
|
|
58
58
|
resizeButtonLabel = props.resizeButtonLabel,
|
|
59
59
|
resizeGrabAreaLabel = props.resizeGrabAreaLabel,
|
|
60
60
|
overrides = props.overrides,
|
|
61
|
-
onExpand = props.onExpand,
|
|
62
|
-
onCollapse = props.onCollapse,
|
|
63
61
|
onResizeStart = props.onResizeStart,
|
|
64
62
|
onResizeEnd = props.onResizeEnd,
|
|
65
63
|
onFlyoutExpand = props.onFlyoutExpand,
|
|
@@ -237,12 +235,11 @@ var LeftSidebar = function LeftSidebar(props) {
|
|
|
237
235
|
if (current.isFlyoutOpen) {
|
|
238
236
|
return current;
|
|
239
237
|
}
|
|
240
|
-
onExpand === null || onExpand === void 0 || onExpand();
|
|
241
238
|
return _objectSpread(_objectSpread({}, current), {}, {
|
|
242
239
|
isFlyoutOpen: true
|
|
243
240
|
});
|
|
244
241
|
});
|
|
245
|
-
}, [setLeftSidebarState,
|
|
242
|
+
}, [setLeftSidebarState, mobileMediaQuery]);
|
|
246
243
|
|
|
247
244
|
// CLEANUP NOTE: If we revert `'platform.design-system-team.responsive-page-layout-left-sidebar_p8r7g'`, this would be gone.
|
|
248
245
|
var closeMobileFlyout = (0, _react.useCallback)(function () {
|
|
@@ -253,12 +250,11 @@ var LeftSidebar = function LeftSidebar(props) {
|
|
|
253
250
|
if (!current.isFlyoutOpen) {
|
|
254
251
|
return current;
|
|
255
252
|
}
|
|
256
|
-
onCollapse === null || onCollapse === void 0 || onCollapse();
|
|
257
253
|
return _objectSpread(_objectSpread({}, current), {}, {
|
|
258
254
|
isFlyoutOpen: false
|
|
259
255
|
});
|
|
260
256
|
});
|
|
261
|
-
}, [setLeftSidebarState,
|
|
257
|
+
}, [setLeftSidebarState, mobileMediaQuery]);
|
|
262
258
|
|
|
263
259
|
// CLEANUP NOTE: If we revert `'platform.design-system-team.responsive-page-layout-left-sidebar_p8r7g'`, this would be gone.
|
|
264
260
|
(0, _responsive.UNSAFE_useMediaQuery)('below.sm', function (event) {
|
|
@@ -336,8 +332,6 @@ var LeftSidebar = function LeftSidebar(props) {
|
|
|
336
332
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
337
333
|
,
|
|
338
334
|
overrides: overrides,
|
|
339
|
-
onCollapse: onCollapse,
|
|
340
|
-
onExpand: onExpand,
|
|
341
335
|
onResizeStart: onResizeStart,
|
|
342
336
|
onResizeEnd: onResizeEnd
|
|
343
337
|
}))));
|
|
@@ -50,8 +50,6 @@ const LeftSidebar = props => {
|
|
|
50
50
|
resizeButtonLabel,
|
|
51
51
|
resizeGrabAreaLabel,
|
|
52
52
|
overrides,
|
|
53
|
-
onExpand,
|
|
54
|
-
onCollapse,
|
|
55
53
|
onResizeStart,
|
|
56
54
|
onResizeEnd,
|
|
57
55
|
onFlyoutExpand,
|
|
@@ -231,13 +229,12 @@ const LeftSidebar = props => {
|
|
|
231
229
|
if (current.isFlyoutOpen) {
|
|
232
230
|
return current;
|
|
233
231
|
}
|
|
234
|
-
onExpand === null || onExpand === void 0 ? void 0 : onExpand();
|
|
235
232
|
return {
|
|
236
233
|
...current,
|
|
237
234
|
isFlyoutOpen: true
|
|
238
235
|
};
|
|
239
236
|
});
|
|
240
|
-
}, [setLeftSidebarState,
|
|
237
|
+
}, [setLeftSidebarState, mobileMediaQuery]);
|
|
241
238
|
|
|
242
239
|
// CLEANUP NOTE: If we revert `'platform.design-system-team.responsive-page-layout-left-sidebar_p8r7g'`, this would be gone.
|
|
243
240
|
const closeMobileFlyout = useCallback(() => {
|
|
@@ -248,13 +245,12 @@ const LeftSidebar = props => {
|
|
|
248
245
|
if (!current.isFlyoutOpen) {
|
|
249
246
|
return current;
|
|
250
247
|
}
|
|
251
|
-
onCollapse === null || onCollapse === void 0 ? void 0 : onCollapse();
|
|
252
248
|
return {
|
|
253
249
|
...current,
|
|
254
250
|
isFlyoutOpen: false
|
|
255
251
|
};
|
|
256
252
|
});
|
|
257
|
-
}, [setLeftSidebarState,
|
|
253
|
+
}, [setLeftSidebarState, mobileMediaQuery]);
|
|
258
254
|
|
|
259
255
|
// CLEANUP NOTE: If we revert `'platform.design-system-team.responsive-page-layout-left-sidebar_p8r7g'`, this would be gone.
|
|
260
256
|
useMediaQuery('below.sm', event => {
|
|
@@ -334,8 +330,6 @@ const LeftSidebar = props => {
|
|
|
334
330
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
335
331
|
,
|
|
336
332
|
overrides: overrides,
|
|
337
|
-
onCollapse: onCollapse,
|
|
338
|
-
onExpand: onExpand,
|
|
339
333
|
onResizeStart: onResizeStart,
|
|
340
334
|
onResizeEnd: onResizeEnd
|
|
341
335
|
}))));
|
|
@@ -53,8 +53,6 @@ var LeftSidebar = function LeftSidebar(props) {
|
|
|
53
53
|
resizeButtonLabel = props.resizeButtonLabel,
|
|
54
54
|
resizeGrabAreaLabel = props.resizeGrabAreaLabel,
|
|
55
55
|
overrides = props.overrides,
|
|
56
|
-
onExpand = props.onExpand,
|
|
57
|
-
onCollapse = props.onCollapse,
|
|
58
56
|
onResizeStart = props.onResizeStart,
|
|
59
57
|
onResizeEnd = props.onResizeEnd,
|
|
60
58
|
onFlyoutExpand = props.onFlyoutExpand,
|
|
@@ -232,12 +230,11 @@ var LeftSidebar = function LeftSidebar(props) {
|
|
|
232
230
|
if (current.isFlyoutOpen) {
|
|
233
231
|
return current;
|
|
234
232
|
}
|
|
235
|
-
onExpand === null || onExpand === void 0 || onExpand();
|
|
236
233
|
return _objectSpread(_objectSpread({}, current), {}, {
|
|
237
234
|
isFlyoutOpen: true
|
|
238
235
|
});
|
|
239
236
|
});
|
|
240
|
-
}, [setLeftSidebarState,
|
|
237
|
+
}, [setLeftSidebarState, mobileMediaQuery]);
|
|
241
238
|
|
|
242
239
|
// CLEANUP NOTE: If we revert `'platform.design-system-team.responsive-page-layout-left-sidebar_p8r7g'`, this would be gone.
|
|
243
240
|
var closeMobileFlyout = useCallback(function () {
|
|
@@ -248,12 +245,11 @@ var LeftSidebar = function LeftSidebar(props) {
|
|
|
248
245
|
if (!current.isFlyoutOpen) {
|
|
249
246
|
return current;
|
|
250
247
|
}
|
|
251
|
-
onCollapse === null || onCollapse === void 0 || onCollapse();
|
|
252
248
|
return _objectSpread(_objectSpread({}, current), {}, {
|
|
253
249
|
isFlyoutOpen: false
|
|
254
250
|
});
|
|
255
251
|
});
|
|
256
|
-
}, [setLeftSidebarState,
|
|
252
|
+
}, [setLeftSidebarState, mobileMediaQuery]);
|
|
257
253
|
|
|
258
254
|
// CLEANUP NOTE: If we revert `'platform.design-system-team.responsive-page-layout-left-sidebar_p8r7g'`, this would be gone.
|
|
259
255
|
useMediaQuery('below.sm', function (event) {
|
|
@@ -331,8 +327,6 @@ var LeftSidebar = function LeftSidebar(props) {
|
|
|
331
327
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
332
328
|
,
|
|
333
329
|
overrides: overrides,
|
|
334
|
-
onCollapse: onCollapse,
|
|
335
|
-
onExpand: onExpand,
|
|
336
330
|
onResizeStart: onResizeStart,
|
|
337
331
|
onResizeEnd: onResizeEnd
|
|
338
332
|
}))));
|
|
@@ -66,14 +66,6 @@ export interface LeftSidebarProps extends SlotWidthProps {
|
|
|
66
66
|
* Display label for expand/collapse button for the left sidebar.
|
|
67
67
|
*/
|
|
68
68
|
resizeButtonLabel?: string;
|
|
69
|
-
/**
|
|
70
|
-
* Called when left-sidebar is collapsed.
|
|
71
|
-
*/
|
|
72
|
-
onCollapse?: () => void;
|
|
73
|
-
/**
|
|
74
|
-
* Called when left-sidebar is expanded.
|
|
75
|
-
*/
|
|
76
|
-
onExpand?: () => void;
|
|
77
69
|
/**
|
|
78
70
|
* Called when left-sidebar resize starts using mouse or touch.
|
|
79
71
|
*/
|
|
@@ -66,14 +66,6 @@ export interface LeftSidebarProps extends SlotWidthProps {
|
|
|
66
66
|
* Display label for expand/collapse button for the left sidebar.
|
|
67
67
|
*/
|
|
68
68
|
resizeButtonLabel?: string;
|
|
69
|
-
/**
|
|
70
|
-
* Called when left-sidebar is collapsed.
|
|
71
|
-
*/
|
|
72
|
-
onCollapse?: () => void;
|
|
73
|
-
/**
|
|
74
|
-
* Called when left-sidebar is expanded.
|
|
75
|
-
*/
|
|
76
|
-
onExpand?: () => void;
|
|
77
69
|
/**
|
|
78
70
|
* Called when left-sidebar resize starts using mouse or touch.
|
|
79
71
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/page-layout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.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/"
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@atlaskit/icon": "^22.0.0",
|
|
41
41
|
"@atlaskit/motion": "^1.5.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
43
|
-
"@atlaskit/primitives": "^1.
|
|
43
|
+
"@atlaskit/primitives": "^1.12.0",
|
|
44
44
|
"@atlaskit/theme": "^12.6.0",
|
|
45
|
-
"@atlaskit/tokens": "^1.
|
|
45
|
+
"@atlaskit/tokens": "^1.29.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
47
|
"@emotion/react": "^11.7.1",
|
|
48
48
|
"bind-event-listener": "^2.1.1",
|
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
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
|
-
|
|
7
|
-
import { ButtonHTMLAttributes } from 'react';
|
|
8
|
-
import { ElementType } from 'react';
|
|
9
|
-
import { jsx } from '@emotion/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
|
-
// @public
|
|
16
|
-
export const Banner: (props: SlotHeightProps) => jsx.JSX.Element;
|
|
17
|
-
|
|
18
|
-
// @public (undocumented)
|
|
19
|
-
export const BANNER_HEIGHT: string;
|
|
20
|
-
|
|
21
|
-
// @public
|
|
22
|
-
export const Content: (props: ContentProps) => jsx.JSX.Element;
|
|
23
|
-
|
|
24
|
-
// @public (undocumented)
|
|
25
|
-
interface ContentProps {
|
|
26
|
-
children: ReactNode;
|
|
27
|
-
testId?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// @public (undocumented)
|
|
31
|
-
type DimensionNames = 'bannerHeight' | 'leftPanelWidth' | 'leftSidebarFlyoutWidth' | 'leftSidebarWidth' | 'rightPanelWidth' | 'rightSidebarWidth' | 'topNavigationHeight';
|
|
32
|
-
|
|
33
|
-
// @public (undocumented)
|
|
34
|
-
export type Dimensions = Partial<Record<DimensionNames, number>>;
|
|
35
|
-
|
|
36
|
-
// @public (undocumented)
|
|
37
|
-
export const LEFT_PANEL_WIDTH: string;
|
|
38
|
-
|
|
39
|
-
// @public (undocumented)
|
|
40
|
-
export const LEFT_SIDEBAR_WIDTH: string;
|
|
41
|
-
|
|
42
|
-
// @public
|
|
43
|
-
export const LeftPanel: (props: SlotWidthProps) => jsx.JSX.Element;
|
|
44
|
-
|
|
45
|
-
// @public
|
|
46
|
-
export const LeftSidebar: (props: LeftSidebarProps) => jsx.JSX.Element;
|
|
47
|
-
|
|
48
|
-
// @public (undocumented)
|
|
49
|
-
interface LeftSidebarProps extends SlotWidthProps {
|
|
50
|
-
collapsedState?: 'collapsed' | 'expanded';
|
|
51
|
-
onCollapse?: () => void;
|
|
52
|
-
onExpand?: () => void;
|
|
53
|
-
onFlyoutCollapse?: () => void;
|
|
54
|
-
onFlyoutExpand?: () => void;
|
|
55
|
-
onResizeEnd?: (leftSidebarState: LeftSidebarState) => void;
|
|
56
|
-
onResizeStart?: (leftSidebarState: LeftSidebarState) => void;
|
|
57
|
-
overrides?: {
|
|
58
|
-
ResizeButton?: {
|
|
59
|
-
render?: (Component: ElementType<ResizeButtonProps>, props: ResizeButtonProps) => ReactElement;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
resizeButtonLabel?: string;
|
|
63
|
-
resizeGrabAreaLabel?: string;
|
|
64
|
-
testId?: string;
|
|
65
|
-
valueTextLabel?: string;
|
|
66
|
-
width?: number;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// @public (undocumented)
|
|
70
|
-
export type LeftSidebarState = {
|
|
71
|
-
isFlyoutOpen: boolean;
|
|
72
|
-
isResizing: boolean;
|
|
73
|
-
isLeftSidebarCollapsed: boolean;
|
|
74
|
-
leftSidebarWidth: number;
|
|
75
|
-
lastLeftSidebarWidth: number;
|
|
76
|
-
flyoutLockCount: number;
|
|
77
|
-
isFixed: boolean;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
// @public
|
|
81
|
-
export const LeftSidebarWithoutResize: (props: SlotWidthProps) => jsx.JSX.Element;
|
|
82
|
-
|
|
83
|
-
// @public
|
|
84
|
-
export const Main: (props: SlotWidthProps) => jsx.JSX.Element;
|
|
85
|
-
|
|
86
|
-
// @public
|
|
87
|
-
export const PageLayout: ({ skipLinksLabel, children, testId, onLeftSidebarExpand, onLeftSidebarCollapse, }: PageLayoutProps) => jsx.JSX.Element;
|
|
88
|
-
|
|
89
|
-
// @public (undocumented)
|
|
90
|
-
interface PageLayoutProps extends SidebarResizeControllerProps {
|
|
91
|
-
// (undocumented)
|
|
92
|
-
skipLinksLabel?: string;
|
|
93
|
-
testId?: string;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// @public (undocumented)
|
|
97
|
-
type ResizeButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
98
|
-
isLeftSidebarCollapsed: boolean;
|
|
99
|
-
label: string;
|
|
100
|
-
testId?: string;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
// @public (undocumented)
|
|
104
|
-
export const RIGHT_PANEL_WIDTH: string;
|
|
105
|
-
|
|
106
|
-
// @public (undocumented)
|
|
107
|
-
export const RIGHT_SIDEBAR_WIDTH: string;
|
|
108
|
-
|
|
109
|
-
// @public
|
|
110
|
-
export const RightPanel: (props: SlotWidthProps) => jsx.JSX.Element;
|
|
111
|
-
|
|
112
|
-
// @public
|
|
113
|
-
export const RightSidebar: (props: SlotWidthProps) => jsx.JSX.Element;
|
|
114
|
-
|
|
115
|
-
// @public (undocumented)
|
|
116
|
-
type SidebarResizeControllerProps = {
|
|
117
|
-
children: ReactNode;
|
|
118
|
-
onLeftSidebarExpand?: (leftSidebarState: LeftSidebarState) => void;
|
|
119
|
-
onLeftSidebarCollapse?: (leftSidebarState: LeftSidebarState) => void;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// @public (undocumented)
|
|
123
|
-
type SkipLinkData = {
|
|
124
|
-
id: string;
|
|
125
|
-
skipLinkTitle: string;
|
|
126
|
-
listIndex?: number;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
// @public (undocumented)
|
|
130
|
-
export interface SlotHeightProps extends SlotProps {
|
|
131
|
-
height?: number;
|
|
132
|
-
shouldPersistHeight?: boolean;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// @public (undocumented)
|
|
136
|
-
interface SlotProps {
|
|
137
|
-
children: ReactNode;
|
|
138
|
-
// (undocumented)
|
|
139
|
-
id?: string;
|
|
140
|
-
isFixed?: boolean;
|
|
141
|
-
// (undocumented)
|
|
142
|
-
skipLinkTitle?: string;
|
|
143
|
-
testId?: string;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// @public (undocumented)
|
|
147
|
-
export interface SlotWidthProps extends SlotProps {
|
|
148
|
-
shouldPersistWidth?: boolean;
|
|
149
|
-
width?: number;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// @public (undocumented)
|
|
153
|
-
export const TOP_NAVIGATION_HEIGHT: string;
|
|
154
|
-
|
|
155
|
-
// @public
|
|
156
|
-
export const TopNavigation: (props: SlotHeightProps) => jsx.JSX.Element;
|
|
157
|
-
|
|
158
|
-
// @public (undocumented)
|
|
159
|
-
export const useCustomSkipLink: (id: SkipLinkData['id'], skipLinkTitle: SkipLinkData['skipLinkTitle'], listIndex?: SkipLinkData['listIndex']) => void;
|
|
160
|
-
|
|
161
|
-
// @public
|
|
162
|
-
export const useLeftSidebarFlyoutLock: () => void;
|
|
163
|
-
|
|
164
|
-
// @public (undocumented)
|
|
165
|
-
export const usePageLayoutResize: () => {
|
|
166
|
-
isLeftSidebarCollapsed: boolean;
|
|
167
|
-
expandLeftSidebar: () => void;
|
|
168
|
-
collapseLeftSidebar: (event?: KeyboardEvent_2 | MouseEvent_2, collapseWithoutTransition?: boolean) => void;
|
|
169
|
-
toggleLeftSidebar: (event?: KeyboardEvent_2 | MouseEvent_2, collapseWithoutTransition?: boolean) => void;
|
|
170
|
-
leftSidebarState: LeftSidebarState;
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
// (No @packageDocumentation comment for this package)
|
|
174
|
-
|
|
175
|
-
```
|