@carbon/ibm-products 2.43.2-canary.166 → 2.43.2-canary.170

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,8 +13,12 @@ export interface ToolbarButtonProps extends React.ComponentProps<typeof IconButt
13
13
  caret?: boolean;
14
14
  /** Provide an optional class to be applied to the containing node */
15
15
  className?: string;
16
+ /**
17
+ * @deprecated use `label` instead
18
+ * Specifies the label for the icon button */
19
+ iconDescription?: string;
16
20
  /** Specifies the label for the icon button */
17
- iconDescription: string;
21
+ label: string;
18
22
  /** Specifies the icon to be used by the ToolbarButton component */
19
23
  renderIcon: React.ElementType;
20
24
  }
@@ -22,3 +26,10 @@ export interface ToolbarButtonProps extends React.ComponentProps<typeof IconButt
22
26
  export declare let ToolbarButton: React.ForwardRefExoticComponent<ToolbarButtonProps & {
23
27
  children?: React.ReactNode;
24
28
  } & React.RefAttributes<unknown>>;
29
+ export declare const deprecatedProps: {
30
+ /**
31
+ * **Deprecated**
32
+ * Specifies the label for the icon button
33
+ * */
34
+ iconDescription: import("prop-types").Requireable<string>;
35
+ };
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { objectSpread2 as _objectSpread2, objectWithoutProperties as _objectWithoutProperties, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default, { forwardRef, useContext } from 'react';
10
10
  import { ToolbarContext, blockClass as blockClass$1 } from './Toolbar.js';
11
11
  import { p as propTypesExports } from '../../node_modules/prop-types/index.js';
@@ -13,7 +13,7 @@ import { IconButton } from '@carbon/react';
13
13
  import cx from 'classnames';
14
14
  import { pkg } from '../../settings.js';
15
15
 
16
- var _excluded = ["caret", "children", "className", "renderIcon", "iconDescription"];
16
+ var _excluded = ["caret", "children", "className", "renderIcon", "iconDescription", "label"];
17
17
  var blockClass = "".concat(blockClass$1, "__button");
18
18
  /** Toolbar buttons are common functions performed as part of a products interface or an open window. */
19
19
  var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
@@ -24,13 +24,14 @@ var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
24
24
  className = _ref.className,
25
25
  renderIcon = _ref.renderIcon,
26
26
  _ref$iconDescription = _ref.iconDescription,
27
- iconDescription = _ref$iconDescription === void 0 ? '' : _ref$iconDescription,
27
+ deprecated_iconDescription = _ref$iconDescription === void 0 ? '' : _ref$iconDescription,
28
+ label = _ref.label,
28
29
  rest = _objectWithoutProperties(_ref, _excluded);
29
30
  var Icon = renderIcon;
30
31
  return /*#__PURE__*/React__default.createElement(IconButton, _extends({
31
32
  align: (_useContext = useContext(ToolbarContext)) !== null && _useContext !== void 0 && _useContext.vertical ? 'right' : 'top'
32
33
  }, rest, {
33
- label: iconDescription,
34
+ label: label !== null && label !== void 0 ? label : deprecated_iconDescription,
34
35
  ref: ref,
35
36
  className: cx(className, _defineProperty({}, "".concat(blockClass, "--caret"), caret)),
36
37
  kind: "ghost",
@@ -41,7 +42,14 @@ var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
41
42
  });
42
43
  var componentName = 'ToolbarButton';
43
44
  ToolbarButton.displayName = componentName;
44
- ToolbarButton.propTypes = {
45
+ var deprecatedProps = {
46
+ /**
47
+ * **Deprecated**
48
+ * Specifies the label for the icon button
49
+ * */
50
+ iconDescription: propTypesExports.string
51
+ };
52
+ ToolbarButton.propTypes = _objectSpread2({
45
53
  /** Determines whether the caret is rendered */
46
54
  caret: propTypesExports.bool,
47
55
  /** Provide the content of the `ToolbarButton` */
@@ -49,10 +57,10 @@ ToolbarButton.propTypes = {
49
57
  /** Provide an optional class to be applied to the containing node */
50
58
  className: propTypesExports.string,
51
59
  /** Specifies the label for the icon button */
52
- iconDescription: propTypesExports.string.isRequired,
60
+ label: propTypesExports.string.isRequired,
53
61
  /** Specifies the icon to be used by the ToolbarButton component */
54
62
  renderIcon: propTypesExports.func.isRequired
55
- };
63
+ }, deprecatedProps);
56
64
  ToolbarButton = pkg.checkComponentEnabled(ToolbarButton, componentName);
57
65
 
58
- export { ToolbarButton, blockClass };
66
+ export { ToolbarButton, blockClass, deprecatedProps };
@@ -13,8 +13,12 @@ export interface ToolbarButtonProps extends React.ComponentProps<typeof IconButt
13
13
  caret?: boolean;
14
14
  /** Provide an optional class to be applied to the containing node */
15
15
  className?: string;
16
+ /**
17
+ * @deprecated use `label` instead
18
+ * Specifies the label for the icon button */
19
+ iconDescription?: string;
16
20
  /** Specifies the label for the icon button */
17
- iconDescription: string;
21
+ label: string;
18
22
  /** Specifies the icon to be used by the ToolbarButton component */
19
23
  renderIcon: React.ElementType;
20
24
  }
@@ -22,3 +26,10 @@ export interface ToolbarButtonProps extends React.ComponentProps<typeof IconButt
22
26
  export declare let ToolbarButton: React.ForwardRefExoticComponent<ToolbarButtonProps & {
23
27
  children?: React.ReactNode;
24
28
  } & React.RefAttributes<unknown>>;
29
+ export declare const deprecatedProps: {
30
+ /**
31
+ * **Deprecated**
32
+ * Specifies the label for the icon button
33
+ * */
34
+ iconDescription: import("prop-types").Requireable<string>;
35
+ };
@@ -22,7 +22,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
22
22
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
23
23
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
24
24
 
25
- var _excluded = ["caret", "children", "className", "renderIcon", "iconDescription"];
25
+ var _excluded = ["caret", "children", "className", "renderIcon", "iconDescription", "label"];
26
26
  var blockClass = "".concat(Toolbar.blockClass, "__button");
27
27
  /** Toolbar buttons are common functions performed as part of a products interface or an open window. */
28
28
  exports.ToolbarButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
@@ -33,13 +33,14 @@ exports.ToolbarButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
33
33
  className = _ref.className,
34
34
  renderIcon = _ref.renderIcon,
35
35
  _ref$iconDescription = _ref.iconDescription,
36
- iconDescription = _ref$iconDescription === void 0 ? '' : _ref$iconDescription,
36
+ deprecated_iconDescription = _ref$iconDescription === void 0 ? '' : _ref$iconDescription,
37
+ label = _ref.label,
37
38
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
38
39
  var Icon = renderIcon;
39
40
  return /*#__PURE__*/React__default["default"].createElement(react.IconButton, _rollupPluginBabelHelpers["extends"]({
40
41
  align: (_useContext = React.useContext(Toolbar.ToolbarContext)) !== null && _useContext !== void 0 && _useContext.vertical ? 'right' : 'top'
41
42
  }, rest, {
42
- label: iconDescription,
43
+ label: label !== null && label !== void 0 ? label : deprecated_iconDescription,
43
44
  ref: ref,
44
45
  className: cx__default["default"](className, _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--caret"), caret)),
45
46
  kind: "ghost",
@@ -50,7 +51,14 @@ exports.ToolbarButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
50
51
  });
51
52
  var componentName = 'ToolbarButton';
52
53
  exports.ToolbarButton.displayName = componentName;
53
- exports.ToolbarButton.propTypes = {
54
+ var deprecatedProps = {
55
+ /**
56
+ * **Deprecated**
57
+ * Specifies the label for the icon button
58
+ * */
59
+ iconDescription: index.propTypesExports.string
60
+ };
61
+ exports.ToolbarButton.propTypes = _rollupPluginBabelHelpers.objectSpread2({
54
62
  /** Determines whether the caret is rendered */
55
63
  caret: index.propTypesExports.bool,
56
64
  /** Provide the content of the `ToolbarButton` */
@@ -58,10 +66,11 @@ exports.ToolbarButton.propTypes = {
58
66
  /** Provide an optional class to be applied to the containing node */
59
67
  className: index.propTypesExports.string,
60
68
  /** Specifies the label for the icon button */
61
- iconDescription: index.propTypesExports.string.isRequired,
69
+ label: index.propTypesExports.string.isRequired,
62
70
  /** Specifies the icon to be used by the ToolbarButton component */
63
71
  renderIcon: index.propTypesExports.func.isRequired
64
- };
72
+ }, deprecatedProps);
65
73
  exports.ToolbarButton = settings.pkg.checkComponentEnabled(exports.ToolbarButton, componentName);
66
74
 
67
75
  exports.blockClass = blockClass;
76
+ exports.deprecatedProps = deprecatedProps;
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.43.2-canary.166+0fb5afd7c",
4
+ "version": "2.43.2-canary.170+0d8601017",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -96,7 +96,7 @@
96
96
  "dependencies": {
97
97
  "@babel/runtime": "^7.23.9",
98
98
  "@carbon/feature-flags": "^0.20.0",
99
- "@carbon/ibm-products-styles": "^2.39.1-canary.176+0fb5afd7c",
99
+ "@carbon/ibm-products-styles": "^2.44.0-rc.0",
100
100
  "@carbon/telemetry": "^0.1.0",
101
101
  "@dnd-kit/core": "^6.0.8",
102
102
  "@dnd-kit/modifiers": "^7.0.0",
@@ -120,5 +120,5 @@
120
120
  "react": "^16.8.6 || ^17.0.1 || ^18.2.0",
121
121
  "react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
122
122
  },
123
- "gitHead": "0fb5afd7c210e6b726f67887b8126f3f0692c106"
123
+ "gitHead": "0d860101791e8587f8d1688348aae8438c4d0fc9"
124
124
  }