@carbon/ibm-products 2.70.0 → 2.70.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.
@@ -28,7 +28,6 @@ import { useId } from '../../global/js/utils/useId.js';
28
28
  import { pkg } from '../../settings.js';
29
29
  import { timeAgo } from './utils.js';
30
30
  import { usePresence } from '../../global/js/hooks/usePresence.js';
31
- import { useClickOutside } from '../../global/js/hooks/useClickOutside.js';
32
31
 
33
32
  var _Close;
34
33
 
@@ -143,15 +142,17 @@ let NotificationsPanel = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
143
142
  // Set the notifications passed to the state within this component
144
143
  setAllNotifications(data);
145
144
  }, [data]);
146
- useClickOutside(ref || notificationPanelRef, target => {
147
- const element = target;
148
- if (!isActionableElement(element)) {
149
- setTimeout(() => {
150
- triggerButtonRef?.current?.focus();
151
- }, 100);
152
- }
153
- onClickOutside?.();
154
- });
145
+
146
+ // useClickOutside(ref || notificationPanelRef, (target) => {
147
+ // const element = target as HTMLElement;
148
+ // if (!isActionableElement(element)) {
149
+ // setTimeout(() => {
150
+ // triggerButtonRef?.current?.focus();
151
+ // }, 100);
152
+ // }
153
+ // onClickOutside?.();
154
+ // });
155
+
155
156
  const handleKeydown = event => {
156
157
  event.stopPropagation();
157
158
  if (event.key === 'Escape') {
@@ -309,17 +310,6 @@ let NotificationsPanel = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
309
310
  size: 16
310
311
  }))));
311
312
  };
312
- const isActionableElement = el => {
313
- if (!el) {
314
- return false;
315
- }
316
- const interactiveRoles = new Set(['button', 'link', 'textbox', 'checkbox', 'radio', 'slider', 'spinbutton', 'combobox', 'switch', 'menuitem']);
317
- const actionableAncestor = el.closest('button, a, input, select, textarea, [tabindex], [contenteditable="true"], [role]');
318
- if (!actionableAncestor) {
319
- return false;
320
- }
321
- return actionableAncestor instanceof HTMLButtonElement || actionableAncestor instanceof HTMLAnchorElement || actionableAncestor instanceof HTMLInputElement || actionableAncestor instanceof HTMLSelectElement || actionableAncestor instanceof HTMLTextAreaElement || actionableAncestor.tabIndex >= 0 || actionableAncestor.isContentEditable || interactiveRoles.has(actionableAncestor.getAttribute('role')?.toLowerCase() ?? '');
322
- };
323
313
  const dismissSingleNotification = (event, notification) => {
324
314
  event.preventDefault();
325
315
  event.stopPropagation();
@@ -30,7 +30,6 @@ var useId = require('../../global/js/utils/useId.js');
30
30
  var settings = require('../../settings.js');
31
31
  var utils = require('./utils.js');
32
32
  var usePresence = require('../../global/js/hooks/usePresence.js');
33
- var useClickOutside = require('../../global/js/hooks/useClickOutside.js');
34
33
 
35
34
  var _Close;
36
35
 
@@ -145,15 +144,17 @@ exports.NotificationsPanel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
145
144
  // Set the notifications passed to the state within this component
146
145
  setAllNotifications(data);
147
146
  }, [data]);
148
- useClickOutside.useClickOutside(ref || notificationPanelRef, target => {
149
- const element = target;
150
- if (!isActionableElement(element)) {
151
- setTimeout(() => {
152
- triggerButtonRef?.current?.focus();
153
- }, 100);
154
- }
155
- onClickOutside?.();
156
- });
147
+
148
+ // useClickOutside(ref || notificationPanelRef, (target) => {
149
+ // const element = target as HTMLElement;
150
+ // if (!isActionableElement(element)) {
151
+ // setTimeout(() => {
152
+ // triggerButtonRef?.current?.focus();
153
+ // }, 100);
154
+ // }
155
+ // onClickOutside?.();
156
+ // });
157
+
157
158
  const handleKeydown = event => {
158
159
  event.stopPropagation();
159
160
  if (event.key === 'Escape') {
@@ -311,17 +312,6 @@ exports.NotificationsPanel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
311
312
  size: 16
312
313
  }))));
313
314
  };
314
- const isActionableElement = el => {
315
- if (!el) {
316
- return false;
317
- }
318
- const interactiveRoles = new Set(['button', 'link', 'textbox', 'checkbox', 'radio', 'slider', 'spinbutton', 'combobox', 'switch', 'menuitem']);
319
- const actionableAncestor = el.closest('button, a, input, select, textarea, [tabindex], [contenteditable="true"], [role]');
320
- if (!actionableAncestor) {
321
- return false;
322
- }
323
- return actionableAncestor instanceof HTMLButtonElement || actionableAncestor instanceof HTMLAnchorElement || actionableAncestor instanceof HTMLInputElement || actionableAncestor instanceof HTMLSelectElement || actionableAncestor instanceof HTMLTextAreaElement || actionableAncestor.tabIndex >= 0 || actionableAncestor.isContentEditable || interactiveRoles.has(actionableAncestor.getAttribute('role')?.toLowerCase() ?? '');
324
- };
325
315
  const dismissSingleNotification = (event, notification) => {
326
316
  event.preventDefault();
327
317
  event.stopPropagation();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/ibm-products",
3
3
  "description": "Carbon for IBM Products",
4
- "version": "2.70.0",
4
+ "version": "2.70.1",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -140,5 +140,5 @@
140
140
  "react": "^16.8.6 || ^17.0.1 || ^18.2.0 || ^19.0.0",
141
141
  "react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0 || ^19.0.0"
142
142
  },
143
- "gitHead": "49c16755842ebdb793878e0389dfcb7ec8ac44a7"
143
+ "gitHead": "91bebb19de1982a9230a433cd998d92532e57803"
144
144
  }