@atlaskit/modal-dialog 12.9.1 → 12.10.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 +12 -0
- package/dist/cjs/internal/constants.js +1 -1
- package/dist/cjs/modal-wrapper.js +2 -2
- package/dist/es2019/internal/constants.js +1 -1
- package/dist/es2019/modal-wrapper.js +2 -2
- package/dist/esm/internal/constants.js +1 -1
- package/dist/esm/modal-wrapper.js +2 -2
- package/dist/types/internal/constants.d.ts +1 -1
- package/dist/types/types.d.ts +3 -2
- package/dist/types-ts4.5/internal/constants.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +3 -2
- package/package.json +5 -2
- package/tmp/api-report-tmp.d.ts +0 -114
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/modal-dialog
|
|
2
2
|
|
|
3
|
+
## 12.10.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#58698](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58698) [`222c15fb9a38`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/222c15fb9a38) - Modal gutter is now 64px instead of 60px. This means the modal now displays slightly lower than before and will be slightly more inset when at max width/height.
|
|
8
|
+
|
|
9
|
+
## 12.10.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#57627](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/57627) [`bef9748d9db2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bef9748d9db2) - [ux] We are testing default return focus on modal close behind a feature flag. This change returns focus to the element which triggered the modal to open. If this fix is successful, it will be available in a later release.
|
|
14
|
+
|
|
3
15
|
## 12.9.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -16,7 +16,7 @@ var width = exports.width = {
|
|
|
16
16
|
},
|
|
17
17
|
defaultValue: 'medium'
|
|
18
18
|
};
|
|
19
|
-
var gutter = exports.gutter =
|
|
19
|
+
var gutter = exports.gutter = 64;
|
|
20
20
|
var gridSize = (0, _constants.gridSize)();
|
|
21
21
|
var borderRadius = exports.borderRadius = (0, _constants.borderRadius)();
|
|
22
22
|
var verticalOffset = exports.verticalOffset = gridSize * 2;
|
|
@@ -87,7 +87,7 @@ var ModalWrapper = function ModalWrapper(props) {
|
|
|
87
87
|
action: 'closed',
|
|
88
88
|
componentName: 'modalDialog',
|
|
89
89
|
packageName: "@atlaskit/modal-dialog",
|
|
90
|
-
packageVersion: "12.
|
|
90
|
+
packageVersion: "12.10.1"
|
|
91
91
|
});
|
|
92
92
|
var onBlanketClicked = (0, _react.useCallback)(function (e) {
|
|
93
93
|
if (shouldCloseOnOverlayClick) {
|
|
@@ -134,7 +134,7 @@ var ModalWrapper = function ModalWrapper(props) {
|
|
|
134
134
|
"aria-hidden": !isForeground
|
|
135
135
|
}), (0, _react2.jsx)(_reactFocusLock.default, {
|
|
136
136
|
autoFocus: autoFocusLock,
|
|
137
|
-
disabled: !isForeground,
|
|
137
|
+
disabled: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.multiple-modal-inappropriate-focus_z5u4j') ? undefined : !isForeground,
|
|
138
138
|
returnFocus: returnFocus,
|
|
139
139
|
onDeactivation: onDeactivation,
|
|
140
140
|
whiteList: whiteListElements
|
|
@@ -72,7 +72,7 @@ const ModalWrapper = props => {
|
|
|
72
72
|
action: 'closed',
|
|
73
73
|
componentName: 'modalDialog',
|
|
74
74
|
packageName: "@atlaskit/modal-dialog",
|
|
75
|
-
packageVersion: "12.
|
|
75
|
+
packageVersion: "12.10.1"
|
|
76
76
|
});
|
|
77
77
|
const onBlanketClicked = useCallback(e => {
|
|
78
78
|
if (shouldCloseOnOverlayClick) {
|
|
@@ -118,7 +118,7 @@ const ModalWrapper = props => {
|
|
|
118
118
|
"aria-hidden": !isForeground
|
|
119
119
|
}), jsx(FocusLock, {
|
|
120
120
|
autoFocus: autoFocusLock,
|
|
121
|
-
disabled: !isForeground,
|
|
121
|
+
disabled: getBooleanFF('platform.design-system-team.multiple-modal-inappropriate-focus_z5u4j') ? undefined : !isForeground,
|
|
122
122
|
returnFocus: returnFocus,
|
|
123
123
|
onDeactivation: onDeactivation,
|
|
124
124
|
whiteList: whiteListElements
|
|
@@ -77,7 +77,7 @@ var ModalWrapper = function ModalWrapper(props) {
|
|
|
77
77
|
action: 'closed',
|
|
78
78
|
componentName: 'modalDialog',
|
|
79
79
|
packageName: "@atlaskit/modal-dialog",
|
|
80
|
-
packageVersion: "12.
|
|
80
|
+
packageVersion: "12.10.1"
|
|
81
81
|
});
|
|
82
82
|
var onBlanketClicked = useCallback(function (e) {
|
|
83
83
|
if (shouldCloseOnOverlayClick) {
|
|
@@ -124,7 +124,7 @@ var ModalWrapper = function ModalWrapper(props) {
|
|
|
124
124
|
"aria-hidden": !isForeground
|
|
125
125
|
}), jsx(FocusLock, {
|
|
126
126
|
autoFocus: autoFocusLock,
|
|
127
|
-
disabled: !isForeground,
|
|
127
|
+
disabled: getBooleanFF('platform.design-system-team.multiple-modal-inappropriate-focus_z5u4j') ? undefined : !isForeground,
|
|
128
128
|
returnFocus: returnFocus,
|
|
129
129
|
onDeactivation: onDeactivation,
|
|
130
130
|
whiteList: whiteListElements
|
|
@@ -8,7 +8,7 @@ interface Width {
|
|
|
8
8
|
defaultValue: string;
|
|
9
9
|
}
|
|
10
10
|
export declare const width: Width;
|
|
11
|
-
export declare const gutter =
|
|
11
|
+
export declare const gutter = 64;
|
|
12
12
|
export declare const borderRadius: number;
|
|
13
13
|
export declare const verticalOffset: number;
|
|
14
14
|
export declare const padding: number;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -62,9 +62,10 @@ export interface ModalDialogProps {
|
|
|
62
62
|
*/
|
|
63
63
|
shouldCloseOnEscapePress?: boolean;
|
|
64
64
|
/**
|
|
65
|
-
* ReturnFocus
|
|
66
|
-
* focus lock mode. If true, focus
|
|
65
|
+
* ReturnFocus controls what happens when the user exits
|
|
66
|
+
* focus lock mode. If true, focus returns to the element that had focus before focus lock
|
|
67
67
|
* was activated. If false, focus remains where it was when the FocusLock was deactivated.
|
|
68
|
+
* If ref is passed, focus returns to that specific ref element.
|
|
68
69
|
*/
|
|
69
70
|
shouldReturnFocus?: boolean | RefObject<HTMLElement>;
|
|
70
71
|
/**
|
|
@@ -8,7 +8,7 @@ interface Width {
|
|
|
8
8
|
defaultValue: string;
|
|
9
9
|
}
|
|
10
10
|
export declare const width: Width;
|
|
11
|
-
export declare const gutter =
|
|
11
|
+
export declare const gutter = 64;
|
|
12
12
|
export declare const borderRadius: number;
|
|
13
13
|
export declare const verticalOffset: number;
|
|
14
14
|
export declare const padding: number;
|
|
@@ -62,9 +62,10 @@ export interface ModalDialogProps {
|
|
|
62
62
|
*/
|
|
63
63
|
shouldCloseOnEscapePress?: boolean;
|
|
64
64
|
/**
|
|
65
|
-
* ReturnFocus
|
|
66
|
-
* focus lock mode. If true, focus
|
|
65
|
+
* ReturnFocus controls what happens when the user exits
|
|
66
|
+
* focus lock mode. If true, focus returns to the element that had focus before focus lock
|
|
67
67
|
* was activated. If false, focus remains where it was when the FocusLock was deactivated.
|
|
68
|
+
* If ref is passed, focus returns to that specific ref element.
|
|
68
69
|
*/
|
|
69
70
|
shouldReturnFocus?: boolean | RefObject<HTMLElement>;
|
|
70
71
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/modal-dialog",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.10.1",
|
|
4
4
|
"description": "A modal dialog displays content that requires user interaction, in a layer above the page.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@atlaskit/motion": "^1.5.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
41
41
|
"@atlaskit/portal": "^4.4.0",
|
|
42
|
-
"@atlaskit/primitives": "^1.
|
|
42
|
+
"@atlaskit/primitives": "^1.13.0",
|
|
43
43
|
"@atlaskit/theme": "^12.6.0",
|
|
44
44
|
"@atlaskit/tokens": "^1.29.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
@@ -131,6 +131,9 @@
|
|
|
131
131
|
"platform.design-system-team.popup-select-close_8h15h": {
|
|
132
132
|
"type": "boolean",
|
|
133
133
|
"referenceOnly": "true"
|
|
134
|
+
},
|
|
135
|
+
"platform.design-system-team.multiple-modal-inappropriate-focus_z5u4j": {
|
|
136
|
+
"type": "boolean"
|
|
134
137
|
}
|
|
135
138
|
},
|
|
136
139
|
"homepage": "https://atlassian.design/components/modal-dialog/",
|
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/modal-dialog"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
/// <reference types="react" />
|
|
8
|
-
|
|
9
|
-
import { ExitingPersistenceProps } from '@atlaskit/motion/exiting-persistence';
|
|
10
|
-
import { jsx } from '@emotion/react';
|
|
11
|
-
import { default as React_2 } from 'react';
|
|
12
|
-
import { ReactNode } from 'react';
|
|
13
|
-
import { RefObject } from 'react';
|
|
14
|
-
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
15
|
-
|
|
16
|
-
// @public (undocumented)
|
|
17
|
-
export type Appearance = 'danger' | 'warning';
|
|
18
|
-
|
|
19
|
-
// @public (undocumented)
|
|
20
|
-
export type KeyboardOrMouseEvent = KeyboardEvent | React_2.KeyboardEvent<any> | React_2.MouseEvent<any>;
|
|
21
|
-
|
|
22
|
-
// @public (undocumented)
|
|
23
|
-
export type ModalAttributes = {
|
|
24
|
-
testId?: ModalDialogProps['testId'];
|
|
25
|
-
titleId: string;
|
|
26
|
-
onClose?: OnCloseHandler;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// @public
|
|
30
|
-
export const ModalBody: (props: ModalBodyProps) => jsx.JSX.Element;
|
|
31
|
-
|
|
32
|
-
// @public (undocumented)
|
|
33
|
-
export interface ModalBodyProps {
|
|
34
|
-
children: React_2.ReactNode;
|
|
35
|
-
testId?: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// @public (undocumented)
|
|
39
|
-
export interface ModalDialogProps {
|
|
40
|
-
autoFocus?: RefObject<HTMLElement | null | undefined> | boolean;
|
|
41
|
-
children?: React_2.ReactNode;
|
|
42
|
-
height?: number | string;
|
|
43
|
-
isBlanketHidden?: boolean;
|
|
44
|
-
label?: string;
|
|
45
|
-
onClose?: OnCloseHandler;
|
|
46
|
-
onCloseComplete?: OnCloseCompleteHandler;
|
|
47
|
-
onOpenComplete?: OnOpenCompleteHandler;
|
|
48
|
-
onStackChange?: OnStackChangeHandler;
|
|
49
|
-
shouldCloseOnEscapePress?: boolean;
|
|
50
|
-
shouldCloseOnOverlayClick?: boolean;
|
|
51
|
-
shouldReturnFocus?: RefObject<HTMLElement> | boolean;
|
|
52
|
-
shouldScrollInViewport?: boolean;
|
|
53
|
-
stackIndex?: number;
|
|
54
|
-
testId?: string;
|
|
55
|
-
width?: WidthNames | number | string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// @public
|
|
59
|
-
export const ModalFooter: (props: ModalFooterProps) => jsx.JSX.Element;
|
|
60
|
-
|
|
61
|
-
// @public (undocumented)
|
|
62
|
-
export interface ModalFooterProps {
|
|
63
|
-
children?: ReactNode;
|
|
64
|
-
testId?: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// @public
|
|
68
|
-
export const ModalHeader: (props: ModalHeaderProps) => jsx.JSX.Element;
|
|
69
|
-
|
|
70
|
-
// @public (undocumented)
|
|
71
|
-
export interface ModalHeaderProps {
|
|
72
|
-
children?: React_2.ReactNode;
|
|
73
|
-
testId?: string;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// @public
|
|
77
|
-
export const ModalTitle: (props: ModalTitleProps) => jsx.JSX.Element;
|
|
78
|
-
|
|
79
|
-
// @public (undocumented)
|
|
80
|
-
export interface ModalTitleProps {
|
|
81
|
-
appearance?: Appearance;
|
|
82
|
-
children?: ReactNode;
|
|
83
|
-
isMultiline?: boolean;
|
|
84
|
-
testId?: string;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// @public
|
|
88
|
-
export const ModalTransition: (props: Pick<ExitingPersistenceProps, 'children'>) => JSX.Element;
|
|
89
|
-
|
|
90
|
-
// @public
|
|
91
|
-
const ModalWrapper: (props: ModalDialogProps) => jsx.JSX.Element;
|
|
92
|
-
export default ModalWrapper;
|
|
93
|
-
|
|
94
|
-
// @public (undocumented)
|
|
95
|
-
export type OnCloseCompleteHandler = (element: HTMLElement) => void;
|
|
96
|
-
|
|
97
|
-
// @public (undocumented)
|
|
98
|
-
export type OnCloseHandler = (e: KeyboardOrMouseEvent, analyticEvent: UIAnalyticsEvent) => void;
|
|
99
|
-
|
|
100
|
-
// @public (undocumented)
|
|
101
|
-
export type OnOpenCompleteHandler = (node: HTMLElement, isAppearing: boolean) => void;
|
|
102
|
-
|
|
103
|
-
// @public (undocumented)
|
|
104
|
-
export type OnStackChangeHandler = (stackIndex: number) => void;
|
|
105
|
-
|
|
106
|
-
// @public (undocumented)
|
|
107
|
-
export const useModal: () => ModalAttributes;
|
|
108
|
-
|
|
109
|
-
// @public (undocumented)
|
|
110
|
-
type WidthNames = 'large' | 'medium' | 'small' | 'x-large';
|
|
111
|
-
|
|
112
|
-
// (No @packageDocumentation comment for this package)
|
|
113
|
-
|
|
114
|
-
```
|