@carbon/ibm-products 2.54.0-canary.67 → 2.54.0-canary.69

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.
@@ -16,7 +16,7 @@ import { CardFooter } from './CardFooter.js';
16
16
  import { pkg } from '../../settings.js';
17
17
 
18
18
  var _Incomplete, _CheckmarkOutline;
19
- var _excluded = ["actionIcons", "actionsPlacement", "decorator", "metadata", "children", "className", "clickZone", "description", "disabled", "footerActionIcon", "getStarted", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "overflowActions", "overflowAriaLabel", "onSecondaryButtonClick", "pictogram", "primaryButtonDisabled", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonDisabled", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonPlacement", "secondaryButtonText", "slug", "status", "sequence", "title", "titleSize", "iconDescription"],
19
+ var _excluded = ["actionIcons", "actionsPlacement", "decorator", "metadata", "children", "className", "clickZone", "description", "disabled", "footerActionIcon", "getStarted", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "onSecondaryButtonClick", "overflowActions", "overflowAriaLabel", "pictogram", "primaryButtonDisabled", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonDisabled", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonPlacement", "secondaryButtonText", "slug", "status", "sequence", "title", "titleSize", "iconDescription"],
20
20
  _excluded2 = ["id", "itemText"],
21
21
  _excluded3 = ["id", "icon", "onClick", "iconDescription", "href"];
22
22
  var componentName = 'Card';
@@ -43,10 +43,10 @@ var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
43
43
  onClick = _ref.onClick,
44
44
  onKeyDown = _ref.onKeyDown,
45
45
  onPrimaryButtonClick = _ref.onPrimaryButtonClick,
46
+ onSecondaryButtonClick = _ref.onSecondaryButtonClick,
46
47
  _ref$overflowActions = _ref.overflowActions,
47
48
  overflowActions = _ref$overflowActions === void 0 ? Object.freeze([]) : _ref$overflowActions,
48
49
  overflowAriaLabel = _ref.overflowAriaLabel,
49
- onSecondaryButtonClick = _ref.onSecondaryButtonClick,
50
50
  Pictogram = _ref.pictogram,
51
51
  primaryButtonDisabled = _ref.primaryButtonDisabled,
52
52
  primaryButtonHref = _ref.primaryButtonHref,
@@ -105,8 +105,7 @@ var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
105
105
  autoAlign: true,
106
106
  menuAlignment: pos,
107
107
  size: size,
108
- "aria-label": overflowAriaLabel,
109
- label: iconDescription
108
+ label: overflowAriaLabel || iconDescription
110
109
  }, overflowActions.map(function (_ref2) {
111
110
  var id = _ref2.id,
112
111
  itemText = _ref2.itemText,
@@ -72,8 +72,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
72
72
  }, [actionState]);
73
73
  useEffect(function () {
74
74
  if (initialState !== null && initialState !== void 0 && initialState.enabledDefault) {
75
- setRootState === null || setRootState === void 0 || setRootState(initialConditionState.current);
76
- initialConditionState.current = null;
75
+ setRootState === null || setRootState === void 0 || setRootState(initialState.state);
77
76
  }
78
77
  // eslint-disable-next-line react-hooks/exhaustive-deps
79
78
  }, [initialState]);
@@ -92,11 +91,16 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
92
91
  };
93
92
  var _onRemove = useCallback(function (groupId) {
94
93
  var _rootState$groups2;
94
+ var groups = rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.filter(function (group) {
95
+ return groupId !== (group === null || group === void 0 ? void 0 : group.id);
96
+ });
95
97
  setRootState === null || setRootState === void 0 || setRootState(_objectSpread2(_objectSpread2({}, rootState), {}, {
96
- groups: rootState ? rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.filter(function (group) {
97
- return groupId !== (group === null || group === void 0 ? void 0 : group.id);
98
- }) : []
98
+ groups: rootState ? groups : []
99
99
  }));
100
+ //set the initial state to empty.
101
+ if ((groups === null || groups === void 0 ? void 0 : groups.length) === 0) {
102
+ initialConditionState.current = null;
103
+ }
100
104
  }, [setRootState, rootState]);
101
105
  var onChangeHandler = function onChangeHandler(updatedGroup, groupIndex) {
102
106
  /**
@@ -66,7 +66,8 @@ export interface ProductiveCardProps extends PropsWithChildren {
66
66
  */
67
67
  overflowActions?: overflowAction[];
68
68
  /**
69
- * Aria label prop required for OverflowMenu
69
+ * Sets the text for the OverflowMenu aria label and the OverflowMenu trigger button tooltip.
70
+ * Overrides `iconDescription` prop.
70
71
  */
71
72
  overflowAriaLabel?: string;
72
73
  /**
@@ -120,7 +121,10 @@ export interface ProductiveCardProps extends PropsWithChildren {
120
121
  */
121
122
  titleSize?: 'default' | 'large';
122
123
  /**
123
- * Tooltip icon description
124
+ * Sets the text for the OverflowMenu trigger button tooltip and OverflowMenu aria label,
125
+ * gets overridden by the `overflowAriaLabel` prop.
126
+ *
127
+ * @deprecated Please use the `overflowAriaLabel` prop instead.
124
128
  */
125
129
  iconDescription?: string;
126
130
  }
@@ -13,16 +13,14 @@ import { pkg } from '../../settings.js';
13
13
  import { prepareProps } from '../../global/js/utils/props-helper.js';
14
14
  import { Card } from '../Card/Card.js';
15
15
 
16
- var _excluded = ["actionsPlacement", "iconDescription"];
16
+ var _excluded = ["actionsPlacement"];
17
17
  var componentName = 'ProductiveCard';
18
18
  var ProductiveCard = /*#__PURE__*/forwardRef(function (_ref, ref) {
19
19
  var _ref$actionsPlacement = _ref.actionsPlacement,
20
20
  actionsPlacement = _ref$actionsPlacement === void 0 ? 'top' : _ref$actionsPlacement,
21
- iconDescription = _ref.iconDescription,
22
21
  rest = _objectWithoutProperties(_ref, _excluded);
23
22
  var validProps = prepareProps(rest, ['media', 'mediaPosition', 'pictogram', 'primaryButtonClick', 'productive', 'secondaryButtonKind']);
24
23
  return /*#__PURE__*/React__default.createElement(Card, _extends({}, _objectSpread2(_objectSpread2({}, validProps), {}, {
25
- iconDescription: iconDescription,
26
24
  actionsPlacement: actionsPlacement,
27
25
  ref: ref,
28
26
  productive: true
@@ -69,7 +67,10 @@ ProductiveCard.propTypes = {
69
67
  */
70
68
  description: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.node]),
71
69
  /**
72
- * Tooltip icon description
70
+ * Sets the text for the OverflowMenu trigger button tooltip and OverflowMenu aria label,
71
+ * gets overridden by the `overflowAriaLabel` prop.
72
+ *
73
+ * @deprecated Please use the `overflowAriaLabel` prop instead.
73
74
  */
74
75
  iconDescription: PropTypes.string,
75
76
  /**
@@ -99,7 +100,8 @@ ProductiveCard.propTypes = {
99
100
  onKeyDown: PropTypes.func
100
101
  })),
101
102
  /**
102
- * Aria label prop required for OverflowMenu
103
+ * Sets the text for the OverflowMenu aria label and the OverflowMenu trigger button tooltip.
104
+ * Overrides `iconDescription` prop.
103
105
  */
104
106
  overflowAriaLabel: PropTypes.string,
105
107
  /**
@@ -18,7 +18,7 @@ var CardFooter = require('./CardFooter.js');
18
18
  var settings = require('../../settings.js');
19
19
 
20
20
  var _Incomplete, _CheckmarkOutline;
21
- var _excluded = ["actionIcons", "actionsPlacement", "decorator", "metadata", "children", "className", "clickZone", "description", "disabled", "footerActionIcon", "getStarted", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "overflowActions", "overflowAriaLabel", "onSecondaryButtonClick", "pictogram", "primaryButtonDisabled", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonDisabled", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonPlacement", "secondaryButtonText", "slug", "status", "sequence", "title", "titleSize", "iconDescription"],
21
+ var _excluded = ["actionIcons", "actionsPlacement", "decorator", "metadata", "children", "className", "clickZone", "description", "disabled", "footerActionIcon", "getStarted", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "onSecondaryButtonClick", "overflowActions", "overflowAriaLabel", "pictogram", "primaryButtonDisabled", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonDisabled", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonPlacement", "secondaryButtonText", "slug", "status", "sequence", "title", "titleSize", "iconDescription"],
22
22
  _excluded2 = ["id", "itemText"],
23
23
  _excluded3 = ["id", "icon", "onClick", "iconDescription", "href"];
24
24
  var componentName = 'Card';
@@ -45,10 +45,10 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
45
45
  onClick = _ref.onClick,
46
46
  onKeyDown = _ref.onKeyDown,
47
47
  onPrimaryButtonClick = _ref.onPrimaryButtonClick,
48
+ onSecondaryButtonClick = _ref.onSecondaryButtonClick,
48
49
  _ref$overflowActions = _ref.overflowActions,
49
50
  overflowActions = _ref$overflowActions === void 0 ? Object.freeze([]) : _ref$overflowActions,
50
51
  overflowAriaLabel = _ref.overflowAriaLabel,
51
- onSecondaryButtonClick = _ref.onSecondaryButtonClick,
52
52
  Pictogram = _ref.pictogram,
53
53
  primaryButtonDisabled = _ref.primaryButtonDisabled,
54
54
  primaryButtonHref = _ref.primaryButtonHref,
@@ -107,8 +107,7 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
107
107
  autoAlign: true,
108
108
  menuAlignment: pos,
109
109
  size: size,
110
- "aria-label": overflowAriaLabel,
111
- label: iconDescription
110
+ label: overflowAriaLabel || iconDescription
112
111
  }, overflowActions.map(function (_ref2) {
113
112
  var id = _ref2.id,
114
113
  itemText = _ref2.itemText,
@@ -76,8 +76,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
76
76
  }, [actionState]);
77
77
  React.useEffect(function () {
78
78
  if (initialState !== null && initialState !== void 0 && initialState.enabledDefault) {
79
- setRootState === null || setRootState === void 0 || setRootState(initialConditionState.current);
80
- initialConditionState.current = null;
79
+ setRootState === null || setRootState === void 0 || setRootState(initialState.state);
81
80
  }
82
81
  // eslint-disable-next-line react-hooks/exhaustive-deps
83
82
  }, [initialState]);
@@ -96,11 +95,16 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
96
95
  };
97
96
  var _onRemove = React.useCallback(function (groupId) {
98
97
  var _rootState$groups2;
98
+ var groups = rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.filter(function (group) {
99
+ return groupId !== (group === null || group === void 0 ? void 0 : group.id);
100
+ });
99
101
  setRootState === null || setRootState === void 0 || setRootState(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, rootState), {}, {
100
- groups: rootState ? rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.filter(function (group) {
101
- return groupId !== (group === null || group === void 0 ? void 0 : group.id);
102
- }) : []
102
+ groups: rootState ? groups : []
103
103
  }));
104
+ //set the initial state to empty.
105
+ if ((groups === null || groups === void 0 ? void 0 : groups.length) === 0) {
106
+ initialConditionState.current = null;
107
+ }
104
108
  }, [setRootState, rootState]);
105
109
  var onChangeHandler = function onChangeHandler(updatedGroup, groupIndex) {
106
110
  /**
@@ -66,7 +66,8 @@ export interface ProductiveCardProps extends PropsWithChildren {
66
66
  */
67
67
  overflowActions?: overflowAction[];
68
68
  /**
69
- * Aria label prop required for OverflowMenu
69
+ * Sets the text for the OverflowMenu aria label and the OverflowMenu trigger button tooltip.
70
+ * Overrides `iconDescription` prop.
70
71
  */
71
72
  overflowAriaLabel?: string;
72
73
  /**
@@ -120,7 +121,10 @@ export interface ProductiveCardProps extends PropsWithChildren {
120
121
  */
121
122
  titleSize?: 'default' | 'large';
122
123
  /**
123
- * Tooltip icon description
124
+ * Sets the text for the OverflowMenu trigger button tooltip and OverflowMenu aria label,
125
+ * gets overridden by the `overflowAriaLabel` prop.
126
+ *
127
+ * @deprecated Please use the `overflowAriaLabel` prop instead.
124
128
  */
125
129
  iconDescription?: string;
126
130
  }
@@ -15,16 +15,14 @@ var settings = require('../../settings.js');
15
15
  var propsHelper = require('../../global/js/utils/props-helper.js');
16
16
  var Card = require('../Card/Card.js');
17
17
 
18
- var _excluded = ["actionsPlacement", "iconDescription"];
18
+ var _excluded = ["actionsPlacement"];
19
19
  var componentName = 'ProductiveCard';
20
20
  exports.ProductiveCard = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
21
21
  var _ref$actionsPlacement = _ref.actionsPlacement,
22
22
  actionsPlacement = _ref$actionsPlacement === void 0 ? 'top' : _ref$actionsPlacement,
23
- iconDescription = _ref.iconDescription,
24
23
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
25
24
  var validProps = propsHelper.prepareProps(rest, ['media', 'mediaPosition', 'pictogram', 'primaryButtonClick', 'productive', 'secondaryButtonKind']);
26
25
  return /*#__PURE__*/React.createElement(Card.Card, _rollupPluginBabelHelpers.extends({}, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, validProps), {}, {
27
- iconDescription: iconDescription,
28
26
  actionsPlacement: actionsPlacement,
29
27
  ref: ref,
30
28
  productive: true
@@ -71,7 +69,10 @@ exports.ProductiveCard.propTypes = {
71
69
  */
72
70
  description: index.default.oneOfType([index.default.string, index.default.object, index.default.node]),
73
71
  /**
74
- * Tooltip icon description
72
+ * Sets the text for the OverflowMenu trigger button tooltip and OverflowMenu aria label,
73
+ * gets overridden by the `overflowAriaLabel` prop.
74
+ *
75
+ * @deprecated Please use the `overflowAriaLabel` prop instead.
75
76
  */
76
77
  iconDescription: index.default.string,
77
78
  /**
@@ -101,7 +102,8 @@ exports.ProductiveCard.propTypes = {
101
102
  onKeyDown: index.default.func
102
103
  })),
103
104
  /**
104
- * Aria label prop required for OverflowMenu
105
+ * Sets the text for the OverflowMenu aria label and the OverflowMenu trigger button tooltip.
106
+ * Overrides `iconDescription` prop.
105
107
  */
106
108
  overflowAriaLabel: index.default.string,
107
109
  /**
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.54.0-canary.67+c6f0ac0f4",
4
+ "version": "2.54.0-canary.69+dd60a2e0e",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -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": "c6f0ac0f444165b55e37873c80462401fd34f14f"
123
+ "gitHead": "dd60a2e0e8551c8c1a4992fec7dc7c7f26ff6d53"
124
124
  }