@atlaskit/drawer 12.1.4 → 13.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 +26 -0
- package/dist/cjs/drawer.js +3 -3
- package/dist/es2019/drawer.js +3 -3
- package/dist/esm/drawer.js +3 -3
- package/drawer/package.json +1 -8
- package/drawer-close-button/package.json +1 -8
- package/drawer-content/package.json +1 -8
- package/drawer-sidebar/package.json +1 -8
- package/package.json +22 -30
- package/types/package.json +1 -8
- package/dist/types-ts4.5/blanket.d.ts +0 -15
- package/dist/types-ts4.5/drawer-panel/drawer-close-button.d.ts +0 -8
- package/dist/types-ts4.5/drawer-panel/drawer-content.d.ts +0 -11
- package/dist/types-ts4.5/drawer-panel/drawer-panel.d.ts +0 -9
- package/dist/types-ts4.5/drawer-panel/drawer-sidebar.d.ts +0 -11
- package/dist/types-ts4.5/drawer-panel/focus-lock.d.ts +0 -9
- package/dist/types-ts4.5/drawer-panel/hooks/use-prevent-programmatic-scroll.d.ts +0 -9
- package/dist/types-ts4.5/drawer.d.ts +0 -12
- package/dist/types-ts4.5/ensure-is-inside-drawer-context.d.ts +0 -7
- package/dist/types-ts4.5/entry-points/drawer-close-button.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/drawer-content.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/drawer-sidebar.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/drawer.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -6
- package/dist/types-ts4.5/on-close-context.d.ts +0 -7
- package/dist/types-ts4.5/types.d.ts +0 -124
- package/dist/types-ts4.5/use-ensure-is-inside-drawer.d.ts +0 -1
- package/dist/types-ts4.5/use-on-close.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlaskit/drawer
|
|
2
2
|
|
|
3
|
+
## 13.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
8
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
9
|
+
|
|
10
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
11
|
+
|
|
12
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
- "typesVersions": {
|
|
16
|
+
- ">=4.5 <4.9": {
|
|
17
|
+
- "*": [
|
|
18
|
+
- "dist/types-ts4.5/*",
|
|
19
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
20
|
+
- ]
|
|
21
|
+
- }
|
|
22
|
+
- },
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
3
29
|
## 12.1.4
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/dist/cjs/drawer.js
CHANGED
|
@@ -67,7 +67,7 @@ var Drawer = exports.Drawer = function Drawer(_ref2) {
|
|
|
67
67
|
action: 'dismissed',
|
|
68
68
|
componentName: 'drawer',
|
|
69
69
|
packageName: "@atlaskit/drawer",
|
|
70
|
-
packageVersion: "12.1.
|
|
70
|
+
packageVersion: "12.1.4",
|
|
71
71
|
analyticsData: {
|
|
72
72
|
trigger: 'escKey'
|
|
73
73
|
}
|
|
@@ -90,7 +90,7 @@ var Drawer = exports.Drawer = function Drawer(_ref2) {
|
|
|
90
90
|
action: 'dismissed',
|
|
91
91
|
componentName: 'drawer',
|
|
92
92
|
packageName: "@atlaskit/drawer",
|
|
93
|
-
packageVersion: "12.1.
|
|
93
|
+
packageVersion: "12.1.4",
|
|
94
94
|
analyticsData: {
|
|
95
95
|
trigger: 'blanket'
|
|
96
96
|
}
|
|
@@ -102,7 +102,7 @@ var Drawer = exports.Drawer = function Drawer(_ref2) {
|
|
|
102
102
|
action: 'dismissed',
|
|
103
103
|
componentName: 'drawer',
|
|
104
104
|
packageName: "@atlaskit/drawer",
|
|
105
|
-
packageVersion: "12.1.
|
|
105
|
+
packageVersion: "12.1.4",
|
|
106
106
|
analyticsData: {
|
|
107
107
|
trigger: 'backButton'
|
|
108
108
|
}
|
package/dist/es2019/drawer.js
CHANGED
|
@@ -52,7 +52,7 @@ export const Drawer = ({
|
|
|
52
52
|
action: 'dismissed',
|
|
53
53
|
componentName: 'drawer',
|
|
54
54
|
packageName: "@atlaskit/drawer",
|
|
55
|
-
packageVersion: "12.1.
|
|
55
|
+
packageVersion: "12.1.4",
|
|
56
56
|
analyticsData: {
|
|
57
57
|
trigger: 'escKey'
|
|
58
58
|
}
|
|
@@ -73,7 +73,7 @@ export const Drawer = ({
|
|
|
73
73
|
action: 'dismissed',
|
|
74
74
|
componentName: 'drawer',
|
|
75
75
|
packageName: "@atlaskit/drawer",
|
|
76
|
-
packageVersion: "12.1.
|
|
76
|
+
packageVersion: "12.1.4",
|
|
77
77
|
analyticsData: {
|
|
78
78
|
trigger: 'blanket'
|
|
79
79
|
}
|
|
@@ -83,7 +83,7 @@ export const Drawer = ({
|
|
|
83
83
|
action: 'dismissed',
|
|
84
84
|
componentName: 'drawer',
|
|
85
85
|
packageName: "@atlaskit/drawer",
|
|
86
|
-
packageVersion: "12.1.
|
|
86
|
+
packageVersion: "12.1.4",
|
|
87
87
|
analyticsData: {
|
|
88
88
|
trigger: 'backButton'
|
|
89
89
|
}
|
package/dist/esm/drawer.js
CHANGED
|
@@ -57,7 +57,7 @@ export var Drawer = function Drawer(_ref2) {
|
|
|
57
57
|
action: 'dismissed',
|
|
58
58
|
componentName: 'drawer',
|
|
59
59
|
packageName: "@atlaskit/drawer",
|
|
60
|
-
packageVersion: "12.1.
|
|
60
|
+
packageVersion: "12.1.4",
|
|
61
61
|
analyticsData: {
|
|
62
62
|
trigger: 'escKey'
|
|
63
63
|
}
|
|
@@ -80,7 +80,7 @@ export var Drawer = function Drawer(_ref2) {
|
|
|
80
80
|
action: 'dismissed',
|
|
81
81
|
componentName: 'drawer',
|
|
82
82
|
packageName: "@atlaskit/drawer",
|
|
83
|
-
packageVersion: "12.1.
|
|
83
|
+
packageVersion: "12.1.4",
|
|
84
84
|
analyticsData: {
|
|
85
85
|
trigger: 'blanket'
|
|
86
86
|
}
|
|
@@ -92,7 +92,7 @@ export var Drawer = function Drawer(_ref2) {
|
|
|
92
92
|
action: 'dismissed',
|
|
93
93
|
componentName: 'drawer',
|
|
94
94
|
packageName: "@atlaskit/drawer",
|
|
95
|
-
packageVersion: "12.1.
|
|
95
|
+
packageVersion: "12.1.4",
|
|
96
96
|
analyticsData: {
|
|
97
97
|
trigger: 'backButton'
|
|
98
98
|
}
|
package/drawer/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/drawer.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/drawer.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/drawer.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/drawer-close-button.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/drawer-close-button.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/drawer-close-button.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/drawer-content.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/drawer-content.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/drawer-content.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/drawer-sidebar.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/drawer-sidebar.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/drawer-sidebar.d.ts"
|
|
17
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/drawer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.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/"
|
|
@@ -12,14 +12,6 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
-
"typesVersions": {
|
|
16
|
-
">=4.5 <4.9": {
|
|
17
|
-
"*": [
|
|
18
|
-
"dist/types-ts4.5/*",
|
|
19
|
-
"dist/types-ts4.5/index.d.ts"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
15
|
"sideEffects": [
|
|
24
16
|
"**/*.compiled.css"
|
|
25
17
|
],
|
|
@@ -44,16 +36,16 @@
|
|
|
44
36
|
}
|
|
45
37
|
},
|
|
46
38
|
"dependencies": {
|
|
47
|
-
"@atlaskit/analytics-next": "^
|
|
48
|
-
"@atlaskit/blanket": "^
|
|
49
|
-
"@atlaskit/button": "^
|
|
50
|
-
"@atlaskit/css": "^0.
|
|
51
|
-
"@atlaskit/icon": "^
|
|
52
|
-
"@atlaskit/layering": "^
|
|
53
|
-
"@atlaskit/motion": "^
|
|
54
|
-
"@atlaskit/portal": "^
|
|
55
|
-
"@atlaskit/theme": "^
|
|
56
|
-
"@atlaskit/tokens": "^
|
|
39
|
+
"@atlaskit/analytics-next": "^12.0.0",
|
|
40
|
+
"@atlaskit/blanket": "^16.0.0",
|
|
41
|
+
"@atlaskit/button": "^24.0.0",
|
|
42
|
+
"@atlaskit/css": "^1.0.0",
|
|
43
|
+
"@atlaskit/icon": "^36.0.0",
|
|
44
|
+
"@atlaskit/layering": "^4.0.0",
|
|
45
|
+
"@atlaskit/motion": "^7.0.0",
|
|
46
|
+
"@atlaskit/portal": "^6.0.0",
|
|
47
|
+
"@atlaskit/theme": "^26.0.0",
|
|
48
|
+
"@atlaskit/tokens": "^14.0.0",
|
|
57
49
|
"@babel/runtime": "^7.0.0",
|
|
58
50
|
"@compiled/react": "^0.20.0",
|
|
59
51
|
"bind-event-listener": "^3.0.0",
|
|
@@ -70,17 +62,17 @@
|
|
|
70
62
|
"@af/accessibility-testing": "workspace:^",
|
|
71
63
|
"@af/integration-testing": "workspace:^",
|
|
72
64
|
"@af/visual-regression": "workspace:^",
|
|
73
|
-
"@atlaskit/code": "^
|
|
74
|
-
"@atlaskit/docs": "^
|
|
75
|
-
"@atlaskit/dropdown-menu": "^
|
|
76
|
-
"@atlaskit/ds-lib": "^
|
|
77
|
-
"@atlaskit/form": "^
|
|
78
|
-
"@atlaskit/inline-message": "^
|
|
79
|
-
"@atlaskit/link": "^
|
|
80
|
-
"@atlaskit/menu": "^
|
|
81
|
-
"@atlaskit/modal-dialog": "^
|
|
82
|
-
"@atlaskit/primitives": "^
|
|
83
|
-
"@atlaskit/section-message": "^
|
|
65
|
+
"@atlaskit/code": "^18.0.0",
|
|
66
|
+
"@atlaskit/docs": "^12.0.0",
|
|
67
|
+
"@atlaskit/dropdown-menu": "^17.0.0",
|
|
68
|
+
"@atlaskit/ds-lib": "^8.0.0",
|
|
69
|
+
"@atlaskit/form": "^16.0.0",
|
|
70
|
+
"@atlaskit/inline-message": "^16.0.0",
|
|
71
|
+
"@atlaskit/link": "^4.0.0",
|
|
72
|
+
"@atlaskit/menu": "^9.0.0",
|
|
73
|
+
"@atlaskit/modal-dialog": "^16.0.0",
|
|
74
|
+
"@atlaskit/primitives": "^20.0.0",
|
|
75
|
+
"@atlaskit/section-message": "^9.0.0",
|
|
84
76
|
"@atlassian/react-compiler-gating": "workspace:^",
|
|
85
77
|
"@atlassian/ssr-tests": "workspace:^",
|
|
86
78
|
"@atlassian/structured-docs-types": "workspace:^",
|
package/types/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/types.d.ts"
|
|
17
10
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
type BlanketProps = {
|
|
7
|
-
isOpen: boolean;
|
|
8
|
-
onBlanketClicked: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
9
|
-
testId?: string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
|
|
13
|
-
*/
|
|
14
|
-
declare const Blanket: ({ isOpen, onBlanketClicked, testId }: BlanketProps) => JSX.Element;
|
|
15
|
-
export default Blanket;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type DrawerCloseButtonProps } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* __Drawer close button
|
|
5
|
-
*
|
|
6
|
-
* A button that closes the drawer.
|
|
7
|
-
*/
|
|
8
|
-
export declare const DrawerCloseButton: ({ icon: Icon, label, testId, }: DrawerCloseButtonProps) => React.JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { type DrawerContentProps } from '../types';
|
|
6
|
-
/**
|
|
7
|
-
* __Drawer content__
|
|
8
|
-
*
|
|
9
|
-
* The main content section of the drawer panel.
|
|
10
|
-
*/
|
|
11
|
-
export declare const DrawerContent: ({ children, scrollContentLabel, xcss, }: DrawerContentProps) => JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { type DrawerPanelProps } from '../types';
|
|
6
|
-
/**
|
|
7
|
-
* __Drawer panel__
|
|
8
|
-
*/
|
|
9
|
-
export declare const DrawerPanel: ({ children, onClose, onCloseComplete, onOpenComplete, testId, isOpen, shouldReturnFocus, autoFocusFirstElem, isFocusLockEnabled, width, label, titleId, enterFrom, }: DrawerPanelProps) => JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { type DrawerSidebarProps } from '../types';
|
|
6
|
-
/**
|
|
7
|
-
* __Drawer sidebar__
|
|
8
|
-
*
|
|
9
|
-
* The sidebar of the drawer panel.
|
|
10
|
-
*/
|
|
11
|
-
export declare const DrawerSidebar: ({ children, xcss }: DrawerSidebarProps) => JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type FocusLockProps } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* __Focus lock__
|
|
5
|
-
*
|
|
6
|
-
* Thin wrapper around react-focus-lock.
|
|
7
|
-
*/
|
|
8
|
-
declare const FocusLock: ({ isFocusLockEnabled, autoFocusFirstElem, shouldReturnFocus, children, }: FocusLockProps) => React.JSX.Element;
|
|
9
|
-
export default FocusLock;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prevents programmatic scrolling of the viewport with `scrollIntoView`.
|
|
3
|
-
* Should be used in conjunction with a scroll lock to prevent a user from scrolling.
|
|
4
|
-
*
|
|
5
|
-
* ⚠️ This is copied from `packages/design-system/modal-dialog/src/internal/hooks/use-prevent-programmatic-scroll.tsx`
|
|
6
|
-
*
|
|
7
|
-
* @returns scroll top offset of the viewport
|
|
8
|
-
*/
|
|
9
|
-
export default function usePreventProgrammaticScroll(): number;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { DrawerProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* __Drawer__
|
|
5
|
-
*
|
|
6
|
-
* A drawer is a panel that slides in from the left side of the screen.
|
|
7
|
-
*
|
|
8
|
-
* - [Examples](https://atlassian.design/components/drawer/examples)
|
|
9
|
-
* - [Code](https://atlassian.design/components/drawer/code)
|
|
10
|
-
* - [Usage](https://atlassian.design/components/drawer/usage)
|
|
11
|
-
*/
|
|
12
|
-
export declare const Drawer: ({ width, isOpen, isFocusLockEnabled, shouldReturnFocus, autoFocusFirstElem, onKeyDown, testId, children, onClose, onCloseComplete, onOpenComplete, zIndex, label, titleId, enterFrom, }: DrawerProps) => React.JSX.Element | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DrawerCloseButton } from '../drawer-panel/drawer-close-button';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DrawerContent } from '../drawer-panel/drawer-content';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DrawerSidebar } from '../drawer-panel/drawer-sidebar';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Drawer, Drawer as default } from '../drawer';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { BaseProps, CloseTrigger, DrawerContentProps, DrawerPanelProps, DrawerProps, DrawerWidth, FocusLockProps, DrawerSidebarProps, } from '../types';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Drawer } from './drawer';
|
|
2
|
-
export { DrawerContent } from './drawer-panel/drawer-content';
|
|
3
|
-
export { DrawerSidebar } from './drawer-panel/drawer-sidebar';
|
|
4
|
-
export { DrawerCloseButton } from './drawer-panel/drawer-close-button';
|
|
5
|
-
export { Drawer, Drawer as default };
|
|
6
|
-
export type { BaseProps, CloseTrigger, DrawerContentProps, DrawerPanelProps, DrawerProps, DrawerWidth, FocusLockProps, DrawerSidebarProps, } from './types';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type Context, type SyntheticEvent } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* __On close context__
|
|
4
|
-
*
|
|
5
|
-
* An context that provides the on close function for the drawer.
|
|
6
|
-
*/
|
|
7
|
-
export declare const OnCloseContext: Context<((event: SyntheticEvent<HTMLElement>, analyticsEvent?: any) => void) | undefined>;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { type ComponentType, type ReactElement, type ReactNode, type RefObject, type SyntheticEvent } from 'react';
|
|
2
|
-
import { type StrictXCSSProp } from '@atlaskit/css';
|
|
3
|
-
import { type Direction } from '@atlaskit/motion';
|
|
4
|
-
export type DrawerWidth = 'extended' | 'full' | 'medium' | 'narrow' | 'wide';
|
|
5
|
-
export interface BaseProps {
|
|
6
|
-
/**
|
|
7
|
-
* 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.
|
|
8
|
-
*/
|
|
9
|
-
testId?: string;
|
|
10
|
-
/**
|
|
11
|
-
* The content of the drawer.
|
|
12
|
-
*/
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
/**
|
|
15
|
-
* Sets the width of the drawer.
|
|
16
|
-
*/
|
|
17
|
-
width?: DrawerWidth;
|
|
18
|
-
/**
|
|
19
|
-
* Sets the direction the draw enters from. The default is "left".
|
|
20
|
-
*/
|
|
21
|
-
enterFrom?: Direction;
|
|
22
|
-
/**
|
|
23
|
-
* Controls if the drawer is open or closed.
|
|
24
|
-
*/
|
|
25
|
-
isOpen: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* A callback function that will be called when the drawer has finished its opening transition.
|
|
28
|
-
*/
|
|
29
|
-
onOpenComplete?: (node: HTMLElement | null) => void;
|
|
30
|
-
/**
|
|
31
|
-
* A callback function that will be called when the drawer has finished its close transition.
|
|
32
|
-
*/
|
|
33
|
-
onCloseComplete?: (node: HTMLElement | null) => void;
|
|
34
|
-
}
|
|
35
|
-
export interface DrawerLabel {
|
|
36
|
-
/**
|
|
37
|
-
* This is an `aria-label` attribute. It sets an accessible name for the drawer wrapper, for people who use assistive technology.
|
|
38
|
-
* Usage of either this, or the `titleId` attribute is strongly recommended.
|
|
39
|
-
*/
|
|
40
|
-
label?: string;
|
|
41
|
-
/**
|
|
42
|
-
* This is an ID referenced by the drawer wrapper's `aria-labelledby` attribute. This ID should be assigned to the drawer `title` element.
|
|
43
|
-
* Usage of either this, or the `label` attribute is strongly recommended.
|
|
44
|
-
*/
|
|
45
|
-
titleId?: string;
|
|
46
|
-
}
|
|
47
|
-
export interface DrawerSidebarProps {
|
|
48
|
-
/**
|
|
49
|
-
* The content of the sidebar.
|
|
50
|
-
*/
|
|
51
|
-
children?: ReactNode;
|
|
52
|
-
xcss?: StrictXCSSProp<'padding' | 'paddingTop' | 'paddingBottom' | 'paddingLeft' | 'paddingRight' | 'backgroundColor' | 'width', never>;
|
|
53
|
-
}
|
|
54
|
-
export interface DrawerContentProps {
|
|
55
|
-
/**
|
|
56
|
-
* The content of the drawer.
|
|
57
|
-
*/
|
|
58
|
-
children?: ReactNode;
|
|
59
|
-
/**
|
|
60
|
-
* When the content is scrollable, this is the accessible name for the the drawer region. The default is "Scrollable content".
|
|
61
|
-
*/
|
|
62
|
-
scrollContentLabel?: string;
|
|
63
|
-
xcss?: StrictXCSSProp<'padding' | 'paddingTop' | 'paddingBottom' | 'paddingLeft' | 'paddingRight' | 'marginTop' | 'backgroundColor' | 'marginBlockStart' | 'paddingInlineStart' | 'paddingInlineEnd' | 'marginBlockStart' | 'paddingBlockStart' | 'paddingInlineEnd' | 'paddingBlockEnd' | 'paddingInlineStart', never>;
|
|
64
|
-
}
|
|
65
|
-
export interface DrawerCloseButtonProps {
|
|
66
|
-
/**
|
|
67
|
-
* Use this to render an icon for the drawer close/back control, if it's available.
|
|
68
|
-
*/
|
|
69
|
-
icon?: ComponentType<any>;
|
|
70
|
-
/**
|
|
71
|
-
* This is the accessible name for the close/back control of the drawer. The default is "Close drawer".
|
|
72
|
-
*/
|
|
73
|
-
label?: string;
|
|
74
|
-
/**
|
|
75
|
-
* 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.
|
|
76
|
-
*/
|
|
77
|
-
testId?: string;
|
|
78
|
-
}
|
|
79
|
-
export interface DrawerPanelProps extends BaseProps, FocusLockSettings, DrawerLabel {
|
|
80
|
-
onClose: (event: SyntheticEvent<HTMLElement>) => void;
|
|
81
|
-
}
|
|
82
|
-
export type DrawerProps = BaseProps & FocusLockSettings & DrawerLabel & {
|
|
83
|
-
/**
|
|
84
|
-
* Callback function called while the drawer is displayed and `keydown` event is triggered.
|
|
85
|
-
*/
|
|
86
|
-
onKeyDown?: (event: SyntheticEvent) => void;
|
|
87
|
-
/**
|
|
88
|
-
* Callback function called when the drawer is closed.
|
|
89
|
-
*/
|
|
90
|
-
onClose?: (event: SyntheticEvent<HTMLElement>, analyticsEvent?: any) => void;
|
|
91
|
-
/**
|
|
92
|
-
* Z-index that the popup should be displayed in.
|
|
93
|
-
* This is passed to the portal component.
|
|
94
|
-
* Defaults to `unset`.
|
|
95
|
-
*/
|
|
96
|
-
zIndex?: number | 'unset';
|
|
97
|
-
};
|
|
98
|
-
export interface FocusLockSettings {
|
|
99
|
-
/**
|
|
100
|
-
* Controls whether to focus the first tabbable element inside the focus lock. Set to `true` by default.
|
|
101
|
-
*/
|
|
102
|
-
autoFocusFirstElem?: boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Enable this to keep focus inside the component until it’s closed. This is strongly recommended, as it prevents people who use assistive technology from accidentally navigating out of the drawer using the tab key.
|
|
105
|
-
*/
|
|
106
|
-
isFocusLockEnabled?: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* ReturnFocus controls what happens when the user exits focus lock mode.
|
|
109
|
-
* If true, focus returns to the trigger element . If false, focus remains where it was when the FocusLock was deactivated.
|
|
110
|
-
* If ref is passed, focus returns to that specific ref element.
|
|
111
|
-
*/
|
|
112
|
-
shouldReturnFocus?: boolean | RefObject<HTMLElement | null>;
|
|
113
|
-
}
|
|
114
|
-
export interface FocusLockProps extends FocusLockSettings {
|
|
115
|
-
/**
|
|
116
|
-
* Content inside the focus lock.
|
|
117
|
-
* Must strictly be a ReactElement and it *must* be implemented to take a `ref` passed from `react-scrollock` to enable Touch Scrolling.
|
|
118
|
-
*/
|
|
119
|
-
children?: ReactElement;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Type of keyboard event that triggers which key will should close the drawer.
|
|
123
|
-
*/
|
|
124
|
-
export type CloseTrigger = 'backButton' | 'blanket' | 'escKey';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useEnsureIsInsideDrawer: () => void;
|