@atlaskit/page-layout 1.7.13 → 1.8.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 +85 -79
- package/dist/cjs/common/constants.js +49 -98
- package/dist/cjs/common/hooks/use-is-sidebar-collapsing.js +1 -2
- package/dist/cjs/common/hooks/use-is-sidebar-dragging.js +1 -2
- package/dist/cjs/common/safe-local-storage.js +1 -2
- package/dist/cjs/common/utils.js +10 -19
- package/dist/cjs/components/resize-control/grab-area.js +30 -17
- package/dist/cjs/components/resize-control/index.js +13 -12
- package/dist/cjs/components/resize-control/resize-button.js +1 -2
- package/dist/cjs/components/resize-control/shadow.js +1 -2
- package/dist/cjs/components/skip-links/skip-link-components.js +3 -5
- package/dist/cjs/components/skip-links/use-custom-skip-link.js +2 -3
- package/dist/cjs/components/slots/banner-slot.js +1 -2
- package/dist/cjs/components/slots/content.js +1 -2
- package/dist/cjs/components/slots/internal/left-sidebar-inner.js +1 -2
- package/dist/cjs/components/slots/internal/left-sidebar-outer.js +1 -2
- package/dist/cjs/components/slots/internal/resizable-children-wrapper.js +1 -2
- package/dist/cjs/components/slots/internal/slot-focus-ring.js +1 -2
- package/dist/cjs/components/slots/left-panel.js +1 -2
- package/dist/cjs/components/slots/left-sidebar-without-resize.js +1 -2
- package/dist/cjs/components/slots/left-sidebar.js +5 -4
- package/dist/cjs/components/slots/main.js +1 -2
- package/dist/cjs/components/slots/page-layout.js +1 -2
- package/dist/cjs/components/slots/right-panel.js +1 -2
- package/dist/cjs/components/slots/right-sidebar.js +1 -2
- package/dist/cjs/components/slots/slot-dimensions.js +2 -3
- package/dist/cjs/components/slots/top-navigation.js +1 -2
- package/dist/cjs/controllers/sidebar-resize-context.js +4 -7
- package/dist/cjs/controllers/sidebar-resize-controller.js +9 -10
- package/dist/cjs/controllers/skip-link-context.js +4 -7
- package/dist/cjs/controllers/skip-link-controller.js +2 -3
- package/dist/cjs/controllers/use-page-layout-grid.js +1 -2
- package/dist/cjs/controllers/use-update-css-vars.js +1 -2
- package/dist/es2019/components/resize-control/grab-area.js +31 -18
- package/dist/es2019/components/resize-control/index.js +7 -6
- package/dist/es2019/components/slots/left-sidebar.js +2 -0
- package/dist/esm/components/resize-control/grab-area.js +30 -16
- package/dist/esm/components/resize-control/index.js +12 -10
- package/dist/esm/components/slots/left-sidebar.js +4 -2
- package/dist/esm/controllers/sidebar-resize-controller.js +7 -7
- package/dist/types/common/types.d.ts +10 -2
- package/dist/types/components/resize-control/grab-area.d.ts +3 -1
- package/dist/types/components/resize-control/index.d.ts +1 -1
- package/dist/types/components/resize-control/types.d.ts +1 -0
- package/dist/types-ts4.5/common/types.d.ts +10 -2
- package/dist/types-ts4.5/components/resize-control/grab-area.d.ts +3 -1
- package/dist/types-ts4.5/components/resize-control/index.d.ts +1 -1
- package/dist/types-ts4.5/components/resize-control/types.d.ts +1 -0
- package/package.json +9 -10
- package/report.api.md +1 -0
- package/tmp/api-report-tmp.d.ts +1 -0
|
@@ -79,7 +79,7 @@ export var SidebarResizeController = function SidebarResizeController(_ref) {
|
|
|
79
79
|
setLeftSidebarState(flyoutOpenSidebarState);
|
|
80
80
|
|
|
81
81
|
// Flush the desktop transitions, cleanup, and call the `onExpand` still
|
|
82
|
-
(_transition$current = transition.current) === null || _transition$current === void 0
|
|
82
|
+
(_transition$current = transition.current) === null || _transition$current === void 0 || _transition$current.complete();
|
|
83
83
|
handleDataAttributesAndCb(stableRef.current.onExpand, flyoutOpenSidebarState);
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
@@ -90,7 +90,7 @@ export var SidebarResizeController = function SidebarResizeController(_ref) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
// flush existing transition
|
|
93
|
-
(_transition$current3 = transition.current) === null || _transition$current3 === void 0
|
|
93
|
+
(_transition$current3 = transition.current) === null || _transition$current3 === void 0 || _transition$current3.complete();
|
|
94
94
|
var width = Math.max(lastLeftSidebarWidth, DEFAULT_LEFT_SIDEBAR_WIDTH);
|
|
95
95
|
var updatedLeftSidebarState = {
|
|
96
96
|
isLeftSidebarCollapsed: false,
|
|
@@ -116,7 +116,7 @@ export var SidebarResizeController = function SidebarResizeController(_ref) {
|
|
|
116
116
|
listener: function listener(event) {
|
|
117
117
|
if (event.target === sidebar && event.propertyName === 'width') {
|
|
118
118
|
var _transition$current4;
|
|
119
|
-
(_transition$current4 = transition.current) === null || _transition$current4 === void 0
|
|
119
|
+
(_transition$current4 = transition.current) === null || _transition$current4 === void 0 || _transition$current4.complete();
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
});
|
|
@@ -155,7 +155,7 @@ export var SidebarResizeController = function SidebarResizeController(_ref) {
|
|
|
155
155
|
setLeftSidebarState(flyoutCloseSidebarState);
|
|
156
156
|
|
|
157
157
|
// Flush the desktop transitions, cleanup, and call the `onCollapse` still
|
|
158
|
-
(_transition$current5 = transition.current) === null || _transition$current5 === void 0
|
|
158
|
+
(_transition$current5 = transition.current) === null || _transition$current5 === void 0 || _transition$current5.complete();
|
|
159
159
|
handleDataAttributesAndCb(stableRef.current.onCollapse, flyoutCloseSidebarState);
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
@@ -166,7 +166,7 @@ export var SidebarResizeController = function SidebarResizeController(_ref) {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
// flush existing transition
|
|
169
|
-
(_transition$current7 = transition.current) === null || _transition$current7 === void 0
|
|
169
|
+
(_transition$current7 = transition.current) === null || _transition$current7 === void 0 || _transition$current7.complete();
|
|
170
170
|
|
|
171
171
|
// data-attribute is used as a CSS selector to sync the hiding/showing
|
|
172
172
|
// of the nav contents with expand/collapse animation
|
|
@@ -196,7 +196,7 @@ export var SidebarResizeController = function SidebarResizeController(_ref) {
|
|
|
196
196
|
listener: function listener(event) {
|
|
197
197
|
if (sidebar === event.target && event.propertyName === 'width') {
|
|
198
198
|
var _transition$current8;
|
|
199
|
-
(_transition$current8 = transition.current) === null || _transition$current8 === void 0
|
|
199
|
+
(_transition$current8 = transition.current) === null || _transition$current8 === void 0 || _transition$current8.complete();
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
});
|
|
@@ -230,7 +230,7 @@ export var SidebarResizeController = function SidebarResizeController(_ref) {
|
|
|
230
230
|
useEffect(function mount() {
|
|
231
231
|
return function unmount() {
|
|
232
232
|
var _transition$current9;
|
|
233
|
-
(_transition$current9 = transition.current) === null || _transition$current9 === void 0
|
|
233
|
+
(_transition$current9 = transition.current) === null || _transition$current9 === void 0 || _transition$current9.abort();
|
|
234
234
|
};
|
|
235
235
|
}, []);
|
|
236
236
|
var context = useMemo(function () {
|
|
@@ -42,6 +42,14 @@ export interface LeftSidebarProps extends SlotWidthProps {
|
|
|
42
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.
|
|
43
43
|
*/
|
|
44
44
|
testId?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The `aria-valuetext` allows users relying on assistive technologies,
|
|
47
|
+
* particularly screen readers, to determine the purpose of the slider.
|
|
48
|
+
* The default value is "Width".
|
|
49
|
+
* The aria-valuenow property is automatically appended to the valueTextLabel.
|
|
50
|
+
* For Example, valueTextLabel="Width" will render aria-valuetext="Width 62%”.
|
|
51
|
+
*/
|
|
52
|
+
valueTextLabel?: string;
|
|
45
53
|
/**
|
|
46
54
|
* You can override prop(s) for the mentioned component(s).
|
|
47
55
|
*/
|
|
@@ -51,11 +59,11 @@ export interface LeftSidebarProps extends SlotWidthProps {
|
|
|
51
59
|
};
|
|
52
60
|
};
|
|
53
61
|
/**
|
|
54
|
-
* Display label for grab area
|
|
62
|
+
* Display label for grab area/slider to resize the left side bar. This will be rendered through assistive technologies.
|
|
55
63
|
*/
|
|
56
64
|
resizeGrabAreaLabel?: string;
|
|
57
65
|
/**
|
|
58
|
-
* Display label for
|
|
66
|
+
* Display label for expand/collapse button for the left sidebar.
|
|
59
67
|
*/
|
|
60
68
|
resizeButtonLabel?: string;
|
|
61
69
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ComponentProps, FocusEvent, KeyboardEvent, MouseEvent } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
+
import { LeftSidebarProps } from '../../common/types';
|
|
4
5
|
export type GrabAreaProps = {
|
|
5
6
|
isDisabled: boolean;
|
|
6
7
|
isLeftSidebarCollapsed: boolean;
|
|
@@ -11,6 +12,7 @@ export type GrabAreaProps = {
|
|
|
11
12
|
onKeyDown: (event: KeyboardEvent<HTMLButtonElement>) => void;
|
|
12
13
|
onMouseDown: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
13
14
|
testId?: string;
|
|
15
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
14
16
|
} & ComponentProps<'button'>;
|
|
15
|
-
declare const GrabArea: ({ testId, isDisabled, isLeftSidebarCollapsed, label, leftSidebarPercentageExpanded, onKeyDown, onMouseDown, onBlur, onFocus, ...rest }: GrabAreaProps) => jsx.JSX.Element;
|
|
17
|
+
declare const GrabArea: ({ testId, valueTextLabel, isDisabled, isLeftSidebarCollapsed, label, leftSidebarPercentageExpanded, onKeyDown, onMouseDown, onBlur, onFocus, ref, ...rest }: GrabAreaProps & Partial<LeftSidebarProps>) => jsx.JSX.Element;
|
|
16
18
|
export default GrabArea;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { ResizeControlProps } from './types';
|
|
3
|
-
declare const ResizeControl: ({ testId, overrides, resizeButtonLabel, resizeGrabAreaLabel, onResizeStart, onResizeEnd, }: ResizeControlProps) => jsx.JSX.Element;
|
|
3
|
+
declare const ResizeControl: ({ testId, overrides, resizeButtonLabel, valueTextLabel, resizeGrabAreaLabel, onResizeStart, onResizeEnd, }: ResizeControlProps) => jsx.JSX.Element;
|
|
4
4
|
export default ResizeControl;
|
|
@@ -12,6 +12,7 @@ export type ResizeControlProps = {
|
|
|
12
12
|
render?: (Component: ElementType<ResizeButtonProps>, props: ResizeButtonProps) => ReactElement;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
+
valueTextLabel?: string;
|
|
15
16
|
resizeGrabAreaLabel?: string;
|
|
16
17
|
resizeButtonLabel?: string;
|
|
17
18
|
onCollapse?: (leftSidebarState: LeftSidebarState) => void;
|
|
@@ -42,6 +42,14 @@ export interface LeftSidebarProps extends SlotWidthProps {
|
|
|
42
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.
|
|
43
43
|
*/
|
|
44
44
|
testId?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The `aria-valuetext` allows users relying on assistive technologies,
|
|
47
|
+
* particularly screen readers, to determine the purpose of the slider.
|
|
48
|
+
* The default value is "Width".
|
|
49
|
+
* The aria-valuenow property is automatically appended to the valueTextLabel.
|
|
50
|
+
* For Example, valueTextLabel="Width" will render aria-valuetext="Width 62%”.
|
|
51
|
+
*/
|
|
52
|
+
valueTextLabel?: string;
|
|
45
53
|
/**
|
|
46
54
|
* You can override prop(s) for the mentioned component(s).
|
|
47
55
|
*/
|
|
@@ -51,11 +59,11 @@ export interface LeftSidebarProps extends SlotWidthProps {
|
|
|
51
59
|
};
|
|
52
60
|
};
|
|
53
61
|
/**
|
|
54
|
-
* Display label for grab area
|
|
62
|
+
* Display label for grab area/slider to resize the left side bar. This will be rendered through assistive technologies.
|
|
55
63
|
*/
|
|
56
64
|
resizeGrabAreaLabel?: string;
|
|
57
65
|
/**
|
|
58
|
-
* Display label for
|
|
66
|
+
* Display label for expand/collapse button for the left sidebar.
|
|
59
67
|
*/
|
|
60
68
|
resizeButtonLabel?: string;
|
|
61
69
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ComponentProps, FocusEvent, KeyboardEvent, MouseEvent } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
+
import { LeftSidebarProps } from '../../common/types';
|
|
4
5
|
export type GrabAreaProps = {
|
|
5
6
|
isDisabled: boolean;
|
|
6
7
|
isLeftSidebarCollapsed: boolean;
|
|
@@ -11,6 +12,7 @@ export type GrabAreaProps = {
|
|
|
11
12
|
onKeyDown: (event: KeyboardEvent<HTMLButtonElement>) => void;
|
|
12
13
|
onMouseDown: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
13
14
|
testId?: string;
|
|
15
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
14
16
|
} & ComponentProps<'button'>;
|
|
15
|
-
declare const GrabArea: ({ testId, isDisabled, isLeftSidebarCollapsed, label, leftSidebarPercentageExpanded, onKeyDown, onMouseDown, onBlur, onFocus, ...rest }: GrabAreaProps) => jsx.JSX.Element;
|
|
17
|
+
declare const GrabArea: ({ testId, valueTextLabel, isDisabled, isLeftSidebarCollapsed, label, leftSidebarPercentageExpanded, onKeyDown, onMouseDown, onBlur, onFocus, ref, ...rest }: GrabAreaProps & Partial<LeftSidebarProps>) => jsx.JSX.Element;
|
|
16
18
|
export default GrabArea;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { ResizeControlProps } from './types';
|
|
3
|
-
declare const ResizeControl: ({ testId, overrides, resizeButtonLabel, resizeGrabAreaLabel, onResizeStart, onResizeEnd, }: ResizeControlProps) => jsx.JSX.Element;
|
|
3
|
+
declare const ResizeControl: ({ testId, overrides, resizeButtonLabel, valueTextLabel, resizeGrabAreaLabel, onResizeStart, onResizeEnd, }: ResizeControlProps) => jsx.JSX.Element;
|
|
4
4
|
export default ResizeControl;
|
|
@@ -12,6 +12,7 @@ export type ResizeControlProps = {
|
|
|
12
12
|
render?: (Component: ElementType<ResizeButtonProps>, props: ResizeButtonProps) => ReactElement;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
+
valueTextLabel?: string;
|
|
15
16
|
resizeGrabAreaLabel?: string;
|
|
16
17
|
resizeButtonLabel?: string;
|
|
17
18
|
onCollapse?: (leftSidebarState: LeftSidebarState) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/page-layout",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.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/"
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
37
37
|
"@atlaskit/icon": "^21.12.0",
|
|
38
|
-
"@atlaskit/motion": "^1.
|
|
38
|
+
"@atlaskit/motion": "^1.5.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
40
|
-
"@atlaskit/primitives": "^1.
|
|
40
|
+
"@atlaskit/primitives": "^1.6.0",
|
|
41
41
|
"@atlaskit/theme": "^12.6.0",
|
|
42
|
-
"@atlaskit/tokens": "^1.
|
|
42
|
+
"@atlaskit/tokens": "^1.26.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"@emotion/react": "^11.7.1",
|
|
45
45
|
"bind-event-listener": "^2.1.1",
|
|
@@ -51,16 +51,15 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@af/accessibility-testing": "*",
|
|
54
|
-
"@atlaskit/atlassian-navigation": "^2.
|
|
54
|
+
"@atlaskit/atlassian-navigation": "^2.8.0",
|
|
55
55
|
"@atlaskit/atlassian-notifications": "^0.4.0",
|
|
56
|
-
"@atlaskit/drawer": "^7.
|
|
57
|
-
"@atlaskit/icon": "*",
|
|
56
|
+
"@atlaskit/drawer": "^7.6.0",
|
|
58
57
|
"@atlaskit/logo": "^13.14.0",
|
|
59
|
-
"@atlaskit/menu": "^
|
|
58
|
+
"@atlaskit/menu": "^2.0.0",
|
|
60
59
|
"@atlaskit/notification-indicator": "^9.1.0",
|
|
61
60
|
"@atlaskit/notification-log-client": "^6.1.0",
|
|
62
|
-
"@atlaskit/popup": "^1.
|
|
63
|
-
"@atlaskit/side-navigation": "^
|
|
61
|
+
"@atlaskit/popup": "^1.11.0",
|
|
62
|
+
"@atlaskit/side-navigation": "^3.0.0",
|
|
64
63
|
"@atlaskit/ssr": "*",
|
|
65
64
|
"@atlaskit/tooltip": "*",
|
|
66
65
|
"@atlaskit/visual-regression": "*",
|
package/report.api.md
CHANGED