@carbon/ibm-products 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. package/css/index-full-carbon.css +1766 -1701
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +2 -2
  4. package/css/index-without-carbon-released-only.css +32 -41
  5. package/css/index-without-carbon-released-only.css.map +1 -1
  6. package/css/index-without-carbon-released-only.min.css +2 -2
  7. package/css/index-without-carbon.css +228 -163
  8. package/css/index-without-carbon.css.map +1 -1
  9. package/css/index-without-carbon.min.css +2 -2
  10. package/css/index.css +1767 -1702
  11. package/css/index.css.map +1 -1
  12. package/css/index.min.css +2 -2
  13. package/es/components/APIKeyModal/APIKeyModal.js +25 -29
  14. package/es/components/ActionBar/ActionBar.js +4 -1
  15. package/es/components/AddSelect/AddSelect.js +65 -19
  16. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +19 -15
  17. package/es/components/CancelableTextEdit/CancelableTextEdit.js +60 -22
  18. package/es/components/CreateFullPage/CreateFullPage.js +78 -259
  19. package/es/components/CreateFullPage/CreateFullPageStep.js +58 -14
  20. package/es/components/CreateFullPage/index.js +1 -2
  21. package/es/components/CreateInfluencer/CreateInfluencer.js +23 -225
  22. package/es/components/CreateTearsheet/CreateTearsheet.js +69 -146
  23. package/es/components/CreateTearsheet/CreateTearsheetStep.js +59 -16
  24. package/es/components/CreateTearsheet/index.js +0 -1
  25. package/es/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +66 -27
  26. package/es/components/ExportModal/ExportModal.js +4 -2
  27. package/es/components/ImportModal/ImportModal.js +2 -1
  28. package/es/components/InlineEdit/InlineEdit.js +224 -0
  29. package/es/components/InlineEdit/index.js +7 -0
  30. package/es/components/MultiAddSelect/MultiAddSelect.js +16 -0
  31. package/es/components/MultiAddSelect/index.js +1 -0
  32. package/es/components/OptionsTile/OptionsTile.js +36 -15
  33. package/es/components/PageHeader/PageHeader.js +54 -33
  34. package/es/components/PageHeader/PageHeaderTitle.js +78 -7
  35. package/es/components/PageHeader/PageHeaderUtils.js +21 -2
  36. package/es/components/RemoveModal/RemoveModal.js +4 -2
  37. package/es/components/SingleAddSelect/SingleAddSelect.js +15 -0
  38. package/es/components/SingleAddSelect/index.js +1 -0
  39. package/es/components/TagSet/TagSet.js +4 -1
  40. package/es/components/Toolbar/Toolbar.js +69 -8
  41. package/es/components/index.js +4 -2
  42. package/es/global/js/hooks/useCreateComponentFocus.js +15 -19
  43. package/es/global/js/hooks/useCreateComponentStepChange.js +44 -74
  44. package/es/global/js/hooks/useValidCreateStepCount.js +4 -7
  45. package/es/global/js/package-settings.js +4 -2
  46. package/lib/components/APIKeyModal/APIKeyModal.js +25 -29
  47. package/lib/components/ActionBar/ActionBar.js +4 -1
  48. package/lib/components/AddSelect/AddSelect.js +64 -19
  49. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +18 -14
  50. package/lib/components/CancelableTextEdit/CancelableTextEdit.js +61 -22
  51. package/lib/components/CreateFullPage/CreateFullPage.js +78 -259
  52. package/lib/components/CreateFullPage/CreateFullPageStep.js +61 -14
  53. package/lib/components/CreateFullPage/index.js +1 -9
  54. package/lib/components/CreateInfluencer/CreateInfluencer.js +21 -236
  55. package/lib/components/CreateTearsheet/CreateTearsheet.js +71 -148
  56. package/lib/components/CreateTearsheet/CreateTearsheetStep.js +61 -15
  57. package/lib/components/CreateTearsheet/index.js +0 -8
  58. package/lib/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +67 -35
  59. package/lib/components/ExportModal/ExportModal.js +4 -2
  60. package/lib/components/ImportModal/ImportModal.js +2 -1
  61. package/lib/components/InlineEdit/InlineEdit.js +242 -0
  62. package/lib/components/InlineEdit/index.js +13 -0
  63. package/lib/components/MultiAddSelect/MultiAddSelect.js +37 -0
  64. package/lib/components/MultiAddSelect/index.js +13 -0
  65. package/lib/components/OptionsTile/OptionsTile.js +36 -15
  66. package/lib/components/PageHeader/PageHeader.js +54 -33
  67. package/lib/components/PageHeader/PageHeaderTitle.js +87 -9
  68. package/lib/components/PageHeader/PageHeaderUtils.js +21 -2
  69. package/lib/components/RemoveModal/RemoveModal.js +4 -2
  70. package/lib/components/SingleAddSelect/SingleAddSelect.js +36 -0
  71. package/lib/components/SingleAddSelect/index.js +13 -0
  72. package/lib/components/TagSet/TagSet.js +4 -1
  73. package/lib/components/Toolbar/Toolbar.js +69 -6
  74. package/lib/components/index.js +25 -9
  75. package/lib/global/js/hooks/useCreateComponentFocus.js +15 -19
  76. package/lib/global/js/hooks/useCreateComponentStepChange.js +44 -74
  77. package/lib/global/js/hooks/useValidCreateStepCount.js +4 -7
  78. package/lib/global/js/package-settings.js +4 -2
  79. package/package.json +8 -8
  80. package/scss/components/AddSelect/_add-select.scss +14 -3
  81. package/scss/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +19 -15
  82. package/scss/components/CancelableTextEdit/_cancelable-text-edit.scss +141 -70
  83. package/scss/components/CreateFullPage/_create-full-page.scss +4 -11
  84. package/scss/components/CreateTearsheet/_create-tearsheet.scss +4 -8
  85. package/scss/components/InlineEdit/_index.scss +8 -0
  86. package/scss/components/InlineEdit/_inline-edit.scss +44 -0
  87. package/scss/components/InlineEdit/_storybook-styles.scss +15 -0
  88. package/scss/components/MultiAddSelect/_index.scss +1 -0
  89. package/scss/components/MultiAddSelect/_multi-add-select.scss +1 -0
  90. package/scss/components/MultiAddSelect/_storybook-styles.scss +6 -0
  91. package/scss/components/PageHeader/_page-header.scss +14 -4
  92. package/scss/components/SingleAddSelect/_index.scss +1 -0
  93. package/scss/components/SingleAddSelect/_single-add-select.scss +1 -0
  94. package/scss/components/SingleAddSelect/_storybook-styles.scss +6 -0
  95. package/scss/components/_index.scss +3 -1
  96. package/es/components/CreateFullPage/CreateFullPageSection.js +0 -53
  97. package/es/components/CreateFullPage/constants.js +0 -8
  98. package/es/components/CreateTearsheet/CreateTearsheetSection.js +0 -83
  99. package/es/components/CreateTearsheet/constants.js +0 -8
  100. package/es/components/CreateTearsheet/preview-components/MultiStepWithSectionsTearsheet.js +0 -327
  101. package/es/global/js/utils/hasValidType.js +0 -94
  102. package/lib/components/CreateFullPage/CreateFullPageSection.js +0 -74
  103. package/lib/components/CreateFullPage/constants.js +0 -16
  104. package/lib/components/CreateTearsheet/CreateTearsheetSection.js +0 -105
  105. package/lib/components/CreateTearsheet/constants.js +0 -17
  106. package/lib/components/CreateTearsheet/preview-components/MultiStepWithSectionsTearsheet.js +0 -354
  107. package/lib/global/js/utils/hasValidType.js +0 -110
@@ -1,327 +0,0 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- import _regeneratorRuntime from "@babel/runtime/regenerator";
4
-
5
- /* eslint-disable react/prop-types */
6
-
7
- /**
8
- * Copyright IBM Corp. 2021, 2021
9
- *
10
- * This source code is licensed under the Apache-2.0 license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- */
13
- import React, { useState } from 'react';
14
- import { Button, Column, Dropdown, FormGroup, InlineNotification, RadioButtonGroup, RadioButton, Row, TextInput, Toggle } from 'carbon-components-react';
15
- import cx from 'classnames';
16
- import { pkg } from '../../../settings';
17
- import { CreateTearsheet } from '../CreateTearsheet';
18
- import { CreateTearsheetStep } from '../CreateTearsheetStep';
19
- import { CreateTearsheetDivider } from '../CreateTearsheetDivider';
20
- var blockClass = "".concat(pkg.prefix, "--tearsheet-create-multi-step");
21
- var componentBlockClass = "".concat(pkg.prefix, "--tearsheet-create");
22
- export var MultiStepWithSectionsTearsheet = function MultiStepWithSectionsTearsheet(_ref) {
23
- var backButtonText = _ref.backButtonText,
24
- cancelButtonText = _ref.cancelButtonText,
25
- className = _ref.className,
26
- description = _ref.description,
27
- influencerWidth = _ref.influencerWidth,
28
- label = _ref.label,
29
- nextButtonText = _ref.nextButtonText,
30
- submitButtonText = _ref.submitButtonText,
31
- title = _ref.title;
32
-
33
- var _useState = useState(750),
34
- _useState2 = _slicedToArray(_useState, 1),
35
- simulatedDelay = _useState2[0];
36
-
37
- var _useState3 = useState(false),
38
- _useState4 = _slicedToArray(_useState3, 2),
39
- open = _useState4[0],
40
- setOpen = _useState4[1];
41
-
42
- var _useState5 = useState(false),
43
- _useState6 = _slicedToArray(_useState5, 2),
44
- shouldReject = _useState6[0],
45
- setShouldReject = _useState6[1];
46
-
47
- var _useState7 = useState(false),
48
- _useState8 = _slicedToArray(_useState7, 2),
49
- hasSubmitError = _useState8[0],
50
- setHasSubmitError = _useState8[1];
51
-
52
- var _useState9 = useState(''),
53
- _useState10 = _slicedToArray(_useState9, 2),
54
- stepOneTextInputValue = _useState10[0],
55
- setStepOneTextInputValue = _useState10[1];
56
-
57
- var _useState11 = useState(''),
58
- _useState12 = _slicedToArray(_useState11, 2),
59
- topicDescriptionValue = _useState12[0],
60
- setTopicDescriptionValue = _useState12[1];
61
-
62
- var _useState13 = useState(''),
63
- _useState14 = _slicedToArray(_useState13, 2),
64
- topicVersionValue = _useState14[0],
65
- setTopicVersionValue = _useState14[1];
66
-
67
- var _useState15 = useState(''),
68
- _useState16 = _slicedToArray(_useState15, 2),
69
- topicMetaData = _useState16[0],
70
- setTopicMetaData = _useState16[1];
71
-
72
- var _useState17 = useState('one-day'),
73
- _useState18 = _slicedToArray(_useState17, 2),
74
- stepThreeTextInputValue = _useState18[0],
75
- setStepThreeTextInputValue = _useState18[1];
76
-
77
- var _useState19 = useState(false),
78
- _useState20 = _slicedToArray(_useState19, 2),
79
- isInvalid = _useState20[0],
80
- setIsInvalid = _useState20[1];
81
-
82
- var _useState21 = useState([]),
83
- _useState22 = _slicedToArray(_useState21, 2),
84
- allTopicOwners = _useState22[0],
85
- setAllTopicOwners = _useState22[1];
86
-
87
- var _useState23 = useState(null),
88
- _useState24 = _slicedToArray(_useState23, 2),
89
- selectedTopicOwner = _useState24[0],
90
- setSelectedTopicOwner = _useState24[1];
91
-
92
- var _useState25 = useState(false),
93
- _useState26 = _slicedToArray(_useState25, 2),
94
- apiFailed = _useState26[0],
95
- setApiFailed = _useState26[1];
96
-
97
- var clearCreateData = function clearCreateData() {
98
- setStepOneTextInputValue('');
99
- setTopicDescriptionValue('');
100
- setTopicVersionValue('');
101
- setStepThreeTextInputValue('one-day');
102
- setHasSubmitError(false);
103
- setIsInvalid(false);
104
- setOpen(false);
105
- setAllTopicOwners([]);
106
- setSelectedTopicOwner(null);
107
- setApiFailed(false);
108
- };
109
-
110
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("style", null, ".".concat(blockClass, " { opacity: 0 }"), ";"), /*#__PURE__*/React.createElement(Button, {
111
- onClick: function onClick() {
112
- return setOpen(!open);
113
- }
114
- }, open ? 'Close CreateTearsheet' : 'Open CreateTearsheet'), /*#__PURE__*/React.createElement(CreateTearsheet, {
115
- influencerWidth: influencerWidth,
116
- label: label,
117
- className: cx(blockClass, className),
118
- submitButtonText: submitButtonText,
119
- cancelButtonText: cancelButtonText,
120
- backButtonText: backButtonText,
121
- nextButtonText: nextButtonText,
122
- description: description,
123
- title: title,
124
- open: open,
125
- onClose: clearCreateData,
126
- onRequestSubmit: function onRequestSubmit() {
127
- return new Promise(function (resolve) {
128
- setTimeout(function () {
129
- clearCreateData();
130
- resolve();
131
- }, simulatedDelay);
132
- });
133
- }
134
- }, /*#__PURE__*/React.createElement(CreateTearsheetStep, {
135
- onMount: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
136
- var data, json;
137
- return _regeneratorRuntime.wrap(function _callee$(_context) {
138
- while (1) {
139
- switch (_context.prev = _context.next) {
140
- case 0:
141
- _context.prev = 0;
142
- _context.next = 3;
143
- return fetch('https://randomuser.me/api/?results=5');
144
-
145
- case 3:
146
- data = _context.sent;
147
- _context.next = 6;
148
- return data.json();
149
-
150
- case 6:
151
- json = _context.sent;
152
-
153
- if (data.ok) {
154
- _context.next = 9;
155
- break;
156
- }
157
-
158
- throw new Error('received non 200 response');
159
-
160
- case 9:
161
- setAllTopicOwners(json.results);
162
- _context.next = 16;
163
- break;
164
-
165
- case 12:
166
- _context.prev = 12;
167
- _context.t0 = _context["catch"](0);
168
- console.warn("CreateTearsheet [storybook example]: API request failed.");
169
- setApiFailed(true);
170
-
171
- case 16:
172
- case "end":
173
- return _context.stop();
174
- }
175
- }
176
- }, _callee, null, [[0, 12]]);
177
- })),
178
- onNext: function onNext() {
179
- return new Promise(function (resolve, reject) {
180
- setTimeout(function () {
181
- // Example usage of how to prevent the next step if some kind
182
- // of error occurred during the `onNext` handler.
183
- if (shouldReject) {
184
- setHasSubmitError(true);
185
- reject();
186
- }
187
-
188
- setIsInvalid(false);
189
- resolve();
190
- }, simulatedDelay);
191
- });
192
- },
193
- title: "Topic name",
194
- fieldsetLegendText: "Topic name information",
195
- disableSubmit: !stepOneTextInputValue,
196
- subtitle: "This is the unique name used to recognize your topic",
197
- description: "It will also be used by your producers and consumers as part of the connection information, so make it something easy to recognize."
198
- }, /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Column, {
199
- xlg: 8,
200
- lg: 8,
201
- md: 8,
202
- sm: 8
203
- }, /*#__PURE__*/React.createElement(TextInput, {
204
- labelText: "Topic name",
205
- id: "tearsheet-multi-step-story-text-input-multi-step-1",
206
- value: stepOneTextInputValue,
207
- placeholder: "Enter topic name",
208
- onChange: function onChange(event) {
209
- if (event.target.value.length) {
210
- setIsInvalid(false);
211
- }
212
-
213
- setStepOneTextInputValue(event.target.value);
214
- },
215
- invalid: isInvalid,
216
- invalidText: "This is a required field",
217
- onBlur: function onBlur() {
218
- if (!stepOneTextInputValue.length) {
219
- setIsInvalid(true);
220
- }
221
- }
222
- }), /*#__PURE__*/React.createElement(TextInput, {
223
- labelText: "Topic description (optional)",
224
- id: "tearsheet-multi-step-story-text-input-multi-step-1-input-2",
225
- value: topicDescriptionValue,
226
- placeholder: "Enter topic description",
227
- onChange: function onChange(event) {
228
- return setTopicDescriptionValue(event.target.value);
229
- }
230
- }), /*#__PURE__*/React.createElement(TextInput, {
231
- labelText: "Topic version (optional)",
232
- id: "tearsheet-multi-step-story-text-input-multi-step-1-input-3",
233
- value: topicVersionValue,
234
- placeholder: "Enter topic version",
235
- onChange: function onChange(event) {
236
- return setTopicVersionValue(event.target.value);
237
- }
238
- }), /*#__PURE__*/React.createElement(Dropdown, {
239
- ariaLabel: "Topic owner dropdown",
240
- className: "bx--form-item",
241
- id: "create-tearsheet-topic-owner",
242
- items: allTopicOwners,
243
- itemToString: function itemToString(item) {
244
- return item ? item.email : '';
245
- },
246
- label: "Select a topic owner",
247
- onChange: function onChange(_ref3) {
248
- var selectedItem = _ref3.selectedItem;
249
- return setSelectedTopicOwner(selectedItem);
250
- },
251
- selectedItem: selectedTopicOwner,
252
- titleText: "Topic owner (optional)",
253
- warn: apiFailed,
254
- warnText: "API request failed."
255
- }), hasSubmitError && /*#__PURE__*/React.createElement(InlineNotification, {
256
- kind: "error",
257
- title: "Error",
258
- subtitle: "Resolve errors to continue",
259
- onClose: function onClose() {
260
- return setHasSubmitError(false);
261
- }
262
- }), /*#__PURE__*/React.createElement(Toggle, {
263
- className: "".concat(blockClass, "__error--toggle"),
264
- id: "simulated-error-toggle",
265
- size: "sm",
266
- labelText: "Simulate error",
267
- onToggle: function onToggle(event) {
268
- return setShouldReject(event);
269
- }
270
- }))), /*#__PURE__*/React.createElement(CreateTearsheetDivider, null), /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Column, {
271
- xlg: 8,
272
- lg: 8,
273
- md: 8,
274
- sm: 8
275
- }, /*#__PURE__*/React.createElement("h4", {
276
- className: "".concat(componentBlockClass, "__step--title")
277
- }, "Meta data"), /*#__PURE__*/React.createElement(FormGroup, {
278
- className: "".concat(pkg.prefix, "--tearsheet-create__step--fieldset"),
279
- legendText: "Enter any topic meta data here"
280
- }, /*#__PURE__*/React.createElement(TextInput, {
281
- labelText: "Topic meta data (optional)",
282
- id: "tearsheet-multi-step-story-text-input-multi-step-1-input-4",
283
- value: topicMetaData,
284
- placeholder: "Enter topic meta data",
285
- onChange: function onChange(event) {
286
- return setTopicMetaData(event.target.value);
287
- }
288
- }))))), /*#__PURE__*/React.createElement(CreateTearsheetStep, {
289
- title: "Message retention",
290
- fieldsetLegendText: "Message retention scheduling",
291
- disableSubmit: !stepThreeTextInputValue,
292
- onNext: function onNext() {
293
- return Promise.resolve();
294
- },
295
- subtitle: "This is how long messages are retained before they are deleted.",
296
- description: "If your messages are not read by a consumer within this time, they will be missed."
297
- }, /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Column, {
298
- xlg: 8,
299
- lg: 8,
300
- md: 8,
301
- sm: 8
302
- }, /*#__PURE__*/React.createElement(RadioButtonGroup, {
303
- legendText: "Message retention",
304
- name: "radio-button-group",
305
- defaultSelected: stepThreeTextInputValue,
306
- onChange: function onChange(value) {
307
- return setStepThreeTextInputValue(value);
308
- },
309
- orientation: "vertical"
310
- }, /*#__PURE__*/React.createElement(RadioButton, {
311
- labelText: "A day",
312
- value: "one-day",
313
- id: "one-day"
314
- }), /*#__PURE__*/React.createElement(RadioButton, {
315
- labelText: "A week",
316
- value: "one-week",
317
- id: "one-week"
318
- }), /*#__PURE__*/React.createElement(RadioButton, {
319
- labelText: "A month",
320
- value: "one-month",
321
- id: "one-month"
322
- }), /*#__PURE__*/React.createElement(RadioButton, {
323
- labelText: "Custom",
324
- value: "custom",
325
- id: "custom"
326
- })))))));
327
- };
@@ -1,94 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2021, 2021
3
- *
4
- * This source code is licensed under the Apache-2.0 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
- import { Fragment } from 'react'; // Custom PropType validator which checks and ensures that all children of the create component are indeed all CreateStep components.
8
-
9
- export var hasValidChildrenType = function hasValidChildrenType(_ref) {
10
- var componentName = _ref.componentName,
11
- childType = _ref.childType;
12
- return function (_ref2) {
13
- var children = _ref2.children;
14
- children.length > 1 && children.map(function (child) {
15
- var _child$type;
16
-
17
- if (typeof (child === null || child === void 0 ? void 0 : child.type) !== 'function' && child && child.props && child.props.type !== childType || typeof (child === null || child === void 0 ? void 0 : child.type) === 'function' && ((_child$type = child.type()) === null || _child$type === void 0 ? void 0 : _child$type.props.type) !== childType) {
18
- throw new Error("Each child of ".concat(componentName, " is required to be a ").concat(childType, ". Please remove the HTML element, or wrap it around the ").concat(childType, " component."));
19
- }
20
-
21
- return;
22
- });
23
- };
24
- };
25
- /**
26
- * Returns array of CreateTearsheetSteps or CreateFullPageSteps
27
- * @param {Array} arr All of the children passed to the create tearsheet component
28
- * @param {string} type string that represents the `type` of component/s we're looking for
29
- */
30
-
31
- export var getExtractedSteps = function getExtractedSteps(arr, type) {
32
- var steps = [];
33
-
34
- var validateChild = function validateChild(child) {
35
- var _child$type2;
36
-
37
- // If the child is a CreateTearsheetStep component
38
- // we can add it to our array of steps
39
- if (typeof (child === null || child === void 0 ? void 0 : child.type) !== 'function' && child && child.props && child.props.type === type) {
40
- steps.push(child);
41
- } // Creating custom step components will follow this format
42
-
43
-
44
- if (typeof (child === null || child === void 0 ? void 0 : child.type) === 'function' && ((_child$type2 = child.type()) === null || _child$type2 === void 0 ? void 0 : _child$type2.props.type) === type) {
45
- // If the custom component does not have any props
46
- // ie all of the create tearsheet step props are set
47
- // inside of the custom component
48
- if (!Object.entries(child.props).length) {
49
- steps.push(child.type());
50
- } else {
51
- steps.push(child);
52
- }
53
- }
54
- };
55
-
56
- var validateFragmentChild = function validateFragmentChild(child) {
57
- if (child.props.children.length) {
58
- child.props.children.map(function (fragmentChild) {
59
- // We need to make sure that we catch all fragments that have
60
- // fragments as children, so we recursively call `validateFragmentChild`
61
- // again until child.type is not a `Fragment`
62
- if ((fragmentChild === null || fragmentChild === void 0 ? void 0 : fragmentChild.type) === Fragment) {
63
- validateFragmentChild(fragmentChild);
64
- }
65
-
66
- validateChild(fragmentChild);
67
- });
68
- } else {
69
- validateChild(child.props.children);
70
- }
71
- };
72
-
73
- arr.length && arr.map(function (child) {
74
- if ((child === null || child === void 0 ? void 0 : child.type) === Fragment) {
75
- validateFragmentChild(child);
76
- }
77
-
78
- validateChild(child);
79
- });
80
- return steps;
81
- }; // Utility used to check the `type` of a child component
82
-
83
- export var hasValidChildType = function hasValidChildType(_ref3) {
84
- var _child$props;
85
-
86
- var child = _ref3.child,
87
- type = _ref3.type;
88
-
89
- if (child && child !== null && child !== void 0 && child.props && (child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.type) === type) {
90
- return true;
91
- }
92
-
93
- return false;
94
- };
@@ -1,74 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports.CreateFullPageSection = void 0;
11
-
12
- var _react = _interopRequireWildcard(require("react"));
13
-
14
- var _propTypes = _interopRequireDefault(require("prop-types"));
15
-
16
- var _classnames = _interopRequireDefault(require("classnames"));
17
-
18
- var _settings = require("../../settings");
19
-
20
- var _constants = require("./constants");
21
-
22
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
- //
27
- // Copyright IBM Corp. 2021, 2021
28
- //
29
- // This source code is licensed under the Apache-2.0 license found in the
30
- // LICENSE file in the root directory of this source tree.
31
- //
32
- var blockClass = "".concat(_settings.pkg.prefix, "--create-full-page__section");
33
- var CreateFullPageSection = /*#__PURE__*/(0, _react.forwardRef)( // currently, we are not supporting the use of FullPageSections -- this may be a future feature
34
-
35
- /* istanbul ignore next */
36
- function (_ref, ref) {
37
- var children = _ref.children,
38
- className = _ref.className,
39
- id = _ref.id;
40
- return /*#__PURE__*/_react.default.createElement("div", {
41
- className: (0, _classnames.default)(blockClass, className),
42
- ref: ref,
43
- id: id
44
- }, children);
45
- });
46
- exports.CreateFullPageSection = CreateFullPageSection;
47
- CreateFullPageSection.propTypes = {
48
- /**
49
- * Content that shows in the CreateFullPage step
50
- */
51
- children: _propTypes.default.node,
52
-
53
- /**
54
- * Sets an optional className to be added to the CreateFullPage step
55
- */
56
- className: _propTypes.default.string,
57
-
58
- /**
59
- * Sets the id of the CreateTearsheetSection outermost element
60
- */
61
- id: _propTypes.default.string.isRequired,
62
-
63
- /**
64
- * Sets the title text for a CreateFullPage step
65
- */
66
- title: _propTypes.default.node.isRequired
67
- }; // Default values for component props. Default values are not required for
68
- // props that are required, nor for props where the component can apply
69
- // 'undefined' values reasonably. Default values should be provided when the
70
- // component needs to make a choice or assumption when a prop is not supplied.
71
-
72
- CreateFullPageSection.defaultProps = {
73
- type: _constants.CREATE_FULL_PAGE_SECTION
74
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CREATE_FULL_PAGE_STEP = exports.CREATE_FULL_PAGE_SECTION = void 0;
7
- //
8
- // Copyright IBM Corp. 2021, 2021
9
- //
10
- // This source code is licensed under the Apache-2.0 license found in the
11
- // LICENSE file in the root directory of this source tree.
12
- //
13
- var CREATE_FULL_PAGE_STEP = 'CreateFullPageStep';
14
- exports.CREATE_FULL_PAGE_STEP = CREATE_FULL_PAGE_STEP;
15
- var CREATE_FULL_PAGE_SECTION = 'CreateFullPageSection';
16
- exports.CREATE_FULL_PAGE_SECTION = CREATE_FULL_PAGE_SECTION;
@@ -1,105 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports.CreateTearsheetSection = void 0;
11
-
12
- var _react = _interopRequireWildcard(require("react"));
13
-
14
- var _propTypes = _interopRequireDefault(require("prop-types"));
15
-
16
- var _classnames = _interopRequireDefault(require("classnames"));
17
-
18
- var _carbonComponentsReact = require("carbon-components-react");
19
-
20
- var _settings = require("../../settings");
21
-
22
- var _constants = require("./constants");
23
-
24
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
-
26
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
-
28
- /**
29
- * Copyright IBM Corp. 2021, 2021
30
- *
31
- * This source code is licensed under the Apache-2.0 license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */
34
- var componentName = 'CreateTearsheetSection';
35
- var blockClass = "".concat(_settings.pkg.prefix, "--tearsheet-create__section");
36
- var CreateTearsheetSection = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
37
- var id = _ref.id,
38
- children = _ref.children,
39
- className = _ref.className,
40
- subtitle = _ref.subtitle,
41
- description = _ref.description,
42
- title = _ref.title,
43
- isViewingAllStepsTogether = _ref.isViewingAllStepsTogether;
44
- return /*#__PURE__*/_react.default.createElement("div", {
45
- className: (0, _classnames.default)(blockClass, className),
46
- ref: ref,
47
- id: id
48
- }, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Row, null, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Column, {
49
- xlg: 12,
50
- lg: 12,
51
- md: 8,
52
- sm: 8
53
- }, isViewingAllStepsTogether && /*#__PURE__*/_react.default.createElement("h4", {
54
- className: "".concat(blockClass, "--title")
55
- }, title), isViewingAllStepsTogether && subtitle && /*#__PURE__*/_react.default.createElement("h6", {
56
- className: "".concat(blockClass, "--subtitle")
57
- }, subtitle), isViewingAllStepsTogether && description && /*#__PURE__*/_react.default.createElement("p", {
58
- className: "".concat(blockClass, "--description")
59
- }, description))), children);
60
- });
61
- exports.CreateTearsheetSection = CreateTearsheetSection;
62
- CreateTearsheetSection.displayName = componentName;
63
- CreateTearsheetSection.propTypes = {
64
- /**
65
- * Content that shows in the tearsheet step
66
- */
67
- children: _propTypes.default.node,
68
-
69
- /**
70
- * Sets an optional className to be added to the tearsheet step
71
- */
72
- className: _propTypes.default.string,
73
-
74
- /**
75
- * Sets an optional description on the section component
76
- */
77
- description: _propTypes.default.string,
78
-
79
- /**
80
- * Sets the id of the CreateTearsheetSection outermost element
81
- */
82
- id: _propTypes.default.string.isRequired,
83
-
84
- /**
85
- * The is an internal prop set in CreateTearsheet so the section knows when to render it's title
86
- */
87
- isViewingAllStepsTogether: _propTypes.default.bool,
88
-
89
- /**
90
- * Sets an optional subtitle on the section component
91
- */
92
- subtitle: _propTypes.default.string,
93
-
94
- /**
95
- * Sets the title text for a tearsheet step
96
- */
97
- title: _propTypes.default.node.isRequired
98
- }; // Default values for component props. Default values are not required for
99
- // props that are required, nor for props where the component can apply
100
- // 'undefined' values reasonably. Default values should be provided when the
101
- // component needs to make a choice or assumption when a prop is not supplied.
102
-
103
- CreateTearsheetSection.defaultProps = {
104
- type: _constants.CREATE_TEARSHEET_SECTION
105
- };
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CREATE_TEARSHEET_STEP = exports.CREATE_TEARSHEET_SECTION = void 0;
7
-
8
- /**
9
- * Copyright IBM Corp. 2021, 2021
10
- *
11
- * This source code is licensed under the Apache-2.0 license found in the
12
- * LICENSE file in the root directory of this source tree.
13
- */
14
- var CREATE_TEARSHEET_STEP = 'CreateTearsheetStep';
15
- exports.CREATE_TEARSHEET_STEP = CREATE_TEARSHEET_STEP;
16
- var CREATE_TEARSHEET_SECTION = 'CreateTearsheetSection';
17
- exports.CREATE_TEARSHEET_SECTION = CREATE_TEARSHEET_SECTION;