@atlaskit/reactions 27.1.1 → 27.1.2
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 +10 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/Counter/Counter.js +3 -2
- package/dist/cjs/components/Counter/styles.js +6 -1
- package/dist/cjs/components/ReactionSummary/ReactionSummaryButton.js +11 -4
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/Counter/Counter.js +4 -3
- package/dist/es2019/components/Counter/styles.js +5 -0
- package/dist/es2019/components/ReactionSummary/ReactionSummaryButton.js +11 -4
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/Counter/Counter.js +4 -3
- package/dist/esm/components/Counter/styles.js +5 -0
- package/dist/esm/components/ReactionSummary/ReactionSummaryButton.js +11 -4
- package/dist/types/components/Counter/Counter.d.ts +5 -1
- package/dist/types/components/Counter/styles.d.ts +1 -0
- package/dist/types-ts4.5/components/Counter/Counter.d.ts +5 -1
- package/dist/types-ts4.5/components/Counter/styles.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 27.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#125203](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125203)
|
|
8
|
+
[`8b6c24cf0f169`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8b6c24cf0f169) -
|
|
9
|
+
[ux] Update emoji and button styling to smaller for compact style. Also update font color to match
|
|
10
|
+
other byline items.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 27.1.1
|
|
4
14
|
|
|
5
15
|
### 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 = "27.1.
|
|
14
|
+
var packageVersion = "27.1.2";
|
|
15
15
|
/**
|
|
16
16
|
* TODO: move to utility package?
|
|
17
17
|
* A random sampling function
|
|
@@ -43,7 +43,8 @@ var Counter = exports.Counter = function Counter(_ref) {
|
|
|
43
43
|
className = _ref.className,
|
|
44
44
|
value = _ref.value,
|
|
45
45
|
_ref$animationDuratio = _ref.animationDuration,
|
|
46
|
-
animationDuration = _ref$animationDuratio === void 0 ? 'medium' : _ref$animationDuratio
|
|
46
|
+
animationDuration = _ref$animationDuratio === void 0 ? 'medium' : _ref$animationDuratio,
|
|
47
|
+
useDarkerFont = _ref.useDarkerFont;
|
|
47
48
|
var getLabel = function getLabel(value) {
|
|
48
49
|
// Check if reached limit
|
|
49
50
|
if (limit && overLimitLabel && value >= limit) {
|
|
@@ -68,7 +69,7 @@ var Counter = exports.Counter = function Counter(_ref) {
|
|
|
68
69
|
"data-testid": RENDER_COMPONENT_WRAPPER
|
|
69
70
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
70
71
|
,
|
|
71
|
-
css: _styles.countStyle
|
|
72
|
+
css: useDarkerFont ? [_styles.countStyle, _styles.darkerFontStyle] : _styles.countStyle
|
|
72
73
|
}, (0, _react2.jsx)(_motion.ExitingPersistence, null, (0, _react2.jsx)(_motion.SlideIn, {
|
|
73
74
|
enterFrom: isIncreasing ? 'top' : 'bottom',
|
|
74
75
|
exitTo: isIncreasing ? 'top' : 'bottom',
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.highlightStyle = exports.counterLabelStyle = exports.countStyle = exports.containerStyle = void 0;
|
|
6
|
+
exports.highlightStyle = exports.darkerFontStyle = exports.counterLabelStyle = exports.countStyle = exports.containerStyle = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _colors = require("@atlaskit/theme/colors");
|
|
9
9
|
/**
|
|
@@ -37,4 +37,9 @@ var highlightStyle = exports.highlightStyle = (0, _react.css)({
|
|
|
37
37
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
38
38
|
var counterLabelStyle = exports.counterLabelStyle = (0, _react.css)({
|
|
39
39
|
fontVariantNumeric: 'tabular-nums'
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
43
|
+
var darkerFontStyle = exports.darkerFontStyle = (0, _react.css)({
|
|
44
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
40
45
|
});
|
|
@@ -28,7 +28,12 @@ var buttonStyle = (0, _primitives.xcss)({
|
|
|
28
28
|
paddingLeft: 'space.100'
|
|
29
29
|
});
|
|
30
30
|
var compactButtonStyle = (0, _primitives.xcss)({
|
|
31
|
-
height: '
|
|
31
|
+
height: '20px',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
marginTop: 'space.075'
|
|
34
|
+
});
|
|
35
|
+
var compactPaddingStyles = (0, _primitives.xcss)({
|
|
36
|
+
paddingTop: 'space.025'
|
|
32
37
|
});
|
|
33
38
|
var opaqueBackgroundStyles = (0, _primitives.xcss)({
|
|
34
39
|
backgroundColor: 'elevation.surface',
|
|
@@ -100,7 +105,8 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
|
|
|
100
105
|
additionalStyles: [].concat(buttonStyles, subtleSummaryStyles, compactButtonStyles)
|
|
101
106
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
102
107
|
space: "space.050",
|
|
103
|
-
xcss: buttonStyle
|
|
108
|
+
xcss: useCompactStyles ? [buttonStyle, compactPaddingStyles] : buttonStyle,
|
|
109
|
+
testId: "reaction-summary-wrapper"
|
|
104
110
|
}, topReactions.map(function (reaction) {
|
|
105
111
|
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
106
112
|
xcss: emojiStyle,
|
|
@@ -112,9 +118,10 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
|
|
|
112
118
|
id: reaction.emojiId,
|
|
113
119
|
shortName: ''
|
|
114
120
|
},
|
|
115
|
-
fitToHeight: 16
|
|
121
|
+
fitToHeight: useCompactStyles ? 12 : 16
|
|
116
122
|
}));
|
|
117
123
|
})), /*#__PURE__*/_react.default.createElement(_Counter.Counter, {
|
|
118
|
-
value: totalReactionsCount
|
|
124
|
+
value: totalReactionsCount,
|
|
125
|
+
useDarkerFont: useCompactStyles
|
|
119
126
|
})));
|
|
120
127
|
});
|
|
@@ -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 = "27.1.
|
|
4
|
+
const packageVersion = "27.1.2";
|
|
5
5
|
/**
|
|
6
6
|
* TODO: move to utility package?
|
|
7
7
|
* A random sampling function
|
|
@@ -9,7 +9,7 @@ import { SlideIn, ExitingPersistence } from '@atlaskit/motion';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/design-system/no-banned-imports
|
|
10
10
|
|
|
11
11
|
import { formatLargeNumber } from '../../shared/utils';
|
|
12
|
-
import { containerStyle, counterLabelStyle, countStyle, highlightStyle } from './styles';
|
|
12
|
+
import { containerStyle, counterLabelStyle, countStyle, highlightStyle, darkerFontStyle } from './styles';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Test id for component top level div
|
|
@@ -34,7 +34,8 @@ export const Counter = ({
|
|
|
34
34
|
overLimitLabel,
|
|
35
35
|
className,
|
|
36
36
|
value,
|
|
37
|
-
animationDuration = 'medium'
|
|
37
|
+
animationDuration = 'medium',
|
|
38
|
+
useDarkerFont
|
|
38
39
|
}) => {
|
|
39
40
|
const getLabel = value => {
|
|
40
41
|
// Check if reached limit
|
|
@@ -60,7 +61,7 @@ export const Counter = ({
|
|
|
60
61
|
"data-testid": RENDER_COMPONENT_WRAPPER
|
|
61
62
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
62
63
|
,
|
|
63
|
-
css: countStyle
|
|
64
|
+
css: useDarkerFont ? [countStyle, darkerFontStyle] : countStyle
|
|
64
65
|
}, jsx(ExitingPersistence, null, jsx(SlideIn, {
|
|
65
66
|
enterFrom: isIncreasing ? 'top' : 'bottom',
|
|
66
67
|
exitTo: isIncreasing ? 'top' : 'bottom',
|
|
@@ -30,4 +30,9 @@ export const highlightStyle = css({
|
|
|
30
30
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
31
31
|
export const counterLabelStyle = css({
|
|
32
32
|
fontVariantNumeric: 'tabular-nums'
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
36
|
+
export const darkerFontStyle = css({
|
|
37
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
33
38
|
});
|
|
@@ -17,7 +17,12 @@ const buttonStyle = xcss({
|
|
|
17
17
|
paddingLeft: 'space.100'
|
|
18
18
|
});
|
|
19
19
|
const compactButtonStyle = xcss({
|
|
20
|
-
height: '
|
|
20
|
+
height: '20px',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
marginTop: 'space.075'
|
|
23
|
+
});
|
|
24
|
+
const compactPaddingStyles = xcss({
|
|
25
|
+
paddingTop: 'space.025'
|
|
21
26
|
});
|
|
22
27
|
const opaqueBackgroundStyles = xcss({
|
|
23
28
|
backgroundColor: 'elevation.surface',
|
|
@@ -81,7 +86,8 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
|
|
|
81
86
|
additionalStyles: [...buttonStyles, ...subtleSummaryStyles, ...compactButtonStyles]
|
|
82
87
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
83
88
|
space: "space.050",
|
|
84
|
-
xcss: buttonStyle
|
|
89
|
+
xcss: useCompactStyles ? [buttonStyle, compactPaddingStyles] : buttonStyle,
|
|
90
|
+
testId: "reaction-summary-wrapper"
|
|
85
91
|
}, topReactions.map(reaction => /*#__PURE__*/React.createElement(Box, {
|
|
86
92
|
xcss: emojiStyle,
|
|
87
93
|
testId: RENDER_SUMMARY_EMOJI_TESTID
|
|
@@ -92,8 +98,9 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
|
|
|
92
98
|
id: reaction.emojiId,
|
|
93
99
|
shortName: ''
|
|
94
100
|
},
|
|
95
|
-
fitToHeight: 16
|
|
101
|
+
fitToHeight: useCompactStyles ? 12 : 16
|
|
96
102
|
})))), /*#__PURE__*/React.createElement(Counter, {
|
|
97
|
-
value: totalReactionsCount
|
|
103
|
+
value: totalReactionsCount,
|
|
104
|
+
useDarkerFont: useCompactStyles
|
|
98
105
|
})));
|
|
99
106
|
});
|
|
@@ -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 = "27.1.
|
|
7
|
+
var packageVersion = "27.1.2";
|
|
8
8
|
/**
|
|
9
9
|
* TODO: move to utility package?
|
|
10
10
|
* A random sampling function
|
|
@@ -9,7 +9,7 @@ import { SlideIn, ExitingPersistence } from '@atlaskit/motion';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/design-system/no-banned-imports
|
|
10
10
|
|
|
11
11
|
import { formatLargeNumber } from '../../shared/utils';
|
|
12
|
-
import { containerStyle, counterLabelStyle, countStyle, highlightStyle } from './styles';
|
|
12
|
+
import { containerStyle, counterLabelStyle, countStyle, highlightStyle, darkerFontStyle } from './styles';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Test id for component top level div
|
|
@@ -36,7 +36,8 @@ export var Counter = function Counter(_ref) {
|
|
|
36
36
|
className = _ref.className,
|
|
37
37
|
value = _ref.value,
|
|
38
38
|
_ref$animationDuratio = _ref.animationDuration,
|
|
39
|
-
animationDuration = _ref$animationDuratio === void 0 ? 'medium' : _ref$animationDuratio
|
|
39
|
+
animationDuration = _ref$animationDuratio === void 0 ? 'medium' : _ref$animationDuratio,
|
|
40
|
+
useDarkerFont = _ref.useDarkerFont;
|
|
40
41
|
var getLabel = function getLabel(value) {
|
|
41
42
|
// Check if reached limit
|
|
42
43
|
if (limit && overLimitLabel && value >= limit) {
|
|
@@ -61,7 +62,7 @@ export var Counter = function Counter(_ref) {
|
|
|
61
62
|
"data-testid": RENDER_COMPONENT_WRAPPER
|
|
62
63
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
63
64
|
,
|
|
64
|
-
css: countStyle
|
|
65
|
+
css: useDarkerFont ? [countStyle, darkerFontStyle] : countStyle
|
|
65
66
|
}, jsx(ExitingPersistence, null, jsx(SlideIn, {
|
|
66
67
|
enterFrom: isIncreasing ? 'top' : 'bottom',
|
|
67
68
|
exitTo: isIncreasing ? 'top' : 'bottom',
|
|
@@ -30,4 +30,9 @@ export var highlightStyle = css({
|
|
|
30
30
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
31
31
|
export var counterLabelStyle = css({
|
|
32
32
|
fontVariantNumeric: 'tabular-nums'
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
36
|
+
export var darkerFontStyle = css({
|
|
37
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
33
38
|
});
|
|
@@ -18,7 +18,12 @@ var buttonStyle = xcss({
|
|
|
18
18
|
paddingLeft: 'space.100'
|
|
19
19
|
});
|
|
20
20
|
var compactButtonStyle = xcss({
|
|
21
|
-
height: '
|
|
21
|
+
height: '20px',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
marginTop: 'space.075'
|
|
24
|
+
});
|
|
25
|
+
var compactPaddingStyles = xcss({
|
|
26
|
+
paddingTop: 'space.025'
|
|
22
27
|
});
|
|
23
28
|
var opaqueBackgroundStyles = xcss({
|
|
24
29
|
backgroundColor: 'elevation.surface',
|
|
@@ -90,7 +95,8 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
90
95
|
additionalStyles: [].concat(buttonStyles, subtleSummaryStyles, compactButtonStyles)
|
|
91
96
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
92
97
|
space: "space.050",
|
|
93
|
-
xcss: buttonStyle
|
|
98
|
+
xcss: useCompactStyles ? [buttonStyle, compactPaddingStyles] : buttonStyle,
|
|
99
|
+
testId: "reaction-summary-wrapper"
|
|
94
100
|
}, topReactions.map(function (reaction) {
|
|
95
101
|
return /*#__PURE__*/React.createElement(Box, {
|
|
96
102
|
xcss: emojiStyle,
|
|
@@ -102,9 +108,10 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
102
108
|
id: reaction.emojiId,
|
|
103
109
|
shortName: ''
|
|
104
110
|
},
|
|
105
|
-
fitToHeight: 16
|
|
111
|
+
fitToHeight: useCompactStyles ? 12 : 16
|
|
106
112
|
}));
|
|
107
113
|
})), /*#__PURE__*/React.createElement(Counter, {
|
|
108
|
-
value: totalReactionsCount
|
|
114
|
+
value: totalReactionsCount,
|
|
115
|
+
useDarkerFont: useCompactStyles
|
|
109
116
|
})));
|
|
110
117
|
});
|
|
@@ -37,8 +37,12 @@ export interface CounterProps {
|
|
|
37
37
|
* Duration of how long the motion will take (defaults to "medium" from '@atlaskit/motion')
|
|
38
38
|
*/
|
|
39
39
|
animationDuration?: Durations;
|
|
40
|
+
/**
|
|
41
|
+
* Optional prop to use a darker text color for the counter
|
|
42
|
+
*/
|
|
43
|
+
useDarkerFont?: boolean;
|
|
40
44
|
}
|
|
41
45
|
/**
|
|
42
46
|
* Display reaction count next to the emoji button
|
|
43
47
|
*/
|
|
44
|
-
export declare const Counter: ({ highlight, limit, overLimitLabel, className, value, animationDuration, }: CounterProps) => jsx.JSX.Element;
|
|
48
|
+
export declare const Counter: ({ highlight, limit, overLimitLabel, className, value, animationDuration, useDarkerFont, }: CounterProps) => jsx.JSX.Element;
|
|
@@ -2,3 +2,4 @@ export declare const countStyle: import("@emotion/react").SerializedStyles;
|
|
|
2
2
|
export declare const containerStyle: import("@emotion/react").SerializedStyles;
|
|
3
3
|
export declare const highlightStyle: import("@emotion/react").SerializedStyles;
|
|
4
4
|
export declare const counterLabelStyle: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const darkerFontStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -37,8 +37,12 @@ export interface CounterProps {
|
|
|
37
37
|
* Duration of how long the motion will take (defaults to "medium" from '@atlaskit/motion')
|
|
38
38
|
*/
|
|
39
39
|
animationDuration?: Durations;
|
|
40
|
+
/**
|
|
41
|
+
* Optional prop to use a darker text color for the counter
|
|
42
|
+
*/
|
|
43
|
+
useDarkerFont?: boolean;
|
|
40
44
|
}
|
|
41
45
|
/**
|
|
42
46
|
* Display reaction count next to the emoji button
|
|
43
47
|
*/
|
|
44
|
-
export declare const Counter: ({ highlight, limit, overLimitLabel, className, value, animationDuration, }: CounterProps) => jsx.JSX.Element;
|
|
48
|
+
export declare const Counter: ({ highlight, limit, overLimitLabel, className, value, animationDuration, useDarkerFont, }: CounterProps) => jsx.JSX.Element;
|
|
@@ -2,3 +2,4 @@ export declare const countStyle: import("@emotion/react").SerializedStyles;
|
|
|
2
2
|
export declare const containerStyle: import("@emotion/react").SerializedStyles;
|
|
3
3
|
export declare const highlightStyle: import("@emotion/react").SerializedStyles;
|
|
4
4
|
export declare const counterLabelStyle: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const darkerFontStyle: import("@emotion/react").SerializedStyles;
|