@patternfly/react-core 5.0.0-alpha.36 → 5.0.0-alpha.38
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/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
- package/components/Modal/ModalBoxCloseButton.js +6 -3
- package/components/Modal/ModalBoxCloseButton.js.map +1 -1
- package/components/OverflowMenu/OverflowMenuDropdownItem.d.ts +4 -4
- package/components/OverflowMenu/OverflowMenuDropdownItem.d.ts.map +1 -1
- package/components/OverflowMenu/OverflowMenuDropdownItem.js +3 -3
- package/components/OverflowMenu/OverflowMenuDropdownItem.js.map +1 -1
- package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxCloseButton.js +6 -3
- package/dist/esm/components/Modal/ModalBoxCloseButton.js.map +1 -1
- package/dist/esm/components/OverflowMenu/OverflowMenuDropdownItem.d.ts +4 -4
- package/dist/esm/components/OverflowMenu/OverflowMenuDropdownItem.d.ts.map +1 -1
- package/dist/esm/components/OverflowMenu/OverflowMenuDropdownItem.js +3 -3
- package/dist/esm/components/OverflowMenu/OverflowMenuDropdownItem.js.map +1 -1
- package/dist/js/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxCloseButton.js +6 -3
- package/dist/js/components/Modal/ModalBoxCloseButton.js.map +1 -1
- package/dist/js/components/OverflowMenu/OverflowMenuDropdownItem.d.ts +4 -4
- package/dist/js/components/OverflowMenu/OverflowMenuDropdownItem.d.ts.map +1 -1
- package/dist/js/components/OverflowMenu/OverflowMenuDropdownItem.js +3 -3
- package/dist/js/components/OverflowMenu/OverflowMenuDropdownItem.js.map +1 -1
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/Modal/ModalBoxCloseButton.tsx +14 -11
- package/src/components/Modal/__tests__/__snapshots__/ModalContent.test.tsx.snap +200 -168
- package/src/components/OverflowMenu/OverflowMenuDropdownItem.tsx +6 -6
- package/src/components/OverflowMenu/__tests__/Generated/OverflowMenuDropdownItem.test.tsx +1 -4
- package/src/components/OverflowMenu/__tests__/Generated/__snapshots__/OverflowMenuDropdownItem.test.tsx.snap +14 -6
- package/src/components/OverflowMenu/examples/OverflowMenu.md +146 -73
- package/src/components/OverflowMenu/examples/OverflowMenuBreakpointOnContainer.tsx +26 -16
- package/src/components/Toolbar/examples/Toolbar.md +2 -0
- package/src/components/Toolbar/examples/ToolbarStacked.tsx +34 -25
- package/src/demos/Card/Card.md +30 -16
- package/src/demos/Tabs.md +3 -0
- package/src/demos/examples/Tabs/TabsAndTable.tsx +18 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.38",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"subpaths": "node scripts/copySubpaths.js"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@patternfly/react-icons": "^5.0.0-alpha.
|
|
48
|
+
"@patternfly/react-icons": "^5.0.0-alpha.5",
|
|
49
49
|
"@patternfly/react-styles": "^5.0.0-alpha.4",
|
|
50
50
|
"@patternfly/react-tokens": "^5.0.0-alpha.4",
|
|
51
51
|
"focus-trap": "6.9.2",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"typescript": "^4.7.4"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"react": "^
|
|
71
|
-
"react-dom": "^
|
|
70
|
+
"react": "^17 || ^18",
|
|
71
|
+
"react-dom": "^17 || ^18"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "084195b009f7c1a02b1dde8918218ac3b0e0d6fb"
|
|
74
74
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { css } from '@patternfly/react-styles';
|
|
3
|
+
import styles from '@patternfly/react-styles/css/components/ModalBox/modal-box';
|
|
2
4
|
import { Button } from '../Button';
|
|
3
5
|
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
4
6
|
import { OUIAProps } from '../../helpers';
|
|
@@ -13,20 +15,21 @@ export interface ModalBoxCloseButtonProps extends OUIAProps {
|
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export const ModalBoxCloseButton: React.FunctionComponent<ModalBoxCloseButtonProps> = ({
|
|
16
|
-
className
|
|
18
|
+
className,
|
|
17
19
|
onClose = () => undefined as any,
|
|
18
20
|
ouiaId,
|
|
19
21
|
...props
|
|
20
22
|
}: ModalBoxCloseButtonProps) => (
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
<div className={css(styles.modalBoxClose, className)}>
|
|
24
|
+
<Button
|
|
25
|
+
variant="plain"
|
|
26
|
+
onClick={onClose}
|
|
27
|
+
aria-label="Close"
|
|
28
|
+
{...(ouiaId && { ouiaId: `${ouiaId}-${ModalBoxCloseButton.displayName}` })}
|
|
29
|
+
{...props}
|
|
30
|
+
>
|
|
31
|
+
<TimesIcon />
|
|
32
|
+
</Button>
|
|
33
|
+
</div>
|
|
31
34
|
);
|
|
32
35
|
ModalBoxCloseButton.displayName = 'ModalBoxCloseButton';
|
|
@@ -18,29 +18,33 @@ exports[`Modal Content Test description 1`] = `
|
|
|
18
18
|
id="boxId"
|
|
19
19
|
role="dialog"
|
|
20
20
|
>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
aria-label="Close"
|
|
24
|
-
class="pf-c-button pf-m-plain"
|
|
25
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-3"
|
|
26
|
-
data-ouia-component-type="PF4/Button"
|
|
27
|
-
data-ouia-safe="true"
|
|
28
|
-
type="button"
|
|
21
|
+
<div
|
|
22
|
+
class="pf-c-modal-box__close"
|
|
29
23
|
>
|
|
30
|
-
<
|
|
31
|
-
aria-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
<button
|
|
25
|
+
aria-disabled="false"
|
|
26
|
+
aria-label="Close"
|
|
27
|
+
class="pf-c-button pf-m-plain"
|
|
28
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-3"
|
|
29
|
+
data-ouia-component-type="PF4/Button"
|
|
30
|
+
data-ouia-safe="true"
|
|
31
|
+
type="button"
|
|
38
32
|
>
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
<svg
|
|
34
|
+
aria-hidden="true"
|
|
35
|
+
fill="currentColor"
|
|
36
|
+
height="1em"
|
|
37
|
+
role="img"
|
|
38
|
+
style="vertical-align: -0.125em;"
|
|
39
|
+
viewBox="0 0 352 512"
|
|
40
|
+
width="1em"
|
|
41
|
+
>
|
|
42
|
+
<path
|
|
43
|
+
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
|
|
44
|
+
/>
|
|
45
|
+
</svg>
|
|
46
|
+
</button>
|
|
47
|
+
</div>
|
|
44
48
|
<header
|
|
45
49
|
class="pf-c-modal-box__header"
|
|
46
50
|
>
|
|
@@ -90,29 +94,33 @@ exports[`Modal Content Test isOpen 1`] = `
|
|
|
90
94
|
id="boxId"
|
|
91
95
|
role="dialog"
|
|
92
96
|
>
|
|
93
|
-
<
|
|
94
|
-
|
|
95
|
-
aria-label="Close"
|
|
96
|
-
class="pf-c-button pf-m-plain"
|
|
97
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-2"
|
|
98
|
-
data-ouia-component-type="PF4/Button"
|
|
99
|
-
data-ouia-safe="true"
|
|
100
|
-
type="button"
|
|
97
|
+
<div
|
|
98
|
+
class="pf-c-modal-box__close"
|
|
101
99
|
>
|
|
102
|
-
<
|
|
103
|
-
aria-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
<button
|
|
101
|
+
aria-disabled="false"
|
|
102
|
+
aria-label="Close"
|
|
103
|
+
class="pf-c-button pf-m-plain"
|
|
104
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-2"
|
|
105
|
+
data-ouia-component-type="PF4/Button"
|
|
106
|
+
data-ouia-safe="true"
|
|
107
|
+
type="button"
|
|
110
108
|
>
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
<svg
|
|
110
|
+
aria-hidden="true"
|
|
111
|
+
fill="currentColor"
|
|
112
|
+
height="1em"
|
|
113
|
+
role="img"
|
|
114
|
+
style="vertical-align: -0.125em;"
|
|
115
|
+
viewBox="0 0 352 512"
|
|
116
|
+
width="1em"
|
|
117
|
+
>
|
|
118
|
+
<path
|
|
119
|
+
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
|
|
120
|
+
/>
|
|
121
|
+
</svg>
|
|
122
|
+
</button>
|
|
123
|
+
</div>
|
|
116
124
|
<header
|
|
117
125
|
class="pf-c-modal-box__header"
|
|
118
126
|
>
|
|
@@ -157,29 +165,33 @@ exports[`Modal Content Test only body 1`] = `
|
|
|
157
165
|
id="boxId"
|
|
158
166
|
role="dialog"
|
|
159
167
|
>
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
aria-label="Close"
|
|
163
|
-
class="pf-c-button pf-m-plain"
|
|
164
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-1"
|
|
165
|
-
data-ouia-component-type="PF4/Button"
|
|
166
|
-
data-ouia-safe="true"
|
|
167
|
-
type="button"
|
|
168
|
+
<div
|
|
169
|
+
class="pf-c-modal-box__close"
|
|
168
170
|
>
|
|
169
|
-
<
|
|
170
|
-
aria-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
171
|
+
<button
|
|
172
|
+
aria-disabled="false"
|
|
173
|
+
aria-label="Close"
|
|
174
|
+
class="pf-c-button pf-m-plain"
|
|
175
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-1"
|
|
176
|
+
data-ouia-component-type="PF4/Button"
|
|
177
|
+
data-ouia-safe="true"
|
|
178
|
+
type="button"
|
|
177
179
|
>
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
<svg
|
|
181
|
+
aria-hidden="true"
|
|
182
|
+
fill="currentColor"
|
|
183
|
+
height="1em"
|
|
184
|
+
role="img"
|
|
185
|
+
style="vertical-align: -0.125em;"
|
|
186
|
+
viewBox="0 0 352 512"
|
|
187
|
+
width="1em"
|
|
188
|
+
>
|
|
189
|
+
<path
|
|
190
|
+
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
|
|
191
|
+
/>
|
|
192
|
+
</svg>
|
|
193
|
+
</button>
|
|
194
|
+
</div>
|
|
183
195
|
<header
|
|
184
196
|
class="pf-c-modal-box__header"
|
|
185
197
|
>
|
|
@@ -224,29 +236,33 @@ exports[`Modal Content Test with footer 1`] = `
|
|
|
224
236
|
id="boxId"
|
|
225
237
|
role="dialog"
|
|
226
238
|
>
|
|
227
|
-
<
|
|
228
|
-
|
|
229
|
-
aria-label="Close"
|
|
230
|
-
class="pf-c-button pf-m-plain"
|
|
231
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-4"
|
|
232
|
-
data-ouia-component-type="PF4/Button"
|
|
233
|
-
data-ouia-safe="true"
|
|
234
|
-
type="button"
|
|
239
|
+
<div
|
|
240
|
+
class="pf-c-modal-box__close"
|
|
235
241
|
>
|
|
236
|
-
<
|
|
237
|
-
aria-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
<button
|
|
243
|
+
aria-disabled="false"
|
|
244
|
+
aria-label="Close"
|
|
245
|
+
class="pf-c-button pf-m-plain"
|
|
246
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-4"
|
|
247
|
+
data-ouia-component-type="PF4/Button"
|
|
248
|
+
data-ouia-safe="true"
|
|
249
|
+
type="button"
|
|
244
250
|
>
|
|
245
|
-
<
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
251
|
+
<svg
|
|
252
|
+
aria-hidden="true"
|
|
253
|
+
fill="currentColor"
|
|
254
|
+
height="1em"
|
|
255
|
+
role="img"
|
|
256
|
+
style="vertical-align: -0.125em;"
|
|
257
|
+
viewBox="0 0 352 512"
|
|
258
|
+
width="1em"
|
|
259
|
+
>
|
|
260
|
+
<path
|
|
261
|
+
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
|
|
262
|
+
/>
|
|
263
|
+
</svg>
|
|
264
|
+
</button>
|
|
265
|
+
</div>
|
|
250
266
|
<header
|
|
251
267
|
class="pf-c-modal-box__header"
|
|
252
268
|
>
|
|
@@ -296,29 +312,33 @@ exports[`Modal Content Test with onclose 1`] = `
|
|
|
296
312
|
id="boxId"
|
|
297
313
|
role="dialog"
|
|
298
314
|
>
|
|
299
|
-
<
|
|
300
|
-
|
|
301
|
-
aria-label="Close"
|
|
302
|
-
class="pf-c-button pf-m-plain"
|
|
303
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-6"
|
|
304
|
-
data-ouia-component-type="PF4/Button"
|
|
305
|
-
data-ouia-safe="true"
|
|
306
|
-
type="button"
|
|
315
|
+
<div
|
|
316
|
+
class="pf-c-modal-box__close"
|
|
307
317
|
>
|
|
308
|
-
<
|
|
309
|
-
aria-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
318
|
+
<button
|
|
319
|
+
aria-disabled="false"
|
|
320
|
+
aria-label="Close"
|
|
321
|
+
class="pf-c-button pf-m-plain"
|
|
322
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-6"
|
|
323
|
+
data-ouia-component-type="PF4/Button"
|
|
324
|
+
data-ouia-safe="true"
|
|
325
|
+
type="button"
|
|
316
326
|
>
|
|
317
|
-
<
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
327
|
+
<svg
|
|
328
|
+
aria-hidden="true"
|
|
329
|
+
fill="currentColor"
|
|
330
|
+
height="1em"
|
|
331
|
+
role="img"
|
|
332
|
+
style="vertical-align: -0.125em;"
|
|
333
|
+
viewBox="0 0 352 512"
|
|
334
|
+
width="1em"
|
|
335
|
+
>
|
|
336
|
+
<path
|
|
337
|
+
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
|
|
338
|
+
/>
|
|
339
|
+
</svg>
|
|
340
|
+
</button>
|
|
341
|
+
</div>
|
|
322
342
|
<header
|
|
323
343
|
class="pf-c-modal-box__header"
|
|
324
344
|
>
|
|
@@ -368,29 +388,33 @@ exports[`Modal Content test without footer 1`] = `
|
|
|
368
388
|
id="boxId"
|
|
369
389
|
role="dialog"
|
|
370
390
|
>
|
|
371
|
-
<
|
|
372
|
-
|
|
373
|
-
aria-label="Close"
|
|
374
|
-
class="pf-c-button pf-m-plain"
|
|
375
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-5"
|
|
376
|
-
data-ouia-component-type="PF4/Button"
|
|
377
|
-
data-ouia-safe="true"
|
|
378
|
-
type="button"
|
|
391
|
+
<div
|
|
392
|
+
class="pf-c-modal-box__close"
|
|
379
393
|
>
|
|
380
|
-
<
|
|
381
|
-
aria-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
394
|
+
<button
|
|
395
|
+
aria-disabled="false"
|
|
396
|
+
aria-label="Close"
|
|
397
|
+
class="pf-c-button pf-m-plain"
|
|
398
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-5"
|
|
399
|
+
data-ouia-component-type="PF4/Button"
|
|
400
|
+
data-ouia-safe="true"
|
|
401
|
+
type="button"
|
|
388
402
|
>
|
|
389
|
-
<
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
403
|
+
<svg
|
|
404
|
+
aria-hidden="true"
|
|
405
|
+
fill="currentColor"
|
|
406
|
+
height="1em"
|
|
407
|
+
role="img"
|
|
408
|
+
style="vertical-align: -0.125em;"
|
|
409
|
+
viewBox="0 0 352 512"
|
|
410
|
+
width="1em"
|
|
411
|
+
>
|
|
412
|
+
<path
|
|
413
|
+
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
|
|
414
|
+
/>
|
|
415
|
+
</svg>
|
|
416
|
+
</button>
|
|
417
|
+
</div>
|
|
394
418
|
<header
|
|
395
419
|
class="pf-c-modal-box__header"
|
|
396
420
|
>
|
|
@@ -435,29 +459,33 @@ exports[`Modal Test with custom footer 1`] = `
|
|
|
435
459
|
id="boxId"
|
|
436
460
|
role="dialog"
|
|
437
461
|
>
|
|
438
|
-
<
|
|
439
|
-
|
|
440
|
-
aria-label="Close"
|
|
441
|
-
class="pf-c-button pf-m-plain"
|
|
442
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-8"
|
|
443
|
-
data-ouia-component-type="PF4/Button"
|
|
444
|
-
data-ouia-safe="true"
|
|
445
|
-
type="button"
|
|
462
|
+
<div
|
|
463
|
+
class="pf-c-modal-box__close"
|
|
446
464
|
>
|
|
447
|
-
<
|
|
448
|
-
aria-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
465
|
+
<button
|
|
466
|
+
aria-disabled="false"
|
|
467
|
+
aria-label="Close"
|
|
468
|
+
class="pf-c-button pf-m-plain"
|
|
469
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-8"
|
|
470
|
+
data-ouia-component-type="PF4/Button"
|
|
471
|
+
data-ouia-safe="true"
|
|
472
|
+
type="button"
|
|
455
473
|
>
|
|
456
|
-
<
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
474
|
+
<svg
|
|
475
|
+
aria-hidden="true"
|
|
476
|
+
fill="currentColor"
|
|
477
|
+
height="1em"
|
|
478
|
+
role="img"
|
|
479
|
+
style="vertical-align: -0.125em;"
|
|
480
|
+
viewBox="0 0 352 512"
|
|
481
|
+
width="1em"
|
|
482
|
+
>
|
|
483
|
+
<path
|
|
484
|
+
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
|
|
485
|
+
/>
|
|
486
|
+
</svg>
|
|
487
|
+
</button>
|
|
488
|
+
</div>
|
|
461
489
|
<header
|
|
462
490
|
class="pf-c-modal-box__header"
|
|
463
491
|
>
|
|
@@ -511,29 +539,33 @@ exports[`Modal Test with custom header 1`] = `
|
|
|
511
539
|
id="boxId"
|
|
512
540
|
role="dialog"
|
|
513
541
|
>
|
|
514
|
-
<
|
|
515
|
-
|
|
516
|
-
aria-label="Close"
|
|
517
|
-
class="pf-c-button pf-m-plain"
|
|
518
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-7"
|
|
519
|
-
data-ouia-component-type="PF4/Button"
|
|
520
|
-
data-ouia-safe="true"
|
|
521
|
-
type="button"
|
|
542
|
+
<div
|
|
543
|
+
class="pf-c-modal-box__close"
|
|
522
544
|
>
|
|
523
|
-
<
|
|
524
|
-
aria-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
545
|
+
<button
|
|
546
|
+
aria-disabled="false"
|
|
547
|
+
aria-label="Close"
|
|
548
|
+
class="pf-c-button pf-m-plain"
|
|
549
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-7"
|
|
550
|
+
data-ouia-component-type="PF4/Button"
|
|
551
|
+
data-ouia-safe="true"
|
|
552
|
+
type="button"
|
|
531
553
|
>
|
|
532
|
-
<
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
554
|
+
<svg
|
|
555
|
+
aria-hidden="true"
|
|
556
|
+
fill="currentColor"
|
|
557
|
+
height="1em"
|
|
558
|
+
role="img"
|
|
559
|
+
style="vertical-align: -0.125em;"
|
|
560
|
+
viewBox="0 0 352 512"
|
|
561
|
+
width="1em"
|
|
562
|
+
>
|
|
563
|
+
<path
|
|
564
|
+
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
|
|
565
|
+
/>
|
|
566
|
+
</svg>
|
|
567
|
+
</button>
|
|
568
|
+
</div>
|
|
537
569
|
<header
|
|
538
570
|
class="pf-c-modal-box__header"
|
|
539
571
|
>
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DropdownItem, DropdownItemProps } from '
|
|
2
|
+
import { DropdownItem, DropdownItemProps } from '../../next/components/Dropdown';
|
|
3
3
|
import { OverflowMenuContext } from './OverflowMenuContext';
|
|
4
4
|
|
|
5
|
-
export interface OverflowMenuDropdownItemProps extends DropdownItemProps {
|
|
5
|
+
export interface OverflowMenuDropdownItemProps extends Omit<DropdownItemProps, 'ref'> {
|
|
6
6
|
/** Indicates when a dropdown item shows and hides the corresponding list item */
|
|
7
7
|
isShared?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/** Identifies the component in the dropdown onSelect callback */
|
|
9
|
+
itemId?: string | number;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export const OverflowMenuDropdownItem: React.FunctionComponent<OverflowMenuDropdownItemProps> = ({
|
|
13
13
|
children,
|
|
14
14
|
isShared = false,
|
|
15
|
-
|
|
15
|
+
itemId,
|
|
16
16
|
...additionalProps
|
|
17
17
|
}: OverflowMenuDropdownItemProps) => (
|
|
18
18
|
<OverflowMenuContext.Consumer>
|
|
19
19
|
{value =>
|
|
20
20
|
(!isShared || value.isBelowBreakpoint) && (
|
|
21
|
-
<DropdownItem component="button"
|
|
21
|
+
<DropdownItem component="button" itemId={itemId} {...additionalProps}>
|
|
22
22
|
{children}
|
|
23
23
|
</DropdownItem>
|
|
24
24
|
)
|
|
@@ -3,14 +3,11 @@ import React from 'react';
|
|
|
3
3
|
import { render } from '@testing-library/react';
|
|
4
4
|
|
|
5
5
|
import { OverflowMenuDropdownItem } from '../../OverflowMenuDropdownItem';
|
|
6
|
-
import { DropdownArrowContext } from '../../../Dropdown';
|
|
7
6
|
|
|
8
7
|
describe('OverflowMenuDropdownItem', () => {
|
|
9
8
|
it('should match snapshot', () => {
|
|
10
9
|
const { asFragment } = render(
|
|
11
|
-
|
|
12
|
-
<OverflowMenuDropdownItem children={'any'} isShared={false} />
|
|
13
|
-
</DropdownArrowContext.Provider>
|
|
10
|
+
<OverflowMenuDropdownItem itemId="id" children={'any'} isShared={false} />
|
|
14
11
|
);
|
|
15
12
|
expect(asFragment()).toMatchSnapshot();
|
|
16
13
|
});
|
|
@@ -3,19 +3,27 @@
|
|
|
3
3
|
exports[`OverflowMenuDropdownItem should match snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<li
|
|
6
|
+
class="pf-c-menu__list-item"
|
|
7
|
+
data-ouia-component-id="OUIA-Generated-DropdownItem-1"
|
|
8
|
+
data-ouia-component-type="PF4/DropdownItem"
|
|
9
|
+
data-ouia-safe="true"
|
|
6
10
|
role="none"
|
|
7
11
|
>
|
|
8
12
|
<button
|
|
9
|
-
|
|
10
|
-
class=""
|
|
11
|
-
data-ouia-component-id="OUIA-Generated-DropdownItem-1"
|
|
12
|
-
data-ouia-component-type="PF4/DropdownItem"
|
|
13
|
-
data-ouia-safe="true"
|
|
13
|
+
class="pf-c-menu__item"
|
|
14
14
|
role="menuitem"
|
|
15
15
|
tabindex="-1"
|
|
16
16
|
type="button"
|
|
17
17
|
>
|
|
18
|
-
|
|
18
|
+
<span
|
|
19
|
+
class="pf-c-menu__item-main"
|
|
20
|
+
>
|
|
21
|
+
<span
|
|
22
|
+
class="pf-c-menu__item-text"
|
|
23
|
+
>
|
|
24
|
+
any
|
|
25
|
+
</span>
|
|
26
|
+
</span>
|
|
19
27
|
</button>
|
|
20
28
|
</li>
|
|
21
29
|
</DocumentFragment>
|