@patternfly/react-core 4.242.4 → 4.242.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.242.4",
3
+ "version": "4.242.6",
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",
@@ -70,5 +70,5 @@
70
70
  "react": "^16.8 || ^17 || ^18",
71
71
  "react-dom": "^16.8 || ^17 || ^18"
72
72
  },
73
- "gitHead": "9c5cb016c12b1b532b590285d6607b0c21778960"
73
+ "gitHead": "86301659315c78434e511835e9b51107ab4132e6"
74
74
  }
@@ -45,7 +45,7 @@ export interface DatePickerProps
45
45
  */
46
46
  appendTo?: HTMLElement | ((ref?: HTMLElement) => HTMLElement) | 'parent';
47
47
  /** Props to pass to the Popover */
48
- popoverProps?: Omit<PopoverProps, 'appendTo'>;
48
+ popoverProps?: Partial<Omit<PopoverProps, 'appendTo'>>;
49
49
  /** Functions that returns an error message if a date is invalid */
50
50
  validators?: ((date: Date) => string)[];
51
51
  /** Additional props for input field */
@@ -11,125 +11,34 @@ import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
11
11
 
12
12
  ## Examples
13
13
 
14
- Keyboard interaction patterns and a11y is implemented in the Tile demos, located in the [Demo section](/documentation/react/demos/tiledemo).
14
+ Keyboard interaction patterns and a11y is implemented in the Tile demos, located in the [Demo section](/components/tile/react-demos).
15
15
 
16
16
  ### Basic
17
17
 
18
- ```js
19
- import React from 'react';
20
- import { Tile } from '@patternfly/react-core';
21
-
22
- <div role="listbox" aria-label="Basic tiles">
23
- <Tile title="Default" isSelected={false} />
24
- <Tile title="Selected" isSelected />
25
- <Tile title="Disabled" isDisabled isSelected={false} />
26
- </div>;
18
+ ```ts file="./TileBasic.tsx"
27
19
  ```
28
20
 
29
21
  ### With subtext
30
22
 
31
- ```js
32
- import React from 'react';
33
- import { Tile } from '@patternfly/react-core';
34
-
35
- <div role="listbox" aria-label="Tiles with subtext">
36
- <Tile title="Default" isSelected={false}>
37
- Subtext goes here
38
- </Tile>{' '}
39
- <Tile title="Selected" isSelected>
40
- Subtext goes here
41
- </Tile>{' '}
42
- <Tile title="Disabled" isDisabled isSelected={false}>
43
- Subtext goes here
44
- </Tile>
45
- </div>;
23
+ ```ts file="./TileWithSubtext.tsx"
46
24
  ```
47
25
 
48
26
  ### With icon
49
27
 
50
- ```js
51
- import React from 'react';
52
- import { Tile } from '@patternfly/react-core';
53
- import PlusIcon from '@patternfly/react-icons/dist/esm/icons/plus-icon';
54
-
55
- <div role="listbox" aria-label="Tiles with icon">
56
- <Tile title="Default" icon={<PlusIcon />} isSelected={false}>
57
- Subtext goes here
58
- </Tile>{' '}
59
- <Tile title="Selected" icon={<PlusIcon />} isSelected>
60
- Subtext goes here
61
- </Tile>{' '}
62
- <Tile title="Disabled" icon={<PlusIcon />} isDisabled isSelected={false}>
63
- Subtext goes here
64
- </Tile>
65
- </div>;
28
+ ```ts file="./TileWithIcon.tsx"
66
29
  ```
67
30
 
68
31
  ### Stacked
69
32
 
70
- ```js
71
- import React from 'react';
72
- import { Tile } from '@patternfly/react-core';
73
- import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
74
-
75
- <div role="listbox" aria-label="Stacked tiles">
76
- <Tile title="Default" icon={<BellIcon />} isStacked isSelected={false}>
77
- Subtext goes here
78
- </Tile>{' '}
79
- <Tile title="Selected" icon={<BellIcon />} isStacked isSelected>
80
- Subtext goes here
81
- </Tile>{' '}
82
- <Tile title="Disabled" icon={<BellIcon />} isStacked isDisabled isSelected={false}>
83
- Subtext goes here
84
- </Tile>
85
- </div>;
33
+ ```ts file="./TileStacked.tsx"
86
34
  ```
87
35
 
88
36
  ### Stacked with large icons
89
37
 
90
- ```js
91
- import React from 'react';
92
- import { Tile } from '@patternfly/react-core';
93
- import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
94
-
95
- <div role="listbox" aria-label="Stacked tiles with large icons">
96
- <Tile title="Default" icon={<BellIcon />} isStacked isDisplayLarge isSelected={false}>
97
- Subtext goes here
98
- </Tile>{' '}
99
- <Tile title="Selected" icon={<BellIcon />} isStacked isDisplayLarge isSelected>
100
- Subtext goes here
101
- </Tile>{' '}
102
- <Tile title="Disabled" icon={<BellIcon />} isStacked isDisplayLarge isDisabled isSelected={false}>
103
- Subtext goes here
104
- </Tile>
105
- </div>;
38
+ ```ts file="./TileStackedWithLargeIcons.tsx"
106
39
  ```
107
40
 
108
41
  ### With extra content
109
42
 
110
- ```js
111
- import React from 'react';
112
- import { Tile, Flex } from '@patternfly/react-core';
113
- import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
114
-
115
- <div role="listbox" aria-label="Tiles with extra content">
116
- <Flex>
117
- <Flex flex={{ default: 'flex_1' }}>
118
- <Tile title="Default" icon={<BellIcon />} isStacked isSelected={false}>
119
- This is really really long subtext that goes on for so long that it has to wrap to the next line. This is really
120
- really long subtext that goes on for so long that it has to wrap to the next line.
121
- </Tile>
122
- </Flex>
123
- <Flex flex={{ default: 'flex_1' }}>
124
- <Tile title="Selected" icon={<BellIcon />} isStacked isSelected>
125
- This is really really long subtext that goes on for so long that it has to wrap to the next line.
126
- </Tile>
127
- </Flex>
128
- <Flex flex={{ default: 'flex_1' }}>
129
- <Tile title="Disabled" icon={<BellIcon />} isStacked isDisabled isSelected={false}>
130
- Subtext goes here
131
- </Tile>
132
- </Flex>
133
- </Flex>
134
- </div>;
43
+ ```ts file="./TileWithExtraContent.tsx"
135
44
  ```
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { Tile } from '@patternfly/react-core';
3
+
4
+ export const TileBasic: React.FunctionComponent = () => (
5
+ <div role="listbox" aria-label="Basic tiles">
6
+ <Tile title="Default" isSelected={false} />
7
+ <Tile title="Selected" isSelected />
8
+ <Tile title="Disabled" isDisabled isSelected={false} />
9
+ </div>
10
+ );
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { Tile } from '@patternfly/react-core';
3
+ import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
4
+
5
+ export const TileStacked: React.FunctionComponent = () => (
6
+ <div role="listbox" aria-label="Stacked tiles">
7
+ <Tile title="Default" icon={<BellIcon />} isStacked isSelected={false}>
8
+ Subtext goes here
9
+ </Tile>{' '}
10
+ <Tile title="Selected" icon={<BellIcon />} isStacked isSelected>
11
+ Subtext goes here
12
+ </Tile>{' '}
13
+ <Tile title="Disabled" icon={<BellIcon />} isStacked isDisabled isSelected={false}>
14
+ Subtext goes here
15
+ </Tile>
16
+ </div>
17
+ );
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { Tile } from '@patternfly/react-core';
3
+ import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
4
+
5
+ export const TileStackedWithLargeIcons: React.FunctionComponent = () => (
6
+ <div role="listbox" aria-label="Stacked tiles with large icons">
7
+ <Tile title="Default" icon={<BellIcon />} isStacked isDisplayLarge isSelected={false}>
8
+ Subtext goes here
9
+ </Tile>{' '}
10
+ <Tile title="Selected" icon={<BellIcon />} isStacked isDisplayLarge isSelected>
11
+ Subtext goes here
12
+ </Tile>{' '}
13
+ <Tile title="Disabled" icon={<BellIcon />} isStacked isDisplayLarge isDisabled isSelected={false}>
14
+ Subtext goes here
15
+ </Tile>
16
+ </div>
17
+ );
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { Tile, Flex } from '@patternfly/react-core';
3
+ import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
4
+
5
+ export const TileWithExtraContent: React.FunctionComponent = () => (
6
+ <div role="listbox" aria-label="Tiles with extra content">
7
+ <Flex>
8
+ <Flex flex={{ default: 'flex_1' }}>
9
+ <Tile title="Default" icon={<BellIcon />} isStacked isSelected={false}>
10
+ This is really really long subtext that goes on for so long that it has to wrap to the next line. This is
11
+ really really long subtext that goes on for so long that it has to wrap to the next line.
12
+ </Tile>
13
+ </Flex>
14
+ <Flex flex={{ default: 'flex_1' }}>
15
+ <Tile title="Selected" icon={<BellIcon />} isStacked isSelected>
16
+ This is really really long subtext that goes on for so long that it has to wrap to the next line.
17
+ </Tile>
18
+ </Flex>
19
+ <Flex flex={{ default: 'flex_1' }}>
20
+ <Tile title="Disabled" icon={<BellIcon />} isStacked isDisabled isSelected={false}>
21
+ Subtext goes here
22
+ </Tile>
23
+ </Flex>
24
+ </Flex>
25
+ </div>
26
+ );
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { Tile } from '@patternfly/react-core';
3
+ import PlusIcon from '@patternfly/react-icons/dist/esm/icons/plus-icon';
4
+
5
+ export const TileWithIcon: React.FunctionComponent = () => (
6
+ <div role="listbox" aria-label="Tiles with icon">
7
+ <Tile title="Default" icon={<PlusIcon />} isSelected={false}>
8
+ Subtext goes here
9
+ </Tile>{' '}
10
+ <Tile title="Selected" icon={<PlusIcon />} isSelected>
11
+ Subtext goes here
12
+ </Tile>{' '}
13
+ <Tile title="Disabled" icon={<PlusIcon />} isDisabled isSelected={false}>
14
+ Subtext goes here
15
+ </Tile>
16
+ </div>
17
+ );
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { Tile } from '@patternfly/react-core';
3
+
4
+ export const TileWithSubtext: React.FunctionComponent = () => (
5
+ <div role="listbox" aria-label="Tiles with subtext">
6
+ <Tile title="Default" isSelected={false}>
7
+ Subtext goes here
8
+ </Tile>{' '}
9
+ <Tile title="Selected" isSelected>
10
+ Subtext goes here
11
+ </Tile>{' '}
12
+ <Tile title="Disabled" isDisabled isSelected={false}>
13
+ Subtext goes here
14
+ </Tile>
15
+ </div>
16
+ );
@@ -27,10 +27,10 @@ const TileSingleSelect: React.FunctionComponent = () => {
27
27
 
28
28
  return (
29
29
  <div role="listbox" aria-label="Single selection tiles">
30
- <Tile title="Tile 1" id="single-select-tile-1" onClick={onSelect} onKeyDown={onKeyDown} isSelected={selectedId === 'tile-1'} />
31
- <Tile title="Tile 2" id="single-select-tile-2" onClick={onSelect} onKeyDown={onKeyDown} isSelected={selectedId === 'tile-2'} />
32
- <Tile title="Tile 3" id="single-select-tile-3" isDisabled isSelected={selectedId === 'tile-3'} />
33
- <Tile title="Tile 4" id="single-select-tile-4" onClick={onSelect} onKeyDown={onKeyDown} isSelected={selectedId === 'tile-4'} />
30
+ <Tile title="Tile 1" id="single-select-tile-1" onClick={onSelect} onKeyDown={onKeyDown} isSelected={selectedId === 'single-select-tile-1'} />
31
+ <Tile title="Tile 2" id="single-select-tile-2" onClick={onSelect} onKeyDown={onKeyDown} isSelected={selectedId === 'single-select-tile-2'} />
32
+ <Tile title="Tile 3" id="single-select-tile-3" isDisabled isSelected={selectedId === 'single-select-tile-3'} />
33
+ <Tile title="Tile 4" id="single-select-tile-4" onClick={onSelect} onKeyDown={onKeyDown} isSelected={selectedId === 'single-select-tile-4'} />
34
34
  </div>
35
35
  );
36
36
  };
@@ -71,14 +71,14 @@ const TileMultiSelect: React.FunctionComponent = () => {
71
71
  id="multiselect-tile-1"
72
72
  onClick={onSelect}
73
73
  onKeyDown={onKeyDown}
74
- isSelected={selectedIds.includes('tile-1')}
74
+ isSelected={selectedIds.includes('multiselect-tile-1')}
75
75
  />
76
76
  <Tile
77
77
  title="Tile 2"
78
78
  id="multiselect-tile-2"
79
79
  onClick={onSelect}
80
80
  onKeyDown={onKeyDown}
81
- isSelected={selectedIds.includes('tile-2')}
81
+ isSelected={selectedIds.includes('multiselect-tile-2')}
82
82
  />
83
83
  <Tile title="Tile 3" id="multiselect-tile-3" isDisabled />
84
84
  <Tile
@@ -86,7 +86,7 @@ const TileMultiSelect: React.FunctionComponent = () => {
86
86
  id="multiselect-tile-4"
87
87
  onClick={onSelect}
88
88
  onKeyDown={onKeyDown}
89
- isSelected={selectedIds.includes('tile-4')}
89
+ isSelected={selectedIds.includes('multiselect-tile-4')}
90
90
  />
91
91
  </div>
92
92
  );