@atlaskit/popup 1.4.1 → 1.5.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,17 @@
1
1
  # @atlaskit/popup
2
2
 
3
+ ## 1.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c520e306869`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c520e306869) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
8
+
9
+ ## 1.4.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
14
+
3
15
  ## 1.4.1
4
16
 
5
17
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { useState } from 'react';
3
3
 
4
- import { css, jsx } from '@emotion/core';
4
+ import { css, jsx } from '@emotion/react';
5
5
 
6
6
  import Button from '@atlaskit/button/custom-theme-button';
7
7
  import MediaServicesAddCommentIcon from '@atlaskit/icon/glyph/media-services/add-comment';
@@ -13,7 +13,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
13
13
 
14
14
  var _react = require("react");
15
15
 
16
- var _core = require("@emotion/core");
16
+ var _react2 = require("@emotion/react");
17
17
 
18
18
  var _popper = require("@atlaskit/popper");
19
19
 
@@ -28,7 +28,7 @@ var _useCloseManager = require("./use-close-manager");
28
28
  var _useFocusManager = require("./use-focus-manager");
29
29
 
30
30
  /** @jsx jsx */
31
- var popupStyles = (0, _core.css)({
31
+ var popupStyles = (0, _react2.css)({
32
32
  display: 'block',
33
33
  boxSizing: 'border-box',
34
34
  zIndex: _constants.layers.layer(),
@@ -42,10 +42,11 @@ var popupStyles = (0, _core.css)({
42
42
  }
43
43
  });
44
44
  var DefaultPopupComponent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
45
- return (0, _core.jsx)("div", (0, _extends2.default)({
46
- css: popupStyles,
45
+ return (0, _react2.jsx)("div", (0, _extends2.default)({
46
+ css: popupStyles
47
+ }, props, {
47
48
  ref: ref
48
- }, props));
49
+ }));
49
50
  });
50
51
 
51
52
  function PopperWrapper(_ref) {
@@ -100,7 +101,7 @@ function PopperWrapper(_ref) {
100
101
  }
101
102
  }];
102
103
  }, [shouldFlip, rootBoundary, boundary, fallbackPlacements]);
103
- return (0, _core.jsx)(_popper.Popper, {
104
+ return (0, _react2.jsx)(_popper.Popper, {
104
105
  placement: placement,
105
106
  offset: offset,
106
107
  modifiers: modifiers
@@ -109,7 +110,7 @@ function PopperWrapper(_ref) {
109
110
  style = _ref2.style,
110
111
  placement = _ref2.placement,
111
112
  update = _ref2.update;
112
- return (0, _core.jsx)(PopupContainer, {
113
+ return (0, _react2.jsx)(PopupContainer, {
113
114
  id: id,
114
115
  "data-placement": placement,
115
116
  "data-testid": testId,
@@ -128,7 +129,7 @@ function PopperWrapper(_ref) {
128
129
  // first on the browser address bar when using keyboard
129
130
  ,
130
131
  tabIndex: autoFocus ? 0 : undefined
131
- }, (0, _core.jsx)(_repositionOnUpdate.RepositionOnUpdate, {
132
+ }, (0, _react2.jsx)(_repositionOnUpdate.RepositionOnUpdate, {
132
133
  update: update
133
134
  }, content({
134
135
  update: update,
package/dist/cjs/popup.js CHANGED
@@ -11,7 +11,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
 
12
12
  var _react = require("react");
13
13
 
14
- var _core = require("@emotion/core");
14
+ var _react2 = require("@emotion/react");
15
15
 
16
16
  var _popper = require("@atlaskit/popper");
17
17
 
@@ -55,7 +55,7 @@ var Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
55
55
  triggerRef = _useState2[0],
56
56
  setTriggerRef = _useState2[1];
57
57
 
58
- return (0, _core.jsx)(_popper.Manager, null, (0, _core.jsx)(_popper.Reference, null, function (_ref2) {
58
+ return (0, _react2.jsx)(_popper.Manager, null, (0, _react2.jsx)(_popper.Reference, null, function (_ref2) {
59
59
  var _ref3 = _ref2.ref;
60
60
  return trigger({
61
61
  ref: function ref(node) {
@@ -73,9 +73,9 @@ var Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
73
73
  'aria-expanded': isOpen,
74
74
  'aria-haspopup': true
75
75
  });
76
- }), isOpen && (0, _core.jsx)(_portal.default, {
76
+ }), isOpen && (0, _react2.jsx)(_portal.default, {
77
77
  zIndex: zIndex
78
- }, (0, _core.jsx)(_popperWrapper.default, {
78
+ }, (0, _react2.jsx)(_popperWrapper.default, {
79
79
  content: content,
80
80
  isOpen: isOpen,
81
81
  placement: placement,
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -9,7 +11,7 @@ var _react = require("react");
9
11
 
10
12
  var _bindEventListener = require("bind-event-listener");
11
13
 
12
- function noop() {}
14
+ var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
13
15
 
14
16
  var useCloseManager = function useCloseManager(_ref) {
15
17
  var isOpen = _ref.isOpen,
@@ -19,7 +21,7 @@ var useCloseManager = function useCloseManager(_ref) {
19
21
  capture = _ref.shouldUseCaptureOnOutsideClick;
20
22
  (0, _react.useEffect)(function () {
21
23
  if (!isOpen || !popupRef) {
22
- return noop;
24
+ return _noop.default;
23
25
  }
24
26
 
25
27
  var closePopup = function closePopup(event) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { forwardRef, useMemo, useState } from 'react';
5
- import { css, jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { Popper } from '@atlaskit/popper';
7
7
  import { N0, N50A, N60A } from '@atlaskit/theme/colors';
8
8
  import { borderRadius, layers } from '@atlaskit/theme/constants';
@@ -23,9 +23,10 @@ const popupStyles = css({
23
23
  }
24
24
  });
25
25
  const DefaultPopupComponent = /*#__PURE__*/forwardRef((props, ref) => jsx("div", _extends({
26
- css: popupStyles,
26
+ css: popupStyles
27
+ }, props, {
27
28
  ref: ref
28
- }, props)));
29
+ })));
29
30
 
30
31
  function PopperWrapper({
31
32
  isOpen,
@@ -2,7 +2,7 @@
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { memo, useState } from 'react';
5
- import { jsx } from '@emotion/core';
5
+ import { jsx } from '@emotion/react';
6
6
  import { Manager, Reference } from '@atlaskit/popper';
7
7
  import Portal from '@atlaskit/portal';
8
8
  import { layers } from '@atlaskit/theme/constants';
@@ -1,8 +1,6 @@
1
1
  import { useEffect } from 'react';
2
2
  import { bindAll } from 'bind-event-listener';
3
-
4
- function noop() {}
5
-
3
+ import noop from '@atlaskit/ds-lib/noop';
6
4
  export const useCloseManager = ({
7
5
  isOpen,
8
6
  onClose,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
 
4
4
  /** @jsx jsx */
5
5
  import { forwardRef, useMemo, useState } from 'react';
6
- import { css, jsx } from '@emotion/core';
6
+ import { css, jsx } from '@emotion/react';
7
7
  import { Popper } from '@atlaskit/popper';
8
8
  import { N0, N50A, N60A } from '@atlaskit/theme/colors';
9
9
  import { borderRadius, layers } from '@atlaskit/theme/constants';
@@ -25,9 +25,10 @@ var popupStyles = css({
25
25
  });
26
26
  var DefaultPopupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
27
27
  return jsx("div", _extends({
28
- css: popupStyles,
28
+ css: popupStyles
29
+ }, props, {
29
30
  ref: ref
30
- }, props));
31
+ }));
31
32
  });
32
33
 
33
34
  function PopperWrapper(_ref) {
package/dist/esm/popup.js CHANGED
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
 
5
5
  /** @jsx jsx */
6
6
  import { memo, useState } from 'react';
7
- import { jsx } from '@emotion/core';
7
+ import { jsx } from '@emotion/react';
8
8
  import { Manager, Reference } from '@atlaskit/popper';
9
9
  import Portal from '@atlaskit/portal';
10
10
  import { layers } from '@atlaskit/theme/constants';
@@ -1,8 +1,6 @@
1
1
  import { useEffect } from 'react';
2
2
  import { bindAll } from 'bind-event-listener';
3
-
4
- function noop() {}
5
-
3
+ import noop from '@atlaskit/ds-lib/noop';
6
4
  export var useCloseManager = function useCloseManager(_ref) {
7
5
  var isOpen = _ref.isOpen,
8
6
  onClose = _ref.onClose,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { PopperWrapperProps } from './types';
3
- declare function PopperWrapper({ isOpen, id, offset, testId, content, fallbackPlacements, onClose, boundary, rootBoundary, shouldFlip, placement, popupComponent: PopupContainer, autoFocus, triggerRef, shouldUseCaptureOnOutsideClick, }: PopperWrapperProps): JSX.Element;
3
+ declare function PopperWrapper({ isOpen, id, offset, testId, content, fallbackPlacements, onClose, boundary, rootBoundary, shouldFlip, placement, popupComponent: PopupContainer, autoFocus, triggerRef, shouldUseCaptureOnOutsideClick, }: PopperWrapperProps): jsx.JSX.Element;
4
4
  export default PopperWrapper;
@@ -0,0 +1,4 @@
1
+ import { Popup } from './popup';
2
+ export type { ContentProps, PopupComponentProps, PopupProps, TriggerProps, } from './types';
3
+ export { Popup };
4
+ export default Popup;
@@ -0,0 +1,4 @@
1
+ import { jsx } from '@emotion/react';
2
+ import { PopperWrapperProps } from './types';
3
+ declare function PopperWrapper({ isOpen, id, offset, testId, content, fallbackPlacements, onClose, boundary, rootBoundary, shouldFlip, placement, popupComponent: PopupContainer, autoFocus, triggerRef, shouldUseCaptureOnOutsideClick, }: PopperWrapperProps): jsx.JSX.Element;
4
+ export default PopperWrapper;
@@ -0,0 +1,5 @@
1
+ /** @jsx jsx */
2
+ import { FC } from 'react';
3
+ import { PopupProps } from './types';
4
+ export declare const Popup: FC<PopupProps>;
5
+ export default Popup;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { RepositionOnUpdateProps } from './types';
3
+ export declare const RepositionOnUpdate: FC<RepositionOnUpdateProps>;
@@ -0,0 +1,169 @@
1
+ import React, { ComponentType, CSSProperties, Dispatch, ReactNode, Ref, SetStateAction } from 'react';
2
+ import { Placement, PopperChildrenProps } from '@atlaskit/popper';
3
+ export interface TriggerProps {
4
+ ref: Ref<any>;
5
+ 'aria-controls'?: string;
6
+ 'aria-expanded': boolean;
7
+ 'aria-haspopup': boolean;
8
+ }
9
+ export declare type PopupRef = HTMLDivElement | null;
10
+ export declare type TriggerRef = HTMLElement | HTMLButtonElement | null;
11
+ export interface ContentProps {
12
+ /**
13
+ * Will reposition the popup if any of the content has changed.
14
+ * Useful for when positions change and the popup was not aware.
15
+ */
16
+ update: PopperChildrenProps['update'];
17
+ /**
18
+ * Passed through from the parent popup.
19
+ */
20
+ isOpen: boolean;
21
+ /**
22
+ * Passed through from the parent popup.
23
+ */
24
+ onClose?: BaseProps['onClose'];
25
+ /**
26
+ * Escape hatch to set the initial focus for a specific element when the popup is opened.
27
+ */
28
+ setInitialFocusRef: Dispatch<SetStateAction<HTMLElement | null>>;
29
+ }
30
+ export interface PopupComponentProps {
31
+ /**
32
+ * Children passed passed through by the parent popup.
33
+ */
34
+ children: ReactNode;
35
+ /**
36
+ * Placement passed through by the parent popup.
37
+ */
38
+ 'data-placement': Placement;
39
+ /**
40
+ * Test id passed through by the parent popup.
41
+ */
42
+ 'data-testid'?: string;
43
+ /**
44
+ * Id passed through by the parent popup.
45
+ */
46
+ id?: string;
47
+ /**
48
+ * Ref that should be assigned to the root element.
49
+ */
50
+ ref: Ref<HTMLDivElement>;
51
+ /**
52
+ * Style that should be assigned to the root element.
53
+ */
54
+ style: CSSProperties;
55
+ /**
56
+ * Tab index passed through by the parent popup.
57
+ */
58
+ tabIndex: number | undefined;
59
+ }
60
+ interface BaseProps {
61
+ /**
62
+ * Used to either show or hide the popup.
63
+ * When set to `false` popup will not render anything to the DOM.
64
+ */
65
+ isOpen: boolean;
66
+ /**
67
+ * Render props for content that is displayed inside the popup.
68
+ */
69
+ content: (props: ContentProps) => React.ReactNode;
70
+ /**
71
+ * Id that is assigned to the popup container element.
72
+ */
73
+ id?: string;
74
+ /**
75
+ * Distance the popup should be offset from the reference in the format of [along, away] (units in px).
76
+ * Defaults to [0, 8] - which means the popup will be 8px away from the edge of the reference specified
77
+ * by the `placement` prop.
78
+ */
79
+ offset?: [
80
+ number,
81
+ number
82
+ ];
83
+ /**
84
+ * Placement of where the popup should be displayed relative to the trigger element.
85
+ * Defaults to `"auto"`.
86
+ */
87
+ placement?: Placement;
88
+ /**
89
+ * Defines a list of placements to try.
90
+ * When no space is available on the preferred placement,
91
+ * the modifier will test the ones provided in the list, and use the first useful one.
92
+ */
93
+ fallbackPlacements?: Placement[];
94
+ /**
95
+ * The boundary element that the popup will check for overflow.
96
+ * Defaults to `"clippingParents"` which are parent scroll containers,
97
+ * but can be set to any element.
98
+ */
99
+ boundary?: 'clippingParents' | HTMLElement;
100
+ /**
101
+ * The root boundary that the popup will check for overflow.
102
+ * Defaults to `"viewport"` but can be set to `"document"`.
103
+ */
104
+ rootBoundary?: 'viewport' | 'document';
105
+ /**
106
+ * Allows the Popup to be placed on the opposite side of its trigger if it does not fit in the viewport.
107
+ * Defaults to `true`.
108
+ */
109
+ shouldFlip?: boolean;
110
+ /**
111
+ * A `testId` prop is provided for specified elements,
112
+ * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
113
+ * serving as a hook for automated tests.
114
+ */
115
+ testId?: string;
116
+ /**
117
+ * Handler that is called when the popup wants to close itself.
118
+ * Generally this will be either when clicking away from the popup or pressing the escape key.
119
+ * You'll want to use this to set open state accordingly and then pump it back into the `isOpen` prop.
120
+ */
121
+ onClose?(event: Event | React.MouseEvent | React.KeyboardEvent): void;
122
+ /**
123
+ * The element that is shown when `isOpen` prop is `true`.
124
+ * The result of the `content` prop will be placed as children here.
125
+ * Defaults to an element with an elevation of `e200` with _no padding_.
126
+ */
127
+ popupComponent?: ComponentType<PopupComponentProps>;
128
+ /**
129
+ * Controls whether the popup takes focus when opening.
130
+ * This changes the `popupComponent` component tabIndex to `null`.
131
+ * Defaults to `true`.
132
+ */
133
+ autoFocus?: boolean;
134
+ /**
135
+ * Controls if the event which handles clicks outside the popup is be bound with
136
+ * `capture: true`.
137
+ */
138
+ shouldUseCaptureOnOutsideClick?: boolean;
139
+ }
140
+ export interface PopupProps extends BaseProps {
141
+ /**
142
+ * Render props used to anchor the popup to your content.
143
+ * Make this an interactive element,
144
+ * such as an `@atlaskit/button` component.
145
+ */
146
+ trigger: (props: TriggerProps) => React.ReactNode;
147
+ /**
148
+ * Z-index that the popup should be displayed in.
149
+ * This is passed to the portal component.
150
+ * Defaults to `layers.layer()` from `@atlaskit/theme`.
151
+ */
152
+ zIndex?: number;
153
+ }
154
+ export interface PopperWrapperProps extends BaseProps {
155
+ triggerRef: TriggerRef;
156
+ }
157
+ export declare type CloseManagerHook = Pick<PopupProps, 'isOpen' | 'onClose'> & {
158
+ popupRef: PopupRef;
159
+ triggerRef: TriggerRef;
160
+ shouldUseCaptureOnOutsideClick?: boolean;
161
+ };
162
+ export declare type FocusManagerHook = {
163
+ popupRef: PopupRef;
164
+ initialFocusRef: HTMLElement | null;
165
+ };
166
+ export declare type RepositionOnUpdateProps = {
167
+ update: PopperChildrenProps['update'];
168
+ };
169
+ export {};
@@ -0,0 +1,2 @@
1
+ import { CloseManagerHook } from './types';
2
+ export declare const useCloseManager: ({ isOpen, onClose, popupRef, triggerRef, shouldUseCaptureOnOutsideClick: capture, }: CloseManagerHook) => void;
@@ -0,0 +1,2 @@
1
+ import { FocusManagerHook } from './types';
2
+ export declare const useFocusManager: ({ popupRef, initialFocusRef, }: FocusManagerHook) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "description": "A popup displays brief content in an overlay.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,6 +12,13 @@
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.0 <4.5": {
17
+ "*": [
18
+ "dist/types-ts4.0/*"
19
+ ]
20
+ }
21
+ },
15
22
  "sideEffects": false,
16
23
  "atlaskit:src": "src/index.tsx",
17
24
  "af:exports": {
@@ -30,10 +37,10 @@
30
37
  "@atlaskit/ds-lib": "^2.1.0",
31
38
  "@atlaskit/popper": "^5.0.0",
32
39
  "@atlaskit/portal": "^4.0.0",
33
- "@atlaskit/theme": "^12.1.0",
40
+ "@atlaskit/theme": "^12.2.0",
34
41
  "@atlaskit/tokens": "^0.10.0",
35
42
  "@babel/runtime": "^7.0.0",
36
- "@emotion/core": "^10.0.9",
43
+ "@emotion/react": "^11.7.1",
37
44
  "bind-event-listener": "^2.1.1",
38
45
  "focus-trap": "^2.4.5"
39
46
  },
@@ -44,25 +51,25 @@
44
51
  "devDependencies": {
45
52
  "@atlaskit/button": "^16.3.0",
46
53
  "@atlaskit/docs": "*",
47
- "@atlaskit/icon": "^21.10.0",
54
+ "@atlaskit/icon": "^21.11.0",
48
55
  "@atlaskit/menu": "^1.3.0",
49
- "@atlaskit/radio": "^5.3.0",
50
- "@atlaskit/section-message": "^6.1.0",
51
- "@atlaskit/select": "^15.6.0",
56
+ "@atlaskit/radio": "^5.4.0",
57
+ "@atlaskit/section-message": "^6.3.0",
58
+ "@atlaskit/select": "^15.7.0",
52
59
  "@atlaskit/ssr": "*",
53
- "@atlaskit/textfield": "^5.1.7",
54
- "@atlaskit/toggle": "^12.4.4",
60
+ "@atlaskit/textfield": "^5.3.0",
61
+ "@atlaskit/toggle": "^12.5.0",
55
62
  "@atlaskit/visual-regression": "*",
56
63
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
57
- "@testing-library/dom": "^7.7.3",
58
- "@testing-library/react": "^8.0.1",
64
+ "@testing-library/dom": "^8.17.1",
65
+ "@testing-library/react": "^12.1.5",
59
66
  "ast-types": "^0.13.3",
60
67
  "jest-axe": "^4.0.0",
61
68
  "jscodeshift": "^0.13.0",
62
69
  "raf-stub": "^2.0.1",
63
70
  "react-dom": "^16.8.0",
64
71
  "storybook-addon-performance": "^0.16.0",
65
- "typescript": "4.3.5",
72
+ "typescript": "4.5.5",
66
73
  "wait-for-expect": "^1.2.0"
67
74
  },
68
75
  "keywords": [
package/report.api.md CHANGED
@@ -1,6 +1,8 @@
1
- ## API Report File for "@atlaskit/popup"
1
+ ## API Report File for "@atlaskit/popup".
2
2
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
4
6
 
5
7
  ```ts
6
8
  import { ComponentType } from 'react';
@@ -9,6 +11,7 @@ import { Dispatch } from 'react';
9
11
  import { FC } from 'react';
10
12
  import { Placement } from '@atlaskit/popper';
11
13
  import { PopperChildrenProps } from '@atlaskit/popper';
14
+ import { default as React_2 } from 'react';
12
15
  import { ReactNode } from 'react';
13
16
  import { Ref } from 'react';
14
17
  import { SetStateAction } from 'react';
@@ -22,7 +25,7 @@ declare interface BaseProps {
22
25
  /**
23
26
  * Render props for content that is displayed inside the popup.
24
27
  */
25
- content: (props: ContentProps) => React.ReactNode;
28
+ content: (props: ContentProps) => React_2.ReactNode;
26
29
  /**
27
30
  * Id that is assigned to the popup container element.
28
31
  */
@@ -71,7 +74,7 @@ declare interface BaseProps {
71
74
  * Generally this will be either when clicking away from the popup or pressing the escape key.
72
75
  * You'll want to use this to set open state accordingly and then pump it back into the `isOpen` prop.
73
76
  */
74
- onClose?(): void;
77
+ onClose?(event: Event | React_2.MouseEvent | React_2.KeyboardEvent): void;
75
78
  /**
76
79
  * The element that is shown when `isOpen` prop is `true`.
77
80
  * The result of the `content` prop will be placed as children here.
@@ -104,7 +107,7 @@ export declare interface ContentProps {
104
107
  /**
105
108
  * Passed through from the parent popup.
106
109
  */
107
- onClose: (() => void) | undefined;
110
+ onClose?: BaseProps['onClose'];
108
111
  /**
109
112
  * Escape hatch to set the initial focus for a specific element when the popup is opened.
110
113
  */
@@ -152,7 +155,7 @@ export declare interface PopupProps extends BaseProps {
152
155
  * Make this an interactive element,
153
156
  * such as an `@atlaskit/button` component.
154
157
  */
155
- trigger: (props: TriggerProps) => React.ReactNode;
158
+ trigger: (props: TriggerProps) => React_2.ReactNode;
156
159
  /**
157
160
  * Z-index that the popup should be displayed in.
158
161
  * This is passed to the portal component.
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/types.js",
5
5
  "module:es2019": "../dist/es2019/types.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/types.d.ts"
7
+ "types": "../dist/types/types.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/types.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }