@propellerads/icon 6.0.1 → 6.0.2

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/icon.esm.js CHANGED
@@ -2,32 +2,20 @@ 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];
5
+ function _objectWithoutPropertiesLoose(r, e) {
6
+ if (null == r) return {};
7
+ var t = {};
8
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
9
+ if (-1 !== e.indexOf(n)) continue;
10
+ t[n] = r[n];
15
11
  }
16
-
17
- return target;
12
+ return t;
18
13
  }
19
-
20
- function _taggedTemplateLiteralLoose(strings, raw) {
21
- if (!raw) {
22
- raw = strings.slice(0);
23
- }
24
-
25
- strings.raw = raw;
26
- return strings;
14
+ function _taggedTemplateLiteralLoose(e, t) {
15
+ return t || (t = e.slice(0)), e.raw = t, e;
27
16
  }
28
17
 
29
18
  var SIZE;
30
-
31
19
  (function (SIZE) {
32
20
  SIZE["EXTRA_SMALL"] = "extra-small";
33
21
  SIZE["SMALL"] = "small";
@@ -36,9 +24,7 @@ var SIZE;
36
24
  SIZE["LARGE"] = "large";
37
25
  SIZE["EXTRA_LARGE"] = "extra-large";
38
26
  })(SIZE || (SIZE = {}));
39
-
40
27
  var COLOR;
41
-
42
28
  (function (COLOR) {
43
29
  COLOR["BLACK"] = "black";
44
30
  COLOR["WHITE"] = "white";
@@ -70,50 +56,37 @@ var StyledIcon = /*#__PURE__*/styled.svg(_templateObject || (_templateObject = /
70
56
  });
71
57
 
72
58
  var _excluded = ["children", "size", "color", "hoverColor"];
73
-
74
59
  var getColor = function getColor(color, theme) {
75
60
  var _theme$actionColor, _theme$successColor, _theme$errorColor, _theme$warningColor;
76
-
77
61
  switch (color) {
78
62
  case COLOR.WHITE:
79
63
  return white;
80
-
81
64
  case COLOR.BLUE:
82
65
  return (theme === null || theme === void 0 ? void 0 : (_theme$actionColor = theme.actionColor) === null || _theme$actionColor === void 0 ? void 0 : _theme$actionColor.main) || actionColor;
83
-
84
66
  case COLOR.GRAY:
85
67
  return gray70;
86
-
87
68
  case COLOR.GRAY_DARK:
88
69
  return gray50;
89
-
90
70
  case COLOR.SUCCESS:
91
71
  return (theme === null || theme === void 0 ? void 0 : (_theme$successColor = theme.successColor) === null || _theme$successColor === void 0 ? void 0 : _theme$successColor.main) || successColor;
92
-
93
72
  case COLOR.ERROR:
94
73
  return (theme === null || theme === void 0 ? void 0 : (_theme$errorColor = theme.errorColor) === null || _theme$errorColor === void 0 ? void 0 : _theme$errorColor.main) || errorColor;
95
-
96
74
  case COLOR.WARNING:
97
75
  return (theme === null || theme === void 0 ? void 0 : (_theme$warningColor = theme.warningColor) === null || _theme$warningColor === void 0 ? void 0 : _theme$warningColor.main) || warningColor;
98
-
99
76
  case COLOR.BLACK:
100
77
  return black;
101
-
102
78
  default:
103
79
  return color;
104
80
  }
105
81
  };
106
-
107
82
  var Icon = function Icon(_ref) {
108
83
  var children = _ref.children,
109
- _ref$size = _ref.size,
110
- size = _ref$size === void 0 ? SIZE.MEDIUM : _ref$size,
111
- _ref$color = _ref.color,
112
- color = _ref$color === void 0 ? COLOR.BLACK : _ref$color,
113
- hoverColor = _ref.hoverColor,
114
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
115
-
116
- // @ts-expect-error
84
+ _ref$size = _ref.size,
85
+ size = _ref$size === void 0 ? SIZE.MEDIUM : _ref$size,
86
+ _ref$color = _ref.color,
87
+ color = _ref$color === void 0 ? COLOR.BLACK : _ref$color,
88
+ hoverColor = _ref.hoverColor,
89
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
117
90
  var themeContext = useContext(ThemeContext);
118
91
  return React.createElement(StyledIcon, Object.assign({
119
92
  size: size,
@@ -495,7 +468,7 @@ var CircleNotification = function CircleNotification(props) {
495
468
  }));
496
469
  };
497
470
 
498
- /* eslint max-len: off */
471
+ /* eslint max-len: off */ /* eslint max-len: off */
499
472
  var Chrome = function Chrome(props) {
500
473
  return React.createElement(Icon, Object.assign({}, props), React.createElement("path", {
501
474
  d: "M2.898 4.18C8.476-2.311 18.82-1.03 22.686 6.555h-9.293c-1.674 0-2.755-.038-3.926.579-1.376.724-2.414 2.067-2.777 3.644L2.898 4.181zM8.008 12c0-2.2 1.789-3.99 3.988-3.99A3.994 3.994 0 0 1 15.984 12c0 2.2-1.789 3.99-3.988 3.99-2.2 0-3.988-1.79-3.988-3.99zm5.536 5.223l-3.87 6.551C1.31 22.132-2.662 12.51 1.945 5.45c1.315 2.292 4.21 7.334 5.305 9.224 1.435 2.477 4.054 3.215 6.293 2.55zM15.7 8.009h7.609c2.837 8.053-3.445 16.498-12.062 15.967 1.472-2.482 4.509-7.607 5.46-9.248a5.464 5.464 0 0 0-1.007-6.719z"