@atlaskit/reactions 34.3.1 → 34.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/reactions
2
2
 
3
+ ## 34.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 34.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`ec2c29c3c63b3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ec2c29c3c63b3) -
14
+ [ux] Reaction button a11y fixes
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 34.3.1
4
21
 
5
22
  ### 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; } // eslint-disable-next-line @typescript-eslint/consistent-type-imports
13
13
  var packageName = "@atlaskit/reactions";
14
- var packageVersion = "34.3.0";
14
+ var packageVersion = "34.4.0";
15
15
  /**
16
16
  * TODO: move to utility package?
17
17
  * A random sampling function
@@ -14,6 +14,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
14
14
  var _react2 = require("@compiled/react");
15
15
  var _FlashAnimation = require("./FlashAnimation");
16
16
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
18
  var _compiled = require("@atlaskit/primitives/compiled");
18
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
19
20
  var styles = {
@@ -42,6 +43,7 @@ var ReactionButton = exports.ReactionButton = function ReactionButton(_ref) {
42
43
  useCompactStyles = _ref.useCompactStyles,
43
44
  reacted = _ref.reacted,
44
45
  ariaLabel = _ref.ariaLabel,
46
+ ariaExpanded = _ref.ariaExpanded,
45
47
  ariaPressed = _ref.ariaPressed,
46
48
  onMouseEnter = _ref.onMouseEnter,
47
49
  onMouseLeave = _ref.onMouseLeave,
@@ -57,6 +59,7 @@ var ReactionButton = exports.ReactionButton = function ReactionButton(_ref) {
57
59
  onFocus: onFocus,
58
60
  "aria-label": ariaLabel,
59
61
  "aria-pressed": ariaPressed,
62
+ "aria-expanded": (0, _expValEquals.expValEquals)('a11y-fixes-week4-may-2026', 'isEnabled', true) ? ariaExpanded : undefined,
60
63
  testId: testId,
61
64
  xcss: (0, _react2.cx)(styles.reactionButton, useCompactStyles && styles.compactButton, reacted && styles.reacted, !reacted && showSubtleStyle && styles.borderless, !reacted && showOpaqueBackground && styles.opaqueBackground, (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') && styles.reactionStylesRefresh)
62
65
  }, dataAttributes), /*#__PURE__*/React.createElement(_FlashAnimation.FlashAnimation, {
@@ -58,7 +58,8 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
58
58
  onMouseLeave = _ref.onMouseLeave,
59
59
  summaryGetOptimisticImageURL = _ref.summaryGetOptimisticImageURL,
60
60
  summaryButtonIconAfter = _ref.summaryButtonIconAfter,
61
- summaryViewParticleEffectEmojiId = _ref.summaryViewParticleEffectEmojiId;
61
+ summaryViewParticleEffectEmojiId = _ref.summaryViewParticleEffectEmojiId,
62
+ isOpen = _ref.isOpen;
62
63
  var intl = (0, _reactIntl.useIntl)();
63
64
 
64
65
  // Helper function to sort reactions by count and return top N
@@ -96,6 +97,7 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
96
97
  ariaLabel: intl.formatMessage(_i18n.messages.summary, {
97
98
  count: totalReactionsCount
98
99
  }),
100
+ ariaExpanded: isOpen,
99
101
  showSubtleStyle: subtleReactionsSummaryAndPicker,
100
102
  showOpaqueBackground: showOpaqueBackground
101
103
  }, /*#__PURE__*/React.createElement(_compiled.Inline, {
@@ -248,7 +248,8 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
248
248
  useButtonAlignmentStyling: useButtonAlignmentStyling,
249
249
  summaryGetOptimisticImageURL: summaryGetOptimisticImageURL,
250
250
  summaryButtonIconAfter: summaryButtonIconAfter,
251
- summaryViewParticleEffectEmojiId: summaryViewParticleEffectEmojiId
251
+ summaryViewParticleEffectEmojiId: summaryViewParticleEffectEmojiId,
252
+ isOpen: isSummaryPopupOpen || isEmojiPickerOpen
252
253
  }));
253
254
  }
254
255
  });
@@ -2,7 +2,7 @@
2
2
  import { createAndFireEvent } from '@atlaskit/analytics-next';
3
3
  import { UI_EVENT_TYPE, OPERATIONAL_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
4
4
  const packageName = "@atlaskit/reactions";
5
- const packageVersion = "34.3.0";
5
+ const packageVersion = "34.4.0";
6
6
  /**
7
7
  * TODO: move to utility package?
8
8
  * A random sampling function
@@ -6,6 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
6
6
  import { cx } from '@compiled/react';
7
7
  import { FlashAnimation } from './FlashAnimation';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
10
  import { Pressable } from '@atlaskit/primitives/compiled';
10
11
  const styles = {
11
12
  reactionButton: "_2rko1rr0 _1reo15vq _18m915vq _189ee4h9 _1dqonqa1 _1h6d1l7x _1e0c1txw _2lx2vrvc _4cvr1y6m _1ul914no _4t3i1tcg _bfhksm61 _syazazsu _1pfh1b66 _12l21b66 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _irr31dpa _1di6fcek",
@@ -32,6 +33,7 @@ export const ReactionButton = ({
32
33
  useCompactStyles,
33
34
  reacted,
34
35
  ariaLabel,
36
+ ariaExpanded,
35
37
  ariaPressed,
36
38
  onMouseEnter,
37
39
  onMouseLeave,
@@ -47,6 +49,7 @@ export const ReactionButton = ({
47
49
  onFocus: onFocus,
48
50
  "aria-label": ariaLabel,
49
51
  "aria-pressed": ariaPressed,
52
+ "aria-expanded": expValEquals('a11y-fixes-week4-may-2026', 'isEnabled', true) ? ariaExpanded : undefined,
50
53
  testId: testId,
51
54
  xcss: cx(styles.reactionButton, useCompactStyles && styles.compactButton, reacted && styles.reacted, !reacted && showSubtleStyle && styles.borderless, !reacted && showOpaqueBackground && styles.opaqueBackground, fg('platform-component-visual-refresh') && styles.reactionStylesRefresh)
52
55
  }, dataAttributes), /*#__PURE__*/React.createElement(FlashAnimation, {
@@ -43,7 +43,8 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
43
43
  onMouseLeave,
44
44
  summaryGetOptimisticImageURL,
45
45
  summaryButtonIconAfter,
46
- summaryViewParticleEffectEmojiId
46
+ summaryViewParticleEffectEmojiId,
47
+ isOpen
47
48
  }, ref) => {
48
49
  const intl = useIntl();
49
50
 
@@ -78,6 +79,7 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
78
79
  ariaLabel: intl.formatMessage(messages.summary, {
79
80
  count: totalReactionsCount
80
81
  }),
82
+ ariaExpanded: isOpen,
81
83
  showSubtleStyle: subtleReactionsSummaryAndPicker,
82
84
  showOpaqueBackground: showOpaqueBackground
83
85
  }, /*#__PURE__*/React.createElement(Inline, {
@@ -211,7 +211,8 @@ export const ReactionSummaryView = ({
211
211
  useButtonAlignmentStyling: useButtonAlignmentStyling,
212
212
  summaryGetOptimisticImageURL: summaryGetOptimisticImageURL,
213
213
  summaryButtonIconAfter: summaryButtonIconAfter,
214
- summaryViewParticleEffectEmojiId: summaryViewParticleEffectEmojiId
214
+ summaryViewParticleEffectEmojiId: summaryViewParticleEffectEmojiId,
215
+ isOpen: isSummaryPopupOpen || isEmojiPickerOpen
215
216
  }))
216
217
  });
217
218
  };
@@ -5,7 +5,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
5
5
  import { createAndFireEvent } from '@atlaskit/analytics-next';
6
6
  import { UI_EVENT_TYPE, OPERATIONAL_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
7
7
  var packageName = "@atlaskit/reactions";
8
- var packageVersion = "34.3.0";
8
+ var packageVersion = "34.4.0";
9
9
  /**
10
10
  * TODO: move to utility package?
11
11
  * A random sampling function
@@ -6,6 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
6
6
  import { cx } from '@compiled/react';
7
7
  import { FlashAnimation } from './FlashAnimation';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
10
  import { Pressable } from '@atlaskit/primitives/compiled';
10
11
  var styles = {
11
12
  reactionButton: "_2rko1rr0 _1reo15vq _18m915vq _189ee4h9 _1dqonqa1 _1h6d1l7x _1e0c1txw _2lx2vrvc _4cvr1y6m _1ul914no _4t3i1tcg _bfhksm61 _syazazsu _1pfh1b66 _12l21b66 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _irr31dpa _1di6fcek",
@@ -33,6 +34,7 @@ export var ReactionButton = function ReactionButton(_ref) {
33
34
  useCompactStyles = _ref.useCompactStyles,
34
35
  reacted = _ref.reacted,
35
36
  ariaLabel = _ref.ariaLabel,
37
+ ariaExpanded = _ref.ariaExpanded,
36
38
  ariaPressed = _ref.ariaPressed,
37
39
  onMouseEnter = _ref.onMouseEnter,
38
40
  onMouseLeave = _ref.onMouseLeave,
@@ -48,6 +50,7 @@ export var ReactionButton = function ReactionButton(_ref) {
48
50
  onFocus: onFocus,
49
51
  "aria-label": ariaLabel,
50
52
  "aria-pressed": ariaPressed,
53
+ "aria-expanded": expValEquals('a11y-fixes-week4-may-2026', 'isEnabled', true) ? ariaExpanded : undefined,
51
54
  testId: testId,
52
55
  xcss: cx(styles.reactionButton, useCompactStyles && styles.compactButton, reacted && styles.reacted, !reacted && showSubtleStyle && styles.borderless, !reacted && showOpaqueBackground && styles.opaqueBackground, fg('platform-component-visual-refresh') && styles.reactionStylesRefresh)
53
56
  }, dataAttributes), /*#__PURE__*/React.createElement(FlashAnimation, {
@@ -49,7 +49,8 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
49
49
  onMouseLeave = _ref.onMouseLeave,
50
50
  summaryGetOptimisticImageURL = _ref.summaryGetOptimisticImageURL,
51
51
  summaryButtonIconAfter = _ref.summaryButtonIconAfter,
52
- summaryViewParticleEffectEmojiId = _ref.summaryViewParticleEffectEmojiId;
52
+ summaryViewParticleEffectEmojiId = _ref.summaryViewParticleEffectEmojiId,
53
+ isOpen = _ref.isOpen;
53
54
  var intl = useIntl();
54
55
 
55
56
  // Helper function to sort reactions by count and return top N
@@ -87,6 +88,7 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
87
88
  ariaLabel: intl.formatMessage(messages.summary, {
88
89
  count: totalReactionsCount
89
90
  }),
91
+ ariaExpanded: isOpen,
90
92
  showSubtleStyle: subtleReactionsSummaryAndPicker,
91
93
  showOpaqueBackground: showOpaqueBackground
92
94
  }, /*#__PURE__*/React.createElement(Inline, {
@@ -239,7 +239,8 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
239
239
  useButtonAlignmentStyling: useButtonAlignmentStyling,
240
240
  summaryGetOptimisticImageURL: summaryGetOptimisticImageURL,
241
241
  summaryButtonIconAfter: summaryButtonIconAfter,
242
- summaryViewParticleEffectEmojiId: summaryViewParticleEffectEmojiId
242
+ summaryViewParticleEffectEmojiId: summaryViewParticleEffectEmojiId,
243
+ isOpen: isSummaryPopupOpen || isEmojiPickerOpen
243
244
  }));
244
245
  }
245
246
  });
@@ -1,5 +1,6 @@
1
1
  import { type ReactionProps } from './Reaction';
2
2
  interface ReactionButtonProps extends Pick<ReactionProps, 'flash'> {
3
+ ariaExpanded?: boolean;
3
4
  ariaLabel: string;
4
5
  ariaPressed?: boolean;
5
6
  children?: React.ReactNode;
@@ -17,5 +18,5 @@ interface ReactionButtonProps extends Pick<ReactionProps, 'flash'> {
17
18
  testId?: string;
18
19
  useCompactStyles?: boolean;
19
20
  }
20
- export declare const ReactionButton: ({ onClick, flash, showSubtleStyle, showOpaqueBackground, useCompactStyles, reacted, ariaLabel, ariaPressed, onMouseEnter, onMouseLeave, onFocus, children, dataAttributes, testId, }: ReactionButtonProps) => JSX.Element;
21
+ export declare const ReactionButton: ({ onClick, flash, showSubtleStyle, showOpaqueBackground, useCompactStyles, reacted, ariaLabel, ariaExpanded, ariaPressed, onMouseEnter, onMouseLeave, onFocus, children, dataAttributes, testId, }: ReactionButtonProps) => JSX.Element;
21
22
  export {};
@@ -44,6 +44,10 @@ interface ReactionSummaryButtonProps extends Pick<ReactionsProps, 'emojiProvider
44
44
  id: string;
45
45
  shortName: string;
46
46
  } | null;
47
+ /**
48
+ * Optional prop to indicate whether the summary popup is open, used for aria-expanded
49
+ */
50
+ isOpen?: boolean;
47
51
  }
48
52
  /**
49
53
  * Test id for summary reaction wrapper button
@@ -1,5 +1,6 @@
1
1
  import { type ReactionProps } from './Reaction';
2
2
  interface ReactionButtonProps extends Pick<ReactionProps, 'flash'> {
3
+ ariaExpanded?: boolean;
3
4
  ariaLabel: string;
4
5
  ariaPressed?: boolean;
5
6
  children?: React.ReactNode;
@@ -17,5 +18,5 @@ interface ReactionButtonProps extends Pick<ReactionProps, 'flash'> {
17
18
  testId?: string;
18
19
  useCompactStyles?: boolean;
19
20
  }
20
- export declare const ReactionButton: ({ onClick, flash, showSubtleStyle, showOpaqueBackground, useCompactStyles, reacted, ariaLabel, ariaPressed, onMouseEnter, onMouseLeave, onFocus, children, dataAttributes, testId, }: ReactionButtonProps) => JSX.Element;
21
+ export declare const ReactionButton: ({ onClick, flash, showSubtleStyle, showOpaqueBackground, useCompactStyles, reacted, ariaLabel, ariaExpanded, ariaPressed, onMouseEnter, onMouseLeave, onFocus, children, dataAttributes, testId, }: ReactionButtonProps) => JSX.Element;
21
22
  export {};
@@ -44,6 +44,10 @@ interface ReactionSummaryButtonProps extends Pick<ReactionsProps, 'emojiProvider
44
44
  id: string;
45
45
  shortName: string;
46
46
  } | null;
47
+ /**
48
+ * Optional prop to indicate whether the summary popup is open, used for aria-expanded
49
+ */
50
+ isOpen?: boolean;
47
51
  }
48
52
  /**
49
53
  * Test id for summary reaction wrapper button
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/reactions",
3
- "version": "34.3.1",
3
+ "version": "34.4.1",
4
4
  "description": "Reactions component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -60,7 +60,7 @@
60
60
  "@atlaskit/spinner": "^19.1.0",
61
61
  "@atlaskit/tabs": "^19.1.0",
62
62
  "@atlaskit/theme": "^25.0.0",
63
- "@atlaskit/tmp-editor-statsig": "^90.0.0",
63
+ "@atlaskit/tmp-editor-statsig": "^91.0.0",
64
64
  "@atlaskit/tokens": "^13.3.0",
65
65
  "@atlaskit/tooltip": "^22.6.0",
66
66
  "@atlaskit/ufo": "^0.5.0",
@@ -78,7 +78,7 @@
78
78
  "@af/visual-regression": "workspace:^",
79
79
  "@atlaskit/editor-test-helpers": "workspace:^",
80
80
  "@atlaskit/util-data-test": "^18.6.0",
81
- "@atlassian/a11y-jest-testing": "^0.11.0",
81
+ "@atlassian/a11y-jest-testing": "^0.12.0",
82
82
  "@atlassian/feature-flags-test-utils": "^1.1.0",
83
83
  "@atlassian/react-compiler-gating": "workspace:^",
84
84
  "@testing-library/dom": "^10.1.0",