@hitachivantara/uikit-react-lab 3.56.1 → 3.57.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 (163) hide show
  1. package/dist/Wizard/Wizard.d.ts +63 -0
  2. package/dist/Wizard/Wizard.js +238 -0
  3. package/dist/Wizard/Wizard.js.map +1 -0
  4. package/dist/Wizard/WizardActions/WizardActions.d.ts +61 -0
  5. package/dist/Wizard/WizardActions/WizardActions.js +259 -0
  6. package/dist/Wizard/WizardActions/WizardActions.js.map +1 -0
  7. package/dist/Wizard/WizardActions/index.d.ts +2 -0
  8. package/dist/Wizard/WizardActions/index.js +16 -0
  9. package/dist/Wizard/WizardActions/index.js.map +1 -0
  10. package/dist/Wizard/WizardActions/styles.js +30 -0
  11. package/dist/Wizard/WizardActions/styles.js.map +1 -0
  12. package/dist/Wizard/WizardContainer/WizardContainer.d.ts +28 -0
  13. package/dist/Wizard/WizardContainer/WizardContainer.js +94 -0
  14. package/dist/Wizard/WizardContainer/WizardContainer.js.map +1 -0
  15. package/dist/Wizard/WizardContainer/index.d.ts +2 -0
  16. package/dist/Wizard/WizardContainer/index.js +16 -0
  17. package/dist/Wizard/WizardContainer/index.js.map +1 -0
  18. package/dist/Wizard/WizardContainer/styles.js +23 -0
  19. package/dist/Wizard/WizardContainer/styles.js.map +1 -0
  20. package/dist/Wizard/WizardContent/LoadingContainer.js +74 -0
  21. package/dist/Wizard/WizardContent/LoadingContainer.js.map +1 -0
  22. package/dist/Wizard/WizardContent/WizardContent.d.ts +28 -0
  23. package/dist/Wizard/WizardContent/WizardContent.js +163 -0
  24. package/dist/Wizard/WizardContent/WizardContent.js.map +1 -0
  25. package/dist/Wizard/WizardContent/index.d.ts +2 -0
  26. package/dist/Wizard/WizardContent/index.js +16 -0
  27. package/dist/Wizard/WizardContent/index.js.map +1 -0
  28. package/dist/Wizard/WizardContent/styles.js +24 -0
  29. package/dist/Wizard/WizardContent/styles.js.map +1 -0
  30. package/dist/Wizard/WizardContext/WizardContext.d.ts +12 -0
  31. package/dist/Wizard/WizardContext/WizardContext.js +21 -0
  32. package/dist/Wizard/WizardContext/WizardContext.js.map +1 -0
  33. package/dist/Wizard/WizardContext/WizardContextProvider.d.ts +28 -0
  34. package/dist/Wizard/WizardContext/WizardContextProvider.js +47 -0
  35. package/dist/Wizard/WizardContext/WizardContextProvider.js.map +1 -0
  36. package/dist/Wizard/WizardContext/index.d.ts +5 -0
  37. package/dist/Wizard/WizardContext/index.js +24 -0
  38. package/dist/Wizard/WizardContext/index.js.map +1 -0
  39. package/dist/Wizard/WizardTitle/WizardTitle.d.ts +40 -0
  40. package/dist/Wizard/WizardTitle/WizardTitle.js +221 -0
  41. package/dist/Wizard/WizardTitle/WizardTitle.js.map +1 -0
  42. package/dist/Wizard/WizardTitle/index.d.ts +2 -0
  43. package/dist/Wizard/WizardTitle/index.js +16 -0
  44. package/dist/Wizard/WizardTitle/index.js.map +1 -0
  45. package/dist/Wizard/WizardTitle/styles.js +41 -0
  46. package/dist/Wizard/WizardTitle/styles.js.map +1 -0
  47. package/dist/Wizard/index.d.ts +17 -0
  48. package/dist/Wizard/index.js +64 -0
  49. package/dist/Wizard/index.js.map +1 -0
  50. package/dist/Wizard/styles.js +16 -0
  51. package/dist/Wizard/styles.js.map +1 -0
  52. package/dist/index.d.ts +3 -0
  53. package/dist/index.js +22 -1
  54. package/dist/index.js.map +1 -1
  55. package/dist/legacy/Wizard/Wizard.d.ts +63 -0
  56. package/dist/legacy/Wizard/Wizard.js +211 -0
  57. package/dist/legacy/Wizard/Wizard.js.map +1 -0
  58. package/dist/legacy/Wizard/WizardActions/WizardActions.d.ts +61 -0
  59. package/dist/legacy/Wizard/WizardActions/WizardActions.js +226 -0
  60. package/dist/legacy/Wizard/WizardActions/WizardActions.js.map +1 -0
  61. package/dist/legacy/Wizard/WizardActions/index.d.ts +2 -0
  62. package/dist/legacy/Wizard/WizardActions/index.js +2 -0
  63. package/dist/legacy/Wizard/WizardActions/index.js.map +1 -0
  64. package/dist/legacy/Wizard/WizardActions/styles.js +22 -0
  65. package/dist/legacy/Wizard/WizardActions/styles.js.map +1 -0
  66. package/dist/legacy/Wizard/WizardContainer/WizardContainer.d.ts +28 -0
  67. package/dist/legacy/Wizard/WizardContainer/WizardContainer.js +75 -0
  68. package/dist/legacy/Wizard/WizardContainer/WizardContainer.js.map +1 -0
  69. package/dist/legacy/Wizard/WizardContainer/index.d.ts +2 -0
  70. package/dist/legacy/Wizard/WizardContainer/index.js +2 -0
  71. package/dist/legacy/Wizard/WizardContainer/index.js.map +1 -0
  72. package/dist/legacy/Wizard/WizardContainer/styles.js +15 -0
  73. package/dist/legacy/Wizard/WizardContainer/styles.js.map +1 -0
  74. package/dist/legacy/Wizard/WizardContent/LoadingContainer.js +58 -0
  75. package/dist/legacy/Wizard/WizardContent/LoadingContainer.js.map +1 -0
  76. package/dist/legacy/Wizard/WizardContent/WizardContent.d.ts +28 -0
  77. package/dist/legacy/Wizard/WizardContent/WizardContent.js +129 -0
  78. package/dist/legacy/Wizard/WizardContent/WizardContent.js.map +1 -0
  79. package/dist/legacy/Wizard/WizardContent/index.d.ts +2 -0
  80. package/dist/legacy/Wizard/WizardContent/index.js +2 -0
  81. package/dist/legacy/Wizard/WizardContent/index.js.map +1 -0
  82. package/dist/legacy/Wizard/WizardContent/styles.js +16 -0
  83. package/dist/legacy/Wizard/WizardContent/styles.js.map +1 -0
  84. package/dist/legacy/Wizard/WizardContext/WizardContext.d.ts +12 -0
  85. package/dist/legacy/Wizard/WizardContext/WizardContext.js +12 -0
  86. package/dist/legacy/Wizard/WizardContext/WizardContext.js.map +1 -0
  87. package/dist/legacy/Wizard/WizardContext/WizardContextProvider.d.ts +28 -0
  88. package/dist/legacy/Wizard/WizardContext/WizardContextProvider.js +35 -0
  89. package/dist/legacy/Wizard/WizardContext/WizardContextProvider.js.map +1 -0
  90. package/dist/legacy/Wizard/WizardContext/index.d.ts +5 -0
  91. package/dist/legacy/Wizard/WizardContext/index.js +3 -0
  92. package/dist/legacy/Wizard/WizardContext/index.js.map +1 -0
  93. package/dist/legacy/Wizard/WizardTitle/WizardTitle.d.ts +40 -0
  94. package/dist/legacy/Wizard/WizardTitle/WizardTitle.js +198 -0
  95. package/dist/legacy/Wizard/WizardTitle/WizardTitle.js.map +1 -0
  96. package/dist/legacy/Wizard/WizardTitle/index.d.ts +2 -0
  97. package/dist/legacy/Wizard/WizardTitle/index.js +2 -0
  98. package/dist/legacy/Wizard/WizardTitle/index.js.map +1 -0
  99. package/dist/legacy/Wizard/WizardTitle/styles.js +33 -0
  100. package/dist/legacy/Wizard/WizardTitle/styles.js.map +1 -0
  101. package/dist/legacy/Wizard/index.d.ts +17 -0
  102. package/dist/legacy/Wizard/index.js +8 -0
  103. package/dist/legacy/Wizard/index.js.map +1 -0
  104. package/dist/legacy/Wizard/styles.js +8 -0
  105. package/dist/legacy/Wizard/styles.js.map +1 -0
  106. package/dist/legacy/index.d.ts +3 -0
  107. package/dist/legacy/index.js +2 -0
  108. package/dist/legacy/index.js.map +1 -1
  109. package/dist/modern/Wizard/Wizard.d.ts +63 -0
  110. package/dist/modern/Wizard/Wizard.js +198 -0
  111. package/dist/modern/Wizard/Wizard.js.map +1 -0
  112. package/dist/modern/Wizard/WizardActions/WizardActions.d.ts +61 -0
  113. package/dist/modern/Wizard/WizardActions/WizardActions.js +186 -0
  114. package/dist/modern/Wizard/WizardActions/WizardActions.js.map +1 -0
  115. package/dist/modern/Wizard/WizardActions/index.d.ts +2 -0
  116. package/dist/modern/Wizard/WizardActions/index.js +2 -0
  117. package/dist/modern/Wizard/WizardActions/index.js.map +1 -0
  118. package/dist/modern/Wizard/WizardActions/styles.js +20 -0
  119. package/dist/modern/Wizard/WizardActions/styles.js.map +1 -0
  120. package/dist/modern/Wizard/WizardContainer/WizardContainer.d.ts +28 -0
  121. package/dist/modern/Wizard/WizardContainer/WizardContainer.js +77 -0
  122. package/dist/modern/Wizard/WizardContainer/WizardContainer.js.map +1 -0
  123. package/dist/modern/Wizard/WizardContainer/index.d.ts +2 -0
  124. package/dist/modern/Wizard/WizardContainer/index.js +2 -0
  125. package/dist/modern/Wizard/WizardContainer/index.js.map +1 -0
  126. package/dist/modern/Wizard/WizardContainer/styles.js +13 -0
  127. package/dist/modern/Wizard/WizardContainer/styles.js.map +1 -0
  128. package/dist/modern/Wizard/WizardContent/LoadingContainer.js +58 -0
  129. package/dist/modern/Wizard/WizardContent/LoadingContainer.js.map +1 -0
  130. package/dist/modern/Wizard/WizardContent/WizardContent.d.ts +28 -0
  131. package/dist/modern/Wizard/WizardContent/WizardContent.js +119 -0
  132. package/dist/modern/Wizard/WizardContent/WizardContent.js.map +1 -0
  133. package/dist/modern/Wizard/WizardContent/index.d.ts +2 -0
  134. package/dist/modern/Wizard/WizardContent/index.js +2 -0
  135. package/dist/modern/Wizard/WizardContent/index.js.map +1 -0
  136. package/dist/modern/Wizard/WizardContent/styles.js +14 -0
  137. package/dist/modern/Wizard/WizardContent/styles.js.map +1 -0
  138. package/dist/modern/Wizard/WizardContext/WizardContext.d.ts +12 -0
  139. package/dist/modern/Wizard/WizardContext/WizardContext.js +12 -0
  140. package/dist/modern/Wizard/WizardContext/WizardContext.js.map +1 -0
  141. package/dist/modern/Wizard/WizardContext/WizardContextProvider.d.ts +28 -0
  142. package/dist/modern/Wizard/WizardContext/WizardContextProvider.js +36 -0
  143. package/dist/modern/Wizard/WizardContext/WizardContextProvider.js.map +1 -0
  144. package/dist/modern/Wizard/WizardContext/index.d.ts +5 -0
  145. package/dist/modern/Wizard/WizardContext/index.js +3 -0
  146. package/dist/modern/Wizard/WizardContext/index.js.map +1 -0
  147. package/dist/modern/Wizard/WizardTitle/WizardTitle.d.ts +40 -0
  148. package/dist/modern/Wizard/WizardTitle/WizardTitle.js +182 -0
  149. package/dist/modern/Wizard/WizardTitle/WizardTitle.js.map +1 -0
  150. package/dist/modern/Wizard/WizardTitle/index.d.ts +2 -0
  151. package/dist/modern/Wizard/WizardTitle/index.js +2 -0
  152. package/dist/modern/Wizard/WizardTitle/index.js.map +1 -0
  153. package/dist/modern/Wizard/WizardTitle/styles.js +31 -0
  154. package/dist/modern/Wizard/WizardTitle/styles.js.map +1 -0
  155. package/dist/modern/Wizard/index.d.ts +17 -0
  156. package/dist/modern/Wizard/index.js +8 -0
  157. package/dist/modern/Wizard/index.js.map +1 -0
  158. package/dist/modern/Wizard/styles.js +6 -0
  159. package/dist/modern/Wizard/styles.js.map +1 -0
  160. package/dist/modern/index.d.ts +3 -0
  161. package/dist/modern/index.js +2 -0
  162. package/dist/modern/index.js.map +1 -1
  163. package/package.json +3 -3
@@ -0,0 +1,61 @@
1
+ import * as React from "react";
2
+ import { ModalProps, StandardProps } from "@material-ui/core";
3
+
4
+ export type HvWizardActionsClassKey = "root";
5
+
6
+ export type HvWizardActionsProps = StandardProps<
7
+ React.HTMLAttributes<HTMLDivElement>,
8
+ HvWizardActionsClassKey
9
+ > & {
10
+ /**
11
+ * Current tab to check if it's last page or first to disable previous button and swap between next and submit button.
12
+ */
13
+ tab: number;
14
+ /**
15
+ * Function to change the tab when pressing previous and next buttons.
16
+ */
17
+ changeTab: any;
18
+ /**
19
+ * Function to handle the cancel button.
20
+ */
21
+ handleClose: ModalProps["onClose"];
22
+ /**
23
+ * Function to handle the submit button. Also sends the current context state.
24
+ */
25
+ handleSubmit: (context: any) => void;
26
+ /**
27
+ * An object containing all the labels for the wizard actions component.
28
+ */
29
+ labels?: {
30
+ /**
31
+ * Cancel button label.
32
+ */
33
+ cancel: string;
34
+ /**
35
+ * Skip button label.
36
+ */
37
+ skip: string;
38
+ /**
39
+ * Previous button label.
40
+ */
41
+ previous: string;
42
+ /**
43
+ * Next button label.
44
+ */
45
+ next: string;
46
+ /**
47
+ * Submit button label.
48
+ */
49
+ submit: string;
50
+ };
51
+ /**
52
+ * Whether the submit button is disabled.
53
+ */
54
+ loading?: boolean;
55
+ /**
56
+ * Enables the skip button.
57
+ */
58
+ skippable?: boolean;
59
+ };
60
+
61
+ export default function HvWizardActions(props: HvWizardActionsProps): JSX.Element | null;
@@ -0,0 +1,186 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+
3
+ var _Backwards, _Forwards;
4
+
5
+ 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; }
6
+
7
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
+
9
+ import "core-js/modules/web.dom-collections.iterator.js";
10
+ import React from "react";
11
+ import PropTypes from "prop-types";
12
+ import { withStyles } from "@material-ui/core";
13
+ import clsx from "clsx";
14
+ import { HvButton, HvDialogActions, HvGrid } from "@hitachivantara/uikit-react-core";
15
+ import { Backwards, Forwards } from "@hitachivantara/uikit-react-icons";
16
+ import HvWizardContext from "../WizardContext";
17
+ import styles from "./styles";
18
+
19
+ const HvWizardActions = ({
20
+ classes,
21
+ handleClose,
22
+ handleSubmit,
23
+ changeTab,
24
+ tab,
25
+ loading = false,
26
+ skippable = false,
27
+ labels = {
28
+ cancel: "Cancel",
29
+ next: "Next",
30
+ previous: "Previous",
31
+ skip: "Skip",
32
+ submit: "Submit"
33
+ }
34
+ }) => {
35
+ var _labels$cancel, _labels$skip, _labels$previous, _labels$submit, _context$tab, _labels$next;
36
+
37
+ const {
38
+ context,
39
+ setContext
40
+ } = React.useContext(HvWizardContext);
41
+ const [pages, setPages] = React.useState(0);
42
+ const [canSubmit, setCanSubmit] = React.useState(false);
43
+ React.useEffect(() => {
44
+ const contextEntries = Object.entries(context);
45
+
46
+ if (contextEntries.length) {
47
+ setPages(contextEntries.length);
48
+ const validWizard = Object.entries(context).every(([, value]) => value.valid);
49
+
50
+ if (validWizard !== canSubmit) {
51
+ setCanSubmit(validWizard);
52
+ }
53
+ }
54
+ }, [context]); // eslint-disable-line react-hooks/exhaustive-deps
55
+
56
+ const lastPage = pages - 1;
57
+ const isLastPage = tab >= lastPage;
58
+ const handleSkip = React.useCallback(() => {
59
+ const skippedContext = Object.entries(context).map(([, child]) => _objectSpread(_objectSpread({}, child), {}, {
60
+ valid: child.valid !== false
61
+ }));
62
+ setContext(skippedContext);
63
+ changeTab(lastPage);
64
+ }, [changeTab, context, lastPage, setContext]);
65
+ const handleSubmitInternal = React.useCallback(() => handleSubmit(context), [handleSubmit, context]);
66
+ return /*#__PURE__*/React.createElement(HvDialogActions, {
67
+ className: classes.actionsContainer
68
+ }, /*#__PURE__*/React.createElement(HvGrid, null, /*#__PURE__*/React.createElement(HvButton, {
69
+ category: "ghost",
70
+ onClick: handleClose,
71
+ className: classes.buttonWidth
72
+ }, `${(_labels$cancel = labels.cancel) !== null && _labels$cancel !== void 0 ? _labels$cancel : "Cancel"}`), /*#__PURE__*/React.createElement(HvButton, {
73
+ category: "ghost",
74
+ disabled: isLastPage || !skippable,
75
+ className: classes.buttonWidth,
76
+ onClick: handleSkip
77
+ }, `${(_labels$skip = labels.skip) !== null && _labels$skip !== void 0 ? _labels$skip : "Skip"}`)), /*#__PURE__*/React.createElement(HvGrid, {
78
+ className: classes.buttonsContainer
79
+ }, /*#__PURE__*/React.createElement(HvButton, {
80
+ category: "ghost",
81
+ className: classes.buttonWidth,
82
+ disabled: tab <= 0,
83
+ onClick: () => changeTab(t => t - 1)
84
+ }, _Backwards || (_Backwards = /*#__PURE__*/React.createElement(Backwards, null)), `${(_labels$previous = labels.previous) !== null && _labels$previous !== void 0 ? _labels$previous : "Previous"}`), isLastPage ? /*#__PURE__*/React.createElement(HvButton, {
85
+ category: "primary",
86
+ className: classes.buttonWidth,
87
+ disabled: loading || !canSubmit,
88
+ onClick: handleSubmitInternal
89
+ }, `${(_labels$submit = labels.submit) !== null && _labels$submit !== void 0 ? _labels$submit : "Submit"}`) : /*#__PURE__*/React.createElement(HvButton, {
90
+ category: "ghost",
91
+ className: clsx(classes.buttonWidth, classes.buttonSpacing),
92
+ onClick: () => changeTab(t => t + 1),
93
+ disabled: !skippable && !(context !== null && context !== void 0 && (_context$tab = context[tab]) !== null && _context$tab !== void 0 && _context$tab.valid)
94
+ }, `${(_labels$next = labels.next) !== null && _labels$next !== void 0 ? _labels$next : "Next"}`, _Forwards || (_Forwards = /*#__PURE__*/React.createElement(Forwards, null)))));
95
+ };
96
+
97
+ process.env.NODE_ENV !== "production" ? HvWizardActions.propTypes = {
98
+ /**
99
+ * A Jss Object used to override or extend the styles applied.
100
+ */
101
+ classes: PropTypes.shape({
102
+ /**
103
+ * Styles applied to the component which contains the groups of buttons.
104
+ */
105
+ actionsContainer: PropTypes.string,
106
+
107
+ /**
108
+ * Styles applied to the component which contains the buttons.
109
+ */
110
+ buttonsContainer: PropTypes.string,
111
+
112
+ /**
113
+ * Styles applied to the Button component to override its width.
114
+ */
115
+ buttonWidth: PropTypes.string,
116
+
117
+ /**
118
+ * Styles applied to some Button components to override its left padding.
119
+ */
120
+ buttonSpacing: PropTypes.string
121
+ }).isRequired,
122
+
123
+ /**
124
+ * Current tab to check if it's last page or first to disable previous button and swap between next and submit button.
125
+ */
126
+ tab: PropTypes.number.isRequired,
127
+
128
+ /**
129
+ * Function to change the tab when pressing previous and next buttons.
130
+ */
131
+ changeTab: PropTypes.func.isRequired,
132
+
133
+ /**
134
+ * Function to handle the cancel button.
135
+ */
136
+ handleClose: PropTypes.func.isRequired,
137
+
138
+ /**
139
+ * Function to handle the submit button. Also sends the current context state.
140
+ */
141
+ handleSubmit: PropTypes.func.isRequired,
142
+
143
+ /**
144
+ * An object containing all the labels for the wizard actions component.
145
+ */
146
+ labels: PropTypes.shape({
147
+ /**
148
+ * Cancel button label.
149
+ */
150
+ cancel: PropTypes.string,
151
+
152
+ /**
153
+ * Skip button label.
154
+ */
155
+ skip: PropTypes.string,
156
+
157
+ /**
158
+ * Previous button label.
159
+ */
160
+ previous: PropTypes.string,
161
+
162
+ /**
163
+ * Next button label.
164
+ */
165
+ next: PropTypes.string,
166
+
167
+ /**
168
+ * Submit button label.
169
+ */
170
+ submit: PropTypes.string
171
+ }),
172
+
173
+ /**
174
+ * Whether the submit button is disabled.
175
+ */
176
+ loading: PropTypes.bool,
177
+
178
+ /**
179
+ * Enables the skip button.
180
+ */
181
+ skippable: PropTypes.bool
182
+ } : void 0;
183
+ export default withStyles(styles, {
184
+ name: "HvWizardActions"
185
+ })(HvWizardActions);
186
+ //# sourceMappingURL=WizardActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WizardActions.js","names":["React","PropTypes","withStyles","clsx","HvButton","HvDialogActions","HvGrid","Backwards","Forwards","HvWizardContext","styles","HvWizardActions","classes","handleClose","handleSubmit","changeTab","tab","loading","skippable","labels","cancel","next","previous","skip","submit","context","setContext","useContext","pages","setPages","useState","canSubmit","setCanSubmit","useEffect","contextEntries","Object","entries","length","validWizard","every","value","valid","lastPage","isLastPage","handleSkip","useCallback","skippedContext","map","child","handleSubmitInternal","actionsContainer","buttonWidth","buttonsContainer","t","buttonSpacing","propTypes","shape","string","isRequired","number","func","bool","name"],"sources":["../../../../src/Wizard/WizardActions/WizardActions.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@material-ui/core\";\nimport clsx from \"clsx\";\nimport { HvButton, HvDialogActions, HvGrid } from \"@hitachivantara/uikit-react-core\";\nimport { Backwards, Forwards } from \"@hitachivantara/uikit-react-icons\";\nimport HvWizardContext from \"../WizardContext\";\n\nimport styles from \"./styles\";\n\nconst HvWizardActions = ({\n classes,\n handleClose,\n handleSubmit,\n changeTab,\n tab,\n loading = false,\n skippable = false,\n labels = {\n cancel: \"Cancel\",\n next: \"Next\",\n previous: \"Previous\",\n skip: \"Skip\",\n submit: \"Submit\",\n },\n}) => {\n const { context, setContext } = React.useContext(HvWizardContext);\n const [pages, setPages] = React.useState(0);\n const [canSubmit, setCanSubmit] = React.useState(false);\n\n React.useEffect(() => {\n const contextEntries = Object.entries(context);\n if (contextEntries.length) {\n setPages(contextEntries.length);\n\n const validWizard = Object.entries(context).every(([, value]) => value.valid);\n if (validWizard !== canSubmit) {\n setCanSubmit(validWizard);\n }\n }\n }, [context]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const lastPage = pages - 1;\n const isLastPage = tab >= lastPage;\n\n const handleSkip = React.useCallback(() => {\n const skippedContext = Object.entries(context).map(([, child]) => ({\n ...child,\n valid: child.valid !== false,\n }));\n setContext(skippedContext);\n changeTab(lastPage);\n }, [changeTab, context, lastPage, setContext]);\n const handleSubmitInternal = React.useCallback(\n () => handleSubmit(context),\n [handleSubmit, context]\n );\n\n return (\n <HvDialogActions className={classes.actionsContainer}>\n <HvGrid>\n <HvButton category=\"ghost\" onClick={handleClose} className={classes.buttonWidth}>\n {`${labels.cancel ?? \"Cancel\"}`}\n </HvButton>\n <HvButton\n category=\"ghost\"\n disabled={isLastPage || !skippable}\n className={classes.buttonWidth}\n onClick={handleSkip}\n >\n {`${labels.skip ?? \"Skip\"}`}\n </HvButton>\n </HvGrid>\n <HvGrid className={classes.buttonsContainer}>\n <HvButton\n category=\"ghost\"\n className={classes.buttonWidth}\n disabled={tab <= 0}\n onClick={() => changeTab((t) => t - 1)}\n >\n <Backwards />\n {`${labels.previous ?? \"Previous\"}`}\n </HvButton>\n\n {isLastPage ? (\n <HvButton\n category=\"primary\"\n className={classes.buttonWidth}\n disabled={loading || !canSubmit}\n onClick={handleSubmitInternal}\n >\n {`${labels.submit ?? \"Submit\"}`}\n </HvButton>\n ) : (\n <HvButton\n category=\"ghost\"\n className={clsx(classes.buttonWidth, classes.buttonSpacing)}\n onClick={() => changeTab((t) => t + 1)}\n disabled={!skippable && !context?.[tab]?.valid}\n >\n {`${labels.next ?? \"Next\"}`}\n <Forwards />\n </HvButton>\n )}\n </HvGrid>\n </HvDialogActions>\n );\n};\n\nHvWizardActions.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component which contains the groups of buttons.\n */\n actionsContainer: PropTypes.string,\n /**\n * Styles applied to the component which contains the buttons.\n */\n buttonsContainer: PropTypes.string,\n /**\n * Styles applied to the Button component to override its width.\n */\n buttonWidth: PropTypes.string,\n /**\n * Styles applied to some Button components to override its left padding.\n */\n buttonSpacing: PropTypes.string,\n }).isRequired,\n /**\n * Current tab to check if it's last page or first to disable previous button and swap between next and submit button.\n */\n tab: PropTypes.number.isRequired,\n /**\n * Function to change the tab when pressing previous and next buttons.\n */\n changeTab: PropTypes.func.isRequired,\n /**\n * Function to handle the cancel button.\n */\n handleClose: PropTypes.func.isRequired,\n /**\n * Function to handle the submit button. Also sends the current context state.\n */\n handleSubmit: PropTypes.func.isRequired,\n /**\n * An object containing all the labels for the wizard actions component.\n */\n labels: PropTypes.shape({\n /**\n * Cancel button label.\n */\n cancel: PropTypes.string,\n /**\n * Skip button label.\n */\n skip: PropTypes.string,\n /**\n * Previous button label.\n */\n previous: PropTypes.string,\n /**\n * Next button label.\n */\n next: PropTypes.string,\n /**\n * Submit button label.\n */\n submit: PropTypes.string,\n }),\n /**\n * Whether the submit button is disabled.\n */\n loading: PropTypes.bool,\n /**\n * Enables the skip button.\n */\n skippable: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvWizardActions\" })(HvWizardActions);\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,UAAT,QAA2B,mBAA3B;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,SAASC,QAAT,EAAmBC,eAAnB,EAAoCC,MA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AACwD;EAhBF,CAAhB,EAiBNC,UArBuB;;EAsB1B;AACF;AACA;EACE1C,GAAG,EAAEf,SAAS,CAAC0D,MAAV,CAAiBD,UAzBI;;EA0B1B;AACF;AACA;EACE3C,SAAS,EAAEd,SAAS,CAAC2D,IAAV,CAAeF,UA7BA;;EA8B1B;AACF;AACA;EACE7C,WAAW,EAAEZ,SAAS,CAAC2D,IAAV,CAAeF,UAjCF;;EAkC1B;AACF;AACA;EACE5C,YAAY,EAAEb,SAAS,CAAC2D,IAAV,CAAeF,UArCH;;EAsC1B;AACF;AACA;EACEvC,MAAM,EAAElB,SAAS,CAACuD,KAAV,CAAgB;IACtB;AACJ;AACA;IACIpC,MAAM,EAAEnB,SAAS,CAACwD,MAJI;;IAKtB;AACJ;AACA;IACIlC,IAAI,EAAEtB,SAAS,CAACwD,MARM;;IAStB;AACJ;AACA;IACInC,QAAQ,EAAErB,SAAS,CAACwD,MAZE;;IAatB;AACJ;AACA;IACIpC,IAAI,EAAEpB,SAAS,CAACwD,MAhBM;;IAiBtB;AACJ;AACA;IACIjC,MAAM,EAAEvB,SAAS,CAACwD;EApBI,CAAhB,CAzCkB;;EA+D1B;AACF;AACA;EACExC,OAAO,EAAEhB,SAAS,CAAC4D,IAlEO;;EAmE1B;AACF;AACA;EACE3C,SAAS,EAAEjB,SAAS,CAAC4D;AAtEK,CAA5B;AAyEA,eAAe3D,UAAU,CAACQ,MAAD,EAAS;EAAEoD,IAAI,EAAE;AAAR,CAAT,CAAV,CAAgDnD,eAAhD,CAAf"}
@@ -0,0 +1,2 @@
1
+ export { default } from "./WizardActions";
2
+ export * from "./WizardActions";
@@ -0,0 +1,2 @@
1
+ export { default } from "./WizardActions";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["default"],"sources":["../../../../src/Wizard/WizardActions/index.js"],"sourcesContent":["export { default } from \"./WizardActions\";\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,iBAAxB"}
@@ -0,0 +1,20 @@
1
+ const styles = () => ({
2
+ buttonWidth: {
3
+ width: 120
4
+ },
5
+ actionsContainer: {
6
+ display: "flex",
7
+ justifyContent: "space-between"
8
+ },
9
+ buttonsContainer: {
10
+ "& > button:last-child": {
11
+ marginLeft: 20
12
+ }
13
+ },
14
+ buttonSpacing: {
15
+ paddingLeft: 28
16
+ }
17
+ });
18
+
19
+ export default styles;
20
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","names":["styles","buttonWidth","width","actionsContainer","display","justifyContent","buttonsContainer","marginLeft","buttonSpacing","paddingLeft"],"sources":["../../../../src/Wizard/WizardActions/styles.js"],"sourcesContent":["const styles = () => ({\n buttonWidth: {\n width: 120,\n },\n actionsContainer: {\n display: \"flex\",\n justifyContent: \"space-between\",\n },\n buttonsContainer: {\n \"& > button:last-child\": {\n marginLeft: 20,\n },\n },\n buttonSpacing: {\n paddingLeft: 28,\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAG,OAAO;EACpBC,WAAW,EAAE;IACXC,KAAK,EAAE;EADI,CADO;EAIpBC,gBAAgB,EAAE;IAChBC,OAAO,EAAE,MADO;IAEhBC,cAAc,EAAE;EAFA,CAJE;EAQpBC,gBAAgB,EAAE;IAChB,yBAAyB;MACvBC,UAAU,EAAE;IADW;EADT,CARE;EAapBC,aAAa,EAAE;IACbC,WAAW,EAAE;EADA;AAbK,CAAP,CAAf;;AAkBA,eAAeT,MAAf"}
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import { StandardProps, ModalProps } from "@material-ui/core";
3
+
4
+ export type HvWizardContainerClassKey = "root";
5
+
6
+ export type HvWizardContainerProps = StandardProps<
7
+ React.HTMLAttributes<HTMLDivElement>,
8
+ HvWizardContainerClassKey
9
+ > & {
10
+ /**
11
+ * Class names to be applied.
12
+ */
13
+ className?: string;
14
+ /**
15
+ * Components of the Wizard.
16
+ */
17
+ children?: React.ReactNode;
18
+ /**
19
+ * Current state of the Wizard.
20
+ */
21
+ open: boolean;
22
+ /**
23
+ * Function executed on close.
24
+ */
25
+ handleClose: ModalProps["onClose"];
26
+ };
27
+
28
+ export default function HvWizardContainer(props: HvWizardContainerProps): JSX.Element | null;
@@ -0,0 +1,77 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ const _excluded = ["classes", "className", "children", "handleClose", "open"];
4
+ import React from "react";
5
+ import PropTypes from "prop-types";
6
+ import clsx from "clsx";
7
+ import { withStyles } from "@material-ui/core";
8
+ import { HvDialog } from "@hitachivantara/uikit-react-core";
9
+ import styles from "./styles";
10
+
11
+ const HvWizardContainer = _ref => {
12
+ let {
13
+ classes,
14
+ className,
15
+ children,
16
+ handleClose,
17
+ open
18
+ } = _ref,
19
+ others = _objectWithoutProperties(_ref, _excluded);
20
+
21
+ return /*#__PURE__*/React.createElement(HvDialog, _extends({
22
+ classes: {
23
+ closeButton: classes.closeButton,
24
+ paper: classes.paper
25
+ } // overrides css
26
+ ,
27
+ className: clsx(className, classes.root),
28
+ open: open,
29
+ onClose: handleClose
30
+ }, others), children);
31
+ };
32
+
33
+ process.env.NODE_ENV !== "production" ? HvWizardContainer.propTypes = {
34
+ /**
35
+ * Class names to be applied.
36
+ */
37
+ className: PropTypes.string,
38
+
39
+ /**
40
+ * A Jss Object used to override or extend the styles applied.
41
+ */
42
+ classes: PropTypes.shape({
43
+ /**
44
+ * Styles applied to the component root class.
45
+ */
46
+ root: PropTypes.string,
47
+
48
+ /**
49
+ * Style applied to the component (root).
50
+ */
51
+ paper: PropTypes.string,
52
+
53
+ /**
54
+ * Style applied to the close button.
55
+ */
56
+ closeButton: PropTypes.string
57
+ }).isRequired,
58
+
59
+ /**
60
+ * Components of the Wizard.
61
+ */
62
+ children: PropTypes.node.isRequired,
63
+
64
+ /**
65
+ * Current state of the Wizard.
66
+ */
67
+ open: PropTypes.bool.isRequired,
68
+
69
+ /**
70
+ * Function executed on close.
71
+ */
72
+ handleClose: PropTypes.func.isRequired
73
+ } : void 0;
74
+ export default withStyles(styles, {
75
+ name: "HvWizardContainer"
76
+ })(HvWizardContainer);
77
+ //# sourceMappingURL=WizardContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WizardContainer.js","names":["React","PropTypes","clsx","withStyles","HvDialog","styles","HvWizardContainer","classes","className","children","handleClose","open","others","closeButton","paper","root","propTypes","string","shape","isRequired","node","bool","func","name"],"sources":["../../../../src/Wizard/WizardContainer/WizardContainer.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { withStyles } from \"@material-ui/core\";\nimport { HvDialog } from \"@hitachivantara/uikit-react-core\";\n\nimport styles from \"./styles\";\n\nconst HvWizardContainer = ({ classes, className, children, handleClose, open, ...others }) => {\n return (\n <HvDialog\n classes={{ closeButton: classes.closeButton, paper: classes.paper }} // overrides css\n className={clsx(className, classes.root)}\n open={open}\n onClose={handleClose}\n {...others}\n >\n {children}\n </HvDialog>\n );\n};\n\nHvWizardContainer.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Style applied to the component (root).\n */\n paper: PropTypes.string,\n /**\n * Style applied to the close button.\n */\n closeButton: PropTypes.string,\n }).isRequired,\n /**\n * Components of the Wizard.\n */\n children: PropTypes.node.isRequired,\n /**\n * Current state of the Wizard.\n */\n open: PropTypes.bool.isRequired,\n /**\n * Function executed on close.\n */\n handleClose: PropTypes.func.isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvWizardContainer\" })(HvWizardContainer);\n"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,SAAS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+1,2 @@
1
+ export { default } from "./WizardContainer";
2
+ export * from "./WizardContainer";
@@ -0,0 +1,2 @@
1
+ export { default } from "./WizardContainer";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["default"],"sources":["../../../../src/Wizard/WizardContainer/index.js"],"sourcesContent":["export { default } from \"./WizardContainer\";\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,mBAAxB"}
@@ -0,0 +1,13 @@
1
+ const styles = () => ({
2
+ root: {},
3
+ paper: {
4
+ width: "80%",
5
+ maxWidth: "80%"
6
+ },
7
+ closeButton: {
8
+ display: "none"
9
+ }
10
+ });
11
+
12
+ export default styles;
13
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","names":["styles","root","paper","width","maxWidth","closeButton","display"],"sources":["../../../../src/Wizard/WizardContainer/styles.js"],"sourcesContent":["const styles = () => ({\n root: {},\n paper: {\n width: \"80%\",\n maxWidth: \"80%\",\n },\n closeButton: {\n display: \"none\",\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAG,OAAO;EACpBC,IAAI,EAAE,EADc;EAEpBC,KAAK,EAAE;IACLC,KAAK,EAAE,KADF;IAELC,QAAQ,EAAE;EAFL,CAFa;EAMpBC,WAAW,EAAE;IACXC,OAAO,EAAE;EADE;AANO,CAAP,CAAf;;AAWA,eAAeN,MAAf"}
@@ -0,0 +1,58 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ const _excluded = ["children", "hidden"];
4
+ import React from "react";
5
+ import PropTypes from "prop-types";
6
+ import clsx from "clsx";
7
+ import { HvLoading } from "@hitachivantara/uikit-react-core";
8
+ import { makeStyles, alpha, hexToRgb } from "@material-ui/core";
9
+ const useStyles = makeStyles(theme => ({
10
+ loading: {
11
+ width: "100%",
12
+ height: "100%"
13
+ },
14
+ overlay: {
15
+ position: "absolute",
16
+ transition: "background-Color .2s ease",
17
+ zIndex: -1
18
+ },
19
+ blur: {
20
+ backgroundColor: alpha(hexToRgb(theme.hv.palette.atmosphere.atmo2), 0.8),
21
+ zIndex: theme.zIndex.drawer
22
+ }
23
+ }));
24
+
25
+ const LoadingContainer = _ref => {
26
+ let {
27
+ children,
28
+ hidden
29
+ } = _ref,
30
+ others = _objectWithoutProperties(_ref, _excluded);
31
+
32
+ const classes = useStyles();
33
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
34
+ style: {
35
+ top: 0,
36
+ left: 0,
37
+ height: "100%",
38
+ width: "100%"
39
+ },
40
+ className: clsx(classes.overlay, !hidden && classes.blur)
41
+ }, /*#__PURE__*/React.createElement(HvLoading, _extends({
42
+ classes: {
43
+ root: classes.loading
44
+ },
45
+ hidden: hidden
46
+ }, others))), /*#__PURE__*/React.createElement("div", {
47
+ style: {
48
+ display: "flow-root"
49
+ }
50
+ }, children));
51
+ };
52
+
53
+ process.env.NODE_ENV !== "production" ? LoadingContainer.propTypes = {
54
+ children: PropTypes.node,
55
+ hidden: PropTypes.bool
56
+ } : void 0;
57
+ export default LoadingContainer;
58
+ //# sourceMappingURL=LoadingContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoadingContainer.js","names":["React","PropTypes","clsx","HvLoading","makeStyles","alpha","hexToRgb","useStyles","theme","loading","width","height","overlay","position","transition","zIndex","blur","backgroundColor","hv","palette","atmosphere","atmo2","drawer","LoadingContainer","children","hidden","others","classes","top","left","root","display","propTypes","node","bool"],"sources":["../../../../src/Wizard/WizardContent/LoadingContainer.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { HvLoading } from \"@hitachivantara/uikit-react-core\";\nimport { makeStyles, alpha, hexToRgb } from \"@material-ui/core\";\n\nconst useStyles = makeStyles((theme) => ({\n loading: {\n width: \"100%\",\n height: \"100%\",\n },\n overlay: {\n position: \"absolute\",\n transition: \"background-Color .2s ease\",\n zIndex: -1,\n },\n blur: {\n backgroundColor: alpha(hexToRgb(theme.hv.palette.atmosphere.atmo2), 0.8),\n zIndex: theme.zIndex.drawer,\n },\n}));\n\nconst LoadingContainer = ({ children, hidden, ...others }) => {\n const classes = useStyles();\n\n return (\n <>\n <div\n style={{\n top: 0,\n left: 0,\n height: \"100%\",\n width: \"100%\",\n }}\n className={clsx(classes.overlay, { [classes.blur]: !hidden })}\n >\n <HvLoading classes={{ root: classes.loading }} hidden={hidden} {...others} />\n </div>\n <div style={{ display: \"flow-root\" }}>{children}</div>\n </>\n );\n};\n\nLoadingContainer.propTypes = {\n children: PropTypes.node,\n hidden: PropTypes.bool,\n};\n\nexport default LoadingContainer;\n"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,SAASC,SAAT,QAA0B,kCAA1B;AACA,SAASC,UAAT,EAAqBC,KAArB,EAA4BC,QAA5B,QAA4C,mBAA5C;AAEA,MAAMC,SAAS,GAAGH,UAAU,CAAEI,KAAD,KAAY;EACvCC,OAAO,EAAE;IACPC,KAAK,EAAE,MADA;IAEPC,MAAM,EAAE;EAFD,CAD8B;EAKvCC,OAAO,EAAE;IACPC,QAAQ,EAAE,UADH;IAEPC,UAAU,EAAE,2BAFL;IAGPC,MAAM,EAAE,CAAC;EAHF,CAL8B;EAUvCC,IAAI,EAAE;IACJC,eAAe,EAAEZ,KAAK,CAACC,QAAQ,CAACE,KAAK,CAACU,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BC,KAA7B,CAAT,EAA8C,GAA9C,CADlB;IAEJN,MAAM,EAAEP,KAAK,CAACO,MAAN,CAAaO;EAFjB;AAViC,CAAZ,CAAD,CAA5B;;AAgBA,MAAMC,gBAAgB,GAAG,QAAqC;EAAA,IAApC;IAAEC,QAAF;IAAYC;EAAZ,CAAoC;EAAA,IAAbC,MAAa;;EAC5D,MAAMC,OAAO,GAAGpB,SAAS,EAAzB;EAEA,oBACE,uDACE;IACE,KAAK,EAAE;MACLqB,GAAG,EAAE,CADA;MAELC,IAAI,EAAE,CAFD;MAGLlB,MAAM,EAAE,MAHH;MAILD,KAAK,EAAE;IAJF,CADT;IAOE,SAAS,EAAER,IAAI,CAACyB,OAAO,CAACf,OAAT,EAAoC,CAACa,MAArC,IAAqBE,OAAO,CAACX,IAA7B;EAPjB,gBASE,oBAAC,SAAD;IAAW,OAAO,EAAE;MAAEc,IAAI,EAAEH,OAAO,CAAClB;IAAhB,CAApB;IAA+C,MAAM,EAAEgB;EAAvD,GAAmEC,MAAnE,EATF,CADF,eAYE;IAAK,KAAK,EAAE;MAAEK,OAAO,EAAE;IAAX;EAAZ,GAAuCP,QAAvC,CAZF,CADF;AAgBD,CAnBD;;AAqBA,wCAAAD,gBAAgB,CAACS,SAAjB,GAA6B;EAC3BR,QAAQ,EAAEvB,SAAS,CAACgC,IADO;EAE3BR,MAAM,EAAExB,SAAS,CAACiC;AAFS,CAA7B;AAKA,eAAeX,gBAAf"}
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import { StandardProps } from "@material-ui/core";
3
+
4
+ export type HvWizardContentClassKey = "root";
5
+
6
+ export type HvWizardContentProps = StandardProps<
7
+ React.HTMLAttributes<HTMLDivElement>,
8
+ HvWizardContentClassKey
9
+ > & {
10
+ /**
11
+ * Tabs to show on the Wizard.
12
+ */
13
+ children?: React.ReactNode;
14
+ /**
15
+ * Current tab to show.
16
+ */
17
+ tab: number;
18
+ /**
19
+ * Forces minimum height to the component.
20
+ */
21
+ fixedHeight?: boolean;
22
+ /**
23
+ * Whether the loading animation is shown.
24
+ */
25
+ loading?: boolean;
26
+ };
27
+
28
+ export default function HvWizardContent(props: HvWizardContentProps): JSX.Element | null;