@uncinc/uncinc-react-kitchen-sink 2.13.2 → 2.13.3
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.
|
@@ -7,6 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import c from 'classnames';
|
|
9
9
|
import prettyBytes from 'pretty-bytes';
|
|
10
|
+
import Icon from '../Icon';
|
|
10
11
|
var Download = function Download(_ref) {
|
|
11
12
|
var source = _ref.source,
|
|
12
13
|
title = _ref.title,
|
|
@@ -16,6 +17,7 @@ var Download = function Download(_ref) {
|
|
|
16
17
|
filesize = _ref$filesize === void 0 ? null : _ref$filesize,
|
|
17
18
|
_ref$filename = _ref.filename,
|
|
18
19
|
filename = _ref$filename === void 0 ? '' : _ref$filename,
|
|
20
|
+
materialIconName = _ref.materialIconName,
|
|
19
21
|
mime = _ref.mime,
|
|
20
22
|
_ref$target = _ref.target,
|
|
21
23
|
target = _ref$target === void 0 ? '_self' : _ref$target,
|
|
@@ -31,7 +33,11 @@ var Download = function Download(_ref) {
|
|
|
31
33
|
target: target,
|
|
32
34
|
href: source,
|
|
33
35
|
rel: "noreferrer"
|
|
34
|
-
}, /*#__PURE__*/React.createElement(
|
|
36
|
+
}, materialIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
37
|
+
className: "Download__icon Icon-".concat(mimeType, " Icon-").concat(mimeSubType),
|
|
38
|
+
name: materialIconName,
|
|
39
|
+
flair: "outlined"
|
|
40
|
+
}) : /*#__PURE__*/React.createElement("span", {
|
|
35
41
|
className: "Download__icon icon icon-download icon-".concat(mimeType, " icon-").concat(mimeSubType)
|
|
36
42
|
}), /*#__PURE__*/React.createElement("div", {
|
|
37
43
|
className: "Download__content"
|
|
@@ -43,7 +49,7 @@ var Download = function Download(_ref) {
|
|
|
43
49
|
className: "Download__attributes"
|
|
44
50
|
}, extension && /*#__PURE__*/React.createElement("span", {
|
|
45
51
|
className: "Download__extension"
|
|
46
|
-
}, extension[0]), filesize && /*#__PURE__*/React.createElement("span", {
|
|
52
|
+
}, extension[0], "\xA0"), filesize && /*#__PURE__*/React.createElement("span", {
|
|
47
53
|
className: "Download__filesize"
|
|
48
54
|
}, "(", prettyBytes(filesize), ")")));
|
|
49
55
|
};
|
|
@@ -7,6 +7,7 @@ var Downloads = function Downloads(_ref) {
|
|
|
7
7
|
text = _ref.text,
|
|
8
8
|
downloads = _ref.downloads,
|
|
9
9
|
target = _ref.target,
|
|
10
|
+
materialIconName = _ref.materialIconName,
|
|
10
11
|
className = _ref.className;
|
|
11
12
|
var classes = c('Downloads', className);
|
|
12
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -23,6 +24,7 @@ var Downloads = function Downloads(_ref) {
|
|
|
23
24
|
description: download.description,
|
|
24
25
|
filesize: download.filesize,
|
|
25
26
|
filename: download.filename,
|
|
27
|
+
materialIconName: materialIconName,
|
|
26
28
|
target: target,
|
|
27
29
|
mime: download.mime
|
|
28
30
|
});
|