@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.
Files changed (228) hide show
  1. package/README.md +1 -1
  2. package/dist/BackgroundColorContext.js +46 -0
  3. package/dist/ThemeContext.js +171 -106
  4. package/dist/V3Select/V3Select.js +549 -0
  5. package/dist/V3Select/index.d.ts +27 -0
  6. package/dist/V3Textarea/V3Textarea.js +264 -0
  7. package/dist/V3Textarea/index.d.ts +27 -0
  8. package/dist/accordion/Accordion.js +119 -52
  9. package/dist/accordion/index.d.ts +28 -0
  10. package/dist/accordion-group/AccordionGroup.js +34 -4
  11. package/dist/accordion-group/index.d.ts +16 -0
  12. package/dist/alert/Alert.js +170 -83
  13. package/dist/alert/index.d.ts +51 -0
  14. package/dist/badge/Badge.js +28 -7
  15. package/dist/box/Box.js +27 -20
  16. package/dist/box/index.d.ts +25 -0
  17. package/dist/button/Button.js +42 -25
  18. package/dist/button/index.d.ts +24 -0
  19. package/dist/card/Card.js +16 -9
  20. package/dist/card/index.d.ts +22 -0
  21. package/dist/checkbox/Checkbox.js +89 -25
  22. package/dist/checkbox/index.d.ts +24 -0
  23. package/dist/chip/Chip.js +63 -23
  24. package/dist/chip/index.d.ts +22 -0
  25. package/dist/common/utils.js +2 -22
  26. package/dist/common/variables.js +1351 -299
  27. package/dist/date/Date.js +60 -40
  28. package/dist/date/index.d.ts +27 -0
  29. package/dist/date-input/DateInput.js +400 -0
  30. package/dist/date-input/index.d.ts +95 -0
  31. package/dist/dialog/Dialog.js +44 -31
  32. package/dist/dialog/index.d.ts +18 -0
  33. package/dist/dropdown/Dropdown.js +162 -76
  34. package/dist/dropdown/index.d.ts +26 -0
  35. package/dist/file-input/FileInput.js +644 -0
  36. package/dist/file-input/FileItem.js +287 -0
  37. package/dist/file-input/index.d.ts +81 -0
  38. package/dist/footer/Footer.js +79 -39
  39. package/dist/footer/Icons.js +77 -0
  40. package/dist/footer/index.d.ts +25 -0
  41. package/dist/header/Header.js +158 -73
  42. package/dist/header/Icons.js +59 -0
  43. package/dist/header/index.d.ts +25 -0
  44. package/dist/heading/Heading.js +103 -38
  45. package/dist/heading/index.d.ts +17 -0
  46. package/dist/input-text/Icons.js +22 -0
  47. package/dist/input-text/InputText.js +181 -75
  48. package/dist/input-text/index.d.ts +36 -0
  49. package/dist/layout/ApplicationLayout.js +14 -18
  50. package/dist/layout/Icons.js +55 -0
  51. package/dist/link/Link.js +77 -41
  52. package/dist/link/index.d.ts +23 -0
  53. package/dist/main.d.ts +40 -0
  54. package/dist/main.js +72 -16
  55. package/dist/number-input/NumberInput.js +136 -0
  56. package/dist/number-input/NumberInputContext.js +16 -0
  57. package/dist/number-input/index.d.ts +113 -0
  58. package/dist/paginator/Icons.js +66 -0
  59. package/dist/paginator/Paginator.js +85 -43
  60. package/dist/paginator/index.d.ts +20 -0
  61. package/dist/password-input/PasswordInput.js +203 -0
  62. package/dist/password-input/index.d.ts +94 -0
  63. package/dist/progress-bar/ProgressBar.js +88 -40
  64. package/dist/progress-bar/index.d.ts +18 -0
  65. package/dist/radio/Radio.js +28 -11
  66. package/dist/radio/index.d.ts +23 -0
  67. package/dist/resultsetTable/ResultsetTable.js +65 -40
  68. package/dist/resultsetTable/index.d.ts +19 -0
  69. package/dist/select/Select.js +887 -283
  70. package/dist/select/index.d.ts +53 -0
  71. package/dist/sidenav/Sidenav.js +47 -25
  72. package/dist/sidenav/index.d.ts +13 -0
  73. package/dist/slider/Slider.js +204 -69
  74. package/dist/slider/index.d.ts +29 -0
  75. package/dist/spinner/Spinner.js +244 -63
  76. package/dist/spinner/index.d.ts +17 -0
  77. package/dist/switch/Switch.js +42 -16
  78. package/dist/switch/index.d.ts +24 -0
  79. package/dist/table/Table.js +45 -13
  80. package/dist/table/index.d.ts +13 -0
  81. package/dist/tabs/Tabs.js +37 -21
  82. package/dist/tabs/index.d.ts +19 -0
  83. package/dist/tag/Tag.js +50 -36
  84. package/dist/tag/index.d.ts +24 -0
  85. package/dist/text-input/TextInput.js +974 -0
  86. package/dist/text-input/index.d.ts +135 -0
  87. package/dist/textarea/Textarea.js +238 -109
  88. package/dist/textarea/index.d.ts +117 -0
  89. package/dist/toggle/Toggle.js +0 -2
  90. package/dist/toggle/index.d.ts +21 -0
  91. package/dist/toggle-group/ToggleGroup.js +139 -37
  92. package/dist/toggle-group/index.d.ts +21 -0
  93. package/dist/upload/Upload.js +1 -7
  94. package/dist/upload/buttons-upload/ButtonsUpload.js +28 -18
  95. package/dist/upload/buttons-upload/Icons.js +40 -0
  96. package/dist/upload/dragAndDropArea/DragAndDropArea.js +61 -27
  97. package/dist/upload/dragAndDropArea/Icons.js +39 -0
  98. package/dist/upload/file-upload/FileToUpload.js +52 -27
  99. package/dist/upload/file-upload/Icons.js +66 -0
  100. package/dist/upload/files-upload/FilesToUpload.js +3 -5
  101. package/dist/upload/index.d.ts +15 -0
  102. package/dist/upload/transaction/Icons.js +160 -0
  103. package/dist/upload/transaction/Transaction.js +37 -43
  104. package/dist/upload/transactions/Transactions.js +24 -10
  105. package/dist/wizard/Icons.js +65 -0
  106. package/dist/wizard/Wizard.js +106 -58
  107. package/dist/wizard/index.d.ts +18 -0
  108. package/package.json +11 -13
  109. package/test/AccordionGroup.test.js +16 -0
  110. package/test/Date.test.js +15 -13
  111. package/test/DateInput.test.js +242 -0
  112. package/test/Dropdown.test.js +15 -0
  113. package/test/FileInput.test.js +201 -0
  114. package/test/Footer.test.js +2 -7
  115. package/test/Header.test.js +5 -10
  116. package/test/Heading.test.js +60 -12
  117. package/test/Link.test.js +3 -2
  118. package/test/NumberInput.test.js +259 -0
  119. package/test/Paginator.test.js +6 -2
  120. package/test/PasswordInput.test.js +83 -0
  121. package/test/ResultsetTable.test.js +6 -6
  122. package/test/Select.test.js +371 -148
  123. package/test/Slider.test.js +9 -17
  124. package/test/Spinner.test.js +5 -0
  125. package/test/TextInput.test.js +732 -0
  126. package/test/Textarea.test.js +193 -0
  127. package/test/ToggleGroup.test.js +5 -1
  128. package/test/Upload.test.js +1 -1
  129. package/test/V3Select.test.js +212 -0
  130. package/test/{TextArea.test.js → V3TextArea.test.js} +6 -7
  131. package/dist/accordion/Accordion.stories.js +0 -207
  132. package/dist/accordion/readme.md +0 -96
  133. package/dist/accordion-group/AccordionGroup.stories.js +0 -207
  134. package/dist/accordion-group/readme.md +0 -70
  135. package/dist/alert/Alert.stories.js +0 -158
  136. package/dist/alert/close.svg +0 -4
  137. package/dist/alert/error.svg +0 -4
  138. package/dist/alert/info.svg +0 -4
  139. package/dist/alert/readme.md +0 -43
  140. package/dist/alert/success.svg +0 -4
  141. package/dist/alert/warning.svg +0 -4
  142. package/dist/button/Button.stories.js +0 -224
  143. package/dist/button/readme.md +0 -93
  144. package/dist/checkbox/Checkbox.stories.js +0 -144
  145. package/dist/checkbox/readme.md +0 -116
  146. package/dist/common/services/example-service.js +0 -10
  147. package/dist/common/services/example-service.test.js +0 -12
  148. package/dist/date/Date.stories.js +0 -205
  149. package/dist/date/calendar.svg +0 -1
  150. package/dist/date/calendar_dark.svg +0 -1
  151. package/dist/date/readme.md +0 -73
  152. package/dist/dialog/Dialog.stories.js +0 -217
  153. package/dist/dialog/readme.md +0 -32
  154. package/dist/dropdown/Dropdown.stories.js +0 -249
  155. package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
  156. package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
  157. package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
  158. package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
  159. package/dist/dropdown/readme.md +0 -69
  160. package/dist/footer/Footer.stories.js +0 -94
  161. package/dist/footer/dxc_logo_wht.png +0 -0
  162. package/dist/footer/readme.md +0 -41
  163. package/dist/header/Header.stories.js +0 -176
  164. package/dist/header/close_icon.svg +0 -1
  165. package/dist/header/dxc_logo_black.png +0 -0
  166. package/dist/header/dxc_logo_blk_rgb.svg +0 -6
  167. package/dist/header/dxc_logo_white.png +0 -0
  168. package/dist/header/hamb_menu_black.svg +0 -1
  169. package/dist/header/hamb_menu_white.svg +0 -1
  170. package/dist/header/readme.md +0 -33
  171. package/dist/input-text/InputText.stories.js +0 -209
  172. package/dist/input-text/error.svg +0 -1
  173. package/dist/input-text/readme.md +0 -91
  174. package/dist/layout/facebook.svg +0 -45
  175. package/dist/layout/linkedin.svg +0 -50
  176. package/dist/layout/twitter.svg +0 -53
  177. package/dist/link/readme.md +0 -51
  178. package/dist/paginator/images/next.svg +0 -3
  179. package/dist/paginator/images/nextPage.svg +0 -3
  180. package/dist/paginator/images/previous.svg +0 -3
  181. package/dist/paginator/images/previousPage.svg +0 -3
  182. package/dist/paginator/readme.md +0 -50
  183. package/dist/progress-bar/ProgressBar.stories.js +0 -280
  184. package/dist/progress-bar/readme.md +0 -63
  185. package/dist/radio/Radio.stories.js +0 -166
  186. package/dist/radio/readme.md +0 -70
  187. package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
  188. package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
  189. package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
  190. package/dist/select/Select.stories.js +0 -235
  191. package/dist/select/readme.md +0 -72
  192. package/dist/slider/Slider.stories.js +0 -241
  193. package/dist/slider/readme.md +0 -64
  194. package/dist/spinner/Spinner.stories.js +0 -183
  195. package/dist/spinner/readme.md +0 -65
  196. package/dist/switch/Switch.stories.js +0 -134
  197. package/dist/switch/readme.md +0 -133
  198. package/dist/tabs/Tabs.stories.js +0 -130
  199. package/dist/tabs/readme.md +0 -78
  200. package/dist/tabs-for-sections/TabsForSections.js +0 -92
  201. package/dist/tabs-for-sections/readme.md +0 -78
  202. package/dist/toggle/Toggle.stories.js +0 -297
  203. package/dist/toggle/readme.md +0 -80
  204. package/dist/toggle-group/readme.md +0 -82
  205. package/dist/upload/Upload.stories.js +0 -72
  206. package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
  207. package/dist/upload/buttons-upload/upload-button.svg +0 -1
  208. package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
  209. package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
  210. package/dist/upload/file-upload/audio-icon.svg +0 -4
  211. package/dist/upload/file-upload/close.svg +0 -4
  212. package/dist/upload/file-upload/file-icon.svg +0 -4
  213. package/dist/upload/file-upload/video-icon.svg +0 -4
  214. package/dist/upload/readme.md +0 -37
  215. package/dist/upload/transaction/audio-icon-err.svg +0 -4
  216. package/dist/upload/transaction/audio-icon.svg +0 -4
  217. package/dist/upload/transaction/error-icon.svg +0 -4
  218. package/dist/upload/transaction/file-icon-err.svg +0 -4
  219. package/dist/upload/transaction/file-icon.svg +0 -4
  220. package/dist/upload/transaction/image-icon-err.svg +0 -4
  221. package/dist/upload/transaction/image-icon.svg +0 -4
  222. package/dist/upload/transaction/success-icon.svg +0 -4
  223. package/dist/upload/transaction/video-icon-err.svg +0 -4
  224. package/dist/upload/transaction/video-icon.svg +0 -4
  225. package/dist/wizard/invalid_icon.svg +0 -6
  226. package/dist/wizard/valid_icon.svg +0 -6
  227. package/dist/wizard/validation-wrong.svg +0 -6
  228. package/test/TabsForSections.test.js +0 -34
@@ -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: 1px solid ", ";\n }\n\n & td {\n color: ", ";\n min-height: 48px;\n }\n\n & th {\n padding: 16px 20px 16px 40px;\n min-height: 60px;\n }\n\n & td {\n padding: 14px 20px 12px 40px;\n }\n\n & th {\n text-align: left;\n font-size: ", ";\n font-weight: ", ";\n background-color: ", ";\n color: ", ";\n }\n\n & th:first-child {\n border-top-left-radius: 4px;\n }\n\n & th:last-child {\n border-top-right-radius: 4px;\n }\n"]);
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 font-size: ", ";\n \n overflow-x: auto;\n width: ", ";\n font-family: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n &::-webkit-scrollbar {\n height: 6px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 6px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 6px;\n }\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, children)));
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.separatorColor;
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.bodyFontColor;
100
+ return props.theme.dataTextAlign;
89
101
  }, function (props) {
90
- return props.theme.fontSize;
102
+ return props.theme.dataTextLineHeight;
91
103
  }, function (props) {
92
- return props.theme.fontWeight;
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 font-size: ", ";\n\n position: relative;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n .MuiTabs-root {\n background: white;\n .MuiTabs-scroller {\n .MuiTabs-flexContainer + span {\n z-index: 4;\n }\n }\n .MuiTab-root {\n text-transform: none !important;\n }\n .MuiButtonBase-root {\n padding: ", ";\n height: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n min-width: 90px;\n max-width: 360px;\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:not(.Mui-selected) {\n background-color: ", ";\n color: ", ";\n }\n &.Mui-selected {\n background-color: ", ";\n color: ", ";\n }\n &.Mui-disabled {\n cursor: not-allowed !important;\n pointer-events: all;\n color: ", ";\n }\n &:focus {\n outline: ", " auto 1px;\n }\n }\n\n .MuiTabs-indicator {\n background-color: ", ";\n }\n\n .MuiTabs-scrollButtons {\n min-width: 48px;\n width: 48px;\n padding: 0;\n }\n\n @media (max-width: 599.95px) {\n .MuiTabs-scrollButtonsDesktop {\n display: flex;\n }\n }\n }\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: 1px;\n position: absolute;\n background-color: ", ";\n"]);
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
- if ((activeTabIndex === index || innerActiveTabIndex === index) && !disabled) {
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.divider;
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.theme.fontSize;
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.theme.fontColor;
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.backgroundColor;
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.fontColor;
282
+ return props.theme.unselectedIconColor;
279
283
  }, function (props) {
280
- return props.theme.backgroundColor;
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"]["boolean"],
308
- notificationNumber: _propTypes["default"].oneOfType([_propTypes["default"]["boolean"], _propTypes["default"].string])
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 padding: 0px 30px;\n font-size: ", ";\n text-transform: ", ";\n letter-spacing: ", ";\n color: black;\n flex-grow: 1;\n text-align: center;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\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: 48px;\n justify-content: center;\n"]);
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 height: 43px;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n img,\n svg {\n height: 23px;\n }\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 padding: 10px 12px;\n height: 23px;\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 outline: 0;\n font-family: inherit;\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 font-size: ", ";\n\n display: inline-flex;\n cursor: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\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 ? "black" : _ref$iconBgColor,
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 ? 1 : _ref$tabIndex;
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
- if (onClick) {
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(StyledDxcTag, {
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 (props) {
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.textDecoration;
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.fontTextTransform;
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.fontLetterSpacingWide01;
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;