@dxc-technology/halstack-react 0.0.0-b821bfb → 0.0.0-b903d8a

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.
Files changed (126) hide show
  1. package/README.md +46 -0
  2. package/dist/index.d.mts +6516 -0
  3. package/dist/index.d.ts +6516 -0
  4. package/dist/index.js +12982 -0
  5. package/dist/index.mjs +12925 -0
  6. package/package.json +82 -72
  7. package/BackgroundColorContext.js +0 -46
  8. package/ThemeContext.js +0 -250
  9. package/V3Select/V3Select.js +0 -549
  10. package/V3Select/index.d.ts +0 -27
  11. package/V3Textarea/V3Textarea.js +0 -264
  12. package/V3Textarea/index.d.ts +0 -27
  13. package/accordion/Accordion.js +0 -353
  14. package/accordion/index.d.ts +0 -28
  15. package/accordion-group/AccordionGroup.js +0 -186
  16. package/accordion-group/index.d.ts +0 -16
  17. package/alert/Alert.js +0 -403
  18. package/alert/index.d.ts +0 -51
  19. package/badge/Badge.js +0 -63
  20. package/box/Box.js +0 -156
  21. package/box/index.d.ts +0 -25
  22. package/button/Button.js +0 -238
  23. package/button/Button.stories.js +0 -27
  24. package/button/index.d.ts +0 -24
  25. package/card/Card.js +0 -254
  26. package/card/index.d.ts +0 -22
  27. package/checkbox/Checkbox.js +0 -299
  28. package/checkbox/index.d.ts +0 -24
  29. package/chip/Chip.js +0 -265
  30. package/chip/index.d.ts +0 -22
  31. package/common/OpenSans.css +0 -81
  32. package/common/RequiredComponent.js +0 -40
  33. package/common/fonts/OpenSans-Bold.ttf +0 -0
  34. package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
  35. package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
  36. package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  37. package/common/fonts/OpenSans-Italic.ttf +0 -0
  38. package/common/fonts/OpenSans-Light.ttf +0 -0
  39. package/common/fonts/OpenSans-LightItalic.ttf +0 -0
  40. package/common/fonts/OpenSans-Regular.ttf +0 -0
  41. package/common/fonts/OpenSans-SemiBold.ttf +0 -0
  42. package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  43. package/common/utils.js +0 -22
  44. package/common/variables.js +0 -1567
  45. package/date/Date.js +0 -379
  46. package/date/index.d.ts +0 -27
  47. package/date-input/DateInput.js +0 -400
  48. package/date-input/index.d.ts +0 -95
  49. package/dialog/Dialog.js +0 -218
  50. package/dialog/index.d.ts +0 -18
  51. package/dropdown/Dropdown.js +0 -544
  52. package/dropdown/index.d.ts +0 -26
  53. package/file-input/FileInput.js +0 -644
  54. package/file-input/FileItem.js +0 -287
  55. package/file-input/index.d.ts +0 -81
  56. package/footer/Footer.js +0 -421
  57. package/footer/Icons.js +0 -77
  58. package/footer/index.d.ts +0 -25
  59. package/header/Header.js +0 -470
  60. package/header/Icons.js +0 -59
  61. package/header/index.d.ts +0 -25
  62. package/heading/Heading.js +0 -230
  63. package/heading/index.d.ts +0 -17
  64. package/input-text/Icons.js +0 -22
  65. package/input-text/InputText.js +0 -705
  66. package/input-text/index.d.ts +0 -36
  67. package/layout/ApplicationLayout.js +0 -327
  68. package/layout/Icons.js +0 -55
  69. package/link/Link.js +0 -237
  70. package/link/index.d.ts +0 -23
  71. package/main.d.ts +0 -40
  72. package/main.js +0 -359
  73. package/number-input/NumberInput.js +0 -136
  74. package/number-input/NumberInputContext.js +0 -16
  75. package/number-input/index.d.ts +0 -113
  76. package/paginator/Icons.js +0 -66
  77. package/paginator/Paginator.js +0 -305
  78. package/paginator/index.d.ts +0 -20
  79. package/password-input/PasswordInput.js +0 -203
  80. package/password-input/index.d.ts +0 -94
  81. package/progress-bar/ProgressBar.js +0 -242
  82. package/progress-bar/index.d.ts +0 -18
  83. package/radio/Radio.js +0 -209
  84. package/radio/index.d.ts +0 -23
  85. package/resultsetTable/ResultsetTable.js +0 -358
  86. package/resultsetTable/index.d.ts +0 -19
  87. package/select/Select.js +0 -1138
  88. package/select/index.d.ts +0 -131
  89. package/sidenav/Sidenav.js +0 -179
  90. package/sidenav/index.d.ts +0 -13
  91. package/slider/Slider.js +0 -404
  92. package/slider/index.d.ts +0 -29
  93. package/spinner/Spinner.js +0 -381
  94. package/spinner/index.d.ts +0 -17
  95. package/switch/Switch.js +0 -222
  96. package/switch/index.d.ts +0 -24
  97. package/table/Table.js +0 -132
  98. package/table/index.d.ts +0 -13
  99. package/tabs/Tabs.js +0 -343
  100. package/tabs/index.d.ts +0 -19
  101. package/tag/Tag.js +0 -282
  102. package/tag/index.d.ts +0 -24
  103. package/text-input/TextInput.js +0 -992
  104. package/text-input/index.d.ts +0 -135
  105. package/textarea/Textarea.js +0 -369
  106. package/textarea/index.d.ts +0 -117
  107. package/toggle/Toggle.js +0 -220
  108. package/toggle/index.d.ts +0 -21
  109. package/toggle-group/ToggleGroup.js +0 -327
  110. package/toggle-group/index.d.ts +0 -21
  111. package/upload/Upload.js +0 -205
  112. package/upload/buttons-upload/ButtonsUpload.js +0 -135
  113. package/upload/buttons-upload/Icons.js +0 -40
  114. package/upload/dragAndDropArea/DragAndDropArea.js +0 -329
  115. package/upload/dragAndDropArea/Icons.js +0 -39
  116. package/upload/file-upload/FileToUpload.js +0 -189
  117. package/upload/file-upload/Icons.js +0 -66
  118. package/upload/files-upload/FilesToUpload.js +0 -123
  119. package/upload/index.d.ts +0 -15
  120. package/upload/transaction/Icons.js +0 -160
  121. package/upload/transaction/Transaction.js +0 -148
  122. package/upload/transactions/Transactions.js +0 -138
  123. package/useTheme.js +0 -22
  124. package/wizard/Icons.js +0 -65
  125. package/wizard/Wizard.js +0 -405
  126. package/wizard/index.d.ts +0 -18
package/table/Table.js DELETED
@@ -1,132 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = void 0;
11
-
12
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
-
14
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
-
16
- var _react = _interopRequireDefault(require("react"));
17
-
18
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
19
-
20
- var _variables = require("../common/variables.js");
21
-
22
- var _utils = require("../common/utils.js");
23
-
24
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
25
-
26
- var _BackgroundColorContext = require("../BackgroundColorContext.js");
27
-
28
- function _templateObject2() {
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
-
31
- _templateObject2 = function _templateObject2() {
32
- return data;
33
- };
34
-
35
- return data;
36
- }
37
-
38
- function _templateObject() {
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
-
41
- _templateObject = function _templateObject() {
42
- return data;
43
- };
44
-
45
- return data;
46
- }
47
-
48
- var DxcTable = function DxcTable(_ref) {
49
- var children = _ref.children,
50
- margin = _ref.margin;
51
- var colorsTheme = (0, _useTheme["default"])();
52
- return _react["default"].createElement(_styledComponents.ThemeProvider, {
53
- theme: colorsTheme.table
54
- }, _react["default"].createElement(DxcTableContainer, {
55
- margin: margin
56
- }, _react["default"].createElement(DxcTableContent, null, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
57
- color: colorsTheme.table.dataBackgroundColor
58
- }, children))));
59
- };
60
-
61
- var calculateWidth = function calculateWidth(margin) {
62
- return "calc(100% - ".concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
63
- };
64
-
65
- var DxcTableContainer = _styledComponents["default"].div(_templateObject(), function (props) {
66
- return calculateWidth(props.margin);
67
- }, function (props) {
68
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
69
- }, function (props) {
70
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
71
- }, function (props) {
72
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
73
- }, function (props) {
74
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
75
- }, function (props) {
76
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
77
- }, function (props) {
78
- return props.theme.scrollBarThumbColor;
79
- }, function (props) {
80
- return props.theme.scrollBarTrackColor;
81
- });
82
-
83
- var DxcTableContent = _styledComponents["default"].table(_templateObject2(), function (props) {
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;
99
- }, function (props) {
100
- return props.theme.dataTextAlign;
101
- }, function (props) {
102
- return props.theme.dataTextLineHeight;
103
- }, function (props) {
104
- return "".concat(props.theme.dataPaddingTop, " ").concat(props.theme.dataPaddingRight, " ").concat(props.theme.dataPaddingBottom, " ").concat(props.theme.dataPaddingLeft);
105
- }, function (props) {
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;
115
- }, function (props) {
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;
129
- });
130
-
131
- var _default = DxcTable;
132
- exports["default"] = _default;
package/table/index.d.ts DELETED
@@ -1,13 +0,0 @@
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/tabs/Tabs.js DELETED
@@ -1,343 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = void 0;
11
-
12
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
-
14
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
-
16
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
17
-
18
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
19
-
20
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
21
-
22
- var _react = _interopRequireDefault(require("react"));
23
-
24
- var _Tabs = _interopRequireDefault(require("@material-ui/core/Tabs"));
25
-
26
- var _Tab = _interopRequireDefault(require("@material-ui/core/Tab"));
27
-
28
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
29
-
30
- var _propTypes = _interopRequireDefault(require("prop-types"));
31
-
32
- var _variables = require("../common/variables.js");
33
-
34
- var _Badge = _interopRequireDefault(require("../badge/Badge"));
35
-
36
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
37
-
38
- function _templateObject9() {
39
- var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 22px;\n max-width: 22px;\n margin-bottom: ", ";\n margin-right: ", ";\n overflow: hidden;\n display: flex;\n align-items: center;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
40
-
41
- _templateObject9 = function _templateObject9() {
42
- return data;
43
- };
44
-
45
- return data;
46
- }
47
-
48
- function _templateObject8() {
49
- var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 22px;\n max-width: 22px;\n"]);
50
-
51
- _templateObject8 = function _templateObject8() {
52
- return data;
53
- };
54
-
55
- return data;
56
- }
57
-
58
- function _templateObject7() {
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"]);
60
-
61
- _templateObject7 = function _templateObject7() {
62
- return data;
63
- };
64
-
65
- return data;
66
- }
67
-
68
- function _templateObject6() {
69
- var data = (0, _taggedTemplateLiteral2["default"])(["\n left: 0px;\n bottom: 0;\n width: 100%;\n height: ", ";\n position: absolute;\n background-color: ", ";\n"]);
70
-
71
- _templateObject6 = function _templateObject6() {
72
- return data;
73
- };
74
-
75
- return data;
76
- }
77
-
78
- function _templateObject5() {
79
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n margin-left: ", ";\n margin-right: ", ";\n"]);
80
-
81
- _templateObject5 = function _templateObject5() {
82
- return data;
83
- };
84
-
85
- return data;
86
- }
87
-
88
- function _templateObject4() {
89
- var data = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n right: 0;\n top: ", ";\n width: 23px;\n height: 17px;\n"]);
90
-
91
- _templateObject4 = function _templateObject4() {
92
- return data;
93
- };
94
-
95
- return data;
96
- }
97
-
98
- function _templateObject3() {
99
- var data = (0, _taggedTemplateLiteral2["default"])([""]);
100
-
101
- _templateObject3 = function _templateObject3() {
102
- return data;
103
- };
104
-
105
- return data;
106
- }
107
-
108
- function _templateObject2() {
109
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n align-items: center;\n"]);
110
-
111
- _templateObject2 = function _templateObject2() {
112
- return data;
113
- };
114
-
115
- return data;
116
- }
117
-
118
- function _templateObject() {
119
- var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n"]);
120
-
121
- _templateObject = function _templateObject() {
122
- return data;
123
- };
124
-
125
- return data;
126
- }
127
-
128
- var DxcTabs = function DxcTabs(_ref) {
129
- var activeTabIndex = _ref.activeTabIndex,
130
- _ref$tabs = _ref.tabs,
131
- tabs = _ref$tabs === void 0 ? [] : _ref$tabs,
132
- onTabClick = _ref.onTabClick,
133
- onTabHover = _ref.onTabHover,
134
- margin = _ref.margin,
135
- _ref$iconPosition = _ref.iconPosition,
136
- iconPosition = _ref$iconPosition === void 0 ? "left" : _ref$iconPosition,
137
- _ref$tabIndex = _ref.tabIndex,
138
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
139
-
140
- var _React$useState = _react["default"].useState(0),
141
- _React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
142
- innerActiveTabIndex = _React$useState2[0],
143
- setInnerActiveTabIndex = _React$useState2[1];
144
-
145
- var colorsTheme = (0, _useTheme["default"])();
146
- var hasLabelAndIcon = tabs && tabs.filter(function (tab) {
147
- return tab.label && tab.icon;
148
- }).length > 0;
149
-
150
- var handleChange = function handleChange(event, newValue) {
151
- if (activeTabIndex == null) {
152
- setInnerActiveTabIndex(newValue);
153
- }
154
-
155
- if (typeof onTabClick === "function") {
156
- onTabClick(newValue);
157
- }
158
- };
159
-
160
- var getTabIndex = function getTabIndex(index, disabled) {
161
- return (activeTabIndex === index || innerActiveTabIndex === index) && !disabled ? tabIndex : -1;
162
- };
163
-
164
- var getLabelForTab = function getLabelForTab(tab) {
165
- return _react["default"].createElement(ParentLabelSpan, null, _react["default"].createElement(MainLabelContainer, {
166
- hasBadge: tab.notificationNumber
167
- }, _react["default"].createElement(TabLabelContainer, {
168
- hasLabelAndIcon: hasLabelAndIcon,
169
- iconPosition: iconPosition
170
- }, tab.icon ? _react["default"].createElement(TabIconContainer, {
171
- hasLabelAndIcon: hasLabelAndIcon,
172
- iconPosition: iconPosition
173
- }, (0, _typeof2["default"])(tab.icon) === "object" ? tab.icon : _react["default"].createElement(tab.icon)) : tab.iconSrc && _react["default"].createElement(TabIcon, {
174
- src: tab.iconSrc
175
- }), _react["default"].createElement(LabelTextContainer, null, tab.label))), tab.notificationNumber && tab.notificationNumber !== false && _react["default"].createElement(BadgeContainer, {
176
- hasLabelAndIcon: hasLabelAndIcon,
177
- iconPosition: iconPosition
178
- }, _react["default"].createElement(_Badge["default"], {
179
- notificationText: tab.notificationNumber > 99 ? "+99" : tab.notificationNumber
180
- })));
181
- };
182
-
183
- return _react["default"].createElement(_styledComponents.ThemeProvider, {
184
- theme: colorsTheme.tabs
185
- }, _react["default"].createElement(DxCTabs, {
186
- margin: margin,
187
- hasLabelAndIcon: hasLabelAndIcon,
188
- iconPosition: iconPosition
189
- }, _react["default"].createElement(Underline, null), _react["default"].createElement(_Tabs["default"], {
190
- value: activeTabIndex != null ? activeTabIndex : innerActiveTabIndex,
191
- onChange: handleChange,
192
- variant: "scrollable",
193
- scrollButtons: "auto"
194
- }, tabs.map(function (tab, i) {
195
- var tabContent = _react["default"].forwardRef(function (props, ref) {
196
- return _react["default"].createElement("div", (0, _extends2["default"])({
197
- role: "button"
198
- }, props, {
199
- ref: ref
200
- }));
201
- });
202
-
203
- return _react["default"].createElement(_Tab["default"], {
204
- tabIndex: (activeTabIndex === i || innerActiveTabIndex === i) && !tab.isDisabled ? tabIndex : -1,
205
- key: "tab".concat(i).concat(tab.label),
206
- label: getLabelForTab(tab),
207
- disabled: tab.isDisabled,
208
- disableRipple: true,
209
- onMouseEnter: function onMouseEnter() {
210
- onTabHover(i);
211
- },
212
- onMouseLeave: function onMouseLeave() {
213
- onTabHover(null);
214
- }
215
- });
216
- }))));
217
- };
218
-
219
- var ParentLabelSpan = _styledComponents["default"].div(_templateObject());
220
-
221
- var TabLabelContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
222
- return props.hasLabelAndIcon && props.iconPosition === "top" && "column" || "row";
223
- });
224
-
225
- var LabelTextContainer = _styledComponents["default"].div(_templateObject3());
226
-
227
- var BadgeContainer = _styledComponents["default"].div(_templateObject4(), function (props) {
228
- return props.hasLabelAndIcon && props.iconPosition === "top" && "0" || "5px";
229
- });
230
-
231
- var MainLabelContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
232
- return props.hasBadge && "35px" || "unset";
233
- }, function (props) {
234
- return props.hasBadge && "35px" || "unset";
235
- });
236
-
237
- var Underline = _styledComponents["default"].div(_templateObject6(), function (props) {
238
- return props.theme.dividerThickness;
239
- }, function (props) {
240
- return props.theme.dividerColor;
241
- });
242
-
243
- var DxCTabs = _styledComponents["default"].div(_templateObject7(), function (props) {
244
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
245
- }, function (props) {
246
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
247
- }, function (props) {
248
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
249
- }, function (props) {
250
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
251
- }, function (props) {
252
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
253
- }, function (props) {
254
- return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
255
- }, function (props) {
256
- return props.theme.fontTextTransform;
257
- }, function (props) {
258
- return props.theme.fontFamily;
259
- }, function (props) {
260
- return props.theme.fontSize;
261
- }, function (props) {
262
- return props.theme.fontStyle;
263
- }, function (props) {
264
- return props.theme.fontWeight;
265
- }, function (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
- }, function (props) {
270
- return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
271
- }, function (props) {
272
- return "".concat(props.theme.hoverBackgroundColor, " !important");
273
- }, function (props) {
274
- return "".concat(props.theme.pressedBackgroundColor, " !important");
275
- }, function (props) {
276
- return "".concat(props.theme.pressedFontWeight, " !important");
277
- }, function (props) {
278
- return props.theme.unselectedBackgroundColor;
279
- }, function (props) {
280
- return props.theme.unselectedFontColor;
281
- }, function (props) {
282
- return props.theme.unselectedIconColor;
283
- }, function (props) {
284
- return props.theme.selectedBackgroundColor;
285
- }, function (props) {
286
- return props.theme.selectedFontColor;
287
- }, function (props) {
288
- return props.theme.selectedIconColor;
289
- }, function (props) {
290
- return props.theme.disabledFontColor;
291
- }, function (props) {
292
- return props.theme.disabledFontStyle;
293
- }, function (props) {
294
- return props.theme.disabledIconColor;
295
- }, function (props) {
296
- return props.theme.focusOutline;
297
- }, function (props) {
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;
305
- });
306
-
307
- var TabIcon = _styledComponents["default"].img(_templateObject8());
308
-
309
- var TabIconContainer = _styledComponents["default"].div(_templateObject9(), function (props) {
310
- return props.hasLabelAndIcon && props.iconPosition === "top" && "8px" || "";
311
- }, function (props) {
312
- return props.hasLabelAndIcon && props.iconPosition === "left" && "12px" || "";
313
- });
314
-
315
- DxcTabs.propTypes = {
316
- activeTabIndex: _propTypes["default"].number,
317
- onTabClick: _propTypes["default"].func,
318
- onTabHover: _propTypes["default"].func,
319
- tabs: _propTypes["default"].arrayOf(_propTypes["default"].shape({
320
- label: _propTypes["default"].string,
321
- icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
322
- iconSrc: _propTypes["default"].string,
323
- isDisabled: _propTypes["default"].bool,
324
- notificationNumber: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].string, _propTypes["default"].number])
325
- })),
326
- margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
327
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
328
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
329
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
330
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
331
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
332
- iconPosition: _propTypes["default"].oneOf(["top", "left"]),
333
- tabIndex: _propTypes["default"].number
334
- };
335
- DxcTabs.defaultProps = {
336
- activeTabIndex: null,
337
- tabs: [],
338
- onTabClick: function onTabClick() {},
339
- onTabHover: function onTabHover() {},
340
- iconPosition: "top"
341
- };
342
- var _default = DxcTabs;
343
- exports["default"] = _default;
package/tabs/index.d.ts DELETED
@@ -1,19 +0,0 @@
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;