@patternfly/react-table 6.0.0-alpha.3 → 6.0.0-alpha.30

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 (88) hide show
  1. package/CHANGELOG.md +300 -0
  2. package/components/package.json +1 -1
  3. package/deprecated/package.json +1 -1
  4. package/dist/dynamic/components/Table/package.json +1 -1
  5. package/dist/dynamic/components/Table/utils/decorators/package.json +1 -1
  6. package/dist/dynamic/components/Table/utils/package.json +1 -1
  7. package/dist/dynamic/deprecated/components/Table/base/package.json +1 -1
  8. package/dist/dynamic/deprecated/components/Table/package.json +1 -1
  9. package/dist/dynamic/deprecated/components/package.json +1 -1
  10. package/dist/esm/components/Table/EditableSelectInputCell.js +1 -1
  11. package/dist/esm/components/Table/EditableSelectInputCell.js.map +1 -1
  12. package/dist/esm/components/Table/EditableTextCell.js +1 -1
  13. package/dist/esm/components/Table/EditableTextCell.js.map +1 -1
  14. package/dist/esm/components/Table/SelectColumn.d.ts +5 -0
  15. package/dist/esm/components/Table/SelectColumn.d.ts.map +1 -1
  16. package/dist/esm/components/Table/SelectColumn.js +6 -3
  17. package/dist/esm/components/Table/SelectColumn.js.map +1 -1
  18. package/dist/esm/components/Table/SortColumn.d.ts +4 -0
  19. package/dist/esm/components/Table/SortColumn.d.ts.map +1 -1
  20. package/dist/esm/components/Table/SortColumn.js +2 -2
  21. package/dist/esm/components/Table/SortColumn.js.map +1 -1
  22. package/dist/esm/components/Table/TableText.d.ts +3 -1
  23. package/dist/esm/components/Table/TableText.d.ts.map +1 -1
  24. package/dist/esm/components/Table/TableText.js +12 -10
  25. package/dist/esm/components/Table/TableText.js.map +1 -1
  26. package/dist/esm/components/Table/TableTypes.d.ts +3 -0
  27. package/dist/esm/components/Table/TableTypes.d.ts.map +1 -1
  28. package/dist/esm/components/Table/Th.d.ts +3 -0
  29. package/dist/esm/components/Table/Th.d.ts.map +1 -1
  30. package/dist/esm/components/Table/Th.js +14 -7
  31. package/dist/esm/components/Table/Th.js.map +1 -1
  32. package/dist/esm/components/Table/utils/decorators/selectable.d.ts.map +1 -1
  33. package/dist/esm/components/Table/utils/decorators/selectable.js +2 -2
  34. package/dist/esm/components/Table/utils/decorators/selectable.js.map +1 -1
  35. package/dist/esm/components/Table/utils/decorators/sortable.d.ts.map +1 -1
  36. package/dist/esm/components/Table/utils/decorators/sortable.js +6 -3
  37. package/dist/esm/components/Table/utils/decorators/sortable.js.map +1 -1
  38. package/dist/js/components/Table/EditableSelectInputCell.js +1 -1
  39. package/dist/js/components/Table/EditableSelectInputCell.js.map +1 -1
  40. package/dist/js/components/Table/EditableTextCell.js +1 -1
  41. package/dist/js/components/Table/EditableTextCell.js.map +1 -1
  42. package/dist/js/components/Table/SelectColumn.d.ts +5 -0
  43. package/dist/js/components/Table/SelectColumn.d.ts.map +1 -1
  44. package/dist/js/components/Table/SelectColumn.js +6 -3
  45. package/dist/js/components/Table/SelectColumn.js.map +1 -1
  46. package/dist/js/components/Table/SortColumn.d.ts +4 -0
  47. package/dist/js/components/Table/SortColumn.d.ts.map +1 -1
  48. package/dist/js/components/Table/SortColumn.js +3 -2
  49. package/dist/js/components/Table/SortColumn.js.map +1 -1
  50. package/dist/js/components/Table/TableText.d.ts +3 -1
  51. package/dist/js/components/Table/TableText.d.ts.map +1 -1
  52. package/dist/js/components/Table/TableText.js +12 -10
  53. package/dist/js/components/Table/TableText.js.map +1 -1
  54. package/dist/js/components/Table/TableTypes.d.ts +3 -0
  55. package/dist/js/components/Table/TableTypes.d.ts.map +1 -1
  56. package/dist/js/components/Table/Th.d.ts +3 -0
  57. package/dist/js/components/Table/Th.d.ts.map +1 -1
  58. package/dist/js/components/Table/Th.js +14 -7
  59. package/dist/js/components/Table/Th.js.map +1 -1
  60. package/dist/js/components/Table/utils/decorators/selectable.d.ts.map +1 -1
  61. package/dist/js/components/Table/utils/decorators/selectable.js +2 -2
  62. package/dist/js/components/Table/utils/decorators/selectable.js.map +1 -1
  63. package/dist/js/components/Table/utils/decorators/sortable.d.ts.map +1 -1
  64. package/dist/js/components/Table/utils/decorators/sortable.js +6 -3
  65. package/dist/js/components/Table/utils/decorators/sortable.js.map +1 -1
  66. package/dist/umd/react-table.min.js +3 -3
  67. package/package.json +6 -6
  68. package/single-packages.config.json +3 -6
  69. package/src/components/Table/EditableSelectInputCell.tsx +1 -1
  70. package/src/components/Table/EditableTextCell.tsx +1 -1
  71. package/src/components/Table/SelectColumn.tsx +27 -8
  72. package/src/components/Table/SortColumn.tsx +15 -1
  73. package/src/components/Table/TableText.tsx +19 -9
  74. package/src/components/Table/TableTypes.tsx +3 -0
  75. package/src/components/Table/Th.tsx +16 -5
  76. package/src/components/Table/examples/TableEmptyState.tsx +1 -8
  77. package/src/components/Table/utils/decorators/selectable.tsx +2 -1
  78. package/src/components/Table/utils/decorators/sortable.tsx +8 -2
  79. package/src/demos/examples/TableBulkSelect.tsx +1 -1
  80. package/src/demos/examples/TableColumnManagement.tsx +1 -1
  81. package/src/demos/examples/TableColumnManagementWithDraggable.tsx +1 -1
  82. package/src/demos/examples/TableEmptyStateDefault.tsx +6 -8
  83. package/src/demos/examples/TableEmptyStateError.tsx +7 -18
  84. package/src/demos/examples/TableEmptyStateLoading.tsx +2 -12
  85. package/src/demos/examples/TableFilterable.tsx +1 -8
  86. package/src/demos/examples/TableSortableResponsive.tsx +3 -2
  87. package/src/deprecated/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +8 -8
  88. package/src/deprecated/components/Table/examples/LegacyTableEmptyState.tsx +6 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-table",
3
- "version": "6.0.0-alpha.3",
3
+ "version": "6.0.0-alpha.30",
4
4
  "description": "This library provides a set of React table components for use with the PatternFly 4",
5
5
  "main": "dist/js/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -40,10 +40,10 @@
40
40
  "subpaths": "node ../../scripts/exportSubpaths.js --config subpaths.config.json"
41
41
  },
42
42
  "dependencies": {
43
- "@patternfly/react-core": "^6.0.0-alpha.3",
44
- "@patternfly/react-icons": "^6.0.0-alpha.3",
45
- "@patternfly/react-styles": "^6.0.0-alpha.3",
46
- "@patternfly/react-tokens": "^6.0.0-alpha.3",
43
+ "@patternfly/react-core": "^6.0.0-alpha.30",
44
+ "@patternfly/react-icons": "^6.0.0-alpha.11",
45
+ "@patternfly/react-styles": "^6.0.0-alpha.11",
46
+ "@patternfly/react-tokens": "^6.0.0-alpha.11",
47
47
  "lodash": "^4.17.19",
48
48
  "tslib": "^2.5.0"
49
49
  },
@@ -55,5 +55,5 @@
55
55
  "react": "^17 || ^18",
56
56
  "react-dom": "^17 || ^18"
57
57
  },
58
- "gitHead": "da36134a3effa82a166c47f5b1c2689869a0f52a"
58
+ "gitHead": "a0d48218e63cd489c8b59556e59989559ba8ba65"
59
59
  }
@@ -1,7 +1,4 @@
1
1
  {
2
- "packageName": "@patternfly/react-table",
3
- "exclude": [
4
- "dist/esm/deprecated/index.js",
5
- "dist/esm/next/index.js"
6
- ]
7
- }
2
+ "packageName": "@patternfly/react-table",
3
+ "exclude": ["dist/esm/deprecated/index.js", "dist/esm/next/index.js"]
4
+ }
@@ -76,7 +76,7 @@ export const EditableSelectInputCell: React.FunctionComponent<IEditableSelectInp
76
76
  <div className={inlineStyles.inlineEditValue}>{Array.isArray(value) ? value.join(', ') : value}</div>
77
77
  <div className={inlineStyles.inlineEditInput}>
78
78
  {select}
79
- <div className={css(formStyles.formHelperText, formStyles.modifiers.error)} aria-live="polite">
79
+ <div className={css(formStyles.formHelperText)} aria-live="polite">
80
80
  {props.errorText}
81
81
  </div>
82
82
  </div>
@@ -49,7 +49,7 @@ export const EditableTextCell: React.FunctionComponent<IEditableTextCell> = ({
49
49
  }}
50
50
  aria-label={inputAriaLabel}
51
51
  />
52
- <div className={css(formStyles.formHelperText, formStyles.modifiers.error)} aria-live="polite">
52
+ <div className={css(formStyles.formHelperText)} aria-live="polite">
53
53
  {props.errorText}
54
54
  </div>
55
55
  </div>
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { Tooltip, TooltipProps } from '@patternfly/react-core/dist/esm/components/Tooltip';
2
3
 
3
4
  export enum RowSelectVariant {
4
5
  radio = 'radio',
@@ -11,6 +12,10 @@ export interface SelectColumnProps {
11
12
  className?: string;
12
13
  onSelect?: (event: React.FormEvent<HTMLInputElement>) => void;
13
14
  selectVariant?: RowSelectVariant;
15
+ /** text to display on the tooltip */
16
+ tooltip?: React.ReactNode;
17
+ /** other props to pass to the tooltip */
18
+ tooltipProps?: Omit<TooltipProps, 'content'>;
14
19
  }
15
20
 
16
21
  export const SelectColumn: React.FunctionComponent<SelectColumnProps> = ({
@@ -19,13 +24,27 @@ export const SelectColumn: React.FunctionComponent<SelectColumnProps> = ({
19
24
  className,
20
25
  onSelect = null as (event: React.FormEvent<HTMLInputElement>) => void,
21
26
  selectVariant,
27
+ tooltip,
28
+ tooltipProps,
22
29
  ...props
23
- }: SelectColumnProps) => (
24
- <React.Fragment>
25
- <label>
26
- <input {...props} type={selectVariant} onChange={onSelect} />
27
- </label>
28
- {children}
29
- </React.Fragment>
30
- );
30
+ }: SelectColumnProps) => {
31
+ const inputRef = React.createRef<HTMLInputElement>();
32
+
33
+ const content = (
34
+ <React.Fragment>
35
+ <label>
36
+ <input {...props} ref={inputRef} type={selectVariant} onChange={onSelect} />
37
+ </label>
38
+ {children}
39
+ </React.Fragment>
40
+ );
41
+
42
+ return tooltip ? (
43
+ <Tooltip triggerRef={inputRef} content={tooltip} {...tooltipProps}>
44
+ {content}
45
+ </Tooltip>
46
+ ) : (
47
+ content
48
+ );
49
+ };
31
50
  SelectColumn.displayName = 'SelectColumn';
@@ -5,6 +5,7 @@ import ArrowsAltVIcon from '@patternfly/react-icons/dist/esm/icons/arrows-alt-v-
5
5
  import { css } from '@patternfly/react-styles';
6
6
  import styles from '@patternfly/react-styles/css/components/Table/table';
7
7
  import { TableText } from './TableText';
8
+ import { TooltipProps } from '@patternfly/react-core/dist/esm/components/Tooltip';
8
9
 
9
10
  export enum SortByDirection {
10
11
  asc = 'asc',
@@ -17,6 +18,9 @@ export interface SortColumnProps extends React.ButtonHTMLAttributes<HTMLButtonEl
17
18
  isSortedBy?: boolean;
18
19
  onSort?: Function;
19
20
  sortDirection?: string;
21
+ tooltip?: React.ReactNode;
22
+ tooltipProps?: Omit<TooltipProps, 'content'>;
23
+ tooltipHasDefaultBehavior?: boolean;
20
24
  }
21
25
 
22
26
  export const SortColumn: React.FunctionComponent<SortColumnProps> = ({
@@ -26,6 +30,9 @@ export const SortColumn: React.FunctionComponent<SortColumnProps> = ({
26
30
  onSort = null,
27
31
  sortDirection = '',
28
32
  type = 'button',
33
+ tooltip,
34
+ tooltipProps,
35
+ tooltipHasDefaultBehavior,
29
36
  ...props
30
37
  }: SortColumnProps) => {
31
38
  let SortedByIcon;
@@ -45,7 +52,14 @@ export const SortColumn: React.FunctionComponent<SortColumnProps> = ({
45
52
  onBlur={() => setFocused(false)}
46
53
  >
47
54
  <div className={css(className, styles.tableButtonContent)}>
48
- <TableText focused={focused}>{children}</TableText>
55
+ <TableText
56
+ tooltip={tooltip}
57
+ tooltipProps={tooltipProps}
58
+ tooltipHasDefaultBehavior={tooltipHasDefaultBehavior}
59
+ focused={focused}
60
+ >
61
+ {children}
62
+ </TableText>
49
63
  <span className={css(styles.tableSortIndicator)}>
50
64
  <SortedByIcon />
51
65
  </span>
@@ -26,13 +26,15 @@ export interface TableTextProps extends React.HTMLProps<HTMLDivElement> {
26
26
  /** Determines which wrapping modifier to apply to the table text */
27
27
  wrapModifier?: WrapModifier | 'wrap' | 'nowrap' | 'truncate' | 'breakWord' | 'fitContent';
28
28
  /** text to display on the tooltip */
29
- tooltip?: string;
29
+ tooltip?: React.ReactNode;
30
30
  /** other props to pass to the tooltip */
31
31
  tooltipProps?: Omit<TooltipProps, 'content'>;
32
32
  /** callback used to create the tooltip if text is truncated */
33
33
  onMouseEnter?: (event: any) => void;
34
34
  /** Determines if the TableText is focused by parent component */
35
35
  focused?: boolean;
36
+ /** Determines if tooltip should have normal visbility behavior. If false, the tooltip will only be shown when children is not entirely visible */
37
+ tooltipHasDefaultBehavior?: boolean;
36
38
  }
37
39
 
38
40
  export const TableText: React.FunctionComponent<TableTextProps> = ({
@@ -44,12 +46,13 @@ export const TableText: React.FunctionComponent<TableTextProps> = ({
44
46
  tooltipProps = {},
45
47
  onMouseEnter: onMouseEnterProp = () => {},
46
48
  focused = false,
49
+ tooltipHasDefaultBehavior = false,
47
50
  ...props
48
51
  }: TableTextProps) => {
49
52
  const Component: TableTextVariant | 'span' | 'div' = variant;
50
53
  const textRef = React.createRef<HTMLElement>();
51
54
 
52
- const [tooltip, setTooltip] = React.useState('');
55
+ const [tooltip, setTooltip] = React.useState(tooltipProp);
53
56
  const onMouseEnter = (event: any) => {
54
57
  if (event.target.offsetWidth < event.target.scrollWidth) {
55
58
  setTooltip(tooltipProp || event.target.innerText);
@@ -70,7 +73,7 @@ export const TableText: React.FunctionComponent<TableTextProps> = ({
70
73
  const text = (
71
74
  <Component
72
75
  ref={textRef as React.Ref<HTMLDivElement>}
73
- onMouseEnter={onMouseEnter}
76
+ onMouseEnter={!tooltipHasDefaultBehavior ? onMouseEnter : undefined}
74
77
  className={css(className, wrapModifier && styles.modifiers[wrapModifier], styles.tableText)}
75
78
  {...props}
76
79
  >
@@ -79,15 +82,22 @@ export const TableText: React.FunctionComponent<TableTextProps> = ({
79
82
  );
80
83
 
81
84
  React.useEffect(() => {
82
- if (focused) {
83
- onFocus(textRef.current);
84
- } else {
85
- setTooltip('');
85
+ if (!tooltipHasDefaultBehavior) {
86
+ if (focused) {
87
+ onFocus(textRef.current);
88
+ } else {
89
+ setTooltip('');
90
+ }
86
91
  }
87
- }, [focused]);
92
+ }, [focused, tooltipHasDefaultBehavior]);
88
93
 
89
94
  return tooltip !== '' ? (
90
- <Tooltip triggerRef={textRef} content={tooltip} isVisible {...tooltipProps}>
95
+ <Tooltip
96
+ triggerRef={textRef}
97
+ content={tooltip}
98
+ {...(!tooltipHasDefaultBehavior && { isVisible: true })}
99
+ {...tooltipProps}
100
+ >
91
101
  {text}
92
102
  </Tooltip>
93
103
  ) : (
@@ -132,6 +132,9 @@ export interface IExtra extends IExtraData {
132
132
  rowData?: IRowData;
133
133
  className?: string;
134
134
  ariaLabel?: string;
135
+ tooltip?: React.ReactNode;
136
+ tooltipProps?: Omit<TooltipProps, 'content'>;
137
+ tooltipHasDefaultBehavior?: boolean;
135
138
  }
136
139
 
137
140
  export type IFormatterValueType = formatterValueType & {
@@ -6,7 +6,7 @@ import { info, sortable, sortableFavorites, selectable, collapsible, cellWidth,
6
6
  import { ThInfoType, ThSelectType, ThExpandType, ThSortType, formatterValueType } from './base/types';
7
7
  import { mergeProps } from './base/merge-props';
8
8
  import { IVisibility } from './utils/decorators/classNames';
9
- import { Tooltip } from '@patternfly/react-core/dist/esm/components/Tooltip/Tooltip';
9
+ import { Tooltip, TooltipProps } from '@patternfly/react-core/dist/esm/components/Tooltip';
10
10
  import { BaseCellProps } from './Table';
11
11
  import { IFormatterValueType, IColumn } from './TableTypes';
12
12
  import cssStickyCellMinWidth from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_MinWidth';
@@ -34,6 +34,8 @@ export interface ThProps
34
34
  * To disable it completely you can set it to null.
35
35
  */
36
36
  tooltip?: React.ReactNode;
37
+ /** other props to pass to the tooltip */
38
+ tooltipProps?: Omit<TooltipProps, 'content'>;
37
39
  /** Callback on mouse enter */
38
40
  onMouseEnter?: (event: any) => void;
39
41
  /** Adds tooltip/popover info button */
@@ -68,6 +70,7 @@ const ThBase: React.FunctionComponent<ThProps> = ({
68
70
  select = null,
69
71
  expand: collapse = null,
70
72
  tooltip = '',
73
+ tooltipProps,
71
74
  onMouseEnter: onMouseEnterProp = () => {},
72
75
  width,
73
76
  visibility,
@@ -99,7 +102,9 @@ const ThBase: React.FunctionComponent<ThProps> = ({
99
102
  sortParams = sortableFavorites({
100
103
  onSort: sort?.onSort,
101
104
  columnIndex: sort.columnIndex,
102
- sortBy: sort.sortBy
105
+ sortBy: sort.sortBy,
106
+ tooltip: tooltip as string,
107
+ tooltipProps
103
108
  })();
104
109
  } else {
105
110
  sortParams = sortable(children as IFormatterValueType, {
@@ -109,7 +114,9 @@ const ThBase: React.FunctionComponent<ThProps> = ({
109
114
  sortBy: sort.sortBy,
110
115
  onSort: sort?.onSort
111
116
  }
112
- } as IColumn
117
+ } as IColumn,
118
+ tooltip: tooltip as string,
119
+ tooltipProps
113
120
  });
114
121
  }
115
122
  }
@@ -127,7 +134,9 @@ const ThBase: React.FunctionComponent<ThProps> = ({
127
134
  allRowsSelected: select.isSelected,
128
135
  isHeaderSelectDisabled: !!select.isHeaderSelectDisabled
129
136
  }
130
- }
137
+ },
138
+ tooltip: tooltip as string,
139
+ tooltipProps
131
140
  })
132
141
  : null;
133
142
  const collapseParams = collapse
@@ -208,13 +217,15 @@ const ThBase: React.FunctionComponent<ThProps> = ({
208
217
  );
209
218
 
210
219
  const canMakeDefaultTooltip = tooltip === '' ? typeof transformedChildren === 'string' : true;
211
- return tooltip !== null && canMakeDefaultTooltip && showTooltip ? (
220
+ const childControlsTooltip = sortParams || selectParams;
221
+ return tooltip !== null && canMakeDefaultTooltip && !childControlsTooltip && showTooltip ? (
212
222
  <>
213
223
  {cell}
214
224
  <Tooltip
215
225
  triggerRef={cellRef as React.RefObject<any>}
216
226
  content={tooltip || (tooltip === '' && children)}
217
227
  isVisible
228
+ {...tooltipProps}
218
229
  />
219
230
  </>
220
231
  ) : (
@@ -4,10 +4,8 @@ import {
4
4
  Bullseye,
5
5
  EmptyState,
6
6
  EmptyStateVariant,
7
- EmptyStateIcon,
8
7
  EmptyStateBody,
9
8
  Button,
10
- EmptyStateHeader,
11
9
  EmptyStateFooter,
12
10
  EmptyStateActions
13
11
  } from '@patternfly/react-core';
@@ -31,12 +29,7 @@ export const TableEmptyState: React.FunctionComponent = () => (
31
29
  <Tr>
32
30
  <Td colSpan={8}>
33
31
  <Bullseye>
34
- <EmptyState variant={EmptyStateVariant.sm}>
35
- <EmptyStateHeader
36
- icon={<EmptyStateIcon icon={SearchIcon} />}
37
- titleText="No results found"
38
- headingLevel="h2"
39
- />
32
+ <EmptyState headingLevel="h2" titleText="No results found" icon={SearchIcon} variant={EmptyStateVariant.sm}>
40
33
  <EmptyStateBody>Clear all filters and try again.</EmptyStateBody>
41
34
  <EmptyStateFooter>
42
35
  <EmptyStateActions>
@@ -7,7 +7,7 @@ import checkStyles from '@patternfly/react-styles/css/components/Check/check';
7
7
 
8
8
  export const selectable: ITransform = (
9
9
  label: IFormatterValueType,
10
- { rowIndex, columnIndex, rowData, column, property }: IExtra
10
+ { rowIndex, columnIndex, rowData, column, property, tooltip }: IExtra
11
11
  ) => {
12
12
  const {
13
13
  extraParams: { onSelect, selectVariant, allRowsSelected, isHeaderSelectDisabled }
@@ -69,6 +69,7 @@ export const selectable: ITransform = (
69
69
  selectVariant={selectVariant as RowSelectVariant}
70
70
  onSelect={selectClick}
71
71
  name={selectName}
72
+ tooltip={tooltip}
72
73
  >
73
74
  {label as React.ReactNode}
74
75
  </SelectColumn>
@@ -15,12 +15,15 @@ export const sortableFavorites = (sort: any) => () =>
15
15
  sortBy: sort.sortBy,
16
16
  onSort: sort?.onSort
17
17
  }
18
- }
18
+ },
19
+ tooltip: sort.tooltip,
20
+ tooltipProps: sort.tooltipProps,
21
+ tooltipHasDefaultBehavior: true
19
22
  });
20
23
 
21
24
  export const sortable: ITransform = (
22
25
  label: IFormatterValueType,
23
- { columnIndex, column, property, className, ariaLabel }: IExtra
26
+ { columnIndex, column, property, className, ariaLabel, tooltip, tooltipProps, tooltipHasDefaultBehavior }: IExtra
24
27
  ) => {
25
28
  const {
26
29
  extraParams: { sortBy, onSort }
@@ -56,6 +59,9 @@ export const sortable: ITransform = (
56
59
  sortDirection={isSortedBy ? sortBy.direction : ''}
57
60
  onSort={sortClicked}
58
61
  aria-label={ariaLabel}
62
+ tooltip={tooltip}
63
+ tooltipProps={tooltipProps}
64
+ tooltipHasDefaultBehavior={tooltipHasDefaultBehavior}
59
65
  >
60
66
  {label as React.ReactNode}
61
67
  </SortColumn>
@@ -140,7 +140,7 @@ export const TableBulkSelect: React.FunctionComponent = () => {
140
140
  <Toolbar>
141
141
  <ToolbarContent>
142
142
  <ToolbarGroup>
143
- <ToolbarItem variant="bulk-select">{buildBulkSelectDropdown()}</ToolbarItem>
143
+ <ToolbarItem>{buildBulkSelectDropdown()}</ToolbarItem>
144
144
  </ToolbarGroup>
145
145
  <ToolbarItem variant="pagination">{buildPagination('top', false)}</ToolbarItem>
146
146
  </ToolbarContent>
@@ -401,7 +401,7 @@ export const TableColumnManagement: React.FunctionComponent = () => {
401
401
  Choose one
402
402
  </span>
403
403
  <ToolbarContent>
404
- <ToolbarItem variant="overflow-menu">
404
+ <ToolbarItem>
405
405
  <OverflowMenu breakpoint="md">
406
406
  <OverflowMenuItem>
407
407
  <MenuToggle>
@@ -590,7 +590,7 @@ export const TableColumnManagementWithDraggable: React.FunctionComponent = () =>
590
590
  Choose one
591
591
  </span>
592
592
  <ToolbarContent>
593
- <ToolbarItem variant="overflow-menu">
593
+ <ToolbarItem>
594
594
  <OverflowMenu breakpoint="md">
595
595
  <OverflowMenuItem isPersistent>
596
596
  <MenuToggle>
@@ -6,9 +6,7 @@ import {
6
6
  Card,
7
7
  EmptyState,
8
8
  EmptyStateVariant,
9
- EmptyStateIcon,
10
9
  EmptyStateBody,
11
- EmptyStateHeader,
12
10
  EmptyStateFooter,
13
11
  EmptyStateActions,
14
12
  PageSection
@@ -34,12 +32,12 @@ export const TableEmptyStateDefault: React.FunctionComponent = () => (
34
32
  <Tr>
35
33
  <Td colSpan={8}>
36
34
  <Bullseye>
37
- <EmptyState variant={EmptyStateVariant.sm}>
38
- <EmptyStateHeader
39
- icon={<EmptyStateIcon icon={SearchIcon} />}
40
- titleText="No results found"
41
- headingLevel="h2"
42
- />
35
+ <EmptyState
36
+ headingLevel="h2"
37
+ titleText="No results found"
38
+ icon={SearchIcon}
39
+ variant={EmptyStateVariant.sm}
40
+ >
43
41
  <EmptyStateBody>
44
42
  No results match this filter criteria. Clear all filters and try again.
45
43
  </EmptyStateBody>
@@ -1,17 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
3
- import {
4
- Bullseye,
5
- Card,
6
- EmptyState,
7
- EmptyStateVariant,
8
- EmptyStateIcon,
9
- EmptyStateBody,
10
- EmptyStateHeader,
11
- PageSection
12
- } from '@patternfly/react-core';
13
- import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
14
- import globalDangerColor200 from '@patternfly/react-tokens/dist/esm/global_danger_color_200';
3
+ import { Bullseye, Card, EmptyState, EmptyStateVariant, EmptyStateBody, PageSection } from '@patternfly/react-core';
15
4
  import { DashboardWrapper } from '@patternfly/react-core/dist/esm/demos/DashboardWrapper';
16
5
 
17
6
  export const TableEmptyStateError: React.FunctionComponent = () => (
@@ -32,12 +21,12 @@ export const TableEmptyStateError: React.FunctionComponent = () => (
32
21
  <Tr>
33
22
  <Td colSpan={8}>
34
23
  <Bullseye>
35
- <EmptyState variant={EmptyStateVariant.sm}>
36
- <EmptyStateHeader
37
- titleText="Unable to connect"
38
- icon={<EmptyStateIcon icon={ExclamationCircleIcon} color={globalDangerColor200.value} />}
39
- headingLevel="h2"
40
- />
24
+ <EmptyState
25
+ headingLevel="h2"
26
+ titleText="Unable to connect"
27
+ status="danger"
28
+ variant={EmptyStateVariant.sm}
29
+ >
41
30
  <EmptyStateBody>
42
31
  There was an error retrieving data. Check your connection and reload the page.
43
32
  </EmptyStateBody>
@@ -1,14 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
3
- import {
4
- Bullseye,
5
- Card,
6
- EmptyState,
7
- EmptyStateIcon,
8
- EmptyStateHeader,
9
- PageSection,
10
- Spinner
11
- } from '@patternfly/react-core';
3
+ import { Bullseye, Card, EmptyState, PageSection, Spinner } from '@patternfly/react-core';
12
4
  import { DashboardWrapper } from '@patternfly/react-core/dist/esm/demos/DashboardWrapper';
13
5
 
14
6
  export const TableEmptyStateLoading: React.FunctionComponent = () => (
@@ -29,9 +21,7 @@ export const TableEmptyStateLoading: React.FunctionComponent = () => (
29
21
  <Tr>
30
22
  <Td colSpan={8}>
31
23
  <Bullseye>
32
- <EmptyState>
33
- <EmptyStateHeader titleText="Loading" headingLevel="h2" icon={<EmptyStateIcon icon={Spinner} />} />
34
- </EmptyState>
24
+ <EmptyState headingLevel="h2" titleText="Loading" icon={Spinner}></EmptyState>
35
25
  </Bullseye>
36
26
  </Td>
37
27
  </Tr>
@@ -6,8 +6,6 @@ import {
6
6
  EmptyState,
7
7
  EmptyStateActions,
8
8
  EmptyStateBody,
9
- EmptyStateIcon,
10
- EmptyStateHeader,
11
9
  EmptyStateFooter,
12
10
  Label,
13
11
  MenuToggle,
@@ -308,12 +306,7 @@ export const TableFilterable: React.FunctionComponent = () => {
308
306
  : rowData;
309
307
 
310
308
  const emptyState = (
311
- <EmptyState>
312
- <EmptyStateHeader
313
- titleText="Clear all filters and try again."
314
- headingLevel="h5"
315
- icon={<EmptyStateIcon icon={SearchIcon} />}
316
- />
309
+ <EmptyState headingLevel="h5" titleText="Clear all filters and try again." icon={SearchIcon}>
317
310
  <EmptyStateBody>No results match the filter criteria. Clear all filters and try again.</EmptyStateBody>
318
311
  <EmptyStateFooter>
319
312
  <EmptyStateActions>
@@ -28,7 +28,8 @@ import {
28
28
  OverflowMenuContent,
29
29
  OverflowMenuControl,
30
30
  OverflowMenuGroup,
31
- OverflowMenuItem
31
+ OverflowMenuItem,
32
+ PageSectionVariants
32
33
  } from '@patternfly/react-core';
33
34
  import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
34
35
  import CloneIcon from '@patternfly/react-icons/dist/esm/icons/clone-icon';
@@ -232,7 +233,7 @@ export const TableSortableResponsive: React.FunctionComponent = () => {
232
233
  return (
233
234
  <React.Fragment>
234
235
  <DashboardWrapper>
235
- <PageSection isWidthLimited>
236
+ <PageSection isWidthLimited variant={PageSectionVariants.light}>
236
237
  <TextContent>
237
238
  <Text component="h1">Table demos</Text>
238
239
  <Text component="p">
@@ -10272,7 +10272,7 @@ exports[`Table simple Editable table 1`] = `
10272
10272
  </span>
10273
10273
  <div
10274
10274
  aria-live="polite"
10275
- class="pf-v5-c-form__helper-text pf-m-error"
10275
+ class="pf-v5-c-form__helper-text"
10276
10276
  />
10277
10277
  </div>
10278
10278
  </td>
@@ -10306,7 +10306,7 @@ exports[`Table simple Editable table 1`] = `
10306
10306
  </span>
10307
10307
  <div
10308
10308
  aria-live="polite"
10309
- class="pf-v5-c-form__helper-text pf-m-error"
10309
+ class="pf-v5-c-form__helper-text"
10310
10310
  />
10311
10311
  </div>
10312
10312
  </td>
@@ -10339,7 +10339,7 @@ exports[`Table simple Editable table 1`] = `
10339
10339
  </span>
10340
10340
  <div
10341
10341
  aria-live="polite"
10342
- class="pf-v5-c-form__helper-text pf-m-error"
10342
+ class="pf-v5-c-form__helper-text"
10343
10343
  />
10344
10344
  </div>
10345
10345
  </td>
@@ -10372,7 +10372,7 @@ exports[`Table simple Editable table 1`] = `
10372
10372
  </span>
10373
10373
  <div
10374
10374
  aria-live="polite"
10375
- class="pf-v5-c-form__helper-text pf-m-error"
10375
+ class="pf-v5-c-form__helper-text"
10376
10376
  />
10377
10377
  </div>
10378
10378
  </td>
@@ -10503,7 +10503,7 @@ exports[`Table simple Editable table 1`] = `
10503
10503
  </span>
10504
10504
  <div
10505
10505
  aria-live="polite"
10506
- class="pf-v5-c-form__helper-text pf-m-error"
10506
+ class="pf-v5-c-form__helper-text"
10507
10507
  />
10508
10508
  </div>
10509
10509
  </td>
@@ -10537,7 +10537,7 @@ exports[`Table simple Editable table 1`] = `
10537
10537
  </span>
10538
10538
  <div
10539
10539
  aria-live="polite"
10540
- class="pf-v5-c-form__helper-text pf-m-error"
10540
+ class="pf-v5-c-form__helper-text"
10541
10541
  />
10542
10542
  </div>
10543
10543
  </td>
@@ -10570,7 +10570,7 @@ exports[`Table simple Editable table 1`] = `
10570
10570
  </span>
10571
10571
  <div
10572
10572
  aria-live="polite"
10573
- class="pf-v5-c-form__helper-text pf-m-error"
10573
+ class="pf-v5-c-form__helper-text"
10574
10574
  />
10575
10575
  </div>
10576
10576
  </td>
@@ -10603,7 +10603,7 @@ exports[`Table simple Editable table 1`] = `
10603
10603
  </span>
10604
10604
  <div
10605
10605
  aria-live="polite"
10606
- class="pf-v5-c-form__helper-text pf-m-error"
10606
+ class="pf-v5-c-form__helper-text"
10607
10607
  />
10608
10608
  </div>
10609
10609
  </td>
@@ -4,10 +4,8 @@ import {
4
4
  Bullseye,
5
5
  EmptyState,
6
6
  EmptyStateVariant,
7
- EmptyStateIcon,
8
7
  EmptyStateBody,
9
8
  Button,
10
- EmptyStateHeader,
11
9
  EmptyStateFooter,
12
10
  EmptyStateActions
13
11
  } from '@patternfly/react-core';
@@ -26,12 +24,12 @@ export const LegacyTableEmptyState: React.FunctionComponent = () => {
26
24
  props: { colSpan: 8 },
27
25
  title: (
28
26
  <Bullseye>
29
- <EmptyState variant={EmptyStateVariant.sm}>
30
- <EmptyStateHeader
31
- titleText="No results found"
32
- icon={<EmptyStateIcon icon={SearchIcon} />}
33
- headingLevel="h2"
34
- />
27
+ <EmptyState
28
+ headingLevel="h2"
29
+ titleText="No results found"
30
+ icon={SearchIcon}
31
+ variant={EmptyStateVariant.sm}
32
+ >
35
33
  <EmptyStateBody>Clear all filters and try again.</EmptyStateBody>
36
34
  <EmptyStateFooter>
37
35
  <EmptyStateActions>