@dhis2-ui/modal 9.12.0 → 9.13.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.
|
@@ -9,7 +9,7 @@ describe('Modal', () => {
|
|
|
9
9
|
describe('Modal Accessibility', () => {
|
|
10
10
|
it('closes when ESC key is pressed', () => {
|
|
11
11
|
const onCloseMock = jest.fn();
|
|
12
|
-
(0, _react.render)(
|
|
12
|
+
(0, _react.render)(/*#__PURE__*/_react2.default.createElement(_modal.Modal, {
|
|
13
13
|
onClose: onCloseMock
|
|
14
14
|
}));
|
|
15
15
|
const modalElement = _react.screen.getByRole('dialog');
|
|
@@ -21,7 +21,7 @@ describe('Modal', () => {
|
|
|
21
21
|
});
|
|
22
22
|
it('does not close when "Enter" is pressed', () => {
|
|
23
23
|
const onCloseMock = jest.fn();
|
|
24
|
-
(0, _react.render)(
|
|
24
|
+
(0, _react.render)(/*#__PURE__*/_react2.default.createElement(_modal.Modal, {
|
|
25
25
|
onClose: onCloseMock
|
|
26
26
|
}));
|
|
27
27
|
const modalElement = _react.screen.getByRole('dialog');
|
|
@@ -33,7 +33,7 @@ describe('Modal', () => {
|
|
|
33
33
|
});
|
|
34
34
|
it('does not close when "SpaceBar" is pressed', () => {
|
|
35
35
|
const onCloseMock = jest.fn();
|
|
36
|
-
(0, _react.render)(
|
|
36
|
+
(0, _react.render)(/*#__PURE__*/_react2.default.createElement(_modal.Modal, {
|
|
37
37
|
onClose: onCloseMock
|
|
38
38
|
}));
|
|
39
39
|
const modalElement = _react.screen.getByRole('dialog');
|
|
@@ -44,7 +44,7 @@ describe('Modal', () => {
|
|
|
44
44
|
expect(onCloseMock).not.toHaveBeenCalled();
|
|
45
45
|
});
|
|
46
46
|
it('has a close button with proper accessibility attributes', async () => {
|
|
47
|
-
(0, _react.render)(
|
|
47
|
+
(0, _react.render)(/*#__PURE__*/_react2.default.createElement(_closeButton.CloseButton, null));
|
|
48
48
|
const closeButton = await _react.screen.findByLabelText(/Close modal dialog/);
|
|
49
49
|
expect(closeButton).toBeInTheDocument();
|
|
50
50
|
expect(closeButton.tagName).toBe('BUTTON');
|
|
@@ -52,7 +52,7 @@ describe('Modal', () => {
|
|
|
52
52
|
});
|
|
53
53
|
describe('Regular dimensions', () => {
|
|
54
54
|
it('has the correct dimension styles in its default state', () => {
|
|
55
|
-
(0, _react.render)(
|
|
55
|
+
(0, _react.render)(/*#__PURE__*/_react2.default.createElement(_modal.Modal, null));
|
|
56
56
|
const modalEl = _react.screen.getByRole('dialog');
|
|
57
57
|
const style = window.getComputedStyle(modalEl);
|
|
58
58
|
expect(style.height).toBe('auto');
|
|
@@ -61,7 +61,7 @@ describe('Modal', () => {
|
|
|
61
61
|
expect(style.width).toBe('600px');
|
|
62
62
|
});
|
|
63
63
|
it('has the correct dimension styles when the "small" prop is provided', () => {
|
|
64
|
-
(0, _react.render)(
|
|
64
|
+
(0, _react.render)(/*#__PURE__*/_react2.default.createElement(_modal.Modal, {
|
|
65
65
|
small: true
|
|
66
66
|
}));
|
|
67
67
|
const modalEl = _react.screen.getByRole('dialog');
|
|
@@ -72,7 +72,7 @@ describe('Modal', () => {
|
|
|
72
72
|
expect(style.width).toBe('400px');
|
|
73
73
|
});
|
|
74
74
|
it('has the correct dimension styles when the "large" prop is provided', () => {
|
|
75
|
-
(0, _react.render)(
|
|
75
|
+
(0, _react.render)(/*#__PURE__*/_react2.default.createElement(_modal.Modal, {
|
|
76
76
|
large: true
|
|
77
77
|
}));
|
|
78
78
|
const modalEl = _react.screen.getByRole('dialog');
|
|
@@ -83,7 +83,7 @@ describe('Modal', () => {
|
|
|
83
83
|
expect(style.width).toBe('800px');
|
|
84
84
|
});
|
|
85
85
|
it('has the correct dimension styles when the "fluid" prop is provided', () => {
|
|
86
|
-
(0, _react.render)(
|
|
86
|
+
(0, _react.render)(/*#__PURE__*/_react2.default.createElement(_modal.Modal, {
|
|
87
87
|
fluid: true
|
|
88
88
|
}));
|
|
89
89
|
const modalEl = _react.screen.getByRole('dialog');
|
|
@@ -6,7 +6,7 @@ describe('Modal', () => {
|
|
|
6
6
|
describe('Modal Accessibility', () => {
|
|
7
7
|
it('closes when ESC key is pressed', () => {
|
|
8
8
|
const onCloseMock = jest.fn();
|
|
9
|
-
render(
|
|
9
|
+
render(/*#__PURE__*/React.createElement(Modal, {
|
|
10
10
|
onClose: onCloseMock
|
|
11
11
|
}));
|
|
12
12
|
const modalElement = screen.getByRole('dialog');
|
|
@@ -18,7 +18,7 @@ describe('Modal', () => {
|
|
|
18
18
|
});
|
|
19
19
|
it('does not close when "Enter" is pressed', () => {
|
|
20
20
|
const onCloseMock = jest.fn();
|
|
21
|
-
render(
|
|
21
|
+
render(/*#__PURE__*/React.createElement(Modal, {
|
|
22
22
|
onClose: onCloseMock
|
|
23
23
|
}));
|
|
24
24
|
const modalElement = screen.getByRole('dialog');
|
|
@@ -30,7 +30,7 @@ describe('Modal', () => {
|
|
|
30
30
|
});
|
|
31
31
|
it('does not close when "SpaceBar" is pressed', () => {
|
|
32
32
|
const onCloseMock = jest.fn();
|
|
33
|
-
render(
|
|
33
|
+
render(/*#__PURE__*/React.createElement(Modal, {
|
|
34
34
|
onClose: onCloseMock
|
|
35
35
|
}));
|
|
36
36
|
const modalElement = screen.getByRole('dialog');
|
|
@@ -41,7 +41,7 @@ describe('Modal', () => {
|
|
|
41
41
|
expect(onCloseMock).not.toHaveBeenCalled();
|
|
42
42
|
});
|
|
43
43
|
it('has a close button with proper accessibility attributes', async () => {
|
|
44
|
-
render(
|
|
44
|
+
render(/*#__PURE__*/React.createElement(CloseButton, null));
|
|
45
45
|
const closeButton = await screen.findByLabelText(/Close modal dialog/);
|
|
46
46
|
expect(closeButton).toBeInTheDocument();
|
|
47
47
|
expect(closeButton.tagName).toBe('BUTTON');
|
|
@@ -49,7 +49,7 @@ describe('Modal', () => {
|
|
|
49
49
|
});
|
|
50
50
|
describe('Regular dimensions', () => {
|
|
51
51
|
it('has the correct dimension styles in its default state', () => {
|
|
52
|
-
render(
|
|
52
|
+
render(/*#__PURE__*/React.createElement(Modal, null));
|
|
53
53
|
const modalEl = screen.getByRole('dialog');
|
|
54
54
|
const style = window.getComputedStyle(modalEl);
|
|
55
55
|
expect(style.height).toBe('auto');
|
|
@@ -58,7 +58,7 @@ describe('Modal', () => {
|
|
|
58
58
|
expect(style.width).toBe('600px');
|
|
59
59
|
});
|
|
60
60
|
it('has the correct dimension styles when the "small" prop is provided', () => {
|
|
61
|
-
render(
|
|
61
|
+
render(/*#__PURE__*/React.createElement(Modal, {
|
|
62
62
|
small: true
|
|
63
63
|
}));
|
|
64
64
|
const modalEl = screen.getByRole('dialog');
|
|
@@ -69,7 +69,7 @@ describe('Modal', () => {
|
|
|
69
69
|
expect(style.width).toBe('400px');
|
|
70
70
|
});
|
|
71
71
|
it('has the correct dimension styles when the "large" prop is provided', () => {
|
|
72
|
-
render(
|
|
72
|
+
render(/*#__PURE__*/React.createElement(Modal, {
|
|
73
73
|
large: true
|
|
74
74
|
}));
|
|
75
75
|
const modalEl = screen.getByRole('dialog');
|
|
@@ -80,7 +80,7 @@ describe('Modal', () => {
|
|
|
80
80
|
expect(style.width).toBe('800px');
|
|
81
81
|
});
|
|
82
82
|
it('has the correct dimension styles when the "fluid" prop is provided', () => {
|
|
83
|
-
render(
|
|
83
|
+
render(/*#__PURE__*/React.createElement(Modal, {
|
|
84
84
|
fluid: true
|
|
85
85
|
}));
|
|
86
86
|
const modalEl = screen.getByRole('dialog');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/modal",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.13.0",
|
|
4
4
|
"description": "UI Modal",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"react": "^16.13",
|
|
31
|
-
"react-dom": "^16.13",
|
|
30
|
+
"react": "^16.13 || ^18",
|
|
31
|
+
"react-dom": "^16.13 || ^18",
|
|
32
32
|
"styled-jsx": "^4"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@dhis2/prop-types": "^3.1.2",
|
|
36
|
-
"@dhis2-ui/card": "9.
|
|
37
|
-
"@dhis2-ui/center": "9.
|
|
38
|
-
"@dhis2-ui/layer": "9.
|
|
39
|
-
"@dhis2-ui/portal": "9.
|
|
40
|
-
"@dhis2/ui-constants": "9.
|
|
41
|
-
"@dhis2/ui-icons": "9.
|
|
36
|
+
"@dhis2-ui/card": "9.13.0",
|
|
37
|
+
"@dhis2-ui/center": "9.13.0",
|
|
38
|
+
"@dhis2-ui/layer": "9.13.0",
|
|
39
|
+
"@dhis2-ui/portal": "9.13.0",
|
|
40
|
+
"@dhis2/ui-constants": "9.13.0",
|
|
41
|
+
"@dhis2/ui-icons": "9.13.0",
|
|
42
42
|
"classnames": "^2.3.1",
|
|
43
43
|
"prop-types": "^15.7.2"
|
|
44
44
|
},
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"types"
|
|
48
48
|
],
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"react": "
|
|
51
|
-
"react-dom": "
|
|
50
|
+
"react": "^18.3.1",
|
|
51
|
+
"react-dom": "^18.3.1",
|
|
52
52
|
"styled-jsx": "^4.0.1"
|
|
53
53
|
},
|
|
54
54
|
"types": "types"
|