@dxc-technology/halstack-react 0.0.0-c709eea → 0.0.0-c713b1b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BackgroundColorContext.d.ts +10 -0
- package/BackgroundColorContext.js +1 -4
- package/HalstackContext.d.ts +10 -0
- package/{ThemeContext.js → HalstackContext.js} +31 -34
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +15 -47
- package/accordion/Accordion.stories.tsx +307 -0
- package/accordion/Accordion.test.js +72 -0
- package/accordion/types.d.ts +8 -8
- package/accordion-group/AccordionGroup.d.ts +1 -1
- package/accordion-group/AccordionGroup.js +15 -17
- package/accordion-group/AccordionGroup.stories.tsx +225 -0
- package/accordion-group/AccordionGroup.test.js +151 -0
- package/accordion-group/types.d.ts +8 -8
- package/alert/Alert.js +2 -2
- package/alert/Alert.stories.tsx +170 -0
- package/alert/Alert.test.js +92 -0
- package/alert/types.d.ts +1 -1
- package/badge/Badge.d.ts +4 -0
- package/badge/Badge.js +1 -1
- package/badge/types.d.ts +4 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +84 -0
- package/bleed/Bleed.stories.tsx +342 -0
- package/bleed/types.d.ts +37 -0
- package/bleed/types.js +5 -0
- package/box/Box.d.ts +4 -0
- package/box/Box.js +6 -32
- package/box/Box.stories.tsx +132 -0
- package/box/Box.test.js +18 -0
- package/box/types.d.ts +43 -0
- package/box/types.js +5 -0
- package/button/Button.d.ts +1 -1
- package/button/Button.js +24 -32
- package/button/Button.stories.tsx +223 -242
- package/button/Button.test.js +35 -0
- package/button/types.d.ts +9 -13
- package/card/Card.js +32 -34
- package/card/Card.stories.tsx +201 -0
- package/card/Card.test.js +50 -0
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +4 -6
- package/checkbox/Checkbox.d.ts +1 -1
- package/checkbox/Checkbox.js +42 -41
- package/checkbox/Checkbox.stories.tsx +188 -0
- package/checkbox/Checkbox.test.js +78 -0
- package/checkbox/types.d.ts +9 -5
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +16 -76
- package/chip/Chip.stories.tsx +119 -0
- package/chip/Chip.test.js +56 -0
- package/chip/types.d.ts +45 -0
- package/chip/types.js +5 -0
- package/common/variables.js +101 -294
- package/date-input/DateInput.js +60 -52
- package/date-input/DateInput.stories.tsx +138 -0
- package/date-input/DateInput.test.js +479 -0
- package/date-input/types.d.ts +16 -9
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +10 -56
- package/dialog/Dialog.stories.tsx +212 -0
- package/dialog/Dialog.test.js +40 -0
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/dropdown/Dropdown.js +28 -87
- package/dropdown/Dropdown.stories.tsx +249 -0
- package/dropdown/Dropdown.test.js +189 -0
- package/dropdown/types.d.ts +80 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +167 -109
- package/file-input/FileInput.stories.tsx +507 -0
- package/file-input/FileInput.test.js +457 -0
- package/file-input/FileItem.d.ts +14 -0
- package/file-input/FileItem.js +16 -23
- package/file-input/types.d.ts +112 -0
- package/file-input/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +32 -146
- package/footer/Footer.stories.tsx +130 -0
- package/footer/Footer.test.js +109 -0
- package/footer/Icons.d.ts +2 -0
- package/footer/Icons.js +3 -3
- package/footer/types.d.ts +65 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +48 -74
- package/header/Header.stories.tsx +172 -0
- package/header/Header.test.js +79 -0
- package/header/Icons.d.ts +2 -0
- package/header/Icons.js +2 -27
- package/header/types.d.ts +47 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/heading/Heading.js +7 -24
- package/heading/Heading.stories.tsx +54 -0
- package/heading/Heading.test.js +186 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +84 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +37 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +10 -0
- package/layout/ApplicationLayout.js +14 -31
- package/layout/ApplicationLayout.stories.tsx +171 -0
- package/layout/types.d.ts +57 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +4 -0
- package/link/Link.js +70 -91
- package/link/Link.stories.tsx +186 -0
- package/link/Link.test.js +83 -0
- package/link/types.d.ts +55 -0
- package/link/types.js +5 -0
- package/list/List.d.ts +4 -0
- package/list/List.js +47 -0
- package/list/List.stories.tsx +95 -0
- package/list/types.d.ts +7 -0
- package/list/types.js +5 -0
- package/main.d.ts +11 -8
- package/main.js +66 -42
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +16 -68
- package/number-input/NumberInput.stories.tsx +115 -0
- package/number-input/NumberInput.test.js +506 -0
- package/number-input/NumberInputContext.d.ts +4 -0
- package/number-input/NumberInputContext.js +5 -2
- package/number-input/numberInputContextTypes.d.ts +19 -0
- package/number-input/numberInputContextTypes.js +5 -0
- package/number-input/types.d.ts +124 -0
- package/number-input/types.js +5 -0
- package/package.json +9 -6
- package/paginator/Paginator.js +2 -8
- package/paginator/Paginator.stories.tsx +63 -0
- package/paginator/Paginator.test.js +266 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/password-input/PasswordInput.js +19 -55
- package/password-input/{PasswordInput.stories.jsx → PasswordInput.stories.tsx} +4 -4
- package/password-input/PasswordInput.test.js +181 -0
- package/password-input/types.d.ts +110 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/progress-bar/ProgressBar.js +5 -23
- package/progress-bar/ProgressBar.stories.jsx +58 -0
- package/progress-bar/ProgressBar.test.js +65 -0
- package/progress-bar/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +64 -0
- package/quick-nav/QuickNav.stories.tsx +237 -0
- package/quick-nav/types.d.ts +21 -0
- package/quick-nav/types.js +5 -0
- package/radio/Radio.js +12 -13
- package/radio/Radio.stories.tsx +192 -0
- package/radio/Radio.test.js +71 -0
- package/radio/types.d.ts +2 -2
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +141 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +280 -0
- package/radio-group/RadioGroup.stories.tsx +100 -0
- package/radio-group/RadioGroup.test.js +695 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/resultsetTable/ResultsetTable.js +9 -29
- package/resultsetTable/ResultsetTable.stories.tsx +275 -0
- package/resultsetTable/ResultsetTable.test.js +306 -0
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/row/Row.d.ts +3 -0
- package/row/Row.js +127 -0
- package/row/Row.stories.tsx +237 -0
- package/row/types.d.ts +28 -0
- package/row/types.js +5 -0
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +93 -0
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +148 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +110 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +107 -317
- package/select/Select.stories.tsx +582 -0
- package/select/Select.test.js +2057 -0
- package/select/types.d.ts +213 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/sidenav/Sidenav.js +6 -15
- package/sidenav/Sidenav.stories.tsx +182 -0
- package/sidenav/Sidenav.test.js +56 -0
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +63 -85
- package/slider/Slider.stories.tsx +177 -0
- package/slider/Slider.test.js +150 -0
- package/slider/types.d.ts +82 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +8 -25
- package/spinner/Spinner.stories.jsx +103 -0
- package/spinner/Spinner.test.js +64 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/stack/Stack.d.ts +3 -0
- package/stack/Stack.js +97 -0
- package/stack/Stack.stories.tsx +164 -0
- package/stack/types.d.ts +24 -0
- package/stack/types.js +5 -0
- package/switch/Switch.d.ts +1 -1
- package/switch/Switch.js +34 -21
- package/switch/Switch.stories.tsx +160 -0
- package/switch/Switch.test.js +98 -0
- package/switch/types.d.ts +6 -2
- package/table/Table.d.ts +4 -0
- package/table/Table.js +3 -3
- package/table/Table.stories.jsx +277 -0
- package/table/Table.test.js +26 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +24 -72
- package/tabs/Tabs.stories.tsx +112 -0
- package/tabs/Tabs.test.js +140 -0
- package/tabs/types.d.ts +82 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +34 -59
- package/tag/Tag.stories.tsx +142 -0
- package/tag/Tag.test.js +60 -0
- package/tag/types.d.ts +69 -0
- package/tag/types.js +5 -0
- package/text/Text.d.ts +7 -0
- package/text/Text.js +30 -0
- package/text/Text.stories.tsx +19 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +64 -93
- package/text-input/TextInput.stories.tsx +474 -0
- package/text-input/TextInput.test.js +1712 -0
- package/text-input/types.d.ts +166 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/textarea/Textarea.js +37 -68
- package/textarea/Textarea.stories.jsx +37 -15
- package/textarea/Textarea.test.js +437 -0
- package/textarea/types.d.ts +137 -0
- package/textarea/types.js +5 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +18 -46
- package/toggle-group/ToggleGroup.stories.tsx +173 -0
- package/toggle-group/ToggleGroup.test.js +156 -0
- package/toggle-group/types.d.ts +105 -0
- package/toggle-group/types.js +5 -0
- package/useTheme.d.ts +2 -0
- package/useTheme.js +2 -2
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +89 -70
- package/wizard/Wizard.stories.tsx +214 -0
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/V3Select/V3Select.js +0 -455
- package/V3Select/index.d.ts +0 -27
- package/V3Textarea/V3Textarea.js +0 -260
- package/V3Textarea/index.d.ts +0 -27
- package/box/index.d.ts +0 -25
- package/chip/index.d.ts +0 -22
- package/date/Date.js +0 -373
- package/date/index.d.ts +0 -27
- package/dialog/index.d.ts +0 -18
- package/dropdown/index.d.ts +0 -26
- package/file-input/index.d.ts +0 -81
- package/footer/index.d.ts +0 -25
- package/header/index.d.ts +0 -25
- package/heading/index.d.ts +0 -17
- package/input-text/Icons.js +0 -22
- package/input-text/InputText.js +0 -611
- package/input-text/index.d.ts +0 -36
- package/link/index.d.ts +0 -23
- package/number-input/index.d.ts +0 -113
- package/password-input/index.d.ts +0 -94
- package/progress-bar/index.d.ts +0 -18
- package/resultsetTable/index.d.ts +0 -19
- package/select/index.d.ts +0 -131
- package/sidenav/index.d.ts +0 -13
- package/slider/index.d.ts +0 -29
- package/spinner/index.d.ts +0 -17
- package/table/index.d.ts +0 -13
- package/tabs/index.d.ts +0 -19
- package/tag/index.d.ts +0 -24
- package/text-input/index.d.ts +0 -135
- package/textarea/index.d.ts +0 -117
- package/toggle/Toggle.js +0 -186
- package/toggle/index.d.ts +0 -21
- package/toggle-group/index.d.ts +0 -21
- package/upload/Upload.js +0 -201
- package/upload/buttons-upload/ButtonsUpload.js +0 -111
- package/upload/buttons-upload/Icons.js +0 -40
- package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
- package/upload/dragAndDropArea/Icons.js +0 -39
- package/upload/file-upload/FileToUpload.js +0 -115
- package/upload/file-upload/Icons.js +0 -66
- package/upload/files-upload/FilesToUpload.js +0 -109
- package/upload/index.d.ts +0 -15
- package/upload/transaction/Icons.js +0 -160
- package/upload/transaction/Transaction.js +0 -104
- package/upload/transactions/Transactions.js +0 -94
- package/wizard/Icons.js +0 -65
- package/wizard/index.d.ts +0 -18
package/footer/Footer.js
CHANGED
|
@@ -9,67 +9,42 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
13
|
|
|
18
|
-
var
|
|
14
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
19
15
|
|
|
20
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
17
|
|
|
22
18
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
19
|
|
|
24
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
20
|
var _variables = require("../common/variables.js");
|
|
27
21
|
|
|
28
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
22
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
29
23
|
|
|
30
|
-
var _BackgroundColorContext = require("../BackgroundColorContext
|
|
24
|
+
var _BackgroundColorContext = require("../BackgroundColorContext");
|
|
31
25
|
|
|
32
|
-
var _Icons =
|
|
26
|
+
var _Icons = require("./Icons");
|
|
33
27
|
|
|
34
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
|
28
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14;
|
|
35
29
|
|
|
36
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
31
|
|
|
38
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; }
|
|
39
33
|
|
|
40
34
|
var DxcFooter = function DxcFooter(_ref) {
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
_ref$bottomLinks = _ref.bottomLinks,
|
|
44
|
-
bottomLinks = _ref$bottomLinks === void 0 ? [] : _ref$bottomLinks,
|
|
35
|
+
var socialLinks = _ref.socialLinks,
|
|
36
|
+
bottomLinks = _ref.bottomLinks,
|
|
45
37
|
_ref$copyright = _ref.copyright,
|
|
46
|
-
copyright = _ref$copyright === void 0 ? "" : _ref$copyright,
|
|
38
|
+
copyright = _ref$copyright === void 0 ? "\xA9 DXC Technology ".concat(new Date().getFullYear(), ". All rights reserved.") : _ref$copyright,
|
|
47
39
|
children = _ref.children,
|
|
48
40
|
padding = _ref.padding,
|
|
49
41
|
margin = _ref.margin,
|
|
50
42
|
_ref$tabIndex = _ref.tabIndex,
|
|
51
43
|
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
52
|
-
var ref = (0, _react.useRef)(null);
|
|
53
|
-
|
|
54
|
-
var _useState = (0, _react.useState)(),
|
|
55
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
56
|
-
refSize = _useState2[0],
|
|
57
|
-
setRefSize = _useState2[1];
|
|
58
|
-
|
|
59
|
-
var _useState3 = (0, _react.useState)(false),
|
|
60
|
-
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
61
|
-
isResponsiveTablet = _useState4[0],
|
|
62
|
-
setIsResponsiveTablet = _useState4[1];
|
|
63
|
-
|
|
64
|
-
var _useState5 = (0, _react.useState)(false),
|
|
65
|
-
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
66
|
-
isResponsivePhone = _useState6[0],
|
|
67
|
-
setIsResponsivePhone = _useState6[1];
|
|
68
|
-
|
|
69
44
|
var colorsTheme = (0, _useTheme["default"])();
|
|
70
45
|
var footerLogo = (0, _react.useMemo)(function () {
|
|
71
46
|
if (!colorsTheme.footer.logo) {
|
|
72
|
-
return _Icons
|
|
47
|
+
return _Icons.dxcLogo;
|
|
73
48
|
}
|
|
74
49
|
|
|
75
50
|
if (typeof colorsTheme.footer.logo === "string") {
|
|
@@ -81,46 +56,17 @@ var DxcFooter = function DxcFooter(_ref) {
|
|
|
81
56
|
|
|
82
57
|
return colorsTheme.footer.logo;
|
|
83
58
|
}, [colorsTheme.footer.logo]);
|
|
84
|
-
|
|
85
|
-
var handleResize = function handleResize(refWidth) {
|
|
86
|
-
if (ref.current) {
|
|
87
|
-
setRefSize(refWidth);
|
|
88
|
-
|
|
89
|
-
if (refWidth <= _variables.responsiveSizes.tablet && refWidth > _variables.responsiveSizes.mobileLarge) {
|
|
90
|
-
setIsResponsiveTablet(true);
|
|
91
|
-
setIsResponsivePhone(false);
|
|
92
|
-
} else if (refWidth <= _variables.responsiveSizes.tablet && refWidth <= _variables.responsiveSizes.mobileLarge) {
|
|
93
|
-
setIsResponsivePhone(true);
|
|
94
|
-
setIsResponsiveTablet(false);
|
|
95
|
-
} else {
|
|
96
|
-
setIsResponsiveTablet(false);
|
|
97
|
-
setIsResponsivePhone(false);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
var handleEventListener = function handleEventListener() {
|
|
103
|
-
handleResize(ref.current.offsetWidth);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
(0, _react.useEffect)(function () {
|
|
107
|
-
window.addEventListener("resize", handleEventListener);
|
|
108
|
-
handleResize(ref.current.offsetWidth);
|
|
109
|
-
return function () {
|
|
110
|
-
window.removeEventListener("resize", handleEventListener);
|
|
111
|
-
};
|
|
112
|
-
}, []);
|
|
113
|
-
var socialLink = socialLinks.map(function (link, index) {
|
|
59
|
+
var socialLink = socialLinks === null || socialLinks === void 0 ? void 0 : socialLinks.map(function (link, index) {
|
|
114
60
|
return /*#__PURE__*/_react["default"].createElement(SocialAnchor, {
|
|
115
61
|
tabIndex: tabIndex,
|
|
116
62
|
key: "social".concat(index).concat(link.href),
|
|
117
63
|
index: index,
|
|
118
64
|
href: link && link.href ? link.href : ""
|
|
119
|
-
},
|
|
120
|
-
src: link.
|
|
121
|
-
}));
|
|
65
|
+
}, /*#__PURE__*/_react["default"].createElement(SocialIconContainer, null, typeof link.logo === "string" ? /*#__PURE__*/_react["default"].createElement(SocialIconImg, {
|
|
66
|
+
src: link.logo
|
|
67
|
+
}) : link.logo));
|
|
122
68
|
});
|
|
123
|
-
var bottomLink = bottomLinks.map(function (link, index) {
|
|
69
|
+
var bottomLink = bottomLinks === null || bottomLinks === void 0 ? void 0 : bottomLinks.map(function (link, index) {
|
|
124
70
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
125
71
|
key: "bottom".concat(index).concat(link.text)
|
|
126
72
|
}, /*#__PURE__*/_react["default"].createElement(BottomLink, {
|
|
@@ -133,32 +79,17 @@ var DxcFooter = function DxcFooter(_ref) {
|
|
|
133
79
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
134
80
|
theme: colorsTheme.footer
|
|
135
81
|
}, /*#__PURE__*/_react["default"].createElement(FooterContainer, {
|
|
136
|
-
margin: margin
|
|
137
|
-
|
|
138
|
-
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",
|
|
141
|
-
refSize: refSize
|
|
142
|
-
}, /*#__PURE__*/_react["default"].createElement(BottomLinks, {
|
|
143
|
-
refSize: refSize
|
|
144
|
-
}, bottomLink), /*#__PURE__*/_react["default"].createElement(Copyright, {
|
|
145
|
-
refSize: refSize
|
|
146
|
-
}, copyright))), (!isResponsiveTablet && !isResponsivePhone || isResponsiveTablet) && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(ChildComponents, {
|
|
82
|
+
margin: margin
|
|
83
|
+
}, /*#__PURE__*/_react["default"].createElement(FooterHeader, null, /*#__PURE__*/_react["default"].createElement(LogoContainer, null, footerLogo), /*#__PURE__*/_react["default"].createElement(SocialLinkContainer, null, socialLink)), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(ChildComponents, {
|
|
147
84
|
padding: padding
|
|
148
85
|
}, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
149
86
|
color: colorsTheme.footer.backgroundColor
|
|
150
87
|
}, children)), /*#__PURE__*/_react["default"].createElement(FooterFooter, {
|
|
151
88
|
className: "footerFooter"
|
|
152
|
-
}, /*#__PURE__*/_react["default"].createElement(BottomLinks,
|
|
153
|
-
refSize: refSize
|
|
154
|
-
}, bottomLink), /*#__PURE__*/_react["default"].createElement(Copyright, {
|
|
155
|
-
refSize: refSize
|
|
156
|
-
}, copyright)))));
|
|
89
|
+
}, /*#__PURE__*/_react["default"].createElement(BottomLinks, null, bottomLink), /*#__PURE__*/_react["default"].createElement(Copyright, null, copyright)))));
|
|
157
90
|
};
|
|
158
91
|
|
|
159
|
-
var FooterContainer = _styledComponents["default"].footer(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n padding: ", ";\n background-color: ", ";\n margin-top: ", ";\n width: 100%;\n box-sizing: border-box;\n min-height: ", ";\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n"])), function (props) {
|
|
160
|
-
return props.refSize <= _variables.responsiveSizes.mobileLarge ? "20px 20px 20px 20px" : "24px 36px 24px 36px";
|
|
161
|
-
}, function (props) {
|
|
92
|
+
var FooterContainer = _styledComponents["default"].footer(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n @media (min-width: ", "rem) {\n padding: 24px 36px 24px 36px;\n }\n\n @media (max-width: ", "rem) {\n //mobile phones\n padding: 20px;\n }\n\n background-color: ", ";\n margin-top: ", ";\n width: 100%;\n box-sizing: border-box;\n min-height: ", ";\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n"])), _variables.responsiveSizes.small, _variables.responsiveSizes.small, function (props) {
|
|
162
93
|
return props.theme.backgroundColor;
|
|
163
94
|
}, function (props) {
|
|
164
95
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
@@ -166,27 +97,17 @@ var FooterContainer = _styledComponents["default"].footer(_templateObject || (_t
|
|
|
166
97
|
return props.theme.height;
|
|
167
98
|
});
|
|
168
99
|
|
|
169
|
-
var FooterHeader = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n"])));
|
|
100
|
+
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
101
|
|
|
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
|
|
172
|
-
return props.refSize <= _variables.responsiveSizes.mobileLarge ? "column" : "row";
|
|
173
|
-
}, function (props) {
|
|
174
|
-
return props.refSize <= _variables.responsiveSizes.mobileLarge ? "center" : "";
|
|
175
|
-
}, function (props) {
|
|
102
|
+
var FooterFooter = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n\n @media (min-width: ", "rem) {\n flex-direction: row;\n }\n\n @media (max-width: ", "rem) {\n //mobile phones\n flex-direction: column;\n align-items: center;\n }\n\n border-top: ", ";\n margin-top: 16px;\n"])), _variables.responsiveSizes.small, _variables.responsiveSizes.small, function (props) {
|
|
176
103
|
return "".concat(props.theme.bottomLinksDividerThickness, " ").concat(props.theme.bottomLinksDividerStyle, " ").concat(props.theme.bottomLinksDividerColor);
|
|
177
104
|
});
|
|
178
105
|
|
|
179
|
-
var BottomLinks = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n padding-top: ", ";\n display: inline-flex;\n flex-wrap: wrap;\n
|
|
106
|
+
var BottomLinks = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n padding-top: ", ";\n display: inline-flex;\n flex-wrap: wrap;\n\n @media (min-width: ", "rem) {\n max-width: 60%;\n }\n\n @media (max-width: ", "rem) {\n //mobile phones\n max-width: 100%;\n width: 100%;\n }\n\n & > span:last-child span {\n display: none;\n }\n align-self: center;\n"])), function (props) {
|
|
180
107
|
return props.theme.bottomLinksDividerSpacing;
|
|
181
|
-
},
|
|
182
|
-
return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "60%";
|
|
183
|
-
}, function (props) {
|
|
184
|
-
return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "";
|
|
185
|
-
}, function (props) {
|
|
186
|
-
return props.refSize <= _variables.responsiveSizes.mobileLarge ? "40px 0 40px 0" : "";
|
|
187
|
-
});
|
|
108
|
+
}, _variables.responsiveSizes.small, _variables.responsiveSizes.small);
|
|
188
109
|
|
|
189
|
-
var ChildComponents = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n min-height:
|
|
110
|
+
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
111
|
return props.padding && (0, _typeof2["default"])(props.padding) !== "object" ? _variables.spaces[props.padding] : "0px";
|
|
191
112
|
}, function (props) {
|
|
192
113
|
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.top ? _variables.spaces[props.padding.top] : "";
|
|
@@ -198,7 +119,7 @@ var ChildComponents = _styledComponents["default"].div(_templateObject5 || (_tem
|
|
|
198
119
|
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.left ? _variables.spaces[props.padding.left] : "";
|
|
199
120
|
});
|
|
200
121
|
|
|
201
|
-
var Copyright = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n
|
|
122
|
+
var Copyright = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n\n @media (min-width: ", "rem) {\n max-width: 40%;\n text-align: right;\n }\n\n @media (max-width: ", "rem) {\n //mobile phones\n max-width: 100%;\n width: 100%;\n text-align: left;\n }\n \n padding-top: ", ";\n"])), function (props) {
|
|
202
123
|
return props.theme.copyrightFontFamily;
|
|
203
124
|
}, function (props) {
|
|
204
125
|
return props.theme.copyrightFontSize;
|
|
@@ -208,13 +129,7 @@ var Copyright = _styledComponents["default"].div(_templateObject6 || (_templateO
|
|
|
208
129
|
return props.theme.copyrightFontWeight;
|
|
209
130
|
}, function (props) {
|
|
210
131
|
return props.theme.copyrightFontColor;
|
|
211
|
-
}, function (props) {
|
|
212
|
-
return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "40%";
|
|
213
|
-
}, function (props) {
|
|
214
|
-
return props.refSize <= _variables.responsiveSizes.mobileLarge ? "100%" : "";
|
|
215
|
-
}, function (props) {
|
|
216
|
-
return props.refSize <= _variables.responsiveSizes.mobileLarge ? "center" : "right";
|
|
217
|
-
}, function (props) {
|
|
132
|
+
}, _variables.responsiveSizes.small, _variables.responsiveSizes.small, function (props) {
|
|
218
133
|
return props.theme.bottomLinksDividerSpacing;
|
|
219
134
|
});
|
|
220
135
|
|
|
@@ -230,19 +145,15 @@ var LogoImg = _styledComponents["default"].img(_templateObject8 || (_templateObj
|
|
|
230
145
|
return props.theme.logoWidth;
|
|
231
146
|
});
|
|
232
147
|
|
|
233
|
-
var
|
|
148
|
+
var SocialLinkContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-self: center;\n"])));
|
|
149
|
+
|
|
150
|
+
var SocialAnchor = _styledComponents["default"].a(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n & {\n display: inline-flex;\n margin-left: ", ";\n }\n"])), function (props) {
|
|
234
151
|
return props.index === 0 ? "0px" : props.theme.socialLinksGutter;
|
|
235
152
|
});
|
|
236
153
|
|
|
237
|
-
var
|
|
238
|
-
return props.theme.socialLinksSize;
|
|
239
|
-
}, function (props) {
|
|
240
|
-
return props.theme.socialLinksSize;
|
|
241
|
-
}, function (props) {
|
|
242
|
-
return props.theme.socialLinksColor;
|
|
243
|
-
});
|
|
154
|
+
var SocialIconImg = _styledComponents["default"].img(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
244
155
|
|
|
245
|
-
var SocialIconContainer = _styledComponents["default"].div(
|
|
156
|
+
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
157
|
return props.theme.socialLinksSize;
|
|
247
158
|
}, function (props) {
|
|
248
159
|
return props.theme.socialLinksSize;
|
|
@@ -250,11 +161,11 @@ var SocialIconContainer = _styledComponents["default"].div(_templateObject11 ||
|
|
|
250
161
|
return props.theme.socialLinksColor;
|
|
251
162
|
});
|
|
252
163
|
|
|
253
|
-
var Point = _styledComponents["default"].span(
|
|
164
|
+
var Point = _styledComponents["default"].span(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px 10px;\n color: ", ";\n"])), function (props) {
|
|
254
165
|
return props.theme.bottomLinksFontColor;
|
|
255
166
|
});
|
|
256
167
|
|
|
257
|
-
var BottomLink = _styledComponents["default"].a(
|
|
168
|
+
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
169
|
return props.theme.bottomLinksTextDecoration;
|
|
259
170
|
}, function (props) {
|
|
260
171
|
return props.theme.bottomLinksFontColor;
|
|
@@ -268,30 +179,5 @@ var BottomLink = _styledComponents["default"].a(_templateObject13 || (_templateO
|
|
|
268
179
|
return props.theme.bottomLinksFontWeight;
|
|
269
180
|
});
|
|
270
181
|
|
|
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
182
|
var _default = DxcFooter;
|
|
297
183
|
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,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@testing-library/react");
|
|
8
|
+
|
|
9
|
+
var _linkedin = _interopRequireDefault(require("../../app/src/images/linkedin.svg"));
|
|
10
|
+
|
|
11
|
+
var _Footer = _interopRequireDefault(require("./Footer"));
|
|
12
|
+
|
|
13
|
+
describe("Footer component tests", function () {
|
|
14
|
+
test("Footer renders with default logo", function () {
|
|
15
|
+
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Footer["default"], null)),
|
|
16
|
+
getByTitle = _render.getByTitle;
|
|
17
|
+
|
|
18
|
+
expect(getByTitle("DXC Logo")).toBeTruthy();
|
|
19
|
+
});
|
|
20
|
+
test("Footer renders with social links", function () {
|
|
21
|
+
var social = [{
|
|
22
|
+
href: "https://www.test.com/test",
|
|
23
|
+
logo: _linkedin["default"]
|
|
24
|
+
}];
|
|
25
|
+
|
|
26
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Footer["default"], {
|
|
27
|
+
socialLinks: social
|
|
28
|
+
})),
|
|
29
|
+
getByRole = _render2.getByRole;
|
|
30
|
+
|
|
31
|
+
var socialIcon = getByRole("link");
|
|
32
|
+
expect(socialIcon.getAttribute("href")).toBe("https://www.test.com/test");
|
|
33
|
+
});
|
|
34
|
+
test("Footer renders with bottom links", function () {
|
|
35
|
+
var bottom = [{
|
|
36
|
+
href: "https://www.test.com/test",
|
|
37
|
+
text: "bottom-link-text"
|
|
38
|
+
}];
|
|
39
|
+
|
|
40
|
+
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Footer["default"], {
|
|
41
|
+
bottomLinks: bottom
|
|
42
|
+
})),
|
|
43
|
+
getByText = _render3.getByText;
|
|
44
|
+
|
|
45
|
+
var link = getByText("bottom-link-text");
|
|
46
|
+
expect(link.getAttribute("href")).toBe("https://www.test.com/test");
|
|
47
|
+
});
|
|
48
|
+
test("Footer renders with copyright text", function () {
|
|
49
|
+
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Footer["default"], {
|
|
50
|
+
copyright: "test-copyright"
|
|
51
|
+
})),
|
|
52
|
+
getByText = _render4.getByText;
|
|
53
|
+
|
|
54
|
+
expect(getByText("test-copyright")).toBeTruthy();
|
|
55
|
+
});
|
|
56
|
+
test("Footer renders with correct children", function () {
|
|
57
|
+
//We need to force the offsetWidth value
|
|
58
|
+
Object.defineProperty(HTMLElement.prototype, "offsetWidth", {
|
|
59
|
+
configurable: true,
|
|
60
|
+
value: 1024
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Footer["default"], null, /*#__PURE__*/_react["default"].createElement("p", null, "footer-child-text"))),
|
|
64
|
+
getByText = _render5.getByText;
|
|
65
|
+
|
|
66
|
+
expect(getByText("footer-child-text")).toBeTruthy();
|
|
67
|
+
});
|
|
68
|
+
test("Footer renders with children in mobile", function () {
|
|
69
|
+
//425 is mobile width
|
|
70
|
+
Object.defineProperty(HTMLElement.prototype, "offsetWidth", {
|
|
71
|
+
configurable: true,
|
|
72
|
+
value: 425
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Footer["default"], null, /*#__PURE__*/_react["default"].createElement("p", null, "footer-child-text"))),
|
|
76
|
+
queryByText = _render6.queryByText;
|
|
77
|
+
|
|
78
|
+
expect(queryByText("footer-child-text")).toBeTruthy();
|
|
79
|
+
});
|
|
80
|
+
test("Footer is fully rendered", function () {
|
|
81
|
+
Object.defineProperty(HTMLElement.prototype, "offsetWidth", {
|
|
82
|
+
configurable: true,
|
|
83
|
+
value: 1024
|
|
84
|
+
});
|
|
85
|
+
var social = [{
|
|
86
|
+
href: "https://www.test.com/social",
|
|
87
|
+
logo: _linkedin["default"]
|
|
88
|
+
}];
|
|
89
|
+
var bottom = [{
|
|
90
|
+
href: "https://www.test.com/bottom",
|
|
91
|
+
text: "bottom-link-text"
|
|
92
|
+
}];
|
|
93
|
+
|
|
94
|
+
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Footer["default"], {
|
|
95
|
+
socialLinks: social,
|
|
96
|
+
bottomLinks: bottom,
|
|
97
|
+
copyright: "test-copyright"
|
|
98
|
+
}, /*#__PURE__*/_react["default"].createElement("p", null, "footer-child-text"))),
|
|
99
|
+
getAllByRole = _render7.getAllByRole,
|
|
100
|
+
getByText = _render7.getByText;
|
|
101
|
+
|
|
102
|
+
var socialIcon = getAllByRole("link")[0];
|
|
103
|
+
expect(socialIcon.getAttribute("href")).toBe("https://www.test.com/social");
|
|
104
|
+
var bottomLink = getByText("bottom-link-text");
|
|
105
|
+
expect(bottomLink.getAttribute("href")).toBe("https://www.test.com/bottom");
|
|
106
|
+
expect(getByText("test-copyright")).toBeTruthy();
|
|
107
|
+
expect(getByText("footer-child-text")).toBeTruthy();
|
|
108
|
+
});
|
|
109
|
+
});
|
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
|
|
8
|
+
exports.dxcLogo = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var
|
|
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
|
|
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;
|