@dxc-technology/halstack-react 0.0.0-b646454 → 0.0.0-b821bfb
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 +46 -0
- package/ThemeContext.js +250 -0
- package/V3Select/V3Select.js +549 -0
- package/V3Select/index.d.ts +27 -0
- package/V3Textarea/V3Textarea.js +264 -0
- package/V3Textarea/index.d.ts +27 -0
- package/accordion/Accordion.js +353 -0
- package/accordion/index.d.ts +28 -0
- package/accordion-group/AccordionGroup.js +186 -0
- package/accordion-group/index.d.ts +16 -0
- package/alert/Alert.js +403 -0
- package/alert/index.d.ts +51 -0
- package/badge/Badge.js +63 -0
- package/{dist/box → box}/Box.js +31 -23
- package/box/index.d.ts +25 -0
- package/button/Button.js +238 -0
- package/button/Button.stories.js +27 -0
- package/button/index.d.ts +24 -0
- package/{dist/card → card}/Card.js +72 -35
- package/card/index.d.ts +22 -0
- package/{dist/checkbox → checkbox}/Checkbox.js +107 -32
- package/checkbox/index.d.ts +24 -0
- package/chip/Chip.js +265 -0
- package/chip/index.d.ts +22 -0
- package/{dist/common → common}/OpenSans.css +0 -0
- package/{dist/common → common}/RequiredComponent.js +2 -8
- 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/common/utils.js +22 -0
- package/common/variables.js +1567 -0
- package/{dist/date → date}/Date.js +81 -59
- package/date/index.d.ts +27 -0
- package/date-input/DateInput.js +400 -0
- package/date-input/index.d.ts +95 -0
- package/{dist/dialog → dialog}/Dialog.js +58 -37
- package/dialog/index.d.ts +18 -0
- package/{dist/dropdown → dropdown}/Dropdown.js +205 -85
- package/dropdown/index.d.ts +26 -0
- package/file-input/FileInput.js +644 -0
- package/file-input/FileItem.js +287 -0
- package/file-input/index.d.ts +81 -0
- package/{dist/footer → footer}/Footer.js +121 -46
- package/footer/Icons.js +77 -0
- package/footer/index.d.ts +25 -0
- package/header/Header.js +470 -0
- package/header/Icons.js +59 -0
- package/header/index.d.ts +25 -0
- package/{dist/heading → heading}/Heading.js +93 -16
- package/heading/index.d.ts +17 -0
- package/input-text/Icons.js +22 -0
- package/input-text/InputText.js +705 -0
- package/input-text/index.d.ts +36 -0
- package/layout/ApplicationLayout.js +327 -0
- package/layout/Icons.js +55 -0
- package/link/Link.js +237 -0
- package/link/index.d.ts +23 -0
- package/main.d.ts +40 -0
- package/{dist/main.js → main.js} +112 -16
- package/number-input/NumberInput.js +136 -0
- package/{dist/ThemeContext.js → number-input/NumberInputContext.js} +3 -2
- package/number-input/index.d.ts +113 -0
- package/package.json +31 -19
- package/paginator/Icons.js +66 -0
- package/paginator/Paginator.js +305 -0
- package/paginator/index.d.ts +20 -0
- package/password-input/PasswordInput.js +203 -0
- package/password-input/index.d.ts +94 -0
- package/{dist/progress-bar → progress-bar}/ProgressBar.js +95 -38
- package/progress-bar/index.d.ts +18 -0
- package/{dist/radio → radio}/Radio.js +39 -17
- package/radio/index.d.ts +23 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +93 -68
- package/resultsetTable/index.d.ts +19 -0
- package/select/Select.js +1138 -0
- package/select/index.d.ts +131 -0
- package/sidenav/Sidenav.js +179 -0
- package/sidenav/index.d.ts +13 -0
- package/slider/Slider.js +404 -0
- package/slider/index.d.ts +29 -0
- package/spinner/Spinner.js +381 -0
- package/spinner/index.d.ts +17 -0
- package/{dist/switch → switch}/Switch.js +50 -27
- package/switch/index.d.ts +24 -0
- package/table/Table.js +132 -0
- package/table/index.d.ts +13 -0
- package/tabs/Tabs.js +343 -0
- package/tabs/index.d.ts +19 -0
- package/{dist/tag → tag}/Tag.js +100 -35
- package/tag/index.d.ts +24 -0
- package/text-input/TextInput.js +992 -0
- package/text-input/index.d.ts +135 -0
- package/textarea/Textarea.js +369 -0
- package/textarea/index.d.ts +117 -0
- package/{dist/toggle → toggle}/Toggle.js +16 -19
- package/toggle/index.d.ts +21 -0
- package/toggle-group/ToggleGroup.js +327 -0
- package/toggle-group/index.d.ts +21 -0
- package/{dist/upload → upload}/Upload.js +13 -8
- package/{dist/upload → upload}/buttons-upload/ButtonsUpload.js +32 -19
- package/upload/buttons-upload/Icons.js +40 -0
- package/{dist/upload → upload}/dragAndDropArea/DragAndDropArea.js +84 -34
- package/upload/dragAndDropArea/Icons.js +39 -0
- package/upload/file-upload/FileToUpload.js +189 -0
- package/upload/file-upload/Icons.js +66 -0
- package/{dist/upload → upload}/files-upload/FilesToUpload.js +16 -16
- package/upload/index.d.ts +15 -0
- package/upload/transaction/Icons.js +160 -0
- package/upload/transaction/Transaction.js +148 -0
- package/{dist/upload → upload}/transactions/Transactions.js +38 -20
- package/useTheme.js +22 -0
- package/wizard/Icons.js +65 -0
- package/{dist/wizard → wizard}/Wizard.js +138 -60
- package/wizard/index.d.ts +18 -0
- package/README.md +0 -66
- package/babel.config.js +0 -4
- package/dist/accordion/Accordion.js +0 -242
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- package/dist/alert/Alert.js +0 -304
- package/dist/alert/Alert.stories.js +0 -158
- package/dist/alert/close.svg +0 -4
- package/dist/alert/error.svg +0 -4
- package/dist/alert/info.svg +0 -4
- package/dist/alert/readme.md +0 -43
- package/dist/alert/success.svg +0 -4
- package/dist/alert/warning.svg +0 -4
- package/dist/button/Button.js +0 -181
- package/dist/button/Button.stories.js +0 -224
- package/dist/button/readme.md +0 -93
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/chip/Chip.js +0 -173
- package/dist/common/services/example-service.js +0 -10
- package/dist/common/services/example-service.test.js +0 -12
- package/dist/common/utils.js +0 -42
- package/dist/common/variables.js +0 -400
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/calendar.svg +0 -1
- package/dist/date/calendar_dark.svg +0 -1
- package/dist/date/readme.md +0 -73
- package/dist/dialog/Dialog.stories.js +0 -217
- package/dist/dialog/readme.md +0 -32
- package/dist/dropdown/Dropdown.stories.js +0 -249
- package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
- package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
- package/dist/dropdown/readme.md +0 -69
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo_wht.png +0 -0
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.js +0 -372
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- package/dist/header/dxc_logo_black.png +0 -0
- package/dist/header/dxc_logo_white.png +0 -0
- package/dist/header/hamb_menu_black.svg +0 -1
- package/dist/header/hamb_menu_white.svg +0 -1
- package/dist/header/readme.md +0 -33
- package/dist/input-text/InputText.js +0 -519
- package/dist/input-text/InputText.stories.js +0 -209
- package/dist/input-text/error.svg +0 -1
- package/dist/input-text/readme.md +0 -91
- package/dist/link/Link.js +0 -136
- package/dist/link/readme.md +0 -51
- package/dist/paginator/Paginator.js +0 -196
- package/dist/paginator/images/next.svg +0 -3
- package/dist/paginator/images/nextPage.svg +0 -3
- package/dist/paginator/images/previous.svg +0 -3
- package/dist/paginator/images/previousPage.svg +0 -3
- package/dist/paginator/readme.md +0 -50
- 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/resultsetTable/arrow_downward-24px_wht.svg +0 -1
- package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
- package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
- package/dist/select/Select.js +0 -445
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/sidenav/Sidenav.js +0 -236
- package/dist/sidenav/arrow_icon.svg +0 -3
- package/dist/slider/Slider.js +0 -258
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.js +0 -193
- 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/table/Table.js +0 -87
- package/dist/tabs/Tabs.js +0 -172
- package/dist/tabs/Tabs.stories.js +0 -130
- package/dist/tabs/readme.md +0 -78
- package/dist/tabs-for-sections/TabsForSections.js +0 -107
- package/dist/tabs-for-sections/readme.md +0 -78
- package/dist/textarea/Textarea.js +0 -227
- 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/buttons-upload/drag-drop-icon.svg +0 -4
- package/dist/upload/buttons-upload/upload-button.svg +0 -1
- 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 -158
- package/dist/upload/file-upload/audio-icon.svg +0 -4
- package/dist/upload/file-upload/close.svg +0 -4
- package/dist/upload/file-upload/file-icon.svg +0 -4
- package/dist/upload/file-upload/video-icon.svg +0 -4
- package/dist/upload/readme.md +0 -37
- package/dist/upload/transaction/Transaction.js +0 -155
- package/dist/upload/transaction/audio-icon-err.svg +0 -4
- package/dist/upload/transaction/audio-icon.svg +0 -4
- package/dist/upload/transaction/error-icon.svg +0 -4
- package/dist/upload/transaction/file-icon-err.svg +0 -4
- package/dist/upload/transaction/file-icon.svg +0 -4
- package/dist/upload/transaction/image-icon-err.svg +0 -4
- package/dist/upload/transaction/image-icon.svg +0 -4
- package/dist/upload/transaction/success-icon.svg +0 -4
- package/dist/upload/transaction/video-icon-err.svg +0 -4
- package/dist/upload/transaction/video-icon.svg +0 -4
- package/dist/wizard/invalid_icon.svg +0 -6
- package/dist/wizard/valid_icon.svg +0 -6
- package/dist/wizard/validation-wrong.svg +0 -6
- package/test/Accordion.test.js +0 -33
- 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 -393
- package/test/Dialog.test.js +0 -23
- package/test/Dropdown.test.js +0 -130
- package/test/Footer.test.js +0 -99
- package/test/Header.test.js +0 -39
- package/test/Heading.test.js +0 -35
- package/test/InputText.test.js +0 -236
- package/test/Link.test.js +0 -25
- package/test/Paginator.test.js +0 -165
- package/test/ProgressBar.test.js +0 -35
- package/test/Radio.test.js +0 -37
- package/test/ResultsetTable.test.js +0 -282
- package/test/Select.test.js +0 -191
- package/test/Sidenav.test.js +0 -87
- package/test/Slider.test.js +0 -65
- package/test/Spinner.test.js +0 -27
- package/test/Switch.test.js +0 -45
- package/test/Table.test.js +0 -36
- package/test/Tabs.test.js +0 -88
- package/test/TabsForSections.test.js +0 -34
- package/test/Tag.test.js +0 -32
- package/test/TextArea.test.js +0 -52
- package/test/Toggle.test.js +0 -43
- package/test/Upload.test.js +0 -60
- package/test/Wizard.test.js +0 -130
- package/test/mocks/pngMock.js +0 -1
- package/test/mocks/svgMock.js +0 -1
package/dist/upload/readme.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# DXC Upload Component
|
|
2
|
-
|
|
3
|
-
## Usage
|
|
4
|
-
|
|
5
|
-
```js
|
|
6
|
-
import { DxcUpload } from "@dxc-technology/halstack-react";
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
<table>
|
|
12
|
-
<tr style="background-color: grey">
|
|
13
|
-
<td>Name</td>
|
|
14
|
-
<td>Default</td>
|
|
15
|
-
<td>Description</td>
|
|
16
|
-
</tr>
|
|
17
|
-
<tr>
|
|
18
|
-
<td>onUpload: function</td>
|
|
19
|
-
<td></td>
|
|
20
|
-
<td>This function will be called when the user clicks the 'Upload' button for every file to be uploaded, we will send as a parameter the File object; apart from that this function should return one promise on which we should make 'then'(here we should show a Success alert) or 'catch' (in this case we would receive the error message as a string)</td>
|
|
21
|
-
</tr>
|
|
22
|
-
|
|
23
|
-
</table>
|
|
24
|
-
|
|
25
|
-
## Examples
|
|
26
|
-
|
|
27
|
-
```js
|
|
28
|
-
import React from "react";
|
|
29
|
-
|
|
30
|
-
import { DxcUpload } from "@dxc-technology/halstack-react";
|
|
31
|
-
|
|
32
|
-
function App() {
|
|
33
|
-
return <Upload callbackUpload={callbackFunc} />;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export default App;
|
|
37
|
-
```
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
|
-
|
|
20
|
-
require("../../common/OpenSans.css");
|
|
21
|
-
|
|
22
|
-
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
23
|
-
|
|
24
|
-
var _successIcon = _interopRequireDefault(require("./success-icon.svg"));
|
|
25
|
-
|
|
26
|
-
var _errorIcon = _interopRequireDefault(require("./error-icon.svg"));
|
|
27
|
-
|
|
28
|
-
var _fileIcon = _interopRequireDefault(require("./file-icon.svg"));
|
|
29
|
-
|
|
30
|
-
var _imageIcon = _interopRequireDefault(require("./image-icon.svg"));
|
|
31
|
-
|
|
32
|
-
var _videoIcon = _interopRequireDefault(require("./video-icon.svg"));
|
|
33
|
-
|
|
34
|
-
var _audioIcon = _interopRequireDefault(require("./audio-icon.svg"));
|
|
35
|
-
|
|
36
|
-
var _fileIconErr = _interopRequireDefault(require("./file-icon-err.svg"));
|
|
37
|
-
|
|
38
|
-
var _imageIconErr = _interopRequireDefault(require("./image-icon-err.svg"));
|
|
39
|
-
|
|
40
|
-
var _videoIconErr = _interopRequireDefault(require("./video-icon-err.svg"));
|
|
41
|
-
|
|
42
|
-
var _audioIconErr = _interopRequireDefault(require("./audio-icon-err.svg"));
|
|
43
|
-
|
|
44
|
-
var _Spinner = _interopRequireDefault(require("../../spinner/Spinner"));
|
|
45
|
-
|
|
46
|
-
var _variables = require("../../common/variables.js");
|
|
47
|
-
|
|
48
|
-
var _ThemeContext = _interopRequireDefault(require("../../ThemeContext.js"));
|
|
49
|
-
|
|
50
|
-
function _templateObject5() {
|
|
51
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 25px;\n height: 20px;\n background: ", ";\n"]);
|
|
52
|
-
|
|
53
|
-
_templateObject5 = function _templateObject5() {
|
|
54
|
-
return data;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
return data;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function _templateObject4() {
|
|
61
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 16px;\n"]);
|
|
62
|
-
|
|
63
|
-
_templateObject4 = function _templateObject4() {
|
|
64
|
-
return data;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return data;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function _templateObject3() {
|
|
71
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n"]);
|
|
72
|
-
|
|
73
|
-
_templateObject3 = function _templateObject3() {
|
|
74
|
-
return data;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
return data;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function _templateObject2() {
|
|
81
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: 24px;\n width: 24px;\n margin-right: 16px;\n svg {\n fill: ", ";\n }\n"]);
|
|
82
|
-
|
|
83
|
-
_templateObject2 = function _templateObject2() {
|
|
84
|
-
return data;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
return data;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function _templateObject() {
|
|
91
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: \"Open Sans\", sans-serif;\n max-width: 100%;\n display: flex;\n flex-direction: row;\n margin-bottom: 16px;\n color: ", ";\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n .MuiCircularProgress-root {\n width: 28px !important;\n height: 28px !important;\n }\n"]);
|
|
92
|
-
|
|
93
|
-
_templateObject = function _templateObject() {
|
|
94
|
-
return data;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
return data;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
var DxcTransaction = function DxcTransaction(_ref) {
|
|
101
|
-
var _ref$name = _ref.name,
|
|
102
|
-
name = _ref$name === void 0 ? "" : _ref$name,
|
|
103
|
-
_ref$type = _ref.type,
|
|
104
|
-
type = _ref$type === void 0 ? "" : _ref$type,
|
|
105
|
-
_ref$status = _ref.status,
|
|
106
|
-
status = _ref$status === void 0 ? "" : _ref$status,
|
|
107
|
-
_ref$message = _ref.message,
|
|
108
|
-
message = _ref$message === void 0 ? "" : _ref$message;
|
|
109
|
-
|
|
110
|
-
var colorsTheme = (0, _react.useContext)(_ThemeContext["default"]) || _variables.colors;
|
|
111
|
-
|
|
112
|
-
var icon = status === "error" && (type.includes("image") && _imageIconErr["default"] || type.includes("video") && _videoIconErr["default"] || type.includes("audio") && _audioIconErr["default"] || _fileIconErr["default"]) || type.includes("image") && _imageIcon["default"] || type.includes("video") && _videoIcon["default"] || type.includes("audio") && _audioIcon["default"] || _fileIcon["default"];
|
|
113
|
-
|
|
114
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
115
|
-
theme: colorsTheme
|
|
116
|
-
}, _react["default"].createElement(DXCTransaction, {
|
|
117
|
-
status: status
|
|
118
|
-
}, _react["default"].createElement(FileImage, {
|
|
119
|
-
src: icon
|
|
120
|
-
}), status === "processing" && _react["default"].createElement(Prueba, null, _react["default"].createElement(FileName, null, name), _react["default"].createElement(_Spinner["default"], {
|
|
121
|
-
mode: "small"
|
|
122
|
-
})) || status === "success" && _react["default"].createElement(Prueba, null, _react["default"].createElement(FileName, null, name), _react["default"].createElement(FileStatus, {
|
|
123
|
-
status: status
|
|
124
|
-
})) || status === "error" && _react["default"].createElement(Prueba, null, _react["default"].createElement(_Tooltip["default"], {
|
|
125
|
-
title: message
|
|
126
|
-
}, _react["default"].createElement(FileName, null, name)), _react["default"].createElement(FileStatus, {
|
|
127
|
-
status: status
|
|
128
|
-
}))));
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
DxcTransaction.propTypes = {
|
|
132
|
-
name: _propTypes["default"].string,
|
|
133
|
-
type: _propTypes["default"].string,
|
|
134
|
-
status: _propTypes["default"].string,
|
|
135
|
-
message: _propTypes["default"].string
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
var DXCTransaction = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
139
|
-
return props.status === "error" && "".concat(props.theme.red);
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
var FileImage = _styledComponents["default"].img(_templateObject2(), function (props) {
|
|
143
|
-
return props.status === "error" && "#D0011B" || "".concat(props.theme.lightGrey);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
var Prueba = _styledComponents["default"].div(_templateObject3());
|
|
147
|
-
|
|
148
|
-
var FileName = _styledComponents["default"].div(_templateObject4());
|
|
149
|
-
|
|
150
|
-
var FileStatus = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
151
|
-
return props.status === "success" && "url('".concat(_successIcon["default"], "') no-repeat padding-box") || props.status === "error" && "url('".concat(_errorIcon["default"], "') no-repeat padding-box");
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
var _default = DxcTransaction;
|
|
155
|
-
exports["default"] = _default;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#D0011B">
|
|
2
|
-
<path fill="none" d="M0 0h24v24H0V0z"/>
|
|
3
|
-
<path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14zM8 15c0-1.66 1.34-3 3-3 .35 0 .69.07 1 .18V6h5v2h-3v7.03c-.02 1.64-1.35 2.97-3 2.97-1.66 0-3-1.34-3-3z"/>
|
|
4
|
-
</svg>
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#D9D9D9">
|
|
2
|
-
<path fill="none" d="M0 0h24v24H0V0z"/>
|
|
3
|
-
<path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14zM8 15c0-1.66 1.34-3 3-3 .35 0 .69.07 1 .18V6h5v2h-3v7.03c-.02 1.64-1.35 2.97-3 2.97-1.66 0-3-1.34-3-3z"/>
|
|
4
|
-
</svg>
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#D0011B">
|
|
2
|
-
<path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/>
|
|
3
|
-
<path d="M0 0h24v24H0z" fill="none"/>
|
|
4
|
-
</svg>
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#D9D9D9">
|
|
2
|
-
<path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/>
|
|
3
|
-
<path d="M0 0h24v24H0z" fill="none"/>
|
|
4
|
-
</svg>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="496" height="496" viewBox="0 0 496 496">
|
|
2
|
-
<g id="Group_2913" data-name="Group 2913" transform="translate(5286 3925)">
|
|
3
|
-
<path id="Path_2821" data-name="Path 2821" d="M240,0C372.548,0,480,107.452,480,240S372.548,480,240,480,0,372.548,0,240,107.452,0,240,0Z" transform="translate(-5278 -3917)" fill="#f9cfcf"/>
|
|
4
|
-
<path id="times-circle-regular" d="M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm0,448A200,200,0,1,1,456,256,199.945,199.945,0,0,1,256,456ZM357.8,193.8,295.6,256l62.2,62.2a12.011,12.011,0,0,1,0,17l-22.6,22.6a12.011,12.011,0,0,1-17,0L256,295.6l-62.2,62.2a12.011,12.011,0,0,1-17,0l-22.6-22.6a12.011,12.011,0,0,1,0-17L216.4,256l-62.2-62.2a12.011,12.011,0,0,1,0-17l22.6-22.6a12.011,12.011,0,0,1,17,0L256,216.4l62.2-62.2a12.011,12.011,0,0,1,17,0l22.6,22.6a12.011,12.011,0,0,1,0,17Z" transform="translate(-5294 -3933)" fill="#e22"/>
|
|
5
|
-
</g>
|
|
6
|
-
</svg>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="496" height="496" viewBox="0 0 496 496">
|
|
2
|
-
<g id="Group_2914" data-name="Group 2914" transform="translate(4677 3925)">
|
|
3
|
-
<path id="Path_2822" data-name="Path 2822" d="M240,0C372.548,0,480,107.452,480,240S372.548,480,240,480,0,372.548,0,240,107.452,0,240,0Z" transform="translate(-4669 -3917)" fill="#dbf1c4"/>
|
|
4
|
-
<path id="check-circle-regular" d="M256,8C119.033,8,8,119.033,8,256S119.033,504,256,504,504,392.967,504,256,392.967,8,256,8Zm0,48A200,200,0,1,1,56,256,199.893,199.893,0,0,1,256,56M396.2,186.267l-22.536-22.718a12,12,0,0,0-16.97-.068L215.346,303.7,155.554,243.42a12,12,0,0,0-16.97-.069l-22.719,22.536a12,12,0,0,0-.068,16.971l90.781,91.516a12,12,0,0,0,16.97.068l172.589-171.2a12,12,0,0,0,.067-16.971Z" transform="translate(-4685 -3933)" fill="#7ed321"/>
|
|
5
|
-
</g>
|
|
6
|
-
</svg>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="496" height="496" viewBox="0 0 496 496">
|
|
2
|
-
<g id="Group_2913" data-name="Group 2913" transform="translate(5286 3925)">
|
|
3
|
-
<path id="Path_2821" data-name="Path 2821" d="M240,0C372.548,0,480,107.452,480,240S372.548,480,240,480,0,372.548,0,240,107.452,0,240,0Z" transform="translate(-5278 -3917)" fill="#f9cfcf"/>
|
|
4
|
-
<path id="times-circle-regular" d="M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm0,448A200,200,0,1,1,456,256,199.945,199.945,0,0,1,256,456ZM357.8,193.8,295.6,256l62.2,62.2a12.011,12.011,0,0,1,0,17l-22.6,22.6a12.011,12.011,0,0,1-17,0L256,295.6l-62.2,62.2a12.011,12.011,0,0,1-17,0l-22.6-22.6a12.011,12.011,0,0,1,0-17L216.4,256l-62.2-62.2a12.011,12.011,0,0,1,0-17l22.6-22.6a12.011,12.011,0,0,1,17,0L256,216.4l62.2-62.2a12.011,12.011,0,0,1,17,0l22.6,22.6a12.011,12.011,0,0,1,0,17Z" transform="translate(-5294 -3933)" fill="#e22"/>
|
|
5
|
-
</g>
|
|
6
|
-
</svg>
|
package/test/Accordion.test.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render, fireEvent } from "@testing-library/react";
|
|
3
|
-
import DxcAccordion from "../src/accordion/Accordion";
|
|
4
|
-
|
|
5
|
-
describe("Accordion component tests", () => {
|
|
6
|
-
test("Accordion renders with correct text", () => {
|
|
7
|
-
const onChange = jest.fn();
|
|
8
|
-
const { getByText } = render(<DxcAccordion label="Accordion" onChange={onChange} />);
|
|
9
|
-
|
|
10
|
-
expect(getByText("Accordion")).toBeTruthy();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
test("Calls correct function on click", () => {
|
|
14
|
-
const onChange = jest.fn();
|
|
15
|
-
const { getByText } = render(<DxcAccordion label="Accordion" onChange={onChange} />);
|
|
16
|
-
|
|
17
|
-
fireEvent.click(getByText("Accordion"));
|
|
18
|
-
expect(onChange).toHaveBeenCalled();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
test("Controlled accordion", () => {
|
|
22
|
-
const onChange = jest.fn();
|
|
23
|
-
const { getByText } = render(<DxcAccordion label="Accordion" onChange={onChange} isExpanded={true} />);
|
|
24
|
-
|
|
25
|
-
fireEvent.click(getByText("Accordion"));
|
|
26
|
-
fireEvent.click(getByText("Accordion"));
|
|
27
|
-
fireEvent.click(getByText("Accordion"));
|
|
28
|
-
expect(onChange).toHaveBeenCalledTimes(3);
|
|
29
|
-
expect(onChange.mock.calls[0][0]).toBe(false);
|
|
30
|
-
expect(onChange.mock.calls[1][0]).toBe(false);
|
|
31
|
-
expect(onChange.mock.calls[2][0]).toBe(false);
|
|
32
|
-
});
|
|
33
|
-
});
|
package/test/Alert.test.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render, fireEvent } from "@testing-library/react";
|
|
3
|
-
import DxcAlert from "../src/alert/Alert";
|
|
4
|
-
|
|
5
|
-
describe("Alert component tests", () => {
|
|
6
|
-
test("Info alert renders with correct text", () => {
|
|
7
|
-
const { getByText } = render(<DxcAlert type="info" inlineText="info-alert-text" />);
|
|
8
|
-
expect(getByText("information")).toBeTruthy();
|
|
9
|
-
expect(getByText("info-alert-text")).toBeTruthy();
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test("Confirm alert renders with correct text", () => {
|
|
13
|
-
const { getByText } = render(<DxcAlert type="confirm" inlineText="confirm-alert-text" />);
|
|
14
|
-
expect(getByText("success")).toBeTruthy();
|
|
15
|
-
expect(getByText("confirm-alert-text")).toBeTruthy();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
test("Warning alert renders with correct text", () => {
|
|
19
|
-
const { getByText } = render(<DxcAlert type="warning" inlineText="warning-alert-text" />);
|
|
20
|
-
expect(getByText("warning")).toBeTruthy();
|
|
21
|
-
expect(getByText("warning-alert-text")).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
test("Error alert renders with correct text", () => {
|
|
25
|
-
const { getByText } = render(<DxcAlert type="error" inlineText="error-alert-text" />);
|
|
26
|
-
expect(getByText("error")).toBeTruthy();
|
|
27
|
-
expect(getByText("error-alert-text")).toBeTruthy();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
test("Alert renders with correct children", () => {
|
|
31
|
-
const { getByText } = render(<DxcAlert inlineText="alert-text"><p>sample-children</p></DxcAlert>);
|
|
32
|
-
expect(getByText("alert-text")).toBeTruthy();
|
|
33
|
-
expect(getByText("sample-children")).toBeTruthy();
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
test("Calls correct function on close", () => {
|
|
37
|
-
const onClose = jest.fn();
|
|
38
|
-
const { getByRole } = render(<DxcAlert onClose={onClose} inlineText="info-alert-text" />);
|
|
39
|
-
|
|
40
|
-
const closeButton = getByRole("button");
|
|
41
|
-
fireEvent.click(closeButton);
|
|
42
|
-
expect(onClose).toHaveBeenCalled();
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
test("Modal alert calls correct function on close", () => {
|
|
46
|
-
const onClose = jest.fn();
|
|
47
|
-
const { getByRole } = render(<DxcAlert onClose={onClose} mode="modal" inlineText="info-alert-text" />);
|
|
48
|
-
|
|
49
|
-
const closeButton = getByRole("button");
|
|
50
|
-
fireEvent.click(closeButton);
|
|
51
|
-
expect(onClose).toHaveBeenCalled();
|
|
52
|
-
});
|
|
53
|
-
});
|
package/test/Box.test.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "@testing-library/react";
|
|
3
|
-
import DxcBox from "../src/card/Card";
|
|
4
|
-
|
|
5
|
-
describe("Box component tests", () => {
|
|
6
|
-
test("Box renders with correct text", () => {
|
|
7
|
-
const { getByText } = render(<DxcBox>test-box</DxcBox>);
|
|
8
|
-
expect(getByText("test-box")).toBeTruthy();
|
|
9
|
-
});
|
|
10
|
-
});
|
package/test/Button.test.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render, fireEvent } from "@testing-library/react";
|
|
3
|
-
import DxcButton from "../src/button/Button";
|
|
4
|
-
|
|
5
|
-
describe("Button component tests", () => {
|
|
6
|
-
test("Button renders with correct text", () => {
|
|
7
|
-
const { getByText } = render(<DxcButton label="Button" />);
|
|
8
|
-
expect(getByText("Button")).toBeTruthy();
|
|
9
|
-
});
|
|
10
|
-
test("Calls correct function on click", () => {
|
|
11
|
-
const onClick = jest.fn();
|
|
12
|
-
const { getByText } = render(<DxcButton label="Button" onClick={onClick} />);
|
|
13
|
-
|
|
14
|
-
const button = getByText("Button");
|
|
15
|
-
fireEvent.click(button);
|
|
16
|
-
expect(onClick).toHaveBeenCalled();
|
|
17
|
-
});
|
|
18
|
-
});
|
package/test/Card.test.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render, fireEvent } from "@testing-library/react";
|
|
3
|
-
import DxcCard from "../src/card/Card";
|
|
4
|
-
|
|
5
|
-
describe("Card component tests", () => {
|
|
6
|
-
test("Card renders with correct content", () => {
|
|
7
|
-
const { getByText } = render(<DxcCard>test-card</DxcCard>);
|
|
8
|
-
expect(getByText("test-card")).toBeTruthy();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
test("Card renders with correct href", () => {
|
|
12
|
-
const { getByRole } = render(<DxcCard linkHref="/testPage">test-card</DxcCard>);
|
|
13
|
-
const card = getByRole("link");
|
|
14
|
-
expect(card.getAttribute("href")).toEqual("/testPage");
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
test("Card renders with correct image", () => {
|
|
18
|
-
const { getByRole } = render(<DxcCard imageSrc="/testImage">test-card</DxcCard>);
|
|
19
|
-
const card = getByRole("img");
|
|
20
|
-
expect(card.getAttribute("src")).toEqual("/testImage");
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test("OnClick function is called", () => {
|
|
24
|
-
const onClick = jest.fn();
|
|
25
|
-
const { getByText } = render(<DxcCard onClick={onClick}>test-card</DxcCard>);
|
|
26
|
-
const card = getByText("test-card");
|
|
27
|
-
fireEvent.click(card);
|
|
28
|
-
expect(onClick).toHaveBeenCalled();
|
|
29
|
-
});
|
|
30
|
-
});
|
package/test/Checkbox.test.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render, fireEvent } from "@testing-library/react";
|
|
3
|
-
|
|
4
|
-
import DxcCheckbox from "../src/checkbox/Checkbox";
|
|
5
|
-
|
|
6
|
-
describe("Checkbox component tests", () => {
|
|
7
|
-
test("Checkbox renders with correct text", () => {
|
|
8
|
-
const { getByText } = render(<DxcCheckbox label="Checkbox" />);
|
|
9
|
-
|
|
10
|
-
expect(getByText("Checkbox")).toBeTruthy();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
test("Calls correct function on click", () => {
|
|
14
|
-
const onChange = jest.fn();
|
|
15
|
-
const { getByText } = render(<DxcCheckbox label="Checkbox" onChange={onChange} />);
|
|
16
|
-
|
|
17
|
-
fireEvent.click(getByText("Checkbox"));
|
|
18
|
-
expect(onChange).toHaveBeenCalled();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
test("Uncontrolled checkbox", () => {
|
|
22
|
-
const onChange = jest.fn();
|
|
23
|
-
const component = render(<DxcCheckbox label="Checkbox" onChange={onChange} />);
|
|
24
|
-
const visibleCheckbox = component.getByText("Checkbox");
|
|
25
|
-
const input = component.getByRole("checkbox");
|
|
26
|
-
expect(input.checked).toBe(false);
|
|
27
|
-
fireEvent.click(visibleCheckbox);
|
|
28
|
-
expect(onChange).toHaveBeenCalled();
|
|
29
|
-
expect(onChange).toHaveBeenCalledWith(true);
|
|
30
|
-
expect(input.checked).toBe(true);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
test("Controlled checkbox", () => {
|
|
34
|
-
const onChange = jest.fn();
|
|
35
|
-
const component = render(<DxcCheckbox label="Checkbox" checked={false} onChange={onChange} />);
|
|
36
|
-
|
|
37
|
-
const input = component.getByRole("checkbox");
|
|
38
|
-
const visibleCheckbox = component.getByText("Checkbox");
|
|
39
|
-
|
|
40
|
-
fireEvent.click(visibleCheckbox);
|
|
41
|
-
expect(onChange).toHaveBeenCalled();
|
|
42
|
-
expect(onChange).toHaveBeenCalledWith(true);
|
|
43
|
-
expect(input.checked).toBe(false);
|
|
44
|
-
});
|
|
45
|
-
});
|
package/test/Chip.test.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render, fireEvent } from "@testing-library/react";
|
|
3
|
-
import DxcChip from "../src/chip/Chip";
|
|
4
|
-
import icon from "../../app/src/images/invision.svg";
|
|
5
|
-
|
|
6
|
-
describe("Chip component tests", () => {
|
|
7
|
-
test("Chip renders with correct text", () => {
|
|
8
|
-
const { getByText } = render(<DxcChip label="Chip" />);
|
|
9
|
-
expect(getByText("Chip")).toBeTruthy();
|
|
10
|
-
});
|
|
11
|
-
test("Calls correct function when clicking on prefix icon", () => {
|
|
12
|
-
const onClick = jest.fn();
|
|
13
|
-
const { getByText, getByRole } = render(<DxcChip label="Chip" prefixIconSrc={icon} onClickPrefix={onClick} />);
|
|
14
|
-
expect(getByText("Chip")).toBeTruthy();
|
|
15
|
-
fireEvent.click(getByRole("img"));
|
|
16
|
-
expect(onClick).toHaveBeenCalled();
|
|
17
|
-
});
|
|
18
|
-
test("Calls correct function when clicking on suffix icon", () => {
|
|
19
|
-
const onClick = jest.fn();
|
|
20
|
-
const { getByText, getByRole } = render(<DxcChip label="Chip" suffixIconSrc={icon} onClickSuffix={onClick} />);
|
|
21
|
-
expect(getByText("Chip")).toBeTruthy();
|
|
22
|
-
fireEvent.click(getByRole("img"));
|
|
23
|
-
expect(onClick).toHaveBeenCalled();
|
|
24
|
-
});
|
|
25
|
-
});
|