@carbon/react 1.51.0 → 1.51.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.
@@ -21,12 +21,14 @@ const ChatButton = /*#__PURE__*/React__default.forwardRef(function ChatButton(_r
21
21
  isQuickAction,
22
22
  isSelected,
23
23
  kind,
24
+ renderIcon,
24
25
  size,
25
26
  ...other
26
27
  } = _ref;
27
28
  const prefix = usePrefix();
28
29
  const classNames = cx(className, {
29
30
  [`${prefix}--chat-btn`]: true,
31
+ [`${prefix}--chat-btn--with-icon`]: renderIcon,
30
32
  [`${prefix}--chat-btn--quick-action`]: isQuickAction,
31
33
  [`${prefix}--chat-btn--quick-action--selected`]: isSelected
32
34
  });
@@ -43,7 +45,8 @@ const ChatButton = /*#__PURE__*/React__default.forwardRef(function ChatButton(_r
43
45
  className: classNames,
44
46
  kind: kind,
45
47
  ref: ref,
46
- size: size
48
+ size: size,
49
+ renderIcon: renderIcon
47
50
  }, other), children);
48
51
  });
49
52
  ChatButton.propTypes = {
@@ -71,6 +74,11 @@ ChatButton.propTypes = {
71
74
  * Specify the kind of `ChatButton` you want to create
72
75
  */
73
76
  kind: PropTypes.oneOf(['primary', 'secondary', 'danger', 'ghost', 'tertiary']),
77
+ /**
78
+ * Optional prop to specify an icon to be rendered.
79
+ * Can be a React component class
80
+ */
81
+ renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
74
82
  /**
75
83
  * Specify the size of the `ChatButton`, from the following list of sizes:
76
84
  */
@@ -36,9 +36,8 @@ const ModalBody = /*#__PURE__*/React__default.forwardRef(function ModalBody(_ref
36
36
  const contentClass = cx({
37
37
  [`${prefix}--modal-content`]: true,
38
38
  [`${prefix}--modal-content--with-form`]: hasForm,
39
- [`${prefix}--modal-scroll-content`]: hasScrollingContent || isScrollable,
40
- customClassName
41
- });
39
+ [`${prefix}--modal-scroll-content`]: hasScrollingContent || isScrollable
40
+ }, customClassName);
42
41
  useIsomorphicEffect(() => {
43
42
  if (contentRef.current) {
44
43
  setIsScrollable(contentRef.current.scrollHeight > contentRef.current.clientHeight);
@@ -31,12 +31,14 @@ const ChatButton = /*#__PURE__*/React__default["default"].forwardRef(function Ch
31
31
  isQuickAction,
32
32
  isSelected,
33
33
  kind,
34
+ renderIcon,
34
35
  size,
35
36
  ...other
36
37
  } = _ref;
37
38
  const prefix = usePrefix.usePrefix();
38
39
  const classNames = cx__default["default"](className, {
39
40
  [`${prefix}--chat-btn`]: true,
41
+ [`${prefix}--chat-btn--with-icon`]: renderIcon,
40
42
  [`${prefix}--chat-btn--quick-action`]: isQuickAction,
41
43
  [`${prefix}--chat-btn--quick-action--selected`]: isSelected
42
44
  });
@@ -53,7 +55,8 @@ const ChatButton = /*#__PURE__*/React__default["default"].forwardRef(function Ch
53
55
  className: classNames,
54
56
  kind: kind,
55
57
  ref: ref,
56
- size: size
58
+ size: size,
59
+ renderIcon: renderIcon
57
60
  }, other), children);
58
61
  });
59
62
  ChatButton.propTypes = {
@@ -81,6 +84,11 @@ ChatButton.propTypes = {
81
84
  * Specify the kind of `ChatButton` you want to create
82
85
  */
83
86
  kind: PropTypes__default["default"].oneOf(['primary', 'secondary', 'danger', 'ghost', 'tertiary']),
87
+ /**
88
+ * Optional prop to specify an icon to be rendered.
89
+ * Can be a React component class
90
+ */
91
+ renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
84
92
  /**
85
93
  * Specify the size of the `ChatButton`, from the following list of sizes:
86
94
  */
@@ -47,9 +47,8 @@ const ModalBody = /*#__PURE__*/React__default["default"].forwardRef(function Mod
47
47
  const contentClass = cx__default["default"]({
48
48
  [`${prefix}--modal-content`]: true,
49
49
  [`${prefix}--modal-content--with-form`]: hasForm,
50
- [`${prefix}--modal-scroll-content`]: hasScrollingContent || isScrollable,
51
- customClassName
52
- });
50
+ [`${prefix}--modal-scroll-content`]: hasScrollingContent || isScrollable
51
+ }, customClassName);
53
52
  useIsomorphicEffect["default"](() => {
54
53
  if (contentRef.current) {
55
54
  setIsScrollable(contentRef.current.scrollHeight > contentRef.current.clientHeight);
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.51.0",
4
+ "version": "1.51.1",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -51,7 +51,7 @@
51
51
  "@carbon/feature-flags": "^0.16.0",
52
52
  "@carbon/icons-react": "^11.36.0",
53
53
  "@carbon/layout": "^11.20.0",
54
- "@carbon/styles": "^1.51.0",
54
+ "@carbon/styles": "^1.51.1",
55
55
  "@ibm/telemetry-js": "^1.2.0",
56
56
  "classnames": "2.5.1",
57
57
  "copy-to-clipboard": "^3.3.1",
@@ -139,5 +139,5 @@
139
139
  "**/*.scss",
140
140
  "**/*.css"
141
141
  ],
142
- "gitHead": "957667fa7f197b544f6cb336814daa7074daaaee"
142
+ "gitHead": "de5bf0cfcece9d4294a6f4569319a219cb6201fa"
143
143
  }