carbon-addons-iot-react 4.2.0 → 4.2.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.
Files changed (32) hide show
  1. package/css/carbon-addons-iot-react.css +479 -130
  2. package/css/carbon-addons-iot-react.css.map +1 -1
  3. package/es/node_modules/@carbon/feature-flags/es/index.js +44 -2
  4. package/es/node_modules/@carbon/react/es/components/FeatureFlags/index.js +4 -1
  5. package/es/node_modules/@carbon/react/es/components/IconButton/index.js +5 -3
  6. package/es/node_modules/@carbon/react/es/components/OverflowMenu/OverflowMenu.js +7 -6
  7. package/es/node_modules/@carbon/react/es/components/Popover/index.js +36 -9
  8. package/es/node_modules/@carbon/react/es/components/Tooltip/Tooltip.js +30 -23
  9. package/es/node_modules/@carbon/react/es/internal/FloatingMenu.js +10 -2
  10. package/es/node_modules/@carbon/react/es/internal/useMergedRefs.js +1 -0
  11. package/es/node_modules/@carbon/react/es/internal/useNoInteractiveChildren.js +3 -0
  12. package/es/node_modules/@carbon/react/es/internal/useOutsideClick.js +1 -0
  13. package/es/node_modules/@carbon/react/es/internal/warning.js +1 -0
  14. package/es/node_modules/@carbon/react/es/prop-types/deprecateValuesWithin.js +6 -6
  15. package/es/node_modules/@carbon/react/es/tools/mergeRefs.js +16 -12
  16. package/lib/css/carbon-addons-iot-react.css +479 -130
  17. package/lib/css/carbon-addons-iot-react.css.map +1 -1
  18. package/lib/node_modules/@carbon/feature-flags/es/index.js +44 -2
  19. package/lib/node_modules/@carbon/react/es/components/FeatureFlags/index.js +4 -1
  20. package/lib/node_modules/@carbon/react/es/components/IconButton/index.js +5 -3
  21. package/lib/node_modules/@carbon/react/es/components/OverflowMenu/OverflowMenu.js +7 -6
  22. package/lib/node_modules/@carbon/react/es/components/Popover/index.js +36 -9
  23. package/lib/node_modules/@carbon/react/es/components/Tooltip/Tooltip.js +30 -23
  24. package/lib/node_modules/@carbon/react/es/internal/FloatingMenu.js +10 -2
  25. package/lib/node_modules/@carbon/react/es/internal/useMergedRefs.js +1 -0
  26. package/lib/node_modules/@carbon/react/es/internal/useNoInteractiveChildren.js +3 -0
  27. package/lib/node_modules/@carbon/react/es/internal/useOutsideClick.js +1 -0
  28. package/lib/node_modules/@carbon/react/es/internal/warning.js +1 -0
  29. package/lib/node_modules/@carbon/react/es/prop-types/deprecateValuesWithin.js +6 -6
  30. package/lib/node_modules/@carbon/react/es/tools/mergeRefs.js +16 -12
  31. package/package.json +3 -3
  32. package/umd/carbon-addons-iot-react.js +158 -58
@@ -2588,6 +2588,15 @@
2588
2588
  } else {
2589
2589
  enabled$1.enableExperimentalTileContrast = false;
2590
2590
  }
2591
+ if (process.env.CARBON_ENABLE_TILE_CONTRAST) {
2592
+ if (process.env.CARBON_ENABLE_TILE_CONTRAST === 'true') {
2593
+ enabled$1.enableTileContrast = true;
2594
+ } else {
2595
+ enabled$1.enableTileContrast = false;
2596
+ }
2597
+ } else {
2598
+ enabled$1.enableTileContrast = false;
2599
+ }
2591
2600
  if (process.env.CARBON_ENABLE_V12_TILE_DEFAULT_ICONS) {
2592
2601
  if (process.env.CARBON_ENABLE_V12_TILE_DEFAULT_ICONS === 'true') {
2593
2602
  enabled$1.enableV12TileDefaultIcons = true;
@@ -2642,6 +2651,15 @@
2642
2651
  } else {
2643
2652
  enabled$1.enableExperimentalFocusWrapWithoutSentinels = false;
2644
2653
  }
2654
+ if (process.env.CARBON_ENABLE_FOCUS_WRAP_WITHOUT_SENTINELS) {
2655
+ if (process.env.CARBON_ENABLE_FOCUS_WRAP_WITHOUT_SENTINELS === 'true') {
2656
+ enabled$1.enableFocusWrapWithoutSentinels = true;
2657
+ } else {
2658
+ enabled$1.enableFocusWrapWithoutSentinels = false;
2659
+ }
2660
+ } else {
2661
+ enabled$1.enableFocusWrapWithoutSentinels = false;
2662
+ }
2645
2663
  if (process.env.CARBON_ENABLE_DIALOG_ELEMENT) {
2646
2664
  if (process.env.CARBON_ENABLE_DIALOG_ELEMENT === 'true') {
2647
2665
  enabled$1.enableDialogElement = true;
@@ -2678,21 +2696,33 @@
2678
2696
  } else {
2679
2697
  enabled$1.enableEnhancedFileUploader = false;
2680
2698
  }
2699
+ if (process.env.CARBON_ENABLE_PRESENCE) {
2700
+ if (process.env.CARBON_ENABLE_PRESENCE === 'true') {
2701
+ enabled$1.enablePresence = true;
2702
+ } else {
2703
+ enabled$1.enablePresence = false;
2704
+ }
2705
+ } else {
2706
+ enabled$1.enablePresence = false;
2707
+ }
2681
2708
  } catch (error) {
2682
2709
  enabled$1.enableCssCustomProperties = false;
2683
2710
  enabled$1.enableCssGrid = false;
2684
2711
  enabled$1.enableV11Release = true;
2685
2712
  enabled$1.enableExperimentalTileContrast = false;
2713
+ enabled$1.enableTileContrast = false;
2686
2714
  enabled$1.enableV12TileDefaultIcons = false;
2687
2715
  enabled$1.enableV12TileRadioIcons = false;
2688
2716
  enabled$1.enableV12Overflowmenu = false;
2689
2717
  enabled$1.enableTreeviewControllable = false;
2690
2718
  enabled$1.enableV12StructuredListVisibleIcons = false;
2691
2719
  enabled$1.enableExperimentalFocusWrapWithoutSentinels = false;
2720
+ enabled$1.enableFocusWrapWithoutSentinels = false;
2692
2721
  enabled$1.enableDialogElement = false;
2693
2722
  enabled$1.enableV12DynamicFloatingStyles = false;
2694
2723
  enabled$1.enableV12ToggleReducedLabelSpacing = false;
2695
2724
  enabled$1.enableEnhancedFileUploader = false;
2725
+ enabled$1.enablePresence = false;
2696
2726
  }
2697
2727
  var featureFlagInfo = [{
2698
2728
  name: "enable-css-custom-properties",
@@ -2708,8 +2738,12 @@
2708
2738
  enabled: enabled$1.enableV11Release
2709
2739
  }, {
2710
2740
  name: "enable-experimental-tile-contrast",
2711
- description: "Enable the experimental tile improved contrast styles\n",
2741
+ description: "Deprecated, use enable-tile-contrast instead\n",
2712
2742
  enabled: enabled$1.enableExperimentalTileContrast
2743
+ }, {
2744
+ name: "enable-tile-contrast",
2745
+ description: "Enable the experimental tile improved contrast styles\n",
2746
+ enabled: enabled$1.enableTileContrast
2713
2747
  }, {
2714
2748
  name: "enable-v12-tile-default-icons",
2715
2749
  description: "Enable rendering of default icons in the tile components\n",
@@ -2732,8 +2766,12 @@
2732
2766
  enabled: enabled$1.enableV12StructuredListVisibleIcons
2733
2767
  }, {
2734
2768
  name: "enable-experimental-focus-wrap-without-sentinels",
2735
- description: "Enable the new focus wrap behavior that doesn't use sentinel nodes\n",
2769
+ description: "Deprecated, use enable-focus-wrap-without-sentinels instead\n",
2736
2770
  enabled: enabled$1.enableExperimentalFocusWrapWithoutSentinels
2771
+ }, {
2772
+ name: "enable-focus-wrap-without-sentinels",
2773
+ description: "Enable the new focus wrap behavior that doesn't use sentinel nodes\n",
2774
+ enabled: enabled$1.enableFocusWrapWithoutSentinels
2737
2775
  }, {
2738
2776
  name: "enable-dialog-element",
2739
2777
  description: "Enable components to utilize the native dialog element\n",
@@ -2750,6 +2788,10 @@
2750
2788
  name: "enable-enhanced-file-uploader",
2751
2789
  description: "Enable enhanced functionality for the FileUploader component, including richer callback data and expanded trigger events for onChange and onDelete.\n",
2752
2790
  enabled: enabled$1.enableEnhancedFileUploader
2791
+ }, {
2792
+ name: "enable-presence",
2793
+ description: "Enable components to remain unmounted in closed state and mount in open state.\n",
2794
+ enabled: enabled$1.enablePresence
2753
2795
  }];
2754
2796
 
2755
2797
  function _arrayLikeToArray$a(r, a) {
@@ -3249,6 +3291,7 @@
3249
3291
  throw new Error('`warning(condition, message)` requires a warning ' + 'format argument');
3250
3292
  }
3251
3293
  if (!condition) {
3294
+ // eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
3252
3295
  console.warn('Warning: ' + message);
3253
3296
  }
3254
3297
  } ;
@@ -4086,6 +4129,7 @@
4086
4129
  }
4087
4130
  placeInProgressRef.current = false;
4088
4131
  }
4132
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
4089
4133
  }, [floatingPosition, onPlace]);
4090
4134
 
4091
4135
  // Attach a resize listener.
@@ -4096,11 +4140,13 @@
4096
4140
  return () => {
4097
4141
  resizeHandler.remove();
4098
4142
  };
4143
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
4099
4144
  }, [triggerRef, menuOffset, menuDirection, flipped, target, updateOrientation]);
4100
4145
 
4101
4146
  // Update menu position when key props change.
4102
4147
  React$1.useEffect(() => {
4103
4148
  updateMenuPosition();
4149
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
4104
4150
  }, [menuOffset, menuDirection, flipped, triggerRef, target, updateOrientation]);
4105
4151
 
4106
4152
  /**
@@ -4159,10 +4205,15 @@
4159
4205
  });
4160
4206
  }
4161
4207
  };
4162
- const focusTrapWithoutSentinels = enabled('enable-experimental-focus-wrap-without-sentinels');
4208
+ const deprecatedFlag = enabled('enable-experimental-focus-wrap-without-sentinels');
4209
+ const focusTrapWithoutSentinelsFlag = enabled('enable-focus-wrap-without-sentinels');
4210
+ const focusTrapWithoutSentinels = deprecatedFlag || focusTrapWithoutSentinelsFlag;
4163
4211
  if (typeof document !== 'undefined') {
4164
4212
  const portalTarget = target ? target() : document.body;
4165
- return /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React$1.createElement("div", {
4213
+ return /*#__PURE__*/ReactDOM.createPortal(
4214
+ /*#__PURE__*/
4215
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- https://github.com/carbon-design-system/carbon/issues/20452
4216
+ React$1.createElement("div", {
4166
4217
  onBlur: focusTrap && !focusTrapWithoutSentinels ? handleBlur : undefined,
4167
4218
  onKeyDown: focusTrapWithoutSentinels ? handleKeyDown : undefined
4168
4219
  }, !focusTrapWithoutSentinels && /*#__PURE__*/React$1.createElement("span", {
@@ -4224,18 +4275,22 @@
4224
4275
  */
4225
4276
 
4226
4277
  /**
4227
- * @param {...Ref<Element>} refs List of React refs to merge.
4228
- * @returns {Ref<Element>} Merged React ref.
4278
+ * @param refs Refs to merge.
4279
+ * @returns Merged ref.
4229
4280
  */
4230
- const mergeRefs$1 = (...refs) => el => {
4231
- refs.forEach(ref => {
4232
- // https://github.com/facebook/react/issues/13029#issuecomment-410002316
4233
- if (typeof ref === 'function') {
4234
- ref(el);
4235
- } else if (Object(ref) === ref) {
4236
- ref.current = el;
4237
- }
4238
- });
4281
+ const mergeRefs$1 = (...refs) => {
4282
+ return value => {
4283
+ refs.forEach(ref => {
4284
+ if (!ref) return;
4285
+
4286
+ // https://github.com/facebook/react/issues/13029#issuecomment-410002316
4287
+ if (typeof ref === 'function') {
4288
+ ref(value);
4289
+ } else if (typeof ref === 'object' && 'current' in ref) {
4290
+ ref.current = value;
4291
+ }
4292
+ });
4293
+ };
4239
4294
  };
4240
4295
 
4241
4296
  /**
@@ -4264,10 +4319,10 @@
4264
4319
 
4265
4320
 
4266
4321
  const didWarnAboutDeprecation = {};
4267
- function deprecateValuesWithin(propType, allowedValues, propMappingFunction) {
4268
- return function checker(props, propName, componentName, ...rest) {
4269
- if (props[propName] === undefined) {
4270
- return;
4322
+ const deprecateValuesWithin = (propType, allowedValues, propMappingFunction) => {
4323
+ return (props, propName, componentName, ...rest) => {
4324
+ if (typeof props[propName] === 'undefined') {
4325
+ return null;
4271
4326
  }
4272
4327
  if (!didWarnAboutDeprecation[componentName] || !didWarnAboutDeprecation[componentName][propName]) {
4273
4328
  didWarnAboutDeprecation[componentName] = {
@@ -4283,7 +4338,7 @@
4283
4338
  }
4284
4339
  return propType(props, propName, componentName, ...rest);
4285
4340
  };
4286
- }
4341
+ };
4287
4342
 
4288
4343
  /**
4289
4344
  * Copyright IBM Corp. 2016, 2023
@@ -4313,6 +4368,7 @@
4313
4368
  * node, assigns that node to every ref in the array.
4314
4369
  */
4315
4370
  const useMergedRefs = refs => {
4371
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
4316
4372
  const memoizedRefs = React$1.useMemo(() => refs, refs);
4317
4373
  return React$1.useCallback(node => {
4318
4374
  memoizedRefs.forEach(ref => {
@@ -7820,6 +7876,7 @@
7820
7876
  */
7821
7877
 
7822
7878
 
7879
+ // TODO: Can this variable be deleted now? It isn't used anywhere.
7823
7880
  /**
7824
7881
  * Our FeatureFlagContext is used alongside the FeatureFlags component to enable
7825
7882
  * or disable feature flags in a given React tree
@@ -7836,9 +7893,11 @@
7836
7893
  enableV12Overflowmenu: PropTypes.bool,
7837
7894
  enableTreeviewControllable: PropTypes.bool,
7838
7895
  enableExperimentalFocusWrapWithoutSentinels: PropTypes.bool,
7896
+ enableFocusWrapWithoutSentinels: PropTypes.bool,
7839
7897
  enableDialogElement: PropTypes.bool,
7840
7898
  enableV12DynamicFloatingStyles: PropTypes.bool,
7841
- enableEnhancedFileUploader: PropTypes.bool
7899
+ enableEnhancedFileUploader: PropTypes.bool,
7900
+ enablePresence: PropTypes.bool
7842
7901
  });
7843
7902
 
7844
7903
  /**
@@ -7881,17 +7940,21 @@
7881
7940
  as: BaseComponent = 'span',
7882
7941
  autoAlign = false,
7883
7942
  autoAlignBoundary,
7943
+ backgroundToken = 'layer',
7884
7944
  caret = isTabTip ? false : true,
7885
7945
  className: customClassName,
7886
7946
  children,
7947
+ border = false,
7887
7948
  dropShadow = true,
7888
7949
  highContrast = false,
7889
7950
  onRequestClose,
7890
7951
  open,
7891
7952
  alignmentAxisOffset,
7892
7953
  ...rest
7954
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
7893
7955
  },
7894
7956
  //this is a workaround, have to come back and fix this.
7957
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
7895
7958
  forwardRef) {
7896
7959
  const prefix = usePrefix();
7897
7960
  const floating = React$1.useRef(null);
@@ -7903,8 +7966,12 @@
7903
7966
  // The `Popover` should close whenever it and its children loses focus
7904
7967
  useEvent(popover, 'focusout', event => {
7905
7968
  const relatedTarget = event.relatedTarget;
7906
-
7907
- // No relatedTarget, focus moved to nowhere, so close the popover
7969
+ if (isTabTip) {
7970
+ if (relatedTarget && !popover.current?.contains(relatedTarget)) {
7971
+ onRequestClose?.();
7972
+ }
7973
+ return;
7974
+ }
7908
7975
  if (!relatedTarget) {
7909
7976
  onRequestClose?.();
7910
7977
  return;
@@ -7929,7 +7996,12 @@
7929
7996
  // needs to be placed 1px further outside the popover content. To do so,
7930
7997
  // we look to see if any of the children has a className containing "slug"
7931
7998
  const initialCaretHeight = React$1.Children.toArray(children).some(x => {
7932
- return x?.props?.className?.includes('slug') || x?.props?.className?.includes('ai-label');
7999
+ return (
8000
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
8001
+ x?.props?.className?.includes('slug') ||
8002
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
8003
+ x?.props?.className?.includes('ai-label')
8004
+ );
7933
8005
  }) ? 7 : 6;
7934
8006
  // These defaults match the defaults defined in packages/styles/scss/components/popover/_popover.scss
7935
8007
  const popoverDimensions = React$1.useRef({
@@ -7980,7 +8052,8 @@
7980
8052
  fallbackAxisSideDirection: 'start',
7981
8053
  boundary: autoAlignBoundary
7982
8054
  }), arrow({
7983
- element: caretRef
8055
+ element: caretRef,
8056
+ padding: 16
7984
8057
  }), autoAlign && hide$1()],
7985
8058
  whileElementsMounted: autoUpdate
7986
8059
  } : {}
@@ -8041,13 +8114,16 @@
8041
8114
  [`${prefix}--popover-container`]: true,
8042
8115
  [`${prefix}--popover--caret`]: caret,
8043
8116
  [`${prefix}--popover--drop-shadow`]: dropShadow,
8117
+ [`${prefix}--popover--border`]: border,
8044
8118
  [`${prefix}--popover--high-contrast`]: highContrast,
8045
8119
  [`${prefix}--popover--open`]: open,
8046
8120
  [`${prefix}--popover--auto-align ${prefix}--autoalign`]: enableFloatingStyles,
8047
8121
  [`${prefix}--popover--${currentAlignment}`]: true,
8048
- [`${prefix}--popover--tab-tip`]: isTabTip
8122
+ [`${prefix}--popover--tab-tip`]: isTabTip,
8123
+ [`${prefix}--popover--background-token__background`]: backgroundToken === 'background' && !highContrast
8049
8124
  }, customClassName);
8050
8125
  const mappedChildren = React$1.Children.map(children, child => {
8126
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
8051
8127
  const item = child;
8052
8128
  const displayName = item?.type?.displayName;
8053
8129
 
@@ -8062,9 +8138,13 @@
8062
8138
  const isTriggerComponent = enableFloatingStyles && displayName && ['ToggletipButton'].includes(displayName);
8063
8139
  const isAllowedTriggerComponent = enableFloatingStyles && !['ToggletipContent', 'PopoverContent'].includes(displayName);
8064
8140
  if (/*#__PURE__*/React$1.isValidElement(item) && (isTriggerElement || isTriggerComponent || isAllowedTriggerComponent)) {
8141
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
8065
8142
  const className = item?.props?.className;
8143
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
8066
8144
  const ref = (item?.props).ref;
8067
8145
  const tabTipClasses = classnames(`${prefix}--popover--tab-tip__button`, className);
8146
+
8147
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
8068
8148
  return /*#__PURE__*/React$1.cloneElement(item, {
8069
8149
  className: isTabTip && item?.type === 'button' ? tabTipClasses : className || '',
8070
8150
  // With cloneElement, if you pass a `ref`, it overrides the original ref.
@@ -8152,6 +8232,10 @@
8152
8232
  * @see https://github.com/carbon-design-system/carbon/issues/18714
8153
8233
  */
8154
8234
  autoAlign: PropTypes.bool,
8235
+ /**
8236
+ * Specify the background token to use. Default is 'layer'.
8237
+ */
8238
+ backgroundToken: PropTypes.oneOf(['layer', 'background']),
8155
8239
  /**
8156
8240
  * Specify a bounding element to be used for autoAlign calculations. The viewport is used by default. This prop is currently experimental and is subject to future changes.
8157
8241
  */
@@ -8165,6 +8249,10 @@
8165
8249
  * Specify whether a caret should be rendered
8166
8250
  */
8167
8251
  caret: PropTypes.bool,
8252
+ /**
8253
+ * Specify whether a border should be rendered on the popover
8254
+ */
8255
+ border: PropTypes.bool,
8168
8256
  /**
8169
8257
  * Provide elements to be rendered inside of the component
8170
8258
  */
@@ -8196,9 +8284,7 @@
8196
8284
  */
8197
8285
  open: PropTypes.bool.isRequired
8198
8286
  };
8199
- function PopoverContentRenderFunction(
8200
- // eslint-disable-next-line react/prop-types
8201
- {
8287
+ function PopoverContentRenderFunction({
8202
8288
  className,
8203
8289
  children,
8204
8290
  ...rest
@@ -8422,13 +8508,16 @@
8422
8508
  /*
8423
8509
  // eslint-disable-next-line react-hooks/rules-of-hooks
8424
8510
  */
8511
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
8425
8512
  React$1.useEffect(() => {
8426
8513
  const node = ref.current ? getInteractiveContent(ref.current) : false;
8427
8514
  if (node) {
8428
8515
  const errorMessage = `Error: ${message}.\n\nInstead found: ${node.outerHTML}`;
8516
+ // eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
8429
8517
  console.error(errorMessage);
8430
8518
  throw new Error(errorMessage);
8431
8519
  }
8520
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
8432
8521
  }, []);
8433
8522
  }
8434
8523
  };
@@ -8496,6 +8585,7 @@
8496
8585
  * Event types that trigger a "drag" to stop.
8497
8586
  */
8498
8587
  const DRAG_STOP_EVENT_TYPES = new Set(['mouseup', 'touchend', 'touchcancel']);
8588
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
8499
8589
  const Tooltip$2 = /*#__PURE__*/React$1.forwardRef(({
8500
8590
  as,
8501
8591
  align = 'top',
@@ -8542,6 +8632,8 @@
8542
8632
  'aria-labelledby': labelledBy,
8543
8633
  'aria-describedby': describedBy
8544
8634
  };
8635
+
8636
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
8545
8637
  function getChildEventHandlers(childProps) {
8546
8638
  const eventHandlerFunctions = Object.keys(triggerProps).filter(prop => prop.startsWith('on'));
8547
8639
  const eventHandlers = {};
@@ -8628,29 +8720,33 @@
8628
8720
  });
8629
8721
  };
8630
8722
  }, [isDragging, onDragStop]);
8631
- return /*#__PURE__*/React$1.createElement(Popover, _extends$2({
8632
- as: as,
8633
- ref: ref
8634
- }, rest, {
8635
- align: align,
8636
- className: classnames(`${prefix}--tooltip`, customClassName),
8637
- dropShadow: dropShadow,
8638
- highContrast: highContrast,
8639
- onKeyDown: onKeyDown,
8640
- onMouseLeave: onMouseLeave,
8641
- open: open
8642
- }), /*#__PURE__*/React$1.createElement("div", {
8643
- className: `${prefix}--tooltip-trigger__wrapper`
8644
- }, typeof child !== 'undefined' ? /*#__PURE__*/React$1.cloneElement(child, {
8645
- ...triggerProps,
8646
- ...getChildEventHandlers(child.props)
8647
- }) : null), /*#__PURE__*/React$1.createElement(PopoverContent, {
8648
- "aria-hidden": open ? 'false' : 'true',
8649
- className: `${prefix}--tooltip-content`,
8650
- id: id,
8651
- onMouseEnter: onMouseEnter,
8652
- role: "tooltip"
8653
- }, label || description));
8723
+ return (
8724
+ /*#__PURE__*/
8725
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
8726
+ React$1.createElement(Popover, _extends$2({
8727
+ as: as,
8728
+ ref: ref
8729
+ }, rest, {
8730
+ align: align,
8731
+ className: classnames(`${prefix}--tooltip`, customClassName),
8732
+ dropShadow: dropShadow,
8733
+ highContrast: highContrast,
8734
+ onKeyDown: onKeyDown,
8735
+ onMouseLeave: onMouseLeave,
8736
+ open: open
8737
+ }), /*#__PURE__*/React$1.createElement("div", {
8738
+ className: `${prefix}--tooltip-trigger__wrapper`
8739
+ }, typeof child !== 'undefined' ? /*#__PURE__*/React$1.cloneElement(child, {
8740
+ ...triggerProps,
8741
+ ...getChildEventHandlers(child.props)
8742
+ }) : null), /*#__PURE__*/React$1.createElement(PopoverContent, {
8743
+ "aria-hidden": open ? 'false' : 'true',
8744
+ className: `${prefix}--tooltip-content`,
8745
+ id: id,
8746
+ onMouseEnter: onMouseEnter,
8747
+ role: "tooltip"
8748
+ }, label || description))
8749
+ );
8654
8750
  });
8655
8751
  Tooltip$2.propTypes = {
8656
8752
  /**
@@ -8888,7 +8984,8 @@
8888
8984
 
8889
8985
 
8890
8986
  const IconButtonKinds = ['primary', 'secondary', 'ghost', 'tertiary'];
8891
- const IconButton = /*#__PURE__*/React$1.forwardRef(function IconButton({
8987
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
8988
+ const IconButton = /*#__PURE__*/React$1.forwardRef(({
8892
8989
  align,
8893
8990
  autoAlign = false,
8894
8991
  badgeCount,
@@ -8907,12 +9004,13 @@
8907
9004
  size,
8908
9005
  isSelected,
8909
9006
  ...rest
8910
- }, ref) {
9007
+ }, ref) => {
8911
9008
  const prefix = usePrefix();
8912
9009
  const tooltipClasses = classnames(wrapperClasses, `${prefix}--icon-tooltip`, {
8913
9010
  [`${prefix}--icon-tooltip--disabled`]: disabled
8914
9011
  });
8915
9012
  if (badgeCount && (kind !== 'ghost' || size !== 'lg')) {
9013
+ // eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
8916
9014
  console.warn("The prop BadgeCount must be used with hasIconOnly=true, kind='ghost' and size='lg'");
8917
9015
  }
8918
9016
  const badgeId = useId('badge-indicator');
@@ -9075,6 +9173,7 @@
9075
9173
  /*
9076
9174
  // eslint-disable-next-line react-hooks/rules-of-hooks
9077
9175
  */
9176
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
9078
9177
  useWindowEvent('click', event => {
9079
9178
  const {
9080
9179
  target
@@ -9136,6 +9235,7 @@
9136
9235
  {
9137
9236
  !(triggerButtonPositionProp && triggerButtonPositionFactor) ? browser(false, '[OverflowMenu] wrong floating menu direction: `%s`', direction) : void 0;
9138
9237
  }
9238
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
9139
9239
  const {
9140
9240
  offsetWidth: menuWidth,
9141
9241
  offsetHeight: menuHeight
@@ -9158,6 +9258,7 @@
9158
9258
  };
9159
9259
  }
9160
9260
  };
9261
+ // eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
9161
9262
  const OverflowMenu$1 = /*#__PURE__*/React$1.forwardRef(({
9162
9263
  align,
9163
9264
  ['aria-label']: ariaLabel = null,
@@ -9239,8 +9340,7 @@
9239
9340
  if (onCloseMenu) {
9240
9341
  onCloseMenu();
9241
9342
  }
9242
- onClose();
9243
- }, [onClose]);
9343
+ }, []);
9244
9344
  const closeMenuAndFocus = React$1.useCallback(() => {
9245
9345
  const wasClicked = click;
9246
9346
  const wasOpen = open;
@@ -9532,9 +9632,9 @@
9532
9632
  */
9533
9633
  selectorPrimaryFocus: PropTypes.string,
9534
9634
  /**
9535
- * Specify the size of the OverflowMenu. Currently supports either `sm`, `md` (default) or `lg` as an option.
9635
+ * Specify the size of the OverflowMenu. Currently supports either `xs`, `sm`, `md` (default) or `lg` as an option.
9536
9636
  */
9537
- size: PropTypes.oneOf(['sm', 'md', 'lg'])
9637
+ size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg'])
9538
9638
  };
9539
9639
 
9540
9640
  var defineProperty$c = objectDefineProperty.f;