@atlaskit/drawer 7.5.5 → 7.6.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 +55 -43
- package/dist/cjs/components/blanket.js +1 -2
- package/dist/cjs/components/index.js +9 -7
- package/dist/cjs/components/primitives/content.js +2 -3
- package/dist/cjs/components/primitives/drawer-wrapper.js +15 -7
- package/dist/cjs/components/primitives/focus-lock.js +1 -2
- package/dist/cjs/components/primitives/icon-button.js +1 -2
- package/dist/cjs/components/primitives/index.js +9 -6
- package/dist/cjs/components/primitives/sidebar.js +2 -3
- package/dist/cjs/components/utils.js +2 -3
- package/dist/cjs/constants.js +9 -14
- package/dist/es2019/components/index.js +6 -2
- package/dist/es2019/components/primitives/drawer-wrapper.js +13 -4
- package/dist/es2019/components/primitives/index.js +6 -2
- package/dist/es2019/constants.js +2 -1
- package/dist/esm/components/index.js +6 -2
- package/dist/esm/components/primitives/drawer-wrapper.js +13 -4
- package/dist/esm/components/primitives/index.js +8 -4
- package/dist/esm/constants.js +2 -1
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/components/primitives/drawer-wrapper.d.ts +1 -1
- package/dist/types/components/primitives/index.d.ts +1 -1
- package/dist/types/components/types.d.ts +17 -5
- package/dist/types-ts4.5/components/index.d.ts +2 -2
- package/dist/types-ts4.5/components/primitives/drawer-wrapper.d.ts +1 -1
- package/dist/types-ts4.5/components/primitives/index.d.ts +1 -1
- package/dist/types-ts4.5/components/types.d.ts +17 -5
- package/package.json +14 -6
- package/report.api.md +14 -2
- package/tmp/api-report-tmp.d.ts +10 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,42 +1,54 @@
|
|
|
1
1
|
# @atlaskit/drawer
|
|
2
2
|
|
|
3
|
+
## 7.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#40647](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40647) [`0de92f17021`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0de92f17021) - Bump react-focus-lock to latest version
|
|
8
|
+
|
|
9
|
+
## 7.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#38517](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38517) [`288b53175c0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/288b53175c0) - [ux] We are testing focus trap behavior for drawer in screen reader mode behind a feature flag. Now focus is set to first element and does not go beyond the content of the modal dialog. If this fix is successful, it will be available in a later release.
|
|
14
|
+
|
|
3
15
|
## 7.5.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
6
18
|
|
|
7
|
-
- [`ddb06fae577`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ddb06fae577) - Adds support for surface detection when using design tokens. Enabling children to be styled with the surface color of the drawer when using the `utility.elevation.surface.current` design token.
|
|
19
|
+
- [#39278](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39278) [`ddb06fae577`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ddb06fae577) - Adds support for surface detection when using design tokens. Enabling children to be styled with the surface color of the drawer when using the `utility.elevation.surface.current` design token.
|
|
8
20
|
- Updated dependencies
|
|
9
21
|
|
|
10
22
|
## 7.5.4
|
|
11
23
|
|
|
12
24
|
### Patch Changes
|
|
13
25
|
|
|
14
|
-
- [`fd6bb9c9184`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd6bb9c9184) - Delete version.json
|
|
26
|
+
- [#38162](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38162) [`fd6bb9c9184`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd6bb9c9184) - Delete version.json
|
|
15
27
|
- Updated dependencies
|
|
16
28
|
|
|
17
29
|
## 7.5.3
|
|
18
30
|
|
|
19
31
|
### Patch Changes
|
|
20
32
|
|
|
21
|
-
- [`779727e307a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/779727e307a) - Internal change only. Replace all instances of Box with stable @atlaskit/primitives version.
|
|
33
|
+
- [#34922](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34922) [`779727e307a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/779727e307a) - Internal change only. Replace all instances of Box with stable @atlaskit/primitives version.
|
|
22
34
|
|
|
23
35
|
## 7.5.2
|
|
24
36
|
|
|
25
37
|
### Patch Changes
|
|
26
38
|
|
|
27
|
-
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
39
|
+
- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793) [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
28
40
|
|
|
29
41
|
## 7.5.1
|
|
30
42
|
|
|
31
43
|
### Patch Changes
|
|
32
44
|
|
|
33
|
-
- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
45
|
+
- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649) [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
34
46
|
|
|
35
47
|
## 7.5.0
|
|
36
48
|
|
|
37
49
|
### Minor Changes
|
|
38
50
|
|
|
39
|
-
- [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
51
|
+
- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258) [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
40
52
|
|
|
41
53
|
### Patch Changes
|
|
42
54
|
|
|
@@ -46,26 +58,26 @@
|
|
|
46
58
|
|
|
47
59
|
### Patch Changes
|
|
48
60
|
|
|
49
|
-
- [`4ba10567310`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ba10567310) - Internal changes.
|
|
61
|
+
- [#32211](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32211) [`4ba10567310`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ba10567310) - Internal changes.
|
|
50
62
|
|
|
51
63
|
## 7.4.13
|
|
52
64
|
|
|
53
65
|
### Patch Changes
|
|
54
66
|
|
|
55
|
-
- [`e0460d5d989`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e0460d5d989) - Usages of `process` are now guarded by a `typeof` check.
|
|
67
|
+
- [#32294](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32294) [`e0460d5d989`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e0460d5d989) - Usages of `process` are now guarded by a `typeof` check.
|
|
56
68
|
|
|
57
69
|
## 7.4.12
|
|
58
70
|
|
|
59
71
|
### Patch Changes
|
|
60
72
|
|
|
61
|
-
- [`261420360ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/261420360ec) - Upgrades component types to support React 18.
|
|
73
|
+
- [#31206](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31206) [`261420360ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/261420360ec) - Upgrades component types to support React 18.
|
|
62
74
|
- Updated dependencies
|
|
63
75
|
|
|
64
76
|
## 7.4.11
|
|
65
77
|
|
|
66
78
|
### Patch Changes
|
|
67
79
|
|
|
68
|
-
- [`74c1b81a476`](https://bitbucket.org/atlassian/atlassian-frontend/commits/74c1b81a476) - Replaces use of `gridSize` with space tokens. There is no expected visual change.
|
|
80
|
+
- [#31338](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31338) [`74c1b81a476`](https://bitbucket.org/atlassian/atlassian-frontend/commits/74c1b81a476) - Replaces use of `gridSize` with space tokens. There is no expected visual change.
|
|
69
81
|
|
|
70
82
|
## 7.4.10
|
|
71
83
|
|
|
@@ -83,13 +95,13 @@
|
|
|
83
95
|
|
|
84
96
|
### Patch Changes
|
|
85
97
|
|
|
86
|
-
- [`18aeca8c199`](https://bitbucket.org/atlassian/atlassian-frontend/commits/18aeca8c199) - Internal change to update token references. There is no expected behaviour or visual change.
|
|
98
|
+
- [#29390](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29390) [`18aeca8c199`](https://bitbucket.org/atlassian/atlassian-frontend/commits/18aeca8c199) - Internal change to update token references. There is no expected behaviour or visual change.
|
|
87
99
|
|
|
88
100
|
## 7.4.7
|
|
89
101
|
|
|
90
102
|
### Patch Changes
|
|
91
103
|
|
|
92
|
-
- [`4ee60bafc6d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ee60bafc6d) - ED-16603: Remove tooltips from VR tests and make them opt in. To opt-in, add `allowedSideEffects` when loading the page.
|
|
104
|
+
- [#29227](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29227) [`4ee60bafc6d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ee60bafc6d) - ED-16603: Remove tooltips from VR tests and make them opt in. To opt-in, add `allowedSideEffects` when loading the page.
|
|
93
105
|
|
|
94
106
|
## 7.4.6
|
|
95
107
|
|
|
@@ -101,7 +113,7 @@
|
|
|
101
113
|
|
|
102
114
|
### Patch Changes
|
|
103
115
|
|
|
104
|
-
- [`021eea6cdc6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/021eea6cdc6) - Remove unnecessary styles. There is no expected behaviour change for consumers.
|
|
116
|
+
- [#28575](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28575) [`021eea6cdc6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/021eea6cdc6) - Remove unnecessary styles. There is no expected behaviour change for consumers.
|
|
105
117
|
|
|
106
118
|
## 7.4.4
|
|
107
119
|
|
|
@@ -119,7 +131,7 @@
|
|
|
119
131
|
|
|
120
132
|
### Patch Changes
|
|
121
133
|
|
|
122
|
-
- [`5bd499c254f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5bd499c254f) - Fix zIndex stacking of internal Blanket component during css transition
|
|
134
|
+
- [#26712](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26712) [`5bd499c254f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5bd499c254f) - Fix zIndex stacking of internal Blanket component during css transition
|
|
123
135
|
|
|
124
136
|
## 7.4.1
|
|
125
137
|
|
|
@@ -131,7 +143,7 @@
|
|
|
131
143
|
|
|
132
144
|
### Minor Changes
|
|
133
145
|
|
|
134
|
-
- [`3d5675d420e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3d5675d420e) - [ux] Prevents the background from being scrollable while a drawer is open.
|
|
146
|
+
- [#25860](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25860) [`3d5675d420e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3d5675d420e) - [ux] Prevents the background from being scrollable while a drawer is open.
|
|
135
147
|
|
|
136
148
|
### Patch Changes
|
|
137
149
|
|
|
@@ -141,19 +153,19 @@
|
|
|
141
153
|
|
|
142
154
|
### Patch Changes
|
|
143
155
|
|
|
144
|
-
- [`bc989043572`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bc989043572) - Internal changes to apply spacing tokens. This should be a no-op change.
|
|
156
|
+
- [#26488](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26488) [`bc989043572`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bc989043572) - Internal changes to apply spacing tokens. This should be a no-op change.
|
|
145
157
|
|
|
146
158
|
## 7.3.1
|
|
147
159
|
|
|
148
160
|
### Patch Changes
|
|
149
161
|
|
|
150
|
-
- [`9de88fa1e1e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9de88fa1e1e) - Internal changes to include spacing tokens in component implementations.
|
|
162
|
+
- [#26408](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26408) [`9de88fa1e1e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9de88fa1e1e) - Internal changes to include spacing tokens in component implementations.
|
|
151
163
|
|
|
152
164
|
## 7.3.0
|
|
153
165
|
|
|
154
166
|
### Minor Changes
|
|
155
167
|
|
|
156
|
-
- [`b975291711b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b975291711b) - Add zindex as prop to drawer
|
|
168
|
+
- [#24710](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24710) [`b975291711b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b975291711b) - Add zindex as prop to drawer
|
|
157
169
|
|
|
158
170
|
### Patch Changes
|
|
159
171
|
|
|
@@ -164,13 +176,13 @@
|
|
|
164
176
|
|
|
165
177
|
### Patch Changes
|
|
166
178
|
|
|
167
|
-
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
179
|
+
- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874) [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
168
180
|
|
|
169
181
|
## 7.2.0
|
|
170
182
|
|
|
171
183
|
### Minor Changes
|
|
172
184
|
|
|
173
|
-
- [`cc4fe7bdf0c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cc4fe7bdf0c) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
185
|
+
- [#24004](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24004) [`cc4fe7bdf0c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cc4fe7bdf0c) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
174
186
|
|
|
175
187
|
### Patch Changes
|
|
176
188
|
|
|
@@ -181,13 +193,13 @@
|
|
|
181
193
|
|
|
182
194
|
### Patch Changes
|
|
183
195
|
|
|
184
|
-
- [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
196
|
+
- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492) [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
185
197
|
|
|
186
198
|
## 7.1.11
|
|
187
199
|
|
|
188
200
|
### Patch Changes
|
|
189
201
|
|
|
190
|
-
- [`fd86b8e4c63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd86b8e4c63) - Internal code change turning on new linting rules.
|
|
202
|
+
- [#23381](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23381) [`fd86b8e4c63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd86b8e4c63) - Internal code change turning on new linting rules.
|
|
191
203
|
|
|
192
204
|
## 7.1.10
|
|
193
205
|
|
|
@@ -199,13 +211,13 @@
|
|
|
199
211
|
|
|
200
212
|
### Patch Changes
|
|
201
213
|
|
|
202
|
-
- [`45e0af67ad3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/45e0af67ad3) - Internal change to make styles statically analyzable
|
|
214
|
+
- [#20721](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20721) [`45e0af67ad3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/45e0af67ad3) - Internal change to make styles statically analyzable
|
|
203
215
|
|
|
204
216
|
## 7.1.8
|
|
205
217
|
|
|
206
218
|
### Patch Changes
|
|
207
219
|
|
|
208
|
-
- [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
|
|
220
|
+
- [#20650](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20650) [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
|
|
209
221
|
|
|
210
222
|
## 7.1.7
|
|
211
223
|
|
|
@@ -217,7 +229,7 @@
|
|
|
217
229
|
|
|
218
230
|
### Patch Changes
|
|
219
231
|
|
|
220
|
-
- [`ac9343c3ed4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ac9343c3ed4) - Replaces usage of deprecated design tokens. No visual or functional changes
|
|
232
|
+
- [#19618](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/19618) [`ac9343c3ed4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ac9343c3ed4) - Replaces usage of deprecated design tokens. No visual or functional changes
|
|
221
233
|
- Updated dependencies
|
|
222
234
|
|
|
223
235
|
## 7.1.5
|
|
@@ -230,13 +242,13 @@
|
|
|
230
242
|
|
|
231
243
|
### Patch Changes
|
|
232
244
|
|
|
233
|
-
- [`e9210b8a098`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e9210b8a098) - Updates Drawer with deprecated status for `cssFn`/`overrides APIs.
|
|
245
|
+
- [#18526](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/18526) [`e9210b8a098`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e9210b8a098) - Updates Drawer with deprecated status for `cssFn`/`overrides APIs.
|
|
234
246
|
|
|
235
247
|
## 7.1.3
|
|
236
248
|
|
|
237
249
|
### Patch Changes
|
|
238
250
|
|
|
239
|
-
- [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - Bump dependency tiny-invariant to latest"
|
|
251
|
+
- [#16752](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/16752) [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - Bump dependency tiny-invariant to latest"
|
|
240
252
|
- Updated dependencies
|
|
241
253
|
|
|
242
254
|
## 7.1.2
|
|
@@ -249,13 +261,13 @@
|
|
|
249
261
|
|
|
250
262
|
### Patch Changes
|
|
251
263
|
|
|
252
|
-
- [`c55c736ecea`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c55c736ecea) - Patch VULN AFP-3486 AFP-3487 AFP-3488 AFP-3489
|
|
264
|
+
- [#17475](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/17475) [`c55c736ecea`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c55c736ecea) - Patch VULN AFP-3486 AFP-3487 AFP-3488 AFP-3489
|
|
253
265
|
|
|
254
266
|
## 7.1.0
|
|
255
267
|
|
|
256
268
|
### Minor Changes
|
|
257
269
|
|
|
258
|
-
- [`d19fa028010`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d19fa028010) - Instrumented `@atlaskit/drawer` with the new theming package, `@atlaskit/tokens`.
|
|
270
|
+
- [#16753](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/16753) [`d19fa028010`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d19fa028010) - Instrumented `@atlaskit/drawer` with the new theming package, `@atlaskit/tokens`.
|
|
259
271
|
|
|
260
272
|
New tokens will be visible only in applications configured to use the new Tokens API (currently in alpha). These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
|
|
261
273
|
|
|
@@ -263,13 +275,13 @@
|
|
|
263
275
|
|
|
264
276
|
### Patch Changes
|
|
265
277
|
|
|
266
|
-
- [`3fced6aa641`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3fced6aa641) - Bumped `react-focus-lock` to version `^2.2.1`.
|
|
278
|
+
- [#15998](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/15998) [`3fced6aa641`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3fced6aa641) - Bumped `react-focus-lock` to version `^2.2.1`.
|
|
267
279
|
|
|
268
280
|
## 7.0.0
|
|
269
281
|
|
|
270
282
|
### Major Changes
|
|
271
283
|
|
|
272
|
-
- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - [ux] Breaking changes:
|
|
284
|
+
- [#14319](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/14319) [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - [ux] Breaking changes:
|
|
273
285
|
|
|
274
286
|
The following components have been removed from `@atlaskit/drawer`:
|
|
275
287
|
|
|
@@ -300,7 +312,7 @@
|
|
|
300
312
|
|
|
301
313
|
### Patch Changes
|
|
302
314
|
|
|
303
|
-
- [`378d1cef00f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/378d1cef00f) - Bump `@atlaskit/theme` to version `^11.3.0`.
|
|
315
|
+
- [#12880](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12880) [`378d1cef00f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/378d1cef00f) - Bump `@atlaskit/theme` to version `^11.3.0`.
|
|
304
316
|
|
|
305
317
|
## 6.0.9
|
|
306
318
|
|
|
@@ -312,20 +324,20 @@
|
|
|
312
324
|
|
|
313
325
|
### Patch Changes
|
|
314
326
|
|
|
315
|
-
- [`79c23df6340`](https://bitbucket.org/atlassian/atlassian-frontend/commits/79c23df6340) - Use injected package name and version for analytics instead of version.json.
|
|
327
|
+
- [#8644](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/8644) [`79c23df6340`](https://bitbucket.org/atlassian/atlassian-frontend/commits/79c23df6340) - Use injected package name and version for analytics instead of version.json.
|
|
316
328
|
- Updated dependencies
|
|
317
329
|
|
|
318
330
|
## 6.0.7
|
|
319
331
|
|
|
320
332
|
### Patch Changes
|
|
321
333
|
|
|
322
|
-
- [`d3265f19be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d3265f19be) - Transpile packages using babel rather than tsc
|
|
334
|
+
- [#5857](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5857) [`d3265f19be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d3265f19be) - Transpile packages using babel rather than tsc
|
|
323
335
|
|
|
324
336
|
## 6.0.6
|
|
325
337
|
|
|
326
338
|
### Patch Changes
|
|
327
339
|
|
|
328
|
-
- [`5f58283e1f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f58283e1f) - Export types using Typescript's new "export type" syntax to satisfy Typescript's --isolatedModules compiler option.
|
|
340
|
+
- [#5497](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5497) [`5f58283e1f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f58283e1f) - Export types using Typescript's new "export type" syntax to satisfy Typescript's --isolatedModules compiler option.
|
|
329
341
|
This requires version 3.8 of Typescript, read more about how we handle Typescript versions here: https://atlaskit.atlassian.com/get-started
|
|
330
342
|
Also add `typescript` to `devDependencies` to denote version that the package was built with.
|
|
331
343
|
|
|
@@ -339,13 +351,13 @@
|
|
|
339
351
|
|
|
340
352
|
### Patch Changes
|
|
341
353
|
|
|
342
|
-
- [`6360c46009`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6360c46009) - Reenable integration tests for Edge browser
|
|
354
|
+
- [#4707](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/4707) [`6360c46009`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6360c46009) - Reenable integration tests for Edge browser
|
|
343
355
|
|
|
344
356
|
## 6.0.3
|
|
345
357
|
|
|
346
358
|
### Patch Changes
|
|
347
359
|
|
|
348
|
-
- [`6c525a8229`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c525a8229) - Upgraded to TypeScript 3.9.6 and tslib to 2.0.0
|
|
360
|
+
- [#3885](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3885) [`6c525a8229`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c525a8229) - Upgraded to TypeScript 3.9.6 and tslib to 2.0.0
|
|
349
361
|
|
|
350
362
|
Since tslib is a dependency for all our packages we recommend that products also follow this tslib upgrade
|
|
351
363
|
to prevent duplicates of tslib being bundled.
|
|
@@ -354,20 +366,20 @@
|
|
|
354
366
|
|
|
355
367
|
### Patch Changes
|
|
356
368
|
|
|
357
|
-
- [`6262f382de`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6262f382de) - Use the 'lodash' package instead of single-function 'lodash.\*' packages
|
|
369
|
+
- [#3823](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3823) [`6262f382de`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6262f382de) - Use the 'lodash' package instead of single-function 'lodash.\*' packages
|
|
358
370
|
|
|
359
371
|
## 6.0.1
|
|
360
372
|
|
|
361
373
|
### Patch Changes
|
|
362
374
|
|
|
363
|
-
- [`60dd4ecc69`](https://bitbucket.org/atlassian/atlassian-frontend/commits/60dd4ecc69) - Changed export all to export individual components in index
|
|
375
|
+
- [#3428](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3428) [`60dd4ecc69`](https://bitbucket.org/atlassian/atlassian-frontend/commits/60dd4ecc69) - Changed export all to export individual components in index
|
|
364
376
|
- Updated dependencies
|
|
365
377
|
|
|
366
378
|
## 6.0.0
|
|
367
379
|
|
|
368
380
|
### Major Changes
|
|
369
381
|
|
|
370
|
-
- [`87f4720f27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/87f4720f27) - Officially dropping IE11 support, from this version onwards there are no warranties of the package working in IE11.
|
|
382
|
+
- [#3335](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3335) [`87f4720f27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/87f4720f27) - Officially dropping IE11 support, from this version onwards there are no warranties of the package working in IE11.
|
|
371
383
|
For more information see: https://community.developer.atlassian.com/t/atlaskit-to-drop-support-for-internet-explorer-11-from-1st-july-2020/39534
|
|
372
384
|
|
|
373
385
|
### Patch Changes
|
|
@@ -378,19 +390,19 @@
|
|
|
378
390
|
|
|
379
391
|
### Patch Changes
|
|
380
392
|
|
|
381
|
-
- [`54a9514fcf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/54a9514fcf) - Build and supporting files will no longer be published to npm
|
|
393
|
+
- [#2866](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/2866) [`54a9514fcf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/54a9514fcf) - Build and supporting files will no longer be published to npm
|
|
382
394
|
|
|
383
395
|
## 5.3.9
|
|
384
396
|
|
|
385
397
|
### Patch Changes
|
|
386
398
|
|
|
387
|
-
- [`4560b65a4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4560b65a4f) - upgrade react-transition-group to latest
|
|
399
|
+
- [#2677](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/2677) [`4560b65a4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4560b65a4f) - upgrade react-transition-group to latest
|
|
388
400
|
|
|
389
401
|
## 5.3.8
|
|
390
402
|
|
|
391
403
|
### Patch Changes
|
|
392
404
|
|
|
393
|
-
- [`54d82b49f0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/54d82b49f0) - Remove unused dependencies
|
|
405
|
+
- [#2137](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/2137) [`54d82b49f0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/54d82b49f0) - Remove unused dependencies
|
|
394
406
|
- [`baaad91b65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/baaad91b65) - Updated to use the latest and more performant version of `@atlaskit/avatar`
|
|
395
407
|
- Updated dependencies
|
|
396
408
|
|
|
@@ -27,7 +27,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
27
27
|
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); }; }
|
|
28
28
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
29
29
|
var packageName = "@atlaskit/drawer";
|
|
30
|
-
var packageVersion = "7.
|
|
30
|
+
var packageVersion = "7.6.1";
|
|
31
31
|
var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
|
|
32
32
|
var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
|
|
33
33
|
return createAndFireEventOnAtlaskit({
|
|
@@ -41,7 +41,7 @@ var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, t
|
|
|
41
41
|
}
|
|
42
42
|
})(createAnalyticsEvent);
|
|
43
43
|
};
|
|
44
|
-
var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
44
|
+
var DrawerBase = exports.DrawerBase = /*#__PURE__*/function (_Component) {
|
|
45
45
|
(0, _inherits2.default)(DrawerBase, _Component);
|
|
46
46
|
var _super = _createSuper(DrawerBase);
|
|
47
47
|
function DrawerBase() {
|
|
@@ -128,7 +128,9 @@ var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
128
128
|
shouldReturnFocus = _this$props3.shouldReturnFocus,
|
|
129
129
|
overrides = _this$props3.overrides,
|
|
130
130
|
_this$props3$zIndex = _this$props3.zIndex,
|
|
131
|
-
zIndex = _this$props3$zIndex === void 0 ? 'unset' : _this$props3$zIndex
|
|
131
|
+
zIndex = _this$props3$zIndex === void 0 ? 'unset' : _this$props3$zIndex,
|
|
132
|
+
label = _this$props3.label,
|
|
133
|
+
titleId = _this$props3.titleId;
|
|
132
134
|
return /*#__PURE__*/_react.default.createElement(_portal.default, {
|
|
133
135
|
zIndex: zIndex
|
|
134
136
|
}, /*#__PURE__*/_react.default.createElement(_blanket.default, {
|
|
@@ -143,6 +145,8 @@ var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
143
145
|
onCloseComplete: onCloseComplete,
|
|
144
146
|
onOpenComplete: onOpenComplete,
|
|
145
147
|
width: width,
|
|
148
|
+
label: label,
|
|
149
|
+
titleId: titleId,
|
|
146
150
|
shouldUnmountOnExit: shouldUnmountOnExit
|
|
147
151
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
148
152
|
,
|
|
@@ -155,13 +159,11 @@ var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
155
159
|
}]);
|
|
156
160
|
return DrawerBase;
|
|
157
161
|
}(_react.Component);
|
|
158
|
-
exports.DrawerBase = DrawerBase;
|
|
159
162
|
(0, _defineProperty2.default)(DrawerBase, "defaultProps", _objectSpread({
|
|
160
163
|
width: 'narrow'
|
|
161
164
|
}, _constants.defaultFocusLockSettings));
|
|
162
|
-
var _default = (0, _analyticsNext.withAnalyticsContext)({
|
|
165
|
+
var _default = exports.default = (0, _analyticsNext.withAnalyticsContext)({
|
|
163
166
|
componentName: 'drawer',
|
|
164
167
|
packageName: packageName,
|
|
165
168
|
packageVersion: packageVersion
|
|
166
|
-
})((0, _analyticsNext.withAnalyticsEvents)()(DrawerBase));
|
|
167
|
-
exports.default = _default;
|
|
169
|
+
})((0, _analyticsNext.withAnalyticsEvents)()(DrawerBase));
|
|
@@ -5,16 +5,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.wrapperWidth = exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _react = require("react");
|
|
10
11
|
var _react2 = require("@emotion/react");
|
|
11
12
|
var _useCallbackRef = require("use-callback-ref");
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
13
15
|
var _tokens = require("@atlaskit/tokens");
|
|
14
16
|
var _usePreventProgrammaticScroll = _interopRequireDefault(require("./hooks/use-prevent-programmatic-scroll"));
|
|
15
17
|
var _css;
|
|
16
18
|
/** @jsx jsx */
|
|
17
|
-
var wrapperWidth = {
|
|
19
|
+
var wrapperWidth = exports.wrapperWidth = {
|
|
18
20
|
full: {
|
|
19
21
|
width: '100vw'
|
|
20
22
|
},
|
|
@@ -31,7 +33,6 @@ var wrapperWidth = {
|
|
|
31
33
|
width: 600
|
|
32
34
|
}
|
|
33
35
|
};
|
|
34
|
-
exports.wrapperWidth = wrapperWidth;
|
|
35
36
|
var wrapperStyles = (0, _react2.css)((_css = {
|
|
36
37
|
display: 'flex',
|
|
37
38
|
height: '100vh',
|
|
@@ -50,7 +51,9 @@ var DrawerWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, scrollRe
|
|
|
50
51
|
_ref$width = _ref.width,
|
|
51
52
|
width = _ref$width === void 0 ? 'narrow' : _ref$width,
|
|
52
53
|
testId = _ref.testId,
|
|
53
|
-
drawerRef = _ref.drawerRef
|
|
54
|
+
drawerRef = _ref.drawerRef,
|
|
55
|
+
label = _ref.label,
|
|
56
|
+
titleId = _ref.titleId;
|
|
54
57
|
/**
|
|
55
58
|
* We use a callback ref to assign the `<Content />` component to the forwarded `scrollRef`.
|
|
56
59
|
* This ref comes from `react-scrolllock` to allow touch scrolling, eg.: `<ScrollLock><TouchScrollable>{children}</TouchScrollable><ScrollLock>`
|
|
@@ -67,13 +70,18 @@ var DrawerWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, scrollRe
|
|
|
67
70
|
}, [scrollRef]);
|
|
68
71
|
var ref = (0, _useCallbackRef.useMergeRefs)([drawerRef, assignSecondChildRef]);
|
|
69
72
|
(0, _usePreventProgrammaticScroll.default)();
|
|
70
|
-
|
|
73
|
+
var modalDialogAttributes = (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc') && {
|
|
74
|
+
'aria-modal': true,
|
|
75
|
+
role: 'dialog',
|
|
76
|
+
'aria-label': label,
|
|
77
|
+
'aria-labelledby': titleId
|
|
78
|
+
};
|
|
79
|
+
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
71
80
|
css: wrapperStyles,
|
|
72
81
|
style: wrapperWidth[width],
|
|
73
82
|
className: className,
|
|
74
83
|
"data-testid": testId,
|
|
75
84
|
ref: ref
|
|
76
|
-
}, children);
|
|
85
|
+
}, modalDialogAttributes), children);
|
|
77
86
|
});
|
|
78
|
-
var _default = DrawerWrapper;
|
|
79
|
-
exports.default = _default;
|
|
87
|
+
var _default = exports.default = DrawerWrapper;
|
|
@@ -25,7 +25,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
25
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
26
26
|
// Thin wrapper over react-focus-lock. This wrapper only exists to ensure API compatibility.
|
|
27
27
|
// This component should be deleted during https://ecosystem.atlassian.net/browse/AK-5658
|
|
28
|
-
var FocusLock = /*#__PURE__*/function (_Component) {
|
|
28
|
+
var FocusLock = exports.default = /*#__PURE__*/function (_Component) {
|
|
29
29
|
(0, _inherits2.default)(FocusLock, _Component);
|
|
30
30
|
var _super = _createSuper(FocusLock);
|
|
31
31
|
function FocusLock() {
|
|
@@ -65,5 +65,4 @@ var FocusLock = /*#__PURE__*/function (_Component) {
|
|
|
65
65
|
}]);
|
|
66
66
|
return FocusLock;
|
|
67
67
|
}(_react.Component);
|
|
68
|
-
exports.default = FocusLock;
|
|
69
68
|
(0, _defineProperty2.default)(FocusLock, "defaultProps", _objectSpread({}, _constants.defaultFocusLockSettings));
|
|
@@ -63,7 +63,9 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
63
63
|
shouldReturnFocus = _ref2.shouldReturnFocus,
|
|
64
64
|
autoFocusFirstElem = _ref2.autoFocusFirstElem,
|
|
65
65
|
isFocusLockEnabled = _ref2.isFocusLockEnabled,
|
|
66
|
-
width = _ref2.width
|
|
66
|
+
width = _ref2.width,
|
|
67
|
+
label = _ref2.label,
|
|
68
|
+
titleId = _ref2.titleId;
|
|
67
69
|
var getOverrides = (0, _utils.createExtender)(defaults, overrides);
|
|
68
70
|
var _getOverrides = getOverrides('Sidebar'),
|
|
69
71
|
Sidebar = _getOverrides.component,
|
|
@@ -78,9 +80,9 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
78
80
|
var drawerRef = (0, _react.useRef)(null);
|
|
79
81
|
var onFinish = (0, _react.useCallback)(function (state) {
|
|
80
82
|
if (state === 'entering') {
|
|
81
|
-
onOpenComplete === null || onOpenComplete === void 0
|
|
83
|
+
onOpenComplete === null || onOpenComplete === void 0 || onOpenComplete(drawerRef.current);
|
|
82
84
|
} else if (state === 'exiting') {
|
|
83
|
-
onCloseComplete === null || onCloseComplete === void 0
|
|
85
|
+
onCloseComplete === null || onCloseComplete === void 0 || onCloseComplete(drawerRef.current);
|
|
84
86
|
}
|
|
85
87
|
}, [onCloseComplete, onOpenComplete]);
|
|
86
88
|
return (0, _react2.jsx)(_motion.ExitingPersistence, {
|
|
@@ -97,7 +99,9 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
97
99
|
className: className,
|
|
98
100
|
width: width,
|
|
99
101
|
testId: testId,
|
|
100
|
-
drawerRef: drawerRef
|
|
102
|
+
drawerRef: drawerRef,
|
|
103
|
+
label: label,
|
|
104
|
+
titleId: titleId
|
|
101
105
|
}, (0, _react2.jsx)(Sidebar, sideBarOverrides, (0, _react2.jsx)(_iconButton.default, {
|
|
102
106
|
onClick: onClose,
|
|
103
107
|
testId: testId && 'DrawerPrimitiveSidebarCloseButton'
|
|
@@ -110,5 +114,4 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
110
114
|
};
|
|
111
115
|
|
|
112
116
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
113
|
-
var _default = DrawerPrimitive;
|
|
114
|
-
exports.default = _default;
|
|
117
|
+
var _default = exports.default = DrawerPrimitive;
|
|
@@ -9,7 +9,7 @@ exports.createExtender = void 0;
|
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated Please avoid using this function as we intend to remote it in a future release. See DSP-2673 for more information.
|
|
11
11
|
*/
|
|
12
|
-
var createExtender = function createExtender(defaults) {
|
|
12
|
+
var createExtender = exports.createExtender = function createExtender(defaults) {
|
|
13
13
|
var overrides = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Object.create(Object.prototype);
|
|
14
14
|
if (!defaults) {
|
|
15
15
|
throw new Error('a default set of overrides *must* be passed in as the first argument');
|
|
@@ -35,5 +35,4 @@ var createExtender = function createExtender(defaults) {
|
|
|
35
35
|
component: customComponent || defaultComponent
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
};
|
|
39
|
-
exports.createExtender = createExtender;
|
|
38
|
+
};
|
package/dist/cjs/constants.js
CHANGED
|
@@ -5,21 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.widths = exports.transitionTimingFunction = exports.transitionDurationMs = exports.transitionDuration = exports.defaultFocusLockSettings = exports.animationTimingFunction = void 0;
|
|
7
7
|
var _curves = require("@atlaskit/motion/curves");
|
|
8
|
-
var
|
|
9
|
-
exports.transitionDuration =
|
|
10
|
-
var transitionDurationMs = 220;
|
|
11
|
-
exports.
|
|
12
|
-
var
|
|
13
|
-
exports.
|
|
14
|
-
var widths = ['narrow', 'medium', 'wide', 'extended', 'full'];
|
|
15
|
-
exports.widths = widths;
|
|
16
|
-
var animationTimingFunction = function animationTimingFunction() {
|
|
8
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
|
+
var transitionDuration = exports.transitionDuration = '0.22s';
|
|
10
|
+
var transitionDurationMs = exports.transitionDurationMs = 220;
|
|
11
|
+
var transitionTimingFunction = exports.transitionTimingFunction = _curves.easeOut;
|
|
12
|
+
var widths = exports.widths = ['narrow', 'medium', 'wide', 'extended', 'full'];
|
|
13
|
+
var animationTimingFunction = exports.animationTimingFunction = function animationTimingFunction() {
|
|
17
14
|
return _curves.easeOut;
|
|
18
15
|
};
|
|
19
|
-
exports.
|
|
20
|
-
var defaultFocusLockSettings = {
|
|
16
|
+
var defaultFocusLockSettings = exports.defaultFocusLockSettings = {
|
|
21
17
|
isFocusLockEnabled: true,
|
|
22
18
|
shouldReturnFocus: true,
|
|
23
|
-
autoFocusFirstElem: false
|
|
24
|
-
};
|
|
25
|
-
exports.defaultFocusLockSettings = defaultFocusLockSettings;
|
|
19
|
+
autoFocusFirstElem: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc') || false
|
|
20
|
+
};
|
|
@@ -8,7 +8,7 @@ import { defaultFocusLockSettings } from '../constants';
|
|
|
8
8
|
import Blanket from './blanket';
|
|
9
9
|
import DrawerPrimitive from './primitives';
|
|
10
10
|
const packageName = "@atlaskit/drawer";
|
|
11
|
-
const packageVersion = "7.
|
|
11
|
+
const packageVersion = "7.6.1";
|
|
12
12
|
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
13
13
|
const createAndFireOnClick = (createAnalyticsEvent, trigger) => createAndFireEventOnAtlaskit({
|
|
14
14
|
action: 'dismissed',
|
|
@@ -96,7 +96,9 @@ export class DrawerBase extends Component {
|
|
|
96
96
|
isFocusLockEnabled,
|
|
97
97
|
shouldReturnFocus,
|
|
98
98
|
overrides,
|
|
99
|
-
zIndex = 'unset'
|
|
99
|
+
zIndex = 'unset',
|
|
100
|
+
label,
|
|
101
|
+
titleId
|
|
100
102
|
} = this.props;
|
|
101
103
|
return /*#__PURE__*/React.createElement(Portal, {
|
|
102
104
|
zIndex: zIndex
|
|
@@ -112,6 +114,8 @@ export class DrawerBase extends Component {
|
|
|
112
114
|
onCloseComplete: onCloseComplete,
|
|
113
115
|
onOpenComplete: onOpenComplete,
|
|
114
116
|
width: width,
|
|
117
|
+
label: label,
|
|
118
|
+
titleId: titleId,
|
|
115
119
|
shouldUnmountOnExit: shouldUnmountOnExit
|
|
116
120
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
117
121
|
,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
/** @jsx jsx */
|
|
2
|
-
|
|
3
3
|
import { forwardRef, useCallback } from 'react';
|
|
4
4
|
import { css, jsx } from '@emotion/react';
|
|
5
5
|
import { useMergeRefs } from 'use-callback-ref';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { N0 } from '@atlaskit/theme/colors';
|
|
7
8
|
import { CURRENT_SURFACE_CSS_VAR } from '@atlaskit/tokens';
|
|
8
9
|
import usePreventProgrammaticScroll from './hooks/use-prevent-programmatic-scroll';
|
|
@@ -42,7 +43,9 @@ const DrawerWrapper = /*#__PURE__*/forwardRef(({
|
|
|
42
43
|
className,
|
|
43
44
|
width = 'narrow',
|
|
44
45
|
testId,
|
|
45
|
-
drawerRef
|
|
46
|
+
drawerRef,
|
|
47
|
+
label,
|
|
48
|
+
titleId
|
|
46
49
|
}, scrollRef) => {
|
|
47
50
|
/**
|
|
48
51
|
* We use a callback ref to assign the `<Content />` component to the forwarded `scrollRef`.
|
|
@@ -60,12 +63,18 @@ const DrawerWrapper = /*#__PURE__*/forwardRef(({
|
|
|
60
63
|
}, [scrollRef]);
|
|
61
64
|
const ref = useMergeRefs([drawerRef, assignSecondChildRef]);
|
|
62
65
|
usePreventProgrammaticScroll();
|
|
63
|
-
|
|
66
|
+
const modalDialogAttributes = getBooleanFF('platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc') && {
|
|
67
|
+
'aria-modal': true,
|
|
68
|
+
role: 'dialog',
|
|
69
|
+
'aria-label': label,
|
|
70
|
+
'aria-labelledby': titleId
|
|
71
|
+
};
|
|
72
|
+
return jsx("div", _extends({
|
|
64
73
|
css: wrapperStyles,
|
|
65
74
|
style: wrapperWidth[width],
|
|
66
75
|
className: className,
|
|
67
76
|
"data-testid": testId,
|
|
68
77
|
ref: ref
|
|
69
|
-
}, children);
|
|
78
|
+
}, modalDialogAttributes), children);
|
|
70
79
|
});
|
|
71
80
|
export default DrawerWrapper;
|
|
@@ -58,7 +58,9 @@ const DrawerPrimitive = ({
|
|
|
58
58
|
shouldReturnFocus,
|
|
59
59
|
autoFocusFirstElem,
|
|
60
60
|
isFocusLockEnabled,
|
|
61
|
-
width
|
|
61
|
+
width,
|
|
62
|
+
label,
|
|
63
|
+
titleId
|
|
62
64
|
}) => {
|
|
63
65
|
const getOverrides = createExtender(defaults, overrides);
|
|
64
66
|
const {
|
|
@@ -95,7 +97,9 @@ const DrawerPrimitive = ({
|
|
|
95
97
|
className: className,
|
|
96
98
|
width: width,
|
|
97
99
|
testId: testId,
|
|
98
|
-
drawerRef: drawerRef
|
|
100
|
+
drawerRef: drawerRef,
|
|
101
|
+
label: label,
|
|
102
|
+
titleId: titleId
|
|
99
103
|
}, jsx(Sidebar, sideBarOverrides, jsx(IconButton, {
|
|
100
104
|
onClick: onClose,
|
|
101
105
|
testId: testId && 'DrawerPrimitiveSidebarCloseButton'
|
package/dist/es2019/constants.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { easeOut } from '@atlaskit/motion/curves';
|
|
2
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
export const transitionDuration = '0.22s';
|
|
3
4
|
export const transitionDurationMs = 220;
|
|
4
5
|
export const transitionTimingFunction = easeOut;
|
|
@@ -7,5 +8,5 @@ export const animationTimingFunction = () => easeOut;
|
|
|
7
8
|
export const defaultFocusLockSettings = {
|
|
8
9
|
isFocusLockEnabled: true,
|
|
9
10
|
shouldReturnFocus: true,
|
|
10
|
-
autoFocusFirstElem: false
|
|
11
|
+
autoFocusFirstElem: getBooleanFF('platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc') || false
|
|
11
12
|
};
|
|
@@ -18,7 +18,7 @@ import { defaultFocusLockSettings } from '../constants';
|
|
|
18
18
|
import Blanket from './blanket';
|
|
19
19
|
import DrawerPrimitive from './primitives';
|
|
20
20
|
var packageName = "@atlaskit/drawer";
|
|
21
|
-
var packageVersion = "7.
|
|
21
|
+
var packageVersion = "7.6.1";
|
|
22
22
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
23
23
|
var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
|
|
24
24
|
return createAndFireEventOnAtlaskit({
|
|
@@ -119,7 +119,9 @@ export var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
119
119
|
shouldReturnFocus = _this$props3.shouldReturnFocus,
|
|
120
120
|
overrides = _this$props3.overrides,
|
|
121
121
|
_this$props3$zIndex = _this$props3.zIndex,
|
|
122
|
-
zIndex = _this$props3$zIndex === void 0 ? 'unset' : _this$props3$zIndex
|
|
122
|
+
zIndex = _this$props3$zIndex === void 0 ? 'unset' : _this$props3$zIndex,
|
|
123
|
+
label = _this$props3.label,
|
|
124
|
+
titleId = _this$props3.titleId;
|
|
123
125
|
return /*#__PURE__*/React.createElement(Portal, {
|
|
124
126
|
zIndex: zIndex
|
|
125
127
|
}, /*#__PURE__*/React.createElement(Blanket, {
|
|
@@ -134,6 +136,8 @@ export var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
134
136
|
onCloseComplete: onCloseComplete,
|
|
135
137
|
onOpenComplete: onOpenComplete,
|
|
136
138
|
width: width,
|
|
139
|
+
label: label,
|
|
140
|
+
titleId: titleId,
|
|
137
141
|
shouldUnmountOnExit: shouldUnmountOnExit
|
|
138
142
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
139
143
|
,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
var _css;
|
|
3
4
|
/** @jsx jsx */
|
|
4
|
-
|
|
5
5
|
import { forwardRef, useCallback } from 'react';
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { useMergeRefs } from 'use-callback-ref';
|
|
8
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { N0 } from '@atlaskit/theme/colors';
|
|
9
10
|
import { CURRENT_SURFACE_CSS_VAR } from '@atlaskit/tokens';
|
|
10
11
|
import usePreventProgrammaticScroll from './hooks/use-prevent-programmatic-scroll';
|
|
@@ -43,7 +44,9 @@ var DrawerWrapper = /*#__PURE__*/forwardRef(function (_ref, scrollRef) {
|
|
|
43
44
|
_ref$width = _ref.width,
|
|
44
45
|
width = _ref$width === void 0 ? 'narrow' : _ref$width,
|
|
45
46
|
testId = _ref.testId,
|
|
46
|
-
drawerRef = _ref.drawerRef
|
|
47
|
+
drawerRef = _ref.drawerRef,
|
|
48
|
+
label = _ref.label,
|
|
49
|
+
titleId = _ref.titleId;
|
|
47
50
|
/**
|
|
48
51
|
* We use a callback ref to assign the `<Content />` component to the forwarded `scrollRef`.
|
|
49
52
|
* This ref comes from `react-scrolllock` to allow touch scrolling, eg.: `<ScrollLock><TouchScrollable>{children}</TouchScrollable><ScrollLock>`
|
|
@@ -60,12 +63,18 @@ var DrawerWrapper = /*#__PURE__*/forwardRef(function (_ref, scrollRef) {
|
|
|
60
63
|
}, [scrollRef]);
|
|
61
64
|
var ref = useMergeRefs([drawerRef, assignSecondChildRef]);
|
|
62
65
|
usePreventProgrammaticScroll();
|
|
63
|
-
|
|
66
|
+
var modalDialogAttributes = getBooleanFF('platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc') && {
|
|
67
|
+
'aria-modal': true,
|
|
68
|
+
role: 'dialog',
|
|
69
|
+
'aria-label': label,
|
|
70
|
+
'aria-labelledby': titleId
|
|
71
|
+
};
|
|
72
|
+
return jsx("div", _extends({
|
|
64
73
|
css: wrapperStyles,
|
|
65
74
|
style: wrapperWidth[width],
|
|
66
75
|
className: className,
|
|
67
76
|
"data-testid": testId,
|
|
68
77
|
ref: ref
|
|
69
|
-
}, children);
|
|
78
|
+
}, modalDialogAttributes), children);
|
|
70
79
|
});
|
|
71
80
|
export default DrawerWrapper;
|
|
@@ -59,7 +59,9 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
59
59
|
shouldReturnFocus = _ref2.shouldReturnFocus,
|
|
60
60
|
autoFocusFirstElem = _ref2.autoFocusFirstElem,
|
|
61
61
|
isFocusLockEnabled = _ref2.isFocusLockEnabled,
|
|
62
|
-
width = _ref2.width
|
|
62
|
+
width = _ref2.width,
|
|
63
|
+
label = _ref2.label,
|
|
64
|
+
titleId = _ref2.titleId;
|
|
63
65
|
var getOverrides = createExtender(defaults, overrides);
|
|
64
66
|
var _getOverrides = getOverrides('Sidebar'),
|
|
65
67
|
Sidebar = _getOverrides.component,
|
|
@@ -74,9 +76,9 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
74
76
|
var drawerRef = useRef(null);
|
|
75
77
|
var onFinish = useCallback(function (state) {
|
|
76
78
|
if (state === 'entering') {
|
|
77
|
-
onOpenComplete === null || onOpenComplete === void 0
|
|
79
|
+
onOpenComplete === null || onOpenComplete === void 0 || onOpenComplete(drawerRef.current);
|
|
78
80
|
} else if (state === 'exiting') {
|
|
79
|
-
onCloseComplete === null || onCloseComplete === void 0
|
|
81
|
+
onCloseComplete === null || onCloseComplete === void 0 || onCloseComplete(drawerRef.current);
|
|
80
82
|
}
|
|
81
83
|
}, [onCloseComplete, onOpenComplete]);
|
|
82
84
|
return jsx(ExitingPersistence, {
|
|
@@ -93,7 +95,9 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
93
95
|
className: className,
|
|
94
96
|
width: width,
|
|
95
97
|
testId: testId,
|
|
96
|
-
drawerRef: drawerRef
|
|
98
|
+
drawerRef: drawerRef,
|
|
99
|
+
label: label,
|
|
100
|
+
titleId: titleId
|
|
97
101
|
}, jsx(Sidebar, sideBarOverrides, jsx(IconButton, {
|
|
98
102
|
onClick: onClose,
|
|
99
103
|
testId: testId && 'DrawerPrimitiveSidebarCloseButton'
|
package/dist/esm/constants.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { easeOut } from '@atlaskit/motion/curves';
|
|
2
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
export var transitionDuration = '0.22s';
|
|
3
4
|
export var transitionDurationMs = 220;
|
|
4
5
|
export var transitionTimingFunction = easeOut;
|
|
@@ -9,5 +10,5 @@ export var animationTimingFunction = function animationTimingFunction() {
|
|
|
9
10
|
export var defaultFocusLockSettings = {
|
|
10
11
|
isFocusLockEnabled: true,
|
|
11
12
|
shouldReturnFocus: true,
|
|
12
|
-
autoFocusFirstElem: false
|
|
13
|
+
autoFocusFirstElem: getBooleanFF('platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc') || false
|
|
13
14
|
};
|
|
@@ -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>, "children" | "onKeyDown" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen"> & 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>, "children" | "onKeyDown" | "onClose" | "testId" | "icon" | "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 | undefined;
|
|
29
29
|
width: DrawerWidth;
|
|
30
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "width" | "children" | "onKeyDown" | "key" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | "analyticsContext" | keyof import("./types").FocusLockSettings> & React.RefAttributes<any>>;
|
|
30
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "width" | "children" | "onKeyDown" | "key" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | "analyticsContext" | keyof import("./types").FocusLockSettings | keyof import("./types").DrawerLabel> & React.RefAttributes<any>>;
|
|
31
31
|
export default _default;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ReactElement, Ref } from 'react';
|
|
3
3
|
import { DrawerPrimitiveProps, Widths } from '../types';
|
|
4
4
|
export declare const wrapperWidth: Widths;
|
|
5
|
-
interface FocusLockRefTargetProps extends Pick<DrawerPrimitiveProps, 'width' | 'testId'> {
|
|
5
|
+
interface FocusLockRefTargetProps extends Pick<DrawerPrimitiveProps, 'width' | 'testId' | 'label' | 'titleId'> {
|
|
6
6
|
/**
|
|
7
7
|
* This must have two children explicitly as we target the second child as the Content.
|
|
8
8
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { DrawerPrimitiveProps } from '../types';
|
|
4
|
-
declare const DrawerPrimitive: ({ children, icon: Icon, onClose, onCloseComplete, onOpenComplete, overrides, testId, in: isOpen, shouldReturnFocus, autoFocusFirstElem, isFocusLockEnabled, width, }: DrawerPrimitiveProps) => jsx.JSX.Element;
|
|
4
|
+
declare const DrawerPrimitive: ({ children, icon: Icon, onClose, onCloseComplete, onOpenComplete, overrides, testId, in: isOpen, shouldReturnFocus, autoFocusFirstElem, isFocusLockEnabled, width, label, titleId, }: DrawerPrimitiveProps) => jsx.JSX.Element;
|
|
5
5
|
export default DrawerPrimitive;
|
|
@@ -54,6 +54,18 @@ export interface BaseProps {
|
|
|
54
54
|
*/
|
|
55
55
|
overrides?: OverridesType;
|
|
56
56
|
}
|
|
57
|
+
export interface DrawerLabel {
|
|
58
|
+
/**
|
|
59
|
+
* Refers to an aria-label attribute. Sets an accessible name for drawer wrapper to announce it to users of assistive technology.
|
|
60
|
+
* Usage of either this, or the `titleId` attribute is strongly recommended.
|
|
61
|
+
*/
|
|
62
|
+
label?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Id referenced by the drawer wrapper's aria-labelledby attribute. This id should be assigned to the drawer title element.
|
|
65
|
+
* Usage of either this, or the `label` attribute is strongly recommended.
|
|
66
|
+
*/
|
|
67
|
+
titleId?: string;
|
|
68
|
+
}
|
|
57
69
|
export type DefaultsType = {
|
|
58
70
|
Sidebar: {
|
|
59
71
|
component: React.ComponentType<SidebarProps>;
|
|
@@ -96,11 +108,11 @@ export interface ContentProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
96
108
|
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
97
109
|
}
|
|
98
110
|
export type ContentCSSProps = Omit<ContentProps, 'cssFn'>;
|
|
99
|
-
export interface DrawerPrimitiveProps extends BaseProps, FocusLockSettings {
|
|
111
|
+
export interface DrawerPrimitiveProps extends BaseProps, FocusLockSettings, DrawerLabel {
|
|
100
112
|
in: boolean;
|
|
101
113
|
onClose: (event: SyntheticEvent<HTMLElement>) => void;
|
|
102
114
|
}
|
|
103
|
-
export type DrawerProps = BaseProps & FocusLockSettings & WithAnalyticsEventsProps & {
|
|
115
|
+
export type DrawerProps = BaseProps & FocusLockSettings & WithAnalyticsEventsProps & DrawerLabel & {
|
|
104
116
|
/**
|
|
105
117
|
* Callback function called while the drawer is displayed and `keydown` event is triggered.
|
|
106
118
|
*/
|
|
@@ -122,7 +134,7 @@ export type DrawerProps = BaseProps & FocusLockSettings & WithAnalyticsEventsPro
|
|
|
122
134
|
};
|
|
123
135
|
export interface FocusLockSettings {
|
|
124
136
|
/**
|
|
125
|
-
* Controls whether to focus the first tabbable element inside the focus lock.
|
|
137
|
+
* Controls whether to focus the first tabbable element inside the focus lock. Set to `true` by default.
|
|
126
138
|
*/
|
|
127
139
|
autoFocusFirstElem?: boolean | (() => HTMLElement | null);
|
|
128
140
|
/**
|
|
@@ -130,14 +142,14 @@ export interface FocusLockSettings {
|
|
|
130
142
|
*/
|
|
131
143
|
isFocusLockEnabled?: boolean;
|
|
132
144
|
/**
|
|
133
|
-
*
|
|
145
|
+
* Controls whether to return the focus to the previous active element on closing the drawer. Set to `true` by default.
|
|
134
146
|
*/
|
|
135
147
|
shouldReturnFocus?: boolean;
|
|
136
148
|
}
|
|
137
149
|
export interface FocusLockProps extends FocusLockSettings {
|
|
138
150
|
/**
|
|
139
151
|
* Content inside the focus lock.
|
|
140
|
-
* Must strictly be a ReactElement and it *must* be implemented to take a `ref` passed from `react-
|
|
152
|
+
* Must strictly be a ReactElement and it *must* be implemented to take a `ref` passed from `react-scrollock` to enable Touch Scrolling.
|
|
141
153
|
*/
|
|
142
154
|
children?: ReactElement;
|
|
143
155
|
}
|
|
@@ -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>, "children" | "onKeyDown" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen"> & 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>, "children" | "onKeyDown" | "onClose" | "testId" | "icon" | "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 | undefined;
|
|
29
29
|
width: DrawerWidth;
|
|
30
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "width" | "children" | "onKeyDown" | "key" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | "analyticsContext" | keyof import("./types").FocusLockSettings> & React.RefAttributes<any>>;
|
|
30
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "width" | "children" | "onKeyDown" | "key" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | "analyticsContext" | keyof import("./types").FocusLockSettings | keyof import("./types").DrawerLabel> & React.RefAttributes<any>>;
|
|
31
31
|
export default _default;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ReactElement, Ref } from 'react';
|
|
3
3
|
import { DrawerPrimitiveProps, Widths } from '../types';
|
|
4
4
|
export declare const wrapperWidth: Widths;
|
|
5
|
-
interface FocusLockRefTargetProps extends Pick<DrawerPrimitiveProps, 'width' | 'testId'> {
|
|
5
|
+
interface FocusLockRefTargetProps extends Pick<DrawerPrimitiveProps, 'width' | 'testId' | 'label' | 'titleId'> {
|
|
6
6
|
/**
|
|
7
7
|
* This must have two children explicitly as we target the second child as the Content.
|
|
8
8
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { DrawerPrimitiveProps } from '../types';
|
|
4
|
-
declare const DrawerPrimitive: ({ children, icon: Icon, onClose, onCloseComplete, onOpenComplete, overrides, testId, in: isOpen, shouldReturnFocus, autoFocusFirstElem, isFocusLockEnabled, width, }: DrawerPrimitiveProps) => jsx.JSX.Element;
|
|
4
|
+
declare const DrawerPrimitive: ({ children, icon: Icon, onClose, onCloseComplete, onOpenComplete, overrides, testId, in: isOpen, shouldReturnFocus, autoFocusFirstElem, isFocusLockEnabled, width, label, titleId, }: DrawerPrimitiveProps) => jsx.JSX.Element;
|
|
5
5
|
export default DrawerPrimitive;
|
|
@@ -54,6 +54,18 @@ export interface BaseProps {
|
|
|
54
54
|
*/
|
|
55
55
|
overrides?: OverridesType;
|
|
56
56
|
}
|
|
57
|
+
export interface DrawerLabel {
|
|
58
|
+
/**
|
|
59
|
+
* Refers to an aria-label attribute. Sets an accessible name for drawer wrapper to announce it to users of assistive technology.
|
|
60
|
+
* Usage of either this, or the `titleId` attribute is strongly recommended.
|
|
61
|
+
*/
|
|
62
|
+
label?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Id referenced by the drawer wrapper's aria-labelledby attribute. This id should be assigned to the drawer title element.
|
|
65
|
+
* Usage of either this, or the `label` attribute is strongly recommended.
|
|
66
|
+
*/
|
|
67
|
+
titleId?: string;
|
|
68
|
+
}
|
|
57
69
|
export type DefaultsType = {
|
|
58
70
|
Sidebar: {
|
|
59
71
|
component: React.ComponentType<SidebarProps>;
|
|
@@ -96,11 +108,11 @@ export interface ContentProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
96
108
|
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
97
109
|
}
|
|
98
110
|
export type ContentCSSProps = Omit<ContentProps, 'cssFn'>;
|
|
99
|
-
export interface DrawerPrimitiveProps extends BaseProps, FocusLockSettings {
|
|
111
|
+
export interface DrawerPrimitiveProps extends BaseProps, FocusLockSettings, DrawerLabel {
|
|
100
112
|
in: boolean;
|
|
101
113
|
onClose: (event: SyntheticEvent<HTMLElement>) => void;
|
|
102
114
|
}
|
|
103
|
-
export type DrawerProps = BaseProps & FocusLockSettings & WithAnalyticsEventsProps & {
|
|
115
|
+
export type DrawerProps = BaseProps & FocusLockSettings & WithAnalyticsEventsProps & DrawerLabel & {
|
|
104
116
|
/**
|
|
105
117
|
* Callback function called while the drawer is displayed and `keydown` event is triggered.
|
|
106
118
|
*/
|
|
@@ -122,7 +134,7 @@ export type DrawerProps = BaseProps & FocusLockSettings & WithAnalyticsEventsPro
|
|
|
122
134
|
};
|
|
123
135
|
export interface FocusLockSettings {
|
|
124
136
|
/**
|
|
125
|
-
* Controls whether to focus the first tabbable element inside the focus lock.
|
|
137
|
+
* Controls whether to focus the first tabbable element inside the focus lock. Set to `true` by default.
|
|
126
138
|
*/
|
|
127
139
|
autoFocusFirstElem?: boolean | (() => HTMLElement | null);
|
|
128
140
|
/**
|
|
@@ -130,14 +142,14 @@ export interface FocusLockSettings {
|
|
|
130
142
|
*/
|
|
131
143
|
isFocusLockEnabled?: boolean;
|
|
132
144
|
/**
|
|
133
|
-
*
|
|
145
|
+
* Controls whether to return the focus to the previous active element on closing the drawer. Set to `true` by default.
|
|
134
146
|
*/
|
|
135
147
|
shouldReturnFocus?: boolean;
|
|
136
148
|
}
|
|
137
149
|
export interface FocusLockProps extends FocusLockSettings {
|
|
138
150
|
/**
|
|
139
151
|
* Content inside the focus lock.
|
|
140
|
-
* Must strictly be a ReactElement and it *must* be implemented to take a `ref` passed from `react-
|
|
152
|
+
* Must strictly be a ReactElement and it *must* be implemented to take a `ref` passed from `react-scrollock` to enable Touch Scrolling.
|
|
141
153
|
*/
|
|
142
154
|
children?: ReactElement;
|
|
143
155
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/drawer",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.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/"
|
|
@@ -36,15 +36,16 @@
|
|
|
36
36
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
37
37
|
"@atlaskit/blanket": "^12.4.0",
|
|
38
38
|
"@atlaskit/icon": "^21.12.0",
|
|
39
|
-
"@atlaskit/motion": "^1.
|
|
39
|
+
"@atlaskit/motion": "^1.5.0",
|
|
40
|
+
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
40
41
|
"@atlaskit/portal": "^4.3.0",
|
|
41
|
-
"@atlaskit/theme": "^12.
|
|
42
|
-
"@atlaskit/tokens": "^1.
|
|
42
|
+
"@atlaskit/theme": "^12.6.0",
|
|
43
|
+
"@atlaskit/tokens": "^1.25.0",
|
|
43
44
|
"@babel/runtime": "^7.0.0",
|
|
44
45
|
"@emotion/react": "^11.7.1",
|
|
45
46
|
"bind-event-listener": "^2.1.1",
|
|
46
47
|
"exenv": "^1.2.2",
|
|
47
|
-
"react-focus-lock": "^2.5
|
|
48
|
+
"react-focus-lock": "^2.9.5",
|
|
48
49
|
"react-scrolllock": "^5.0.1",
|
|
49
50
|
"tiny-invariant": "^1.2.0",
|
|
50
51
|
"use-callback-ref": "^1.2.3"
|
|
@@ -54,12 +55,14 @@
|
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@af/accessibility-testing": "*",
|
|
58
|
+
"@af/integration-testing": "*",
|
|
57
59
|
"@af/visual-regression": "*",
|
|
58
60
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
59
61
|
"@atlaskit/ssr": "*",
|
|
60
62
|
"@atlaskit/visual-regression": "*",
|
|
61
63
|
"@atlaskit/webdriver-runner": "*",
|
|
62
64
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
65
|
+
"@atlassian/feature-flags-test-utils": "*",
|
|
63
66
|
"@testing-library/react": "^12.1.5",
|
|
64
67
|
"@testing-library/user-event": "^14.4.3",
|
|
65
68
|
"lodash": "^4.17.21",
|
|
@@ -90,5 +93,10 @@
|
|
|
90
93
|
]
|
|
91
94
|
}
|
|
92
95
|
},
|
|
93
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
96
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|
|
97
|
+
"platform-feature-flags": {
|
|
98
|
+
"platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc": {
|
|
99
|
+
"type": "boolean"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
94
102
|
}
|
package/report.api.md
CHANGED
|
@@ -65,6 +65,7 @@ const _default: React_2.ForwardRefExoticComponent<
|
|
|
65
65
|
| 'shouldUnmountOnExit'
|
|
66
66
|
| 'testId'
|
|
67
67
|
| 'zIndex'
|
|
68
|
+
| keyof DrawerLabel
|
|
68
69
|
> &
|
|
69
70
|
Partial<
|
|
70
71
|
Pick<
|
|
@@ -102,6 +103,7 @@ const _default: React_2.ForwardRefExoticComponent<
|
|
|
102
103
|
| 'testId'
|
|
103
104
|
| 'width'
|
|
104
105
|
| 'zIndex'
|
|
106
|
+
| keyof DrawerLabel
|
|
105
107
|
| keyof FocusLockSettings
|
|
106
108
|
> &
|
|
107
109
|
React_2.RefAttributes<any>
|
|
@@ -120,6 +122,12 @@ export type DefaultsType = {
|
|
|
120
122
|
};
|
|
121
123
|
};
|
|
122
124
|
|
|
125
|
+
// @public (undocumented)
|
|
126
|
+
interface DrawerLabel {
|
|
127
|
+
label?: string;
|
|
128
|
+
titleId?: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
123
131
|
// @public (undocumented)
|
|
124
132
|
export type DrawerPrimitiveDefaults = Pick<DefaultsType, 'Content' | 'Sidebar'>;
|
|
125
133
|
|
|
@@ -130,7 +138,10 @@ export type DrawerPrimitiveOverrides = Pick<
|
|
|
130
138
|
>;
|
|
131
139
|
|
|
132
140
|
// @public (undocumented)
|
|
133
|
-
export interface DrawerPrimitiveProps
|
|
141
|
+
export interface DrawerPrimitiveProps
|
|
142
|
+
extends BaseProps,
|
|
143
|
+
FocusLockSettings,
|
|
144
|
+
DrawerLabel {
|
|
134
145
|
// (undocumented)
|
|
135
146
|
in: boolean;
|
|
136
147
|
// (undocumented)
|
|
@@ -140,7 +151,8 @@ export interface DrawerPrimitiveProps extends BaseProps, FocusLockSettings {
|
|
|
140
151
|
// @public (undocumented)
|
|
141
152
|
export type DrawerProps = BaseProps &
|
|
142
153
|
FocusLockSettings &
|
|
143
|
-
WithAnalyticsEventsProps &
|
|
154
|
+
WithAnalyticsEventsProps &
|
|
155
|
+
DrawerLabel & {
|
|
144
156
|
onKeyDown?: (event: SyntheticEvent) => void;
|
|
145
157
|
onClose?: (event: SyntheticEvent<HTMLElement>, analyticsEvent: any) => void;
|
|
146
158
|
isOpen: boolean;
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -39,12 +39,12 @@ export interface ContentProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
// @public (undocumented)
|
|
42
|
-
const _default: React_2.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerProps, keyof WithAnalyticsEventsProps>, "children" | "icon" | "isOpen" | "onClose" | "onCloseComplete" | "onKeyDown" | "onOpenComplete" | "overrides" | "shouldUnmountOnExit" | "testId" | "zIndex"> & Partial<Pick<Omit<DrawerProps, keyof WithAnalyticsEventsProps>, "width" | keyof FocusLockSettings>> & Partial<Pick<{
|
|
42
|
+
const _default: React_2.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerProps, keyof WithAnalyticsEventsProps>, "children" | "icon" | "isOpen" | "onClose" | "onCloseComplete" | "onKeyDown" | "onOpenComplete" | "overrides" | "shouldUnmountOnExit" | "testId" | "zIndex" | keyof DrawerLabel> & Partial<Pick<Omit<DrawerProps, keyof WithAnalyticsEventsProps>, "width" | keyof FocusLockSettings>> & Partial<Pick<{
|
|
43
43
|
autoFocusFirstElem?: (() => HTMLElement | null) | boolean | undefined;
|
|
44
44
|
isFocusLockEnabled?: boolean | undefined;
|
|
45
45
|
shouldReturnFocus?: boolean | undefined;
|
|
46
46
|
width: DrawerWidth;
|
|
47
|
-
}, never>> & React_2.RefAttributes<any> & WithContextProps, "analyticsContext" | "children" | "icon" | "isOpen" | "key" | "onClose" | "onCloseComplete" | "onKeyDown" | "onOpenComplete" | "overrides" | "shouldUnmountOnExit" | "testId" | "width" | "zIndex" | keyof FocusLockSettings> & React_2.RefAttributes<any>>;
|
|
47
|
+
}, never>> & React_2.RefAttributes<any> & WithContextProps, "analyticsContext" | "children" | "icon" | "isOpen" | "key" | "onClose" | "onCloseComplete" | "onKeyDown" | "onOpenComplete" | "overrides" | "shouldUnmountOnExit" | "testId" | "width" | "zIndex" | keyof DrawerLabel| keyof FocusLockSettings > & React_2.RefAttributes<any>>;
|
|
48
48
|
export default _default;
|
|
49
49
|
|
|
50
50
|
// @public (undocumented)
|
|
@@ -59,6 +59,12 @@ export type DefaultsType = {
|
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
+
// @public (undocumented)
|
|
63
|
+
interface DrawerLabel {
|
|
64
|
+
label?: string;
|
|
65
|
+
titleId?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
62
68
|
// @public (undocumented)
|
|
63
69
|
export type DrawerPrimitiveDefaults = Pick<DefaultsType, 'Content' | 'Sidebar'>;
|
|
64
70
|
|
|
@@ -66,7 +72,7 @@ export type DrawerPrimitiveDefaults = Pick<DefaultsType, 'Content' | 'Sidebar'>;
|
|
|
66
72
|
export type DrawerPrimitiveOverrides = Pick<OverridesType, 'Content' | 'Sidebar'>;
|
|
67
73
|
|
|
68
74
|
// @public (undocumented)
|
|
69
|
-
export interface DrawerPrimitiveProps extends BaseProps, FocusLockSettings {
|
|
75
|
+
export interface DrawerPrimitiveProps extends BaseProps, FocusLockSettings, DrawerLabel {
|
|
70
76
|
// (undocumented)
|
|
71
77
|
in: boolean;
|
|
72
78
|
// (undocumented)
|
|
@@ -74,7 +80,7 @@ export interface DrawerPrimitiveProps extends BaseProps, FocusLockSettings {
|
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
// @public (undocumented)
|
|
77
|
-
export type DrawerProps = BaseProps & FocusLockSettings & WithAnalyticsEventsProps & {
|
|
83
|
+
export type DrawerProps = BaseProps & FocusLockSettings & WithAnalyticsEventsProps & DrawerLabel & {
|
|
78
84
|
onKeyDown?: (event: SyntheticEvent) => void;
|
|
79
85
|
onClose?: (event: SyntheticEvent<HTMLElement>, analyticsEvent: any) => void;
|
|
80
86
|
isOpen: boolean;
|