@atlaskit/profilecard 18.4.0 → 19.1.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
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 19.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`13af6ca0e48`](https://bitbucket.org/atlassian/atlassian-frontend/commits/13af6ca0e48) - [ux] TSLA-521 docs(changeset): [ux] This change (TSLA-521) adds keyboard support for the profile card component by adding tabindex, an onKeyPress handler, and setting role="button" when the card is trigged by click. This change also adds unit tests for the profile card trigger as well as notifcations.
8
+
9
+ ## 19.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - [`6e57454a13a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6e57454a13a) - makeRequestViaGateway removed from TeamProfileClient, instead use makeRequest. teamsUseV2 removed from ProfileCardClient, it will now always use V3.
14
+
3
15
  ## 18.4.0
4
16
 
5
17
  ### Minor Changes
@@ -95,11 +95,21 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
95
95
  _this.fireAnalytics((0, _analytics.cardTriggered)('user', 'hover'));
96
96
  }
97
97
  });
98
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onKeyPress", function (event) {
99
+ if (event.key === 'Enter' || event.key === ' ') {
100
+ event.preventDefault();
101
+ _this.showProfilecard();
102
+ if (!_this.state.visible) {
103
+ _this.fireAnalytics((0, _analytics.cardTriggered)('user', 'click'));
104
+ }
105
+ }
106
+ });
98
107
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "containerListeners", _this.props.trigger === 'hover' ? {
99
108
  onMouseEnter: _this.onMouseEnter,
100
109
  onMouseLeave: _this.hideProfilecard
101
110
  } : {
102
- onClick: _this.onClick
111
+ onClick: _this.onClick,
112
+ onKeyPress: _this.onKeyPress
103
113
  });
104
114
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "layerListeners", {
105
115
  handleClickOutside: _this.hideProfilecard,
@@ -269,7 +279,9 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
269
279
  innerProps = (0, _objectWithoutProperties2.default)(triggerProps, _excluded);
270
280
  return /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({}, innerProps, _this3.containerListeners, {
271
281
  ref: ref,
272
- "data-testid": _this3.props.testId
282
+ "data-testid": _this3.props.testId,
283
+ tabIndex: 0,
284
+ role: _this3.props.trigger !== 'hover' ? 'button' : ''
273
285
  }), _this3.props.children);
274
286
  },
275
287
  zIndex: _constants.layers.modal(),
@@ -44,7 +44,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
44
44
  actionSubjectId: actionSubjectId,
45
45
  attributes: _objectSpread(_objectSpread({
46
46
  packageName: "@atlaskit/profilecard",
47
- packageVersion: "18.4.0"
47
+ packageVersion: "19.1.0"
48
48
  }, attributes), {}, {
49
49
  firedAt: Math.round((0, _performance.getPageTime)())
50
50
  })
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.4.0"
3
+ "version": "19.1.0"
4
4
  }
@@ -65,11 +65,21 @@ class ProfilecardTrigger extends React.PureComponent {
65
65
  this.fireAnalytics(cardTriggered('user', 'hover'));
66
66
  }
67
67
  });
68
+ _defineProperty(this, "onKeyPress", event => {
69
+ if (event.key === 'Enter' || event.key === ' ') {
70
+ event.preventDefault();
71
+ this.showProfilecard();
72
+ if (!this.state.visible) {
73
+ this.fireAnalytics(cardTriggered('user', 'click'));
74
+ }
75
+ }
76
+ });
68
77
  _defineProperty(this, "containerListeners", this.props.trigger === 'hover' ? {
69
78
  onMouseEnter: this.onMouseEnter,
70
79
  onMouseLeave: this.hideProfilecard
71
80
  } : {
72
- onClick: this.onClick
81
+ onClick: this.onClick,
82
+ onKeyPress: this.onKeyPress
73
83
  });
74
84
  _defineProperty(this, "layerListeners", {
75
85
  handleClickOutside: this.hideProfilecard,
@@ -224,7 +234,9 @@ class ProfilecardTrigger extends React.PureComponent {
224
234
  } = triggerProps;
225
235
  return /*#__PURE__*/React.createElement("span", _extends({}, innerProps, this.containerListeners, {
226
236
  ref: ref,
227
- "data-testid": this.props.testId
237
+ "data-testid": this.props.testId,
238
+ tabIndex: 0,
239
+ role: this.props.trigger !== 'hover' ? 'button' : ''
228
240
  }), this.props.children);
229
241
  },
230
242
  zIndex: layers.modal(),
@@ -31,7 +31,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
31
31
  actionSubjectId,
32
32
  attributes: {
33
33
  packageName: "@atlaskit/profilecard",
34
- packageVersion: "18.4.0",
34
+ packageVersion: "19.1.0",
35
35
  ...attributes,
36
36
  firedAt: Math.round(getPageTime())
37
37
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.4.0"
3
+ "version": "19.1.0"
4
4
  }
@@ -85,11 +85,21 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
85
85
  _this.fireAnalytics(cardTriggered('user', 'hover'));
86
86
  }
87
87
  });
88
+ _defineProperty(_assertThisInitialized(_this), "onKeyPress", function (event) {
89
+ if (event.key === 'Enter' || event.key === ' ') {
90
+ event.preventDefault();
91
+ _this.showProfilecard();
92
+ if (!_this.state.visible) {
93
+ _this.fireAnalytics(cardTriggered('user', 'click'));
94
+ }
95
+ }
96
+ });
88
97
  _defineProperty(_assertThisInitialized(_this), "containerListeners", _this.props.trigger === 'hover' ? {
89
98
  onMouseEnter: _this.onMouseEnter,
90
99
  onMouseLeave: _this.hideProfilecard
91
100
  } : {
92
- onClick: _this.onClick
101
+ onClick: _this.onClick,
102
+ onKeyPress: _this.onKeyPress
93
103
  });
94
104
  _defineProperty(_assertThisInitialized(_this), "layerListeners", {
95
105
  handleClickOutside: _this.hideProfilecard,
@@ -259,7 +269,9 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
259
269
  innerProps = _objectWithoutProperties(triggerProps, _excluded);
260
270
  return /*#__PURE__*/React.createElement("span", _extends({}, innerProps, _this3.containerListeners, {
261
271
  ref: ref,
262
- "data-testid": _this3.props.testId
272
+ "data-testid": _this3.props.testId,
273
+ tabIndex: 0,
274
+ role: _this3.props.trigger !== 'hover' ? 'button' : ''
263
275
  }), _this3.props.children);
264
276
  },
265
277
  zIndex: layers.modal(),
@@ -38,7 +38,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
38
38
  actionSubjectId: actionSubjectId,
39
39
  attributes: _objectSpread(_objectSpread({
40
40
  packageName: "@atlaskit/profilecard",
41
- packageVersion: "18.4.0"
41
+ packageVersion: "19.1.0"
42
42
  }, attributes), {}, {
43
43
  firedAt: Math.round(getPageTime())
44
44
  })
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.4.0"
3
+ "version": "19.1.0"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.4.0",
3
+ "version": "19.1.0",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -41,17 +41,17 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@atlaskit/analytics-next": "^9.0.0",
44
- "@atlaskit/avatar": "^21.1.0",
44
+ "@atlaskit/avatar": "^21.2.0",
45
45
  "@atlaskit/avatar-group": "^9.2.0",
46
46
  "@atlaskit/button": "^16.5.0",
47
- "@atlaskit/dropdown-menu": "^11.6.0",
47
+ "@atlaskit/dropdown-menu": "^11.7.0",
48
48
  "@atlaskit/empty-state": "^7.4.8",
49
49
  "@atlaskit/give-kudos": "^1.0.0",
50
50
  "@atlaskit/icon": "^21.11.0",
51
51
  "@atlaskit/lozenge": "^11.3.0",
52
52
  "@atlaskit/menu": "^1.5.0",
53
53
  "@atlaskit/popup": "^1.5.0",
54
- "@atlaskit/spinner": "^15.3.0",
54
+ "@atlaskit/spinner": "^15.4.0",
55
55
  "@atlaskit/theme": "^12.2.0",
56
56
  "@atlaskit/tokens": "^1.2.0",
57
57
  "@babel/runtime": "^7.0.0",