@atlaskit/modal-dialog 12.6.8 → 12.6.10
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/components/scroll-container.js +2 -0
- package/dist/cjs/modal-title.js +3 -3
- package/dist/cjs/modal-wrapper.js +1 -1
- package/dist/es2019/internal/components/scroll-container.js +2 -0
- package/dist/es2019/modal-title.js +3 -3
- package/dist/es2019/modal-wrapper.js +1 -1
- package/dist/esm/internal/components/scroll-container.js +2 -0
- package/dist/esm/modal-title.js +3 -3
- package/dist/esm/modal-wrapper.js +1 -1
- package/package.json +5 -4
- package/tmp/api-report-tmp.d.ts +113 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/modal-dialog
|
|
2
2
|
|
|
3
|
+
## 12.6.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`6900f89eb0e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6900f89eb0e) - Internal changes to use space tokens. There is no expected visual or behaviour change.
|
|
8
|
+
|
|
9
|
+
## 12.6.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`c8d28bd7519`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c8d28bd7519) - Adds role of region to modal dialog body when scrollable
|
|
14
|
+
|
|
3
15
|
## 12.6.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -109,8 +109,10 @@ var ScrollContainer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
109
109
|
return (0, _react2.jsx)(_focusRing.default, {
|
|
110
110
|
isInset: true
|
|
111
111
|
}, (0, _react2.jsx)("div", {
|
|
112
|
+
// tabindex is allowed here so that keyboard users can scroll content
|
|
112
113
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
113
114
|
tabIndex: showContentFocus ? 0 : undefined,
|
|
115
|
+
role: showContentFocus ? 'region' : undefined,
|
|
114
116
|
"aria-label": showContentFocus ? 'Scrollable content' : undefined,
|
|
115
117
|
"data-testid": testId && "".concat(testId, "--scrollable"),
|
|
116
118
|
ref: (0, _mergeRefs.default)([ref, scrollableRef]),
|
package/dist/cjs/modal-title.js
CHANGED
|
@@ -57,9 +57,9 @@ var truncatedTextStyles = (0, _react.css)({
|
|
|
57
57
|
overflowX: 'clip'
|
|
58
58
|
},
|
|
59
59
|
'@supports not (overflow-x: clip)': {
|
|
60
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
60
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview
|
|
61
61
|
marginTop: "".concat(lineHeightOffset / 2, "px"),
|
|
62
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
62
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview
|
|
63
63
|
marginBottom: "".concat(lineHeightOffset / 2, "px"),
|
|
64
64
|
lineHeight: adjustedLineHeight,
|
|
65
65
|
overflow: 'hidden'
|
|
@@ -67,7 +67,7 @@ var truncatedTextStyles = (0, _react.css)({
|
|
|
67
67
|
});
|
|
68
68
|
var truncatedTextIconStyles = (0, _react.css)({
|
|
69
69
|
'@supports not (overflow-x: clip)': {
|
|
70
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
70
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview
|
|
71
71
|
marginBottom: "".concat(lineHeightOffset / 2, "px"),
|
|
72
72
|
lineHeight: 1.2
|
|
73
73
|
}
|
|
@@ -84,7 +84,7 @@ var ModalWrapper = function ModalWrapper(props) {
|
|
|
84
84
|
action: 'closed',
|
|
85
85
|
componentName: 'modalDialog',
|
|
86
86
|
packageName: "@atlaskit/modal-dialog",
|
|
87
|
-
packageVersion: "12.6.
|
|
87
|
+
packageVersion: "12.6.10"
|
|
88
88
|
});
|
|
89
89
|
var onBlanketClicked = (0, _react.useCallback)(function (e) {
|
|
90
90
|
if (shouldCloseOnOverlayClick) {
|
|
@@ -88,8 +88,10 @@ const ScrollContainer = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
88
88
|
return jsx(FocusRing, {
|
|
89
89
|
isInset: true
|
|
90
90
|
}, jsx("div", {
|
|
91
|
+
// tabindex is allowed here so that keyboard users can scroll content
|
|
91
92
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
92
93
|
tabIndex: showContentFocus ? 0 : undefined,
|
|
94
|
+
role: showContentFocus ? 'region' : undefined,
|
|
93
95
|
"aria-label": showContentFocus ? 'Scrollable content' : undefined,
|
|
94
96
|
"data-testid": testId && `${testId}--scrollable`,
|
|
95
97
|
ref: mergeRefs([ref, scrollableRef]),
|
|
@@ -50,9 +50,9 @@ const truncatedTextStyles = css({
|
|
|
50
50
|
overflowX: 'clip'
|
|
51
51
|
},
|
|
52
52
|
'@supports not (overflow-x: clip)': {
|
|
53
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
53
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview
|
|
54
54
|
marginTop: `${lineHeightOffset / 2}px`,
|
|
55
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
55
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview
|
|
56
56
|
marginBottom: `${lineHeightOffset / 2}px`,
|
|
57
57
|
lineHeight: adjustedLineHeight,
|
|
58
58
|
overflow: 'hidden'
|
|
@@ -60,7 +60,7 @@ const truncatedTextStyles = css({
|
|
|
60
60
|
});
|
|
61
61
|
const truncatedTextIconStyles = css({
|
|
62
62
|
'@supports not (overflow-x: clip)': {
|
|
63
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
63
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview
|
|
64
64
|
marginBottom: `${lineHeightOffset / 2}px`,
|
|
65
65
|
lineHeight: 1.2
|
|
66
66
|
}
|
|
@@ -70,7 +70,7 @@ const ModalWrapper = props => {
|
|
|
70
70
|
action: 'closed',
|
|
71
71
|
componentName: 'modalDialog',
|
|
72
72
|
packageName: "@atlaskit/modal-dialog",
|
|
73
|
-
packageVersion: "12.6.
|
|
73
|
+
packageVersion: "12.6.10"
|
|
74
74
|
});
|
|
75
75
|
const onBlanketClicked = useCallback(e => {
|
|
76
76
|
if (shouldCloseOnOverlayClick) {
|
|
@@ -99,8 +99,10 @@ var ScrollContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
99
99
|
return jsx(FocusRing, {
|
|
100
100
|
isInset: true
|
|
101
101
|
}, jsx("div", {
|
|
102
|
+
// tabindex is allowed here so that keyboard users can scroll content
|
|
102
103
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
103
104
|
tabIndex: showContentFocus ? 0 : undefined,
|
|
105
|
+
role: showContentFocus ? 'region' : undefined,
|
|
104
106
|
"aria-label": showContentFocus ? 'Scrollable content' : undefined,
|
|
105
107
|
"data-testid": testId && "".concat(testId, "--scrollable"),
|
|
106
108
|
ref: mergeRefs([ref, scrollableRef]),
|
package/dist/esm/modal-title.js
CHANGED
|
@@ -50,9 +50,9 @@ var truncatedTextStyles = css({
|
|
|
50
50
|
overflowX: 'clip'
|
|
51
51
|
},
|
|
52
52
|
'@supports not (overflow-x: clip)': {
|
|
53
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
53
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview
|
|
54
54
|
marginTop: "".concat(lineHeightOffset / 2, "px"),
|
|
55
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
55
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview
|
|
56
56
|
marginBottom: "".concat(lineHeightOffset / 2, "px"),
|
|
57
57
|
lineHeight: adjustedLineHeight,
|
|
58
58
|
overflow: 'hidden'
|
|
@@ -60,7 +60,7 @@ var truncatedTextStyles = css({
|
|
|
60
60
|
});
|
|
61
61
|
var truncatedTextIconStyles = css({
|
|
62
62
|
'@supports not (overflow-x: clip)': {
|
|
63
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
63
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/ensure-design-token-usage/preview
|
|
64
64
|
marginBottom: "".concat(lineHeightOffset / 2, "px"),
|
|
65
65
|
lineHeight: 1.2
|
|
66
66
|
}
|
|
@@ -74,7 +74,7 @@ var ModalWrapper = function ModalWrapper(props) {
|
|
|
74
74
|
action: 'closed',
|
|
75
75
|
componentName: 'modalDialog',
|
|
76
76
|
packageName: "@atlaskit/modal-dialog",
|
|
77
|
-
packageVersion: "12.6.
|
|
77
|
+
packageVersion: "12.6.10"
|
|
78
78
|
});
|
|
79
79
|
var onBlanketClicked = useCallback(function (e) {
|
|
80
80
|
if (shouldCloseOnOverlayClick) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/modal-dialog",
|
|
3
|
-
"version": "12.6.
|
|
3
|
+
"version": "12.6.10",
|
|
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/"
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"@atlaskit/icon": "^21.12.0",
|
|
35
35
|
"@atlaskit/motion": "^1.4.0",
|
|
36
36
|
"@atlaskit/portal": "^4.3.0",
|
|
37
|
-
"@atlaskit/primitives": "^1.
|
|
38
|
-
"@atlaskit/theme": "^12.
|
|
39
|
-
"@atlaskit/tokens": "^1.
|
|
37
|
+
"@atlaskit/primitives": "^1.4.0",
|
|
38
|
+
"@atlaskit/theme": "^12.6.0",
|
|
39
|
+
"@atlaskit/tokens": "^1.21.0",
|
|
40
40
|
"@babel/runtime": "^7.0.0",
|
|
41
41
|
"@emotion/react": "^11.7.1",
|
|
42
42
|
"bind-event-listener": "^2.1.1",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@af/accessibility-testing": "*",
|
|
53
|
+
"@af/integration-testing": "*",
|
|
53
54
|
"@af/visual-regression": "*",
|
|
54
55
|
"@atlaskit/button": "*",
|
|
55
56
|
"@atlaskit/ssr": "*",
|
|
@@ -0,0 +1,113 @@
|
|
|
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
|
+
shouldScrollInViewport?: boolean;
|
|
52
|
+
stackIndex?: number;
|
|
53
|
+
testId?: string;
|
|
54
|
+
width?: WidthNames | number | string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// @public
|
|
58
|
+
export const ModalFooter: (props: ModalFooterProps) => jsx.JSX.Element;
|
|
59
|
+
|
|
60
|
+
// @public (undocumented)
|
|
61
|
+
export interface ModalFooterProps {
|
|
62
|
+
children?: ReactNode;
|
|
63
|
+
testId?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// @public
|
|
67
|
+
export const ModalHeader: (props: ModalHeaderProps) => jsx.JSX.Element;
|
|
68
|
+
|
|
69
|
+
// @public (undocumented)
|
|
70
|
+
export interface ModalHeaderProps {
|
|
71
|
+
children?: React_2.ReactNode;
|
|
72
|
+
testId?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// @public
|
|
76
|
+
export const ModalTitle: (props: ModalTitleProps) => jsx.JSX.Element;
|
|
77
|
+
|
|
78
|
+
// @public (undocumented)
|
|
79
|
+
export interface ModalTitleProps {
|
|
80
|
+
appearance?: Appearance;
|
|
81
|
+
children?: ReactNode;
|
|
82
|
+
isMultiline?: boolean;
|
|
83
|
+
testId?: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// @public
|
|
87
|
+
export const ModalTransition: (props: Pick<ExitingPersistenceProps, 'children'>) => JSX.Element;
|
|
88
|
+
|
|
89
|
+
// @public
|
|
90
|
+
const ModalWrapper: (props: ModalDialogProps) => jsx.JSX.Element;
|
|
91
|
+
export default ModalWrapper;
|
|
92
|
+
|
|
93
|
+
// @public (undocumented)
|
|
94
|
+
export type OnCloseCompleteHandler = (element: HTMLElement) => void;
|
|
95
|
+
|
|
96
|
+
// @public (undocumented)
|
|
97
|
+
export type OnCloseHandler = (e: KeyboardOrMouseEvent, analyticEvent: UIAnalyticsEvent) => void;
|
|
98
|
+
|
|
99
|
+
// @public (undocumented)
|
|
100
|
+
export type OnOpenCompleteHandler = (node: HTMLElement, isAppearing: boolean) => void;
|
|
101
|
+
|
|
102
|
+
// @public (undocumented)
|
|
103
|
+
export type OnStackChangeHandler = (stackIndex: number) => void;
|
|
104
|
+
|
|
105
|
+
// @public (undocumented)
|
|
106
|
+
export const useModal: () => ModalAttributes;
|
|
107
|
+
|
|
108
|
+
// @public (undocumented)
|
|
109
|
+
type WidthNames = 'large' | 'medium' | 'small' | 'x-large';
|
|
110
|
+
|
|
111
|
+
// (No @packageDocumentation comment for this package)
|
|
112
|
+
|
|
113
|
+
```
|