@dxc-technology/halstack-react 0.0.0-f0d662d → 0.0.0-f1bbdfe

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 (302) hide show
  1. package/BackgroundColorContext.d.ts +2 -2
  2. package/BackgroundColorContext.js +1 -1
  3. package/HalstackContext.d.ts +1336 -0
  4. package/HalstackContext.js +335 -0
  5. package/accordion/Accordion.d.ts +1 -1
  6. package/accordion/Accordion.js +118 -142
  7. package/accordion/Accordion.stories.tsx +115 -27
  8. package/accordion/Accordion.test.js +71 -0
  9. package/accordion/types.d.ts +8 -7
  10. package/accordion-group/AccordionGroup.d.ts +1 -1
  11. package/accordion-group/AccordionGroup.js +17 -38
  12. package/accordion-group/AccordionGroup.stories.tsx +28 -2
  13. package/accordion-group/AccordionGroup.test.js +126 -0
  14. package/accordion-group/types.d.ts +14 -7
  15. package/alert/Alert.js +8 -7
  16. package/alert/Alert.stories.tsx +28 -0
  17. package/alert/Alert.test.js +92 -0
  18. package/badge/Badge.d.ts +4 -0
  19. package/badge/Badge.js +5 -3
  20. package/badge/types.d.ts +5 -0
  21. package/bleed/Bleed.js +1 -34
  22. package/bleed/Bleed.stories.tsx +95 -95
  23. package/bleed/types.d.ts +25 -1
  24. package/box/Box.js +25 -37
  25. package/box/Box.stories.tsx +15 -0
  26. package/box/Box.test.js +18 -0
  27. package/box/types.d.ts +1 -0
  28. package/bulleted-list/BulletedList.d.ts +7 -0
  29. package/bulleted-list/BulletedList.js +125 -0
  30. package/bulleted-list/BulletedList.stories.tsx +206 -0
  31. package/bulleted-list/types.d.ts +38 -0
  32. package/button/Button.js +52 -70
  33. package/button/Button.stories.tsx +159 -8
  34. package/button/Button.test.js +35 -0
  35. package/button/types.d.ts +5 -5
  36. package/card/Card.js +33 -37
  37. package/card/Card.stories.tsx +12 -13
  38. package/card/Card.test.js +50 -0
  39. package/card/types.d.ts +1 -0
  40. package/checkbox/Checkbox.d.ts +2 -2
  41. package/checkbox/Checkbox.js +107 -110
  42. package/checkbox/Checkbox.stories.tsx +198 -130
  43. package/checkbox/Checkbox.test.js +155 -0
  44. package/checkbox/types.d.ts +11 -3
  45. package/chip/Chip.d.ts +1 -1
  46. package/chip/Chip.js +22 -68
  47. package/chip/Chip.stories.tsx +98 -13
  48. package/chip/Chip.test.js +54 -0
  49. package/chip/types.d.ts +5 -13
  50. package/common/OpenSans.css +68 -80
  51. package/common/coreTokens.d.ts +146 -0
  52. package/common/coreTokens.js +167 -0
  53. package/common/utils.d.ts +1 -0
  54. package/common/utils.js +4 -4
  55. package/common/variables.d.ts +1482 -0
  56. package/common/variables.js +1097 -1348
  57. package/date-input/Calendar.d.ts +4 -0
  58. package/date-input/Calendar.js +258 -0
  59. package/date-input/DateInput.js +169 -258
  60. package/date-input/DateInput.stories.tsx +199 -33
  61. package/date-input/DateInput.test.js +835 -0
  62. package/date-input/DatePicker.d.ts +4 -0
  63. package/date-input/DatePicker.js +146 -0
  64. package/date-input/Icons.d.ts +6 -0
  65. package/date-input/Icons.js +75 -0
  66. package/date-input/YearPicker.d.ts +4 -0
  67. package/date-input/YearPicker.js +126 -0
  68. package/date-input/types.d.ts +67 -9
  69. package/dialog/Dialog.js +76 -93
  70. package/dialog/Dialog.stories.tsx +230 -123
  71. package/dialog/Dialog.test.js +369 -0
  72. package/dialog/types.d.ts +1 -0
  73. package/dropdown/Dropdown.d.ts +1 -1
  74. package/dropdown/Dropdown.js +248 -277
  75. package/dropdown/Dropdown.stories.tsx +255 -64
  76. package/dropdown/Dropdown.test.js +586 -0
  77. package/dropdown/DropdownMenu.d.ts +4 -0
  78. package/dropdown/DropdownMenu.js +74 -0
  79. package/dropdown/DropdownMenuItem.d.ts +4 -0
  80. package/dropdown/DropdownMenuItem.js +79 -0
  81. package/dropdown/types.d.ts +27 -16
  82. package/file-input/FileInput.d.ts +2 -2
  83. package/file-input/FileInput.js +180 -223
  84. package/file-input/FileInput.stories.tsx +122 -11
  85. package/file-input/FileInput.test.js +457 -0
  86. package/file-input/FileItem.d.ts +4 -14
  87. package/file-input/FileItem.js +44 -66
  88. package/file-input/types.d.ts +17 -0
  89. package/flex/Flex.d.ts +4 -0
  90. package/flex/Flex.js +71 -0
  91. package/flex/Flex.stories.tsx +112 -0
  92. package/flex/types.d.ts +97 -0
  93. package/footer/Footer.js +17 -92
  94. package/footer/Footer.stories.tsx +99 -1
  95. package/footer/Footer.test.js +97 -0
  96. package/footer/Icons.js +1 -1
  97. package/footer/types.d.ts +2 -1
  98. package/grid/Grid.d.ts +7 -0
  99. package/grid/Grid.js +91 -0
  100. package/grid/Grid.stories.tsx +219 -0
  101. package/grid/types.d.ts +115 -0
  102. package/header/Header.d.ts +3 -2
  103. package/header/Header.js +108 -129
  104. package/header/Header.stories.tsx +189 -36
  105. package/header/Header.test.js +79 -0
  106. package/header/Icons.js +2 -2
  107. package/header/types.d.ts +1 -0
  108. package/heading/Heading.js +1 -1
  109. package/heading/Heading.test.js +186 -0
  110. package/inset/Inset.js +1 -34
  111. package/inset/Inset.stories.tsx +37 -36
  112. package/inset/types.d.ts +25 -1
  113. package/layout/ApplicationLayout.d.ts +16 -6
  114. package/layout/ApplicationLayout.js +72 -126
  115. package/layout/ApplicationLayout.stories.tsx +84 -93
  116. package/layout/Icons.d.ts +5 -0
  117. package/layout/Icons.js +13 -2
  118. package/layout/SidenavContext.d.ts +5 -0
  119. package/layout/SidenavContext.js +19 -0
  120. package/layout/types.d.ts +19 -35
  121. package/link/Link.d.ts +3 -2
  122. package/link/Link.js +63 -88
  123. package/link/Link.stories.tsx +159 -52
  124. package/link/Link.test.js +81 -0
  125. package/link/types.d.ts +7 -27
  126. package/main.d.ts +12 -15
  127. package/main.js +57 -75
  128. package/nav-tabs/NavTabs.d.ts +8 -0
  129. package/nav-tabs/NavTabs.js +125 -0
  130. package/nav-tabs/NavTabs.stories.tsx +260 -0
  131. package/nav-tabs/NavTabs.test.js +82 -0
  132. package/nav-tabs/Tab.d.ts +4 -0
  133. package/nav-tabs/Tab.js +150 -0
  134. package/nav-tabs/types.d.ts +53 -0
  135. package/nav-tabs/types.js +5 -0
  136. package/number-input/NumberInput.js +11 -18
  137. package/number-input/NumberInput.stories.tsx +5 -5
  138. package/number-input/NumberInput.test.js +542 -0
  139. package/number-input/types.d.ts +17 -10
  140. package/package.json +20 -23
  141. package/paginator/Icons.d.ts +5 -0
  142. package/paginator/Icons.js +16 -28
  143. package/paginator/Paginator.js +19 -48
  144. package/paginator/Paginator.stories.tsx +24 -0
  145. package/paginator/Paginator.test.js +305 -0
  146. package/paragraph/Paragraph.d.ts +5 -0
  147. package/paragraph/Paragraph.js +38 -0
  148. package/paragraph/Paragraph.stories.tsx +44 -0
  149. package/password-input/PasswordInput.js +7 -4
  150. package/password-input/PasswordInput.test.js +181 -0
  151. package/password-input/types.d.ts +14 -11
  152. package/progress-bar/ProgressBar.js +61 -55
  153. package/progress-bar/ProgressBar.stories.jsx +47 -12
  154. package/progress-bar/ProgressBar.test.js +110 -0
  155. package/quick-nav/QuickNav.d.ts +4 -0
  156. package/quick-nav/QuickNav.js +117 -0
  157. package/quick-nav/QuickNav.stories.tsx +356 -0
  158. package/quick-nav/types.d.ts +21 -0
  159. package/quick-nav/types.js +5 -0
  160. package/radio-group/Radio.d.ts +1 -1
  161. package/radio-group/Radio.js +53 -37
  162. package/radio-group/RadioGroup.js +67 -57
  163. package/radio-group/RadioGroup.stories.tsx +171 -36
  164. package/radio-group/RadioGroup.test.js +563 -89
  165. package/radio-group/types.d.ts +82 -4
  166. package/resultsetTable/Icons.d.ts +7 -0
  167. package/resultsetTable/Icons.js +51 -0
  168. package/resultsetTable/ResultsetTable.js +50 -106
  169. package/resultsetTable/ResultsetTable.stories.tsx +50 -25
  170. package/resultsetTable/ResultsetTable.test.js +325 -0
  171. package/resultsetTable/types.d.ts +1 -1
  172. package/select/Icons.d.ts +10 -0
  173. package/select/Icons.js +93 -0
  174. package/select/Listbox.d.ts +4 -0
  175. package/select/Listbox.js +169 -0
  176. package/select/Option.d.ts +4 -0
  177. package/select/Option.js +97 -0
  178. package/select/Select.js +189 -386
  179. package/select/Select.stories.tsx +600 -201
  180. package/select/Select.test.js +2228 -0
  181. package/select/types.d.ts +53 -13
  182. package/sidenav/Icons.d.ts +7 -0
  183. package/sidenav/Icons.js +51 -0
  184. package/sidenav/Sidenav.d.ts +6 -5
  185. package/sidenav/Sidenav.js +146 -44
  186. package/sidenav/Sidenav.stories.tsx +251 -151
  187. package/sidenav/Sidenav.test.js +44 -0
  188. package/sidenav/types.d.ts +52 -26
  189. package/slider/Slider.d.ts +2 -2
  190. package/slider/Slider.js +123 -98
  191. package/slider/Slider.stories.tsx +72 -9
  192. package/slider/Slider.test.js +250 -0
  193. package/slider/types.d.ts +8 -0
  194. package/spinner/Spinner.js +18 -24
  195. package/spinner/Spinner.stories.jsx +53 -27
  196. package/spinner/Spinner.test.js +64 -0
  197. package/switch/Switch.d.ts +2 -2
  198. package/switch/Switch.js +152 -69
  199. package/switch/Switch.stories.tsx +53 -42
  200. package/switch/Switch.test.js +225 -0
  201. package/switch/types.d.ts +10 -2
  202. package/table/Table.js +3 -3
  203. package/table/Table.stories.jsx +80 -1
  204. package/table/Table.test.js +26 -0
  205. package/tabs/Tab.d.ts +4 -0
  206. package/tabs/Tab.js +132 -0
  207. package/tabs/Tabs.d.ts +1 -1
  208. package/tabs/Tabs.js +360 -112
  209. package/tabs/Tabs.stories.tsx +119 -13
  210. package/tabs/Tabs.test.js +350 -0
  211. package/tabs/types.d.ts +17 -3
  212. package/tag/Tag.d.ts +1 -1
  213. package/tag/Tag.js +24 -36
  214. package/tag/Tag.stories.tsx +37 -27
  215. package/tag/Tag.test.js +60 -0
  216. package/tag/types.d.ts +23 -14
  217. package/text-input/Icons.d.ts +8 -0
  218. package/text-input/Icons.js +60 -0
  219. package/text-input/Suggestion.d.ts +4 -0
  220. package/text-input/Suggestion.js +84 -0
  221. package/text-input/Suggestions.d.ts +4 -0
  222. package/text-input/Suggestions.js +134 -0
  223. package/text-input/TextInput.js +224 -345
  224. package/text-input/TextInput.stories.tsx +310 -197
  225. package/text-input/TextInput.test.js +1723 -0
  226. package/text-input/types.d.ts +50 -12
  227. package/textarea/Textarea.js +22 -30
  228. package/textarea/Textarea.stories.jsx +93 -13
  229. package/textarea/Textarea.test.js +435 -0
  230. package/textarea/types.d.ts +18 -11
  231. package/toggle-group/ToggleGroup.d.ts +1 -1
  232. package/toggle-group/ToggleGroup.js +12 -8
  233. package/toggle-group/ToggleGroup.stories.tsx +46 -4
  234. package/toggle-group/ToggleGroup.test.js +156 -0
  235. package/toggle-group/types.d.ts +10 -2
  236. package/typography/Typography.d.ts +4 -0
  237. package/typography/Typography.js +32 -0
  238. package/typography/Typography.stories.tsx +198 -0
  239. package/typography/types.d.ts +18 -0
  240. package/typography/types.js +5 -0
  241. package/useTheme.d.ts +1234 -1
  242. package/useTheme.js +3 -3
  243. package/useTranslatedLabels.d.ts +85 -0
  244. package/useTranslatedLabels.js +20 -0
  245. package/utils/BaseTypography.d.ts +21 -0
  246. package/utils/BaseTypography.js +108 -0
  247. package/utils/FocusLock.d.ts +13 -0
  248. package/utils/FocusLock.js +139 -0
  249. package/wizard/Wizard.d.ts +1 -1
  250. package/wizard/Wizard.js +59 -55
  251. package/wizard/Wizard.stories.tsx +48 -19
  252. package/wizard/Wizard.test.js +141 -0
  253. package/wizard/types.d.ts +8 -4
  254. package/ThemeContext.d.ts +0 -15
  255. package/ThemeContext.js +0 -243
  256. package/V3Select/V3Select.js +0 -455
  257. package/V3Select/index.d.ts +0 -27
  258. package/V3Textarea/V3Textarea.js +0 -260
  259. package/V3Textarea/index.d.ts +0 -27
  260. package/common/RequiredComponent.js +0 -32
  261. package/date/Date.js +0 -373
  262. package/date/index.d.ts +0 -27
  263. package/input-text/Icons.js +0 -22
  264. package/input-text/InputText.js +0 -611
  265. package/input-text/index.d.ts +0 -36
  266. package/list/List.d.ts +0 -4
  267. package/list/List.js +0 -47
  268. package/list/List.stories.tsx +0 -95
  269. package/list/types.d.ts +0 -7
  270. package/radio/Radio.d.ts +0 -4
  271. package/radio/Radio.js +0 -174
  272. package/radio/Radio.stories.tsx +0 -192
  273. package/radio/types.d.ts +0 -54
  274. package/row/Row.d.ts +0 -3
  275. package/row/Row.js +0 -127
  276. package/row/Row.stories.tsx +0 -237
  277. package/row/types.d.ts +0 -10
  278. package/stack/Stack.d.ts +0 -3
  279. package/stack/Stack.js +0 -97
  280. package/stack/Stack.stories.tsx +0 -164
  281. package/stack/types.d.ts +0 -9
  282. package/text/Text.d.ts +0 -7
  283. package/text/Text.js +0 -30
  284. package/text/Text.stories.tsx +0 -19
  285. package/toggle/Toggle.js +0 -186
  286. package/toggle/index.d.ts +0 -21
  287. package/upload/Upload.js +0 -201
  288. package/upload/buttons-upload/ButtonsUpload.js +0 -111
  289. package/upload/buttons-upload/Icons.js +0 -40
  290. package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
  291. package/upload/dragAndDropArea/Icons.js +0 -39
  292. package/upload/file-upload/FileToUpload.js +0 -115
  293. package/upload/file-upload/Icons.js +0 -66
  294. package/upload/files-upload/FilesToUpload.js +0 -109
  295. package/upload/index.d.ts +0 -15
  296. package/upload/transaction/Icons.js +0 -160
  297. package/upload/transaction/Transaction.js +0 -104
  298. package/upload/transactions/Transactions.js +0 -94
  299. /package/{list → badge}/types.js +0 -0
  300. /package/{radio → bulleted-list}/types.js +0 -0
  301. /package/{row → flex}/types.js +0 -0
  302. /package/{stack → grid}/types.js +0 -0
package/wizard/Wizard.js CHANGED
@@ -9,17 +9,17 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports["default"] = void 0;
11
11
 
12
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
-
14
12
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
15
13
 
14
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
+
16
16
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
17
 
18
18
  var _react = _interopRequireWildcard(require("react"));
19
19
 
20
20
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
21
21
 
22
- var _variables = require("../common/variables.js");
22
+ var _variables = require("../common/variables");
23
23
 
24
24
  var _useTheme = _interopRequireDefault(require("../useTheme"));
25
25
 
@@ -82,8 +82,11 @@ var icons = {
82
82
  };
83
83
 
84
84
  var DxcWizard = function DxcWizard(_ref) {
85
+ var _ref2;
86
+
85
87
  var _ref$mode = _ref.mode,
86
88
  mode = _ref$mode === void 0 ? "horizontal" : _ref$mode,
89
+ defaultCurrentStep = _ref.defaultCurrentStep,
87
90
  currentStep = _ref.currentStep,
88
91
  onStepClick = _ref.onStepClick,
89
92
  steps = _ref.steps,
@@ -91,7 +94,7 @@ var DxcWizard = function DxcWizard(_ref) {
91
94
  _ref$tabIndex = _ref.tabIndex,
92
95
  tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
93
96
 
94
- var _useState = (0, _react.useState)(currentStep || 0),
97
+ var _useState = (0, _react.useState)((_ref2 = currentStep !== null && currentStep !== void 0 ? currentStep : defaultCurrentStep) !== null && _ref2 !== void 0 ? _ref2 : 0),
95
98
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
96
99
  innerCurrent = _useState2[0],
97
100
  setInnerCurrentStep = _useState2[1];
@@ -113,48 +116,49 @@ var DxcWizard = function DxcWizard(_ref) {
113
116
  theme: colorsTheme.wizard
114
117
  }, /*#__PURE__*/_react["default"].createElement(StepsContainer, {
115
118
  mode: mode,
116
- margin: margin
119
+ margin: margin,
120
+ role: "group"
117
121
  }, steps === null || steps === void 0 ? void 0 : steps.map(function (step, i) {
118
122
  return /*#__PURE__*/_react["default"].createElement(StepContainer, {
119
123
  key: "step".concat(i),
120
124
  mode: mode,
121
125
  lastStep: i === (steps === null || steps === void 0 ? void 0 : steps.length) - 1
122
126
  }, /*#__PURE__*/_react["default"].createElement(Step, {
123
- tabIndex: tabIndex,
124
127
  onClick: function onClick() {
125
- return handleStepClick(i);
128
+ handleStepClick(i);
126
129
  },
127
- mode: mode,
128
130
  disabled: step.disabled,
131
+ mode: mode,
129
132
  first: i === 0,
130
- last: i === (steps === null || steps === void 0 ? void 0 : steps.length) - 1
131
- }, /*#__PURE__*/_react["default"].createElement(StepHeader, null, /*#__PURE__*/_react["default"].createElement(IconContainer, {
133
+ last: i === (steps === null || steps === void 0 ? void 0 : steps.length) - 1,
134
+ "aria-current": renderedCurrent === i ? "step" : "false",
135
+ tabIndex: tabIndex
136
+ }, /*#__PURE__*/_react["default"].createElement(StepHeader, {
137
+ validityIcon: step.valid !== undefined
138
+ }, /*#__PURE__*/_react["default"].createElement(IconContainer, {
132
139
  current: i === renderedCurrent,
133
140
  visited: i < renderedCurrent,
134
141
  disabled: step.disabled
135
- }, step.icon ? typeof step.icon === "string" ? /*#__PURE__*/_react["default"].createElement(Icon, {
142
+ }, step.icon ? /*#__PURE__*/_react["default"].createElement(StepIconContainer, null, typeof step.icon === "string" ? /*#__PURE__*/_react["default"].createElement(Icon, {
136
143
  src: step.icon
137
- }) : /*#__PURE__*/_react["default"].createElement(StepIconContainer, {
138
- disabled: step.disabled
139
- }, (0, _typeof2["default"])(step.icon) === "object" ? step.icon : /*#__PURE__*/_react["default"].createElement(step.icon)) : /*#__PURE__*/_react["default"].createElement(Number, {
140
- disabled: step.disabled,
141
- current: i === renderedCurrent
142
- }, i + 1)), step.valid !== undefined ? step.valid ? /*#__PURE__*/_react["default"].createElement(ValidityIconContainer, null, icons.validIcon) : /*#__PURE__*/_react["default"].createElement(ValidityIconContainer, null, icons.invalidIcon) : ""), step.label || step.description ? /*#__PURE__*/_react["default"].createElement(InfoContainer, null, step.label ? /*#__PURE__*/_react["default"].createElement(Label, {
144
+ }) : step.icon) : /*#__PURE__*/_react["default"].createElement(Number, null, i + 1)), step.valid !== undefined && (step.valid ? /*#__PURE__*/_react["default"].createElement(ValidityIconContainer, null, icons.validIcon) : /*#__PURE__*/_react["default"].createElement(ValidityIconContainer, null, icons.invalidIcon))), (step.label || step.description) && /*#__PURE__*/_react["default"].createElement(InfoContainer, null, step.label && /*#__PURE__*/_react["default"].createElement(Label, {
145
+ current: i === renderedCurrent,
143
146
  disabled: step.disabled,
144
147
  visited: i <= innerCurrent
145
- }, step.label) : "", step.description ? /*#__PURE__*/_react["default"].createElement(Description, {
148
+ }, step.label), step.description && /*#__PURE__*/_react["default"].createElement(Description, {
149
+ current: i === renderedCurrent,
146
150
  disabled: step.disabled,
147
151
  visited: i <= innerCurrent
148
- }, step.description) : "") : ""), i === steps.length - 1 ? "" : /*#__PURE__*/_react["default"].createElement(StepSeparator, {
152
+ }, step.description))), i === steps.length - 1 ? "" : /*#__PURE__*/_react["default"].createElement(StepSeparator, {
149
153
  mode: mode
150
154
  }));
151
155
  })));
152
156
  };
153
157
 
154
- var StepsContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n flex-direction: ", ";\n justify-content: \"center\";\n ", ";\n font-family: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
158
+ var StepsContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n justify-content: center;\n ", ";\n font-family: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
155
159
  return props.mode === "vertical" ? "column" : "row";
156
160
  }, function (props) {
157
- return props.mode === "vertical" ? "height: 500px" : "width: 100%";
161
+ return props.mode === "vertical" && "height: 500px";
158
162
  }, function (props) {
159
163
  return props.theme.fontFamily;
160
164
  }, function (props) {
@@ -170,16 +174,16 @@ var StepsContainer = _styledComponents["default"].div(_templateObject || (_templ
170
174
  });
171
175
 
172
176
  var StepContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n ", "\n flex-grow: ", ";\n flex-direction: ", ";\n ", "\n"])), function (props) {
173
- return props.mode === "vertical" ? "" : "align-items: center;";
177
+ return props.mode !== "vertical" && "align-items: center;";
174
178
  }, function (props) {
175
179
  return props.lastStep ? "0" : "1";
176
180
  }, function (props) {
177
181
  return props.mode === "vertical" ? "column" : "row";
178
182
  }, function (props) {
179
- return props.mode === "vertical" ? "width: 100%;" : "";
183
+ return props.mode === "vertical" && "width: fit-content;";
180
184
  });
181
185
 
182
- var Step = _styledComponents["default"].button(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n border: none;\n background: inherit;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: ", ";\n\n padding: 0px;\n ", ";\n\n &:hover {\n ", ";\n }\n &:focus {\n outline: ", " auto 1px;\n }\n"])), function (props) {
186
+ var Step = _styledComponents["default"].button(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: flex-start;\n align-items: center;\n border: none;\n border-radius: 0.25rem;\n background: inherit;\n margin: ", ";\n\n padding: 0px;\n ", ";\n\n &:hover {\n ", ";\n }\n &:focus {\n outline: 2px solid ", ";\n }\n"])), function (props) {
183
187
  return props.first ? props.mode === "vertical" ? "0 0 24px 0" : "0 24px 0 0" : props.last ? props.mode === "vertical" ? "24px 0 0 0" : "0 0 0 24px" : props.mode === "vertical" ? "24px 0" : "0 24px";
184
188
  }, function (props) {
185
189
  return props.disabled ? "cursor: not-allowed" : "";
@@ -189,42 +193,44 @@ var Step = _styledComponents["default"].button(_templateObject3 || (_templateObj
189
193
  return props.theme.focusColor;
190
194
  });
191
195
 
192
- var StepHeader = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: inline-flex;\n padding-bottom: 4px;\n"])));
196
+ var StepHeader = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: inline-flex;\n ", "\n"])), function (props) {
197
+ return props.validityIcon && "padding-bottom: 4px;";
198
+ });
193
199
 
194
- var IconContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n\n ", "\n ", ";\n\n border-radius: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n"])), function (props) {
195
- return props.disabled ? props.theme.disabledCircleWidth : props.current ? props.theme.selectedCircleWidth : props.theme.circleWidth;
200
+ var IconContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n\n ", "\n ", ";\n\n border-radius: ", ";\n\n display: flex;\n justify-content: center;\n align-items: center;\n"])), function (props) {
201
+ return props.disabled ? props.theme.disabledStepWidth : props.current ? props.theme.selectedStepWidth : props.theme.stepWidth;
196
202
  }, function (props) {
197
- return props.disabled ? props.theme.disabledCircleHeight : props.current ? props.theme.selectedCircleHeight : props.theme.circleHeight;
203
+ return props.disabled ? props.theme.disabledStepHeight : props.current ? props.theme.selectedStepHeight : props.theme.stepHeight;
198
204
  }, function (props) {
199
- return "\n ".concat(!props.current && !props.disabled ? "border: ".concat(props.theme.circleBorderThickness, " ").concat(props.theme.circleBorderStyle, " ").concat(props.theme.circleBorderColor, ";") : props.current && !props.disabled ? "border: ".concat(props.theme.selectedCircleBorderThickness, " ").concat(props.theme.selectedCircleBorderStyle, " ").concat(props.theme.selectedCircleBorderColor, ";") : props.disabled ? "border: ".concat(props.theme.disabledCircleBorderThickness, " ").concat(props.theme.disabledCircleBorderStyle, " ").concat(props.theme.disabledCircleBorderColor, ";") : "", "\n background: ").concat(props.disabled ? "".concat(props.theme.disabledBackgroundColor) : props.current ? "".concat(props.theme.stepContainerSelectedBackgroundColor) : "".concat(props.theme.stepContainerBackgroundColor), ";\n ");
205
+ return "\n ".concat(props.disabled ? "border: ".concat(props.theme.disabledStepBorderThickness, " ").concat(props.theme.disabledStepBorderStyle, " ").concat(props.theme.disabledStepBorderColor, ";") : props.current ? "border: ".concat(props.theme.selectedStepBorderThickness, " ").concat(props.theme.selectedStepBorderStyle, " ").concat(props.theme.selectedStepBorderColor, ";") : props.visited ? "border: ".concat(props.theme.stepBorderThickness, " ").concat(props.theme.stepBorderStyle, " ").concat(props.theme.visitedStepBorderColor, ";") : "border: ".concat(props.theme.stepBorderThickness, " ").concat(props.theme.stepBorderStyle, " ").concat(props.theme.unvisitedStepBorderColor, ";"), "\n background: ").concat(props.disabled ? "".concat(props.theme.disabledStepBackgroundColor) : props.current ? "".concat(props.theme.selectedStepBackgroundColor) : !props.visited ? "".concat(props.theme.unvisitedStepBackgroundColor) : "".concat(props.theme.visitedStepBackgroundColor), ";\n ");
200
206
  }, function (props) {
201
- return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.current ? props.theme.stepContainerSelectedFontColor : props.theme.stepContainerFontColor, ";");
207
+ return props.disabled ? "color: ".concat(props.theme.disabledStepFontColor, ";") : "color: ".concat(props.current ? props.theme.selectedStepFontColor : !props.visited ? props.theme.unvisitedStepFontColor : props.theme.visitedStepFontColor, ";");
202
208
  }, function (props) {
203
- return !props.current && !props.disabled ? props.theme.circleBorderRadius : props.current ? props.theme.selectedCircleBorderRadius : props.disabled ? props.theme.disabledCircleBorderRadius : "";
209
+ return !props.current && !props.disabled ? props.theme.stepBorderRadius : props.current ? props.theme.selectedStepBorderRadius : props.disabled ? props.theme.disabledStepBorderRadius : "";
204
210
  });
205
211
 
206
212
  var Icon = _styledComponents["default"].img(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n"])), function (props) {
207
- return props.theme.stepContainerIconSize;
213
+ return props.theme.stepIconSize;
208
214
  }, function (props) {
209
- return props.theme.stepContainerIconSize;
215
+ return props.theme.stepIconSize;
210
216
  });
211
217
 
212
218
  var StepIconContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n overflow: hidden;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
213
- return props.theme.stepContainerIconSize;
219
+ return props.theme.stepIconSize;
214
220
  }, function (props) {
215
- return props.theme.stepContainerIconSize;
221
+ return props.theme.stepIconSize;
216
222
  });
217
223
 
218
224
  var Number = _styledComponents["default"].p(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n opacity: 1;\n margin: 0px 0px 0px 1px;\n"])), function (props) {
219
- return props.theme.stepContainerFontSize;
225
+ return props.theme.stepFontSize;
220
226
  }, function (props) {
221
- return props.theme.stepContainerFontFamily;
227
+ return props.theme.stepFontFamily;
222
228
  }, function (props) {
223
- return props.theme.stepContainerFontStyle;
229
+ return props.theme.stepFontStyle;
224
230
  }, function (props) {
225
- return props.theme.stepContainerFontWeight;
231
+ return props.theme.stepFontWeight;
226
232
  }, function (props) {
227
- return props.theme.stepContainerLetterSpacing;
233
+ return props.theme.stepFontTracking;
228
234
  });
229
235
 
230
236
  var ValidityIconContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n width: 18px;\n height: 18px;\n position: absolute;\n top: 22.5px;\n left: 22.5px;\n"])));
@@ -242,37 +248,35 @@ var Label = _styledComponents["default"].p(_templateObject11 || (_templateObject
242
248
  }, function (props) {
243
249
  return props.theme.labelFontWeight;
244
250
  }, function (props) {
245
- return props.theme.labelLetterSpacing;
251
+ return props.theme.labelFontTracking;
246
252
  }, function (props) {
247
- return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.visited ? props.theme.visitedLabelFontColor : props.theme.labelFontColor, ";");
253
+ return props.disabled ? "color: ".concat(props.theme.disabledLabelFontColor, ";") : "color: ".concat(!props.visited ? props.theme.unvisitedLabelFontColor : props.current ? props.theme.selectedLabelFontColor : props.theme.visitedLabelFontColor, ";");
248
254
  }, function (props) {
249
255
  return props.theme.labelFontTextTransform;
250
256
  });
251
257
 
252
258
  var Description = _styledComponents["default"].p(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n text-align: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n ", ";\n margin: 0;\n"])), function (props) {
253
- return props.theme.descriptionTextAlign;
259
+ return props.theme.helperTextTextAlign;
254
260
  }, function (props) {
255
- return props.theme.descriptionFontFamily;
261
+ return props.theme.helperTextFontFamily;
256
262
  }, function (props) {
257
- return props.theme.descriptionFontSize;
263
+ return props.theme.helperTextFontSize;
258
264
  }, function (props) {
259
- return props.theme.descriptionFontStyle;
265
+ return props.theme.helperTextFontStyle;
260
266
  }, function (props) {
261
- return props.theme.descriptionFontWeight;
267
+ return props.theme.helperTextFontWeight;
262
268
  }, function (props) {
263
- return props.theme.descriptionLetterSpacing;
269
+ return props.theme.helperTextFontTracking;
264
270
  }, function (props) {
265
- return props.theme.descriptionFontTextTransform;
271
+ return props.theme.helperTextFontTextTransform;
266
272
  }, function (props) {
267
- return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.visited ? props.theme.visitedDescriptionFontColor : props.theme.descriptionFontColor, ";");
273
+ return props.disabled ? "color: ".concat(props.theme.disabledHelperTextFontColor, ";") : "color: ".concat(!props.visited ? props.theme.unvisitedHelperTextFontColor : props.current ? props.theme.selectedHelperTextFontColor : props.theme.visitedHelperTextFontColor, ";");
268
274
  });
269
275
 
270
- var StepSeparator = _styledComponents["default"].div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", "\n border: ", ";\n opacity: 1;\n flex-grow: 1;\n"])), function (props) {
271
- return props.mode === "horizontal" ? "" : "0";
272
- }, function (props) {
273
- return props.mode === "horizontal" ? "0" : "";
276
+ var StepSeparator = _styledComponents["default"].div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n ", "\n border: ", ";\n opacity: 1;\n flex-grow: 1;\n"])), function (props) {
277
+ return props.mode === "horizontal" ? "height: 0;" : "width: 0;";
274
278
  }, function (props) {
275
- return props.mode === "vertical" ? "margin: 0 18px;" : "";
279
+ return props.mode === "vertical" && "margin: 0 18px;";
276
280
  }, function (props) {
277
281
  return "".concat(props.theme.separatorBorderStyle, " ").concat(props.theme.separatorBorderThickness, " ").concat(props.theme.separatorColor);
278
282
  });
@@ -3,29 +3,25 @@ import DxcWizard from "./Wizard";
3
3
  import Title from "../../.storybook/components/Title";
4
4
  import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
5
  import { userEvent, within } from "@storybook/testing-library";
6
+ import { HalstackProvider } from "../HalstackContext";
6
7
 
7
8
  export default {
8
9
  title: "Wizard",
9
10
  component: DxcWizard,
10
11
  };
11
12
 
12
- const favoriteSVG = () => {
13
- return (
14
- <svg viewBox="0 0 24 24" fill="currentColor">
15
- <path d="M0 0h24v24H0z" fill="none" />
16
- <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
17
- </svg>
18
- );
19
- };
20
-
21
- const largeIcon = () => {
22
- return (
23
- <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="currentColor">
24
- <path d="M0 0h24v24H0z" fill="none" />
25
- <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" />
26
- </svg>
27
- );
28
- };
13
+ const favoriteSVG = (
14
+ <svg viewBox="0 0 24 24" fill="currentColor">
15
+ <path d="M0 0h24v24H0z" fill="none" />
16
+ <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
17
+ </svg>
18
+ );
19
+ const largeIcon = (
20
+ <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="currentColor">
21
+ <path d="M0 0h24v24H0z" fill="none" />
22
+ <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" />
23
+ </svg>
24
+ );
29
25
 
30
26
  const stepWithLabel = [
31
27
  {
@@ -137,19 +133,41 @@ const stepLargeIcons = [
137
133
  },
138
134
  ];
139
135
 
136
+ const opinionatedTheme = {
137
+ wizard: {
138
+ baseColor: "#5f249f",
139
+ fontColor: "#000000",
140
+ selectedStepFontColor: "#ffffff",
141
+ },
142
+ };
143
+
140
144
  export const Chromatic = () => (
141
145
  <>
142
146
  <ExampleContainer>
143
147
  <Title title="Current step in the third step, labels and description" theme="light" level={4} />
144
- <DxcWizard currentStep={2} steps={stepWithLabelDescription}></DxcWizard>
148
+ <DxcWizard defaultCurrentStep={2} steps={stepWithLabelDescription}></DxcWizard>
149
+ </ExampleContainer>
150
+ <ExampleContainer>
145
151
  <Title title="With long description in horizontal" theme="light" level={4} />
146
152
  <DxcWizard steps={stepWithLongDescription}></DxcWizard>
153
+ </ExampleContainer>
154
+ <ExampleContainer>
147
155
  <Title title="With long description in vertical" theme="light" level={4} />
148
156
  <DxcWizard mode="vertical" steps={stepWithLongDescription}></DxcWizard>
157
+ </ExampleContainer>
158
+ <ExampleContainer>
149
159
  <Title title="Disabled steps" theme="light" level={4} />
150
160
  <DxcWizard steps={stepDisabled}></DxcWizard>
161
+ </ExampleContainer>
162
+ <ExampleContainer pseudoState="pseudo-focus">
163
+ <Title title="Focused steps" theme="light" level={4} />
164
+ <DxcWizard steps={stepIcons}></DxcWizard>
165
+ </ExampleContainer>
166
+ <ExampleContainer>
151
167
  <Title title="With icons" theme="light" level={4} />
152
168
  <DxcWizard steps={stepIcons}></DxcWizard>
169
+ </ExampleContainer>
170
+ <ExampleContainer>
153
171
  <Title title="With large icons" theme="light" level={4} />
154
172
  <DxcWizard steps={stepLargeIcons}></DxcWizard>
155
173
  </ExampleContainer>
@@ -211,10 +229,21 @@ export const Chromatic = () => (
211
229
  <Title title="Xxlarge margin" theme="light" level={4} />
212
230
  <DxcWizard mode="vertical" margin="xxlarge" steps={stepWithLabel}></DxcWizard>
213
231
  </ExampleContainer>
232
+ <Title title="Opinionated theme" theme="light" level={2} />
233
+ <ExampleContainer>
234
+ <HalstackProvider theme={opinionatedTheme}>
235
+ <DxcWizard defaultCurrentStep={2} steps={stepWithLabelDescription}></DxcWizard>
236
+ </HalstackProvider>
237
+ </ExampleContainer>
214
238
  </>
215
239
  );
216
240
 
217
- const WizardSelected = () => <DxcWizard steps={stepWithLabel}></DxcWizard>;
241
+ const WizardSelected = () => (
242
+ <ExampleContainer>
243
+ <Title title="Clicked step" theme="light" level={4} />
244
+ <DxcWizard steps={stepWithLabel} mode="vertical"></DxcWizard>
245
+ </ExampleContainer>
246
+ );
218
247
 
219
248
  export const WizardStepActived = WizardSelected.bind({});
220
249
  WizardStepActived.play = async ({ canvasElement }) => {
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _react = _interopRequireDefault(require("react"));
6
+
7
+ var _react2 = require("@testing-library/react");
8
+
9
+ var _Wizard = _interopRequireDefault(require("./Wizard.tsx"));
10
+
11
+ describe("Wizard components tests", function () {
12
+ test("Wizard renders with correct steps", function () {
13
+ var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
14
+ steps: [{
15
+ label: "first-step"
16
+ }, {
17
+ label: "second-step"
18
+ }]
19
+ })),
20
+ getByText = _render.getByText,
21
+ getAllByRole = _render.getAllByRole;
22
+
23
+ var steps = getAllByRole("button");
24
+ expect(getByText("first-step")).toBeTruthy();
25
+ expect(getByText("second-step")).toBeTruthy();
26
+ expect(steps[0].getAttribute("aria-current")).toBe("step");
27
+ expect(steps[1].getAttribute("aria-current")).toBe("false");
28
+ });
29
+ test("Wizard renders with initially selected step", function () {
30
+ var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
31
+ defaultCurrentStep: 1,
32
+ steps: [{
33
+ label: "first-step"
34
+ }, {
35
+ label: "second-step"
36
+ }]
37
+ })),
38
+ getAllByRole = _render2.getAllByRole;
39
+
40
+ var steps = getAllByRole("button");
41
+ expect(steps[1].getAttribute("aria-current")).toBe("step");
42
+ });
43
+ test("Click on step text", function () {
44
+ var onClick = jest.fn();
45
+
46
+ var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
47
+ onStepClick: onClick,
48
+ steps: [{
49
+ label: "first-step"
50
+ }]
51
+ })),
52
+ getByText = _render3.getByText;
53
+
54
+ var step = getByText("first-step");
55
+
56
+ _react2.fireEvent.click(step);
57
+
58
+ expect(onClick).toHaveBeenCalled();
59
+ });
60
+ test("Click on step description", function () {
61
+ var onClick = jest.fn();
62
+
63
+ var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
64
+ onStepClick: onClick,
65
+ steps: [{
66
+ label: "first-step",
67
+ description: "step-description"
68
+ }]
69
+ })),
70
+ getByText = _render4.getByText;
71
+
72
+ var step = getByText("step-description");
73
+
74
+ _react2.fireEvent.click(step);
75
+
76
+ expect(onClick).toHaveBeenCalled();
77
+ });
78
+ test("Click on step number", function () {
79
+ var onClick = jest.fn();
80
+
81
+ var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
82
+ onStepClick: onClick,
83
+ steps: [{
84
+ label: "first-step"
85
+ }]
86
+ })),
87
+ getByText = _render5.getByText;
88
+
89
+ var step = getByText("1");
90
+
91
+ _react2.fireEvent.click(step);
92
+
93
+ expect(onClick).toHaveBeenCalled();
94
+ });
95
+ test("Click on disable step", function () {
96
+ var onClick = jest.fn();
97
+
98
+ var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
99
+ onStepClick: onClick,
100
+ steps: [{
101
+ label: "first-step"
102
+ }, {
103
+ label: "second-step",
104
+ disabled: true
105
+ }]
106
+ })),
107
+ getByText = _render6.getByText;
108
+
109
+ var step = getByText("second-step");
110
+
111
+ _react2.fireEvent.click(step);
112
+
113
+ expect(onClick).toHaveBeenCalledTimes(0);
114
+ });
115
+ test("Controlled wizard function is called", function () {
116
+ var onClick = jest.fn(function (i) {
117
+ return i;
118
+ });
119
+
120
+ var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Wizard["default"], {
121
+ currentStep: 0,
122
+ onStepClick: onClick,
123
+ steps: [{
124
+ label: "first-step"
125
+ }, {
126
+ label: "second-step"
127
+ }]
128
+ })),
129
+ getAllByRole = _render7.getAllByRole;
130
+
131
+ var steps = getAllByRole("button");
132
+
133
+ _react2.fireEvent.click(steps[1]);
134
+
135
+ _react2.fireEvent.click(steps[0]);
136
+
137
+ expect(onClick).toHaveBeenCalledTimes(2);
138
+ expect(onClick).toHaveBeenNthCalledWith(1, 1);
139
+ expect(onClick).toHaveBeenNthCalledWith(2, 0);
140
+ });
141
+ });
package/wizard/types.d.ts CHANGED
@@ -6,8 +6,8 @@ declare type Margin = {
6
6
  left?: Space;
7
7
  right?: Space;
8
8
  };
9
- declare type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
10
- declare type Step = {
9
+ declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
10
+ export declare type StepProps = {
11
11
  /**
12
12
  * Step label.
13
13
  */
@@ -35,7 +35,11 @@ declare type Props = {
35
35
  */
36
36
  mode?: "horizontal" | "vertical";
37
37
  /**
38
- * Defines which step is marked as the current. The numeration starts in 0.
38
+ * Initially selected step, only when it is uncontrolled.
39
+ */
40
+ defaultCurrentStep?: number;
41
+ /**
42
+ * Defines which step is marked as the current. The numeration starts at 0.
39
43
  */
40
44
  currentStep?: number;
41
45
  /**
@@ -46,7 +50,7 @@ declare type Props = {
46
50
  /**
47
51
  * An array of objects representing the steps.
48
52
  */
49
- steps: Step[];
53
+ steps: StepProps[];
50
54
  /**
51
55
  * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
52
56
  * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
package/ThemeContext.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import React from "react";
2
- declare const ThemeContext: React.Context<object>;
3
- declare type ThemeProviderCommonProps = {
4
- children: React.ReactNode;
5
- };
6
- declare type ThemeProviderDefaultTheme = ThemeProviderCommonProps & {
7
- theme: object;
8
- };
9
- declare type ThemeProviderAdvancedTheme = ThemeProviderCommonProps & {
10
- advancedTheme: object;
11
- };
12
- declare type ThemeProviderPropsType = ThemeProviderDefaultTheme | ThemeProviderAdvancedTheme;
13
- declare const ThemeProvider: (props: ThemeProviderPropsType) => JSX.Element;
14
- export default ThemeContext;
15
- export { ThemeProvider };