@dxc-technology/halstack-react 0.0.0-e081e21 → 0.0.0-e1a279c

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 (137) hide show
  1. package/accordion/Accordion.d.ts +4 -0
  2. package/accordion/Accordion.js +12 -43
  3. package/accordion/types.d.ts +68 -0
  4. package/accordion/types.js +5 -0
  5. package/accordion-group/AccordionGroup.d.ts +7 -0
  6. package/accordion-group/AccordionGroup.js +58 -72
  7. package/accordion-group/types.d.ts +72 -0
  8. package/accordion-group/types.js +5 -0
  9. package/alert/Alert.stories.tsx +170 -0
  10. package/box/Box.d.ts +4 -0
  11. package/box/Box.js +9 -32
  12. package/box/Box.stories.tsx +132 -0
  13. package/box/types.d.ts +47 -0
  14. package/box/types.js +5 -0
  15. package/button/Button.d.ts +1 -1
  16. package/button/Button.js +7 -12
  17. package/button/Button.stories.tsx +244 -274
  18. package/button/types.d.ts +10 -10
  19. package/card/Card.d.ts +4 -0
  20. package/card/Card.js +13 -48
  21. package/card/types.d.ts +69 -0
  22. package/card/types.js +5 -0
  23. package/checkbox/Checkbox.stories.tsx +192 -0
  24. package/checkbox/types.d.ts +2 -3
  25. package/chip/Chip.stories.tsx +121 -0
  26. package/common/variables.js +30 -22
  27. package/date-input/DateInput.d.ts +4 -0
  28. package/date-input/DateInput.js +3 -38
  29. package/date-input/DateInput.stories.tsx +138 -0
  30. package/date-input/types.d.ts +100 -0
  31. package/date-input/types.js +5 -0
  32. package/dialog/Dialog.d.ts +4 -0
  33. package/dialog/Dialog.js +4 -23
  34. package/dialog/Dialog.stories.tsx +212 -0
  35. package/dialog/types.d.ts +43 -0
  36. package/dialog/types.js +5 -0
  37. package/dropdown/Dropdown.d.ts +4 -0
  38. package/dropdown/Dropdown.js +7 -40
  39. package/dropdown/types.d.ts +89 -0
  40. package/dropdown/types.js +5 -0
  41. package/footer/Footer.d.ts +4 -0
  42. package/footer/Footer.js +4 -35
  43. package/footer/Footer.stories.jsx +151 -0
  44. package/footer/types.d.ts +61 -0
  45. package/footer/types.js +5 -0
  46. package/header/Header.d.ts +7 -0
  47. package/header/Header.js +26 -28
  48. package/header/Icons.js +2 -27
  49. package/header/types.d.ts +45 -0
  50. package/header/types.js +5 -0
  51. package/link/Link.d.ts +3 -0
  52. package/link/Link.js +1 -23
  53. package/link/Link.stories.tsx +70 -0
  54. package/link/types.d.ts +74 -0
  55. package/link/types.js +5 -0
  56. package/number-input/NumberInput.d.ts +4 -0
  57. package/number-input/NumberInput.js +2 -44
  58. package/number-input/NumberInput.stories.tsx +115 -0
  59. package/number-input/types.d.ts +117 -0
  60. package/number-input/types.js +5 -0
  61. package/package.json +3 -3
  62. package/paginator/Paginator.stories.tsx +63 -0
  63. package/password-input/PasswordInput.d.ts +4 -0
  64. package/password-input/PasswordInput.js +2 -39
  65. package/password-input/PasswordInput.stories.tsx +131 -0
  66. package/password-input/types.d.ts +100 -0
  67. package/password-input/types.js +5 -0
  68. package/progress-bar/ProgressBar.d.ts +4 -0
  69. package/progress-bar/ProgressBar.js +3 -21
  70. package/progress-bar/ProgressBar.stories.jsx +58 -0
  71. package/progress-bar/types.d.ts +37 -0
  72. package/progress-bar/types.js +5 -0
  73. package/radio/Radio.d.ts +4 -0
  74. package/radio/Radio.js +3 -24
  75. package/radio/Radio.stories.tsx +192 -0
  76. package/radio/types.d.ts +54 -0
  77. package/radio/types.js +5 -0
  78. package/select/Select.stories.tsx +572 -0
  79. package/select/index.d.ts +4 -4
  80. package/sidenav/Sidenav.d.ts +9 -0
  81. package/sidenav/Sidenav.js +4 -13
  82. package/sidenav/types.d.ts +50 -0
  83. package/sidenav/types.js +5 -0
  84. package/slider/Slider.d.ts +4 -0
  85. package/slider/Slider.js +59 -82
  86. package/slider/Slider.stories.tsx +177 -0
  87. package/slider/types.d.ts +78 -0
  88. package/slider/types.js +5 -0
  89. package/spinner/Spinner.d.ts +4 -0
  90. package/spinner/Spinner.js +6 -23
  91. package/spinner/Spinner.stories.jsx +102 -0
  92. package/spinner/types.d.ts +32 -0
  93. package/spinner/types.js +5 -0
  94. package/switch/Switch.js +2 -2
  95. package/switch/Switch.stories.tsx +160 -0
  96. package/table/Table.d.ts +4 -0
  97. package/table/Table.stories.jsx +276 -0
  98. package/table/types.d.ts +21 -0
  99. package/table/types.js +5 -0
  100. package/tabs/Tabs.d.ts +4 -0
  101. package/tabs/Tabs.js +5 -53
  102. package/tabs/types.d.ts +71 -0
  103. package/tabs/types.js +5 -0
  104. package/tag/Tag.d.ts +4 -0
  105. package/tag/Tag.js +20 -35
  106. package/tag/Tag.stories.tsx +145 -0
  107. package/tag/types.d.ts +60 -0
  108. package/tag/types.js +5 -0
  109. package/text-input/index.d.ts +2 -2
  110. package/textarea/Textarea.stories.jsx +135 -0
  111. package/toggle-group/ToggleGroup.stories.tsx +178 -0
  112. package/wizard/Wizard.d.ts +4 -0
  113. package/wizard/Wizard.js +11 -51
  114. package/wizard/Wizard.stories.jsx +224 -0
  115. package/wizard/types.d.ts +64 -0
  116. package/wizard/types.js +5 -0
  117. package/accordion/index.d.ts +0 -28
  118. package/accordion-group/index.d.ts +0 -16
  119. package/box/index.d.ts +0 -25
  120. package/card/index.d.ts +0 -22
  121. package/date-input/index.d.ts +0 -95
  122. package/dialog/index.d.ts +0 -18
  123. package/dropdown/index.d.ts +0 -26
  124. package/footer/index.d.ts +0 -25
  125. package/header/index.d.ts +0 -25
  126. package/link/index.d.ts +0 -23
  127. package/number-input/index.d.ts +0 -113
  128. package/password-input/index.d.ts +0 -94
  129. package/progress-bar/index.d.ts +0 -18
  130. package/radio/index.d.ts +0 -23
  131. package/sidenav/index.d.ts +0 -13
  132. package/slider/index.d.ts +0 -29
  133. package/spinner/index.d.ts +0 -17
  134. package/table/index.d.ts +0 -13
  135. package/tabs/index.d.ts +0 -19
  136. package/tag/index.d.ts +0 -24
  137. package/wizard/index.d.ts +0 -18
package/wizard/Wizard.js CHANGED
@@ -9,8 +9,6 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports["default"] = void 0;
11
11
 
12
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
-
14
12
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
13
 
16
14
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
@@ -21,15 +19,13 @@ var _react = _interopRequireWildcard(require("react"));
21
19
 
22
20
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
23
21
 
24
- var _propTypes = _interopRequireDefault(require("prop-types"));
25
-
26
22
  var _variables = require("../common/variables.js");
27
23
 
28
24
  var _useTheme = _interopRequireDefault(require("../useTheme.js"));
29
25
 
30
26
  var _Icons = require("./Icons");
31
27
 
32
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14;
28
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
33
29
 
34
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
31
 
@@ -68,11 +64,11 @@ var DxcWizard = function DxcWizard(_ref) {
68
64
  }, /*#__PURE__*/_react["default"].createElement(StepsContainer, {
69
65
  mode: mode,
70
66
  margin: margin
71
- }, steps.map(function (step, i) {
67
+ }, steps === null || steps === void 0 ? void 0 : steps.map(function (step, i) {
72
68
  return /*#__PURE__*/_react["default"].createElement(StepContainer, {
73
69
  key: "step".concat(i),
74
70
  mode: mode,
75
- lastStep: i === steps.length - 1
71
+ lastStep: i === (steps === null || steps === void 0 ? void 0 : steps.length) - 1
76
72
  }, /*#__PURE__*/_react["default"].createElement(Step, {
77
73
  tabIndex: tabIndex,
78
74
  onClick: function onClick() {
@@ -81,17 +77,14 @@ var DxcWizard = function DxcWizard(_ref) {
81
77
  mode: mode,
82
78
  disabled: step.disabled,
83
79
  first: i === 0,
84
- last: i === steps.length - 1
80
+ last: i === (steps === null || steps === void 0 ? void 0 : steps.length) - 1
85
81
  }, /*#__PURE__*/_react["default"].createElement(StepHeader, null, /*#__PURE__*/_react["default"].createElement(IconContainer, {
86
82
  current: i === renderedCurrent,
87
83
  visited: i < renderedCurrent,
88
84
  disabled: step.disabled
89
85
  }, step.icon ? /*#__PURE__*/_react["default"].createElement(StepIconContainer, {
90
86
  disabled: step.disabled
91
- }, (0, _typeof2["default"])(step.icon) === "object" ? step.icon.type === "img" ? /*#__PURE__*/_react["default"].createElement(ImgContainer, {
92
- current: i === renderedCurrent,
93
- img: step.icon.props.src
94
- }) : step.icon : /*#__PURE__*/_react["default"].createElement(step.icon)) : step.iconSrc ? /*#__PURE__*/_react["default"].createElement(Icon, {
87
+ }, (0, _typeof2["default"])(step.icon) === "object" ? step.icon : /*#__PURE__*/_react["default"].createElement(step.icon)) : step.iconSrc ? /*#__PURE__*/_react["default"].createElement(Icon, {
95
88
  src: step.iconSrc
96
89
  }) : /*#__PURE__*/_react["default"].createElement(Number, {
97
90
  disabled: step.disabled,
@@ -172,20 +165,7 @@ var StepIconContainer = _styledComponents["default"].div(_templateObject7 || (_t
172
165
  return props.theme.stepContainerIconSize;
173
166
  });
174
167
 
175
- var ImgContainer = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n mask: url(", ") no-repeat center;\n mask-size: ", ";\n height: ", ";\n width: ", ";\n"])), function (props) {
176
- return props.current ? props.theme.stepContainerSelectedFontColor : props.theme.stepContainerFontColor;
177
- }, function (_ref2) {
178
- var img = _ref2.img;
179
- return img;
180
- }, function (props) {
181
- return "".concat(props.theme.stepContainerIconSize, " ").concat(props.theme.stepContainerIconSize);
182
- }, function (props) {
183
- return props.theme.stepContainerIconSize;
184
- }, function (props) {
185
- return props.theme.stepContainerIconSize;
186
- });
187
-
188
- var Number = _styledComponents["default"].p(_templateObject9 || (_templateObject9 = (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) {
168
+ 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) {
189
169
  return props.theme.stepContainerFontSize;
190
170
  }, function (props) {
191
171
  return props.theme.stepContainerFontFamily;
@@ -197,11 +177,11 @@ var Number = _styledComponents["default"].p(_templateObject9 || (_templateObject
197
177
  return props.theme.stepContainerLetterSpacing;
198
178
  });
199
179
 
200
- var ValidityIconContainer = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n width: 18px;\n height: 18px;\n position: absolute;\n top: 22.5px;\n left: 22.5px;\n"])));
180
+ 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"])));
201
181
 
202
- var InfoContainer = _styledComponents["default"].div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 12px;\n"])));
182
+ var InfoContainer = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 12px;\n"])));
203
183
 
204
- var Label = _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 ", ";\n text-transform: ", ";\n margin: 0;\n"])), function (props) {
184
+ var Label = _styledComponents["default"].p(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n text-align: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n ", ";\n text-transform: ", ";\n margin: 0;\n"])), function (props) {
205
185
  return props.theme.labelTextAlign;
206
186
  }, function (props) {
207
187
  return props.theme.labelFontFamily;
@@ -219,7 +199,7 @@ var Label = _styledComponents["default"].p(_templateObject12 || (_templateObject
219
199
  return props.theme.labelFontTextTransform;
220
200
  });
221
201
 
222
- var Description = _styledComponents["default"].p(_templateObject13 || (_templateObject13 = (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) {
202
+ 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) {
223
203
  return props.theme.descriptionTextAlign;
224
204
  }, function (props) {
225
205
  return props.theme.descriptionFontFamily;
@@ -237,7 +217,7 @@ var Description = _styledComponents["default"].p(_templateObject13 || (_template
237
217
  return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.visited ? props.theme.visitedDescriptionFontColor : props.theme.descriptionFontColor, ";");
238
218
  });
239
219
 
240
- var StepSeparator = _styledComponents["default"].div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", "\n border: ", ";\n opacity: 1;\n flex-grow: 1;\n"])), function (props) {
220
+ 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) {
241
221
  return props.mode === "horizontal" ? "" : "0";
242
222
  }, function (props) {
243
223
  return props.mode === "horizontal" ? "0" : "";
@@ -247,25 +227,5 @@ var StepSeparator = _styledComponents["default"].div(_templateObject14 || (_temp
247
227
  return "".concat(props.theme.separatorBorderStyle, " ").concat(props.theme.separatorBorderThickness, " ").concat(props.theme.separatorColor);
248
228
  });
249
229
 
250
- DxcWizard.propTypes = {
251
- mode: _propTypes["default"].oneOf(["horizontal", "vertical"]),
252
- currentStep: _propTypes["default"].number,
253
- onStepClick: _propTypes["default"].func,
254
- steps: _propTypes["default"].arrayOf(_propTypes["default"].shape({
255
- label: _propTypes["default"].string,
256
- description: _propTypes["default"].string,
257
- icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
258
- iconSrc: _propTypes["default"].string,
259
- disabled: _propTypes["default"].bool,
260
- valid: _propTypes["default"].bool
261
- })),
262
- margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
263
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
264
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
265
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
266
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
267
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
268
- tabIndex: _propTypes["default"].number
269
- };
270
230
  var _default = DxcWizard;
271
231
  exports["default"] = _default;
@@ -0,0 +1,224 @@
1
+ import React from "react";
2
+ import DxcWizard from "./Wizard";
3
+ import Title from "../../.storybook/components/Title";
4
+ import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
+ import { userEvent, within } from "@storybook/testing-library";
6
+
7
+ export default {
8
+ title: "Wizard",
9
+ component: DxcWizard,
10
+ };
11
+
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
+ };
29
+
30
+ const stepWithLabel = [
31
+ {
32
+ label: "First step",
33
+ },
34
+ {
35
+ label: "Second step",
36
+ },
37
+ {
38
+ label: "Third step",
39
+ },
40
+ {
41
+ label: "Forth step",
42
+ },
43
+ ];
44
+
45
+ const stepWithLabelDescription = [
46
+ {
47
+ label: "First step",
48
+ description: "Description",
49
+ },
50
+ {
51
+ label: "Second step",
52
+ description: "Description",
53
+ },
54
+ {
55
+ label: "Third step",
56
+ description: "Description",
57
+ valid: true,
58
+ },
59
+ {
60
+ label: "Forth step",
61
+ description: "Description",
62
+ valid: false,
63
+ },
64
+ ];
65
+
66
+ const stepWithLongDescription = [
67
+ {
68
+ label: "First step",
69
+ description:
70
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ",
71
+ },
72
+ {
73
+ label: "Second step",
74
+ description:
75
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ",
76
+ },
77
+ {
78
+ label: "Third step",
79
+ description:
80
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ",
81
+ },
82
+ ];
83
+
84
+ const stepDisabled = [
85
+ {
86
+ label: "First step",
87
+ description: "Description",
88
+ disabled: true,
89
+ },
90
+ {
91
+ label: "Second step",
92
+ description: "Description",
93
+ icon: favoriteSVG,
94
+ disabled: true,
95
+ },
96
+ {
97
+ label: "Third step",
98
+ description: "Description",
99
+ disabled: true,
100
+ valid: true,
101
+ },
102
+ {
103
+ label: "Forth step",
104
+ description: "Description",
105
+ valid: false,
106
+ disabled: true,
107
+ },
108
+ ];
109
+
110
+ const stepIcons = [
111
+ {
112
+ label: "First step",
113
+ icon: favoriteSVG,
114
+ },
115
+ {
116
+ label: "Second step",
117
+ icon: favoriteSVG,
118
+ },
119
+ {
120
+ label: "Third step",
121
+ icon: favoriteSVG,
122
+ },
123
+ ];
124
+
125
+ const stepLargeIcons = [
126
+ {
127
+ label: "First step",
128
+ icon: largeIcon,
129
+ },
130
+ {
131
+ label: "Second step",
132
+ icon: largeIcon,
133
+ },
134
+ {
135
+ label: "Third step",
136
+ icon: largeIcon,
137
+ },
138
+ ];
139
+
140
+ export const Chromatic = () => (
141
+ <>
142
+ <ExampleContainer>
143
+ <Title title="Current step in the third step, labels and description" theme="light" level={4} />
144
+ <DxcWizard currentStep={2} steps={stepWithLabelDescription}></DxcWizard>
145
+ <Title title="With long description in horizontal" theme="light" level={4} />
146
+ <DxcWizard steps={stepWithLongDescription}></DxcWizard>
147
+ <Title title="With long description in vertical" theme="light" level={4} />
148
+ <DxcWizard mode="vertical" steps={stepWithLongDescription}></DxcWizard>
149
+ <Title title="Disabled steps" theme="light" level={4} />
150
+ <DxcWizard steps={stepDisabled}></DxcWizard>
151
+ <Title title="With icons" theme="light" level={4} />
152
+ <DxcWizard steps={stepIcons}></DxcWizard>
153
+ <Title title="With large icons" theme="light" level={4} />
154
+ <DxcWizard steps={stepLargeIcons}></DxcWizard>
155
+ </ExampleContainer>
156
+ <Title title="Margins horizontal" theme="light" level={2} />
157
+ <ExampleContainer>
158
+ <Title title="Xxsmall margin" theme="light" level={4} />
159
+ <DxcWizard margin="xxsmall" steps={stepWithLabel}></DxcWizard>
160
+ </ExampleContainer>
161
+ <ExampleContainer>
162
+ <Title title="Xsmall margin" theme="light" level={4} />
163
+ <DxcWizard margin="xsmall" steps={stepWithLabel}></DxcWizard>
164
+ </ExampleContainer>
165
+ <ExampleContainer>
166
+ <Title title="Small margin" theme="light" level={4} />
167
+ <DxcWizard margin="small" steps={stepWithLabel}></DxcWizard>
168
+ </ExampleContainer>
169
+ <ExampleContainer>
170
+ <Title title="Medium margin" theme="light" level={4} />
171
+ <DxcWizard margin="medium" steps={stepWithLabel}></DxcWizard>
172
+ </ExampleContainer>
173
+ <ExampleContainer>
174
+ <Title title="Large margin" theme="light" level={4} />
175
+ <DxcWizard margin="large" steps={stepWithLabel}></DxcWizard>
176
+ </ExampleContainer>
177
+ <ExampleContainer>
178
+ <Title title="Xlarge margin" theme="light" level={4} />
179
+ <DxcWizard margin="xlarge" steps={stepWithLabel}></DxcWizard>
180
+ </ExampleContainer>
181
+ <ExampleContainer>
182
+ <Title title="Xxlarge margin" theme="light" level={4} />
183
+ <DxcWizard margin="xxlarge" steps={stepWithLabel}></DxcWizard>
184
+ </ExampleContainer>
185
+ <Title title="Margins vertical" theme="light" level={2} />
186
+ <ExampleContainer>
187
+ <Title title="Xxsmall margin" theme="light" level={4} />
188
+ <DxcWizard mode="vertical" margin="xxsmall" steps={stepWithLabelDescription}></DxcWizard>
189
+ </ExampleContainer>
190
+ <ExampleContainer>
191
+ <Title title="Xsmall margin" theme="light" level={4} />
192
+ <DxcWizard mode="vertical" margin="xsmall" steps={stepWithLabel}></DxcWizard>
193
+ </ExampleContainer>
194
+ <ExampleContainer>
195
+ <Title title="Small margin" theme="light" level={4} />
196
+ <DxcWizard mode="vertical" margin="small" steps={stepWithLabel}></DxcWizard>
197
+ </ExampleContainer>
198
+ <ExampleContainer>
199
+ <Title title="Medium margin" theme="light" level={4} />
200
+ <DxcWizard mode="vertical" margin="medium" steps={stepWithLabel}></DxcWizard>
201
+ </ExampleContainer>
202
+ <ExampleContainer>
203
+ <Title title="Large margin" theme="light" level={4} />
204
+ <DxcWizard mode="vertical" margin="large" steps={stepWithLabel}></DxcWizard>
205
+ </ExampleContainer>
206
+ <ExampleContainer>
207
+ <Title title="Xlarge margin" theme="light" level={4} />
208
+ <DxcWizard mode="vertical" margin="xlarge" steps={stepWithLabel}></DxcWizard>
209
+ </ExampleContainer>
210
+ <ExampleContainer>
211
+ <Title title="Xxlarge margin" theme="light" level={4} />
212
+ <DxcWizard mode="vertical" margin="xxlarge" steps={stepWithLabel}></DxcWizard>
213
+ </ExampleContainer>
214
+ </>
215
+ );
216
+
217
+ const WizardSelected = () => <DxcWizard steps={stepWithLabel}></DxcWizard>;
218
+
219
+ export const WizardStepActived = WizardSelected.bind({});
220
+ WizardStepActived.play = async ({ canvasElement }) => {
221
+ const canvas = within(canvasElement);
222
+ const option = canvas.getByText("Third step");
223
+ await userEvent.click(option);
224
+ };
@@ -0,0 +1,64 @@
1
+ /// <reference types="react" />
2
+ declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ declare type Margin = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+ declare type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
10
+ declare type Step = {
11
+ /**
12
+ * Step label.
13
+ */
14
+ label: string;
15
+ /**
16
+ * Description that will be placed next to the step.
17
+ */
18
+ description?: string;
19
+ /**
20
+ * Element used as the icon to be displayed in the step.
21
+ */
22
+ icon?: SVG;
23
+ /**
24
+ * @deprecated URL of the icon to be displayed in the step.
25
+ */
26
+ iconSrc?: string;
27
+ /**
28
+ * Whether the step is disabled or not.
29
+ */
30
+ disabled?: boolean;
31
+ /**
32
+ * Whether the step is valid or not.
33
+ */
34
+ valid?: boolean;
35
+ };
36
+ declare type Props = {
37
+ /**
38
+ * The wizard can be showed in horizontal or vertical.
39
+ */
40
+ mode?: "horizontal" | "vertical";
41
+ /**
42
+ * Defines which step is marked as the current. The numeration starts in 0.
43
+ */
44
+ currentStep?: number;
45
+ /**
46
+ * This function will be called when the user clicks a step. The step
47
+ * number will be passed as a parameter.
48
+ */
49
+ onStepClick?: (newCurrentStep: number) => void;
50
+ /**
51
+ * An array of objects representing the steps.
52
+ */
53
+ steps: [Step, ...Step[]];
54
+ /**
55
+ * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
56
+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
57
+ */
58
+ margin?: Space | Margin;
59
+ /**
60
+ * Value of the tabindex attribute that is given to all the steps.
61
+ */
62
+ tabIndex?: number;
63
+ };
64
+ export default Props;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,28 +0,0 @@
1
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
- type Margin = {
3
- top?: Space;
4
- bottom?: Space;
5
- left?: Space;
6
- right?: Space;
7
- };
8
- type Padding = {
9
- top?: Space;
10
- bottom?: Space;
11
- left?: Space;
12
- right?: Space;
13
- };
14
-
15
- type Props = {
16
- label?: string;
17
- iconSrc?: string;
18
- icon?: any;
19
- assistiveText?: string;
20
- disabled?: boolean;
21
- onChange?: void;
22
- isExpanded?: boolean;
23
- margin?: Space | Margin;
24
- padding?: Space | Padding;
25
- tabIndex?: number;
26
- };
27
-
28
- export default function DxcAccordion(props: Props): JSX.Element;
@@ -1,16 +0,0 @@
1
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
- type Margin = {
3
- top?: Space;
4
- bottom?: Space;
5
- left?: Space;
6
- right?: Space;
7
- };
8
-
9
- type Props = {
10
- disabled?: boolean;
11
- onActiveChange?: void;
12
- indexActive?: number;
13
- margin?: Space | Margin;
14
- };
15
-
16
- export default function DxcAccordionGroup(props: Props): JSX.Element;
package/box/index.d.ts DELETED
@@ -1,25 +0,0 @@
1
- type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
2
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
- type Padding = {
10
- top?: Space;
11
- bottom?: Space;
12
- left?: Space;
13
- right?: Space;
14
- };
15
-
16
-
17
- type Props = {
18
- shadowDepth?: 0 | 1 | 2;
19
- margin?: Space | Margin;
20
- padging?: Space | Padding;
21
- display: string;
22
- size: Size;
23
- };
24
-
25
- export default function DxcBox(props: Props): JSX.Element;
package/card/index.d.ts DELETED
@@ -1,22 +0,0 @@
1
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
- type Margin = {
3
- top?: Space;
4
- bottom?: Space;
5
- left?: Space;
6
- right?: Space;
7
- };
8
-
9
- type Props = {
10
- imageSrc?: string;
11
- margin?: Space | Margin;
12
- contentPadding?: any;
13
- linkHref?: string;
14
- onClick?: void;
15
- imageBgColor?: string;
16
- imagePadding?: any;
17
- imagePosition?: "before" | "after";
18
- outlined?: boolean;
19
- imageCover?: boolean;
20
- };
21
-
22
- export default function DxcCard(props: Props): JSX.Element;
@@ -1,95 +0,0 @@
1
- type Size = "small" | "medium" | "large" | "fillParent";
2
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
-
10
- type Props = {
11
- /**
12
- * Text to be placed above the date.
13
- */
14
- label?: string;
15
- /**
16
- * Name attribute of the input element.
17
- */
18
- name?: string;
19
- /**
20
- * Value of the input element. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
21
- */
22
- value?: string;
23
- /**
24
- * The format in which the date value will be displayed. User must use this format when editing the value or it will be considered as an invalid date.
25
- */
26
- format?: string;
27
- /**
28
- * Helper text to be placed above the date.
29
- */
30
- helperText?: string;
31
- /**
32
- * If true, the date format will appear as placeholder in the field.
33
- */
34
- placeholder?: boolean;
35
- /**
36
- * If true, the date input will have an action to clear the entered value.
37
- */
38
- clearable?: boolean;
39
- /**
40
- * If true, the component will be disabled.
41
- */
42
- disabled?: boolean;
43
- /**
44
- * If true, the date will be optional, showing '(Optional)'
45
- * next to the label. Otherwise, the field will be considered required and an error will be
46
- * passed as a parameter to the OnBlur and onChange functions when it has
47
- * not been filled.
48
- */
49
- optional?: boolean;
50
- /**
51
- * This function will be called when the user types within the input
52
- * element of the component. An object including the string value, the
53
- * error and the date value will be passed to this function.
54
- * If the string value is a valid date, error will
55
- * be null. Also, if the string value is not a valid date, date will be null.
56
- */
57
- onChange?: (val: { value: string; error: string; date: Date }) => void;
58
- /**
59
- * This function will be called when the input element loses the focus.
60
- * An object including the string value, the error and the date value
61
- * will be passed to this function. If the string value is a valid date, error will
62
- * be null. Also, if the string value is not a valid date, date will be null.
63
- */
64
- onBlur?: (val: { value: string; error: string; date: Date }) => void;
65
- /**
66
- * If it is defined, the component will change its appearance, showing
67
- * the error below the date input component. If it is not defined, the error
68
- * messages will be managed internally, but never displayed on its own.
69
- */
70
- error?: string;
71
- /**
72
- * HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
73
- * Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
74
- */
75
- autocomplete?: string;
76
- /**
77
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
78
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
79
- */
80
- margin?: Space | Margin;
81
- /**
82
- * Size of the component ('medium' | 'large' | 'fillParent').
83
- */
84
- size?: Size;
85
- /**
86
- * Value of the tabindex attribute.
87
- */
88
- tabIndex?: number;
89
- /**
90
- * Reference to the component.
91
- */
92
- ref?: React.RefObject<HTMLDivElement>;
93
- };
94
-
95
- export default function DxcDateInput(props: Props): JSX.Element;
package/dialog/index.d.ts DELETED
@@ -1,18 +0,0 @@
1
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
- type Padding = {
3
- top?: Space;
4
- bottom?: Space;
5
- left?: Space;
6
- right?: Space;
7
- };
8
-
9
- type Props = {
10
- isCloseVisible?: boolean;
11
- onCloseClick?: void;
12
- overlay?: boolean;
13
- onBackgroundClick?: void;
14
- padding?: Padding,
15
- tabIndex?: number;
16
- };
17
-
18
- export default function DxcDialog(props: Props): JSX.Element;
@@ -1,26 +0,0 @@
1
- type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
2
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
-
10
- type Props = {
11
- options?: any;
12
- optionsIconPosition?: "before" | "after";
13
- icon?: any;
14
- iconSrc?: string;
15
- iconPosition?: "before" | "after";
16
- label?: string;
17
- disabled?: boolean;
18
- caretHidden?: boolean;
19
- onSelectOption?: void;
20
- expandOnHover?: boolean;
21
- margin?: Space | Margin;
22
- size?: Size;
23
- tabIndex?: number;
24
- };
25
-
26
- export default function DxcDropdown(props: Props): JSX.Element;