@atlaskit/reactions 21.0.3 → 21.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.
Files changed (147) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +3 -0
  3. package/dist/cjs/components/Counter.js +73 -162
  4. package/dist/cjs/components/EmojiButton.js +9 -11
  5. package/dist/cjs/components/FlashAnimation.js +19 -17
  6. package/dist/cjs/components/Reaction.js +28 -39
  7. package/dist/cjs/components/ReactionPicker.js +26 -33
  8. package/dist/cjs/components/ReactionTooltip.js +33 -29
  9. package/dist/cjs/components/Reactions.js +17 -19
  10. package/dist/cjs/components/Selector.js +23 -28
  11. package/dist/cjs/components/ShowMore.js +25 -22
  12. package/dist/cjs/components/Trigger.js +11 -16
  13. package/dist/cjs/i18n/cs.js +4 -3
  14. package/dist/cjs/i18n/da.js +4 -3
  15. package/dist/cjs/i18n/de.js +4 -3
  16. package/dist/cjs/i18n/en_ZZ.js +21 -0
  17. package/dist/cjs/i18n/es.js +4 -3
  18. package/dist/cjs/i18n/et.js +2 -2
  19. package/dist/cjs/i18n/fi.js +4 -3
  20. package/dist/cjs/i18n/fr.js +4 -3
  21. package/dist/cjs/i18n/hu.js +4 -3
  22. package/dist/cjs/i18n/it.js +4 -3
  23. package/dist/cjs/i18n/ja.js +4 -3
  24. package/dist/cjs/i18n/ko.js +4 -3
  25. package/dist/cjs/i18n/nb.js +4 -3
  26. package/dist/cjs/i18n/nl.js +4 -3
  27. package/dist/cjs/i18n/pl.js +4 -3
  28. package/dist/cjs/i18n/pt_BR.js +4 -3
  29. package/dist/cjs/i18n/pt_PT.js +2 -2
  30. package/dist/cjs/i18n/ru.js +4 -3
  31. package/dist/cjs/i18n/sk.js +2 -2
  32. package/dist/cjs/i18n/sv.js +4 -3
  33. package/dist/cjs/i18n/th.js +4 -3
  34. package/dist/cjs/i18n/tr.js +4 -3
  35. package/dist/cjs/i18n/uk.js +4 -3
  36. package/dist/cjs/i18n/vi.js +4 -3
  37. package/dist/cjs/i18n/zh.js +4 -3
  38. package/dist/cjs/i18n/zh_TW.js +4 -3
  39. package/dist/cjs/version.json +1 -1
  40. package/dist/es2019/components/Counter.js +57 -141
  41. package/dist/es2019/components/EmojiButton.js +10 -10
  42. package/dist/es2019/components/FlashAnimation.js +16 -15
  43. package/dist/es2019/components/Reaction.js +29 -39
  44. package/dist/es2019/components/ReactionPicker.js +27 -32
  45. package/dist/es2019/components/ReactionTooltip.js +27 -27
  46. package/dist/es2019/components/Reactions.js +18 -18
  47. package/dist/es2019/components/Selector.js +21 -24
  48. package/dist/es2019/components/ShowMore.js +22 -18
  49. package/dist/es2019/components/Trigger.js +10 -14
  50. package/dist/es2019/i18n/cs.js +4 -3
  51. package/dist/es2019/i18n/da.js +4 -3
  52. package/dist/es2019/i18n/de.js +4 -3
  53. package/dist/es2019/i18n/en_ZZ.js +13 -0
  54. package/dist/es2019/i18n/es.js +4 -3
  55. package/dist/es2019/i18n/et.js +2 -2
  56. package/dist/es2019/i18n/fi.js +4 -3
  57. package/dist/es2019/i18n/fr.js +4 -3
  58. package/dist/es2019/i18n/hu.js +4 -3
  59. package/dist/es2019/i18n/it.js +4 -3
  60. package/dist/es2019/i18n/ja.js +4 -3
  61. package/dist/es2019/i18n/ko.js +4 -3
  62. package/dist/es2019/i18n/nb.js +4 -3
  63. package/dist/es2019/i18n/nl.js +4 -3
  64. package/dist/es2019/i18n/pl.js +4 -3
  65. package/dist/es2019/i18n/pt_BR.js +4 -3
  66. package/dist/es2019/i18n/pt_PT.js +2 -2
  67. package/dist/es2019/i18n/ru.js +4 -3
  68. package/dist/es2019/i18n/sk.js +2 -2
  69. package/dist/es2019/i18n/sv.js +4 -3
  70. package/dist/es2019/i18n/th.js +4 -3
  71. package/dist/es2019/i18n/tr.js +4 -3
  72. package/dist/es2019/i18n/uk.js +4 -3
  73. package/dist/es2019/i18n/vi.js +4 -3
  74. package/dist/es2019/i18n/zh.js +4 -3
  75. package/dist/es2019/i18n/zh_TW.js +4 -3
  76. package/dist/es2019/version.json +1 -1
  77. package/dist/esm/components/Counter.js +65 -158
  78. package/dist/esm/components/EmojiButton.js +9 -10
  79. package/dist/esm/components/FlashAnimation.js +16 -14
  80. package/dist/esm/components/Reaction.js +28 -37
  81. package/dist/esm/components/ReactionPicker.js +27 -32
  82. package/dist/esm/components/ReactionTooltip.js +27 -27
  83. package/dist/esm/components/Reactions.js +17 -18
  84. package/dist/esm/components/Selector.js +20 -24
  85. package/dist/esm/components/ShowMore.js +22 -19
  86. package/dist/esm/components/Trigger.js +10 -14
  87. package/dist/esm/i18n/cs.js +4 -3
  88. package/dist/esm/i18n/da.js +4 -3
  89. package/dist/esm/i18n/de.js +4 -3
  90. package/dist/esm/i18n/en_ZZ.js +13 -0
  91. package/dist/esm/i18n/es.js +4 -3
  92. package/dist/esm/i18n/et.js +2 -2
  93. package/dist/esm/i18n/fi.js +4 -3
  94. package/dist/esm/i18n/fr.js +4 -3
  95. package/dist/esm/i18n/hu.js +4 -3
  96. package/dist/esm/i18n/it.js +4 -3
  97. package/dist/esm/i18n/ja.js +4 -3
  98. package/dist/esm/i18n/ko.js +4 -3
  99. package/dist/esm/i18n/nb.js +4 -3
  100. package/dist/esm/i18n/nl.js +4 -3
  101. package/dist/esm/i18n/pl.js +4 -3
  102. package/dist/esm/i18n/pt_BR.js +4 -3
  103. package/dist/esm/i18n/pt_PT.js +2 -2
  104. package/dist/esm/i18n/ru.js +4 -3
  105. package/dist/esm/i18n/sk.js +2 -2
  106. package/dist/esm/i18n/sv.js +4 -3
  107. package/dist/esm/i18n/th.js +4 -3
  108. package/dist/esm/i18n/tr.js +4 -3
  109. package/dist/esm/i18n/uk.js +4 -3
  110. package/dist/esm/i18n/vi.js +4 -3
  111. package/dist/esm/i18n/zh.js +4 -3
  112. package/dist/esm/i18n/zh_TW.js +4 -3
  113. package/dist/esm/version.json +1 -1
  114. package/dist/types/components/Counter.d.ts +6 -26
  115. package/dist/types/components/FlashAnimation.d.ts +3 -1
  116. package/dist/types/components/Reaction.d.ts +3 -3
  117. package/dist/types/components/Reactions.d.ts +1 -1
  118. package/dist/types/components/Selector.d.ts +2 -1
  119. package/dist/types/components/ShowMore.d.ts +4 -0
  120. package/dist/types/i18n/cs.d.ts +2 -1
  121. package/dist/types/i18n/da.d.ts +2 -1
  122. package/dist/types/i18n/de.d.ts +2 -1
  123. package/dist/types/i18n/en_ZZ.d.ts +13 -0
  124. package/dist/types/i18n/es.d.ts +2 -1
  125. package/dist/types/i18n/et.d.ts +1 -1
  126. package/dist/types/i18n/fi.d.ts +2 -1
  127. package/dist/types/i18n/fr.d.ts +2 -1
  128. package/dist/types/i18n/hu.d.ts +2 -1
  129. package/dist/types/i18n/it.d.ts +2 -1
  130. package/dist/types/i18n/ja.d.ts +2 -1
  131. package/dist/types/i18n/ko.d.ts +2 -1
  132. package/dist/types/i18n/nb.d.ts +2 -1
  133. package/dist/types/i18n/nl.d.ts +2 -1
  134. package/dist/types/i18n/pl.d.ts +2 -1
  135. package/dist/types/i18n/pt_BR.d.ts +2 -1
  136. package/dist/types/i18n/pt_PT.d.ts +1 -1
  137. package/dist/types/i18n/ru.d.ts +2 -1
  138. package/dist/types/i18n/sk.d.ts +1 -1
  139. package/dist/types/i18n/sv.d.ts +2 -1
  140. package/dist/types/i18n/th.d.ts +2 -1
  141. package/dist/types/i18n/tr.d.ts +2 -1
  142. package/dist/types/i18n/uk.d.ts +2 -1
  143. package/dist/types/i18n/vi.d.ts +2 -1
  144. package/dist/types/i18n/zh.d.ts +2 -1
  145. package/dist/types/i18n/zh_TW.d.ts +2 -1
  146. package/local-config-example.ts +3 -1
  147. package/package.json +12 -10
@@ -1,154 +1,70 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ /** @jsx jsx */
2
+ import { jsx, css } from '@emotion/core';
2
3
  import { N90, B400 } from '@atlaskit/theme/colors';
3
4
  import { token } from '@atlaskit/tokens';
4
- import cx from 'classnames';
5
- import React from 'react';
6
- import { CSSTransition } from 'react-transition-group';
7
- import { keyframes, style } from 'typestyle';
8
- import { akHeight } from './utils';
9
- const animationTime = 300;
10
- export const countStyle = style({
11
- fontSize: '11px',
5
+ import React, { memo } from 'react';
6
+ import { SlideIn, ExitingPersistence, mediumDurationMs } from '@atlaskit/motion';
7
+ import usePreviousValue from '@atlaskit/ds-lib/use-previous-value';
8
+ export const counterTestId = 'counter-container';
9
+ export const countStyle = css({
10
+ fontSize: 11,
11
+ // TODO: nice to have a theme level token for fontSize
12
12
  color: token('color.text.subtlest', N90),
13
13
  overflow: 'hidden',
14
- height: `${akHeight}px`,
15
- transition: `width ${animationTime}ms ease-in-out`
14
+ position: 'relative',
15
+ padding: '4px 8px 4px 0',
16
+ lineHeight: '14px'
16
17
  });
17
- export const highlightStyle = style({
18
- color: token('color.text.brand', B400),
18
+ export const highlightStyle = css({
19
+ color: token('color.text.selected', B400),
19
20
  fontWeight: 600
20
21
  });
21
- export const containerStyle = style({
22
+ export const containerStyle = css({
22
23
  display: 'flex',
23
24
  flexDirection: 'column'
24
25
  });
25
-
26
- const slideAnimation = (start, end) => {
27
- const animation = keyframes({
28
- '0%': {
29
- transform: `translateY(${start}%)`
30
- },
31
- '100%': {
32
- transform: `translateY(${end}%)`
26
+ export const Counter = /*#__PURE__*/memo(({
27
+ highlight = false,
28
+ limit = 100,
29
+ overLimitLabel = '99+',
30
+ className,
31
+ value,
32
+ animationDuration = mediumDurationMs
33
+ }) => {
34
+ const hasReachedLimit = value => limit && value >= limit;
35
+
36
+ const getLabel = value => {
37
+ if (hasReachedLimit(value)) {
38
+ return overLimitLabel || '';
39
+ } else if (value === 0) {
40
+ return '';
41
+ } else {
42
+ return value.toString();
33
43
  }
34
- });
35
- return `${animation} ${animationTime}ms ease-in-out`;
36
- };
37
-
38
- const counterAnimation = (start, end) => style({
39
- animation: slideAnimation(start, end)
40
- });
41
-
42
- export const slideUpStyle = counterAnimation(0, -50);
43
- export const slideDownStyle = counterAnimation(-50, 0);
44
- export class Counter extends React.PureComponent {
45
- constructor(props) {
46
- super(props);
47
-
48
- _defineProperty(this, "getLabel", value => {
49
- const {
50
- overLimitLabel
51
- } = this.props;
52
-
53
- if (this.hasReachedLimit(value)) {
54
- return overLimitLabel || '';
55
- } else if (value === 0) {
56
- return '';
57
- } else {
58
- return value.toString();
59
- }
60
- });
61
-
62
- _defineProperty(this, "hasReachedLimit", value => this.props.limit && value >= this.props.limit);
63
-
64
- _defineProperty(this, "renderPrevious", () => {
65
- const {
66
- previous
67
- } = this.state;
68
-
69
- if (previous !== undefined) {
70
- const className = cx({
71
- [highlightStyle]: previous.highlight
72
- });
73
- return /*#__PURE__*/React.createElement("div", {
74
- key: previous.value,
75
- className: className
76
- }, this.getLabel(previous.value));
77
- }
78
-
79
- return null;
80
- });
81
-
82
- _defineProperty(this, "clearPrevious", () => {
83
- this.setState({
84
- previous: undefined
85
- });
86
- });
87
-
88
- this.state = {
89
- previous: undefined
90
- };
91
- }
92
-
93
- UNSAFE_componentWillReceiveProps(nextProps) {
94
- const {
95
- value,
96
- highlight
97
- } = this.props;
98
-
99
- if (value !== undefined && value !== nextProps.value && (!this.hasReachedLimit(value) || !this.hasReachedLimit(nextProps.value))) {
100
- this.setState({
101
- previous: {
102
- value,
103
- highlight
104
- }
105
- });
44
+ };
45
+
46
+ const previousValue = usePreviousValue(value);
47
+ const label = getLabel(value);
48
+ const increase = previousValue ? previousValue < value : false;
49
+ return jsx("div", {
50
+ className: className,
51
+ css: countStyle,
52
+ style: {
53
+ width: label.length * 7
106
54
  }
107
- }
108
-
109
- render() {
110
- const {
111
- value,
112
- highlight,
113
- className: classNameProp
114
- } = this.props;
115
- const {
116
- previous
117
- } = this.state;
118
- const label = this.getLabel(value);
119
- const increase = previous !== undefined && previous.value < value;
120
- const decrease = previous !== undefined && previous.value > value;
121
- const enterClass = increase ? slideUpStyle : decrease ? slideDownStyle : undefined;
122
- const className = cx(countStyle, classNameProp);
123
- const currentClassName = cx({
124
- [highlightStyle]: highlight
125
- }); // WS-2525 With the pill UI updates, width of * 10 was too much so dropped down to * 7
126
-
127
- return /*#__PURE__*/React.createElement("div", {
128
- className: className,
129
- style: {
130
- width: label.length * 7
131
- }
132
- }, /*#__PURE__*/React.createElement(CSSTransition, {
133
- classNames: {
134
- enter: enterClass
135
- },
136
- timeout: animationTime,
137
- in: increase || decrease,
138
- onEntered: this.clearPrevious
139
- }, /*#__PURE__*/React.createElement("div", {
140
- className: containerStyle
141
- }, increase ? this.renderPrevious() : null, /*#__PURE__*/React.createElement("div", {
142
- className: currentClassName,
143
- key: value
144
- }, label), decrease ? this.renderPrevious() : null)));
145
- }
146
-
147
- }
148
-
149
- _defineProperty(Counter, "defaultProps", {
150
- highlight: false,
151
- limit: 100,
152
- overLimitLabel: '99+',
153
- className: undefined
55
+ }, jsx(ExitingPersistence, null, jsx(SlideIn, {
56
+ enterFrom: increase ? 'bottom' : 'top',
57
+ key: value,
58
+ duration: animationDuration
59
+ }, (motion, direction) => jsx("div", {
60
+ ref: motion.ref,
61
+ css: [containerStyle, css({
62
+ position: direction === 'exiting' ? 'absolute' : undefined
63
+ })],
64
+ className: motion.className,
65
+ "data-testid": counterTestId
66
+ }, jsx("div", {
67
+ css: highlight && highlightStyle,
68
+ key: value
69
+ }, label)))));
154
70
  });
@@ -1,10 +1,12 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ /** @jsx jsx */
4
+ import { jsx, css } from '@emotion/core';
2
5
  import { ResourcedEmoji } from '@atlaskit/emoji/element';
3
6
  import React from 'react';
4
7
  import { PureComponent } from 'react';
5
- import { style } from 'typestyle';
6
8
  import { isLeftClick } from './utils';
7
- const emojiButtonStyle = style({
9
+ const emojiButtonStyle = css({
8
10
  outline: 'none',
9
11
  display: 'flex',
10
12
  backgroundColor: 'transparent',
@@ -13,11 +15,9 @@ const emojiButtonStyle = style({
13
15
  cursor: 'pointer',
14
16
  margin: '0',
15
17
  padding: '10px 8px',
16
- $nest: {
17
- '&:hover > span': {
18
- transition: 'transform cubic-bezier(0.23, 1, 0.32, 1) 200ms',
19
- transform: 'scale(1.33)'
20
- }
18
+ '&:hover > span': {
19
+ transition: 'transform cubic-bezier(0.23, 1, 0.32, 1) 200ms',
20
+ transform: 'scale(1.33)'
21
21
  }
22
22
  });
23
23
  export class EmojiButton extends PureComponent {
@@ -38,10 +38,10 @@ export class EmojiButton extends PureComponent {
38
38
  emojiId,
39
39
  emojiProvider
40
40
  } = this.props;
41
- return /*#__PURE__*/React.createElement("button", {
41
+ return jsx("button", {
42
42
  onMouseUp: this.handleMouseDown,
43
- className: emojiButtonStyle
44
- }, /*#__PURE__*/React.createElement(ResourcedEmoji, {
43
+ css: emojiButtonStyle
44
+ }, jsx(ResourcedEmoji, {
45
45
  emojiProvider: emojiProvider,
46
46
  emojiId: emojiId
47
47
  }));
@@ -1,39 +1,40 @@
1
+ /** @jsx jsx */
2
+ import { jsx, css, keyframes } from '@emotion/core';
1
3
  import { B75, B300 } from '@atlaskit/theme/colors';
2
4
  import { token } from '@atlaskit/tokens';
3
- import cx from 'classnames';
4
5
  import React from 'react';
5
- import { keyframes, style } from 'typestyle';
6
- const containerStyle = style({
6
+ export const flashAnimationTestId = 'flash-animation';
7
+ const containerStyle = css({
7
8
  width: '100%',
8
9
  height: '100%'
9
10
  });
10
11
  const flashTime = 700;
11
- const flashAnimation = keyframes({
12
+ export const flashAnimation = keyframes({
12
13
  '0%': {
13
14
  backgroundColor: 'transparent'
14
15
  },
15
16
  '20%': {
16
- backgroundColor: token('color.background.brand.pressed', B75),
17
- borderColor: token('color.icon.brand', B300)
17
+ backgroundColor: token('color.background.selected.pressed', B75),
18
+ borderColor: token('color.border.selected', B300)
18
19
  },
19
20
  '75%': {
20
- backgroundColor: token('color.background.brand.pressed', B75),
21
- borderColor: token('color.icon.brand', B300)
21
+ backgroundColor: token('color.background.selected.pressed', B75),
22
+ borderColor: token('color.border.selected', B300)
22
23
  },
23
24
  '100%': {
24
- backgroundColor: token('color.background.brand.pressed', B75),
25
- borderColor: token('color.icon.brand', B300)
25
+ backgroundColor: token('color.background.selected.pressed', B75),
26
+ borderColor: token('color.border.selected', B300)
26
27
  }
27
28
  });
28
- export const flashStyle = style({
29
+ export const flashStyle = css({
29
30
  animation: `${flashAnimation} ${flashTime}ms ease-in-out`
30
31
  });
31
32
  /**
32
33
  * Flash animation background component. See Reaction component for usage.
33
34
  */
34
35
 
35
- export const FlashAnimation = props => /*#__PURE__*/React.createElement("div", {
36
- className: cx(containerStyle, props.className, {
37
- [flashStyle]: props.flash
38
- })
36
+ export const FlashAnimation = props => jsx("div", {
37
+ className: props.className,
38
+ css: [containerStyle, props.flash && flashStyle],
39
+ "data-testid": flashAnimationTestId
39
40
  }, props.children);
@@ -1,12 +1,13 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ /** @jsx jsx */
4
+ import { jsx, css } from '@emotion/core';
2
5
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
3
6
  import { ResourcedEmoji } from '@atlaskit/emoji/element';
4
7
  import { B50, B75, B300, N20, N40, N400 } from '@atlaskit/theme/colors';
5
8
  import { token } from '@atlaskit/tokens';
6
- import cx from 'classnames';
7
9
  import React from 'react';
8
10
  import { PureComponent } from 'react';
9
- import { style } from 'typestyle';
10
11
  import { createAndFireSafe, createReactionClickedEvent, createReactionHoveredEvent } from '../analytics';
11
12
  import { Counter } from './Counter';
12
13
  import { FlashAnimation } from './FlashAnimation';
@@ -18,12 +19,12 @@ import { isLeftClick, akHeight } from './utils';
18
19
  * of FlashAnimation b/c it otherwise throws off the flash styling
19
20
  */
20
21
 
21
- const emojiStyle = style({
22
+ const emojiStyle = css({
22
23
  transformOrigin: 'center center 0',
23
24
  lineHeight: '12px',
24
25
  padding: '4px 4px 4px 8px'
25
26
  });
26
- const reactionStyle = style({
27
+ const reactionStyle = css({
27
28
  outline: 'none',
28
29
  display: 'flex',
29
30
  flexDirection: 'row',
@@ -39,33 +40,25 @@ const reactionStyle = style({
39
40
  margin: 0,
40
41
  padding: 0,
41
42
  transition: '200ms ease-in-out',
42
- $nest: {
43
- '&:hover': {
44
- background: `${token('color.background.neutral.subtle.hovered', N20)}`
45
- }
43
+ '&:hover': {
44
+ background: `${token('color.background.neutral.subtle.hovered', N20)}`
46
45
  }
47
46
  });
48
- const reactedStyle = style({
49
- backgroundColor: token('color.background.brand', B50),
50
- borderColor: token('color.icon.brand', B300),
51
- $nest: {
52
- '&:hover': {
53
- background: `${token('color.background.brand.hovered', B75)}`
54
- }
47
+ const reactedStyle = css({
48
+ backgroundColor: token('color.background.selected', B50),
49
+ borderColor: token('color.border.selected', B300),
50
+ '&:hover': {
51
+ background: `${token('color.background.selected.hovered', B75)}`
55
52
  }
56
53
  });
57
54
  const flashHeight = akHeight - 2; // height without the 1px border
58
55
 
59
- const flashStyle = style({
56
+ const flashStyle = css({
60
57
  display: 'flex',
61
58
  flexDirection: 'row',
62
59
  borderRadius: '10px',
63
60
  height: `${flashHeight}px`
64
61
  });
65
- const counterStyle = style({
66
- padding: '4px 8px 4px 0',
67
- lineHeight: '14px'
68
- });
69
62
 
70
63
  class ReactionWithoutAnalytics extends PureComponent {
71
64
  constructor(props) {
@@ -90,10 +83,10 @@ class ReactionWithoutAnalytics extends PureComponent {
90
83
  }
91
84
  });
92
85
 
93
- _defineProperty(this, "handleMouseOver", event => {
86
+ _defineProperty(this, "handleMouseEnter", event => {
94
87
  event.preventDefault();
95
88
  const {
96
- onMouseOver,
89
+ onMouseEnter,
97
90
  reaction
98
91
  } = this.props;
99
92
 
@@ -101,8 +94,8 @@ class ReactionWithoutAnalytics extends PureComponent {
101
94
  this.hoverStart = Date.now();
102
95
  }
103
96
 
104
- if (onMouseOver) {
105
- onMouseOver(this.props.reaction, event);
97
+ if (onMouseEnter) {
98
+ onMouseEnter(this.props.reaction, event);
106
99
  }
107
100
  });
108
101
 
@@ -145,31 +138,28 @@ class ReactionWithoutAnalytics extends PureComponent {
145
138
  const {
146
139
  emojiName
147
140
  } = this.state;
148
- const classNames = cx(reactionStyle, classNameProp, {
149
- [reactedStyle]: reaction.reacted
150
- });
151
141
  const emojiId = {
152
142
  id: reaction.emojiId,
153
143
  shortName: ''
154
144
  };
155
- return /*#__PURE__*/React.createElement("button", {
156
- className: classNames,
145
+ return jsx("button", {
146
+ className: classNameProp,
147
+ css: [reactionStyle, reaction.reacted && reactedStyle],
157
148
  onMouseUp: this.handleMouseDown,
158
- onMouseOver: this.handleMouseOver
159
- }, /*#__PURE__*/React.createElement(ReactionTooltip, {
149
+ onMouseEnter: this.handleMouseEnter
150
+ }, jsx(ReactionTooltip, {
160
151
  emojiName: emojiName,
161
152
  reaction: reaction
162
- }, /*#__PURE__*/React.createElement(FlashAnimation, {
153
+ }, jsx(FlashAnimation, {
163
154
  flash: flash,
164
- className: flashStyle
165
- }, /*#__PURE__*/React.createElement("div", {
166
- className: emojiStyle
167
- }, /*#__PURE__*/React.createElement(ResourcedEmoji, {
155
+ css: flashStyle
156
+ }, jsx("div", {
157
+ css: emojiStyle
158
+ }, jsx(ResourcedEmoji, {
168
159
  emojiProvider: emojiProvider,
169
160
  emojiId: emojiId,
170
161
  fitToHeight: 16
171
- })), /*#__PURE__*/React.createElement(Counter, {
172
- className: counterStyle,
162
+ })), jsx(Counter, {
173
163
  value: reaction.count,
174
164
  highlight: reaction.reacted
175
165
  }))));
@@ -180,7 +170,7 @@ class ReactionWithoutAnalytics extends PureComponent {
180
170
  _defineProperty(ReactionWithoutAnalytics, "defaultProps", {
181
171
  flash: false,
182
172
  className: undefined,
183
- onMouseOver: undefined,
173
+ onMouseEnter: undefined,
184
174
  flashOnMount: false
185
175
  });
186
176
 
@@ -1,37 +1,34 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ /** @jsx jsx */
4
+ import { jsx, css } from '@emotion/core';
2
5
  import { EmojiPicker } from '@atlaskit/emoji/picker';
3
6
  import { Manager, Popper, Reference } from '@atlaskit/popper';
4
7
  import { borderRadius } from '@atlaskit/theme/constants';
5
8
  import { N0, N50A, N60A } from '@atlaskit/theme/colors';
6
9
  import { token } from '@atlaskit/tokens';
7
- import cx from 'classnames';
8
- import React from 'react';
10
+ import React, { Fragment } from 'react';
9
11
  import { PureComponent } from 'react';
10
12
  import ReactDOM from 'react-dom';
11
- import { style } from 'typestyle';
12
13
  import { Selector } from './Selector';
13
14
  import { Trigger } from './Trigger';
14
15
  import { layers } from '@atlaskit/theme/constants';
15
- const pickerStyle = style({
16
+ const pickerStyle = css({
16
17
  verticalAlign: 'middle',
17
- $nest: {
18
- '&.miniMode': {
19
- display: 'inline-block',
20
- marginRight: '4px'
21
- }
18
+ '&.miniMode': {
19
+ display: 'inline-block',
20
+ marginRight: '4px'
22
21
  }
23
22
  });
24
- const contentStyle = style({
23
+ const contentStyle = css({
25
24
  display: 'flex'
26
25
  });
27
- const popupStyle = style({
26
+ const popupStyle = css({
28
27
  background: token('elevation.surface.overlay', N0),
29
28
  borderRadius: `${borderRadius()}px`,
30
29
  boxShadow: token('elevation.shadow.overlay', `0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`),
31
- $nest: {
32
- '&> div': {
33
- boxShadow: undefined
34
- }
30
+ '&> div': {
31
+ boxShadow: undefined
35
32
  }
36
33
  });
37
34
 
@@ -154,9 +151,9 @@ export class ReactionPicker extends PureComponent {
154
151
  emojiProvider,
155
152
  allowAllEmojis
156
153
  } = this.props;
157
- return /*#__PURE__*/React.createElement("div", {
158
- className: contentStyle
159
- }, /*#__PURE__*/React.createElement(Selector, {
154
+ return jsx("div", {
155
+ css: contentStyle
156
+ }, jsx(Selector, {
160
157
  emojiProvider: emojiProvider,
161
158
  onSelection: this.onEmojiSelected,
162
159
  showMore: allowAllEmojis,
@@ -165,7 +162,7 @@ export class ReactionPicker extends PureComponent {
165
162
  }
166
163
 
167
164
  renderEmojiPicker() {
168
- return /*#__PURE__*/React.createElement(EmojiPicker, {
165
+ return jsx(EmojiPicker, {
169
166
  emojiProvider: this.props.emojiProvider,
170
167
  onSelection: this.onEmojiSelected
171
168
  });
@@ -180,22 +177,20 @@ export class ReactionPicker extends PureComponent {
180
177
  isOpen
181
178
  } = this.state;
182
179
  const {
183
- miniMode
180
+ miniMode,
181
+ className
184
182
  } = this.props;
185
- const classNames = cx(pickerStyle, {
186
- isOpen: isOpen,
187
- miniMode: miniMode
188
- }, this.props.className);
189
- return /*#__PURE__*/React.createElement("div", {
190
- className: classNames
191
- }, /*#__PURE__*/React.createElement(Manager, null, /*#__PURE__*/React.createElement(Reference, null, ({
183
+ return jsx("div", {
184
+ className: ` ${isOpen ? 'isOpen' : ''} ${miniMode ? 'miniMode' : ''} ${className}`,
185
+ css: pickerStyle
186
+ }, jsx(Manager, null, jsx(Reference, null, ({
192
187
  ref
193
- }) => /*#__PURE__*/React.createElement(Trigger, {
188
+ }) => jsx(Trigger, {
194
189
  ref: ref,
195
190
  onClick: this.onTriggerClick,
196
191
  miniMode: miniMode,
197
192
  disabled: this.props.disabled
198
- })), /*#__PURE__*/React.createElement(Popper, {
193
+ })), jsx(Popper, {
199
194
  placement: "bottom-start",
200
195
  modifiers: this.popperModifiers
201
196
  }, ({
@@ -204,14 +199,14 @@ export class ReactionPicker extends PureComponent {
204
199
  update
205
200
  }) => {
206
201
  this.updatePopper = update;
207
- return /*#__PURE__*/React.createElement(React.Fragment, null, this.state.isOpen && /*#__PURE__*/React.createElement("div", {
202
+ return jsx(Fragment, null, isOpen && jsx("div", {
208
203
  style: {
209
204
  zIndex: layers.layer(),
210
205
  ...style
211
206
  },
212
207
  ref: ref
213
- }, /*#__PURE__*/React.createElement("div", {
214
- className: popupStyle
208
+ }, jsx("div", {
209
+ css: popupStyle
215
210
  }, this.renderContent())));
216
211
  })));
217
212
  }
@@ -1,38 +1,38 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+
3
+ /** @jsx jsx */
4
+ import { jsx, css } from '@emotion/core';
2
5
  import Tooltip from '@atlaskit/tooltip';
3
- import React from 'react';
6
+ import React, { Fragment } from 'react';
4
7
  import { FormattedMessage } from 'react-intl-next';
5
- import { style } from 'typestyle';
6
8
  import { token } from '@atlaskit/tokens';
7
9
  import { N90 } from '@atlaskit/theme/colors';
8
10
  import { messages } from './i18n';
9
11
  const verticalMargin = 5;
10
- const tooltipStyle = style({
12
+ const tooltipStyle = css({
11
13
  maxWidth: '150px',
12
14
  textOverflow: 'ellipsis',
13
15
  whiteSpace: 'nowrap',
14
16
  overflow: 'hidden',
15
17
  marginBottom: verticalMargin,
16
- $nest: {
17
- ul: {
18
- listStyle: 'none',
19
- margin: 0,
20
- padding: 0,
21
- textAlign: 'left'
22
- },
23
- li: {
24
- overflow: 'hidden',
25
- textOverflow: 'ellipsis',
26
- marginTop: verticalMargin
27
- }
18
+ ul: {
19
+ listStyle: 'none',
20
+ margin: 0,
21
+ padding: 0,
22
+ textAlign: 'left'
23
+ },
24
+ li: {
25
+ overflow: 'hidden',
26
+ textOverflow: 'ellipsis',
27
+ marginTop: verticalMargin
28
28
  }
29
29
  });
30
- const emojiNameStyle = style({
30
+ const emojiNameStyle = css({
31
31
  textTransform: 'capitalize',
32
32
  color: token('color.text.inverse', N90),
33
33
  fontWeight: 600
34
34
  });
35
- const footerStyle = style({
35
+ const footerStyle = css({
36
36
  color: token('color.text.inverse', N90),
37
37
  fontWeight: 300
38
38
  });
@@ -45,25 +45,25 @@ export const ReactionTooltip = ({
45
45
  }
46
46
  }) => {
47
47
  if (!users || users.length === 0) {
48
- return /*#__PURE__*/React.createElement(React.Fragment, null, React.Children.only(children));
48
+ return jsx(Fragment, null, React.Children.only(children));
49
49
  }
50
50
 
51
- const content = /*#__PURE__*/React.createElement("div", {
52
- className: tooltipStyle
53
- }, /*#__PURE__*/React.createElement("ul", null, emojiName ? /*#__PURE__*/React.createElement("li", {
54
- className: emojiNameStyle
51
+ const content = jsx("div", {
52
+ css: tooltipStyle
53
+ }, jsx("ul", null, emojiName ? jsx("li", {
54
+ css: emojiNameStyle
55
55
  }, emojiName) : null, users.slice(0, TOOLTIP_USERS_LIMIT).map((user, index) => {
56
- return /*#__PURE__*/React.createElement("li", {
56
+ return jsx("li", {
57
57
  key: index
58
58
  }, user.displayName);
59
- }), users.length > TOOLTIP_USERS_LIMIT ? /*#__PURE__*/React.createElement("li", {
60
- className: footerStyle
61
- }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.otherUsers, {
59
+ }), users.length > TOOLTIP_USERS_LIMIT ? jsx("li", {
60
+ css: footerStyle
61
+ }, jsx(FormattedMessage, _extends({}, messages.otherUsers, {
62
62
  values: {
63
63
  count: users.length - TOOLTIP_USERS_LIMIT
64
64
  }
65
65
  }))) : null));
66
- return /*#__PURE__*/React.createElement(Tooltip, {
66
+ return jsx(Tooltip, {
67
67
  content: content,
68
68
  position: "bottom"
69
69
  }, React.Children.only(children));