@carbon/ibm-products 2.54.0-canary.33 → 2.54.0-canary.36

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.
@@ -8,7 +8,7 @@ import React, { Dispatch, PropsWithChildren, ReactNode, SetStateAction } from 'r
8
8
  import { ExperimentalSecondarySubmit } from './CreateTearsheetStep';
9
9
  export interface StepsContextType {
10
10
  currentStep: number;
11
- setExperimentalSecondarySubmit: Dispatch<SetStateAction<ExperimentalSecondarySubmit>>;
11
+ setExperimentalSecondarySubmit: Dispatch<SetStateAction<ExperimentalSecondarySubmit | undefined>>;
12
12
  setIsDisabled: Dispatch<SetStateAction<boolean>>;
13
13
  setOnPrevious: (fn: any) => void;
14
14
  setOnNext: (fn: any) => void;
@@ -105,7 +105,7 @@ var CreateTearsheet = /*#__PURE__*/forwardRef(function (_ref, ref) {
105
105
  _useState24 = _slicedToArray(_useState23, 2),
106
106
  lastIncludedStep = _useState24[0],
107
107
  setLastIncludedStep = _useState24[1];
108
- var _useState25 = useState({}),
108
+ var _useState25 = useState(),
109
109
  _useState26 = _slicedToArray(_useState25, 2),
110
110
  experimentalSecondarySubmit = _useState26[0],
111
111
  setExperimentalSecondarySubmit = _useState26[1];
@@ -176,7 +176,7 @@ var CreateTearsheet = /*#__PURE__*/forwardRef(function (_ref, ref) {
176
176
  isSubmitting: isSubmitting,
177
177
  componentBlockClass: blockClass,
178
178
  experimentalSecondarySubmit: experimentalSecondarySubmit,
179
- experimentalSecondarySubmitText: experimentalSecondarySubmit.labelText ? experimentalSecondarySubmit.labelText : experimentalSecondarySubmitText,
179
+ experimentalSecondarySubmitText: experimentalSecondarySubmit !== null && experimentalSecondarySubmit !== void 0 && experimentalSecondarySubmit.labelText ? experimentalSecondarySubmit.labelText : experimentalSecondarySubmitText,
180
180
  setCreateComponentActions: setCreateTearsheetActions
181
181
  });
182
182
  return /*#__PURE__*/React__default.createElement(TearsheetShell, _extends({}, getDevtoolsProps(componentName), rest, {
@@ -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, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default, { forwardRef, useRef, useContext, useState, useEffect, isValidElement } from 'react';
10
10
  import PropTypes from '../../_virtual/index.js';
11
11
  import cx from 'classnames';
@@ -82,7 +82,7 @@ var CreateTearsheetStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
82
82
  useEffect(function () {
83
83
  if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep) && (previousState === null || previousState === void 0 ? void 0 : previousState.currentStep) !== (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
84
84
  stepsContext === null || stepsContext === void 0 || stepsContext.setOnMount(onMount);
85
- stepsContext === null || stepsContext === void 0 || stepsContext.setExperimentalSecondarySubmit(_objectSpread2({}, experimentalSecondarySubmit));
85
+ stepsContext === null || stepsContext === void 0 || stepsContext.setExperimentalSecondarySubmit(experimentalSecondarySubmit);
86
86
  }
87
87
  }, [onMount, experimentalSecondarySubmit, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]);
88
88
 
@@ -118,8 +118,11 @@ var CreateTearsheetStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
118
118
  stepsContext.setIsDisabled(!!disableSubmit);
119
119
  stepsContext === null || stepsContext === void 0 || stepsContext.setOnNext(onNext); // needs to be updated here otherwise there could be stale state values from only initially setting onNext
120
120
  stepsContext === null || stepsContext === void 0 || stepsContext.setOnPrevious(onPrevious);
121
+
122
+ //Handle props for experimentalSecondarySubmit button, depending on state change
123
+ stepsContext === null || stepsContext === void 0 || stepsContext.setExperimentalSecondarySubmit(experimentalSecondarySubmit);
121
124
  }
122
- }, [stepsContext, stepNumber, disableSubmit, onNext, onPrevious, stepRef, stepRefValue]);
125
+ }, [stepsContext, stepNumber, disableSubmit, onNext, onPrevious, stepRef, stepRefValue, experimentalSecondarySubmit]);
123
126
  var renderDescription = function renderDescription() {
124
127
  if (description) {
125
128
  if (typeof description === 'string') {
@@ -8,7 +8,7 @@ import React, { Dispatch, PropsWithChildren, ReactNode, SetStateAction } from 'r
8
8
  import { ExperimentalSecondarySubmit } from './CreateTearsheetStep';
9
9
  export interface StepsContextType {
10
10
  currentStep: number;
11
- setExperimentalSecondarySubmit: Dispatch<SetStateAction<ExperimentalSecondarySubmit>>;
11
+ setExperimentalSecondarySubmit: Dispatch<SetStateAction<ExperimentalSecondarySubmit | undefined>>;
12
12
  setIsDisabled: Dispatch<SetStateAction<boolean>>;
13
13
  setOnPrevious: (fn: any) => void;
14
14
  setOnNext: (fn: any) => void;
@@ -107,7 +107,7 @@ exports.CreateTearsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
107
107
  _useState24 = _rollupPluginBabelHelpers.slicedToArray(_useState23, 2),
108
108
  lastIncludedStep = _useState24[0],
109
109
  setLastIncludedStep = _useState24[1];
110
- var _useState25 = React.useState({}),
110
+ var _useState25 = React.useState(),
111
111
  _useState26 = _rollupPluginBabelHelpers.slicedToArray(_useState25, 2),
112
112
  experimentalSecondarySubmit = _useState26[0],
113
113
  setExperimentalSecondarySubmit = _useState26[1];
@@ -178,7 +178,7 @@ exports.CreateTearsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
178
178
  isSubmitting: isSubmitting,
179
179
  componentBlockClass: blockClass,
180
180
  experimentalSecondarySubmit: experimentalSecondarySubmit,
181
- experimentalSecondarySubmitText: experimentalSecondarySubmit.labelText ? experimentalSecondarySubmit.labelText : experimentalSecondarySubmitText,
181
+ experimentalSecondarySubmitText: experimentalSecondarySubmit !== null && experimentalSecondarySubmit !== void 0 && experimentalSecondarySubmit.labelText ? experimentalSecondarySubmit.labelText : experimentalSecondarySubmitText,
182
182
  setCreateComponentActions: setCreateTearsheetActions
183
183
  });
184
184
  return /*#__PURE__*/React.createElement(TearsheetShell.TearsheetShell, _rollupPluginBabelHelpers.extends({}, devtools.getDevtoolsProps(componentName), rest, {
@@ -84,7 +84,7 @@ exports.CreateTearsheetStep = /*#__PURE__*/React.forwardRef(function (_ref, ref)
84
84
  React.useEffect(function () {
85
85
  if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep) && (previousState === null || previousState === void 0 ? void 0 : previousState.currentStep) !== (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
86
86
  stepsContext === null || stepsContext === void 0 || stepsContext.setOnMount(onMount);
87
- stepsContext === null || stepsContext === void 0 || stepsContext.setExperimentalSecondarySubmit(_rollupPluginBabelHelpers.objectSpread2({}, experimentalSecondarySubmit));
87
+ stepsContext === null || stepsContext === void 0 || stepsContext.setExperimentalSecondarySubmit(experimentalSecondarySubmit);
88
88
  }
89
89
  }, [onMount, experimentalSecondarySubmit, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]);
90
90
 
@@ -120,8 +120,11 @@ exports.CreateTearsheetStep = /*#__PURE__*/React.forwardRef(function (_ref, ref)
120
120
  stepsContext.setIsDisabled(!!disableSubmit);
121
121
  stepsContext === null || stepsContext === void 0 || stepsContext.setOnNext(onNext); // needs to be updated here otherwise there could be stale state values from only initially setting onNext
122
122
  stepsContext === null || stepsContext === void 0 || stepsContext.setOnPrevious(onPrevious);
123
+
124
+ //Handle props for experimentalSecondarySubmit button, depending on state change
125
+ stepsContext === null || stepsContext === void 0 || stepsContext.setExperimentalSecondarySubmit(experimentalSecondarySubmit);
123
126
  }
124
- }, [stepsContext, stepNumber, disableSubmit, onNext, onPrevious, stepRef, stepRefValue]);
127
+ }, [stepsContext, stepNumber, disableSubmit, onNext, onPrevious, stepRef, stepRefValue, experimentalSecondarySubmit]);
125
128
  var renderDescription = function renderDescription() {
126
129
  if (description) {
127
130
  if (typeof description === 'string') {
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.33+48d5c34dc",
4
+ "version": "2.54.0-canary.36+1d049e04a",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -81,7 +81,7 @@
81
81
  "fs-extra": "^11.2.0",
82
82
  "glob": "^10.3.10",
83
83
  "jest": "^29.7.0",
84
- "jest-config-ibm-cloud-cognitive": "^1.13.0",
84
+ "jest-config-ibm-cloud-cognitive": "^1.14.0-rc.0",
85
85
  "jest-environment-jsdom": "^29.7.0",
86
86
  "namor": "^1.1.2",
87
87
  "npm-check-updates": "^16.14.12",
@@ -96,7 +96,7 @@
96
96
  "dependencies": {
97
97
  "@babel/runtime": "^7.23.9",
98
98
  "@carbon/feature-flags": "^0.24.0",
99
- "@carbon/ibm-products-styles": "^2.50.0",
99
+ "@carbon/ibm-products-styles": "^2.51.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": "48d5c34dca79a4b00fc69391a513431fa21295ee"
123
+ "gitHead": "1d049e04aef8410f4c5da8b2eb4fe84e15e1d1ce"
124
124
  }