@atlaskit/popup 8.0.0 → 9.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,26 @@
1
1
  # @atlaskit/popup
2
2
 
3
+ ## 9.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`d562a51283c05`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d562a51283c05) -
8
+ Widen Popup and Dropdown Menu trigger `aria-haspopup` types to include valid popup kinds,
9
+ including `menu`. Consumers with explicitly narrow render-prop annotations may need to accept the
10
+ additional values.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 8.1.0
17
+
18
+ ### Minor Changes
19
+
20
+ - [`f0b2e3b3c48b2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f0b2e3b3c48b2) -
21
+ Export `TriggerAriaProps` from `@atlaskit/popup/types` for components that accept Popup's trigger
22
+ ARIA attributes.
23
+
3
24
  ## 8.0.0
4
25
 
5
26
  ### Major 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({
@@ -1,11 +1,7 @@
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 interface TriggerProps {
5
- /**
6
- * React ref that will be attached to the trigger element.
7
- */
8
- ref: Ref<any>;
4
+ export interface TriggerAriaProps {
9
5
  /**
10
6
  * Identifies the popup element that the trigger controls.
11
7
  * Should match the `id` of the popup content for screen readers to understand the relationship.
@@ -18,7 +14,13 @@ export interface TriggerProps {
18
14
  /**
19
15
  * Informs assistive technology that this element triggers a popup.
20
16
  */
21
- 'aria-haspopup': boolean | 'dialog';
17
+ 'aria-haspopup': boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
18
+ }
19
+ export interface TriggerProps extends TriggerAriaProps {
20
+ /**
21
+ * React ref that will be attached to the trigger element.
22
+ */
23
+ ref: Ref<any>;
22
24
  'data-ds--level'?: string;
23
25
  }
24
26
  export type PopupRef = HTMLDivElement | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "8.0.0",
3
+ "version": "9.0.0",
4
4
  "description": "A popup displays brief content in an overlay.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,14 +37,14 @@
37
37
  "@atlaskit/css": "^1.1.0",
38
38
  "@atlaskit/ds-lib": "^8.0.0",
39
39
  "@atlaskit/layering": "^6.0.0",
40
- "@atlaskit/motion": "^9.0.0",
40
+ "@atlaskit/motion": "^9.1.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
46
  "@atlaskit/tokens": "^20.1.0",
47
- "@atlaskit/top-layer": "^6.0.0",
47
+ "@atlaskit/top-layer": "^6.1.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@compiled/react": "^1.0.2",
50
50
  "bind-event-listener": "^3.0.0",
@@ -65,7 +65,7 @@
65
65
  "@atlaskit/code": "^20.0.0",
66
66
  "@atlaskit/datetime-picker": "^19.0.0",
67
67
  "@atlaskit/docs": "^12.3.0",
68
- "@atlaskit/dropdown-menu": "^20.0.0",
68
+ "@atlaskit/dropdown-menu": "^21.0.0",
69
69
  "@atlaskit/form": "^18.0.0",
70
70
  "@atlaskit/heading": "^8.0.0",
71
71
  "@atlaskit/icon": "^38.0.0",