@patternfly/react-core 4.175.7 → 4.175.11

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/esm/components/Alert/Alert.d.ts +2 -0
  3. package/dist/esm/components/Alert/Alert.d.ts.map +1 -1
  4. package/dist/esm/components/Alert/Alert.js +2 -2
  5. package/dist/esm/components/Alert/Alert.js.map +1 -1
  6. package/dist/esm/components/FileUpload/FileUpload.d.ts +1 -1
  7. package/dist/esm/components/FileUpload/FileUpload.d.ts.map +1 -1
  8. package/dist/esm/components/Select/Select.js +4 -4
  9. package/dist/esm/components/Select/Select.js.map +1 -1
  10. package/dist/esm/components/Toolbar/ToolbarContent.d.ts +1 -1
  11. package/dist/esm/components/Toolbar/ToolbarGroup.d.ts +1 -1
  12. package/dist/esm/components/Toolbar/ToolbarItem.d.ts +1 -1
  13. package/dist/esm/components/Toolbar/ToolbarToggleGroup.d.ts +1 -1
  14. package/dist/js/components/Alert/Alert.d.ts +2 -0
  15. package/dist/js/components/Alert/Alert.d.ts.map +1 -1
  16. package/dist/js/components/Alert/Alert.js +2 -2
  17. package/dist/js/components/Alert/Alert.js.map +1 -1
  18. package/dist/js/components/FileUpload/FileUpload.d.ts +1 -1
  19. package/dist/js/components/FileUpload/FileUpload.d.ts.map +1 -1
  20. package/dist/js/components/Select/Select.js +4 -4
  21. package/dist/js/components/Select/Select.js.map +1 -1
  22. package/dist/js/components/Toolbar/ToolbarContent.d.ts +1 -1
  23. package/dist/js/components/Toolbar/ToolbarGroup.d.ts +1 -1
  24. package/dist/js/components/Toolbar/ToolbarItem.d.ts +1 -1
  25. package/dist/js/components/Toolbar/ToolbarToggleGroup.d.ts +1 -1
  26. package/dist/umd/react-core.css +4 -2
  27. package/dist/umd/react-core.js +6 -6
  28. package/dist/umd/react-core.min.css +4 -2
  29. package/dist/umd/react-core.min.js +1 -1
  30. package/package.json +6 -6
  31. package/src/components/Alert/Alert.tsx +5 -2
  32. package/src/components/Alert/__tests__/Alert.test.tsx +9 -0
  33. package/src/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap +370 -40
  34. package/src/components/Alert/examples/Alert.md +2 -1
  35. package/src/components/FileUpload/FileUpload.tsx +1 -1
  36. package/src/components/Select/Select.tsx +4 -4
  37. package/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +24 -24
  38. package/src/components/Toolbar/ToolbarContent.tsx +1 -1
  39. package/src/components/Toolbar/ToolbarGroup.tsx +1 -1
  40. package/src/components/Toolbar/ToolbarItem.tsx +1 -1
  41. 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.7",
3
+ "version": "4.175.11",
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.7",
38
- "@patternfly/react-styles": "^4.25.7",
39
- "@patternfly/react-tokens": "^4.27.7",
37
+ "@patternfly/react-icons": "^4.26.11",
38
+ "@patternfly/react-styles": "^4.25.11",
39
+ "@patternfly/react-tokens": "^4.27.11",
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.1",
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": "e2a1625afbb8740e9314ae41b26661b6bda95069"
63
+ "gitHead": "29d40d083cb8feb5a6dfb1bb343a8f06c49b4d88"
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
- <h4
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
- </h4>
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="">