@atlaskit/popup 6.3.9 → 7.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
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/popup
|
|
2
2
|
|
|
3
|
+
## 7.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`5e712839d1e00`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5e712839d1e00) -
|
|
8
|
+
Popup's trigger render props now include the role-specific `aria-haspopup` values `"menu"`,
|
|
9
|
+
`"listbox"`, `"tree"`, and `"grid"`, which the top-layer path could already provide at runtime.
|
|
10
|
+
Popup also exports `AriaHasPopup` and `TriggerAriaProps` for consumers to type trigger ARIA
|
|
11
|
+
attributes. Use booleans instead of the string values `"true"` and `"false"`.
|
|
12
|
+
|
|
13
|
+
Dropdown Menu's custom trigger props now reflect Popup's `aria-haspopup` values, and Dropdown Item
|
|
14
|
+
accepts the same roles and booleans. Custom triggers forward Popup's value on the legacy path; the
|
|
15
|
+
top-layer path provides `"menu"`. Dropdown items already forwarded `aria-controls` and
|
|
16
|
+
`aria-expanded` at runtime.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
22
|
+
## 6.3.10
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 6.3.9
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -211,13 +211,6 @@ var PopupTopLayer = exports.PopupTopLayer = /*#__PURE__*/(0, _react.memo)(functi
|
|
|
211
211
|
'aria-controls': ariaAttributes['aria-controls'],
|
|
212
212
|
// `aria-expanded` reflects current open state.
|
|
213
213
|
'aria-expanded': ariaAttributes['aria-expanded'],
|
|
214
|
-
// FUDGE(top-layer-api): cast to the narrow public TriggerProps['aria-haspopup'] union.
|
|
215
|
-
// `getAriaForTrigger` derives `aria-haspopup` from the content's role and types it
|
|
216
|
-
// as the wider WAI-ARIA union (boolean | 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid').
|
|
217
|
-
// We keep the public popup TriggerProps narrow (boolean | 'dialog') because the
|
|
218
|
-
// top-layer API surface is not yet settled. Widening adopter types now would commit
|
|
219
|
-
// us to a public surface we may revisit. The runtime value is unchanged; only the
|
|
220
|
-
// TypeScript-visible type is narrowed at this boundary.
|
|
221
214
|
'aria-haspopup': ariaAttributes['aria-haspopup']
|
|
222
215
|
};
|
|
223
216
|
return /*#__PURE__*/React.createElement(_react.Fragment, null, trigger(triggerProps), /*#__PURE__*/React.createElement(_popover.Popover, (0, _extends2.default)({
|
|
@@ -223,13 +223,6 @@ export const PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer({
|
|
|
223
223
|
'aria-controls': ariaAttributes['aria-controls'],
|
|
224
224
|
// `aria-expanded` reflects current open state.
|
|
225
225
|
'aria-expanded': ariaAttributes['aria-expanded'],
|
|
226
|
-
// FUDGE(top-layer-api): cast to the narrow public TriggerProps['aria-haspopup'] union.
|
|
227
|
-
// `getAriaForTrigger` derives `aria-haspopup` from the content's role and types it
|
|
228
|
-
// as the wider WAI-ARIA union (boolean | 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid').
|
|
229
|
-
// We keep the public popup TriggerProps narrow (boolean | 'dialog') because the
|
|
230
|
-
// top-layer API surface is not yet settled. Widening adopter types now would commit
|
|
231
|
-
// us to a public surface we may revisit. The runtime value is unchanged; only the
|
|
232
|
-
// TypeScript-visible type is narrowed at this boundary.
|
|
233
226
|
'aria-haspopup': ariaAttributes['aria-haspopup']
|
|
234
227
|
};
|
|
235
228
|
return /*#__PURE__*/React.createElement(Fragment, null, trigger(triggerProps), /*#__PURE__*/React.createElement(Popover, _extends({
|
|
@@ -202,13 +202,6 @@ export var PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer(_ref) {
|
|
|
202
202
|
'aria-controls': ariaAttributes['aria-controls'],
|
|
203
203
|
// `aria-expanded` reflects current open state.
|
|
204
204
|
'aria-expanded': ariaAttributes['aria-expanded'],
|
|
205
|
-
// FUDGE(top-layer-api): cast to the narrow public TriggerProps['aria-haspopup'] union.
|
|
206
|
-
// `getAriaForTrigger` derives `aria-haspopup` from the content's role and types it
|
|
207
|
-
// as the wider WAI-ARIA union (boolean | 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid').
|
|
208
|
-
// We keep the public popup TriggerProps narrow (boolean | 'dialog') because the
|
|
209
|
-
// top-layer API surface is not yet settled. Widening adopter types now would commit
|
|
210
|
-
// us to a public surface we may revisit. The runtime value is unchanged; only the
|
|
211
|
-
// TypeScript-visible type is narrowed at this boundary.
|
|
212
205
|
'aria-haspopup': ariaAttributes['aria-haspopup']
|
|
213
206
|
};
|
|
214
207
|
return /*#__PURE__*/React.createElement(Fragment, null, trigger(triggerProps), /*#__PURE__*/React.createElement(Popover, _extends({
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { type ComponentType, type CSSProperties, type Dispatch, type PropsWithChildren, type default as React, type ReactNode, type Ref, type SetStateAction } from 'react';
|
|
2
2
|
import { type StrictXCSSProp } from '@atlaskit/css';
|
|
3
3
|
import type { Modifier, Placement, PopperChildrenProps } from '@atlaskit/popper/main';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
* React ref that will be attached to the trigger element.
|
|
7
|
-
*/
|
|
8
|
-
ref: Ref<any>;
|
|
4
|
+
export type AriaHasPopup = boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
5
|
+
export interface TriggerAriaProps {
|
|
9
6
|
/**
|
|
10
7
|
* Identifies the popup element that the trigger controls.
|
|
11
8
|
* Should match the `id` of the popup content for screen readers to understand the relationship.
|
|
@@ -18,7 +15,13 @@ export interface TriggerProps {
|
|
|
18
15
|
/**
|
|
19
16
|
* Informs assistive technology that this element triggers a popup.
|
|
20
17
|
*/
|
|
21
|
-
'aria-haspopup':
|
|
18
|
+
'aria-haspopup': AriaHasPopup;
|
|
19
|
+
}
|
|
20
|
+
export interface TriggerProps extends TriggerAriaProps {
|
|
21
|
+
/**
|
|
22
|
+
* React ref that will be attached to the trigger element.
|
|
23
|
+
*/
|
|
24
|
+
ref: Ref<any>;
|
|
22
25
|
'data-ds--level'?: string;
|
|
23
26
|
}
|
|
24
27
|
export type PopupRef = HTMLDivElement | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/popup",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "A popup displays brief content in an overlay.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@atlaskit/css": "^1.1.0",
|
|
38
38
|
"@atlaskit/ds-lib": "^8.0.0",
|
|
39
|
-
"@atlaskit/layering": "^
|
|
40
|
-
"@atlaskit/motion": "^
|
|
39
|
+
"@atlaskit/layering": "^6.0.0",
|
|
40
|
+
"@atlaskit/motion": "^9.0.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
42
42
|
"@atlaskit/popper": "^9.4.0",
|
|
43
43
|
"@atlaskit/portal": "^7.0.0",
|
|
44
44
|
"@atlaskit/primitives": "^22.5.0",
|
|
45
45
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
46
|
-
"@atlaskit/tokens": "^
|
|
47
|
-
"@atlaskit/top-layer": "^
|
|
46
|
+
"@atlaskit/tokens": "^20.1.0",
|
|
47
|
+
"@atlaskit/top-layer": "^6.0.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
49
|
"@compiled/react": "^1.0.2",
|
|
50
50
|
"bind-event-listener": "^3.0.0",
|
|
@@ -62,19 +62,19 @@
|
|
|
62
62
|
"@af/visual-regression": "workspace:^",
|
|
63
63
|
"@atlaskit/banner": "^15.3.0",
|
|
64
64
|
"@atlaskit/button": "^25.4.0",
|
|
65
|
-
"@atlaskit/code": "^
|
|
66
|
-
"@atlaskit/datetime-picker": "^
|
|
67
|
-
"@atlaskit/docs": "^12.
|
|
68
|
-
"@atlaskit/dropdown-menu": "^
|
|
69
|
-
"@atlaskit/form": "^
|
|
70
|
-
"@atlaskit/heading": "^
|
|
71
|
-
"@atlaskit/icon": "^
|
|
65
|
+
"@atlaskit/code": "^20.0.0",
|
|
66
|
+
"@atlaskit/datetime-picker": "^19.0.0",
|
|
67
|
+
"@atlaskit/docs": "^12.3.0",
|
|
68
|
+
"@atlaskit/dropdown-menu": "^19.0.0",
|
|
69
|
+
"@atlaskit/form": "^18.0.0",
|
|
70
|
+
"@atlaskit/heading": "^8.0.0",
|
|
71
|
+
"@atlaskit/icon": "^38.0.0",
|
|
72
72
|
"@atlaskit/link": "^5.1.0",
|
|
73
73
|
"@atlaskit/menu": "^11.0.0",
|
|
74
|
-
"@atlaskit/modal-dialog": "^
|
|
74
|
+
"@atlaskit/modal-dialog": "^17.0.0",
|
|
75
75
|
"@atlaskit/radio": "^10.2.0",
|
|
76
76
|
"@atlaskit/section-message": "^10.2.0",
|
|
77
|
-
"@atlaskit/select": "^
|
|
77
|
+
"@atlaskit/select": "^23.1.0",
|
|
78
78
|
"@atlaskit/textfield": "^10.2.0",
|
|
79
79
|
"@atlaskit/toggle": "^17.3.0",
|
|
80
80
|
"@atlaskit/visually-hidden": "^4.4.0",
|