@atlaskit/util-data-test 17.5.5 → 17.5.7

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,18 @@
1
1
  # @atlaskit/util-data-test
2
2
 
3
+ ## 17.5.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`588c8a3e413`](https://bitbucket.org/atlassian/atlassian-frontend/commits/588c8a3e413) - Update mocks to include interface fetchByEmojiId
8
+ - Updated dependencies
9
+
10
+ ## 17.5.6
11
+
12
+ ### Patch Changes
13
+
14
+ - [`12e166e12ee`](https://bitbucket.org/atlassian/atlassian-frontend/commits/12e166e12ee) - Updated user picker team data to demonstrate a hover effect on the custom icon. New example component added for custom icon.
15
+
3
16
  ## 17.5.5
4
17
 
5
18
  ### Patch Changes
@@ -123,6 +123,19 @@ var MockNonUploadingEmojiResource = /*#__PURE__*/function (_AbstractResource) {
123
123
  var emoji = this.emojiRepository.findByShortName(shortName);
124
124
  return this.promiseBuilder(emoji, 'findByShortName');
125
125
  }
126
+ }, {
127
+ key: "fetchByEmojiId",
128
+ value: function fetchByEmojiId(emojiId, optimistic) {
129
+ var id = emojiId.id,
130
+ shortName = emojiId.shortName;
131
+
132
+ if (id) {
133
+ var emoji = this.emojiRepository.findById(id);
134
+ return this.promiseBuilder(emoji, 'fetchByEmojiId');
135
+ }
136
+
137
+ return this.emojiRepository.findByShortName(shortName);
138
+ }
126
139
  }, {
127
140
  key: "findByEmojiId",
128
141
  value: function findByEmojiId(emojiId) {
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+
12
+ var _react = require("react");
13
+
14
+ var _core = require("@emotion/core");
15
+
16
+ var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right"));
17
+
18
+ var _colors = require("@atlaskit/theme/colors");
19
+
20
+ var _tokens = require("@atlaskit/tokens");
21
+
22
+ /** @jsx jsx */
23
+ var wrapper = (0, _core.css)({
24
+ display: 'flex'
25
+ });
26
+
27
+ var _default = function _default() {
28
+ var _useState = (0, _react.useState)(false),
29
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
30
+ isMouseHovered = _useState2[0],
31
+ setHoverState = _useState2[1];
32
+
33
+ var onMouseEnter = (0, _react.useCallback)(function () {
34
+ return setHoverState(true);
35
+ }, [setHoverState]);
36
+ var onMouseLeave = (0, _react.useCallback)(function () {
37
+ return setHoverState(false);
38
+ }, [setHoverState]);
39
+ return (0, _core.jsx)("div", {
40
+ css: wrapper,
41
+ onMouseEnter: onMouseEnter,
42
+ onMouseLeave: onMouseLeave
43
+ }, (0, _core.jsx)(_chevronRight.default, {
44
+ testId: "chevron-right-icon",
45
+ label: "chevron right",
46
+ size: "large",
47
+ primaryColor: (0, _tokens.token)('color.text.subtlest', isMouseHovered ? _colors.N200 : _colors.N50)
48
+ }));
49
+ };
50
+
51
+ exports.default = _default;
@@ -9,7 +9,7 @@ exports.userPickerTeamData = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
- var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right"));
12
+ var _ChevronRight = _interopRequireDefault(require("./ChevronRight"));
13
13
 
14
14
  var userPickerTeamData = [{
15
15
  id: 'team-custom-icon',
@@ -17,10 +17,7 @@ var userPickerTeamData = [{
17
17
  type: 'team',
18
18
  fixed: false,
19
19
  description: 'This team has a custom icon',
20
- lozenge: /*#__PURE__*/_react.default.createElement(_chevronRight.default, {
21
- label: "chevron right",
22
- size: "large"
23
- })
20
+ lozenge: /*#__PURE__*/_react.default.createElement(_ChevronRight.default, null)
24
21
  }, {
25
22
  id: 'team-custom-icon-and-byline',
26
23
  name: 'Team with custom icon and byline',
@@ -28,9 +25,6 @@ var userPickerTeamData = [{
28
25
  fixed: false,
29
26
  description: 'This team has a custom icon and byline which is not reliant on memberCount and includesYou props',
30
27
  byline: 'Select team members',
31
- lozenge: /*#__PURE__*/_react.default.createElement(_chevronRight.default, {
32
- label: "chevron right",
33
- size: "large"
34
- })
28
+ lozenge: /*#__PURE__*/_react.default.createElement(_ChevronRight.default, null)
35
29
  }];
36
30
  exports.userPickerTeamData = userPickerTeamData;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/util-data-test",
3
- "version": "17.5.5"
3
+ "version": "17.5.7"
4
4
  }
@@ -57,6 +57,20 @@ export class MockNonUploadingEmojiResource extends AbstractResource {
57
57
  return this.promiseBuilder(emoji, 'findByShortName');
58
58
  }
59
59
 
60
+ fetchByEmojiId(emojiId, optimistic) {
61
+ const {
62
+ id,
63
+ shortName
64
+ } = emojiId;
65
+
66
+ if (id) {
67
+ const emoji = this.emojiRepository.findById(id);
68
+ return this.promiseBuilder(emoji, 'fetchByEmojiId');
69
+ }
70
+
71
+ return this.emojiRepository.findByShortName(shortName);
72
+ }
73
+
60
74
  findByEmojiId(emojiId) {
61
75
  const {
62
76
  id,
@@ -0,0 +1,24 @@
1
+ /** @jsx jsx */
2
+ import { useCallback, useState } from 'react';
3
+ import { css, jsx } from '@emotion/core';
4
+ import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
5
+ import { N50, N200 } from '@atlaskit/theme/colors';
6
+ import { token } from '@atlaskit/tokens';
7
+ const wrapper = css({
8
+ display: 'flex'
9
+ });
10
+ export default (() => {
11
+ const [isMouseHovered, setHoverState] = useState(false);
12
+ const onMouseEnter = useCallback(() => setHoverState(true), [setHoverState]);
13
+ const onMouseLeave = useCallback(() => setHoverState(false), [setHoverState]);
14
+ return jsx("div", {
15
+ css: wrapper,
16
+ onMouseEnter: onMouseEnter,
17
+ onMouseLeave: onMouseLeave
18
+ }, jsx(ChevronRightIcon, {
19
+ testId: "chevron-right-icon",
20
+ label: "chevron right",
21
+ size: "large",
22
+ primaryColor: token('color.text.subtlest', isMouseHovered ? N200 : N50)
23
+ }));
24
+ });
@@ -1,15 +1,12 @@
1
1
  import React from 'react';
2
- import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
2
+ import ChevronRight from './ChevronRight';
3
3
  export const userPickerTeamData = [{
4
4
  id: 'team-custom-icon',
5
5
  name: 'Team with custom icon',
6
6
  type: 'team',
7
7
  fixed: false,
8
8
  description: 'This team has a custom icon',
9
- lozenge: /*#__PURE__*/React.createElement(ChevronRightIcon, {
10
- label: "chevron right",
11
- size: "large"
12
- })
9
+ lozenge: /*#__PURE__*/React.createElement(ChevronRight, null)
13
10
  }, {
14
11
  id: 'team-custom-icon-and-byline',
15
12
  name: 'Team with custom icon and byline',
@@ -17,8 +14,5 @@ export const userPickerTeamData = [{
17
14
  fixed: false,
18
15
  description: 'This team has a custom icon and byline which is not reliant on memberCount and includesYou props',
19
16
  byline: 'Select team members',
20
- lozenge: /*#__PURE__*/React.createElement(ChevronRightIcon, {
21
- label: "chevron right",
22
- size: "large"
23
- })
17
+ lozenge: /*#__PURE__*/React.createElement(ChevronRight, null)
24
18
  }];
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/util-data-test",
3
- "version": "17.5.5"
3
+ "version": "17.5.7"
4
4
  }
@@ -108,6 +108,19 @@ export var MockNonUploadingEmojiResource = /*#__PURE__*/function (_AbstractResou
108
108
  var emoji = this.emojiRepository.findByShortName(shortName);
109
109
  return this.promiseBuilder(emoji, 'findByShortName');
110
110
  }
111
+ }, {
112
+ key: "fetchByEmojiId",
113
+ value: function fetchByEmojiId(emojiId, optimistic) {
114
+ var id = emojiId.id,
115
+ shortName = emojiId.shortName;
116
+
117
+ if (id) {
118
+ var emoji = this.emojiRepository.findById(id);
119
+ return this.promiseBuilder(emoji, 'fetchByEmojiId');
120
+ }
121
+
122
+ return this.emojiRepository.findByShortName(shortName);
123
+ }
111
124
  }, {
112
125
  key: "findByEmojiId",
113
126
  value: function findByEmojiId(emojiId) {
@@ -0,0 +1,34 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+
3
+ /** @jsx jsx */
4
+ import { useCallback, useState } from 'react';
5
+ import { css, jsx } from '@emotion/core';
6
+ import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
7
+ import { N50, N200 } from '@atlaskit/theme/colors';
8
+ import { token } from '@atlaskit/tokens';
9
+ var wrapper = css({
10
+ display: 'flex'
11
+ });
12
+ export default (function () {
13
+ var _useState = useState(false),
14
+ _useState2 = _slicedToArray(_useState, 2),
15
+ isMouseHovered = _useState2[0],
16
+ setHoverState = _useState2[1];
17
+
18
+ var onMouseEnter = useCallback(function () {
19
+ return setHoverState(true);
20
+ }, [setHoverState]);
21
+ var onMouseLeave = useCallback(function () {
22
+ return setHoverState(false);
23
+ }, [setHoverState]);
24
+ return jsx("div", {
25
+ css: wrapper,
26
+ onMouseEnter: onMouseEnter,
27
+ onMouseLeave: onMouseLeave
28
+ }, jsx(ChevronRightIcon, {
29
+ testId: "chevron-right-icon",
30
+ label: "chevron right",
31
+ size: "large",
32
+ primaryColor: token('color.text.subtlest', isMouseHovered ? N200 : N50)
33
+ }));
34
+ });
@@ -1,15 +1,12 @@
1
1
  import React from 'react';
2
- import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
2
+ import ChevronRight from './ChevronRight';
3
3
  export var userPickerTeamData = [{
4
4
  id: 'team-custom-icon',
5
5
  name: 'Team with custom icon',
6
6
  type: 'team',
7
7
  fixed: false,
8
8
  description: 'This team has a custom icon',
9
- lozenge: /*#__PURE__*/React.createElement(ChevronRightIcon, {
10
- label: "chevron right",
11
- size: "large"
12
- })
9
+ lozenge: /*#__PURE__*/React.createElement(ChevronRight, null)
13
10
  }, {
14
11
  id: 'team-custom-icon-and-byline',
15
12
  name: 'Team with custom icon and byline',
@@ -17,8 +14,5 @@ export var userPickerTeamData = [{
17
14
  fixed: false,
18
15
  description: 'This team has a custom icon and byline which is not reliant on memberCount and includesYou props',
19
16
  byline: 'Select team members',
20
- lozenge: /*#__PURE__*/React.createElement(ChevronRightIcon, {
21
- label: "chevron right",
22
- size: "large"
23
- })
17
+ lozenge: /*#__PURE__*/React.createElement(ChevronRight, null)
24
18
  }];
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/util-data-test",
3
- "version": "17.5.5"
3
+ "version": "17.5.7"
4
4
  }
@@ -16,6 +16,7 @@ export declare class MockNonUploadingEmojiResource extends AbstractResource<stri
16
16
  getCurrentUser(): OptionalUser;
17
17
  filter(query?: string, options?: SearchOptions): void;
18
18
  findByShortName(shortName: string): Promise<OptionalEmojiDescription>;
19
+ fetchByEmojiId(emojiId: EmojiId, optimistic: boolean): Promise<OptionalEmojiDescription> | OptionalEmojiDescription;
19
20
  findByEmojiId(emojiId: EmojiId): Promise<OptionalEmojiDescription> | OptionalEmojiDescription;
20
21
  findById(id: string): Promise<OptionalEmojiDescription>;
21
22
  findInCategory(categoryId: CategoryId): Promise<EmojiDescription[]>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
@@ -16,6 +16,7 @@ export declare class MockNonUploadingEmojiResource extends AbstractResource<stri
16
16
  getCurrentUser(): OptionalUser;
17
17
  filter(query?: string, options?: SearchOptions): void;
18
18
  findByShortName(shortName: string): Promise<OptionalEmojiDescription>;
19
+ fetchByEmojiId(emojiId: EmojiId, optimistic: boolean): Promise<OptionalEmojiDescription> | OptionalEmojiDescription;
19
20
  findByEmojiId(emojiId: EmojiId): Promise<OptionalEmojiDescription> | OptionalEmojiDescription;
20
21
  findById(id: string): Promise<OptionalEmojiDescription>;
21
22
  findInCategory(categoryId: CategoryId): Promise<EmojiDescription[]>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  }
8
8
  },
9
9
  "name": "@atlaskit/util-data-test",
10
- "version": "17.5.5",
10
+ "version": "17.5.7",
11
11
  "description": "Shared test and story data",
12
12
  "publishConfig": {
13
13
  "registry": "https://registry.npmjs.org/"
@@ -75,14 +75,17 @@
75
75
  },
76
76
  "dependencies": {
77
77
  "@atlaskit/analytics-next": "^8.0.0",
78
- "@atlaskit/emoji": "^65.2.0",
78
+ "@atlaskit/emoji": "^66.0.0",
79
79
  "@atlaskit/icon": "^21.10.0",
80
80
  "@atlaskit/mention": "^21.0.0",
81
81
  "@atlaskit/profilecard": "^17.2.0",
82
82
  "@atlaskit/task-decision": "^17.5.0",
83
+ "@atlaskit/theme": "^12.2.1",
84
+ "@atlaskit/tokens": "^0.10.22",
83
85
  "@atlaskit/user-picker": "^9.4.0",
84
86
  "@atlaskit/util-service-support": "^6.1.0",
85
87
  "@babel/runtime": "^7.0.0",
88
+ "@emotion/core": "^10.0.9",
86
89
  "lodash": "^4.17.21",
87
90
  "memoize-one": "^6.0.0",
88
91
  "uuid": "^3.1.0"