@patternfly/react-core 4.215.0 → 4.216.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 4.216.0 (2022-05-19)
7
+
8
+
9
+ ### Features
10
+
11
+ * **table:** update sortable demo to align with core ([#7292](https://github.com/patternfly/patternfly-react/issues/7292)) ([6891764](https://github.com/patternfly/patternfly-react/commit/6891764f2507c775005878f6e74cc5c8e44a6c68))
12
+
13
+
14
+
15
+
16
+
6
17
  # 4.215.0 (2022-05-19)
7
18
 
8
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.215.0",
3
+ "version": "4.216.0",
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,9 +34,9 @@
34
34
  "generate": "node scripts/copyStyles.js"
35
35
  },
36
36
  "dependencies": {
37
- "@patternfly/react-icons": "^4.66.0",
38
- "@patternfly/react-styles": "^4.65.0",
39
- "@patternfly/react-tokens": "^4.67.0",
37
+ "@patternfly/react-icons": "^4.67.0",
38
+ "@patternfly/react-styles": "^4.66.0",
39
+ "@patternfly/react-tokens": "^4.68.0",
40
40
  "focus-trap": "6.2.2",
41
41
  "react-dropzone": "9.0.0",
42
42
  "tippy.js": "5.1.2",
@@ -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": "7df23c027f02c66cd27907fb2caf63109687900b"
63
+ "gitHead": "78b436c5a6bdae02a7a6b4bb8c6b94e2ab1586be"
64
64
  }
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  import {
3
+ ApplicationLauncher,
4
+ ApplicationLauncherItem,
3
5
  Avatar,
4
6
  Brand,
5
7
  Button,
@@ -18,14 +20,13 @@ import {
18
20
  ToolbarContent,
19
21
  ToolbarGroup,
20
22
  ToolbarItem,
21
- PageToggleButton,
22
- Divider
23
+ PageToggleButton
23
24
  } from '@patternfly/react-core';
24
25
  import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
25
26
  import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
26
27
  import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
27
28
  import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
28
- import AttentionBellIcon from '@patternfly/react-icons/dist/esm/icons/attention-bell-icon';
29
+ import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
29
30
  import imgBrand from './pfColorLogo.svg';
30
31
  import imgAvatar from '@patternfly/react-core/src/components/Avatar/examples/avatarImg.svg';
31
32
 
@@ -36,6 +37,7 @@ export default class DashboardHeader extends React.Component {
36
37
  isDropdownOpen: false,
37
38
  isKebabDropdownOpen: false,
38
39
  isFullKebabDropdownOpen: false,
40
+ isAppLauncherOpen: false,
39
41
  activeItem: 0
40
42
  };
41
43
 
@@ -74,10 +76,22 @@ export default class DashboardHeader extends React.Component {
74
76
  isFullKebabDropdownOpen: !this.state.isFullKebabDropdownOpen
75
77
  });
76
78
  };
79
+
80
+ this.onAppLauncherToggle = isAppLauncherOpen => {
81
+ this.setState({
82
+ isAppLauncherOpen
83
+ });
84
+ };
85
+
86
+ this.onAppLauncherSelect = () => {
87
+ this.setState({
88
+ isAppLauncherOpen: !this.state.isAppLauncherOpen
89
+ });
90
+ };
77
91
  }
78
92
 
79
93
  render() {
80
- const { isDropdownOpen, isKebabDropdownOpen, isFullKebabDropdownOpen } = this.state;
94
+ const { isDropdownOpen, isKebabDropdownOpen, isAppLauncherOpen } = this.state;
81
95
 
82
96
  const kebabDropdownItems = [
83
97
  <DropdownItem key="kebab-1">
@@ -97,21 +111,13 @@ export default class DashboardHeader extends React.Component {
97
111
  </DropdownGroup>
98
112
  ];
99
113
 
100
- const fullKebabItems = [
101
- <DropdownGroup key="group 2">
102
- <DropdownItem key="group 2 profile">My profile</DropdownItem>
103
- <DropdownItem key="group 2 user" component="button">
104
- User management
105
- </DropdownItem>
106
- <DropdownItem key="group 2 logout">Logout</DropdownItem>
107
- </DropdownGroup>,
108
- <Divider key="divider" />,
109
- <DropdownItem key="kebab-1">
110
- <CogIcon /> Settings
111
- </DropdownItem>,
112
- <DropdownItem key="kebab-2">
113
- <HelpIcon /> Help
114
- </DropdownItem>
114
+ const appLauncherItems = [
115
+ <ApplicationLauncherItem key="application_1a" href="#">
116
+ Application 1 (anchor link)
117
+ </ApplicationLauncherItem>,
118
+ <ApplicationLauncherItem key="application_2a" component="button" onClick={() => alert('Clicked item 2')}>
119
+ Application 2 (button with onClick)
120
+ </ApplicationLauncherItem>
115
121
  ];
116
122
 
117
123
  const headerToolbar = (
@@ -123,51 +129,45 @@ export default class DashboardHeader extends React.Component {
123
129
  spacer={{ default: 'spacerNone', md: 'spacerMd' }}
124
130
  >
125
131
  <ToolbarItem>
126
- <Button aria-label="Notifications" variant={ButtonVariant.plain}>
127
- <AttentionBellIcon />
128
- </Button>
132
+ <Button aria-label="Notifications" variant={ButtonVariant.plain} icon={<BellIcon />} />
129
133
  </ToolbarItem>
130
134
  <ToolbarGroup variant="icon-button-group" visibility={{ default: 'hidden', lg: 'visible' }}>
135
+ <ToolbarItem visibility={{ default: 'hidden', sm: 'hidden', lg: 'visible' }}>
136
+ <ApplicationLauncher
137
+ onSelect={this.onAppLauncherSelect}
138
+ onToggle={this.onAppLauncherToggle}
139
+ isOpen={isAppLauncherOpen}
140
+ items={appLauncherItems}
141
+ />
142
+ </ToolbarItem>
131
143
  <ToolbarItem>
132
- <Button aria-label="Settings actions" variant={ButtonVariant.plain}>
133
- <CogIcon />
134
- </Button>
144
+ <Button aria-label="Settings" variant={ButtonVariant.plain} icon={<CogIcon />} />
135
145
  </ToolbarItem>
136
146
  <ToolbarItem>
137
- <Button aria-label="Help actions" variant={ButtonVariant.plain}>
138
- <QuestionCircleIcon />
139
- </Button>
147
+ <Button aria-label="Help" variant={ButtonVariant.plain} icon={<QuestionCircleIcon />} />
140
148
  </ToolbarItem>
141
149
  </ToolbarGroup>
150
+ <ToolbarItem visibility={{ default: 'hidden', sm: 'visible', md: 'visible', lg: 'hidden' }}>
151
+ <Dropdown
152
+ isPlain
153
+ position="right"
154
+ onSelect={this.onKebabDropdownSelect}
155
+ toggle={<KebabToggle onToggle={this.onKebabDropdownToggle} />}
156
+ isOpen={isKebabDropdownOpen}
157
+ dropdownItems={kebabDropdownItems}
158
+ />
159
+ </ToolbarItem>
142
160
  </ToolbarGroup>
143
- <ToolbarItem visibility={{ default: 'hidden', md: 'visible', lg: 'hidden' }}>
144
- <Dropdown
145
- isPlain
146
- position="right"
147
- onSelect={this.onKebabDropdownSelect}
148
- toggle={<KebabToggle onToggle={this.onKebabDropdownToggle} />}
149
- isOpen={isKebabDropdownOpen}
150
- dropdownItems={kebabDropdownItems}
151
- />
152
- </ToolbarItem>
153
- <ToolbarItem visibility={{ default: 'visible', md: 'hidden', lg: 'hidden', xl: 'hidden', '2xl': 'hidden' }}>
154
- <Dropdown
155
- isPlain
156
- position="right"
157
- onSelect={this.onFullKebabSelect}
158
- toggle={<KebabToggle onToggle={this.onFullKebabToggle} />}
159
- isOpen={isFullKebabDropdownOpen}
160
- dropdownItems={fullKebabItems}
161
- />
162
- </ToolbarItem>
163
- <ToolbarItem visibility={{ default: 'hidden', md: 'visible' }}>
161
+
162
+ <ToolbarItem visibility={{ default: 'hidden', sm: 'visible' }}>
164
163
  <Dropdown
165
164
  position="right"
165
+ isFullHeight
166
166
  onSelect={this.onDropdownSelect}
167
167
  isOpen={isDropdownOpen}
168
168
  toggle={
169
169
  <DropdownToggle icon={<Avatar src={imgAvatar} alt="Avatar" />} onToggle={this.onDropdownToggle}>
170
- John Smith
170
+ Ned Username
171
171
  </DropdownToggle>
172
172
  }
173
173
  dropdownItems={userDropdownItems}