@patternfly/react-core 4.222.3 → 4.222.6
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/AboutModal/AboutModal.d.ts +1 -1
- package/dist/esm/components/AboutModal/AboutModal.js.map +1 -1
- package/dist/esm/components/Dropdown/InternalDropdownItem.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/InternalDropdownItem.js +3 -3
- package/dist/esm/components/Dropdown/InternalDropdownItem.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.js +6 -5
- package/dist/esm/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorPane.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/esm/components/Modal/Modal.d.ts +1 -1
- package/dist/esm/components/Modal/Modal.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js +2 -1
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
- package/dist/js/components/AboutModal/AboutModal.d.ts +1 -1
- package/dist/js/components/AboutModal/AboutModal.js.map +1 -1
- package/dist/js/components/Dropdown/InternalDropdownItem.d.ts.map +1 -1
- package/dist/js/components/Dropdown/InternalDropdownItem.js +3 -3
- package/dist/js/components/Dropdown/InternalDropdownItem.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.js +6 -5
- package/dist/js/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorPane.js.map +1 -1
- package/dist/js/components/Menu/MenuItem.js.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/js/components/Modal/Modal.d.ts +1 -1
- package/dist/js/components/Modal/Modal.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js +2 -1
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
- package/dist/umd/react-core.css +132 -64
- package/dist/umd/react-core.js +11 -9
- package/dist/umd/react-core.min.css +69 -1
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +6 -6
- package/src/components/AboutModal/AboutModal.tsx +1 -1
- package/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherSeparator.test.tsx.snap +1 -1
- package/src/components/ApplicationLauncher/__tests__/__snapshots__/ApplicationLauncher.test.tsx.snap +26 -14
- package/src/components/Dropdown/InternalDropdownItem.tsx +3 -2
- package/src/components/Dropdown/__tests__/Generated/__snapshots__/DropdownSeparator.test.tsx.snap +1 -1
- package/src/components/Dropdown/__tests__/__snapshots__/Dropdown.test.tsx.snap +21 -3
- package/src/components/Dropdown/__tests__/__snapshots__/InternalDropdownItem.test.tsx.snap +10 -0
- package/src/components/Dropdown/examples/DropdownBasic.tsx +4 -2
- package/src/components/DualListSelector/DualListSelector.tsx +57 -37
- package/src/components/DualListSelector/DualListSelectorPane.tsx +10 -8
- package/src/components/JumpLinks/examples/JumpLinks.md +6 -69
- package/src/components/JumpLinks/examples/JumpLinksBasic.tsx +10 -0
- package/src/components/JumpLinks/examples/JumpLinksExpandableVerticalWithSubsection.tsx +18 -0
- package/src/components/JumpLinks/examples/JumpLinksVertical.tsx +10 -0
- package/src/components/JumpLinks/examples/JumpLinksVerticalWithLabel.tsx +10 -0
- package/src/components/JumpLinks/examples/JumpLinksWithCenteredList.tsx +10 -0
- package/src/components/JumpLinks/examples/JumpLinksWithLabel.tsx +17 -0
- package/src/components/LabelGroup/examples/LabelGroup.md +6 -172
- package/src/components/LabelGroup/examples/LabelGroupBasic.tsx +15 -0
- package/src/components/LabelGroup/examples/LabelGroupCategory.tsx +15 -0
- package/src/components/LabelGroup/examples/LabelGroupCategoryRemovable.tsx +24 -0
- package/src/components/LabelGroup/examples/LabelGroupEditableLabels.tsx +53 -0
- package/src/components/LabelGroup/examples/LabelGroupOverflow.tsx +24 -0
- package/src/components/LabelGroup/examples/LabelGroupVerticalCategoryOverflowRemovable.tsx +24 -0
- package/src/components/List/examples/List.md +10 -72
- package/src/components/List/examples/ListBasic.tsx +10 -0
- package/src/components/List/examples/ListHorizontalRules.tsx +10 -0
- package/src/components/List/examples/ListIcons.tsx +13 -0
- package/src/components/List/examples/ListInline.tsx +10 -0
- package/src/components/List/examples/ListLargeIcons.tsx +13 -0
- package/src/components/List/examples/ListOrdered.tsx +10 -0
- package/src/components/List/examples/ListPlain.tsx +10 -0
- package/src/components/Menu/MenuItem.tsx +1 -1
- package/src/components/MenuToggle/MenuToggle.tsx +1 -1
- package/src/components/Modal/Modal.tsx +1 -1
- package/src/components/OptionsMenu/__tests__/Generated/__snapshots__/OptionsMenuItem.test.tsx.snap +2 -1
- package/src/components/OptionsMenu/__tests__/__snapshots__/OptionsMenu.test.tsx.snap +12 -6
- package/src/components/OverflowMenu/__tests__/Generated/__snapshots__/OverflowMenuDropdownItem.test.tsx.snap +2 -1
- package/src/components/Select/Select.tsx +6 -3
- package/src/components/Toolbar/ToolbarToggleGroup.tsx +4 -1
- package/src/demos/Wizard/WizardDemo.md +66 -121
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Label, LabelGroup } from '@patternfly/react-core';
|
|
3
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
4
|
+
|
|
5
|
+
export const LabelGroupCategory: React.FunctionComponent = () => (
|
|
6
|
+
<LabelGroup categoryName="Group label">
|
|
7
|
+
<Label icon={<InfoCircleIcon />}>Label 1</Label>
|
|
8
|
+
<Label icon={<InfoCircleIcon />} color="blue">
|
|
9
|
+
Label 2
|
|
10
|
+
</Label>
|
|
11
|
+
<Label icon={<InfoCircleIcon />} color="green">
|
|
12
|
+
Label 3
|
|
13
|
+
</Label>
|
|
14
|
+
</LabelGroup>
|
|
15
|
+
);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Label, LabelGroup, LabelProps } from '@patternfly/react-core';
|
|
3
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
4
|
+
|
|
5
|
+
export const LabelGroupCategoryRemovable: React.FunctionComponent = () => {
|
|
6
|
+
const [labels, setLabels] = React.useState([
|
|
7
|
+
['Label 1', 'grey'],
|
|
8
|
+
['Label 2', 'blue'],
|
|
9
|
+
['Label 3', 'green'],
|
|
10
|
+
['Label 4', 'orange'],
|
|
11
|
+
['Label 5', 'red']
|
|
12
|
+
]);
|
|
13
|
+
const deleteCategory = () => setLabels([]);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<LabelGroup categoryName="Group label" isClosable onClick={deleteCategory}>
|
|
17
|
+
{labels.map(([labelText, labelColor]) => (
|
|
18
|
+
<Label icon={<InfoCircleIcon />} color={labelColor as LabelProps['color']} key={labelText}>
|
|
19
|
+
{labelText}
|
|
20
|
+
</Label>
|
|
21
|
+
))}
|
|
22
|
+
</LabelGroup>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LabelGroup, Label } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const LabelGroupEditableLabels: React.FunctionComponent = () => {
|
|
5
|
+
const [label1, setLabel1] = React.useState('Editable label');
|
|
6
|
+
const [label2, setLabel2] = React.useState('Editable label 2');
|
|
7
|
+
const [label3, setLabel3] = React.useState('Editable label 3');
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<LabelGroup numLabels={5} isEditable>
|
|
11
|
+
<Label
|
|
12
|
+
color="blue"
|
|
13
|
+
onClose={() => Function.prototype}
|
|
14
|
+
onEditCancel={prevText => setLabel1(prevText)}
|
|
15
|
+
onEditComplete={newText => setLabel1(newText)}
|
|
16
|
+
isEditable
|
|
17
|
+
editableProps={{
|
|
18
|
+
'aria-label': 'Editable text',
|
|
19
|
+
id: 'editable-label-1'
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
{label1}
|
|
23
|
+
</Label>
|
|
24
|
+
<Label color="green">Static label</Label>
|
|
25
|
+
<Label
|
|
26
|
+
color="blue"
|
|
27
|
+
onClose={() => Function.prototype}
|
|
28
|
+
onEditCancel={prevText => setLabel2(prevText)}
|
|
29
|
+
onEditComplete={newText => setLabel2(newText)}
|
|
30
|
+
isEditable
|
|
31
|
+
editableProps={{
|
|
32
|
+
'aria-label': 'Editable text 2',
|
|
33
|
+
id: 'editable-label-2'
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
{label2}
|
|
37
|
+
</Label>
|
|
38
|
+
<Label
|
|
39
|
+
color="blue"
|
|
40
|
+
onClose={() => Function.prototype}
|
|
41
|
+
onEditCancel={prevText => setLabel3(prevText)}
|
|
42
|
+
onEditComplete={newText => setLabel3(newText)}
|
|
43
|
+
isEditable
|
|
44
|
+
editableProps={{
|
|
45
|
+
'aria-label': 'Editable text 3',
|
|
46
|
+
id: 'editable-label-3'
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
{label3}
|
|
50
|
+
</Label>
|
|
51
|
+
</LabelGroup>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Label, LabelGroup } from '@patternfly/react-core';
|
|
3
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
4
|
+
|
|
5
|
+
export const LabelGroupOverflow: React.FunctionComponent = () => (
|
|
6
|
+
<LabelGroup>
|
|
7
|
+
<Label icon={<InfoCircleIcon />}>Label 1</Label>
|
|
8
|
+
<Label icon={<InfoCircleIcon />} color="blue">
|
|
9
|
+
Label 2
|
|
10
|
+
</Label>
|
|
11
|
+
<Label icon={<InfoCircleIcon />} color="green">
|
|
12
|
+
Label 3
|
|
13
|
+
</Label>
|
|
14
|
+
<Label icon={<InfoCircleIcon />} color="orange">
|
|
15
|
+
Label 4
|
|
16
|
+
</Label>
|
|
17
|
+
<Label icon={<InfoCircleIcon />} color="red">
|
|
18
|
+
Label 5
|
|
19
|
+
</Label>
|
|
20
|
+
<Label icon={<InfoCircleIcon />} color="purple">
|
|
21
|
+
Label 6
|
|
22
|
+
</Label>
|
|
23
|
+
</LabelGroup>
|
|
24
|
+
);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Label, LabelGroup, LabelProps } from '@patternfly/react-core';
|
|
3
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
4
|
+
|
|
5
|
+
export const LabelGroupVerticalCategoryOverflowRemovable: React.FunctionComponent = () => {
|
|
6
|
+
const [labels, setLabels] = React.useState([
|
|
7
|
+
['Label 1', 'grey'],
|
|
8
|
+
['Label 2', 'blue'],
|
|
9
|
+
['Label 3', 'green'],
|
|
10
|
+
['Label 4', 'orange'],
|
|
11
|
+
['Label 5', 'red']
|
|
12
|
+
]);
|
|
13
|
+
const deleteCategory = () => setLabels([]);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<LabelGroup categoryName="Group label with a very long name" isVertical isClosable onClick={deleteCategory}>
|
|
17
|
+
{labels.map(([labelText, labelColor]) => (
|
|
18
|
+
<Label icon={<InfoCircleIcon />} color={labelColor as LabelProps['color']} key={labelText}>
|
|
19
|
+
{labelText}
|
|
20
|
+
</Label>
|
|
21
|
+
))}
|
|
22
|
+
</LabelGroup>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -5,97 +5,35 @@ cssPrefix: pf-c-list
|
|
|
5
5
|
propComponents: ['List', 'ListItem']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import BookOpenIcon from '@patternfly/react-icons/dist/esm/icons/book-open-icon';
|
|
9
|
+
import KeyIcon from '@patternfly/react-icons/dist/esm/icons/key-icon';
|
|
10
|
+
import DesktopIcon from '@patternfly/react-icons/dist/esm/icons/desktop-icon';
|
|
11
11
|
|
|
12
12
|
## Examples
|
|
13
13
|
### Basic
|
|
14
|
-
```
|
|
15
|
-
import React from 'react';
|
|
16
|
-
import { List, ListItem } from '@patternfly/react-core';
|
|
17
|
-
|
|
18
|
-
<List>
|
|
19
|
-
<ListItem>First</ListItem>
|
|
20
|
-
<ListItem>Second</ListItem>
|
|
21
|
-
<ListItem>Third</ListItem>
|
|
22
|
-
</List>
|
|
14
|
+
```ts file="./ListBasic.tsx"
|
|
23
15
|
```
|
|
24
16
|
|
|
25
17
|
### Inline
|
|
26
|
-
```
|
|
27
|
-
import React from 'react';
|
|
28
|
-
import { List, ListItem, ListVariant } from '@patternfly/react-core';
|
|
29
|
-
|
|
30
|
-
<List variant={ListVariant.inline}>
|
|
31
|
-
<ListItem>First</ListItem>
|
|
32
|
-
<ListItem>Second</ListItem>
|
|
33
|
-
<ListItem>Third</ListItem>
|
|
34
|
-
</List>
|
|
18
|
+
```ts file="./ListInline.tsx"
|
|
35
19
|
```
|
|
36
20
|
|
|
37
21
|
### Ordered
|
|
38
|
-
```
|
|
39
|
-
import React from 'react';
|
|
40
|
-
import { List, ListItem, ListComponent, OrderType } from '@patternfly/react-core';
|
|
41
|
-
|
|
42
|
-
<List component={ListComponent.ol} type={OrderType.number}>
|
|
43
|
-
<ListItem>First</ListItem>
|
|
44
|
-
<ListItem>Second</ListItem>
|
|
45
|
-
<ListItem>Third</ListItem>
|
|
46
|
-
</List>
|
|
22
|
+
```ts file="./ListOrdered.tsx"
|
|
47
23
|
```
|
|
48
24
|
|
|
49
25
|
### Plain
|
|
50
|
-
```
|
|
51
|
-
import React from 'react';
|
|
52
|
-
import { List, ListItem } from '@patternfly/react-core';
|
|
53
|
-
|
|
54
|
-
<List isPlain>
|
|
55
|
-
<ListItem>First</ListItem>
|
|
56
|
-
<ListItem>Second</ListItem>
|
|
57
|
-
<ListItem>Third</ListItem>
|
|
58
|
-
</List>
|
|
26
|
+
```ts file="./ListPlain.tsx"
|
|
59
27
|
```
|
|
60
28
|
|
|
61
29
|
### With horizontal rules
|
|
62
|
-
```
|
|
63
|
-
import React from 'react';
|
|
64
|
-
import { List, ListItem } from '@patternfly/react-core';
|
|
65
|
-
|
|
66
|
-
<List isPlain isBordered>
|
|
67
|
-
<ListItem>First</ListItem>
|
|
68
|
-
<ListItem>Second</ListItem>
|
|
69
|
-
<ListItem>Third</ListItem>
|
|
70
|
-
</List>
|
|
30
|
+
```ts file="./ListHorizontalRules.tsx"
|
|
71
31
|
```
|
|
72
32
|
|
|
73
33
|
### With icons
|
|
74
|
-
```
|
|
75
|
-
import React from 'react';
|
|
76
|
-
import { List, ListItem } from '@patternfly/react-core';
|
|
77
|
-
import BookOpen from '@patternfly/react-icons/dist/esm/icons/book-open-icon';
|
|
78
|
-
import Key from '@patternfly/react-icons/dist/esm/icons/key-icon';
|
|
79
|
-
import Desktop from '@patternfly/react-icons/dist/esm/icons/desktop-icon';
|
|
80
|
-
|
|
81
|
-
<List isPlain>
|
|
82
|
-
<ListItem icon={<BookOpen />}>First</ListItem>
|
|
83
|
-
<ListItem icon={<Key />}>Second</ListItem>
|
|
84
|
-
<ListItem icon={<Desktop />}>Third</ListItem>
|
|
85
|
-
</List>
|
|
34
|
+
```ts file="./ListIcons.tsx"
|
|
86
35
|
```
|
|
87
36
|
|
|
88
37
|
### With large icons
|
|
89
|
-
```
|
|
90
|
-
import React from 'react';
|
|
91
|
-
import { List, ListItem } from '@patternfly/react-core';
|
|
92
|
-
import BookOpen from '@patternfly/react-icons/dist/esm/icons/book-open-icon';
|
|
93
|
-
import Key from '@patternfly/react-icons/dist/esm/icons/key-icon';
|
|
94
|
-
import Desktop from '@patternfly/react-icons/dist/esm/icons/desktop-icon';
|
|
95
|
-
|
|
96
|
-
<List isPlain iconSize="large">
|
|
97
|
-
<ListItem icon={<BookOpen />}>First</ListItem>
|
|
98
|
-
<ListItem icon={<Key />}>Second</ListItem>
|
|
99
|
-
<ListItem icon={<Desktop />}>Third</ListItem>
|
|
100
|
-
</List>
|
|
38
|
+
```ts file="./ListLargeIcons.tsx"
|
|
101
39
|
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { List, ListItem } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ListHorizontalRules: React.FunctionComponent = () => (
|
|
5
|
+
<List isPlain isBordered>
|
|
6
|
+
<ListItem>First</ListItem>
|
|
7
|
+
<ListItem>Second</ListItem>
|
|
8
|
+
<ListItem>Third</ListItem>
|
|
9
|
+
</List>
|
|
10
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { List, ListItem } from '@patternfly/react-core';
|
|
3
|
+
import BookOpenIcon from '@patternfly/react-icons/dist/esm/icons/book-open-icon';
|
|
4
|
+
import KeyIcon from '@patternfly/react-icons/dist/esm/icons/key-icon';
|
|
5
|
+
import DesktopIcon from '@patternfly/react-icons/dist/esm/icons/desktop-icon';
|
|
6
|
+
|
|
7
|
+
export const ListIcons: React.FunctionComponent = () => (
|
|
8
|
+
<List isPlain>
|
|
9
|
+
<ListItem icon={<BookOpenIcon />}>First</ListItem>
|
|
10
|
+
<ListItem icon={<KeyIcon />}>Second</ListItem>
|
|
11
|
+
<ListItem icon={<DesktopIcon />}>Third</ListItem>
|
|
12
|
+
</List>
|
|
13
|
+
);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { List, ListItem, ListVariant } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ListInline: React.FunctionComponent = () => (
|
|
5
|
+
<List variant={ListVariant.inline}>
|
|
6
|
+
<ListItem>First</ListItem>
|
|
7
|
+
<ListItem>Second</ListItem>
|
|
8
|
+
<ListItem>Third</ListItem>
|
|
9
|
+
</List>
|
|
10
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { List, ListItem } from '@patternfly/react-core';
|
|
3
|
+
import BookOpenIcon from '@patternfly/react-icons/dist/esm/icons/book-open-icon';
|
|
4
|
+
import KeyIcon from '@patternfly/react-icons/dist/esm/icons/key-icon';
|
|
5
|
+
import DesktopIcon from '@patternfly/react-icons/dist/esm/icons/desktop-icon';
|
|
6
|
+
|
|
7
|
+
export const ListLargeIcons: React.FunctionComponent = () => (
|
|
8
|
+
<List isPlain iconSize="large">
|
|
9
|
+
<ListItem icon={<BookOpenIcon />}>First</ListItem>
|
|
10
|
+
<ListItem icon={<KeyIcon />}>Second</ListItem>
|
|
11
|
+
<ListItem icon={<DesktopIcon />}>Third</ListItem>
|
|
12
|
+
</List>
|
|
13
|
+
);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { List, ListItem, ListComponent, OrderType } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ListOrdered: React.FunctionComponent = () => (
|
|
5
|
+
<List component={ListComponent.ol} type={OrderType.number}>
|
|
6
|
+
<ListItem>First</ListItem>
|
|
7
|
+
<ListItem>Second</ListItem>
|
|
8
|
+
<ListItem>Third</ListItem>
|
|
9
|
+
</List>
|
|
10
|
+
);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { List, ListItem } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ListPlain: React.FunctionComponent = () => (
|
|
5
|
+
<List isPlain>
|
|
6
|
+
<ListItem>First</ListItem>
|
|
7
|
+
<ListItem>Second</ListItem>
|
|
8
|
+
<ListItem>Third</ListItem>
|
|
9
|
+
</List>
|
|
10
|
+
);
|
|
@@ -224,7 +224,7 @@ const MenuItemBase: React.FunctionComponent<MenuItemProps> = ({
|
|
|
224
224
|
onDrillIn(
|
|
225
225
|
menuId,
|
|
226
226
|
typeof drilldownMenu === 'function'
|
|
227
|
-
? drilldownMenu().props.id
|
|
227
|
+
? (drilldownMenu() as any).props.id
|
|
228
228
|
: (drilldownMenu as React.ReactElement).props.id,
|
|
229
229
|
itemId
|
|
230
230
|
);
|
|
@@ -61,7 +61,7 @@ export class MenuToggleBase extends React.Component<MenuToggleProps> {
|
|
|
61
61
|
<React.Fragment>
|
|
62
62
|
{icon && <span className={css(styles.menuToggleIcon)}>{icon}</span>}
|
|
63
63
|
<span className="pf-c-menu-toggle__text">{children}</span>
|
|
64
|
-
{badge && <span className={css(styles.menuToggleCount)}>{badge}</span>}
|
|
64
|
+
{badge && <span className={css(styles.menuToggleCount)}>{badge as React.ReactNode}</span>}
|
|
65
65
|
<span className={css(styles.menuToggleControls)}>
|
|
66
66
|
<span className={css(styles.menuToggleToggleIcon)}>
|
|
67
67
|
<CaretDownIcon aria-hidden />
|
package/src/components/OptionsMenu/__tests__/Generated/__snapshots__/OptionsMenuItem.test.tsx.snap
CHANGED
|
@@ -4,7 +4,7 @@ exports[`OptionsMenuItem should match snapshot 1`] = `
|
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<li
|
|
6
6
|
id="''"
|
|
7
|
-
role="
|
|
7
|
+
role="none"
|
|
8
8
|
>
|
|
9
9
|
<button
|
|
10
10
|
aria-disabled="true"
|
|
@@ -12,6 +12,7 @@ exports[`OptionsMenuItem should match snapshot 1`] = `
|
|
|
12
12
|
data-ouia-component-id="OUIA-Generated-DropdownItem-1"
|
|
13
13
|
data-ouia-component-type="PF4/DropdownItem"
|
|
14
14
|
data-ouia-safe="true"
|
|
15
|
+
role="menuitem"
|
|
15
16
|
tabindex="-1"
|
|
16
17
|
type="button"
|
|
17
18
|
>
|
|
@@ -61,7 +61,7 @@ exports[`optionsMenu expanded 1`] = `
|
|
|
61
61
|
>
|
|
62
62
|
<li
|
|
63
63
|
id=""
|
|
64
|
-
role="
|
|
64
|
+
role="none"
|
|
65
65
|
>
|
|
66
66
|
<button
|
|
67
67
|
aria-disabled="false"
|
|
@@ -69,6 +69,7 @@ exports[`optionsMenu expanded 1`] = `
|
|
|
69
69
|
data-ouia-component-id="OUIA-Generated-DropdownItem-1"
|
|
70
70
|
data-ouia-component-type="PF4/DropdownItem"
|
|
71
71
|
data-ouia-safe="true"
|
|
72
|
+
role="menuitem"
|
|
72
73
|
tabindex="-1"
|
|
73
74
|
type="button"
|
|
74
75
|
>
|
|
@@ -77,7 +78,7 @@ exports[`optionsMenu expanded 1`] = `
|
|
|
77
78
|
</li>
|
|
78
79
|
<li
|
|
79
80
|
id=""
|
|
80
|
-
role="
|
|
81
|
+
role="none"
|
|
81
82
|
>
|
|
82
83
|
<button
|
|
83
84
|
aria-disabled="false"
|
|
@@ -85,6 +86,7 @@ exports[`optionsMenu expanded 1`] = `
|
|
|
85
86
|
data-ouia-component-id="OUIA-Generated-DropdownItem-2"
|
|
86
87
|
data-ouia-component-type="PF4/DropdownItem"
|
|
87
88
|
data-ouia-safe="true"
|
|
89
|
+
role="menuitem"
|
|
88
90
|
tabindex="-1"
|
|
89
91
|
type="button"
|
|
90
92
|
>
|
|
@@ -93,7 +95,7 @@ exports[`optionsMenu expanded 1`] = `
|
|
|
93
95
|
</li>
|
|
94
96
|
<li
|
|
95
97
|
id=""
|
|
96
|
-
role="
|
|
98
|
+
role="none"
|
|
97
99
|
>
|
|
98
100
|
<button
|
|
99
101
|
aria-disabled="true"
|
|
@@ -101,6 +103,7 @@ exports[`optionsMenu expanded 1`] = `
|
|
|
101
103
|
data-ouia-component-id="OUIA-Generated-DropdownItem-3"
|
|
102
104
|
data-ouia-component-type="PF4/DropdownItem"
|
|
103
105
|
data-ouia-safe="true"
|
|
106
|
+
role="menuitem"
|
|
104
107
|
tabindex="-1"
|
|
105
108
|
type="button"
|
|
106
109
|
>
|
|
@@ -109,7 +112,7 @@ exports[`optionsMenu expanded 1`] = `
|
|
|
109
112
|
</li>
|
|
110
113
|
<li
|
|
111
114
|
id=""
|
|
112
|
-
role="
|
|
115
|
+
role="none"
|
|
113
116
|
>
|
|
114
117
|
<button
|
|
115
118
|
aria-disabled="false"
|
|
@@ -117,6 +120,7 @@ exports[`optionsMenu expanded 1`] = `
|
|
|
117
120
|
data-ouia-component-id="OUIA-Generated-DropdownItem-4"
|
|
118
121
|
data-ouia-component-type="PF4/DropdownItem"
|
|
119
122
|
data-ouia-safe="true"
|
|
123
|
+
role="menuitem"
|
|
120
124
|
tabindex="-1"
|
|
121
125
|
type="button"
|
|
122
126
|
>
|
|
@@ -145,7 +149,7 @@ exports[`optionsMenu expanded 1`] = `
|
|
|
145
149
|
>
|
|
146
150
|
<li
|
|
147
151
|
id=""
|
|
148
|
-
role="
|
|
152
|
+
role="none"
|
|
149
153
|
>
|
|
150
154
|
<button
|
|
151
155
|
aria-disabled="false"
|
|
@@ -153,6 +157,7 @@ exports[`optionsMenu expanded 1`] = `
|
|
|
153
157
|
data-ouia-component-id="OUIA-Generated-DropdownItem-5"
|
|
154
158
|
data-ouia-component-type="PF4/DropdownItem"
|
|
155
159
|
data-ouia-safe="true"
|
|
160
|
+
role="menuitem"
|
|
156
161
|
tabindex="-1"
|
|
157
162
|
type="button"
|
|
158
163
|
>
|
|
@@ -161,7 +166,7 @@ exports[`optionsMenu expanded 1`] = `
|
|
|
161
166
|
</li>
|
|
162
167
|
<li
|
|
163
168
|
id=""
|
|
164
|
-
role="
|
|
169
|
+
role="none"
|
|
165
170
|
>
|
|
166
171
|
<button
|
|
167
172
|
aria-disabled="false"
|
|
@@ -169,6 +174,7 @@ exports[`optionsMenu expanded 1`] = `
|
|
|
169
174
|
data-ouia-component-id="OUIA-Generated-DropdownItem-6"
|
|
170
175
|
data-ouia-component-type="PF4/DropdownItem"
|
|
171
176
|
data-ouia-safe="true"
|
|
177
|
+
role="menuitem"
|
|
172
178
|
tabindex="-1"
|
|
173
179
|
type="button"
|
|
174
180
|
>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`OverflowMenuDropdownItem should match snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<li
|
|
6
|
-
role="
|
|
6
|
+
role="none"
|
|
7
7
|
>
|
|
8
8
|
<button
|
|
9
9
|
aria-disabled="false"
|
|
@@ -11,6 +11,7 @@ exports[`OverflowMenuDropdownItem should match snapshot 1`] = `
|
|
|
11
11
|
data-ouia-component-id="OUIA-Generated-DropdownItem-1"
|
|
12
12
|
data-ouia-component-type="PF4/DropdownItem"
|
|
13
13
|
data-ouia-safe="true"
|
|
14
|
+
role="menuitem"
|
|
14
15
|
tabindex="-1"
|
|
15
16
|
type="button"
|
|
16
17
|
>
|
|
@@ -447,7 +447,10 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
447
447
|
typeaheadFilteredChildren =
|
|
448
448
|
typeaheadInputValue.toString() !== ''
|
|
449
449
|
? React.Children.map(children, group => {
|
|
450
|
-
if (
|
|
450
|
+
if (
|
|
451
|
+
React.isValidElement<React.ComponentProps<typeof SelectGroup>>(group) &&
|
|
452
|
+
group.type === SelectGroup
|
|
453
|
+
) {
|
|
451
454
|
const filteredGroupChildren = (React.Children.toArray(group.props.children) as React.ReactElement<
|
|
452
455
|
SelectGroupProps
|
|
453
456
|
>[]).filter(childFilter);
|
|
@@ -635,8 +638,8 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
635
638
|
optionContainerRef: React.ReactNode,
|
|
636
639
|
index: number
|
|
637
640
|
) => {
|
|
638
|
-
this.refCollection[index] = [optionRef as HTMLElement, favoriteRef as HTMLElement];
|
|
639
|
-
this.optionContainerRefCollection[index] = optionContainerRef as HTMLElement;
|
|
641
|
+
this.refCollection[index] = [(optionRef as unknown) as HTMLElement, (favoriteRef as unknown) as HTMLElement];
|
|
642
|
+
this.optionContainerRefCollection[index] = (optionContainerRef as unknown) as HTMLElement;
|
|
640
643
|
};
|
|
641
644
|
|
|
642
645
|
handleMenuKeys = (index: number, innerIndex: number, position: string) => {
|
|
@@ -144,7 +144,10 @@ export class ToolbarToggleGroup extends React.Component<ToolbarToggleGroupProps>
|
|
|
144
144
|
</Button>
|
|
145
145
|
</div>
|
|
146
146
|
{isExpanded
|
|
147
|
-
? ReactDOM.createPortal(
|
|
147
|
+
? (ReactDOM.createPortal(
|
|
148
|
+
children,
|
|
149
|
+
expandableContentRef.current.firstElementChild
|
|
150
|
+
) as React.ReactElement)
|
|
148
151
|
: children}
|
|
149
152
|
</div>
|
|
150
153
|
);
|