@dxc-technology/halstack-react 0.0.0-abb5d48 → 0.0.0-acb1a24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/BackgroundColorContext.js +46 -0
- package/dist/ThemeContext.js +171 -106
- package/dist/V3Select/V3Select.js +549 -0
- package/dist/V3Select/index.d.ts +27 -0
- package/dist/V3Textarea/V3Textarea.js +264 -0
- package/dist/V3Textarea/index.d.ts +27 -0
- package/dist/accordion/Accordion.js +119 -52
- package/dist/accordion/index.d.ts +28 -0
- package/dist/accordion-group/AccordionGroup.js +34 -4
- package/dist/accordion-group/index.d.ts +16 -0
- package/dist/alert/Alert.js +170 -83
- package/dist/alert/index.d.ts +51 -0
- package/dist/badge/Badge.js +28 -7
- package/dist/box/Box.js +27 -20
- package/dist/box/index.d.ts +25 -0
- package/dist/button/Button.js +42 -25
- package/dist/button/index.d.ts +24 -0
- package/dist/card/Card.js +16 -9
- package/dist/card/index.d.ts +22 -0
- package/dist/checkbox/Checkbox.js +89 -25
- package/dist/checkbox/index.d.ts +24 -0
- package/dist/chip/Chip.js +63 -23
- package/dist/chip/index.d.ts +22 -0
- package/dist/common/utils.js +2 -22
- package/dist/common/variables.js +1351 -299
- package/dist/date/Date.js +60 -40
- package/dist/date/index.d.ts +27 -0
- package/dist/date-input/DateInput.js +400 -0
- package/dist/date-input/index.d.ts +95 -0
- package/dist/dialog/Dialog.js +44 -31
- package/dist/dialog/index.d.ts +18 -0
- package/dist/dropdown/Dropdown.js +162 -76
- package/dist/dropdown/index.d.ts +26 -0
- package/dist/file-input/FileInput.js +644 -0
- package/dist/file-input/FileItem.js +287 -0
- package/dist/file-input/index.d.ts +81 -0
- package/dist/footer/Footer.js +79 -39
- package/dist/footer/Icons.js +77 -0
- package/dist/footer/index.d.ts +25 -0
- package/dist/header/Header.js +158 -73
- package/dist/header/Icons.js +59 -0
- package/dist/header/index.d.ts +25 -0
- package/dist/heading/Heading.js +103 -38
- package/dist/heading/index.d.ts +17 -0
- package/dist/input-text/Icons.js +22 -0
- package/dist/input-text/InputText.js +181 -75
- package/dist/input-text/index.d.ts +36 -0
- package/dist/layout/ApplicationLayout.js +14 -18
- package/dist/layout/Icons.js +55 -0
- package/dist/link/Link.js +77 -41
- package/dist/link/index.d.ts +23 -0
- package/dist/main.d.ts +40 -0
- package/dist/main.js +72 -16
- package/dist/number-input/NumberInput.js +136 -0
- package/dist/number-input/NumberInputContext.js +16 -0
- package/dist/number-input/index.d.ts +113 -0
- package/dist/paginator/Icons.js +66 -0
- package/dist/paginator/Paginator.js +85 -43
- package/dist/paginator/index.d.ts +20 -0
- package/dist/password-input/PasswordInput.js +203 -0
- package/dist/password-input/index.d.ts +94 -0
- package/dist/progress-bar/ProgressBar.js +88 -40
- package/dist/progress-bar/index.d.ts +18 -0
- package/dist/radio/Radio.js +28 -11
- package/dist/radio/index.d.ts +23 -0
- package/dist/resultsetTable/ResultsetTable.js +65 -40
- package/dist/resultsetTable/index.d.ts +19 -0
- package/dist/select/Select.js +887 -283
- package/dist/select/index.d.ts +53 -0
- package/dist/sidenav/Sidenav.js +47 -25
- package/dist/sidenav/index.d.ts +13 -0
- package/dist/slider/Slider.js +204 -69
- package/dist/slider/index.d.ts +29 -0
- package/dist/spinner/Spinner.js +244 -63
- package/dist/spinner/index.d.ts +17 -0
- package/dist/switch/Switch.js +42 -16
- package/dist/switch/index.d.ts +24 -0
- package/dist/table/Table.js +45 -13
- package/dist/table/index.d.ts +13 -0
- package/dist/tabs/Tabs.js +37 -21
- package/dist/tabs/index.d.ts +19 -0
- package/dist/tag/Tag.js +50 -36
- package/dist/tag/index.d.ts +24 -0
- package/dist/text-input/TextInput.js +974 -0
- package/dist/text-input/index.d.ts +135 -0
- package/dist/textarea/Textarea.js +238 -109
- package/dist/textarea/index.d.ts +117 -0
- package/dist/toggle/Toggle.js +0 -2
- package/dist/toggle/index.d.ts +21 -0
- package/dist/toggle-group/ToggleGroup.js +139 -37
- package/dist/toggle-group/index.d.ts +21 -0
- package/dist/upload/Upload.js +1 -7
- package/dist/upload/buttons-upload/ButtonsUpload.js +28 -18
- package/dist/upload/buttons-upload/Icons.js +40 -0
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +61 -27
- package/dist/upload/dragAndDropArea/Icons.js +39 -0
- package/dist/upload/file-upload/FileToUpload.js +52 -27
- package/dist/upload/file-upload/Icons.js +66 -0
- package/dist/upload/files-upload/FilesToUpload.js +3 -5
- package/dist/upload/index.d.ts +15 -0
- package/dist/upload/transaction/Icons.js +160 -0
- package/dist/upload/transaction/Transaction.js +37 -43
- package/dist/upload/transactions/Transactions.js +24 -10
- package/dist/wizard/Icons.js +65 -0
- package/dist/wizard/Wizard.js +106 -58
- package/dist/wizard/index.d.ts +18 -0
- package/package.json +11 -13
- package/test/AccordionGroup.test.js +16 -0
- package/test/Date.test.js +15 -13
- package/test/DateInput.test.js +242 -0
- package/test/Dropdown.test.js +15 -0
- package/test/FileInput.test.js +201 -0
- package/test/Footer.test.js +2 -7
- package/test/Header.test.js +5 -10
- package/test/Heading.test.js +60 -12
- package/test/Link.test.js +3 -2
- package/test/NumberInput.test.js +259 -0
- package/test/Paginator.test.js +6 -2
- package/test/PasswordInput.test.js +83 -0
- package/test/ResultsetTable.test.js +6 -6
- package/test/Select.test.js +371 -148
- package/test/Slider.test.js +9 -17
- package/test/Spinner.test.js +5 -0
- package/test/TextInput.test.js +732 -0
- package/test/Textarea.test.js +193 -0
- package/test/ToggleGroup.test.js +5 -1
- package/test/Upload.test.js +1 -1
- package/test/V3Select.test.js +212 -0
- package/test/{TextArea.test.js → V3TextArea.test.js} +6 -7
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- package/dist/accordion-group/AccordionGroup.stories.js +0 -207
- package/dist/accordion-group/readme.md +0 -70
- package/dist/alert/Alert.stories.js +0 -158
- package/dist/alert/close.svg +0 -4
- package/dist/alert/error.svg +0 -4
- package/dist/alert/info.svg +0 -4
- package/dist/alert/readme.md +0 -43
- package/dist/alert/success.svg +0 -4
- package/dist/alert/warning.svg +0 -4
- package/dist/button/Button.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/services/example-service.js +0 -10
- package/dist/common/services/example-service.test.js +0 -12
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/calendar.svg +0 -1
- package/dist/date/calendar_dark.svg +0 -1
- package/dist/date/readme.md +0 -73
- package/dist/dialog/Dialog.stories.js +0 -217
- package/dist/dialog/readme.md +0 -32
- package/dist/dropdown/Dropdown.stories.js +0 -249
- package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
- package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
- package/dist/dropdown/readme.md +0 -69
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo_wht.png +0 -0
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- package/dist/header/dxc_logo_black.png +0 -0
- package/dist/header/dxc_logo_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/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.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.stories.js +0 -183
- package/dist/spinner/readme.md +0 -65
- package/dist/switch/Switch.stories.js +0 -134
- package/dist/switch/readme.md +0 -133
- package/dist/tabs/Tabs.stories.js +0 -130
- package/dist/tabs/readme.md +0 -78
- package/dist/tabs-for-sections/TabsForSections.js +0 -92
- package/dist/tabs-for-sections/readme.md +0 -78
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- package/dist/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/TabsForSections.test.js +0 -34
package/dist/table/Table.js
CHANGED
|
@@ -17,16 +17,16 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
17
17
|
|
|
18
18
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
19
|
|
|
20
|
-
require("../common/OpenSans.css");
|
|
21
|
-
|
|
22
20
|
var _variables = require("../common/variables.js");
|
|
23
21
|
|
|
24
22
|
var _utils = require("../common/utils.js");
|
|
25
23
|
|
|
26
24
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
27
25
|
|
|
26
|
+
var _BackgroundColorContext = require("../BackgroundColorContext.js");
|
|
27
|
+
|
|
28
28
|
function _templateObject2() {
|
|
29
|
-
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"]);
|
|
30
30
|
|
|
31
31
|
_templateObject2 = function _templateObject2() {
|
|
32
32
|
return data;
|
|
@@ -36,7 +36,7 @@ function _templateObject2() {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function _templateObject() {
|
|
39
|
-
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"]);
|
|
40
40
|
|
|
41
41
|
_templateObject = function _templateObject() {
|
|
42
42
|
return data;
|
|
@@ -53,7 +53,9 @@ var DxcTable = function DxcTable(_ref) {
|
|
|
53
53
|
theme: colorsTheme.table
|
|
54
54
|
}, _react["default"].createElement(DxcTableContainer, {
|
|
55
55
|
margin: margin
|
|
56
|
-
}, _react["default"].createElement(DxcTableContent, null,
|
|
56
|
+
}, _react["default"].createElement(DxcTableContent, null, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
57
|
+
color: colorsTheme.table.dataBackgroundColor
|
|
58
|
+
}, children))));
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
var calculateWidth = function calculateWidth(margin) {
|
|
@@ -61,11 +63,7 @@ var calculateWidth = function calculateWidth(margin) {
|
|
|
61
63
|
};
|
|
62
64
|
|
|
63
65
|
var DxcTableContainer = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
64
|
-
return props.theme.fontSizeBase;
|
|
65
|
-
}, function (props) {
|
|
66
66
|
return calculateWidth(props.margin);
|
|
67
|
-
}, function (props) {
|
|
68
|
-
return props.theme.fontFamily;
|
|
69
67
|
}, function (props) {
|
|
70
68
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
71
69
|
}, function (props) {
|
|
@@ -83,17 +81,51 @@ var DxcTableContainer = _styledComponents["default"].div(_templateObject(), func
|
|
|
83
81
|
});
|
|
84
82
|
|
|
85
83
|
var DxcTableContent = _styledComponents["default"].table(_templateObject2(), function (props) {
|
|
86
|
-
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;
|
|
87
99
|
}, function (props) {
|
|
88
|
-
return props.theme.
|
|
100
|
+
return props.theme.dataTextAlign;
|
|
89
101
|
}, function (props) {
|
|
90
|
-
return props.theme.
|
|
102
|
+
return props.theme.dataTextLineHeight;
|
|
91
103
|
}, function (props) {
|
|
92
|
-
return props.theme.
|
|
104
|
+
return "".concat(props.theme.dataPaddingTop, " ").concat(props.theme.dataPaddingRight, " ").concat(props.theme.dataPaddingBottom, " ").concat(props.theme.dataPaddingLeft);
|
|
93
105
|
}, function (props) {
|
|
94
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;
|
|
95
115
|
}, function (props) {
|
|
96
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;
|
|
97
129
|
});
|
|
98
130
|
|
|
99
131
|
var _default = DxcTable;
|
|
@@ -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;
|
package/dist/tabs/Tabs.js
CHANGED
|
@@ -29,8 +29,6 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
29
29
|
|
|
30
30
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
31
31
|
|
|
32
|
-
require("../common/OpenSans.css");
|
|
33
|
-
|
|
34
32
|
var _variables = require("../common/variables.js");
|
|
35
33
|
|
|
36
34
|
var _Badge = _interopRequireDefault(require("../badge/Badge"));
|
|
@@ -58,7 +56,7 @@ function _templateObject8() {
|
|
|
58
56
|
}
|
|
59
57
|
|
|
60
58
|
function _templateObject7() {
|
|
61
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
59
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n .MuiTabs-root {\n background: white;\n min-height: ", ";\n\n .MuiTabs-scroller {\n .MuiTabs-flexContainer + span {\n z-index: 4;\n }\n }\n .MuiTab-root {\n text-transform: ", " !important;\n }\n .MuiButtonBase-root {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n\n padding: ", ";\n height: ", ";\n min-width: 90px;\n max-width: 360px;\n min-height: ", ";\n\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n font-weight: ", ";\n }\n &:not(.Mui-selected) {\n background-color: ", ";\n color: ", ";\n svg {\n color: ", ";\n }\n }\n &.Mui-selected {\n background-color: ", ";\n color: ", ";\n svg {\n color: ", ";\n }\n }\n &.Mui-disabled {\n cursor: not-allowed !important;\n pointer-events: all;\n color: ", ";\n font-style: ", ";\n svg {\n color: ", ";\n }\n }\n &:focus {\n outline: ", " auto 1px;\n }\n }\n .MuiTabs-indicator {\n background-color: ", ";\n height: ", ";\n }\n .MuiTabs-scrollButtons {\n min-width: ", ";\n width: ", ";\n padding: 0;\n }\n @media (max-width: 599.95px) {\n .MuiTabs-scrollButtonsDesktop {\n display: flex;\n }\n }\n }\n"]);
|
|
62
60
|
|
|
63
61
|
_templateObject7 = function _templateObject7() {
|
|
64
62
|
return data;
|
|
@@ -68,7 +66,7 @@ function _templateObject7() {
|
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
function _templateObject6() {
|
|
71
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n left: 0px;\n bottom: 0;\n width: 100%;\n height:
|
|
69
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n left: 0px;\n bottom: 0;\n width: 100%;\n height: ", ";\n position: absolute;\n background-color: ", ";\n"]);
|
|
72
70
|
|
|
73
71
|
_templateObject6 = function _templateObject6() {
|
|
74
72
|
return data;
|
|
@@ -160,11 +158,7 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
160
158
|
};
|
|
161
159
|
|
|
162
160
|
var getTabIndex = function getTabIndex(index, disabled) {
|
|
163
|
-
|
|
164
|
-
return tabIndex;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return -1;
|
|
161
|
+
return (activeTabIndex === index || innerActiveTabIndex === index) && !disabled ? tabIndex : -1;
|
|
168
162
|
};
|
|
169
163
|
|
|
170
164
|
var getLabelForTab = function getLabelForTab(tab) {
|
|
@@ -241,12 +235,12 @@ var MainLabelContainer = _styledComponents["default"].div(_templateObject5(), fu
|
|
|
241
235
|
});
|
|
242
236
|
|
|
243
237
|
var Underline = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
244
|
-
return props.theme.
|
|
238
|
+
return props.theme.dividerThickness;
|
|
239
|
+
}, function (props) {
|
|
240
|
+
return props.theme.dividerColor;
|
|
245
241
|
});
|
|
246
242
|
|
|
247
243
|
var DxCTabs = _styledComponents["default"].div(_templateObject7(), function (props) {
|
|
248
|
-
return props.theme.fontSizeBase;
|
|
249
|
-
}, function (props) {
|
|
250
244
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
251
245
|
}, function (props) {
|
|
252
246
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -256,36 +250,58 @@ var DxCTabs = _styledComponents["default"].div(_templateObject7(), function (pro
|
|
|
256
250
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
257
251
|
}, function (props) {
|
|
258
252
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
259
|
-
}, function (props) {
|
|
260
|
-
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "12px 16px" || "8px 16px";
|
|
261
253
|
}, function (props) {
|
|
262
254
|
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
255
|
+
}, function (props) {
|
|
256
|
+
return props.theme.fontTextTransform;
|
|
263
257
|
}, function (props) {
|
|
264
258
|
return props.theme.fontFamily;
|
|
259
|
+
}, function (props) {
|
|
260
|
+
return props.theme.fontSize;
|
|
261
|
+
}, function (props) {
|
|
262
|
+
return props.theme.fontStyle;
|
|
265
263
|
}, function (props) {
|
|
266
264
|
return props.theme.fontWeight;
|
|
267
265
|
}, function (props) {
|
|
268
|
-
return props.
|
|
266
|
+
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "12px 16px" || "8px 16px";
|
|
267
|
+
}, function (props) {
|
|
268
|
+
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
269
269
|
}, function (props) {
|
|
270
|
-
return props.
|
|
270
|
+
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
271
271
|
}, function (props) {
|
|
272
272
|
return "".concat(props.theme.hoverBackgroundColor, " !important");
|
|
273
273
|
}, function (props) {
|
|
274
274
|
return "".concat(props.theme.pressedBackgroundColor, " !important");
|
|
275
275
|
}, function (props) {
|
|
276
|
-
return props.theme.
|
|
276
|
+
return "".concat(props.theme.pressedFontWeight, " !important");
|
|
277
|
+
}, function (props) {
|
|
278
|
+
return props.theme.unselectedBackgroundColor;
|
|
279
|
+
}, function (props) {
|
|
280
|
+
return props.theme.unselectedFontColor;
|
|
277
281
|
}, function (props) {
|
|
278
|
-
return props.theme.
|
|
282
|
+
return props.theme.unselectedIconColor;
|
|
279
283
|
}, function (props) {
|
|
280
|
-
return props.theme.
|
|
284
|
+
return props.theme.selectedBackgroundColor;
|
|
281
285
|
}, function (props) {
|
|
282
286
|
return props.theme.selectedFontColor;
|
|
287
|
+
}, function (props) {
|
|
288
|
+
return props.theme.selectedIconColor;
|
|
283
289
|
}, function (props) {
|
|
284
290
|
return props.theme.disabledFontColor;
|
|
291
|
+
}, function (props) {
|
|
292
|
+
return props.theme.disabledFontStyle;
|
|
293
|
+
}, function (props) {
|
|
294
|
+
return props.theme.disabledIconColor;
|
|
285
295
|
}, function (props) {
|
|
286
296
|
return props.theme.focusOutline;
|
|
287
297
|
}, function (props) {
|
|
288
298
|
return props.theme.selectedUnderlineColor;
|
|
299
|
+
}, function (props) {
|
|
300
|
+
return props.theme.selectedUnderlineThickness;
|
|
301
|
+
}, function (props) {
|
|
302
|
+
return props.theme.scrollButtonsWidth;
|
|
303
|
+
}, function (props) {
|
|
304
|
+
return props.theme.scrollButtonsWidth;
|
|
289
305
|
});
|
|
290
306
|
|
|
291
307
|
var TabIcon = _styledComponents["default"].img(_templateObject8());
|
|
@@ -304,8 +320,8 @@ DxcTabs.propTypes = {
|
|
|
304
320
|
label: _propTypes["default"].string,
|
|
305
321
|
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
306
322
|
iconSrc: _propTypes["default"].string,
|
|
307
|
-
isDisabled: _propTypes["default"]
|
|
308
|
-
notificationNumber: _propTypes["default"].oneOfType([_propTypes["default"]["
|
|
323
|
+
isDisabled: _propTypes["default"].bool,
|
|
324
|
+
notificationNumber: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].string, _propTypes["default"].number])
|
|
309
325
|
})),
|
|
310
326
|
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
311
327
|
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
activeTabIndex?: number;
|
|
11
|
+
tabs?: any;
|
|
12
|
+
onTabClick?: void;
|
|
13
|
+
onTabHover?: void;
|
|
14
|
+
iconPosition?: "top" | "left";
|
|
15
|
+
margin?: Space | Margin;
|
|
16
|
+
tabIndex?: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default function DxcTabs(props: Props): JSX.Element;
|
package/dist/tag/Tag.js
CHANGED
|
@@ -30,7 +30,7 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
|
30
30
|
var _Box = _interopRequireDefault(require("../box/Box"));
|
|
31
31
|
|
|
32
32
|
function _templateObject8() {
|
|
33
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
33
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n flex-grow: 1;\n text-align: center;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n"]);
|
|
34
34
|
|
|
35
35
|
_templateObject8 = function _templateObject8() {
|
|
36
36
|
return data;
|
|
@@ -40,7 +40,7 @@ function _templateObject8() {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
function _templateObject7() {
|
|
43
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n background: ", ";\n width:
|
|
43
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n background: ", ";\n width: ", ";\n height: 100%;\n justify-content: center;\n align-items: center;\n color: ", ";\n"]);
|
|
44
44
|
|
|
45
45
|
_templateObject7 = function _templateObject7() {
|
|
46
46
|
return data;
|
|
@@ -50,7 +50,7 @@ function _templateObject7() {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function _templateObject6() {
|
|
53
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
53
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n\n img,\n svg {\n width: ", ";\n height: ", ";\n }\n"]);
|
|
54
54
|
|
|
55
55
|
_templateObject6 = function _templateObject6() {
|
|
56
56
|
return data;
|
|
@@ -60,7 +60,7 @@ function _templateObject6() {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function _templateObject5() {
|
|
63
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
63
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n width: ", ";\n height: ", ";\n"]);
|
|
64
64
|
|
|
65
65
|
_templateObject5 = function _templateObject5() {
|
|
66
66
|
return data;
|
|
@@ -70,7 +70,7 @@ function _templateObject5() {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
function _templateObject4() {
|
|
73
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n
|
|
73
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n background: none;\n border-radius: 4px;\n border: none;\n padding: 0;\n cursor: pointer;\n font-family: inherit;\n\n :focus {\n outline: 2px solid ", ";\n }\n"]);
|
|
74
74
|
|
|
75
75
|
_templateObject4 = function _templateObject4() {
|
|
76
76
|
return data;
|
|
@@ -80,7 +80,7 @@ function _templateObject4() {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
function _templateObject3() {
|
|
83
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: ", ";\n"]);
|
|
83
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: none;\n border-radius: 4px;\n\n :focus {\n outline: 2px solid ", ";\n outline-offset: 0px;\n }\n"]);
|
|
84
84
|
|
|
85
85
|
_templateObject3 = function _templateObject3() {
|
|
86
86
|
return data;
|
|
@@ -90,7 +90,7 @@ function _templateObject3() {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function _templateObject2() {
|
|
93
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n flex-direction: ", ";\n width: ", ";\n"]);
|
|
93
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n flex-direction: ", ";\n width: ", ";\n height: ", ";\n"]);
|
|
94
94
|
|
|
95
95
|
_templateObject2 = function _templateObject2() {
|
|
96
96
|
return data;
|
|
@@ -100,7 +100,7 @@ function _templateObject2() {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
function _templateObject() {
|
|
103
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
103
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
104
104
|
|
|
105
105
|
_templateObject = function _templateObject() {
|
|
106
106
|
return data;
|
|
@@ -117,7 +117,7 @@ var DxcTag = function DxcTag(_ref) {
|
|
|
117
117
|
linkHref = _ref.linkHref,
|
|
118
118
|
onClick = _ref.onClick,
|
|
119
119
|
_ref$iconBgColor = _ref.iconBgColor,
|
|
120
|
-
iconBgColor = _ref$iconBgColor === void 0 ? "
|
|
120
|
+
iconBgColor = _ref$iconBgColor === void 0 ? "#5f249f" : _ref$iconBgColor,
|
|
121
121
|
_ref$labelPosition = _ref.labelPosition,
|
|
122
122
|
labelPosition = _ref$labelPosition === void 0 ? "after" : _ref$labelPosition,
|
|
123
123
|
_ref$newWindow = _ref.newWindow,
|
|
@@ -125,7 +125,7 @@ var DxcTag = function DxcTag(_ref) {
|
|
|
125
125
|
_ref$size = _ref.size,
|
|
126
126
|
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
127
127
|
_ref$tabIndex = _ref.tabIndex,
|
|
128
|
-
tabIndex = _ref$tabIndex === void 0 ?
|
|
128
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
129
129
|
var colorsTheme = (0, _useTheme["default"])();
|
|
130
130
|
|
|
131
131
|
var _useState = (0, _react.useState)(false),
|
|
@@ -134,9 +134,7 @@ var DxcTag = function DxcTag(_ref) {
|
|
|
134
134
|
changeIsHovered = _useState2[1];
|
|
135
135
|
|
|
136
136
|
var clickHandler = function clickHandler() {
|
|
137
|
-
|
|
138
|
-
onClick();
|
|
139
|
-
}
|
|
137
|
+
onClick && onClick();
|
|
140
138
|
};
|
|
141
139
|
|
|
142
140
|
var tagContent = _react["default"].createElement(_Box["default"], {
|
|
@@ -144,7 +142,6 @@ var DxcTag = function DxcTag(_ref) {
|
|
|
144
142
|
shadowDepth: isHovered && (onClick || linkHref) && 2 || 1
|
|
145
143
|
}, _react["default"].createElement(TagContent, {
|
|
146
144
|
labelPosition: labelPosition,
|
|
147
|
-
margin: margin,
|
|
148
145
|
size: size
|
|
149
146
|
}, _react["default"].createElement(IconContainer, {
|
|
150
147
|
iconBgColor: iconBgColor
|
|
@@ -152,7 +149,9 @@ var DxcTag = function DxcTag(_ref) {
|
|
|
152
149
|
src: iconSrc
|
|
153
150
|
})), size !== "small" && _react["default"].createElement(TagLabel, null, label)));
|
|
154
151
|
|
|
155
|
-
return _react["default"].createElement(
|
|
152
|
+
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
153
|
+
theme: colorsTheme.tag
|
|
154
|
+
}, _react["default"].createElement(StyledDxcTag, {
|
|
156
155
|
margin: margin,
|
|
157
156
|
onMouseEnter: function onMouseEnter() {
|
|
158
157
|
return changeIsHovered(true);
|
|
@@ -168,7 +167,7 @@ var DxcTag = function DxcTag(_ref) {
|
|
|
168
167
|
tabIndex: tabIndex,
|
|
169
168
|
href: linkHref,
|
|
170
169
|
target: newWindow ? "_blank" : "_self"
|
|
171
|
-
}, tagContent) : tagContent);
|
|
170
|
+
}, tagContent) : tagContent));
|
|
172
171
|
};
|
|
173
172
|
|
|
174
173
|
var sizes = {
|
|
@@ -183,9 +182,7 @@ var calculateWidth = function calculateWidth(size) {
|
|
|
183
182
|
return sizes[size];
|
|
184
183
|
};
|
|
185
184
|
|
|
186
|
-
var StyledDxcTag = _styledComponents["default"].div(_templateObject(), function (
|
|
187
|
-
return props.theme.fontSizeBase;
|
|
188
|
-
}, function (_ref2) {
|
|
185
|
+
var StyledDxcTag = _styledComponents["default"].div(_templateObject(), function (_ref2) {
|
|
189
186
|
var hasAction = _ref2.hasAction;
|
|
190
187
|
return hasAction && "pointer" || "unset";
|
|
191
188
|
}, function (_ref3) {
|
|
@@ -210,29 +207,57 @@ var TagContent = _styledComponents["default"].div(_templateObject2(), function (
|
|
|
210
207
|
return labelPosition === "before" && "row-reverse" || "row";
|
|
211
208
|
}, function (props) {
|
|
212
209
|
return calculateWidth(props.size);
|
|
210
|
+
}, function (props) {
|
|
211
|
+
return props.theme.height;
|
|
213
212
|
});
|
|
214
213
|
|
|
215
214
|
var StyledLink = _styledComponents["default"].a(_templateObject3(), function (props) {
|
|
216
|
-
return props.theme.
|
|
215
|
+
return props.theme.focusColor;
|
|
217
216
|
});
|
|
218
217
|
|
|
219
|
-
var StyledButton = _styledComponents["default"].button(_templateObject4())
|
|
218
|
+
var StyledButton = _styledComponents["default"].button(_templateObject4(), function (props) {
|
|
219
|
+
return props.theme.focusColor;
|
|
220
|
+
});
|
|
220
221
|
|
|
221
|
-
var TagIcon = _styledComponents["default"].img(_templateObject5())
|
|
222
|
+
var TagIcon = _styledComponents["default"].img(_templateObject5(), function (props) {
|
|
223
|
+
return props.theme.iconWidth;
|
|
224
|
+
}, function (props) {
|
|
225
|
+
return props.theme.iconHeight;
|
|
226
|
+
});
|
|
222
227
|
|
|
223
|
-
var TagIconContainer = _styledComponents["default"].div(_templateObject6())
|
|
228
|
+
var TagIconContainer = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
229
|
+
return props.theme.iconWidth;
|
|
230
|
+
}, function (props) {
|
|
231
|
+
return props.theme.iconHeight;
|
|
232
|
+
});
|
|
224
233
|
|
|
225
234
|
var IconContainer = _styledComponents["default"].div(_templateObject7(), function (_ref9) {
|
|
226
235
|
var iconBgColor = _ref9.iconBgColor;
|
|
227
236
|
return iconBgColor;
|
|
237
|
+
}, function (props) {
|
|
238
|
+
return props.theme.iconSectionWidth;
|
|
239
|
+
}, function (props) {
|
|
240
|
+
return props.theme.iconColor;
|
|
228
241
|
});
|
|
229
242
|
|
|
230
243
|
var TagLabel = _styledComponents["default"].div(_templateObject8(), function (props) {
|
|
244
|
+
return props.theme.fontFamily;
|
|
245
|
+
}, function (props) {
|
|
231
246
|
return props.theme.fontSize;
|
|
232
247
|
}, function (props) {
|
|
233
|
-
return props.theme.
|
|
248
|
+
return props.theme.fontStyle;
|
|
249
|
+
}, function (props) {
|
|
250
|
+
return props.theme.fontWeight;
|
|
251
|
+
}, function (props) {
|
|
252
|
+
return props.theme.fontColor;
|
|
234
253
|
}, function (props) {
|
|
235
|
-
return props.theme.
|
|
254
|
+
return props.theme.labelPaddingTop;
|
|
255
|
+
}, function (props) {
|
|
256
|
+
return props.theme.labelPaddingBottom;
|
|
257
|
+
}, function (props) {
|
|
258
|
+
return props.theme.labelPaddingLeft;
|
|
259
|
+
}, function (props) {
|
|
260
|
+
return props.theme.labelPaddingRight;
|
|
236
261
|
});
|
|
237
262
|
|
|
238
263
|
DxcTag.propTypes = {
|
|
@@ -253,16 +278,5 @@ DxcTag.propTypes = {
|
|
|
253
278
|
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
254
279
|
tabIndex: _propTypes["default"].number
|
|
255
280
|
};
|
|
256
|
-
DxcTag.defaultProps = {
|
|
257
|
-
icon: null,
|
|
258
|
-
iconSrc: null,
|
|
259
|
-
label: null,
|
|
260
|
-
margin: null,
|
|
261
|
-
linkHref: null,
|
|
262
|
-
onClick: null,
|
|
263
|
-
iconBgColor: "black",
|
|
264
|
-
labelPosition: "after",
|
|
265
|
-
newWindow: false
|
|
266
|
-
};
|
|
267
281
|
var _default = DxcTag;
|
|
268
282
|
exports["default"] = _default;
|
|
@@ -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
|
+
icon?: any;
|
|
12
|
+
iconSrc?: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
linkHref?: string;
|
|
15
|
+
onClick?: void,
|
|
16
|
+
iconBgColor?: string;
|
|
17
|
+
labelPosition?: "before" | "after";
|
|
18
|
+
newWindow?: boolean;
|
|
19
|
+
margin?: Space | Margin;
|
|
20
|
+
size?: Size;
|
|
21
|
+
tabIndex?: number;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default function DxcTag(props: Props): JSX.Element;
|