@patternfly/react-core 5.0.0-alpha.13 → 5.0.0-alpha.14
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 +4 -0
- package/components/Accordion/Accordion.d.ts.map +1 -1
- package/components/Accordion/Accordion.js +2 -2
- package/components/Accordion/Accordion.js.map +1 -1
- package/components/Alert/Alert.d.ts +0 -2
- package/components/Alert/Alert.d.ts.map +1 -1
- package/components/Alert/Alert.js +2 -2
- package/components/Alert/Alert.js.map +1 -1
- package/components/Menu/Menu.d.ts +0 -2
- package/components/Menu/Menu.d.ts.map +1 -1
- package/components/Menu/Menu.js +3 -3
- package/components/Menu/Menu.js.map +1 -1
- package/components/Menu/MenuItem.d.ts +1 -1
- package/components/Menu/MenuItem.d.ts.map +1 -1
- package/components/Menu/MenuItem.js +3 -3
- package/components/Menu/MenuItem.js.map +1 -1
- package/components/Menu/MenuList.d.ts +2 -0
- package/components/Menu/MenuList.d.ts.map +1 -1
- package/components/Menu/MenuList.js +2 -2
- package/components/Menu/MenuList.js.map +1 -1
- package/components/NumberInput/NumberInput.d.ts +0 -2
- package/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/components/NumberInput/NumberInput.js +1 -4
- package/components/NumberInput/NumberInput.js.map +1 -1
- package/components/Page/PageGroup.d.ts +1 -1
- package/components/Page/PageGroup.d.ts.map +1 -1
- package/components/Page/PageGroup.js +1 -1
- package/components/Page/PageGroup.js.map +1 -1
- package/components/Page/PageNavigation.d.ts +1 -1
- package/components/Page/PageNavigation.d.ts.map +1 -1
- package/components/Page/PageNavigation.js +1 -1
- package/components/Page/PageNavigation.js.map +1 -1
- package/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
- package/components/ProgressStepper/ProgressStep.js +3 -1
- package/components/ProgressStepper/ProgressStep.js.map +1 -1
- package/components/Wizard/Wizard.d.ts +6 -2
- package/components/Wizard/Wizard.d.ts.map +1 -1
- package/components/Wizard/Wizard.js.map +1 -1
- package/components/Wizard/WizardBody.d.ts +6 -2
- package/components/Wizard/WizardBody.d.ts.map +1 -1
- package/components/Wizard/WizardBody.js +28 -1
- package/components/Wizard/WizardBody.js.map +1 -1
- package/components/Wizard/WizardToggle.d.ts +6 -2
- package/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/esm/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/esm/components/Accordion/Accordion.js +2 -2
- package/dist/esm/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/Alert/Alert.d.ts +0 -2
- package/dist/esm/components/Alert/Alert.d.ts.map +1 -1
- package/dist/esm/components/Alert/Alert.js +2 -2
- package/dist/esm/components/Alert/Alert.js.map +1 -1
- package/dist/esm/components/Menu/Menu.d.ts +0 -2
- package/dist/esm/components/Menu/Menu.d.ts.map +1 -1
- package/dist/esm/components/Menu/Menu.js +3 -3
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.d.ts +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.d.ts +2 -0
- package/dist/esm/components/Menu/MenuList.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuList.js +2 -2
- package/dist/esm/components/Menu/MenuList.js.map +1 -1
- package/dist/esm/components/NumberInput/NumberInput.d.ts +0 -2
- package/dist/esm/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/esm/components/NumberInput/NumberInput.js +1 -4
- package/dist/esm/components/NumberInput/NumberInput.js.map +1 -1
- package/dist/esm/components/Page/PageGroup.d.ts +1 -1
- package/dist/esm/components/Page/PageGroup.d.ts.map +1 -1
- package/dist/esm/components/Page/PageGroup.js +1 -1
- package/dist/esm/components/Page/PageGroup.js.map +1 -1
- package/dist/esm/components/Page/PageNavigation.d.ts +1 -1
- package/dist/esm/components/Page/PageNavigation.d.ts.map +1 -1
- package/dist/esm/components/Page/PageNavigation.js +1 -1
- package/dist/esm/components/Page/PageNavigation.js.map +1 -1
- package/dist/esm/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
- package/dist/esm/components/ProgressStepper/ProgressStep.js +3 -1
- package/dist/esm/components/ProgressStepper/ProgressStep.js.map +1 -1
- package/dist/esm/components/Wizard/Wizard.d.ts +6 -2
- package/dist/esm/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/esm/components/Wizard/Wizard.js.map +1 -1
- package/dist/esm/components/Wizard/WizardBody.d.ts +6 -2
- package/dist/esm/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardBody.js +28 -1
- package/dist/esm/components/Wizard/WizardBody.js.map +1 -1
- package/dist/esm/components/Wizard/WizardToggle.d.ts +6 -2
- package/dist/esm/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardBody.d.ts +7 -3
- package/dist/esm/next/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardBody.js +35 -2
- package/dist/esm/next/components/Wizard/WizardBody.js.map +1 -1
- package/dist/js/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/js/components/Accordion/Accordion.js +2 -2
- package/dist/js/components/Accordion/Accordion.js.map +1 -1
- package/dist/js/components/Alert/Alert.d.ts +0 -2
- package/dist/js/components/Alert/Alert.d.ts.map +1 -1
- package/dist/js/components/Alert/Alert.js +2 -2
- package/dist/js/components/Alert/Alert.js.map +1 -1
- package/dist/js/components/Menu/Menu.d.ts +0 -2
- package/dist/js/components/Menu/Menu.d.ts.map +1 -1
- package/dist/js/components/Menu/Menu.js +3 -3
- package/dist/js/components/Menu/Menu.js.map +1 -1
- package/dist/js/components/Menu/MenuItem.d.ts +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.d.ts +2 -0
- package/dist/js/components/Menu/MenuList.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuList.js +2 -2
- package/dist/js/components/Menu/MenuList.js.map +1 -1
- package/dist/js/components/NumberInput/NumberInput.d.ts +0 -2
- package/dist/js/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/js/components/NumberInput/NumberInput.js +1 -4
- package/dist/js/components/NumberInput/NumberInput.js.map +1 -1
- package/dist/js/components/Page/PageGroup.d.ts +1 -1
- package/dist/js/components/Page/PageGroup.d.ts.map +1 -1
- package/dist/js/components/Page/PageGroup.js +1 -1
- package/dist/js/components/Page/PageGroup.js.map +1 -1
- package/dist/js/components/Page/PageNavigation.d.ts +1 -1
- package/dist/js/components/Page/PageNavigation.d.ts.map +1 -1
- package/dist/js/components/Page/PageNavigation.js +1 -1
- package/dist/js/components/Page/PageNavigation.js.map +1 -1
- package/dist/js/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
- package/dist/js/components/ProgressStepper/ProgressStep.js +3 -1
- package/dist/js/components/ProgressStepper/ProgressStep.js.map +1 -1
- package/dist/js/components/Wizard/Wizard.d.ts +6 -2
- package/dist/js/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/js/components/Wizard/Wizard.js.map +1 -1
- package/dist/js/components/Wizard/WizardBody.d.ts +6 -2
- package/dist/js/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardBody.js +28 -1
- package/dist/js/components/Wizard/WizardBody.js.map +1 -1
- package/dist/js/components/Wizard/WizardToggle.d.ts +6 -2
- package/dist/js/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardBody.d.ts +7 -3
- package/dist/js/next/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardBody.js +35 -2
- package/dist/js/next/components/Wizard/WizardBody.js.map +1 -1
- package/dist/umd/react-core.min.js +1 -1
- package/next/components/Wizard/WizardBody.d.ts +7 -3
- package/next/components/Wizard/WizardBody.d.ts.map +1 -1
- package/next/components/Wizard/WizardBody.js +35 -2
- package/next/components/Wizard/WizardBody.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Accordion/Accordion.tsx +2 -1
- package/src/components/Alert/Alert.tsx +0 -4
- package/src/components/Alert/__tests__/Alert.test.tsx +33 -25
- package/src/components/Menu/Menu.tsx +0 -4
- package/src/components/Menu/MenuItem.tsx +4 -2
- package/src/components/Menu/MenuList.tsx +4 -0
- package/src/components/NumberInput/NumberInput.tsx +0 -6
- package/src/components/NumberInput/__tests__/NumberInput.test.tsx +0 -6
- package/src/components/NumberInput/examples/NumberInputCustomStep.tsx +0 -1
- package/src/components/NumberInput/examples/NumberInputCustomStepAndThreshold.tsx +0 -1
- package/src/components/NumberInput/examples/NumberInputDefault.tsx +0 -1
- package/src/components/NumberInput/examples/NumberInputDisabled.tsx +0 -1
- package/src/components/NumberInput/examples/NumberInputUnit.tsx +0 -2
- package/src/components/NumberInput/examples/NumberInputUnitThreshold.tsx +0 -1
- package/src/components/NumberInput/examples/NumberInputVaryingSizes.tsx +0 -4
- package/src/components/NumberInput/examples/NumberInputWithStatus.tsx +0 -1
- package/src/components/Page/PageGroup.tsx +2 -3
- package/src/components/Page/PageNavigation.tsx +2 -3
- package/src/components/Page/__tests__/Page.test.tsx +6 -1
- package/src/components/Page/__tests__/PageGroup.test.tsx +5 -1
- package/src/components/Page/__tests__/PageNavigation.test.tsx +5 -1
- package/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap +3 -1
- package/src/components/Page/__tests__/__snapshots__/PageGroup.test.tsx.snap +1 -0
- package/src/components/Page/__tests__/__snapshots__/PageNavigation.test.tsx.snap +1 -0
- package/src/components/ProgressStepper/ProgressStep.tsx +3 -1
- package/src/components/ProgressStepper/__tests__/ProgressStep.test.tsx +2 -2
- package/src/components/Wizard/Wizard.tsx +6 -2
- package/src/components/Wizard/WizardBody.tsx +46 -3
- package/src/components/Wizard/WizardToggle.tsx +6 -2
- package/src/components/Wizard/__tests__/Generated/__snapshots__/WizardBody.test.tsx.snap +0 -2
- package/src/components/Wizard/__tests__/Generated/__snapshots__/WizardToggle.test.tsx.snap +0 -2
- package/src/components/Wizard/__tests__/Wizard.test.tsx +70 -132
- package/src/components/Wizard/__tests__/__snapshots__/Wizard.test.tsx.snap +0 -2
- package/src/components/Wizard/examples/WizardBasic.tsx +26 -1
- package/src/demos/examples/AlertGroup/AlertGroupToastWithNotificationDrawer.tsx +0 -1
- package/src/next/components/Wizard/WizardBody.tsx +57 -8
- package/src/next/components/Wizard/__tests__/WizardBody.test.tsx +0 -10
- package/src/next/components/Wizard/examples/Wizard.md +1 -1
- package/src/next/components/Wizard/examples/WizardBasic.tsx +19 -1
- package/src/next/components/Wizard/examples/WizardKitchenSink.tsx +0 -236
|
@@ -6,15 +6,19 @@ export interface WizardBodyProps {
|
|
|
6
6
|
children: React.ReactNode | React.ReactNode[];
|
|
7
7
|
/** Set to true to remove the default body padding */
|
|
8
8
|
hasNoPadding?: boolean;
|
|
9
|
-
/**
|
|
9
|
+
/** Adds an accessible name to the wrapper element when the content overflows and renders
|
|
10
|
+
* a scrollbar.
|
|
11
|
+
*/
|
|
10
12
|
'aria-label'?: string;
|
|
11
|
-
/**
|
|
13
|
+
/** Adds an accessible name to the wrapper element by passing the the id of one or more elements.
|
|
14
|
+
* The aria-labelledby will only be applied when the content overflows and renders a scrollbar.
|
|
15
|
+
*/
|
|
12
16
|
'aria-labelledby'?: string;
|
|
13
17
|
/** Component used as the wrapping content container */
|
|
14
18
|
component?: React.ElementType;
|
|
15
19
|
}
|
|
16
20
|
export declare const WizardBody: {
|
|
17
|
-
({ children, hasNoPadding, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, component
|
|
21
|
+
({ children, hasNoPadding, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, component }: WizardBodyProps): JSX.Element;
|
|
18
22
|
displayName: string;
|
|
19
23
|
};
|
|
20
24
|
//# sourceMappingURL=WizardBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardBody.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardBody.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B;;GAEG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;IAC9C,qDAAqD;IACrD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uDAAuD;IACvD,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;CAC/B;AAED,eAAO,MAAM,UAAU;wGAMpB,eAAe;;CA8CjB,CAAC"}
|
|
@@ -1,7 +1,40 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { WizardContext } from './WizardContext';
|
|
5
|
+
import { debounce } from '../../../helpers/util';
|
|
6
|
+
import { getResizeObserver } from '../../../helpers/resizeObserver';
|
|
7
|
+
export const WizardBody = ({ children, hasNoPadding = false, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, component = 'div' }) => {
|
|
8
|
+
const [hasScrollbar, setHasScrollbar] = React.useState(false);
|
|
9
|
+
const [previousWidth, setPreviousWidth] = React.useState(undefined);
|
|
10
|
+
const wrapperRef = React.useRef(null);
|
|
11
|
+
const WrapperComponent = component;
|
|
12
|
+
const { activeStep } = React.useContext(WizardContext);
|
|
13
|
+
const defaultAriaLabel = ariaLabel || `${activeStep === null || activeStep === void 0 ? void 0 : activeStep.name} content`;
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
const resize = () => {
|
|
16
|
+
if (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current) {
|
|
17
|
+
const { offsetWidth, offsetHeight, scrollHeight } = wrapperRef.current;
|
|
18
|
+
if (previousWidth !== offsetWidth) {
|
|
19
|
+
setPreviousWidth(offsetWidth);
|
|
20
|
+
setHasScrollbar(offsetHeight < scrollHeight);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const handleResizeWithDelay = debounce(resize, 250);
|
|
25
|
+
let observer = () => { };
|
|
26
|
+
if (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current) {
|
|
27
|
+
observer = getResizeObserver(wrapperRef.current, handleResizeWithDelay);
|
|
28
|
+
const { offsetHeight, scrollHeight } = wrapperRef.current;
|
|
29
|
+
setHasScrollbar(offsetHeight < scrollHeight);
|
|
30
|
+
setPreviousWidth(wrapperRef.current.offsetWidth);
|
|
31
|
+
}
|
|
32
|
+
return () => {
|
|
33
|
+
observer();
|
|
34
|
+
};
|
|
35
|
+
}, []);
|
|
36
|
+
return (React.createElement(WrapperComponent, Object.assign({ ref: wrapperRef }, (component === 'div' && hasScrollbar && { role: 'region' }), (hasScrollbar && { 'aria-label': defaultAriaLabel, 'aria-labelledby': ariaLabelledBy, tabIndex: 0 }), { className: css(styles.wizardMain) }),
|
|
37
|
+
React.createElement("div", { className: css(styles.wizardMainBody, hasNoPadding && styles.modifiers.noPadding) }, children)));
|
|
38
|
+
};
|
|
6
39
|
WizardBody.displayName = 'WizardBody';
|
|
7
40
|
//# sourceMappingURL=WizardBody.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardBody.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,MAAM,MAAM,uDAAuD,CAAC;AAC3E,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardBody.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardBody.tsx"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.14",
|
|
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",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"react": "^16.8 || ^17 || ^18",
|
|
71
71
|
"react-dom": "^16.8 || ^17 || ^18"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "15626ee299af769871fd0852efd69373fa1e49b5"
|
|
74
74
|
}
|
|
@@ -23,7 +23,7 @@ export interface AccordionProps extends React.HTMLProps<HTMLDListElement> {
|
|
|
23
23
|
export const Accordion: React.FunctionComponent<AccordionProps> = ({
|
|
24
24
|
children = null,
|
|
25
25
|
className = '',
|
|
26
|
-
'aria-label': ariaLabel
|
|
26
|
+
'aria-label': ariaLabel,
|
|
27
27
|
headingLevel = 'h3',
|
|
28
28
|
asDefinitionList = true,
|
|
29
29
|
isBordered = false,
|
|
@@ -40,6 +40,7 @@ export const Accordion: React.FunctionComponent<AccordionProps> = ({
|
|
|
40
40
|
className
|
|
41
41
|
)}
|
|
42
42
|
aria-label={ariaLabel}
|
|
43
|
+
{...(!asDefinitionList && ariaLabel && { role: 'region' })}
|
|
43
44
|
{...props}
|
|
44
45
|
>
|
|
45
46
|
<AccordionContext.Provider
|
|
@@ -27,8 +27,6 @@ export interface AlertProps extends Omit<React.HTMLProps<HTMLDivElement>, 'actio
|
|
|
27
27
|
* or React.Fragment.
|
|
28
28
|
*/
|
|
29
29
|
actionLinks?: React.ReactNode;
|
|
30
|
-
/** Adds accessible text to the alert. */
|
|
31
|
-
'aria-label'?: string;
|
|
32
30
|
/** Content rendered inside the alert. */
|
|
33
31
|
children?: React.ReactNode;
|
|
34
32
|
/** Additional classes to add to the alert. */
|
|
@@ -97,7 +95,6 @@ export const Alert: React.FunctionComponent<AlertProps> = ({
|
|
|
97
95
|
isPlain = false,
|
|
98
96
|
isLiveRegion = false,
|
|
99
97
|
variantLabel = `${capitalize(variant)} alert:`,
|
|
100
|
-
'aria-label': ariaLabel = `${capitalize(variant)} Alert`,
|
|
101
98
|
actionClose,
|
|
102
99
|
actionLinks,
|
|
103
100
|
title,
|
|
@@ -229,7 +226,6 @@ export const Alert: React.FunctionComponent<AlertProps> = ({
|
|
|
229
226
|
styles.modifiers[variant as 'success' | 'danger' | 'warning' | 'info'],
|
|
230
227
|
className
|
|
231
228
|
)}
|
|
232
|
-
aria-label={ariaLabel}
|
|
233
229
|
{...ouiaProps}
|
|
234
230
|
{...(isLiveRegion && {
|
|
235
231
|
'aria-live': 'polite',
|
|
@@ -48,13 +48,9 @@ test('Renders with class pf-c-alert__title on the div containing the title', ()
|
|
|
48
48
|
expect(screen.getByRole('heading', { name: 'Default alert: Some title' })).toHaveClass('pf-c-alert__title');
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
test('Renders with
|
|
52
|
-
render(
|
|
53
|
-
|
|
54
|
-
Some alert
|
|
55
|
-
</Alert>
|
|
56
|
-
);
|
|
57
|
-
expect(screen.getByTestId('Alert-test-id')).toHaveAccessibleName('Default Alert');
|
|
51
|
+
test('Renders with default hidden text of "Default alert:"', () => {
|
|
52
|
+
render(<Alert title="Some title">Some alert</Alert>);
|
|
53
|
+
expect(screen.getByText('Default alert:')).toBeInTheDocument();
|
|
58
54
|
});
|
|
59
55
|
|
|
60
56
|
['success', 'danger', 'warning', 'info'].forEach(variant => {
|
|
@@ -76,13 +72,13 @@ test('Renders with a default aria label of Default Alert', () => {
|
|
|
76
72
|
expect(screen.getByTestId('Alert-test-id')).toHaveClass(`pf-m-${variant}`);
|
|
77
73
|
});
|
|
78
74
|
|
|
79
|
-
test(`Renders with
|
|
75
|
+
test(`Renders with hidden text "${capitalize(variant)} alert:" when variant = ${variant}`, () => {
|
|
80
76
|
render(
|
|
81
77
|
<Alert variant={`${variant as AlertVariant}`} title="Some title" data-testid="Alert-test-id">
|
|
82
78
|
Some alert
|
|
83
79
|
</Alert>
|
|
84
80
|
);
|
|
85
|
-
expect(screen.
|
|
81
|
+
expect(screen.getByText(`${capitalize(variant)} alert:`)).toBeInTheDocument();
|
|
86
82
|
});
|
|
87
83
|
|
|
88
84
|
test(`Renders the title with an accessible name of '${capitalize(
|
|
@@ -136,31 +132,39 @@ test('Renders with a default aria label of Default Alert', () => {
|
|
|
136
132
|
});
|
|
137
133
|
|
|
138
134
|
test('Does not render with class pf-m-inline by default', () => {
|
|
139
|
-
render(
|
|
140
|
-
|
|
135
|
+
render(
|
|
136
|
+
<Alert title="Some title" data-testid="Alert-test-id">
|
|
137
|
+
Some alert
|
|
138
|
+
</Alert>
|
|
139
|
+
);
|
|
140
|
+
expect(screen.getByTestId('Alert-test-id')).not.toHaveClass('pf-m-inline');
|
|
141
141
|
});
|
|
142
142
|
|
|
143
143
|
test('Renders with class pf-m-inline when isInline = true', () => {
|
|
144
144
|
render(
|
|
145
|
-
<Alert isInline title="Some title">
|
|
145
|
+
<Alert isInline title="Some title" data-testid="Alert-test-id">
|
|
146
146
|
Some alert
|
|
147
147
|
</Alert>
|
|
148
148
|
);
|
|
149
|
-
expect(screen.
|
|
149
|
+
expect(screen.getByTestId('Alert-test-id')).toHaveClass('pf-m-inline');
|
|
150
150
|
});
|
|
151
151
|
|
|
152
152
|
test('Does not render with class pf-m-plain by default', () => {
|
|
153
|
-
render(
|
|
154
|
-
|
|
153
|
+
render(
|
|
154
|
+
<Alert title="Some title" data-testid="Alert-test-id">
|
|
155
|
+
Some alert
|
|
156
|
+
</Alert>
|
|
157
|
+
);
|
|
158
|
+
expect(screen.getByTestId('Alert-test-id')).not.toHaveClass('pf-m-plain');
|
|
155
159
|
});
|
|
156
160
|
|
|
157
161
|
test('Renders with class pf-m-plain when isPlain = true', () => {
|
|
158
162
|
render(
|
|
159
|
-
<Alert isPlain title="Some title">
|
|
163
|
+
<Alert isPlain title="Some title" data-testid="Alert-test-id">
|
|
160
164
|
Some alert
|
|
161
165
|
</Alert>
|
|
162
166
|
);
|
|
163
|
-
expect(screen.
|
|
167
|
+
expect(screen.getByTestId('Alert-test-id')).toHaveClass('pf-m-plain');
|
|
164
168
|
});
|
|
165
169
|
|
|
166
170
|
test('Renders the title', () => {
|
|
@@ -588,17 +592,21 @@ test('Passes customIcon value to AlertIcon', () => {
|
|
|
588
592
|
});
|
|
589
593
|
|
|
590
594
|
test('Does not render with class pf-m-expandable by default', () => {
|
|
591
|
-
render(
|
|
592
|
-
|
|
595
|
+
render(
|
|
596
|
+
<Alert title="Some title" data-testid="Alert-test-id">
|
|
597
|
+
Some alert
|
|
598
|
+
</Alert>
|
|
599
|
+
);
|
|
600
|
+
expect(screen.getByTestId('Alert-test-id')).not.toHaveClass('pf-m-expandable');
|
|
593
601
|
});
|
|
594
602
|
|
|
595
603
|
test('Renders with class pf-m-expandable when isExpandable = true', () => {
|
|
596
604
|
render(
|
|
597
|
-
<Alert isExpandable title="Some title">
|
|
605
|
+
<Alert isExpandable title="Some title" data-testid="Alert-test-id">
|
|
598
606
|
Some alert
|
|
599
607
|
</Alert>
|
|
600
608
|
);
|
|
601
|
-
expect(screen.
|
|
609
|
+
expect(screen.getByTestId('Alert-test-id')).toHaveClass('pf-m-expandable');
|
|
602
610
|
});
|
|
603
611
|
|
|
604
612
|
test('Renders AlertToggleExpandButton inside pf-c-alert__toggle', () => {
|
|
@@ -613,26 +621,26 @@ test('Renders AlertToggleExpandButton inside pf-c-alert__toggle', () => {
|
|
|
613
621
|
|
|
614
622
|
test('Does not render with class pf-m-expanded when AlertToggleExpandButton has not been clicked', () => {
|
|
615
623
|
render(
|
|
616
|
-
<Alert isExpandable title="Some title">
|
|
624
|
+
<Alert isExpandable title="Some title" data-testid="Alert-test-id">
|
|
617
625
|
Some alert
|
|
618
626
|
</Alert>
|
|
619
627
|
);
|
|
620
628
|
|
|
621
|
-
expect(screen.
|
|
629
|
+
expect(screen.getByTestId('Alert-test-id')).not.toHaveClass('pf-m-expanded');
|
|
622
630
|
});
|
|
623
631
|
|
|
624
632
|
test('Renders with class pf-m-expanded once the AlertToggleExpandButton is clicked', async () => {
|
|
625
633
|
const user = userEvent.setup();
|
|
626
634
|
|
|
627
635
|
render(
|
|
628
|
-
<Alert isExpandable title="Some title">
|
|
636
|
+
<Alert isExpandable title="Some title" data-testid="Alert-test-id">
|
|
629
637
|
Some alert
|
|
630
638
|
</Alert>
|
|
631
639
|
);
|
|
632
640
|
|
|
633
641
|
await user.click(screen.getByRole('button'));
|
|
634
642
|
|
|
635
|
-
expect(screen.
|
|
643
|
+
expect(screen.getByTestId('Alert-test-id')).toHaveClass('pf-m-expanded');
|
|
636
644
|
});
|
|
637
645
|
|
|
638
646
|
test('Does not render children when isExpandable = true and AlertToggleExpandButton has not been clicked', () => {
|
|
@@ -25,8 +25,6 @@ export interface MenuProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'r
|
|
|
25
25
|
event: React.FormEvent<HTMLInputElement> | React.SyntheticEvent<HTMLButtonElement>,
|
|
26
26
|
value: string
|
|
27
27
|
) => void;
|
|
28
|
-
/** Accessibility label */
|
|
29
|
-
'aria-label'?: string;
|
|
30
28
|
/** @beta Indicates if menu contains a flyout menu */
|
|
31
29
|
containsFlyout?: boolean;
|
|
32
30
|
/** @beta Indicating that the menu should have nav flyout styling */
|
|
@@ -250,7 +248,6 @@ class MenuBase extends React.Component<MenuProps, MenuState> {
|
|
|
250
248
|
|
|
251
249
|
render() {
|
|
252
250
|
const {
|
|
253
|
-
'aria-label': ariaLabel,
|
|
254
251
|
id,
|
|
255
252
|
children,
|
|
256
253
|
className,
|
|
@@ -339,7 +336,6 @@ class MenuBase extends React.Component<MenuProps, MenuState> {
|
|
|
339
336
|
_isMenuDrilledIn && styles.modifiers.drilledIn,
|
|
340
337
|
className
|
|
341
338
|
)}
|
|
342
|
-
aria-label={ariaLabel}
|
|
343
339
|
ref={this.menuRef}
|
|
344
340
|
{...getOUIAProps(Menu.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe)}
|
|
345
341
|
{...props}
|
|
@@ -64,7 +64,7 @@ export interface MenuItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'onC
|
|
|
64
64
|
direction?: 'down' | 'up';
|
|
65
65
|
/** @beta True if item is on current selection path */
|
|
66
66
|
isOnPath?: boolean;
|
|
67
|
-
/**
|
|
67
|
+
/** Adds an accessible name to the menu item. */
|
|
68
68
|
'aria-label'?: string;
|
|
69
69
|
/** @hide Forwarded ref */
|
|
70
70
|
innerRef?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;
|
|
@@ -103,6 +103,7 @@ const MenuItemBase: React.FunctionComponent<MenuItemProps> = ({
|
|
|
103
103
|
isOnPath,
|
|
104
104
|
innerRef,
|
|
105
105
|
id,
|
|
106
|
+
'aria-label': ariaLabel,
|
|
106
107
|
...props
|
|
107
108
|
}: MenuItemProps) => {
|
|
108
109
|
const {
|
|
@@ -312,6 +313,7 @@ const MenuItemBase: React.FunctionComponent<MenuItemProps> = ({
|
|
|
312
313
|
{...(flyoutMenu && { onKeyDown: handleFlyout })}
|
|
313
314
|
ref={ref}
|
|
314
315
|
role={!hasCheckbox ? 'none' : 'menuitem'}
|
|
316
|
+
{...(hasCheckbox && { 'aria-label': ariaLabel })}
|
|
315
317
|
{...props}
|
|
316
318
|
>
|
|
317
319
|
<GenerateId>
|
|
@@ -321,7 +323,7 @@ const MenuItemBase: React.FunctionComponent<MenuItemProps> = ({
|
|
|
321
323
|
tabIndex={-1}
|
|
322
324
|
className={css(styles.menuItem, getIsSelected() && !hasCheckbox && styles.modifiers.selected, className)}
|
|
323
325
|
aria-current={getAriaCurrent()}
|
|
324
|
-
{...(!hasCheckbox && { disabled: isDisabled })}
|
|
326
|
+
{...(!hasCheckbox && { disabled: isDisabled, 'aria-label': ariaLabel })}
|
|
325
327
|
{...(!hasCheckbox && !flyoutMenu && { role: isSelectMenu ? 'option' : 'menuitem' })}
|
|
326
328
|
{...(!hasCheckbox && !flyoutMenu && isSelectMenu && { 'aria-selected': getIsSelected() })}
|
|
327
329
|
ref={innerRef}
|
|
@@ -12,12 +12,15 @@ export interface MenuListProps extends React.HTMLProps<HTMLUListElement> {
|
|
|
12
12
|
* for a non-checkbox menu. Only applies when the menu's role is "listbox".
|
|
13
13
|
*/
|
|
14
14
|
isAriaMultiselectable?: boolean;
|
|
15
|
+
/** Adds an accessible name to the menu. */
|
|
16
|
+
'aria-label'?: string;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export const MenuList: React.FunctionComponent<MenuListProps> = ({
|
|
18
20
|
children = null,
|
|
19
21
|
className,
|
|
20
22
|
isAriaMultiselectable = false,
|
|
23
|
+
'aria-label': ariaLabel,
|
|
21
24
|
...props
|
|
22
25
|
}: MenuListProps) => {
|
|
23
26
|
const { role } = React.useContext(MenuContext);
|
|
@@ -27,6 +30,7 @@ export const MenuList: React.FunctionComponent<MenuListProps> = ({
|
|
|
27
30
|
role={role}
|
|
28
31
|
{...(role === 'listbox' && { 'aria-multiselectable': isAriaMultiselectable })}
|
|
29
32
|
className={css(styles.menuList, className)}
|
|
33
|
+
aria-label={ariaLabel}
|
|
30
34
|
{...props}
|
|
31
35
|
>
|
|
32
36
|
{children}
|
|
@@ -51,8 +51,6 @@ export interface NumberInputProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
51
51
|
minusBtnProps?: ButtonProps;
|
|
52
52
|
/** Additional properties added to the plus button */
|
|
53
53
|
plusBtnProps?: ButtonProps;
|
|
54
|
-
/** Allow the user to clear out the input to an empty string (recommended) */
|
|
55
|
-
allowEmptyInput?: boolean;
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
type DefaultKeyDownHandlerArgs = Pick<NumberInputProps, 'inputName' | 'onMinus' | 'onPlus'>;
|
|
@@ -89,12 +87,8 @@ export const NumberInput: React.FunctionComponent<NumberInputProps> = ({
|
|
|
89
87
|
inputProps,
|
|
90
88
|
minusBtnProps,
|
|
91
89
|
plusBtnProps,
|
|
92
|
-
allowEmptyInput = false,
|
|
93
90
|
...props
|
|
94
91
|
}: NumberInputProps) => {
|
|
95
|
-
if (!allowEmptyInput) {
|
|
96
|
-
value = value || 0;
|
|
97
|
-
}
|
|
98
92
|
const numberInputUnit = <div className={css(styles.numberInputUnit)}>{unit}</div>;
|
|
99
93
|
const keyDownHandler =
|
|
100
94
|
inputProps && inputProps.onKeyDown ? inputProps.onKeyDown : defaultKeyDownHandler({ inputName, onMinus, onPlus });
|
|
@@ -210,12 +210,6 @@ describe('numberInput', () => {
|
|
|
210
210
|
test('renders 0 if null value passed', () => {
|
|
211
211
|
render(<NumberInput value={null} />);
|
|
212
212
|
const input = screen.getByRole('spinbutton');
|
|
213
|
-
expect(input).toHaveDisplayValue('0');
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
test('renders nothing if null value passed with allow empty', () => {
|
|
217
|
-
render(<NumberInput allowEmptyInput value={null} />);
|
|
218
|
-
const input = screen.getByRole('spinbutton');
|
|
219
213
|
expect(input).toHaveDisplayValue('');
|
|
220
214
|
});
|
|
221
215
|
|
|
@@ -37,7 +37,6 @@ export const NumberInputUnit: React.FunctionComponent = () => {
|
|
|
37
37
|
minusBtnAriaLabel="minus 1"
|
|
38
38
|
plusBtnAriaLabel="plus 1"
|
|
39
39
|
unit="%"
|
|
40
|
-
allowEmptyInput
|
|
41
40
|
/>
|
|
42
41
|
<br />
|
|
43
42
|
<br />
|
|
@@ -52,7 +51,6 @@ export const NumberInputUnit: React.FunctionComponent = () => {
|
|
|
52
51
|
plusBtnAriaLabel="plus 0.01"
|
|
53
52
|
unit="$"
|
|
54
53
|
unitPosition="before"
|
|
55
|
-
allowEmptyInput
|
|
56
54
|
/>
|
|
57
55
|
</React.Fragment>
|
|
58
56
|
);
|
|
@@ -35,7 +35,6 @@ export const NumberInputVaryingSizes: React.FunctionComponent = () => {
|
|
|
35
35
|
minusBtnAriaLabel="input 2 minus"
|
|
36
36
|
plusBtnAriaLabel="input 2 plus"
|
|
37
37
|
widthChars={1}
|
|
38
|
-
allowEmptyInput
|
|
39
38
|
/>
|
|
40
39
|
<br />
|
|
41
40
|
<br />
|
|
@@ -49,7 +48,6 @@ export const NumberInputVaryingSizes: React.FunctionComponent = () => {
|
|
|
49
48
|
minusBtnAriaLabel="input 2 minus"
|
|
50
49
|
plusBtnAriaLabel="input 2 plus"
|
|
51
50
|
widthChars={10}
|
|
52
|
-
allowEmptyInput
|
|
53
51
|
/>
|
|
54
52
|
<br />
|
|
55
53
|
<br />
|
|
@@ -63,7 +61,6 @@ export const NumberInputVaryingSizes: React.FunctionComponent = () => {
|
|
|
63
61
|
minusBtnAriaLabel="input 3 minus"
|
|
64
62
|
plusBtnAriaLabel="input 3 plus"
|
|
65
63
|
widthChars={5}
|
|
66
|
-
allowEmptyInput
|
|
67
64
|
/>
|
|
68
65
|
<br />
|
|
69
66
|
<br />
|
|
@@ -77,7 +74,6 @@ export const NumberInputVaryingSizes: React.FunctionComponent = () => {
|
|
|
77
74
|
minusBtnAriaLabel="input 4 minus"
|
|
78
75
|
plusBtnAriaLabel="input 4 plus"
|
|
79
76
|
widthChars={5}
|
|
80
|
-
allowEmptyInput
|
|
81
77
|
/>
|
|
82
78
|
</React.Fragment>
|
|
83
79
|
);
|
|
@@ -23,7 +23,7 @@ export interface PageGroupProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
23
23
|
hasShadowBottom?: boolean;
|
|
24
24
|
/** Flag indicating if the PageGroup has a scrolling overflow */
|
|
25
25
|
hasOverflowScroll?: boolean;
|
|
26
|
-
/** Adds an accessible name to the page group
|
|
26
|
+
/** Adds an accessible name to the page group when the hasOverflowScroll prop is set to true. */
|
|
27
27
|
'aria-label'?: string;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -57,8 +57,7 @@ export const PageGroup = ({
|
|
|
57
57
|
hasOverflowScroll && styles.modifiers.overflowScroll,
|
|
58
58
|
className
|
|
59
59
|
)}
|
|
60
|
-
{...(hasOverflowScroll && { tabIndex: 0 })}
|
|
61
|
-
aria-label={ariaLabel}
|
|
60
|
+
{...(hasOverflowScroll && { tabIndex: 0, role: 'region', 'aria-label': ariaLabel })}
|
|
62
61
|
>
|
|
63
62
|
{children}
|
|
64
63
|
</div>
|
|
@@ -26,7 +26,7 @@ export interface PageNavigationProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
26
26
|
hasShadowBottom?: boolean;
|
|
27
27
|
/** Flag indicating if the PageNavigation has a scrolling overflow */
|
|
28
28
|
hasOverflowScroll?: boolean;
|
|
29
|
-
/** Adds an accessible name to the page navigation
|
|
29
|
+
/** Adds an accessible name to the page navigation when the hasOverflowScroll prop is set to true. */
|
|
30
30
|
'aria-label'?: string;
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -61,8 +61,7 @@ export const PageNavigation = ({
|
|
|
61
61
|
hasOverflowScroll && styles.modifiers.overflowScroll,
|
|
62
62
|
className
|
|
63
63
|
)}
|
|
64
|
-
{...(hasOverflowScroll && { tabIndex: 0 })}
|
|
65
|
-
aria-label={ariaLabel}
|
|
64
|
+
{...(hasOverflowScroll && { tabIndex: 0, role: 'region', 'aria-label': ariaLabel })}
|
|
66
65
|
{...props}
|
|
67
66
|
>
|
|
68
67
|
{isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
|
|
@@ -356,7 +356,12 @@ describe('Page', () => {
|
|
|
356
356
|
tertiaryNav={nav}
|
|
357
357
|
isBreadcrumbGrouped
|
|
358
358
|
isTertiaryNavGrouped
|
|
359
|
-
groupProps={{
|
|
359
|
+
groupProps={{
|
|
360
|
+
stickyOnBreakpoint: { default: 'bottom' },
|
|
361
|
+
hasShadowTop: true,
|
|
362
|
+
hasOverflowScroll: true,
|
|
363
|
+
'aria-label': 'test'
|
|
364
|
+
}}
|
|
360
365
|
>
|
|
361
366
|
<PageSection variant="default">Section with default background</PageSection>
|
|
362
367
|
<PageSection variant="light">Section with light background</PageSection>
|
|
@@ -35,7 +35,11 @@ describe('page group', () => {
|
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
test('Renders with the passed aria-label applied', () => {
|
|
38
|
-
render(
|
|
38
|
+
render(
|
|
39
|
+
<PageGroup aria-label="Test label" hasOverflowScroll>
|
|
40
|
+
test
|
|
41
|
+
</PageGroup>
|
|
42
|
+
);
|
|
39
43
|
|
|
40
44
|
expect(screen.getByText('test')).toHaveAccessibleName('Test label');
|
|
41
45
|
});
|
|
@@ -39,7 +39,11 @@ describe('page navigation', () => {
|
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
test('Renders with the passed aria-label applied', () => {
|
|
42
|
-
render(
|
|
42
|
+
render(
|
|
43
|
+
<PageNavigation aria-label="Test label" hasOverflowScroll>
|
|
44
|
+
test
|
|
45
|
+
</PageNavigation>
|
|
46
|
+
);
|
|
43
47
|
|
|
44
48
|
expect(screen.getByText('test')).toHaveAccessibleName('Test label');
|
|
45
49
|
});
|
|
@@ -786,7 +786,9 @@ exports[`Page Check page to verify grouped nav and breadcrumb - old / props synt
|
|
|
786
786
|
>
|
|
787
787
|
<div
|
|
788
788
|
aria-label="test"
|
|
789
|
-
class="pf-c-page__main-group pf-m-sticky-bottom pf-m-shadow-top"
|
|
789
|
+
class="pf-c-page__main-group pf-m-sticky-bottom pf-m-shadow-top pf-m-overflow-scroll"
|
|
790
|
+
role="region"
|
|
791
|
+
tabindex="0"
|
|
790
792
|
>
|
|
791
793
|
<div
|
|
792
794
|
class="pf-c-page__main-nav"
|
|
@@ -100,7 +100,9 @@ export const ProgressStep: React.FunctionComponent<ProgressStepProps> = ({
|
|
|
100
100
|
id={titleId}
|
|
101
101
|
ref={stepRef}
|
|
102
102
|
{...(popoverRender && { type: 'button' })}
|
|
103
|
-
{...(props.id !== undefined &&
|
|
103
|
+
{...(props.id !== undefined &&
|
|
104
|
+
titleId !== undefined &&
|
|
105
|
+
popoverRender && { 'aria-labelledby': `${props.id} ${titleId}` })}
|
|
104
106
|
>
|
|
105
107
|
{children}
|
|
106
108
|
{popoverRender && popoverRender(stepRef)}
|
|
@@ -149,11 +149,11 @@ test('Does not renders with aria-labelledBy by default on Component element', ()
|
|
|
149
149
|
|
|
150
150
|
test('Renders with an accessible name that matches children', () => {
|
|
151
151
|
render(
|
|
152
|
-
<ProgressStep id="test-id" titleId="title-id">
|
|
152
|
+
<ProgressStep popoverRender={stepRef => <div>Popover content</div>} id="test-id" titleId="title-id">
|
|
153
153
|
Test
|
|
154
154
|
</ProgressStep>
|
|
155
155
|
);
|
|
156
|
-
expect(screen.getByText('Test')).toHaveAccessibleName('Test');
|
|
156
|
+
expect(screen.getByText('Test')).toHaveAccessibleName('Test Popover content');
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
test('Renders with popoverRender element', () => {
|