@atlaskit/reactions 22.10.2 → 22.10.3
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 +9 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/Reaction/Reaction.js +14 -2
- package/dist/cjs/components/ReactionPicker/ReactionPicker.js +5 -2
- package/dist/cjs/components/ReactionSummary/ReactionSummaryButton.js +14 -10
- package/dist/cjs/components/ReactionSummary/ReactionSummaryView.js +5 -2
- package/dist/cjs/components/Reactions/Reactions.js +9 -4
- package/dist/cjs/components/Trigger/Trigger.js +15 -3
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/Reaction/Reaction.js +13 -2
- package/dist/es2019/components/ReactionPicker/ReactionPicker.js +4 -2
- package/dist/es2019/components/ReactionSummary/ReactionSummaryButton.js +13 -10
- package/dist/es2019/components/ReactionSummary/ReactionSummaryView.js +4 -2
- package/dist/es2019/components/Reactions/Reactions.js +8 -4
- package/dist/es2019/components/Trigger/Trigger.js +14 -3
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/Reaction/Reaction.js +14 -2
- package/dist/esm/components/ReactionPicker/ReactionPicker.js +5 -2
- package/dist/esm/components/ReactionSummary/ReactionSummaryButton.js +14 -10
- package/dist/esm/components/ReactionSummary/ReactionSummaryView.js +5 -2
- package/dist/esm/components/Reactions/Reactions.js +9 -4
- package/dist/esm/components/Trigger/Trigger.js +15 -3
- package/dist/types/components/Reaction/Reaction.d.ts +5 -1
- package/dist/types/components/ReactionPicker/ReactionPicker.d.ts +4 -0
- package/dist/types/components/ReactionSummary/ReactionSummaryButton.d.ts +4 -0
- package/dist/types/components/ReactionSummary/ReactionSummaryView.d.ts +5 -1
- package/dist/types/components/Reactions/Reactions.d.ts +5 -1
- package/dist/types/components/Trigger/Trigger.d.ts +4 -0
- package/dist/types-ts4.5/components/Reaction/Reaction.d.ts +5 -1
- package/dist/types-ts4.5/components/ReactionPicker/ReactionPicker.d.ts +4 -0
- package/dist/types-ts4.5/components/ReactionSummary/ReactionSummaryButton.d.ts +4 -0
- package/dist/types-ts4.5/components/ReactionSummary/ReactionSummaryView.d.ts +5 -1
- package/dist/types-ts4.5/components/Reactions/Reactions.d.ts +5 -1
- package/dist/types-ts4.5/components/Trigger/Trigger.d.ts +4 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 22.10.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#124009](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124009)
|
|
8
|
+
[`1b172cc669c8e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1b172cc669c8e) -
|
|
9
|
+
[ux] add support for opaque backgrounds in pre-existing reaction buttons while in summary view
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 22.10.2
|
|
4
13
|
|
|
5
14
|
### 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.10.
|
|
14
|
+
var packageVersion = "22.10.3";
|
|
15
15
|
/**
|
|
16
16
|
* TODO: move to utility package?
|
|
17
17
|
* A random sampling function
|
|
@@ -49,6 +49,15 @@ var reactedStyles = (0, _primitives.xcss)({
|
|
|
49
49
|
backgroundColor: 'color.background.selected.pressed'
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
+
var opaqueBackgroundStyles = (0, _primitives.xcss)({
|
|
53
|
+
backgroundColor: 'elevation.surface',
|
|
54
|
+
':hover': {
|
|
55
|
+
backgroundColor: 'elevation.surface.hovered'
|
|
56
|
+
},
|
|
57
|
+
':active': {
|
|
58
|
+
backgroundColor: 'elevation.surface.pressed'
|
|
59
|
+
}
|
|
60
|
+
});
|
|
52
61
|
|
|
53
62
|
/**
|
|
54
63
|
* Render an emoji reaction button
|
|
@@ -67,7 +76,9 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
|
|
|
67
76
|
showParticleEffect = _ref$showParticleEffe === void 0 ? false : _ref$showParticleEffe,
|
|
68
77
|
_ref$handleUserListCl = _ref.handleUserListClick,
|
|
69
78
|
handleUserListClick = _ref$handleUserListCl === void 0 ? function () {} : _ref$handleUserListCl,
|
|
70
|
-
allowUserDialog = _ref.allowUserDialog
|
|
79
|
+
allowUserDialog = _ref.allowUserDialog,
|
|
80
|
+
_ref$showOpaqueBackgr = _ref.showOpaqueBackground,
|
|
81
|
+
showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
|
|
71
82
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
72
83
|
var hoverStart = (0, _react.useRef)();
|
|
73
84
|
var focusStart = (0, _react.useRef)();
|
|
@@ -143,6 +154,7 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
|
|
|
143
154
|
handleUserListClick(emojiId);
|
|
144
155
|
setIsTooltipEnabled(false);
|
|
145
156
|
};
|
|
157
|
+
var buttonStyles = showOpaqueBackground ? [opaqueBackgroundStyles] : [];
|
|
146
158
|
return (0, _react2.jsx)(_primitives.Box, {
|
|
147
159
|
xcss: containerStyles
|
|
148
160
|
}, showParticleEffect && (0, _react2.jsx)(_ReactionParticleEffect.ReactionParticleEffect, {
|
|
@@ -157,7 +169,7 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
|
|
|
157
169
|
}, (0, _react2.jsx)(_ReactionButton.ReactionButton, {
|
|
158
170
|
onClick: handleClick,
|
|
159
171
|
flash: flash,
|
|
160
|
-
additionalStyles: reaction.reacted ? [reactedStyles] :
|
|
172
|
+
additionalStyles: reaction.reacted ? [reactedStyles] : buttonStyles,
|
|
161
173
|
ariaLabel: intl.formatMessage(_i18n.messages.reactWithEmoji, {
|
|
162
174
|
emoji: emojiName
|
|
163
175
|
}),
|
|
@@ -89,7 +89,9 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
|
|
|
89
89
|
onCancel = _props$onCancel === void 0 ? function () {} : _props$onCancel,
|
|
90
90
|
_props$tooltipContent = props.tooltipContent,
|
|
91
91
|
tooltipContent = _props$tooltipContent === void 0 ? (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.addReaction) : _props$tooltipContent,
|
|
92
|
-
emojiPickerSize = props.emojiPickerSize
|
|
92
|
+
emojiPickerSize = props.emojiPickerSize,
|
|
93
|
+
_props$showOpaqueBack = props.showOpaqueBackground,
|
|
94
|
+
showOpaqueBackground = _props$showOpaqueBack === void 0 ? false : _props$showOpaqueBack;
|
|
93
95
|
var _useState = (0, _react.useState)(null),
|
|
94
96
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
95
97
|
triggerRef = _useState2[0],
|
|
@@ -220,7 +222,8 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
|
|
|
220
222
|
onClick: onTriggerClick,
|
|
221
223
|
miniMode: miniMode,
|
|
222
224
|
disabled: disabled,
|
|
223
|
-
tooltipContent: settings.isOpen ? null : tooltipContent
|
|
225
|
+
tooltipContent: settings.isOpen ? null : tooltipContent,
|
|
226
|
+
showOpaqueBackground: showOpaqueBackground
|
|
224
227
|
})
|
|
225
228
|
);
|
|
226
229
|
}), settings.isOpen && (0, _react2.jsx)(PopperWrapper, {
|
|
@@ -26,6 +26,15 @@ var buttonStyle = (0, _primitives.xcss)({
|
|
|
26
26
|
paddingBottom: 'space.050',
|
|
27
27
|
paddingLeft: 'space.100'
|
|
28
28
|
});
|
|
29
|
+
var opaqueBackgroundStyles = (0, _primitives.xcss)({
|
|
30
|
+
backgroundColor: 'elevation.surface',
|
|
31
|
+
':hover': {
|
|
32
|
+
backgroundColor: 'elevation.surface.hovered'
|
|
33
|
+
},
|
|
34
|
+
':active': {
|
|
35
|
+
backgroundColor: 'elevation.surface.pressed'
|
|
36
|
+
}
|
|
37
|
+
});
|
|
29
38
|
var containerStyle = (0, _primitives.xcss)({
|
|
30
39
|
position: 'relative'
|
|
31
40
|
});
|
|
@@ -46,7 +55,9 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
|
|
|
46
55
|
reactions = _ref$reactions === void 0 ? [] : _ref$reactions,
|
|
47
56
|
_ref$emojisToShow = _ref.emojisToShow,
|
|
48
57
|
emojisToShow = _ref$emojisToShow === void 0 ? 3 : _ref$emojisToShow,
|
|
49
|
-
onClick = _ref.onClick
|
|
58
|
+
onClick = _ref.onClick,
|
|
59
|
+
_ref$showOpaqueBackgr = _ref.showOpaqueBackground,
|
|
60
|
+
showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
|
|
50
61
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
51
62
|
|
|
52
63
|
// Helper function to sort reactions by count and return top N
|
|
@@ -63,6 +74,7 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
|
|
|
63
74
|
var topReactions = (0, _react.useMemo)(function () {
|
|
64
75
|
return getTopReactions(reactions, emojisToShow);
|
|
65
76
|
}, [emojisToShow, reactions]);
|
|
77
|
+
var buttonStyles = showOpaqueBackground ? [opaqueBackgroundStyles] : [];
|
|
66
78
|
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
67
79
|
xcss: containerStyle,
|
|
68
80
|
ref: ref
|
|
@@ -70,15 +82,7 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
|
|
|
70
82
|
onClick: onClick,
|
|
71
83
|
testId: RENDER_SUMMARY_BUTTON_TESTID,
|
|
72
84
|
ariaLabel: intl.formatMessage(_i18n.messages.summary),
|
|
73
|
-
additionalStyles:
|
|
74
|
-
backgroundColor: 'elevation.surface',
|
|
75
|
-
':hover': {
|
|
76
|
-
backgroundColor: 'elevation.surface.hovered'
|
|
77
|
-
},
|
|
78
|
-
':active': {
|
|
79
|
-
backgroundColor: 'elevation.surface.pressed'
|
|
80
|
-
}
|
|
81
|
-
})]
|
|
85
|
+
additionalStyles: buttonStyles
|
|
82
86
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
83
87
|
space: "space.050",
|
|
84
88
|
xcss: buttonStyle
|
|
@@ -38,7 +38,9 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
|
|
|
38
38
|
placement = _ref$placement === void 0 ? 'auto-start' : _ref$placement,
|
|
39
39
|
onReactionClick = _ref.onReactionClick,
|
|
40
40
|
onReactionFocused = _ref.onReactionFocused,
|
|
41
|
-
onReactionMouseEnter = _ref.onReactionMouseEnter
|
|
41
|
+
onReactionMouseEnter = _ref.onReactionMouseEnter,
|
|
42
|
+
_ref$showOpaqueBackgr = _ref.showOpaqueBackground,
|
|
43
|
+
showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
|
|
42
44
|
var _useState = (0, _react.useState)(false),
|
|
43
45
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
44
46
|
isSummaryPopupOpen = _useState2[0],
|
|
@@ -78,7 +80,8 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
|
|
|
78
80
|
return /*#__PURE__*/_react.default.createElement(_ReactionSummaryButton.ReactionSummaryButton, (0, _extends2.default)({}, triggerProps, {
|
|
79
81
|
emojiProvider: emojiProvider,
|
|
80
82
|
reactions: reactions,
|
|
81
|
-
onClick: handleSummaryClick
|
|
83
|
+
onClick: handleSummaryClick,
|
|
84
|
+
showOpaqueBackground: showOpaqueBackground
|
|
82
85
|
}));
|
|
83
86
|
}
|
|
84
87
|
});
|
|
@@ -122,7 +122,9 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
122
122
|
summaryViewEnabled = _ref$summaryViewEnabl === void 0 ? false : _ref$summaryViewEnabl,
|
|
123
123
|
_ref$summaryViewThres = _ref.summaryViewThreshold,
|
|
124
124
|
summaryViewThreshold = _ref$summaryViewThres === void 0 ? 3 : _ref$summaryViewThres,
|
|
125
|
-
summaryViewPlacement = _ref.summaryViewPlacement
|
|
125
|
+
summaryViewPlacement = _ref.summaryViewPlacement,
|
|
126
|
+
_ref$showOpaqueBackgr = _ref.showOpaqueBackground,
|
|
127
|
+
showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
|
|
126
128
|
var _useState = (0, _react.useState)(),
|
|
127
129
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
128
130
|
selectedEmojiId = _useState2[0],
|
|
@@ -293,7 +295,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
293
295
|
onReactionClick: onReactionClick,
|
|
294
296
|
onReactionFocused: handleReactionFocused,
|
|
295
297
|
onReactionMouseEnter: handleReactionMouseEnter,
|
|
296
|
-
placement: summaryViewPlacement
|
|
298
|
+
placement: summaryViewPlacement,
|
|
299
|
+
showOpaqueBackground: showOpaqueBackground
|
|
297
300
|
})) : memorizedReactions.map(function (reaction) {
|
|
298
301
|
return (0, _react2.jsx)(_Reaction.Reaction, {
|
|
299
302
|
key: reaction.emojiId,
|
|
@@ -305,7 +308,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
305
308
|
flash: flash[reaction.emojiId],
|
|
306
309
|
handleUserListClick: handleOpenReactionsDialog,
|
|
307
310
|
allowUserDialog: allowUserDialog,
|
|
308
|
-
showParticleEffect: particleEffectByEmoji[reaction.emojiId]
|
|
311
|
+
showParticleEffect: particleEffectByEmoji[reaction.emojiId],
|
|
312
|
+
showOpaqueBackground: showOpaqueBackground
|
|
309
313
|
});
|
|
310
314
|
}), (0, _react2.jsx)(_ReactionPicker.ReactionPicker
|
|
311
315
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
@@ -321,7 +325,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
321
325
|
onShowMore: handleOnMore,
|
|
322
326
|
tooltipContent: getTooltip(status, errorMessage),
|
|
323
327
|
emojiPickerSize: emojiPickerSize,
|
|
324
|
-
miniMode: miniMode
|
|
328
|
+
miniMode: miniMode,
|
|
329
|
+
showOpaqueBackground: showOpaqueBackground
|
|
325
330
|
}), allowUserDialog && reactions.length > 0 && (0, _react2.jsx)(_tooltip.default, {
|
|
326
331
|
content: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.seeWhoReactedTooltip),
|
|
327
332
|
hideTooltipOnClick: true
|
|
@@ -35,7 +35,7 @@ var triggerStyles = (0, _primitives.xcss)({
|
|
|
35
35
|
alignItems: 'center',
|
|
36
36
|
lineHeight: '16px'
|
|
37
37
|
});
|
|
38
|
-
var
|
|
38
|
+
var transparentEnabledTriggerStyles = (0, _primitives.xcss)({
|
|
39
39
|
borderColor: 'color.border',
|
|
40
40
|
backgroundColor: 'color.background.neutral.subtle',
|
|
41
41
|
':hover': {
|
|
@@ -45,6 +45,16 @@ var enabledTriggerStyles = (0, _primitives.xcss)({
|
|
|
45
45
|
backgroundColor: 'color.background.neutral.subtle.pressed'
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
var opaqueEnabledTriggerStyles = (0, _primitives.xcss)({
|
|
49
|
+
borderColor: 'color.border',
|
|
50
|
+
backgroundColor: 'elevation.surface',
|
|
51
|
+
':hover': {
|
|
52
|
+
backgroundColor: 'elevation.surface.hovered'
|
|
53
|
+
},
|
|
54
|
+
':active': {
|
|
55
|
+
backgroundColor: 'elevation.surface.pressed'
|
|
56
|
+
}
|
|
57
|
+
});
|
|
48
58
|
var disabledTriggerStyles = (0, _primitives.xcss)({
|
|
49
59
|
borderColor: 'color.border.disabled',
|
|
50
60
|
backgroundColor: 'color.background.disabled'
|
|
@@ -66,7 +76,9 @@ var Trigger = exports.Trigger = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
66
76
|
_props$disabled = props.disabled,
|
|
67
77
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
68
78
|
_props$ariaAttributes = props.ariaAttributes,
|
|
69
|
-
ariaAttributes = _props$ariaAttributes === void 0 ? {} : _props$ariaAttributes
|
|
79
|
+
ariaAttributes = _props$ariaAttributes === void 0 ? {} : _props$ariaAttributes,
|
|
80
|
+
_props$showOpaqueBack = props.showOpaqueBackground,
|
|
81
|
+
showOpaqueBackground = _props$showOpaqueBack === void 0 ? false : _props$showOpaqueBack;
|
|
70
82
|
var handleMouseDown = function handleMouseDown(e, analyticsEvent) {
|
|
71
83
|
if (onClick && !disabled) {
|
|
72
84
|
onClick(e, analyticsEvent);
|
|
@@ -77,7 +89,7 @@ var Trigger = exports.Trigger = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
77
89
|
content: tooltipContent
|
|
78
90
|
}, (0, _react2.jsx)(_primitives.Pressable, (0, _extends2.default)({
|
|
79
91
|
testId: RENDER_TRIGGER_BUTTON_TESTID,
|
|
80
|
-
xcss: [triggerStyles, disabled ? disabledTriggerStyles :
|
|
92
|
+
xcss: [triggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles],
|
|
81
93
|
onClick: handleMouseDown,
|
|
82
94
|
isDisabled: disabled,
|
|
83
95
|
ref: ref
|
|
@@ -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.10.
|
|
4
|
+
const packageVersion = "22.10.3";
|
|
5
5
|
/**
|
|
6
6
|
* TODO: move to utility package?
|
|
7
7
|
* A random sampling function
|
|
@@ -35,6 +35,15 @@ const reactedStyles = xcss({
|
|
|
35
35
|
backgroundColor: 'color.background.selected.pressed'
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
+
const opaqueBackgroundStyles = xcss({
|
|
39
|
+
backgroundColor: 'elevation.surface',
|
|
40
|
+
':hover': {
|
|
41
|
+
backgroundColor: 'elevation.surface.hovered'
|
|
42
|
+
},
|
|
43
|
+
':active': {
|
|
44
|
+
backgroundColor: 'elevation.surface.pressed'
|
|
45
|
+
}
|
|
46
|
+
});
|
|
38
47
|
|
|
39
48
|
/**
|
|
40
49
|
* Render an emoji reaction button
|
|
@@ -48,7 +57,8 @@ export const Reaction = ({
|
|
|
48
57
|
flash = false,
|
|
49
58
|
showParticleEffect = false,
|
|
50
59
|
handleUserListClick = () => {},
|
|
51
|
-
allowUserDialog
|
|
60
|
+
allowUserDialog,
|
|
61
|
+
showOpaqueBackground = false
|
|
52
62
|
}) => {
|
|
53
63
|
const intl = useIntl();
|
|
54
64
|
const hoverStart = useRef();
|
|
@@ -107,6 +117,7 @@ export const Reaction = ({
|
|
|
107
117
|
handleUserListClick(emojiId);
|
|
108
118
|
setIsTooltipEnabled(false);
|
|
109
119
|
};
|
|
120
|
+
const buttonStyles = showOpaqueBackground ? [opaqueBackgroundStyles] : [];
|
|
110
121
|
return jsx(Box, {
|
|
111
122
|
xcss: containerStyles
|
|
112
123
|
}, showParticleEffect && jsx(ReactionParticleEffect, {
|
|
@@ -121,7 +132,7 @@ export const Reaction = ({
|
|
|
121
132
|
}, jsx(ReactionButton, {
|
|
122
133
|
onClick: handleClick,
|
|
123
134
|
flash: flash,
|
|
124
|
-
additionalStyles: reaction.reacted ? [reactedStyles] :
|
|
135
|
+
additionalStyles: reaction.reacted ? [reactedStyles] : buttonStyles,
|
|
125
136
|
ariaLabel: intl.formatMessage(messages.reactWithEmoji, {
|
|
126
137
|
emoji: emojiName
|
|
127
138
|
}),
|
|
@@ -75,7 +75,8 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
|
|
|
75
75
|
onOpen = () => {},
|
|
76
76
|
onCancel = () => {},
|
|
77
77
|
tooltipContent = jsx(FormattedMessage, messages.addReaction),
|
|
78
|
-
emojiPickerSize
|
|
78
|
+
emojiPickerSize,
|
|
79
|
+
showOpaqueBackground = false
|
|
79
80
|
} = props;
|
|
80
81
|
const [triggerRef, setTriggerRef] = useState(null);
|
|
81
82
|
|
|
@@ -200,7 +201,8 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
|
|
|
200
201
|
onClick: onTriggerClick,
|
|
201
202
|
miniMode: miniMode,
|
|
202
203
|
disabled: disabled,
|
|
203
|
-
tooltipContent: settings.isOpen ? null : tooltipContent
|
|
204
|
+
tooltipContent: settings.isOpen ? null : tooltipContent,
|
|
205
|
+
showOpaqueBackground: showOpaqueBackground
|
|
204
206
|
})), settings.isOpen && jsx(PopperWrapper, {
|
|
205
207
|
settings: settings
|
|
206
208
|
}, settings.showFullPicker ? jsx(EmojiPicker, {
|
|
@@ -15,6 +15,15 @@ const buttonStyle = xcss({
|
|
|
15
15
|
paddingBottom: 'space.050',
|
|
16
16
|
paddingLeft: 'space.100'
|
|
17
17
|
});
|
|
18
|
+
const opaqueBackgroundStyles = xcss({
|
|
19
|
+
backgroundColor: 'elevation.surface',
|
|
20
|
+
':hover': {
|
|
21
|
+
backgroundColor: 'elevation.surface.hovered'
|
|
22
|
+
},
|
|
23
|
+
':active': {
|
|
24
|
+
backgroundColor: 'elevation.surface.pressed'
|
|
25
|
+
}
|
|
26
|
+
});
|
|
18
27
|
const containerStyle = xcss({
|
|
19
28
|
position: 'relative'
|
|
20
29
|
});
|
|
@@ -33,7 +42,8 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
|
|
|
33
42
|
emojiProvider,
|
|
34
43
|
reactions = [],
|
|
35
44
|
emojisToShow = 3,
|
|
36
|
-
onClick
|
|
45
|
+
onClick,
|
|
46
|
+
showOpaqueBackground = false
|
|
37
47
|
}, ref) => {
|
|
38
48
|
const intl = useIntl();
|
|
39
49
|
|
|
@@ -47,6 +57,7 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
|
|
|
47
57
|
}, 0);
|
|
48
58
|
}, [reactions]);
|
|
49
59
|
const topReactions = useMemo(() => getTopReactions(reactions, emojisToShow), [emojisToShow, reactions]);
|
|
60
|
+
const buttonStyles = showOpaqueBackground ? [opaqueBackgroundStyles] : [];
|
|
50
61
|
return /*#__PURE__*/React.createElement(Box, {
|
|
51
62
|
xcss: containerStyle,
|
|
52
63
|
ref: ref
|
|
@@ -54,15 +65,7 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
|
|
|
54
65
|
onClick: onClick,
|
|
55
66
|
testId: RENDER_SUMMARY_BUTTON_TESTID,
|
|
56
67
|
ariaLabel: intl.formatMessage(messages.summary),
|
|
57
|
-
additionalStyles:
|
|
58
|
-
backgroundColor: 'elevation.surface',
|
|
59
|
-
':hover': {
|
|
60
|
-
backgroundColor: 'elevation.surface.hovered'
|
|
61
|
-
},
|
|
62
|
-
':active': {
|
|
63
|
-
backgroundColor: 'elevation.surface.pressed'
|
|
64
|
-
}
|
|
65
|
-
})]
|
|
68
|
+
additionalStyles: buttonStyles
|
|
66
69
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
67
70
|
space: "space.050",
|
|
68
71
|
xcss: buttonStyle
|
|
@@ -23,7 +23,8 @@ export const ReactionSummaryView = ({
|
|
|
23
23
|
placement = 'auto-start',
|
|
24
24
|
onReactionClick,
|
|
25
25
|
onReactionFocused,
|
|
26
|
-
onReactionMouseEnter
|
|
26
|
+
onReactionMouseEnter,
|
|
27
|
+
showOpaqueBackground = false
|
|
27
28
|
}) => {
|
|
28
29
|
const [isSummaryPopupOpen, setSummaryPopupOpen] = useState(false);
|
|
29
30
|
const handlePopupClose = useCallback(() => setSummaryPopupOpen(false), []);
|
|
@@ -52,7 +53,8 @@ export const ReactionSummaryView = ({
|
|
|
52
53
|
trigger: triggerProps => /*#__PURE__*/React.createElement(ReactionSummaryButton, _extends({}, triggerProps, {
|
|
53
54
|
emojiProvider: emojiProvider,
|
|
54
55
|
reactions: reactions,
|
|
55
|
-
onClick: handleSummaryClick
|
|
56
|
+
onClick: handleSummaryClick,
|
|
57
|
+
showOpaqueBackground: showOpaqueBackground
|
|
56
58
|
}))
|
|
57
59
|
});
|
|
58
60
|
};
|
|
@@ -96,7 +96,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
96
96
|
miniMode = false,
|
|
97
97
|
summaryViewEnabled = false,
|
|
98
98
|
summaryViewThreshold = 3,
|
|
99
|
-
summaryViewPlacement
|
|
99
|
+
summaryViewPlacement,
|
|
100
|
+
showOpaqueBackground = false
|
|
100
101
|
}) => {
|
|
101
102
|
const [selectedEmojiId, setSelectedEmojiId] = useState();
|
|
102
103
|
const {
|
|
@@ -262,7 +263,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
262
263
|
onReactionClick: onReactionClick,
|
|
263
264
|
onReactionFocused: handleReactionFocused,
|
|
264
265
|
onReactionMouseEnter: handleReactionMouseEnter,
|
|
265
|
-
placement: summaryViewPlacement
|
|
266
|
+
placement: summaryViewPlacement,
|
|
267
|
+
showOpaqueBackground: showOpaqueBackground
|
|
266
268
|
})) : memorizedReactions.map(reaction => jsx(Reaction, {
|
|
267
269
|
key: reaction.emojiId,
|
|
268
270
|
reaction: reaction,
|
|
@@ -273,7 +275,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
273
275
|
flash: flash[reaction.emojiId],
|
|
274
276
|
handleUserListClick: handleOpenReactionsDialog,
|
|
275
277
|
allowUserDialog: allowUserDialog,
|
|
276
|
-
showParticleEffect: particleEffectByEmoji[reaction.emojiId]
|
|
278
|
+
showParticleEffect: particleEffectByEmoji[reaction.emojiId],
|
|
279
|
+
showOpaqueBackground: showOpaqueBackground
|
|
277
280
|
})), jsx(ReactionPicker
|
|
278
281
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
279
282
|
, {
|
|
@@ -288,7 +291,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
288
291
|
onShowMore: handleOnMore,
|
|
289
292
|
tooltipContent: getTooltip(status, errorMessage),
|
|
290
293
|
emojiPickerSize: emojiPickerSize,
|
|
291
|
-
miniMode: miniMode
|
|
294
|
+
miniMode: miniMode,
|
|
295
|
+
showOpaqueBackground: showOpaqueBackground
|
|
292
296
|
}), allowUserDialog && reactions.length > 0 && jsx(Tooltip, {
|
|
293
297
|
content: jsx(FormattedMessage, messages.seeWhoReactedTooltip),
|
|
294
298
|
hideTooltipOnClick: true
|
|
@@ -27,7 +27,7 @@ const triggerStyles = xcss({
|
|
|
27
27
|
alignItems: 'center',
|
|
28
28
|
lineHeight: '16px'
|
|
29
29
|
});
|
|
30
|
-
const
|
|
30
|
+
const transparentEnabledTriggerStyles = xcss({
|
|
31
31
|
borderColor: 'color.border',
|
|
32
32
|
backgroundColor: 'color.background.neutral.subtle',
|
|
33
33
|
':hover': {
|
|
@@ -37,6 +37,16 @@ const enabledTriggerStyles = xcss({
|
|
|
37
37
|
backgroundColor: 'color.background.neutral.subtle.pressed'
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
+
const opaqueEnabledTriggerStyles = xcss({
|
|
41
|
+
borderColor: 'color.border',
|
|
42
|
+
backgroundColor: 'elevation.surface',
|
|
43
|
+
':hover': {
|
|
44
|
+
backgroundColor: 'elevation.surface.hovered'
|
|
45
|
+
},
|
|
46
|
+
':active': {
|
|
47
|
+
backgroundColor: 'elevation.surface.pressed'
|
|
48
|
+
}
|
|
49
|
+
});
|
|
40
50
|
const disabledTriggerStyles = xcss({
|
|
41
51
|
borderColor: 'color.border.disabled',
|
|
42
52
|
backgroundColor: 'color.background.disabled'
|
|
@@ -57,7 +67,8 @@ export const Trigger = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
57
67
|
miniMode,
|
|
58
68
|
tooltipContent,
|
|
59
69
|
disabled = false,
|
|
60
|
-
ariaAttributes = {}
|
|
70
|
+
ariaAttributes = {},
|
|
71
|
+
showOpaqueBackground = false
|
|
61
72
|
} = props;
|
|
62
73
|
const handleMouseDown = (e, analyticsEvent) => {
|
|
63
74
|
if (onClick && !disabled) {
|
|
@@ -69,7 +80,7 @@ export const Trigger = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
69
80
|
content: tooltipContent
|
|
70
81
|
}, jsx(Pressable, _extends({
|
|
71
82
|
testId: RENDER_TRIGGER_BUTTON_TESTID,
|
|
72
|
-
xcss: [triggerStyles, disabled ? disabledTriggerStyles :
|
|
83
|
+
xcss: [triggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles],
|
|
73
84
|
onClick: handleMouseDown,
|
|
74
85
|
isDisabled: disabled,
|
|
75
86
|
ref: ref
|
|
@@ -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.10.
|
|
7
|
+
var packageVersion = "22.10.3";
|
|
8
8
|
/**
|
|
9
9
|
* TODO: move to utility package?
|
|
10
10
|
* A random sampling function
|
|
@@ -38,6 +38,15 @@ var reactedStyles = xcss({
|
|
|
38
38
|
backgroundColor: 'color.background.selected.pressed'
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
|
+
var opaqueBackgroundStyles = xcss({
|
|
42
|
+
backgroundColor: 'elevation.surface',
|
|
43
|
+
':hover': {
|
|
44
|
+
backgroundColor: 'elevation.surface.hovered'
|
|
45
|
+
},
|
|
46
|
+
':active': {
|
|
47
|
+
backgroundColor: 'elevation.surface.pressed'
|
|
48
|
+
}
|
|
49
|
+
});
|
|
41
50
|
|
|
42
51
|
/**
|
|
43
52
|
* Render an emoji reaction button
|
|
@@ -56,7 +65,9 @@ export var Reaction = function Reaction(_ref) {
|
|
|
56
65
|
showParticleEffect = _ref$showParticleEffe === void 0 ? false : _ref$showParticleEffe,
|
|
57
66
|
_ref$handleUserListCl = _ref.handleUserListClick,
|
|
58
67
|
handleUserListClick = _ref$handleUserListCl === void 0 ? function () {} : _ref$handleUserListCl,
|
|
59
|
-
allowUserDialog = _ref.allowUserDialog
|
|
68
|
+
allowUserDialog = _ref.allowUserDialog,
|
|
69
|
+
_ref$showOpaqueBackgr = _ref.showOpaqueBackground,
|
|
70
|
+
showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
|
|
60
71
|
var intl = useIntl();
|
|
61
72
|
var hoverStart = useRef();
|
|
62
73
|
var focusStart = useRef();
|
|
@@ -132,6 +143,7 @@ export var Reaction = function Reaction(_ref) {
|
|
|
132
143
|
handleUserListClick(emojiId);
|
|
133
144
|
setIsTooltipEnabled(false);
|
|
134
145
|
};
|
|
146
|
+
var buttonStyles = showOpaqueBackground ? [opaqueBackgroundStyles] : [];
|
|
135
147
|
return jsx(Box, {
|
|
136
148
|
xcss: containerStyles
|
|
137
149
|
}, showParticleEffect && jsx(ReactionParticleEffect, {
|
|
@@ -146,7 +158,7 @@ export var Reaction = function Reaction(_ref) {
|
|
|
146
158
|
}, jsx(ReactionButton, {
|
|
147
159
|
onClick: handleClick,
|
|
148
160
|
flash: flash,
|
|
149
|
-
additionalStyles: reaction.reacted ? [reactedStyles] :
|
|
161
|
+
additionalStyles: reaction.reacted ? [reactedStyles] : buttonStyles,
|
|
150
162
|
ariaLabel: intl.formatMessage(messages.reactWithEmoji, {
|
|
151
163
|
emoji: emojiName
|
|
152
164
|
}),
|
|
@@ -82,7 +82,9 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
82
82
|
onCancel = _props$onCancel === void 0 ? function () {} : _props$onCancel,
|
|
83
83
|
_props$tooltipContent = props.tooltipContent,
|
|
84
84
|
tooltipContent = _props$tooltipContent === void 0 ? jsx(FormattedMessage, messages.addReaction) : _props$tooltipContent,
|
|
85
|
-
emojiPickerSize = props.emojiPickerSize
|
|
85
|
+
emojiPickerSize = props.emojiPickerSize,
|
|
86
|
+
_props$showOpaqueBack = props.showOpaqueBackground,
|
|
87
|
+
showOpaqueBackground = _props$showOpaqueBack === void 0 ? false : _props$showOpaqueBack;
|
|
86
88
|
var _useState = useState(null),
|
|
87
89
|
_useState2 = _slicedToArray(_useState, 2),
|
|
88
90
|
triggerRef = _useState2[0],
|
|
@@ -213,7 +215,8 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
213
215
|
onClick: onTriggerClick,
|
|
214
216
|
miniMode: miniMode,
|
|
215
217
|
disabled: disabled,
|
|
216
|
-
tooltipContent: settings.isOpen ? null : tooltipContent
|
|
218
|
+
tooltipContent: settings.isOpen ? null : tooltipContent,
|
|
219
|
+
showOpaqueBackground: showOpaqueBackground
|
|
217
220
|
})
|
|
218
221
|
);
|
|
219
222
|
}), settings.isOpen && jsx(PopperWrapper, {
|
|
@@ -16,6 +16,15 @@ var buttonStyle = xcss({
|
|
|
16
16
|
paddingBottom: 'space.050',
|
|
17
17
|
paddingLeft: 'space.100'
|
|
18
18
|
});
|
|
19
|
+
var opaqueBackgroundStyles = xcss({
|
|
20
|
+
backgroundColor: 'elevation.surface',
|
|
21
|
+
':hover': {
|
|
22
|
+
backgroundColor: 'elevation.surface.hovered'
|
|
23
|
+
},
|
|
24
|
+
':active': {
|
|
25
|
+
backgroundColor: 'elevation.surface.pressed'
|
|
26
|
+
}
|
|
27
|
+
});
|
|
19
28
|
var containerStyle = xcss({
|
|
20
29
|
position: 'relative'
|
|
21
30
|
});
|
|
@@ -36,7 +45,9 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
36
45
|
reactions = _ref$reactions === void 0 ? [] : _ref$reactions,
|
|
37
46
|
_ref$emojisToShow = _ref.emojisToShow,
|
|
38
47
|
emojisToShow = _ref$emojisToShow === void 0 ? 3 : _ref$emojisToShow,
|
|
39
|
-
onClick = _ref.onClick
|
|
48
|
+
onClick = _ref.onClick,
|
|
49
|
+
_ref$showOpaqueBackgr = _ref.showOpaqueBackground,
|
|
50
|
+
showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
|
|
40
51
|
var intl = useIntl();
|
|
41
52
|
|
|
42
53
|
// Helper function to sort reactions by count and return top N
|
|
@@ -53,6 +64,7 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
53
64
|
var topReactions = useMemo(function () {
|
|
54
65
|
return getTopReactions(reactions, emojisToShow);
|
|
55
66
|
}, [emojisToShow, reactions]);
|
|
67
|
+
var buttonStyles = showOpaqueBackground ? [opaqueBackgroundStyles] : [];
|
|
56
68
|
return /*#__PURE__*/React.createElement(Box, {
|
|
57
69
|
xcss: containerStyle,
|
|
58
70
|
ref: ref
|
|
@@ -60,15 +72,7 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
60
72
|
onClick: onClick,
|
|
61
73
|
testId: RENDER_SUMMARY_BUTTON_TESTID,
|
|
62
74
|
ariaLabel: intl.formatMessage(messages.summary),
|
|
63
|
-
additionalStyles:
|
|
64
|
-
backgroundColor: 'elevation.surface',
|
|
65
|
-
':hover': {
|
|
66
|
-
backgroundColor: 'elevation.surface.hovered'
|
|
67
|
-
},
|
|
68
|
-
':active': {
|
|
69
|
-
backgroundColor: 'elevation.surface.pressed'
|
|
70
|
-
}
|
|
71
|
-
})]
|
|
75
|
+
additionalStyles: buttonStyles
|
|
72
76
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
73
77
|
space: "space.050",
|
|
74
78
|
xcss: buttonStyle
|
|
@@ -28,7 +28,9 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
|
|
|
28
28
|
placement = _ref$placement === void 0 ? 'auto-start' : _ref$placement,
|
|
29
29
|
onReactionClick = _ref.onReactionClick,
|
|
30
30
|
onReactionFocused = _ref.onReactionFocused,
|
|
31
|
-
onReactionMouseEnter = _ref.onReactionMouseEnter
|
|
31
|
+
onReactionMouseEnter = _ref.onReactionMouseEnter,
|
|
32
|
+
_ref$showOpaqueBackgr = _ref.showOpaqueBackground,
|
|
33
|
+
showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
|
|
32
34
|
var _useState = useState(false),
|
|
33
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
34
36
|
isSummaryPopupOpen = _useState2[0],
|
|
@@ -68,7 +70,8 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
|
|
|
68
70
|
return /*#__PURE__*/React.createElement(ReactionSummaryButton, _extends({}, triggerProps, {
|
|
69
71
|
emojiProvider: emojiProvider,
|
|
70
72
|
reactions: reactions,
|
|
71
|
-
onClick: handleSummaryClick
|
|
73
|
+
onClick: handleSummaryClick,
|
|
74
|
+
showOpaqueBackground: showOpaqueBackground
|
|
72
75
|
}));
|
|
73
76
|
}
|
|
74
77
|
});
|
|
@@ -109,7 +109,9 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
109
109
|
summaryViewEnabled = _ref$summaryViewEnabl === void 0 ? false : _ref$summaryViewEnabl,
|
|
110
110
|
_ref$summaryViewThres = _ref.summaryViewThreshold,
|
|
111
111
|
summaryViewThreshold = _ref$summaryViewThres === void 0 ? 3 : _ref$summaryViewThres,
|
|
112
|
-
summaryViewPlacement = _ref.summaryViewPlacement
|
|
112
|
+
summaryViewPlacement = _ref.summaryViewPlacement,
|
|
113
|
+
_ref$showOpaqueBackgr = _ref.showOpaqueBackground,
|
|
114
|
+
showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr;
|
|
113
115
|
var _useState = useState(),
|
|
114
116
|
_useState2 = _slicedToArray(_useState, 2),
|
|
115
117
|
selectedEmojiId = _useState2[0],
|
|
@@ -280,7 +282,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
280
282
|
onReactionClick: onReactionClick,
|
|
281
283
|
onReactionFocused: handleReactionFocused,
|
|
282
284
|
onReactionMouseEnter: handleReactionMouseEnter,
|
|
283
|
-
placement: summaryViewPlacement
|
|
285
|
+
placement: summaryViewPlacement,
|
|
286
|
+
showOpaqueBackground: showOpaqueBackground
|
|
284
287
|
})) : memorizedReactions.map(function (reaction) {
|
|
285
288
|
return jsx(Reaction, {
|
|
286
289
|
key: reaction.emojiId,
|
|
@@ -292,7 +295,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
292
295
|
flash: flash[reaction.emojiId],
|
|
293
296
|
handleUserListClick: handleOpenReactionsDialog,
|
|
294
297
|
allowUserDialog: allowUserDialog,
|
|
295
|
-
showParticleEffect: particleEffectByEmoji[reaction.emojiId]
|
|
298
|
+
showParticleEffect: particleEffectByEmoji[reaction.emojiId],
|
|
299
|
+
showOpaqueBackground: showOpaqueBackground
|
|
296
300
|
});
|
|
297
301
|
}), jsx(ReactionPicker
|
|
298
302
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
@@ -308,7 +312,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
308
312
|
onShowMore: handleOnMore,
|
|
309
313
|
tooltipContent: getTooltip(status, errorMessage),
|
|
310
314
|
emojiPickerSize: emojiPickerSize,
|
|
311
|
-
miniMode: miniMode
|
|
315
|
+
miniMode: miniMode,
|
|
316
|
+
showOpaqueBackground: showOpaqueBackground
|
|
312
317
|
}), allowUserDialog && reactions.length > 0 && jsx(Tooltip, {
|
|
313
318
|
content: jsx(FormattedMessage, messages.seeWhoReactedTooltip),
|
|
314
319
|
hideTooltipOnClick: true
|
|
@@ -27,7 +27,7 @@ var triggerStyles = xcss({
|
|
|
27
27
|
alignItems: 'center',
|
|
28
28
|
lineHeight: '16px'
|
|
29
29
|
});
|
|
30
|
-
var
|
|
30
|
+
var transparentEnabledTriggerStyles = xcss({
|
|
31
31
|
borderColor: 'color.border',
|
|
32
32
|
backgroundColor: 'color.background.neutral.subtle',
|
|
33
33
|
':hover': {
|
|
@@ -37,6 +37,16 @@ var enabledTriggerStyles = xcss({
|
|
|
37
37
|
backgroundColor: 'color.background.neutral.subtle.pressed'
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
+
var opaqueEnabledTriggerStyles = xcss({
|
|
41
|
+
borderColor: 'color.border',
|
|
42
|
+
backgroundColor: 'elevation.surface',
|
|
43
|
+
':hover': {
|
|
44
|
+
backgroundColor: 'elevation.surface.hovered'
|
|
45
|
+
},
|
|
46
|
+
':active': {
|
|
47
|
+
backgroundColor: 'elevation.surface.pressed'
|
|
48
|
+
}
|
|
49
|
+
});
|
|
40
50
|
var disabledTriggerStyles = xcss({
|
|
41
51
|
borderColor: 'color.border.disabled',
|
|
42
52
|
backgroundColor: 'color.background.disabled'
|
|
@@ -58,7 +68,9 @@ export var Trigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
58
68
|
_props$disabled = props.disabled,
|
|
59
69
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
60
70
|
_props$ariaAttributes = props.ariaAttributes,
|
|
61
|
-
ariaAttributes = _props$ariaAttributes === void 0 ? {} : _props$ariaAttributes
|
|
71
|
+
ariaAttributes = _props$ariaAttributes === void 0 ? {} : _props$ariaAttributes,
|
|
72
|
+
_props$showOpaqueBack = props.showOpaqueBackground,
|
|
73
|
+
showOpaqueBackground = _props$showOpaqueBack === void 0 ? false : _props$showOpaqueBack;
|
|
62
74
|
var handleMouseDown = function handleMouseDown(e, analyticsEvent) {
|
|
63
75
|
if (onClick && !disabled) {
|
|
64
76
|
onClick(e, analyticsEvent);
|
|
@@ -69,7 +81,7 @@ export var Trigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
69
81
|
content: tooltipContent
|
|
70
82
|
}, jsx(Pressable, _extends({
|
|
71
83
|
testId: RENDER_TRIGGER_BUTTON_TESTID,
|
|
72
|
-
xcss: [triggerStyles, disabled ? disabledTriggerStyles :
|
|
84
|
+
xcss: [triggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles],
|
|
73
85
|
onClick: handleMouseDown,
|
|
74
86
|
isDisabled: disabled,
|
|
75
87
|
ref: ref
|
|
@@ -40,8 +40,12 @@ export interface ReactionProps extends Pick<ReactionTooltipProps, 'allowUserDial
|
|
|
40
40
|
* Optional function when the user wants to see more users in a modal
|
|
41
41
|
*/
|
|
42
42
|
handleUserListClick?: (emojiId: string) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Optional prop for using an opaque button background instead of a transparent background
|
|
45
|
+
*/
|
|
46
|
+
showOpaqueBackground?: boolean;
|
|
43
47
|
}
|
|
44
48
|
/**
|
|
45
49
|
* Render an emoji reaction button
|
|
46
50
|
*/
|
|
47
|
-
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, flash, showParticleEffect, handleUserListClick, allowUserDialog, }: ReactionProps) => jsx.JSX.Element;
|
|
51
|
+
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, flash, showParticleEffect, handleUserListClick, allowUserDialog, showOpaqueBackground, }: ReactionProps) => jsx.JSX.Element;
|
|
@@ -56,6 +56,10 @@ export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickRea
|
|
|
56
56
|
* Optional emoji picker size to control the size of emoji picker
|
|
57
57
|
*/
|
|
58
58
|
emojiPickerSize?: PickerSize;
|
|
59
|
+
/**
|
|
60
|
+
* Optional prop for using an opaque button background instead of a transparent background
|
|
61
|
+
*/
|
|
62
|
+
showOpaqueBackground?: boolean;
|
|
59
63
|
}
|
|
60
64
|
/**
|
|
61
65
|
* Picker component for adding reactions
|
|
@@ -9,6 +9,10 @@ interface ReactionSummaryButtonProps extends Pick<ReactionsProps, 'emojiProvider
|
|
|
9
9
|
* The number of emojis to show in the summary button
|
|
10
10
|
*/
|
|
11
11
|
emojisToShow?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Optional prop for using an opaque button background instead of a transparent background
|
|
14
|
+
*/
|
|
15
|
+
showOpaqueBackground?: boolean;
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* Test id for summary reaction wrapper button
|
|
@@ -28,6 +28,10 @@ interface ReactionSummaryViewProps extends Pick<ReactionsProps, 'emojiProvider'
|
|
|
28
28
|
* Optional event when focused a reaction inside the summary
|
|
29
29
|
*/
|
|
30
30
|
onReactionFocused?: ReactionFocused;
|
|
31
|
+
/**
|
|
32
|
+
* Optional prop for using an opaque button background instead of a transparent background
|
|
33
|
+
*/
|
|
34
|
+
showOpaqueBackground?: boolean;
|
|
31
35
|
}
|
|
32
|
-
export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, handleOpenReactionsDialog, allowUserDialog, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, }: ReactionSummaryViewProps) => JSX.Element;
|
|
36
|
+
export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, handleOpenReactionsDialog, allowUserDialog, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, }: ReactionSummaryViewProps) => JSX.Element;
|
|
33
37
|
export {};
|
|
@@ -110,6 +110,10 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
110
110
|
* Optional prop to change the placement of the summary popup reaction list
|
|
111
111
|
*/
|
|
112
112
|
summaryViewPlacement?: Placement;
|
|
113
|
+
/**
|
|
114
|
+
* Optional prop for using an opaque button background instead of a transparent background
|
|
115
|
+
*/
|
|
116
|
+
showOpaqueBackground?: boolean;
|
|
113
117
|
}
|
|
114
118
|
/**
|
|
115
119
|
* Get content of the tooltip
|
|
@@ -118,4 +122,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
118
122
|
/**
|
|
119
123
|
* Renders list of reactions
|
|
120
124
|
*/
|
|
121
|
-
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, }: ReactionsProps) => jsx.JSX.Element>;
|
|
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>;
|
|
@@ -32,6 +32,10 @@ export interface TriggerProps {
|
|
|
32
32
|
* Aria accessibility attributes that will be added to the button
|
|
33
33
|
*/
|
|
34
34
|
ariaAttributes?: AriaAttributes;
|
|
35
|
+
/**
|
|
36
|
+
* Optional prop for using an opaque button background instead of a transparent background
|
|
37
|
+
*/
|
|
38
|
+
showOpaqueBackground?: boolean;
|
|
35
39
|
}
|
|
36
40
|
/**
|
|
37
41
|
* Render an emoji button to open the reactions select picker
|
|
@@ -40,8 +40,12 @@ export interface ReactionProps extends Pick<ReactionTooltipProps, 'allowUserDial
|
|
|
40
40
|
* Optional function when the user wants to see more users in a modal
|
|
41
41
|
*/
|
|
42
42
|
handleUserListClick?: (emojiId: string) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Optional prop for using an opaque button background instead of a transparent background
|
|
45
|
+
*/
|
|
46
|
+
showOpaqueBackground?: boolean;
|
|
43
47
|
}
|
|
44
48
|
/**
|
|
45
49
|
* Render an emoji reaction button
|
|
46
50
|
*/
|
|
47
|
-
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, flash, showParticleEffect, handleUserListClick, allowUserDialog, }: ReactionProps) => jsx.JSX.Element;
|
|
51
|
+
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, flash, showParticleEffect, handleUserListClick, allowUserDialog, showOpaqueBackground, }: ReactionProps) => jsx.JSX.Element;
|
|
@@ -56,6 +56,10 @@ export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickRea
|
|
|
56
56
|
* Optional emoji picker size to control the size of emoji picker
|
|
57
57
|
*/
|
|
58
58
|
emojiPickerSize?: PickerSize;
|
|
59
|
+
/**
|
|
60
|
+
* Optional prop for using an opaque button background instead of a transparent background
|
|
61
|
+
*/
|
|
62
|
+
showOpaqueBackground?: boolean;
|
|
59
63
|
}
|
|
60
64
|
/**
|
|
61
65
|
* Picker component for adding reactions
|
|
@@ -9,6 +9,10 @@ interface ReactionSummaryButtonProps extends Pick<ReactionsProps, 'emojiProvider
|
|
|
9
9
|
* The number of emojis to show in the summary button
|
|
10
10
|
*/
|
|
11
11
|
emojisToShow?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Optional prop for using an opaque button background instead of a transparent background
|
|
14
|
+
*/
|
|
15
|
+
showOpaqueBackground?: boolean;
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* Test id for summary reaction wrapper button
|
|
@@ -28,6 +28,10 @@ interface ReactionSummaryViewProps extends Pick<ReactionsProps, 'emojiProvider'
|
|
|
28
28
|
* Optional event when focused a reaction inside the summary
|
|
29
29
|
*/
|
|
30
30
|
onReactionFocused?: ReactionFocused;
|
|
31
|
+
/**
|
|
32
|
+
* Optional prop for using an opaque button background instead of a transparent background
|
|
33
|
+
*/
|
|
34
|
+
showOpaqueBackground?: boolean;
|
|
31
35
|
}
|
|
32
|
-
export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, handleOpenReactionsDialog, allowUserDialog, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, }: ReactionSummaryViewProps) => JSX.Element;
|
|
36
|
+
export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, handleOpenReactionsDialog, allowUserDialog, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, }: ReactionSummaryViewProps) => JSX.Element;
|
|
33
37
|
export {};
|
|
@@ -110,6 +110,10 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
110
110
|
* Optional prop to change the placement of the summary popup reaction list
|
|
111
111
|
*/
|
|
112
112
|
summaryViewPlacement?: Placement;
|
|
113
|
+
/**
|
|
114
|
+
* Optional prop for using an opaque button background instead of a transparent background
|
|
115
|
+
*/
|
|
116
|
+
showOpaqueBackground?: boolean;
|
|
113
117
|
}
|
|
114
118
|
/**
|
|
115
119
|
* Get content of the tooltip
|
|
@@ -118,4 +122,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
118
122
|
/**
|
|
119
123
|
* Renders list of reactions
|
|
120
124
|
*/
|
|
121
|
-
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, }: ReactionsProps) => jsx.JSX.Element>;
|
|
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>;
|
|
@@ -32,6 +32,10 @@ export interface TriggerProps {
|
|
|
32
32
|
* Aria accessibility attributes that will be added to the button
|
|
33
33
|
*/
|
|
34
34
|
ariaAttributes?: AriaAttributes;
|
|
35
|
+
/**
|
|
36
|
+
* Optional prop for using an opaque button background instead of a transparent background
|
|
37
|
+
*/
|
|
38
|
+
showOpaqueBackground?: boolean;
|
|
35
39
|
}
|
|
36
40
|
/**
|
|
37
41
|
* Render an emoji button to open the reactions select picker
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/reactions",
|
|
3
|
-
"version": "22.10.
|
|
3
|
+
"version": "22.10.3",
|
|
4
4
|
"description": "Reactions component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^6.10.0",
|
|
38
38
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
39
|
-
"@atlaskit/avatar": "^21.
|
|
40
|
-
"@atlaskit/button": "^19.
|
|
41
|
-
"@atlaskit/emoji": "^67.
|
|
42
|
-
"@atlaskit/icon": "^22.
|
|
39
|
+
"@atlaskit/avatar": "^21.12.0",
|
|
40
|
+
"@atlaskit/button": "^19.1.0",
|
|
41
|
+
"@atlaskit/emoji": "^67.7.0",
|
|
42
|
+
"@atlaskit/icon": "^22.9.0",
|
|
43
43
|
"@atlaskit/modal-dialog": "^12.14.0",
|
|
44
44
|
"@atlaskit/motion": "^1.7.0",
|
|
45
45
|
"@atlaskit/popper": "^6.1.0",
|
|
46
46
|
"@atlaskit/popup": "1.20.2",
|
|
47
|
-
"@atlaskit/primitives": "^11.
|
|
47
|
+
"@atlaskit/primitives": "^11.1.0",
|
|
48
48
|
"@atlaskit/spinner": "^16.2.0",
|
|
49
49
|
"@atlaskit/tabs": "^16.3.0",
|
|
50
50
|
"@atlaskit/theme": "^12.11.0",
|