@patternfly/react-core 4.224.9 → 4.224.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 +8 -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/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/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/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/styles/base-no-reset.css +10 -10
- package/dist/styles/base.css +10 -10
- package/dist/umd/react-core.css +424 -392
- package/dist/umd/react-core.js +29 -24
- package/dist/umd/react-core.min.css +244 -212
- 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/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/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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.224.
|
|
3
|
+
"version": "4.224.10",
|
|
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.10",
|
|
38
|
+
"@patternfly/react-styles": "^4.74.10",
|
|
39
|
+
"@patternfly/react-tokens": "^4.76.10",
|
|
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": "5242f54a3eeae9d5ca2958620454a8d67b7926e8"
|
|
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>
|
|
@@ -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)}
|
|
@@ -9,15 +9,11 @@ import { Button, ButtonVariant } from '../Button';
|
|
|
9
9
|
import { TextInput } from '../TextInput';
|
|
10
10
|
import { InputGroup } from '../InputGroup';
|
|
11
11
|
import { KEY_CODES } from '../../helpers/constants';
|
|
12
|
-
import { FocusTrap } from '../../helpers';
|
|
12
|
+
import { FocusTrap, getUniqueId } from '../../helpers';
|
|
13
13
|
import { ToggleMenuBaseProps } from '../../helpers/Popper/Popper';
|
|
14
14
|
import { Popper } from '../../helpers/Popper/Popper';
|
|
15
15
|
import { getOUIAProps, OUIAProps, getDefaultOUIAId } from '../../helpers';
|
|
16
16
|
|
|
17
|
-
// seed for the aria-labelledby ID
|
|
18
|
-
let currentId = 0;
|
|
19
|
-
const newId = currentId++;
|
|
20
|
-
|
|
21
17
|
export interface ContextSelectorProps extends Omit<ToggleMenuBaseProps, 'menuAppendTo'>, OUIAProps {
|
|
22
18
|
/** content rendered inside the Context Selector */
|
|
23
19
|
children?: React.ReactNode;
|
|
@@ -66,6 +62,8 @@ export interface ContextSelectorProps extends Omit<ToggleMenuBaseProps, 'menuApp
|
|
|
66
62
|
* appended inline, e.g. `menuAppendTo="parent"`
|
|
67
63
|
*/
|
|
68
64
|
isFlipEnabled?: boolean;
|
|
65
|
+
/** Id of the context selector */
|
|
66
|
+
id?: string;
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
export class ContextSelector extends React.Component<ContextSelectorProps, { ouiaStateId: string }> {
|
|
@@ -108,9 +106,6 @@ export class ContextSelector extends React.Component<ContextSelectorProps, { oui
|
|
|
108
106
|
};
|
|
109
107
|
|
|
110
108
|
render() {
|
|
111
|
-
const toggleId = `pf-context-selector-toggle-id-${newId}`;
|
|
112
|
-
const screenReaderLabelId = `pf-context-selector-label-id-${newId}`;
|
|
113
|
-
const searchButtonId = `pf-context-selector-search-button-id-${newId}`;
|
|
114
109
|
const {
|
|
115
110
|
children,
|
|
116
111
|
className,
|
|
@@ -133,14 +128,21 @@ export class ContextSelector extends React.Component<ContextSelectorProps, { oui
|
|
|
133
128
|
footer,
|
|
134
129
|
disableFocusTrap,
|
|
135
130
|
isFlipEnabled,
|
|
131
|
+
id,
|
|
136
132
|
...props
|
|
137
133
|
} = this.props;
|
|
134
|
+
|
|
135
|
+
const uniqueId = id || getUniqueId();
|
|
136
|
+
const toggleId = `pf-context-selector-toggle-id-${uniqueId}`;
|
|
137
|
+
const screenReaderLabelId = `pf-context-selector-label-id-${uniqueId}`;
|
|
138
|
+
|
|
138
139
|
const menuContainer = (
|
|
139
140
|
<div
|
|
140
141
|
className={css(styles.contextSelectorMenu)}
|
|
141
142
|
// This removes the `position: absolute`styling from the `.pf-c-context-selector__menu`
|
|
142
143
|
// allowing the menu to flip correctly
|
|
143
144
|
{...(isFlipEnabled && { style: { position: 'revert' } })}
|
|
145
|
+
id={uniqueId}
|
|
144
146
|
>
|
|
145
147
|
{isOpen && (
|
|
146
148
|
<FocusTrap
|
|
@@ -155,12 +157,11 @@ export class ContextSelector extends React.Component<ContextSelectorProps, { oui
|
|
|
155
157
|
placeholder={searchInputPlaceholder}
|
|
156
158
|
onChange={onSearchInputChange}
|
|
157
159
|
onKeyPress={this.onEnterPressed}
|
|
158
|
-
aria-
|
|
160
|
+
aria-label={searchButtonAriaLabel}
|
|
159
161
|
/>
|
|
160
162
|
<Button
|
|
161
163
|
variant={ButtonVariant.control}
|
|
162
164
|
aria-label={searchButtonAriaLabel}
|
|
163
|
-
id={searchButtonId}
|
|
164
165
|
onClick={onSearchButtonClick}
|
|
165
166
|
>
|
|
166
167
|
<SearchIcon aria-hidden="true" />
|
|
@@ -29,7 +29,8 @@ export class ContextSelectorMenuList extends React.Component<ContextSelectorMenu
|
|
|
29
29
|
return React.Children.map(this.props.children, (child, index) =>
|
|
30
30
|
React.cloneElement(child as React.ReactElement<any>, {
|
|
31
31
|
sendRef: this.sendRef,
|
|
32
|
-
index
|
|
32
|
+
index,
|
|
33
|
+
role: 'menuitem'
|
|
33
34
|
})
|
|
34
35
|
);
|
|
35
36
|
}
|
|
@@ -16,12 +16,12 @@ const items = [
|
|
|
16
16
|
|
|
17
17
|
describe('ContextSelector', () => {
|
|
18
18
|
test('Renders ContextSelector', () => {
|
|
19
|
-
const { asFragment } = render(<ContextSelector>{items}</ContextSelector>);
|
|
19
|
+
const { asFragment } = render(<ContextSelector id="render">{items}</ContextSelector>);
|
|
20
20
|
expect(asFragment()).toMatchSnapshot();
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
test('Renders ContextSelector open', () => {
|
|
24
|
-
const { asFragment } = render(<ContextSelector isOpen>{items}</ContextSelector>);
|
|
24
|
+
const { asFragment } = render(<ContextSelector isOpen id="render-open">{items}</ContextSelector>);
|
|
25
25
|
expect(asFragment()).toMatchSnapshot();
|
|
26
26
|
});
|
|
27
27
|
|
package/src/components/ContextSelector/__tests__/__snapshots__/ContextSelector.test.tsx.snap
CHANGED
|
@@ -10,9 +10,9 @@ exports[`ContextSelector Renders ContextSelector 1`] = `
|
|
|
10
10
|
>
|
|
11
11
|
<button
|
|
12
12
|
aria-expanded="false"
|
|
13
|
-
aria-labelledby="pf-context-selector-label-id-
|
|
13
|
+
aria-labelledby="pf-context-selector-label-id-render pf-context-selector-toggle-id-render"
|
|
14
14
|
class="pf-c-context-selector__toggle"
|
|
15
|
-
id="pf-context-selector-toggle-id-
|
|
15
|
+
id="pf-context-selector-toggle-id-render"
|
|
16
16
|
type="button"
|
|
17
17
|
>
|
|
18
18
|
<span
|
|
@@ -50,9 +50,9 @@ exports[`ContextSelector Renders ContextSelector open 1`] = `
|
|
|
50
50
|
>
|
|
51
51
|
<button
|
|
52
52
|
aria-expanded="true"
|
|
53
|
-
aria-labelledby="pf-context-selector-label-id-
|
|
53
|
+
aria-labelledby="pf-context-selector-label-id-render-open pf-context-selector-toggle-id-render-open"
|
|
54
54
|
class="pf-c-context-selector__toggle"
|
|
55
|
-
id="pf-context-selector-toggle-id-
|
|
55
|
+
id="pf-context-selector-toggle-id-render-open"
|
|
56
56
|
type="button"
|
|
57
57
|
>
|
|
58
58
|
<span
|
|
@@ -78,6 +78,7 @@ exports[`ContextSelector Renders ContextSelector open 1`] = `
|
|
|
78
78
|
</button>
|
|
79
79
|
<div
|
|
80
80
|
class="pf-c-context-selector__menu"
|
|
81
|
+
id="render-open"
|
|
81
82
|
>
|
|
82
83
|
<div>
|
|
83
84
|
<div
|
|
@@ -87,9 +88,8 @@ exports[`ContextSelector Renders ContextSelector open 1`] = `
|
|
|
87
88
|
class="pf-c-input-group"
|
|
88
89
|
>
|
|
89
90
|
<input
|
|
90
|
-
aria-describedby="pf-context-selector-search-button-id-0"
|
|
91
91
|
aria-invalid="false"
|
|
92
|
-
aria-
|
|
92
|
+
aria-label="Search menu items"
|
|
93
93
|
class="pf-c-form-control"
|
|
94
94
|
data-ouia-component-id="OUIA-Generated-TextInputBase-1"
|
|
95
95
|
data-ouia-component-type="PF4/TextInput"
|
|
@@ -105,7 +105,6 @@ exports[`ContextSelector Renders ContextSelector open 1`] = `
|
|
|
105
105
|
data-ouia-component-id="OUIA-Generated-Button-control-1"
|
|
106
106
|
data-ouia-component-type="PF4/Button"
|
|
107
107
|
data-ouia-safe="true"
|
|
108
|
-
id="pf-context-selector-search-button-id-0"
|
|
109
108
|
type="button"
|
|
110
109
|
>
|
|
111
110
|
<svg
|
|
@@ -133,6 +132,7 @@ exports[`ContextSelector Renders ContextSelector open 1`] = `
|
|
|
133
132
|
>
|
|
134
133
|
<button
|
|
135
134
|
class="pf-c-context-selector__menu-list-item"
|
|
135
|
+
role="menuitem"
|
|
136
136
|
>
|
|
137
137
|
My Project
|
|
138
138
|
</button>
|
|
@@ -142,6 +142,7 @@ exports[`ContextSelector Renders ContextSelector open 1`] = `
|
|
|
142
142
|
>
|
|
143
143
|
<button
|
|
144
144
|
class="pf-c-context-selector__menu-list-item"
|
|
145
|
+
role="menuitem"
|
|
145
146
|
>
|
|
146
147
|
OpenShift Cluster
|
|
147
148
|
</button>
|
|
@@ -151,6 +152,7 @@ exports[`ContextSelector Renders ContextSelector open 1`] = `
|
|
|
151
152
|
>
|
|
152
153
|
<button
|
|
153
154
|
class="pf-c-context-selector__menu-list-item"
|
|
155
|
+
role="menuitem"
|
|
154
156
|
>
|
|
155
157
|
Production Ansible
|
|
156
158
|
</button>
|
|
@@ -160,6 +162,7 @@ exports[`ContextSelector Renders ContextSelector open 1`] = `
|
|
|
160
162
|
>
|
|
161
163
|
<button
|
|
162
164
|
class="pf-c-context-selector__menu-list-item"
|
|
165
|
+
role="menuitem"
|
|
163
166
|
>
|
|
164
167
|
AWS
|
|
165
168
|
</button>
|
|
@@ -169,6 +172,7 @@ exports[`ContextSelector Renders ContextSelector open 1`] = `
|
|
|
169
172
|
>
|
|
170
173
|
<button
|
|
171
174
|
class="pf-c-context-selector__menu-list-item"
|
|
175
|
+
role="menuitem"
|
|
172
176
|
>
|
|
173
177
|
Azure
|
|
174
178
|
</button>
|