@dxc-technology/halstack-react 0.0.0-e832ef8 → 0.0.0-e884f9f
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.
- package/BackgroundColorContext.js +50 -0
- package/ThemeContext.js +246 -0
- package/{dist/select/Select.js → V3Select/V3Select.js} +38 -132
- package/V3Select/index.d.ts +27 -0
- package/{dist/V3Textarea → V3Textarea}/V3Textarea.js +10 -14
- package/V3Textarea/index.d.ts +27 -0
- package/accordion/Accordion.d.ts +4 -0
- package/{dist/accordion → accordion}/Accordion.js +35 -130
- package/accordion/types.d.ts +68 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +7 -0
- package/accordion-group/AccordionGroup.js +170 -0
- package/accordion-group/types.d.ts +72 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/{dist/alert → alert}/Alert.js +38 -151
- package/alert/Alert.stories.tsx +170 -0
- package/alert/types.d.ts +49 -0
- package/alert/types.js +5 -0
- package/badge/Badge.js +59 -0
- package/box/Box.d.ts +4 -0
- package/{dist/box → box}/Box.js +13 -43
- package/box/Box.stories.tsx +132 -0
- package/box/types.d.ts +43 -0
- package/box/types.js +5 -0
- package/button/Button.d.ts +4 -0
- package/{dist/button → button}/Button.js +23 -84
- package/button/Button.stories.tsx +276 -0
- package/button/types.d.ts +57 -0
- package/button/types.js +5 -0
- package/card/Card.d.ts +4 -0
- package/{dist/card → card}/Card.js +33 -123
- package/card/Card.stories.tsx +201 -0
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +67 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/{dist/checkbox → checkbox}/Checkbox.js +16 -63
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/checkbox/types.d.ts +60 -0
- package/checkbox/types.js +5 -0
- package/{dist/chip → chip}/Chip.js +17 -61
- package/chip/Chip.stories.tsx +121 -0
- package/chip/index.d.ts +22 -0
- package/{dist/common → common}/OpenSans.css +0 -0
- package/{dist/common → common}/RequiredComponent.js +3 -11
- package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/{dist/common → common}/utils.js +0 -0
- package/{dist/common → common}/variables.js +160 -152
- package/{dist/date → date}/Date.js +21 -27
- package/date/index.d.ts +27 -0
- package/date-input/DateInput.d.ts +4 -0
- package/{dist/date-input → date-input}/DateInput.js +22 -61
- package/date-input/DateInput.stories.tsx +138 -0
- package/date-input/types.d.ts +100 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/{dist/dialog → dialog}/Dialog.js +20 -73
- package/dialog/Dialog.stories.tsx +212 -0
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/{dist/dropdown → dropdown}/Dropdown.js +44 -171
- package/dropdown/types.d.ts +89 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/{dist/file-input → file-input}/FileInput.js +56 -189
- package/file-input/FileItem.d.ts +14 -0
- package/file-input/FileItem.js +182 -0
- package/file-input/types.d.ts +87 -0
- package/file-input/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/{dist/footer → footer}/Footer.js +38 -193
- package/footer/Footer.stories.jsx +151 -0
- package/{dist/footer → footer}/Icons.js +13 -13
- package/footer/types.d.ts +61 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +324 -0
- package/header/Header.stories.tsx +162 -0
- package/{dist/header → header}/Icons.js +7 -32
- package/header/types.d.ts +47 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/{dist/heading → heading}/Heading.js +30 -89
- package/heading/Heading.stories.tsx +53 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/{dist/input-text → input-text}/Icons.js +2 -2
- package/{dist/input-text → input-text}/InputText.js +36 -130
- package/input-text/index.d.ts +36 -0
- package/{dist/layout → layout}/ApplicationLayout.js +31 -123
- package/{dist/layout → layout}/Icons.js +7 -7
- package/link/Link.d.ts +3 -0
- package/{dist/link → link}/Link.js +18 -94
- package/link/Link.stories.tsx +146 -0
- package/link/types.d.ts +74 -0
- package/link/types.js +5 -0
- package/main.d.ts +44 -0
- package/{dist/main.js → main.js} +93 -97
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +86 -0
- package/number-input/NumberInput.stories.tsx +115 -0
- package/{dist/number-input → number-input}/NumberInputContext.js +1 -1
- package/number-input/types.d.ts +117 -0
- package/number-input/types.js +5 -0
- package/package.json +32 -25
- package/{dist/paginator → paginator}/Icons.js +9 -9
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +198 -0
- package/paginator/Paginator.stories.tsx +63 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/{dist/password-input → password-input}/PasswordInput.js +24 -60
- package/password-input/PasswordInput.stories.tsx +131 -0
- package/password-input/types.d.ts +100 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/{dist/progress-bar → progress-bar}/ProgressBar.js +20 -92
- package/progress-bar/ProgressBar.stories.jsx +58 -0
- package/progress-bar/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/radio/Radio.d.ts +4 -0
- package/{dist/radio → radio}/Radio.js +15 -50
- package/radio/Radio.stories.tsx +192 -0
- package/radio/types.d.ts +54 -0
- package/radio/types.js +5 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +35 -119
- package/resultsetTable/index.d.ts +19 -0
- package/select/Select.js +865 -0
- package/select/Select.stories.tsx +572 -0
- package/select/index.d.ts +131 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/{dist/sidenav → sidenav}/Sidenav.js +19 -62
- package/sidenav/Sidenav.stories.tsx +165 -0
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/{dist/slider → slider}/Slider.js +71 -158
- package/slider/Slider.stories.tsx +177 -0
- package/slider/types.d.ts +78 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +250 -0
- package/spinner/Spinner.stories.jsx +102 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/switch/Switch.d.ts +4 -0
- package/{dist/switch → switch}/Switch.js +26 -69
- package/switch/Switch.stories.tsx +160 -0
- package/switch/types.d.ts +58 -0
- package/switch/types.js +5 -0
- package/table/Table.d.ts +4 -0
- package/{dist/table → table}/Table.js +10 -24
- package/table/Table.stories.jsx +276 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +213 -0
- package/tabs/types.d.ts +70 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +193 -0
- package/tag/Tag.stories.tsx +145 -0
- package/tag/types.d.ts +60 -0
- package/tag/types.js +5 -0
- package/{dist/text-input → text-input}/TextInput.js +244 -390
- package/{dist/text-input → text-input}/index.d.ts +2 -2
- package/{dist/textarea → textarea}/Textarea.js +20 -72
- package/textarea/Textarea.stories.jsx +135 -0
- package/{dist/textarea → textarea}/index.d.ts +0 -0
- package/{dist/toggle → toggle}/Toggle.js +15 -49
- package/toggle/index.d.ts +21 -0
- package/{dist/toggle-group → toggle-group}/ToggleGroup.js +23 -107
- package/toggle-group/ToggleGroup.stories.tsx +178 -0
- package/toggle-group/index.d.ts +21 -0
- package/{dist/upload → upload}/Upload.js +14 -18
- package/{dist/upload → upload}/buttons-upload/ButtonsUpload.js +13 -37
- package/{dist/upload → upload}/buttons-upload/Icons.js +7 -7
- package/upload/dragAndDropArea/DragAndDropArea.js +225 -0
- package/upload/dragAndDropArea/Icons.js +39 -0
- package/upload/file-upload/FileToUpload.js +115 -0
- package/{dist/upload → upload}/file-upload/Icons.js +13 -13
- package/{dist/upload → upload}/files-upload/FilesToUpload.js +12 -26
- package/upload/index.d.ts +15 -0
- package/{dist/upload → upload}/transaction/Icons.js +31 -31
- package/upload/transaction/Transaction.js +104 -0
- package/upload/transactions/Transactions.js +94 -0
- package/{dist/useTheme.js → useTheme.js} +0 -0
- package/{dist/wizard → wizard}/Icons.js +8 -8
- package/wizard/Wizard.d.ts +4 -0
- package/{dist/wizard → wizard}/Wizard.js +32 -206
- package/wizard/Wizard.stories.jsx +224 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/README.md +0 -66
- package/babel.config.js +0 -8
- package/dist/BackgroundColorContext.js +0 -46
- package/dist/ThemeContext.js +0 -248
- package/dist/accordion-group/AccordionGroup.js +0 -186
- package/dist/alert/index.d.ts +0 -51
- package/dist/badge/Badge.js +0 -63
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/readme.md +0 -73
- package/dist/date-input/index.d.ts +0 -95
- package/dist/file-input/FileItem.js +0 -280
- package/dist/file-input/index.d.ts +0 -81
- package/dist/header/Header.js +0 -434
- package/dist/link/readme.md +0 -51
- package/dist/main.d.ts +0 -8
- package/dist/new-select/NewSelect.js +0 -836
- package/dist/new-select/index.d.ts +0 -53
- package/dist/number-input/NumberInput.js +0 -136
- package/dist/number-input/index.d.ts +0 -113
- package/dist/paginator/Paginator.js +0 -283
- package/dist/password-input/index.d.ts +0 -94
- package/dist/progress-bar/ProgressBar.stories.js +0 -280
- package/dist/progress-bar/readme.md +0 -63
- package/dist/radio/Radio.stories.js +0 -166
- package/dist/radio/readme.md +0 -70
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.js +0 -381
- package/dist/spinner/Spinner.stories.js +0 -183
- package/dist/spinner/readme.md +0 -65
- package/dist/switch/Switch.stories.js +0 -134
- package/dist/switch/readme.md +0 -133
- package/dist/tabs/Tabs.js +0 -343
- package/dist/tabs/Tabs.stories.js +0 -130
- package/dist/tabs/readme.md +0 -78
- package/dist/tabs-for-sections/TabsForSections.js +0 -92
- package/dist/tabs-for-sections/readme.md +0 -78
- package/dist/tag/Tag.js +0 -282
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- package/dist/upload/Upload.stories.js +0 -72
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
- package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
- package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
- package/dist/upload/file-upload/FileToUpload.js +0 -189
- package/dist/upload/readme.md +0 -37
- package/dist/upload/transaction/Transaction.js +0 -148
- package/dist/upload/transactions/Transactions.js +0 -138
- package/test/Accordion.test.js +0 -33
- package/test/AccordionGroup.test.js +0 -125
- package/test/Alert.test.js +0 -53
- package/test/Box.test.js +0 -10
- package/test/Button.test.js +0 -18
- package/test/Card.test.js +0 -30
- package/test/Checkbox.test.js +0 -45
- package/test/Chip.test.js +0 -25
- package/test/Date.test.js +0 -397
- package/test/DateInput.test.js +0 -242
- package/test/Dialog.test.js +0 -23
- package/test/Dropdown.test.js +0 -145
- package/test/FileInput.test.js +0 -201
- package/test/Footer.test.js +0 -94
- package/test/Header.test.js +0 -34
- package/test/Heading.test.js +0 -35
- package/test/InputText.test.js +0 -248
- package/test/Link.test.js +0 -43
- package/test/NumberInput.test.js +0 -259
- package/test/Paginator.test.js +0 -177
- package/test/PasswordInput.test.js +0 -83
- package/test/ProgressBar.test.js +0 -35
- package/test/Radio.test.js +0 -37
- package/test/ResultsetTable.test.js +0 -329
- package/test/Select.test.js +0 -212
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -74
- package/test/Spinner.test.js +0 -32
- package/test/Switch.test.js +0 -45
- package/test/Table.test.js +0 -36
- package/test/Tabs.test.js +0 -109
- package/test/TabsForSections.test.js +0 -34
- package/test/Tag.test.js +0 -32
- package/test/TextInput.test.js +0 -732
- package/test/Textarea.test.js +0 -193
- package/test/ToggleGroup.test.js +0 -85
- package/test/Upload.test.js +0 -60
- package/test/V3TextArea.test.js +0 -51
- package/test/Wizard.test.js +0 -130
- package/test/mocks/pngMock.js +0 -1
- package/test/mocks/svgMock.js +0 -1
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
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,153 +19,17 @@ 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
|
-
|
|
33
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", "\n border: ", ";\n opacity: 1;\n flex-grow: 1;\n"]);
|
|
34
|
-
|
|
35
|
-
_templateObject14 = function _templateObject14() {
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _templateObject13() {
|
|
43
|
-
var data = (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"]);
|
|
44
|
-
|
|
45
|
-
_templateObject13 = function _templateObject13() {
|
|
46
|
-
return data;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return data;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function _templateObject12() {
|
|
53
|
-
var data = (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"]);
|
|
54
|
-
|
|
55
|
-
_templateObject12 = function _templateObject12() {
|
|
56
|
-
return data;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
return data;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function _templateObject11() {
|
|
63
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 12px;\n"]);
|
|
64
|
-
|
|
65
|
-
_templateObject11 = function _templateObject11() {
|
|
66
|
-
return data;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
return data;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function _templateObject10() {
|
|
73
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 18px;\n height: 18px;\n position: absolute;\n top: 22.5px;\n left: 22.5px;\n"]);
|
|
74
|
-
|
|
75
|
-
_templateObject10 = function _templateObject10() {
|
|
76
|
-
return data;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
return data;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function _templateObject9() {
|
|
83
|
-
var data = (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"]);
|
|
84
|
-
|
|
85
|
-
_templateObject9 = function _templateObject9() {
|
|
86
|
-
return data;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
return data;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function _templateObject8() {
|
|
93
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n mask: url(", ") no-repeat center;\n mask-size: ", ";\n height: ", ";\n width: ", ";\n"]);
|
|
94
|
-
|
|
95
|
-
_templateObject8 = function _templateObject8() {
|
|
96
|
-
return data;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
return data;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function _templateObject7() {
|
|
103
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n overflow: hidden;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
104
|
-
|
|
105
|
-
_templateObject7 = function _templateObject7() {
|
|
106
|
-
return data;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
return data;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function _templateObject6() {
|
|
113
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n"]);
|
|
114
|
-
|
|
115
|
-
_templateObject6 = function _templateObject6() {
|
|
116
|
-
return data;
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
return data;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function _templateObject5() {
|
|
123
|
-
var data = (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"]);
|
|
124
|
-
|
|
125
|
-
_templateObject5 = function _templateObject5() {
|
|
126
|
-
return data;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
return data;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function _templateObject4() {
|
|
133
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: inline-flex;\n padding-bottom: 4px;\n"]);
|
|
134
|
-
|
|
135
|
-
_templateObject4 = function _templateObject4() {
|
|
136
|
-
return data;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
return data;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function _templateObject3() {
|
|
143
|
-
var data = (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"]);
|
|
144
|
-
|
|
145
|
-
_templateObject3 = function _templateObject3() {
|
|
146
|
-
return data;
|
|
147
|
-
};
|
|
28
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
|
148
29
|
|
|
149
|
-
|
|
150
|
-
}
|
|
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); }
|
|
151
31
|
|
|
152
|
-
function
|
|
153
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n ", "\n flex-grow: ", ";\n flex-direction: ", ";\n ", "\n"]);
|
|
154
|
-
|
|
155
|
-
_templateObject2 = function _templateObject2() {
|
|
156
|
-
return data;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
return data;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function _templateObject() {
|
|
163
|
-
var data = (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"]);
|
|
164
|
-
|
|
165
|
-
_templateObject = function _templateObject() {
|
|
166
|
-
return data;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
return data;
|
|
170
|
-
}
|
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
171
33
|
|
|
172
34
|
var DxcWizard = function DxcWizard(_ref) {
|
|
173
35
|
var _ref$mode = _ref.mode,
|
|
@@ -197,17 +59,17 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
197
59
|
}
|
|
198
60
|
};
|
|
199
61
|
|
|
200
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
62
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
201
63
|
theme: colorsTheme.wizard
|
|
202
|
-
}, _react["default"].createElement(StepsContainer, {
|
|
64
|
+
}, /*#__PURE__*/_react["default"].createElement(StepsContainer, {
|
|
203
65
|
mode: mode,
|
|
204
66
|
margin: margin
|
|
205
|
-
}, steps.map(function (step, i) {
|
|
206
|
-
return _react["default"].createElement(StepContainer, {
|
|
67
|
+
}, steps === null || steps === void 0 ? void 0 : steps.map(function (step, i) {
|
|
68
|
+
return /*#__PURE__*/_react["default"].createElement(StepContainer, {
|
|
207
69
|
key: "step".concat(i),
|
|
208
70
|
mode: mode,
|
|
209
|
-
lastStep: i === steps.length - 1
|
|
210
|
-
}, _react["default"].createElement(Step, {
|
|
71
|
+
lastStep: i === (steps === null || steps === void 0 ? void 0 : steps.length) - 1
|
|
72
|
+
}, /*#__PURE__*/_react["default"].createElement(Step, {
|
|
211
73
|
tabIndex: tabIndex,
|
|
212
74
|
onClick: function onClick() {
|
|
213
75
|
return handleStepClick(i);
|
|
@@ -215,34 +77,31 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
215
77
|
mode: mode,
|
|
216
78
|
disabled: step.disabled,
|
|
217
79
|
first: i === 0,
|
|
218
|
-
last: i === steps.length - 1
|
|
219
|
-
}, _react["default"].createElement(StepHeader, null, _react["default"].createElement(IconContainer, {
|
|
80
|
+
last: i === (steps === null || steps === void 0 ? void 0 : steps.length) - 1
|
|
81
|
+
}, /*#__PURE__*/_react["default"].createElement(StepHeader, null, /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
220
82
|
current: i === renderedCurrent,
|
|
221
83
|
visited: i < renderedCurrent,
|
|
222
84
|
disabled: step.disabled
|
|
223
|
-
}, step.icon ? _react["default"].createElement(StepIconContainer, {
|
|
85
|
+
}, step.icon ? /*#__PURE__*/_react["default"].createElement(StepIconContainer, {
|
|
224
86
|
disabled: step.disabled
|
|
225
|
-
}, (0, _typeof2["default"])(step.icon) === "object" ? step.icon
|
|
226
|
-
current: i === renderedCurrent,
|
|
227
|
-
img: step.icon.props.src
|
|
228
|
-
}) : step.icon : _react["default"].createElement(step.icon)) : step.iconSrc ? _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, {
|
|
229
88
|
src: step.iconSrc
|
|
230
|
-
}) : _react["default"].createElement(Number, {
|
|
89
|
+
}) : /*#__PURE__*/_react["default"].createElement(Number, {
|
|
231
90
|
disabled: step.disabled,
|
|
232
91
|
current: i === renderedCurrent
|
|
233
|
-
}, i + 1)), step.valid !== undefined ? step.valid ? _react["default"].createElement(ValidityIconContainer, null, _Icons.validIcon) : _react["default"].createElement(ValidityIconContainer, null, _Icons.invalidIcon) : ""), step.label || step.description ? _react["default"].createElement(InfoContainer, null, step.label ? _react["default"].createElement(Label, {
|
|
92
|
+
}, 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, {
|
|
234
93
|
disabled: step.disabled,
|
|
235
94
|
visited: i <= innerCurrent
|
|
236
|
-
}, step.label) : "", step.description ? _react["default"].createElement(Description, {
|
|
95
|
+
}, step.label) : "", step.description ? /*#__PURE__*/_react["default"].createElement(Description, {
|
|
237
96
|
disabled: step.disabled,
|
|
238
97
|
visited: i <= innerCurrent
|
|
239
|
-
}, step.description) : "") : ""), i === steps.length - 1 ? "" : _react["default"].createElement(StepSeparator, {
|
|
98
|
+
}, step.description) : "") : ""), i === steps.length - 1 ? "" : /*#__PURE__*/_react["default"].createElement(StepSeparator, {
|
|
240
99
|
mode: mode
|
|
241
100
|
}));
|
|
242
101
|
})));
|
|
243
102
|
};
|
|
244
103
|
|
|
245
|
-
var StepsContainer = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
104
|
+
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) {
|
|
246
105
|
return props.mode === "vertical" ? "column" : "row";
|
|
247
106
|
}, function (props) {
|
|
248
107
|
return props.mode === "vertical" ? "height: 500px" : "width: 100%";
|
|
@@ -260,7 +119,7 @@ var StepsContainer = _styledComponents["default"].div(_templateObject(), functio
|
|
|
260
119
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
261
120
|
});
|
|
262
121
|
|
|
263
|
-
var StepContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
122
|
+
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) {
|
|
264
123
|
return props.mode === "vertical" ? "" : "align-items: center;";
|
|
265
124
|
}, function (props) {
|
|
266
125
|
return props.lastStep ? "0" : "1";
|
|
@@ -270,7 +129,7 @@ var StepContainer = _styledComponents["default"].div(_templateObject2(), functio
|
|
|
270
129
|
return props.mode === "vertical" ? "width: 100%;" : "";
|
|
271
130
|
});
|
|
272
131
|
|
|
273
|
-
var Step = _styledComponents["default"].button(_templateObject3(), function (props) {
|
|
132
|
+
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) {
|
|
274
133
|
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";
|
|
275
134
|
}, function (props) {
|
|
276
135
|
return props.disabled ? "cursor: not-allowed" : "";
|
|
@@ -280,9 +139,9 @@ var Step = _styledComponents["default"].button(_templateObject3(), function (pro
|
|
|
280
139
|
return props.theme.focusColor;
|
|
281
140
|
});
|
|
282
141
|
|
|
283
|
-
var StepHeader = _styledComponents["default"].div(_templateObject4());
|
|
142
|
+
var StepHeader = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: inline-flex;\n padding-bottom: 4px;\n"])));
|
|
284
143
|
|
|
285
|
-
var IconContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
144
|
+
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) {
|
|
286
145
|
return props.disabled ? props.theme.disabledCircleWidth : props.current ? props.theme.selectedCircleWidth : props.theme.circleWidth;
|
|
287
146
|
}, function (props) {
|
|
288
147
|
return props.disabled ? props.theme.disabledCircleHeight : props.current ? props.theme.selectedCircleHeight : props.theme.circleHeight;
|
|
@@ -294,32 +153,19 @@ var IconContainer = _styledComponents["default"].div(_templateObject5(), functio
|
|
|
294
153
|
return !props.current && !props.disabled ? props.theme.circleBorderRadius : props.current ? props.theme.selectedCircleBorderRadius : props.disabled ? props.theme.disabledCircleBorderRadius : "";
|
|
295
154
|
});
|
|
296
155
|
|
|
297
|
-
var Icon = _styledComponents["default"].img(_templateObject6(), function (props) {
|
|
156
|
+
var Icon = _styledComponents["default"].img(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n"])), function (props) {
|
|
298
157
|
return props.theme.stepContainerIconSize;
|
|
299
158
|
}, function (props) {
|
|
300
159
|
return props.theme.stepContainerIconSize;
|
|
301
160
|
});
|
|
302
161
|
|
|
303
|
-
var StepIconContainer = _styledComponents["default"].div(_templateObject7(), function (props) {
|
|
162
|
+
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) {
|
|
304
163
|
return props.theme.stepContainerIconSize;
|
|
305
164
|
}, function (props) {
|
|
306
165
|
return props.theme.stepContainerIconSize;
|
|
307
166
|
});
|
|
308
167
|
|
|
309
|
-
var
|
|
310
|
-
return props.current ? props.theme.stepContainerSelectedFontColor : props.theme.stepContainerFontColor;
|
|
311
|
-
}, function (_ref2) {
|
|
312
|
-
var img = _ref2.img;
|
|
313
|
-
return img;
|
|
314
|
-
}, function (props) {
|
|
315
|
-
return "".concat(props.theme.stepContainerIconSize, " ").concat(props.theme.stepContainerIconSize);
|
|
316
|
-
}, function (props) {
|
|
317
|
-
return props.theme.stepContainerIconSize;
|
|
318
|
-
}, function (props) {
|
|
319
|
-
return props.theme.stepContainerIconSize;
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
var Number = _styledComponents["default"].p(_templateObject9(), 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) {
|
|
323
169
|
return props.theme.stepContainerFontSize;
|
|
324
170
|
}, function (props) {
|
|
325
171
|
return props.theme.stepContainerFontFamily;
|
|
@@ -331,11 +177,11 @@ var Number = _styledComponents["default"].p(_templateObject9(), function (props)
|
|
|
331
177
|
return props.theme.stepContainerLetterSpacing;
|
|
332
178
|
});
|
|
333
179
|
|
|
334
|
-
var ValidityIconContainer = _styledComponents["default"].div(
|
|
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"])));
|
|
335
181
|
|
|
336
|
-
var InfoContainer = _styledComponents["default"].div(
|
|
182
|
+
var InfoContainer = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 12px;\n"])));
|
|
337
183
|
|
|
338
|
-
var Label = _styledComponents["default"].p(
|
|
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) {
|
|
339
185
|
return props.theme.labelTextAlign;
|
|
340
186
|
}, function (props) {
|
|
341
187
|
return props.theme.labelFontFamily;
|
|
@@ -353,7 +199,7 @@ var Label = _styledComponents["default"].p(_templateObject12(), function (props)
|
|
|
353
199
|
return props.theme.labelFontTextTransform;
|
|
354
200
|
});
|
|
355
201
|
|
|
356
|
-
var Description = _styledComponents["default"].p(
|
|
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) {
|
|
357
203
|
return props.theme.descriptionTextAlign;
|
|
358
204
|
}, function (props) {
|
|
359
205
|
return props.theme.descriptionFontFamily;
|
|
@@ -371,7 +217,7 @@ var Description = _styledComponents["default"].p(_templateObject13(), function (
|
|
|
371
217
|
return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.visited ? props.theme.visitedDescriptionFontColor : props.theme.descriptionFontColor, ";");
|
|
372
218
|
});
|
|
373
219
|
|
|
374
|
-
var StepSeparator = _styledComponents["default"].div(
|
|
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) {
|
|
375
221
|
return props.mode === "horizontal" ? "" : "0";
|
|
376
222
|
}, function (props) {
|
|
377
223
|
return props.mode === "horizontal" ? "0" : "";
|
|
@@ -381,25 +227,5 @@ var StepSeparator = _styledComponents["default"].div(_templateObject14(), functi
|
|
|
381
227
|
return "".concat(props.theme.separatorBorderStyle, " ").concat(props.theme.separatorBorderThickness, " ").concat(props.theme.separatorColor);
|
|
382
228
|
});
|
|
383
229
|
|
|
384
|
-
DxcWizard.propTypes = {
|
|
385
|
-
mode: _propTypes["default"].oneOf(["horizontal", "vertical"]),
|
|
386
|
-
currentStep: _propTypes["default"].number,
|
|
387
|
-
onStepClick: _propTypes["default"].func,
|
|
388
|
-
steps: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
389
|
-
label: _propTypes["default"].string,
|
|
390
|
-
description: _propTypes["default"].string,
|
|
391
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
392
|
-
iconSrc: _propTypes["default"].string,
|
|
393
|
-
disabled: _propTypes["default"].bool,
|
|
394
|
-
valid: _propTypes["default"].bool
|
|
395
|
-
})),
|
|
396
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
397
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
398
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
399
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
400
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
401
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
402
|
-
tabIndex: _propTypes["default"].number
|
|
403
|
-
};
|
|
404
230
|
var _default = DxcWizard;
|
|
405
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;
|