@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,9 +1,9 @@
|
|
|
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
|
});
|
|
@@ -29,95 +29,11 @@ var _variables = require("../common/variables.js");
|
|
|
29
29
|
|
|
30
30
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: ", ";\n height: 24px;\n width: 24px;\n overflow: hidden;\n display: flex;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
34
|
-
|
|
35
|
-
_templateObject9 = function _templateObject9() {
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _templateObject8() {
|
|
43
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: 24px;\n width: 24px;\n margin-right: ", ";\n"]);
|
|
44
|
-
|
|
45
|
-
_templateObject8 = function _templateObject8() {
|
|
46
|
-
return data;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return data;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function _templateObject7() {
|
|
53
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n"]);
|
|
54
|
-
|
|
55
|
-
_templateObject7 = function _templateObject7() {
|
|
56
|
-
return data;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
return data;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function _templateObject6() {
|
|
63
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"]);
|
|
64
|
-
|
|
65
|
-
_templateObject6 = function _templateObject6() {
|
|
66
|
-
return data;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
return data;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function _templateObject5() {
|
|
73
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-right: ", ";\n\n ", "\n"]);
|
|
32
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
74
33
|
|
|
75
|
-
|
|
76
|
-
return data;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
return data;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function _templateObject4() {
|
|
83
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n opacity: 1;\n height: calc(48px - 4px - 4px);\n border-width: ", ";\n border-style: ", ";\n border-radius: ", ";\n border-color: ", ";\n background-color: ", ";\n padding: 4px;\n margin-top: ", ";\n"]);
|
|
84
|
-
|
|
85
|
-
_templateObject4 = function _templateObject4() {
|
|
86
|
-
return data;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
return data;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function _templateObject3() {
|
|
93
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
94
|
-
|
|
95
|
-
_templateObject3 = function _templateObject3() {
|
|
96
|
-
return data;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
return data;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function _templateObject2() {
|
|
103
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
104
|
-
|
|
105
|
-
_templateObject2 = function _templateObject2() {
|
|
106
|
-
return data;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
return data;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function _templateObject() {
|
|
113
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
114
|
-
|
|
115
|
-
_templateObject = function _templateObject() {
|
|
116
|
-
return data;
|
|
117
|
-
};
|
|
34
|
+
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); }
|
|
118
35
|
|
|
119
|
-
|
|
120
|
-
}
|
|
36
|
+
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; }
|
|
121
37
|
|
|
122
38
|
var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
123
39
|
var label = _ref.label,
|
|
@@ -182,21 +98,21 @@ var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
|
182
98
|
if (!disabled && (event.nativeEvent.code === "Enter" || event.nativeEvent.code === "Space")) handleToggleChange(optionValue);
|
|
183
99
|
};
|
|
184
100
|
|
|
185
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
101
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
186
102
|
theme: colorsTheme.toggleGroup
|
|
187
|
-
}, _react["default"].createElement(ToggleGroup, {
|
|
103
|
+
}, /*#__PURE__*/_react["default"].createElement(ToggleGroup, {
|
|
188
104
|
margin: margin,
|
|
189
105
|
disabled: disabled
|
|
190
|
-
}, _react["default"].createElement(Label, {
|
|
106
|
+
}, /*#__PURE__*/_react["default"].createElement(Label, {
|
|
191
107
|
htmlFor: toggleGroupId,
|
|
192
108
|
disabled: disabled
|
|
193
|
-
}, label), _react["default"].createElement(HelperText, {
|
|
109
|
+
}, label), /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
194
110
|
disabled: disabled
|
|
195
|
-
}, helperText), _react["default"].createElement(OptionsContainer, {
|
|
111
|
+
}, helperText), /*#__PURE__*/_react["default"].createElement(OptionsContainer, {
|
|
196
112
|
id: toggleGroupId,
|
|
197
113
|
role: multiple ? "group" : "radiogroup"
|
|
198
114
|
}, options.map(function (option, i) {
|
|
199
|
-
return _react["default"].createElement(ToggleContainer, {
|
|
115
|
+
return /*#__PURE__*/_react["default"].createElement(ToggleContainer, {
|
|
200
116
|
selected: multiple ? value ? value.includes(option.value) : selectedValue.includes(option.value) : value ? option.value === value : option.value === selectedValue,
|
|
201
117
|
role: multiple ? "switch" : "radio",
|
|
202
118
|
"aria-checked": multiple ? value ? value.includes(option.value) : selectedValue.includes(option.value) : value ? option.value === value : option.value === selectedValue,
|
|
@@ -213,16 +129,16 @@ var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
|
213
129
|
handleKeyPress(event, option.value);
|
|
214
130
|
},
|
|
215
131
|
key: "toggle-".concat(i, "-").concat(option.label)
|
|
216
|
-
}, _react["default"].createElement(OptionContent, null, option.icon && _react["default"].createElement(IconContainer, {
|
|
132
|
+
}, /*#__PURE__*/_react["default"].createElement(OptionContent, null, option.icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
217
133
|
optionLabel: option.label
|
|
218
|
-
}, (0, _typeof2["default"])(option.icon) === "object" ? option.icon : _react["default"].createElement(option.icon)), option.iconSrc && _react["default"].createElement(Icon, {
|
|
134
|
+
}, (0, _typeof2["default"])(option.icon) === "object" ? option.icon : /*#__PURE__*/_react["default"].createElement(option.icon)), option.iconSrc && /*#__PURE__*/_react["default"].createElement(Icon, {
|
|
219
135
|
src: option.iconSrc,
|
|
220
136
|
optionLabel: option.label
|
|
221
|
-
}), option.label && _react["default"].createElement(LabelContainer, null, option.label)));
|
|
137
|
+
}), option.label && /*#__PURE__*/_react["default"].createElement(LabelContainer, null, option.label)));
|
|
222
138
|
}))));
|
|
223
139
|
};
|
|
224
140
|
|
|
225
|
-
var Label = _styledComponents["default"].label(_templateObject(), function (props) {
|
|
141
|
+
var Label = _styledComponents["default"].label(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
226
142
|
return props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor;
|
|
227
143
|
}, function (props) {
|
|
228
144
|
return props.theme.labelFontFamily;
|
|
@@ -236,7 +152,7 @@ var Label = _styledComponents["default"].label(_templateObject(), function (prop
|
|
|
236
152
|
return props.theme.labelLineHeight;
|
|
237
153
|
});
|
|
238
154
|
|
|
239
|
-
var HelperText = _styledComponents["default"].span(_templateObject2(), function (props) {
|
|
155
|
+
var HelperText = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
240
156
|
return props.disabled ? props.theme.disabledHelperTextFontcolor : props.theme.helperTextFontColor;
|
|
241
157
|
}, function (props) {
|
|
242
158
|
return props.theme.helperTextFontFamily;
|
|
@@ -250,7 +166,7 @@ var HelperText = _styledComponents["default"].span(_templateObject2(), function
|
|
|
250
166
|
return props.theme.helperTextLineHeight;
|
|
251
167
|
});
|
|
252
168
|
|
|
253
|
-
var ToggleGroup = _styledComponents["default"].div(_templateObject3(), function (props) {
|
|
169
|
+
var ToggleGroup = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
254
170
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
255
171
|
}, function (props) {
|
|
256
172
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -262,7 +178,7 @@ var ToggleGroup = _styledComponents["default"].div(_templateObject3(), function
|
|
|
262
178
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
263
179
|
});
|
|
264
180
|
|
|
265
|
-
var OptionsContainer = _styledComponents["default"].div(_templateObject4(), function (props) {
|
|
181
|
+
var OptionsContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n opacity: 1;\n height: calc(48px - 4px - 4px);\n border-width: ", ";\n border-style: ", ";\n border-radius: ", ";\n border-color: ", ";\n background-color: ", ";\n padding: 4px;\n margin-top: ", ";\n"])), function (props) {
|
|
266
182
|
return props.theme.containerBorderThickness;
|
|
267
183
|
}, function (props) {
|
|
268
184
|
return props.theme.containerBorderStyle;
|
|
@@ -276,13 +192,13 @@ var OptionsContainer = _styledComponents["default"].div(_templateObject4(), func
|
|
|
276
192
|
return props.theme.containerMarginTop;
|
|
277
193
|
});
|
|
278
194
|
|
|
279
|
-
var ToggleContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
195
|
+
var ToggleContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-right: ", ";\n\n ", "\n"])), function (props) {
|
|
280
196
|
return !props.isLast && "4px";
|
|
281
197
|
}, function (props) {
|
|
282
198
|
return "\n background-color: ".concat(props.selected ? props.disabled ? props.theme.selectedDisabledBackgroundColor : props.theme.selectedBackgroundColor : props.disabled ? props.theme.unselectedDisabledBackgroundColor : props.theme.unselectedBackgroundColor, ";\n border-width: ").concat(props.theme.optionBorderThickness, ";\n border-style: ").concat(props.theme.optionBorderStyle, ";\n border-radius: ").concat(props.theme.optionBorderRadius, ";\n padding-left: ").concat(props.optionLabel && props.isIcon || props.optionLabel && !props.isIcon ? props.theme.labelPaddingLeft : props.theme.iconPaddingLeft, ";\n padding-right: ").concat(props.optionLabel && props.isIcon || props.optionLabel && !props.isIcon ? props.theme.labelPaddingRight : props.theme.iconPaddingRight, ";\n ").concat(!props.disabled ? ":hover {\n background-color: ".concat(props.selected ? props.theme.selectedHoverBackgroundColor : props.theme.unselectedHoverBackgroundColor, ";\n }\n :active {\n background-color: ").concat(props.selected ? props.theme.selectedActiveBackgroundColor : props.theme.unselectedActiveBackgroundColor, ";\n color: #ffffff;\n } \n :focus {\n border-color: transparent;\n box-shadow: 0 0 0 ").concat(props.theme.optionFocusBorderThickness, " ").concat(props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor, ";\n }\n &:focus-visible {\n outline: none;\n }\n cursor: pointer;\n color: ").concat(props.selected ? props.theme.selectedFontColor : props.theme.unselectedFontColor, ";\n") : "color: ".concat(props.selected ? props.theme.selectedDisabledFontColor : props.theme.unselectedDisabledFontColor, ";\n cursor: not-allowed;"), "\n ");
|
|
283
199
|
});
|
|
284
200
|
|
|
285
|
-
var LabelContainer = _styledComponents["default"].span(_templateObject6(), function (props) {
|
|
201
|
+
var LabelContainer = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"])), function (props) {
|
|
286
202
|
return props.theme.optionLabelFontFamily;
|
|
287
203
|
}, function (props) {
|
|
288
204
|
return props.theme.optionLabelFontSize;
|
|
@@ -292,13 +208,13 @@ var LabelContainer = _styledComponents["default"].span(_templateObject6(), funct
|
|
|
292
208
|
return props.theme.optionLabelFontWeight;
|
|
293
209
|
});
|
|
294
210
|
|
|
295
|
-
var OptionContent = _styledComponents["default"].div(_templateObject7());
|
|
211
|
+
var OptionContent = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n"])));
|
|
296
212
|
|
|
297
|
-
var Icon = _styledComponents["default"].img(_templateObject8(), function (props) {
|
|
213
|
+
var Icon = _styledComponents["default"].img(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n height: 24px;\n width: 24px;\n margin-right: ", ";\n"])), function (props) {
|
|
298
214
|
return props.optionLabel && props.theme.iconMarginRight;
|
|
299
215
|
});
|
|
300
216
|
|
|
301
|
-
var IconContainer = _styledComponents["default"].div(_templateObject9(), function (props) {
|
|
217
|
+
var IconContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: ", ";\n height: 24px;\n width: 24px;\n overflow: hidden;\n display: flex;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
|
|
302
218
|
return props.optionLabel && props.theme.iconMarginRight;
|
|
303
219
|
});
|
|
304
220
|
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { userEvent, within } from "@storybook/testing-library";
|
|
3
|
+
import DxcToggleGroup from "./ToggleGroup";
|
|
4
|
+
import Title from "../../.storybook/components/Title";
|
|
5
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "ToggleGroup",
|
|
9
|
+
component: DxcToggleGroup,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const ethernetSVG = () => {
|
|
13
|
+
return (
|
|
14
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
|
15
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
16
|
+
<path d="M7.77 6.76L6.23 5.48.82 12l5.41 6.52 1.54-1.28L3.42 12l4.35-5.24zM7 13h2v-2H7v2zm10-2h-2v2h2v-2zm-6 2h2v-2h-2v2zm6.77-7.52l-1.54 1.28L20.58 12l-4.35 5.24 1.54 1.28L23.18 12l-5.41-6.52z" />
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
const gMobileSVG = () => {
|
|
21
|
+
return (
|
|
22
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
|
23
|
+
<g>
|
|
24
|
+
<path d="M0,0h24v24H0V0z" fill="none" />
|
|
25
|
+
</g>
|
|
26
|
+
<g>
|
|
27
|
+
<g>
|
|
28
|
+
<path d="M3,7v2h5v2H4v2h4v2H3v2h5c1.1,0,2-0.9,2-2v-1.5c0-0.83-0.67-1.5-1.5-1.5c0.83,0,1.5-0.67,1.5-1.5V9c0-1.1-0.9-2-2-2H3z M21,11v4c0,1.1-0.9,2-2,2h-5c-1.1,0-2-0.9-2-2V9c0-1.1,0.9-2,2-2h5c1.1,0,2,0.9,2,2h-7v6h5v-2h-2.5v-2H21z" />
|
|
29
|
+
</g>
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
const wifiSVG = () => {
|
|
35
|
+
return (
|
|
36
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
|
37
|
+
<path d="M0 0h24v24H0V0zm0 0h24v24H0V0z" fill="none" />
|
|
38
|
+
<path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3c-1.65-1.66-4.34-1.66-6 0zm-4-4l2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13z" />
|
|
39
|
+
</svg>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
const options = [
|
|
43
|
+
{
|
|
44
|
+
value: 1,
|
|
45
|
+
label: "Facebook",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
value: 2,
|
|
49
|
+
label: "Twitter",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
value: 3,
|
|
53
|
+
label: "Linkedin",
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
const optionsWithIcon = [
|
|
57
|
+
{
|
|
58
|
+
value: 1,
|
|
59
|
+
icon: wifiSVG,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: 2,
|
|
63
|
+
icon: ethernetSVG,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
value: 3,
|
|
67
|
+
icon: gMobileSVG,
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
const optionsWithIconAndLabel = [
|
|
71
|
+
{
|
|
72
|
+
value: 1,
|
|
73
|
+
label: "Wi-fi",
|
|
74
|
+
icon: wifiSVG,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
value: 2,
|
|
78
|
+
label: "Ethernet",
|
|
79
|
+
icon: ethernetSVG,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
value: 3,
|
|
83
|
+
label: "3G Mobile",
|
|
84
|
+
icon: gMobileSVG,
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
const twoOptions = [
|
|
88
|
+
{
|
|
89
|
+
value: 1,
|
|
90
|
+
label: "Facebook",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
value: 2,
|
|
94
|
+
label: "Twitter",
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
export const Chromatic = () => (
|
|
98
|
+
<>
|
|
99
|
+
<ExampleContainer>
|
|
100
|
+
<Title title="Basic toggle group" theme="light" level={4} />
|
|
101
|
+
<DxcToggleGroup label="Toggle group" helperText="HelperText" options={options} />
|
|
102
|
+
</ExampleContainer>
|
|
103
|
+
<ExampleContainer>
|
|
104
|
+
<Title title="Selected" theme="light" level={4} />
|
|
105
|
+
<DxcToggleGroup label="Selected" helperText="HelperText" value={2} options={options} />
|
|
106
|
+
</ExampleContainer>
|
|
107
|
+
<ExampleContainer>
|
|
108
|
+
<Title title="Icons toggle group" theme="light" level={4} />
|
|
109
|
+
<DxcToggleGroup label="Icons group" options={optionsWithIcon} />
|
|
110
|
+
</ExampleContainer>
|
|
111
|
+
<ExampleContainer>
|
|
112
|
+
<Title title="Icons & label toggle group" theme="light" level={4} />
|
|
113
|
+
<DxcToggleGroup label="Icons & label" options={optionsWithIconAndLabel} />
|
|
114
|
+
</ExampleContainer>
|
|
115
|
+
<ExampleContainer>
|
|
116
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
117
|
+
<DxcToggleGroup label="Disabled" value={2} options={options} disabled />
|
|
118
|
+
</ExampleContainer>
|
|
119
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
120
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
121
|
+
<DxcToggleGroup label="Hovered" options={twoOptions} value={2} />
|
|
122
|
+
</ExampleContainer>
|
|
123
|
+
<ExampleContainer>
|
|
124
|
+
<Title title="Multiple toggleGroup" theme="light" level={4} />
|
|
125
|
+
<DxcToggleGroup
|
|
126
|
+
label="Toggle group"
|
|
127
|
+
helperText="Please select one or more"
|
|
128
|
+
options={options}
|
|
129
|
+
value={[1, 3]}
|
|
130
|
+
multiple
|
|
131
|
+
></DxcToggleGroup>
|
|
132
|
+
</ExampleContainer>
|
|
133
|
+
<Title title="Margins" theme="light" level={2} />
|
|
134
|
+
<ExampleContainer>
|
|
135
|
+
<Title title="xxSmall" theme="light" level={4} />
|
|
136
|
+
<DxcToggleGroup label="xxSmall margin" options={options} margin="xxsmall" />
|
|
137
|
+
</ExampleContainer>
|
|
138
|
+
<ExampleContainer>
|
|
139
|
+
<Title title="xSmall" theme="light" level={4} />
|
|
140
|
+
<DxcToggleGroup label="xSmall margin" options={options} margin="xsmall" />
|
|
141
|
+
</ExampleContainer>
|
|
142
|
+
<ExampleContainer>
|
|
143
|
+
<Title title="Small" theme="light" level={4} />
|
|
144
|
+
<DxcToggleGroup label="Small margin" options={options} margin="small" />
|
|
145
|
+
</ExampleContainer>
|
|
146
|
+
<ExampleContainer>
|
|
147
|
+
<Title title="Medium" theme="light" level={4} />
|
|
148
|
+
<DxcToggleGroup label="Medium margin" options={options} margin="medium" />
|
|
149
|
+
</ExampleContainer>
|
|
150
|
+
<ExampleContainer>
|
|
151
|
+
<Title title="Large" theme="light" level={4} />
|
|
152
|
+
<DxcToggleGroup label="Large margin" options={options} margin="large" />
|
|
153
|
+
</ExampleContainer>
|
|
154
|
+
<ExampleContainer>
|
|
155
|
+
<Title title="xLarge" theme="light" level={4} />
|
|
156
|
+
<DxcToggleGroup label="xLarge margin" options={options} margin="xlarge" />
|
|
157
|
+
</ExampleContainer>
|
|
158
|
+
<ExampleContainer>
|
|
159
|
+
<Title title="xxLarge" theme="light" level={4} />
|
|
160
|
+
<DxcToggleGroup label="xxLarge margin" options={options} margin="xxlarge" />
|
|
161
|
+
</ExampleContainer>
|
|
162
|
+
</>
|
|
163
|
+
);
|
|
164
|
+
const OptionSelected = () => <DxcToggleGroup label="Toggle group" helperText="HelperText" options={options} />;
|
|
165
|
+
|
|
166
|
+
export const ToggleGroupSelectedActived = OptionSelected.bind({});
|
|
167
|
+
ToggleGroupSelectedActived.play = async ({ canvasElement }) => {
|
|
168
|
+
const canvas = within(canvasElement);
|
|
169
|
+
const option = canvas.getByText("Linkedin");
|
|
170
|
+
await userEvent.click(option);
|
|
171
|
+
};
|
|
172
|
+
export const ToggleGroupUnselectedActived = OptionSelected.bind({});
|
|
173
|
+
ToggleGroupUnselectedActived.play = async ({ canvasElement }) => {
|
|
174
|
+
const canvas = within(canvasElement);
|
|
175
|
+
const option = canvas.getByText("Twitter");
|
|
176
|
+
await userEvent.click(option);
|
|
177
|
+
userEvent.tab();
|
|
178
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
+
type Margin = {
|
|
3
|
+
top?: Space;
|
|
4
|
+
bottom?: Space;
|
|
5
|
+
left?: Space;
|
|
6
|
+
right?: Space;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
label?: string;
|
|
11
|
+
helperText?: string;
|
|
12
|
+
value?: any;
|
|
13
|
+
onChange?: void;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
options?: any;
|
|
16
|
+
multiple?: boolean;
|
|
17
|
+
margin?: Space | Margin;
|
|
18
|
+
tabIndex?: number;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default function DxcToggleGroup(props: Props): JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
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
|
});
|
|
@@ -31,17 +31,13 @@ var _Transactions = _interopRequireDefault(require("./transactions/Transactions"
|
|
|
31
31
|
|
|
32
32
|
var _variables = require("../common/variables.js");
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-width: 100%;\n height: 400px;\n box-shadow: 0px 3px 6px #00000029;\n border-radius: 4px;\n display: flex;\n flex-direction: row;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
34
|
+
var _templateObject;
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
36
|
+
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); }
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
}
|
|
38
|
+
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; }
|
|
43
39
|
|
|
44
|
-
var
|
|
40
|
+
var DxcUpload = function DxcUpload(_ref) {
|
|
45
41
|
var callbackUpload = _ref.callbackUpload,
|
|
46
42
|
margin = _ref.margin,
|
|
47
43
|
_ref$tabIndex = _ref.tabIndex,
|
|
@@ -157,20 +153,20 @@ var V3DxcUpload = function V3DxcUpload(_ref) {
|
|
|
157
153
|
|
|
158
154
|
var filesToUpload = getFilesToUpload();
|
|
159
155
|
var transactionFiles = getTransactionsFiles();
|
|
160
|
-
return _react["default"].createElement(DXCUpload, {
|
|
156
|
+
return /*#__PURE__*/_react["default"].createElement(DXCUpload, {
|
|
161
157
|
margin: margin
|
|
162
|
-
}, transactionFiles && transactionFiles.length !== 0 && _react["default"].createElement(_Transactions["default"], {
|
|
158
|
+
}, transactionFiles && transactionFiles.length !== 0 && /*#__PURE__*/_react["default"].createElement(_Transactions["default"], {
|
|
163
159
|
tabIndexValue: tabIndex,
|
|
164
160
|
transactions: transactionFiles
|
|
165
|
-
}), filesToUpload && filesToUpload.length === 0 && transactionFiles && transactionFiles.length === 0 && _react["default"].createElement(_DragAndDropArea["default"], {
|
|
161
|
+
}), filesToUpload && filesToUpload.length === 0 && transactionFiles && transactionFiles.length === 0 && /*#__PURE__*/_react["default"].createElement(_DragAndDropArea["default"], {
|
|
166
162
|
dashed: false,
|
|
167
163
|
addFile: onDragHandler,
|
|
168
164
|
tabIndexValue: tabIndex
|
|
169
|
-
}) || filesToUpload && filesToUpload.length === 0 && transactionFiles && transactionFiles.length !== 0 && _react["default"].createElement(_DragAndDropArea["default"], {
|
|
165
|
+
}) || filesToUpload && filesToUpload.length === 0 && transactionFiles && transactionFiles.length !== 0 && /*#__PURE__*/_react["default"].createElement(_DragAndDropArea["default"], {
|
|
170
166
|
dashed: true,
|
|
171
167
|
addFile: onDragHandler,
|
|
172
168
|
tabIndexValue: tabIndex
|
|
173
|
-
}), filesToUpload && filesToUpload.length !== 0 && _react["default"].createElement(_FilesToUpload["default"], {
|
|
169
|
+
}), filesToUpload && filesToUpload.length !== 0 && /*#__PURE__*/_react["default"].createElement(_FilesToUpload["default"], {
|
|
174
170
|
filesToUpload: filesToUpload,
|
|
175
171
|
addFile: onDragHandler,
|
|
176
172
|
onUpload: onUploadHandler,
|
|
@@ -178,7 +174,7 @@ var V3DxcUpload = function V3DxcUpload(_ref) {
|
|
|
178
174
|
}));
|
|
179
175
|
};
|
|
180
176
|
|
|
181
|
-
|
|
177
|
+
DxcUpload.propTypes = {
|
|
182
178
|
callbackUpload: _propTypes["default"].func,
|
|
183
179
|
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
184
180
|
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
@@ -189,7 +185,7 @@ V3DxcUpload.propTypes = {
|
|
|
189
185
|
tabIndex: _propTypes["default"].number
|
|
190
186
|
};
|
|
191
187
|
|
|
192
|
-
var DXCUpload = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
188
|
+
var DXCUpload = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n max-width: 100%;\n height: 400px;\n box-shadow: 0px 3px 6px #00000029;\n border-radius: 4px;\n display: flex;\n flex-direction: row;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
193
189
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
194
190
|
}, function (props) {
|
|
195
191
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -201,5 +197,5 @@ var DXCUpload = _styledComponents["default"].div(_templateObject(), function (pr
|
|
|
201
197
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
202
198
|
});
|
|
203
199
|
|
|
204
|
-
var _default =
|
|
200
|
+
var _default = DxcUpload;
|
|
205
201
|
exports["default"] = _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
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 _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -25,35 +25,11 @@ var _useTheme = _interopRequireDefault(require("../../useTheme.js"));
|
|
|
25
25
|
|
|
26
26
|
var _BackgroundColorContext = require("../../BackgroundColorContext.js");
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n margin-right: 5px;\n & svg {\n fill: ", ";\n }\n"]);
|
|
30
|
-
|
|
31
|
-
_templateObject3 = function _templateObject3() {
|
|
32
|
-
return data;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
return data;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function _templateObject2() {
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n align-items: center;\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n margin-right: 50px;\n"]);
|
|
28
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
40
29
|
|
|
41
|
-
|
|
42
|
-
return data;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return data;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _templateObject() {
|
|
49
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 80px;\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n"]);
|
|
50
|
-
|
|
51
|
-
_templateObject = function _templateObject() {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
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); }
|
|
54
31
|
|
|
55
|
-
|
|
56
|
-
}
|
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(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; }
|
|
57
33
|
|
|
58
34
|
var DxcButtonsUpload = function DxcButtonsUpload(_ref) {
|
|
59
35
|
var addFile = _ref.addFile,
|
|
@@ -75,18 +51,18 @@ var DxcButtonsUpload = function DxcButtonsUpload(_ref) {
|
|
|
75
51
|
document.getElementById("chooseFiles").click();
|
|
76
52
|
};
|
|
77
53
|
|
|
78
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
54
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
79
55
|
theme: colorsTheme.upload
|
|
80
|
-
}, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
56
|
+
}, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
81
57
|
color: colorsTheme.upload.backgroundColor
|
|
82
|
-
}, _react["default"].createElement(DXCButtonsUpload, null, _react["default"].createElement(DragAndDropLabel, null, _react["default"].createElement(DragAndDropIconContainer, null, _Icons.dragAndDropIcon), "Drag and Drop area"), _react["default"].createElement(_Button["default"], {
|
|
58
|
+
}, /*#__PURE__*/_react["default"].createElement(DXCButtonsUpload, null, /*#__PURE__*/_react["default"].createElement(DragAndDropLabel, null, /*#__PURE__*/_react["default"].createElement(DragAndDropIconContainer, null, _Icons.dragAndDropIcon), "Drag and Drop area"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
83
59
|
margin: {
|
|
84
60
|
right: "small"
|
|
85
61
|
},
|
|
86
62
|
mode: "text",
|
|
87
63
|
label: "CHOOSE FILES",
|
|
88
64
|
onClick: handleClick
|
|
89
|
-
}), _react["default"].createElement("input", {
|
|
65
|
+
}), /*#__PURE__*/_react["default"].createElement("input", {
|
|
90
66
|
id: "chooseFiles",
|
|
91
67
|
type: "file",
|
|
92
68
|
multiple: true,
|
|
@@ -94,7 +70,7 @@ var DxcButtonsUpload = function DxcButtonsUpload(_ref) {
|
|
|
94
70
|
style: {
|
|
95
71
|
display: "none"
|
|
96
72
|
}
|
|
97
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
73
|
+
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
98
74
|
label: "UPLOAD",
|
|
99
75
|
iconPosition: "after",
|
|
100
76
|
icon: _Icons.uploadIcon,
|
|
@@ -107,9 +83,9 @@ DxcButtonsUpload.propTypes = {
|
|
|
107
83
|
onUpload: _propTypes["default"].func
|
|
108
84
|
};
|
|
109
85
|
|
|
110
|
-
var DXCButtonsUpload = _styledComponents["default"].div(_templateObject());
|
|
86
|
+
var DXCButtonsUpload = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 80px;\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n"])));
|
|
111
87
|
|
|
112
|
-
var DragAndDropLabel = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
88
|
+
var DragAndDropLabel = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n align-items: center;\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n margin-right: 50px;\n"])), function (props) {
|
|
113
89
|
return props.theme.fontFamily;
|
|
114
90
|
}, function (props) {
|
|
115
91
|
return props.theme.dragAndDropAreaTextFontSize;
|
|
@@ -123,7 +99,7 @@ var DragAndDropLabel = _styledComponents["default"].div(_templateObject2(), func
|
|
|
123
99
|
return props.theme.dragAndDropAreaTextFontColor;
|
|
124
100
|
});
|
|
125
101
|
|
|
126
|
-
var DragAndDropIconContainer = _styledComponents["default"].div(_templateObject3(), function (props) {
|
|
102
|
+
var DragAndDropIconContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n margin-right: 5px;\n & svg {\n fill: ", ";\n }\n"])), function (props) {
|
|
127
103
|
return props.theme.dragAndDropAreaIconSize;
|
|
128
104
|
}, function (props) {
|
|
129
105
|
return props.theme.dragAndDropAreaIconSize;
|
|
@@ -5,35 +5,35 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.uploadIcon = exports.dragAndDropIcon = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var uploadIcon = _react["default"].createElement("svg", {
|
|
12
|
+
var uploadIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
14
|
width: "24",
|
|
15
15
|
height: "24",
|
|
16
16
|
viewBox: "0 0 24 24",
|
|
17
17
|
fill: "#FFFFFF"
|
|
18
|
-
}, _react["default"].createElement("path", {
|
|
18
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
19
19
|
d: "M0 0h24v24H0z",
|
|
20
20
|
fill: "none"
|
|
21
|
-
}), _react["default"].createElement("path", {
|
|
21
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
22
22
|
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"
|
|
23
23
|
}));
|
|
24
24
|
|
|
25
25
|
exports.uploadIcon = uploadIcon;
|
|
26
26
|
|
|
27
|
-
var dragAndDropIcon = _react["default"].createElement("svg", {
|
|
27
|
+
var dragAndDropIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
28
28
|
xmlns: "http://www.w3.org/2000/svg",
|
|
29
29
|
width: "24",
|
|
30
30
|
height: "24",
|
|
31
31
|
viewBox: "0 0 24 24",
|
|
32
32
|
fill: "#666666"
|
|
33
|
-
}, _react["default"].createElement("path", {
|
|
33
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
34
34
|
fill: "none",
|
|
35
35
|
d: "M0 0h24v24H0V0z"
|
|
36
|
-
}), _react["default"].createElement("path", {
|
|
36
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
37
37
|
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"
|
|
38
38
|
}));
|
|
39
39
|
|