@dxc-technology/halstack-react 0.0.0-c709eea → 0.0.0-c713b1b

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 (313) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +1 -4
  3. package/HalstackContext.d.ts +10 -0
  4. package/{ThemeContext.js → HalstackContext.js} +31 -34
  5. package/accordion/Accordion.d.ts +1 -1
  6. package/accordion/Accordion.js +15 -47
  7. package/accordion/Accordion.stories.tsx +307 -0
  8. package/accordion/Accordion.test.js +72 -0
  9. package/accordion/types.d.ts +8 -8
  10. package/accordion-group/AccordionGroup.d.ts +1 -1
  11. package/accordion-group/AccordionGroup.js +15 -17
  12. package/accordion-group/AccordionGroup.stories.tsx +225 -0
  13. package/accordion-group/AccordionGroup.test.js +151 -0
  14. package/accordion-group/types.d.ts +8 -8
  15. package/alert/Alert.js +2 -2
  16. package/alert/Alert.stories.tsx +170 -0
  17. package/alert/Alert.test.js +92 -0
  18. package/alert/types.d.ts +1 -1
  19. package/badge/Badge.d.ts +4 -0
  20. package/badge/Badge.js +1 -1
  21. package/badge/types.d.ts +4 -0
  22. package/badge/types.js +5 -0
  23. package/bleed/Bleed.d.ts +3 -0
  24. package/bleed/Bleed.js +84 -0
  25. package/bleed/Bleed.stories.tsx +342 -0
  26. package/bleed/types.d.ts +37 -0
  27. package/bleed/types.js +5 -0
  28. package/box/Box.d.ts +4 -0
  29. package/box/Box.js +6 -32
  30. package/box/Box.stories.tsx +132 -0
  31. package/box/Box.test.js +18 -0
  32. package/box/types.d.ts +43 -0
  33. package/box/types.js +5 -0
  34. package/button/Button.d.ts +1 -1
  35. package/button/Button.js +24 -32
  36. package/button/Button.stories.tsx +223 -242
  37. package/button/Button.test.js +35 -0
  38. package/button/types.d.ts +9 -13
  39. package/card/Card.js +32 -34
  40. package/card/Card.stories.tsx +201 -0
  41. package/card/Card.test.js +50 -0
  42. package/card/ice-cream.jpg +0 -0
  43. package/card/types.d.ts +4 -6
  44. package/checkbox/Checkbox.d.ts +1 -1
  45. package/checkbox/Checkbox.js +42 -41
  46. package/checkbox/Checkbox.stories.tsx +188 -0
  47. package/checkbox/Checkbox.test.js +78 -0
  48. package/checkbox/types.d.ts +9 -5
  49. package/chip/Chip.d.ts +4 -0
  50. package/chip/Chip.js +16 -76
  51. package/chip/Chip.stories.tsx +119 -0
  52. package/chip/Chip.test.js +56 -0
  53. package/chip/types.d.ts +45 -0
  54. package/chip/types.js +5 -0
  55. package/common/variables.js +101 -294
  56. package/date-input/DateInput.js +60 -52
  57. package/date-input/DateInput.stories.tsx +138 -0
  58. package/date-input/DateInput.test.js +479 -0
  59. package/date-input/types.d.ts +16 -9
  60. package/dialog/Dialog.d.ts +4 -0
  61. package/dialog/Dialog.js +10 -56
  62. package/dialog/Dialog.stories.tsx +212 -0
  63. package/dialog/Dialog.test.js +40 -0
  64. package/dialog/types.d.ts +43 -0
  65. package/dialog/types.js +5 -0
  66. package/dropdown/Dropdown.d.ts +4 -0
  67. package/dropdown/Dropdown.js +28 -87
  68. package/dropdown/Dropdown.stories.tsx +249 -0
  69. package/dropdown/Dropdown.test.js +189 -0
  70. package/dropdown/types.d.ts +80 -0
  71. package/dropdown/types.js +5 -0
  72. package/file-input/FileInput.d.ts +4 -0
  73. package/file-input/FileInput.js +167 -109
  74. package/file-input/FileInput.stories.tsx +507 -0
  75. package/file-input/FileInput.test.js +457 -0
  76. package/file-input/FileItem.d.ts +14 -0
  77. package/file-input/FileItem.js +16 -23
  78. package/file-input/types.d.ts +112 -0
  79. package/file-input/types.js +5 -0
  80. package/footer/Footer.d.ts +4 -0
  81. package/footer/Footer.js +32 -146
  82. package/footer/Footer.stories.tsx +130 -0
  83. package/footer/Footer.test.js +109 -0
  84. package/footer/Icons.d.ts +2 -0
  85. package/footer/Icons.js +3 -3
  86. package/footer/types.d.ts +65 -0
  87. package/footer/types.js +5 -0
  88. package/header/Header.d.ts +7 -0
  89. package/header/Header.js +48 -74
  90. package/header/Header.stories.tsx +172 -0
  91. package/header/Header.test.js +79 -0
  92. package/header/Icons.d.ts +2 -0
  93. package/header/Icons.js +2 -27
  94. package/header/types.d.ts +47 -0
  95. package/header/types.js +5 -0
  96. package/heading/Heading.d.ts +4 -0
  97. package/heading/Heading.js +7 -24
  98. package/heading/Heading.stories.tsx +54 -0
  99. package/heading/Heading.test.js +186 -0
  100. package/heading/types.d.ts +33 -0
  101. package/heading/types.js +5 -0
  102. package/inset/Inset.d.ts +3 -0
  103. package/inset/Inset.js +84 -0
  104. package/inset/Inset.stories.tsx +229 -0
  105. package/inset/types.d.ts +37 -0
  106. package/inset/types.js +5 -0
  107. package/layout/ApplicationLayout.d.ts +10 -0
  108. package/layout/ApplicationLayout.js +14 -31
  109. package/layout/ApplicationLayout.stories.tsx +171 -0
  110. package/layout/types.d.ts +57 -0
  111. package/layout/types.js +5 -0
  112. package/link/Link.d.ts +4 -0
  113. package/link/Link.js +70 -91
  114. package/link/Link.stories.tsx +186 -0
  115. package/link/Link.test.js +83 -0
  116. package/link/types.d.ts +55 -0
  117. package/link/types.js +5 -0
  118. package/list/List.d.ts +4 -0
  119. package/list/List.js +47 -0
  120. package/list/List.stories.tsx +95 -0
  121. package/list/types.d.ts +7 -0
  122. package/list/types.js +5 -0
  123. package/main.d.ts +11 -8
  124. package/main.js +66 -42
  125. package/number-input/NumberInput.d.ts +4 -0
  126. package/number-input/NumberInput.js +16 -68
  127. package/number-input/NumberInput.stories.tsx +115 -0
  128. package/number-input/NumberInput.test.js +506 -0
  129. package/number-input/NumberInputContext.d.ts +4 -0
  130. package/number-input/NumberInputContext.js +5 -2
  131. package/number-input/numberInputContextTypes.d.ts +19 -0
  132. package/number-input/numberInputContextTypes.js +5 -0
  133. package/number-input/types.d.ts +124 -0
  134. package/number-input/types.js +5 -0
  135. package/package.json +9 -6
  136. package/paginator/Paginator.js +2 -8
  137. package/paginator/Paginator.stories.tsx +63 -0
  138. package/paginator/Paginator.test.js +266 -0
  139. package/password-input/PasswordInput.d.ts +4 -0
  140. package/password-input/PasswordInput.js +19 -55
  141. package/password-input/{PasswordInput.stories.jsx → PasswordInput.stories.tsx} +4 -4
  142. package/password-input/PasswordInput.test.js +181 -0
  143. package/password-input/types.d.ts +110 -0
  144. package/password-input/types.js +5 -0
  145. package/progress-bar/ProgressBar.d.ts +4 -0
  146. package/progress-bar/ProgressBar.js +5 -23
  147. package/progress-bar/ProgressBar.stories.jsx +58 -0
  148. package/progress-bar/ProgressBar.test.js +65 -0
  149. package/progress-bar/types.d.ts +37 -0
  150. package/progress-bar/types.js +5 -0
  151. package/quick-nav/QuickNav.d.ts +4 -0
  152. package/quick-nav/QuickNav.js +64 -0
  153. package/quick-nav/QuickNav.stories.tsx +237 -0
  154. package/quick-nav/types.d.ts +21 -0
  155. package/quick-nav/types.js +5 -0
  156. package/radio/Radio.js +12 -13
  157. package/radio/Radio.stories.tsx +192 -0
  158. package/radio/Radio.test.js +71 -0
  159. package/radio/types.d.ts +2 -2
  160. package/radio-group/Radio.d.ts +4 -0
  161. package/radio-group/Radio.js +141 -0
  162. package/radio-group/RadioGroup.d.ts +4 -0
  163. package/radio-group/RadioGroup.js +280 -0
  164. package/radio-group/RadioGroup.stories.tsx +100 -0
  165. package/radio-group/RadioGroup.test.js +695 -0
  166. package/radio-group/types.d.ts +114 -0
  167. package/radio-group/types.js +5 -0
  168. package/resultsetTable/ResultsetTable.d.ts +4 -0
  169. package/resultsetTable/ResultsetTable.js +9 -29
  170. package/resultsetTable/ResultsetTable.stories.tsx +275 -0
  171. package/resultsetTable/ResultsetTable.test.js +306 -0
  172. package/resultsetTable/types.d.ts +67 -0
  173. package/resultsetTable/types.js +5 -0
  174. package/row/Row.d.ts +3 -0
  175. package/row/Row.js +127 -0
  176. package/row/Row.stories.tsx +237 -0
  177. package/row/types.d.ts +28 -0
  178. package/row/types.js +5 -0
  179. package/select/Icons.d.ts +10 -0
  180. package/select/Icons.js +93 -0
  181. package/select/Listbox.d.ts +4 -0
  182. package/select/Listbox.js +148 -0
  183. package/select/Option.d.ts +4 -0
  184. package/select/Option.js +110 -0
  185. package/select/Select.d.ts +4 -0
  186. package/select/Select.js +107 -317
  187. package/select/Select.stories.tsx +582 -0
  188. package/select/Select.test.js +2057 -0
  189. package/select/types.d.ts +213 -0
  190. package/select/types.js +5 -0
  191. package/sidenav/Sidenav.d.ts +9 -0
  192. package/sidenav/Sidenav.js +6 -15
  193. package/sidenav/Sidenav.stories.tsx +182 -0
  194. package/sidenav/Sidenav.test.js +56 -0
  195. package/sidenav/types.d.ts +50 -0
  196. package/sidenav/types.js +5 -0
  197. package/slider/Slider.d.ts +4 -0
  198. package/slider/Slider.js +63 -85
  199. package/slider/Slider.stories.tsx +177 -0
  200. package/slider/Slider.test.js +150 -0
  201. package/slider/types.d.ts +82 -0
  202. package/slider/types.js +5 -0
  203. package/spinner/Spinner.d.ts +4 -0
  204. package/spinner/Spinner.js +8 -25
  205. package/spinner/Spinner.stories.jsx +103 -0
  206. package/spinner/Spinner.test.js +64 -0
  207. package/spinner/types.d.ts +32 -0
  208. package/spinner/types.js +5 -0
  209. package/stack/Stack.d.ts +3 -0
  210. package/stack/Stack.js +97 -0
  211. package/stack/Stack.stories.tsx +164 -0
  212. package/stack/types.d.ts +24 -0
  213. package/stack/types.js +5 -0
  214. package/switch/Switch.d.ts +1 -1
  215. package/switch/Switch.js +34 -21
  216. package/switch/Switch.stories.tsx +160 -0
  217. package/switch/Switch.test.js +98 -0
  218. package/switch/types.d.ts +6 -2
  219. package/table/Table.d.ts +4 -0
  220. package/table/Table.js +3 -3
  221. package/table/Table.stories.jsx +277 -0
  222. package/table/Table.test.js +26 -0
  223. package/table/types.d.ts +21 -0
  224. package/table/types.js +5 -0
  225. package/tabs/Tabs.d.ts +4 -0
  226. package/tabs/Tabs.js +24 -72
  227. package/tabs/Tabs.stories.tsx +112 -0
  228. package/tabs/Tabs.test.js +140 -0
  229. package/tabs/types.d.ts +82 -0
  230. package/tabs/types.js +5 -0
  231. package/tag/Tag.d.ts +4 -0
  232. package/tag/Tag.js +34 -59
  233. package/tag/Tag.stories.tsx +142 -0
  234. package/tag/Tag.test.js +60 -0
  235. package/tag/types.d.ts +69 -0
  236. package/tag/types.js +5 -0
  237. package/text/Text.d.ts +7 -0
  238. package/text/Text.js +30 -0
  239. package/text/Text.stories.tsx +19 -0
  240. package/text-input/TextInput.d.ts +4 -0
  241. package/text-input/TextInput.js +64 -93
  242. package/text-input/TextInput.stories.tsx +474 -0
  243. package/text-input/TextInput.test.js +1712 -0
  244. package/text-input/types.d.ts +166 -0
  245. package/text-input/types.js +5 -0
  246. package/textarea/Textarea.d.ts +4 -0
  247. package/textarea/Textarea.js +37 -68
  248. package/textarea/Textarea.stories.jsx +37 -15
  249. package/textarea/Textarea.test.js +437 -0
  250. package/textarea/types.d.ts +137 -0
  251. package/textarea/types.js +5 -0
  252. package/toggle-group/ToggleGroup.d.ts +4 -0
  253. package/toggle-group/ToggleGroup.js +18 -46
  254. package/toggle-group/ToggleGroup.stories.tsx +173 -0
  255. package/toggle-group/ToggleGroup.test.js +156 -0
  256. package/toggle-group/types.d.ts +105 -0
  257. package/toggle-group/types.js +5 -0
  258. package/useTheme.d.ts +2 -0
  259. package/useTheme.js +2 -2
  260. package/wizard/Wizard.d.ts +4 -0
  261. package/wizard/Wizard.js +89 -70
  262. package/wizard/Wizard.stories.tsx +214 -0
  263. package/wizard/Wizard.test.js +141 -0
  264. package/wizard/types.d.ts +64 -0
  265. package/wizard/types.js +5 -0
  266. package/V3Select/V3Select.js +0 -455
  267. package/V3Select/index.d.ts +0 -27
  268. package/V3Textarea/V3Textarea.js +0 -260
  269. package/V3Textarea/index.d.ts +0 -27
  270. package/box/index.d.ts +0 -25
  271. package/chip/index.d.ts +0 -22
  272. package/date/Date.js +0 -373
  273. package/date/index.d.ts +0 -27
  274. package/dialog/index.d.ts +0 -18
  275. package/dropdown/index.d.ts +0 -26
  276. package/file-input/index.d.ts +0 -81
  277. package/footer/index.d.ts +0 -25
  278. package/header/index.d.ts +0 -25
  279. package/heading/index.d.ts +0 -17
  280. package/input-text/Icons.js +0 -22
  281. package/input-text/InputText.js +0 -611
  282. package/input-text/index.d.ts +0 -36
  283. package/link/index.d.ts +0 -23
  284. package/number-input/index.d.ts +0 -113
  285. package/password-input/index.d.ts +0 -94
  286. package/progress-bar/index.d.ts +0 -18
  287. package/resultsetTable/index.d.ts +0 -19
  288. package/select/index.d.ts +0 -131
  289. package/sidenav/index.d.ts +0 -13
  290. package/slider/index.d.ts +0 -29
  291. package/spinner/index.d.ts +0 -17
  292. package/table/index.d.ts +0 -13
  293. package/tabs/index.d.ts +0 -19
  294. package/tag/index.d.ts +0 -24
  295. package/text-input/index.d.ts +0 -135
  296. package/textarea/index.d.ts +0 -117
  297. package/toggle/Toggle.js +0 -186
  298. package/toggle/index.d.ts +0 -21
  299. package/toggle-group/index.d.ts +0 -21
  300. package/upload/Upload.js +0 -201
  301. package/upload/buttons-upload/ButtonsUpload.js +0 -111
  302. package/upload/buttons-upload/Icons.js +0 -40
  303. package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
  304. package/upload/dragAndDropArea/Icons.js +0 -39
  305. package/upload/file-upload/FileToUpload.js +0 -115
  306. package/upload/file-upload/Icons.js +0 -66
  307. package/upload/files-upload/FilesToUpload.js +0 -109
  308. package/upload/index.d.ts +0 -15
  309. package/upload/transaction/Icons.js +0 -160
  310. package/upload/transaction/Transaction.js +0 -104
  311. package/upload/transactions/Transactions.js +0 -94
  312. package/wizard/Icons.js +0 -65
  313. package/wizard/index.d.ts +0 -18
@@ -21,13 +21,11 @@ var _main = require("../main");
21
21
 
22
22
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
23
23
 
24
- var _propTypes = _interopRequireDefault(require("prop-types"));
25
-
26
24
  var _variables = require("../common/variables.js");
27
25
 
28
26
  var _Icons = require("./Icons");
29
27
 
30
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
28
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
31
29
 
32
30
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
33
31
 
@@ -55,23 +53,14 @@ var Footer = function Footer(_ref3) {
55
53
  };
56
54
 
57
55
  var SideNav = function SideNav(props) {
58
- var displayArrow = props.displayArrow,
59
- mode = props.mode,
56
+ var _props$displayArrow = props.displayArrow,
57
+ displayArrow = _props$displayArrow === void 0 ? true : _props$displayArrow,
58
+ _props$mode = props.mode,
59
+ mode = _props$mode === void 0 ? "overlay" : _props$mode,
60
60
  childProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
61
61
  return /*#__PURE__*/_react["default"].createElement(_main.DxcSidenav, childProps, childProps.children);
62
62
  };
63
63
 
64
- SideNav.propTypes = {
65
- mode: _propTypes["default"].oneOf(["overlay", "push", ""]),
66
- displayArrow: _propTypes["default"].bool,
67
- padding: _propTypes["default"].oneOfType([_propTypes["default"].shape({
68
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
69
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
70
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
71
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
72
- })])
73
- };
74
-
75
64
  var defaultFooter = function defaultFooter() {
76
65
  return /*#__PURE__*/_react["default"].createElement(_main.DxcFooter, {
77
66
  copyright: "\xA9 DXC Technology ".concat(year, "\u200B\u200B\u200B\u200B. All rights reserved."),
@@ -120,7 +109,7 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref4) {
120
109
  isSideNavVisible = _useState2[0],
121
110
  setIsSideNavVisible = _useState2[1];
122
111
 
123
- var _useState3 = (0, _react.useState)(),
112
+ var _useState3 = (0, _react.useState)(false),
124
113
  _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
125
114
  isResponsive = _useState4[0],
126
115
  setIsResponsive = _useState4[1];
@@ -147,27 +136,20 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref4) {
147
136
  }));
148
137
  };
149
138
 
150
- var handleResize = function handleResize(width) {
151
- if (width) {
152
- if (width <= _variables.responsiveSizes.tablet ? setIsResponsive(true) : setIsResponsive(false)) ;
153
- setIsSideNavVisible(true);
154
- }
155
- };
156
-
157
- var handleEventListener = function handleEventListener() {
158
- handleResize(ref.current.offsetWidth);
139
+ var handleResize = function handleResize() {
140
+ setIsResponsive(window.matchMedia("(max-width: ".concat(_variables.responsiveSizes.medium, "rem)")).matches);
141
+ setIsSideNavVisible(true);
159
142
  };
160
143
 
161
144
  (0, _react.useEffect)(function () {
162
145
  if (ref.current) {
163
- window.addEventListener("resize", handleEventListener);
164
- handleResize(ref.current.offsetWidth);
146
+ window.addEventListener("resize", handleResize);
165
147
  }
166
148
 
167
149
  return function () {
168
- window.removeEventListener("resize", handleEventListener);
150
+ window.removeEventListener("resize", handleResize);
169
151
  };
170
- }, []);
152
+ }, [ref.current]);
171
153
 
172
154
  var handleSidenav = function handleSidenav() {
173
155
  setIsSideNavVisible(!isSideNavVisible);
@@ -180,6 +162,7 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref4) {
180
162
  }, /*#__PURE__*/_react["default"].createElement(HeaderContainer, null, header), /*#__PURE__*/_react["default"].createElement(BodyContainer, null, /*#__PURE__*/_react["default"].createElement(ContentContainer, null, /*#__PURE__*/_react["default"].createElement(SideNavArrowContainer, {
181
163
  isSideNavVisible: isSideNavVisible
182
164
  }, sideNav, /*#__PURE__*/_react["default"].createElement(ArrowContainer, null, sideNav && (displayArrow || isResponsive) && /*#__PURE__*/_react["default"].createElement(ArrowTrigger, {
165
+ role: "button",
183
166
  tabIndex: 0,
184
167
  onClick: handleSidenav,
185
168
  isSideNavVisible: isSideNavVisible
@@ -223,7 +206,7 @@ var SideNavArrowContainer = _styledComponents["default"].div(_templateObject8 ||
223
206
 
224
207
  var ArrowContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n height: calc(100vh - 64px);\n left: 279px;\n"])));
225
208
 
226
- var ArrowTrigger = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n position: sticky;\n top: 45vh;\n width: 42px;\n min-height: 42px;\n background-color: ", ";\n border-radius: 50%;\n transform: ", ";\n transition: transform 0.4s ease-in-out;\n z-index: 1250;\n cursor: pointer;\n & > svg {\n fill: ", ";\n }\n"])), function (props) {
209
+ var ArrowTrigger = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n position: sticky;\n top: 45vh;\n width: 42px;\n min-height: 42px;\n background-color: ", ";\n border-radius: 50%;\n transform: ", ";\n transition: transform 0.4s ease-in-out;\n z-index: 1250;\n cursor: pointer;\n & > svg {\n fill: ", ";\n }\n :focus {\n outline: #0095ff auto 1px;\n }\n"])), function (props) {
227
210
  return "".concat(props.theme.arrowContainerColor);
228
211
  }, function (props) {
229
212
  return props.isSideNavVisible ? "rotate(-180deg)" : "rotate(0deg)";
@@ -0,0 +1,171 @@
1
+ import React from "react";
2
+ import DxcApplicationLayout from "./ApplicationLayout";
3
+ import DxcSidenav from "../sidenav/Sidenav";
4
+ import Title from "../../.storybook/components/Title";
5
+ import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
6
+ import { userEvent, within, waitFor } from "@storybook/testing-library";
7
+
8
+ export default {
9
+ title: "Application Layout ",
10
+ component: DxcApplicationLayout,
11
+ parameters: {
12
+ viewport: {
13
+ viewports: INITIAL_VIEWPORTS,
14
+ }
15
+ }
16
+ };
17
+
18
+ export const DefaultApplicationLayout = () => (
19
+ <>
20
+ <DxcApplicationLayout>
21
+ <DxcApplicationLayout.Main>
22
+ <Title title="Default application layout" theme="light" level={4} />
23
+ <p>Main Content</p>
24
+ <p>Main Content</p>
25
+ <p>Main Content</p>
26
+ <p>Main Content</p>
27
+ </DxcApplicationLayout.Main>
28
+ </DxcApplicationLayout>
29
+ </>
30
+ );
31
+
32
+ export const ApplicationLayoutWithDefaultSidenav = () => (
33
+ <>
34
+ <DxcApplicationLayout>
35
+ <DxcApplicationLayout.SideNav>
36
+ <DxcSidenav.Title>Application layout with sidenav</DxcSidenav.Title>
37
+ <p>SideNav Content</p>
38
+ <p>SideNav Content</p>
39
+ <p>SideNav Content</p>
40
+ <p>SideNav Content</p>
41
+ <p>SideNav Content</p>
42
+ </DxcApplicationLayout.SideNav>
43
+ <DxcApplicationLayout.Main>
44
+ <p>Main Content</p>
45
+ <p>Main Content</p>
46
+ <p>Main Content</p>
47
+ <p>Main Content</p>
48
+ </DxcApplicationLayout.Main>
49
+ </DxcApplicationLayout>
50
+ </>
51
+ );
52
+
53
+ export const ApplicationLayoutWithPushSidenav = () => (
54
+ <>
55
+ <DxcApplicationLayout>
56
+ <DxcApplicationLayout.SideNav mode="push">
57
+ <DxcSidenav.Title>Application layout with push sidenav</DxcSidenav.Title>
58
+ <p>SideNav Content</p>
59
+ <p>SideNav Content</p>
60
+ <p>SideNav Content</p>
61
+ <p>SideNav Content</p>
62
+ <p>SideNav Content</p>
63
+ </DxcApplicationLayout.SideNav>
64
+ <DxcApplicationLayout.Main>
65
+ <p>Main Content</p>
66
+ <p>Main Content</p>
67
+ <p>Main Content</p>
68
+ <p>Main Content</p>
69
+ </DxcApplicationLayout.Main>
70
+ </DxcApplicationLayout>
71
+ </>
72
+ );
73
+
74
+ export const ApplicationLayoutWithArrowSidenav = () => (
75
+ <>
76
+ <DxcApplicationLayout>
77
+ <DxcApplicationLayout.SideNav mode="overlay" displayArrow>
78
+ <DxcSidenav.Title>Application layout with push sidenav</DxcSidenav.Title>
79
+ <p>SideNav Content</p>
80
+ <p>SideNav Content</p>
81
+ <p>SideNav Content</p>
82
+ <p>SideNav Content</p>
83
+ <p>SideNav Content</p>
84
+ </DxcApplicationLayout.SideNav>
85
+ <DxcApplicationLayout.Main>
86
+ <p>Main Content</p>
87
+ <p>Main Content</p>
88
+ <p>Main Content</p>
89
+ <p>Main Content</p>
90
+ </DxcApplicationLayout.Main>
91
+ </DxcApplicationLayout>
92
+ </>
93
+ );
94
+
95
+ export const ApplicationLayoutWithResponsiveSidenav = () => (
96
+ <>
97
+ <DxcApplicationLayout>
98
+ <DxcApplicationLayout.SideNav>
99
+ <DxcSidenav.Title>Application layout with push sidenav</DxcSidenav.Title>
100
+ <p>SideNav Content</p>
101
+ <p>SideNav Content</p>
102
+ <p>SideNav Content</p>
103
+ <p>SideNav Content</p>
104
+ <p>SideNav Content</p>
105
+ </DxcApplicationLayout.SideNav>
106
+ <DxcApplicationLayout.Main>
107
+ <p>Main Content</p>
108
+ <p>Main Content</p>
109
+ <p>Main Content</p>
110
+ <p>Main Content</p>
111
+ </DxcApplicationLayout.Main>
112
+ </DxcApplicationLayout>
113
+ </>
114
+ );
115
+
116
+ ApplicationLayoutWithResponsiveSidenav.parameters = {
117
+ viewport: {
118
+ defaultViewport: 'pixel',
119
+ },
120
+ };
121
+
122
+ export const ApplicationLayoutWithCustomHeader = () => (
123
+ <>
124
+ <DxcApplicationLayout>
125
+ <DxcApplicationLayout.Header> <p>Custom Header</p> </DxcApplicationLayout.Header>
126
+ <DxcApplicationLayout.SideNav>
127
+ <DxcSidenav.Title>Application layout with push sidenav</DxcSidenav.Title>
128
+ <p>SideNav Content</p>
129
+ <p>SideNav Content</p>
130
+ <p>SideNav Content</p>
131
+ <p>SideNav Content</p>
132
+ <p>SideNav Content</p>
133
+ </DxcApplicationLayout.SideNav>
134
+ <DxcApplicationLayout.Main>
135
+ <p>Main Content</p>
136
+ <p>Main Content</p>
137
+ <p>Main Content</p>
138
+ <p>Main Content</p>
139
+ </DxcApplicationLayout.Main>
140
+ </DxcApplicationLayout>
141
+ </>
142
+ );
143
+
144
+ export const ApplicationLayoutWithCustomFooter = () => (
145
+ <>
146
+ <DxcApplicationLayout>
147
+ <DxcApplicationLayout.SideNav>
148
+ <DxcSidenav.Title>Application layout with push sidenav</DxcSidenav.Title>
149
+ <p>SideNav Content</p>
150
+ <p>SideNav Content</p>
151
+ <p>SideNav Content</p>
152
+ <p>SideNav Content</p>
153
+ <p>SideNav Content</p>
154
+ </DxcApplicationLayout.SideNav>
155
+ <DxcApplicationLayout.Main>
156
+ <p>Main Content</p>
157
+ <p>Main Content</p>
158
+ <p>Main Content</p>
159
+ <p>Main Content</p>
160
+ </DxcApplicationLayout.Main>
161
+ <DxcApplicationLayout.Footer> <p>Custom Footer</p> </DxcApplicationLayout.Footer>
162
+ </DxcApplicationLayout>
163
+ </>
164
+ );
165
+
166
+ export const ApplicationLayoutWithClosingSidenav = ApplicationLayoutWithArrowSidenav.bind({});
167
+ ApplicationLayoutWithClosingSidenav.play = async ({ canvasElement }) => {
168
+ const canvas = within(canvasElement);
169
+ const arrow = canvas.getByRole("button");
170
+ await userEvent.click(arrow);
171
+ };
@@ -0,0 +1,57 @@
1
+ /// <reference types="react" />
2
+ declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ declare type Padding = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+ declare type ChildrenType = AppLayoutHeaderPropsType | AppLayoutMainPropsType | AppLayoutFooterPropsType | AppLayoutSidenavPropsType;
10
+ export declare type AppLayoutHeaderPropsType = {
11
+ /**
12
+ * Everything between this tags will be displayed as a header, at the top of the screen.
13
+ * This is optional and if it is not specified, the DxcHeader will be shown by default.
14
+ */
15
+ children?: React.ReactNode;
16
+ };
17
+ export declare type AppLayoutMainPropsType = {
18
+ /**
19
+ * Everything between the tags will be displayed as the content of the main part of the application.
20
+ */
21
+ children: React.ReactNode;
22
+ };
23
+ export declare type AppLayoutFooterPropsType = {
24
+ /**
25
+ * Everything between the tags will be displayed as a footer, at the bottom of the screen.
26
+ * This is optional and if it is not specified, the DxcFooter will be shown by default.
27
+ */
28
+ children?: React.ReactNode;
29
+ };
30
+ export declare type AppLayoutSidenavPropsType = {
31
+ /**
32
+ * Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
33
+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
34
+ */
35
+ padding?: Space | Padding;
36
+ /**
37
+ * The area inside the sidenav. This area can be used to render custom content.
38
+ */
39
+ children: React.ReactNode;
40
+ /**
41
+ * If false, the arrow button is hidden.
42
+ * In lower resolutions the arrow will be always displayed.
43
+ */
44
+ displayArrow?: boolean;
45
+ /**
46
+ * Default action over the content of the page, overlay the content or push to the right ('push' | 'overlay').
47
+ * In lower resolutions the mode will always be overlay.
48
+ */
49
+ mode: "push" | "overlay";
50
+ };
51
+ declare type AppLayoutPropsType = {
52
+ /**
53
+ * The area inside the sidenav. This area can be used to render custom content.
54
+ */
55
+ children: React.ReactElement<ChildrenType> | React.ReactElement<ChildrenType>[];
56
+ };
57
+ export default AppLayoutPropsType;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/link/Link.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { LinkProps } from "./types";
3
+ declare const DxcLink: ({ inheritColor, disabled, icon, iconPosition, href, newWindow, onClick, margin, tabIndex, children, }: LinkProps) => JSX.Element;
4
+ export default DxcLink;
package/link/Link.js CHANGED
@@ -9,21 +9,17 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports["default"] = void 0;
11
11
 
12
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
12
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
13
 
14
14
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
15
 
16
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
17
-
18
16
  var _react = _interopRequireDefault(require("react"));
19
17
 
20
18
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
21
19
 
22
- var _propTypes = _interopRequireDefault(require("prop-types"));
23
-
24
20
  var _variables = require("../common/variables.js");
25
21
 
26
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
22
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
27
23
 
28
24
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
29
25
 
@@ -31,57 +27,62 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
31
27
 
32
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
33
29
 
34
- var DxcLink = function DxcLink(_ref) {
35
- var _ref$inheritColor = _ref.inheritColor,
36
- inheritColor = _ref$inheritColor === void 0 ? false : _ref$inheritColor,
37
- _ref$disabled = _ref.disabled,
38
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
39
- iconSrc = _ref.iconSrc,
30
+ var LinkContent = /*#__PURE__*/_react["default"].memo(function (_ref) {
31
+ var iconPosition = _ref.iconPosition,
40
32
  icon = _ref.icon,
41
- _ref$iconPosition = _ref.iconPosition,
42
- iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
43
- _ref$href = _ref.href,
44
- href = _ref$href === void 0 ? "" : _ref$href,
45
- _ref$newWindow = _ref.newWindow,
46
- newWindow = _ref$newWindow === void 0 ? false : _ref$newWindow,
47
- onClick = _ref.onClick,
48
- _ref$text = _ref.text,
49
- text = _ref$text === void 0 ? "" : _ref$text,
50
- margin = _ref.margin,
51
- _ref$tabIndex = _ref.tabIndex,
52
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
53
- var colorsTheme = (0, _useTheme["default"])();
54
-
55
- var linkContent = /*#__PURE__*/_react["default"].createElement(LinkText, {
56
- iconPosition: iconPosition
57
- }, text, icon ? /*#__PURE__*/_react["default"].createElement(LinkIconContainer, {
33
+ children = _ref.children;
34
+ return /*#__PURE__*/_react["default"].createElement(LinkText, null, iconPosition === "after" && children, icon && /*#__PURE__*/_react["default"].createElement(LinkIconContainer, {
58
35
  iconPosition: iconPosition
59
- }, (0, _typeof2["default"])(icon) === "object" ? icon : /*#__PURE__*/_react["default"].createElement(icon)) : iconSrc && /*#__PURE__*/_react["default"].createElement(LinkIcon, {
60
- src: iconSrc,
61
- iconPosition: iconPosition
62
- }));
36
+ }, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(LinkIcon, {
37
+ src: icon
38
+ }) : icon), iconPosition === "before" && children);
39
+ });
63
40
 
41
+ var DxcLink = function DxcLink(_ref2) {
42
+ var _ref2$inheritColor = _ref2.inheritColor,
43
+ inheritColor = _ref2$inheritColor === void 0 ? false : _ref2$inheritColor,
44
+ _ref2$disabled = _ref2.disabled,
45
+ disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
46
+ icon = _ref2.icon,
47
+ _ref2$iconPosition = _ref2.iconPosition,
48
+ iconPosition = _ref2$iconPosition === void 0 ? "before" : _ref2$iconPosition,
49
+ _ref2$href = _ref2.href,
50
+ href = _ref2$href === void 0 ? "" : _ref2$href,
51
+ _ref2$newWindow = _ref2.newWindow,
52
+ newWindow = _ref2$newWindow === void 0 ? false : _ref2$newWindow,
53
+ onClick = _ref2.onClick,
54
+ margin = _ref2.margin,
55
+ _ref2$tabIndex = _ref2.tabIndex,
56
+ tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex,
57
+ children = _ref2.children;
58
+ var colorsTheme = (0, _useTheme["default"])();
64
59
  return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
65
60
  theme: colorsTheme.link
66
- }, /*#__PURE__*/_react["default"].createElement(DxcLinkContainer, {
61
+ }, /*#__PURE__*/_react["default"].createElement(LinkContainer, {
67
62
  margin: margin
68
- }, onClick ? /*#__PURE__*/_react["default"].createElement(StyledButton, {
69
- type: "button",
63
+ }, typeof children === "string" && (href || onClick) ? /*#__PURE__*/_react["default"].createElement(StyledLink, {
64
+ as: href ? "a" : "button",
65
+ tabIndex: tabIndex,
70
66
  onClick: !disabled && onClick,
71
- margin: margin,
67
+ href: !disabled && href ? href : undefined,
68
+ target: href ? newWindow ? "_blank" : "_self" : undefined,
72
69
  disabled: disabled,
73
70
  inheritColor: inheritColor
74
- }, linkContent) : /*#__PURE__*/_react["default"].createElement(StyledLink, {
75
- tabIndex: tabIndex,
76
- href: !disabled && href,
77
- target: newWindow ? "_blank" : "_self",
78
- margin: margin,
71
+ }, /*#__PURE__*/_react["default"].createElement(LinkContent, {
72
+ iconPosition: iconPosition,
73
+ icon: icon,
74
+ children: children
75
+ })) : /*#__PURE__*/_react["default"].createElement(CustomLinkContainer, {
79
76
  disabled: disabled,
80
77
  inheritColor: inheritColor
81
- }, linkContent)));
78
+ }, /*#__PURE__*/_react["default"].createElement(LinkContent, {
79
+ iconPosition: iconPosition,
80
+ icon: icon,
81
+ children: children
82
+ }))));
82
83
  };
83
84
 
84
- var DxcLinkContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
85
+ var LinkContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n * {\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n text-decoration-color: transparent;\n }\n"])), function (props) {
85
86
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
86
87
  }, function (props) {
87
88
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
@@ -91,16 +92,26 @@ var DxcLinkContainer = _styledComponents["default"].div(_templateObject || (_tem
91
92
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
92
93
  }, function (props) {
93
94
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
95
+ }, function (props) {
96
+ return props.theme.fontSize;
97
+ }, function (props) {
98
+ return props.theme.fontWeight;
99
+ }, function (props) {
100
+ return props.theme.fontStyle;
101
+ }, function (props) {
102
+ return props.theme.fontFamily;
94
103
  });
95
104
 
96
- var StyledLink = _styledComponents["default"].a(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n ", "\n\n text-decoration-color: transparent;\n ", "\n\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n outline-color: ", ";\n outline-width: 2px;\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
105
+ var StyledLink = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n ", "\n color: ", ";\n ", "\n\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n border-radius: 2px;\n outline: 2px solid ", ";\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
106
+ return "padding-bottom: ".concat(props.theme.underlineSpacing, ";\n border-bottom: ").concat(props.theme.underlineThickness, " ").concat(props.theme.underlineStyle, " transparent;");
107
+ }, function (props) {
108
+ return props.disabled && "cursor: default;";
109
+ }, function (props) {
97
110
  return props.inheritColor ? "inherit" : !props.disabled ? props.theme.fontColor : props.theme.disabledColor;
98
111
  }, function (props) {
99
112
  return props.disabled ? "pointer-events: none;" : "";
100
113
  }, function (props) {
101
- return "padding-bottom: ".concat(props.theme.underlineSpacing, ";\n border-bottom: ").concat(props.theme.underlineThickness, " ").concat(props.theme.underlineStyle, " transparent;");
102
- }, function (props) {
103
- return !props.inheritColor ? props.theme.visitedFontColor : "";
114
+ return !props.inheritColor && !props.disabled ? props.theme.visitedFontColor : "";
104
115
  }, function (props) {
105
116
  return "color: ".concat(props.theme.visitedFontColor, ";\n border-bottom-color: ").concat(props.theme.visitedUnderlineColor, ";");
106
117
  }, function (props) {
@@ -113,47 +124,33 @@ var StyledLink = _styledComponents["default"].a(_templateObject2 || (_templateOb
113
124
  return "color: ".concat(props.theme.activeFontColor, " !important;\n border-bottom-color: ").concat(props.theme.activeUnderlineColor, " !important;");
114
125
  });
115
126
 
116
- var StyledButton = _styledComponents["default"].button(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-family: inherit;\n text-decoration-color: transparent;\n\n ", "\n ", "\n color: ", ";\n ", "\n\n &:hover {\n ", "\n }\n &:focus {\n outline-color: ", ";\n outline-width: 2px;\n outline-offset: 1px;\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
127
+ var CustomLinkContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n ", "\n ", "\n\n * {\n color: ", ";\n }\n\n &:hover {\n * {\n color: ", ";\n }\n ", "\n }\n &:focus-within {\n * {\n outline: none;\n }\n border-radius: 2px;\n outline: 2px solid ", ";\n ", "\n }\n &:active {\n * {\n color: ", " !important;\n }\n ", "\n }\n"])), function (props) {
117
128
  return "padding-bottom: ".concat(props.theme.underlineSpacing, ";\n border-bottom: ").concat(props.theme.underlineThickness, " ").concat(props.theme.underlineStyle, " transparent;");
118
129
  }, function (props) {
119
130
  return props.disabled && "cursor: default;";
131
+ }, function (props) {
132
+ return props.disabled ? "pointer-events: none;" : "";
120
133
  }, function (props) {
121
134
  return props.inheritColor ? "inherit" : !props.disabled ? props.theme.fontColor : props.theme.disabledColor;
122
135
  }, function (props) {
123
- return props.disabled ? "pointer-events: none;" : "";
136
+ return props.theme.hoverFontColor;
124
137
  }, function (props) {
125
- return "color: ".concat(props.theme.hoverFontColor, ";\n border-bottom-color: ").concat(props.theme.hoverUnderlineColor, ";\n cursor: pointer;");
138
+ return "border-bottom-color: ".concat(props.theme.hoverUnderlineColor, ";\n cursor: pointer;");
126
139
  }, function (props) {
127
140
  return props.theme.focusColor;
128
141
  }, function (props) {
129
142
  return props.disabled && "outline: none";
130
143
  }, function (props) {
131
- return "color: ".concat(props.theme.activeFontColor, " !important;\n border-bottom-color: ").concat(props.theme.activeUnderlineColor, " !important;");
132
- });
133
-
134
- var LinkText = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n display: inline-flex;\n flex-direction: ", ";\n justify-content: ", ";\n align-items: center;\n max-width: 100%;\n"])), function (props) {
135
- return props.theme.fontSize;
136
- }, function (props) {
137
- return props.theme.fontWeight;
138
- }, function (props) {
139
- return props.theme.fontStyle;
140
- }, function (props) {
141
- return props.theme.fontFamily;
144
+ return props.theme.activeFontColor;
142
145
  }, function (props) {
143
- return props.iconPosition === "after" ? "row" : "row-reverse";
144
- }, function (props) {
145
- return props.iconPosition === "after" ? "flex-start" : "flex-end";
146
+ return "border-bottom-color: ".concat(props.theme.activeUnderlineColor, " !important;");
146
147
  });
147
148
 
148
- var LinkIcon = _styledComponents["default"].img(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", ";\n"])), function (props) {
149
- return props.theme.iconSize;
150
- }, function (props) {
151
- return props.theme.iconSize;
152
- }, function (props) {
153
- return "".concat(props.iconPosition === "before" ? "margin-right" : "margin-left", ": ").concat(props.theme.iconSpacing);
154
- });
149
+ var LinkText = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: baseline;\n max-width: 100%;\n"])));
150
+
151
+ var LinkIcon = _styledComponents["default"].img(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])([""])));
155
152
 
156
- var LinkIconContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", ";\n overflow: hidden;\n \n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
153
+ var LinkIconContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", ";\n overflow: hidden;\n align-self: center;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
157
154
  return props.theme.iconSize;
158
155
  }, function (props) {
159
156
  return props.theme.iconSize;
@@ -161,23 +158,5 @@ var LinkIconContainer = _styledComponents["default"].div(_templateObject6 || (_t
161
158
  return "".concat(props.iconPosition === "before" ? "margin-right" : "margin-left", ": ").concat(props.theme.iconSpacing);
162
159
  });
163
160
 
164
- DxcLink.propTypes = {
165
- inheritColor: _propTypes["default"].bool,
166
- disabled: _propTypes["default"].bool,
167
- icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
168
- iconSrc: _propTypes["default"].string,
169
- iconPosition: _propTypes["default"].oneOf(["after", "before"]),
170
- href: _propTypes["default"].string,
171
- onClick: _propTypes["default"].func,
172
- margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
173
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
174
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
175
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
176
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
177
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
178
- newWindow: _propTypes["default"].bool,
179
- text: _propTypes["default"].string,
180
- tabIndex: _propTypes["default"].number
181
- };
182
161
  var _default = DxcLink;
183
162
  exports["default"] = _default;