@dxc-technology/halstack-react 0.0.0-971b360 → 0.0.0-97eade8

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 (252) hide show
  1. package/BackgroundColorContext.d.ts +2 -2
  2. package/BackgroundColorContext.js +1 -1
  3. package/HalstackContext.d.ts +1329 -5
  4. package/HalstackContext.js +117 -77
  5. package/accordion/Accordion.js +118 -110
  6. package/accordion/Accordion.stories.tsx +104 -16
  7. package/accordion/Accordion.test.js +10 -11
  8. package/accordion/types.d.ts +2 -1
  9. package/accordion-group/AccordionGroup.d.ts +4 -3
  10. package/accordion-group/AccordionGroup.js +25 -65
  11. package/accordion-group/AccordionGroup.stories.tsx +27 -1
  12. package/accordion-group/AccordionGroup.test.js +21 -46
  13. package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
  14. package/accordion-group/AccordionGroupAccordion.js +43 -0
  15. package/accordion-group/types.d.ts +8 -1
  16. package/alert/Alert.js +5 -9
  17. package/alert/Alert.stories.tsx +28 -0
  18. package/alert/Alert.test.js +1 -1
  19. package/bleed/Bleed.js +1 -34
  20. package/bleed/Bleed.stories.tsx +95 -95
  21. package/bleed/types.d.ts +1 -1
  22. package/box/Box.d.ts +1 -1
  23. package/box/Box.js +8 -27
  24. package/box/Box.stories.tsx +38 -51
  25. package/box/Box.test.js +1 -1
  26. package/box/types.d.ts +0 -11
  27. package/bulleted-list/BulletedList.d.ts +7 -0
  28. package/bulleted-list/BulletedList.js +125 -0
  29. package/bulleted-list/BulletedList.stories.tsx +206 -0
  30. package/bulleted-list/types.d.ts +38 -0
  31. package/button/Button.js +52 -73
  32. package/button/Button.stories.tsx +159 -8
  33. package/button/Button.test.js +1 -1
  34. package/button/types.d.ts +5 -5
  35. package/card/Card.d.ts +1 -1
  36. package/card/Card.js +43 -63
  37. package/card/Card.stories.tsx +12 -42
  38. package/card/Card.test.js +1 -1
  39. package/card/types.d.ts +1 -6
  40. package/checkbox/Checkbox.d.ts +2 -2
  41. package/checkbox/Checkbox.js +94 -101
  42. package/checkbox/Checkbox.stories.tsx +131 -59
  43. package/checkbox/Checkbox.test.js +94 -17
  44. package/checkbox/types.d.ts +4 -0
  45. package/chip/Chip.js +28 -49
  46. package/chip/Chip.stories.tsx +121 -26
  47. package/chip/Chip.test.js +3 -5
  48. package/chip/types.d.ts +1 -1
  49. package/common/OpenSans.css +68 -80
  50. package/common/coreTokens.d.ts +146 -0
  51. package/common/coreTokens.js +167 -0
  52. package/common/utils.d.ts +1 -0
  53. package/common/utils.js +4 -4
  54. package/common/variables.d.ts +1482 -0
  55. package/common/variables.js +1009 -1118
  56. package/date-input/Calendar.d.ts +4 -0
  57. package/date-input/Calendar.js +258 -0
  58. package/date-input/DateInput.js +134 -237
  59. package/date-input/DateInput.stories.tsx +199 -33
  60. package/date-input/DateInput.test.js +494 -138
  61. package/date-input/DatePicker.d.ts +4 -0
  62. package/date-input/DatePicker.js +146 -0
  63. package/date-input/Icons.d.ts +6 -0
  64. package/date-input/Icons.js +75 -0
  65. package/date-input/YearPicker.d.ts +4 -0
  66. package/date-input/YearPicker.js +126 -0
  67. package/date-input/types.d.ts +51 -0
  68. package/dialog/Dialog.d.ts +1 -1
  69. package/dialog/Dialog.js +72 -79
  70. package/dialog/Dialog.stories.tsx +154 -171
  71. package/dialog/Dialog.test.js +334 -5
  72. package/dialog/types.d.ts +0 -12
  73. package/dropdown/Dropdown.d.ts +1 -1
  74. package/dropdown/Dropdown.js +246 -249
  75. package/dropdown/Dropdown.stories.tsx +245 -56
  76. package/dropdown/Dropdown.test.js +507 -110
  77. package/dropdown/DropdownMenu.d.ts +4 -0
  78. package/dropdown/DropdownMenu.js +74 -0
  79. package/dropdown/DropdownMenuItem.d.ts +4 -0
  80. package/dropdown/DropdownMenuItem.js +79 -0
  81. package/dropdown/types.d.ts +23 -3
  82. package/file-input/FileInput.d.ts +2 -2
  83. package/file-input/FileInput.js +174 -220
  84. package/file-input/FileInput.stories.tsx +122 -11
  85. package/file-input/FileInput.test.js +14 -14
  86. package/file-input/FileItem.d.ts +4 -14
  87. package/file-input/FileItem.js +39 -63
  88. package/file-input/types.d.ts +17 -0
  89. package/flex/Flex.d.ts +4 -0
  90. package/flex/Flex.js +71 -0
  91. package/flex/Flex.stories.tsx +112 -0
  92. package/flex/types.d.ts +97 -0
  93. package/footer/Footer.d.ts +1 -1
  94. package/footer/Footer.js +8 -23
  95. package/footer/Footer.stories.tsx +26 -16
  96. package/footer/Footer.test.js +14 -26
  97. package/footer/Icons.js +1 -1
  98. package/footer/types.d.ts +1 -6
  99. package/grid/Grid.d.ts +7 -0
  100. package/grid/Grid.js +91 -0
  101. package/grid/Grid.stories.tsx +219 -0
  102. package/grid/types.d.ts +115 -0
  103. package/header/Header.d.ts +3 -2
  104. package/header/Header.js +89 -89
  105. package/header/Header.stories.tsx +152 -9
  106. package/header/Header.test.js +2 -2
  107. package/header/Icons.js +2 -2
  108. package/header/types.d.ts +1 -0
  109. package/heading/Heading.js +1 -1
  110. package/heading/Heading.test.js +1 -1
  111. package/inset/Inset.js +1 -34
  112. package/inset/Inset.stories.tsx +37 -36
  113. package/inset/types.d.ts +1 -1
  114. package/layout/ApplicationLayout.d.ts +15 -6
  115. package/layout/ApplicationLayout.js +38 -66
  116. package/layout/ApplicationLayout.stories.tsx +80 -44
  117. package/layout/types.d.ts +18 -29
  118. package/link/Link.js +4 -4
  119. package/link/Link.stories.tsx +73 -6
  120. package/link/Link.test.js +2 -4
  121. package/link/types.d.ts +3 -3
  122. package/main.d.ts +7 -9
  123. package/main.js +33 -49
  124. package/{tabs-nav → nav-tabs}/NavTabs.d.ts +2 -2
  125. package/{tabs-nav → nav-tabs}/NavTabs.js +13 -16
  126. package/{tabs-nav → nav-tabs}/NavTabs.stories.tsx +110 -6
  127. package/{tabs-nav → nav-tabs}/NavTabs.test.js +1 -1
  128. package/{tabs-nav → nav-tabs}/Tab.js +51 -37
  129. package/{tabs-nav → nav-tabs}/types.d.ts +9 -10
  130. package/number-input/NumberInput.test.js +44 -8
  131. package/package.json +17 -21
  132. package/paginator/Icons.d.ts +5 -0
  133. package/paginator/Icons.js +16 -28
  134. package/paginator/Paginator.js +8 -16
  135. package/paginator/Paginator.stories.tsx +24 -0
  136. package/paginator/Paginator.test.js +91 -39
  137. package/paragraph/Paragraph.d.ts +5 -0
  138. package/paragraph/Paragraph.js +38 -0
  139. package/paragraph/Paragraph.stories.tsx +44 -0
  140. package/password-input/PasswordInput.test.js +14 -13
  141. package/progress-bar/ProgressBar.js +60 -54
  142. package/progress-bar/ProgressBar.stories.jsx +38 -3
  143. package/progress-bar/ProgressBar.test.js +68 -23
  144. package/quick-nav/QuickNav.js +25 -20
  145. package/quick-nav/QuickNav.stories.tsx +145 -26
  146. package/radio-group/Radio.d.ts +1 -1
  147. package/radio-group/Radio.js +46 -31
  148. package/radio-group/RadioGroup.js +31 -32
  149. package/radio-group/RadioGroup.stories.tsx +132 -18
  150. package/radio-group/RadioGroup.test.js +124 -97
  151. package/radio-group/types.d.ts +2 -2
  152. package/resultsetTable/Icons.d.ts +7 -0
  153. package/resultsetTable/Icons.js +51 -0
  154. package/resultsetTable/ResultsetTable.js +49 -108
  155. package/resultsetTable/ResultsetTable.stories.tsx +50 -25
  156. package/resultsetTable/ResultsetTable.test.js +61 -42
  157. package/resultsetTable/types.d.ts +1 -1
  158. package/select/Listbox.d.ts +1 -1
  159. package/select/Listbox.js +33 -16
  160. package/select/Option.js +11 -24
  161. package/select/Select.js +92 -71
  162. package/select/Select.stories.tsx +513 -136
  163. package/select/Select.test.js +413 -305
  164. package/select/types.d.ts +3 -6
  165. package/sidenav/Icons.d.ts +7 -0
  166. package/sidenav/Icons.js +51 -0
  167. package/sidenav/Sidenav.d.ts +6 -5
  168. package/sidenav/Sidenav.js +139 -48
  169. package/sidenav/Sidenav.stories.tsx +251 -151
  170. package/sidenav/Sidenav.test.js +25 -37
  171. package/sidenav/types.d.ts +52 -26
  172. package/slider/Slider.d.ts +2 -2
  173. package/slider/Slider.js +121 -97
  174. package/slider/Slider.stories.tsx +64 -1
  175. package/slider/Slider.test.js +122 -22
  176. package/slider/types.d.ts +4 -0
  177. package/spinner/Spinner.js +17 -23
  178. package/spinner/Spinner.stories.jsx +53 -27
  179. package/spinner/Spinner.test.js +1 -1
  180. package/switch/Switch.d.ts +2 -2
  181. package/switch/Switch.js +137 -70
  182. package/switch/Switch.stories.tsx +41 -30
  183. package/switch/Switch.test.js +145 -18
  184. package/switch/types.d.ts +4 -0
  185. package/table/Table.js +3 -3
  186. package/table/Table.stories.jsx +80 -1
  187. package/table/Table.test.js +2 -2
  188. package/tabs/Tab.d.ts +4 -0
  189. package/tabs/Tab.js +132 -0
  190. package/tabs/Tabs.js +358 -108
  191. package/tabs/Tabs.stories.tsx +119 -5
  192. package/tabs/Tabs.test.js +220 -10
  193. package/tabs/types.d.ts +13 -3
  194. package/tag/Tag.js +8 -10
  195. package/tag/Tag.stories.tsx +14 -1
  196. package/tag/Tag.test.js +1 -1
  197. package/tag/types.d.ts +1 -1
  198. package/text-input/Icons.d.ts +8 -0
  199. package/text-input/Icons.js +60 -0
  200. package/text-input/Suggestion.js +40 -11
  201. package/text-input/Suggestions.d.ts +4 -0
  202. package/text-input/Suggestions.js +134 -0
  203. package/text-input/TextInput.js +199 -296
  204. package/text-input/TextInput.stories.tsx +280 -185
  205. package/text-input/TextInput.test.js +736 -725
  206. package/text-input/types.d.ts +22 -3
  207. package/textarea/Textarea.js +3 -4
  208. package/textarea/Textarea.stories.jsx +60 -1
  209. package/textarea/Textarea.test.js +2 -4
  210. package/toggle-group/ToggleGroup.d.ts +2 -2
  211. package/toggle-group/ToggleGroup.js +7 -4
  212. package/toggle-group/ToggleGroup.stories.tsx +42 -0
  213. package/toggle-group/ToggleGroup.test.js +1 -1
  214. package/toggle-group/types.d.ts +2 -2
  215. package/typography/Typography.d.ts +4 -0
  216. package/typography/Typography.js +32 -0
  217. package/typography/Typography.stories.tsx +198 -0
  218. package/typography/types.d.ts +18 -0
  219. package/typography/types.js +5 -0
  220. package/useTheme.d.ts +1234 -1
  221. package/useTheme.js +1 -1
  222. package/useTranslatedLabels.d.ts +84 -1
  223. package/utils/BaseTypography.d.ts +21 -0
  224. package/utils/BaseTypography.js +108 -0
  225. package/utils/FocusLock.d.ts +13 -0
  226. package/utils/FocusLock.js +138 -0
  227. package/wizard/Wizard.js +10 -17
  228. package/wizard/Wizard.stories.tsx +40 -1
  229. package/wizard/Wizard.test.js +1 -1
  230. package/wizard/types.d.ts +3 -3
  231. package/card/ice-cream.jpg +0 -0
  232. package/common/RequiredComponent.js +0 -32
  233. package/list/List.d.ts +0 -4
  234. package/list/List.js +0 -47
  235. package/list/List.stories.tsx +0 -95
  236. package/list/types.d.ts +0 -7
  237. package/row/Row.d.ts +0 -3
  238. package/row/Row.js +0 -127
  239. package/row/Row.stories.tsx +0 -237
  240. package/row/types.d.ts +0 -28
  241. package/stack/Stack.d.ts +0 -3
  242. package/stack/Stack.js +0 -97
  243. package/stack/Stack.stories.tsx +0 -164
  244. package/stack/types.d.ts +0 -24
  245. package/text/Text.d.ts +0 -7
  246. package/text/Text.js +0 -30
  247. package/text/Text.stories.tsx +0 -19
  248. /package/{list → bulleted-list}/types.js +0 -0
  249. /package/{row → flex}/types.js +0 -0
  250. /package/{stack → grid}/types.js +0 -0
  251. /package/{tabs-nav → nav-tabs}/Tab.d.ts +0 -0
  252. /package/{tabs-nav → nav-tabs}/types.js +0 -0
package/card/Card.js CHANGED
@@ -19,13 +19,13 @@ var _react = _interopRequireWildcard(require("react"));
19
19
 
20
20
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
21
21
 
22
- var _variables = require("../common/variables.js");
22
+ var _variables = require("../common/variables");
23
23
 
24
24
  var _useTheme = _interopRequireDefault(require("../useTheme"));
25
25
 
26
26
  var _Box = _interopRequireDefault(require("../box/Box"));
27
27
 
28
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
28
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
29
29
 
30
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
31
 
@@ -43,7 +43,6 @@ var DxcCard = function DxcCard(_ref) {
43
43
  _ref$imageCover = _ref.imageCover,
44
44
  imageCover = _ref$imageCover === void 0 ? false : _ref$imageCover,
45
45
  margin = _ref.margin,
46
- contentPadding = _ref.contentPadding,
47
46
  _ref$tabIndex = _ref.tabIndex,
48
47
  tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,
49
48
  _ref$outlined = _ref.outlined,
@@ -56,26 +55,8 @@ var DxcCard = function DxcCard(_ref) {
56
55
  isHovered = _useState2[0],
57
56
  changeIsHovered = _useState2[1];
58
57
 
59
- var imageComponent = /*#__PURE__*/_react["default"].createElement(ImageContainer, {
60
- imageBgColor: imageBgColor
61
- }, /*#__PURE__*/_react["default"].createElement(TagImage, {
62
- imagePadding: imagePadding,
63
- cover: imageCover,
64
- src: imageSrc
65
- }));
66
-
67
- var tagContent = /*#__PURE__*/_react["default"].createElement(_Box["default"], {
68
- shadowDepth: !outlined ? 0 : isHovered && (onClick || linkHref) ? 2 : 1
69
- }, /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
70
- theme: colorsTheme.card
71
- }, /*#__PURE__*/_react["default"].createElement(CardContainer, {
72
- hasAction: onClick || linkHref,
73
- imagePosition: imagePosition
74
- }, imageSrc && imagePosition === "before" && imageComponent, /*#__PURE__*/_react["default"].createElement(CardContent, {
75
- contentPadding: contentPadding
76
- }, children), imageSrc && imagePosition === "after" && imageComponent)));
77
-
78
- return /*#__PURE__*/_react["default"].createElement(StyledDxcCard, {
58
+ return /*#__PURE__*/_react["default"].createElement(Card, {
59
+ hasAction: onClick || linkHref ? true : false,
79
60
  margin: margin,
80
61
  onMouseEnter: function onMouseEnter() {
81
62
  return changeIsHovered(true);
@@ -84,15 +65,26 @@ var DxcCard = function DxcCard(_ref) {
84
65
  return changeIsHovered(false);
85
66
  },
86
67
  onClick: onClick,
87
- hasAction: onClick,
88
- tabIndex: typeof onClick === "function" && !linkHref ? tabIndex : -1
89
- }, linkHref && /*#__PURE__*/_react["default"].createElement(StyledLink, {
90
- tabIndex: tabIndex,
68
+ tabIndex: onClick || linkHref ? tabIndex : -1,
69
+ as: linkHref && "a",
91
70
  href: linkHref
92
- }, tagContent) || tagContent);
71
+ }, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
72
+ shadowDepth: !outlined ? 0 : isHovered && (onClick || linkHref) ? 2 : 1
73
+ }, /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
74
+ theme: colorsTheme.card
75
+ }, /*#__PURE__*/_react["default"].createElement(CardContainer, {
76
+ hasAction: onClick || linkHref ? true : false,
77
+ imagePosition: imageSrc ? imagePosition : "none"
78
+ }, imageSrc && /*#__PURE__*/_react["default"].createElement(ImageContainer, {
79
+ imageBgColor: imageBgColor
80
+ }, /*#__PURE__*/_react["default"].createElement(TagImage, {
81
+ imagePadding: imagePadding,
82
+ imageCover: imageCover,
83
+ src: imageSrc
84
+ })), /*#__PURE__*/_react["default"].createElement(CardContent, null, children)))));
93
85
  };
94
86
 
95
- var StyledDxcCard = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n outline: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n :focus {\n outline: #0095ff auto 1px;\n }\n"])), function (_ref2) {
87
+ var Card = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n outline: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n text-decoration: none;\n ", "\n"])), function (_ref2) {
96
88
  var hasAction = _ref2.hasAction;
97
89
  return hasAction && "pointer" || "unset";
98
90
  }, function (_ref3) {
@@ -103,61 +95,49 @@ var StyledDxcCard = _styledComponents["default"].div(_templateObject || (_templa
103
95
  return margin && (0, _typeof2["default"])(margin) !== "object" ? _variables.spaces[margin] : "0px";
104
96
  }, function (_ref5) {
105
97
  var margin = _ref5.margin;
106
- return margin && margin.top ? _variables.spaces[margin.top] : "";
98
+ return margin && (0, _typeof2["default"])(margin) === "object" && margin.top ? _variables.spaces[margin.top] : "";
107
99
  }, function (_ref6) {
108
100
  var margin = _ref6.margin;
109
- return margin && margin.right ? _variables.spaces[margin.right] : "";
101
+ return margin && (0, _typeof2["default"])(margin) === "object" && margin.right ? _variables.spaces[margin.right] : "";
110
102
  }, function (_ref7) {
111
103
  var margin = _ref7.margin;
112
- return margin && margin.bottom ? _variables.spaces[margin.bottom] : "";
104
+ return margin && (0, _typeof2["default"])(margin) === "object" && margin.bottom ? _variables.spaces[margin.bottom] : "";
113
105
  }, function (_ref8) {
114
106
  var margin = _ref8.margin;
115
- return margin && margin.left ? _variables.spaces[margin.left] : "";
107
+ return margin && (0, _typeof2["default"])(margin) === "object" && margin.left ? _variables.spaces[margin.left] : "";
108
+ }, function (_ref9) {
109
+ var hasAction = _ref9.hasAction;
110
+ return hasAction && ":focus {\n outline: #0095ff auto 1px;\n }";
116
111
  });
117
112
 
118
- var CardContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n height: ", ";\n width: ", ";\n &:hover {\n border-color: ", ";\n }\n"])), function (props) {
113
+ var CardContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n flex-direction: ", ";\n height: ", ";\n width: ", ";\n &:hover {\n border-color: ", ";\n }\n"])), function (props) {
114
+ return props.imagePosition === "after" ? "row-reverse" : "row";
115
+ }, function (props) {
119
116
  return props.theme.height;
120
117
  }, function (props) {
121
118
  return props.theme.width;
122
- }, function (_ref9) {
123
- var hasAction = _ref9.hasAction;
119
+ }, function (_ref10) {
120
+ var hasAction = _ref10.hasAction;
124
121
  return hasAction ? "" : "unset";
125
122
  });
126
123
 
127
- var StyledLink = _styledComponents["default"].a(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n cursor: pointer;\n text-decoration: none;\n\n :focus {\n outline-color: #0095ff;\n }\n"])));
128
-
129
- var TagImage = _styledComponents["default"].img(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n object-fit: ", ";\n"])), function (_ref10) {
130
- var imagePadding = _ref10.imagePadding;
131
- return !imagePadding ? "100%" : "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
132
- }, function (_ref11) {
124
+ var TagImage = _styledComponents["default"].img(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n object-fit: ", ";\n"])), function (_ref11) {
133
125
  var imagePadding = _ref11.imagePadding;
134
- return !imagePadding ? "100%" : "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
126
+ return !imagePadding ? "100%" : (0, _typeof2["default"])(imagePadding) !== "object" && "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
135
127
  }, function (_ref12) {
136
- var cover = _ref12.cover;
137
- return cover ? "cover" : "contain";
128
+ var imagePadding = _ref12.imagePadding;
129
+ return !imagePadding ? "100%" : (0, _typeof2["default"])(imagePadding) !== "object" && "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
130
+ }, function (_ref13) {
131
+ var imageCover = _ref13.imageCover;
132
+ return imageCover ? "cover" : "contain";
138
133
  });
139
134
 
140
- var ImageContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: 35%;\n height: 100%;\n flex-shrink: 0;\n background: ", ";\n justify-content: center;\n align-items: center;\n display: inline-flex;\n"])), function (_ref13) {
141
- var imageBgColor = _ref13.imageBgColor;
135
+ var ImageContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n width: 35%;\n height: 100%;\n background-color: ", ";\n"])), function (_ref14) {
136
+ var imageBgColor = _ref14.imageBgColor;
142
137
  return imageBgColor;
143
138
  });
144
139
 
145
- var CardContent = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n flex-grow: 1;\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n overflow: hidden;\n"])), function (_ref14) {
146
- var contentPadding = _ref14.contentPadding;
147
- return contentPadding && (0, _typeof2["default"])(contentPadding) !== "object" ? _variables.spaces[contentPadding] : "0px";
148
- }, function (_ref15) {
149
- var contentPadding = _ref15.contentPadding;
150
- return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.top ? _variables.spaces[contentPadding.top] : "";
151
- }, function (_ref16) {
152
- var contentPadding = _ref16.contentPadding;
153
- return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.right ? _variables.spaces[contentPadding.right] : "";
154
- }, function (_ref17) {
155
- var contentPadding = _ref17.contentPadding;
156
- return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.bottom ? _variables.spaces[contentPadding.bottom] : "";
157
- }, function (_ref18) {
158
- var contentPadding = _ref18.contentPadding;
159
- return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.left ? _variables.spaces[contentPadding.left] : "";
160
- });
140
+ var CardContent = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n flex-grow: 1;\n overflow: hidden;\n"])));
161
141
 
162
142
  var _default = DxcCard;
163
143
  exports["default"] = _default;
@@ -2,7 +2,6 @@ import React from "react";
2
2
  import Title from "../../.storybook/components/Title";
3
3
  import ExampleContainer from "../../.storybook/components/ExampleContainer";
4
4
  import DxcCard from "./Card";
5
- import imagePath from "./ice-cream.jpg";
6
5
  import { userEvent, within } from "@storybook/testing-library";
7
6
 
8
7
  export default {
@@ -38,104 +37,75 @@ const Card = () => (
38
37
  </ExampleContainer>
39
38
  <Title title="Default with image" theme="light" level={4} />
40
39
  <ExampleContainer>
41
- <DxcCard imageSrc={imagePath}>Default</DxcCard>
40
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300">Default</DxcCard>
42
41
  </ExampleContainer>
43
42
  <Title title="Default image with background color" theme="light" level={4} />
44
43
  <ExampleContainer>
45
- <DxcCard imageSrc={imagePath} imageBgColor="yellow">
44
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imageBgColor="yellow">
46
45
  Background color
47
46
  </DxcCard>
48
47
  </ExampleContainer>
49
48
  <Title title="Default image with position after" theme="light" level={4} />
50
49
  <ExampleContainer>
51
- <DxcCard imageSrc={imagePath} imagePosition="after">
50
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePosition="after">
52
51
  Position after
53
52
  </DxcCard>
54
53
  </ExampleContainer>
55
54
  <Title title="Image cover" theme="light" level={4} />
56
55
  <ExampleContainer>
57
- <DxcCard imageSrc={imagePath} imageCover>
56
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imageCover>
58
57
  Image cover
59
58
  </DxcCard>
60
59
  </ExampleContainer>
61
60
  <Title title="Image cover with position after" theme="light" level={4} />
62
61
  <ExampleContainer>
63
- <DxcCard imageSrc={imagePath} imageCover imagePosition="after">
62
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imageCover imagePosition="after">
64
63
  Image cover with position after
65
64
  </DxcCard>
66
65
  </ExampleContainer>
67
66
  <Title title="Image padding" theme="light" level={2} />
68
67
  <ExampleContainer>
69
68
  <Title title="Xxsmall" theme="light" level={4} />
70
- <DxcCard imageSrc={imagePath} imagePadding="xxsmall" imageCover>
69
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="xxsmall" imageCover>
71
70
  Xxsmall
72
71
  </DxcCard>
73
72
  </ExampleContainer>
74
73
  <ExampleContainer>
75
74
  <Title title="Xsmall" theme="light" level={4} />
76
- <DxcCard imageSrc={imagePath} imagePadding="xsmall" imageCover>
75
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="xsmall" imageCover>
77
76
  Xsmall
78
77
  </DxcCard>
79
78
  </ExampleContainer>
80
79
  <ExampleContainer>
81
80
  <Title title="Small" theme="light" level={4} />
82
- <DxcCard imageSrc={imagePath} imagePadding="small" imageCover>
81
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="small" imageCover>
83
82
  Small
84
83
  </DxcCard>
85
84
  </ExampleContainer>
86
85
  <ExampleContainer>
87
86
  <Title title="Medium" theme="light" level={4} />
88
- <DxcCard imageSrc={imagePath} imagePadding="medium" imageCover>
87
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="medium" imageCover>
89
88
  Medium
90
89
  </DxcCard>
91
90
  </ExampleContainer>
92
91
  <ExampleContainer>
93
92
  <Title title="Large" theme="light" level={4} />
94
- <DxcCard imageSrc={imagePath} imagePadding="large" imageCover>
93
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="large" imageCover>
95
94
  Large
96
95
  </DxcCard>
97
96
  </ExampleContainer>
98
97
  <ExampleContainer>
99
98
  <Title title="Xlarge" theme="light" level={4} />
100
- <DxcCard imageSrc={imagePath} imagePadding="xlarge" imageCover>
99
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="xlarge" imageCover>
101
100
  Xlarge
102
101
  </DxcCard>
103
102
  </ExampleContainer>
104
103
  <ExampleContainer>
105
104
  <Title title="Xxlarge" theme="light" level={4} />
106
- <DxcCard imageSrc={imagePath} imagePadding="xxlarge" imageCover>
105
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="xxlarge" imageCover>
107
106
  Xxlarge
108
107
  </DxcCard>
109
108
  </ExampleContainer>
110
- <Title title="Content padding" theme="light" level={2} />
111
- <ExampleContainer>
112
- <Title title="Xxsmall" theme="light" level={4} />
113
- <DxcCard contentPadding="xxsmall">Xxsmall</DxcCard>
114
- </ExampleContainer>
115
- <ExampleContainer>
116
- <Title title="Xsmall" theme="light" level={4} />
117
- <DxcCard contentPadding="xsmall">Xsmall</DxcCard>
118
- </ExampleContainer>
119
- <ExampleContainer>
120
- <Title title="Small" theme="light" level={4} />
121
- <DxcCard contentPadding="small">Small</DxcCard>
122
- </ExampleContainer>
123
- <ExampleContainer>
124
- <Title title="Medium" theme="light" level={4} />
125
- <DxcCard contentPadding="medium">Medium</DxcCard>
126
- </ExampleContainer>
127
- <ExampleContainer>
128
- <Title title="Large" theme="light" level={4} />
129
- <DxcCard contentPadding="large">Large</DxcCard>
130
- </ExampleContainer>
131
- <ExampleContainer>
132
- <Title title="Xlarge" theme="light" level={4} />
133
- <DxcCard contentPadding="xlarge">Xlarge</DxcCard>
134
- </ExampleContainer>
135
- <ExampleContainer>
136
- <Title title="Xxlarge" theme="light" level={4} />
137
- <DxcCard contentPadding="xxlarge">Xxlarge</DxcCard>
138
- </ExampleContainer>
139
109
  <Title title="Margin" theme="light" level={2} />
140
110
  <ExampleContainer>
141
111
  <Title title="Xxsmall" theme="light" level={4} />
package/card/Card.test.js CHANGED
@@ -6,7 +6,7 @@ var _react = _interopRequireDefault(require("react"));
6
6
 
7
7
  var _react2 = require("@testing-library/react");
8
8
 
9
- var _Card = _interopRequireDefault(require("./Card"));
9
+ var _Card = _interopRequireDefault(require("./Card.tsx"));
10
10
 
11
11
  describe("Card component tests", function () {
12
12
  test("Card renders with correct content", function () {
package/card/types.d.ts CHANGED
@@ -46,17 +46,12 @@ declare type Props = {
46
46
  * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
47
47
  */
48
48
  margin?: Space | Size;
49
- /**
50
- * Size of the padding to be applied to the content area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
51
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
52
- */
53
- contentPadding?: Space | Size;
54
49
  /**
55
50
  * Value of the tabindex given when there is an href.
56
51
  */
57
52
  tabIndex?: number;
58
53
  /**
59
- * Whether the card must be outlined.
54
+ * Determines whether or not the component should have an outline.
60
55
  */
61
56
  outlined?: boolean;
62
57
  /**
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  import CheckboxPropsType from "./types";
3
- declare const DxcCheckbox: ({ checked, defaultChecked, value, label, labelPosition, name, disabled, optional, onChange, margin, size, tabIndex, }: CheckboxPropsType) => JSX.Element;
3
+ declare const DxcCheckbox: React.ForwardRefExoticComponent<CheckboxPropsType & React.RefAttributes<HTMLDivElement>>;
4
4
  export default DxcCheckbox;