@dxc-technology/halstack-react 0.0.0-eb2a4cc → 0.0.0-ebb089f
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/README.md +2 -2
- package/babel.config.js +5 -2
- package/dist/BackgroundColorContext.js +46 -0
- package/dist/ThemeContext.js +237 -2
- package/dist/V3Select/V3Select.js +549 -0
- package/dist/V3Select/index.d.ts +27 -0
- package/dist/V3Textarea/V3Textarea.js +264 -0
- package/dist/V3Textarea/index.d.ts +27 -0
- package/dist/accordion/Accordion.js +170 -81
- package/dist/accordion/index.d.ts +28 -0
- package/dist/accordion-group/AccordionGroup.js +186 -0
- package/dist/accordion-group/index.d.ts +16 -0
- package/dist/alert/Alert.js +184 -83
- package/dist/alert/index.d.ts +51 -0
- package/dist/badge/Badge.js +63 -0
- package/dist/box/Box.js +31 -23
- package/dist/box/index.d.ts +25 -0
- package/dist/button/Button.js +84 -29
- package/dist/button/Button.stories.js +14 -211
- package/dist/button/index.d.ts +24 -0
- package/dist/card/Card.js +72 -35
- package/dist/card/index.d.ts +22 -0
- package/dist/checkbox/Checkbox.js +107 -32
- package/dist/checkbox/index.d.ts +24 -0
- package/dist/chip/Chip.js +135 -40
- package/dist/chip/index.d.ts +22 -0
- package/dist/common/RequiredComponent.js +2 -8
- package/dist/common/utils.js +2 -22
- package/dist/common/variables.js +1472 -159
- package/dist/date/Date.js +81 -59
- package/dist/date/index.d.ts +27 -0
- package/dist/date-input/DateInput.js +400 -0
- package/dist/date-input/index.d.ts +95 -0
- package/dist/dialog/Dialog.js +61 -36
- package/dist/dialog/index.d.ts +18 -0
- package/dist/dropdown/Dropdown.js +226 -94
- package/dist/dropdown/index.d.ts +26 -0
- package/dist/file-input/FileInput.js +644 -0
- package/dist/file-input/FileItem.js +287 -0
- package/dist/file-input/index.d.ts +81 -0
- package/dist/footer/Footer.js +122 -47
- package/dist/footer/Icons.js +77 -0
- package/dist/footer/index.d.ts +25 -0
- package/dist/header/Header.js +211 -91
- package/dist/header/Icons.js +59 -0
- package/dist/header/index.d.ts +25 -0
- package/dist/heading/Heading.js +93 -22
- package/dist/heading/index.d.ts +17 -0
- package/dist/input-text/Icons.js +22 -0
- package/dist/input-text/InputText.js +290 -104
- package/dist/input-text/index.d.ts +36 -0
- package/dist/layout/ApplicationLayout.js +327 -0
- package/dist/layout/Icons.js +55 -0
- package/dist/link/Link.js +136 -35
- package/dist/link/index.d.ts +23 -0
- package/dist/main.d.ts +40 -0
- package/dist/main.js +112 -16
- package/dist/number-input/NumberInput.js +136 -0
- package/dist/number-input/NumberInputContext.js +16 -0
- package/dist/number-input/index.d.ts +113 -0
- package/dist/paginator/Icons.js +66 -0
- package/dist/paginator/Paginator.js +184 -57
- package/dist/paginator/index.d.ts +20 -0
- package/dist/password-input/PasswordInput.js +203 -0
- package/dist/password-input/index.d.ts +94 -0
- package/dist/progress-bar/ProgressBar.js +97 -44
- package/dist/progress-bar/index.d.ts +18 -0
- package/dist/radio/Radio.js +39 -21
- package/dist/radio/index.d.ts +23 -0
- package/dist/resultsetTable/ResultsetTable.js +93 -69
- package/dist/resultsetTable/index.d.ts +19 -0
- package/dist/select/Select.js +957 -262
- package/dist/select/index.d.ts +131 -0
- package/dist/sidenav/Sidenav.js +87 -125
- package/dist/sidenav/index.d.ts +13 -0
- package/dist/slider/Slider.js +219 -73
- package/dist/slider/index.d.ts +29 -0
- package/dist/spinner/Spinner.js +249 -64
- package/dist/spinner/index.d.ts +17 -0
- package/dist/switch/Switch.js +51 -26
- package/dist/switch/index.d.ts +24 -0
- package/dist/table/Table.js +63 -15
- package/dist/table/index.d.ts +13 -0
- package/dist/tabs/Tabs.js +208 -35
- package/dist/tabs/index.d.ts +19 -0
- package/dist/tag/Tag.js +100 -35
- package/dist/tag/index.d.ts +24 -0
- package/dist/text-input/TextInput.js +974 -0
- package/dist/text-input/index.d.ts +135 -0
- package/dist/textarea/Textarea.js +250 -107
- package/dist/textarea/index.d.ts +117 -0
- package/dist/toggle/Toggle.js +16 -19
- package/dist/toggle/index.d.ts +21 -0
- package/dist/toggle-group/ToggleGroup.js +327 -0
- package/dist/toggle-group/index.d.ts +21 -0
- package/dist/upload/Upload.js +13 -8
- package/dist/upload/buttons-upload/ButtonsUpload.js +35 -25
- package/dist/upload/buttons-upload/Icons.js +40 -0
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +84 -37
- package/dist/upload/dragAndDropArea/Icons.js +39 -0
- package/dist/upload/file-upload/FileToUpload.js +64 -33
- package/dist/upload/file-upload/Icons.js +66 -0
- package/dist/upload/files-upload/FilesToUpload.js +16 -16
- package/dist/upload/index.d.ts +15 -0
- package/dist/upload/transaction/Icons.js +160 -0
- package/dist/upload/transaction/Transaction.js +42 -49
- package/dist/upload/transactions/Transactions.js +38 -20
- package/dist/useTheme.js +22 -0
- package/dist/wizard/Icons.js +65 -0
- package/dist/wizard/Wizard.js +156 -61
- package/dist/wizard/index.d.ts +18 -0
- package/package.json +26 -14
- package/test/AccordionGroup.test.js +125 -0
- package/test/Date.test.js +15 -13
- package/test/DateInput.test.js +242 -0
- package/test/Dropdown.test.js +19 -4
- package/test/FileInput.test.js +201 -0
- package/test/Footer.test.js +2 -7
- package/test/Header.test.js +5 -10
- package/test/Heading.test.js +60 -12
- package/test/InputText.test.js +31 -28
- package/test/Link.test.js +25 -7
- package/test/NumberInput.test.js +259 -0
- package/test/Paginator.test.js +76 -60
- package/test/PasswordInput.test.js +83 -0
- package/test/ResultsetTable.test.js +65 -17
- package/test/Select.test.js +869 -132
- package/test/Sidenav.test.js +22 -64
- package/test/Slider.test.js +24 -15
- package/test/Spinner.test.js +5 -0
- package/test/Tabs.test.js +21 -0
- package/test/TextInput.test.js +731 -0
- package/test/Textarea.test.js +193 -0
- package/test/ToggleGroup.test.js +85 -0
- package/test/Upload.test.js +1 -1
- package/test/V3Select.test.js +212 -0
- package/test/{TextArea.test.js → V3TextArea.test.js} +6 -7
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- 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/readme.md +0 -93
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/common/services/example-service.js +0 -10
- package/dist/common/services/example-service.test.js +0 -12
- 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.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.stories.js +0 -209
- package/dist/input-text/error.svg +0 -1
- package/dist/input-text/readme.md +0 -91
- package/dist/link/readme.md +0 -51
- 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.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/sidenav/arrow_icon.svg +0 -3
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- 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.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/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/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/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/TabsForSections.test.js +0 -34
- package/test/Toggle.test.js +0 -43
package/dist/toggle/readme.md
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
# DXC Toggle Component
|
|
2
|
-
|
|
3
|
-
## Usage
|
|
4
|
-
|
|
5
|
-
```js
|
|
6
|
-
import { DxcToggle } from "@dxc-technology/halstack-react";
|
|
7
|
-
|
|
8
|
-
<DxcToggle onClick={handleClick} label="Test Button" />;
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Props
|
|
12
|
-
|
|
13
|
-
<table>
|
|
14
|
-
<tr style="background-color: grey">
|
|
15
|
-
<td>Name</td>
|
|
16
|
-
<td>Default</td>
|
|
17
|
-
<td>Description</td>
|
|
18
|
-
</tr>
|
|
19
|
-
<tr>
|
|
20
|
-
<td>selected: boolean</td>
|
|
21
|
-
<td><code>false</code></td>
|
|
22
|
-
<td>If true, the component is selected.</td>
|
|
23
|
-
</tr>
|
|
24
|
-
<tr>
|
|
25
|
-
<td>mode: 'basic' | 'outlined'</td>
|
|
26
|
-
<td><code>'basic'</code></td>
|
|
27
|
-
<td>Uses on of the available toggle modes.</td>
|
|
28
|
-
</tr>
|
|
29
|
-
<tr>
|
|
30
|
-
<td>iconPosition: 'before' | 'after'</td>
|
|
31
|
-
<td><code>'before'</code></td>
|
|
32
|
-
<td>Changes the position of the icon.</td>
|
|
33
|
-
</tr>
|
|
34
|
-
<tr>
|
|
35
|
-
<td>theme: 'light' |'dark'</td>
|
|
36
|
-
<td><code>'light'</code></td>
|
|
37
|
-
<td>Uses one of the available component themes.</td>
|
|
38
|
-
</tr>
|
|
39
|
-
<tr>
|
|
40
|
-
<td>label: string</td>
|
|
41
|
-
<td><code>'basic'</code></td>
|
|
42
|
-
<td>Text to be placed on the toggle.</td>
|
|
43
|
-
</tr>
|
|
44
|
-
<tr>
|
|
45
|
-
<td>iconSrc: string</td>
|
|
46
|
-
<td></td>
|
|
47
|
-
<td>URL of the icon that will be placed on the toggle.</td>
|
|
48
|
-
</tr>
|
|
49
|
-
<tr>
|
|
50
|
-
<td>disabled: boolean</td>
|
|
51
|
-
<td><code>false</code></td>
|
|
52
|
-
<td>If true, the component will be disabled.</td>
|
|
53
|
-
</tr>
|
|
54
|
-
<tr>
|
|
55
|
-
<td>disableRipple: boolean</td>
|
|
56
|
-
<td><code>false</code></td>
|
|
57
|
-
<td>If true, the ripple effect will be disabled.</td>
|
|
58
|
-
</tr>
|
|
59
|
-
<tr>
|
|
60
|
-
<td>onClick: function</td>
|
|
61
|
-
<td></td>
|
|
62
|
-
<td>This function will be called when the user clicks the button. The new state will be passed as a parameter.</td>
|
|
63
|
-
</tr>
|
|
64
|
-
|
|
65
|
-
</table>
|
|
66
|
-
|
|
67
|
-
## Examples
|
|
68
|
-
|
|
69
|
-
```js
|
|
70
|
-
import { DxcToggle } from "@dxc-technology/halstack-react";
|
|
71
|
-
<DxcToggle
|
|
72
|
-
label="Disabled Ripple"
|
|
73
|
-
disableRipple={true}
|
|
74
|
-
theme="dark"
|
|
75
|
-
iconSrc={amazon}
|
|
76
|
-
mode="outlined"
|
|
77
|
-
selected={selected}
|
|
78
|
-
onClick={click}
|
|
79
|
-
></DxcToggle>;
|
|
80
|
-
```
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
6
|
-
|
|
7
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
-
|
|
9
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
|
|
11
|
-
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
|
|
13
|
-
var _react2 = require("@storybook/react");
|
|
14
|
-
|
|
15
|
-
var _readme = _interopRequireDefault(require("./readme.md"));
|
|
16
|
-
|
|
17
|
-
var _Upload = _interopRequireDefault(require("./Upload"));
|
|
18
|
-
|
|
19
|
-
function callbackFunc() {
|
|
20
|
-
return _callbackFunc.apply(this, arguments);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function _callbackFunc() {
|
|
24
|
-
_callbackFunc = (0, _asyncToGenerator2["default"])(
|
|
25
|
-
/*#__PURE__*/
|
|
26
|
-
_regenerator["default"].mark(function _callee() {
|
|
27
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
28
|
-
while (1) {
|
|
29
|
-
switch (_context.prev = _context.next) {
|
|
30
|
-
case 0:
|
|
31
|
-
return _context.abrupt("return", new Promise(function (resolve) {
|
|
32
|
-
return setTimeout(resolve, 1000);
|
|
33
|
-
}));
|
|
34
|
-
|
|
35
|
-
case 1:
|
|
36
|
-
case "end":
|
|
37
|
-
return _context.stop();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}, _callee);
|
|
41
|
-
}));
|
|
42
|
-
return _callbackFunc.apply(this, arguments);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
(0, _react2.storiesOf)("Form Components|Upload", module).add("Component", function () {
|
|
46
|
-
return _react["default"].createElement("div", {
|
|
47
|
-
style: {
|
|
48
|
-
marginTop: "80px"
|
|
49
|
-
}
|
|
50
|
-
}, _react["default"].createElement(_Upload["default"], {
|
|
51
|
-
callbackUpload: callbackFunc
|
|
52
|
-
}));
|
|
53
|
-
}, {
|
|
54
|
-
notes: {
|
|
55
|
-
markdown: _readme["default"]
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
var knobProps = function knobProps() {
|
|
60
|
-
return {};
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
(0, _react2.storiesOf)("Form Components|Upload", module).add("Knobs example", function () {
|
|
64
|
-
var props = knobProps();
|
|
65
|
-
return _react["default"].createElement(_Upload["default"], (0, _extends2["default"])({}, props, {
|
|
66
|
-
callbackUpload: callbackFunc
|
|
67
|
-
}));
|
|
68
|
-
}, {
|
|
69
|
-
notes: {
|
|
70
|
-
markdown: _readme["default"]
|
|
71
|
-
}
|
|
72
|
-
});
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#666666">
|
|
2
|
-
<path fill="none" d="M0 0h24v24H0V0z"/>
|
|
3
|
-
<path d="M3 13h2v-2H3v2zm0 4h2v-2H3v2zm2 4v-2H3c0 1.1.89 2 2 2zM3 9h2V7H3v2zm12 12h2v-2h-2v2zm4-18H9c-1.11 0-2 .9-2 2v10c0 1.1.89 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 12H9V5h10v10zm-8 6h2v-2h-2v2zm-4 0h2v-2H7v2z"/>
|
|
4
|
-
</svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"/></svg>
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="74.5" height="74.5" viewBox="0 0 24 24" fill="#666666">
|
|
2
|
-
<path fill="none" d="M0 0h24v24H0z"/>
|
|
3
|
-
<path d="M11 5v5.59H7.5l4.5 4.5 4.5-4.5H13V5h-2zm-5 9c0 3.31 2.69 6 6 6s6-2.69 6-6h-2c0 2.21-1.79 4-4 4s-4-1.79-4-4H6z"/>
|
|
4
|
-
</svg>
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
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>
|
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,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>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "@testing-library/react";
|
|
3
|
-
import DxcTabsForSections from "../src/tabs-for-sections/TabsForSections";
|
|
4
|
-
|
|
5
|
-
const sections = [
|
|
6
|
-
{
|
|
7
|
-
tabLabel: "S1",
|
|
8
|
-
section: () => <div>test-section-1</div>,
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
tabLabel: "S2",
|
|
12
|
-
section: () => <div>test-section-2</div>,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
tabLabel: "S3",
|
|
16
|
-
section: () => <div>test-section-3</div>,
|
|
17
|
-
},
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
describe("TabsForSections component tests", () => {
|
|
21
|
-
test("TabsForSections renders with correct sections label", () => {
|
|
22
|
-
const { getByText } = render(<DxcTabsForSections sections={sections}></DxcTabsForSections>);
|
|
23
|
-
expect(getByText("S1")).toBeTruthy();
|
|
24
|
-
expect(getByText("S2")).toBeTruthy();
|
|
25
|
-
expect(getByText("S3")).toBeTruthy();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
test("TabsForSections renders with correct sections content", () => {
|
|
29
|
-
const { getByText } = render(<DxcTabsForSections sections={sections}></DxcTabsForSections>);
|
|
30
|
-
expect(getByText("test-section-1")).toBeTruthy();
|
|
31
|
-
expect(getByText("test-section-2")).toBeTruthy();
|
|
32
|
-
expect(getByText("test-section-3")).toBeTruthy();
|
|
33
|
-
});
|
|
34
|
-
});
|
package/test/Toggle.test.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render, fireEvent } from "@testing-library/react";
|
|
3
|
-
import DxcToggle from "../src/toggle/Toggle";
|
|
4
|
-
|
|
5
|
-
describe("Toggle component tests", () => {
|
|
6
|
-
test("Toggle renders with correct text", () => {
|
|
7
|
-
const { getByText } = render(<DxcToggle label="Toggle" />);
|
|
8
|
-
expect(getByText("Toggle")).toBeTruthy();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
test("Calls correct function on click", () => {
|
|
12
|
-
const onClick = jest.fn();
|
|
13
|
-
const { getByText} = render(<DxcToggle label="ToggleTest" onClick={onClick} />);
|
|
14
|
-
fireEvent.click(getByText("ToggleTest"));
|
|
15
|
-
expect(onClick).toHaveBeenCalled();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
test("Calls correct function on click with the correct value.", () => {
|
|
19
|
-
const onClick = jest.fn();
|
|
20
|
-
const { getByText, rerender } = render(<DxcToggle label="ToggleTest" onClick={onClick} />);
|
|
21
|
-
|
|
22
|
-
fireEvent.click(getByText("ToggleTest"));
|
|
23
|
-
rerender(<DxcToggle label="ToggleTest" onClick={onClick} selected={true} />);
|
|
24
|
-
fireEvent.click(getByText("ToggleTest"));
|
|
25
|
-
expect(onClick.mock.calls[0][0]).toBe(true);
|
|
26
|
-
expect(onClick.mock.calls[1][0]).toBe(false);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
test("Calls correct function on click with the correct value, if it´s controlled and the user doesn´t change the value the function always receives the same", () => {
|
|
31
|
-
const onClick = jest.fn();
|
|
32
|
-
const { getByText } = render(<DxcToggle label="ToggleTest" selected={true} onClick={onClick} />);
|
|
33
|
-
|
|
34
|
-
fireEvent.click(getByText("ToggleTest"));
|
|
35
|
-
fireEvent.click(getByText("ToggleTest"));
|
|
36
|
-
fireEvent.click(getByText("ToggleTest"));
|
|
37
|
-
expect(onClick).toHaveBeenCalledTimes(3);
|
|
38
|
-
expect(onClick.mock.calls[0][0]).toBe(false);
|
|
39
|
-
expect(onClick.mock.calls[1][0]).toBe(false);
|
|
40
|
-
expect(onClick.mock.calls[2][0]).toBe(false);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
});
|