@propellerads/icon 5.19.0 → 5.20.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/CHANGELOG.md +3 -0
- package/dist/createSvg.d.ts +1 -1
- package/dist/icon.cjs.development.js +21 -8
- package/dist/icon.cjs.development.js.map +1 -1
- package/dist/icon.cjs.production.min.js +1 -1
- package/dist/icon.cjs.production.min.js.map +1 -1
- package/dist/icon.esm.js +21 -8
- package/dist/icon.esm.js.map +1 -1
- package/dist/types.d.ts +1 -4
- package/package.json +2 -2
package/dist/icon.esm.js
CHANGED
|
@@ -2,6 +2,21 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import styled, { ThemeContext } from 'styled-components';
|
|
3
3
|
import { spacing, black, warningColor, errorColor, successColor, gray50, gray70, actionColor, white } from '@propellerads/stylevariables';
|
|
4
4
|
|
|
5
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
6
|
+
if (source == null) return {};
|
|
7
|
+
var target = {};
|
|
8
|
+
var sourceKeys = Object.keys(source);
|
|
9
|
+
var key, i;
|
|
10
|
+
|
|
11
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
12
|
+
key = sourceKeys[i];
|
|
13
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
14
|
+
target[key] = source[key];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return target;
|
|
18
|
+
}
|
|
19
|
+
|
|
5
20
|
function _taggedTemplateLiteralLoose(strings, raw) {
|
|
6
21
|
if (!raw) {
|
|
7
22
|
raw = strings.slice(0);
|
|
@@ -54,6 +69,8 @@ var StyledIcon = /*#__PURE__*/styled.svg(_templateObject || (_templateObject = /
|
|
|
54
69
|
return props.hoverColor && "\n &:hover {\n fill: " + props.hoverColor + ";\n }\n ";
|
|
55
70
|
});
|
|
56
71
|
|
|
72
|
+
var _excluded = ["children", "size", "color", "hoverColor"];
|
|
73
|
+
|
|
57
74
|
var getColor = function getColor(color, theme) {
|
|
58
75
|
var _theme$actionColor, _theme$successColor, _theme$errorColor, _theme$warningColor;
|
|
59
76
|
|
|
@@ -95,19 +112,15 @@ var Icon = function Icon(_ref) {
|
|
|
95
112
|
color = _ref$color === void 0 ? COLOR.BLACK : _ref$color,
|
|
96
113
|
_ref$hoverColor = _ref.hoverColor,
|
|
97
114
|
hoverColor = _ref$hoverColor === void 0 ? COLOR.BLACK : _ref$hoverColor,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
className = _ref.className;
|
|
115
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
116
|
+
|
|
101
117
|
var themeContext = useContext(ThemeContext);
|
|
102
|
-
return React.createElement(StyledIcon, {
|
|
103
|
-
className: className,
|
|
118
|
+
return React.createElement(StyledIcon, Object.assign({
|
|
104
119
|
size: size,
|
|
105
120
|
color: getColor(color, themeContext),
|
|
106
121
|
hoverColor: getColor(hoverColor, themeContext),
|
|
107
|
-
onMouseEnter: onMouseEnter,
|
|
108
|
-
onMouseLeave: onMouseLeave,
|
|
109
122
|
viewBox: "0 0 24 24"
|
|
110
|
-
}, children);
|
|
123
|
+
}, rest), children);
|
|
111
124
|
};
|
|
112
125
|
|
|
113
126
|
/* eslint max-len: off */
|