@patternfly/react-core 4.224.9 → 4.224.12
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 +24 -0
- package/dist/esm/components/ContextSelector/ContextSelector.d.ts +2 -0
- package/dist/esm/components/ContextSelector/ContextSelector.d.ts.map +1 -1
- package/dist/esm/components/ContextSelector/ContextSelector.js +8 -11
- package/dist/esm/components/ContextSelector/ContextSelector.js.map +1 -1
- package/dist/esm/components/ContextSelector/ContextSelectorMenuList.d.ts.map +1 -1
- package/dist/esm/components/ContextSelector/ContextSelectorMenuList.js +2 -1
- package/dist/esm/components/ContextSelector/ContextSelectorMenuList.js.map +1 -1
- package/dist/esm/components/DragDrop/DragDrop.d.ts +1 -1
- package/dist/esm/components/DragDrop/DragDrop.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.js +6 -6
- package/dist/esm/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.js +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorList.d.ts +1 -0
- package/dist/esm/components/DualListSelector/DualListSelectorList.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorList.js +7 -1
- package/dist/esm/components/DualListSelector/DualListSelectorList.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorTree.d.ts +3 -2
- package/dist/esm/components/DualListSelector/DualListSelectorTree.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorTree.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.d.ts +7 -0
- package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +9 -4
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelector.d.ts +2 -0
- package/dist/js/components/ContextSelector/ContextSelector.d.ts.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelector.js +7 -10
- package/dist/js/components/ContextSelector/ContextSelector.js.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelectorMenuList.d.ts.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelectorMenuList.js +2 -1
- package/dist/js/components/ContextSelector/ContextSelectorMenuList.js.map +1 -1
- package/dist/js/components/DragDrop/DragDrop.d.ts +1 -1
- package/dist/js/components/DragDrop/DragDrop.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.js +5 -5
- package/dist/js/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorControlsWrapper.js +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorControlsWrapper.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorList.d.ts +1 -0
- package/dist/js/components/DualListSelector/DualListSelectorList.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorList.js +7 -1
- package/dist/js/components/DualListSelector/DualListSelectorList.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorTree.d.ts +3 -2
- package/dist/js/components/DualListSelector/DualListSelectorTree.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorTree.js.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.d.ts +7 -0
- package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.js +9 -4
- package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/styles/base-no-reset.css +10 -10
- package/dist/styles/base.css +10 -10
- package/dist/umd/react-core.css +39 -209
- package/dist/umd/react-core.js +709 -726
- package/dist/umd/react-core.min.css +141 -311
- package/dist/umd/react-core.min.js +4 -4
- package/package.json +6 -6
- package/src/components/Accordion/examples/AccordionBordered.tsx +21 -21
- package/src/components/Accordion/examples/AccordionDefinitionList.tsx +21 -21
- package/src/components/ActionList/__tests__/ActionList.test.tsx +46 -11
- package/src/components/ActionList/__tests__/ActionListGroup.test.tsx +34 -7
- package/src/components/ActionList/__tests__/ActionListItem.test.tsx +34 -7
- package/src/components/ActionList/__tests__/__snapshots__/ActionList.test.tsx.snap +1 -11
- package/src/components/ActionList/__tests__/__snapshots__/ActionListGroup.test.tsx.snap +1 -1
- package/src/components/ActionList/__tests__/__snapshots__/ActionListItem.test.tsx.snap +1 -1
- package/src/components/ActionList/examples/ActionListMultipleGroups.tsx +4 -4
- package/src/components/ActionList/examples/ActionListSingleGroup.tsx +4 -4
- package/src/components/ActionList/examples/ActionListWithCancelButton.tsx +5 -5
- package/src/components/ActionList/examples/ActionListWithIcons.tsx +2 -2
- package/src/components/Card/examples/CardSelectableA11yHighlight.tsx +4 -4
- package/src/components/CodeBlock/examples/CodeBlockBasic.tsx +1 -1
- package/src/components/CodeBlock/examples/CodeBlockExpandable.tsx +1 -1
- package/src/components/ContextSelector/ContextSelector.tsx +11 -10
- package/src/components/ContextSelector/ContextSelectorMenuList.tsx +2 -1
- package/src/components/ContextSelector/__tests__/ContextSelector.test.tsx +2 -2
- package/src/components/ContextSelector/__tests__/__snapshots__/ContextSelector.test.tsx.snap +11 -7
- package/src/components/ContextSelector/__tests__/__snapshots__/ContextSelectorMenuList.test.tsx.snap +10 -0
- package/src/components/DataList/examples/DataListCompact.tsx +4 -4
- package/src/components/DataList/examples/DataListControllingText.tsx +3 -3
- package/src/components/DataList/examples/DataListDraggable.tsx +14 -7
- package/src/components/DataList/examples/DataListExpandable.tsx +3 -3
- package/src/components/DataList/examples/DataListSmGridBreakpoint.tsx +3 -3
- package/src/components/DragDrop/DragDrop.tsx +1 -1
- package/src/components/DualListSelector/DualListSelector.tsx +93 -89
- package/src/components/DualListSelector/DualListSelectorControlsWrapper.tsx +1 -1
- package/src/components/DualListSelector/DualListSelectorList.tsx +10 -4
- package/src/components/DualListSelector/DualListSelectorTree.tsx +3 -2
- package/src/components/DualListSelector/__tests__/__snapshots__/DualListSelector.test.tsx.snap +6 -20
- package/src/components/DualListSelector/examples/DualListSelector.md +3 -1
- package/src/components/DualListSelector/examples/DualListSelectorComposable.tsx +1 -1
- package/src/components/DualListSelector/examples/DualListSelectorComposableDragDrop.tsx +1 -1
- package/src/components/DualListSelector/examples/DualListSelectorComposableTree.tsx +1 -1
- package/src/components/DualListSelector/examples/{DualListSelectorTree.tsx → DualListSelectorTreeExample.tsx} +1 -1
- package/src/components/FileUpload/examples/FileUploadCustomUpload.tsx +1 -1
- package/src/components/FileUpload/examples/FileUploadSimpleText.tsx +1 -1
- package/src/components/FileUpload/examples/FileUploadTextWithEdits.tsx +1 -1
- package/src/components/FileUpload/examples/FileUploadTextWithRestrictions.tsx +2 -2
- package/src/components/InputGroup/examples/InputGroupBasic.tsx +3 -3
- package/src/components/InputGroup/examples/InputGroupWithDropdown.tsx +1 -1
- package/src/components/InputGroup/examples/InputGroupWithPopover.tsx +12 -2
- package/src/components/InputGroup/examples/InputGroupWithSiblings.tsx +7 -2
- package/src/components/InputGroup/examples/InputGroupWithTextarea.tsx +1 -1
- package/src/components/LoginPage/examples/LoginPage.md +2 -325
- package/src/components/LoginPage/examples/LoginPageBasic.tsx +144 -0
- package/src/components/LoginPage/examples/LoginPageShowHidePassword.tsx +145 -0
- package/src/components/NotificationDrawer/examples/NotificationDrawer.md +69 -68
- package/src/components/SearchInput/SearchInput.tsx +32 -5
- package/src/components/SearchInput/__tests__/SearchInput.test.tsx +37 -0
- package/src/components/SearchInput/__tests__/__snapshots__/SearchInput.test.tsx.snap +193 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.224.
|
|
3
|
+
"version": "4.224.12",
|
|
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",
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.75.
|
|
38
|
-
"@patternfly/react-styles": "^4.74.
|
|
39
|
-
"@patternfly/react-tokens": "^4.76.
|
|
37
|
+
"@patternfly/react-icons": "^4.75.12",
|
|
38
|
+
"@patternfly/react-styles": "^4.74.12",
|
|
39
|
+
"@patternfly/react-tokens": "^4.76.12",
|
|
40
40
|
"focus-trap": "6.9.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
43
43
|
"tslib": "^2.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@patternfly/patternfly": "4.
|
|
46
|
+
"@patternfly/patternfly": "4.203.1",
|
|
47
47
|
"@rollup/plugin-commonjs": "^21.0.0",
|
|
48
48
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
49
49
|
"@rollup/plugin-replace": "^3.0.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "c2616a25c297f5810239191a6414b9d4218bd7e0"
|
|
64
64
|
}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import ArrowRightIcon from '@patternfly/react-icons/dist/esm/icons/arrow-right-icon';
|
|
12
12
|
|
|
13
13
|
export const AccordionBordered: React.FunctionComponent = () => {
|
|
14
|
-
const [expanded, setExpanded] = React.useState('
|
|
14
|
+
const [expanded, setExpanded] = React.useState('bordered-toggle4');
|
|
15
15
|
const [isDisplayLarge, setIsDisplayLarge] = React.useState(false);
|
|
16
16
|
|
|
17
17
|
const displaySize = isDisplayLarge ? 'large' : 'default';
|
|
@@ -29,14 +29,14 @@ export const AccordionBordered: React.FunctionComponent = () => {
|
|
|
29
29
|
<AccordionItem>
|
|
30
30
|
<AccordionToggle
|
|
31
31
|
onClick={() => {
|
|
32
|
-
onToggle('
|
|
32
|
+
onToggle('bordered-toggle1');
|
|
33
33
|
}}
|
|
34
|
-
isExpanded={expanded === '
|
|
35
|
-
id="
|
|
34
|
+
isExpanded={expanded === 'bordered-toggle1'}
|
|
35
|
+
id="bordered-toggle1"
|
|
36
36
|
>
|
|
37
37
|
Item one
|
|
38
38
|
</AccordionToggle>
|
|
39
|
-
<AccordionContent id="
|
|
39
|
+
<AccordionContent id="bordered-expand1" isHidden={expanded !== 'bordered-toggle1'}>
|
|
40
40
|
<p>
|
|
41
41
|
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
|
|
42
42
|
dolore magna aliqua.
|
|
@@ -47,14 +47,14 @@ export const AccordionBordered: React.FunctionComponent = () => {
|
|
|
47
47
|
<AccordionItem>
|
|
48
48
|
<AccordionToggle
|
|
49
49
|
onClick={() => {
|
|
50
|
-
onToggle('
|
|
50
|
+
onToggle('bordered-toggle2');
|
|
51
51
|
}}
|
|
52
|
-
isExpanded={expanded === '
|
|
53
|
-
id="
|
|
52
|
+
isExpanded={expanded === 'bordered-toggle2'}
|
|
53
|
+
id="bordered-toggle2"
|
|
54
54
|
>
|
|
55
55
|
Item two
|
|
56
56
|
</AccordionToggle>
|
|
57
|
-
<AccordionContent id="
|
|
57
|
+
<AccordionContent id="bordered-expand2" isHidden={expanded !== 'bordered-toggle2'}>
|
|
58
58
|
<p>
|
|
59
59
|
Vivamus et tortor sed arcu congue vehicula eget et diam. Praesent nec dictum lorem. Aliquam id diam
|
|
60
60
|
ultrices, faucibus erat id, maximus nunc.
|
|
@@ -65,14 +65,14 @@ export const AccordionBordered: React.FunctionComponent = () => {
|
|
|
65
65
|
<AccordionItem>
|
|
66
66
|
<AccordionToggle
|
|
67
67
|
onClick={() => {
|
|
68
|
-
onToggle('
|
|
68
|
+
onToggle('bordered-toggle3');
|
|
69
69
|
}}
|
|
70
|
-
isExpanded={expanded === '
|
|
71
|
-
id="
|
|
70
|
+
isExpanded={expanded === 'bordered-toggle3'}
|
|
71
|
+
id="bordered-toggle3"
|
|
72
72
|
>
|
|
73
73
|
Item three
|
|
74
74
|
</AccordionToggle>
|
|
75
|
-
<AccordionContent id="
|
|
75
|
+
<AccordionContent id="bordered-expand3" isHidden={expanded !== 'bordered-toggle3'}>
|
|
76
76
|
<p>Morbi vitae urna quis nunc convallis hendrerit. Aliquam congue orci quis ultricies tempus.</p>
|
|
77
77
|
</AccordionContent>
|
|
78
78
|
</AccordionItem>
|
|
@@ -80,14 +80,14 @@ export const AccordionBordered: React.FunctionComponent = () => {
|
|
|
80
80
|
<AccordionItem>
|
|
81
81
|
<AccordionToggle
|
|
82
82
|
onClick={() => {
|
|
83
|
-
onToggle('
|
|
83
|
+
onToggle('bordered-toggle4');
|
|
84
84
|
}}
|
|
85
|
-
isExpanded={expanded === '
|
|
86
|
-
id="
|
|
85
|
+
isExpanded={expanded === 'bordered-toggle4'}
|
|
86
|
+
id="bordered-toggle4"
|
|
87
87
|
>
|
|
88
88
|
Item four
|
|
89
89
|
</AccordionToggle>
|
|
90
|
-
<AccordionContent id="
|
|
90
|
+
<AccordionContent id="bordered-expand4" isHidden={expanded !== 'bordered-toggle4'} isCustomContent>
|
|
91
91
|
<AccordionExpandedContentBody>
|
|
92
92
|
Donec vel posuere orci. Phasellus quis tortor a ex hendrerit efficitur. Aliquam lacinia ligula pharetra,
|
|
93
93
|
sagittis ex ut, pellentesque diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices
|
|
@@ -107,14 +107,14 @@ export const AccordionBordered: React.FunctionComponent = () => {
|
|
|
107
107
|
<AccordionItem>
|
|
108
108
|
<AccordionToggle
|
|
109
109
|
onClick={() => {
|
|
110
|
-
onToggle('
|
|
110
|
+
onToggle('bordered-toggle5');
|
|
111
111
|
}}
|
|
112
|
-
isExpanded={expanded === '
|
|
113
|
-
id="
|
|
112
|
+
isExpanded={expanded === 'bordered-toggle5'}
|
|
113
|
+
id="bordered-toggle5"
|
|
114
114
|
>
|
|
115
115
|
Item five
|
|
116
116
|
</AccordionToggle>
|
|
117
|
-
<AccordionContent id="
|
|
117
|
+
<AccordionContent id="bordered-expand5" isHidden={expanded !== 'bordered-toggle5'}>
|
|
118
118
|
<p>Vivamus finibus dictum ex id ultrices. Mauris dictum neque a iaculis blandit.</p>
|
|
119
119
|
</AccordionContent>
|
|
120
120
|
</AccordionItem>
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Accordion, AccordionItem, AccordionContent, AccordionToggle } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
4
|
export const AccordionDefinitionList: React.FunctionComponent = () => {
|
|
5
|
-
const [expanded, setExpanded] = React.useState('
|
|
5
|
+
const [expanded, setExpanded] = React.useState('def-list-toggle2');
|
|
6
6
|
|
|
7
7
|
const onToggle = (id: string) => {
|
|
8
8
|
if (id === expanded) {
|
|
@@ -17,14 +17,14 @@ export const AccordionDefinitionList: React.FunctionComponent = () => {
|
|
|
17
17
|
<AccordionItem>
|
|
18
18
|
<AccordionToggle
|
|
19
19
|
onClick={() => {
|
|
20
|
-
onToggle('
|
|
20
|
+
onToggle('def-list-toggle1');
|
|
21
21
|
}}
|
|
22
|
-
isExpanded={expanded === '
|
|
23
|
-
id="
|
|
22
|
+
isExpanded={expanded === 'def-list-toggle1'}
|
|
23
|
+
id="def-list-toggle1"
|
|
24
24
|
>
|
|
25
25
|
Item one
|
|
26
26
|
</AccordionToggle>
|
|
27
|
-
<AccordionContent id="
|
|
27
|
+
<AccordionContent id="def-list-expand1" isHidden={expanded !== 'def-list-toggle1'}>
|
|
28
28
|
<p>
|
|
29
29
|
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
|
|
30
30
|
dolore magna aliqua.
|
|
@@ -35,14 +35,14 @@ export const AccordionDefinitionList: React.FunctionComponent = () => {
|
|
|
35
35
|
<AccordionItem>
|
|
36
36
|
<AccordionToggle
|
|
37
37
|
onClick={() => {
|
|
38
|
-
onToggle('
|
|
38
|
+
onToggle('def-list-toggle2');
|
|
39
39
|
}}
|
|
40
|
-
isExpanded={expanded === '
|
|
41
|
-
id="
|
|
40
|
+
isExpanded={expanded === 'def-list-toggle2'}
|
|
41
|
+
id="def-list-toggle2"
|
|
42
42
|
>
|
|
43
43
|
Item two
|
|
44
44
|
</AccordionToggle>
|
|
45
|
-
<AccordionContent id="
|
|
45
|
+
<AccordionContent id="def-list-expand2" isHidden={expanded !== 'def-list-toggle2'}>
|
|
46
46
|
<p>
|
|
47
47
|
Vivamus et tortor sed arcu congue vehicula eget et diam. Praesent nec dictum lorem. Aliquam id diam
|
|
48
48
|
ultrices, faucibus erat id, maximus nunc.
|
|
@@ -53,14 +53,14 @@ export const AccordionDefinitionList: React.FunctionComponent = () => {
|
|
|
53
53
|
<AccordionItem>
|
|
54
54
|
<AccordionToggle
|
|
55
55
|
onClick={() => {
|
|
56
|
-
onToggle('
|
|
56
|
+
onToggle('def-list-toggle3');
|
|
57
57
|
}}
|
|
58
|
-
isExpanded={expanded === '
|
|
59
|
-
id="
|
|
58
|
+
isExpanded={expanded === 'def-list-toggle3'}
|
|
59
|
+
id="def-list-toggle3"
|
|
60
60
|
>
|
|
61
61
|
Item three
|
|
62
62
|
</AccordionToggle>
|
|
63
|
-
<AccordionContent id="
|
|
63
|
+
<AccordionContent id="def-list-expand3" isHidden={expanded !== 'def-list-toggle3'}>
|
|
64
64
|
<p>Morbi vitae urna quis nunc convallis hendrerit. Aliquam congue orci quis ultricies tempus.</p>
|
|
65
65
|
</AccordionContent>
|
|
66
66
|
</AccordionItem>
|
|
@@ -68,14 +68,14 @@ export const AccordionDefinitionList: React.FunctionComponent = () => {
|
|
|
68
68
|
<AccordionItem>
|
|
69
69
|
<AccordionToggle
|
|
70
70
|
onClick={() => {
|
|
71
|
-
onToggle('
|
|
71
|
+
onToggle('def-list-toggle4');
|
|
72
72
|
}}
|
|
73
|
-
isExpanded={expanded === '
|
|
74
|
-
id="
|
|
73
|
+
isExpanded={expanded === 'def-list-toggle4'}
|
|
74
|
+
id="def-list-toggle4"
|
|
75
75
|
>
|
|
76
76
|
Item four
|
|
77
77
|
</AccordionToggle>
|
|
78
|
-
<AccordionContent id="
|
|
78
|
+
<AccordionContent id="def-list-expand4" isHidden={expanded !== 'def-list-toggle4'}>
|
|
79
79
|
<p>
|
|
80
80
|
Donec vel posuere orci. Phasellus quis tortor a ex hendrerit efficitur. Aliquam lacinia ligula pharetra,
|
|
81
81
|
sagittis ex ut, pellentesque diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere
|
|
@@ -91,14 +91,14 @@ export const AccordionDefinitionList: React.FunctionComponent = () => {
|
|
|
91
91
|
<AccordionItem>
|
|
92
92
|
<AccordionToggle
|
|
93
93
|
onClick={() => {
|
|
94
|
-
onToggle('
|
|
94
|
+
onToggle('def-list-toggle5');
|
|
95
95
|
}}
|
|
96
|
-
isExpanded={expanded === '
|
|
97
|
-
id="
|
|
96
|
+
isExpanded={expanded === 'def-list-toggle5'}
|
|
97
|
+
id="def-list-toggle5"
|
|
98
98
|
>
|
|
99
99
|
Item five
|
|
100
100
|
</AccordionToggle>
|
|
101
|
-
<AccordionContent id="
|
|
101
|
+
<AccordionContent id="def-list-expand5" isHidden={expanded !== 'def-list-toggle5'}>
|
|
102
102
|
<p>Vivamus finibus dictum ex id ultrices. Mauris dictum neque a iaculis blandit.</p>
|
|
103
103
|
</AccordionContent>
|
|
104
104
|
</AccordionItem>
|
|
@@ -1,14 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import { ActionList } from '../ActionList';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
test('Renders without children', () => {
|
|
6
|
+
render(<ActionList data-testid="action-list" />);
|
|
7
|
+
expect(screen.getByTestId('action-list')).toBeVisible();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('Renders children', () => {
|
|
11
|
+
render(<ActionList>Test</ActionList>);
|
|
12
|
+
|
|
13
|
+
expect(screen.getByText('Test')).toBeVisible();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('Renders with class pf-c-action-list', () => {
|
|
17
|
+
render(<ActionList>Test</ActionList>);
|
|
18
|
+
|
|
19
|
+
expect(screen.getByText('Test')).toHaveClass('pf-c-action-list');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('Renders with custom class names provided via prop', () => {
|
|
23
|
+
render(<ActionList className="custom-class">Test</ActionList>);
|
|
24
|
+
|
|
25
|
+
expect(screen.getByText('Test')).toHaveClass('custom-class');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('Does not render with class pf-m-icons by default', () => {
|
|
29
|
+
render(<ActionList>Test</ActionList>);
|
|
30
|
+
|
|
31
|
+
expect(screen.getByText('Test')).not.toHaveClass('pf-m-icons');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('Renders with class pf-m-icons when isIconList is true', () => {
|
|
35
|
+
render(<ActionList isIconList={true}>Test</ActionList>);
|
|
36
|
+
|
|
37
|
+
expect(screen.getByText('Test')).toHaveClass('pf-m-icons');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('Renders with inherited element props spread to the component', () => {
|
|
41
|
+
render(<ActionList aria-label="Test label">Test</ActionList>);
|
|
42
|
+
|
|
43
|
+
expect(screen.getByText('Test')).toHaveAccessibleName('Test label');
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
test('Matches the snapshot', () => {
|
|
47
|
+
const { asFragment } = render(<ActionList>test</ActionList>);
|
|
48
|
+
expect(asFragment()).toMatchSnapshot();
|
|
14
49
|
});
|
|
@@ -1,10 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import { ActionListGroup } from '../ActionListGroup';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
test('Renders without children', () => {
|
|
6
|
+
render(<ActionListGroup data-testid="action-list-group" />);
|
|
7
|
+
expect(screen.getByTestId('action-list-group')).toBeVisible();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('Renders children', () => {
|
|
11
|
+
render(<ActionListGroup>Test</ActionListGroup>);
|
|
12
|
+
|
|
13
|
+
expect(screen.getByText('Test')).toBeVisible();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('Renders with class pf-c-action-list__group', () => {
|
|
17
|
+
render(<ActionListGroup>Test</ActionListGroup>);
|
|
18
|
+
|
|
19
|
+
expect(screen.getByText('Test')).toHaveClass('pf-c-action-list__group');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('Renders with custom class names provided via prop', () => {
|
|
23
|
+
render(<ActionListGroup className="custom-class">Test</ActionListGroup>);
|
|
24
|
+
|
|
25
|
+
expect(screen.getByText('Test')).toHaveClass('custom-class');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('Renders with inherited element props spread to the component', () => {
|
|
29
|
+
render(<ActionListGroup aria-label="Test label">Test</ActionListGroup>);
|
|
30
|
+
|
|
31
|
+
expect(screen.getByText('Test')).toHaveAccessibleName('Test label');
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
test('Matches the snapshot', () => {
|
|
35
|
+
const { asFragment } = render(<ActionListGroup>test</ActionListGroup>);
|
|
36
|
+
expect(asFragment()).toMatchSnapshot();
|
|
10
37
|
});
|
|
@@ -1,10 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import { ActionListItem } from '../ActionListItem';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
test('Renders without children', () => {
|
|
6
|
+
render(<ActionListItem data-testid="action-list-item" />);
|
|
7
|
+
expect(screen.getByTestId('action-list-item')).toBeVisible();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('Renders children', () => {
|
|
11
|
+
render(<ActionListItem>Test</ActionListItem>);
|
|
12
|
+
|
|
13
|
+
expect(screen.getByText('Test')).toBeVisible();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('Renders with class pf-c-action-list__item', () => {
|
|
17
|
+
render(<ActionListItem>Test</ActionListItem>);
|
|
18
|
+
|
|
19
|
+
expect(screen.getByText('Test')).toHaveClass('pf-c-action-list__item');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('Renders with custom class names provided via prop', () => {
|
|
23
|
+
render(<ActionListItem className="custom-class">Test</ActionListItem>);
|
|
24
|
+
|
|
25
|
+
expect(screen.getByText('Test')).toHaveClass('custom-class');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('Renders with inherited element props spread to the component', () => {
|
|
29
|
+
render(<ActionListItem aria-label="Test label">Test</ActionListItem>);
|
|
30
|
+
|
|
31
|
+
expect(screen.getByText('Test')).toHaveAccessibleName('Test label');
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
test('Matches the snapshot', () => {
|
|
35
|
+
const { asFragment } = render(<ActionListItem>test</ActionListItem>);
|
|
36
|
+
expect(asFragment()).toMatchSnapshot();
|
|
10
37
|
});
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
4
|
-
<DocumentFragment>
|
|
5
|
-
<div
|
|
6
|
-
class="pf-c-action-list pf-m-icons"
|
|
7
|
-
>
|
|
8
|
-
test
|
|
9
|
-
</div>
|
|
10
|
-
</DocumentFragment>
|
|
11
|
-
`;
|
|
12
|
-
|
|
13
|
-
exports[`action list renders successfully 1`] = `
|
|
3
|
+
exports[`Matches the snapshot 1`] = `
|
|
14
4
|
<DocumentFragment>
|
|
15
5
|
<div
|
|
16
6
|
class="pf-c-action-list"
|
|
@@ -5,24 +5,24 @@ export const ActionListMultipleGroups: React.FunctionComponent = () => (
|
|
|
5
5
|
<ActionList>
|
|
6
6
|
<ActionListGroup>
|
|
7
7
|
<ActionListItem>
|
|
8
|
-
<Button variant="primary" id="next-button">
|
|
8
|
+
<Button variant="primary" id="multi-group-next-button">
|
|
9
9
|
Next
|
|
10
10
|
</Button>
|
|
11
11
|
</ActionListItem>
|
|
12
12
|
<ActionListItem>
|
|
13
|
-
<Button variant="secondary" id="back-button">
|
|
13
|
+
<Button variant="secondary" id="multi-group-back-button">
|
|
14
14
|
Back
|
|
15
15
|
</Button>
|
|
16
16
|
</ActionListItem>
|
|
17
17
|
</ActionListGroup>
|
|
18
18
|
<ActionListGroup>
|
|
19
19
|
<ActionListItem>
|
|
20
|
-
<Button variant="primary" id="submit-button">
|
|
20
|
+
<Button variant="primary" id="multi-group-submit-button">
|
|
21
21
|
Submit
|
|
22
22
|
</Button>
|
|
23
23
|
</ActionListItem>
|
|
24
24
|
<ActionListItem>
|
|
25
|
-
<Button variant="link" id="cancel-button">
|
|
25
|
+
<Button variant="link" id="multi-group-cancel-button">
|
|
26
26
|
Cancel
|
|
27
27
|
</Button>
|
|
28
28
|
</ActionListItem>
|
|
@@ -47,12 +47,12 @@ export const ActionListSingleGroup: React.FunctionComponent = () => {
|
|
|
47
47
|
<React.Fragment>
|
|
48
48
|
<ActionList>
|
|
49
49
|
<ActionListItem>
|
|
50
|
-
<Button variant="primary" id="next-button">
|
|
50
|
+
<Button variant="primary" id="single-group-next-button">
|
|
51
51
|
Next
|
|
52
52
|
</Button>
|
|
53
53
|
</ActionListItem>
|
|
54
54
|
<ActionListItem>
|
|
55
|
-
<Button variant="secondary" id="back-button">
|
|
55
|
+
<Button variant="secondary" id="single-group-back-button">
|
|
56
56
|
Back
|
|
57
57
|
</Button>
|
|
58
58
|
</ActionListItem>
|
|
@@ -61,12 +61,12 @@ export const ActionListSingleGroup: React.FunctionComponent = () => {
|
|
|
61
61
|
With kebab
|
|
62
62
|
<ActionList>
|
|
63
63
|
<ActionListItem>
|
|
64
|
-
<Button variant="primary" id="next-button2">
|
|
64
|
+
<Button variant="primary" id="single-group-next-button2">
|
|
65
65
|
Next
|
|
66
66
|
</Button>
|
|
67
67
|
</ActionListItem>
|
|
68
68
|
<ActionListItem>
|
|
69
|
-
<Button variant="secondary" id="back-button2">
|
|
69
|
+
<Button variant="secondary" id="single-group-back-button2">
|
|
70
70
|
Back
|
|
71
71
|
</Button>
|
|
72
72
|
</ActionListItem>
|
|
@@ -6,12 +6,12 @@ export const ActionListWithCancelButton: React.FunctionComponent = () => (
|
|
|
6
6
|
In modals, forms, data lists
|
|
7
7
|
<ActionList>
|
|
8
8
|
<ActionListItem>
|
|
9
|
-
<Button variant="primary" id="save-button">
|
|
9
|
+
<Button variant="primary" id="with-cancel-save-button">
|
|
10
10
|
Save
|
|
11
11
|
</Button>
|
|
12
12
|
</ActionListItem>
|
|
13
13
|
<ActionListItem>
|
|
14
|
-
<Button variant="link" id="cancel-button">
|
|
14
|
+
<Button variant="link" id="with-cancel-cancel-button">
|
|
15
15
|
Cancel
|
|
16
16
|
</Button>
|
|
17
17
|
</ActionListItem>
|
|
@@ -21,19 +21,19 @@ export const ActionListWithCancelButton: React.FunctionComponent = () => (
|
|
|
21
21
|
<ActionList>
|
|
22
22
|
<ActionListGroup>
|
|
23
23
|
<ActionListItem>
|
|
24
|
-
<Button variant="primary" id="next-button">
|
|
24
|
+
<Button variant="primary" id="with-cancel-next-button">
|
|
25
25
|
Next
|
|
26
26
|
</Button>
|
|
27
27
|
</ActionListItem>
|
|
28
28
|
<ActionListItem>
|
|
29
|
-
<Button variant="secondary" id="back-button">
|
|
29
|
+
<Button variant="secondary" id="with-cancel-back-button">
|
|
30
30
|
Back
|
|
31
31
|
</Button>
|
|
32
32
|
</ActionListItem>
|
|
33
33
|
</ActionListGroup>
|
|
34
34
|
<ActionListGroup>
|
|
35
35
|
<ActionListItem>
|
|
36
|
-
<Button variant="link" id="cancel-button2">
|
|
36
|
+
<Button variant="link" id="with-cancel-cancel-button2">
|
|
37
37
|
Cancel
|
|
38
38
|
</Button>
|
|
39
39
|
</ActionListItem>
|
|
@@ -6,12 +6,12 @@ import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
|
6
6
|
export const ActionListWithIcons: React.FunctionComponent = () => (
|
|
7
7
|
<ActionList isIconList>
|
|
8
8
|
<ActionListItem>
|
|
9
|
-
<Button variant="plain" id="times-button" aria-label="times icon button">
|
|
9
|
+
<Button variant="plain" id="with-icons-times-button" aria-label="times icon button">
|
|
10
10
|
<TimesIcon />
|
|
11
11
|
</Button>
|
|
12
12
|
</ActionListItem>
|
|
13
13
|
<ActionListItem>
|
|
14
|
-
<Button variant="plain" id="check-button" aria-label="check icon button">
|
|
14
|
+
<Button variant="plain" id="with-icons-check-button" aria-label="check icon button">
|
|
15
15
|
<CheckIcon />
|
|
16
16
|
</Button>
|
|
17
17
|
</ActionListItem>
|
|
@@ -28,13 +28,13 @@ export const CardSelectableA11yHighlight: React.FunctionComponent = () => {
|
|
|
28
28
|
return (
|
|
29
29
|
<React.Fragment>
|
|
30
30
|
<Card
|
|
31
|
-
id="selectable-first-card"
|
|
31
|
+
id="a11y-selectable-first-card"
|
|
32
32
|
onKeyDown={onKeyDown}
|
|
33
33
|
onClick={onClick}
|
|
34
34
|
hasSelectableInput
|
|
35
35
|
onSelectableInputChange={onChange}
|
|
36
36
|
isSelectableRaised
|
|
37
|
-
isSelected={selected === 'selectable-first-card'}
|
|
37
|
+
isSelected={selected === 'a11y-selectable-first-card'}
|
|
38
38
|
>
|
|
39
39
|
<CardTitle>Selectable card with proper accessibility considerations</CardTitle>
|
|
40
40
|
<CardBody>
|
|
@@ -44,11 +44,11 @@ export const CardSelectableA11yHighlight: React.FunctionComponent = () => {
|
|
|
44
44
|
</Card>
|
|
45
45
|
<br />
|
|
46
46
|
<Card
|
|
47
|
-
id="selectable-second-card"
|
|
47
|
+
id="a11y-selectable-second-card"
|
|
48
48
|
onKeyDown={onKeyDown}
|
|
49
49
|
onClick={onClick}
|
|
50
50
|
isSelectableRaised
|
|
51
|
-
isSelected={selected === 'selectable-second-card'}
|
|
51
|
+
isSelected={selected === 'a11y-selectable-second-card'}
|
|
52
52
|
>
|
|
53
53
|
<CardTitle>Selectable card without proper accessibility considerations</CardTitle>
|
|
54
54
|
<CardBody>
|
|
@@ -32,7 +32,7 @@ url: https://raw.githubusercontent.com/Azure-Samples/helm-charts/master/docs`;
|
|
|
32
32
|
<React.Fragment>
|
|
33
33
|
<CodeBlockAction>
|
|
34
34
|
<ClipboardCopyButton
|
|
35
|
-
id="copy-button"
|
|
35
|
+
id="basic-copy-button"
|
|
36
36
|
textId="code-content"
|
|
37
37
|
aria-label="Copy to clipboard"
|
|
38
38
|
onClick={e => onClick(e, code)}
|
|
@@ -53,7 +53,7 @@ url: https://raw.githubusercontent.com/Azure-Samples/helm-charts/master/docs`;
|
|
|
53
53
|
<React.Fragment>
|
|
54
54
|
<CodeBlockAction>
|
|
55
55
|
<ClipboardCopyButton
|
|
56
|
-
id="copy-button"
|
|
56
|
+
id="expandable-copy-button"
|
|
57
57
|
textId="code-content"
|
|
58
58
|
aria-label="Copy to clipboard"
|
|
59
59
|
onClick={e => onClick(e, copyBlock)}
|