@patternfly/react-core 4.273.3 → 4.274.1

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.
Files changed (232) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/components/Chip/Chip.d.ts.map +1 -1
  3. package/components/Chip/Chip.js +5 -4
  4. package/components/Chip/Chip.js.map +1 -1
  5. package/components/Menu/MenuGroup.d.ts +1 -1
  6. package/components/Menu/MenuGroup.d.ts.map +1 -1
  7. package/components/Menu/MenuGroup.js.map +1 -1
  8. package/components/Text/TextList.d.ts +2 -0
  9. package/components/Text/TextList.d.ts.map +1 -1
  10. package/components/Text/TextList.js +3 -2
  11. package/components/Text/TextList.js.map +1 -1
  12. package/dist/esm/components/Chip/Chip.d.ts.map +1 -1
  13. package/dist/esm/components/Chip/Chip.js +5 -4
  14. package/dist/esm/components/Chip/Chip.js.map +1 -1
  15. package/dist/esm/components/Menu/MenuGroup.d.ts +1 -1
  16. package/dist/esm/components/Menu/MenuGroup.d.ts.map +1 -1
  17. package/dist/esm/components/Menu/MenuGroup.js.map +1 -1
  18. package/dist/esm/components/Text/TextList.d.ts +2 -0
  19. package/dist/esm/components/Text/TextList.d.ts.map +1 -1
  20. package/dist/esm/components/Text/TextList.js +3 -2
  21. package/dist/esm/components/Text/TextList.js.map +1 -1
  22. package/dist/esm/next/components/Wizard/Wizard.d.ts +11 -14
  23. package/dist/esm/next/components/Wizard/Wizard.d.ts.map +1 -1
  24. package/dist/esm/next/components/Wizard/Wizard.js +30 -23
  25. package/dist/esm/next/components/Wizard/Wizard.js.map +1 -1
  26. package/dist/esm/next/components/Wizard/WizardContext.d.ts +16 -16
  27. package/dist/esm/next/components/Wizard/WizardContext.d.ts.map +1 -1
  28. package/dist/esm/next/components/Wizard/WizardContext.js +17 -19
  29. package/dist/esm/next/components/Wizard/WizardContext.js.map +1 -1
  30. package/dist/esm/next/components/Wizard/WizardFooter.d.ts +8 -5
  31. package/dist/esm/next/components/Wizard/WizardFooter.d.ts.map +1 -1
  32. package/dist/esm/next/components/Wizard/WizardFooter.js +1 -1
  33. package/dist/esm/next/components/Wizard/WizardFooter.js.map +1 -1
  34. package/dist/esm/next/components/Wizard/WizardHeader.d.ts +1 -1
  35. package/dist/esm/next/components/Wizard/WizardHeader.d.ts.map +1 -1
  36. package/dist/esm/next/components/Wizard/WizardNavInternal.d.ts +2 -2
  37. package/dist/esm/next/components/Wizard/WizardNavInternal.d.ts.map +1 -1
  38. package/dist/esm/next/components/Wizard/WizardNavInternal.js +15 -9
  39. package/dist/esm/next/components/Wizard/WizardNavInternal.js.map +1 -1
  40. package/dist/esm/next/components/Wizard/WizardNavItem.d.ts +10 -4
  41. package/dist/esm/next/components/Wizard/WizardNavItem.d.ts.map +1 -1
  42. package/dist/esm/next/components/Wizard/WizardNavItem.js +10 -9
  43. package/dist/esm/next/components/Wizard/WizardNavItem.js.map +1 -1
  44. package/dist/esm/next/components/Wizard/WizardStep.d.ts +3 -3
  45. package/dist/esm/next/components/Wizard/WizardStep.d.ts.map +1 -1
  46. package/dist/esm/next/components/Wizard/WizardStep.js +4 -2
  47. package/dist/esm/next/components/Wizard/WizardStep.js.map +1 -1
  48. package/dist/esm/next/components/Wizard/WizardToggle.d.ts +4 -4
  49. package/dist/esm/next/components/Wizard/WizardToggle.d.ts.map +1 -1
  50. package/dist/esm/next/components/Wizard/WizardToggle.js +1 -1
  51. package/dist/esm/next/components/Wizard/WizardToggle.js.map +1 -1
  52. package/dist/esm/next/components/Wizard/hooks/index.d.ts +1 -0
  53. package/dist/esm/next/components/Wizard/hooks/index.d.ts.map +1 -1
  54. package/dist/esm/next/components/Wizard/hooks/index.js +1 -0
  55. package/dist/esm/next/components/Wizard/hooks/index.js.map +1 -1
  56. package/dist/esm/next/components/Wizard/hooks/useGetMergedSteps.d.ts +9 -0
  57. package/dist/esm/next/components/Wizard/hooks/useGetMergedSteps.d.ts.map +1 -0
  58. package/dist/esm/next/components/Wizard/hooks/useGetMergedSteps.js +33 -0
  59. package/dist/esm/next/components/Wizard/hooks/useGetMergedSteps.js.map +1 -0
  60. package/dist/esm/next/components/Wizard/index.d.ts +2 -2
  61. package/dist/esm/next/components/Wizard/index.d.ts.map +1 -1
  62. package/dist/esm/next/components/Wizard/index.js +2 -2
  63. package/dist/esm/next/components/Wizard/index.js.map +1 -1
  64. package/dist/esm/next/components/Wizard/types.d.ts +13 -19
  65. package/dist/esm/next/components/Wizard/types.d.ts.map +1 -1
  66. package/dist/esm/next/components/Wizard/types.js +6 -0
  67. package/dist/esm/next/components/Wizard/types.js.map +1 -1
  68. package/dist/esm/next/components/Wizard/utils.d.ts +5 -6
  69. package/dist/esm/next/components/Wizard/utils.d.ts.map +1 -1
  70. package/dist/esm/next/components/Wizard/utils.js +15 -22
  71. package/dist/esm/next/components/Wizard/utils.js.map +1 -1
  72. package/dist/js/components/Chip/Chip.d.ts.map +1 -1
  73. package/dist/js/components/Chip/Chip.js +4 -4
  74. package/dist/js/components/Chip/Chip.js.map +1 -1
  75. package/dist/js/components/Menu/MenuGroup.d.ts +1 -1
  76. package/dist/js/components/Menu/MenuGroup.d.ts.map +1 -1
  77. package/dist/js/components/Menu/MenuGroup.js.map +1 -1
  78. package/dist/js/components/Text/TextList.d.ts +2 -0
  79. package/dist/js/components/Text/TextList.d.ts.map +1 -1
  80. package/dist/js/components/Text/TextList.js +3 -2
  81. package/dist/js/components/Text/TextList.js.map +1 -1
  82. package/dist/js/next/components/Wizard/Wizard.d.ts +11 -14
  83. package/dist/js/next/components/Wizard/Wizard.d.ts.map +1 -1
  84. package/dist/js/next/components/Wizard/Wizard.js +28 -21
  85. package/dist/js/next/components/Wizard/Wizard.js.map +1 -1
  86. package/dist/js/next/components/Wizard/WizardContext.d.ts +16 -16
  87. package/dist/js/next/components/Wizard/WizardContext.d.ts.map +1 -1
  88. package/dist/js/next/components/Wizard/WizardContext.js +16 -17
  89. package/dist/js/next/components/Wizard/WizardContext.js.map +1 -1
  90. package/dist/js/next/components/Wizard/WizardFooter.d.ts +8 -5
  91. package/dist/js/next/components/Wizard/WizardFooter.d.ts.map +1 -1
  92. package/dist/js/next/components/Wizard/WizardFooter.js +1 -1
  93. package/dist/js/next/components/Wizard/WizardFooter.js.map +1 -1
  94. package/dist/js/next/components/Wizard/WizardHeader.d.ts +1 -1
  95. package/dist/js/next/components/Wizard/WizardHeader.d.ts.map +1 -1
  96. package/dist/js/next/components/Wizard/WizardNavInternal.d.ts +2 -2
  97. package/dist/js/next/components/Wizard/WizardNavInternal.d.ts.map +1 -1
  98. package/dist/js/next/components/Wizard/WizardNavInternal.js +15 -9
  99. package/dist/js/next/components/Wizard/WizardNavInternal.js.map +1 -1
  100. package/dist/js/next/components/Wizard/WizardNavItem.d.ts +10 -4
  101. package/dist/js/next/components/Wizard/WizardNavItem.d.ts.map +1 -1
  102. package/dist/js/next/components/Wizard/WizardNavItem.js +10 -8
  103. package/dist/js/next/components/Wizard/WizardNavItem.js.map +1 -1
  104. package/dist/js/next/components/Wizard/WizardStep.d.ts +3 -3
  105. package/dist/js/next/components/Wizard/WizardStep.d.ts.map +1 -1
  106. package/dist/js/next/components/Wizard/WizardStep.js +4 -2
  107. package/dist/js/next/components/Wizard/WizardStep.js.map +1 -1
  108. package/dist/js/next/components/Wizard/WizardToggle.d.ts +4 -4
  109. package/dist/js/next/components/Wizard/WizardToggle.d.ts.map +1 -1
  110. package/dist/js/next/components/Wizard/WizardToggle.js +1 -1
  111. package/dist/js/next/components/Wizard/WizardToggle.js.map +1 -1
  112. package/dist/js/next/components/Wizard/hooks/index.d.ts +1 -0
  113. package/dist/js/next/components/Wizard/hooks/index.d.ts.map +1 -1
  114. package/dist/js/next/components/Wizard/hooks/index.js +3 -1
  115. package/dist/js/next/components/Wizard/hooks/index.js.map +1 -1
  116. package/dist/js/next/components/Wizard/hooks/useGetMergedSteps.d.ts +9 -0
  117. package/dist/js/next/components/Wizard/hooks/useGetMergedSteps.d.ts.map +1 -0
  118. package/dist/js/next/components/Wizard/hooks/useGetMergedSteps.js +38 -0
  119. package/dist/js/next/components/Wizard/hooks/useGetMergedSteps.js.map +1 -0
  120. package/dist/js/next/components/Wizard/index.d.ts +2 -2
  121. package/dist/js/next/components/Wizard/index.d.ts.map +1 -1
  122. package/dist/js/next/components/Wizard/index.js +4 -2
  123. package/dist/js/next/components/Wizard/index.js.map +1 -1
  124. package/dist/js/next/components/Wizard/types.d.ts +13 -19
  125. package/dist/js/next/components/Wizard/types.d.ts.map +1 -1
  126. package/dist/js/next/components/Wizard/types.js +7 -1
  127. package/dist/js/next/components/Wizard/types.js.map +1 -1
  128. package/dist/js/next/components/Wizard/utils.d.ts +5 -6
  129. package/dist/js/next/components/Wizard/utils.d.ts.map +1 -1
  130. package/dist/js/next/components/Wizard/utils.js +17 -25
  131. package/dist/js/next/components/Wizard/utils.js.map +1 -1
  132. package/dist/umd/react-core.min.js +2 -2
  133. package/next/components/Wizard/Wizard.d.ts +11 -14
  134. package/next/components/Wizard/Wizard.d.ts.map +1 -1
  135. package/next/components/Wizard/Wizard.js +30 -23
  136. package/next/components/Wizard/Wizard.js.map +1 -1
  137. package/next/components/Wizard/WizardContext.d.ts +16 -16
  138. package/next/components/Wizard/WizardContext.d.ts.map +1 -1
  139. package/next/components/Wizard/WizardContext.js +17 -19
  140. package/next/components/Wizard/WizardContext.js.map +1 -1
  141. package/next/components/Wizard/WizardFooter.d.ts +8 -5
  142. package/next/components/Wizard/WizardFooter.d.ts.map +1 -1
  143. package/next/components/Wizard/WizardFooter.js +1 -1
  144. package/next/components/Wizard/WizardFooter.js.map +1 -1
  145. package/next/components/Wizard/WizardHeader.d.ts +1 -1
  146. package/next/components/Wizard/WizardHeader.d.ts.map +1 -1
  147. package/next/components/Wizard/WizardNavInternal.d.ts +2 -2
  148. package/next/components/Wizard/WizardNavInternal.d.ts.map +1 -1
  149. package/next/components/Wizard/WizardNavInternal.js +15 -9
  150. package/next/components/Wizard/WizardNavInternal.js.map +1 -1
  151. package/next/components/Wizard/WizardNavItem.d.ts +10 -4
  152. package/next/components/Wizard/WizardNavItem.d.ts.map +1 -1
  153. package/next/components/Wizard/WizardNavItem.js +10 -9
  154. package/next/components/Wizard/WizardNavItem.js.map +1 -1
  155. package/next/components/Wizard/WizardStep.d.ts +3 -3
  156. package/next/components/Wizard/WizardStep.d.ts.map +1 -1
  157. package/next/components/Wizard/WizardStep.js +4 -2
  158. package/next/components/Wizard/WizardStep.js.map +1 -1
  159. package/next/components/Wizard/WizardToggle.d.ts +4 -4
  160. package/next/components/Wizard/WizardToggle.d.ts.map +1 -1
  161. package/next/components/Wizard/WizardToggle.js +1 -1
  162. package/next/components/Wizard/WizardToggle.js.map +1 -1
  163. package/next/components/Wizard/hooks/index.d.ts +1 -0
  164. package/next/components/Wizard/hooks/index.d.ts.map +1 -1
  165. package/next/components/Wizard/hooks/index.js +1 -0
  166. package/next/components/Wizard/hooks/index.js.map +1 -1
  167. package/next/components/Wizard/hooks/useGetMergedSteps.d.ts +9 -0
  168. package/next/components/Wizard/hooks/useGetMergedSteps.d.ts.map +1 -0
  169. package/next/components/Wizard/hooks/useGetMergedSteps.js +33 -0
  170. package/next/components/Wizard/hooks/useGetMergedSteps.js.map +1 -0
  171. package/next/components/Wizard/index.d.ts +2 -2
  172. package/next/components/Wizard/index.d.ts.map +1 -1
  173. package/next/components/Wizard/index.js +2 -2
  174. package/next/components/Wizard/index.js.map +1 -1
  175. package/next/components/Wizard/types.d.ts +13 -19
  176. package/next/components/Wizard/types.d.ts.map +1 -1
  177. package/next/components/Wizard/types.js +6 -0
  178. package/next/components/Wizard/types.js.map +1 -1
  179. package/next/components/Wizard/utils.d.ts +5 -6
  180. package/next/components/Wizard/utils.d.ts.map +1 -1
  181. package/next/components/Wizard/utils.js +15 -22
  182. package/next/components/Wizard/utils.js.map +1 -1
  183. package/package.json +2 -2
  184. package/src/components/Chip/Chip.tsx +4 -2
  185. package/src/components/Chip/__tests__/Chip.test.tsx +9 -0
  186. package/src/components/Chip/__tests__/__snapshots__/Chip.test.tsx.snap +55 -0
  187. package/src/components/ChipGroup/__tests__/__snapshots__/ChipGroup.test.tsx.snap +4 -0
  188. package/src/components/Menu/MenuGroup.tsx +2 -2
  189. package/src/components/Modal/examples/Modal.md +46 -11
  190. package/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +2 -0
  191. package/src/components/Text/TextList.tsx +5 -1
  192. package/src/components/Text/__tests__/TextList.test.tsx +5 -0
  193. package/src/components/Text/examples/Text.md +5 -0
  194. package/src/components/Text/examples/TextPlainList.tsx +24 -0
  195. package/src/components/Toolbar/__tests__/__snapshots__/Toolbar.test.tsx.snap +2 -0
  196. package/src/next/components/Wizard/Wizard.tsx +71 -46
  197. package/src/next/components/Wizard/WizardContext.tsx +38 -43
  198. package/src/next/components/Wizard/WizardFooter.tsx +10 -6
  199. package/src/next/components/Wizard/WizardHeader.tsx +1 -1
  200. package/src/next/components/Wizard/WizardNavInternal.tsx +51 -43
  201. package/src/next/components/Wizard/WizardNavItem.tsx +21 -14
  202. package/src/next/components/Wizard/WizardStep.tsx +8 -6
  203. package/src/next/components/Wizard/WizardToggle.tsx +5 -5
  204. package/src/next/components/Wizard/__tests__/Wizard.test.tsx +129 -26
  205. package/src/next/components/Wizard/__tests__/WizardStep.test.tsx +5 -5
  206. package/src/next/components/Wizard/__tests__/WizardToggle.test.tsx +2 -2
  207. package/src/next/components/Wizard/__tests__/utils.test.tsx +3 -17
  208. package/src/next/components/Wizard/examples/Wizard.md +69 -41
  209. package/src/next/components/Wizard/examples/WizardBasic.tsx +6 -12
  210. package/src/next/components/Wizard/examples/WizardBasicDisabledSteps.tsx +22 -0
  211. package/src/next/components/Wizard/examples/WizardEnabledOnFormValidation.tsx +84 -0
  212. package/src/next/components/Wizard/examples/WizardExpandableSteps.tsx +42 -0
  213. package/src/next/components/Wizard/examples/WizardGetCurrentStep.tsx +53 -0
  214. package/src/next/components/Wizard/examples/WizardProgressiveSteps.tsx +31 -0
  215. package/src/next/components/Wizard/examples/WizardStepDrawerContent.tsx +80 -0
  216. package/src/next/components/Wizard/examples/WizardStepErrorStatus.tsx +55 -0
  217. package/src/next/components/Wizard/examples/WizardStepVisitRequired.tsx +22 -0
  218. package/src/next/components/Wizard/examples/WizardToggleStepVisibility.tsx +57 -0
  219. package/src/next/components/Wizard/examples/WizardValidateOnButtonPress.tsx +183 -0
  220. package/src/next/components/Wizard/examples/WizardWithCustomFooter.tsx +107 -0
  221. package/src/next/components/Wizard/examples/{WizardCustomNav.tsx → WizardWithCustomNav.tsx} +11 -11
  222. package/src/next/components/Wizard/examples/WizardWithCustomNavItem.tsx +22 -0
  223. package/src/next/components/Wizard/examples/WizardWithHeader.tsx +26 -0
  224. package/src/next/components/Wizard/examples/WizardWithNavAnchors.tsx +46 -0
  225. package/src/next/components/Wizard/examples/WizardWithSubmitProgress.tsx +86 -0
  226. package/src/next/components/Wizard/examples/WizardWithinModal.tsx +41 -0
  227. package/src/next/components/Wizard/hooks/index.ts +1 -0
  228. package/src/next/components/Wizard/hooks/useGetMergedSteps.tsx +45 -0
  229. package/src/next/components/Wizard/index.ts +2 -2
  230. package/src/next/components/Wizard/types.tsx +19 -29
  231. package/src/next/components/Wizard/utils.ts +27 -33
  232. package/src/next/components/Wizard/examples/WizardKitchenSink.tsx +0 -243
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useWizardFooter = void 0;
3
+ exports.useGetMergedSteps = exports.useWizardFooter = void 0;
4
4
  var useWizardFooter_1 = require("./useWizardFooter");
5
5
  Object.defineProperty(exports, "useWizardFooter", { enumerable: true, get: function () { return useWizardFooter_1.useWizardFooter; } });
6
+ var useGetMergedSteps_1 = require("./useGetMergedSteps");
7
+ Object.defineProperty(exports, "useGetMergedSteps", { enumerable: true, get: function () { return useGetMergedSteps_1.useGetMergedSteps; } });
6
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA"}
@@ -0,0 +1,9 @@
1
+ import { WizardStepType } from '../types';
2
+ /**
3
+ * Get stable ref of combined initial (prop provided) and current (context stored) steps.
4
+ * @param initialSteps
5
+ * @param currentSteps
6
+ * @returns WizardStepType[]
7
+ */
8
+ export declare const useGetMergedSteps: (initialSteps: WizardStepType[], currentSteps: WizardStepType[]) => WizardStepType[];
9
+ //# sourceMappingURL=useGetMergedSteps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGetMergedSteps.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useGetMergedSteps.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,iBAAkB,cAAc,EAAE,gBAAgB,cAAc,EAAE,KAAG,cAAc,EAkChH,CAAC"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useGetMergedSteps = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = tslib_1.__importDefault(require("react"));
6
+ const fast_deep_equal_1 = tslib_1.__importDefault(require("fast-deep-equal"));
7
+ /**
8
+ * Get stable ref of combined initial (prop provided) and current (context stored) steps.
9
+ * @param initialSteps
10
+ * @param currentSteps
11
+ * @returns WizardStepType[]
12
+ */
13
+ const useGetMergedSteps = (initialSteps, currentSteps) => {
14
+ const initialStepsRef = react_1.default.useRef(initialSteps);
15
+ const currentStepsRef = react_1.default.useRef(currentSteps);
16
+ // Check each value within the array of initialSteps (props) and currentSteps (context).
17
+ // If any value changes for either of these, update the reference.
18
+ if (!(0, fast_deep_equal_1.default)(initialStepsRef.current, initialSteps)) {
19
+ initialStepsRef.current = initialSteps;
20
+ }
21
+ if (!(0, fast_deep_equal_1.default)(currentStepsRef.current, currentSteps)) {
22
+ currentStepsRef.current = currentSteps;
23
+ }
24
+ // Combine both initial and current steps, where prop provided values
25
+ // take precedence over what's stored in context.
26
+ const mergedSteps = react_1.default.useMemo(() => initialSteps.reduce((acc, initialStepProps, index) => {
27
+ const currentStepProps = currentSteps[index];
28
+ if (initialStepProps.id === currentStepProps.id) {
29
+ acc.push(Object.assign(Object.assign({}, currentStepProps), initialStepProps));
30
+ }
31
+ return acc;
32
+ }, []),
33
+ // eslint-disable-next-line react-hooks/exhaustive-deps
34
+ [initialStepsRef.current, currentStepsRef.current]);
35
+ return mergedSteps;
36
+ };
37
+ exports.useGetMergedSteps = useGetMergedSteps;
38
+ //# sourceMappingURL=useGetMergedSteps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGetMergedSteps.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useGetMergedSteps.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,8EAAsC;AAGtC;;;;;GAKG;AACI,MAAM,iBAAiB,GAAG,CAAC,YAA8B,EAAE,YAA8B,EAAoB,EAAE;IACpH,MAAM,eAAe,GAAG,eAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnD,MAAM,eAAe,GAAG,eAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAEnD,wFAAwF;IACxF,kEAAkE;IAClE,IAAI,CAAC,IAAA,yBAAO,EAAC,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE;QACnD,eAAe,CAAC,OAAO,GAAG,YAAY,CAAC;KACxC;IACD,IAAI,CAAC,IAAA,yBAAO,EAAC,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE;QACnD,eAAe,CAAC,OAAO,GAAG,YAAY,CAAC;KACxC;IAED,qEAAqE;IACrE,iDAAiD;IACjD,MAAM,WAAW,GAAG,eAAK,CAAC,OAAO,CAC/B,GAAG,EAAE,CACH,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE;QACnD,MAAM,gBAAgB,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAE7C,IAAI,gBAAgB,CAAC,EAAE,KAAK,gBAAgB,CAAC,EAAE,EAAE;YAC/C,GAAG,CAAC,IAAI,iCACH,gBAAgB,GAChB,gBAAgB,EACnB,CAAC;SACJ;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC;IACR,uDAAuD;IACvD,CAAC,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC,CACnD,CAAC;IAEF,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAlCW,QAAA,iBAAiB,qBAkC5B"}
@@ -6,7 +6,7 @@ export * from './WizardStep';
6
6
  export * from './WizardNav';
7
7
  export * from './WizardNavItem';
8
8
  export * from './WizardHeader';
9
- export * from './hooks';
10
9
  export * from './types';
11
- export { useWizardContext } from './WizardContext';
10
+ export { useWizardFooter } from './hooks';
11
+ export { useWizardContext, WizardContext } from './WizardContext';
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useWizardContext = void 0;
3
+ exports.WizardContext = exports.useWizardContext = exports.useWizardFooter = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  tslib_1.__exportStar(require("./Wizard"), exports);
6
6
  tslib_1.__exportStar(require("./WizardBody"), exports);
@@ -10,8 +10,10 @@ tslib_1.__exportStar(require("./WizardStep"), exports);
10
10
  tslib_1.__exportStar(require("./WizardNav"), exports);
11
11
  tslib_1.__exportStar(require("./WizardNavItem"), exports);
12
12
  tslib_1.__exportStar(require("./WizardHeader"), exports);
13
- tslib_1.__exportStar(require("./hooks"), exports);
14
13
  tslib_1.__exportStar(require("./types"), exports);
14
+ var hooks_1 = require("./hooks");
15
+ Object.defineProperty(exports, "useWizardFooter", { enumerable: true, get: function () { return hooks_1.useWizardFooter; } });
15
16
  var WizardContext_1 = require("./WizardContext");
16
17
  Object.defineProperty(exports, "useWizardContext", { enumerable: true, get: function () { return WizardContext_1.useWizardContext; } });
18
+ Object.defineProperty(exports, "WizardContext", { enumerable: true, get: function () { return WizardContext_1.WizardContext; } });
17
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/index.ts"],"names":[],"mappings":";;;;AAAA,mDAAyB;AACzB,uDAA6B;AAC7B,yDAA+B;AAC/B,yDAA+B;AAC/B,uDAA6B;AAC7B,sDAA4B;AAC5B,0DAAgC;AAChC,yDAA+B;AAC/B,kDAAwB;AACxB,kDAAwB;AACxB,iDAAmD;AAA1C,iHAAA,gBAAgB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/index.ts"],"names":[],"mappings":";;;;AAAA,mDAAyB;AACzB,uDAA6B;AAC7B,yDAA+B;AAC/B,yDAA+B;AAC/B,uDAA6B;AAC7B,sDAA4B;AAC5B,0DAAgC;AAChC,yDAA+B;AAC/B,kDAAwB;AACxB,iCAA0C;AAAjC,wGAAA,eAAe,OAAA;AACxB,iDAAkE;AAAzD,iHAAA,gBAAgB,OAAA;AAAE,8GAAA,aAAa,OAAA"}
@@ -31,8 +31,8 @@ export declare enum WizardNavItemStatus {
31
31
  export interface WizardParentStep extends WizardBasicStep {
32
32
  /** Nested step IDs */
33
33
  subStepIds: (string | number)[];
34
- /** Flag to determine whether sub-steps can collapse or not */
35
- isCollapsible?: boolean;
34
+ /** Flag to determine whether the step can expand or not. */
35
+ isExpandable?: boolean;
36
36
  }
37
37
  /** Type used to define sub-steps. */
38
38
  export interface WizardSubStep extends WizardBasicStep {
@@ -40,31 +40,25 @@ export interface WizardSubStep extends WizardBasicStep {
40
40
  parentId: string | number;
41
41
  }
42
42
  /** Encompasses all step type variants that are internally controlled by the Wizard. */
43
- export declare type WizardControlStep = WizardBasicStep | WizardParentStep | WizardSubStep;
44
- /** Callback for the Wizard's 'onNext', 'onBack', and 'onNavByIndex' properties. */
45
- export declare type WizardNavStepFunction = (currentStep: WizardNavStepData, previousStep: WizardNavStepData) => void | Promise<void>;
46
- /** Data returned for either parameter of WizardNavStepFunction. */
47
- export interface WizardNavStepData {
48
- /** Unique identifier */
49
- id: string | number;
50
- /** Name of the step */
51
- name: string;
52
- /** Index of the step (starts at 1) */
53
- index: number;
43
+ export declare type WizardStepType = WizardBasicStep | WizardParentStep | WizardSubStep;
44
+ export declare enum WizardStepChangeScope {
45
+ Next = "next",
46
+ Back = "back",
47
+ Nav = "nav"
54
48
  }
55
49
  export declare type WizardFooterType = Partial<WizardFooterProps> | CustomWizardFooterFunction | React.ReactElement;
56
50
  export declare type WizardNavType = Partial<WizardNavProps> | CustomWizardNavFunction | React.ReactElement;
57
51
  export declare type WizardNavItemType = Partial<WizardNavItemProps> | CustomWizardNavItemFunction | React.ReactElement;
58
52
  /** Callback for the Wizard's 'nav' property. Returns element which replaces the Wizard's default navigation. */
59
- export declare type CustomWizardNavFunction = (isExpanded: boolean, steps: WizardControlStep[], activeStep: WizardControlStep, goToStepByIndex: (index: number) => void) => React.ReactElement<WizardNavProps>;
53
+ export declare type CustomWizardNavFunction = (isExpanded: boolean, steps: WizardStepType[], activeStep: WizardStepType, goToStepByIndex: (index: number) => void) => React.ReactElement<WizardNavProps>;
60
54
  /** Callback for the Wizard's 'navItem' property. Returns element which replaces the WizardStep's default navigation item. */
61
- export declare type CustomWizardNavItemFunction = (step: WizardControlStep, activeStep: WizardControlStep, steps: WizardControlStep[], goToStepByIndex: (index: number) => void) => React.ReactElement<WizardNavItemProps>;
55
+ export declare type CustomWizardNavItemFunction = (step: WizardStepType, activeStep: WizardStepType, steps: WizardStepType[], goToStepByIndex: (index: number) => void) => React.ReactElement<WizardNavItemProps>;
62
56
  /** Callback for the Wizard's 'footer' property. Returns element which replaces the Wizard's default footer. */
63
- export declare type CustomWizardFooterFunction = (activeStep: WizardControlStep, onNext: () => void | Promise<void>, onBack: () => void | Promise<void>, onClose: () => void | Promise<void>) => React.ReactElement<WizardFooterProps>;
57
+ export declare type CustomWizardFooterFunction = (activeStep: WizardStepType, onNext: (event: React.MouseEvent<HTMLButtonElement>) => void | Promise<void>, onBack: (event: React.MouseEvent<HTMLButtonElement>) => void | Promise<void>, onClose: (event: React.MouseEvent<HTMLButtonElement>) => void | Promise<void>) => React.ReactElement<WizardFooterProps>;
64
58
  export declare function isCustomWizardNav(nav: WizardNavType): nav is CustomWizardNavFunction | React.ReactElement;
65
59
  export declare function isCustomWizardNavItem(navItem: WizardNavItemType): navItem is CustomWizardNavItemFunction | React.ReactElement;
66
60
  export declare function isCustomWizardFooter(footer: WizardFooterType): footer is CustomWizardFooterFunction | React.ReactElement;
67
- export declare function isWizardBasicStep(step: WizardControlStep): step is WizardBasicStep;
68
- export declare function isWizardSubStep(step: WizardControlStep): step is WizardSubStep;
69
- export declare function isWizardParentStep(step: WizardControlStep): step is WizardParentStep;
61
+ export declare function isWizardBasicStep(step: WizardStepType): step is WizardBasicStep;
62
+ export declare function isWizardSubStep(step: WizardStepType): step is WizardSubStep;
63
+ export declare function isWizardParentStep(step: WizardStepType): step is WizardParentStep;
70
64
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAElF,mHAAmH;AACnH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,wBAAwB;IACxB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yEAAyE;IACzE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qIAAqI;IACrI,SAAS,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC/B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,iBAAiB,CAAC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AC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAC5E,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAC1E,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;AAE3C,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,GAAG,IAAI,uBAAuB,GAAG,KAAK,CAAC,YAAY,CAEzG;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,iBAAiB,GACzB,OAAO,IAAI,2BAA2B,GAAG,KAAK,CAAC,YAAY,CAE7D;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,gBAAgB,GACvB,MAAM,IAAI,0BAA0B,GAAG,KAAK,CAAC,YAAY,CAE3D;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,IAAI,eAAe,CAE/E;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,IAAI,aAAa,CAE3E;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,IAAI,gBAAgB,CAEjF"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isWizardParentStep = exports.isWizardSubStep = exports.isWizardBasicStep = exports.isCustomWizardFooter = exports.isCustomWizardNavItem = exports.isCustomWizardNav = exports.WizardNavItemStatus = void 0;
3
+ exports.isWizardParentStep = exports.isWizardSubStep = exports.isWizardBasicStep = exports.isCustomWizardFooter = exports.isCustomWizardNavItem = exports.isCustomWizardNav = exports.WizardStepChangeScope = exports.WizardNavItemStatus = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  var WizardNavItemStatus;
@@ -8,6 +8,12 @@ var WizardNavItemStatus;
8
8
  WizardNavItemStatus["Default"] = "default";
9
9
  WizardNavItemStatus["Error"] = "error";
10
10
  })(WizardNavItemStatus = exports.WizardNavItemStatus || (exports.WizardNavItemStatus = {}));
11
+ var WizardStepChangeScope;
12
+ (function (WizardStepChangeScope) {
13
+ WizardStepChangeScope["Next"] = "next";
14
+ WizardStepChangeScope["Back"] = "back";
15
+ WizardStepChangeScope["Nav"] = "nav";
16
+ })(WizardStepChangeScope = exports.WizardStepChangeScope || (exports.WizardStepChangeScope = {}));
11
17
  function isCustomWizardNav(nav) {
12
18
  return typeof nav === 'function' || react_1.default.isValidElement(nav);
13
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/types.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AA2B1B,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,sCAAe,CAAA;AACjB,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B;AA+DD,SAAgB,iBAAiB,CAAC,GAAkB;IAClD,OAAO,OAAO,GAAG,KAAK,UAAU,IAAI,eAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AAChE,CAAC;AAFD,8CAEC;AAED,SAAgB,qBAAqB,CACnC,OAA0B;IAE1B,OAAO,OAAO,OAAO,KAAK,UAAU,IAAI,eAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AACxE,CAAC;AAJD,sDAIC;AAED,SAAgB,oBAAoB,CAClC,MAAwB;IAExB,OAAO,OAAO,MAAM,KAAK,UAAU,IAAI,eAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC;AAJD,oDAIC;AAED,SAAgB,iBAAiB,CAAC,IAAuB;IACvD,OAAO,CAAC,IAAyB,aAAzB,IAAI,uBAAJ,IAAI,CAAuB,UAAU,MAAK,SAAS,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AACxF,CAAC;AAFD,8C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AK,SAAS,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AACxF,CAAC;AAFD,8CAEC;AAED,SAAgB,eAAe,CAAC,IAAoB;IAClD,OAAO,CAAC,IAAsB,aAAtB,IAAI,uBAAJ,IAAI,CAAoB,QAAQ,MAAK,SAAS,CAAC;AACzD,CAAC;AAFD,0CAEC;AAED,SAAgB,kBAAkB,CAAC,IAAoB;IACrD,OAAO,CAAC,IAAyB,aAAzB,IAAI,uBAAJ,IAAI,CAAuB,UAAU,MAAK,SAAS,CAAC;AAC9D,CAAC;AAFD,gDAEC"}
@@ -1,14 +1,13 @@
1
1
  import React from 'react';
2
- import { WizardControlStep, WizardNavStepData } from './types';
2
+ import { WizardStepType } from './types';
3
3
  import { WizardStepProps } from './WizardStep';
4
4
  /**
5
5
  * Accumulate list of step & sub-step props pulled from child components
6
6
  * @param children
7
- * @returns WizardControlStep[]
7
+ * @returns WizardStepType[]
8
8
  */
9
- export declare const buildSteps: (children: React.ReactElement<WizardStepProps> | React.ReactElement<WizardStepProps>[]) => WizardControlStep[];
9
+ export declare const buildSteps: (children: React.ReactNode | React.ReactNode[]) => WizardStepType[];
10
10
  export declare function isWizardStep(child: any | React.ReactElement<WizardStepProps>): child is React.ReactElement<WizardStepProps>;
11
- export declare const normalizeStep: ({ children, steps, ...controlStep }: WizardStepProps) => Omit<WizardControlStep, 'index'>;
12
- export declare const normalizeNavStep: (navStep: WizardControlStep) => WizardNavStepData;
13
- export declare const getActiveStep: (steps: WizardControlStep[], activeStepIndex: number) => WizardControlStep;
11
+ export declare const normalizeStepProps: ({ children: _children, steps: _steps, ...controlStep }: WizardStepProps) => Omit<WizardStepType, 'index'>;
12
+ export declare const getActiveStep: (steps: WizardStepType[], activeStepIndex: number) => WizardStepType;
14
13
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/utils.ts"],"names":[],"mappings":"AAAA,OA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E,mBAAmB,MAAM,mBAC1B,CAAC"}
@@ -1,51 +1,43 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getActiveStep = exports.normalizeNavStep = exports.normalizeStep = exports.isWizardStep = exports.buildSteps = void 0;
3
+ exports.getActiveStep = exports.normalizeStepProps = exports.isWizardStep = exports.buildSteps = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const WizardStep_1 = require("./WizardStep");
7
7
  /**
8
8
  * Accumulate list of step & sub-step props pulled from child components
9
9
  * @param children
10
- * @returns WizardControlStep[]
10
+ * @returns WizardStepType[]
11
11
  */
12
- const buildSteps = (children) => react_1.default.Children.toArray(children).reduce((acc, child) => {
12
+ const buildSteps = (children) => react_1.default.Children.toArray(children).reduce((acc, child, index) => {
13
13
  if (isWizardStep(child)) {
14
- const { steps: subSteps, id, isHidden, isDisabled } = child.props;
15
- const subControlledSteps = [];
14
+ const { props: childProps } = child;
15
+ const { steps: childStepComponents, id } = childProps;
16
16
  const stepIndex = acc.length + 1;
17
- acc.push(Object.assign(Object.assign(Object.assign({ index: stepIndex, component: child }, (stepIndex === 1 && { isVisited: true })), (subSteps && {
18
- subStepIds: subSteps === null || subSteps === void 0 ? void 0 : subSteps.map((subStep, subStepIndex) => {
19
- subControlledSteps.push(Object.assign({ isHidden,
20
- isDisabled, component: subStep, parentId: id, index: stepIndex + subStepIndex + 1 }, (0, exports.normalizeStep)(subStep.props)));
21
- return subStep.props.id;
17
+ const subSteps = [];
18
+ acc.push(Object.assign(Object.assign(Object.assign({ index: stepIndex, component: child }, (index === 0 && !(childStepComponents === null || childStepComponents === void 0 ? void 0 : childStepComponents.length) && { isVisited: true })), (childStepComponents && {
19
+ subStepIds: childStepComponents === null || childStepComponents === void 0 ? void 0 : childStepComponents.map((childStepComponent, subStepIndex) => {
20
+ subSteps.push(Object.assign(Object.assign({ index: stepIndex + subStepIndex + 1, component: childStepComponent, parentId: id }, (index === 0 && subStepIndex === 0 && { isVisited: true })), (0, exports.normalizeStepProps)(childStepComponent.props)));
21
+ return childStepComponent.props.id;
22
22
  })
23
- })), (0, exports.normalizeStep)(child.props)), ...subControlledSteps);
23
+ })), (0, exports.normalizeStepProps)(childProps)), ...subSteps);
24
24
  }
25
25
  else {
26
- throw new Error('Wizard only accepts children with required WizardStepProps.');
26
+ throw new Error('Wizard only accepts children of type WizardStep.');
27
27
  }
28
28
  return acc;
29
29
  }, []);
30
30
  exports.buildSteps = buildSteps;
31
31
  function isWizardStep(child) {
32
- var _a, _b;
33
- return ((react_1.default.isValidElement(child) && child.type === WizardStep_1.WizardStep) ||
34
- (((_a = child.props) === null || _a === void 0 ? void 0 : _a.name) !== undefined && ((_b = child.props) === null || _b === void 0 ? void 0 : _b.id) !== undefined));
32
+ return react_1.default.isValidElement(child) && child.type === WizardStep_1.WizardStep;
35
33
  }
36
34
  exports.isWizardStep = isWizardStep;
37
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
38
- const normalizeStep = (_a) => {
39
- var { children, steps } = _a, controlStep = tslib_1.__rest(_a, ["children", "steps"]);
35
+ // Omit "children" and "steps" when building steps for the Wizard's context
36
+ const normalizeStepProps = (_a) => {
37
+ var { children: _children, steps: _steps } = _a, controlStep = tslib_1.__rest(_a, ["children", "steps"]);
40
38
  return controlStep;
41
39
  };
42
- exports.normalizeStep = normalizeStep;
43
- const normalizeNavStep = (navStep) => ({
44
- id: navStep.id,
45
- index: navStep.index,
46
- name: navStep.name.toString()
47
- });
48
- exports.normalizeNavStep = normalizeNavStep;
40
+ exports.normalizeStepProps = normalizeStepProps;
49
41
  const getActiveStep = (steps, activeStepIndex) => steps.find(step => step.index === activeStepIndex);
50
42
  exports.getActiveStep = getActiveStep;
51
43
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/utils.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B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