@propellerads/icon 5.19.0 → 5.21.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 +6 -0
- package/dist/createSvg.d.ts +1 -1
- package/dist/icon.cjs.development.js +22 -10
- 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 +22 -10
- package/dist/icon.esm.js.map +1 -1
- package/dist/style.d.ts +2 -2
- 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
|
|
|
@@ -93,21 +110,16 @@ var Icon = function Icon(_ref) {
|
|
|
93
110
|
size = _ref$size === void 0 ? SIZE.MEDIUM : _ref$size,
|
|
94
111
|
_ref$color = _ref.color,
|
|
95
112
|
color = _ref$color === void 0 ? COLOR.BLACK : _ref$color,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
onMouseLeave = _ref.onMouseLeave,
|
|
100
|
-
className = _ref.className;
|
|
113
|
+
hoverColor = _ref.hoverColor,
|
|
114
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
115
|
+
|
|
101
116
|
var themeContext = useContext(ThemeContext);
|
|
102
|
-
return React.createElement(StyledIcon, {
|
|
103
|
-
className: className,
|
|
117
|
+
return React.createElement(StyledIcon, Object.assign({
|
|
104
118
|
size: size,
|
|
105
119
|
color: getColor(color, themeContext),
|
|
106
120
|
hoverColor: getColor(hoverColor, themeContext),
|
|
107
|
-
onMouseEnter: onMouseEnter,
|
|
108
|
-
onMouseLeave: onMouseLeave,
|
|
109
121
|
viewBox: "0 0 24 24"
|
|
110
|
-
}, children);
|
|
122
|
+
}, rest), children);
|
|
111
123
|
};
|
|
112
124
|
|
|
113
125
|
/* eslint max-len: off */
|