@patternfly/react-core 4.175.5 → 4.175.9
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/Alert/Alert.d.ts +2 -0
- 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/FileUpload/FileUpload.d.ts +1 -1
- package/dist/esm/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/esm/components/Pagination/Pagination.d.ts +1 -1
- package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js +4 -4
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarContent.d.ts +1 -1
- package/dist/esm/components/Toolbar/ToolbarGroup.d.ts +1 -1
- package/dist/esm/components/Toolbar/ToolbarItem.d.ts +1 -1
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.d.ts +1 -1
- package/dist/js/components/Alert/Alert.d.ts +2 -0
- 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/FileUpload/FileUpload.d.ts +1 -1
- package/dist/js/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/js/components/Pagination/Pagination.d.ts +1 -1
- package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js +4 -4
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarContent.d.ts +1 -1
- package/dist/js/components/Toolbar/ToolbarGroup.d.ts +1 -1
- package/dist/js/components/Toolbar/ToolbarItem.d.ts +1 -1
- package/dist/js/components/Toolbar/ToolbarToggleGroup.d.ts +1 -1
- package/dist/umd/react-core.js +6 -6
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +6 -6
- package/src/components/Alert/Alert.tsx +5 -2
- package/src/components/Alert/__tests__/Alert.test.tsx +9 -0
- package/src/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap +370 -40
- package/src/components/Alert/examples/Alert.md +2 -1
- package/src/components/FileUpload/FileUpload.tsx +1 -1
- package/src/components/Pagination/Pagination.tsx +1 -1
- package/src/components/Select/Select.tsx +4 -4
- package/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +24 -24
- package/src/components/Toolbar/ToolbarContent.tsx +1 -1
- package/src/components/Toolbar/ToolbarGroup.tsx +1 -1
- package/src/components/Toolbar/ToolbarItem.tsx +1 -1
- package/src/components/Toolbar/ToolbarToggleGroup.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.175.
|
|
3
|
+
"version": "4.175.9",
|
|
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.26.
|
|
38
|
-
"@patternfly/react-styles": "^4.25.
|
|
39
|
-
"@patternfly/react-tokens": "^4.27.
|
|
37
|
+
"@patternfly/react-icons": "^4.26.9",
|
|
38
|
+
"@patternfly/react-styles": "^4.25.9",
|
|
39
|
+
"@patternfly/react-tokens": "^4.27.9",
|
|
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.159.
|
|
46
|
+
"@patternfly/patternfly": "4.159.2",
|
|
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": "fe2d3b55de1b60cf0c5740fb5180beece366d68e"
|
|
64
64
|
}
|
|
@@ -27,6 +27,8 @@ export interface AlertProps extends Omit<React.HTMLProps<HTMLDivElement>, 'actio
|
|
|
27
27
|
isPlain?: boolean;
|
|
28
28
|
/** Title of the alert */
|
|
29
29
|
title: React.ReactNode;
|
|
30
|
+
/** Sets the heading level to use for the alert title. Default is h4. */
|
|
31
|
+
titleHeadingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
30
32
|
/** Close button; use the alertActionCloseButton component */
|
|
31
33
|
actionClose?: React.ReactNode;
|
|
32
34
|
/** Action links; use a single alertActionLink component or multiple wrapped in an array or React.Fragment */
|
|
@@ -69,6 +71,7 @@ export const Alert: React.FunctionComponent<AlertProps> = ({
|
|
|
69
71
|
actionClose,
|
|
70
72
|
actionLinks,
|
|
71
73
|
title,
|
|
74
|
+
titleHeadingLevel: TitleHeadingLevel = 'h4',
|
|
72
75
|
children = '',
|
|
73
76
|
className = '',
|
|
74
77
|
ouiaId,
|
|
@@ -165,13 +168,13 @@ export const Alert: React.FunctionComponent<AlertProps> = ({
|
|
|
165
168
|
return null;
|
|
166
169
|
}
|
|
167
170
|
const Title = (
|
|
168
|
-
<
|
|
171
|
+
<TitleHeadingLevel
|
|
169
172
|
{...(isTooltipVisible && { tabIndex: 0 })}
|
|
170
173
|
ref={titleRef}
|
|
171
174
|
className={css(styles.alertTitle, truncateTitle && styles.modifiers.truncate)}
|
|
172
175
|
>
|
|
173
176
|
{getHeadingContent}
|
|
174
|
-
</
|
|
177
|
+
</TitleHeadingLevel>
|
|
175
178
|
);
|
|
176
179
|
|
|
177
180
|
return (
|
|
@@ -36,6 +36,15 @@ Object.values(AlertVariant).forEach(variant => {
|
|
|
36
36
|
expect(view).toMatchSnapshot();
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
+
test('Heading level', () => {
|
|
40
|
+
const view = mount(
|
|
41
|
+
<Alert variant={variant} title="Some title" titleHeadingLevel="h1">
|
|
42
|
+
Some alert
|
|
43
|
+
</Alert>
|
|
44
|
+
);
|
|
45
|
+
expect(view).toMatchSnapshot();
|
|
46
|
+
});
|
|
47
|
+
|
|
39
48
|
test('Action Link', () => {
|
|
40
49
|
const view = mount(
|
|
41
50
|
<Alert variant={variant} actionLinks={[<AlertActionLink key={'action-1'}>test</AlertActionLink>]} title="">
|