@dxc-technology/halstack-react 0.0.0-71a326e → 0.0.0-73f82b7
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/accordion/types.d.ts +1 -1
- package/accordion-group/types.d.ts +1 -1
- package/alert/Alert.stories.tsx +170 -0
- package/box/Box.d.ts +4 -0
- package/box/Box.js +9 -32
- package/box/Box.stories.tsx +132 -0
- package/box/types.d.ts +47 -0
- package/box/types.js +5 -0
- package/button/Button.d.ts +1 -1
- package/button/Button.js +7 -12
- package/button/Button.stories.tsx +217 -234
- package/button/types.d.ts +10 -10
- package/card/Card.d.ts +4 -0
- package/card/Card.js +13 -48
- package/card/types.d.ts +69 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/common/variables.js +30 -22
- package/date-input/DateInput.stories.tsx +138 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +4 -23
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/dropdown/Dropdown.js +7 -40
- package/dropdown/types.d.ts +89 -0
- package/dropdown/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +4 -35
- package/footer/Footer.stories.jsx +151 -0
- package/footer/types.d.ts +61 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +26 -28
- package/header/Icons.js +2 -27
- package/header/types.d.ts +45 -0
- package/header/types.js +5 -0
- package/link/Link.d.ts +3 -0
- package/link/Link.js +1 -23
- package/link/Link.stories.tsx +70 -0
- package/link/types.d.ts +74 -0
- package/link/types.js +5 -0
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +2 -44
- package/number-input/NumberInput.stories.tsx +115 -0
- package/number-input/types.d.ts +117 -0
- package/number-input/types.js +5 -0
- package/package.json +1 -1
- package/paginator/Paginator.stories.tsx +63 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/password-input/PasswordInput.js +0 -37
- package/password-input/{PasswordInput.stories.jsx → PasswordInput.stories.tsx} +1 -1
- package/password-input/types.d.ts +100 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/progress-bar/ProgressBar.js +3 -21
- package/progress-bar/ProgressBar.stories.jsx +58 -0
- package/progress-bar/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/radio/Radio.stories.tsx +192 -0
- package/select/index.d.ts +4 -4
- package/sidenav/Sidenav.d.ts +9 -0
- package/sidenav/Sidenav.js +4 -13
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +57 -80
- package/slider/Slider.stories.tsx +172 -0
- package/slider/types.d.ts +78 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +6 -23
- package/spinner/Spinner.stories.jsx +102 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/switch/Switch.js +2 -2
- package/switch/Switch.stories.tsx +160 -0
- package/table/Table.d.ts +4 -0
- package/table/Table.stories.jsx +276 -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 +5 -53
- package/tabs/types.d.ts +71 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +20 -35
- package/tag/Tag.stories.tsx +145 -0
- package/tag/types.d.ts +60 -0
- package/tag/types.js +5 -0
- package/text-input/index.d.ts +2 -2
- package/textarea/Textarea.stories.jsx +135 -0
- package/toggle-group/ToggleGroup.stories.tsx +178 -0
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +11 -51
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/box/index.d.ts +0 -25
- package/card/index.d.ts +0 -22
- package/dialog/index.d.ts +0 -18
- package/dropdown/index.d.ts +0 -26
- package/footer/index.d.ts +0 -25
- package/header/index.d.ts +0 -25
- 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/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/wizard/index.d.ts +0 -18
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
declare type Padding = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
declare type Props = {
|
|
10
|
+
/**
|
|
11
|
+
* If true, the close 'x' button will be visible.
|
|
12
|
+
*/
|
|
13
|
+
isCloseVisible?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* This function will be called when the user clicks the close 'x' button.
|
|
16
|
+
* The responsibility of hiding the modal lies with the user.
|
|
17
|
+
*/
|
|
18
|
+
onCloseClick?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* If true, the dialog will be displayed over a darker background that covers the content behind.
|
|
21
|
+
*/
|
|
22
|
+
overlay?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* This function will be called when the user clicks background of the modal.
|
|
25
|
+
* The responsibility of hiding the modal lies with the user.
|
|
26
|
+
*/
|
|
27
|
+
onBackgroundClick?: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Size of the padding to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
30
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
31
|
+
*/
|
|
32
|
+
padding?: Padding | Space;
|
|
33
|
+
/**
|
|
34
|
+
* Value of the tabindex given to the close 'x' button.
|
|
35
|
+
*/
|
|
36
|
+
tabIndex?: number;
|
|
37
|
+
/**
|
|
38
|
+
* The area inside the dialog. This area can be used to render
|
|
39
|
+
* custom content.
|
|
40
|
+
*/
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
};
|
|
43
|
+
export default Props;
|
package/dialog/types.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import DropdownPropsType from "./types";
|
|
3
|
+
declare const DxcDropdown: ({ options, optionsIconPosition, icon, iconSrc, iconPosition, label, caretHidden, onSelectOption, expandOnHover, margin, size, tabIndex, disabled, }: DropdownPropsType) => JSX.Element;
|
|
4
|
+
export default DxcDropdown;
|
package/dropdown/Dropdown.js
CHANGED
|
@@ -9,8 +9,6 @@ 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
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
13
|
|
|
16
14
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
@@ -21,8 +19,6 @@ 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 _Popper = _interopRequireDefault(require("@material-ui/core/Popper"));
|
|
27
23
|
|
|
28
24
|
var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
|
|
@@ -48,8 +44,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
48
44
|
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; }
|
|
49
45
|
|
|
50
46
|
var DxcDropdown = function DxcDropdown(_ref) {
|
|
51
|
-
var
|
|
52
|
-
options = _ref$options === void 0 ? [] : _ref$options,
|
|
47
|
+
var options = _ref.options,
|
|
53
48
|
_ref$optionsIconPosit = _ref.optionsIconPosition,
|
|
54
49
|
optionsIconPosition = _ref$optionsIconPosit === void 0 ? "before" : _ref$optionsIconPosit,
|
|
55
50
|
icon = _ref.icon,
|
|
@@ -59,18 +54,18 @@ var DxcDropdown = function DxcDropdown(_ref) {
|
|
|
59
54
|
iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
|
|
60
55
|
_ref$label = _ref.label,
|
|
61
56
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
62
|
-
_ref$disabled = _ref.disabled,
|
|
63
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
64
57
|
_ref$caretHidden = _ref.caretHidden,
|
|
65
58
|
caretHidden = _ref$caretHidden === void 0 ? false : _ref$caretHidden,
|
|
66
59
|
onSelectOption = _ref.onSelectOption,
|
|
60
|
+
_ref$expandOnHover = _ref.expandOnHover,
|
|
61
|
+
expandOnHover = _ref$expandOnHover === void 0 ? false : _ref$expandOnHover,
|
|
67
62
|
margin = _ref.margin,
|
|
68
63
|
_ref$size = _ref.size,
|
|
69
64
|
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
70
|
-
_ref$expandOnHover = _ref.expandOnHover,
|
|
71
|
-
expandOnHover = _ref$expandOnHover === void 0 ? false : _ref$expandOnHover,
|
|
72
65
|
_ref$tabIndex = _ref.tabIndex,
|
|
73
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex
|
|
66
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,
|
|
67
|
+
_ref$disabled = _ref.disabled,
|
|
68
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
74
69
|
|
|
75
70
|
var _useState = (0, _react.useState)(),
|
|
76
71
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
@@ -106,10 +101,7 @@ var DxcDropdown = function DxcDropdown(_ref) {
|
|
|
106
101
|
|
|
107
102
|
function handleMenuItemClick(option) {
|
|
108
103
|
setAnchorEl(null);
|
|
109
|
-
|
|
110
|
-
if (typeof onSelectOption === "function") {
|
|
111
|
-
onSelectOption(option.value);
|
|
112
|
-
}
|
|
104
|
+
onSelectOption(option.value);
|
|
113
105
|
}
|
|
114
106
|
|
|
115
107
|
function handleClose() {
|
|
@@ -421,30 +413,5 @@ var CaretIconContainer = _styledComponents["default"].div(_templateObject10 || (
|
|
|
421
413
|
return props.theme.caretIconSize;
|
|
422
414
|
});
|
|
423
415
|
|
|
424
|
-
DxcDropdown.propTypes = {
|
|
425
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
426
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
427
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
428
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
429
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
430
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
431
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
432
|
-
optionsIconPosition: _propTypes["default"].oneOf(["after", "before", ""]),
|
|
433
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
434
|
-
iconSrc: _propTypes["default"].string,
|
|
435
|
-
iconPosition: _propTypes["default"].oneOf(["after", "before", ""]),
|
|
436
|
-
label: _propTypes["default"].string,
|
|
437
|
-
caretHidden: _propTypes["default"].bool,
|
|
438
|
-
disabled: _propTypes["default"].bool,
|
|
439
|
-
expandOnHover: _propTypes["default"].bool,
|
|
440
|
-
onSelectOption: _propTypes["default"].func,
|
|
441
|
-
options: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
442
|
-
value: _propTypes["default"].any.isRequired,
|
|
443
|
-
label: _propTypes["default"].any.isRequired,
|
|
444
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
445
|
-
iconSrc: _propTypes["default"].string
|
|
446
|
-
})),
|
|
447
|
-
tabIndex: _propTypes["default"].number
|
|
448
|
-
};
|
|
449
416
|
var _default = DxcDropdown;
|
|
450
417
|
exports["default"] = _default;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
declare type Margin = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
declare type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
10
|
+
declare type Option = {
|
|
11
|
+
/**
|
|
12
|
+
* Option display value.
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Element used as the icon that will be placed next to the
|
|
17
|
+
* option label.
|
|
18
|
+
*/
|
|
19
|
+
icon?: SVG;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated URL of the icon that will be placed next to the option label.
|
|
22
|
+
*/
|
|
23
|
+
iconSrc?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Option inner value.
|
|
26
|
+
*/
|
|
27
|
+
value: string;
|
|
28
|
+
};
|
|
29
|
+
declare type Props = {
|
|
30
|
+
/**
|
|
31
|
+
* An array of objects representing the options.
|
|
32
|
+
*/
|
|
33
|
+
options: [Option, ...Option[]];
|
|
34
|
+
/**
|
|
35
|
+
* In case options include icons, whether the icon should appear
|
|
36
|
+
* after or before the label.
|
|
37
|
+
*/
|
|
38
|
+
optionsIconPosition?: "before" | "after";
|
|
39
|
+
/**
|
|
40
|
+
* Element used as the icon that will be placed next to the
|
|
41
|
+
* dropdown label.
|
|
42
|
+
*/
|
|
43
|
+
icon?: SVG;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated URL of the icon that will be placed next to the
|
|
46
|
+
* dropdown label.
|
|
47
|
+
*/
|
|
48
|
+
iconSrc?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the icon should appear after or before the label.
|
|
51
|
+
*/
|
|
52
|
+
iconPosition?: "before" | "after";
|
|
53
|
+
/**
|
|
54
|
+
* Text to be placed within the dropdown.
|
|
55
|
+
*/
|
|
56
|
+
label?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the arrow next to the label must be displayed or not.
|
|
59
|
+
*/
|
|
60
|
+
caretHidden?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* This function will be called every time the selection changes.
|
|
63
|
+
* The value of the selected option will be passed as a parameter.
|
|
64
|
+
*/
|
|
65
|
+
onSelectOption: (value: string) => void;
|
|
66
|
+
/**
|
|
67
|
+
* If true, the options are showed when the dropdown is hover.
|
|
68
|
+
*/
|
|
69
|
+
expandOnHover?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Size of the margin to be applied to the component.
|
|
72
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right'
|
|
73
|
+
* properties in order to specify different margin sizes.
|
|
74
|
+
*/
|
|
75
|
+
margin?: Space | Margin;
|
|
76
|
+
/**
|
|
77
|
+
* Size of the component.
|
|
78
|
+
*/
|
|
79
|
+
size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
80
|
+
/**
|
|
81
|
+
* Value of the tabindex.
|
|
82
|
+
*/
|
|
83
|
+
tabIndex?: number;
|
|
84
|
+
/**
|
|
85
|
+
* If true, the component will be disabled.
|
|
86
|
+
*/
|
|
87
|
+
disabled?: boolean;
|
|
88
|
+
};
|
|
89
|
+
export default Props;
|
package/footer/Footer.js
CHANGED
|
@@ -9,8 +9,6 @@ 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
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
13
|
|
|
16
14
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
@@ -21,8 +19,6 @@ 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
24
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
@@ -38,10 +34,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
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
|
|
42
|
-
|
|
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
40
|
copyright = _ref$copyright === void 0 ? "" : _ref$copyright,
|
|
47
41
|
children = _ref.children,
|
|
@@ -110,7 +104,7 @@ 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),
|
|
@@ -120,7 +114,7 @@ var DxcFooter = function DxcFooter(_ref) {
|
|
|
120
114
|
src: link.logoSrc
|
|
121
115
|
}));
|
|
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, {
|
|
@@ -268,30 +262,5 @@ var BottomLink = _styledComponents["default"].a(_templateObject13 || (_templateO
|
|
|
268
262
|
return props.theme.bottomLinksFontWeight;
|
|
269
263
|
});
|
|
270
264
|
|
|
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
265
|
var _default = DxcFooter;
|
|
297
266
|
exports["default"] = _default;
|
|
@@ -0,0 +1,151 @@
|
|
|
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: (
|
|
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
|
+
),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
href: "https://www.facebook.com/DXCTechnology/",
|
|
56
|
+
logo: (
|
|
57
|
+
<svg
|
|
58
|
+
version="1.1"
|
|
59
|
+
id="Capa_1"
|
|
60
|
+
x="0px"
|
|
61
|
+
y="0px"
|
|
62
|
+
viewBox="0 0 438.536 438.536"
|
|
63
|
+
fill="currentColor"
|
|
64
|
+
width="1000px"
|
|
65
|
+
height="500px"
|
|
66
|
+
>
|
|
67
|
+
<g>
|
|
68
|
+
<path
|
|
69
|
+
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
|
|
70
|
+
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
|
|
71
|
+
h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225
|
|
72
|
+
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
|
|
73
|
+
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
|
|
74
|
+
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"
|
|
75
|
+
/>
|
|
76
|
+
</g>
|
|
77
|
+
</svg>
|
|
78
|
+
),
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
const bottom = [
|
|
83
|
+
{
|
|
84
|
+
href: "https://www.linkedin.com/company/dxctechnology",
|
|
85
|
+
text: "Linkedin",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
href: "https://twitter.com/dxctechnology",
|
|
89
|
+
text: "Twitter",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
href: "https://www.facebook.com/DXCTechnology/",
|
|
93
|
+
text: "Facebook",
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
export default {
|
|
98
|
+
title: "Footer",
|
|
99
|
+
component: DxcFooter,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const Chromatic = () => (
|
|
103
|
+
<>
|
|
104
|
+
<ExampleContainer>
|
|
105
|
+
<Title title="Default" theme="light" level={4} />
|
|
106
|
+
<DxcFooter />
|
|
107
|
+
</ExampleContainer>
|
|
108
|
+
<ExampleContainer>
|
|
109
|
+
<Title title="With children, copyright, bottom links and social links" theme="light" level={4} />
|
|
110
|
+
<DxcFooter copyright="Copyright" socialLinks={social} bottomLinks={bottom}>
|
|
111
|
+
<div>
|
|
112
|
+
<a href="https://www.linkedin.com/company/dxctechnology">Linkedin</a>
|
|
113
|
+
</div>
|
|
114
|
+
</DxcFooter>
|
|
115
|
+
</ExampleContainer>
|
|
116
|
+
<Title title="Margins" theme="light" level={2} />
|
|
117
|
+
<ExampleContainer>
|
|
118
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
119
|
+
<DxcFooter margin="xxsmall"></DxcFooter>
|
|
120
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
121
|
+
<DxcFooter margin="xsmall"></DxcFooter>
|
|
122
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
123
|
+
<DxcFooter margin="small"></DxcFooter>
|
|
124
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
125
|
+
<DxcFooter margin="medium"></DxcFooter>
|
|
126
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
127
|
+
<DxcFooter margin="large"></DxcFooter>
|
|
128
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
129
|
+
<DxcFooter margin="xlarge"></DxcFooter>
|
|
130
|
+
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
131
|
+
<DxcFooter margin="xxlarge"></DxcFooter>
|
|
132
|
+
</ExampleContainer>
|
|
133
|
+
<Title title="Padding" theme="light" level={2} />
|
|
134
|
+
<ExampleContainer>
|
|
135
|
+
<Title title="Xxsmall padding" theme="light" level={4} />
|
|
136
|
+
<DxcFooter padding="xxsmall"></DxcFooter>
|
|
137
|
+
<Title title="Xsmall padding" theme="light" level={4} />
|
|
138
|
+
<DxcFooter padding="xsmall"></DxcFooter>
|
|
139
|
+
<Title title="Small padding" theme="light" level={4} />
|
|
140
|
+
<DxcFooter padding="small"></DxcFooter>
|
|
141
|
+
<Title title="Medium padding" theme="light" level={4} />
|
|
142
|
+
<DxcFooter padding="medium"></DxcFooter>
|
|
143
|
+
<Title title="Large padding" theme="light" level={4} />
|
|
144
|
+
<DxcFooter padding="large"></DxcFooter>
|
|
145
|
+
<Title title="Xlarge padding" theme="light" level={4} />
|
|
146
|
+
<DxcFooter padding="xlarge"></DxcFooter>
|
|
147
|
+
<Title title="Xxlarge padding" theme="light" level={4} />
|
|
148
|
+
<DxcFooter padding="xxlarge"></DxcFooter>
|
|
149
|
+
</ExampleContainer>
|
|
150
|
+
</>
|
|
151
|
+
);
|
|
@@ -0,0 +1,61 @@
|
|
|
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 SocialLink = {
|
|
10
|
+
logo?: ImgElement;
|
|
11
|
+
logoSrc?: string;
|
|
12
|
+
href?: string;
|
|
13
|
+
};
|
|
14
|
+
declare type BottomLink = {
|
|
15
|
+
text?: string;
|
|
16
|
+
href?: string;
|
|
17
|
+
};
|
|
18
|
+
declare type ImgElement = HTMLElement & (SVGElement | HTMLImageElement);
|
|
19
|
+
declare type FooterPropsType = {
|
|
20
|
+
/**
|
|
21
|
+
* 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.
|
|
27
|
+
*/
|
|
28
|
+
socialLinks?: [SocialLink, ...SocialLink[]];
|
|
29
|
+
/**
|
|
30
|
+
* 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.
|
|
35
|
+
*/
|
|
36
|
+
bottomLinks?: [BottomLink, ...BottomLink[]];
|
|
37
|
+
/**
|
|
38
|
+
* The center section of the footer. Can be used to render custom
|
|
39
|
+
* content in this area.
|
|
40
|
+
*/
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* The text that will be displayed as copyright disclaimer.
|
|
44
|
+
*/
|
|
45
|
+
copyright?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Value of the tabindex for all interactuable elements, except those
|
|
48
|
+
* inside the custom area.
|
|
49
|
+
*/
|
|
50
|
+
tabIndex?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Size of the top margin to be applied to the footer.
|
|
53
|
+
*/
|
|
54
|
+
margin?: Space | Size;
|
|
55
|
+
/**
|
|
56
|
+
* Size of the padding to be applied to the custom area of the component.
|
|
57
|
+
* You can pass an object with properties in order to specify different padding sizes.
|
|
58
|
+
*/
|
|
59
|
+
padding?: Space | Size;
|
|
60
|
+
};
|
|
61
|
+
export default FooterPropsType;
|
package/footer/types.js
ADDED
|
@@ -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;
|