@dxc-technology/halstack-react 0.0.0-c593452 → 0.0.0-c680086

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 (237) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +1 -4
  3. package/ThemeContext.d.ts +15 -0
  4. package/ThemeContext.js +5 -8
  5. package/V3Select/V3Select.js +2 -2
  6. package/V3Textarea/V3Textarea.js +2 -2
  7. package/accordion/Accordion.d.ts +1 -1
  8. package/accordion/Accordion.js +11 -22
  9. package/accordion/Accordion.stories.tsx +307 -0
  10. package/accordion/types.d.ts +4 -8
  11. package/accordion-group/AccordionGroup.js +2 -2
  12. package/accordion-group/AccordionGroup.stories.tsx +225 -0
  13. package/accordion-group/types.d.ts +4 -8
  14. package/alert/Alert.js +2 -2
  15. package/alert/Alert.stories.tsx +170 -0
  16. package/alert/types.d.ts +1 -1
  17. package/badge/Badge.js +1 -1
  18. package/bleed/Bleed.d.ts +3 -0
  19. package/bleed/Bleed.js +84 -0
  20. package/bleed/Bleed.stories.tsx +342 -0
  21. package/bleed/types.d.ts +13 -0
  22. package/bleed/types.js +5 -0
  23. package/box/Box.d.ts +4 -0
  24. package/box/Box.js +6 -32
  25. package/box/Box.stories.tsx +132 -0
  26. package/box/types.d.ts +43 -0
  27. package/box/types.js +5 -0
  28. package/button/Button.d.ts +1 -1
  29. package/button/Button.js +15 -26
  30. package/button/Button.stories.tsx +223 -242
  31. package/button/types.d.ts +9 -13
  32. package/card/Card.js +5 -6
  33. package/card/Card.stories.tsx +201 -0
  34. package/card/ice-cream.jpg +0 -0
  35. package/card/types.d.ts +4 -6
  36. package/checkbox/Checkbox.js +2 -2
  37. package/checkbox/Checkbox.stories.tsx +192 -0
  38. package/checkbox/types.d.ts +2 -2
  39. package/chip/Chip.d.ts +4 -0
  40. package/chip/Chip.js +16 -76
  41. package/chip/Chip.stories.tsx +119 -0
  42. package/chip/types.d.ts +45 -0
  43. package/chip/types.js +5 -0
  44. package/common/variables.js +86 -44
  45. package/date/Date.js +1 -1
  46. package/date-input/DateInput.js +10 -13
  47. package/date-input/DateInput.stories.tsx +138 -0
  48. package/dialog/Dialog.d.ts +4 -0
  49. package/dialog/Dialog.js +8 -26
  50. package/dialog/Dialog.stories.tsx +212 -0
  51. package/dialog/types.d.ts +43 -0
  52. package/dialog/types.js +5 -0
  53. package/dropdown/Dropdown.d.ts +1 -1
  54. package/dropdown/Dropdown.js +13 -35
  55. package/dropdown/Dropdown.stories.tsx +249 -0
  56. package/dropdown/types.d.ts +6 -15
  57. package/file-input/FileInput.d.ts +4 -0
  58. package/file-input/FileInput.js +167 -109
  59. package/file-input/FileInput.stories.tsx +507 -0
  60. package/file-input/FileItem.d.ts +14 -0
  61. package/file-input/FileItem.js +12 -21
  62. package/file-input/types.d.ts +112 -0
  63. package/file-input/types.js +5 -0
  64. package/footer/Footer.d.ts +4 -0
  65. package/footer/Footer.js +31 -70
  66. package/footer/Footer.stories.tsx +130 -0
  67. package/footer/Icons.d.ts +2 -0
  68. package/footer/Icons.js +3 -3
  69. package/footer/types.d.ts +65 -0
  70. package/footer/types.js +5 -0
  71. package/header/Header.d.ts +7 -0
  72. package/header/Header.js +28 -30
  73. package/header/Header.stories.tsx +162 -0
  74. package/header/Icons.d.ts +2 -0
  75. package/header/Icons.js +2 -27
  76. package/header/types.d.ts +47 -0
  77. package/header/types.js +5 -0
  78. package/heading/Heading.d.ts +4 -0
  79. package/heading/Heading.js +7 -24
  80. package/heading/Heading.stories.tsx +54 -0
  81. package/heading/types.d.ts +33 -0
  82. package/heading/types.js +5 -0
  83. package/input-text/InputText.js +2 -2
  84. package/inset/Inset.d.ts +3 -0
  85. package/inset/Inset.js +84 -0
  86. package/inset/Inset.stories.tsx +229 -0
  87. package/inset/types.d.ts +13 -0
  88. package/inset/types.js +5 -0
  89. package/layout/ApplicationLayout.d.ts +10 -0
  90. package/layout/ApplicationLayout.js +9 -19
  91. package/layout/ApplicationLayout.stories.tsx +171 -0
  92. package/layout/types.d.ts +57 -0
  93. package/layout/types.js +5 -0
  94. package/link/Link.d.ts +3 -0
  95. package/link/Link.js +10 -40
  96. package/link/Link.stories.tsx +151 -0
  97. package/link/types.d.ts +70 -0
  98. package/link/types.js +5 -0
  99. package/list/List.d.ts +4 -0
  100. package/list/List.js +47 -0
  101. package/list/List.stories.tsx +95 -0
  102. package/list/types.d.ts +7 -0
  103. package/list/types.js +5 -0
  104. package/main.d.ts +8 -3
  105. package/main.js +42 -2
  106. package/number-input/NumberInput.d.ts +4 -0
  107. package/number-input/NumberInput.js +5 -50
  108. package/number-input/NumberInput.stories.tsx +115 -0
  109. package/number-input/NumberInputContext.d.ts +4 -0
  110. package/number-input/NumberInputContext.js +5 -2
  111. package/number-input/numberInputContextTypes.d.ts +19 -0
  112. package/number-input/numberInputContextTypes.js +5 -0
  113. package/number-input/types.d.ts +117 -0
  114. package/number-input/types.js +5 -0
  115. package/package.json +4 -2
  116. package/paginator/Paginator.js +2 -8
  117. package/paginator/Paginator.stories.tsx +63 -0
  118. package/password-input/PasswordInput.d.ts +4 -0
  119. package/password-input/PasswordInput.js +19 -55
  120. package/password-input/{PasswordInput.stories.jsx → PasswordInput.stories.tsx} +4 -4
  121. package/password-input/types.d.ts +107 -0
  122. package/password-input/types.js +5 -0
  123. package/progress-bar/ProgressBar.js +5 -5
  124. package/progress-bar/ProgressBar.stories.jsx +58 -0
  125. package/radio/Radio.js +2 -2
  126. package/radio/Radio.stories.tsx +192 -0
  127. package/radio/types.d.ts +2 -2
  128. package/radio-group/Radio.d.ts +4 -0
  129. package/radio-group/Radio.js +140 -0
  130. package/radio-group/RadioGroup.d.ts +4 -0
  131. package/radio-group/RadioGroup.js +273 -0
  132. package/radio-group/RadioGroup.stories.tsx +79 -0
  133. package/radio-group/RadioGroup.test.js +248 -0
  134. package/radio-group/types.d.ts +36 -0
  135. package/radio-group/types.js +5 -0
  136. package/resultsetTable/ResultsetTable.d.ts +4 -0
  137. package/resultsetTable/ResultsetTable.js +9 -29
  138. package/resultsetTable/ResultsetTable.stories.tsx +275 -0
  139. package/resultsetTable/types.d.ts +67 -0
  140. package/resultsetTable/types.js +5 -0
  141. package/row/Row.d.ts +3 -0
  142. package/row/Row.js +127 -0
  143. package/row/Row.stories.tsx +237 -0
  144. package/row/types.d.ts +10 -0
  145. package/row/types.js +5 -0
  146. package/select/Select.d.ts +4 -0
  147. package/select/Select.js +20 -22
  148. package/select/Select.stories.tsx +572 -0
  149. package/select/types.d.ts +170 -0
  150. package/select/types.js +5 -0
  151. package/sidenav/Sidenav.d.ts +9 -0
  152. package/sidenav/Sidenav.js +6 -15
  153. package/sidenav/Sidenav.stories.tsx +182 -0
  154. package/sidenav/types.d.ts +50 -0
  155. package/sidenav/types.js +5 -0
  156. package/slider/Slider.d.ts +1 -1
  157. package/slider/Slider.js +43 -32
  158. package/slider/Slider.stories.tsx +177 -0
  159. package/slider/types.d.ts +2 -7
  160. package/spinner/Spinner.d.ts +4 -0
  161. package/spinner/Spinner.js +8 -25
  162. package/spinner/Spinner.stories.jsx +103 -0
  163. package/spinner/types.d.ts +32 -0
  164. package/spinner/types.js +5 -0
  165. package/stack/Stack.d.ts +3 -0
  166. package/stack/Stack.js +97 -0
  167. package/stack/Stack.stories.tsx +164 -0
  168. package/stack/types.d.ts +9 -0
  169. package/stack/types.js +5 -0
  170. package/switch/Switch.js +4 -4
  171. package/switch/Switch.stories.tsx +160 -0
  172. package/table/Table.d.ts +4 -0
  173. package/table/Table.js +3 -3
  174. package/table/Table.stories.jsx +277 -0
  175. package/table/types.d.ts +21 -0
  176. package/table/types.js +5 -0
  177. package/tabs/Tabs.js +11 -9
  178. package/tabs/Tabs.stories.tsx +120 -0
  179. package/tabs/types.d.ts +25 -18
  180. package/tag/Tag.d.ts +4 -0
  181. package/tag/Tag.js +26 -46
  182. package/tag/Tag.stories.tsx +138 -0
  183. package/tag/types.d.ts +69 -0
  184. package/tag/types.js +5 -0
  185. package/text/Text.d.ts +7 -0
  186. package/text/Text.js +30 -0
  187. package/text/Text.stories.tsx +19 -0
  188. package/text-input/TextInput.d.ts +4 -0
  189. package/text-input/TextInput.js +54 -85
  190. package/text-input/TextInput.stories.tsx +456 -0
  191. package/text-input/types.d.ts +159 -0
  192. package/text-input/types.js +5 -0
  193. package/textarea/Textarea.d.ts +4 -0
  194. package/textarea/Textarea.js +27 -60
  195. package/textarea/Textarea.stories.jsx +4 -3
  196. package/textarea/types.d.ts +130 -0
  197. package/textarea/types.js +5 -0
  198. package/toggle/Toggle.js +1 -1
  199. package/toggle-group/ToggleGroup.d.ts +4 -0
  200. package/toggle-group/ToggleGroup.js +16 -45
  201. package/toggle-group/ToggleGroup.stories.tsx +173 -0
  202. package/toggle-group/types.d.ts +97 -0
  203. package/toggle-group/types.js +5 -0
  204. package/upload/buttons-upload/ButtonsUpload.js +2 -2
  205. package/upload/dragAndDropArea/DragAndDropArea.js +2 -2
  206. package/upload/file-upload/FileToUpload.js +1 -1
  207. package/upload/files-upload/FilesToUpload.js +1 -1
  208. package/upload/transaction/Transaction.js +2 -2
  209. package/upload/transactions/Transactions.js +1 -1
  210. package/useTheme.d.ts +2 -0
  211. package/useTheme.js +1 -1
  212. package/wizard/Wizard.d.ts +4 -0
  213. package/wizard/Wizard.js +69 -59
  214. package/wizard/Wizard.stories.tsx +224 -0
  215. package/wizard/types.d.ts +60 -0
  216. package/wizard/types.js +5 -0
  217. package/box/index.d.ts +0 -25
  218. package/chip/index.d.ts +0 -22
  219. package/dialog/index.d.ts +0 -18
  220. package/file-input/index.d.ts +0 -81
  221. package/footer/index.d.ts +0 -25
  222. package/header/index.d.ts +0 -25
  223. package/heading/index.d.ts +0 -17
  224. package/link/index.d.ts +0 -23
  225. package/number-input/index.d.ts +0 -113
  226. package/password-input/index.d.ts +0 -94
  227. package/resultsetTable/index.d.ts +0 -19
  228. package/select/index.d.ts +0 -131
  229. package/sidenav/index.d.ts +0 -13
  230. package/spinner/index.d.ts +0 -17
  231. package/table/index.d.ts +0 -13
  232. package/tag/index.d.ts +0 -24
  233. package/text-input/index.d.ts +0 -135
  234. package/textarea/index.d.ts +0 -117
  235. package/toggle-group/index.d.ts +0 -21
  236. package/wizard/Icons.js +0 -65
  237. package/wizard/index.d.ts +0 -18
@@ -0,0 +1,112 @@
1
+ declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ declare type Margin = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+ declare type FileData = {
9
+ /**
10
+ * Selected file.
11
+ */
12
+ file: File;
13
+ /**
14
+ * Error of the file. If it is defined, it will be shown and the file item will be mark as invalid.
15
+ */
16
+ error?: string;
17
+ /**
18
+ * Preview of the file.
19
+ */
20
+ preview?: string;
21
+ };
22
+ declare type CommonProps = {
23
+ /**
24
+ * Name attribute.
25
+ */
26
+ name?: string;
27
+ /**
28
+ * Text to be placed above the component.
29
+ */
30
+ label?: string;
31
+ /**
32
+ * Text to be placed inside the button.
33
+ */
34
+ buttonLabel?: string;
35
+ /**
36
+ * Helper text to be placed above the component.
37
+ */
38
+ helperText?: string;
39
+ /**
40
+ * The file types that the component accepts. Its value must be one of all the possible values of the HTML file input's accept attribute.
41
+ */
42
+ accept?: string;
43
+ /**
44
+ * An array of files representing the selected files.
45
+ */
46
+ value: FileData[];
47
+ /**
48
+ * The minimum file size (in bytes) allowed. If the size of the file does not comply the minSize, the file will have an error.
49
+ */
50
+ minSize?: number;
51
+ /**
52
+ * The maximum file size (in bytes) allowed. If the size of the file does not comply the maxSize, the file will have an error.
53
+ */
54
+ maxSize?: number;
55
+ /**
56
+ * If true, if the file is an image, a preview of it will be shown. If not, an icon refering to the file type will be shown.
57
+ */
58
+ showPreview?: boolean;
59
+ /**
60
+ * If true, the component allows multiple file items and will show all of them. If false, only one file will be shown, and if there is already one
61
+ * file selected and a new one is chosen, it will be replaced by the new selected one.
62
+ */
63
+ multiple?: boolean;
64
+ /**
65
+ * If true, the component will be disabled.
66
+ */
67
+ disabled?: boolean;
68
+ /**
69
+ * This function will be called when the user selects or drops a file. The list of files will be sent as a parameter.
70
+ * In this function, the files can be updated or returned as they come. These files must be passed to the value in order to be shown.
71
+ */
72
+ callbackFile: (files: FileData[]) => void;
73
+ /**
74
+ * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
75
+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
76
+ */
77
+ margin?: Space | Margin;
78
+ /**
79
+ * Value of the tabindex attribute.
80
+ */
81
+ tabIndex?: number;
82
+ };
83
+ declare type DropModeProps = CommonProps & {
84
+ /**
85
+ * Uses one of the available file input modes:
86
+ * 'file': Files are selected by clicking the button and selecting it through the file explorer.
87
+ * 'filedrop': Files can be selected by clicking the button and selecting it through the file explorer or by dropping them inside the drag and drop area.
88
+ * 'dropzone': Files can be selected by clicking the button and selecting it through the file explorer or by dropping them inside the drag and drop area.
89
+ * The drag and drop area of this mode is bigger than the one of the filedrop mode.
90
+ */
91
+ mode: "filedrop" | "dropzone";
92
+ /**
93
+ * Text to be placed inside the drag and drop zone alongside the button.
94
+ */
95
+ dropAreaLabel?: string;
96
+ };
97
+ declare type FileModeProps = CommonProps & {
98
+ /**
99
+ * Uses one of the available file input modes:
100
+ * 'file': Files are selected by clicking the button and selecting it through the file explorer.
101
+ * 'filedrop': Files can be selected by clicking the button and selecting it through the file explorer or by dropping them inside the drag and drop area.
102
+ * 'dropzone': Files can be selected by clicking the button and selecting it through the file explorer or by dropping them inside the drag and drop area.
103
+ * The drag and drop area of this mode is bigger than the one of the filedrop mode.
104
+ */
105
+ mode?: "file";
106
+ /**
107
+ * Text to be placed inside the drag and drop zone alongside the button.
108
+ */
109
+ dropAreaLabel?: never;
110
+ };
111
+ declare type Props = DropModeProps | FileModeProps;
112
+ export default Props;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import FooterPropsType from "./types";
3
+ declare const DxcFooter: ({ socialLinks, bottomLinks, copyright, children, padding, margin, tabIndex, }: FooterPropsType) => JSX.Element;
4
+ export default DxcFooter;
package/footer/Footer.js CHANGED
@@ -9,41 +9,35 @@ 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 _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
19
17
 
20
18
  var _react = _interopRequireWildcard(require("react"));
21
19
 
22
20
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
23
21
 
24
- var _propTypes = _interopRequireDefault(require("prop-types"));
25
-
26
22
  var _variables = require("../common/variables.js");
27
23
 
28
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
24
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
29
25
 
30
- var _BackgroundColorContext = require("../BackgroundColorContext.js");
26
+ var _BackgroundColorContext = require("../BackgroundColorContext");
31
27
 
32
- var _Icons = _interopRequireDefault(require("./Icons"));
28
+ var _Icons = require("./Icons");
33
29
 
34
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
30
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14;
35
31
 
36
32
  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); }
37
33
 
38
34
  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; }
39
35
 
40
36
  var DxcFooter = function DxcFooter(_ref) {
41
- var _ref$socialLinks = _ref.socialLinks,
42
- socialLinks = _ref$socialLinks === void 0 ? [] : _ref$socialLinks,
43
- _ref$bottomLinks = _ref.bottomLinks,
44
- bottomLinks = _ref$bottomLinks === void 0 ? [] : _ref$bottomLinks,
37
+ var socialLinks = _ref.socialLinks,
38
+ bottomLinks = _ref.bottomLinks,
45
39
  _ref$copyright = _ref.copyright,
46
- copyright = _ref$copyright === void 0 ? "" : _ref$copyright,
40
+ copyright = _ref$copyright === void 0 ? "\xA9 DXC Technology ".concat(new Date().getFullYear(), ". All rights reserved.") : _ref$copyright,
47
41
  children = _ref.children,
48
42
  padding = _ref.padding,
49
43
  margin = _ref.margin,
@@ -69,7 +63,7 @@ var DxcFooter = function DxcFooter(_ref) {
69
63
  var colorsTheme = (0, _useTheme["default"])();
70
64
  var footerLogo = (0, _react.useMemo)(function () {
71
65
  if (!colorsTheme.footer.logo) {
72
- return _Icons["default"];
66
+ return _Icons.dxcLogo;
73
67
  }
74
68
 
75
69
  if (typeof colorsTheme.footer.logo === "string") {
@@ -110,17 +104,17 @@ var DxcFooter = function DxcFooter(_ref) {
110
104
  window.removeEventListener("resize", handleEventListener);
111
105
  };
112
106
  }, []);
113
- var socialLink = socialLinks.map(function (link, index) {
107
+ var socialLink = socialLinks === null || socialLinks === void 0 ? void 0 : socialLinks.map(function (link, index) {
114
108
  return /*#__PURE__*/_react["default"].createElement(SocialAnchor, {
115
109
  tabIndex: tabIndex,
116
110
  key: "social".concat(index).concat(link.href),
117
111
  index: index,
118
112
  href: link && link.href ? link.href : ""
119
- }, link.logo ? /*#__PURE__*/_react["default"].createElement(SocialIconContainer, null, (0, _typeof2["default"])(link.logo) === "object" ? link.logo : /*#__PURE__*/_react["default"].createElement(link.logo)) : link && link.logoSrc && /*#__PURE__*/_react["default"].createElement(SocialIcon, {
120
- src: link.logoSrc
121
- }));
113
+ }, /*#__PURE__*/_react["default"].createElement(SocialIconContainer, null, typeof link.logo === "string" ? /*#__PURE__*/_react["default"].createElement(SocialIconImg, {
114
+ src: link.logo
115
+ }) : link.logo));
122
116
  });
123
- var bottomLink = bottomLinks.map(function (link, index) {
117
+ var bottomLink = bottomLinks === null || bottomLinks === void 0 ? void 0 : bottomLinks.map(function (link, index) {
124
118
  return /*#__PURE__*/_react["default"].createElement("span", {
125
119
  key: "bottom".concat(index).concat(link.text)
126
120
  }, /*#__PURE__*/_react["default"].createElement(BottomLink, {
@@ -136,19 +130,17 @@ var DxcFooter = function DxcFooter(_ref) {
136
130
  margin: margin,
137
131
  refSize: refSize,
138
132
  ref: ref
139
- }, /*#__PURE__*/_react["default"].createElement(FooterHeader, null, /*#__PURE__*/_react["default"].createElement(LogoContainer, null, footerLogo), /*#__PURE__*/_react["default"].createElement("div", null, socialLink)), isResponsivePhone && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(FooterFooter, {
140
- className: "footerFooter",
133
+ }, /*#__PURE__*/_react["default"].createElement(FooterHeader, {
141
134
  refSize: refSize
142
- }, /*#__PURE__*/_react["default"].createElement(BottomLinks, {
143
- refSize: refSize
144
- }, bottomLink), /*#__PURE__*/_react["default"].createElement(Copyright, {
135
+ }, /*#__PURE__*/_react["default"].createElement(LogoContainer, null, footerLogo), /*#__PURE__*/_react["default"].createElement(SocialLinkContainer, {
145
136
  refSize: refSize
146
- }, copyright))), (!isResponsiveTablet && !isResponsivePhone || isResponsiveTablet) && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(ChildComponents, {
137
+ }, socialLink)), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(ChildComponents, {
147
138
  padding: padding
148
139
  }, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
149
140
  color: colorsTheme.footer.backgroundColor
150
141
  }, children)), /*#__PURE__*/_react["default"].createElement(FooterFooter, {
151
- className: "footerFooter"
142
+ className: "footerFooter",
143
+ refSize: refSize
152
144
  }, /*#__PURE__*/_react["default"].createElement(BottomLinks, {
153
145
  refSize: refSize
154
146
  }, bottomLink), /*#__PURE__*/_react["default"].createElement(Copyright, {
@@ -166,9 +158,9 @@ var FooterContainer = _styledComponents["default"].footer(_templateObject || (_t
166
158
  return props.theme.height;
167
159
  });
168
160
 
169
- var FooterHeader = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n"])));
161
+ var FooterHeader = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n row-gap: 24px;\n"])));
170
162
 
171
- var FooterFooter = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n flex-direction: ", ";\n align-items: ", ";\n border-top: ", ";\n"])), function (props) {
163
+ var FooterFooter = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n flex-direction: ", ";\n align-items: ", ";\n border-top: ", ";\n margin-top: 16px;\n"])), function (props) {
172
164
  return props.refSize <= _variables.responsiveSizes.mobileLarge ? "column" : "row";
173
165
  }, function (props) {
174
166
  return props.refSize <= _variables.responsiveSizes.mobileLarge ? "center" : "";
@@ -176,17 +168,15 @@ var FooterFooter = _styledComponents["default"].div(_templateObject3 || (_templa
176
168
  return "".concat(props.theme.bottomLinksDividerThickness, " ").concat(props.theme.bottomLinksDividerStyle, " ").concat(props.theme.bottomLinksDividerColor);
177
169
  });
178
170
 
179
- var BottomLinks = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n padding-top: ", ";\n display: inline-flex;\n flex-wrap: wrap;\n max-width: ", ";\n width: ", ";\n & > span:last-child span {\n display: none;\n }\n margin: ", ";\n"])), function (props) {
171
+ var BottomLinks = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n padding-top: ", ";\n display: inline-flex;\n flex-wrap: wrap;\n max-width: ", ";\n width: ", ";\n & > span:last-child span {\n display: none;\n }\n align-self: center;\n"])), function (props) {
180
172
  return props.theme.bottomLinksDividerSpacing;
181
173
  }, function (props) {
182
174
  return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "60%";
183
175
  }, function (props) {
184
176
  return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "";
185
- }, function (props) {
186
- return props.refSize <= _variables.responsiveSizes.mobileLarge ? "40px 0 40px 0" : "";
187
177
  });
188
178
 
189
- var ChildComponents = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 15px;\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n overflow: hidden;\n"])), function (props) {
179
+ var ChildComponents = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 16px;\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n overflow: hidden;\n"])), function (props) {
190
180
  return props.padding && (0, _typeof2["default"])(props.padding) !== "object" ? _variables.spaces[props.padding] : "0px";
191
181
  }, function (props) {
192
182
  return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.top ? _variables.spaces[props.padding.top] : "";
@@ -213,7 +203,7 @@ var Copyright = _styledComponents["default"].div(_templateObject6 || (_templateO
213
203
  }, function (props) {
214
204
  return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "";
215
205
  }, function (props) {
216
- return props.refSize <= _variables.responsiveSizes.mobileLarge ? "center" : "right";
206
+ return props.refSize <= _variables.responsiveSizes.mobileLarge ? "left" : "right";
217
207
  }, function (props) {
218
208
  return props.theme.bottomLinksDividerSpacing;
219
209
  });
@@ -230,19 +220,15 @@ var LogoImg = _styledComponents["default"].img(_templateObject8 || (_templateObj
230
220
  return props.theme.logoWidth;
231
221
  });
232
222
 
233
- var SocialAnchor = _styledComponents["default"].a(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n & {\n display: inline-flex;\n margin-left: ", ";\n }\n"])), function (props) {
223
+ var SocialLinkContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-self: center;\n"])));
224
+
225
+ var SocialAnchor = _styledComponents["default"].a(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n & {\n display: inline-flex;\n margin-left: ", ";\n }\n"])), function (props) {
234
226
  return props.index === 0 ? "0px" : props.theme.socialLinksGutter;
235
227
  });
236
228
 
237
- var SocialIcon = _styledComponents["default"].img(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n & {\n display: inline-flex;\n height: ", ";\n width: ", ";\n fill: ", ";\n }\n"])), function (props) {
238
- return props.theme.socialLinksSize;
239
- }, function (props) {
240
- return props.theme.socialLinksSize;
241
- }, function (props) {
242
- return props.theme.socialLinksColor;
243
- });
229
+ var SocialIconImg = _styledComponents["default"].img(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])([""])));
244
230
 
245
- var SocialIconContainer = _styledComponents["default"].div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n & {\n display: inline-flex;\n height: ", ";\n width: ", ";\n color: ", ";\n }\n\n overflow: hidden;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
231
+ var SocialIconContainer = _styledComponents["default"].div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n & {\n display: inline-flex;\n height: ", ";\n width: ", ";\n color: ", ";\n }\n\n overflow: hidden;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
246
232
  return props.theme.socialLinksSize;
247
233
  }, function (props) {
248
234
  return props.theme.socialLinksSize;
@@ -250,11 +236,11 @@ var SocialIconContainer = _styledComponents["default"].div(_templateObject11 ||
250
236
  return props.theme.socialLinksColor;
251
237
  });
252
238
 
253
- var Point = _styledComponents["default"].span(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px 10px;\n color: ", ";\n"])), function (props) {
239
+ var Point = _styledComponents["default"].span(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px 10px;\n color: ", ";\n"])), function (props) {
254
240
  return props.theme.bottomLinksFontColor;
255
241
  });
256
242
 
257
- var BottomLink = _styledComponents["default"].a(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"])), function (props) {
243
+ var BottomLink = _styledComponents["default"].a(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"])), function (props) {
258
244
  return props.theme.bottomLinksTextDecoration;
259
245
  }, function (props) {
260
246
  return props.theme.bottomLinksFontColor;
@@ -268,30 +254,5 @@ var BottomLink = _styledComponents["default"].a(_templateObject13 || (_templateO
268
254
  return props.theme.bottomLinksFontWeight;
269
255
  });
270
256
 
271
- DxcFooter.propTypes = {
272
- socialLinks: _propTypes["default"].arrayOf(_propTypes["default"].shape({
273
- logo: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
274
- logoSrc: _propTypes["default"].string.isRequired,
275
- href: _propTypes["default"].string
276
- })),
277
- bottomLinks: _propTypes["default"].arrayOf(_propTypes["default"].shape({
278
- text: _propTypes["default"].string.isRequired,
279
- href: _propTypes["default"].string
280
- })),
281
- copyright: _propTypes["default"].string,
282
- margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
283
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
284
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
285
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
286
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
287
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
288
- padding: _propTypes["default"].oneOfType([_propTypes["default"].shape({
289
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
290
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
291
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
292
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
293
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
294
- tabIndex: _propTypes["default"].number
295
- };
296
257
  var _default = DxcFooter;
297
258
  exports["default"] = _default;
@@ -0,0 +1,130 @@
1
+ import React from "react";
2
+ import DxcFooter from "./Footer";
3
+ import Title from "../../.storybook/components/Title";
4
+ import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
+
6
+ const social = [
7
+ {
8
+ href: "https://www.linkedin.com/company/dxctechnology",
9
+ logo: (
10
+ <svg version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 438.536 438.536" fill="currentColor">
11
+ <g>
12
+ <path
13
+ d="M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123
14
+ C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126
15
+ h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225
16
+ C438.532,59.576,430.49,40.204,414.41,24.123z M133.618,367.157H67.666V169.016h65.952V367.157z M127.626,132.332
17
+ c-6.851,6.567-15.893,9.851-27.124,9.851h-0.288c-10.848,0-19.648-3.284-26.407-9.851c-6.76-6.567-10.138-14.703-10.138-24.41
18
+ c0-9.897,3.476-18.083,10.421-24.556c6.95-6.471,15.942-9.708,26.98-9.708c11.039,0,19.89,3.237,26.553,9.708
19
+ c6.661,6.473,10.088,14.659,10.277,24.556C137.899,117.625,134.477,125.761,127.626,132.332z M370.873,367.157h-65.952v-105.92
20
+ c0-29.879-11.036-44.823-33.116-44.823c-8.374,0-15.42,2.331-21.128,6.995c-5.715,4.661-9.996,10.324-12.847,16.991
21
+ c-1.335,3.422-1.999,8.75-1.999,15.981v110.775h-65.952c0.571-119.529,0.571-185.579,0-198.142h65.952v27.974
22
+ c13.867-21.681,33.558-32.544,59.101-32.544c22.84,0,41.21,7.52,55.104,22.554c13.895,15.037,20.841,37.214,20.841,66.519v113.64
23
+ H370.873z"
24
+ />
25
+ </g>
26
+ </svg>
27
+ ),
28
+ },
29
+ {
30
+ href: "https://twitter.com/dxctechnology",
31
+ logo: "http://assets.stickpng.com/images/580b57fcd9996e24bc43c53e.png",
32
+ },
33
+ {
34
+ href: "https://www.facebook.com/DXCTechnology/",
35
+ logo: (
36
+ <svg
37
+ version="1.1"
38
+ id="Capa_1"
39
+ x="0px"
40
+ y="0px"
41
+ viewBox="0 0 438.536 438.536"
42
+ fill="currentColor"
43
+ width="1000px"
44
+ height="500px"
45
+ >
46
+ <g>
47
+ <path
48
+ d="M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123
49
+ C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126
50
+ h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225
51
+ C438.532,59.576,430.49,40.204,414.41,24.123z M373.155,225.548h-49.963V406.84h-74.802V225.548H210.99V163.02h37.401v-37.402
52
+ c0-26.838,6.283-47.107,18.843-60.813c12.559-13.706,33.304-20.555,62.242-20.555h49.963v62.526h-31.401
53
+ c-10.663,0-17.467,1.853-20.417,5.568c-2.949,3.711-4.428,10.23-4.428,19.558v31.119h56.534L373.155,225.548z"
54
+ />
55
+ </g>
56
+ </svg>
57
+ ),
58
+ },
59
+ ];
60
+
61
+ const bottom = [
62
+ {
63
+ href: "https://www.linkedin.com/company/dxctechnology",
64
+ text: "Linkedin",
65
+ },
66
+ {
67
+ href: "https://twitter.com/dxctechnology",
68
+ text: "Twitter",
69
+ },
70
+ {
71
+ href: "https://www.facebook.com/DXCTechnology/",
72
+ text: "Facebook",
73
+ },
74
+ ];
75
+
76
+ export default {
77
+ title: "Footer",
78
+ component: DxcFooter,
79
+ };
80
+
81
+ export const Chromatic = () => (
82
+ <>
83
+ <ExampleContainer>
84
+ <Title title="Default" theme="light" level={4} />
85
+ <DxcFooter />
86
+ </ExampleContainer>
87
+ <ExampleContainer>
88
+ <Title title="With children, copyright, bottom links and social links" theme="light" level={4} />
89
+ <DxcFooter copyright="Copyright" socialLinks={social} bottomLinks={bottom}>
90
+ <div>
91
+ <a href="https://www.linkedin.com/company/dxctechnology">Linkedin</a>
92
+ </div>
93
+ </DxcFooter>
94
+ </ExampleContainer>
95
+ <Title title="Margins" theme="light" level={2} />
96
+ <ExampleContainer>
97
+ <Title title="Xxsmall margin" theme="light" level={4} />
98
+ <DxcFooter margin="xxsmall"></DxcFooter>
99
+ <Title title="Xsmall margin" theme="light" level={4} />
100
+ <DxcFooter margin="xsmall"></DxcFooter>
101
+ <Title title="Small margin" theme="light" level={4} />
102
+ <DxcFooter margin="small"></DxcFooter>
103
+ <Title title="Medium margin" theme="light" level={4} />
104
+ <DxcFooter margin="medium"></DxcFooter>
105
+ <Title title="Large margin" theme="light" level={4} />
106
+ <DxcFooter margin="large"></DxcFooter>
107
+ <Title title="Xlarge margin" theme="light" level={4} />
108
+ <DxcFooter margin="xlarge"></DxcFooter>
109
+ <Title title="Xxlarge margin" theme="light" level={4} />
110
+ <DxcFooter margin="xxlarge"></DxcFooter>
111
+ </ExampleContainer>
112
+ <Title title="Padding" theme="light" level={2} />
113
+ <ExampleContainer>
114
+ <Title title="Xxsmall padding" theme="light" level={4} />
115
+ <DxcFooter padding="xxsmall"></DxcFooter>
116
+ <Title title="Xsmall padding" theme="light" level={4} />
117
+ <DxcFooter padding="xsmall"></DxcFooter>
118
+ <Title title="Small padding" theme="light" level={4} />
119
+ <DxcFooter padding="small"></DxcFooter>
120
+ <Title title="Medium padding" theme="light" level={4} />
121
+ <DxcFooter padding="medium"></DxcFooter>
122
+ <Title title="Large padding" theme="light" level={4} />
123
+ <DxcFooter padding="large"></DxcFooter>
124
+ <Title title="Xlarge padding" theme="light" level={4} />
125
+ <DxcFooter padding="xlarge"></DxcFooter>
126
+ <Title title="Xxlarge padding" theme="light" level={4} />
127
+ <DxcFooter padding="xxlarge"></DxcFooter>
128
+ </ExampleContainer>
129
+ </>
130
+ );
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const dxcLogo: JSX.Element;
package/footer/Icons.js CHANGED
@@ -5,11 +5,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = void 0;
8
+ exports.dxcLogo = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
- var _default = /*#__PURE__*/_react["default"].createElement("svg", {
12
+ var dxcLogo = /*#__PURE__*/_react["default"].createElement("svg", {
13
13
  id: "g10",
14
14
  xmlns: "http://www.w3.org/2000/svg",
15
15
  width: "280.781",
@@ -74,4 +74,4 @@ var _default = /*#__PURE__*/_react["default"].createElement("svg", {
74
74
  fill: "#fff"
75
75
  })));
76
76
 
77
- exports["default"] = _default;
77
+ exports.dxcLogo = dxcLogo;
@@ -0,0 +1,65 @@
1
+ /// <reference types="react" />
2
+ declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ declare type Size = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+ declare type SVG = React.SVGProps<SVGSVGElement>;
10
+ declare type SocialLink = {
11
+ /**
12
+ * Element used as the icon for the link.
13
+ */
14
+ logo: string | SVG;
15
+ /**
16
+ * URL of the page the link goes to.
17
+ */
18
+ href: string;
19
+ };
20
+ declare type BottomLink = {
21
+ /**
22
+ * Text for the link.
23
+ */
24
+ text: string;
25
+ /**
26
+ * URL of the page the link goes to.
27
+ */
28
+ href: string;
29
+ };
30
+ declare type FooterPropsType = {
31
+ /**
32
+ * An array of objects representing the links that will be rendered as
33
+ * icons at the top-right side of the footer.
34
+ */
35
+ socialLinks?: SocialLink[];
36
+ /**
37
+ * An array of objects representing the links that will be rendered at
38
+ * the bottom part of the footer.
39
+ */
40
+ bottomLinks?: BottomLink[];
41
+ /**
42
+ * The center section of the footer. Can be used to render custom
43
+ * content in this area.
44
+ */
45
+ children?: React.ReactNode;
46
+ /**
47
+ * The text that will be displayed as copyright disclaimer.
48
+ */
49
+ copyright?: string;
50
+ /**
51
+ * Value of the tabindex for all interactuable elements, except those
52
+ * inside the custom area.
53
+ */
54
+ tabIndex?: number;
55
+ /**
56
+ * Size of the top margin to be applied to the footer.
57
+ */
58
+ margin?: Space | Size;
59
+ /**
60
+ * Size of the padding to be applied to the custom area of the component.
61
+ * You can pass an object with properties in order to specify different padding sizes.
62
+ */
63
+ padding?: Space | Size;
64
+ };
65
+ export default FooterPropsType;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import HeaderPropsType from "./types";
3
+ declare const DxcHeader: {
4
+ ({ underlined, content, responsiveContent, onClick, margin, padding, tabIndex, }: HeaderPropsType): JSX.Element;
5
+ Dropdown: (props: any) => JSX.Element;
6
+ };
7
+ export default DxcHeader;