@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 CHANGED
@@ -1,3 +1,6 @@
1
+ ## `5.20.0`
2
+ * Icon types are extended using native SVG interface.
3
+
1
4
  ## `5.19.0`
2
5
  * Added `ArrowLeftFull` and `Cursor` icons
3
6
 
@@ -3,5 +3,5 @@ import { IconProps } from './types';
3
3
  interface Props extends IconProps {
4
4
  children: React.ReactNode;
5
5
  }
6
- declare const Icon: ({ children, size, color, hoverColor, onMouseEnter, onMouseLeave, className, }: Props) => JSX.Element;
6
+ declare const Icon: ({ children, size, color, hoverColor, ...rest }: Props) => JSX.Element;
7
7
  export { Icon };
@@ -10,6 +10,21 @@ var styled = require('styled-components');
10
10
  var styled__default = _interopDefault(styled);
11
11
  var stylevariables = require('@propellerads/stylevariables');
12
12
 
13
+ function _objectWithoutPropertiesLoose(source, excluded) {
14
+ if (source == null) return {};
15
+ var target = {};
16
+ var sourceKeys = Object.keys(source);
17
+ var key, i;
18
+
19
+ for (i = 0; i < sourceKeys.length; i++) {
20
+ key = sourceKeys[i];
21
+ if (excluded.indexOf(key) >= 0) continue;
22
+ target[key] = source[key];
23
+ }
24
+
25
+ return target;
26
+ }
27
+
13
28
  function _taggedTemplateLiteralLoose(strings, raw) {
14
29
  if (!raw) {
15
30
  raw = strings.slice(0);
@@ -58,6 +73,8 @@ var StyledIcon = /*#__PURE__*/styled__default.svg(_templateObject || (_templateO
58
73
  return props.hoverColor && "\n &:hover {\n fill: " + props.hoverColor + ";\n }\n ";
59
74
  });
60
75
 
76
+ var _excluded = ["children", "size", "color", "hoverColor"];
77
+
61
78
  var getColor = function getColor(color, theme) {
62
79
  var _theme$actionColor, _theme$successColor, _theme$errorColor, _theme$warningColor;
63
80
 
@@ -99,19 +116,15 @@ var Icon = function Icon(_ref) {
99
116
  color = _ref$color === void 0 ? exports.COLOR.BLACK : _ref$color,
100
117
  _ref$hoverColor = _ref.hoverColor,
101
118
  hoverColor = _ref$hoverColor === void 0 ? exports.COLOR.BLACK : _ref$hoverColor,
102
- onMouseEnter = _ref.onMouseEnter,
103
- onMouseLeave = _ref.onMouseLeave,
104
- className = _ref.className;
119
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
120
+
105
121
  var themeContext = React.useContext(styled.ThemeContext);
106
- return React__default.createElement(StyledIcon, {
107
- className: className,
122
+ return React__default.createElement(StyledIcon, Object.assign({
108
123
  size: size,
109
124
  color: getColor(color, themeContext),
110
125
  hoverColor: getColor(hoverColor, themeContext),
111
- onMouseEnter: onMouseEnter,
112
- onMouseLeave: onMouseLeave,
113
126
  viewBox: "0 0 24 24"
114
- }, children);
127
+ }, rest), children);
115
128
  };
116
129
 
117
130
  /* eslint max-len: off */