@atlaskit/popup 1.5.1 → 1.5.3

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.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.5.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 1.5.1
4
16
 
5
17
  ### Patch Changes
@@ -54,8 +54,7 @@ function check({
54
54
 
55
55
  describe('Convert boundaries props', () => {
56
56
  check({
57
- it:
58
- 'should turn `boundariesElement="scrollParents"` to `boundary="clippingParents"`',
57
+ it: 'should turn `boundariesElement="scrollParents"` to `boundary="clippingParents"`',
59
58
  original: `
60
59
  import Popup from '@atlaskit/popup';
61
60
 
@@ -95,8 +94,7 @@ describe('Convert boundaries props', () => {
95
94
  });
96
95
 
97
96
  check({
98
- it:
99
- 'should turn `boundariesElement="window"` into `rootBoundary="document"`',
97
+ it: 'should turn `boundariesElement="window"` into `rootBoundary="document"`',
100
98
  original: `
101
99
  import Popup from '@atlaskit/popup';
102
100
 
@@ -136,8 +134,7 @@ describe('Convert boundaries props', () => {
136
134
  });
137
135
 
138
136
  check({
139
- it:
140
- 'should turn `boundariesElement="viewport"` into `rootBoundary="viewport"`',
137
+ it: 'should turn `boundariesElement="viewport"` into `rootBoundary="viewport"`',
141
138
  original: `
142
139
  import Popup from '@atlaskit/popup';
143
140
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "A popup displays brief content in an overlay.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,14 +12,6 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "typesVersions": {
16
- ">=4.0 <4.5": {
17
- "*": [
18
- "dist/types-ts4.0/*",
19
- "dist/types-ts4.0/index.d.ts"
20
- ]
21
- }
22
- },
23
15
  "sideEffects": false,
24
16
  "atlaskit:src": "src/index.tsx",
25
17
  "af:exports": {
@@ -37,10 +29,10 @@
37
29
  },
38
30
  "dependencies": {
39
31
  "@atlaskit/ds-lib": "^2.1.0",
40
- "@atlaskit/popper": "^5.0.0",
32
+ "@atlaskit/popper": "^5.4.0",
41
33
  "@atlaskit/portal": "^4.0.0",
42
34
  "@atlaskit/theme": "^12.2.0",
43
- "@atlaskit/tokens": "^0.10.0",
35
+ "@atlaskit/tokens": "^0.12.0",
44
36
  "@babel/runtime": "^7.0.0",
45
37
  "@emotion/react": "^11.7.1",
46
38
  "bind-event-listener": "^2.1.1",
@@ -51,13 +43,13 @@
51
43
  "react-dom": "^16.8.0"
52
44
  },
53
45
  "devDependencies": {
54
- "@atlaskit/button": "^16.3.0",
46
+ "@atlaskit/button": "^16.5.0",
55
47
  "@atlaskit/docs": "*",
56
48
  "@atlaskit/icon": "^21.11.0",
57
- "@atlaskit/menu": "^1.3.0",
49
+ "@atlaskit/menu": "^1.4.0",
58
50
  "@atlaskit/radio": "^5.4.0",
59
51
  "@atlaskit/section-message": "^6.3.0",
60
- "@atlaskit/select": "^15.7.0",
52
+ "@atlaskit/select": "^16.0.0",
61
53
  "@atlaskit/ssr": "*",
62
54
  "@atlaskit/textfield": "^5.3.0",
63
55
  "@atlaskit/toggle": "^12.5.0",
package/report.api.md CHANGED
@@ -1,8 +1,17 @@
1
- ## API Report File for "@atlaskit/popup".
1
+ <!-- API Report Version: 2.2 -->
2
2
 
3
- > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
3
+ ## API Report File for "@atlaskit/popup"
4
4
 
5
- [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
5
+ > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
6
+ > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
+
8
+ ### Table of contents
9
+
10
+ - [Main Entry Types](#main-entry-types)
11
+
12
+ ### Main Entry Types
13
+
14
+ <!--SECTION START: Main Entry Types-->
6
15
 
7
16
  ```ts
8
17
  import { ComponentType } from 'react';
@@ -16,160 +25,67 @@ import { ReactNode } from 'react';
16
25
  import { Ref } from 'react';
17
26
  import { SetStateAction } from 'react';
18
27
 
19
- declare interface BaseProps {
20
- /**
21
- * Used to either show or hide the popup.
22
- * When set to `false` popup will not render anything to the DOM.
23
- */
24
- isOpen: boolean;
25
- /**
26
- * Render props for content that is displayed inside the popup.
27
- */
28
+ // @public (undocumented)
29
+ interface BaseProps {
30
+ autoFocus?: boolean;
31
+ boundary?: 'clippingParents' | HTMLElement;
28
32
  content: (props: ContentProps) => React_2.ReactNode;
29
- /**
30
- * Id that is assigned to the popup container element.
31
- */
33
+ fallbackPlacements?: Placement[];
32
34
  id?: string;
33
- /**
34
- * Distance the popup should be offset from the reference in the format of [along, away] (units in px).
35
- * Defaults to [0, 8] - which means the popup will be 8px away from the edge of the reference specified
36
- * by the `placement` prop.
37
- */
35
+ isOpen: boolean;
38
36
  offset?: [number, number];
39
- /**
40
- * Placement of where the popup should be displayed relative to the trigger element.
41
- * Defaults to `"auto"`.
42
- */
37
+ onClose?(event: Event | React_2.KeyboardEvent | React_2.MouseEvent): void;
43
38
  placement?: Placement;
44
- /**
45
- * Defines a list of placements to try.
46
- * When no space is available on the preferred placement,
47
- * the modifier will test the ones provided in the list, and use the first useful one.
48
- */
49
- fallbackPlacements?: Placement[];
50
- /**
51
- * The boundary element that the popup will check for overflow.
52
- * Defaults to `"clippingParents"` which are parent scroll containers,
53
- * but can be set to any element.
54
- */
55
- boundary?: 'clippingParents' | HTMLElement;
56
- /**
57
- * The root boundary that the popup will check for overflow.
58
- * Defaults to `"viewport"` but can be set to `"document"`.
59
- */
60
- rootBoundary?: 'viewport' | 'document';
61
- /**
62
- * Allows the Popup to be placed on the opposite side of its trigger if it does not fit in the viewport.
63
- * Defaults to `true`.
64
- */
65
- shouldFlip?: boolean;
66
- /**
67
- * A `testId` prop is provided for specified elements,
68
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
69
- * serving as a hook for automated tests.
70
- */
71
- testId?: string;
72
- /**
73
- * Handler that is called when the popup wants to close itself.
74
- * Generally this will be either when clicking away from the popup or pressing the escape key.
75
- * You'll want to use this to set open state accordingly and then pump it back into the `isOpen` prop.
76
- */
77
- onClose?(event: Event | React_2.MouseEvent | React_2.KeyboardEvent): void;
78
- /**
79
- * The element that is shown when `isOpen` prop is `true`.
80
- * The result of the `content` prop will be placed as children here.
81
- * Defaults to an element with an elevation of `e200` with _no padding_.
82
- */
83
39
  popupComponent?: ComponentType<PopupComponentProps>;
84
- /**
85
- * Controls whether the popup takes focus when opening.
86
- * This changes the `popupComponent` component tabIndex to `null`.
87
- * Defaults to `true`.
88
- */
89
- autoFocus?: boolean;
90
- /**
91
- * Controls if the event which handles clicks outside the popup is be bound with
92
- * `capture: true`.
93
- */
40
+ rootBoundary?: 'document' | 'viewport';
41
+ shouldFlip?: boolean;
94
42
  shouldUseCaptureOnOutsideClick?: boolean;
43
+ testId?: string;
95
44
  }
96
45
 
97
- export declare interface ContentProps {
98
- /**
99
- * Will reposition the popup if any of the content has changed.
100
- * Useful for when positions change and the popup was not aware.
101
- */
102
- update: PopperChildrenProps['update'];
103
- /**
104
- * Passed through from the parent popup.
105
- */
46
+ // @public (undocumented)
47
+ export interface ContentProps {
106
48
  isOpen: boolean;
107
- /**
108
- * Passed through from the parent popup.
109
- */
110
49
  onClose?: BaseProps['onClose'];
111
- /**
112
- * Escape hatch to set the initial focus for a specific element when the popup is opened.
113
- */
114
50
  setInitialFocusRef: Dispatch<SetStateAction<HTMLElement | null>>;
51
+ update: PopperChildrenProps['update'];
115
52
  }
116
53
 
117
- declare const Popup: FC<PopupProps>;
54
+ // @public (undocumented)
55
+ const Popup: FC<PopupProps>;
118
56
  export { Popup };
119
57
  export default Popup;
120
58
 
121
- export declare interface PopupComponentProps {
122
- /**
123
- * Children passed passed through by the parent popup.
124
- */
125
- children: ReactNode;
126
- /**
127
- * Placement passed through by the parent popup.
128
- */
59
+ // @public (undocumented)
60
+ export interface PopupComponentProps {
129
61
  'data-placement': Placement;
130
- /**
131
- * Test id passed through by the parent popup.
132
- */
133
62
  'data-testid'?: string;
134
- /**
135
- * Id passed through by the parent popup.
136
- */
63
+ children: ReactNode;
137
64
  id?: string;
138
- /**
139
- * Ref that should be assigned to the root element.
140
- */
141
65
  ref: Ref<HTMLDivElement>;
142
- /**
143
- * Style that should be assigned to the root element.
144
- */
145
66
  style: CSSProperties;
146
- /**
147
- * Tab index passed through by the parent popup.
148
- */
149
67
  tabIndex: number | undefined;
150
68
  }
151
69
 
152
- export declare interface PopupProps extends BaseProps {
153
- /**
154
- * Render props used to anchor the popup to your content.
155
- * Make this an interactive element,
156
- * such as an `@atlaskit/button` component.
157
- */
70
+ // @public (undocumented)
71
+ export interface PopupProps extends BaseProps {
158
72
  trigger: (props: TriggerProps) => React_2.ReactNode;
159
- /**
160
- * Z-index that the popup should be displayed in.
161
- * This is passed to the portal component.
162
- * Defaults to `layers.layer()` from `@atlaskit/theme`.
163
- */
164
73
  zIndex?: number;
165
74
  }
166
75
 
167
- export declare interface TriggerProps {
168
- ref: Ref<any>;
76
+ // @public (undocumented)
77
+ export interface TriggerProps {
78
+ // (undocumented)
169
79
  'aria-controls'?: string;
80
+ // (undocumented)
170
81
  'aria-expanded': boolean;
82
+ // (undocumented)
171
83
  'aria-haspopup': boolean;
84
+ // (undocumented)
85
+ ref: Ref<any>;
172
86
  }
173
87
 
174
- export {};
88
+ // (No @packageDocumentation comment for this package)
175
89
  ```
90
+
91
+ <!--SECTION END: Main Entry Types-->
@@ -1,4 +0,0 @@
1
- import { Popup } from './popup';
2
- export type { ContentProps, PopupComponentProps, PopupProps, TriggerProps, } from './types';
3
- export { Popup };
4
- export default Popup;
@@ -1,4 +0,0 @@
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;
@@ -1,5 +0,0 @@
1
- /** @jsx jsx */
2
- import { FC } from 'react';
3
- import { PopupProps } from './types';
4
- export declare const Popup: FC<PopupProps>;
5
- export default Popup;
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
- import { RepositionOnUpdateProps } from './types';
3
- export declare const RepositionOnUpdate: FC<RepositionOnUpdateProps>;
@@ -1,169 +0,0 @@
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 {};
@@ -1,2 +0,0 @@
1
- import { CloseManagerHook } from './types';
2
- export declare const useCloseManager: ({ isOpen, onClose, popupRef, triggerRef, shouldUseCaptureOnOutsideClick: capture, }: CloseManagerHook) => void;
@@ -1,2 +0,0 @@
1
- import { FocusManagerHook } from './types';
2
- export declare const useFocusManager: ({ popupRef, initialFocusRef, }: FocusManagerHook) => void;