@carbon/react 1.48.0-rc.0 → 1.48.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.
@@ -22,14 +22,17 @@ const SlugContent = /*#__PURE__*/React__default.forwardRef(function SlugContent(
22
22
  className
23
23
  } = _ref;
24
24
  const prefix = usePrefix();
25
+ const hasSlugActions = React__default.Children.toArray(children).some(child => child.type?.displayName === 'SlugActions');
25
26
  const slugContentClasses = cx(className, {
26
- [`${prefix}--slug-content`]: true
27
+ [`${prefix}--slug-content`]: true,
28
+ [`${prefix}--slug-content--with-actions`]: hasSlugActions
27
29
  });
28
30
  return /*#__PURE__*/React__default.createElement(ToggletipContent, {
29
31
  className: slugContentClasses,
30
32
  ref: ref
31
33
  }, children);
32
34
  });
35
+ SlugContent.displayName = 'SlugContent';
33
36
  SlugContent.propTypes = {
34
37
  /**
35
38
  * Specify the content you want rendered inside the slug ToggleTip
@@ -54,6 +57,7 @@ const SlugActions = /*#__PURE__*/React__default.forwardRef(function SlugActions(
54
57
  ref: ref
55
58
  }, children);
56
59
  });
60
+ SlugActions.displayName = 'SlugActions';
57
61
  SlugActions.propTypes = {
58
62
  /**
59
63
  * Specify the content you want rendered inside the slug callout toolbar
@@ -12,7 +12,7 @@ import React__default, { useRef, useState, useCallback, useEffect } from 'react'
12
12
  import { Popover, PopoverContent } from '../Popover/index.js';
13
13
  import { useDelayedState } from '../../internal/useDelayedState.js';
14
14
  import { useId } from '../../internal/useId.js';
15
- import { useNoInteractiveChildren, getInteractiveContent } from '../../internal/useNoInteractiveChildren.js';
15
+ import { useNoInteractiveChildren } from '../../internal/useNoInteractiveChildren.js';
16
16
  import { usePrefix } from '../../internal/usePrefix.js';
17
17
  import { match } from '../../internal/keyboard/match.js';
18
18
  import { Escape, Enter, Space } from '../../internal/keyboard/keys.js';
@@ -110,14 +110,6 @@ function Tooltip(_ref) {
110
110
  }
111
111
  }, [isPointerIntersecting, leaveDelayMs, setOpen]);
112
112
  useNoInteractiveChildren(tooltipRef, 'The Tooltip component must have no interactive content rendered by the' + '`label` or `description` prop');
113
- useEffect(() => {
114
- if (containerRef !== null && containerRef.current) {
115
- const interactiveContent = getInteractiveContent(containerRef.current);
116
- if (!interactiveContent) {
117
- setOpen(false);
118
- }
119
- }
120
- });
121
113
  useEffect(() => {
122
114
  if (isDragging) {
123
115
  // Register drag stop handlers.
@@ -32,14 +32,17 @@ const SlugContent = /*#__PURE__*/React__default["default"].forwardRef(function S
32
32
  className
33
33
  } = _ref;
34
34
  const prefix = usePrefix.usePrefix();
35
+ const hasSlugActions = React__default["default"].Children.toArray(children).some(child => child.type?.displayName === 'SlugActions');
35
36
  const slugContentClasses = cx__default["default"](className, {
36
- [`${prefix}--slug-content`]: true
37
+ [`${prefix}--slug-content`]: true,
38
+ [`${prefix}--slug-content--with-actions`]: hasSlugActions
37
39
  });
38
40
  return /*#__PURE__*/React__default["default"].createElement(index.ToggletipContent, {
39
41
  className: slugContentClasses,
40
42
  ref: ref
41
43
  }, children);
42
44
  });
45
+ SlugContent.displayName = 'SlugContent';
43
46
  SlugContent.propTypes = {
44
47
  /**
45
48
  * Specify the content you want rendered inside the slug ToggleTip
@@ -64,6 +67,7 @@ const SlugActions = /*#__PURE__*/React__default["default"].forwardRef(function S
64
67
  ref: ref
65
68
  }, children);
66
69
  });
70
+ SlugActions.displayName = 'SlugActions';
67
71
  SlugActions.propTypes = {
68
72
  /**
69
73
  * Specify the content you want rendered inside the slug callout toolbar
@@ -120,14 +120,6 @@ function Tooltip(_ref) {
120
120
  }
121
121
  }, [isPointerIntersecting, leaveDelayMs, setOpen]);
122
122
  useNoInteractiveChildren.useNoInteractiveChildren(tooltipRef, 'The Tooltip component must have no interactive content rendered by the' + '`label` or `description` prop');
123
- React.useEffect(() => {
124
- if (containerRef !== null && containerRef.current) {
125
- const interactiveContent = useNoInteractiveChildren.getInteractiveContent(containerRef.current);
126
- if (!interactiveContent) {
127
- setOpen(false);
128
- }
129
- }
130
- });
131
123
  React.useEffect(() => {
132
124
  if (isDragging) {
133
125
  // Register drag stop handlers.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/react",
3
3
  "description": "React components for the Carbon Design System",
4
- "version": "1.48.0-rc.0",
4
+ "version": "1.48.1",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -49,9 +49,9 @@
49
49
  "dependencies": {
50
50
  "@babel/runtime": "^7.18.3",
51
51
  "@carbon/feature-flags": "^0.16.0",
52
- "@carbon/icons-react": "^11.34.0-rc.0",
52
+ "@carbon/icons-react": "^11.34.1",
53
53
  "@carbon/layout": "^11.20.0",
54
- "@carbon/styles": "^1.48.0-rc.0",
54
+ "@carbon/styles": "^1.48.1",
55
55
  "@ibm/telemetry-js": "^1.1.0",
56
56
  "classnames": "2.5.1",
57
57
  "copy-to-clipboard": "^3.3.1",
@@ -79,7 +79,7 @@
79
79
  "@babel/preset-react": "^7.22.3",
80
80
  "@babel/preset-typescript": "^7.21.5",
81
81
  "@carbon/test-utils": "^10.30.0",
82
- "@carbon/themes": "^11.29.0-rc.0",
82
+ "@carbon/themes": "^11.29.1",
83
83
  "@rollup/plugin-babel": "^6.0.0",
84
84
  "@rollup/plugin-commonjs": "^25.0.0",
85
85
  "@rollup/plugin-node-resolve": "^15.0.0",
@@ -139,5 +139,5 @@
139
139
  "**/*.scss",
140
140
  "**/*.css"
141
141
  ],
142
- "gitHead": "5eb449df62a21a69a467895cb94d758ba8554620"
142
+ "gitHead": "68c58d98fe0c287eb4456c8b5153f6cb7b58c5bf"
143
143
  }