@patternfly/react-core 4.198.7 → 4.198.8
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/BackToTop/BackToTop.js +1 -1
- package/dist/esm/components/BackToTop/BackToTop.js.map +1 -1
- package/dist/esm/components/Button/Button.d.ts +5 -1
- package/dist/esm/components/Button/Button.d.ts.map +1 -1
- package/dist/esm/components/Button/Button.js +2 -2
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.js +2 -2
- package/dist/esm/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/esm/components/ChipGroup/ChipGroup.d.ts.map +1 -1
- package/dist/esm/components/ChipGroup/ChipGroup.js +3 -3
- package/dist/esm/components/ChipGroup/ChipGroup.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorListItem.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorListItem.js +4 -2
- package/dist/esm/components/DualListSelector/DualListSelectorListItem.js.map +1 -1
- package/dist/esm/components/LabelGroup/LabelGroup.d.ts.map +1 -1
- package/dist/esm/components/LabelGroup/LabelGroup.js +2 -2
- package/dist/esm/components/LabelGroup/LabelGroup.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js +3 -3
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/Menu/MenuList.js +1 -1
- package/dist/esm/components/Menu/MenuList.js.map +1 -1
- package/dist/esm/components/OptionsMenu/OptionsMenu.js +1 -1
- package/dist/esm/components/OptionsMenu/OptionsMenu.js.map +1 -1
- package/dist/esm/components/OptionsMenu/OptionsMenuToggle.d.ts +2 -2
- package/dist/esm/components/OptionsMenu/OptionsMenuToggle.d.ts.map +1 -1
- package/dist/esm/components/OptionsMenu/OptionsMenuToggleWithText.d.ts +5 -1
- package/dist/esm/components/OptionsMenu/OptionsMenuToggleWithText.d.ts.map +1 -1
- package/dist/esm/components/OptionsMenu/OptionsMenuToggleWithText.js +7 -3
- package/dist/esm/components/OptionsMenu/OptionsMenuToggleWithText.js.map +1 -1
- package/dist/esm/components/SimpleList/SimpleList.js +1 -1
- package/dist/esm/components/SimpleList/SimpleList.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.d.ts +5 -1
- package/dist/esm/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js +2 -2
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/TreeView/TreeViewListItem.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeViewListItem.js +3 -3
- package/dist/esm/components/TreeView/TreeViewListItem.js.map +1 -1
- package/dist/js/components/BackToTop/BackToTop.js +1 -1
- package/dist/js/components/BackToTop/BackToTop.js.map +1 -1
- package/dist/js/components/Button/Button.d.ts +5 -1
- package/dist/js/components/Button/Button.d.ts.map +1 -1
- package/dist/js/components/Button/Button.js +2 -2
- package/dist/js/components/Button/Button.js.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.js +2 -2
- package/dist/js/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/js/components/ChipGroup/ChipGroup.d.ts.map +1 -1
- package/dist/js/components/ChipGroup/ChipGroup.js +3 -3
- package/dist/js/components/ChipGroup/ChipGroup.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorListItem.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorListItem.js +4 -2
- package/dist/js/components/DualListSelector/DualListSelectorListItem.js.map +1 -1
- package/dist/js/components/LabelGroup/LabelGroup.d.ts.map +1 -1
- package/dist/js/components/LabelGroup/LabelGroup.js +2 -2
- package/dist/js/components/LabelGroup/LabelGroup.js.map +1 -1
- package/dist/js/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuItem.js +3 -3
- package/dist/js/components/Menu/MenuItem.js.map +1 -1
- package/dist/js/components/Menu/MenuList.js +1 -1
- package/dist/js/components/Menu/MenuList.js.map +1 -1
- package/dist/js/components/OptionsMenu/OptionsMenu.js +1 -1
- package/dist/js/components/OptionsMenu/OptionsMenu.js.map +1 -1
- package/dist/js/components/OptionsMenu/OptionsMenuToggle.d.ts +2 -2
- package/dist/js/components/OptionsMenu/OptionsMenuToggle.d.ts.map +1 -1
- package/dist/js/components/OptionsMenu/OptionsMenuToggleWithText.d.ts +5 -1
- package/dist/js/components/OptionsMenu/OptionsMenuToggleWithText.d.ts.map +1 -1
- package/dist/js/components/OptionsMenu/OptionsMenuToggleWithText.js +7 -3
- package/dist/js/components/OptionsMenu/OptionsMenuToggleWithText.js.map +1 -1
- package/dist/js/components/SimpleList/SimpleList.js +1 -1
- package/dist/js/components/SimpleList/SimpleList.js.map +1 -1
- package/dist/js/components/Spinner/Spinner.d.ts +5 -1
- package/dist/js/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/js/components/Spinner/Spinner.js +2 -2
- package/dist/js/components/Spinner/Spinner.js.map +1 -1
- package/dist/js/components/TreeView/TreeViewListItem.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeViewListItem.js +3 -3
- package/dist/js/components/TreeView/TreeViewListItem.js.map +1 -1
- package/dist/umd/react-core.js +32 -26
- package/dist/umd/react-core.min.js +3 -3
- package/package.json +5 -5
- package/src/components/BackToTop/BackToTop.tsx +1 -1
- package/src/components/Backdrop/examples/BackdropSpinner.tsx +1 -1
- package/src/components/Button/Button.tsx +13 -2
- package/src/components/Button/__tests__/__snapshots__/Button.test.tsx.snap +2 -0
- package/src/components/Button/examples/ButtonProgress.tsx +33 -14
- package/src/components/CalendarMonth/CalendarMonth.tsx +2 -2
- package/src/components/ChipGroup/ChipGroup.tsx +6 -9
- package/src/components/ChipGroup/__tests__/__snapshots__/ChipGroup.test.tsx.snap +8 -3
- package/src/components/DualListSelector/DualListSelectorListItem.tsx +5 -2
- package/src/components/EmptyState/examples/EmptyState.md +2 -14
- package/src/components/InputGroup/examples/InputGroup.md +1 -1
- package/src/components/LabelGroup/LabelGroup.tsx +4 -8
- package/src/components/Menu/MenuItem.tsx +5 -6
- package/src/components/Menu/MenuList.tsx +1 -1
- package/src/components/OptionsMenu/OptionsMenu.tsx +1 -1
- package/src/components/OptionsMenu/OptionsMenuToggle.tsx +2 -2
- package/src/components/OptionsMenu/OptionsMenuToggleWithText.tsx +9 -1
- package/src/components/OptionsMenu/__tests__/__snapshots__/OptionsMenu.test.tsx.snap +0 -2
- package/src/components/Progress/examples/Progress.md +29 -25
- package/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +4 -0
- package/src/components/Sidebar/examples/Sidebar.md +6 -6
- package/src/components/SimpleList/SimpleList.tsx +1 -1
- package/src/components/SimpleList/__tests__/__snapshots__/SimpleList.test.tsx.snap +0 -1
- package/src/components/Spinner/Spinner.tsx +10 -1
- package/src/components/Spinner/__tests__/Generated/__snapshots__/Spinner.test.tsx.snap +1 -0
- package/src/components/Spinner/__tests__/__snapshots__/Spinner.test.tsx.snap +5 -0
- package/src/components/Spinner/examples/Spinner.md +6 -6
- package/src/components/Tooltip/examples/Tooltip.md +12 -5
- package/src/components/TreeView/TreeViewListItem.tsx +1 -2
- package/src/demos/DateTimePicker.md +5 -5
- package/src/demos/Tabs/NestedTabsDemo.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.198.
|
|
3
|
+
"version": "4.198.8",
|
|
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,9 +34,9 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.49.
|
|
38
|
-
"@patternfly/react-styles": "^4.48.
|
|
39
|
-
"@patternfly/react-tokens": "^4.50.
|
|
37
|
+
"@patternfly/react-icons": "^4.49.8",
|
|
38
|
+
"@patternfly/react-styles": "^4.48.8",
|
|
39
|
+
"@patternfly/react-tokens": "^4.50.8",
|
|
40
40
|
"focus-trap": "6.2.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
@@ -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": "65be4d3b6ceb42101a09604672d852374167f557"
|
|
64
64
|
}
|
|
@@ -69,7 +69,7 @@ const BackToTopBase: React.FunctionComponent<BackToTopProps> = ({
|
|
|
69
69
|
scrollEl.removeEventListener('scroll', toggleVisible);
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
});
|
|
72
|
+
}, [scrollableSelector, toggleVisible]);
|
|
73
73
|
|
|
74
74
|
const handleClick = () => {
|
|
75
75
|
scrollElement.scrollTo({ top: 0, behavior: 'smooth' });
|
|
@@ -4,7 +4,7 @@ import { Backdrop, Spinner, Bullseye } from '@patternfly/react-core';
|
|
|
4
4
|
export const BackdropSpinner: React.FunctionComponent = () => (
|
|
5
5
|
<Backdrop>
|
|
6
6
|
<Bullseye>
|
|
7
|
-
<Spinner />
|
|
7
|
+
<Spinner aria-label="Backdrop content" aria-valueText="Loading..." />
|
|
8
8
|
</Bullseye>
|
|
9
9
|
</Backdrop>
|
|
10
10
|
);
|
|
@@ -37,8 +37,12 @@ export interface ButtonProps extends Omit<React.HTMLProps<HTMLButtonElement>, 'r
|
|
|
37
37
|
isAriaDisabled?: boolean;
|
|
38
38
|
/** Adds progress styling to button */
|
|
39
39
|
isLoading?: boolean;
|
|
40
|
-
/**
|
|
40
|
+
/** Text describing that current loading status or progress */
|
|
41
41
|
spinnerAriaValueText?: string;
|
|
42
|
+
/** Accessible label for the spinner to describe what is loading */
|
|
43
|
+
spinnerAriaLabel?: string;
|
|
44
|
+
/** Id of element which describes what is being loaded */
|
|
45
|
+
spinnerAriaLabelledBy?: string;
|
|
42
46
|
/** Events to prevent when the button is in an aria-disabled state */
|
|
43
47
|
inoperableEvents?: string[];
|
|
44
48
|
/** Adds inline styling to a link button */
|
|
@@ -76,6 +80,8 @@ const ButtonBase: React.FunctionComponent<ButtonProps> = ({
|
|
|
76
80
|
isLoading = null,
|
|
77
81
|
isDanger = false,
|
|
78
82
|
spinnerAriaValueText,
|
|
83
|
+
spinnerAriaLabelledBy,
|
|
84
|
+
spinnerAriaLabel,
|
|
79
85
|
isSmall = false,
|
|
80
86
|
isLarge = false,
|
|
81
87
|
inoperableEvents = ['onClick', 'onKeyPress'],
|
|
@@ -146,7 +152,12 @@ const ButtonBase: React.FunctionComponent<ButtonProps> = ({
|
|
|
146
152
|
>
|
|
147
153
|
{isLoading && (
|
|
148
154
|
<span className={css(styles.buttonProgress)}>
|
|
149
|
-
<Spinner
|
|
155
|
+
<Spinner
|
|
156
|
+
size={spinnerSize.md}
|
|
157
|
+
aria-valuetext={spinnerAriaValueText}
|
|
158
|
+
aria-label={spinnerAriaLabel}
|
|
159
|
+
aria-labelledby={spinnerAriaLabelledBy}
|
|
160
|
+
/>
|
|
150
161
|
</span>
|
|
151
162
|
)}
|
|
152
163
|
{variant === ButtonVariant.plain && children === null && icon ? icon : null}
|
|
@@ -328,6 +328,7 @@ exports[`isLoading 1`] = `
|
|
|
328
328
|
size="md"
|
|
329
329
|
>
|
|
330
330
|
<span
|
|
331
|
+
aria-label="Contents"
|
|
331
332
|
aria-valuetext="Loading"
|
|
332
333
|
className="pf-c-spinner pf-m-md"
|
|
333
334
|
role="progressbar"
|
|
@@ -393,6 +394,7 @@ exports[`isLoading icon only 1`] = `
|
|
|
393
394
|
size="md"
|
|
394
395
|
>
|
|
395
396
|
<span
|
|
397
|
+
aria-label="Contents"
|
|
396
398
|
aria-valuetext="Loading"
|
|
397
399
|
className="pf-c-spinner pf-m-md"
|
|
398
400
|
role="progressbar"
|
|
@@ -2,37 +2,56 @@ import React from 'react';
|
|
|
2
2
|
import { Button } from '@patternfly/react-core';
|
|
3
3
|
import UploadIcon from '@patternfly/react-icons/dist/esm/icons/upload-icon';
|
|
4
4
|
|
|
5
|
+
interface LoadingPropsType {
|
|
6
|
+
spinnerAriaValueText: string;
|
|
7
|
+
spinnerAriaLabelledBy?: string;
|
|
8
|
+
spinnerAriaLabel?: string;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
5
12
|
export const ButtonProgress: React.FunctionComponent = () => {
|
|
6
13
|
const [isPrimaryLoading, setIsPrimaryLoading] = React.useState<boolean>(true);
|
|
7
14
|
const [isSecondaryLoading, setIsSecondaryLoading] = React.useState<boolean>(true);
|
|
8
|
-
const [isUploading, setIsUploading] = React.useState(
|
|
15
|
+
const [isUploading, setIsUploading] = React.useState<boolean>(false);
|
|
16
|
+
|
|
17
|
+
const primaryLoadingProps = {} as LoadingPropsType;
|
|
18
|
+
if (isPrimaryLoading) {
|
|
19
|
+
primaryLoadingProps.spinnerAriaValueText = 'Loading';
|
|
20
|
+
primaryLoadingProps.spinnerAriaLabelledBy = 'primary-loading-button';
|
|
21
|
+
primaryLoadingProps.isLoading = true;
|
|
22
|
+
}
|
|
23
|
+
const secondaryLoadingProps = {} as LoadingPropsType;
|
|
24
|
+
if (isSecondaryLoading) {
|
|
25
|
+
secondaryLoadingProps.spinnerAriaValueText = 'Loading';
|
|
26
|
+
secondaryLoadingProps.spinnerAriaLabel = 'Content being loaded';
|
|
27
|
+
secondaryLoadingProps.isLoading = true;
|
|
28
|
+
}
|
|
29
|
+
const uploadingProps = {} as LoadingPropsType;
|
|
30
|
+
if (isUploading) {
|
|
31
|
+
uploadingProps.spinnerAriaValueText = 'Loading';
|
|
32
|
+
uploadingProps.isLoading = true;
|
|
33
|
+
uploadingProps.spinnerAriaLabel = 'Uploading data';
|
|
34
|
+
}
|
|
9
35
|
|
|
10
36
|
return (
|
|
11
37
|
<React.Fragment>
|
|
12
38
|
<Button
|
|
13
|
-
spinnerAriaValueText={isPrimaryLoading ? 'Loading' : undefined}
|
|
14
|
-
isLoading={isPrimaryLoading}
|
|
15
39
|
variant="primary"
|
|
40
|
+
id="primary-loading-button"
|
|
16
41
|
onClick={() => setIsPrimaryLoading(!isPrimaryLoading)}
|
|
17
|
-
{...
|
|
42
|
+
{...primaryLoadingProps}
|
|
18
43
|
>
|
|
19
|
-
{isPrimaryLoading ? '
|
|
44
|
+
{isPrimaryLoading ? 'Pause loading logs' : 'Resume loading logs'}
|
|
20
45
|
</Button>{' '}
|
|
21
|
-
<Button
|
|
22
|
-
spinnerAriaValueText={isSecondaryLoading ? 'Loading' : undefined}
|
|
23
|
-
isLoading={isSecondaryLoading}
|
|
24
|
-
variant="secondary"
|
|
25
|
-
onClick={() => setIsSecondaryLoading(!isSecondaryLoading)}
|
|
26
|
-
{...(isSecondaryLoading && { spinnerAriaValueText: 'Loading' })}
|
|
27
|
-
>
|
|
46
|
+
<Button variant="secondary" onClick={() => setIsSecondaryLoading(!isSecondaryLoading)} {...secondaryLoadingProps}>
|
|
28
47
|
{isSecondaryLoading ? 'Click to stop loading' : 'Click to start loading'}
|
|
29
48
|
</Button>{' '}
|
|
30
49
|
<Button
|
|
31
|
-
spinnerAriaValueText={isUploading ? 'Loading' : undefined}
|
|
32
|
-
isLoading={isUploading}
|
|
33
50
|
variant="plain"
|
|
51
|
+
{...(!isUploading && { 'aria-label': 'Upload' })}
|
|
34
52
|
onClick={() => setIsUploading(!isUploading)}
|
|
35
53
|
icon={<UploadIcon />}
|
|
54
|
+
{...uploadingProps}
|
|
36
55
|
/>
|
|
37
56
|
<br />
|
|
38
57
|
<br />
|
|
@@ -126,7 +126,7 @@ export const CalendarMonth = ({
|
|
|
126
126
|
if (!(isValidDate(dateProp) && isSameDate(focusedDate, dateProp))) {
|
|
127
127
|
setFocusedDate(dateProp);
|
|
128
128
|
}
|
|
129
|
-
}, [dateProp]);
|
|
129
|
+
}, [dateProp, focusedDate]);
|
|
130
130
|
useEffect(() => {
|
|
131
131
|
// When using header controls don't move focus
|
|
132
132
|
if (shouldFocus) {
|
|
@@ -136,7 +136,7 @@ export const CalendarMonth = ({
|
|
|
136
136
|
} else {
|
|
137
137
|
setShouldFocus(true);
|
|
138
138
|
}
|
|
139
|
-
}, [focusedDate]);
|
|
139
|
+
}, [focusedDate, focusedDateValidated, shouldFocus]);
|
|
140
140
|
|
|
141
141
|
const onMonthClick = (newDate: Date) => {
|
|
142
142
|
setFocusedDate(newDate);
|
|
@@ -105,18 +105,12 @@ export class ChipGroup extends React.Component<ChipGroupProps, ChipGroupState> {
|
|
|
105
105
|
const { isTooltipVisible } = this.state;
|
|
106
106
|
return isTooltipVisible ? (
|
|
107
107
|
<Tooltip position={tooltipPosition} content={categoryName}>
|
|
108
|
-
<span
|
|
109
|
-
|
|
110
|
-
ref={this.headingRef}
|
|
111
|
-
className={css(styles.chipGroupLabel)}
|
|
112
|
-
id={id}
|
|
113
|
-
aria-label={categoryName}
|
|
114
|
-
>
|
|
115
|
-
<span aria-hidden="true">{categoryName}</span>
|
|
108
|
+
<span tabIndex={0} ref={this.headingRef} className={css(styles.chipGroupLabel)}>
|
|
109
|
+
<span id={id}>{categoryName}</span>
|
|
116
110
|
</span>
|
|
117
111
|
</Tooltip>
|
|
118
112
|
) : (
|
|
119
|
-
<span ref={this.headingRef} className={css(styles.chipGroupLabel)}
|
|
113
|
+
<span ref={this.headingRef} className={css(styles.chipGroupLabel)} id={id}>
|
|
120
114
|
{categoryName}
|
|
121
115
|
</span>
|
|
122
116
|
);
|
|
@@ -156,6 +150,9 @@ export class ChipGroup extends React.Component<ChipGroupProps, ChipGroupState> {
|
|
|
156
150
|
return (
|
|
157
151
|
<div
|
|
158
152
|
className={css(styles.chipGroup, className, categoryName && styles.modifiers.category)}
|
|
153
|
+
role="group"
|
|
154
|
+
{...(categoryName && { 'aria-labelledby': id })}
|
|
155
|
+
{...(!categoryName && { 'aria-label': ariaLabel })}
|
|
159
156
|
{...getOUIAProps(ChipGroup.displayName, ouiaId)}
|
|
160
157
|
>
|
|
161
158
|
<div className={css(styles.chipGroupMain)}>
|
|
@@ -18,9 +18,11 @@ exports[`ChipGroup chip group default 1`] = `
|
|
|
18
18
|
prefix="pf-random-id-"
|
|
19
19
|
>
|
|
20
20
|
<div
|
|
21
|
+
aria-label="Chip group category"
|
|
21
22
|
className="pf-c-chip-group"
|
|
22
23
|
data-ouia-component-type="PF4/ChipGroup"
|
|
23
24
|
data-ouia-safe={true}
|
|
25
|
+
role="group"
|
|
24
26
|
>
|
|
25
27
|
<div
|
|
26
28
|
className="pf-c-chip-group__main"
|
|
@@ -147,15 +149,16 @@ exports[`ChipGroup chip group with category 1`] = `
|
|
|
147
149
|
prefix="pf-random-id-"
|
|
148
150
|
>
|
|
149
151
|
<div
|
|
152
|
+
aria-labelledby="pf-random-id-2"
|
|
150
153
|
className="pf-c-chip-group pf-m-category"
|
|
151
154
|
data-ouia-component-type="PF4/ChipGroup"
|
|
152
155
|
data-ouia-safe={true}
|
|
156
|
+
role="group"
|
|
153
157
|
>
|
|
154
158
|
<div
|
|
155
159
|
className="pf-c-chip-group__main"
|
|
156
160
|
>
|
|
157
161
|
<span
|
|
158
|
-
aria-hidden="true"
|
|
159
162
|
className="pf-c-chip-group__label"
|
|
160
163
|
id="pf-random-id-2"
|
|
161
164
|
>
|
|
@@ -283,15 +286,16 @@ exports[`ChipGroup chip group with category and tooltip 1`] = `
|
|
|
283
286
|
prefix="pf-random-id-"
|
|
284
287
|
>
|
|
285
288
|
<div
|
|
289
|
+
aria-labelledby="pf-random-id-12"
|
|
286
290
|
className="pf-c-chip-group pf-m-category"
|
|
287
291
|
data-ouia-component-type="PF4/ChipGroup"
|
|
288
292
|
data-ouia-safe={true}
|
|
293
|
+
role="group"
|
|
289
294
|
>
|
|
290
295
|
<div
|
|
291
296
|
className="pf-c-chip-group__main"
|
|
292
297
|
>
|
|
293
298
|
<span
|
|
294
|
-
aria-hidden="true"
|
|
295
299
|
className="pf-c-chip-group__label"
|
|
296
300
|
id="pf-random-id-12"
|
|
297
301
|
>
|
|
@@ -419,15 +423,16 @@ exports[`ChipGroup chip group with closable category 1`] = `
|
|
|
419
423
|
prefix="pf-random-id-"
|
|
420
424
|
>
|
|
421
425
|
<div
|
|
426
|
+
aria-labelledby="pf-random-id-4"
|
|
422
427
|
className="pf-c-chip-group pf-m-category"
|
|
423
428
|
data-ouia-component-type="PF4/ChipGroup"
|
|
424
429
|
data-ouia-safe={true}
|
|
430
|
+
role="group"
|
|
425
431
|
>
|
|
426
432
|
<div
|
|
427
433
|
className="pf-c-chip-group__main"
|
|
428
434
|
>
|
|
429
435
|
<span
|
|
430
|
-
aria-hidden="true"
|
|
431
436
|
className="pf-c-chip-group__label"
|
|
432
437
|
id="pf-random-id-4"
|
|
433
438
|
>
|
|
@@ -38,8 +38,9 @@ export const DualListSelectorListItemBase: React.FunctionComponent<DualListSelec
|
|
|
38
38
|
isSelected,
|
|
39
39
|
innerRef,
|
|
40
40
|
isDraggable = false,
|
|
41
|
-
draggableButtonAriaLabel = 'Reorder option',
|
|
42
41
|
isDisabled,
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
43
|
+
draggableButtonAriaLabel = 'Reorder option',
|
|
43
44
|
...props
|
|
44
45
|
}: DualListSelectorListItemProps) => {
|
|
45
46
|
const ref = innerRef || React.useRef<HTMLLIElement>(null);
|
|
@@ -73,7 +74,9 @@ export const DualListSelectorListItemBase: React.FunctionComponent<DualListSelec
|
|
|
73
74
|
<div className={css(styles.dualListSelectorListItemRow, isSelected && styles.modifiers.selected)}>
|
|
74
75
|
{isDraggable && !isDisabled && (
|
|
75
76
|
<div className={css(styles.dualListSelectorDraggable)}>
|
|
76
|
-
|
|
77
|
+
{/** TODO once keyboard accessibility is enabled, remove `component=span`
|
|
78
|
+
and add `aria-label={draggableButtonAriaLabel}` */}
|
|
79
|
+
<Button variant={ButtonVariant.plain} component="span">
|
|
77
80
|
<GripVerticalIcon style={{ verticalAlign: '-0.3em' }} />
|
|
78
81
|
</Button>
|
|
79
82
|
</div>
|
|
@@ -50,11 +50,9 @@ import {
|
|
|
50
50
|
Button,
|
|
51
51
|
EmptyState,
|
|
52
52
|
EmptyStateVariant,
|
|
53
|
-
EmptyStateIcon,
|
|
54
53
|
EmptyStateBody,
|
|
55
54
|
EmptyStateSecondaryActions
|
|
56
55
|
} from '@patternfly/react-core';
|
|
57
|
-
import CubesIcon from '@patternfly/react-icons/dist/esm/icons/cubes-icon';
|
|
58
56
|
|
|
59
57
|
<EmptyState variant={EmptyStateVariant.xs}>
|
|
60
58
|
<Title headingLevel="h4" size="md">
|
|
@@ -185,22 +183,13 @@ import CubesIcon from '@patternfly/react-icons/dist/esm/icons/cubes-icon';
|
|
|
185
183
|
import React from 'react';
|
|
186
184
|
import {
|
|
187
185
|
Title,
|
|
188
|
-
Button,
|
|
189
186
|
EmptyState,
|
|
190
187
|
EmptyStateIcon,
|
|
191
|
-
|
|
192
|
-
EmptyStateSecondaryActions
|
|
188
|
+
Spinner
|
|
193
189
|
} from '@patternfly/react-core';
|
|
194
190
|
|
|
195
191
|
|
|
196
192
|
EmptyStateSpinner = () => {
|
|
197
|
-
const Spinner = () => (
|
|
198
|
-
<span className="pf-c-spinner" role="progressbar" aria-valuetext="Loading...">
|
|
199
|
-
<span className="pf-c-spinner__clipper" />
|
|
200
|
-
<span className="pf-c-spinner__lead-ball" />
|
|
201
|
-
<span className="pf-c-spinner__tail-ball" />
|
|
202
|
-
</span>
|
|
203
|
-
)
|
|
204
193
|
return (
|
|
205
194
|
<EmptyState>
|
|
206
195
|
<EmptyStateIcon variant="container" component={Spinner} />
|
|
@@ -221,8 +210,7 @@ import {
|
|
|
221
210
|
EmptyState,
|
|
222
211
|
EmptyStatePrimary,
|
|
223
212
|
EmptyStateIcon,
|
|
224
|
-
EmptyStateBody
|
|
225
|
-
EmptyStateSecondaryActions
|
|
213
|
+
EmptyStateBody
|
|
226
214
|
} from '@patternfly/react-core';
|
|
227
215
|
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
228
216
|
|
|
@@ -50,7 +50,7 @@ class SimpleInputGroups extends React.Component {
|
|
|
50
50
|
</InputGroup>
|
|
51
51
|
<br />
|
|
52
52
|
<InputGroup>
|
|
53
|
-
<InputGroupText id="username"
|
|
53
|
+
<InputGroupText id="username">
|
|
54
54
|
<AtIcon />
|
|
55
55
|
</InputGroupText>
|
|
56
56
|
<TextInput validated={ValidatedOptions.error} id="textInput7" type="email" aria-label="Error state username example" />
|
|
@@ -116,14 +116,10 @@ export class LabelGroup extends React.Component<LabelGroupProps, LabelGroupState
|
|
|
116
116
|
const { isTooltipVisible } = this.state;
|
|
117
117
|
return isTooltipVisible ? (
|
|
118
118
|
<Tooltip position={tooltipPosition} content={categoryName}>
|
|
119
|
-
<span
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
id={id}
|
|
124
|
-
aria-label={categoryName}
|
|
125
|
-
>
|
|
126
|
-
<span aria-hidden="true">{categoryName}</span>
|
|
119
|
+
<span tabIndex={0} ref={this.headingRef} className={css(styles.labelGroupLabel)}>
|
|
120
|
+
<span aria-hidden="true" id={id}>
|
|
121
|
+
{categoryName}
|
|
122
|
+
</span>
|
|
127
123
|
</span>
|
|
128
124
|
</Tooltip>
|
|
129
125
|
) : (
|
|
@@ -273,7 +273,6 @@ export const MenuItem: React.FunctionComponent<MenuItemProps> = ({
|
|
|
273
273
|
|
|
274
274
|
return (
|
|
275
275
|
<li
|
|
276
|
-
role="none"
|
|
277
276
|
className={css(
|
|
278
277
|
styles.menuListItem,
|
|
279
278
|
isDisabled && styles.modifiers.disabled,
|
|
@@ -283,21 +282,21 @@ export const MenuItem: React.FunctionComponent<MenuItemProps> = ({
|
|
|
283
282
|
className
|
|
284
283
|
)}
|
|
285
284
|
onMouseOver={onMouseOver}
|
|
286
|
-
tabIndex={-1}
|
|
287
285
|
{...(flyoutMenu && { onKeyDown: handleFlyout })}
|
|
288
286
|
ref={ref}
|
|
287
|
+
role="none"
|
|
289
288
|
{...props}
|
|
290
289
|
>
|
|
291
290
|
<Component
|
|
292
|
-
role="menuitem"
|
|
293
291
|
tabIndex={-1}
|
|
292
|
+
className={css(styles.menuItem, getIsSelected() && styles.modifiers.selected, className)}
|
|
293
|
+
aria-current={getAriaCurrent()}
|
|
294
|
+
disabled={isDisabled}
|
|
295
|
+
role="menuitem"
|
|
294
296
|
onClick={(event: any) => {
|
|
295
297
|
onItemSelect(event, onSelect);
|
|
296
298
|
_drill && _drill();
|
|
297
299
|
}}
|
|
298
|
-
className={css(styles.menuItem, getIsSelected() && styles.modifiers.selected, className)}
|
|
299
|
-
aria-current={getAriaCurrent()}
|
|
300
|
-
disabled={isDisabled}
|
|
301
300
|
{...additionalProps}
|
|
302
301
|
>
|
|
303
302
|
<span className={css(styles.menuItemMain)}>
|
|
@@ -14,7 +14,7 @@ export const MenuList: React.FunctionComponent<MenuListProps> = ({
|
|
|
14
14
|
className,
|
|
15
15
|
...props
|
|
16
16
|
}: MenuListProps) => (
|
|
17
|
-
<ul role="
|
|
17
|
+
<ul role="menu" className={css(styles.menuList, className)} {...props}>
|
|
18
18
|
{children}
|
|
19
19
|
</ul>
|
|
20
20
|
);
|
|
@@ -71,13 +71,13 @@ export const OptionsMenu: React.FunctionComponent<OptionsMenuProps> = ({
|
|
|
71
71
|
}}
|
|
72
72
|
>
|
|
73
73
|
<DropdownWithContext
|
|
74
|
-
{...props}
|
|
75
74
|
id={id}
|
|
76
75
|
dropdownItems={menuItems}
|
|
77
76
|
className={className}
|
|
78
77
|
isGrouped={isGrouped}
|
|
79
78
|
toggle={toggle}
|
|
80
79
|
menuAppendTo={menuAppendTo}
|
|
80
|
+
{...props}
|
|
81
81
|
/>
|
|
82
82
|
</DropdownContext.Provider>
|
|
83
83
|
);
|
|
@@ -19,9 +19,9 @@ export interface OptionsMenuToggleProps extends React.HTMLProps<HTMLButtonElemen
|
|
|
19
19
|
hideCaret?: boolean;
|
|
20
20
|
/** Provides an accessible name for the button when an icon is used instead of text */
|
|
21
21
|
'aria-label'?: string;
|
|
22
|
-
/** Internal function to implement enter click */
|
|
22
|
+
/** @hide Internal function to implement enter click */
|
|
23
23
|
onEnter?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
24
|
-
/** Internal parent reference */
|
|
24
|
+
/** @hide Internal parent reference */
|
|
25
25
|
parentRef?: HTMLElement;
|
|
26
26
|
/** Content to be rendered in the options menu toggle button */
|
|
27
27
|
toggleTemplate?: React.ReactNode;
|
|
@@ -26,12 +26,16 @@ export interface OptionsMenuToggleWithTextProps extends React.HTMLProps<HTMLDivE
|
|
|
26
26
|
isActive?: boolean;
|
|
27
27
|
/** Disables the options menu toggle */
|
|
28
28
|
isDisabled?: boolean;
|
|
29
|
-
/** Internal parent reference */
|
|
29
|
+
/** @hide Internal parent reference */
|
|
30
30
|
parentRef?: React.RefObject<HTMLElement>;
|
|
31
31
|
/** Indicates that the element has a popup context menu or sub-level menu */
|
|
32
32
|
'aria-haspopup'?: boolean | 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid';
|
|
33
33
|
/** Provides an accessible name for the button when an icon is used instead of text */
|
|
34
34
|
'aria-label'?: string;
|
|
35
|
+
/** @hide Display the toggle in text only mode. */
|
|
36
|
+
isText?: boolean;
|
|
37
|
+
/** @hide The menu element */
|
|
38
|
+
getMenuRef?: () => HTMLElement;
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
export const OptionsMenuToggleWithText: React.FunctionComponent<OptionsMenuToggleWithTextProps> = ({
|
|
@@ -43,11 +47,15 @@ export const OptionsMenuToggleWithText: React.FunctionComponent<OptionsMenuToggl
|
|
|
43
47
|
onToggle = () => null as any,
|
|
44
48
|
isOpen = false,
|
|
45
49
|
isPlain = false,
|
|
50
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
51
|
+
isText = true,
|
|
46
52
|
isDisabled = false,
|
|
47
53
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
48
54
|
isActive = false,
|
|
49
55
|
'aria-haspopup': ariaHasPopup,
|
|
50
56
|
parentRef,
|
|
57
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
58
|
+
getMenuRef,
|
|
51
59
|
onEnter,
|
|
52
60
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
53
61
|
'aria-label': ariaLabel = 'Options menu',
|
|
@@ -3320,9 +3320,7 @@ exports[`optionsMenu text 1`] = `
|
|
|
3320
3320
|
>
|
|
3321
3321
|
<div
|
|
3322
3322
|
className="pf-c-options-menu__toggle pf-m-text"
|
|
3323
|
-
getMenuRef={[Function]}
|
|
3324
3323
|
id="pf-dropdown-toggle-id-6"
|
|
3325
|
-
isText={false}
|
|
3326
3324
|
>
|
|
3327
3325
|
<span
|
|
3328
3326
|
className="pf-c-options-menu__toggle-text"
|