@patternfly/react-core 4.174.0 → 4.175.1

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 (133) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/esm/components/Card/Card.d.ts +6 -0
  3. package/dist/esm/components/Card/Card.d.ts.map +1 -1
  4. package/dist/esm/components/Card/Card.js +2 -2
  5. package/dist/esm/components/Card/Card.js.map +1 -1
  6. package/dist/esm/components/Pagination/Navigation.d.ts +2 -0
  7. package/dist/esm/components/Pagination/Navigation.d.ts.map +1 -1
  8. package/dist/esm/components/Pagination/Navigation.js +4 -4
  9. package/dist/esm/components/Pagination/Navigation.js.map +1 -1
  10. package/dist/esm/components/Pagination/OptionsToggle.js +3 -3
  11. package/dist/esm/components/Pagination/OptionsToggle.js.map +1 -1
  12. package/dist/esm/components/Pagination/Pagination.d.ts +1 -1
  13. package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
  14. package/dist/esm/components/Pagination/Pagination.js +27 -18
  15. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  16. package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts +1 -1
  17. package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
  18. package/dist/esm/components/Pagination/PaginationOptionsMenu.js +3 -14
  19. package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
  20. package/dist/esm/components/Panel/Panel.d.ts +13 -0
  21. package/dist/esm/components/Panel/Panel.d.ts.map +1 -0
  22. package/dist/esm/components/Panel/Panel.js +10 -0
  23. package/dist/esm/components/Panel/Panel.js.map +1 -0
  24. package/dist/esm/components/Panel/PanelFooter.d.ts +9 -0
  25. package/dist/esm/components/Panel/PanelFooter.d.ts.map +1 -0
  26. package/dist/esm/components/Panel/PanelFooter.js +10 -0
  27. package/dist/esm/components/Panel/PanelFooter.js.map +1 -0
  28. package/dist/esm/components/Panel/PanelHeader.d.ts +9 -0
  29. package/dist/esm/components/Panel/PanelHeader.d.ts.map +1 -0
  30. package/dist/esm/components/Panel/PanelHeader.js +10 -0
  31. package/dist/esm/components/Panel/PanelHeader.js.map +1 -0
  32. package/dist/esm/components/Panel/PanelMain.d.ts +11 -0
  33. package/dist/esm/components/Panel/PanelMain.d.ts.map +1 -0
  34. package/dist/esm/components/Panel/PanelMain.js +10 -0
  35. package/dist/esm/components/Panel/PanelMain.js.map +1 -0
  36. package/dist/esm/components/Panel/PanelMainBody.d.ts +9 -0
  37. package/dist/esm/components/Panel/PanelMainBody.d.ts.map +1 -0
  38. package/dist/esm/components/Panel/PanelMainBody.js +10 -0
  39. package/dist/esm/components/Panel/PanelMainBody.js.map +1 -0
  40. package/dist/esm/components/Panel/index.d.ts +6 -0
  41. package/dist/esm/components/Panel/index.d.ts.map +1 -0
  42. package/dist/esm/components/Panel/index.js +6 -0
  43. package/dist/esm/components/Panel/index.js.map +1 -0
  44. package/dist/esm/components/index.d.ts +1 -0
  45. package/dist/esm/components/index.d.ts.map +1 -1
  46. package/dist/esm/components/index.js +1 -0
  47. package/dist/esm/components/index.js.map +1 -1
  48. package/dist/esm/helpers/Popper/Popper.d.ts.map +1 -1
  49. package/dist/esm/helpers/Popper/Popper.js +6 -1
  50. package/dist/esm/helpers/Popper/Popper.js.map +1 -1
  51. package/dist/js/components/Card/Card.d.ts +6 -0
  52. package/dist/js/components/Card/Card.d.ts.map +1 -1
  53. package/dist/js/components/Card/Card.js +2 -2
  54. package/dist/js/components/Card/Card.js.map +1 -1
  55. package/dist/js/components/Pagination/Navigation.d.ts +2 -0
  56. package/dist/js/components/Pagination/Navigation.d.ts.map +1 -1
  57. package/dist/js/components/Pagination/Navigation.js +4 -4
  58. package/dist/js/components/Pagination/Navigation.js.map +1 -1
  59. package/dist/js/components/Pagination/OptionsToggle.js +3 -3
  60. package/dist/js/components/Pagination/OptionsToggle.js.map +1 -1
  61. package/dist/js/components/Pagination/Pagination.d.ts +1 -1
  62. package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
  63. package/dist/js/components/Pagination/Pagination.js +30 -21
  64. package/dist/js/components/Pagination/Pagination.js.map +1 -1
  65. package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts +1 -1
  66. package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
  67. package/dist/js/components/Pagination/PaginationOptionsMenu.js +3 -14
  68. package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
  69. package/dist/js/components/Panel/Panel.d.ts +13 -0
  70. package/dist/js/components/Panel/Panel.d.ts.map +1 -0
  71. package/dist/js/components/Panel/Panel.js +14 -0
  72. package/dist/js/components/Panel/Panel.js.map +1 -0
  73. package/dist/js/components/Panel/PanelFooter.d.ts +9 -0
  74. package/dist/js/components/Panel/PanelFooter.d.ts.map +1 -0
  75. package/dist/js/components/Panel/PanelFooter.js +14 -0
  76. package/dist/js/components/Panel/PanelFooter.js.map +1 -0
  77. package/dist/js/components/Panel/PanelHeader.d.ts +9 -0
  78. package/dist/js/components/Panel/PanelHeader.d.ts.map +1 -0
  79. package/dist/js/components/Panel/PanelHeader.js +14 -0
  80. package/dist/js/components/Panel/PanelHeader.js.map +1 -0
  81. package/dist/js/components/Panel/PanelMain.d.ts +11 -0
  82. package/dist/js/components/Panel/PanelMain.d.ts.map +1 -0
  83. package/dist/js/components/Panel/PanelMain.js +14 -0
  84. package/dist/js/components/Panel/PanelMain.js.map +1 -0
  85. package/dist/js/components/Panel/PanelMainBody.d.ts +9 -0
  86. package/dist/js/components/Panel/PanelMainBody.d.ts.map +1 -0
  87. package/dist/js/components/Panel/PanelMainBody.js +14 -0
  88. package/dist/js/components/Panel/PanelMainBody.js.map +1 -0
  89. package/dist/js/components/Panel/index.d.ts +6 -0
  90. package/dist/js/components/Panel/index.d.ts.map +1 -0
  91. package/dist/js/components/Panel/index.js +9 -0
  92. package/dist/js/components/Panel/index.js.map +1 -0
  93. package/dist/js/components/index.d.ts +1 -0
  94. package/dist/js/components/index.d.ts.map +1 -1
  95. package/dist/js/components/index.js +1 -0
  96. package/dist/js/components/index.js.map +1 -1
  97. package/dist/js/helpers/Popper/Popper.d.ts.map +1 -1
  98. package/dist/js/helpers/Popper/Popper.js +6 -1
  99. package/dist/js/helpers/Popper/Popper.js.map +1 -1
  100. package/dist/umd/react-core.css +523 -90
  101. package/dist/umd/react-core.js +981 -927
  102. package/dist/umd/react-core.min.css +523 -90
  103. package/dist/umd/react-core.min.js +3 -3
  104. package/package.json +6 -6
  105. package/src/components/Card/Card.tsx +15 -3
  106. package/src/components/Card/__tests__/Card.test.tsx +24 -0
  107. package/src/components/Card/__tests__/__snapshots__/Card.test.tsx.snap +11 -1
  108. package/src/components/Card/examples/Card.md +133 -26
  109. package/src/components/Pagination/Navigation.tsx +11 -4
  110. package/src/components/Pagination/OptionsToggle.tsx +3 -3
  111. package/src/components/Pagination/Pagination.tsx +40 -23
  112. package/src/components/Pagination/PaginationOptionsMenu.tsx +4 -15
  113. package/src/components/Pagination/__tests__/Generated/__snapshots__/Navigation.test.tsx.snap +0 -7
  114. package/src/components/Pagination/__tests__/Generated/__snapshots__/OptionsToggle.test.tsx.snap +1 -1
  115. package/src/components/Pagination/__tests__/Generated/__snapshots__/Pagination.test.tsx.snap +3 -8
  116. package/src/components/Pagination/__tests__/Pagination.test.tsx +24 -0
  117. package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +187 -157
  118. package/src/components/Pagination/examples/Pagination.md +35 -0
  119. package/src/components/Panel/Panel.tsx +37 -0
  120. package/src/components/Panel/PanelFooter.tsx +22 -0
  121. package/src/components/Panel/PanelHeader.tsx +22 -0
  122. package/src/components/Panel/PanelMain.tsx +29 -0
  123. package/src/components/Panel/PanelMainBody.tsx +22 -0
  124. package/src/components/Panel/__tests__/Panel.test.tsx +62 -0
  125. package/src/components/Panel/__tests__/__snapshots__/Panel.test.tsx.snap +83 -0
  126. package/src/components/Panel/examples/Panel.md +203 -0
  127. package/src/components/Panel/index.ts +5 -0
  128. package/src/components/TextInputGroup/examples/TextInputGroup.md +4 -4
  129. package/src/components/Tooltip/examples/Tooltip.md +18 -12
  130. package/src/components/index.ts +1 -0
  131. package/src/demos/DateTimePicker.md +103 -0
  132. package/src/demos/TextInputGroupDemo.md +278 -0
  133. package/src/helpers/Popper/Popper.tsx +7 -1
@@ -89,6 +89,41 @@ class PaginationBottom extends React.Component {
89
89
  }
90
90
  }
91
91
  ```
92
+ ### Indeterminate
93
+
94
+ By not passing `itemCount` and passing `toggleTemplate` you can customize the toggle with text.
95
+
96
+ ```js
97
+ import React from 'react';
98
+ import { Pagination } from '@patternfly/react-core';
99
+
100
+ PaginationIndeterminate = () => {
101
+ const [page, setPage] = React.useState(1);
102
+ const [perPage, setPerPage] = React.useState(20);
103
+
104
+ const onSetPage = (_event, pageNumber) => setPage(pageNumber);
105
+ const onPerPageSelect = (_event, perPage) => setPerPage(perPage);
106
+
107
+ return (
108
+ <Pagination
109
+ toggleTemplate={({ firstIndex, lastIndex }) => (
110
+ <React.Fragment>
111
+ <b>
112
+ {firstIndex} - {lastIndex}
113
+ </b>
114
+ of
115
+ <b>many</b>
116
+ </React.Fragment>
117
+ )}
118
+ widgetId="pagination-indeterminate"
119
+ perPage={perPage}
120
+ page={page}
121
+ onSetPage={onSetPage}
122
+ onPerPageSelect={onPerPageSelect}
123
+ />
124
+ );
125
+ }
126
+ ```
92
127
 
93
128
  ### Disabled
94
129
 
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+ import styles from '@patternfly/react-styles/css/components/Panel/panel';
3
+ import { css } from '@patternfly/react-styles';
4
+
5
+ export interface PanelProps extends React.HTMLProps<HTMLDivElement> {
6
+ /** Content rendered inside the panel */
7
+ children?: React.ReactNode;
8
+ /** Class to add to outer div */
9
+ className?: string;
10
+ /** Adds panel variant styles */
11
+ variant?: 'raised' | 'bordered';
12
+ /** Flag to add scrollable styling to the panel */
13
+ isScrollable?: boolean;
14
+ }
15
+
16
+ export const Panel: React.FunctionComponent<PanelProps> = ({
17
+ className,
18
+ children,
19
+ variant,
20
+ isScrollable,
21
+ ...props
22
+ }: PanelProps) => (
23
+ <div
24
+ className={css(
25
+ styles.panel,
26
+ variant === 'raised' && styles.modifiers.raised,
27
+ variant === 'bordered' && styles.modifiers.bordered,
28
+ isScrollable && styles.modifiers.scrollable,
29
+ className
30
+ )}
31
+ {...props}
32
+ >
33
+ {children}
34
+ </div>
35
+ );
36
+
37
+ Panel.displayName = 'Panel';
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import styles from '@patternfly/react-styles/css/components/Panel/panel';
3
+ import { css } from '@patternfly/react-styles';
4
+
5
+ export interface PanelFooterProps extends React.HTMLProps<HTMLDivElement> {
6
+ /** Content rendered inside the panel footer */
7
+ children?: React.ReactNode;
8
+ /** Class to add to outer div */
9
+ className?: string;
10
+ }
11
+
12
+ export const PanelFooter: React.FunctionComponent<PanelFooterProps> = ({
13
+ className,
14
+ children,
15
+ ...props
16
+ }: PanelFooterProps) => (
17
+ <div className={css(styles.panelFooter, className)} {...props}>
18
+ {children}
19
+ </div>
20
+ );
21
+
22
+ PanelFooter.displayName = 'PanelFooter';
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import styles from '@patternfly/react-styles/css/components/Panel/panel';
3
+ import { css } from '@patternfly/react-styles';
4
+
5
+ export interface PanelHeaderProps extends React.HTMLProps<HTMLDivElement> {
6
+ /** Content rendered inside the panel header */
7
+ children?: React.ReactNode;
8
+ /** Class to add to outer div */
9
+ className?: string;
10
+ }
11
+
12
+ export const PanelHeader: React.FunctionComponent<PanelHeaderProps> = ({
13
+ className,
14
+ children,
15
+ ...props
16
+ }: PanelHeaderProps) => (
17
+ <div className={css(styles.panelHeader, className)} {...props}>
18
+ {children}
19
+ </div>
20
+ );
21
+
22
+ PanelHeader.displayName = 'PanelHeader';
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ import styles from '@patternfly/react-styles/css/components/Panel/panel';
3
+ import { css } from '@patternfly/react-styles';
4
+
5
+ export interface PanelMainProps extends React.HTMLProps<HTMLDivElement> {
6
+ /** Content rendered inside the panel main div */
7
+ children?: React.ReactNode;
8
+ /** Class to add to outer div */
9
+ className?: string;
10
+ /** Max height of the panel main div as a string with the value and unit */
11
+ maxHeight?: string;
12
+ }
13
+
14
+ export const PanelMain: React.FunctionComponent<PanelMainProps> = ({
15
+ className,
16
+ children,
17
+ maxHeight,
18
+ ...props
19
+ }: PanelMainProps) => (
20
+ <div
21
+ className={css(styles.panelMain, className)}
22
+ style={{ '--pf-c-panel__main--MaxHeight': maxHeight } as React.CSSProperties}
23
+ {...props}
24
+ >
25
+ {children}
26
+ </div>
27
+ );
28
+
29
+ PanelMain.displayName = 'PanelMain';
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import styles from '@patternfly/react-styles/css/components/Panel/panel';
3
+ import { css } from '@patternfly/react-styles';
4
+
5
+ export interface PanelMainBodyProps extends React.HTMLProps<HTMLDivElement> {
6
+ /** Content rendered inside the panel main body div */
7
+ children?: React.ReactNode;
8
+ /** Class to add to outer div */
9
+ className?: string;
10
+ }
11
+
12
+ export const PanelMainBody: React.FunctionComponent<PanelMainBodyProps> = ({
13
+ className,
14
+ children,
15
+ ...props
16
+ }: PanelMainBodyProps) => (
17
+ <div className={css(styles.panelMainBody, className)} {...props}>
18
+ {children}
19
+ </div>
20
+ );
21
+
22
+ PanelMainBody.displayName = 'PanelMainBody';
@@ -0,0 +1,62 @@
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+ import { Panel } from '../Panel';
4
+ import { PanelMain } from '../PanelMain';
5
+ import { PanelMainBody } from '../PanelMainBody';
6
+ import { PanelHeader } from '../PanelHeader';
7
+ import { PanelFooter } from '../PanelFooter';
8
+
9
+ describe('Panel', () => {
10
+ test('renders content', () => {
11
+ const view = shallow(<Panel>Foo</Panel>);
12
+ expect(view).toMatchSnapshot();
13
+ });
14
+
15
+ test('renders content with raised styling', () => {
16
+ const view = shallow(<Panel variant='raised'>Foo</Panel>);
17
+ expect(view).toMatchSnapshot();
18
+ });
19
+
20
+ test('renders content with bordered styling', () => {
21
+ const view = shallow(<Panel variant='bordered'>Foo</Panel>);
22
+ expect(view).toMatchSnapshot();
23
+ });
24
+
25
+ test('renders content with scrollable styling', () => {
26
+ const view = shallow(<Panel isScrollable>Foo</Panel>);
27
+ expect(view).toMatchSnapshot();
28
+ });
29
+ });
30
+
31
+ describe('PanelMain', () => {
32
+ test('renders content', () => {
33
+ const view = shallow(<PanelMain>Foo</PanelMain>);
34
+ expect(view).toMatchSnapshot();
35
+ });
36
+
37
+ test('renders content with the set maximum height', () => {
38
+ const view = shallow(<PanelMain maxHeight={'80px'}>Foo</PanelMain>);
39
+ expect(view).toMatchSnapshot();
40
+ });
41
+ });
42
+
43
+ describe('PanelMainBody', () => {
44
+ test('renders content', () => {
45
+ const view = shallow(<PanelMainBody>Foo</PanelMainBody>);
46
+ expect(view).toMatchSnapshot();
47
+ });
48
+ });
49
+
50
+ describe('PanelHeader', () => {
51
+ test('renders content', () => {
52
+ const view = shallow(<PanelHeader>Foo</PanelHeader>);
53
+ expect(view).toMatchSnapshot();
54
+ });
55
+ });
56
+
57
+ describe('PanelFooter', () => {
58
+ test('renders content', () => {
59
+ const view = shallow(<PanelFooter>Foo</PanelFooter>);
60
+ expect(view).toMatchSnapshot();
61
+ });
62
+ });
@@ -0,0 +1,83 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Panel renders content 1`] = `
4
+ <div
5
+ className="pf-c-panel"
6
+ >
7
+ Foo
8
+ </div>
9
+ `;
10
+
11
+ exports[`Panel renders content with bordered styling 1`] = `
12
+ <div
13
+ className="pf-c-panel pf-m-bordered"
14
+ >
15
+ Foo
16
+ </div>
17
+ `;
18
+
19
+ exports[`Panel renders content with raised styling 1`] = `
20
+ <div
21
+ className="pf-c-panel pf-m-raised"
22
+ >
23
+ Foo
24
+ </div>
25
+ `;
26
+
27
+ exports[`Panel renders content with scrollable styling 1`] = `
28
+ <div
29
+ className="pf-c-panel pf-m-scrollable"
30
+ >
31
+ Foo
32
+ </div>
33
+ `;
34
+
35
+ exports[`PanelFooter renders content 1`] = `
36
+ <div
37
+ className="pf-c-panel__footer"
38
+ >
39
+ Foo
40
+ </div>
41
+ `;
42
+
43
+ exports[`PanelHeader renders content 1`] = `
44
+ <div
45
+ className="pf-c-panel__header"
46
+ >
47
+ Foo
48
+ </div>
49
+ `;
50
+
51
+ exports[`PanelMain renders content 1`] = `
52
+ <div
53
+ className="pf-c-panel__main"
54
+ style={
55
+ Object {
56
+ "--pf-c-panel__main--MaxHeight": undefined,
57
+ }
58
+ }
59
+ >
60
+ Foo
61
+ </div>
62
+ `;
63
+
64
+ exports[`PanelMain renders content with the set maximum height 1`] = `
65
+ <div
66
+ className="pf-c-panel__main"
67
+ style={
68
+ Object {
69
+ "--pf-c-panel__main--MaxHeight": "80px",
70
+ }
71
+ }
72
+ >
73
+ Foo
74
+ </div>
75
+ `;
76
+
77
+ exports[`PanelMainBody renders content 1`] = `
78
+ <div
79
+ className="pf-c-panel__main-body"
80
+ >
81
+ Foo
82
+ </div>
83
+ `;
@@ -0,0 +1,203 @@
1
+ ---
2
+ id: Panel
3
+ section: components
4
+ cssPrefix: pf-c-panel
5
+ propComponents: [Panel, PanelMain, PanelMainBody, PanelHeader, PanelFooter]
6
+ beta: true
7
+ ---
8
+
9
+ ## Examples
10
+
11
+ ### Basic
12
+
13
+ ```js
14
+ import React from 'react';
15
+ import { Panel, PanelMain, PanelMainBody } from '@patternfly/react-core';
16
+
17
+ const BasicPanel = () => (
18
+ <Panel>
19
+ <PanelMain>
20
+ <PanelMainBody>Main content</PanelMainBody>
21
+ </PanelMain>
22
+ </Panel>
23
+ );
24
+ ```
25
+
26
+ ### Header
27
+
28
+ ```js
29
+ import React from 'react';
30
+ import { Panel, PanelMain, PanelMainBody, PanelHeader, Divider } from '@patternfly/react-core';
31
+
32
+ const HeaderPanel = () => (
33
+ <Panel>
34
+ <PanelHeader>Header content</PanelHeader>
35
+ <Divider />
36
+ <PanelMain>
37
+ <PanelMainBody>Main content</PanelMainBody>
38
+ </PanelMain>
39
+ </Panel>
40
+ );
41
+ ```
42
+
43
+ ### Footer
44
+
45
+ ```js
46
+ import React from 'react';
47
+ import { Panel, PanelMain, PanelMainBody, PanelFooter } from '@patternfly/react-core';
48
+
49
+ const FooterPanel = () => (
50
+ <Panel>
51
+ <PanelMain>
52
+ <PanelMainBody>Main content</PanelMainBody>
53
+ </PanelMain>
54
+ <PanelFooter>Footer content</PanelFooter>
55
+ </Panel>
56
+ );
57
+ ```
58
+
59
+ ### Header and footer
60
+
61
+ ```js
62
+ import React from 'react';
63
+ import { Panel, PanelMain, PanelMainBody, PanelHeader, Divider, PanelFooter } from '@patternfly/react-core';
64
+
65
+ const HeaderFooterPanel = () => (
66
+ <Panel>
67
+ <PanelHeader>Header content</PanelHeader>
68
+ <Divider />
69
+ <PanelMain>
70
+ <PanelMainBody>Main content</PanelMainBody>
71
+ </PanelMain>
72
+ <PanelFooter>Footer content</PanelFooter>
73
+ </Panel>
74
+ );
75
+ ```
76
+
77
+ ### No body
78
+
79
+ ```js
80
+ import React from 'react';
81
+ import { Panel, PanelMain } from '@patternfly/react-core';
82
+
83
+ const NoBodyPanel = () => (
84
+ <Panel>
85
+ <PanelMain>Main content</PanelMain>
86
+ </Panel>
87
+ );
88
+ ```
89
+
90
+ ### Raised
91
+
92
+ ```js
93
+ import React from 'react';
94
+ import { Panel, PanelMain, PanelMainBody } from '@patternfly/react-core';
95
+
96
+ const RaisedPanel = () => (
97
+ <Panel variant="raised">
98
+ <PanelMain>
99
+ <PanelMainBody>Main content</PanelMainBody>
100
+ </PanelMain>
101
+ </Panel>
102
+ );
103
+ ```
104
+
105
+ ### Bordered
106
+
107
+ ```js
108
+ import React from 'react';
109
+ import { Panel, PanelMain, PanelMainBody } from '@patternfly/react-core';
110
+
111
+ const BorderedPanel = () => (
112
+ <Panel variant="bordered">
113
+ <PanelMain>
114
+ <PanelMainBody>Main content</PanelMainBody>
115
+ </PanelMain>
116
+ </Panel>
117
+ );
118
+ ```
119
+
120
+ ### Scrollable
121
+
122
+ ```js
123
+ import React from 'react';
124
+ import { Panel, PanelMain, PanelMainBody } from '@patternfly/react-core';
125
+
126
+ const ScrollablePanel = () => (
127
+ <Panel isScrollable>
128
+ <PanelMain tabIndex={0}>
129
+ <PanelMainBody>
130
+ Main content
131
+ <br />
132
+ <br />
133
+ Main content
134
+ <br />
135
+ <br />
136
+ Main content
137
+ <br />
138
+ <br />
139
+ Main content
140
+ <br />
141
+ <br />
142
+ Main content
143
+ <br />
144
+ <br />
145
+ Main content
146
+ <br />
147
+ <br />
148
+ Main content
149
+ <br />
150
+ <br />
151
+ Main content
152
+ <br />
153
+ <br />
154
+ Main content
155
+ </PanelMainBody>
156
+ </PanelMain>
157
+ </Panel>
158
+ );
159
+ ```
160
+
161
+ ### Scrollable with header and footer
162
+
163
+ ```js
164
+ import React from 'react';
165
+ import { Panel, PanelMain, PanelMainBody, PanelHeader, Divider, PanelFooter } from '@patternfly/react-core';
166
+
167
+ const ScrollableHeaderFooterPanel = () => (
168
+ <Panel isScrollable>
169
+ <PanelHeader>Header content</PanelHeader>
170
+ <Divider />
171
+ <PanelMain tabIndex={0}>
172
+ <PanelMainBody>
173
+ Main content
174
+ <br />
175
+ <br />
176
+ Main content
177
+ <br />
178
+ <br />
179
+ Main content
180
+ <br />
181
+ <br />
182
+ Main content
183
+ <br />
184
+ <br />
185
+ Main content
186
+ <br />
187
+ <br />
188
+ Main content
189
+ <br />
190
+ <br />
191
+ Main content
192
+ <br />
193
+ <br />
194
+ Main content
195
+ <br />
196
+ <br />
197
+ Main content
198
+ </PanelMainBody>
199
+ </PanelMain>
200
+ <PanelFooter>Footer content</PanelFooter>
201
+ </Panel>
202
+ );
203
+ ```
@@ -0,0 +1,5 @@
1
+ export * from './Panel';
2
+ export * from './PanelMain';
3
+ export * from './PanelMainBody';
4
+ export * from './PanelHeader';
5
+ export * from './PanelFooter';
@@ -49,8 +49,8 @@ const TextInputGroupWithIcons = () => {
49
49
  const [inputValue, setInputValue] = React.useState('');
50
50
 
51
51
  /** callback for updating the inputValue state in this component so that the input can be controlled */
52
- const handleInputChange = event => {
53
- setInputValue(event.target.value);
52
+ const handleInputChange = (value, _event) => {
53
+ setInputValue(value);
54
54
  };
55
55
 
56
56
  /** show the input clearing button only when the input is not empty */
@@ -108,8 +108,8 @@ const TextInputGroupWithChips = () => {
108
108
  const showSearchIcon = !currentChips.length;
109
109
 
110
110
  /** callback for updating the inputValue state in this component so that the input can be controlled */
111
- const handleInputChange = event => {
112
- setInputValue(event.target.value);
111
+ const handleInputChange = (value, _event) => {
112
+ setInputValue(value);
113
113
  };
114
114
 
115
115
  /** callback for removing a chip from the chip selections */
@@ -6,6 +6,7 @@ propComponents: ['Tooltip']
6
6
  ---
7
7
 
8
8
  import OutlinedQuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/outlined-question-circle-icon';
9
+ import CopyIcon from '@patternfly/react-icons/dist/esm/icons/copy-icon';
9
10
  import './TooltipExamples.css';
10
11
 
11
12
  ## Examples
@@ -66,19 +67,24 @@ import { Tooltip } from '@patternfly/react-core';
66
67
  ### On icon
67
68
  ```js
68
69
  import React from 'react';
69
- import { Tooltip } from '@patternfly/react-core';
70
- import OutlinedQuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/outlined-question-circle-icon';
70
+ import { Tooltip, Button } from '@patternfly/react-core';
71
+ import CopyIcon from '@patternfly/react-icons/dist/esm/icons/copy-icon';
71
72
 
72
- <div style={{ margin: '100px' }}>
73
- <Tooltip
74
- position="top"
75
- content={
76
- <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id feugiat augue, nec fringilla turpis.</div>
77
- }
78
- >
79
- <OutlinedQuestionCircleIcon title="An icon with a tooltip" />
80
- </Tooltip>
81
- </div>
73
+ IconExample = () => {
74
+ const [showSuccessContent, setShowSuccessContent] = React.useState(false);
75
+ const copyText = 'Copy to clipboard';
76
+ const doneCopyText = 'Successfully copied to clipboard!';
77
+ const [content, setContent] = React.useState(copyText);
78
+ return (
79
+ <div style={{ margin: '100px' }}>
80
+ <Tooltip content={showSuccessContent ? doneCopyText : copyText}>
81
+ <Button variant="plain" id="tt-ref" onClick={() => setShowSuccessContent(!showSuccessContent)}>
82
+ <CopyIcon />
83
+ </Button>
84
+ </Tooltip>
85
+ </div>
86
+ );
87
+ };
82
88
  ```
83
89
 
84
90
  ### Options
@@ -80,3 +80,4 @@ export * from './TreeView';
80
80
  export * from './Wizard';
81
81
  export * from './DragDrop';
82
82
  export * from './TextInputGroup';
83
+ export * from './Panel';