@atlaskit/reactions 22.11.2 → 22.12.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 (32) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/analytics/index.js +1 -1
  3. package/dist/cjs/components/ReactionPicker/ReactionPicker.js +8 -2
  4. package/dist/cjs/components/ReactionSummary/ReactionSummaryButton.js +8 -2
  5. package/dist/cjs/components/ReactionSummary/ReactionSummaryView.js +5 -2
  6. package/dist/cjs/components/Reactions/Reactions.js +15 -6
  7. package/dist/cjs/components/Trigger/Trigger.js +31 -3
  8. package/dist/es2019/analytics/index.js +1 -1
  9. package/dist/es2019/components/ReactionPicker/ReactionPicker.js +6 -2
  10. package/dist/es2019/components/ReactionSummary/ReactionSummaryButton.js +7 -2
  11. package/dist/es2019/components/ReactionSummary/ReactionSummaryView.js +4 -2
  12. package/dist/es2019/components/Reactions/Reactions.js +12 -6
  13. package/dist/es2019/components/Trigger/Trigger.js +31 -4
  14. package/dist/esm/analytics/index.js +1 -1
  15. package/dist/esm/components/ReactionPicker/ReactionPicker.js +8 -2
  16. package/dist/esm/components/ReactionSummary/ReactionSummaryButton.js +8 -2
  17. package/dist/esm/components/ReactionSummary/ReactionSummaryView.js +5 -2
  18. package/dist/esm/components/Reactions/Reactions.js +15 -6
  19. package/dist/esm/components/Trigger/Trigger.js +32 -4
  20. package/dist/types/components/ReactionPicker/ReactionPicker.d.ts +8 -0
  21. package/dist/types/components/ReactionSummary/ReactionSummaryButton.d.ts +4 -0
  22. package/dist/types/components/ReactionSummary/ReactionSummaryView.d.ts +5 -1
  23. package/dist/types/components/Reactions/Reactions.d.ts +13 -1
  24. package/dist/types/components/Trigger/Trigger.d.ts +8 -0
  25. package/dist/types/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +1 -1
  26. package/dist/types-ts4.5/components/ReactionPicker/ReactionPicker.d.ts +8 -0
  27. package/dist/types-ts4.5/components/ReactionSummary/ReactionSummaryButton.d.ts +4 -0
  28. package/dist/types-ts4.5/components/ReactionSummary/ReactionSummaryView.d.ts +5 -1
  29. package/dist/types-ts4.5/components/Reactions/Reactions.d.ts +13 -1
  30. package/dist/types-ts4.5/components/Trigger/Trigger.d.ts +8 -0
  31. package/dist/types-ts4.5/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +1 -1
  32. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/reactions
2
2
 
3
+ ## 22.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#137371](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/137371)
8
+ [`1eb8eea490922`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1eb8eea490922) -
9
+ [ux] Added props for applying subtle styling to reactions summary and picker. Added prop for
10
+ displaying the full "Add a reaction" text to the button UI for the reactions picker. Added prop
11
+ for hiding default reactions displayed when there is no existing reaction on the page.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 22.11.2
4
18
 
5
19
  ### Patch Changes
@@ -11,7 +11,7 @@ var _analyticsGasTypes = require("@atlaskit/analytics-gas-types");
11
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
13
  var packageName = "@atlaskit/reactions";
14
- var packageVersion = "22.11.2";
14
+ var packageVersion = "22.12.0";
15
15
  /**
16
16
  * TODO: move to utility package?
17
17
  * A random sampling function
@@ -91,7 +91,11 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
91
91
  tooltipContent = _props$tooltipContent === void 0 ? (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.addReaction) : _props$tooltipContent,
92
92
  emojiPickerSize = props.emojiPickerSize,
93
93
  _props$showOpaqueBack = props.showOpaqueBackground,
94
- showOpaqueBackground = _props$showOpaqueBack === void 0 ? false : _props$showOpaqueBack;
94
+ showOpaqueBackground = _props$showOpaqueBack === void 0 ? false : _props$showOpaqueBack,
95
+ _props$subtleReaction = props.subtleReactionsSummaryAndPicker,
96
+ subtleReactionsSummaryAndPicker = _props$subtleReaction === void 0 ? false : _props$subtleReaction,
97
+ _props$showAddReactio = props.showAddReactionText,
98
+ showAddReactionText = _props$showAddReactio === void 0 ? false : _props$showAddReactio;
95
99
  var _useState = (0, _react.useState)(null),
96
100
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
97
101
  triggerRef = _useState2[0],
@@ -223,7 +227,9 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
223
227
  miniMode: miniMode,
224
228
  disabled: disabled,
225
229
  tooltipContent: settings.isOpen ? null : tooltipContent,
226
- showOpaqueBackground: showOpaqueBackground
230
+ showOpaqueBackground: showOpaqueBackground,
231
+ showAddReactionText: showAddReactionText,
232
+ subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker
227
233
  })
228
234
  );
229
235
  }), settings.isOpen && (0, _react2.jsx)(PopperWrapper, {
@@ -38,6 +38,9 @@ var opaqueBackgroundStyles = (0, _primitives.xcss)({
38
38
  var containerStyle = (0, _primitives.xcss)({
39
39
  position: 'relative'
40
40
  });
41
+ var hideBorderStyle = (0, _primitives.xcss)({
42
+ border: 'none'
43
+ });
41
44
  /**
42
45
  * Test id for summary reaction wrapper button
43
46
  */
@@ -57,7 +60,9 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
57
60
  emojisToShow = _ref$emojisToShow === void 0 ? 3 : _ref$emojisToShow,
58
61
  onClick = _ref.onClick,
59
62
  _ref$showOpaqueBackgr = _ref.showOpaqueBackground,
60
- showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
63
+ showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr,
64
+ _ref$subtleReactionsS = _ref.subtleReactionsSummaryAndPicker,
65
+ subtleReactionsSummaryAndPicker = _ref$subtleReactionsS === void 0 ? false : _ref$subtleReactionsS;
61
66
  var intl = (0, _reactIntlNext.useIntl)();
62
67
 
63
68
  // Helper function to sort reactions by count and return top N
@@ -75,6 +80,7 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
75
80
  return getTopReactions(reactions, emojisToShow);
76
81
  }, [emojisToShow, reactions]);
77
82
  var buttonStyles = showOpaqueBackground ? [opaqueBackgroundStyles] : [];
83
+ var subtleSummaryStyles = subtleReactionsSummaryAndPicker ? [hideBorderStyle] : [];
78
84
  return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
79
85
  xcss: containerStyle,
80
86
  ref: ref
@@ -82,7 +88,7 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
82
88
  onClick: onClick,
83
89
  testId: RENDER_SUMMARY_BUTTON_TESTID,
84
90
  ariaLabel: intl.formatMessage(_i18n.messages.summary),
85
- additionalStyles: buttonStyles
91
+ additionalStyles: [].concat(buttonStyles, subtleSummaryStyles)
86
92
  }, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
87
93
  space: "space.050",
88
94
  xcss: buttonStyle
@@ -41,7 +41,9 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
41
41
  onReactionFocused = _ref.onReactionFocused,
42
42
  onReactionMouseEnter = _ref.onReactionMouseEnter,
43
43
  _ref$showOpaqueBackgr = _ref.showOpaqueBackground,
44
- showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
44
+ showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr,
45
+ _ref$subtleReactionsS = _ref.subtleReactionsSummaryAndPicker,
46
+ subtleReactionsSummaryAndPicker = _ref$subtleReactionsS === void 0 ? false : _ref$subtleReactionsS;
45
47
  var _useState = (0, _react.useState)(false),
46
48
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
47
49
  isSummaryPopupOpen = _useState2[0],
@@ -82,7 +84,8 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
82
84
  emojiProvider: emojiProvider,
83
85
  reactions: reactions,
84
86
  onClick: handleSummaryClick,
85
- showOpaqueBackground: showOpaqueBackground
87
+ showOpaqueBackground: showOpaqueBackground,
88
+ subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker
86
89
  }));
87
90
  }
88
91
  });
@@ -124,7 +124,13 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
124
124
  summaryViewThreshold = _ref$summaryViewThres === void 0 ? 3 : _ref$summaryViewThres,
125
125
  summaryViewPlacement = _ref.summaryViewPlacement,
126
126
  _ref$showOpaqueBackgr = _ref.showOpaqueBackground,
127
- showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
127
+ showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr,
128
+ _ref$subtleReactionsS = _ref.subtleReactionsSummaryAndPicker,
129
+ subtleReactionsSummaryAndPicker = _ref$subtleReactionsS === void 0 ? false : _ref$subtleReactionsS,
130
+ _ref$showAddReactionT = _ref.showAddReactionText,
131
+ showAddReactionText = _ref$showAddReactionT === void 0 ? false : _ref$showAddReactionT,
132
+ _ref$hideDefaultReact = _ref.hideDefaultReactions,
133
+ hideDefaultReactions = _ref$hideDefaultReact === void 0 ? false : _ref$hideDefaultReact;
128
134
  var _useState = (0, _react.useState)(),
129
135
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
130
136
  selectedEmojiId = _useState2[0],
@@ -252,9 +258,9 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
252
258
  var memorizedReactions = (0, _react.useMemo)(function () {
253
259
  //
254
260
  /**
255
- * If reactions not empty, don't show quick reactions Pre defined emoji or if its empty => return the current list of reactions
261
+ * If reactions not empty, don't show quick reactions Pre defined emoji or if its empty and default reactions not hidden => return the current list of reactions
256
262
  */
257
- if (reactions.length > 0 || !quickReactionEmojis) {
263
+ if (reactions.length === 0 && hideDefaultReactions || reactions.length > 0 || !quickReactionEmojis) {
258
264
  return reactions;
259
265
  }
260
266
 
@@ -276,7 +282,7 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
276
282
  };
277
283
  });
278
284
  return reactions.concat(items);
279
- }, [quickReactionEmojis, reactions]);
285
+ }, [quickReactionEmojis, reactions, hideDefaultReactions]);
280
286
  var shouldShowSummaryView = summaryViewEnabled && memorizedReactions.length >= summaryViewThreshold && reactions.length > 0;
281
287
  return (
282
288
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -296,7 +302,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
296
302
  onReactionFocused: handleReactionFocused,
297
303
  onReactionMouseEnter: handleReactionMouseEnter,
298
304
  placement: summaryViewPlacement,
299
- showOpaqueBackground: showOpaqueBackground
305
+ showOpaqueBackground: showOpaqueBackground,
306
+ subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker
300
307
  })) : memorizedReactions.map(function (reaction) {
301
308
  return (0, _react2.jsx)(_Reaction.Reaction, {
302
309
  key: reaction.emojiId,
@@ -326,7 +333,9 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
326
333
  tooltipContent: getTooltip(status, errorMessage),
327
334
  emojiPickerSize: emojiPickerSize,
328
335
  miniMode: miniMode,
329
- showOpaqueBackground: showOpaqueBackground
336
+ showOpaqueBackground: showOpaqueBackground,
337
+ showAddReactionText: showAddReactionText,
338
+ subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker
330
339
  }), allowUserDialog && reactions.length > 0 && (0, _react2.jsx)(_tooltip.default, {
331
340
  content: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.seeWhoReactedTooltip),
332
341
  hideTooltipOnClick: true
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.Trigger = exports.RENDER_TRIGGER_BUTTON_TESTID = exports.RENDER_TOOLTIP_TRIGGER_TESTID = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
+ var _reactIntlNext = require("react-intl-next");
10
11
  var _react2 = require("@emotion/react");
11
12
  var _primitives = require("@atlaskit/primitives");
12
13
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
@@ -24,6 +25,13 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
25
  */
25
26
  var RENDER_TOOLTIP_TRIGGER_TESTID = exports.RENDER_TOOLTIP_TRIGGER_TESTID = 'render-tooltip-trigger';
26
27
  var RENDER_TRIGGER_BUTTON_TESTID = exports.RENDER_TRIGGER_BUTTON_TESTID = 'render-trigger-button';
28
+ var i18n = (0, _reactIntlNext.defineMessages)({
29
+ addReaction: {
30
+ id: 'reaction-picker-trigger.add.reaction.message',
31
+ description: 'Message displayed when there are no page reactions existing on the page.',
32
+ defaultMessage: 'Add a reaction'
33
+ }
34
+ });
27
35
  var triggerStyles = (0, _primitives.xcss)({
28
36
  minWidth: '32px',
29
37
  height: '24px',
@@ -36,6 +44,13 @@ var triggerStyles = (0, _primitives.xcss)({
36
44
  alignItems: 'center',
37
45
  lineHeight: '16px'
38
46
  });
47
+ var subtleTriggerStyles = (0, _primitives.xcss)({
48
+ minWidth: '24px',
49
+ border: 'none'
50
+ });
51
+ var expandedTriggerStyles = (0, _primitives.xcss)({
52
+ minWidth: '110px'
53
+ });
39
54
  var triggerStylesRefresh = (0, _primitives.xcss)({
40
55
  borderRadius: 'border.radius'
41
56
  });
@@ -69,11 +84,18 @@ var miniModeStyles = (0, _primitives.xcss)({
69
84
  border: 'none',
70
85
  borderRadius: 'border.radius'
71
86
  });
87
+ var addReactionMessageStyles = (0, _primitives.xcss)({
88
+ fontSize: '12px',
89
+ color: 'color.text.subtle',
90
+ marginLeft: 'space.050'
91
+ });
72
92
 
73
93
  /**
74
94
  * Render an emoji button to open the reactions select picker
75
95
  */
76
96
  var Trigger = exports.Trigger = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
97
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
98
+ formatMessage = _useIntl.formatMessage;
77
99
  var onClick = props.onClick,
78
100
  miniMode = props.miniMode,
79
101
  tooltipContent = props.tooltipContent,
@@ -82,7 +104,11 @@ var Trigger = exports.Trigger = /*#__PURE__*/_react.default.forwardRef(function
82
104
  _props$ariaAttributes = props.ariaAttributes,
83
105
  ariaAttributes = _props$ariaAttributes === void 0 ? {} : _props$ariaAttributes,
84
106
  _props$showOpaqueBack = props.showOpaqueBackground,
85
- showOpaqueBackground = _props$showOpaqueBack === void 0 ? false : _props$showOpaqueBack;
107
+ showOpaqueBackground = _props$showOpaqueBack === void 0 ? false : _props$showOpaqueBack,
108
+ _props$showAddReactio = props.showAddReactionText,
109
+ showAddReactionText = _props$showAddReactio === void 0 ? false : _props$showAddReactio,
110
+ _props$subtleReaction = props.subtleReactionsSummaryAndPicker,
111
+ subtleReactionsSummaryAndPicker = _props$subtleReaction === void 0 ? false : _props$subtleReaction;
86
112
  var handleMouseDown = function handleMouseDown(e, analyticsEvent) {
87
113
  if (onClick && !disabled) {
88
114
  onClick(e, analyticsEvent);
@@ -93,7 +119,7 @@ var Trigger = exports.Trigger = /*#__PURE__*/_react.default.forwardRef(function
93
119
  content: tooltipContent
94
120
  }, (0, _react2.jsx)(_primitives.Pressable, (0, _extends2.default)({
95
121
  testId: RENDER_TRIGGER_BUTTON_TESTID,
96
- xcss: [triggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') && triggerStylesRefresh],
122
+ xcss: [triggerStyles, subtleReactionsSummaryAndPicker && subtleTriggerStyles, showAddReactionText && expandedTriggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') && triggerStylesRefresh],
97
123
  onClick: handleMouseDown,
98
124
  isDisabled: disabled,
99
125
  ref: ref
@@ -101,5 +127,7 @@ var Trigger = exports.Trigger = /*#__PURE__*/_react.default.forwardRef(function
101
127
  primaryColor: disabled ? "var(--ds-icon-disabled, #091E424F)" : "var(--ds-icon, #44546F)",
102
128
  size: "small",
103
129
  label: "Add reaction"
104
- })));
130
+ }), showAddReactionText && (0, _react2.jsx)(_primitives.Box, {
131
+ xcss: addReactionMessageStyles
132
+ }, formatMessage(i18n.addReaction))));
105
133
  });
@@ -1,7 +1,7 @@
1
1
  import { createAndFireEvent } from '@atlaskit/analytics-next';
2
2
  import { UI_EVENT_TYPE, OPERATIONAL_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
3
3
  const packageName = "@atlaskit/reactions";
4
- const packageVersion = "22.11.2";
4
+ const packageVersion = "22.12.0";
5
5
  /**
6
6
  * TODO: move to utility package?
7
7
  * A random sampling function
@@ -76,7 +76,9 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
76
76
  onCancel = () => {},
77
77
  tooltipContent = jsx(FormattedMessage, messages.addReaction),
78
78
  emojiPickerSize,
79
- showOpaqueBackground = false
79
+ showOpaqueBackground = false,
80
+ subtleReactionsSummaryAndPicker = false,
81
+ showAddReactionText = false
80
82
  } = props;
81
83
  const [triggerRef, setTriggerRef] = useState(null);
82
84
 
@@ -202,7 +204,9 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
202
204
  miniMode: miniMode,
203
205
  disabled: disabled,
204
206
  tooltipContent: settings.isOpen ? null : tooltipContent,
205
- showOpaqueBackground: showOpaqueBackground
207
+ showOpaqueBackground: showOpaqueBackground,
208
+ showAddReactionText: showAddReactionText,
209
+ subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker
206
210
  })), settings.isOpen && jsx(PopperWrapper, {
207
211
  settings: settings
208
212
  }, settings.showFullPicker ? jsx(EmojiPicker, {
@@ -27,6 +27,9 @@ const opaqueBackgroundStyles = xcss({
27
27
  const containerStyle = xcss({
28
28
  position: 'relative'
29
29
  });
30
+ const hideBorderStyle = xcss({
31
+ border: 'none'
32
+ });
30
33
  /**
31
34
  * Test id for summary reaction wrapper button
32
35
  */
@@ -43,7 +46,8 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
43
46
  reactions = [],
44
47
  emojisToShow = 3,
45
48
  onClick,
46
- showOpaqueBackground = false
49
+ showOpaqueBackground = false,
50
+ subtleReactionsSummaryAndPicker = false
47
51
  }, ref) => {
48
52
  const intl = useIntl();
49
53
 
@@ -58,6 +62,7 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
58
62
  }, [reactions]);
59
63
  const topReactions = useMemo(() => getTopReactions(reactions, emojisToShow), [emojisToShow, reactions]);
60
64
  const buttonStyles = showOpaqueBackground ? [opaqueBackgroundStyles] : [];
65
+ const subtleSummaryStyles = subtleReactionsSummaryAndPicker ? [hideBorderStyle] : [];
61
66
  return /*#__PURE__*/React.createElement(Box, {
62
67
  xcss: containerStyle,
63
68
  ref: ref
@@ -65,7 +70,7 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
65
70
  onClick: onClick,
66
71
  testId: RENDER_SUMMARY_BUTTON_TESTID,
67
72
  ariaLabel: intl.formatMessage(messages.summary),
68
- additionalStyles: buttonStyles
73
+ additionalStyles: [...buttonStyles, ...subtleSummaryStyles]
69
74
  }, /*#__PURE__*/React.createElement(Inline, {
70
75
  space: "space.050",
71
76
  xcss: buttonStyle
@@ -25,7 +25,8 @@ export const ReactionSummaryView = ({
25
25
  onReactionClick,
26
26
  onReactionFocused,
27
27
  onReactionMouseEnter,
28
- showOpaqueBackground = false
28
+ showOpaqueBackground = false,
29
+ subtleReactionsSummaryAndPicker = false
29
30
  }) => {
30
31
  const [isSummaryPopupOpen, setSummaryPopupOpen] = useState(false);
31
32
  const handlePopupClose = useCallback(() => setSummaryPopupOpen(false), []);
@@ -55,7 +56,8 @@ export const ReactionSummaryView = ({
55
56
  emojiProvider: emojiProvider,
56
57
  reactions: reactions,
57
58
  onClick: handleSummaryClick,
58
- showOpaqueBackground: showOpaqueBackground
59
+ showOpaqueBackground: showOpaqueBackground,
60
+ subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker
59
61
  }))
60
62
  });
61
63
  };
@@ -97,7 +97,10 @@ export const Reactions = /*#__PURE__*/React.memo(({
97
97
  summaryViewEnabled = false,
98
98
  summaryViewThreshold = 3,
99
99
  summaryViewPlacement,
100
- showOpaqueBackground = false
100
+ showOpaqueBackground = false,
101
+ subtleReactionsSummaryAndPicker = false,
102
+ showAddReactionText = false,
103
+ hideDefaultReactions = false
101
104
  }) => {
102
105
  const [selectedEmojiId, setSelectedEmojiId] = useState();
103
106
  const {
@@ -222,9 +225,9 @@ export const Reactions = /*#__PURE__*/React.memo(({
222
225
  const memorizedReactions = useMemo(() => {
223
226
  //
224
227
  /**
225
- * If reactions not empty, don't show quick reactions Pre defined emoji or if its empty => return the current list of reactions
228
+ * If reactions not empty, don't show quick reactions Pre defined emoji or if its empty and default reactions not hidden => return the current list of reactions
226
229
  */
227
- if (reactions.length > 0 || !quickReactionEmojis) {
230
+ if (reactions.length === 0 && hideDefaultReactions || reactions.length > 0 || !quickReactionEmojis) {
228
231
  return reactions;
229
232
  }
230
233
 
@@ -244,7 +247,7 @@ export const Reactions = /*#__PURE__*/React.memo(({
244
247
  };
245
248
  });
246
249
  return reactions.concat(items);
247
- }, [quickReactionEmojis, reactions]);
250
+ }, [quickReactionEmojis, reactions, hideDefaultReactions]);
248
251
  const shouldShowSummaryView = summaryViewEnabled && memorizedReactions.length >= summaryViewThreshold && reactions.length > 0;
249
252
  return (
250
253
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -264,7 +267,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
264
267
  onReactionFocused: handleReactionFocused,
265
268
  onReactionMouseEnter: handleReactionMouseEnter,
266
269
  placement: summaryViewPlacement,
267
- showOpaqueBackground: showOpaqueBackground
270
+ showOpaqueBackground: showOpaqueBackground,
271
+ subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker
268
272
  })) : memorizedReactions.map(reaction => jsx(Reaction, {
269
273
  key: reaction.emojiId,
270
274
  reaction: reaction,
@@ -292,7 +296,9 @@ export const Reactions = /*#__PURE__*/React.memo(({
292
296
  tooltipContent: getTooltip(status, errorMessage),
293
297
  emojiPickerSize: emojiPickerSize,
294
298
  miniMode: miniMode,
295
- showOpaqueBackground: showOpaqueBackground
299
+ showOpaqueBackground: showOpaqueBackground,
300
+ showAddReactionText: showAddReactionText,
301
+ subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker
296
302
  }), allowUserDialog && reactions.length > 0 && jsx(Tooltip, {
297
303
  content: jsx(FormattedMessage, messages.seeWhoReactedTooltip),
298
304
  hideTooltipOnClick: true
@@ -4,9 +4,10 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  * @jsx jsx
5
5
  */
6
6
  import React from 'react';
7
+ import { defineMessages, useIntl } from 'react-intl-next';
7
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
9
  import { jsx } from '@emotion/react';
9
- import { Pressable, xcss } from '@atlaskit/primitives';
10
+ import { Pressable, Box, xcss } from '@atlaskit/primitives';
10
11
  import Tooltip from '@atlaskit/tooltip';
11
12
  import EmojiAddIcon from '@atlaskit/icon/glyph/emoji-add';
12
13
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -16,6 +17,13 @@ import { fg } from '@atlaskit/platform-feature-flags';
16
17
  */
17
18
  export const RENDER_TOOLTIP_TRIGGER_TESTID = 'render-tooltip-trigger';
18
19
  export const RENDER_TRIGGER_BUTTON_TESTID = 'render-trigger-button';
20
+ const i18n = defineMessages({
21
+ addReaction: {
22
+ id: 'reaction-picker-trigger.add.reaction.message',
23
+ description: 'Message displayed when there are no page reactions existing on the page.',
24
+ defaultMessage: 'Add a reaction'
25
+ }
26
+ });
19
27
  const triggerStyles = xcss({
20
28
  minWidth: '32px',
21
29
  height: '24px',
@@ -28,6 +36,13 @@ const triggerStyles = xcss({
28
36
  alignItems: 'center',
29
37
  lineHeight: '16px'
30
38
  });
39
+ const subtleTriggerStyles = xcss({
40
+ minWidth: '24px',
41
+ border: 'none'
42
+ });
43
+ const expandedTriggerStyles = xcss({
44
+ minWidth: '110px'
45
+ });
31
46
  const triggerStylesRefresh = xcss({
32
47
  borderRadius: 'border.radius'
33
48
  });
@@ -61,18 +76,28 @@ const miniModeStyles = xcss({
61
76
  border: 'none',
62
77
  borderRadius: 'border.radius'
63
78
  });
79
+ const addReactionMessageStyles = xcss({
80
+ fontSize: '12px',
81
+ color: 'color.text.subtle',
82
+ marginLeft: 'space.050'
83
+ });
64
84
 
65
85
  /**
66
86
  * Render an emoji button to open the reactions select picker
67
87
  */
68
88
  export const Trigger = /*#__PURE__*/React.forwardRef((props, ref) => {
89
+ const {
90
+ formatMessage
91
+ } = useIntl();
69
92
  const {
70
93
  onClick,
71
94
  miniMode,
72
95
  tooltipContent,
73
96
  disabled = false,
74
97
  ariaAttributes = {},
75
- showOpaqueBackground = false
98
+ showOpaqueBackground = false,
99
+ showAddReactionText = false,
100
+ subtleReactionsSummaryAndPicker = false
76
101
  } = props;
77
102
  const handleMouseDown = (e, analyticsEvent) => {
78
103
  if (onClick && !disabled) {
@@ -84,7 +109,7 @@ export const Trigger = /*#__PURE__*/React.forwardRef((props, ref) => {
84
109
  content: tooltipContent
85
110
  }, jsx(Pressable, _extends({
86
111
  testId: RENDER_TRIGGER_BUTTON_TESTID,
87
- xcss: [triggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, fg('platform-component-visual-refresh') && triggerStylesRefresh],
112
+ xcss: [triggerStyles, subtleReactionsSummaryAndPicker && subtleTriggerStyles, showAddReactionText && expandedTriggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, fg('platform-component-visual-refresh') && triggerStylesRefresh],
88
113
  onClick: handleMouseDown,
89
114
  isDisabled: disabled,
90
115
  ref: ref
@@ -92,5 +117,7 @@ export const Trigger = /*#__PURE__*/React.forwardRef((props, ref) => {
92
117
  primaryColor: disabled ? "var(--ds-icon-disabled, #091E424F)" : "var(--ds-icon, #44546F)",
93
118
  size: "small",
94
119
  label: "Add reaction"
95
- })));
120
+ }), showAddReactionText && jsx(Box, {
121
+ xcss: addReactionMessageStyles
122
+ }, formatMessage(i18n.addReaction))));
96
123
  });
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { createAndFireEvent } from '@atlaskit/analytics-next';
5
5
  import { UI_EVENT_TYPE, OPERATIONAL_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
6
6
  var packageName = "@atlaskit/reactions";
7
- var packageVersion = "22.11.2";
7
+ var packageVersion = "22.12.0";
8
8
  /**
9
9
  * TODO: move to utility package?
10
10
  * A random sampling function
@@ -84,7 +84,11 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
84
84
  tooltipContent = _props$tooltipContent === void 0 ? jsx(FormattedMessage, messages.addReaction) : _props$tooltipContent,
85
85
  emojiPickerSize = props.emojiPickerSize,
86
86
  _props$showOpaqueBack = props.showOpaqueBackground,
87
- showOpaqueBackground = _props$showOpaqueBack === void 0 ? false : _props$showOpaqueBack;
87
+ showOpaqueBackground = _props$showOpaqueBack === void 0 ? false : _props$showOpaqueBack,
88
+ _props$subtleReaction = props.subtleReactionsSummaryAndPicker,
89
+ subtleReactionsSummaryAndPicker = _props$subtleReaction === void 0 ? false : _props$subtleReaction,
90
+ _props$showAddReactio = props.showAddReactionText,
91
+ showAddReactionText = _props$showAddReactio === void 0 ? false : _props$showAddReactio;
88
92
  var _useState = useState(null),
89
93
  _useState2 = _slicedToArray(_useState, 2),
90
94
  triggerRef = _useState2[0],
@@ -216,7 +220,9 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
216
220
  miniMode: miniMode,
217
221
  disabled: disabled,
218
222
  tooltipContent: settings.isOpen ? null : tooltipContent,
219
- showOpaqueBackground: showOpaqueBackground
223
+ showOpaqueBackground: showOpaqueBackground,
224
+ showAddReactionText: showAddReactionText,
225
+ subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker
220
226
  })
221
227
  );
222
228
  }), settings.isOpen && jsx(PopperWrapper, {
@@ -28,6 +28,9 @@ var opaqueBackgroundStyles = xcss({
28
28
  var containerStyle = xcss({
29
29
  position: 'relative'
30
30
  });
31
+ var hideBorderStyle = xcss({
32
+ border: 'none'
33
+ });
31
34
  /**
32
35
  * Test id for summary reaction wrapper button
33
36
  */
@@ -47,7 +50,9 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
47
50
  emojisToShow = _ref$emojisToShow === void 0 ? 3 : _ref$emojisToShow,
48
51
  onClick = _ref.onClick,
49
52
  _ref$showOpaqueBackgr = _ref.showOpaqueBackground,
50
- showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
53
+ showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr,
54
+ _ref$subtleReactionsS = _ref.subtleReactionsSummaryAndPicker,
55
+ subtleReactionsSummaryAndPicker = _ref$subtleReactionsS === void 0 ? false : _ref$subtleReactionsS;
51
56
  var intl = useIntl();
52
57
 
53
58
  // Helper function to sort reactions by count and return top N
@@ -65,6 +70,7 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
65
70
  return getTopReactions(reactions, emojisToShow);
66
71
  }, [emojisToShow, reactions]);
67
72
  var buttonStyles = showOpaqueBackground ? [opaqueBackgroundStyles] : [];
73
+ var subtleSummaryStyles = subtleReactionsSummaryAndPicker ? [hideBorderStyle] : [];
68
74
  return /*#__PURE__*/React.createElement(Box, {
69
75
  xcss: containerStyle,
70
76
  ref: ref
@@ -72,7 +78,7 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
72
78
  onClick: onClick,
73
79
  testId: RENDER_SUMMARY_BUTTON_TESTID,
74
80
  ariaLabel: intl.formatMessage(messages.summary),
75
- additionalStyles: buttonStyles
81
+ additionalStyles: [].concat(buttonStyles, subtleSummaryStyles)
76
82
  }, /*#__PURE__*/React.createElement(Inline, {
77
83
  space: "space.050",
78
84
  xcss: buttonStyle
@@ -31,7 +31,9 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
31
31
  onReactionFocused = _ref.onReactionFocused,
32
32
  onReactionMouseEnter = _ref.onReactionMouseEnter,
33
33
  _ref$showOpaqueBackgr = _ref.showOpaqueBackground,
34
- showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
34
+ showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr,
35
+ _ref$subtleReactionsS = _ref.subtleReactionsSummaryAndPicker,
36
+ subtleReactionsSummaryAndPicker = _ref$subtleReactionsS === void 0 ? false : _ref$subtleReactionsS;
35
37
  var _useState = useState(false),
36
38
  _useState2 = _slicedToArray(_useState, 2),
37
39
  isSummaryPopupOpen = _useState2[0],
@@ -72,7 +74,8 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
72
74
  emojiProvider: emojiProvider,
73
75
  reactions: reactions,
74
76
  onClick: handleSummaryClick,
75
- showOpaqueBackground: showOpaqueBackground
77
+ showOpaqueBackground: showOpaqueBackground,
78
+ subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker
76
79
  }));
77
80
  }
78
81
  });
@@ -111,7 +111,13 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
111
111
  summaryViewThreshold = _ref$summaryViewThres === void 0 ? 3 : _ref$summaryViewThres,
112
112
  summaryViewPlacement = _ref.summaryViewPlacement,
113
113
  _ref$showOpaqueBackgr = _ref.showOpaqueBackground,
114
- showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
114
+ showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr,
115
+ _ref$subtleReactionsS = _ref.subtleReactionsSummaryAndPicker,
116
+ subtleReactionsSummaryAndPicker = _ref$subtleReactionsS === void 0 ? false : _ref$subtleReactionsS,
117
+ _ref$showAddReactionT = _ref.showAddReactionText,
118
+ showAddReactionText = _ref$showAddReactionT === void 0 ? false : _ref$showAddReactionT,
119
+ _ref$hideDefaultReact = _ref.hideDefaultReactions,
120
+ hideDefaultReactions = _ref$hideDefaultReact === void 0 ? false : _ref$hideDefaultReact;
115
121
  var _useState = useState(),
116
122
  _useState2 = _slicedToArray(_useState, 2),
117
123
  selectedEmojiId = _useState2[0],
@@ -239,9 +245,9 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
239
245
  var memorizedReactions = useMemo(function () {
240
246
  //
241
247
  /**
242
- * If reactions not empty, don't show quick reactions Pre defined emoji or if its empty => return the current list of reactions
248
+ * If reactions not empty, don't show quick reactions Pre defined emoji or if its empty and default reactions not hidden => return the current list of reactions
243
249
  */
244
- if (reactions.length > 0 || !quickReactionEmojis) {
250
+ if (reactions.length === 0 && hideDefaultReactions || reactions.length > 0 || !quickReactionEmojis) {
245
251
  return reactions;
246
252
  }
247
253
 
@@ -263,7 +269,7 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
263
269
  };
264
270
  });
265
271
  return reactions.concat(items);
266
- }, [quickReactionEmojis, reactions]);
272
+ }, [quickReactionEmojis, reactions, hideDefaultReactions]);
267
273
  var shouldShowSummaryView = summaryViewEnabled && memorizedReactions.length >= summaryViewThreshold && reactions.length > 0;
268
274
  return (
269
275
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -283,7 +289,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
283
289
  onReactionFocused: handleReactionFocused,
284
290
  onReactionMouseEnter: handleReactionMouseEnter,
285
291
  placement: summaryViewPlacement,
286
- showOpaqueBackground: showOpaqueBackground
292
+ showOpaqueBackground: showOpaqueBackground,
293
+ subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker
287
294
  })) : memorizedReactions.map(function (reaction) {
288
295
  return jsx(Reaction, {
289
296
  key: reaction.emojiId,
@@ -313,7 +320,9 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
313
320
  tooltipContent: getTooltip(status, errorMessage),
314
321
  emojiPickerSize: emojiPickerSize,
315
322
  miniMode: miniMode,
316
- showOpaqueBackground: showOpaqueBackground
323
+ showOpaqueBackground: showOpaqueBackground,
324
+ showAddReactionText: showAddReactionText,
325
+ subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker
317
326
  }), allowUserDialog && reactions.length > 0 && jsx(Tooltip, {
318
327
  content: jsx(FormattedMessage, messages.seeWhoReactedTooltip),
319
328
  hideTooltipOnClick: true
@@ -4,9 +4,10 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  * @jsx jsx
5
5
  */
6
6
  import React from 'react';
7
+ import { defineMessages, useIntl } from 'react-intl-next';
7
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
9
  import { jsx } from '@emotion/react';
9
- import { Pressable, xcss } from '@atlaskit/primitives';
10
+ import { Pressable, Box, xcss } from '@atlaskit/primitives';
10
11
  import Tooltip from '@atlaskit/tooltip';
11
12
  import EmojiAddIcon from '@atlaskit/icon/glyph/emoji-add';
12
13
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -16,6 +17,13 @@ import { fg } from '@atlaskit/platform-feature-flags';
16
17
  */
17
18
  export var RENDER_TOOLTIP_TRIGGER_TESTID = 'render-tooltip-trigger';
18
19
  export var RENDER_TRIGGER_BUTTON_TESTID = 'render-trigger-button';
20
+ var i18n = defineMessages({
21
+ addReaction: {
22
+ id: 'reaction-picker-trigger.add.reaction.message',
23
+ description: 'Message displayed when there are no page reactions existing on the page.',
24
+ defaultMessage: 'Add a reaction'
25
+ }
26
+ });
19
27
  var triggerStyles = xcss({
20
28
  minWidth: '32px',
21
29
  height: '24px',
@@ -28,6 +36,13 @@ var triggerStyles = xcss({
28
36
  alignItems: 'center',
29
37
  lineHeight: '16px'
30
38
  });
39
+ var subtleTriggerStyles = xcss({
40
+ minWidth: '24px',
41
+ border: 'none'
42
+ });
43
+ var expandedTriggerStyles = xcss({
44
+ minWidth: '110px'
45
+ });
31
46
  var triggerStylesRefresh = xcss({
32
47
  borderRadius: 'border.radius'
33
48
  });
@@ -61,11 +76,18 @@ var miniModeStyles = xcss({
61
76
  border: 'none',
62
77
  borderRadius: 'border.radius'
63
78
  });
79
+ var addReactionMessageStyles = xcss({
80
+ fontSize: '12px',
81
+ color: 'color.text.subtle',
82
+ marginLeft: 'space.050'
83
+ });
64
84
 
65
85
  /**
66
86
  * Render an emoji button to open the reactions select picker
67
87
  */
68
88
  export var Trigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
89
+ var _useIntl = useIntl(),
90
+ formatMessage = _useIntl.formatMessage;
69
91
  var onClick = props.onClick,
70
92
  miniMode = props.miniMode,
71
93
  tooltipContent = props.tooltipContent,
@@ -74,7 +96,11 @@ export var Trigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
74
96
  _props$ariaAttributes = props.ariaAttributes,
75
97
  ariaAttributes = _props$ariaAttributes === void 0 ? {} : _props$ariaAttributes,
76
98
  _props$showOpaqueBack = props.showOpaqueBackground,
77
- showOpaqueBackground = _props$showOpaqueBack === void 0 ? false : _props$showOpaqueBack;
99
+ showOpaqueBackground = _props$showOpaqueBack === void 0 ? false : _props$showOpaqueBack,
100
+ _props$showAddReactio = props.showAddReactionText,
101
+ showAddReactionText = _props$showAddReactio === void 0 ? false : _props$showAddReactio,
102
+ _props$subtleReaction = props.subtleReactionsSummaryAndPicker,
103
+ subtleReactionsSummaryAndPicker = _props$subtleReaction === void 0 ? false : _props$subtleReaction;
78
104
  var handleMouseDown = function handleMouseDown(e, analyticsEvent) {
79
105
  if (onClick && !disabled) {
80
106
  onClick(e, analyticsEvent);
@@ -85,7 +111,7 @@ export var Trigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
85
111
  content: tooltipContent
86
112
  }, jsx(Pressable, _extends({
87
113
  testId: RENDER_TRIGGER_BUTTON_TESTID,
88
- xcss: [triggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, fg('platform-component-visual-refresh') && triggerStylesRefresh],
114
+ xcss: [triggerStyles, subtleReactionsSummaryAndPicker && subtleTriggerStyles, showAddReactionText && expandedTriggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, fg('platform-component-visual-refresh') && triggerStylesRefresh],
89
115
  onClick: handleMouseDown,
90
116
  isDisabled: disabled,
91
117
  ref: ref
@@ -93,5 +119,7 @@ export var Trigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
93
119
  primaryColor: disabled ? "var(--ds-icon-disabled, #091E424F)" : "var(--ds-icon, #44546F)",
94
120
  size: "small",
95
121
  label: "Add reaction"
96
- })));
122
+ }), showAddReactionText && jsx(Box, {
123
+ xcss: addReactionMessageStyles
124
+ }, formatMessage(i18n.addReaction))));
97
125
  });
@@ -60,6 +60,14 @@ export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickRea
60
60
  * Optional prop for using an opaque button background instead of a transparent background
61
61
  */
62
62
  showOpaqueBackground?: boolean;
63
+ /**
64
+ * Optional prop for applying subtle styling to reaction summary and picker
65
+ */
66
+ subtleReactionsSummaryAndPicker?: boolean;
67
+ /**
68
+ * Optional prop for displaying text to add a reaction
69
+ */
70
+ showAddReactionText?: boolean;
63
71
  }
64
72
  /**
65
73
  * Picker component for adding reactions
@@ -13,6 +13,10 @@ interface ReactionSummaryButtonProps extends Pick<ReactionsProps, 'emojiProvider
13
13
  * Optional prop for using an opaque button background instead of a transparent background
14
14
  */
15
15
  showOpaqueBackground?: boolean;
16
+ /**
17
+ * Optional prop for applying subtle styling to reaction summary button
18
+ */
19
+ subtleReactionsSummaryAndPicker?: boolean;
16
20
  }
17
21
  /**
18
22
  * Test id for summary reaction wrapper button
@@ -32,6 +32,10 @@ interface ReactionSummaryViewProps extends Pick<ReactionsProps, 'emojiProvider'
32
32
  * Optional prop for using an opaque button background instead of a transparent background
33
33
  */
34
34
  showOpaqueBackground?: boolean;
35
+ /**
36
+ * Optional prop for applying subtle styling to reaction picker
37
+ */
38
+ subtleReactionsSummaryAndPicker?: boolean;
35
39
  }
36
- export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, handleOpenReactionsDialog, allowUserDialog, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, }: ReactionSummaryViewProps) => JSX.Element;
40
+ export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, handleOpenReactionsDialog, allowUserDialog, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, subtleReactionsSummaryAndPicker, }: ReactionSummaryViewProps) => JSX.Element;
37
41
  export {};
@@ -114,6 +114,18 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
114
114
  * Optional prop for using an opaque button background instead of a transparent background
115
115
  */
116
116
  showOpaqueBackground?: boolean;
117
+ /**
118
+ * Optional prop for applying subtle styling to reaction summary and picker
119
+ */
120
+ subtleReactionsSummaryAndPicker?: boolean;
121
+ /**
122
+ * Optional prop for displaying text to add a reaction
123
+ */
124
+ showAddReactionText?: boolean;
125
+ /**
126
+ * Optional prop for hiding default reactions displayed when there are no existing reactions
127
+ */
128
+ hideDefaultReactions?: boolean;
117
129
  }
118
130
  /**
119
131
  * Get content of the tooltip
@@ -122,4 +134,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
122
134
  /**
123
135
  * Renders list of reactions
124
136
  */
125
- export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, }: ReactionsProps) => jsx.JSX.Element>;
137
+ export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, }: ReactionsProps) => jsx.JSX.Element>;
@@ -36,6 +36,14 @@ export interface TriggerProps {
36
36
  * Optional prop for using an opaque button background instead of a transparent background
37
37
  */
38
38
  showOpaqueBackground?: boolean;
39
+ /**
40
+ * Optional prop for displaying text to add a reaction
41
+ */
42
+ showAddReactionText?: boolean;
43
+ /**
44
+ * Optional prop for applying subtle styling to reaction picker
45
+ */
46
+ subtleReactionsSummaryAndPicker?: boolean;
39
47
  }
40
48
  /**
41
49
  * Render an emoji button to open the reactions select picker
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { type ReactionsProps, type ReactionPickerProps } from '../../components';
3
3
  import { ReactionStatus, type Actions, type State, type StorePropInput } from '../../types';
4
- export interface ConnectedReactionsViewProps extends Pick<ReactionsProps, 'quickReactionEmojis' | 'onDialogOpenCallback' | 'onDialogCloseCallback' | 'onDialogSelectReactionCallback' | 'allowUserDialog' | 'allowAllEmojis' | 'emojiProvider' | 'emojiPickerSize' | 'miniMode' | 'summaryViewEnabled'>, Pick<ReactionPickerProps, 'pickerQuickReactionEmojiIds'> {
4
+ export interface ConnectedReactionsViewProps extends Pick<ReactionsProps, 'quickReactionEmojis' | 'onDialogOpenCallback' | 'onDialogCloseCallback' | 'onDialogSelectReactionCallback' | 'allowUserDialog' | 'allowAllEmojis' | 'emojiProvider' | 'emojiPickerSize' | 'miniMode' | 'summaryViewEnabled' | 'subtleReactionsSummaryAndPicker'>, Pick<ReactionPickerProps, 'pickerQuickReactionEmojiIds'> {
5
5
  /**
6
6
  * Wrapper id for reactions list
7
7
  */
@@ -60,6 +60,14 @@ export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickRea
60
60
  * Optional prop for using an opaque button background instead of a transparent background
61
61
  */
62
62
  showOpaqueBackground?: boolean;
63
+ /**
64
+ * Optional prop for applying subtle styling to reaction summary and picker
65
+ */
66
+ subtleReactionsSummaryAndPicker?: boolean;
67
+ /**
68
+ * Optional prop for displaying text to add a reaction
69
+ */
70
+ showAddReactionText?: boolean;
63
71
  }
64
72
  /**
65
73
  * Picker component for adding reactions
@@ -13,6 +13,10 @@ interface ReactionSummaryButtonProps extends Pick<ReactionsProps, 'emojiProvider
13
13
  * Optional prop for using an opaque button background instead of a transparent background
14
14
  */
15
15
  showOpaqueBackground?: boolean;
16
+ /**
17
+ * Optional prop for applying subtle styling to reaction summary button
18
+ */
19
+ subtleReactionsSummaryAndPicker?: boolean;
16
20
  }
17
21
  /**
18
22
  * Test id for summary reaction wrapper button
@@ -32,6 +32,10 @@ interface ReactionSummaryViewProps extends Pick<ReactionsProps, 'emojiProvider'
32
32
  * Optional prop for using an opaque button background instead of a transparent background
33
33
  */
34
34
  showOpaqueBackground?: boolean;
35
+ /**
36
+ * Optional prop for applying subtle styling to reaction picker
37
+ */
38
+ subtleReactionsSummaryAndPicker?: boolean;
35
39
  }
36
- export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, handleOpenReactionsDialog, allowUserDialog, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, }: ReactionSummaryViewProps) => JSX.Element;
40
+ export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, handleOpenReactionsDialog, allowUserDialog, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, subtleReactionsSummaryAndPicker, }: ReactionSummaryViewProps) => JSX.Element;
37
41
  export {};
@@ -114,6 +114,18 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
114
114
  * Optional prop for using an opaque button background instead of a transparent background
115
115
  */
116
116
  showOpaqueBackground?: boolean;
117
+ /**
118
+ * Optional prop for applying subtle styling to reaction summary and picker
119
+ */
120
+ subtleReactionsSummaryAndPicker?: boolean;
121
+ /**
122
+ * Optional prop for displaying text to add a reaction
123
+ */
124
+ showAddReactionText?: boolean;
125
+ /**
126
+ * Optional prop for hiding default reactions displayed when there are no existing reactions
127
+ */
128
+ hideDefaultReactions?: boolean;
117
129
  }
118
130
  /**
119
131
  * Get content of the tooltip
@@ -122,4 +134,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
122
134
  /**
123
135
  * Renders list of reactions
124
136
  */
125
- export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, }: ReactionsProps) => jsx.JSX.Element>;
137
+ export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, }: ReactionsProps) => jsx.JSX.Element>;
@@ -36,6 +36,14 @@ export interface TriggerProps {
36
36
  * Optional prop for using an opaque button background instead of a transparent background
37
37
  */
38
38
  showOpaqueBackground?: boolean;
39
+ /**
40
+ * Optional prop for displaying text to add a reaction
41
+ */
42
+ showAddReactionText?: boolean;
43
+ /**
44
+ * Optional prop for applying subtle styling to reaction picker
45
+ */
46
+ subtleReactionsSummaryAndPicker?: boolean;
39
47
  }
40
48
  /**
41
49
  * Render an emoji button to open the reactions select picker
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { type ReactionsProps, type ReactionPickerProps } from '../../components';
3
3
  import { ReactionStatus, type Actions, type State, type StorePropInput } from '../../types';
4
- export interface ConnectedReactionsViewProps extends Pick<ReactionsProps, 'quickReactionEmojis' | 'onDialogOpenCallback' | 'onDialogCloseCallback' | 'onDialogSelectReactionCallback' | 'allowUserDialog' | 'allowAllEmojis' | 'emojiProvider' | 'emojiPickerSize' | 'miniMode' | 'summaryViewEnabled'>, Pick<ReactionPickerProps, 'pickerQuickReactionEmojiIds'> {
4
+ export interface ConnectedReactionsViewProps extends Pick<ReactionsProps, 'quickReactionEmojis' | 'onDialogOpenCallback' | 'onDialogCloseCallback' | 'onDialogSelectReactionCallback' | 'allowUserDialog' | 'allowAllEmojis' | 'emojiProvider' | 'emojiPickerSize' | 'miniMode' | 'summaryViewEnabled' | 'subtleReactionsSummaryAndPicker'>, Pick<ReactionPickerProps, 'pickerQuickReactionEmojiIds'> {
5
5
  /**
6
6
  * Wrapper id for reactions list
7
7
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/reactions",
3
- "version": "22.11.2",
3
+ "version": "22.12.0",
4
4
  "description": "Reactions component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/avatar": "^21.15.0",
39
39
  "@atlaskit/button": "^20.1.0",
40
40
  "@atlaskit/emoji": "^67.7.0",
41
- "@atlaskit/icon": "^22.15.0",
41
+ "@atlaskit/icon": "^22.16.0",
42
42
  "@atlaskit/modal-dialog": "^12.15.0",
43
43
  "@atlaskit/motion": "^1.9.0",
44
44
  "@atlaskit/platform-feature-flags": "^0.3.0",