@patternfly/react-core 4.183.10 → 4.184.2
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 +35 -0
- package/dist/esm/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/esm/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/Dropdown/DropdownToggle.d.ts +2 -0
- package/dist/esm/components/Dropdown/DropdownToggle.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/DropdownToggle.js +3 -3
- package/dist/esm/components/Dropdown/DropdownToggle.js.map +1 -1
- package/dist/esm/components/Dropdown/DropdownWithContext.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/DropdownWithContext.js +4 -2
- package/dist/esm/components/Dropdown/DropdownWithContext.js.map +1 -1
- package/dist/esm/components/Dropdown/Toggle.d.ts +2 -0
- package/dist/esm/components/Dropdown/Toggle.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/Toggle.js +4 -3
- package/dist/esm/components/Dropdown/Toggle.js.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/js/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/js/components/Dropdown/DropdownToggle.d.ts +2 -0
- package/dist/js/components/Dropdown/DropdownToggle.d.ts.map +1 -1
- package/dist/js/components/Dropdown/DropdownToggle.js +3 -3
- package/dist/js/components/Dropdown/DropdownToggle.js.map +1 -1
- package/dist/js/components/Dropdown/DropdownWithContext.d.ts.map +1 -1
- package/dist/js/components/Dropdown/DropdownWithContext.js +4 -2
- package/dist/js/components/Dropdown/DropdownWithContext.js.map +1 -1
- package/dist/js/components/Dropdown/Toggle.d.ts +2 -0
- package/dist/js/components/Dropdown/Toggle.d.ts.map +1 -1
- package/dist/js/components/Dropdown/Toggle.js +4 -3
- package/dist/js/components/Dropdown/Toggle.js.map +1 -1
- package/dist/umd/react-core.css +17 -2
- package/dist/umd/react-core.js +11 -8
- package/dist/umd/react-core.min.css +17 -2
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +6 -6
- package/src/components/ActionList/examples/ActionList.md +4 -201
- package/src/components/ActionList/examples/ActionListMultipleGroups.tsx +31 -0
- package/src/components/ActionList/examples/ActionListSingleGroup.tsx +86 -0
- package/src/components/ActionList/examples/ActionListWithCancelButton.tsx +43 -0
- package/src/components/ActionList/examples/ActionListWithIcons.tsx +19 -0
- package/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncher.test.tsx.snap +1 -0
- package/src/components/ApplicationLauncher/__tests__/__snapshots__/ApplicationLauncher.test.tsx.snap +18 -0
- package/src/components/Dropdown/Dropdown.tsx +2 -0
- package/src/components/Dropdown/DropdownToggle.tsx +4 -0
- package/src/components/Dropdown/DropdownWithContext.tsx +3 -0
- package/src/components/Dropdown/Toggle.tsx +5 -0
- package/src/components/Dropdown/__tests__/DropdownToggle.test.tsx +11 -0
- package/src/components/Dropdown/__tests__/Generated/__snapshots__/Dropdown.test.tsx.snap +1 -0
- package/src/components/Dropdown/__tests__/Generated/__snapshots__/KebabToggle.test.tsx.snap +1 -0
- package/src/components/Dropdown/__tests__/__snapshots__/Dropdown.test.tsx.snap +45 -0
- package/src/components/Dropdown/__tests__/__snapshots__/DropdownToggle.test.tsx.snap +94 -8
- package/src/components/Dropdown/__tests__/__snapshots__/Toggle.test.tsx.snap +2 -0
- package/src/components/Dropdown/examples/Dropdown.md +57 -0
- package/src/components/OptionsMenu/__tests__/Generated/__snapshots__/OptionsMenu.test.tsx.snap +1 -0
- package/src/components/OptionsMenu/__tests__/__snapshots__/OptionsMenu.test.tsx.snap +31 -0
- package/src/components/Pagination/__tests__/Generated/__snapshots__/PaginationOptionsMenu.test.tsx.snap +1 -0
- package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +47 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.184.2",
|
|
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.
|
|
38
|
-
"@patternfly/react-styles": "^4.
|
|
39
|
-
"@patternfly/react-tokens": "^4.
|
|
37
|
+
"@patternfly/react-icons": "^4.35.2",
|
|
38
|
+
"@patternfly/react-styles": "^4.34.2",
|
|
39
|
+
"@patternfly/react-tokens": "^4.36.2",
|
|
40
40
|
"focus-trap": "6.2.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.166.3",
|
|
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": "948a074ec94f6131cebca702a2b41cf3c6835da2"
|
|
64
64
|
}
|
|
@@ -12,217 +12,20 @@ import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
|
|
|
12
12
|
|
|
13
13
|
### Action list single group
|
|
14
14
|
|
|
15
|
-
```
|
|
16
|
-
import React from 'react';
|
|
17
|
-
import {
|
|
18
|
-
ActionList,
|
|
19
|
-
ActionListItem,
|
|
20
|
-
Button,
|
|
21
|
-
Dropdown,
|
|
22
|
-
DropdownItem,
|
|
23
|
-
DropdownSeparator,
|
|
24
|
-
KebabToggle
|
|
25
|
-
} from '@patternfly/react-core';
|
|
26
|
-
|
|
27
|
-
class BasicActionList extends React.Component {
|
|
28
|
-
constructor(props) {
|
|
29
|
-
super(props);
|
|
30
|
-
this.state = {
|
|
31
|
-
isOpen: false
|
|
32
|
-
};
|
|
33
|
-
this.onToggle = (isOpen, event) => {
|
|
34
|
-
event.stopPropagation();
|
|
35
|
-
this.setState({
|
|
36
|
-
isOpen
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
this.onSelect = event => {
|
|
40
|
-
event.stopPropagation();
|
|
41
|
-
this.setState({
|
|
42
|
-
isOpen: !this.state.isOpen
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
render() {
|
|
48
|
-
const dropdownItems = [
|
|
49
|
-
<DropdownItem key="link">Link</DropdownItem>,
|
|
50
|
-
<DropdownItem key="action" component="button">
|
|
51
|
-
Action
|
|
52
|
-
</DropdownItem>,
|
|
53
|
-
<DropdownItem key="disabled link" isDisabled>
|
|
54
|
-
Disabled Link
|
|
55
|
-
</DropdownItem>,
|
|
56
|
-
<DropdownItem key="disabled action" isDisabled component="button">
|
|
57
|
-
Disabled Action
|
|
58
|
-
</DropdownItem>,
|
|
59
|
-
<DropdownSeparator key="separator" />,
|
|
60
|
-
<DropdownItem key="separated link">Separated Link</DropdownItem>,
|
|
61
|
-
<DropdownItem key="separated action" component="button">
|
|
62
|
-
Separated Action
|
|
63
|
-
</DropdownItem>
|
|
64
|
-
];
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<React.Fragment>
|
|
68
|
-
<ActionList>
|
|
69
|
-
<ActionListItem>
|
|
70
|
-
<Button variant="primary" id="next-button">
|
|
71
|
-
Next
|
|
72
|
-
</Button>
|
|
73
|
-
</ActionListItem>
|
|
74
|
-
<ActionListItem>
|
|
75
|
-
<Button variant="secondary" id="back-button">
|
|
76
|
-
Back
|
|
77
|
-
</Button>
|
|
78
|
-
</ActionListItem>
|
|
79
|
-
</ActionList>
|
|
80
|
-
<br />
|
|
81
|
-
With kebab
|
|
82
|
-
<ActionList>
|
|
83
|
-
<ActionListItem>
|
|
84
|
-
<Button variant="primary" id="next-button2">
|
|
85
|
-
Next
|
|
86
|
-
</Button>
|
|
87
|
-
</ActionListItem>
|
|
88
|
-
<ActionListItem>
|
|
89
|
-
<Button variant="secondary" id="back-button2">
|
|
90
|
-
Back
|
|
91
|
-
</Button>
|
|
92
|
-
</ActionListItem>
|
|
93
|
-
<ActionListItem>
|
|
94
|
-
<Dropdown
|
|
95
|
-
onSelect={this.onSelect}
|
|
96
|
-
toggle={<KebabToggle onToggle={this.onToggle} />}
|
|
97
|
-
isOpen={this.state.isOpen}
|
|
98
|
-
isPlain
|
|
99
|
-
dropdownItems={dropdownItems}
|
|
100
|
-
position="right"
|
|
101
|
-
/>
|
|
102
|
-
</ActionListItem>
|
|
103
|
-
</ActionList>
|
|
104
|
-
</React.Fragment>
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
15
|
+
```ts file="ActionListSingleGroup.tsx"
|
|
108
16
|
```
|
|
109
17
|
|
|
110
18
|
### Action list with icons
|
|
111
19
|
|
|
112
|
-
```
|
|
113
|
-
import React from 'react';
|
|
114
|
-
import { ActionList, ActionListItem, Button } from '@patternfly/react-core';
|
|
115
|
-
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
116
|
-
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
117
|
-
|
|
118
|
-
class IconsActionList extends React.Component {
|
|
119
|
-
render() {
|
|
120
|
-
return (
|
|
121
|
-
<ActionList isIconList>
|
|
122
|
-
<ActionListItem>
|
|
123
|
-
<Button variant="plain" id="times-button" aria-label="times icon button">
|
|
124
|
-
<TimesIcon />
|
|
125
|
-
</Button>
|
|
126
|
-
</ActionListItem>
|
|
127
|
-
<ActionListItem>
|
|
128
|
-
<Button variant="plain" id="check-button" aria-label="check icon button">
|
|
129
|
-
<CheckIcon />
|
|
130
|
-
</Button>
|
|
131
|
-
</ActionListItem>
|
|
132
|
-
</ActionList>
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
20
|
+
```ts file="./ActionListWithIcons.tsx"
|
|
136
21
|
```
|
|
137
22
|
|
|
138
23
|
### Action list multiple groups
|
|
139
24
|
|
|
140
|
-
```
|
|
141
|
-
import React from 'react';
|
|
142
|
-
import { ActionList, ActionListGroup, ActionListItem, Button } from '@patternfly/react-core';
|
|
143
|
-
|
|
144
|
-
class GroupsActionList extends React.Component {
|
|
145
|
-
render() {
|
|
146
|
-
return (
|
|
147
|
-
<ActionList>
|
|
148
|
-
<ActionListGroup>
|
|
149
|
-
<ActionListItem>
|
|
150
|
-
<Button variant="primary" id="next-button">
|
|
151
|
-
Next
|
|
152
|
-
</Button>
|
|
153
|
-
</ActionListItem>
|
|
154
|
-
<ActionListItem>
|
|
155
|
-
<Button variant="secondary" id="back-button">
|
|
156
|
-
Back
|
|
157
|
-
</Button>
|
|
158
|
-
</ActionListItem>
|
|
159
|
-
</ActionListGroup>
|
|
160
|
-
<ActionListGroup>
|
|
161
|
-
<ActionListItem>
|
|
162
|
-
<Button variant="primary" id="submit-button">
|
|
163
|
-
Submit
|
|
164
|
-
</Button>
|
|
165
|
-
</ActionListItem>
|
|
166
|
-
<ActionListItem>
|
|
167
|
-
<Button variant="link" id="cancel-button">
|
|
168
|
-
Cancel
|
|
169
|
-
</Button>
|
|
170
|
-
</ActionListItem>
|
|
171
|
-
</ActionListGroup>
|
|
172
|
-
</ActionList>
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
25
|
+
```ts file="./ActionListMultipleGroups.tsx"
|
|
176
26
|
```
|
|
177
27
|
|
|
178
28
|
### Action list with cancel button
|
|
179
29
|
|
|
180
|
-
```
|
|
181
|
-
import React from 'react';
|
|
182
|
-
import { ActionList, ActionListGroup, ActionListItem, Button } from '@patternfly/react-core';
|
|
183
|
-
|
|
184
|
-
class CancelActionList extends React.Component {
|
|
185
|
-
render() {
|
|
186
|
-
return (
|
|
187
|
-
<React.Fragment>
|
|
188
|
-
In modals, forms, data lists
|
|
189
|
-
<ActionList>
|
|
190
|
-
<ActionListItem>
|
|
191
|
-
<Button variant="primary" id="save-button">
|
|
192
|
-
Save
|
|
193
|
-
</Button>
|
|
194
|
-
</ActionListItem>
|
|
195
|
-
<ActionListItem>
|
|
196
|
-
<Button variant="link" id="cancel-button">
|
|
197
|
-
Cancel
|
|
198
|
-
</Button>
|
|
199
|
-
</ActionListItem>
|
|
200
|
-
</ActionList>
|
|
201
|
-
<br />
|
|
202
|
-
In wizards
|
|
203
|
-
<ActionList>
|
|
204
|
-
<ActionListGroup>
|
|
205
|
-
<ActionListItem>
|
|
206
|
-
<Button variant="primary" id="next-button">
|
|
207
|
-
Next
|
|
208
|
-
</Button>
|
|
209
|
-
</ActionListItem>
|
|
210
|
-
<ActionListItem>
|
|
211
|
-
<Button variant="secondary" id="back-button">
|
|
212
|
-
Back
|
|
213
|
-
</Button>
|
|
214
|
-
</ActionListItem>
|
|
215
|
-
</ActionListGroup>
|
|
216
|
-
<ActionListGroup>
|
|
217
|
-
<ActionListItem>
|
|
218
|
-
<Button variant="link" id="cancel-button2">
|
|
219
|
-
Cancel
|
|
220
|
-
</Button>
|
|
221
|
-
</ActionListItem>
|
|
222
|
-
</ActionListGroup>
|
|
223
|
-
</ActionList>
|
|
224
|
-
</React.Fragment>
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
30
|
+
```ts file="./ActionListWithCancelButton.tsx"
|
|
228
31
|
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActionList, ActionListGroup, ActionListItem, Button } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ActionListMultipleGroups: React.FunctionComponent = () => (
|
|
5
|
+
<ActionList>
|
|
6
|
+
<ActionListGroup>
|
|
7
|
+
<ActionListItem>
|
|
8
|
+
<Button variant="primary" id="next-button">
|
|
9
|
+
Next
|
|
10
|
+
</Button>
|
|
11
|
+
</ActionListItem>
|
|
12
|
+
<ActionListItem>
|
|
13
|
+
<Button variant="secondary" id="back-button">
|
|
14
|
+
Back
|
|
15
|
+
</Button>
|
|
16
|
+
</ActionListItem>
|
|
17
|
+
</ActionListGroup>
|
|
18
|
+
<ActionListGroup>
|
|
19
|
+
<ActionListItem>
|
|
20
|
+
<Button variant="primary" id="submit-button">
|
|
21
|
+
Submit
|
|
22
|
+
</Button>
|
|
23
|
+
</ActionListItem>
|
|
24
|
+
<ActionListItem>
|
|
25
|
+
<Button variant="link" id="cancel-button">
|
|
26
|
+
Cancel
|
|
27
|
+
</Button>
|
|
28
|
+
</ActionListItem>
|
|
29
|
+
</ActionListGroup>
|
|
30
|
+
</ActionList>
|
|
31
|
+
);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
ActionList,
|
|
4
|
+
ActionListItem,
|
|
5
|
+
Button,
|
|
6
|
+
Dropdown,
|
|
7
|
+
DropdownItem,
|
|
8
|
+
DropdownSeparator,
|
|
9
|
+
KebabToggle
|
|
10
|
+
} from '@patternfly/react-core';
|
|
11
|
+
|
|
12
|
+
export const ActionListSingleGroup: React.FunctionComponent = () => {
|
|
13
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
14
|
+
|
|
15
|
+
const onToggle = (
|
|
16
|
+
isOpen: boolean,
|
|
17
|
+
event: MouseEvent | TouchEvent | KeyboardEvent | React.KeyboardEvent<any> | React.MouseEvent<HTMLButtonElement>
|
|
18
|
+
) => {
|
|
19
|
+
event.stopPropagation();
|
|
20
|
+
setIsOpen(isOpen);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const onSelect = (event: React.SyntheticEvent<HTMLDivElement, Event>) => {
|
|
24
|
+
event.stopPropagation();
|
|
25
|
+
setIsOpen(!isOpen);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const dropdownItems = [
|
|
29
|
+
<DropdownItem key="link">Link</DropdownItem>,
|
|
30
|
+
<DropdownItem key="action" component="button">
|
|
31
|
+
Action
|
|
32
|
+
</DropdownItem>,
|
|
33
|
+
<DropdownItem key="disabled link" isDisabled>
|
|
34
|
+
Disabled Link
|
|
35
|
+
</DropdownItem>,
|
|
36
|
+
<DropdownItem key="disabled action" isDisabled component="button">
|
|
37
|
+
Disabled Action
|
|
38
|
+
</DropdownItem>,
|
|
39
|
+
<DropdownSeparator key="separator" />,
|
|
40
|
+
<DropdownItem key="separated link">Separated Link</DropdownItem>,
|
|
41
|
+
<DropdownItem key="separated action" component="button">
|
|
42
|
+
Separated Action
|
|
43
|
+
</DropdownItem>
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<React.Fragment>
|
|
48
|
+
<ActionList>
|
|
49
|
+
<ActionListItem>
|
|
50
|
+
<Button variant="primary" id="next-button">
|
|
51
|
+
Next
|
|
52
|
+
</Button>
|
|
53
|
+
</ActionListItem>
|
|
54
|
+
<ActionListItem>
|
|
55
|
+
<Button variant="secondary" id="back-button">
|
|
56
|
+
Back
|
|
57
|
+
</Button>
|
|
58
|
+
</ActionListItem>
|
|
59
|
+
</ActionList>
|
|
60
|
+
<br />
|
|
61
|
+
With kebab
|
|
62
|
+
<ActionList>
|
|
63
|
+
<ActionListItem>
|
|
64
|
+
<Button variant="primary" id="next-button2">
|
|
65
|
+
Next
|
|
66
|
+
</Button>
|
|
67
|
+
</ActionListItem>
|
|
68
|
+
<ActionListItem>
|
|
69
|
+
<Button variant="secondary" id="back-button2">
|
|
70
|
+
Back
|
|
71
|
+
</Button>
|
|
72
|
+
</ActionListItem>
|
|
73
|
+
<ActionListItem>
|
|
74
|
+
<Dropdown
|
|
75
|
+
onSelect={onSelect}
|
|
76
|
+
toggle={<KebabToggle onToggle={onToggle} />}
|
|
77
|
+
isOpen={isOpen}
|
|
78
|
+
isPlain
|
|
79
|
+
dropdownItems={dropdownItems}
|
|
80
|
+
position="right"
|
|
81
|
+
/>
|
|
82
|
+
</ActionListItem>
|
|
83
|
+
</ActionList>
|
|
84
|
+
</React.Fragment>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActionList, ActionListGroup, ActionListItem, Button } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ActionListWithCancelButton: React.FunctionComponent = () => (
|
|
5
|
+
<React.Fragment>
|
|
6
|
+
In modals, forms, data lists
|
|
7
|
+
<ActionList>
|
|
8
|
+
<ActionListItem>
|
|
9
|
+
<Button variant="primary" id="save-button">
|
|
10
|
+
Save
|
|
11
|
+
</Button>
|
|
12
|
+
</ActionListItem>
|
|
13
|
+
<ActionListItem>
|
|
14
|
+
<Button variant="link" id="cancel-button">
|
|
15
|
+
Cancel
|
|
16
|
+
</Button>
|
|
17
|
+
</ActionListItem>
|
|
18
|
+
</ActionList>
|
|
19
|
+
<br />
|
|
20
|
+
In wizards
|
|
21
|
+
<ActionList>
|
|
22
|
+
<ActionListGroup>
|
|
23
|
+
<ActionListItem>
|
|
24
|
+
<Button variant="primary" id="next-button">
|
|
25
|
+
Next
|
|
26
|
+
</Button>
|
|
27
|
+
</ActionListItem>
|
|
28
|
+
<ActionListItem>
|
|
29
|
+
<Button variant="secondary" id="back-button">
|
|
30
|
+
Back
|
|
31
|
+
</Button>
|
|
32
|
+
</ActionListItem>
|
|
33
|
+
</ActionListGroup>
|
|
34
|
+
<ActionListGroup>
|
|
35
|
+
<ActionListItem>
|
|
36
|
+
<Button variant="link" id="cancel-button2">
|
|
37
|
+
Cancel
|
|
38
|
+
</Button>
|
|
39
|
+
</ActionListItem>
|
|
40
|
+
</ActionListGroup>
|
|
41
|
+
</ActionList>
|
|
42
|
+
</React.Fragment>
|
|
43
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActionList, ActionListItem, Button } from '@patternfly/react-core';
|
|
3
|
+
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
4
|
+
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
5
|
+
|
|
6
|
+
export const ActionListWithIcons: React.FunctionComponent = () => (
|
|
7
|
+
<ActionList isIconList>
|
|
8
|
+
<ActionListItem>
|
|
9
|
+
<Button variant="plain" id="times-button" aria-label="times icon button">
|
|
10
|
+
<TimesIcon />
|
|
11
|
+
</Button>
|
|
12
|
+
</ActionListItem>
|
|
13
|
+
<ActionListItem>
|
|
14
|
+
<Button variant="plain" id="check-button" aria-label="check icon button">
|
|
15
|
+
<CheckIcon />
|
|
16
|
+
</Button>
|
|
17
|
+
</ActionListItem>
|
|
18
|
+
</ActionList>
|
|
19
|
+
);
|
package/src/components/ApplicationLauncher/__tests__/__snapshots__/ApplicationLauncher.test.tsx.snap
CHANGED
|
@@ -97,6 +97,7 @@ exports[`ApplicationLauncher custom icon 1`] = `
|
|
|
97
97
|
isGrouped={false}
|
|
98
98
|
isOpen={true}
|
|
99
99
|
isPlain={false}
|
|
100
|
+
isText={false}
|
|
100
101
|
menuAppendTo="inline"
|
|
101
102
|
onSelect={[Function]}
|
|
102
103
|
position="left"
|
|
@@ -131,6 +132,7 @@ exports[`ApplicationLauncher custom icon 1`] = `
|
|
|
131
132
|
isDisabled={false}
|
|
132
133
|
isOpen={true}
|
|
133
134
|
isPlain={false}
|
|
135
|
+
isText={false}
|
|
134
136
|
key=".0"
|
|
135
137
|
onEnter={[Function]}
|
|
136
138
|
onToggle={[Function]}
|
|
@@ -292,6 +294,7 @@ exports[`ApplicationLauncher custom icon 1`] = `
|
|
|
292
294
|
isPlain={false}
|
|
293
295
|
isPrimary={false}
|
|
294
296
|
isSplitButton={false}
|
|
297
|
+
isText={false}
|
|
295
298
|
onEnter={[Function]}
|
|
296
299
|
onToggle={[Function]}
|
|
297
300
|
parentRef={
|
|
@@ -1104,6 +1107,7 @@ exports[`ApplicationLauncher dropup + right aligned 1`] = `
|
|
|
1104
1107
|
isGrouped={false}
|
|
1105
1108
|
isOpen={false}
|
|
1106
1109
|
isPlain={false}
|
|
1110
|
+
isText={false}
|
|
1107
1111
|
menuAppendTo="inline"
|
|
1108
1112
|
onSelect={[Function]}
|
|
1109
1113
|
position="right"
|
|
@@ -1137,6 +1141,7 @@ exports[`ApplicationLauncher dropup + right aligned 1`] = `
|
|
|
1137
1141
|
isDisabled={false}
|
|
1138
1142
|
isOpen={false}
|
|
1139
1143
|
isPlain={false}
|
|
1144
|
+
isText={false}
|
|
1140
1145
|
key=".0"
|
|
1141
1146
|
onEnter={[Function]}
|
|
1142
1147
|
onToggle={[Function]}
|
|
@@ -1196,6 +1201,7 @@ exports[`ApplicationLauncher dropup + right aligned 1`] = `
|
|
|
1196
1201
|
isPlain={false}
|
|
1197
1202
|
isPrimary={false}
|
|
1198
1203
|
isSplitButton={false}
|
|
1204
|
+
isText={false}
|
|
1199
1205
|
onEnter={[Function]}
|
|
1200
1206
|
onToggle={[Function]}
|
|
1201
1207
|
parentRef={
|
|
@@ -1384,6 +1390,7 @@ exports[`ApplicationLauncher dropup 1`] = `
|
|
|
1384
1390
|
isGrouped={false}
|
|
1385
1391
|
isOpen={false}
|
|
1386
1392
|
isPlain={false}
|
|
1393
|
+
isText={false}
|
|
1387
1394
|
menuAppendTo="inline"
|
|
1388
1395
|
onSelect={[Function]}
|
|
1389
1396
|
position="left"
|
|
@@ -1417,6 +1424,7 @@ exports[`ApplicationLauncher dropup 1`] = `
|
|
|
1417
1424
|
isDisabled={false}
|
|
1418
1425
|
isOpen={false}
|
|
1419
1426
|
isPlain={false}
|
|
1427
|
+
isText={false}
|
|
1420
1428
|
key=".0"
|
|
1421
1429
|
onEnter={[Function]}
|
|
1422
1430
|
onToggle={[Function]}
|
|
@@ -1476,6 +1484,7 @@ exports[`ApplicationLauncher dropup 1`] = `
|
|
|
1476
1484
|
isPlain={false}
|
|
1477
1485
|
isPrimary={false}
|
|
1478
1486
|
isSplitButton={false}
|
|
1487
|
+
isText={false}
|
|
1479
1488
|
onEnter={[Function]}
|
|
1480
1489
|
onToggle={[Function]}
|
|
1481
1490
|
parentRef={
|
|
@@ -1664,6 +1673,7 @@ exports[`ApplicationLauncher expanded 1`] = `
|
|
|
1664
1673
|
isGrouped={false}
|
|
1665
1674
|
isOpen={true}
|
|
1666
1675
|
isPlain={false}
|
|
1676
|
+
isText={false}
|
|
1667
1677
|
menuAppendTo="inline"
|
|
1668
1678
|
onSelect={[Function]}
|
|
1669
1679
|
position="left"
|
|
@@ -1697,6 +1707,7 @@ exports[`ApplicationLauncher expanded 1`] = `
|
|
|
1697
1707
|
isDisabled={false}
|
|
1698
1708
|
isOpen={true}
|
|
1699
1709
|
isPlain={false}
|
|
1710
|
+
isText={false}
|
|
1700
1711
|
key=".0"
|
|
1701
1712
|
onEnter={[Function]}
|
|
1702
1713
|
onToggle={[Function]}
|
|
@@ -1857,6 +1868,7 @@ exports[`ApplicationLauncher expanded 1`] = `
|
|
|
1857
1868
|
isPlain={false}
|
|
1858
1869
|
isPrimary={false}
|
|
1859
1870
|
isSplitButton={false}
|
|
1871
|
+
isText={false}
|
|
1860
1872
|
onEnter={[Function]}
|
|
1861
1873
|
onToggle={[Function]}
|
|
1862
1874
|
parentRef={
|
|
@@ -2666,6 +2678,7 @@ exports[`ApplicationLauncher regular 1`] = `
|
|
|
2666
2678
|
isGrouped={false}
|
|
2667
2679
|
isOpen={false}
|
|
2668
2680
|
isPlain={false}
|
|
2681
|
+
isText={false}
|
|
2669
2682
|
menuAppendTo="inline"
|
|
2670
2683
|
onSelect={[Function]}
|
|
2671
2684
|
position="left"
|
|
@@ -2699,6 +2712,7 @@ exports[`ApplicationLauncher regular 1`] = `
|
|
|
2699
2712
|
isDisabled={false}
|
|
2700
2713
|
isOpen={false}
|
|
2701
2714
|
isPlain={false}
|
|
2715
|
+
isText={false}
|
|
2702
2716
|
key=".0"
|
|
2703
2717
|
onEnter={[Function]}
|
|
2704
2718
|
onToggle={[Function]}
|
|
@@ -2758,6 +2772,7 @@ exports[`ApplicationLauncher regular 1`] = `
|
|
|
2758
2772
|
isPlain={false}
|
|
2759
2773
|
isPrimary={false}
|
|
2760
2774
|
isSplitButton={false}
|
|
2775
|
+
isText={false}
|
|
2761
2776
|
onEnter={[Function]}
|
|
2762
2777
|
onToggle={[Function]}
|
|
2763
2778
|
parentRef={
|
|
@@ -2946,6 +2961,7 @@ exports[`ApplicationLauncher right aligned 1`] = `
|
|
|
2946
2961
|
isGrouped={false}
|
|
2947
2962
|
isOpen={false}
|
|
2948
2963
|
isPlain={false}
|
|
2964
|
+
isText={false}
|
|
2949
2965
|
menuAppendTo="inline"
|
|
2950
2966
|
onSelect={[Function]}
|
|
2951
2967
|
position="right"
|
|
@@ -2979,6 +2995,7 @@ exports[`ApplicationLauncher right aligned 1`] = `
|
|
|
2979
2995
|
isDisabled={false}
|
|
2980
2996
|
isOpen={false}
|
|
2981
2997
|
isPlain={false}
|
|
2998
|
+
isText={false}
|
|
2982
2999
|
key=".0"
|
|
2983
3000
|
onEnter={[Function]}
|
|
2984
3001
|
onToggle={[Function]}
|
|
@@ -3038,6 +3055,7 @@ exports[`ApplicationLauncher right aligned 1`] = `
|
|
|
3038
3055
|
isPlain={false}
|
|
3039
3056
|
isPrimary={false}
|
|
3040
3057
|
isSplitButton={false}
|
|
3058
|
+
isText={false}
|
|
3041
3059
|
onEnter={[Function]}
|
|
3042
3060
|
onToggle={[Function]}
|
|
3043
3061
|
parentRef={
|
|
@@ -16,6 +16,8 @@ export interface DropdownProps extends ToggleMenuBaseProps, React.HTMLProps<HTML
|
|
|
16
16
|
isOpen?: boolean;
|
|
17
17
|
/** Display the toggle with no border or background */
|
|
18
18
|
isPlain?: boolean;
|
|
19
|
+
/** Display the toggle in text only mode */
|
|
20
|
+
isText?: boolean;
|
|
19
21
|
/** Flag indicating that the dropdown should expand to full height */
|
|
20
22
|
isFullHeight?: boolean;
|
|
21
23
|
/** Indicates where menu will be aligned horizontally */
|
|
@@ -25,6 +25,8 @@ export interface DropdownToggleProps extends React.HTMLProps<HTMLButtonElement>,
|
|
|
25
25
|
isActive?: boolean;
|
|
26
26
|
/** Display the toggle with no border or background */
|
|
27
27
|
isPlain?: boolean;
|
|
28
|
+
/** Display the toggle in text only mode */
|
|
29
|
+
isText?: boolean;
|
|
28
30
|
/** Whether or not the <div> has a disabled state */
|
|
29
31
|
isDisabled?: boolean;
|
|
30
32
|
/** @deprecated Use `toggleVariant` instead. Whether or not the dropdown toggle button should have primary button styling */
|
|
@@ -58,6 +60,7 @@ export const DropdownToggle: React.FunctionComponent<DropdownToggleProps> = ({
|
|
|
58
60
|
getMenuRef = null,
|
|
59
61
|
isDisabled = false,
|
|
60
62
|
isPlain = false,
|
|
63
|
+
isText = false,
|
|
61
64
|
isPrimary = false,
|
|
62
65
|
toggleVariant = 'default',
|
|
63
66
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -89,6 +92,7 @@ export const DropdownToggle: React.FunctionComponent<DropdownToggleProps> = ({
|
|
|
89
92
|
isActive={isActive}
|
|
90
93
|
isDisabled={isDisabled}
|
|
91
94
|
isPlain={isPlain}
|
|
95
|
+
isText={isText}
|
|
92
96
|
isPrimary={isPrimary}
|
|
93
97
|
toggleVariant={toggleVariant}
|
|
94
98
|
onToggle={onToggle}
|
|
@@ -23,6 +23,7 @@ export class DropdownWithContext extends React.Component<DropdownProps & OUIAPro
|
|
|
23
23
|
dropdownItems: [] as any[],
|
|
24
24
|
isOpen: false,
|
|
25
25
|
isPlain: false,
|
|
26
|
+
isText: false,
|
|
26
27
|
isGrouped: false,
|
|
27
28
|
position: DropdownPosition.left,
|
|
28
29
|
direction: DropdownDirection.down,
|
|
@@ -65,6 +66,7 @@ export class DropdownWithContext extends React.Component<DropdownProps & OUIAPro
|
|
|
65
66
|
dropdownItems,
|
|
66
67
|
isOpen,
|
|
67
68
|
isPlain,
|
|
69
|
+
isText,
|
|
68
70
|
isGrouped,
|
|
69
71
|
isFullHeight,
|
|
70
72
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -140,6 +142,7 @@ export class DropdownWithContext extends React.Component<DropdownProps & OUIAPro
|
|
|
140
142
|
isOpen,
|
|
141
143
|
id,
|
|
142
144
|
isPlain,
|
|
145
|
+
isText,
|
|
143
146
|
'aria-haspopup': ariaHasPopup,
|
|
144
147
|
onEnter: () => {
|
|
145
148
|
this.onEnter();
|
|
@@ -33,6 +33,8 @@ export interface ToggleProps {
|
|
|
33
33
|
isDisabled?: boolean;
|
|
34
34
|
/** Display the toggle with no border or background */
|
|
35
35
|
isPlain?: boolean;
|
|
36
|
+
/** Display the toggle in text only mode */
|
|
37
|
+
isText?: boolean;
|
|
36
38
|
/** @deprecated Use `toggleVariant` instead. Display the toggle with a primary button style */
|
|
37
39
|
isPrimary?: boolean;
|
|
38
40
|
/** Style the toggle as a child of a split button */
|
|
@@ -61,6 +63,7 @@ export class Toggle extends React.Component<ToggleProps> {
|
|
|
61
63
|
isActive: false,
|
|
62
64
|
isDisabled: false,
|
|
63
65
|
isPlain: false,
|
|
66
|
+
isText: false,
|
|
64
67
|
isPrimary: false,
|
|
65
68
|
isSplitButton: false,
|
|
66
69
|
onToggle: () => {},
|
|
@@ -135,6 +138,7 @@ export class Toggle extends React.Component<ToggleProps> {
|
|
|
135
138
|
isOpen,
|
|
136
139
|
isDisabled,
|
|
137
140
|
isPlain,
|
|
141
|
+
isText,
|
|
138
142
|
isPrimary,
|
|
139
143
|
isSplitButton,
|
|
140
144
|
toggleVariant,
|
|
@@ -162,6 +166,7 @@ export class Toggle extends React.Component<ToggleProps> {
|
|
|
162
166
|
isSplitButton ? styles.dropdownToggleButton : toggleClass || styles.dropdownToggle,
|
|
163
167
|
isActive && styles.modifiers.active,
|
|
164
168
|
isPlain && styles.modifiers.plain,
|
|
169
|
+
isText && styles.modifiers.text,
|
|
165
170
|
isPrimary && styles.modifiers.primary,
|
|
166
171
|
buttonVariantStyles[toggleVariant],
|
|
167
172
|
className
|