@atlaskit/popup 4.21.1 → 4.22.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/popup
2
2
 
3
+ ## 4.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`cc76d2e733b71`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cc76d2e733b71) -
8
+ Updates the top layer popup trigger's `aria-expanded` attribute, so it stays `"true"` for the
9
+ duration of the popup's exit animation, only going `false` after the animation completes.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 4.21.2
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 4.21.1
4
22
 
5
23
  ### Patch Changes
@@ -127,9 +127,6 @@ var PopupTopLayer = exports.PopupTopLayer = /*#__PURE__*/(0, _react.memo)(functi
127
127
  titleId: titleId
128
128
  });
129
129
 
130
- // Sync controlled isOpen with internal state
131
- var effectiveIsOpen = isOpen;
132
-
133
130
  // Narrow to ForwardRefExoticComponent so JSX accepts the ref prop.
134
131
  // All popupComponent implementations use forwardRef per the PopupComponentProps contract.
135
132
  var Container = PopupContainer;
@@ -150,8 +147,14 @@ var PopupTopLayer = exports.PopupTopLayer = /*#__PURE__*/(0, _react.memo)(functi
150
147
  _ref4(node);
151
148
  }
152
149
  },
153
- 'aria-controls': effectiveIsOpen ? providedId !== null && providedId !== void 0 ? providedId : popoverId : undefined,
154
- 'aria-expanded': effectiveIsOpen,
150
+ 'aria-controls': isOpen ? providedId !== null && providedId !== void 0 ? providedId : popoverId : undefined,
151
+ // Use ariaAttributes['aria-expanded'] (which comes from `@atlaskit/top-layer`), rather than
152
+ // `isOpen` directly. `@atlaskit/top-layer` tracks the full animation lifecycle via
153
+ // TPopupState and only goes false after the exit animation completes, so:
154
+ // - Screen readers don't announce the popup as closed while it is still visible.
155
+ // - Consumers relying on aria-expanded to show/hide trigger UI don't lose the
156
+ // trigger (popup anchor) before the animation finishes.
157
+ 'aria-expanded': ariaAttributes['aria-expanded'],
155
158
  // FUDGE(top-layer-api): cast to the narrow public TriggerProps['aria-haspopup'] union.
156
159
  // `@atlaskit/top-layer` derives `aria-haspopup` from the content's role and types it
157
160
  // as the wider WAI-ARIA union (boolean | 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid').
@@ -167,7 +170,7 @@ var PopupTopLayer = exports.PopupTopLayer = /*#__PURE__*/(0, _react.memo)(functi
167
170
  };
168
171
  return trigger(triggerProps);
169
172
  }), /*#__PURE__*/React.createElement(_popup.Popup.Content, (0, _extends2.default)({}, roleProps, {
170
- isOpen: effectiveIsOpen,
173
+ isOpen: isOpen,
171
174
  animate: animation,
172
175
  testId: testId && "".concat(testId, "--content"),
173
176
  widthFromAnchor: shouldFitContainer ? 'match-anchor' : 'none'
@@ -134,9 +134,6 @@ export const PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer({
134
134
  titleId
135
135
  });
136
136
 
137
- // Sync controlled isOpen with internal state
138
- const effectiveIsOpen = isOpen;
139
-
140
137
  // Narrow to ForwardRefExoticComponent so JSX accepts the ref prop.
141
138
  // All popupComponent implementations use forwardRef per the PopupComponentProps contract.
142
139
  const Container = PopupContainer;
@@ -158,8 +155,14 @@ export const PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer({
158
155
  ref(node);
159
156
  }
160
157
  },
161
- 'aria-controls': effectiveIsOpen ? providedId !== null && providedId !== void 0 ? providedId : popoverId : undefined,
162
- 'aria-expanded': effectiveIsOpen,
158
+ 'aria-controls': isOpen ? providedId !== null && providedId !== void 0 ? providedId : popoverId : undefined,
159
+ // Use ariaAttributes['aria-expanded'] (which comes from `@atlaskit/top-layer`), rather than
160
+ // `isOpen` directly. `@atlaskit/top-layer` tracks the full animation lifecycle via
161
+ // TPopupState and only goes false after the exit animation completes, so:
162
+ // - Screen readers don't announce the popup as closed while it is still visible.
163
+ // - Consumers relying on aria-expanded to show/hide trigger UI don't lose the
164
+ // trigger (popup anchor) before the animation finishes.
165
+ 'aria-expanded': ariaAttributes['aria-expanded'],
163
166
  // FUDGE(top-layer-api): cast to the narrow public TriggerProps['aria-haspopup'] union.
164
167
  // `@atlaskit/top-layer` derives `aria-haspopup` from the content's role and types it
165
168
  // as the wider WAI-ARIA union (boolean | 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid').
@@ -175,7 +178,7 @@ export const PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer({
175
178
  };
176
179
  return trigger(triggerProps);
177
180
  }), /*#__PURE__*/React.createElement(Popup.Content, _extends({}, roleProps, {
178
- isOpen: effectiveIsOpen,
181
+ isOpen: isOpen,
179
182
  animate: animation,
180
183
  testId: testId && `${testId}--content`,
181
184
  widthFromAnchor: shouldFitContainer ? 'match-anchor' : 'none'
@@ -118,9 +118,6 @@ export var PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer(_ref) {
118
118
  titleId: titleId
119
119
  });
120
120
 
121
- // Sync controlled isOpen with internal state
122
- var effectiveIsOpen = isOpen;
123
-
124
121
  // Narrow to ForwardRefExoticComponent so JSX accepts the ref prop.
125
122
  // All popupComponent implementations use forwardRef per the PopupComponentProps contract.
126
123
  var Container = PopupContainer;
@@ -141,8 +138,14 @@ export var PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer(_ref) {
141
138
  _ref4(node);
142
139
  }
143
140
  },
144
- 'aria-controls': effectiveIsOpen ? providedId !== null && providedId !== void 0 ? providedId : popoverId : undefined,
145
- 'aria-expanded': effectiveIsOpen,
141
+ 'aria-controls': isOpen ? providedId !== null && providedId !== void 0 ? providedId : popoverId : undefined,
142
+ // Use ariaAttributes['aria-expanded'] (which comes from `@atlaskit/top-layer`), rather than
143
+ // `isOpen` directly. `@atlaskit/top-layer` tracks the full animation lifecycle via
144
+ // TPopupState and only goes false after the exit animation completes, so:
145
+ // - Screen readers don't announce the popup as closed while it is still visible.
146
+ // - Consumers relying on aria-expanded to show/hide trigger UI don't lose the
147
+ // trigger (popup anchor) before the animation finishes.
148
+ 'aria-expanded': ariaAttributes['aria-expanded'],
146
149
  // FUDGE(top-layer-api): cast to the narrow public TriggerProps['aria-haspopup'] union.
147
150
  // `@atlaskit/top-layer` derives `aria-haspopup` from the content's role and types it
148
151
  // as the wider WAI-ARIA union (boolean | 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid').
@@ -158,7 +161,7 @@ export var PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer(_ref) {
158
161
  };
159
162
  return trigger(triggerProps);
160
163
  }), /*#__PURE__*/React.createElement(Popup.Content, _extends({}, roleProps, {
161
- isOpen: effectiveIsOpen,
164
+ isOpen: isOpen,
162
165
  animate: animation,
163
166
  testId: testId && "".concat(testId, "--content"),
164
167
  widthFromAnchor: shouldFitContainer ? 'match-anchor' : 'none'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "4.21.1",
3
+ "version": "4.22.0",
4
4
  "description": "A popup displays brief content in an overlay.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -48,7 +48,7 @@
48
48
  "@atlaskit/portal": "^5.5.0",
49
49
  "@atlaskit/primitives": "^19.0.0",
50
50
  "@atlaskit/tokens": "^13.0.0",
51
- "@atlaskit/top-layer": "^0.10.0",
51
+ "@atlaskit/top-layer": "^0.12.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@compiled/react": "^0.20.0",
54
54
  "bind-event-listener": "^3.0.0",
@@ -74,7 +74,7 @@
74
74
  "@atlaskit/modal-dialog": "^15.2.0",
75
75
  "@atlaskit/section-message": "^8.13.0",
76
76
  "@atlaskit/textfield": "^8.3.0",
77
- "@atlaskit/toggle": "^15.6.0",
77
+ "@atlaskit/toggle": "^16.0.0",
78
78
  "@atlassian/feature-flags-test-utils": "^1.1.0",
79
79
  "@atlassian/react-compiler-gating": "workspace:^",
80
80
  "@atlassian/ssr-tests": "workspace:^",