@dxc-technology/halstack-react 0.0.0-d5ae9d7 → 0.0.0-d618bea
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 -3
- package/ThemeContext.d.ts +15 -0
- package/ThemeContext.js +5 -8
- package/V3Select/V3Select.js +2 -2
- package/V3Textarea/V3Textarea.js +2 -2
- package/accordion/Accordion.d.ts +2 -2
- package/accordion/Accordion.js +2 -2
- package/accordion/types.d.ts +1 -1
- package/accordion-group/AccordionGroup.d.ts +7 -0
- package/accordion-group/AccordionGroup.js +59 -73
- package/accordion-group/AccordionGroup.stories.tsx +225 -0
- package/accordion-group/types.d.ts +72 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.js +2 -2
- package/alert/Alert.stories.tsx +170 -0
- package/alert/types.d.ts +1 -1
- package/badge/Badge.js +1 -1
- package/box/Box.d.ts +4 -0
- package/box/Box.js +6 -32
- package/box/Box.stories.tsx +132 -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 +9 -12
- package/button/Button.stories.tsx +217 -234
- package/button/types.d.ts +11 -11
- package/card/Card.d.ts +4 -0
- package/card/Card.js +17 -53
- package/card/Card.stories.tsx +201 -0
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +67 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.js +2 -2
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/checkbox/types.d.ts +3 -4
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +1 -23
- package/chip/Chip.stories.tsx +121 -0
- package/chip/types.d.ts +53 -0
- package/chip/types.js +5 -0
- package/common/variables.js +45 -38
- package/date/Date.js +1 -1
- package/date-input/DateInput.js +4 -7
- package/date-input/DateInput.stories.tsx +138 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +6 -25
- package/dialog/Dialog.stories.tsx +212 -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 +8 -41
- package/dropdown/types.d.ts +89 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +65 -76
- package/file-input/FileItem.d.ts +14 -0
- package/file-input/FileItem.js +12 -21
- 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 +11 -42
- package/footer/Footer.stories.tsx +151 -0
- package/footer/types.d.ts +65 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +28 -30
- package/header/Header.stories.tsx +162 -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 +53 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/input-text/InputText.js +2 -2
- package/layout/ApplicationLayout.d.ts +10 -0
- package/layout/ApplicationLayout.js +8 -18
- 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 +3 -0
- package/link/Link.js +4 -26
- package/link/Link.stories.tsx +146 -0
- package/link/types.d.ts +74 -0
- package/link/types.js +5 -0
- package/list/List.d.ts +7 -0
- package/list/List.js +37 -0
- package/list/List.stories.tsx +70 -0
- package/main.d.ts +7 -3
- package/main.js +34 -2
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +5 -50
- package/number-input/NumberInput.stories.tsx +115 -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 +117 -0
- package/number-input/types.js +5 -0
- package/package.json +1 -1
- package/paginator/Paginator.js +2 -8
- package/paginator/Paginator.stories.tsx +63 -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} +1 -1
- package/password-input/types.d.ts +107 -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/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/radio/Radio.js +2 -2
- package/radio/Radio.stories.tsx +192 -0
- package/radio/types.d.ts +2 -2
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/resultsetTable/ResultsetTable.js +4 -27
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/row/Row.d.ts +11 -0
- package/row/Row.js +124 -0
- package/row/Row.stories.tsx +223 -0
- package/select/Select.js +15 -17
- package/select/Select.stories.tsx +572 -0
- package/select/index.d.ts +4 -4
- package/sidenav/Sidenav.d.ts +9 -0
- package/sidenav/Sidenav.js +6 -15
- package/sidenav/Sidenav.stories.tsx +165 -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 +61 -84
- package/slider/Slider.stories.tsx +177 -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 +8 -25
- package/spinner/Spinner.stories.jsx +102 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/stack/Stack.d.ts +10 -0
- package/stack/Stack.js +94 -0
- package/stack/Stack.stories.tsx +150 -0
- package/switch/Switch.js +4 -4
- package/switch/Switch.stories.tsx +160 -0
- package/table/Table.d.ts +4 -0
- package/table/Table.js +3 -3
- 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 +9 -55
- package/tabs/Tabs.stories.tsx +121 -0
- package/tabs/types.d.ts +70 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +21 -36
- package/tag/Tag.stories.tsx +145 -0
- package/tag/types.d.ts +60 -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 +42 -81
- package/text-input/TextInput.stories.tsx +456 -0
- package/text-input/types.d.ts +159 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.js +29 -32
- package/textarea/Textarea.stories.jsx +135 -0
- package/textarea/index.d.ts +18 -8
- package/toggle/Toggle.js +1 -1
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +8 -34
- package/toggle-group/ToggleGroup.stories.tsx +178 -0
- package/toggle-group/types.d.ts +84 -0
- package/toggle-group/types.js +5 -0
- package/upload/buttons-upload/ButtonsUpload.js +2 -2
- package/upload/dragAndDropArea/DragAndDropArea.js +2 -2
- package/upload/file-upload/FileToUpload.js +1 -1
- package/upload/files-upload/FilesToUpload.js +1 -1
- package/upload/transaction/Transaction.js +2 -2
- package/upload/transactions/Transactions.js +1 -1
- package/useTheme.d.ts +2 -0
- package/useTheme.js +1 -1
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +13 -53
- package/wizard/Wizard.stories.jsx +224 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/accordion-group/index.d.ts +0 -16
- package/box/index.d.ts +0 -25
- package/card/index.d.ts +0 -22
- package/chip/index.d.ts +0 -22
- 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/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/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/toggle-group/index.d.ts +0 -21
- package/wizard/index.d.ts +0 -18
package/file-input/FileInput.js
CHANGED
|
@@ -23,21 +23,19 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
23
23
|
|
|
24
24
|
var _react = _interopRequireWildcard(require("react"));
|
|
25
25
|
|
|
26
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
-
|
|
28
26
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
29
27
|
|
|
30
28
|
var _uuid = require("uuid");
|
|
31
29
|
|
|
32
30
|
var _variables = require("../common/variables.js");
|
|
33
31
|
|
|
34
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
32
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
35
33
|
|
|
36
34
|
var _Button = _interopRequireDefault(require("../button/Button"));
|
|
37
35
|
|
|
38
36
|
var _FileItem = _interopRequireDefault(require("./FileItem"));
|
|
39
37
|
|
|
40
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
38
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
41
39
|
|
|
42
40
|
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); }
|
|
43
41
|
|
|
@@ -89,6 +87,8 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
89
87
|
mode = _ref$mode === void 0 ? "file" : _ref$mode,
|
|
90
88
|
_ref$label = _ref.label,
|
|
91
89
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
90
|
+
buttonLabel = _ref.buttonLabel,
|
|
91
|
+
dropAreaLabel = _ref.dropAreaLabel,
|
|
92
92
|
_ref$helperText = _ref.helperText,
|
|
93
93
|
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
94
94
|
accept = _ref.accept,
|
|
@@ -103,7 +103,8 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
103
103
|
callbackFile = _ref.callbackFile,
|
|
104
104
|
value = _ref.value,
|
|
105
105
|
margin = _ref.margin,
|
|
106
|
-
tabIndex = _ref.tabIndex
|
|
106
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
107
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
107
108
|
|
|
108
109
|
var _useState = (0, _react.useState)(false),
|
|
109
110
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
@@ -297,18 +298,12 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
297
298
|
};
|
|
298
299
|
|
|
299
300
|
var handleDragIn = function handleDragIn(e) {
|
|
300
|
-
e.
|
|
301
|
-
e.stopPropagation();
|
|
302
|
-
|
|
303
|
-
if (e.dataTransfer.items && e.dataTransfer.items.length > 0) {
|
|
304
|
-
setIsDragging(true);
|
|
305
|
-
}
|
|
301
|
+
if (e.dataTransfer.items && e.dataTransfer.items.length > 0) setIsDragging(true);
|
|
306
302
|
};
|
|
307
303
|
|
|
308
304
|
var handleDragOut = function handleDragOut(e) {
|
|
309
|
-
|
|
310
|
-
e.
|
|
311
|
-
setIsDragging(false);
|
|
305
|
+
// only if dragged items leave container (outside, not to childs)
|
|
306
|
+
if (!e.currentTarget.contains(e.relatedTarget)) setIsDragging(false);
|
|
312
307
|
};
|
|
313
308
|
|
|
314
309
|
var handleDrop = function handleDrop(e) {
|
|
@@ -329,8 +324,7 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
329
324
|
theme: colorsTheme.fileInput
|
|
330
325
|
}, /*#__PURE__*/_react["default"].createElement(FileInputContainer, {
|
|
331
326
|
margin: margin,
|
|
332
|
-
name: name
|
|
333
|
-
tabIndex: tabIndex
|
|
327
|
+
name: name
|
|
334
328
|
}, /*#__PURE__*/_react["default"].createElement(Label, {
|
|
335
329
|
htmlFor: fileInputId,
|
|
336
330
|
disabled: disabled
|
|
@@ -339,22 +333,20 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
339
333
|
}, helperText), mode === "file" ? /*#__PURE__*/_react["default"].createElement(FileContainer, {
|
|
340
334
|
multiple: multiple,
|
|
341
335
|
files: files
|
|
342
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
343
|
-
mode: "secondary",
|
|
344
|
-
label: "Select files",
|
|
345
|
-
onClick: handleClick,
|
|
346
|
-
disabled: disabled,
|
|
347
|
-
size: "medium",
|
|
348
|
-
tabIndex: tabIndex
|
|
349
|
-
}), /*#__PURE__*/_react["default"].createElement("input", {
|
|
336
|
+
}, /*#__PURE__*/_react["default"].createElement(HiddenInputFile, {
|
|
350
337
|
id: fileInputId,
|
|
351
338
|
type: "file",
|
|
352
339
|
accept: accept,
|
|
353
340
|
multiple: multiple,
|
|
354
341
|
onChange: selectFiles
|
|
355
|
-
}),
|
|
356
|
-
|
|
357
|
-
|
|
342
|
+
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
343
|
+
mode: "secondary",
|
|
344
|
+
label: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : multiple ? "Select files" : "Select file",
|
|
345
|
+
onClick: handleClick,
|
|
346
|
+
disabled: disabled,
|
|
347
|
+
size: "medium",
|
|
348
|
+
tabIndex: tabIndex
|
|
349
|
+
}), files.map(function (file) {
|
|
358
350
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(FileItemContainer, {
|
|
359
351
|
mode: mode,
|
|
360
352
|
multiple: multiple,
|
|
@@ -368,9 +360,16 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
368
360
|
numFiles: files.length,
|
|
369
361
|
preview: file.preview,
|
|
370
362
|
type: file.file.type,
|
|
371
|
-
onDelete: onDelete
|
|
363
|
+
onDelete: onDelete,
|
|
364
|
+
tabIndex: tabIndex
|
|
372
365
|
})));
|
|
373
|
-
})) : /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(
|
|
366
|
+
})) : /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(HiddenInputFile, {
|
|
367
|
+
id: fileInputId,
|
|
368
|
+
type: "file",
|
|
369
|
+
accept: accept,
|
|
370
|
+
multiple: multiple,
|
|
371
|
+
onChange: selectFiles
|
|
372
|
+
}), /*#__PURE__*/_react["default"].createElement(DragDropArea, {
|
|
374
373
|
isDragging: isDragging,
|
|
375
374
|
disabled: disabled,
|
|
376
375
|
mode: mode,
|
|
@@ -382,19 +381,15 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
382
381
|
mode: mode
|
|
383
382
|
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
384
383
|
mode: "secondary",
|
|
385
|
-
label: "Select",
|
|
384
|
+
label: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : "Select",
|
|
386
385
|
onClick: handleClick,
|
|
387
386
|
disabled: disabled,
|
|
388
387
|
size: "fitContent"
|
|
389
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
accept: accept,
|
|
393
|
-
multiple: multiple,
|
|
394
|
-
onChange: selectFiles
|
|
395
|
-
})), /*#__PURE__*/_react["default"].createElement(DropLabel, {
|
|
388
|
+
})), mode === "dropzone" ? /*#__PURE__*/_react["default"].createElement(DropzoneLabel, {
|
|
389
|
+
disabled: disabled
|
|
390
|
+
}, dropAreaLabel !== null && dropAreaLabel !== void 0 ? dropAreaLabel : multiple ? "or drop files" : "or drop a file") : /*#__PURE__*/_react["default"].createElement(FiledropLabel, {
|
|
396
391
|
disabled: disabled
|
|
397
|
-
}, "or drop files")), files.map(function (file) {
|
|
392
|
+
}, dropAreaLabel !== null && dropAreaLabel !== void 0 ? dropAreaLabel : multiple ? "or drop files" : "or drop a file")), files.map(function (file) {
|
|
398
393
|
return /*#__PURE__*/_react["default"].createElement(FileItemContainer, {
|
|
399
394
|
mode: mode,
|
|
400
395
|
multiple: multiple,
|
|
@@ -408,9 +403,12 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
408
403
|
numFiles: files.length,
|
|
409
404
|
preview: file.preview,
|
|
410
405
|
type: file.file.type,
|
|
411
|
-
onDelete: onDelete
|
|
406
|
+
onDelete: onDelete,
|
|
407
|
+
tabIndex: tabIndex
|
|
412
408
|
}));
|
|
413
|
-
})))
|
|
409
|
+
})), files.length === 1 && files.map(function (file) {
|
|
410
|
+
return file.error && mode === "file" && !multiple && /*#__PURE__*/_react["default"].createElement(ErrorMessage, null, file.error);
|
|
411
|
+
})));
|
|
414
412
|
};
|
|
415
413
|
|
|
416
414
|
var FileInputContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: fit-content;\n"])), function (props) {
|
|
@@ -449,35 +447,37 @@ var HelperText = _styledComponents["default"].span(_templateObject3 || (_templat
|
|
|
449
447
|
return props.theme.helperTextLineHeight;
|
|
450
448
|
});
|
|
451
449
|
|
|
452
|
-
var DragDropArea = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
453
|
-
return props.mode === "filedrop" ? "calc(48px - 2px)" : "calc(160px - 2px)";
|
|
454
|
-
}, function (props) {
|
|
450
|
+
var DragDropArea = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n flex-direction: ", ";\n ", ";\n align-items: center;\n height: ", ";\n width: 320px;\n\n box-shadow: 0 0 0 2px transparent;\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n\n ", "\n\n cursor: ", ";\n"])), function (props) {
|
|
455
451
|
return props.mode === "filedrop" ? "row" : "column";
|
|
452
|
+
}, function (props) {
|
|
453
|
+
return props.mode === "dropzone" && "justify-content: center; padding: 1rem;";
|
|
454
|
+
}, function (props) {
|
|
455
|
+
return props.mode === "filedrop" ? "48px" : "160px";
|
|
456
456
|
}, function (props) {
|
|
457
457
|
return props.theme.dropBorderRadius;
|
|
458
458
|
}, function (props) {
|
|
459
|
-
return
|
|
459
|
+
return props.theme.dropBorderThickness;
|
|
460
460
|
}, function (props) {
|
|
461
|
-
return
|
|
461
|
+
return props.theme.dropBorderStyle;
|
|
462
462
|
}, function (props) {
|
|
463
|
-
return props.
|
|
463
|
+
return props.disabled ? props.theme.disabledDropBorderColor : props.theme.dropBorderColor;
|
|
464
464
|
}, function (props) {
|
|
465
|
-
return props.
|
|
465
|
+
return props.isDragging && "\n background-color: ".concat(props.theme.dragoverDropBackgroundColor, ";\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(props.theme.focusDropBorderColor, ";\n ");
|
|
466
466
|
}, function (props) {
|
|
467
467
|
return props.disabled && "not-allowed";
|
|
468
468
|
});
|
|
469
469
|
|
|
470
|
-
var FileContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n"])), function (props) {
|
|
470
|
+
var FileContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n margin-top: 0.25rem;\n"])), function (props) {
|
|
471
471
|
return props.multiple || props.files.length > 1 ? "column" : "row";
|
|
472
472
|
});
|
|
473
473
|
|
|
474
|
-
var
|
|
474
|
+
var HiddenInputFile = _styledComponents["default"].input(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n visibility: hidden;\n position: absolute;\n width: 0px;\n height: 0px;\n"])));
|
|
475
475
|
|
|
476
|
-
var ButtonContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
477
|
-
return props.mode === "filedrop"
|
|
476
|
+
var ButtonContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n"])), function (props) {
|
|
477
|
+
return props.mode === "filedrop" && "padding: 2px 12px 2px 3px";
|
|
478
478
|
});
|
|
479
479
|
|
|
480
|
-
var
|
|
480
|
+
var DropzoneLabel = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: -webkit-box;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-line-clamp: 3;\n text-align: center;\n margin-top: 0.5rem;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n"])), function (props) {
|
|
481
481
|
return props.disabled ? props.theme.disabledDropLabelFontColor : props.theme.dropLabelFontColor;
|
|
482
482
|
}, function (props) {
|
|
483
483
|
return props.theme.dropLabelFontFamily;
|
|
@@ -487,15 +487,25 @@ var DropLabel = _styledComponents["default"].span(_templateObject8 || (_template
|
|
|
487
487
|
return props.theme.dropLabelFontWeight;
|
|
488
488
|
});
|
|
489
489
|
|
|
490
|
-
var
|
|
490
|
+
var FiledropLabel = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n margin-right: 1rem;\n"])), function (props) {
|
|
491
|
+
return props.disabled ? props.theme.disabledDropLabelFontColor : props.theme.dropLabelFontColor;
|
|
492
|
+
}, function (props) {
|
|
493
|
+
return props.theme.dropLabelFontFamily;
|
|
494
|
+
}, function (props) {
|
|
495
|
+
return props.theme.dropLabelFontSize;
|
|
496
|
+
}, function (props) {
|
|
497
|
+
return props.theme.dropLabelFontWeight;
|
|
498
|
+
});
|
|
491
499
|
|
|
492
|
-
var
|
|
500
|
+
var Container = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin-top: 0.25rem;\n"])));
|
|
501
|
+
|
|
502
|
+
var FileItemContainer = _styledComponents["default"].div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n margin-top: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
493
503
|
return (props.multiple || props.files.length > 1 || props.mode !== "file") && "4px";
|
|
494
504
|
}, function (props) {
|
|
495
505
|
return props.mode === "file" && props.files.length === 1 && !props.multiple && "4px";
|
|
496
506
|
});
|
|
497
507
|
|
|
498
|
-
var ErrorMessage = _styledComponents["default"].div(
|
|
508
|
+
var ErrorMessage = _styledComponents["default"].div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: 0.25rem;\n"])), function (props) {
|
|
499
509
|
return props.theme.errorMessageFontColor;
|
|
500
510
|
}, function (props) {
|
|
501
511
|
return props.theme.errorMessageFontFamily;
|
|
@@ -507,26 +517,5 @@ var ErrorMessage = _styledComponents["default"].div(_templateObject11 || (_templ
|
|
|
507
517
|
return props.theme.errorMessageLineHeight;
|
|
508
518
|
});
|
|
509
519
|
|
|
510
|
-
DxcFileInput.propTypes = {
|
|
511
|
-
name: _propTypes["default"].string,
|
|
512
|
-
mode: _propTypes["default"].oneOf(["file", "filedrop", "dropzone"]),
|
|
513
|
-
label: _propTypes["default"].string,
|
|
514
|
-
helperText: _propTypes["default"].string,
|
|
515
|
-
accept: _propTypes["default"].array,
|
|
516
|
-
maxSize: _propTypes["default"].number,
|
|
517
|
-
minSize: _propTypes["default"].number,
|
|
518
|
-
multiple: _propTypes["default"].bool,
|
|
519
|
-
showPreview: _propTypes["default"].bool,
|
|
520
|
-
disabled: _propTypes["default"].bool,
|
|
521
|
-
callbackFile: _propTypes["default"].func,
|
|
522
|
-
value: _propTypes["default"].array,
|
|
523
|
-
tabIndex: _propTypes["default"].number,
|
|
524
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
525
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
526
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
527
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
528
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
529
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
530
|
-
};
|
|
531
520
|
var _default = DxcFileInput;
|
|
532
521
|
exports["default"] = _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const FileItem: ({ mode, multiple, name, error, showPreview, preview, type, numFiles, onDelete, tabIndex, }: {
|
|
3
|
+
mode: any;
|
|
4
|
+
multiple: any;
|
|
5
|
+
name?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
showPreview: any;
|
|
8
|
+
preview: any;
|
|
9
|
+
type: any;
|
|
10
|
+
numFiles: any;
|
|
11
|
+
onDelete: any;
|
|
12
|
+
tabIndex: any;
|
|
13
|
+
}) => JSX.Element;
|
|
14
|
+
export default FileItem;
|
package/file-input/FileItem.js
CHANGED
|
@@ -13,11 +13,9 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
16
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
17
|
|
|
20
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
18
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
21
19
|
|
|
22
20
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
23
21
|
|
|
@@ -59,7 +57,8 @@ var FileItem = function FileItem(_ref) {
|
|
|
59
57
|
preview = _ref.preview,
|
|
60
58
|
type = _ref.type,
|
|
61
59
|
numFiles = _ref.numFiles,
|
|
62
|
-
onDelete = _ref.onDelete
|
|
60
|
+
onDelete = _ref.onDelete,
|
|
61
|
+
tabIndex = _ref.tabIndex;
|
|
63
62
|
var colorsTheme = (0, _useTheme["default"])();
|
|
64
63
|
var isImage = type.includes("image");
|
|
65
64
|
|
|
@@ -104,12 +103,13 @@ var FileItem = function FileItem(_ref) {
|
|
|
104
103
|
onClick: function onClick() {
|
|
105
104
|
return onDelete(name);
|
|
106
105
|
},
|
|
107
|
-
"aria-label": "Remove ".concat(name)
|
|
106
|
+
"aria-label": "Remove ".concat(name),
|
|
107
|
+
tabIndex: tabIndex
|
|
108
108
|
}, deleteIcon)), error && (multiple || numFiles > 1) && /*#__PURE__*/_react["default"].createElement(ErrorMessage, null, error))));
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
var Container = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n padding: ", ";\n background-color: ", ";\n border-radius: ", ";\n width: ", ";\n min-height: ", ";\n border-color: ", ";\n border-width: ", ";\n border-style: ", ";\n display: flex;\n justify-content: center;\n"])), function (props) {
|
|
112
|
-
return props.showPreview ? "8px" : "8px 8px 8px 16px";
|
|
112
|
+
return props.showPreview ? "calc(8px - ".concat(props.theme.fileItemBorderThickness, ") 8px") : "calc(8px - ".concat(props.theme.fileItemBorderThickness, ") 8px calc(8px - ").concat(props.theme.fileItemBorderThickness, ") 16px");
|
|
113
113
|
}, function (props) {
|
|
114
114
|
return props.error && props.theme.errorFileItemBackgroundColor;
|
|
115
115
|
}, function (props) {
|
|
@@ -156,14 +156,16 @@ var FileName = _styledComponents["default"].span(_templateObject7 || (_templateO
|
|
|
156
156
|
|
|
157
157
|
var ErrorIcon = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n color: #d0011b;\n"])));
|
|
158
158
|
|
|
159
|
-
var DeleteIcon = _styledComponents["default"].button(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius:
|
|
159
|
+
var DeleteIcon = _styledComponents["default"].button(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 2px;\n margin-left: 4px;\n background-color: transparent;\n box-shadow: 0 0 0 2px transparent;\n padding: 3px;\n cursor: pointer;\n svg {\n line-height: 18px;\n }\n &:hover {\n background-color: ", ";\n }\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n &:active {\n background-color: ", ";\n }\n"])), function (props) {
|
|
160
160
|
return props.theme.fontFamily;
|
|
161
161
|
}, function (props) {
|
|
162
|
-
return props.
|
|
162
|
+
return props.theme.hoverDeleteFileItemBackgroundColor;
|
|
163
|
+
}, function (props) {
|
|
164
|
+
return props.theme.focusActionBorderColor;
|
|
163
165
|
}, function (props) {
|
|
164
|
-
return props.
|
|
166
|
+
return props.theme.focusActionBorderColor;
|
|
165
167
|
}, function (props) {
|
|
166
|
-
return props.
|
|
168
|
+
return props.theme.activeDeleteFileItemBackgroundColor;
|
|
167
169
|
});
|
|
168
170
|
|
|
169
171
|
var ErrorMessage = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
@@ -178,16 +180,5 @@ var ErrorMessage = _styledComponents["default"].span(_templateObject10 || (_temp
|
|
|
178
180
|
return props.theme.errorMessageLineHeight;
|
|
179
181
|
});
|
|
180
182
|
|
|
181
|
-
FileItem.propTypes = {
|
|
182
|
-
mode: _propTypes["default"].string,
|
|
183
|
-
multiple: _propTypes["default"].bool,
|
|
184
|
-
name: _propTypes["default"].string,
|
|
185
|
-
type: _propTypes["default"].string,
|
|
186
|
-
showPreview: _propTypes["default"]["boolean"],
|
|
187
|
-
numFiles: _propTypes["default"].number,
|
|
188
|
-
preview: _propTypes["default"].string,
|
|
189
|
-
error: _propTypes["default"].string,
|
|
190
|
-
onDelete: _propTypes["default"].func
|
|
191
|
-
};
|
|
192
183
|
var _default = FileItem;
|
|
193
184
|
exports["default"] = _default;
|
|
@@ -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;
|
package/footer/Footer.js
CHANGED
|
@@ -9,25 +9,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
13
|
|
|
14
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
15
|
|
|
16
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
|
-
|
|
18
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
17
|
|
|
20
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
19
|
|
|
22
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
21
|
|
|
24
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
22
|
var _variables = require("../common/variables.js");
|
|
27
23
|
|
|
28
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
24
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
29
25
|
|
|
30
|
-
var _BackgroundColorContext = require("../BackgroundColorContext
|
|
26
|
+
var _BackgroundColorContext = require("../BackgroundColorContext");
|
|
31
27
|
|
|
32
28
|
var _Icons = _interopRequireDefault(require("./Icons"));
|
|
33
29
|
|
|
@@ -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,17 +104,17 @@ var DxcFooter = function DxcFooter(_ref) {
|
|
|
110
104
|
window.removeEventListener("resize", handleEventListener);
|
|
111
105
|
};
|
|
112
106
|
}, []);
|
|
113
|
-
var socialLink = socialLinks.map(function (link, index) {
|
|
107
|
+
var socialLink = socialLinks === null || socialLinks === void 0 ? void 0 : socialLinks.map(function (link, index) {
|
|
114
108
|
return /*#__PURE__*/_react["default"].createElement(SocialAnchor, {
|
|
115
109
|
tabIndex: tabIndex,
|
|
116
110
|
key: "social".concat(index).concat(link.href),
|
|
117
111
|
index: index,
|
|
118
112
|
href: link && link.href ? link.href : ""
|
|
119
|
-
},
|
|
120
|
-
src: link.
|
|
121
|
-
}));
|
|
113
|
+
}, typeof link.logo === "string" ? /*#__PURE__*/_react["default"].createElement(SocialIconImg, {
|
|
114
|
+
src: link.logo
|
|
115
|
+
}) : /*#__PURE__*/_react["default"].createElement(SocialIconContainer, null, link.logo));
|
|
122
116
|
});
|
|
123
|
-
var bottomLink = bottomLinks.map(function (link, index) {
|
|
117
|
+
var bottomLink = bottomLinks === null || bottomLinks === void 0 ? void 0 : bottomLinks.map(function (link, index) {
|
|
124
118
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
125
119
|
key: "bottom".concat(index).concat(link.text)
|
|
126
120
|
}, /*#__PURE__*/_react["default"].createElement(BottomLink, {
|
|
@@ -234,7 +228,7 @@ var SocialAnchor = _styledComponents["default"].a(_templateObject9 || (_template
|
|
|
234
228
|
return props.index === 0 ? "0px" : props.theme.socialLinksGutter;
|
|
235
229
|
});
|
|
236
230
|
|
|
237
|
-
var
|
|
231
|
+
var SocialIconImg = _styledComponents["default"].img(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n & {\n display: inline-flex;\n height: ", ";\n width: ", ";\n fill: ", ";\n }\n"])), function (props) {
|
|
238
232
|
return props.theme.socialLinksSize;
|
|
239
233
|
}, function (props) {
|
|
240
234
|
return props.theme.socialLinksSize;
|
|
@@ -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;
|