@dxc-technology/halstack-react 9.1.0 → 10.1.0

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 (109) hide show
  1. package/HalstackContext.d.ts +11 -6
  2. package/HalstackContext.js +1 -1
  3. package/README.md +47 -0
  4. package/accordion/Accordion.d.ts +1 -1
  5. package/accordion/Accordion.js +2 -14
  6. package/accordion/Accordion.stories.tsx +2 -100
  7. package/accordion/types.d.ts +0 -12
  8. package/accordion-group/AccordionGroup.d.ts +4 -3
  9. package/accordion-group/AccordionGroup.js +21 -42
  10. package/accordion-group/AccordionGroup.stories.tsx +77 -76
  11. package/accordion-group/AccordionGroup.test.js +6 -16
  12. package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
  13. package/accordion-group/AccordionGroupAccordion.js +43 -0
  14. package/accordion-group/types.d.ts +0 -12
  15. package/alert/Alert.js +1 -3
  16. package/box/Box.d.ts +1 -1
  17. package/box/Box.js +5 -22
  18. package/box/Box.stories.tsx +25 -53
  19. package/box/types.d.ts +0 -12
  20. package/bulleted-list/BulletedList.js +4 -2
  21. package/bulleted-list/BulletedList.stories.tsx +7 -1
  22. package/bulleted-list/types.d.ts +31 -4
  23. package/button/Button.d.ts +1 -1
  24. package/button/Button.js +45 -54
  25. package/button/Button.stories.tsx +3 -3
  26. package/button/Button.test.js +11 -0
  27. package/button/types.d.ts +4 -0
  28. package/card/Card.d.ts +1 -1
  29. package/card/Card.js +18 -35
  30. package/card/Card.stories.tsx +0 -29
  31. package/card/types.d.ts +1 -7
  32. package/chip/Chip.js +23 -36
  33. package/chip/Chip.stories.tsx +25 -17
  34. package/common/OpenSans.css +68 -80
  35. package/common/coreTokens.d.ts +146 -0
  36. package/common/coreTokens.js +167 -0
  37. package/common/variables.d.ts +9 -144
  38. package/common/variables.js +960 -1095
  39. package/date-input/Calendar.js +2 -2
  40. package/dialog/Dialog.d.ts +1 -1
  41. package/dialog/Dialog.js +4 -22
  42. package/dialog/Dialog.stories.tsx +52 -176
  43. package/dialog/types.d.ts +0 -13
  44. package/dropdown/DropdownMenu.js +5 -1
  45. package/file-input/FileItem.js +2 -2
  46. package/file-input/types.d.ts +1 -1
  47. package/flex/Flex.js +4 -2
  48. package/flex/Flex.stories.tsx +24 -10
  49. package/flex/types.d.ts +70 -5
  50. package/footer/Footer.d.ts +1 -1
  51. package/footer/Footer.js +43 -61
  52. package/footer/Footer.stories.tsx +19 -95
  53. package/footer/Footer.test.js +3 -1
  54. package/footer/types.d.ts +10 -12
  55. package/grid/Grid.d.ts +1 -1
  56. package/grid/Grid.js +1 -1
  57. package/grid/Grid.stories.tsx +38 -38
  58. package/header/Header.d.ts +1 -1
  59. package/header/Header.js +3 -30
  60. package/header/Header.stories.tsx +7 -71
  61. package/header/types.d.ts +0 -14
  62. package/image/Image.d.ts +4 -0
  63. package/image/Image.js +85 -0
  64. package/image/Image.stories.tsx +127 -0
  65. package/image/types.d.ts +72 -0
  66. package/inset/Inset.stories.tsx +1 -1
  67. package/layout/ApplicationLayout.d.ts +2 -2
  68. package/layout/ApplicationLayout.js +14 -11
  69. package/layout/ApplicationLayout.stories.tsx +1 -1
  70. package/layout/Icons.d.ts +7 -4
  71. package/layout/Icons.js +52 -56
  72. package/link/Link.js +1 -1
  73. package/main.d.ts +2 -1
  74. package/main.js +8 -0
  75. package/nav-tabs/NavTabs.d.ts +2 -2
  76. package/nav-tabs/NavTabs.js +7 -10
  77. package/nav-tabs/NavTabs.stories.tsx +14 -0
  78. package/nav-tabs/Tab.js +22 -26
  79. package/nav-tabs/types.d.ts +8 -9
  80. package/number-input/NumberInput.d.ts +7 -0
  81. package/number-input/NumberInput.js +6 -4
  82. package/number-input/NumberInput.test.js +278 -95
  83. package/package.json +2 -2
  84. package/paginator/Paginator.js +1 -1
  85. package/paginator/Paginator.test.js +13 -0
  86. package/password-input/Icons.d.ts +6 -0
  87. package/password-input/Icons.js +39 -0
  88. package/password-input/PasswordInput.js +35 -82
  89. package/password-input/PasswordInput.stories.tsx +1 -0
  90. package/password-input/PasswordInput.test.js +27 -34
  91. package/radio-group/Radio.js +10 -10
  92. package/radio-group/RadioGroup.js +8 -10
  93. package/select/Select.stories.tsx +3 -3
  94. package/select/Select.test.js +4 -4
  95. package/sidenav/Sidenav.js +21 -23
  96. package/text-input/TextInput.js +62 -78
  97. package/text-input/TextInput.stories.tsx +1 -1
  98. package/toggle-group/ToggleGroup.d.ts +2 -2
  99. package/toggle-group/ToggleGroup.js +79 -56
  100. package/toggle-group/ToggleGroup.stories.tsx +6 -3
  101. package/toggle-group/ToggleGroup.test.js +37 -23
  102. package/toggle-group/types.d.ts +22 -13
  103. package/useTheme.d.ts +9 -1
  104. package/utils/FocusLock.js +2 -3
  105. package/card/ice-cream.jpg +0 -0
  106. package/number-input/NumberInputContext.d.ts +0 -4
  107. package/number-input/NumberInputContext.js +0 -19
  108. package/number-input/numberInputContextTypes.d.ts +0 -19
  109. /package/{number-input/numberInputContextTypes.js → image/types.js} +0 -0
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import Title from "../../.storybook/components/Title";
3
3
  import ExampleContainer from "../../.storybook/components/ExampleContainer";
4
4
  import DxcBox from "./Box";
5
+ import DxcInset from "../inset/Inset";
5
6
  import { HalstackProvider } from "../HalstackContext";
6
7
 
7
8
  export default {
@@ -19,99 +20,70 @@ export const Chromatic = () => (
19
20
  <>
20
21
  <Title title="Display flex" theme="light" level={2} />
21
22
  <ExampleContainer>
22
- <DxcBox display="flex" padding="medium">
23
- Box
23
+ <DxcBox display="flex">
24
+ <DxcInset space="2rem">Box</DxcInset>
24
25
  </DxcBox>
25
26
  </ExampleContainer>
26
27
  <Title title="ShadowDepth" theme="light" level={2} />
27
28
  <ExampleContainer>
28
29
  <Title title="ShadowDepth 0" theme="light" level={4} />
29
- <DxcBox shadowDepth={0} margin="medium" padding="medium">
30
- Box
30
+ <DxcBox shadowDepth={0} margin="medium">
31
+ <DxcInset space="2rem">Box</DxcInset>
31
32
  </DxcBox>
32
33
  </ExampleContainer>
33
34
  <ExampleContainer>
34
35
  <Title title="ShadowDepth 1" theme="light" level={4} />
35
- <DxcBox shadowDepth={1} margin="medium" padding="medium">
36
- Box
36
+ <DxcBox shadowDepth={1} margin="medium">
37
+ <DxcInset space="2rem">Box</DxcInset>
37
38
  </DxcBox>
38
39
  </ExampleContainer>
39
40
  <ExampleContainer>
40
41
  <Title title="ShadowDepth 2" theme="light" level={4} />
41
- <DxcBox shadowDepth={2} margin="medium" padding="medium">
42
- Box
42
+ <DxcBox shadowDepth={2} margin="medium">
43
+ <DxcInset space="2rem">Box</DxcInset>
43
44
  </DxcBox>
44
45
  </ExampleContainer>
45
- <Title title="Paddings" theme="light" level={2} />
46
- <ExampleContainer>
47
- <Title title="Xxsmall padding" theme="light" level={4} />
48
- <DxcBox padding="xxsmall">Box</DxcBox>
49
- </ExampleContainer>
50
- <ExampleContainer>
51
- <Title title="Xsmall padding" theme="light" level={4} />
52
- <DxcBox padding="xsmall">Box</DxcBox>
53
- </ExampleContainer>
54
- <ExampleContainer>
55
- <Title title="Small padding" theme="light" level={4} />
56
- <DxcBox padding="small">Box</DxcBox>
57
- </ExampleContainer>
58
- <ExampleContainer>
59
- <Title title="Medium padding" theme="light" level={4} />
60
- <DxcBox padding="medium">Box</DxcBox>
61
- </ExampleContainer>
62
- <ExampleContainer>
63
- <Title title="Large padding" theme="light" level={4} />
64
- <DxcBox padding="large">Box</DxcBox>
65
- </ExampleContainer>
66
- <ExampleContainer>
67
- <Title title="Xlarge padding" theme="light" level={4} />
68
- <DxcBox padding="xlarge">Box</DxcBox>
69
- </ExampleContainer>
70
- <ExampleContainer>
71
- <Title title="Xxlarge padding" theme="light" level={4} />
72
- <DxcBox padding="xxlarge">Box</DxcBox>
73
- </ExampleContainer>
74
46
  <Title title="Margins" theme="light" level={2} />
75
47
  <ExampleContainer>
76
48
  <Title title="Xxsmall margin" theme="light" level={4} />
77
- <DxcBox margin="xxsmall" padding="medium">
78
- Box
49
+ <DxcBox margin="xxsmall">
50
+ <DxcInset space="2rem">Box</DxcInset>
79
51
  </DxcBox>
80
52
  </ExampleContainer>
81
53
  <ExampleContainer>
82
54
  <Title title="Xsmall margin" theme="light" level={4} />
83
- <DxcBox margin="xsmall" padding="medium">
84
- Box
55
+ <DxcBox margin="xsmall">
56
+ <DxcInset space="2rem">Box</DxcInset>
85
57
  </DxcBox>
86
58
  </ExampleContainer>
87
59
  <ExampleContainer>
88
60
  <Title title="Small margin" theme="light" level={4} />
89
- <DxcBox margin="small" padding="medium">
90
- Box
61
+ <DxcBox margin="small">
62
+ <DxcInset space="2rem">Box</DxcInset>
91
63
  </DxcBox>
92
64
  </ExampleContainer>
93
65
  <ExampleContainer>
94
66
  <Title title="Medium margin" theme="light" level={4} />
95
- <DxcBox margin="medium" padding="medium">
96
- Box
67
+ <DxcBox margin="medium">
68
+ <DxcInset space="2rem">Box</DxcInset>
97
69
  </DxcBox>
98
70
  </ExampleContainer>
99
71
  <ExampleContainer>
100
72
  <Title title="Large margin" theme="light" level={4} />
101
- <DxcBox margin="large" padding="medium">
102
- Box
73
+ <DxcBox margin="large">
74
+ <DxcInset space="2rem">Box</DxcInset>
103
75
  </DxcBox>
104
76
  </ExampleContainer>
105
77
  <ExampleContainer>
106
78
  <Title title="Xlarge margin" theme="light" level={4} />
107
- <DxcBox margin="xlarge" padding="medium">
108
- Box
79
+ <DxcBox margin="xlarge">
80
+ <DxcInset space="2rem">Box</DxcInset>
109
81
  </DxcBox>
110
82
  </ExampleContainer>
111
83
  <ExampleContainer>
112
84
  <Title title="Xxlarge margin" theme="light" level={4} />
113
- <DxcBox margin="xxlarge" padding="medium">
114
- Box
85
+ <DxcBox margin="xxlarge">
86
+ <DxcInset space="2rem">Box</DxcInset>
115
87
  </DxcBox>
116
88
  </ExampleContainer>
117
89
  <Title title="Sizes" theme="light" level={2} />
@@ -138,8 +110,8 @@ export const Chromatic = () => (
138
110
  <Title title="Opinionated theme" theme="light" level={2} />
139
111
  <ExampleContainer>
140
112
  <HalstackProvider theme={opinionatedTheme}>
141
- <DxcBox display="flex" padding="medium">
142
- Box
113
+ <DxcBox display="flex">
114
+ <DxcInset space="2rem">Box</DxcInset>
143
115
  </DxcBox>
144
116
  </HalstackProvider>
145
117
  </ExampleContainer>
package/box/types.d.ts CHANGED
@@ -6,12 +6,6 @@ declare type Margin = {
6
6
  left?: Space;
7
7
  right?: Space;
8
8
  };
9
- declare type Padding = {
10
- top?: Space;
11
- bottom?: Space;
12
- left?: Space;
13
- right?: Space;
14
- };
15
9
  declare type Props = {
16
10
  /**
17
11
  * The size of the shadow to be displayed around the box.
@@ -30,12 +24,6 @@ declare type Props = {
30
24
  * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
31
25
  */
32
26
  margin?: Space | Margin;
33
- /**
34
- * @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
35
- * Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
36
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
37
- */
38
- padding?: Space | Padding;
39
27
  /**
40
28
  * Size of the component.
41
29
  */
@@ -57,7 +57,9 @@ var DxcBulletedList = function DxcBulletedList(_ref2) {
57
57
  backgroundType: backgroundType
58
58
  })) : type === "icon" ? /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Icon, {
59
59
  backgroundType: backgroundType
60
- }, icon)) : /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Disc, {
60
+ }, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
61
+ src: icon
62
+ }) : icon)) : /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Disc, {
61
63
  backgroundType: backgroundType
62
64
  })), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
63
65
  color: backgroundType && backgroundType === "dark" ? colorsTheme.bulletedList.fontColorOnDark : colorsTheme.bulletedList.fontColor
@@ -73,7 +75,7 @@ var Bullet = _styledComponents["default"].div(_templateObject2 || (_templateObje
73
75
 
74
76
  var GeneralContent = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: grid;\n grid-template-columns: auto 1fr;\n align-items: center;\n"])));
75
77
 
76
- var Icon = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n width: auto;\n margin-right: ", ";\n align-content: center;\n color: ", ";\n & > svg {\n height: ", ";\n width: ", ";\n }\n"])), function (props) {
78
+ var Icon = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n width: auto;\n margin-right: ", ";\n align-content: center;\n color: ", ";\n svg,\n img {\n height: ", ";\n width: ", ";\n }\n"])), function (props) {
77
79
  return props.theme.bulletMarginRight;
78
80
  }, function (props) {
79
81
  return props.backgroundType && props.backgroundType === "dark" ? props.theme.fontColorOnDark : props.theme.fontColor;
@@ -20,12 +20,18 @@ const icon = (
20
20
  export const Chromatic = () => (
21
21
  <>
22
22
  <ExampleContainer>
23
- <Title title="Icon list" level={4} />
23
+ <Title title="Icon list (SVG)" level={4} />
24
24
  <DxcBulletedList type="icon" icon={icon}>
25
25
  <DxcBulletedList.Item>Code</DxcBulletedList.Item>
26
26
  <DxcBulletedList.Item>Usage</DxcBulletedList.Item>
27
27
  <DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
28
28
  </DxcBulletedList>
29
+ <Title title="Icon list (path)" level={4} />
30
+ <DxcBulletedList type="icon" icon="https://upload.wikimedia.org/wikipedia/commons/e/e0/Check_green_icon.svg">
31
+ <DxcBulletedList.Item>Code</DxcBulletedList.Item>
32
+ <DxcBulletedList.Item>Usage</DxcBulletedList.Item>
33
+ <DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
34
+ </DxcBulletedList>
29
35
  <Title title="Number list" level={4} />
30
36
  <DxcBulletedList type="number">
31
37
  <DxcBulletedList.Item>Code</DxcBulletedList.Item>
@@ -1,11 +1,38 @@
1
1
  /// <reference types="react" />
2
- declare type SVG = React.ReactNode & (React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>);
3
- declare type Props = {
2
+ declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
3
+ declare type IconProps = {
4
+ /**
5
+ * Defines the style of the bullet point in the list.
6
+ */
7
+ type: "icon";
8
+ /**
9
+ * Icon to display as bullet.
10
+ */
11
+ icon: string | SVG;
12
+ /**
13
+ * Text to be shown in the list.
14
+ */
4
15
  children: React.ReactNode;
5
- type?: "disc" | "circle" | "square" | "number" | "icon";
6
- icon?: string | SVG;
7
16
  };
17
+ declare type OtherProps = {
18
+ /**
19
+ * Defines the style of the bullet point in the list.
20
+ */
21
+ type?: "disc" | "circle" | "square" | "number";
22
+ /**
23
+ * Icon to display as bullet.
24
+ */
25
+ icon?: never;
26
+ /**
27
+ * Text to be shown in the list.
28
+ */
29
+ children: React.ReactNode;
30
+ };
31
+ declare type Props = IconProps | OtherProps;
8
32
  export default Props;
9
33
  export declare type BulletedListItemPropsType = {
34
+ /**
35
+ * Text to be shown in the list.
36
+ */
10
37
  children?: React.ReactNode;
11
38
  };
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import ButtonPropsType from "./types";
3
- declare const DxcButton: ({ label, mode, disabled, iconPosition, type, icon, onClick, margin, size, tabIndex, }: ButtonPropsType) => JSX.Element;
3
+ declare const DxcButton: ({ label, mode, disabled, iconPosition, title, type, icon, onClick, margin, size, tabIndex, }: ButtonPropsType) => JSX.Element;
4
4
  export default DxcButton;
package/button/Button.js CHANGED
@@ -31,22 +31,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
31
31
 
32
32
  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
33
 
34
- var sizes = {
35
- small: "42px",
36
- medium: "120px",
37
- large: "240px",
38
- fillParent: "100%",
39
- fitContent: "fit-content"
40
- };
41
-
42
- var calculateWidth = function calculateWidth(margin, size) {
43
- if (size === "fillParent") {
44
- return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
45
- }
46
-
47
- return sizes[size];
48
- };
49
-
50
34
  var DxcButton = function DxcButton(_ref) {
51
35
  var _ref$label = _ref.label,
52
36
  label = _ref$label === void 0 ? "" : _ref$label,
@@ -56,6 +40,7 @@ var DxcButton = function DxcButton(_ref) {
56
40
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
57
41
  _ref$iconPosition = _ref.iconPosition,
58
42
  iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
43
+ title = _ref.title,
59
44
  _ref$type = _ref.type,
60
45
  type = _ref$type === void 0 ? "button" : _ref$type,
61
46
  icon = _ref.icon,
@@ -72,31 +57,50 @@ var DxcButton = function DxcButton(_ref) {
72
57
  return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
73
58
  theme: colorsTheme.button
74
59
  }, /*#__PURE__*/_react["default"].createElement(Button, {
75
- type: type,
76
- mode: mode !== "primary" && mode !== "secondary" && mode !== "text" ? "primary" : mode,
60
+ "aria-label": title,
77
61
  disabled: disabled,
62
+ onClick: function onClick() {
63
+ _onClick();
64
+ },
78
65
  tabIndex: disabled ? -1 : tabIndex,
66
+ title: title,
67
+ type: type,
68
+ $mode: mode !== "primary" && mode !== "secondary" && mode !== "text" ? "primary" : mode,
69
+ hasLabel: label ? true : false,
70
+ hasIcon: icon ? true : false,
71
+ iconPosition: iconPosition,
79
72
  backgroundType: backgroundType,
80
73
  size: size,
81
- margin: margin,
82
- onClick: function onClick() {
83
- _onClick();
84
- }
85
- }, label && iconPosition === "after" && /*#__PURE__*/_react["default"].createElement(LabelContainer, {
86
- icon: icon,
87
- iconPosition: iconPosition
88
- }, label), icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
89
- label: label,
90
- iconPosition: iconPosition
91
- }, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
74
+ margin: margin
75
+ }, label && /*#__PURE__*/_react["default"].createElement(LabelContainer, null, label), icon && /*#__PURE__*/_react["default"].createElement(IconContainer, null, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
92
76
  src: icon
93
- }) : icon), label && iconPosition === "before" && /*#__PURE__*/_react["default"].createElement(LabelContainer, {
94
- icon: icon,
95
- iconPosition: iconPosition
96
- }, label)));
77
+ }) : icon)));
78
+ };
79
+
80
+ var sizes = {
81
+ small: "42px",
82
+ medium: "120px",
83
+ large: "240px",
84
+ fillParent: "100%",
85
+ fitContent: "fit-content"
86
+ };
87
+
88
+ var calculateWidth = function calculateWidth(margin, size) {
89
+ return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
90
+ };
91
+
92
+ var getButtonStyles = function getButtonStyles(props) {
93
+ var $mode = props.$mode,
94
+ backgroundType = props.backgroundType,
95
+ disabled = props.disabled;
96
+ return "\n border-radius: ".concat($mode === "primary" ? props.theme.primaryBorderRadius : $mode === "secondary" ? props.theme.secondaryBorderRadius : props.theme.textBorderRadius, ";\n border-width: ").concat($mode === "primary" ? props.theme.primaryBorderThickness : $mode === "secondary" ? props.theme.secondaryBorderThickness : props.theme.textBorderThickness, ";\n border-style: ").concat($mode === "primary" ? props.theme.primaryBorderStyle : $mode === "secondary" ? props.theme.secondaryBorderStyle : props.theme.textBorderStyle, ";\n font-family: ").concat($mode === "primary" ? props.theme.primaryFontFamily : $mode === "secondary" ? props.theme.secondaryFontFamily : props.theme.textFontFamily, ";\n font-size: ").concat($mode === "primary" ? props.theme.primaryFontSize : $mode === "secondary" ? props.theme.secondaryFontSize : props.theme.textFontSize, ";\n font-weight: ").concat($mode === "primary" ? props.theme.primaryFontWeight : $mode === "secondary" ? props.theme.secondaryFontWeight : props.theme.textFontWeight, ";\n background-color: ").concat($mode === "primary" ? backgroundType === "dark" ? props.theme.primaryBackgroundColorOnDark : props.theme.primaryBackgroundColor : $mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryBackgroundColorOnDark : props.theme.secondaryBackgroundColor : backgroundType === "dark" ? props.theme.textBackgroundColorOnDark : props.theme.textBackgroundColor, ";\n color: ").concat($mode === "primary" ? backgroundType === "dark" ? props.theme.primaryFontColorOnDark : props.theme.primaryFontColor : $mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryFontColorOnDark : props.theme.secondaryFontColor : backgroundType === "dark" ? props.theme.textFontColorOnDark : props.theme.textFontColor, ";\n border-color: ").concat($mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryBorderColorOnDark : props.theme.secondaryBorderColor : "", ";\n &:hover {\n background-color: ").concat($mode === "primary" ? backgroundType === "dark" ? props.theme.primaryHoverBackgroundColorOnDark : props.theme.primaryHoverBackgroundColor : $mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryHoverBackgroundColorOnDark : props.theme.secondaryHoverBackgroundColor : backgroundType === "dark" ? props.theme.textHoverBackgroundColorOnDark : props.theme.textHoverBackgroundColor, ";\n color: ").concat($mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor : "", ";\n }\n &:focus {\n border-color: ").concat($mode === "secondary" ? "transparent" : "", ";\n }\n &:active {\n background-color: ").concat($mode === "primary" ? backgroundType === "dark" ? props.theme.primaryActiveBackgroundColorOnDark : props.theme.primaryActiveBackgroundColor : $mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryActiveBackgroundColorOnDark : props.theme.secondaryActiveBackgroundColor : backgroundType === "dark" ? props.theme.textActiveBackgroundColorOnDark : props.theme.textActiveBackgroundColor, ";\n color: ").concat($mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor : "", ";\n border-color: ").concat($mode === "secondary" ? "transparent" : "", ";\n outline: none;\n box-shadow: ").concat(!disabled ? "0 0 0 2px ".concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor) : "", ";\n }\n &:disabled {\n cursor: not-allowed;\n background-color: ").concat($mode === "primary" ? backgroundType === "dark" ? props.theme.primaryDisabledBackgroundColorOnDark : props.theme.primaryDisabledBackgroundColor : $mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryDisabledBackgroundColorOnDark : props.theme.secondaryDisabledBackgroundColor : backgroundType === "dark" ? props.theme.textDisabledBackgroundColorOnDark : props.theme.textDisabledBackgroundColor, ";\n color: ").concat($mode === "primary" ? backgroundType === "dark" ? props.theme.primaryDisabledFontColorOnDark : props.theme.primaryDisabledFontColor : $mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryDisabledFontColorOnDark : props.theme.secondaryDisabledFontColor : backgroundType === "dark" ? props.theme.textDisabledFontColorOnDark : props.theme.textDisabledFontColor, ";\n border-color: ").concat($mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryDisabledBorderColorOnDark : props.theme.secondaryDisabledBorderColor : "", ";\n }\n ");
97
97
  };
98
98
 
99
- var Button = _styledComponents["default"].button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: inline-flex;\n width: ", ";\n height: 40px;\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n align-items: center;\n justify-content: center;\n box-shadow: 0 0 0 2px transparent;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n cursor: pointer;\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px\n ", ";\n }\n ", "\n"])), function (props) {
99
+ var Button = _styledComponents["default"].button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n flex-direction: ", ";\n gap: 0.5rem;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: 40px;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n box-shadow: 0 0 0 2px transparent;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n cursor: pointer;\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px\n ", ";\n }\n\n ", "\n"])), function (props) {
100
+ return props.iconPosition === "after" ? "row" : "row-reverse";
101
+ }, function (props) {
102
+ return calculateWidth(props.margin, props.size);
103
+ }, function (props) {
100
104
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
101
105
  }, function (props) {
102
106
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
@@ -106,16 +110,14 @@ var Button = _styledComponents["default"].button(_templateObject || (_templateOb
106
110
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
107
111
  }, function (props) {
108
112
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
109
- }, function (props) {
110
- return calculateWidth(props.margin, props.size);
111
- }, function (props) {
112
- return props.theme.paddingLeft;
113
- }, function (props) {
114
- return props.theme.paddingRight;
115
113
  }, function (props) {
116
114
  return props.theme.paddingTop;
117
115
  }, function (props) {
118
116
  return props.theme.paddingBottom;
117
+ }, function (props) {
118
+ return props.hasIcon && !props.hasLabel ? props.theme.paddingLeft : "calc(".concat(props.theme.paddingLeft, " + 8px)");
119
+ }, function (props) {
120
+ return props.hasIcon && !props.hasLabel ? props.theme.paddingRight : "calc(".concat(props.theme.paddingRight, " + 8px)");
119
121
  }, function (props) {
120
122
  return props.theme.fontFamily;
121
123
  }, function (props) {
@@ -127,27 +129,16 @@ var Button = _styledComponents["default"].button(_templateObject || (_templateOb
127
129
  }, function (props) {
128
130
  return props.backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor;
129
131
  }, function (props) {
130
- var mode = props.mode,
131
- backgroundType = props.backgroundType,
132
- disabled = props.disabled;
133
- return "\n border-radius: ".concat(props.mode === "primary" ? props.theme.primaryBorderRadius : props.mode === "secondary" ? props.theme.secondaryBorderRadius : props.theme.textBorderRadius, ";\n border-width: ").concat(props.mode === "primary" ? props.theme.primaryBorderThickness : props.mode === "secondary" ? props.theme.secondaryBorderThickness : props.theme.textBorderThickness, ";\n border-style: ").concat(mode === "primary" ? props.theme.primaryBorderStyle : mode === "secondary" ? props.theme.secondaryBorderStyle : props.theme.textBorderStyle, ";\n font-family: ").concat(mode === "primary" ? props.theme.primaryFontFamily : mode === "secondary" ? props.theme.secondaryFontFamily : props.theme.textFontFamily, ";\n font-size: ").concat(mode === "primary" ? props.theme.primaryFontSize : mode === "secondary" ? props.theme.secondaryFontSize : props.theme.textFontSize, ";\n font-weight: ").concat(mode === "primary" ? props.theme.primaryFontWeight : mode === "secondary" ? props.theme.secondaryFontWeight : props.theme.textFontWeight, ";\n background-color: ").concat(mode === "primary" ? backgroundType === "dark" ? props.theme.primaryBackgroundColorOnDark : props.theme.primaryBackgroundColor : mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryBackgroundColorOnDark : props.theme.secondaryBackgroundColor : backgroundType === "dark" ? props.theme.textBackgroundColorOnDark : props.theme.textBackgroundColor, ";\n color: ").concat(mode === "primary" ? backgroundType === "dark" ? props.theme.primaryFontColorOnDark : props.theme.primaryFontColor : mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryFontColorOnDark : props.theme.secondaryFontColor : backgroundType === "dark" ? props.theme.textFontColorOnDark : props.theme.textFontColor, ";\n border-color: ").concat(mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryBorderColorOnDark : props.theme.secondaryBorderColor : "", ";\n &:hover {\n background-color: ").concat(mode === "primary" ? backgroundType === "dark" ? props.theme.primaryHoverBackgroundColorOnDark : props.theme.primaryHoverBackgroundColor : mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryHoverBackgroundColorOnDark : props.theme.secondaryHoverBackgroundColor : backgroundType === "dark" ? props.theme.textHoverBackgroundColorOnDark : props.theme.textHoverBackgroundColor, ";\n color: ").concat(mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor : "", ";\n }\n &:focus {\n border-color: ").concat(mode === "secondary" ? "transparent" : "", ";\n }\n &:active {\n background-color: ").concat(mode === "primary" ? backgroundType === "dark" ? props.theme.primaryActiveBackgroundColorOnDark : props.theme.primaryActiveBackgroundColor : mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryActiveBackgroundColorOnDark : props.theme.secondaryActiveBackgroundColor : backgroundType === "dark" ? props.theme.textActiveBackgroundColorOnDark : props.theme.textActiveBackgroundColor, ";\n color: ").concat(mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor : "", ";\n border-color: ").concat(mode === "secondary" ? "transparent" : "", ";\n outline: none;\n box-shadow: ").concat(!disabled ? "0 0 0 2px ".concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor) : "", ";\n }\n &:disabled {\n cursor: not-allowed;\n background-color: ").concat(mode === "primary" ? backgroundType === "dark" ? props.theme.primaryDisabledBackgroundColorOnDark : props.theme.primaryDisabledBackgroundColor : mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryDisabledBackgroundColorOnDark : props.theme.secondaryDisabledBackgroundColor : backgroundType === "dark" ? props.theme.textDisabledBackgroundColorOnDark : props.theme.textDisabledBackgroundColor, ";\n color: ").concat(mode === "primary" ? backgroundType === "dark" ? props.theme.primaryDisabledFontColorOnDark : props.theme.primaryDisabledFontColor : mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryDisabledFontColorOnDark : props.theme.secondaryDisabledFontColor : backgroundType === "dark" ? props.theme.textDisabledFontColorOnDark : props.theme.textDisabledFontColor, ";\n border-color: ").concat(mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryDisabledBorderColorOnDark : props.theme.secondaryDisabledBorderColor : "", ";\n }\n ");
132
+ return getButtonStyles(props);
134
133
  });
135
134
 
136
- var LabelContainer = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n line-height: ", ";\n font-size: ", ";\n text-overflow: ellipsis;\n overflow: hidden;\n text-transform: none;\n white-space: nowrap;\n margin-right: ", ";\n margin-left: ", ";\n"])), function (props) {
135
+ var LabelContainer = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n line-height: ", ";\n font-size: ", ";\n text-overflow: ellipsis;\n overflow: hidden;\n text-transform: none;\n white-space: nowrap;\n"])), function (props) {
137
136
  return props.theme.labelFontLineHeight;
138
137
  }, function (props) {
139
138
  return props.theme.fontSize;
140
- }, function (props) {
141
- return !props.icon || props.iconPosition === "before" ? "8px" : "0px";
142
- }, function (props) {
143
- return !props.icon || props.iconPosition === "after" ? "8px" : "0px";
144
139
  });
145
140
 
146
- var IconContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n margin-left: ", ";\n margin-right: ", ";\n\n img,\n svg {\n height: 24px;\n width: 24px;\n }\n"])), function (props) {
147
- return !props.label ? "0px" : props.iconPosition === "after" && props.label !== "" && "8px" || "8px";
148
- }, function (props) {
149
- return !props.label ? "0px" : props.iconPosition === "before" && props.label !== "" && "8px" || "8px";
150
- });
141
+ var IconContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n img,\n svg {\n height: 24px;\n width: 24px;\n }\n"])));
151
142
 
152
143
  var _default = DxcButton;
153
144
  exports["default"] = _default;
@@ -133,7 +133,7 @@ export const Chromatic = () => (
133
133
  <Title title="Only icon (image)" theme="light" level={4} />
134
134
  <DxcButton
135
135
  mode="secondary"
136
- icon="https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons/images/icon-and-image-large-icon-settings_2x.png"
136
+ icon="https://www.freepnglogos.com/uploads/facebook-logo-design-1.png"
137
137
  />
138
138
  </ExampleContainer>
139
139
  <Title title="Text" theme="light" level={2} />
@@ -165,7 +165,7 @@ export const Chromatic = () => (
165
165
  <Title title="Only icon (image)" theme="light" level={4} />
166
166
  <DxcButton
167
167
  mode="text"
168
- icon="https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons/images/icon-and-image-large-icon-settings_2x.png"
168
+ icon="https://www.freepnglogos.com/uploads/facebook-logo-design-1.png"
169
169
  />
170
170
  </ExampleContainer>
171
171
  <BackgroundColorProvider color="#333333">
@@ -339,7 +339,7 @@ export const Chromatic = () => (
339
339
  </ExampleContainer>
340
340
  <Title title="Inside a flex" theme="light" level={2} />
341
341
  <ExampleContainer>
342
- <DxcFlex direction="column" gap="0.75rem">
342
+ <DxcFlex direction="column" gap="1rem">
343
343
  <DxcButton label="Button" />
344
344
  <DxcButton label="Button" />
345
345
  <DxcButton label="Button" />
@@ -32,4 +32,15 @@ describe("Button component tests", function () {
32
32
 
33
33
  expect(onClick).toHaveBeenCalled();
34
34
  });
35
+ test("Renders with correct accessibility attributes", function () {
36
+ var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
37
+ label: "Home",
38
+ title: "Go home"
39
+ })),
40
+ getByRole = _render3.getByRole;
41
+
42
+ var button = getByRole("button");
43
+ expect(button.getAttribute("aria-label")).toBe("Go home");
44
+ expect(button.getAttribute("title")).toBe("Go home");
45
+ });
35
46
  });
package/button/types.d.ts CHANGED
@@ -24,6 +24,10 @@ declare type Props = {
24
24
  * Whether the icon should appear after or before the label.
25
25
  */
26
26
  iconPosition?: "before" | "after";
27
+ /**
28
+ * Value for the HTML properties title and aria-label.
29
+ */
30
+ title?: string;
27
31
  /**
28
32
  * 'type' html prop of the button.
29
33
  */
package/card/Card.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import CardPropsType from "./types";
3
- declare const DxcCard: ({ imageSrc, imageBgColor, imagePadding, imagePosition, linkHref, onClick, imageCover, margin, contentPadding, tabIndex, outlined, children, }: CardPropsType) => JSX.Element;
3
+ declare const DxcCard: ({ imageSrc, imageBgColor, imagePadding, imagePosition, linkHref, onClick, imageCover, margin, tabIndex, outlined, children, }: CardPropsType) => JSX.Element;
4
4
  export default DxcCard;
package/card/Card.js CHANGED
@@ -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,15 +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
- imageCover: imageCover,
64
- src: imageSrc
65
- }));
66
-
67
- return /*#__PURE__*/_react["default"].createElement(StyledDxcCard, {
58
+ return /*#__PURE__*/_react["default"].createElement(Card, {
59
+ hasAction: onClick || linkHref ? true : false,
68
60
  margin: margin,
69
61
  onMouseEnter: function onMouseEnter() {
70
62
  return changeIsHovered(true);
@@ -73,7 +65,6 @@ var DxcCard = function DxcCard(_ref) {
73
65
  return changeIsHovered(false);
74
66
  },
75
67
  onClick: onClick,
76
- hasAction: onClick || linkHref,
77
68
  tabIndex: onClick || linkHref ? tabIndex : -1,
78
69
  as: linkHref && "a",
79
70
  href: linkHref
@@ -82,13 +73,18 @@ var DxcCard = function DxcCard(_ref) {
82
73
  }, /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
83
74
  theme: colorsTheme.card
84
75
  }, /*#__PURE__*/_react["default"].createElement(CardContainer, {
85
- hasAction: onClick || linkHref
86
- }, imageSrc && imagePosition === "before" && imageComponent, /*#__PURE__*/_react["default"].createElement(CardContent, {
87
- contentPadding: contentPadding
88
- }, children), imageSrc && imagePosition === "after" && imageComponent))));
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)))));
89
85
  };
90
86
 
91
- 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 text-decoration: none;\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) {
92
88
  var hasAction = _ref2.hasAction;
93
89
  return hasAction && "pointer" || "unset";
94
90
  }, function (_ref3) {
@@ -111,10 +107,12 @@ var StyledDxcCard = _styledComponents["default"].div(_templateObject || (_templa
111
107
  return margin && (0, _typeof2["default"])(margin) === "object" && margin.left ? _variables.spaces[margin.left] : "";
112
108
  }, function (_ref9) {
113
109
  var hasAction = _ref9.hasAction;
114
- return hasAction && ":focus {\n outline: #0095ff auto 1px;\n }";
110
+ return hasAction && ":focus {\n outline: #0095ff auto 1px;\n }";
115
111
  });
116
112
 
117
- 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) {
118
116
  return props.theme.height;
119
117
  }, function (props) {
120
118
  return props.theme.width;
@@ -134,27 +132,12 @@ var TagImage = _styledComponents["default"].img(_templateObject3 || (_templateOb
134
132
  return imageCover ? "cover" : "contain";
135
133
  });
136
134
 
137
- var ImageContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (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 (_ref14) {
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) {
138
136
  var imageBgColor = _ref14.imageBgColor;
139
137
  return imageBgColor;
140
138
  });
141
139
 
142
- var CardContent = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (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 (_ref15) {
143
- var contentPadding = _ref15.contentPadding;
144
- return contentPadding && (0, _typeof2["default"])(contentPadding) !== "object" ? _variables.spaces[contentPadding] : "0px";
145
- }, function (_ref16) {
146
- var contentPadding = _ref16.contentPadding;
147
- return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.top ? _variables.spaces[contentPadding.top] : "";
148
- }, function (_ref17) {
149
- var contentPadding = _ref17.contentPadding;
150
- return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.right ? _variables.spaces[contentPadding.right] : "";
151
- }, function (_ref18) {
152
- var contentPadding = _ref18.contentPadding;
153
- return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.bottom ? _variables.spaces[contentPadding.bottom] : "";
154
- }, function (_ref19) {
155
- var contentPadding = _ref19.contentPadding;
156
- return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.left ? _variables.spaces[contentPadding.left] : "";
157
- });
140
+ var CardContent = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n flex-grow: 1;\n overflow: hidden;\n"])));
158
141
 
159
142
  var _default = DxcCard;
160
143
  exports["default"] = _default;