@patternfly/react-core 4.211.0 → 4.211.3

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 (72) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/esm/components/Menu/Menu.js +1 -1
  3. package/dist/esm/components/Menu/Menu.js.map +1 -1
  4. package/dist/esm/components/Page/PageBreadcrumb.d.ts.map +1 -1
  5. package/dist/esm/components/Page/PageBreadcrumb.js +1 -1
  6. package/dist/esm/components/Page/PageBreadcrumb.js.map +1 -1
  7. package/dist/esm/components/Page/PageGroup.d.ts.map +1 -1
  8. package/dist/esm/components/Page/PageGroup.js +1 -1
  9. package/dist/esm/components/Page/PageGroup.js.map +1 -1
  10. package/dist/esm/components/Page/PageNavigation.d.ts.map +1 -1
  11. package/dist/esm/components/Page/PageNavigation.js +1 -1
  12. package/dist/esm/components/Page/PageNavigation.js.map +1 -1
  13. package/dist/esm/components/Page/PageSection.d.ts.map +1 -1
  14. package/dist/esm/components/Page/PageSection.js +1 -1
  15. package/dist/esm/components/Page/PageSection.js.map +1 -1
  16. package/dist/esm/components/Panel/Panel.d.ts +3 -1
  17. package/dist/esm/components/Panel/Panel.d.ts.map +1 -1
  18. package/dist/esm/components/Panel/Panel.js +4 -3
  19. package/dist/esm/components/Panel/Panel.js.map +1 -1
  20. package/dist/esm/components/Tooltip/Tooltip.d.ts +6 -0
  21. package/dist/esm/components/Tooltip/Tooltip.d.ts.map +1 -1
  22. package/dist/esm/components/Tooltip/Tooltip.js +2 -2
  23. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  24. package/dist/esm/helpers/KeyboardHandler.d.ts +2 -0
  25. package/dist/esm/helpers/KeyboardHandler.d.ts.map +1 -1
  26. package/dist/esm/helpers/KeyboardHandler.js +3 -2
  27. package/dist/esm/helpers/KeyboardHandler.js.map +1 -1
  28. package/dist/js/components/Menu/Menu.js +1 -1
  29. package/dist/js/components/Menu/Menu.js.map +1 -1
  30. package/dist/js/components/Page/PageBreadcrumb.d.ts.map +1 -1
  31. package/dist/js/components/Page/PageBreadcrumb.js +1 -1
  32. package/dist/js/components/Page/PageBreadcrumb.js.map +1 -1
  33. package/dist/js/components/Page/PageGroup.d.ts.map +1 -1
  34. package/dist/js/components/Page/PageGroup.js +1 -1
  35. package/dist/js/components/Page/PageGroup.js.map +1 -1
  36. package/dist/js/components/Page/PageNavigation.d.ts.map +1 -1
  37. package/dist/js/components/Page/PageNavigation.js +1 -1
  38. package/dist/js/components/Page/PageNavigation.js.map +1 -1
  39. package/dist/js/components/Page/PageSection.d.ts.map +1 -1
  40. package/dist/js/components/Page/PageSection.js +1 -1
  41. package/dist/js/components/Page/PageSection.js.map +1 -1
  42. package/dist/js/components/Panel/Panel.d.ts +3 -1
  43. package/dist/js/components/Panel/Panel.d.ts.map +1 -1
  44. package/dist/js/components/Panel/Panel.js +4 -4
  45. package/dist/js/components/Panel/Panel.js.map +1 -1
  46. package/dist/js/components/Tooltip/Tooltip.d.ts +6 -0
  47. package/dist/js/components/Tooltip/Tooltip.d.ts.map +1 -1
  48. package/dist/js/components/Tooltip/Tooltip.js +2 -2
  49. package/dist/js/components/Tooltip/Tooltip.js.map +1 -1
  50. package/dist/js/helpers/KeyboardHandler.d.ts +2 -0
  51. package/dist/js/helpers/KeyboardHandler.d.ts.map +1 -1
  52. package/dist/js/helpers/KeyboardHandler.js +3 -2
  53. package/dist/js/helpers/KeyboardHandler.js.map +1 -1
  54. package/dist/umd/react-core.js +14 -12
  55. package/dist/umd/react-core.min.js +4 -4
  56. package/package.json +6 -6
  57. package/src/components/Menu/Menu.tsx +1 -1
  58. package/src/components/Page/PageBreadcrumb.tsx +1 -0
  59. package/src/components/Page/PageGroup.tsx +1 -0
  60. package/src/components/Page/PageNavigation.tsx +1 -0
  61. package/src/components/Page/PageSection.tsx +1 -0
  62. package/src/components/Page/__tests__/__snapshots__/PageBreadcrumb.test.tsx.snap +1 -0
  63. package/src/components/Page/__tests__/__snapshots__/PageGroup.test.tsx.snap +1 -0
  64. package/src/components/Page/__tests__/__snapshots__/PageNavigation.test.tsx.snap +1 -0
  65. package/src/components/Page/__tests__/__snapshots__/PageSection.test.tsx.snap +1 -0
  66. package/src/components/Panel/Panel.tsx +8 -1
  67. package/src/components/Tabs/examples/Tabs.md +144 -25
  68. package/src/components/Tooltip/Tooltip.tsx +8 -0
  69. package/src/components/Tooltip/examples/Tooltip.md +86 -41
  70. package/src/demos/ComposableMenu/ComposableMenu.md +2 -0
  71. package/src/demos/ComposableMenu/examples/ComposableTreeViewMenu.tsx +62 -28
  72. package/src/helpers/KeyboardHandler.tsx +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.211.0",
3
+ "version": "4.211.3",
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.62.0",
38
- "@patternfly/react-styles": "^4.61.0",
39
- "@patternfly/react-tokens": "^4.63.0",
37
+ "@patternfly/react-icons": "^4.62.3",
38
+ "@patternfly/react-styles": "^4.61.3",
39
+ "@patternfly/react-tokens": "^4.63.3",
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.193.0",
46
+ "@patternfly/patternfly": "4.194.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": "7b52196359d23335c01897580e8a1864093cebdd"
63
+ "gitHead": "cbbd9d29145826f7cebc54c76ce1cbed4efd3be7"
64
64
  }
@@ -210,7 +210,7 @@ class MenuBase extends React.Component<MenuProps, MenuState> {
210
210
  ? Array.from(this.activeMenu.getElementsByTagName('UL')[0].children).filter(
211
211
  el => !(el.classList.contains('pf-m-disabled') || el.classList.contains('pf-c-divider'))
212
212
  )
213
- : Array.from(this.activeMenu.getElementsByTagName('LI')).filter(
213
+ : Array.from(this.menuRef.current.getElementsByTagName('LI')).filter(
214
214
  el => !(el.classList.contains('pf-m-disabled') || el.classList.contains('pf-c-divider'))
215
215
  );
216
216
  };
@@ -40,6 +40,7 @@ export const PageBreadcrumb = ({
40
40
  hasOverflowScroll && styles.modifiers.overflowScroll,
41
41
  className
42
42
  )}
43
+ {...(hasOverflowScroll && { tabIndex: 0 })}
43
44
  {...props}
44
45
  >
45
46
  {isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
@@ -37,6 +37,7 @@ export const PageGroup = ({
37
37
  hasOverflowScroll && styles.modifiers.overflowScroll,
38
38
  className
39
39
  )}
40
+ {...(hasOverflowScroll && { tabIndex: 0 })}
40
41
  >
41
42
  {children}
42
43
  </div>
@@ -40,6 +40,7 @@ export const PageNavigation = ({
40
40
  hasOverflowScroll && styles.modifiers.overflowScroll,
41
41
  className
42
42
  )}
43
+ {...(hasOverflowScroll && { tabIndex: 0 })}
43
44
  {...props}
44
45
  >
45
46
  {isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
@@ -101,6 +101,7 @@ export const PageSection: React.FunctionComponent<PageSectionProps> = ({
101
101
  hasOverflowScroll && styles.modifiers.overflowScroll,
102
102
  className
103
103
  )}
104
+ {...(hasOverflowScroll && { tabIndex: 0 })}
104
105
  >
105
106
  {isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
106
107
  {!isWidthLimited && children}
@@ -48,6 +48,7 @@ exports[`page breadcrumb Verify overflow scroll 1`] = `
48
48
  <DocumentFragment>
49
49
  <section
50
50
  class="pf-c-page__main-breadcrumb pf-m-overflow-scroll"
51
+ tabindex="0"
51
52
  >
52
53
  test
53
54
  </section>
@@ -34,6 +34,7 @@ exports[`page group Verify overflow scroll 1`] = `
34
34
  <DocumentFragment>
35
35
  <div
36
36
  class="pf-c-page__main-group pf-m-overflow-scroll"
37
+ tabindex="0"
37
38
  >
38
39
  test
39
40
  </div>
@@ -48,6 +48,7 @@ exports[`page navigation Verify overflow scroll 1`] = `
48
48
  <DocumentFragment>
49
49
  <div
50
50
  class="pf-c-page__main-nav pf-m-overflow-scroll"
51
+ tabindex="0"
51
52
  >
52
53
  test
53
54
  </div>
@@ -112,6 +112,7 @@ exports[`Verify page section overflow scroll 1`] = `
112
112
  <DocumentFragment>
113
113
  <section
114
114
  class="pf-c-page__main-section pf-m-overflow-scroll"
115
+ tabindex="0"
115
116
  >
116
117
  test
117
118
  </section>
@@ -11,13 +11,16 @@ export interface PanelProps extends React.HTMLProps<HTMLDivElement> {
11
11
  variant?: 'raised' | 'bordered';
12
12
  /** Flag to add scrollable styling to the panel */
13
13
  isScrollable?: boolean;
14
+ /** @hide Forwarded ref */
15
+ innerRef?: React.Ref<any>;
14
16
  }
15
17
 
16
- export const Panel: React.FunctionComponent<PanelProps> = ({
18
+ const PanelBase: React.FunctionComponent<PanelProps> = ({
17
19
  className,
18
20
  children,
19
21
  variant,
20
22
  isScrollable,
23
+ innerRef,
21
24
  ...props
22
25
  }: PanelProps) => (
23
26
  <div
@@ -28,10 +31,14 @@ export const Panel: React.FunctionComponent<PanelProps> = ({
28
31
  isScrollable && styles.modifiers.scrollable,
29
32
  className
30
33
  )}
34
+ ref={innerRef}
31
35
  {...props}
32
36
  >
33
37
  {children}
34
38
  </div>
35
39
  );
36
40
 
41
+ export const Panel = React.forwardRef((props: PanelProps, ref: React.Ref<any>) => (
42
+ <PanelBase innerRef={ref} {...props} />
43
+ ));
37
44
  Panel.displayName = 'Panel';
@@ -56,7 +56,12 @@ class SimpleTabs extends React.Component {
56
56
 
57
57
  return (
58
58
  <div>
59
- <Tabs activeKey={activeTabKey} onSelect={this.handleTabClick} isBox={isBox} aria-label="Tabs in the default example">
59
+ <Tabs
60
+ activeKey={activeTabKey}
61
+ onSelect={this.handleTabClick}
62
+ isBox={isBox}
63
+ aria-label="Tabs in the default example"
64
+ >
60
65
  <Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
61
66
  Users
62
67
  </Tab>
@@ -99,7 +104,9 @@ class SimpleTabs extends React.Component {
99
104
 
100
105
  ### With tooltip react ref
101
106
 
102
- When using a React ref to link a Tooltip to a Tab component, an `id` must be manually set on the Tooltip component, and the Tab component must have a matching `aria-describedby` attribute so that screen readers are able to announce the Tooltip contents.
107
+ When using a React ref to link a Tooltip to a Tab component via the `reference` prop, you should avoid manually passing in a value of "off" to the `aria-live` prop. Doing so may lead to the tooltip becoming less accessible to assistive technologies.
108
+
109
+ The tooltip should also have the `id` prop passed in. The value given to this prop should then be passed into the tab's `aria-describedby` prop. This ensures a tooltip used with a React ref will be announced by the JAWS and NVDA screen readers.
103
110
 
104
111
  ```js
105
112
  import React from 'react';
@@ -132,7 +139,12 @@ class SimpleTabs extends React.Component {
132
139
 
133
140
  return (
134
141
  <div>
135
- <Tabs activeKey={activeTabKey} onSelect={this.handleTabClick} isBox={isBox} aria-label="Tabs in the example with a tooltip ref">
142
+ <Tabs
143
+ activeKey={activeTabKey}
144
+ onSelect={this.handleTabClick}
145
+ isBox={isBox}
146
+ aria-label="Tabs in the example with a tooltip ref"
147
+ >
136
148
  <Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
137
149
  Users
138
150
  </Tab>
@@ -153,15 +165,15 @@ class SimpleTabs extends React.Component {
153
165
  title={<TabTitleText>ARIA Disabled (Tooltip)</TabTitleText>}
154
166
  isAriaDisabled
155
167
  ref={tooltipRef}
156
- aria-describedby="tooltip-tab-5"
168
+ aria-describedby="tooltip-ref1"
157
169
  >
158
170
  ARIA Disabled (Tooltip)
159
171
  </Tab>
160
172
  </Tabs>
161
173
  <Tooltip
174
+ id="tooltip-ref1"
162
175
  content="Aria-disabled tabs are like disabled tabs, but focusable. Allows for tooltip support."
163
176
  reference={tooltipRef}
164
- id="tooltip-tab-5"
165
177
  />
166
178
  <div style={{ marginTop: '20px' }}>
167
179
  <Checkbox
@@ -338,7 +350,12 @@ class ScrollButtonsPrimaryTabs extends React.Component {
338
350
  const { activeTabKey, isBox } = this.state;
339
351
  return (
340
352
  <div>
341
- <Tabs activeKey={activeTabKey} onSelect={this.handleTabClick} isBox={isBox} aria-label="Tabs in the default overflow example">
353
+ <Tabs
354
+ activeKey={activeTabKey}
355
+ onSelect={this.handleTabClick}
356
+ isBox={isBox}
357
+ aria-label="Tabs in the default overflow example"
358
+ >
342
359
  <Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
343
360
  Users
344
361
  </Tab>
@@ -424,7 +441,13 @@ class VerticalTabs extends React.Component {
424
441
 
425
442
  return (
426
443
  <div>
427
- <Tabs activeKey={activeTabKey} onSelect={this.handleTabClick} isVertical isBox={isBox} aria-label="Tabs in the vertical example">
444
+ <Tabs
445
+ activeKey={activeTabKey}
446
+ onSelect={this.handleTabClick}
447
+ isVertical
448
+ isBox={isBox}
449
+ aria-label="Tabs in the vertical example"
450
+ >
428
451
  <Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
429
452
  Users
430
453
  </Tab>
@@ -689,7 +712,13 @@ class PageInsetsTabs extends React.Component {
689
712
  const { activeTabKey, isBox } = this.state;
690
713
  return (
691
714
  <div>
692
- <Tabs activeKey={activeTabKey} onSelect={this.handleTabClick} usePageInsets isBox={isBox} aria-label="Tabs in the page insets example">
715
+ <Tabs
716
+ activeKey={activeTabKey}
717
+ onSelect={this.handleTabClick}
718
+ usePageInsets
719
+ isBox={isBox}
720
+ aria-label="Tabs in the page insets example"
721
+ >
693
722
  <Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
694
723
  Users
695
724
  </Tab>
@@ -753,7 +782,11 @@ class IconAndTextTabs extends React.Component {
753
782
 
754
783
  render() {
755
784
  return (
756
- <Tabs activeKey={this.state.activeTabKey} onSelect={this.handleTabClick} aria-label="Tabs in the icons and text example">
785
+ <Tabs
786
+ activeKey={this.state.activeTabKey}
787
+ onSelect={this.handleTabClick}
788
+ aria-label="Tabs in the icons and text example"
789
+ >
757
790
  <Tab
758
791
  eventKey={0}
759
792
  title={
@@ -876,9 +909,19 @@ class SecondaryTabs extends React.Component {
876
909
  const { activeTabKey1, activeTabKey2, isBox } = this.state;
877
910
  return (
878
911
  <div>
879
- <Tabs activeKey={activeTabKey1} onSelect={this.handleTabClickFirst} isBox={isBox} aria-label="Tabs in the tabs with subtabs example">
912
+ <Tabs
913
+ activeKey={activeTabKey1}
914
+ onSelect={this.handleTabClickFirst}
915
+ isBox={isBox}
916
+ aria-label="Tabs in the tabs with subtabs example"
917
+ >
880
918
  <Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
881
- <Tabs aria-label="secondary tabs for users" activeKey={activeTabKey2} isSecondary onSelect={this.handleTabClickSecond}>
919
+ <Tabs
920
+ aria-label="secondary tabs for users"
921
+ activeKey={activeTabKey2}
922
+ isSecondary
923
+ onSelect={this.handleTabClickSecond}
924
+ >
882
925
  <Tab eventKey={20} title={<TabTitleText>Secondary tab item 1</TabTitleText>}>
883
926
  Secondary tab item 1 item section
884
927
  </Tab>
@@ -983,7 +1026,13 @@ class FilledTabs extends React.Component {
983
1026
  const { activeTabKey, isBox } = this.state;
984
1027
  return (
985
1028
  <div>
986
- <Tabs isFilled activeKey={activeTabKey} onSelect={this.handleTabClick} isBox={isBox} aria-label="Tabs in the filled example">
1029
+ <Tabs
1030
+ isFilled
1031
+ activeKey={activeTabKey}
1032
+ onSelect={this.handleTabClick}
1033
+ isBox={isBox}
1034
+ aria-label="Tabs in the filled example"
1035
+ >
987
1036
  <Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
988
1037
  Users
989
1038
  </Tab>
@@ -1044,7 +1093,13 @@ class FilledTabsWithIcons extends React.Component {
1044
1093
  const { activeTabKey, isBox } = this.state;
1045
1094
  return (
1046
1095
  <div>
1047
- <Tabs isFilled activeKey={activeTabKey} onSelect={this.handleTabClick} isBox={isBox} aria-label="Tabs in the filled with icons example">
1096
+ <Tabs
1097
+ isFilled
1098
+ activeKey={activeTabKey}
1099
+ onSelect={this.handleTabClick}
1100
+ isBox={isBox}
1101
+ aria-label="Tabs in the filled with icons example"
1102
+ >
1048
1103
  <Tab
1049
1104
  eventKey={0}
1050
1105
  title={
@@ -1270,7 +1325,11 @@ class SeparateTabContent extends React.Component {
1270
1325
  render() {
1271
1326
  return (
1272
1327
  <React.Fragment>
1273
- <Tabs activeKey={this.state.activeTabKey} onSelect={this.handleTabClick} aria-label="Tabs in the seperate content example">
1328
+ <Tabs
1329
+ activeKey={this.state.activeTabKey}
1330
+ onSelect={this.handleTabClick}
1331
+ aria-label="Tabs in the seperate content example"
1332
+ >
1274
1333
  <Tab
1275
1334
  eventKey={0}
1276
1335
  title={<TabTitleText>Tab item 1</TabTitleText>}
@@ -1291,13 +1350,30 @@ class SeparateTabContent extends React.Component {
1291
1350
  />
1292
1351
  </Tabs>
1293
1352
  <div>
1294
- <TabContent eventKey={0} id="refTab1Section" ref={this.contentRef1} aria-label="This is content for the first tab">
1353
+ <TabContent
1354
+ eventKey={0}
1355
+ id="refTab1Section"
1356
+ ref={this.contentRef1}
1357
+ aria-label="This is content for the first tab"
1358
+ >
1295
1359
  Tab 1 section
1296
1360
  </TabContent>
1297
- <TabContent eventKey={1} id="refTab2Section" ref={this.contentRef2} aria-label="This is content for the second tab" hidden>
1361
+ <TabContent
1362
+ eventKey={1}
1363
+ id="refTab2Section"
1364
+ ref={this.contentRef2}
1365
+ aria-label="This is content for the second tab"
1366
+ hidden
1367
+ >
1298
1368
  Tab 2 section
1299
1369
  </TabContent>
1300
- <TabContent eventKey={2} id="refTab3Section" ref={this.contentRef3} aria-label="This is content for the third tab" hidden>
1370
+ <TabContent
1371
+ eventKey={2}
1372
+ id="refTab3Section"
1373
+ ref={this.contentRef3}
1374
+ aria-label="This is content for the third tab"
1375
+ hidden
1376
+ >
1301
1377
  Tab 3 section
1302
1378
  </TabContent>
1303
1379
  </div>
@@ -1351,10 +1427,22 @@ const TabContentWithBody = () => {
1351
1427
  <TabContent eventKey={0} id="refTab1Section" ref={contentRef1} aria-label="This is content for the first tab">
1352
1428
  <TabContentBody hasPadding> Tab 1 section </TabContentBody>
1353
1429
  </TabContent>
1354
- <TabContent eventKey={1} id="refTab2Section" ref={contentRef2} aria-label="This is content for the second tab" hidden>
1430
+ <TabContent
1431
+ eventKey={1}
1432
+ id="refTab2Section"
1433
+ ref={contentRef2}
1434
+ aria-label="This is content for the second tab"
1435
+ hidden
1436
+ >
1355
1437
  <TabContentBody hasPadding> Tab 2 section </TabContentBody>
1356
1438
  </TabContent>
1357
- <TabContent eventKey={2} id="refTab3Section" ref={contentRef3} aria-label="This is content for the third tab" hidden>
1439
+ <TabContent
1440
+ eventKey={2}
1441
+ id="refTab3Section"
1442
+ ref={contentRef3}
1443
+ aria-label="This is content for the third tab"
1444
+ hidden
1445
+ >
1358
1446
  <TabContentBody hasPadding> Tab 3 section </TabContentBody>
1359
1447
  </TabContent>
1360
1448
  </div>
@@ -1385,7 +1473,12 @@ class MountingSimpleTabs extends React.Component {
1385
1473
 
1386
1474
  render() {
1387
1475
  return (
1388
- <Tabs mountOnEnter activeKey={this.state.activeTabKey} onSelect={this.handleTabClick} aria-label="Tabs in the children mounting on click example">
1476
+ <Tabs
1477
+ mountOnEnter
1478
+ activeKey={this.state.activeTabKey}
1479
+ onSelect={this.handleTabClick}
1480
+ aria-label="Tabs in the children mounting on click example"
1481
+ >
1389
1482
  <Tab eventKey={0} title={<TabTitleText>Tab item 1</TabTitleText>}>
1390
1483
  Tab 1 section
1391
1484
  </Tab>
@@ -1423,7 +1516,12 @@ class UnmountingSimpleTabs extends React.Component {
1423
1516
 
1424
1517
  render() {
1425
1518
  return (
1426
- <Tabs unmountOnExit activeKey={this.state.activeTabKey} onSelect={this.handleTabClick} aria-label="Tabs in the unmounting invisible children example">
1519
+ <Tabs
1520
+ unmountOnExit
1521
+ activeKey={this.state.activeTabKey}
1522
+ onSelect={this.handleTabClick}
1523
+ aria-label="Tabs in the unmounting invisible children example"
1524
+ >
1427
1525
  <Tab eventKey={0} title={<TabTitleText>Tab item 1</TabTitleText>}>
1428
1526
  Tab 1 section
1429
1527
  </Tab>
@@ -1473,7 +1571,11 @@ class ToggledSeparateContent extends React.Component {
1473
1571
  {isTab2Hidden ? 'Show' : 'Hide'} tab 2
1474
1572
  </Button>
1475
1573
  <Divider style={{ paddingTop: '1rem', paddingBottom: '1rem' }} />
1476
- <Tabs activeKey={this.state.activeTabKey} onSelect={this.handleTabClick} aria-label="Tabs in the toggled separate content example">
1574
+ <Tabs
1575
+ activeKey={this.state.activeTabKey}
1576
+ onSelect={this.handleTabClick}
1577
+ aria-label="Tabs in the toggled separate content example"
1578
+ >
1477
1579
  <Tab eventKey={0} title="Tab item 1" tabContentId="refTab1Section" tabContentRef={this.contentRef1} />
1478
1580
  {!isTab2Hidden && (
1479
1581
  <Tab eventKey={1} title="Tab item 2" tabContentId="refTab2Section" tabContentRef={this.contentRef2} />
@@ -1481,15 +1583,32 @@ class ToggledSeparateContent extends React.Component {
1481
1583
  <Tab eventKey={2} title="Tab item 3" tabContentId="refTab3Section" tabContentRef={this.contentRef3} />
1482
1584
  </Tabs>
1483
1585
  <div>
1484
- <TabContent eventKey={0} id="refTab1Section" ref={this.contentRef1} aria-label="This is content for the first tab">
1586
+ <TabContent
1587
+ eventKey={0}
1588
+ id="refTab1Section"
1589
+ ref={this.contentRef1}
1590
+ aria-label="This is content for the first tab"
1591
+ >
1485
1592
  Tab 1 section
1486
1593
  </TabContent>
1487
1594
  {!isTab2Hidden && (
1488
- <TabContent eventKey={1} id="refTab2Section" ref={this.contentRef2} aria-label="This is content for the second tab" hidden>
1595
+ <TabContent
1596
+ eventKey={1}
1597
+ id="refTab2Section"
1598
+ ref={this.contentRef2}
1599
+ aria-label="This is content for the second tab"
1600
+ hidden
1601
+ >
1489
1602
  Tab 2 section
1490
1603
  </TabContent>
1491
1604
  )}
1492
- <TabContent eventKey={2} id="refTab3Section" ref={this.contentRef3} aria-label="This is content for the third tab" hidden>
1605
+ <TabContent
1606
+ eventKey={2}
1607
+ id="refTab3Section"
1608
+ ref={this.contentRef3}
1609
+ aria-label="This is content for the third tab"
1610
+ hidden
1611
+ >
1493
1612
  Tab 3 section
1494
1613
  </TabContent>
1495
1614
  </div>
@@ -35,6 +35,12 @@ export interface TooltipProps extends Omit<React.HTMLProps<HTMLDivElement>, 'con
35
35
  * If you don't want that or prefer to add the aria attribute yourself on the trigger, set aria to 'none'.
36
36
  */
37
37
  aria?: 'describedby' | 'labelledby' | 'none';
38
+ /**
39
+ * Determines whether the tooltip is an aria-live region. If the reference prop is passed in the
40
+ * default behavior is 'polite' in order to ensure the tooltip contents is announced to
41
+ * assistive technologies. Otherwise the default behavior is 'off'.
42
+ */
43
+ 'aria-live'?: 'off' | 'polite';
38
44
  /**
39
45
  * The reference element to which the Tooltip is relatively placed to.
40
46
  * If you cannot wrap the reference with the Tooltip, you can use the reference prop instead.
@@ -155,6 +161,7 @@ export const Tooltip: React.FunctionComponent<TooltipProps> = ({
155
161
  children,
156
162
  animationDuration = 300,
157
163
  reference,
164
+ 'aria-live': ariaLive = reference ? 'polite' : 'off',
158
165
  boundary,
159
166
  isAppLauncher,
160
167
  tippyProps,
@@ -251,6 +258,7 @@ export const Tooltip: React.FunctionComponent<TooltipProps> = ({
251
258
  const hasCustomMaxWidth = maxWidth !== tooltipMaxWidth.value;
252
259
  const content = (
253
260
  <div
261
+ aria-live={ariaLive}
254
262
  className={css(styles.tooltip, className)}
255
263
  role="tooltip"
256
264
  id={id}