@carbon/ibm-products 1.3.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. package/css/index-full-carbon.css +5102 -4711
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +9 -3
  4. package/css/index-full-carbon.min.css.map +1 -0
  5. package/css/index-without-carbon-released-only.css +189 -108
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +3 -3
  8. package/css/index-without-carbon-released-only.min.css.map +1 -0
  9. package/css/index-without-carbon.css +619 -236
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +9 -3
  12. package/css/index-without-carbon.min.css.map +1 -0
  13. package/css/index.css +950 -567
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +9 -3
  16. package/css/index.min.css.map +1 -0
  17. package/es/components/APIKeyModal/APIKeyModal.js +25 -29
  18. package/es/components/ActionBar/ActionBar.js +4 -1
  19. package/es/components/ActionSet/ActionSet.js +22 -10
  20. package/es/components/ActionSet/actions.js +25 -17
  21. package/es/components/AddSelect/AddSelect.js +141 -53
  22. package/es/components/AddSelect/AddSelectBreadcrumbs.js +56 -0
  23. package/es/components/AddSelect/AddSelectList.js +94 -0
  24. package/es/components/AddSelect/AddSelectSidebar.js +78 -0
  25. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +24 -17
  26. package/es/components/CancelableTextEdit/CancelableTextEdit.js +62 -24
  27. package/es/components/Card/Card.js +6 -4
  28. package/es/components/CreateFullPage/CreateFullPage.js +102 -258
  29. package/es/components/CreateFullPage/CreateFullPageStep.js +65 -13
  30. package/es/components/CreateFullPage/index.js +1 -2
  31. package/es/components/CreateInfluencer/CreateInfluencer.js +40 -220
  32. package/es/components/CreateTearsheet/CreateTearsheet.js +95 -146
  33. package/es/components/CreateTearsheet/CreateTearsheetStep.js +70 -20
  34. package/es/components/CreateTearsheet/index.js +0 -1
  35. package/es/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +87 -28
  36. package/es/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +8 -6
  37. package/es/components/EmptyStates/EmptyState.js +1 -1
  38. package/es/components/EmptyStates/EmptyStateContent.js +2 -2
  39. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -1
  40. package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -1
  41. package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -1
  42. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -1
  43. package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -1
  44. package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -1
  45. package/es/components/ExportModal/ExportModal.js +41 -12
  46. package/es/components/ImportModal/ImportModal.js +2 -1
  47. package/es/components/InlineEdit/InlineEdit.js +397 -0
  48. package/es/components/InlineEdit/index.js +7 -0
  49. package/es/components/MultiAddSelect/MultiAddSelect.js +16 -0
  50. package/es/components/MultiAddSelect/index.js +1 -0
  51. package/es/components/NotificationsPanel/NotificationsPanel.js +16 -3
  52. package/es/components/OptionsTile/OptionsTile.js +36 -15
  53. package/es/components/PageHeader/PageHeader.js +59 -35
  54. package/es/components/PageHeader/PageHeaderTitle.js +82 -7
  55. package/es/components/PageHeader/PageHeaderUtils.js +21 -2
  56. package/es/components/RemoveModal/RemoveModal.js +4 -2
  57. package/es/components/SidePanel/SidePanel.js +33 -16
  58. package/es/components/SingleAddSelect/SingleAddSelect.js +15 -0
  59. package/es/components/SingleAddSelect/index.js +1 -0
  60. package/es/components/TagSet/TagSet.js +4 -1
  61. package/es/components/Tearsheet/Tearsheet.js +1 -1
  62. package/es/components/Tearsheet/TearsheetNarrow.js +1 -1
  63. package/es/components/Tearsheet/TearsheetShell.js +1 -1
  64. package/es/components/Toolbar/Toolbar.js +69 -8
  65. package/es/components/WebTerminal/WebTerminal.js +1 -1
  66. package/es/components/index.js +4 -2
  67. package/es/global/js/hooks/index.js +1 -0
  68. package/es/global/js/hooks/useCreateComponentFocus.js +15 -19
  69. package/es/global/js/hooks/useCreateComponentStepChange.js +69 -79
  70. package/es/global/js/hooks/useResetCreateComponent.js +7 -4
  71. package/es/global/js/hooks/useRetrieveStepData.js +51 -0
  72. package/es/global/js/hooks/useValidCreateStepCount.js +4 -7
  73. package/es/global/js/package-settings.js +4 -2
  74. package/es/global/js/utils/lastIndexInArray.js +26 -0
  75. package/es/settings.js +0 -5
  76. package/lib/components/APIKeyModal/APIKeyModal.js +25 -29
  77. package/lib/components/ActionBar/ActionBar.js +4 -1
  78. package/lib/components/ActionSet/ActionSet.js +22 -10
  79. package/lib/components/ActionSet/actions.js +25 -17
  80. package/lib/components/AddSelect/AddSelect.js +141 -50
  81. package/lib/components/AddSelect/AddSelectBreadcrumbs.js +71 -0
  82. package/lib/components/AddSelect/AddSelectList.js +112 -0
  83. package/lib/components/AddSelect/AddSelectSidebar.js +89 -0
  84. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +23 -16
  85. package/lib/components/CancelableTextEdit/CancelableTextEdit.js +62 -23
  86. package/lib/components/Card/Card.js +6 -4
  87. package/lib/components/CreateFullPage/CreateFullPage.js +102 -258
  88. package/lib/components/CreateFullPage/CreateFullPageStep.js +68 -13
  89. package/lib/components/CreateFullPage/index.js +1 -9
  90. package/lib/components/CreateInfluencer/CreateInfluencer.js +38 -231
  91. package/lib/components/CreateTearsheet/CreateTearsheet.js +97 -148
  92. package/lib/components/CreateTearsheet/CreateTearsheetStep.js +72 -19
  93. package/lib/components/CreateTearsheet/index.js +0 -8
  94. package/lib/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +86 -34
  95. package/lib/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +8 -6
  96. package/lib/components/EmptyStates/EmptyState.js +1 -1
  97. package/lib/components/EmptyStates/EmptyStateContent.js +2 -2
  98. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -1
  99. package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -1
  100. package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -1
  101. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -1
  102. package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -1
  103. package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -1
  104. package/lib/components/ExportModal/ExportModal.js +38 -11
  105. package/lib/components/ImportModal/ImportModal.js +2 -1
  106. package/lib/components/InlineEdit/InlineEdit.js +413 -0
  107. package/lib/components/InlineEdit/index.js +13 -0
  108. package/lib/components/MultiAddSelect/MultiAddSelect.js +37 -0
  109. package/lib/components/MultiAddSelect/index.js +13 -0
  110. package/lib/components/NotificationsPanel/NotificationsPanel.js +13 -1
  111. package/lib/components/OptionsTile/OptionsTile.js +36 -15
  112. package/lib/components/PageHeader/PageHeader.js +59 -35
  113. package/lib/components/PageHeader/PageHeaderTitle.js +91 -9
  114. package/lib/components/PageHeader/PageHeaderUtils.js +21 -2
  115. package/lib/components/RemoveModal/RemoveModal.js +4 -2
  116. package/lib/components/SidePanel/SidePanel.js +33 -16
  117. package/lib/components/SingleAddSelect/SingleAddSelect.js +36 -0
  118. package/lib/components/SingleAddSelect/index.js +13 -0
  119. package/lib/components/TagSet/TagSet.js +4 -1
  120. package/lib/components/Tearsheet/Tearsheet.js +1 -1
  121. package/lib/components/Tearsheet/TearsheetNarrow.js +1 -1
  122. package/lib/components/Tearsheet/TearsheetShell.js +1 -1
  123. package/lib/components/Toolbar/Toolbar.js +69 -6
  124. package/lib/components/WebTerminal/WebTerminal.js +1 -1
  125. package/lib/components/index.js +25 -9
  126. package/lib/global/js/hooks/index.js +8 -0
  127. package/lib/global/js/hooks/useCreateComponentFocus.js +15 -19
  128. package/lib/global/js/hooks/useCreateComponentStepChange.js +69 -79
  129. package/lib/global/js/hooks/useResetCreateComponent.js +7 -4
  130. package/lib/global/js/hooks/useRetrieveStepData.js +62 -0
  131. package/lib/global/js/hooks/useValidCreateStepCount.js +4 -7
  132. package/lib/global/js/package-settings.js +4 -2
  133. package/lib/global/js/utils/lastIndexInArray.js +35 -0
  134. package/lib/settings.js +0 -6
  135. package/package.json +24 -24
  136. package/scss/components/AddSelect/_add-select.scss +53 -8
  137. package/scss/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +19 -15
  138. package/scss/components/BreadcrumbWithOverflow/_index.scss +1 -1
  139. package/scss/components/CancelableTextEdit/_cancelable-text-edit.scss +142 -70
  140. package/scss/components/CancelableTextEdit/_storybook-styles.scss +0 -7
  141. package/scss/components/CreateFullPage/_create-full-page.scss +4 -11
  142. package/scss/components/CreateInfluencer/_create-influencer.scss +4 -4
  143. package/scss/components/CreateTearsheet/_create-tearsheet.scss +6 -10
  144. package/scss/components/CreateTearsheetNarrow/_storybook-styles.scss +0 -6
  145. package/scss/components/EditSidePanel/_storybook-styles.scss +0 -8
  146. package/scss/components/InlineEdit/_index.scss +8 -0
  147. package/scss/components/InlineEdit/_inline-edit.scss +320 -0
  148. package/scss/components/InlineEdit/_storybook-styles.scss +21 -0
  149. package/scss/components/LoadingBar/_storybook-styles.scss +0 -5
  150. package/scss/components/MultiAddSelect/_index.scss +1 -0
  151. package/scss/components/MultiAddSelect/_multi-add-select.scss +1 -0
  152. package/scss/components/MultiAddSelect/_storybook-styles.scss +6 -0
  153. package/scss/components/NotificationsPanel/_notifications-panel.scss +2 -2
  154. package/scss/components/OptionsTile/_storybook-styles.scss +0 -7
  155. package/scss/components/PageHeader/_index.scss +1 -1
  156. package/scss/components/PageHeader/_page-header.scss +18 -5
  157. package/scss/components/ProductiveCard/_productive-card.scss +0 -4
  158. package/scss/components/SidePanel/_side-panel.scss +15 -6
  159. package/scss/components/SingleAddSelect/_index.scss +1 -0
  160. package/scss/components/SingleAddSelect/_single-add-select.scss +1 -0
  161. package/scss/components/SingleAddSelect/_storybook-styles.scss +6 -0
  162. package/scss/components/StatusIcon/_index.scss +1 -1
  163. package/scss/components/StatusIcon/_status-icon.scss +6 -4
  164. package/scss/components/TagSet/_index.scss +1 -1
  165. package/scss/components/UserProfileImage/_index.scss +1 -1
  166. package/scss/components/UserProfileImage/_user-profile-image.scss +2 -2
  167. package/scss/components/WebTerminal/_web-terminal.scss +2 -2
  168. package/scss/components/_index.scss +3 -1
  169. package/scss/global/styles/_project-settings.scss +5 -1
  170. package/es/components/CreateFullPage/CreateFullPageSection.js +0 -53
  171. package/es/components/CreateFullPage/constants.js +0 -8
  172. package/es/components/CreateTearsheet/CreateTearsheetSection.js +0 -83
  173. package/es/components/CreateTearsheet/constants.js +0 -8
  174. package/es/components/CreateTearsheet/preview-components/MultiStepWithSectionsTearsheet.js +0 -327
  175. package/es/generated/feature-flags/feature-flags.js +0 -15
  176. package/es/global/js/utils/hasValidType.js +0 -94
  177. package/lib/components/CreateFullPage/CreateFullPageSection.js +0 -74
  178. package/lib/components/CreateFullPage/constants.js +0 -16
  179. package/lib/components/CreateTearsheet/CreateTearsheetSection.js +0 -105
  180. package/lib/components/CreateTearsheet/constants.js +0 -17
  181. package/lib/components/CreateTearsheet/preview-components/MultiStepWithSectionsTearsheet.js +0 -354
  182. package/lib/generated/feature-flags/feature-flags.js +0 -22
  183. package/lib/global/js/utils/hasValidType.js +0 -110
  184. package/scss/generated/feature-flags/_feature-flags.scss +0 -19
@@ -1,44 +1,94 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+
1
4
  /**
2
- * Copyright IBM Corp. 2021, 2021
5
+ * Copyright IBM Corp. 2021, 2022
3
6
  *
4
7
  * This source code is licensed under the Apache-2.0 license found in the
5
8
  * LICENSE file in the root directory of this source tree.
6
9
  */
7
- import React, { forwardRef } from 'react';
10
+ import React, { forwardRef, useContext, useEffect, useState } from 'react';
8
11
  import PropTypes from 'prop-types';
9
12
  import cx from 'classnames';
10
13
  import { Column, FormGroup, Row } from 'carbon-components-react';
14
+ import { StepsContext, StepNumberContext } from './CreateTearsheet';
11
15
  import { pkg } from '../../settings';
12
- import { CREATE_TEARSHEET_STEP } from './constants';
16
+ import pconsole from '../../global/js/utils/pconsole';
17
+ import { usePreviousValue, useRetrieveStepData } from '../../global/js/hooks';
13
18
  var componentName = 'CreateTearsheetStep';
14
19
  var blockClass = "".concat(pkg.prefix, "--tearsheet-create__step");
15
20
  export var CreateTearsheetStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
21
+ var _cx;
22
+
16
23
  var children = _ref.children,
17
24
  className = _ref.className,
18
- subtitle = _ref.subtitle,
19
25
  description = _ref.description,
20
- title = _ref.title,
21
- hasFieldset = _ref.hasFieldset,
26
+ disableSubmit = _ref.disableSubmit,
22
27
  fieldsetLegendText = _ref.fieldsetLegendText,
23
- isViewingAllStepsTogether = _ref.isViewingAllStepsTogether;
24
- return /*#__PURE__*/React.createElement("div", {
25
- className: cx(blockClass, className),
28
+ hasFieldset = _ref.hasFieldset,
29
+ includeStep = _ref.includeStep,
30
+ introStep = _ref.introStep,
31
+ onNext = _ref.onNext,
32
+ onMount = _ref.onMount,
33
+ secondaryLabel = _ref.secondaryLabel,
34
+ subtitle = _ref.subtitle,
35
+ title = _ref.title;
36
+ var stepsContext = useContext(StepsContext);
37
+ var stepNumber = useContext(StepNumberContext);
38
+
39
+ var _useState = useState(),
40
+ _useState2 = _slicedToArray(_useState, 2),
41
+ shouldIncludeStep = _useState2[0],
42
+ setShouldIncludeStep = _useState2[1];
43
+
44
+ var previousState = usePreviousValue({
45
+ currentStep: stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep
46
+ });
47
+ useRetrieveStepData({
48
+ stepsContext: stepsContext,
49
+ stepNumber: stepNumber,
50
+ introStep: introStep,
51
+ shouldIncludeStep: shouldIncludeStep,
52
+ secondaryLabel: secondaryLabel,
53
+ title: title
54
+ }); // This useEffect reports back the onNext and onMount values so that they can be used
55
+ // in the appropriate custom hooks.
56
+
57
+ useEffect(function () {
58
+ 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)) {
59
+ stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnNext(onNext);
60
+ stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnMount(onMount);
61
+ }
62
+ }, [onMount, onNext, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]); // Used to take the `includeStep` prop and use it as a local state value
63
+
64
+ useEffect(function () {
65
+ setShouldIncludeStep(includeStep);
66
+ }, [includeStep, stepsContext, title]); // Whenever we are the current step, supply our disableSubmit value to the
67
+ // steps container context so that it can manage the 'Next' button appropriately.
68
+
69
+ useEffect(function () {
70
+ if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
71
+ stepsContext.setIsDisabled(disableSubmit);
72
+ }
73
+ }, [stepsContext, stepNumber, disableSubmit, onNext]);
74
+ return stepsContext ? /*#__PURE__*/React.createElement("div", {
75
+ className: cx(blockClass, className, (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__step--hidden-step"), stepNumber !== (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)), _defineProperty(_cx, "".concat(blockClass, "__step--visible-step"), stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)), _cx)),
26
76
  ref: ref
27
77
  }, /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Column, {
28
78
  xlg: 12,
29
79
  lg: 12,
30
80
  md: 8,
31
81
  sm: 8
32
- }, !isViewingAllStepsTogether && /*#__PURE__*/React.createElement("h4", {
82
+ }, /*#__PURE__*/React.createElement("h4", {
33
83
  className: "".concat(blockClass, "--title")
34
- }, title), !isViewingAllStepsTogether && subtitle && /*#__PURE__*/React.createElement("h6", {
84
+ }, title), subtitle && /*#__PURE__*/React.createElement("h6", {
35
85
  className: "".concat(blockClass, "--subtitle")
36
- }, subtitle), !isViewingAllStepsTogether && description && /*#__PURE__*/React.createElement("p", {
86
+ }, subtitle), description && /*#__PURE__*/React.createElement("p", {
37
87
  className: "".concat(blockClass, "--description")
38
88
  }, description))), hasFieldset ? /*#__PURE__*/React.createElement(FormGroup, {
39
89
  legendText: fieldsetLegendText,
40
90
  className: "".concat(blockClass, "--fieldset")
41
- }, children) : children);
91
+ }, children) : children) : pconsole.warn("You have tried using a ".concat(componentName, " component outside of a CreateTearsheet. This is not allowed. ").concat(componentName, "s should always be children of the CreateTearsheet"));
42
92
  }); // Return a placeholder if not released and not enabled by feature flag
43
93
 
44
94
  CreateTearsheetStep = pkg.checkComponentEnabled(CreateTearsheetStep, componentName);
@@ -81,15 +131,15 @@ CreateTearsheetStep.propTypes = {
81
131
  hasFieldset: PropTypes.bool,
82
132
 
83
133
  /**
84
- * This prop can be used on the first step to mark it as an intro step, which will not render the progress indicator steps
134
+ * This prop is used to help track dynamic steps. If this value is `false` then the step is not included in the visible steps or the ProgressIndicator
135
+ * steps. If this value is `true` then the step will be included in the list of visible steps, as well as being included in the ProgressIndicator step list
85
136
  */
86
- introStep: PropTypes.bool,
137
+ includeStep: PropTypes.bool,
87
138
 
88
139
  /**
89
- * @ignore
90
- * The is an internal prop set in CreateTearsheet so the step knows when to render it's title
140
+ * This prop can be used on the first step to mark it as an intro step, which will not render the progress indicator steps
91
141
  */
92
- isViewingAllStepsTogether: PropTypes.bool,
142
+ introStep: PropTypes.bool,
93
143
 
94
144
  /**
95
145
  * Optional function to be called on initial mount of a step.
@@ -124,6 +174,6 @@ CreateTearsheetStep.propTypes = {
124
174
  // component needs to make a choice or assumption when a prop is not supplied.
125
175
 
126
176
  CreateTearsheetStep.defaultProps = {
127
- type: CREATE_TEARSHEET_STEP,
128
- hasFieldset: true
177
+ hasFieldset: true,
178
+ includeStep: true
129
179
  };
@@ -6,5 +6,4 @@
6
6
  */
7
7
  export { CreateTearsheet } from './CreateTearsheet';
8
8
  export { CreateTearsheetStep } from './CreateTearsheetStep';
9
- export { CreateTearsheetSection } from './CreateTearsheetSection';
10
9
  export { CreateTearsheetDivider } from './CreateTearsheetDivider';
@@ -1,30 +1,57 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["value1", "setValue1"];
2
5
 
3
6
  /* eslint-disable react/prop-types */
4
7
 
5
8
  /**
6
- * Copyright IBM Corp. 2021, 2021
9
+ * Copyright IBM Corp. 2021, 2022
7
10
  *
8
11
  * This source code is licensed under the Apache-2.0 license found in the
9
12
  * LICENSE file in the root directory of this source tree.
10
13
  */
11
14
  import React, { useState } from 'react';
12
- import { Button, Column, InlineNotification, RadioButtonGroup, RadioButton, Row, TextInput, Toggle, NumberInput } from 'carbon-components-react';
15
+ import { Button, Column, InlineNotification, RadioButtonGroup, RadioButton, Row, TextInput, Toggle, NumberInput, Checkbox } from 'carbon-components-react';
13
16
  import cx from 'classnames';
14
17
  import { pkg } from '../../../settings';
15
18
  import { CreateTearsheet } from '../CreateTearsheet';
16
19
  import { CreateTearsheetStep } from '../CreateTearsheetStep';
17
20
  var blockClass = "".concat(pkg.prefix, "--tearsheet-create-multi-step");
18
- export var MultiStepTearsheet = function MultiStepTearsheet(_ref) {
19
- var backButtonText = _ref.backButtonText,
20
- cancelButtonText = _ref.cancelButtonText,
21
- className = _ref.className,
22
- description = _ref.description,
23
- influencerWidth = _ref.influencerWidth,
24
- label = _ref.label,
25
- nextButtonText = _ref.nextButtonText,
26
- submitButtonText = _ref.submitButtonText,
27
- title = _ref.title;
21
+
22
+ var CustomStep = function CustomStep(_ref) {
23
+ var value1 = _ref.value1,
24
+ setValue1 = _ref.setValue1,
25
+ rest = _objectWithoutProperties(_ref, _excluded);
26
+
27
+ return /*#__PURE__*/React.createElement(CreateTearsheetStep, _extends({}, rest, {
28
+ disableSubmit: !value1
29
+ }), /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Column, {
30
+ xlg: 8,
31
+ lg: 8,
32
+ md: 8,
33
+ sm: 8
34
+ }, /*#__PURE__*/React.createElement(TextInput, {
35
+ value: value1,
36
+ onChange: function onChange(event) {
37
+ return setValue1(event.target.value);
38
+ },
39
+ id: "custom-step-input",
40
+ labelText: "Location",
41
+ placeholder: "Enter location"
42
+ }))));
43
+ };
44
+
45
+ export var MultiStepTearsheet = function MultiStepTearsheet(_ref2) {
46
+ var backButtonText = _ref2.backButtonText,
47
+ cancelButtonText = _ref2.cancelButtonText,
48
+ className = _ref2.className,
49
+ description = _ref2.description,
50
+ influencerWidth = _ref2.influencerWidth,
51
+ label = _ref2.label,
52
+ nextButtonText = _ref2.nextButtonText,
53
+ submitButtonText = _ref2.submitButtonText,
54
+ title = _ref2.title;
28
55
 
29
56
  var _useState = useState(750),
30
57
  _useState2 = _slicedToArray(_useState, 1),
@@ -47,33 +74,43 @@ export var MultiStepTearsheet = function MultiStepTearsheet(_ref) {
47
74
 
48
75
  var _useState9 = useState(''),
49
76
  _useState10 = _slicedToArray(_useState9, 2),
50
- stepOneTextInputValue = _useState10[0],
51
- setStepOneTextInputValue = _useState10[1];
77
+ value1 = _useState10[0],
78
+ setValue1 = _useState10[1];
52
79
 
53
80
  var _useState11 = useState(''),
54
81
  _useState12 = _slicedToArray(_useState11, 2),
55
- topicDescriptionValue = _useState12[0],
56
- setTopicDescriptionValue = _useState12[1];
82
+ stepOneTextInputValue = _useState12[0],
83
+ setStepOneTextInputValue = _useState12[1];
57
84
 
58
85
  var _useState13 = useState(''),
59
86
  _useState14 = _slicedToArray(_useState13, 2),
60
- topicVersionValue = _useState14[0],
61
- setTopicVersionValue = _useState14[1];
87
+ topicDescriptionValue = _useState14[0],
88
+ setTopicDescriptionValue = _useState14[1];
62
89
 
63
- var _useState15 = useState(1),
90
+ var _useState15 = useState(''),
64
91
  _useState16 = _slicedToArray(_useState15, 2),
65
- stepTwoTextInputValue = _useState16[0],
66
- setStepTwoTextInputValue = _useState16[1];
92
+ topicVersionValue = _useState16[0],
93
+ setTopicVersionValue = _useState16[1];
67
94
 
68
- var _useState17 = useState('one-day'),
95
+ var _useState17 = useState(1),
69
96
  _useState18 = _slicedToArray(_useState17, 2),
70
- stepThreeTextInputValue = _useState18[0],
71
- setStepThreeTextInputValue = _useState18[1];
97
+ stepTwoTextInputValue = _useState18[0],
98
+ setStepTwoTextInputValue = _useState18[1];
72
99
 
73
- var _useState19 = useState(false),
100
+ var _useState19 = useState('one-day'),
74
101
  _useState20 = _slicedToArray(_useState19, 2),
75
- isInvalid = _useState20[0],
76
- setIsInvalid = _useState20[1];
102
+ stepThreeTextInputValue = _useState20[0],
103
+ setStepThreeTextInputValue = _useState20[1];
104
+
105
+ var _useState21 = useState(false),
106
+ _useState22 = _slicedToArray(_useState21, 2),
107
+ isInvalid = _useState22[0],
108
+ setIsInvalid = _useState22[1];
109
+
110
+ var _useState23 = useState(false),
111
+ _useState24 = _slicedToArray(_useState23, 2),
112
+ shouldIncludeAdditionalStep = _useState24[0],
113
+ setShouldIncludeAdditionalStep = _useState24[1];
77
114
 
78
115
  var clearCreateData = function clearCreateData() {
79
116
  setStepOneTextInputValue('');
@@ -84,6 +121,8 @@ export var MultiStepTearsheet = function MultiStepTearsheet(_ref) {
84
121
  setHasSubmitError(false);
85
122
  setIsInvalid(false);
86
123
  setOpen(false);
124
+ setValue1('');
125
+ setShouldIncludeAdditionalStep(false);
87
126
  };
88
127
 
89
128
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("style", null, ".".concat(blockClass, " { opacity: 0 }"), ";"), /*#__PURE__*/React.createElement(Button, {
@@ -138,9 +177,9 @@ export var MultiStepTearsheet = function MultiStepTearsheet(_ref) {
138
177
  sm: 8
139
178
  }, /*#__PURE__*/React.createElement(TextInput, {
140
179
  labelText: "Topic name",
180
+ placeholder: "Enter topic name",
141
181
  id: "tearsheet-multi-step-story-text-input-multi-step-1",
142
182
  value: stepOneTextInputValue,
143
- placeholder: "Enter topic name",
144
183
  onChange: function onChange(event) {
145
184
  if (event.target.value.length) {
146
185
  setIsInvalid(false);
@@ -186,7 +225,27 @@ export var MultiStepTearsheet = function MultiStepTearsheet(_ref) {
186
225
  onToggle: function onToggle(event) {
187
226
  return setShouldReject(event);
188
227
  }
228
+ }), /*#__PURE__*/React.createElement(Checkbox, {
229
+ labelText: "Include additional step",
230
+ id: "include-additional-step-checkbox",
231
+ onChange: function onChange(value) {
232
+ return setShouldIncludeAdditionalStep(value);
233
+ },
234
+ checked: shouldIncludeAdditionalStep
189
235
  })))), /*#__PURE__*/React.createElement(CreateTearsheetStep, {
236
+ title: "Dynamic step",
237
+ subtitle: "Dynamic step subtitle",
238
+ description: "This is an example showing how to include a dynamic step into the CreateTearsheet",
239
+ hasFieldset: false,
240
+ includeStep: shouldIncludeAdditionalStep
241
+ }, "dynamic step content"), /*#__PURE__*/React.createElement(CustomStep, {
242
+ title: "Location",
243
+ subtitle: "Custom step subtitle",
244
+ description: "Custom step description (see storybook implementation for new custom step capability)",
245
+ value1: value1,
246
+ setValue1: setValue1,
247
+ hasFieldset: false
248
+ }), /*#__PURE__*/React.createElement(CreateTearsheetStep, {
190
249
  title: "Partitions",
191
250
  disableSubmit: !stepTwoTextInputValue,
192
251
  subtitle: "One or more partitions make up a topic. A partition is an ordered list of messages.",
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  /* eslint-disable react/prop-types */
4
4
 
5
5
  /**
6
- * Copyright IBM Corp. 2021, 2021
6
+ * Copyright IBM Corp. 2021, 2022
7
7
  *
8
8
  * This source code is licensed under the Apache-2.0 license found in the
9
9
  * LICENSE file in the root directory of this source tree.
@@ -154,14 +154,16 @@ export var MultiStepWithIntro = function MultiStepWithIntro(_ref) {
154
154
  size: "lg"
155
155
  }), /*#__PURE__*/React.createElement("span", {
156
156
  className: "".concat(pkg.prefix, "--tearsheet-create-multi-step--custom-tile-label")
157
- }, "Plus")))), selectedCategory === 'plus' && /*#__PURE__*/React.createElement(CreateTearsheetStep, {
157
+ }, "Plus")))), /*#__PURE__*/React.createElement(CreateTearsheetStep, {
158
158
  title: "Conditional step",
159
159
  subtitle: "This step will only show for plus category creation flows",
160
- hasFieldset: false
161
- }, "conditional step content"), selectedCategory === 'standard' && /*#__PURE__*/React.createElement(CreateTearsheetStep, {
160
+ hasFieldset: false,
161
+ includeStep: selectedCategory === 'plus'
162
+ }, "This step will only show for plus create flows"), /*#__PURE__*/React.createElement(CreateTearsheetStep, {
162
163
  title: "Standard step only",
163
- hasFieldset: false
164
- }, "This step will only show for standard flows"), /*#__PURE__*/React.createElement(CreateTearsheetStep, {
164
+ hasFieldset: false,
165
+ includeStep: selectedCategory === 'standard'
166
+ }, "This step will only show for standard create flows"), /*#__PURE__*/React.createElement(CreateTearsheetStep, {
165
167
  onNext: function onNext() {
166
168
  return new Promise(function (resolve, reject) {
167
169
  setTimeout(function () {
@@ -107,7 +107,7 @@ EmptyState.propTypes = {
107
107
  /**
108
108
  * Empty state subtext
109
109
  */
110
- subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
110
+ subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
111
111
 
112
112
  /**
113
113
  * Empty state heading
@@ -30,7 +30,7 @@ export var EmptyStateContent = function EmptyStateContent(_ref) {
30
30
  title = _ref.title;
31
31
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", {
32
32
  className: cx("".concat(blockClass, "__header"), _defineProperty({}, "".concat(blockClass, "__header--small"), size === 'sm'))
33
- }, title), /*#__PURE__*/React.createElement("p", {
33
+ }, title), subtitle && /*#__PURE__*/React.createElement("p", {
34
34
  className: cx("".concat(blockClass, "__subtitle"), _defineProperty({}, "".concat(blockClass, "__subtitle--small"), size === 'sm'))
35
35
  }, subtitle), (action === null || action === void 0 ? void 0 : action.text) && (action === null || action === void 0 ? void 0 : action.onClick) && /*#__PURE__*/React.createElement(Button, _extends({}, action, {
36
36
  className: "".concat(blockClass, "__action-button"),
@@ -76,7 +76,7 @@ EmptyStateContent.propTypes = {
76
76
  /**
77
77
  * Empty state subtitle
78
78
  */
79
- subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
79
+ subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
80
80
 
81
81
  /**
82
82
  * Empty state title
@@ -99,7 +99,7 @@ ErrorEmptyState.propTypes = {
99
99
  /**
100
100
  * Empty state subtitle
101
101
  */
102
- subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
102
+ subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
103
103
 
104
104
  /**
105
105
  * Empty state title
@@ -99,7 +99,7 @@ NoDataEmptyState.propTypes = {
99
99
  /**
100
100
  * Empty state subtitle
101
101
  */
102
- subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
102
+ subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
103
103
 
104
104
  /**
105
105
  * Empty state title
@@ -99,7 +99,7 @@ NoTagsEmptyState.propTypes = {
99
99
  /**
100
100
  * Empty state subtitle
101
101
  */
102
- subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
102
+ subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
103
103
 
104
104
  /**
105
105
  * Empty state title
@@ -99,7 +99,7 @@ NotFoundEmptyState.propTypes = {
99
99
  /**
100
100
  * Empty state subtitle
101
101
  */
102
- subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
102
+ subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
103
103
 
104
104
  /**
105
105
  * Empty state title
@@ -99,7 +99,7 @@ NotificationsEmptyState.propTypes = {
99
99
  /**
100
100
  * Empty state subtitle
101
101
  */
102
- subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
102
+ subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
103
103
 
104
104
  /**
105
105
  * Empty state title
@@ -99,7 +99,7 @@ UnauthorizedEmptyState.propTypes = {
99
99
  /**
100
100
  * Empty state subtitle
101
101
  */
102
- subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
102
+ subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
103
103
 
104
104
  /**
105
105
  * Empty state title
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
- var _excluded = ["body", "className", "error", "errorMessage", "filename", "inputLabel", "invalidInputText", "loading", "loadingMessage", "onClose", "onRequestSubmit", "open", "preformattedExtensions", "preformattedExtensionsLabel", "primaryButtonText", "secondaryButtonText", "successMessage", "successful", "title", "validExtensions"];
5
+ var _excluded = ["body", "className", "error", "errorMessage", "filename", "hidePasswordLabel", "inputLabel", "inputType", "invalidInputText", "loading", "loadingMessage", "onClose", "onRequestSubmit", "open", "preformattedExtensions", "preformattedExtensionsLabel", "primaryButtonText", "secondaryButtonText", "showPasswordLabel", "successMessage", "successful", "title", "validExtensions"];
6
6
 
7
7
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
8
 
@@ -15,7 +15,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
15
15
  // LICENSE file in the root directory of this source tree.
16
16
  //
17
17
  import React, { useState, useRef, forwardRef } from 'react';
18
- import { Button, ComposedModal, ModalHeader, ModalFooter, ModalBody, TextInput, RadioButton, RadioButtonGroup, FormGroup, Loading } from 'carbon-components-react';
18
+ import { Button, ComposedModal, ModalHeader, ModalFooter, ModalBody, TextInput, RadioButton, RadioButtonGroup, FormGroup, Loading, PasswordInput } from 'carbon-components-react';
19
19
  import cx from 'classnames';
20
20
  import { ErrorFilled16, CheckmarkFilled16 } from '@carbon/icons-react';
21
21
  import PropTypes from 'prop-types';
@@ -31,7 +31,9 @@ export var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
31
31
  error = _ref.error,
32
32
  errorMessage = _ref.errorMessage,
33
33
  filename = _ref.filename,
34
+ hidePasswordLabel = _ref.hidePasswordLabel,
34
35
  inputLabel = _ref.inputLabel,
36
+ inputType = _ref.inputType,
35
37
  invalidInputText = _ref.invalidInputText,
36
38
  loading = _ref.loading,
37
39
  loadingMessage = _ref.loadingMessage,
@@ -42,6 +44,7 @@ export var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
42
44
  preformattedExtensionsLabel = _ref.preformattedExtensionsLabel,
43
45
  primaryButtonText = _ref.primaryButtonText,
44
46
  secondaryButtonText = _ref.secondaryButtonText,
47
+ showPasswordLabel = _ref.showPasswordLabel,
45
48
  successMessage = _ref.successMessage,
46
49
  successful = _ref.successful,
47
50
  title = _ref.title,
@@ -103,6 +106,17 @@ export var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
103
106
  var internalId = useRef(uuidv4());
104
107
  var primaryButtonDisabled = loading || !name || hasInvalidExtension();
105
108
  var submitted = loading || error || successful;
109
+
110
+ var commonInputProps = _defineProperty({
111
+ id: "text-input--".concat(internalId.current),
112
+ value: name,
113
+ onChange: onNameChangeHandler,
114
+ labelText: inputLabel,
115
+ invalid: hasInvalidExtension(),
116
+ invalidText: invalidInputText,
117
+ onBlur: onBlurHandler
118
+ }, 'data-modal-primary-focus', true);
119
+
106
120
  return /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, {
107
121
  className: cx(blockClass, className),
108
122
  "aria-label": title,
@@ -131,17 +145,16 @@ export var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
131
145
  key: o.extension,
132
146
  id: o.extension,
133
147
  value: o.extension,
134
- labelText: "".concat(o.extension, " (").concat(o.description, ")")
148
+ labelText: "".concat(o.extension, " (").concat(o.description, ")"),
149
+ "data-modal-primary-focus": true
135
150
  });
136
- }))) : /*#__PURE__*/React.createElement(TextInput, {
137
- id: "text-input--".concat(internalId.current),
138
- value: name,
139
- onChange: onNameChangeHandler,
140
- labelText: inputLabel,
141
- invalid: hasInvalidExtension(),
142
- invalidText: invalidInputText,
143
- onBlur: onBlurHandler
144
- })), /*#__PURE__*/React.createElement("div", {
151
+ }))) : /*#__PURE__*/React.createElement("div", {
152
+ className: "".concat(blockClass, "__input-container")
153
+ }, inputType === 'text' ? /*#__PURE__*/React.createElement(TextInput, commonInputProps) : /*#__PURE__*/React.createElement(PasswordInput, _extends({}, commonInputProps, {
154
+ showPasswordLabel: showPasswordLabel,
155
+ hidePasswordLabel: hidePasswordLabel,
156
+ tooltipPosition: "left"
157
+ })))), /*#__PURE__*/React.createElement("div", {
145
158
  className: "".concat(blockClass, "__messaging")
146
159
  }, loading && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Loading, {
147
160
  small: true,
@@ -191,11 +204,21 @@ ExportModal.propTypes = {
191
204
  */
192
205
  filename: PropTypes.string.isRequired,
193
206
 
207
+ /**
208
+ * label text that's displayed when hovering over visibility toggler to hide key
209
+ */
210
+ hidePasswordLabel: PropTypes.string,
211
+
194
212
  /**
195
213
  * label for the text input
196
214
  */
197
215
  inputLabel: PropTypes.string,
198
216
 
217
+ /**
218
+ * specify the type of text input
219
+ */
220
+ inputType: PropTypes.oneOf(['text', 'password']),
221
+
199
222
  /**
200
223
  * text for an invalid input
201
224
  */
@@ -249,6 +272,11 @@ ExportModal.propTypes = {
249
272
  */
250
273
  secondaryButtonText: PropTypes.string.isRequired,
251
274
 
275
+ /**
276
+ * label text that's displayed when hovering over visibility toggler to show key
277
+ */
278
+ showPasswordLabel: PropTypes.string,
279
+
252
280
  /**
253
281
  * messaging to display if the export was successful
254
282
  */
@@ -270,6 +298,7 @@ ExportModal.propTypes = {
270
298
  validExtensions: PropTypes.array
271
299
  };
272
300
  ExportModal.defaultProps = {
301
+ inputType: 'text',
273
302
  preformattedExtensions: [],
274
303
  validExtensions: []
275
304
  };
@@ -229,7 +229,8 @@ export var ImportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
229
229
  accept: accept,
230
230
  labelText: fileDropLabel,
231
231
  onAddFiles: onAddFile,
232
- disabled: hasFiles
232
+ disabled: hasFiles,
233
+ "data-modal-primary-focus": true
233
234
  }), inputLabel && /*#__PURE__*/React.createElement("p", {
234
235
  className: "".concat(blockClass, "__label")
235
236
  }, inputLabel), /*#__PURE__*/React.createElement("div", {