@atlaskit/drawer 7.12.4 → 7.13.1
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 +16 -0
- package/dist/cjs/components/index.js +16 -4
- package/dist/cjs/components/primitives/content.js +3 -2
- package/dist/cjs/components/primitives/index.js +9 -5
- package/dist/cjs/components/primitives/sidebar.js +3 -2
- package/dist/cjs/constants.js +2 -1
- package/dist/es2019/components/index.js +17 -4
- package/dist/es2019/components/primitives/content.js +3 -2
- package/dist/es2019/components/primitives/index.js +8 -5
- package/dist/es2019/components/primitives/sidebar.js +3 -2
- package/dist/es2019/constants.js +1 -0
- package/dist/esm/components/index.js +17 -4
- package/dist/esm/components/primitives/content.js +3 -2
- package/dist/esm/components/primitives/index.js +9 -5
- package/dist/esm/components/primitives/sidebar.js +3 -2
- package/dist/esm/constants.js +1 -0
- package/dist/types/components/index.d.ts +12 -3
- package/dist/types/components/primitives/content.d.ts +2 -2
- package/dist/types/components/primitives/index.d.ts +1 -1
- package/dist/types/components/primitives/sidebar.d.ts +2 -2
- 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 +12 -3
- package/dist/types-ts4.5/components/primitives/content.d.ts +2 -2
- package/dist/types-ts4.5/components/primitives/index.d.ts +1 -1
- package/dist/types-ts4.5/components/primitives/sidebar.d.ts +2 -2
- package/dist/types-ts4.5/components/types.d.ts +5 -0
- package/dist/types-ts4.5/constants.d.ts +2 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/drawer
|
|
2
2
|
|
|
3
|
+
## 7.13.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#120049](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120049)
|
|
8
|
+
[`77504ff274f72`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77504ff274f72) -
|
|
9
|
+
DSP-19576: Assign names to anonymous default exports
|
|
10
|
+
|
|
11
|
+
## 7.13.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#116848](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116848)
|
|
16
|
+
[`9b4398682d67b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9b4398682d67b) -
|
|
17
|
+
Drawer can be configured to enter from any direction
|
|
18
|
+
|
|
3
19
|
## 7.12.4
|
|
4
20
|
|
|
5
21
|
### 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.1";
|
|
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
|
|
@@ -191,11 +193,21 @@ var DrawerBase = exports.DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
191
193
|
}]);
|
|
192
194
|
return DrawerBase;
|
|
193
195
|
}(_react.Component);
|
|
196
|
+
/**
|
|
197
|
+
* __Drawer__
|
|
198
|
+
*
|
|
199
|
+
* A drawer is a panel that slides in from the left side of the screen.
|
|
200
|
+
*
|
|
201
|
+
* - [Examples](https://atlassian.design/components/drawer/examples)
|
|
202
|
+
* - [Code](https://atlassian.design/components/drawer/code)
|
|
203
|
+
* - [Usage](https://atlassian.design/components/drawer/usage)
|
|
204
|
+
*/
|
|
194
205
|
(0, _defineProperty2.default)(DrawerBase, "defaultProps", _objectSpread({
|
|
195
206
|
width: 'narrow'
|
|
196
207
|
}, _constants.defaultFocusLockSettings));
|
|
197
|
-
var
|
|
208
|
+
var Drawer = (0, _analyticsNext.withAnalyticsContext)({
|
|
198
209
|
componentName: 'drawer',
|
|
199
210
|
packageName: packageName,
|
|
200
211
|
packageVersion: packageVersion
|
|
201
|
-
})((0, _analyticsNext.withAnalyticsEvents)()(DrawerBase));
|
|
212
|
+
})((0, _analyticsNext.withAnalyticsEvents)()(DrawerBase));
|
|
213
|
+
var _default = exports.default = Drawer;
|
|
@@ -62,7 +62,8 @@ var Content = function Content(_ref) {
|
|
|
62
62
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
63
63
|
}, props));
|
|
64
64
|
};
|
|
65
|
-
var
|
|
65
|
+
var contentDefaults = {
|
|
66
66
|
component: Content,
|
|
67
67
|
cssFn: contentCSS
|
|
68
|
-
};
|
|
68
|
+
};
|
|
69
|
+
var _default = exports.default = contentDefaults;
|
|
@@ -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, {
|
|
@@ -38,7 +38,8 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
38
38
|
css: (0, _react.css)(cssFn(defaultStyle))
|
|
39
39
|
}, props));
|
|
40
40
|
};
|
|
41
|
-
var
|
|
41
|
+
var sidebarDefaults = {
|
|
42
42
|
component: Sidebar,
|
|
43
43
|
cssFn: sidebarCSS
|
|
44
|
-
};
|
|
44
|
+
};
|
|
45
|
+
var _default = exports.default = sidebarDefaults;
|
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.1";
|
|
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
|
|
@@ -159,12 +161,23 @@ export class DrawerBase extends Component {
|
|
|
159
161
|
})) : children));
|
|
160
162
|
}
|
|
161
163
|
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* __Drawer__
|
|
167
|
+
*
|
|
168
|
+
* A drawer is a panel that slides in from the left side of the screen.
|
|
169
|
+
*
|
|
170
|
+
* - [Examples](https://atlassian.design/components/drawer/examples)
|
|
171
|
+
* - [Code](https://atlassian.design/components/drawer/code)
|
|
172
|
+
* - [Usage](https://atlassian.design/components/drawer/usage)
|
|
173
|
+
*/
|
|
162
174
|
_defineProperty(DrawerBase, "defaultProps", {
|
|
163
175
|
width: 'narrow',
|
|
164
176
|
...defaultFocusLockSettings
|
|
165
177
|
});
|
|
166
|
-
|
|
178
|
+
const Drawer = withAnalyticsContext({
|
|
167
179
|
componentName: 'drawer',
|
|
168
180
|
packageName,
|
|
169
181
|
packageVersion
|
|
170
|
-
})(withAnalyticsEvents()(DrawerBase));
|
|
182
|
+
})(withAnalyticsEvents()(DrawerBase));
|
|
183
|
+
export default Drawer;
|
|
@@ -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.1";
|
|
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
|
|
@@ -182,11 +184,22 @@ export var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
182
184
|
}]);
|
|
183
185
|
return DrawerBase;
|
|
184
186
|
}(Component);
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* __Drawer__
|
|
190
|
+
*
|
|
191
|
+
* A drawer is a panel that slides in from the left side of the screen.
|
|
192
|
+
*
|
|
193
|
+
* - [Examples](https://atlassian.design/components/drawer/examples)
|
|
194
|
+
* - [Code](https://atlassian.design/components/drawer/code)
|
|
195
|
+
* - [Usage](https://atlassian.design/components/drawer/usage)
|
|
196
|
+
*/
|
|
185
197
|
_defineProperty(DrawerBase, "defaultProps", _objectSpread({
|
|
186
198
|
width: 'narrow'
|
|
187
199
|
}, defaultFocusLockSettings));
|
|
188
|
-
|
|
200
|
+
var Drawer = withAnalyticsContext({
|
|
189
201
|
componentName: 'drawer',
|
|
190
202
|
packageName: packageName,
|
|
191
203
|
packageVersion: packageVersion
|
|
192
|
-
})(withAnalyticsEvents()(DrawerBase));
|
|
204
|
+
})(withAnalyticsEvents()(DrawerBase));
|
|
205
|
+
export default Drawer;
|
|
@@ -57,7 +57,8 @@ var Content = function Content(_ref) {
|
|
|
57
57
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
58
58
|
}, props));
|
|
59
59
|
};
|
|
60
|
-
|
|
60
|
+
var contentDefaults = {
|
|
61
61
|
component: Content,
|
|
62
62
|
cssFn: contentCSS
|
|
63
|
-
};
|
|
63
|
+
};
|
|
64
|
+
export default contentDefaults;
|
|
@@ -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,19 @@ export declare class DrawerBase extends Component<DrawerProps, {
|
|
|
22
22
|
handleKeyDown: (event: KeyboardEvent) => void;
|
|
23
23
|
render(): JSX.Element | null;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* __Drawer__
|
|
27
|
+
*
|
|
28
|
+
* A drawer is a panel that slides in from the left side of the screen.
|
|
29
|
+
*
|
|
30
|
+
* - [Examples](https://atlassian.design/components/drawer/examples)
|
|
31
|
+
* - [Code](https://atlassian.design/components/drawer/code)
|
|
32
|
+
* - [Usage](https://atlassian.design/components/drawer/usage)
|
|
33
|
+
*/
|
|
34
|
+
declare const Drawer: 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
35
|
autoFocusFirstElem?: boolean | (() => HTMLElement | null) | undefined;
|
|
27
36
|
isFocusLockEnabled?: boolean | undefined;
|
|
28
37
|
shouldReturnFocus?: boolean | React.RefObject<HTMLElement> | undefined;
|
|
29
38
|
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>>;
|
|
31
|
-
export default
|
|
39
|
+
}, 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>>;
|
|
40
|
+
export default Drawer;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import { type CSSObject, jsx } from '@emotion/react';
|
|
6
6
|
import { type ContentProps } from '../types';
|
|
7
|
-
declare const
|
|
7
|
+
declare const contentDefaults: {
|
|
8
8
|
component: ({ cssFn, scrollContentLabel, ...props }: ContentProps) => jsx.JSX.Element;
|
|
9
9
|
cssFn: () => CSSObject;
|
|
10
10
|
};
|
|
11
|
-
export default
|
|
11
|
+
export default contentDefaults;
|
|
@@ -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;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { type FC } from 'react';
|
|
6
6
|
import { type CSSObject } from '@emotion/react';
|
|
7
7
|
import { type SidebarProps } from '../types';
|
|
8
|
-
declare const
|
|
8
|
+
declare const sidebarDefaults: {
|
|
9
9
|
component: FC<SidebarProps>;
|
|
10
10
|
cssFn: () => CSSObject;
|
|
11
11
|
};
|
|
12
|
-
export default
|
|
12
|
+
export default sidebarDefaults;
|
|
@@ -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,19 @@ export declare class DrawerBase extends Component<DrawerProps, {
|
|
|
22
22
|
handleKeyDown: (event: KeyboardEvent) => void;
|
|
23
23
|
render(): JSX.Element | null;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* __Drawer__
|
|
27
|
+
*
|
|
28
|
+
* A drawer is a panel that slides in from the left side of the screen.
|
|
29
|
+
*
|
|
30
|
+
* - [Examples](https://atlassian.design/components/drawer/examples)
|
|
31
|
+
* - [Code](https://atlassian.design/components/drawer/code)
|
|
32
|
+
* - [Usage](https://atlassian.design/components/drawer/usage)
|
|
33
|
+
*/
|
|
34
|
+
declare const Drawer: 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
35
|
autoFocusFirstElem?: boolean | (() => HTMLElement | null) | undefined;
|
|
27
36
|
isFocusLockEnabled?: boolean | undefined;
|
|
28
37
|
shouldReturnFocus?: boolean | React.RefObject<HTMLElement> | undefined;
|
|
29
38
|
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>>;
|
|
31
|
-
export default
|
|
39
|
+
}, 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>>;
|
|
40
|
+
export default Drawer;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import { type CSSObject, jsx } from '@emotion/react';
|
|
6
6
|
import { type ContentProps } from '../types';
|
|
7
|
-
declare const
|
|
7
|
+
declare const contentDefaults: {
|
|
8
8
|
component: ({ cssFn, scrollContentLabel, ...props }: ContentProps) => jsx.JSX.Element;
|
|
9
9
|
cssFn: () => CSSObject;
|
|
10
10
|
};
|
|
11
|
-
export default
|
|
11
|
+
export default contentDefaults;
|
|
@@ -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;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { type FC } from 'react';
|
|
6
6
|
import { type CSSObject } from '@emotion/react';
|
|
7
7
|
import { type SidebarProps } from '../types';
|
|
8
|
-
declare const
|
|
8
|
+
declare const sidebarDefaults: {
|
|
9
9
|
component: FC<SidebarProps>;
|
|
10
10
|
cssFn: () => CSSObject;
|
|
11
11
|
};
|
|
12
|
-
export default
|
|
12
|
+
export default sidebarDefaults;
|
|
@@ -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.1",
|
|
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,14 +42,14 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
44
44
|
"@atlaskit/blanket": "^13.2.0",
|
|
45
|
-
"@atlaskit/button": "^18.
|
|
46
|
-
"@atlaskit/icon": "^22.
|
|
45
|
+
"@atlaskit/button": "^18.4.0",
|
|
46
|
+
"@atlaskit/icon": "^22.6.0",
|
|
47
47
|
"@atlaskit/layering": "^0.3.0",
|
|
48
48
|
"@atlaskit/motion": "^1.7.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
50
50
|
"@atlaskit/portal": "^4.6.0",
|
|
51
51
|
"@atlaskit/theme": "^12.11.0",
|
|
52
|
-
"@atlaskit/tokens": "^1.
|
|
52
|
+
"@atlaskit/tokens": "^1.54.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@emotion/react": "^11.7.1",
|
|
55
55
|
"bind-event-listener": "^3.0.0",
|