@dxc-technology/halstack-react 3.2.0 → 4.0.0
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/{dist/accordion → accordion}/Accordion.js +119 -50
- package/accordion/index.d.ts +28 -0
- package/{dist/accordion-group → accordion-group}/AccordionGroup.js +33 -1
- 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 +27 -18
- 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 +16 -9
- package/card/index.d.ts +22 -0
- package/{dist/checkbox → checkbox}/Checkbox.js +89 -23
- package/checkbox/index.d.ts +24 -0
- package/{dist/chip → chip}/Chip.js +63 -21
- package/chip/index.d.ts +22 -0
- package/{dist/common → common}/OpenSans.css +0 -0
- package/{dist/common → common}/RequiredComponent.js +0 -0
- 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 +60 -38
- 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 +44 -29
- package/dialog/index.d.ts +18 -0
- package/{dist/dropdown → dropdown}/Dropdown.js +162 -74
- 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 +79 -37
- package/footer/Icons.js +77 -0
- package/footer/index.d.ts +25 -0
- package/{dist/header → header}/Header.js +157 -72
- package/header/Icons.js +59 -0
- package/header/index.d.ts +25 -0
- package/heading/Heading.js +230 -0
- package/heading/index.d.ts +17 -0
- package/input-text/Icons.js +22 -0
- package/{dist/input-text → input-text}/InputText.js +162 -66
- package/input-text/index.d.ts +36 -0
- package/{dist/layout → layout}/ApplicationLayout.js +7 -11
- package/layout/Icons.js +55 -0
- package/{dist/link → link}/Link.js +76 -39
- package/link/index.d.ts +23 -0
- package/main.d.ts +40 -0
- package/{dist/main.js → main.js} +71 -15
- package/number-input/NumberInput.js +136 -0
- package/number-input/NumberInputContext.js +16 -0
- package/number-input/index.d.ts +113 -0
- package/package.json +25 -19
- package/paginator/Icons.js +66 -0
- package/{dist/paginator → paginator}/Paginator.js +86 -42
- 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 +88 -38
- package/progress-bar/index.d.ts +18 -0
- package/{dist/radio → radio}/Radio.js +28 -9
- package/radio/index.d.ts +23 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +65 -40
- package/resultsetTable/index.d.ts +19 -0
- package/select/Select.js +1138 -0
- package/select/index.d.ts +131 -0
- package/{dist/sidenav → sidenav}/Sidenav.js +47 -23
- 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 +42 -14
- package/switch/index.d.ts +24 -0
- package/{dist/table → table}/Table.js +45 -11
- package/table/index.d.ts +13 -0
- package/{dist/tabs → tabs}/Tabs.js +37 -19
- package/tabs/index.d.ts +19 -0
- package/{dist/tag → tag}/Tag.js +50 -36
- 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 +0 -0
- 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 +1 -5
- package/{dist/upload → upload}/buttons-upload/ButtonsUpload.js +28 -16
- package/upload/buttons-upload/Icons.js +40 -0
- package/{dist/upload → upload}/dragAndDropArea/DragAndDropArea.js +61 -25
- package/upload/dragAndDropArea/Icons.js +39 -0
- package/{dist/upload → upload}/file-upload/FileToUpload.js +52 -25
- package/upload/file-upload/Icons.js +66 -0
- package/{dist/upload → upload}/files-upload/FilesToUpload.js +3 -3
- package/upload/index.d.ts +15 -0
- package/upload/transaction/Icons.js +160 -0
- package/{dist/upload → upload}/transaction/Transaction.js +37 -41
- package/{dist/upload → upload}/transactions/Transactions.js +24 -8
- package/{dist/useTheme.js → useTheme.js} +0 -0
- package/wizard/Icons.js +65 -0
- package/{dist/wizard → wizard}/Wizard.js +106 -56
- package/wizard/index.d.ts +18 -0
- package/README.md +0 -66
- package/babel.config.js +0 -8
- package/dist/ThemeContext.js +0 -201
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- package/dist/accordion-group/AccordionGroup.stories.js +0 -207
- package/dist/accordion-group/readme.md +0 -70
- package/dist/alert/Alert.js +0 -318
- 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/badge/Badge.js +0 -40
- package/dist/button/Button.js +0 -219
- 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/common/utils.js +0 -42
- package/dist/common/variables.js +0 -523
- 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_blk_rgb.svg +0 -6
- 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/heading/Heading.js +0 -163
- 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/layout/facebook.svg +0 -45
- package/dist/layout/linkedin.svg +0 -50
- package/dist/layout/twitter.svg +0 -53
- 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.js +0 -490
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/slider/Slider.js +0 -267
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.js +0 -198
- 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 -92
- package/dist/tabs-for-sections/readme.md +0 -78
- package/dist/textarea/Textarea.js +0 -238
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- package/dist/toggle-group/ToggleGroup.js +0 -223
- package/dist/toggle-group/readme.md +0 -82
- 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/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 -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 -240
- package/test/Link.test.js +0 -42
- package/test/Paginator.test.js +0 -177
- package/test/ProgressBar.test.js +0 -35
- package/test/Radio.test.js +0 -37
- package/test/ResultsetTable.test.js +0 -330
- package/test/Select.test.js +0 -192
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -82
- 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 -109
- package/test/TabsForSections.test.js +0 -34
- package/test/Tag.test.js +0 -32
- package/test/TextArea.test.js +0 -52
- package/test/ToggleGroup.test.js +0 -81
- 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
|
@@ -0,0 +1,381 @@
|
|
|
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 _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
+
|
|
14
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
+
|
|
16
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
17
|
+
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
20
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
+
|
|
22
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
+
|
|
24
|
+
var _variables = require("../common/variables.js");
|
|
25
|
+
|
|
26
|
+
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
27
|
+
|
|
28
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
29
|
+
|
|
30
|
+
function _templateObject12() {
|
|
31
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-style: ", ";\n color: ", ";\n text-align: ", ";\n letter-spacing: ", ";\n"]);
|
|
32
|
+
|
|
33
|
+
_templateObject12 = function _templateObject12() {
|
|
34
|
+
return data;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function _templateObject11() {
|
|
41
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-style: ", ";\n color: ", ";\n text-align: ", ";\n letter-spacing: ", ";\n"]);
|
|
42
|
+
|
|
43
|
+
_templateObject11 = function _templateObject11() {
|
|
44
|
+
return data;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function _templateObject10() {
|
|
51
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: block;\n margin: 0 auto;\n position: absolute;\n text-align: center;\n width: 110px;\n"]);
|
|
52
|
+
|
|
53
|
+
_templateObject10 = function _templateObject10() {
|
|
54
|
+
return data;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function _templateObject9() {
|
|
61
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n fill: transparent;\n stroke-linecap: initial;\n vector-effect: non-scaling-stroke;\n animation: ", ";\n stroke: ", ";\n transform-origin: ", ";\n stroke-dasharray: ", ";\n stroke-width: ", ";\n stroke-dashoffset: ", ";\n"]);
|
|
62
|
+
|
|
63
|
+
_templateObject9 = function _templateObject9() {
|
|
64
|
+
return data;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return data;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function _templateObject8() {
|
|
71
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n transform: rotate(-90deg);\n top: 0;\n left: 0;\n transform-origin: center;\n overflow: visible;\n animation: ", ";\n"]);
|
|
72
|
+
|
|
73
|
+
_templateObject8 = function _templateObject8() {
|
|
74
|
+
return data;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return data;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function _templateObject7() {
|
|
81
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n position: relative;\n z-index: 2;\n"]);
|
|
82
|
+
|
|
83
|
+
_templateObject7 = function _templateObject7() {
|
|
84
|
+
return data;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return data;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function _templateObject6() {
|
|
91
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n animation: none;\n fill: transparent;\n stroke: ", ";\n stroke-dasharray: ", ";\n stroke-linecap: initial;\n stroke-width: ", ";\n transform-origin: 50% 50%;\n vector-effect: non-scaling-stroke;\n"]);
|
|
92
|
+
|
|
93
|
+
_templateObject6 = function _templateObject6() {
|
|
94
|
+
return data;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return data;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function _templateObject5() {
|
|
101
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n"]);
|
|
102
|
+
|
|
103
|
+
_templateObject5 = function _templateObject5() {
|
|
104
|
+
return data;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
return data;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function _templateObject4() {
|
|
111
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n position: absolute;\n z-index: 1;\n"]);
|
|
112
|
+
|
|
113
|
+
_templateObject4 = function _templateObject4() {
|
|
114
|
+
return data;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
return data;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function _templateObject3() {
|
|
121
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 100vw;\n height: 100vh;\n opacity: 1;\n transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n position: fixed;\n top: 0;\n left: 0;\n background-color: ", ";\n opacity: ", ";\n"]);
|
|
122
|
+
|
|
123
|
+
_templateObject3 = function _templateObject3() {
|
|
124
|
+
return data;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
return data;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function _templateObject2() {
|
|
131
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n align-items: center;\n display: flex;\n height: ", ";\n width: ", ";\n justify-content: center;\n position: relative;\n background-color: transparent;\n\n @keyframes spinner-svg {\n 0% {\n transform: rotateZ(0deg);\n }\n 100% {\n transform: rotateZ(360deg);\n }\n }\n @keyframes svg-circle-large {\n 0% {\n stroke-dashoffset: 400;\n transform: rotate(0);\n }\n\n 50% {\n stroke-dashoffset: 75;\n transform: rotate(45deg);\n }\n\n 100% {\n stroke-dashoffset: 400;\n transform: rotate(360deg);\n }\n }\n @keyframes svg-circle-small {\n 0% {\n stroke-dashoffset: 35;\n transform: rotate(0);\n }\n\n 50% {\n stroke-dashoffset: 8;\n transform: rotate(45deg);\n }\n\n 100% {\n stroke-dashoffset: 35;\n transform: rotate(360deg);\n }\n }\n"]);
|
|
132
|
+
|
|
133
|
+
_templateObject2 = function _templateObject2() {
|
|
134
|
+
return data;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
return data;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function _templateObject() {
|
|
141
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n display: ", ";\n position: ", ";\n top: ", ";\n left: ", ";\n justify-content: ", ";\n align-items: ", ";\n z-index: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
142
|
+
|
|
143
|
+
_templateObject = function _templateObject() {
|
|
144
|
+
return data;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
return data;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
var DxcSpinner = function DxcSpinner(_ref) {
|
|
151
|
+
var _ref$label = _ref.label,
|
|
152
|
+
label = _ref$label === void 0 ? "" : _ref$label,
|
|
153
|
+
value = _ref.value,
|
|
154
|
+
_ref$showValue = _ref.showValue,
|
|
155
|
+
showValue = _ref$showValue === void 0 ? false : _ref$showValue,
|
|
156
|
+
_ref$mode = _ref.mode,
|
|
157
|
+
mode = _ref$mode === void 0 ? "large" : _ref$mode,
|
|
158
|
+
margin = _ref.margin;
|
|
159
|
+
var colorsTheme = (0, _useTheme["default"])();
|
|
160
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
161
|
+
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
162
|
+
theme: colorsTheme.spinner
|
|
163
|
+
}, _react["default"].createElement(DXCSpinner, {
|
|
164
|
+
margin: margin,
|
|
165
|
+
mode: mode
|
|
166
|
+
}, _react["default"].createElement(SpinnerContainer, {
|
|
167
|
+
backgroundType: backgroundType,
|
|
168
|
+
mode: mode
|
|
169
|
+
}, mode === "overlay" && _react["default"].createElement(BackOverlay, null), _react["default"].createElement(BackgroundSpinner, {
|
|
170
|
+
mode: mode
|
|
171
|
+
}, mode !== "small" && _react["default"].createElement(SVGBackground, {
|
|
172
|
+
viewBox: "0 0 140 140"
|
|
173
|
+
}, _react["default"].createElement(CircleBackground, {
|
|
174
|
+
cx: "70",
|
|
175
|
+
cy: "70",
|
|
176
|
+
r: "65",
|
|
177
|
+
mode: mode
|
|
178
|
+
})), mode === "small" && _react["default"].createElement(SVGBackground, {
|
|
179
|
+
viewBox: "0 0 16 16"
|
|
180
|
+
}, _react["default"].createElement(CircleBackground, {
|
|
181
|
+
cx: "8",
|
|
182
|
+
cy: "8",
|
|
183
|
+
r: "6",
|
|
184
|
+
mode: mode
|
|
185
|
+
}))), value >= 0 && value <= 100 ? _react["default"].createElement(Spinner, {
|
|
186
|
+
role: "progressbar",
|
|
187
|
+
mode: mode
|
|
188
|
+
}, mode !== "small" && _react["default"].createElement(SVGSpinner, {
|
|
189
|
+
viewBox: "0 0 140 140",
|
|
190
|
+
isDeterminated: true
|
|
191
|
+
}, _react["default"].createElement(CircleSpinner, {
|
|
192
|
+
cx: "70",
|
|
193
|
+
cy: "70",
|
|
194
|
+
r: "65",
|
|
195
|
+
backgroundType: backgroundType,
|
|
196
|
+
mode: mode,
|
|
197
|
+
isDeterminated: true,
|
|
198
|
+
value: value
|
|
199
|
+
})), mode === "small" && _react["default"].createElement(SVGSpinner, {
|
|
200
|
+
viewBox: "0 0 16 16",
|
|
201
|
+
isDeterminated: true
|
|
202
|
+
}, _react["default"].createElement(CircleSpinner, {
|
|
203
|
+
cx: "8",
|
|
204
|
+
cy: "8",
|
|
205
|
+
r: "6",
|
|
206
|
+
backgroundType: backgroundType,
|
|
207
|
+
mode: mode,
|
|
208
|
+
isDeterminated: true,
|
|
209
|
+
value: value
|
|
210
|
+
}))) : _react["default"].createElement(Spinner, {
|
|
211
|
+
role: "progressbar",
|
|
212
|
+
mode: mode
|
|
213
|
+
}, mode !== "small" && _react["default"].createElement(SVGSpinner, {
|
|
214
|
+
viewBox: "0 0 140 140",
|
|
215
|
+
isDeterminated: false
|
|
216
|
+
}, _react["default"].createElement(CircleSpinner, {
|
|
217
|
+
cx: "70",
|
|
218
|
+
cy: "70",
|
|
219
|
+
r: "65",
|
|
220
|
+
backgroundType: backgroundType,
|
|
221
|
+
mode: mode,
|
|
222
|
+
isDeterminated: false
|
|
223
|
+
})), mode === "small" && _react["default"].createElement(SVGSpinner, {
|
|
224
|
+
viewBox: "0 0 16 16",
|
|
225
|
+
isDeterminated: false
|
|
226
|
+
}, _react["default"].createElement(CircleSpinner, {
|
|
227
|
+
cx: "8",
|
|
228
|
+
cy: "8",
|
|
229
|
+
r: "6",
|
|
230
|
+
backgroundType: backgroundType,
|
|
231
|
+
mode: mode,
|
|
232
|
+
isDeterminated: false
|
|
233
|
+
}))), mode !== "small" && _react["default"].createElement(LabelsContainer, {
|
|
234
|
+
label: label,
|
|
235
|
+
value: value,
|
|
236
|
+
showValue: showValue
|
|
237
|
+
}, _react["default"].createElement(SpinnerLabel, {
|
|
238
|
+
backgroundType: backgroundType,
|
|
239
|
+
mode: mode
|
|
240
|
+
}, label), (value || value === 0) && showValue && _react["default"].createElement(SpinnerProgress, {
|
|
241
|
+
backgroundType: backgroundType,
|
|
242
|
+
mode: mode,
|
|
243
|
+
showValue: showValue
|
|
244
|
+
}, value, "%")))));
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
var determinatedValue = function determinatedValue(props, strokeDashArray) {
|
|
248
|
+
var val = 0;
|
|
249
|
+
|
|
250
|
+
if (props.value >= 0 && props.value <= 100) {
|
|
251
|
+
val = strokeDashArray * (1 - props.value / 100);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return val;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
DxcSpinner.propTypes = {
|
|
258
|
+
label: _propTypes["default"].string,
|
|
259
|
+
value: _propTypes["default"].number,
|
|
260
|
+
showValue: _propTypes["default"].bool,
|
|
261
|
+
mode: _propTypes["default"].oneOf(["large", "small", "overlay"]),
|
|
262
|
+
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
263
|
+
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
264
|
+
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
265
|
+
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
266
|
+
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
267
|
+
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
var DXCSpinner = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
271
|
+
return props.mode === "overlay" ? "100vh" : "";
|
|
272
|
+
}, function (props) {
|
|
273
|
+
return props.mode === "overlay" ? "100vw" : "";
|
|
274
|
+
}, function (props) {
|
|
275
|
+
return props.mode === "overlay" ? "flex" : "";
|
|
276
|
+
}, function (props) {
|
|
277
|
+
return props.mode === "overlay" ? "fixed" : "";
|
|
278
|
+
}, function (props) {
|
|
279
|
+
return props.mode === "overlay" ? 0 : "";
|
|
280
|
+
}, function (props) {
|
|
281
|
+
return props.mode === "overlay" ? 0 : "";
|
|
282
|
+
}, function (props) {
|
|
283
|
+
return props.mode === "overlay" ? "center" : "";
|
|
284
|
+
}, function (props) {
|
|
285
|
+
return props.mode === "overlay" ? "center" : "";
|
|
286
|
+
}, function (props) {
|
|
287
|
+
return props.mode === "overlay" ? 1300 : "";
|
|
288
|
+
}, function (props) {
|
|
289
|
+
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
290
|
+
}, function (props) {
|
|
291
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
292
|
+
}, function (props) {
|
|
293
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
294
|
+
}, function (props) {
|
|
295
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
296
|
+
}, function (props) {
|
|
297
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
var SpinnerContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
301
|
+
return props.mode === "small" ? "16px" : "140px";
|
|
302
|
+
}, function (props) {
|
|
303
|
+
return props.mode === "small" ? "16px" : "140px";
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
var BackOverlay = _styledComponents["default"].div(_templateObject3(), function (props) {
|
|
307
|
+
return "".concat(props.theme.overlayBackgroundColor);
|
|
308
|
+
}, function (props) {
|
|
309
|
+
return "".concat(props.theme.overlayOpacity);
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
var BackgroundSpinner = _styledComponents["default"].div(_templateObject4());
|
|
313
|
+
|
|
314
|
+
var SVGBackground = _styledComponents["default"].svg(_templateObject5());
|
|
315
|
+
|
|
316
|
+
var CircleBackground = _styledComponents["default"].circle(_templateObject6(), function (props) {
|
|
317
|
+
return "".concat(props.theme.totalCircleColor);
|
|
318
|
+
}, function (props) {
|
|
319
|
+
return props.mode !== "small" ? "409" : "38";
|
|
320
|
+
}, function (props) {
|
|
321
|
+
return props.mode !== "small" ? "8.5px" : "2px";
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
var Spinner = _styledComponents["default"].div(_templateObject7());
|
|
325
|
+
|
|
326
|
+
var SVGSpinner = _styledComponents["default"].svg(_templateObject8(), function (props) {
|
|
327
|
+
return !props.isDeterminated ? "1.4s linear infinite both spinner-svg" : "";
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
var CircleSpinner = _styledComponents["default"].circle(_templateObject9(), function (props) {
|
|
331
|
+
return props.isDeterminated ? "none" : props.mode !== "small" ? "1.4s ease-in-out infinite both svg-circle-large" : "1.4s ease-in-out infinite both svg-circle-small";
|
|
332
|
+
}, function (props) {
|
|
333
|
+
return props.backgroundType === "dark" ? props.theme.trackCircleColorOnDark : props.theme.trackCircleColor;
|
|
334
|
+
}, function (props) {
|
|
335
|
+
return !props.isDeterminated ? "50% 50%" : "";
|
|
336
|
+
}, function (props) {
|
|
337
|
+
return props.mode !== "small" ? "409" : "38";
|
|
338
|
+
}, function (props) {
|
|
339
|
+
return props.mode !== "small" ? "8.5px" : "2px";
|
|
340
|
+
}, function (props) {
|
|
341
|
+
return props.isDeterminated ? props.mode !== "small" ? determinatedValue(props, 409) : determinatedValue(props, 38) : "";
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
var LabelsContainer = _styledComponents["default"].div(_templateObject10());
|
|
345
|
+
|
|
346
|
+
var SpinnerLabel = _styledComponents["default"].p(_templateObject11(), function (props) {
|
|
347
|
+
return props.mode === "overlay" ? props.theme.overlayLabelFontFamily : props.theme.labelFontFamily;
|
|
348
|
+
}, function (props) {
|
|
349
|
+
return props.mode === "overlay" ? props.theme.overlayLabelFontWeight : props.theme.labelFontWeight;
|
|
350
|
+
}, function (props) {
|
|
351
|
+
return props.mode === "overlay" ? props.theme.overlayLabelFontSize : props.theme.labelFontSize;
|
|
352
|
+
}, function (props) {
|
|
353
|
+
return props.mode === "overlay" ? props.theme.overlayLabelFontStyle : props.theme.labelFontStyle;
|
|
354
|
+
}, function (props) {
|
|
355
|
+
return props.mode === "overlay" ? props.theme.overlayLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
356
|
+
}, function (props) {
|
|
357
|
+
return props.mode === "overlay" ? props.theme.overlayLabelTextAlign : props.theme.labelTextAlign;
|
|
358
|
+
}, function (props) {
|
|
359
|
+
return props.mode === "overlay" ? props.theme.overlayLabelLetterSpacing : props.theme.labelLetterSpacing;
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
var SpinnerProgress = _styledComponents["default"].p(_templateObject12(), function (props) {
|
|
363
|
+
return props.value !== "" && props.showValue === true && "block" || "none";
|
|
364
|
+
}, function (props) {
|
|
365
|
+
return props.mode === "overlay" ? props.theme.overlayProgressValueFontFamily : props.theme.progressValueFontFamily;
|
|
366
|
+
}, function (props) {
|
|
367
|
+
return props.mode === "overlay" ? props.theme.overlayProgressValueFontWeight : props.theme.progressValueFontWeight;
|
|
368
|
+
}, function (props) {
|
|
369
|
+
return props.mode === "overlay" ? props.theme.overlayProgressValueFontSize : props.theme.progressValueFontSize;
|
|
370
|
+
}, function (props) {
|
|
371
|
+
return props.mode === "overlay" ? props.theme.overlayProgressValueFontStyle : props.theme.progressValueFontStyle;
|
|
372
|
+
}, function (props) {
|
|
373
|
+
return props.mode === "overlay" ? props.theme.overlayProgressValueFontColor : props.backgroundType === "dark" ? props.theme.progressValueFontColorOnDark : props.theme.progressValueFontColor;
|
|
374
|
+
}, function (props) {
|
|
375
|
+
return props.mode === "overlay" ? props.theme.overlayProgressValueTextAlign : props.theme.progressValueTextAlign;
|
|
376
|
+
}, function (props) {
|
|
377
|
+
return props.mode === "overlay" ? props.theme.overlayProgressValueLetterSpacing : props.theme.progressValueLetterSpacing;
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
var _default = DxcSpinner;
|
|
381
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
value?: number;
|
|
12
|
+
showValue?: boolean;
|
|
13
|
+
mode?: "large" | "small" | "overlay";
|
|
14
|
+
margin?: Space | Margin;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default function DxcSpinner(props: Props): JSX.Element;
|
|
@@ -33,8 +33,10 @@ var _utils = require("../common/utils.js");
|
|
|
33
33
|
|
|
34
34
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
35
35
|
|
|
36
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
37
|
+
|
|
36
38
|
function _templateObject2() {
|
|
37
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n
|
|
39
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n opacity: 1;\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n cursor: ", ";\n ", "\n"]);
|
|
38
40
|
|
|
39
41
|
_templateObject2 = function _templateObject2() {
|
|
40
42
|
return data;
|
|
@@ -44,7 +46,7 @@ function _templateObject2() {
|
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
function _templateObject() {
|
|
47
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n
|
|
49
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n display: inline-flex;\n align-items: center;\n flex-direction: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n cursor: ", ";\n opacity: 1;\n \n .MuiSwitch-root {\n align-items: center;\n width: ", ";\n height: 45px;\n margin: 3px;\n\n .Mui-focusVisible {\n border: ", ";\n padding: 7px;\n }\n\n .MuiSwitch-track {\n /*Enabled and unchecked bar*/\n background-color: ", ";\n height: ", ";\n }\n\n .MuiSwitch-switchBase + .MuiSwitch-track {\n opacity: 1;\n }\n\n .MuiIconButton-root {\n /*Enabled and unchecked*/\n top: unset;\n .MuiSwitch-thumb {\n /*Only for thumb in all states*/\n width: ", ";\n height: ", ";\n }\n color: ", ";\n &:hover {\n background-color: transparent;\n }\n &.Mui-disabled {\n /*Disabled and unchecked*/\n color: ", ";\n + .MuiSwitch-track {\n /*Disabled and unchecked bar*/\n background-color: ", ";\n }\n }\n &.Mui-disabled.Mui-checked {\n /*Disabled and checked*/\n color: ", ";\n + .MuiSwitch-track {\n /*Disabled and checked bar*/\n background-color: ", ";\n }\n }\n &.Mui-checked {\n /*Enabled and checked*/\n color: ", ";\n transform: translateX(", ");\n &:hover {\n background-color: transparent;\n }\n + .MuiSwitch-track {\n /*Enabled and checked bar*/\n background-color: ", ";\n }\n }\n }\n }\n"]);
|
|
48
50
|
|
|
49
51
|
_templateObject = function _templateObject() {
|
|
50
52
|
return data;
|
|
@@ -77,6 +79,7 @@ var DxcSwitch = function DxcSwitch(_ref) {
|
|
|
77
79
|
setInnerChecked = _useState2[1];
|
|
78
80
|
|
|
79
81
|
var colorsTheme = (0, _useTheme["default"])();
|
|
82
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
80
83
|
|
|
81
84
|
var handlerSwitchChange = function handlerSwitchChange(newValue) {
|
|
82
85
|
if (checked === undefined) {
|
|
@@ -99,7 +102,8 @@ var DxcSwitch = function DxcSwitch(_ref) {
|
|
|
99
102
|
margin: margin,
|
|
100
103
|
disabled: disabled,
|
|
101
104
|
labelPosition: labelPosition,
|
|
102
|
-
size: size
|
|
105
|
+
size: size,
|
|
106
|
+
backgroundType: backgroundType
|
|
103
107
|
}, _react["default"].createElement(_core.Switch, {
|
|
104
108
|
checked: checked != undefined ? checked : innerChecked,
|
|
105
109
|
inputProps: {
|
|
@@ -112,9 +116,9 @@ var DxcSwitch = function DxcSwitch(_ref) {
|
|
|
112
116
|
disableRipple: true
|
|
113
117
|
}), _react["default"].createElement(LabelContainer, {
|
|
114
118
|
labelPosition: labelPosition,
|
|
115
|
-
brightness: _variables.componentTokens,
|
|
116
119
|
onClick: disabled === true ? function () {} : handlerSwitchChange,
|
|
117
|
-
disabled: disabled
|
|
120
|
+
disabled: disabled,
|
|
121
|
+
backgroundType: backgroundType
|
|
118
122
|
}, required && _react["default"].createElement(_RequiredComponent["default"], null), label)));
|
|
119
123
|
};
|
|
120
124
|
|
|
@@ -149,27 +153,51 @@ var SwitchContainer = _styledComponents["default"].div(_templateObject(), functi
|
|
|
149
153
|
}, function (props) {
|
|
150
154
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
151
155
|
}, function (props) {
|
|
152
|
-
return props.disabled
|
|
156
|
+
return props.disabled ? "not-allowed" : "default";
|
|
157
|
+
}, function (props) {
|
|
158
|
+
return props.theme.trackWidth;
|
|
159
|
+
}, function (props) {
|
|
160
|
+
return "".concat(props.backgroundType === "dark" ? props.theme.thumbFocusColorOnDark : props.theme.thumbFocusColor, " solid 2px");
|
|
161
|
+
}, function (props) {
|
|
162
|
+
return props.backgroundType === "dark" ? props.theme.uncheckedTrackBackgroundColorOnDark : props.theme.uncheckedTrackBackgroundColor;
|
|
163
|
+
}, function (props) {
|
|
164
|
+
return props.theme.trackHeight;
|
|
165
|
+
}, function (props) {
|
|
166
|
+
return props.theme.thumbWidth;
|
|
153
167
|
}, function (props) {
|
|
154
|
-
return props.theme.
|
|
168
|
+
return props.theme.thumbHeight;
|
|
155
169
|
}, function (props) {
|
|
156
|
-
return props.
|
|
170
|
+
return props.backgroundType === "dark" ? props.theme.uncheckedThumbBackgroundColorOnDark : props.theme.uncheckedThumbBackgroundColor;
|
|
157
171
|
}, function (props) {
|
|
158
|
-
return props.theme.
|
|
172
|
+
return props.backgroundType === "dark" ? props.theme.disabledUncheckedThumbBackgroundColorOnDark : props.theme.disabledUncheckedThumbBackgroundColor;
|
|
159
173
|
}, function (props) {
|
|
160
|
-
return props.
|
|
174
|
+
return props.backgroundType === "dark" ? props.theme.disabledUncheckedTrackBackgroundColorOnDark : props.theme.disabledUncheckedTrackBackgroundColor;
|
|
161
175
|
}, function (props) {
|
|
162
|
-
return props.theme.
|
|
176
|
+
return props.backgroundType === "dark" ? props.theme.disabledCheckedThumbBackgroundColorOnDark : props.theme.disabledCheckedThumbBackgroundColor;
|
|
163
177
|
}, function (props) {
|
|
164
|
-
return props.
|
|
178
|
+
return props.backgroundType === "dark" ? props.theme.disabledCheckedTrackBackgroundColorOnDark : props.theme.disabledCheckedTrackBackgroundColor;
|
|
179
|
+
}, function (props) {
|
|
180
|
+
return props.backgroundType === "dark" ? props.theme.checkedThumbBackgroundColorOnDark : props.theme.checkedThumbBackgroundColor;
|
|
181
|
+
}, function (props) {
|
|
182
|
+
return props.theme.thumbShift;
|
|
183
|
+
}, function (props) {
|
|
184
|
+
return props.backgroundType === "dark" ? props.theme.checkedTrackBackgroundColorOnDark : props.theme.checkedTrackBackgroundColor;
|
|
165
185
|
});
|
|
166
186
|
|
|
167
187
|
var LabelContainer = _styledComponents["default"].span(_templateObject2(), function (props) {
|
|
168
|
-
return props.disabled ? props.theme.
|
|
188
|
+
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
189
|
+
}, function (props) {
|
|
190
|
+
return props.theme.labelFontFamily;
|
|
191
|
+
}, function (props) {
|
|
192
|
+
return props.theme.labelFontSize;
|
|
193
|
+
}, function (props) {
|
|
194
|
+
return props.disabled ? props.theme.disabledLabelFontStyle : props.theme.labelFontStyle;
|
|
195
|
+
}, function (props) {
|
|
196
|
+
return props.theme.labelFontWeight;
|
|
169
197
|
}, function (props) {
|
|
170
198
|
return props.disabled === true ? "not-allowed" : "pointer";
|
|
171
199
|
}, function (props) {
|
|
172
|
-
return props.theme.
|
|
200
|
+
return props.labelPosition === "after" ? "margin-left: ".concat(props.theme.spaceBetweenLabelSwitch, ";") : "margin-right: ".concat(props.theme.spaceBetweenLabelSwitch, ";");
|
|
173
201
|
});
|
|
174
202
|
|
|
175
203
|
DxcSwitch.propTypes = {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
2
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
type Margin = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
value?: any;
|
|
13
|
+
label?: string;
|
|
14
|
+
labelPosition?: "before" | "after";
|
|
15
|
+
name?: string,
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onChange?: void;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
margin?: Space | Margin;
|
|
20
|
+
size?: Size;
|
|
21
|
+
tabIndex?: number;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default function DxcSwitch(props: Props): JSX.Element;
|
|
@@ -23,8 +23,10 @@ var _utils = require("../common/utils.js");
|
|
|
23
23
|
|
|
24
24
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
25
25
|
|
|
26
|
+
var _BackgroundColorContext = require("../BackgroundColorContext.js");
|
|
27
|
+
|
|
26
28
|
function _templateObject2() {
|
|
27
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n border-collapse: collapse;\n width: 100%;\n\n & tr {\n border-bottom:
|
|
29
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n border-collapse: collapse;\n width: 100%;\n\n & tr {\n border-bottom: ", ";\n }\n & td {\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n text-transform: ", ";\n text-align: ", ";\n line-height: ", ";\n padding: ", ";\n }\n & th {\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n text-transform: ", ";\n text-align: ", ";\n line-height: ", ";\n padding: ", ";\n }\n & th:first-child {\n border-top-left-radius: ", ";\n }\n & th:last-child {\n border-top-right-radius: ", ";\n }\n"]);
|
|
28
30
|
|
|
29
31
|
_templateObject2 = function _templateObject2() {
|
|
30
32
|
return data;
|
|
@@ -34,7 +36,7 @@ function _templateObject2() {
|
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
function _templateObject() {
|
|
37
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
39
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n overflow: hidden auto;\n &::-webkit-scrollbar {\n width: 8px;\n }\n &::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 6px;\n }\n &::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 6px;\n }\n"]);
|
|
38
40
|
|
|
39
41
|
_templateObject = function _templateObject() {
|
|
40
42
|
return data;
|
|
@@ -51,7 +53,9 @@ var DxcTable = function DxcTable(_ref) {
|
|
|
51
53
|
theme: colorsTheme.table
|
|
52
54
|
}, _react["default"].createElement(DxcTableContainer, {
|
|
53
55
|
margin: margin
|
|
54
|
-
}, _react["default"].createElement(DxcTableContent, null,
|
|
56
|
+
}, _react["default"].createElement(DxcTableContent, null, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
57
|
+
color: colorsTheme.table.dataBackgroundColor
|
|
58
|
+
}, children))));
|
|
55
59
|
};
|
|
56
60
|
|
|
57
61
|
var calculateWidth = function calculateWidth(margin) {
|
|
@@ -59,11 +63,7 @@ var calculateWidth = function calculateWidth(margin) {
|
|
|
59
63
|
};
|
|
60
64
|
|
|
61
65
|
var DxcTableContainer = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
62
|
-
return props.theme.fontSizeBase;
|
|
63
|
-
}, function (props) {
|
|
64
66
|
return calculateWidth(props.margin);
|
|
65
|
-
}, function (props) {
|
|
66
|
-
return props.theme.fontFamily;
|
|
67
67
|
}, function (props) {
|
|
68
68
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
69
69
|
}, function (props) {
|
|
@@ -81,17 +81,51 @@ var DxcTableContainer = _styledComponents["default"].div(_templateObject(), func
|
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
var DxcTableContent = _styledComponents["default"].table(_templateObject2(), function (props) {
|
|
84
|
-
return props.theme.
|
|
84
|
+
return "".concat(props.theme.rowSeparatorThickness, " ").concat(props.theme.rowSeparatorStyle, " ").concat(props.theme.rowSeparatorColor);
|
|
85
|
+
}, function (props) {
|
|
86
|
+
return props.theme.dataBackgroundColor;
|
|
87
|
+
}, function (props) {
|
|
88
|
+
return props.theme.dataFontFamily;
|
|
89
|
+
}, function (props) {
|
|
90
|
+
return props.theme.dataFontSize;
|
|
91
|
+
}, function (props) {
|
|
92
|
+
return props.theme.dataFontStyle;
|
|
93
|
+
}, function (props) {
|
|
94
|
+
return props.theme.dataFontWeight;
|
|
95
|
+
}, function (props) {
|
|
96
|
+
return props.theme.dataFontColor;
|
|
97
|
+
}, function (props) {
|
|
98
|
+
return props.theme.dataFontTextTransform;
|
|
85
99
|
}, function (props) {
|
|
86
|
-
return props.theme.
|
|
100
|
+
return props.theme.dataTextAlign;
|
|
87
101
|
}, function (props) {
|
|
88
|
-
return props.theme.
|
|
102
|
+
return props.theme.dataTextLineHeight;
|
|
89
103
|
}, function (props) {
|
|
90
|
-
return props.theme.
|
|
104
|
+
return "".concat(props.theme.dataPaddingTop, " ").concat(props.theme.dataPaddingRight, " ").concat(props.theme.dataPaddingBottom, " ").concat(props.theme.dataPaddingLeft);
|
|
91
105
|
}, function (props) {
|
|
92
106
|
return props.theme.headerBackgroundColor;
|
|
107
|
+
}, function (props) {
|
|
108
|
+
return props.theme.headerFontFamily;
|
|
109
|
+
}, function (props) {
|
|
110
|
+
return props.theme.headerFontSize;
|
|
111
|
+
}, function (props) {
|
|
112
|
+
return props.theme.headerFontStyle;
|
|
113
|
+
}, function (props) {
|
|
114
|
+
return props.theme.headerFontWeight;
|
|
93
115
|
}, function (props) {
|
|
94
116
|
return props.theme.headerFontColor;
|
|
117
|
+
}, function (props) {
|
|
118
|
+
return props.theme.headerFontTextTransform;
|
|
119
|
+
}, function (props) {
|
|
120
|
+
return props.theme.headerTextAlign;
|
|
121
|
+
}, function (props) {
|
|
122
|
+
return props.theme.headerTextLineHeight;
|
|
123
|
+
}, function (props) {
|
|
124
|
+
return "".concat(props.theme.headerPaddingTop, " ").concat(props.theme.headerPaddingRight, " ").concat(props.theme.headerPaddingBottom, " ").concat(props.theme.headerPaddingLeft);
|
|
125
|
+
}, function (props) {
|
|
126
|
+
return props.theme.headerBorderRadius;
|
|
127
|
+
}, function (props) {
|
|
128
|
+
return props.theme.headerBorderRadius;
|
|
95
129
|
});
|
|
96
130
|
|
|
97
131
|
var _default = DxcTable;
|
package/table/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
margin?: Space | Margin;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default function DxcTable(props: Props): JSX.Element;
|