@atlaskit/drawer 7.12.4 → 7.13.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 +8 -0
- package/dist/cjs/components/index.js +4 -2
- package/dist/cjs/components/primitives/index.js +9 -5
- package/dist/cjs/constants.js +2 -1
- package/dist/es2019/components/index.js +4 -2
- package/dist/es2019/components/primitives/index.js +8 -5
- package/dist/es2019/constants.js +1 -0
- package/dist/esm/components/index.js +4 -2
- package/dist/esm/components/primitives/index.js +9 -5
- package/dist/esm/constants.js +1 -0
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/components/primitives/index.d.ts +1 -1
- package/dist/types/components/types.d.ts +5 -0
- package/dist/types/constants.d.ts +2 -0
- package/dist/types-ts4.5/components/index.d.ts +2 -2
- package/dist/types-ts4.5/components/primitives/index.d.ts +1 -1
- package/dist/types-ts4.5/components/types.d.ts +5 -0
- package/dist/types-ts4.5/constants.d.ts +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/drawer
|
|
2
2
|
|
|
3
|
+
## 7.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#116848](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116848)
|
|
8
|
+
[`9b4398682d67b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9b4398682d67b) -
|
|
9
|
+
Drawer can be configured to enter from any direction
|
|
10
|
+
|
|
3
11
|
## 7.12.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -29,7 +29,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
29
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
30
30
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
31
31
|
var packageName = "@atlaskit/drawer";
|
|
32
|
-
var packageVersion = "7.
|
|
32
|
+
var packageVersion = "7.13.0";
|
|
33
33
|
var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
|
|
34
34
|
var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
|
|
35
35
|
return createAndFireEventOnAtlaskit({
|
|
@@ -154,7 +154,8 @@ var DrawerBase = exports.DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
154
154
|
_this$props3$zIndex = _this$props3.zIndex,
|
|
155
155
|
zIndex = _this$props3$zIndex === void 0 ? 'unset' : _this$props3$zIndex,
|
|
156
156
|
label = _this$props3.label,
|
|
157
|
-
titleId = _this$props3.titleId
|
|
157
|
+
titleId = _this$props3.titleId,
|
|
158
|
+
enterFrom = _this$props3.enterFrom;
|
|
158
159
|
var shouldHaveLayeringEnabled = (0, _platformFeatureFlags.fg)('platform.design-system-team.inline-message-layering_wfp1p') && isOpen;
|
|
159
160
|
return /*#__PURE__*/_react.default.createElement(_portal.default, {
|
|
160
161
|
zIndex: zIndex
|
|
@@ -171,6 +172,7 @@ var DrawerBase = exports.DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
171
172
|
onCloseComplete: onCloseComplete,
|
|
172
173
|
onOpenComplete: onOpenComplete,
|
|
173
174
|
width: width,
|
|
175
|
+
enterFrom: enterFrom,
|
|
174
176
|
label: label,
|
|
175
177
|
titleId: titleId,
|
|
176
178
|
shouldUnmountOnExit: shouldUnmountOnExit
|
|
@@ -38,7 +38,8 @@ var defaults = {
|
|
|
38
38
|
*/
|
|
39
39
|
var CustomSlideIn = function CustomSlideIn(_ref) {
|
|
40
40
|
var children = _ref.children,
|
|
41
|
-
onFinish = _ref.onFinish
|
|
41
|
+
onFinish = _ref.onFinish,
|
|
42
|
+
enterFrom = _ref.enterFrom;
|
|
42
43
|
var _useExitingPersistenc = (0, _motion.useExitingPersistence)(),
|
|
43
44
|
isExiting = _useExitingPersistenc.isExiting;
|
|
44
45
|
|
|
@@ -51,8 +52,8 @@ var CustomSlideIn = function CustomSlideIn(_ref) {
|
|
|
51
52
|
return (0, _react2.jsx)(_motion.SlideIn, {
|
|
52
53
|
animationTimingFunction: _constants.animationTimingFunction,
|
|
53
54
|
duration: duration,
|
|
54
|
-
enterFrom:
|
|
55
|
-
exitTo:
|
|
55
|
+
enterFrom: enterFrom,
|
|
56
|
+
exitTo: enterFrom,
|
|
56
57
|
fade: "none",
|
|
57
58
|
onFinish: onFinish
|
|
58
59
|
}, children);
|
|
@@ -74,7 +75,9 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
74
75
|
isFocusLockEnabled = _ref2.isFocusLockEnabled,
|
|
75
76
|
width = _ref2.width,
|
|
76
77
|
label = _ref2.label,
|
|
77
|
-
titleId = _ref2.titleId
|
|
78
|
+
titleId = _ref2.titleId,
|
|
79
|
+
_ref2$enterFrom = _ref2.enterFrom,
|
|
80
|
+
enterFrom = _ref2$enterFrom === void 0 ? 'left' : _ref2$enterFrom;
|
|
78
81
|
var getOverrides = (0, _utils.createExtender)(defaults, overrides);
|
|
79
82
|
var _getOverrides = getOverrides('Sidebar'),
|
|
80
83
|
Sidebar = _getOverrides.component,
|
|
@@ -97,7 +100,8 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
97
100
|
return (0, _react2.jsx)(_motion.ExitingPersistence, {
|
|
98
101
|
appear: true
|
|
99
102
|
}, isOpen && (0, _react2.jsx)(CustomSlideIn, {
|
|
100
|
-
onFinish: onFinish
|
|
103
|
+
onFinish: onFinish,
|
|
104
|
+
enterFrom: enterFrom
|
|
101
105
|
}, function (_ref3) {
|
|
102
106
|
var className = _ref3.className;
|
|
103
107
|
return (0, _react2.jsx)(_focusLock.default, {
|
package/dist/cjs/constants.js
CHANGED
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.widths = exports.transitionTimingFunction = exports.transitionDurationMs = exports.transitionDuration = exports.defaultFocusLockSettings = exports.animationTimingFunction = void 0;
|
|
6
|
+
exports.widths = exports.transitionTimingFunction = exports.transitionDurationMs = exports.transitionDuration = exports.directions = exports.defaultFocusLockSettings = exports.animationTimingFunction = void 0;
|
|
7
7
|
var _curves = require("@atlaskit/motion/curves");
|
|
8
8
|
var transitionDuration = exports.transitionDuration = '0.22s';
|
|
9
9
|
var transitionDurationMs = exports.transitionDurationMs = 220;
|
|
10
10
|
var transitionTimingFunction = exports.transitionTimingFunction = _curves.easeOut;
|
|
11
11
|
var widths = exports.widths = ['narrow', 'medium', 'wide', 'extended', 'full'];
|
|
12
|
+
var directions = exports.directions = ['top', 'right', 'bottom', 'left'];
|
|
12
13
|
var animationTimingFunction = exports.animationTimingFunction = function animationTimingFunction() {
|
|
13
14
|
return _curves.easeOut;
|
|
14
15
|
};
|
|
@@ -10,7 +10,7 @@ import { defaultFocusLockSettings } from '../constants';
|
|
|
10
10
|
import Blanket from './blanket';
|
|
11
11
|
import DrawerPrimitive from './primitives';
|
|
12
12
|
const packageName = "@atlaskit/drawer";
|
|
13
|
-
const packageVersion = "7.
|
|
13
|
+
const packageVersion = "7.13.0";
|
|
14
14
|
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
15
15
|
const createAndFireOnClick = (createAnalyticsEvent, trigger) => createAndFireEventOnAtlaskit({
|
|
16
16
|
action: 'dismissed',
|
|
@@ -123,7 +123,8 @@ export class DrawerBase extends Component {
|
|
|
123
123
|
overrides,
|
|
124
124
|
zIndex = 'unset',
|
|
125
125
|
label,
|
|
126
|
-
titleId
|
|
126
|
+
titleId,
|
|
127
|
+
enterFrom
|
|
127
128
|
} = this.props;
|
|
128
129
|
const shouldHaveLayeringEnabled = fg('platform.design-system-team.inline-message-layering_wfp1p') && isOpen;
|
|
129
130
|
return /*#__PURE__*/React.createElement(Portal, {
|
|
@@ -141,6 +142,7 @@ export class DrawerBase extends Component {
|
|
|
141
142
|
onCloseComplete: onCloseComplete,
|
|
142
143
|
onOpenComplete: onOpenComplete,
|
|
143
144
|
width: width,
|
|
145
|
+
enterFrom: enterFrom,
|
|
144
146
|
label: label,
|
|
145
147
|
titleId: titleId,
|
|
146
148
|
shouldUnmountOnExit: shouldUnmountOnExit
|
|
@@ -31,7 +31,8 @@ const defaults = {
|
|
|
31
31
|
*/
|
|
32
32
|
const CustomSlideIn = ({
|
|
33
33
|
children,
|
|
34
|
-
onFinish
|
|
34
|
+
onFinish,
|
|
35
|
+
enterFrom
|
|
35
36
|
}) => {
|
|
36
37
|
const {
|
|
37
38
|
isExiting
|
|
@@ -46,8 +47,8 @@ const CustomSlideIn = ({
|
|
|
46
47
|
return jsx(SlideIn, {
|
|
47
48
|
animationTimingFunction: animationTimingFunction,
|
|
48
49
|
duration: duration,
|
|
49
|
-
enterFrom:
|
|
50
|
-
exitTo:
|
|
50
|
+
enterFrom: enterFrom,
|
|
51
|
+
exitTo: enterFrom,
|
|
51
52
|
fade: "none",
|
|
52
53
|
onFinish: onFinish
|
|
53
54
|
}, children);
|
|
@@ -68,7 +69,8 @@ const DrawerPrimitive = ({
|
|
|
68
69
|
isFocusLockEnabled,
|
|
69
70
|
width,
|
|
70
71
|
label,
|
|
71
|
-
titleId
|
|
72
|
+
titleId,
|
|
73
|
+
enterFrom = 'left'
|
|
72
74
|
}) => {
|
|
73
75
|
const getOverrides = createExtender(defaults, overrides);
|
|
74
76
|
const {
|
|
@@ -94,7 +96,8 @@ const DrawerPrimitive = ({
|
|
|
94
96
|
return jsx(ExitingPersistence, {
|
|
95
97
|
appear: true
|
|
96
98
|
}, isOpen && jsx(CustomSlideIn, {
|
|
97
|
-
onFinish: onFinish
|
|
99
|
+
onFinish: onFinish,
|
|
100
|
+
enterFrom: enterFrom
|
|
98
101
|
}, ({
|
|
99
102
|
className
|
|
100
103
|
}) => jsx(FocusLock, {
|
package/dist/es2019/constants.js
CHANGED
|
@@ -3,6 +3,7 @@ export const transitionDuration = '0.22s';
|
|
|
3
3
|
export const transitionDurationMs = 220;
|
|
4
4
|
export const transitionTimingFunction = easeOut;
|
|
5
5
|
export const widths = ['narrow', 'medium', 'wide', 'extended', 'full'];
|
|
6
|
+
export const directions = ['top', 'right', 'bottom', 'left'];
|
|
6
7
|
export const animationTimingFunction = () => easeOut;
|
|
7
8
|
export const defaultFocusLockSettings = {
|
|
8
9
|
isFocusLockEnabled: true,
|
|
@@ -20,7 +20,7 @@ import { defaultFocusLockSettings } from '../constants';
|
|
|
20
20
|
import Blanket from './blanket';
|
|
21
21
|
import DrawerPrimitive from './primitives';
|
|
22
22
|
var packageName = "@atlaskit/drawer";
|
|
23
|
-
var packageVersion = "7.
|
|
23
|
+
var packageVersion = "7.13.0";
|
|
24
24
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
25
25
|
var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
|
|
26
26
|
return createAndFireEventOnAtlaskit({
|
|
@@ -145,7 +145,8 @@ export var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
145
145
|
_this$props3$zIndex = _this$props3.zIndex,
|
|
146
146
|
zIndex = _this$props3$zIndex === void 0 ? 'unset' : _this$props3$zIndex,
|
|
147
147
|
label = _this$props3.label,
|
|
148
|
-
titleId = _this$props3.titleId
|
|
148
|
+
titleId = _this$props3.titleId,
|
|
149
|
+
enterFrom = _this$props3.enterFrom;
|
|
149
150
|
var shouldHaveLayeringEnabled = fg('platform.design-system-team.inline-message-layering_wfp1p') && isOpen;
|
|
150
151
|
return /*#__PURE__*/React.createElement(Portal, {
|
|
151
152
|
zIndex: zIndex
|
|
@@ -162,6 +163,7 @@ export var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
162
163
|
onCloseComplete: onCloseComplete,
|
|
163
164
|
onOpenComplete: onOpenComplete,
|
|
164
165
|
width: width,
|
|
166
|
+
enterFrom: enterFrom,
|
|
165
167
|
label: label,
|
|
166
168
|
titleId: titleId,
|
|
167
169
|
shouldUnmountOnExit: shouldUnmountOnExit
|
|
@@ -34,7 +34,8 @@ var defaults = {
|
|
|
34
34
|
*/
|
|
35
35
|
var CustomSlideIn = function CustomSlideIn(_ref) {
|
|
36
36
|
var children = _ref.children,
|
|
37
|
-
onFinish = _ref.onFinish
|
|
37
|
+
onFinish = _ref.onFinish,
|
|
38
|
+
enterFrom = _ref.enterFrom;
|
|
38
39
|
var _useExitingPersistenc = useExitingPersistence(),
|
|
39
40
|
isExiting = _useExitingPersistenc.isExiting;
|
|
40
41
|
|
|
@@ -47,8 +48,8 @@ var CustomSlideIn = function CustomSlideIn(_ref) {
|
|
|
47
48
|
return jsx(SlideIn, {
|
|
48
49
|
animationTimingFunction: animationTimingFunction,
|
|
49
50
|
duration: duration,
|
|
50
|
-
enterFrom:
|
|
51
|
-
exitTo:
|
|
51
|
+
enterFrom: enterFrom,
|
|
52
|
+
exitTo: enterFrom,
|
|
52
53
|
fade: "none",
|
|
53
54
|
onFinish: onFinish
|
|
54
55
|
}, children);
|
|
@@ -70,7 +71,9 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
70
71
|
isFocusLockEnabled = _ref2.isFocusLockEnabled,
|
|
71
72
|
width = _ref2.width,
|
|
72
73
|
label = _ref2.label,
|
|
73
|
-
titleId = _ref2.titleId
|
|
74
|
+
titleId = _ref2.titleId,
|
|
75
|
+
_ref2$enterFrom = _ref2.enterFrom,
|
|
76
|
+
enterFrom = _ref2$enterFrom === void 0 ? 'left' : _ref2$enterFrom;
|
|
74
77
|
var getOverrides = createExtender(defaults, overrides);
|
|
75
78
|
var _getOverrides = getOverrides('Sidebar'),
|
|
76
79
|
Sidebar = _getOverrides.component,
|
|
@@ -93,7 +96,8 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
93
96
|
return jsx(ExitingPersistence, {
|
|
94
97
|
appear: true
|
|
95
98
|
}, isOpen && jsx(CustomSlideIn, {
|
|
96
|
-
onFinish: onFinish
|
|
99
|
+
onFinish: onFinish,
|
|
100
|
+
enterFrom: enterFrom
|
|
97
101
|
}, function (_ref3) {
|
|
98
102
|
var className = _ref3.className;
|
|
99
103
|
return jsx(FocusLock, {
|
package/dist/esm/constants.js
CHANGED
|
@@ -3,6 +3,7 @@ export var transitionDuration = '0.22s';
|
|
|
3
3
|
export var transitionDurationMs = 220;
|
|
4
4
|
export var transitionTimingFunction = easeOut;
|
|
5
5
|
export var widths = ['narrow', 'medium', 'wide', 'extended', 'full'];
|
|
6
|
+
export var directions = ['top', 'right', 'bottom', 'left'];
|
|
6
7
|
export var animationTimingFunction = function animationTimingFunction() {
|
|
7
8
|
return easeOut;
|
|
8
9
|
};
|
|
@@ -22,10 +22,10 @@ export declare class DrawerBase extends Component<DrawerProps, {
|
|
|
22
22
|
handleKeyDown: (event: KeyboardEvent) => void;
|
|
23
23
|
render(): JSX.Element | null;
|
|
24
24
|
}
|
|
25
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "scrollContentLabel" | "children" | "onKeyDown" | "onClose" | "testId" | "icon" | "closeLabel" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | keyof import("./types").DrawerLabel> & Partial<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "width" | keyof import("./types").FocusLockSettings>> & Partial<Pick<{
|
|
25
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "scrollContentLabel" | "children" | "onKeyDown" | "onClose" | "testId" | "icon" | "closeLabel" | "enterFrom" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | keyof import("./types").DrawerLabel> & Partial<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "width" | keyof import("./types").FocusLockSettings>> & Partial<Pick<{
|
|
26
26
|
autoFocusFirstElem?: boolean | (() => HTMLElement | null) | undefined;
|
|
27
27
|
isFocusLockEnabled?: boolean | undefined;
|
|
28
28
|
shouldReturnFocus?: boolean | React.RefObject<HTMLElement> | undefined;
|
|
29
29
|
width: DrawerWidth;
|
|
30
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "scrollContentLabel" | "width" | "children" | "onKeyDown" | "key" | "onClose" | "testId" | "icon" | "closeLabel" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | "analyticsContext" | keyof import("./types").FocusLockSettings | keyof import("./types").DrawerLabel> & React.RefAttributes<any>>;
|
|
30
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "scrollContentLabel" | "width" | "children" | "onKeyDown" | "key" | "onClose" | "testId" | "icon" | "closeLabel" | "enterFrom" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | "analyticsContext" | keyof import("./types").FocusLockSettings | keyof import("./types").DrawerLabel> & React.RefAttributes<any>>;
|
|
31
31
|
export default _default;
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
import { type DrawerPrimitiveProps } from '../types';
|
|
7
|
-
declare const DrawerPrimitive: ({ children, icon: Icon, closeLabel, scrollContentLabel, onClose, onCloseComplete, onOpenComplete, overrides, testId, in: isOpen, shouldReturnFocus, autoFocusFirstElem, isFocusLockEnabled, width, label, titleId, }: DrawerPrimitiveProps) => jsx.JSX.Element;
|
|
7
|
+
declare const DrawerPrimitive: ({ children, icon: Icon, closeLabel, scrollContentLabel, onClose, onCloseComplete, onOpenComplete, overrides, testId, in: isOpen, shouldReturnFocus, autoFocusFirstElem, isFocusLockEnabled, width, label, titleId, enterFrom, }: DrawerPrimitiveProps) => jsx.JSX.Element;
|
|
8
8
|
export default DrawerPrimitive;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ComponentType, type ReactElement, type ReactNode, type RefObject, type SyntheticEvent } from 'react';
|
|
2
2
|
import { type CSSObject } from '@emotion/react';
|
|
3
3
|
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
|
+
import { type Direction } from '@atlaskit/motion';
|
|
4
5
|
export type Widths = {
|
|
5
6
|
extended: {
|
|
6
7
|
width: string;
|
|
@@ -44,6 +45,10 @@ export interface BaseProps {
|
|
|
44
45
|
* Sets the width of the drawer.
|
|
45
46
|
*/
|
|
46
47
|
width?: DrawerWidth;
|
|
48
|
+
/**
|
|
49
|
+
* Sets the direction the draw enters from. The default is "left".
|
|
50
|
+
*/
|
|
51
|
+
enterFrom?: Direction;
|
|
47
52
|
/**
|
|
48
53
|
* A callback function that will be called when the drawer has finished its opening transition.
|
|
49
54
|
*/
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { Direction } from '@atlaskit/motion';
|
|
1
2
|
import type { DrawerWidth, FocusLockSettings } from './components/types';
|
|
2
3
|
export declare const transitionDuration = "0.22s";
|
|
3
4
|
export declare const transitionDurationMs = 220;
|
|
4
5
|
export declare const transitionTimingFunction: import("@atlaskit/motion/curves").AnimationCurve;
|
|
5
6
|
export declare const widths: DrawerWidth[];
|
|
7
|
+
export declare const directions: Direction[];
|
|
6
8
|
export declare const animationTimingFunction: () => import("@atlaskit/motion/curves").AnimationCurve;
|
|
7
9
|
export declare const defaultFocusLockSettings: FocusLockSettings;
|
|
@@ -22,10 +22,10 @@ export declare class DrawerBase extends Component<DrawerProps, {
|
|
|
22
22
|
handleKeyDown: (event: KeyboardEvent) => void;
|
|
23
23
|
render(): JSX.Element | null;
|
|
24
24
|
}
|
|
25
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "scrollContentLabel" | "children" | "onKeyDown" | "onClose" | "testId" | "icon" | "closeLabel" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | keyof import("./types").DrawerLabel> & Partial<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "width" | keyof import("./types").FocusLockSettings>> & Partial<Pick<{
|
|
25
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "scrollContentLabel" | "children" | "onKeyDown" | "onClose" | "testId" | "icon" | "closeLabel" | "enterFrom" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | keyof import("./types").DrawerLabel> & Partial<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "width" | keyof import("./types").FocusLockSettings>> & Partial<Pick<{
|
|
26
26
|
autoFocusFirstElem?: boolean | (() => HTMLElement | null) | undefined;
|
|
27
27
|
isFocusLockEnabled?: boolean | undefined;
|
|
28
28
|
shouldReturnFocus?: boolean | React.RefObject<HTMLElement> | undefined;
|
|
29
29
|
width: DrawerWidth;
|
|
30
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "scrollContentLabel" | "width" | "children" | "onKeyDown" | "key" | "onClose" | "testId" | "icon" | "closeLabel" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | "analyticsContext" | keyof import("./types").FocusLockSettings | keyof import("./types").DrawerLabel> & React.RefAttributes<any>>;
|
|
30
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "scrollContentLabel" | "width" | "children" | "onKeyDown" | "key" | "onClose" | "testId" | "icon" | "closeLabel" | "enterFrom" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | "analyticsContext" | keyof import("./types").FocusLockSettings | keyof import("./types").DrawerLabel> & React.RefAttributes<any>>;
|
|
31
31
|
export default _default;
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
import { type DrawerPrimitiveProps } from '../types';
|
|
7
|
-
declare const DrawerPrimitive: ({ children, icon: Icon, closeLabel, scrollContentLabel, onClose, onCloseComplete, onOpenComplete, overrides, testId, in: isOpen, shouldReturnFocus, autoFocusFirstElem, isFocusLockEnabled, width, label, titleId, }: DrawerPrimitiveProps) => jsx.JSX.Element;
|
|
7
|
+
declare const DrawerPrimitive: ({ children, icon: Icon, closeLabel, scrollContentLabel, onClose, onCloseComplete, onOpenComplete, overrides, testId, in: isOpen, shouldReturnFocus, autoFocusFirstElem, isFocusLockEnabled, width, label, titleId, enterFrom, }: DrawerPrimitiveProps) => jsx.JSX.Element;
|
|
8
8
|
export default DrawerPrimitive;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ComponentType, type ReactElement, type ReactNode, type RefObject, type SyntheticEvent } from 'react';
|
|
2
2
|
import { type CSSObject } from '@emotion/react';
|
|
3
3
|
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
|
+
import { type Direction } from '@atlaskit/motion';
|
|
4
5
|
export type Widths = {
|
|
5
6
|
extended: {
|
|
6
7
|
width: string;
|
|
@@ -44,6 +45,10 @@ export interface BaseProps {
|
|
|
44
45
|
* Sets the width of the drawer.
|
|
45
46
|
*/
|
|
46
47
|
width?: DrawerWidth;
|
|
48
|
+
/**
|
|
49
|
+
* Sets the direction the draw enters from. The default is "left".
|
|
50
|
+
*/
|
|
51
|
+
enterFrom?: Direction;
|
|
47
52
|
/**
|
|
48
53
|
* A callback function that will be called when the drawer has finished its opening transition.
|
|
49
54
|
*/
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { Direction } from '@atlaskit/motion';
|
|
1
2
|
import type { DrawerWidth, FocusLockSettings } from './components/types';
|
|
2
3
|
export declare const transitionDuration = "0.22s";
|
|
3
4
|
export declare const transitionDurationMs = 220;
|
|
4
5
|
export declare const transitionTimingFunction: import("@atlaskit/motion/curves").AnimationCurve;
|
|
5
6
|
export declare const widths: DrawerWidth[];
|
|
7
|
+
export declare const directions: Direction[];
|
|
6
8
|
export declare const animationTimingFunction: () => import("@atlaskit/motion/curves").AnimationCurve;
|
|
7
9
|
export declare const defaultFocusLockSettings: FocusLockSettings;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/drawer",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.13.0",
|
|
4
4
|
"description": "A drawer is a panel that slides in from the left side of the screen.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
44
44
|
"@atlaskit/blanket": "^13.2.0",
|
|
45
|
-
"@atlaskit/button": "^18.
|
|
45
|
+
"@atlaskit/button": "^18.1.0",
|
|
46
46
|
"@atlaskit/icon": "^22.5.0",
|
|
47
47
|
"@atlaskit/layering": "^0.3.0",
|
|
48
48
|
"@atlaskit/motion": "^1.7.0",
|