@uncinc/uncinc-react-kitchen-sink 2.13.2 → 2.14.0
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/dist/components/Download/index.d.ts +1 -0
- package/dist/components/Download/index.js +8 -2
- package/dist/components/Form/Checkbox/index.js +2 -1
- package/dist/components/Form/Checkboxes/index.js +2 -1
- package/dist/components/Form/Select/Input/style.scss +9 -9
- package/dist/components/Icon/style.scss +20 -1
- package/dist/organisms/Downloads/index.d.ts +1 -0
- package/dist/organisms/Downloads/index.js +2 -0
- package/package.json +1 -1
|
@@ -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
|
};
|
|
@@ -58,7 +58,8 @@ export var Checkbox = function Checkbox(props) {
|
|
|
58
58
|
var field = _ref.field,
|
|
59
59
|
form = _ref.form;
|
|
60
60
|
var id = "".concat(props.fieldName, "--").concat(props.value);
|
|
61
|
-
|
|
61
|
+
// TODO: Remove the WebformCheckboxes class (BREAKING): This shouldn't be in KS.
|
|
62
|
+
var classes = c('Checkboxes__checkbox__input', 'WebformCheckboxes__checkbox__input', {
|
|
62
63
|
'icon-before': true,
|
|
63
64
|
'icon-checkmark': true,
|
|
64
65
|
'icon-variant-0': !field.value,
|
|
@@ -31,7 +31,8 @@ function Checkbox(props) {
|
|
|
31
31
|
form = _ref.form;
|
|
32
32
|
var name = "".concat(props.name, "--").concat(props.value);
|
|
33
33
|
var checked = field.value && field.value.includes(value);
|
|
34
|
-
|
|
34
|
+
// TODO: Remove the WebformCheckboxes class (BREAKING): This shouldn't be in KS.
|
|
35
|
+
var classes = c('Checkboxes__checkbox__input', 'WebformCheckboxes__checkbox__input', {
|
|
35
36
|
'icon-before': true,
|
|
36
37
|
'icon-checkmark': true,
|
|
37
38
|
'icon-variant-0': !checked,
|
|
@@ -4,28 +4,28 @@
|
|
|
4
4
|
.Select {
|
|
5
5
|
&__inner {
|
|
6
6
|
&__control {
|
|
7
|
-
border-radius: 0
|
|
7
|
+
border-radius: 0;
|
|
8
8
|
&--menu-is-open,
|
|
9
9
|
&--is-focused {
|
|
10
|
-
border-color: inherit
|
|
11
|
-
box-shadow: none
|
|
10
|
+
border-color: inherit;
|
|
11
|
+
box-shadow: none;
|
|
12
12
|
&:hover,
|
|
13
13
|
&:focus {
|
|
14
|
-
border-color: inherit
|
|
15
|
-
box-shadow: none
|
|
14
|
+
border-color: inherit;
|
|
15
|
+
box-shadow: none;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
&__option {
|
|
21
21
|
&--is-selected {
|
|
22
|
-
background-color: transparent
|
|
23
|
-
color: $color--primary
|
|
22
|
+
background-color: transparent;
|
|
23
|
+
color: $color--primary;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
&__menu {
|
|
27
|
-
border-radius: 0
|
|
28
|
-
margin-top: 0
|
|
27
|
+
border-radius: 0;
|
|
28
|
+
margin-top: 0;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -108,6 +108,7 @@ $material-icon-styles: (
|
|
|
108
108
|
$icon-name: null,
|
|
109
109
|
$style: 'outlined',
|
|
110
110
|
$custom: false,
|
|
111
|
+
$color: #000000,
|
|
111
112
|
) {
|
|
112
113
|
@if not $icon-name {
|
|
113
114
|
@error 'an icon name is required'
|
|
@@ -122,8 +123,26 @@ $material-icon-styles: (
|
|
|
122
123
|
display: block;
|
|
123
124
|
width: 1em;
|
|
124
125
|
height: 1em;
|
|
125
|
-
|
|
126
|
+
mask-repeat: no-repeat;
|
|
127
|
+
mask-size: contain;
|
|
128
|
+
background-color: $color;
|
|
126
129
|
background-repeat: no-repeat;
|
|
127
130
|
background-position: 0 0;
|
|
128
131
|
background-size: 1em;
|
|
129
132
|
}
|
|
133
|
+
|
|
134
|
+
// For including a material or custom icon through CSS.
|
|
135
|
+
// And a better name than gridIconToMaterialIcon, for backwards compatability.
|
|
136
|
+
@mixin materialIcon(
|
|
137
|
+
$icon-name: null,
|
|
138
|
+
$style: 'outlined',
|
|
139
|
+
$custom: false,
|
|
140
|
+
$color: #000000,
|
|
141
|
+
) {
|
|
142
|
+
@include gridIconToMaterialIcon(
|
|
143
|
+
$icon-name,
|
|
144
|
+
$style,
|
|
145
|
+
$custom,
|
|
146
|
+
$color,
|
|
147
|
+
)
|
|
148
|
+
}
|
|
@@ -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
|
});
|