@dxc-technology/halstack-react 0.0.0-ee92231 → 0.0.0-f0d662d

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 (203) 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.js +2 -2
  8. package/accordion/Accordion.stories.tsx +307 -0
  9. package/accordion/types.d.ts +1 -1
  10. package/accordion-group/AccordionGroup.js +2 -2
  11. package/accordion-group/AccordionGroup.stories.tsx +225 -0
  12. package/accordion-group/types.d.ts +1 -1
  13. package/alert/Alert.js +2 -2
  14. package/alert/Alert.stories.tsx +170 -0
  15. package/alert/types.d.ts +1 -1
  16. package/badge/Badge.js +1 -1
  17. package/bleed/Bleed.d.ts +3 -0
  18. package/bleed/Bleed.js +84 -0
  19. package/bleed/Bleed.stories.tsx +342 -0
  20. package/bleed/types.d.ts +13 -0
  21. package/bleed/types.js +5 -0
  22. package/box/Box.d.ts +1 -1
  23. package/box/Box.js +4 -7
  24. package/box/types.d.ts +0 -4
  25. package/button/Button.d.ts +1 -1
  26. package/button/Button.js +13 -19
  27. package/button/Button.stories.tsx +222 -241
  28. package/button/types.d.ts +5 -9
  29. package/card/Card.js +5 -6
  30. package/card/Card.stories.tsx +201 -0
  31. package/card/ice-cream.jpg +0 -0
  32. package/card/types.d.ts +4 -6
  33. package/checkbox/Checkbox.js +2 -2
  34. package/checkbox/types.d.ts +2 -2
  35. package/chip/Chip.d.ts +4 -0
  36. package/chip/Chip.js +5 -27
  37. package/chip/Chip.stories.tsx +121 -0
  38. package/chip/types.d.ts +53 -0
  39. package/chip/types.js +5 -0
  40. package/common/variables.js +70 -27
  41. package/date/Date.js +1 -1
  42. package/date-input/DateInput.js +10 -13
  43. package/date-input/DateInput.stories.tsx +138 -0
  44. package/dialog/Dialog.js +4 -3
  45. package/dialog/Dialog.stories.tsx +212 -0
  46. package/dropdown/Dropdown.js +1 -1
  47. package/dropdown/Dropdown.stories.tsx +247 -0
  48. package/dropdown/types.d.ts +1 -1
  49. package/file-input/FileInput.d.ts +4 -0
  50. package/file-input/FileInput.js +167 -109
  51. package/file-input/FileInput.stories.tsx +507 -0
  52. package/file-input/FileItem.d.ts +14 -0
  53. package/file-input/FileItem.js +12 -21
  54. package/file-input/types.d.ts +112 -0
  55. package/file-input/types.js +5 -0
  56. package/footer/Footer.d.ts +1 -1
  57. package/footer/Footer.js +28 -36
  58. package/footer/{Footer.stories.jsx → Footer.stories.tsx} +1 -22
  59. package/footer/Icons.d.ts +2 -0
  60. package/footer/Icons.js +3 -3
  61. package/footer/types.d.ts +22 -18
  62. package/header/Header.js +2 -2
  63. package/header/Header.stories.tsx +162 -0
  64. package/header/Icons.d.ts +2 -0
  65. package/header/types.d.ts +4 -2
  66. package/heading/Heading.d.ts +4 -0
  67. package/heading/Heading.js +7 -24
  68. package/heading/Heading.stories.tsx +54 -0
  69. package/heading/types.d.ts +33 -0
  70. package/heading/types.js +5 -0
  71. package/input-text/InputText.js +2 -2
  72. package/inset/Inset.d.ts +3 -0
  73. package/inset/Inset.js +84 -0
  74. package/inset/Inset.stories.tsx +229 -0
  75. package/inset/types.d.ts +13 -0
  76. package/inset/types.js +5 -0
  77. package/layout/ApplicationLayout.d.ts +10 -0
  78. package/layout/ApplicationLayout.js +9 -19
  79. package/layout/ApplicationLayout.stories.tsx +171 -0
  80. package/layout/types.d.ts +57 -0
  81. package/layout/types.js +5 -0
  82. package/link/Link.js +3 -3
  83. package/link/Link.stories.tsx +146 -0
  84. package/list/List.d.ts +4 -0
  85. package/list/List.js +47 -0
  86. package/list/List.stories.tsx +95 -0
  87. package/list/types.d.ts +7 -0
  88. package/list/types.js +5 -0
  89. package/main.d.ts +7 -3
  90. package/main.js +34 -2
  91. package/number-input/NumberInput.d.ts +4 -0
  92. package/number-input/NumberInput.js +5 -50
  93. package/number-input/{NumberInput.stories.jsx → NumberInput.stories.tsx} +0 -0
  94. package/number-input/NumberInputContext.d.ts +4 -0
  95. package/number-input/NumberInputContext.js +5 -2
  96. package/number-input/numberInputContextTypes.d.ts +19 -0
  97. package/number-input/numberInputContextTypes.js +5 -0
  98. package/number-input/types.d.ts +117 -0
  99. package/number-input/types.js +5 -0
  100. package/package.json +4 -2
  101. package/paginator/Paginator.js +2 -8
  102. package/password-input/PasswordInput.js +19 -18
  103. package/password-input/PasswordInput.stories.tsx +3 -3
  104. package/password-input/types.d.ts +17 -10
  105. package/progress-bar/ProgressBar.js +4 -4
  106. package/radio/Radio.js +2 -2
  107. package/radio/types.d.ts +2 -2
  108. package/radio-group/Radio.d.ts +4 -0
  109. package/radio-group/Radio.js +140 -0
  110. package/radio-group/RadioGroup.d.ts +4 -0
  111. package/radio-group/RadioGroup.js +273 -0
  112. package/radio-group/RadioGroup.stories.tsx +79 -0
  113. package/radio-group/RadioGroup.test.js +248 -0
  114. package/radio-group/types.d.ts +36 -0
  115. package/radio-group/types.js +5 -0
  116. package/resultsetTable/ResultsetTable.d.ts +4 -0
  117. package/resultsetTable/ResultsetTable.js +5 -28
  118. package/resultsetTable/ResultsetTable.stories.tsx +275 -0
  119. package/resultsetTable/types.d.ts +67 -0
  120. package/resultsetTable/types.js +5 -0
  121. package/row/Row.d.ts +3 -0
  122. package/row/Row.js +127 -0
  123. package/row/Row.stories.tsx +237 -0
  124. package/row/types.d.ts +10 -0
  125. package/row/types.js +5 -0
  126. package/select/Select.d.ts +4 -0
  127. package/select/Select.js +20 -22
  128. package/select/Select.stories.tsx +572 -0
  129. package/select/types.d.ts +170 -0
  130. package/select/types.js +5 -0
  131. package/sidenav/Sidenav.d.ts +9 -0
  132. package/sidenav/Sidenav.js +6 -15
  133. package/sidenav/Sidenav.stories.tsx +182 -0
  134. package/sidenav/types.d.ts +50 -0
  135. package/sidenav/types.js +5 -0
  136. package/slider/Slider.d.ts +1 -1
  137. package/slider/Slider.js +43 -32
  138. package/slider/Slider.stories.tsx +177 -0
  139. package/slider/types.d.ts +2 -7
  140. package/spinner/Spinner.js +2 -2
  141. package/spinner/Spinner.stories.jsx +1 -0
  142. package/stack/Stack.d.ts +3 -0
  143. package/stack/Stack.js +97 -0
  144. package/stack/Stack.stories.tsx +164 -0
  145. package/stack/types.d.ts +9 -0
  146. package/stack/types.js +5 -0
  147. package/switch/Switch.js +2 -2
  148. package/switch/Switch.stories.tsx +1 -1
  149. package/table/Table.js +3 -3
  150. package/table/Table.stories.jsx +2 -1
  151. package/tabs/Tabs.js +11 -9
  152. package/tabs/Tabs.stories.tsx +120 -0
  153. package/tabs/types.d.ts +25 -18
  154. package/tag/Tag.d.ts +4 -0
  155. package/tag/Tag.js +4 -25
  156. package/tag/{Tag.stories.jsx → Tag.stories.tsx} +1 -1
  157. package/tag/types.d.ts +60 -0
  158. package/tag/types.js +5 -0
  159. package/text/Text.d.ts +7 -0
  160. package/text/Text.js +30 -0
  161. package/text/Text.stories.tsx +19 -0
  162. package/text-input/TextInput.d.ts +4 -0
  163. package/text-input/TextInput.js +54 -85
  164. package/text-input/TextInput.stories.tsx +456 -0
  165. package/text-input/types.d.ts +159 -0
  166. package/text-input/types.js +5 -0
  167. package/textarea/Textarea.d.ts +4 -0
  168. package/textarea/Textarea.js +27 -60
  169. package/textarea/Textarea.stories.jsx +4 -3
  170. package/textarea/types.d.ts +130 -0
  171. package/textarea/types.js +5 -0
  172. package/toggle/Toggle.js +1 -1
  173. package/toggle-group/ToggleGroup.d.ts +4 -0
  174. package/toggle-group/ToggleGroup.js +16 -45
  175. package/toggle-group/ToggleGroup.stories.tsx +173 -0
  176. package/toggle-group/types.d.ts +97 -0
  177. package/toggle-group/types.js +5 -0
  178. package/upload/buttons-upload/ButtonsUpload.js +2 -2
  179. package/upload/dragAndDropArea/DragAndDropArea.js +2 -2
  180. package/upload/file-upload/FileToUpload.js +1 -1
  181. package/upload/files-upload/FilesToUpload.js +1 -1
  182. package/upload/transaction/Transaction.js +2 -2
  183. package/upload/transactions/Transactions.js +1 -1
  184. package/useTheme.d.ts +2 -0
  185. package/useTheme.js +1 -1
  186. package/wizard/Wizard.d.ts +4 -0
  187. package/wizard/Wizard.js +69 -59
  188. package/wizard/Wizard.stories.tsx +224 -0
  189. package/wizard/types.d.ts +60 -0
  190. package/wizard/types.js +5 -0
  191. package/chip/index.d.ts +0 -22
  192. package/file-input/index.d.ts +0 -81
  193. package/heading/index.d.ts +0 -17
  194. package/number-input/index.d.ts +0 -113
  195. package/resultsetTable/index.d.ts +0 -19
  196. package/select/index.d.ts +0 -131
  197. package/sidenav/index.d.ts +0 -13
  198. package/tag/index.d.ts +0 -24
  199. package/text-input/index.d.ts +0 -135
  200. package/textarea/index.d.ts +0 -117
  201. package/toggle-group/index.d.ts +0 -21
  202. package/wizard/Icons.js +0 -65
  203. 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
+ });
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import FooterPropsType from "./types";
3
- declare const DxcFooter: ({ socialLinks, bottomLinks, copyright, children, padding, margin, tabIndex }: FooterPropsType) => JSX.Element;
3
+ declare const DxcFooter: ({ socialLinks, bottomLinks, copyright, children, padding, margin, tabIndex, }: FooterPropsType) => JSX.Element;
4
4
  export default DxcFooter;
package/footer/Footer.js CHANGED
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports["default"] = void 0;
11
11
 
12
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
-
14
12
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
15
13
 
14
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
+
16
16
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
17
 
18
18
  var _react = _interopRequireWildcard(require("react"));
@@ -21,13 +21,13 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
21
21
 
22
22
  var _variables = require("../common/variables.js");
23
23
 
24
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
24
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
25
25
 
26
- var _BackgroundColorContext = require("../BackgroundColorContext.js");
26
+ var _BackgroundColorContext = require("../BackgroundColorContext");
27
27
 
28
- var _Icons = _interopRequireDefault(require("./Icons"));
28
+ var _Icons = require("./Icons");
29
29
 
30
- 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;
31
31
 
32
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); }
33
33
 
@@ -37,7 +37,7 @@ var DxcFooter = function DxcFooter(_ref) {
37
37
  var socialLinks = _ref.socialLinks,
38
38
  bottomLinks = _ref.bottomLinks,
39
39
  _ref$copyright = _ref.copyright,
40
- 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,
41
41
  children = _ref.children,
42
42
  padding = _ref.padding,
43
43
  margin = _ref.margin,
@@ -63,7 +63,7 @@ var DxcFooter = function DxcFooter(_ref) {
63
63
  var colorsTheme = (0, _useTheme["default"])();
64
64
  var footerLogo = (0, _react.useMemo)(function () {
65
65
  if (!colorsTheme.footer.logo) {
66
- return _Icons["default"];
66
+ return _Icons.dxcLogo;
67
67
  }
68
68
 
69
69
  if (typeof colorsTheme.footer.logo === "string") {
@@ -110,9 +110,9 @@ var DxcFooter = function DxcFooter(_ref) {
110
110
  key: "social".concat(index).concat(link.href),
111
111
  index: index,
112
112
  href: link && link.href ? link.href : ""
113
- }, 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, {
114
- src: link.logoSrc
115
- }));
113
+ }, /*#__PURE__*/_react["default"].createElement(SocialIconContainer, null, typeof link.logo === "string" ? /*#__PURE__*/_react["default"].createElement(SocialIconImg, {
114
+ src: link.logo
115
+ }) : link.logo));
116
116
  });
117
117
  var bottomLink = bottomLinks === null || bottomLinks === void 0 ? void 0 : bottomLinks.map(function (link, index) {
118
118
  return /*#__PURE__*/_react["default"].createElement("span", {
@@ -130,19 +130,17 @@ var DxcFooter = function DxcFooter(_ref) {
130
130
  margin: margin,
131
131
  refSize: refSize,
132
132
  ref: ref
133
- }, /*#__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, {
134
- className: "footerFooter",
133
+ }, /*#__PURE__*/_react["default"].createElement(FooterHeader, {
135
134
  refSize: refSize
136
- }, /*#__PURE__*/_react["default"].createElement(BottomLinks, {
137
- refSize: refSize
138
- }, bottomLink), /*#__PURE__*/_react["default"].createElement(Copyright, {
135
+ }, /*#__PURE__*/_react["default"].createElement(LogoContainer, null, footerLogo), /*#__PURE__*/_react["default"].createElement(SocialLinkContainer, {
139
136
  refSize: refSize
140
- }, 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, {
141
138
  padding: padding
142
139
  }, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
143
140
  color: colorsTheme.footer.backgroundColor
144
141
  }, children)), /*#__PURE__*/_react["default"].createElement(FooterFooter, {
145
- className: "footerFooter"
142
+ className: "footerFooter",
143
+ refSize: refSize
146
144
  }, /*#__PURE__*/_react["default"].createElement(BottomLinks, {
147
145
  refSize: refSize
148
146
  }, bottomLink), /*#__PURE__*/_react["default"].createElement(Copyright, {
@@ -160,9 +158,9 @@ var FooterContainer = _styledComponents["default"].footer(_templateObject || (_t
160
158
  return props.theme.height;
161
159
  });
162
160
 
163
- 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"])));
164
162
 
165
- 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) {
166
164
  return props.refSize <= _variables.responsiveSizes.mobileLarge ? "column" : "row";
167
165
  }, function (props) {
168
166
  return props.refSize <= _variables.responsiveSizes.mobileLarge ? "center" : "";
@@ -170,17 +168,15 @@ var FooterFooter = _styledComponents["default"].div(_templateObject3 || (_templa
170
168
  return "".concat(props.theme.bottomLinksDividerThickness, " ").concat(props.theme.bottomLinksDividerStyle, " ").concat(props.theme.bottomLinksDividerColor);
171
169
  });
172
170
 
173
- 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) {
174
172
  return props.theme.bottomLinksDividerSpacing;
175
173
  }, function (props) {
176
174
  return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "60%";
177
175
  }, function (props) {
178
176
  return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "";
179
- }, function (props) {
180
- return props.refSize <= _variables.responsiveSizes.mobileLarge ? "40px 0 40px 0" : "";
181
177
  });
182
178
 
183
- 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) {
184
180
  return props.padding && (0, _typeof2["default"])(props.padding) !== "object" ? _variables.spaces[props.padding] : "0px";
185
181
  }, function (props) {
186
182
  return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.top ? _variables.spaces[props.padding.top] : "";
@@ -207,7 +203,7 @@ var Copyright = _styledComponents["default"].div(_templateObject6 || (_templateO
207
203
  }, function (props) {
208
204
  return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "";
209
205
  }, function (props) {
210
- return props.refSize <= _variables.responsiveSizes.mobileLarge ? "center" : "right";
206
+ return props.refSize <= _variables.responsiveSizes.mobileLarge ? "left" : "right";
211
207
  }, function (props) {
212
208
  return props.theme.bottomLinksDividerSpacing;
213
209
  });
@@ -224,19 +220,15 @@ var LogoImg = _styledComponents["default"].img(_templateObject8 || (_templateObj
224
220
  return props.theme.logoWidth;
225
221
  });
226
222
 
227
- 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) {
228
226
  return props.index === 0 ? "0px" : props.theme.socialLinksGutter;
229
227
  });
230
228
 
231
- 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) {
232
- return props.theme.socialLinksSize;
233
- }, function (props) {
234
- return props.theme.socialLinksSize;
235
- }, function (props) {
236
- return props.theme.socialLinksColor;
237
- });
229
+ var SocialIconImg = _styledComponents["default"].img(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])([""])));
238
230
 
239
- 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) {
240
232
  return props.theme.socialLinksSize;
241
233
  }, function (props) {
242
234
  return props.theme.socialLinksSize;
@@ -244,11 +236,11 @@ var SocialIconContainer = _styledComponents["default"].div(_templateObject11 ||
244
236
  return props.theme.socialLinksColor;
245
237
  });
246
238
 
247
- 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) {
248
240
  return props.theme.bottomLinksFontColor;
249
241
  });
250
242
 
251
- 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) {
252
244
  return props.theme.bottomLinksTextDecoration;
253
245
  }, function (props) {
254
246
  return props.theme.bottomLinksFontColor;
@@ -28,28 +28,7 @@ const social = [
28
28
  },
29
29
  {
30
30
  href: "https://twitter.com/dxctechnology",
31
- logo: (
32
- <svg version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 438.536 438.536" fill="currentColor">
33
- <g>
34
- <path
35
- 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
36
- 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
37
- h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225
38
- C438.532,59.576,430.49,40.204,414.41,24.123z M335.471,168.735c0.191,1.713,0.288,4.278,0.288,7.71
39
- c0,15.989-2.334,32.025-6.995,48.104c-4.661,16.087-11.8,31.504-21.416,46.254c-9.606,14.749-21.074,27.791-34.396,39.115
40
- c-13.325,11.32-29.311,20.365-47.968,27.117c-18.648,6.762-38.637,10.143-59.953,10.143c-33.116,0-63.76-8.952-91.931-26.836
41
- c4.568,0.568,9.329,0.855,14.275,0.855c27.6,0,52.439-8.565,74.519-25.7c-12.941-0.185-24.506-4.179-34.688-11.991
42
- c-10.185-7.803-17.273-17.699-21.271-29.691c4.947,0.76,8.658,1.137,11.132,1.137c4.187,0,9.042-0.76,14.56-2.279
43
- c-13.894-2.669-25.598-9.562-35.115-20.697c-9.519-11.136-14.277-23.84-14.277-38.114v-0.571
44
- c10.085,4.755,19.602,7.229,28.549,7.422c-17.321-11.613-25.981-28.265-25.981-49.963c0-10.66,2.758-20.747,8.278-30.264
45
- c15.035,18.464,33.311,33.213,54.816,44.252c21.507,11.038,44.54,17.227,69.092,18.558c-0.95-3.616-1.427-8.186-1.427-13.704
46
- c0-16.562,5.853-30.692,17.56-42.399c11.703-11.706,25.837-17.561,42.394-17.561c17.515,0,32.079,6.283,43.688,18.846
47
- c13.134-2.474,25.892-7.33,38.26-14.56c-4.757,14.652-13.613,25.788-26.55,33.402c12.368-1.716,23.88-4.95,34.537-9.708
48
- C357.458,149.793,347.462,160.166,335.471,168.735z"
49
- />
50
- </g>
51
- </svg>
52
- ),
31
+ logo: "http://assets.stickpng.com/images/580b57fcd9996e24bc43c53e.png",
53
32
  },
54
33
  {
55
34
  href: "https://www.facebook.com/DXCTechnology/",
@@ -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;
package/footer/types.d.ts CHANGED
@@ -6,39 +6,43 @@ declare type Size = {
6
6
  left?: Space;
7
7
  right?: Space;
8
8
  };
9
+ declare type SVG = React.SVGProps<SVGSVGElement>;
9
10
  declare type SocialLink = {
10
- logo?: ImgElement;
11
- logoSrc?: string;
12
- href?: string;
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;
13
19
  };
14
20
  declare type BottomLink = {
15
- text?: string;
16
- href?: string;
21
+ /**
22
+ * Text for the link.
23
+ */
24
+ text: string;
25
+ /**
26
+ * URL of the page the link goes to.
27
+ */
28
+ href: string;
17
29
  };
18
- declare type ImgElement = HTMLElement & (SVGElement | HTMLImageElement);
19
30
  declare type FooterPropsType = {
20
31
  /**
21
32
  * An array of objects representing the links that will be rendered as
22
- * icons at the top-right side of the footer. Each object has the
23
- * following properties:
24
- * - logo: Element used as the icon for the link.
25
- * - logoSrc: The path of an icon for the link. @deprecated
26
- * - href: URL of the page the link goes to.
33
+ * icons at the top-right side of the footer.
27
34
  */
28
- socialLinks?: [SocialLink, ...SocialLink[]];
35
+ socialLinks?: SocialLink[];
29
36
  /**
30
37
  * An array of objects representing the links that will be rendered at
31
- * the bottom part of the footer. Each object has the following
32
- * properties:
33
- * - text: Text for the link.
34
- * - href: URL of the page the link goes to.
38
+ * the bottom part of the footer.
35
39
  */
36
- bottomLinks?: [BottomLink, ...BottomLink[]];
40
+ bottomLinks?: BottomLink[];
37
41
  /**
38
42
  * The center section of the footer. Can be used to render custom
39
43
  * content in this area.
40
44
  */
41
- children: React.ReactNode;
45
+ children?: React.ReactNode;
42
46
  /**
43
47
  * The text that will be displayed as copyright disclaimer.
44
48
  */
package/header/Header.js CHANGED
@@ -27,9 +27,9 @@ var _Icons = require("./Icons");
27
27
 
28
28
  var _variables = require("../common/variables.js");
29
29
 
30
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
30
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
31
31
 
32
- var _BackgroundColorContext = _interopRequireWildcard(require("../BackgroundColorContext.js"));
32
+ var _BackgroundColorContext = _interopRequireWildcard(require("../BackgroundColorContext"));
33
33
 
34
34
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15;
35
35
 
@@ -0,0 +1,162 @@
1
+ import React from "react";
2
+ import DxcHeader from "./Header";
3
+ import Title from "../../.storybook/components/Title";
4
+ import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
+ import { userEvent, waitFor, within } from "@storybook/testing-library";
6
+
7
+ export default {
8
+ title: "Header",
9
+ component: DxcHeader,
10
+ };
11
+
12
+ const options: any = [
13
+ {
14
+ value: 1,
15
+ label: "Amazon",
16
+ },
17
+ ];
18
+
19
+ export const Chromatic = () => (
20
+ <>
21
+ <ExampleContainer>
22
+ <Title title="Default with dropdown" theme="light" level={4} />
23
+ <DxcHeader content={<DxcHeader.Dropdown options={options} label="Default Dropdown" />} />
24
+ </ExampleContainer>
25
+ <ExampleContainer>
26
+ <Title title="Underlined with text" theme="light" level={4} />
27
+ <DxcHeader underlined content={<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras felis.</p>} />
28
+ </ExampleContainer>
29
+ <ExampleContainer>
30
+ <Title title="Responsive" theme="light" level={4} />
31
+ <div style={{ width: "400px" }}>
32
+ <DxcHeader
33
+ responsiveContent={(closeHandler) => <DxcHeader.Dropdown options={options} label="Default Dropdown" />}
34
+ underlined
35
+ />
36
+ </div>
37
+ </ExampleContainer>
38
+ <Title title="Margins" theme="light" level={2} />
39
+ <ExampleContainer>
40
+ <Title title="Xxsmall margin" theme="light" level={4} />
41
+ <DxcHeader underlined margin="xxsmall" />
42
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras felis.</p>
43
+ </ExampleContainer>
44
+ <ExampleContainer>
45
+ <Title title="Xsmall margin" theme="light" level={4} />
46
+ <DxcHeader underlined margin="xsmall" />
47
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras felis.</p>
48
+ </ExampleContainer>
49
+ <ExampleContainer>
50
+ <Title title="Small margin" theme="light" level={4} />
51
+ <DxcHeader underlined margin="small" />
52
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras felis.</p>
53
+ </ExampleContainer>
54
+ <ExampleContainer>
55
+ <Title title="Medium margin" theme="light" level={4} />
56
+ <DxcHeader underlined margin="medium" />
57
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras felis.</p>
58
+ </ExampleContainer>
59
+ <ExampleContainer>
60
+ <Title title="Large margin" theme="light" level={4} />
61
+ <DxcHeader underlined margin="large" />
62
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras felis.</p>
63
+ </ExampleContainer>
64
+ <ExampleContainer>
65
+ <Title title="Xlarge margin" theme="light" level={4} />
66
+ <DxcHeader underlined margin="xlarge" />
67
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras felis.</p>
68
+ </ExampleContainer>
69
+ <ExampleContainer>
70
+ <Title title="Xxlarge margin" theme="light" level={4} />
71
+ <DxcHeader underlined margin="xxlarge" />
72
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras felis.</p>
73
+ </ExampleContainer>
74
+
75
+ <Title title="Paddings" theme="light" level={2} />
76
+ <ExampleContainer>
77
+ <Title title="Xxsmall padding" theme="light" level={4} />
78
+ <DxcHeader underlined padding="xxsmall" />
79
+ </ExampleContainer>
80
+ <ExampleContainer>
81
+ <Title title="Xsmall padding" theme="light" level={4} />
82
+ <DxcHeader underlined padding="xsmall" />
83
+ </ExampleContainer>
84
+ <ExampleContainer>
85
+ <Title title="Small padding" theme="light" level={4} />
86
+ <DxcHeader underlined padding="small" />
87
+ </ExampleContainer>
88
+ <ExampleContainer>
89
+ <Title title="Medium padding" theme="light" level={4} />
90
+ <DxcHeader underlined padding="medium" />
91
+ </ExampleContainer>
92
+ <ExampleContainer>
93
+ <Title title="Large padding" theme="light" level={4} />
94
+ <DxcHeader underlined padding="large" />
95
+ </ExampleContainer>
96
+ <ExampleContainer>
97
+ <Title title="Xlarge padding" theme="light" level={4} />
98
+ <DxcHeader underlined padding="xlarge" />
99
+ </ExampleContainer>
100
+ <ExampleContainer>
101
+ <Title title="Xxlarge padding" theme="light" level={4} />
102
+ <DxcHeader underlined padding="xxlarge" />
103
+ </ExampleContainer>
104
+ </>
105
+ );
106
+
107
+ const RespHeader = () => (
108
+ <ExampleContainer>
109
+ <Title title="Responsive" theme="light" level={4} />
110
+ <div style={{ maxWidth: "400px" }}>
111
+ <DxcHeader
112
+ responsiveContent={(closeHandler) => <DxcHeader.Dropdown options={options} label="Default Dropdown" />}
113
+ underlined
114
+ />
115
+ </div>
116
+ </ExampleContainer>
117
+ );
118
+
119
+ const RespHeaderFocus = () => (
120
+ <ExampleContainer pseudoState="pseudo-focus">
121
+ <Title title="Responsive" theme="light" level={4} />
122
+ <div style={{ maxWidth: "400px" }}>
123
+ <DxcHeader
124
+ responsiveContent={(closeHandler) => <p>Lorem ipsum dolor sit amet.</p>}
125
+ underlined
126
+ />
127
+ </div>
128
+ </ExampleContainer>
129
+ );
130
+
131
+ const RespHeaderHover = () => (
132
+ <ExampleContainer pseudoState="pseudo-hover">
133
+ <Title title="Responsive" theme="light" level={4} />
134
+ <div style={{ maxWidth: "400px" }}>
135
+ <DxcHeader
136
+ responsiveContent={(closeHandler) => <p>Lorem ipsum dolor sit amet.</p>}
137
+ underlined
138
+ />
139
+ </div>
140
+ </ExampleContainer>
141
+ );
142
+
143
+ export const ResponsiveHeader = RespHeader.bind({});
144
+ ResponsiveHeader.play = async ({ canvasElement }) => {
145
+ const canvas = within(canvasElement);
146
+ await waitFor(() => canvas.findByText("Menu"));
147
+ await userEvent.click(canvas.getByText("Menu"));
148
+ };
149
+
150
+ export const ResponsiveHeaderFocus = RespHeaderFocus.bind({});
151
+ ResponsiveHeaderFocus.play = async ({ canvasElement }) => {
152
+ const canvas = within(canvasElement);
153
+ await waitFor(() => canvas.findByText("Menu"));
154
+ await userEvent.click(canvas.getByText("Menu"));
155
+ };
156
+
157
+ export const ResponsiveHeaderHover = RespHeaderHover.bind({});
158
+ ResponsiveHeaderHover.play = async ({ canvasElement }) => {
159
+ const canvas = within(canvasElement);
160
+ await waitFor(() => canvas.findByText("Menu"));
161
+ await userEvent.click(canvas.getByText("Menu"));
162
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const dxcLogo: JSX.Element;
package/header/types.d.ts CHANGED
@@ -27,11 +27,13 @@ declare type Props = {
27
27
  */
28
28
  onClick?: () => void;
29
29
  /**
30
- * Size of the bottom margin to be applied to the header.
30
+ * Size of the bottom margin to be applied to the header
31
+ * ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
31
32
  */
32
33
  margin?: Space;
33
34
  /**
34
- * Size of the padding to be applied to the custom area of the component.
35
+ * Size of the padding to be applied to the custom area of the component
36
+ * ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
35
37
  * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in
36
38
  * order to specify different padding sizes.
37
39
  */
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import HeadingPropsType from "./types";
3
+ declare const DxcHeading: ({ level, text, as, weight, margin }: HeadingPropsType) => JSX.Element;
4
+ export default DxcHeading;