@patternfly/react-core 4.175.8 → 4.175.12
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/ActionList/ActionList.d.ts +2 -0
- package/dist/esm/components/ActionList/ActionList.d.ts.map +1 -1
- package/dist/esm/components/ActionList/ActionList.js +2 -2
- package/dist/esm/components/ActionList/ActionList.js.map +1 -1
- package/dist/esm/components/ActionList/ActionListGroup.d.ts +2 -0
- package/dist/esm/components/ActionList/ActionListGroup.d.ts.map +1 -1
- package/dist/esm/components/ActionList/ActionListGroup.js +2 -2
- package/dist/esm/components/ActionList/ActionListGroup.js.map +1 -1
- package/dist/esm/components/ActionList/ActionListItem.d.ts +2 -0
- package/dist/esm/components/ActionList/ActionListItem.d.ts.map +1 -1
- package/dist/esm/components/ActionList/ActionListItem.js +3 -2
- package/dist/esm/components/ActionList/ActionListItem.js.map +1 -1
- 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/Select/Select.js +1 -1
- 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/ActionList/ActionList.d.ts +2 -0
- package/dist/js/components/ActionList/ActionList.d.ts.map +1 -1
- package/dist/js/components/ActionList/ActionList.js +2 -2
- package/dist/js/components/ActionList/ActionList.js.map +1 -1
- package/dist/js/components/ActionList/ActionListGroup.d.ts +2 -0
- package/dist/js/components/ActionList/ActionListGroup.d.ts.map +1 -1
- package/dist/js/components/ActionList/ActionListGroup.js +2 -2
- package/dist/js/components/ActionList/ActionListGroup.js.map +1 -1
- package/dist/js/components/ActionList/ActionListItem.d.ts +2 -0
- package/dist/js/components/ActionList/ActionListItem.d.ts.map +1 -1
- package/dist/js/components/ActionList/ActionListItem.js +3 -2
- package/dist/js/components/ActionList/ActionListItem.js.map +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/Select/Select.js +1 -1
- 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.css +4 -2
- package/dist/umd/react-core.js +9 -9
- package/dist/umd/react-core.min.css +4 -2
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +6 -6
- package/src/components/ActionList/ActionList.tsx +4 -1
- package/src/components/ActionList/ActionListGroup.tsx +4 -1
- package/src/components/ActionList/ActionListItem.tsx +5 -1
- 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/Select/Select.tsx +1 -1
- 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.12",
|
|
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.12",
|
|
38
|
+
"@patternfly/react-styles": "^4.25.12",
|
|
39
|
+
"@patternfly/react-tokens": "^4.27.12",
|
|
40
40
|
"focus-trap": "6.2.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
43
43
|
"tslib": "^2.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@patternfly/patternfly": "4.
|
|
46
|
+
"@patternfly/patternfly": "4.160.0",
|
|
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": "c31cf1714bb3cbb692b22861c6c8204d59243d83"
|
|
64
64
|
}
|
|
@@ -7,14 +7,17 @@ export interface ActionListProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
/** Flag indicating the action list contains multiple icons and item padding should be removed */
|
|
9
9
|
isIconList?: boolean;
|
|
10
|
+
/** Additional classes added to the action list */
|
|
11
|
+
className?: string;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export const ActionList: React.FunctionComponent<ActionListProps> = ({
|
|
13
15
|
children,
|
|
14
16
|
isIconList,
|
|
17
|
+
className = '',
|
|
15
18
|
...props
|
|
16
19
|
}: ActionListProps) => (
|
|
17
|
-
<div className={css(styles.actionList, isIconList && styles.modifiers.icons)} {...props}>
|
|
20
|
+
<div className={css(styles.actionList, isIconList && styles.modifiers.icons, className)} {...props}>
|
|
18
21
|
{children}
|
|
19
22
|
</div>
|
|
20
23
|
);
|
|
@@ -5,13 +5,16 @@ import styles from '@patternfly/react-styles/css/components/ActionList/action-li
|
|
|
5
5
|
export interface ActionListGroupProps extends React.HTMLProps<HTMLDivElement> {
|
|
6
6
|
/** Children of the action list group */
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
/** Additional classes added to the action list group */
|
|
9
|
+
className?: string;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
export const ActionListGroup: React.FunctionComponent<ActionListGroupProps> = ({
|
|
11
13
|
children,
|
|
14
|
+
className = '',
|
|
12
15
|
...props
|
|
13
16
|
}: ActionListGroupProps) => (
|
|
14
|
-
<div className={css(styles.actionListGroup)} {...props}>
|
|
17
|
+
<div className={css(styles.actionListGroup, className)} {...props}>
|
|
15
18
|
{children}
|
|
16
19
|
</div>
|
|
17
20
|
);
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { css } from '@patternfly/react-styles';
|
|
2
3
|
|
|
3
4
|
export interface ActionListItemProps extends React.HTMLProps<HTMLDivElement> {
|
|
4
5
|
/** Children of the action list item */
|
|
5
6
|
children?: React.ReactNode;
|
|
7
|
+
/** Additional classes added to the action list item */
|
|
8
|
+
className?: string;
|
|
6
9
|
}
|
|
7
10
|
|
|
8
11
|
export const ActionListItem: React.FunctionComponent<ActionListItemProps> = ({
|
|
9
12
|
children,
|
|
13
|
+
className = '',
|
|
10
14
|
...props
|
|
11
15
|
}: ActionListItemProps) => (
|
|
12
|
-
<div className=
|
|
16
|
+
<div className={css('pf-c-action-list__item', className)} {...props}>
|
|
13
17
|
{children}
|
|
14
18
|
</div>
|
|
15
19
|
);
|
|
@@ -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="">
|