@medely/react-fontawesome 0.0.1 → 0.1.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.
Files changed (5) hide show
  1. package/README.md +36 -20
  2. package/index.d.ts +34 -33
  3. package/index.es.js +273 -207
  4. package/index.js +342 -419
  5. package/package.json +21 -11
package/index.es.js CHANGED
@@ -1,151 +1,181 @@
1
- import { parse, icon } from '../fontawesome-svg-core';
1
+ import { parse, icon } from '@fortawesome/fontawesome-svg-core';
2
2
  import PropTypes from 'prop-types';
3
3
  import React from 'react';
4
4
 
5
- function ownKeys(object, enumerableOnly) {
6
- var keys = Object.keys(object);
7
-
8
- if (Object.getOwnPropertySymbols) {
9
- var symbols = Object.getOwnPropertySymbols(object);
10
- enumerableOnly && (symbols = symbols.filter(function (sym) {
11
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
12
- })), keys.push.apply(keys, symbols);
13
- }
14
-
15
- return keys;
5
+ function _arrayLikeToArray(r, a) {
6
+ (null == a || a > r.length) && (a = r.length);
7
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
8
+ return n;
16
9
  }
17
-
18
- function _objectSpread2(target) {
19
- for (var i = 1; i < arguments.length; i++) {
20
- var source = null != arguments[i] ? arguments[i] : {};
21
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
22
- _defineProperty(target, key, source[key]);
23
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
24
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
25
- });
10
+ function _arrayWithHoles(r) {
11
+ if (Array.isArray(r)) return r;
12
+ }
13
+ function _arrayWithoutHoles(r) {
14
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
15
+ }
16
+ function _defineProperty(e, r, t) {
17
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
18
+ value: t,
19
+ enumerable: !0,
20
+ configurable: !0,
21
+ writable: !0
22
+ }) : e[r] = t, e;
23
+ }
24
+ function _iterableToArray(r) {
25
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
26
+ }
27
+ function _iterableToArrayLimit(r, l) {
28
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
29
+ if (null != t) {
30
+ var e,
31
+ n,
32
+ i,
33
+ u,
34
+ a = [],
35
+ f = !0,
36
+ o = !1;
37
+ try {
38
+ if (i = (t = t.call(r)).next, 0 === l) {
39
+ if (Object(t) !== t) return;
40
+ f = !1;
41
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
42
+ } catch (r) {
43
+ o = !0, n = r;
44
+ } finally {
45
+ try {
46
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
47
+ } finally {
48
+ if (o) throw n;
49
+ }
50
+ }
51
+ return a;
26
52
  }
27
-
28
- return target;
29
53
  }
30
-
31
- function _typeof(obj) {
32
- "@babel/helpers - typeof";
33
-
34
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
35
- return typeof obj;
36
- } : function (obj) {
37
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
38
- }, _typeof(obj);
54
+ function _nonIterableRest() {
55
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
39
56
  }
40
-
41
- function _defineProperty(obj, key, value) {
42
- if (key in obj) {
43
- Object.defineProperty(obj, key, {
44
- value: value,
45
- enumerable: true,
46
- configurable: true,
47
- writable: true
48
- });
49
- } else {
50
- obj[key] = value;
57
+ function _nonIterableSpread() {
58
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
59
+ }
60
+ function ownKeys(e, r) {
61
+ var t = Object.keys(e);
62
+ if (Object.getOwnPropertySymbols) {
63
+ var o = Object.getOwnPropertySymbols(e);
64
+ r && (o = o.filter(function (r) {
65
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
66
+ })), t.push.apply(t, o);
51
67
  }
52
-
53
- return obj;
68
+ return t;
54
69
  }
55
-
56
- function _objectWithoutPropertiesLoose(source, excluded) {
57
- if (source == null) return {};
58
- var target = {};
59
- var sourceKeys = Object.keys(source);
60
- var key, i;
61
-
62
- for (i = 0; i < sourceKeys.length; i++) {
63
- key = sourceKeys[i];
64
- if (excluded.indexOf(key) >= 0) continue;
65
- target[key] = source[key];
70
+ function _objectSpread2(e) {
71
+ for (var r = 1; r < arguments.length; r++) {
72
+ var t = null != arguments[r] ? arguments[r] : {};
73
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
74
+ _defineProperty(e, r, t[r]);
75
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
76
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
77
+ });
66
78
  }
67
-
68
- return target;
79
+ return e;
69
80
  }
70
-
71
- function _objectWithoutProperties(source, excluded) {
72
- if (source == null) return {};
73
-
74
- var target = _objectWithoutPropertiesLoose(source, excluded);
75
-
76
- var key, i;
77
-
81
+ function _objectWithoutProperties(e, t) {
82
+ if (null == e) return {};
83
+ var o,
84
+ r,
85
+ i = _objectWithoutPropertiesLoose(e, t);
78
86
  if (Object.getOwnPropertySymbols) {
79
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
80
-
81
- for (i = 0; i < sourceSymbolKeys.length; i++) {
82
- key = sourceSymbolKeys[i];
83
- if (excluded.indexOf(key) >= 0) continue;
84
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
85
- target[key] = source[key];
86
- }
87
+ var n = Object.getOwnPropertySymbols(e);
88
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
87
89
  }
88
-
89
- return target;
90
+ return i;
90
91
  }
91
-
92
- function _toConsumableArray(arr) {
93
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
92
+ function _objectWithoutPropertiesLoose(r, e) {
93
+ if (null == r) return {};
94
+ var t = {};
95
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
96
+ if (-1 !== e.indexOf(n)) continue;
97
+ t[n] = r[n];
98
+ }
99
+ return t;
94
100
  }
95
-
96
- function _arrayWithoutHoles(arr) {
97
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
101
+ function _slicedToArray(r, e) {
102
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
98
103
  }
99
-
100
- function _iterableToArray(iter) {
101
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
104
+ function _toConsumableArray(r) {
105
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
102
106
  }
103
-
104
- function _unsupportedIterableToArray(o, minLen) {
105
- if (!o) return;
106
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
107
- var n = Object.prototype.toString.call(o).slice(8, -1);
108
- if (n === "Object" && o.constructor) n = o.constructor.name;
109
- if (n === "Map" || n === "Set") return Array.from(o);
110
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
107
+ function _toPrimitive(t, r) {
108
+ if ("object" != typeof t || !t) return t;
109
+ var e = t[Symbol.toPrimitive];
110
+ if (void 0 !== e) {
111
+ var i = e.call(t, r || "default");
112
+ if ("object" != typeof i) return i;
113
+ throw new TypeError("@@toPrimitive must return a primitive value.");
114
+ }
115
+ return ("string" === r ? String : Number)(t);
111
116
  }
117
+ function _toPropertyKey(t) {
118
+ var i = _toPrimitive(t, "string");
119
+ return "symbol" == typeof i ? i : i + "";
120
+ }
121
+ function _typeof(o) {
122
+ "@babel/helpers - typeof";
112
123
 
113
- function _arrayLikeToArray(arr, len) {
114
- if (len == null || len > arr.length) len = arr.length;
115
-
116
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
117
-
118
- return arr2;
124
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
125
+ return typeof o;
126
+ } : function (o) {
127
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
128
+ }, _typeof(o);
129
+ }
130
+ function _unsupportedIterableToArray(r, a) {
131
+ if (r) {
132
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
133
+ var t = {}.toString.call(r).slice(8, -1);
134
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
135
+ }
119
136
  }
120
137
 
121
- function _nonIterableSpread() {
122
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
138
+ var ICON_PACKS_STARTING_VERSION = '7.0.0';
139
+
140
+ // Try to get version from installed package first, fallback to env var, then default
141
+ var SVG_CORE_VERSION;
142
+ try {
143
+ var svgCorePackageJson = require('@fortawesome/fontawesome-svg-core/package.json');
144
+ SVG_CORE_VERSION = svgCorePackageJson.version;
145
+ } catch (e) {
146
+ // If package.json can't be loaded, try environment variable
147
+ SVG_CORE_VERSION = typeof process !== 'undefined' && process.env.FA_VERSION || '7.0.0';
123
148
  }
124
149
 
125
150
  // Get CSS class list from a props object
126
151
  function classList(props) {
127
- var _classes;
128
-
129
152
  var beat = props.beat,
130
- fade = props.fade,
131
- beatFade = props.beatFade,
132
- bounce = props.bounce,
133
- shake = props.shake,
134
- flash = props.flash,
135
- spin = props.spin,
136
- spinPulse = props.spinPulse,
137
- spinReverse = props.spinReverse,
138
- pulse = props.pulse,
139
- fixedWidth = props.fixedWidth,
140
- inverse = props.inverse,
141
- border = props.border,
142
- listItem = props.listItem,
143
- flip = props.flip,
144
- size = props.size,
145
- rotation = props.rotation,
146
- pull = props.pull; // map of CSS class names to properties
147
-
148
- var classes = (_classes = {
153
+ fade = props.fade,
154
+ beatFade = props.beatFade,
155
+ bounce = props.bounce,
156
+ shake = props.shake,
157
+ flash = props.flash,
158
+ spin = props.spin,
159
+ spinPulse = props.spinPulse,
160
+ spinReverse = props.spinReverse,
161
+ pulse = props.pulse,
162
+ fixedWidth = props.fixedWidth,
163
+ inverse = props.inverse,
164
+ border = props.border,
165
+ listItem = props.listItem,
166
+ flip = props.flip,
167
+ size = props.size,
168
+ rotation = props.rotation,
169
+ pull = props.pull,
170
+ swapOpacity = props.swapOpacity,
171
+ rotateBy = props.rotateBy,
172
+ widthAuto = props.widthAuto;
173
+
174
+ // Check if we're using version 7 or later
175
+ var isVersion7OrLater = versionCheckGte(SVG_CORE_VERSION, ICON_PACKS_STARTING_VERSION);
176
+
177
+ // map of CSS class names to properties
178
+ var classes = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
149
179
  'fa-beat': beat,
150
180
  'fa-fade': fade,
151
181
  'fa-beat-fade': beatFade,
@@ -163,9 +193,10 @@ function classList(props) {
163
193
  'fa-flip': flip === true,
164
194
  'fa-flip-horizontal': flip === 'horizontal' || flip === 'both',
165
195
  'fa-flip-vertical': flip === 'vertical' || flip === 'both'
166
- }, _defineProperty(_classes, "fa-".concat(size), typeof size !== 'undefined' && size !== null), _defineProperty(_classes, "fa-rotate-".concat(rotation), typeof rotation !== 'undefined' && rotation !== null && rotation !== 0), _defineProperty(_classes, "fa-pull-".concat(pull), typeof pull !== 'undefined' && pull !== null), _defineProperty(_classes, 'fa-swap-opacity', props.swapOpacity), _classes); // map over all the keys in the classes object
167
- // return an array of the keys where the value for the key is not null
196
+ }, "fa-".concat(size), typeof size !== 'undefined' && size !== null), "fa-rotate-".concat(rotation), typeof rotation !== 'undefined' && rotation !== null && rotation !== 0), "fa-pull-".concat(pull), typeof pull !== 'undefined' && pull !== null), 'fa-swap-opacity', swapOpacity), 'fa-rotate-by', isVersion7OrLater && rotateBy), 'fa-width-auto', isVersion7OrLater && widthAuto);
168
197
 
198
+ // map over all the keys in the classes object
199
+ // return an array of the keys where the value for the key is not null
169
200
  return Object.keys(classes).map(function (key) {
170
201
  return classes[key] ? key : null;
171
202
  }).filter(function (key) {
@@ -173,35 +204,82 @@ function classList(props) {
173
204
  });
174
205
  }
175
206
 
207
+ // check if verion1 is greater than or equal to version2
208
+ function versionCheckGte(version1, version2) {
209
+ var _version1$split = version1.split('-'),
210
+ _version1$split2 = _slicedToArray(_version1$split, 2),
211
+ v1Base = _version1$split2[0],
212
+ v1PreRelease = _version1$split2[1];
213
+ var _version2$split = version2.split('-'),
214
+ _version2$split2 = _slicedToArray(_version2$split, 2),
215
+ v2Base = _version2$split2[0],
216
+ v2PreRelease = _version2$split2[1];
217
+ var v1Parts = v1Base.split('.');
218
+ var v2Parts = v2Base.split('.');
219
+
220
+ // Compare version numbers first
221
+ for (var i = 0; i < Math.max(v1Parts.length, v2Parts.length); i++) {
222
+ var v1Part = v1Parts[i] || '0';
223
+ var v2Part = v2Parts[i] || '0';
224
+
225
+ // Compare numeric values
226
+ var v1Num = parseInt(v1Part, 10);
227
+ var v2Num = parseInt(v2Part, 10);
228
+ if (v1Num !== v2Num) {
229
+ return v1Num > v2Num;
230
+ }
231
+ }
232
+
233
+ // If numeric values are equal, look for any remaining parts
234
+ // that would make one version greater than the other
235
+ for (var _i = 0; _i < Math.max(v1Parts.length, v2Parts.length); _i++) {
236
+ var _v1Part = v1Parts[_i] || '0';
237
+ var _v2Part = v2Parts[_i] || '0';
238
+ if (_v1Part !== _v2Part) {
239
+ // When numeric values are equal but strings differ,
240
+ // the one without leading zeros is greater
241
+ if (_v1Part.length !== _v2Part.length) {
242
+ return _v1Part.length < _v2Part.length;
243
+ }
244
+ }
245
+ }
246
+
247
+ // If version numbers are equal, compare pre-release identifiers
248
+ // A version with a pre-release identifier is less than one without
249
+ if (v1PreRelease && !v2PreRelease) return false;
250
+ if (!v1PreRelease && v2PreRelease) return true;
251
+ return true;
252
+ }
253
+
176
254
  // Camelize taken from humps
177
255
  // humps is copyright © 2012+ Dom Christie
178
256
  // Released under the MIT license.
257
+
179
258
  // Performant way to determine if object coerces to a number
180
259
  function _isNumerical(obj) {
181
- obj = obj - 0; // eslint-disable-next-line no-self-compare
260
+ obj = obj - 0;
182
261
 
262
+ // eslint-disable-next-line no-self-compare
183
263
  return obj === obj;
184
264
  }
185
-
186
265
  function camelize(string) {
187
266
  if (_isNumerical(string)) {
188
267
  return string;
189
- } // eslint-disable-next-line no-useless-escape
190
-
268
+ }
191
269
 
270
+ // eslint-disable-next-line no-useless-escape
192
271
  string = string.replace(/[\-_\s]+(.)?/g, function (match, chr) {
193
272
  return chr ? chr.toUpperCase() : '';
194
- }); // Ensure 1st char is always lowercase
273
+ });
195
274
 
275
+ // Ensure 1st char is always lowercase
196
276
  return string.substr(0, 1).toLowerCase() + string.substr(1);
197
277
  }
198
278
 
199
- var _excluded$1 = ["style"];
200
-
279
+ var _excluded = ["style"];
201
280
  function capitalize(val) {
202
281
  return val.charAt(0).toUpperCase() + val.slice(1);
203
282
  }
204
-
205
283
  function styleToObject(style) {
206
284
  return style.split(';').map(function (s) {
207
285
  return s.trim();
@@ -215,50 +293,40 @@ function styleToObject(style) {
215
293
  return acc;
216
294
  }, {});
217
295
  }
218
-
219
296
  function convert(createElement, element) {
220
297
  var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
221
-
222
298
  if (typeof element === 'string') {
223
299
  return element;
224
300
  }
225
-
226
301
  var children = (element.children || []).map(function (child) {
227
302
  return convert(createElement, child);
228
303
  });
229
- /* eslint-disable dot-notation */
230
304
 
305
+ /* eslint-disable dot-notation */
231
306
  var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) {
232
307
  var val = element.attributes[key];
233
-
234
308
  switch (key) {
235
309
  case 'class':
236
310
  acc.attrs['className'] = val;
237
311
  delete element.attributes['class'];
238
312
  break;
239
-
240
313
  case 'style':
241
314
  acc.attrs['style'] = styleToObject(val);
242
315
  break;
243
-
244
316
  default:
245
317
  if (key.indexOf('aria-') === 0 || key.indexOf('data-') === 0) {
246
318
  acc.attrs[key.toLowerCase()] = val;
247
319
  } else {
248
320
  acc.attrs[camelize(key)] = val;
249
321
  }
250
-
251
322
  }
252
-
253
323
  return acc;
254
324
  }, {
255
325
  attrs: {}
256
326
  });
257
-
258
327
  var _extraProps$style = extraProps.style,
259
- existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style,
260
- remaining = _objectWithoutProperties(extraProps, _excluded$1);
261
-
328
+ existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style,
329
+ remaining = _objectWithoutProperties(extraProps, _excluded);
262
330
  mixins.attrs['style'] = _objectSpread2(_objectSpread2({}, mixins.attrs['style']), existingStyle);
263
331
  /* eslint-enable */
264
332
 
@@ -266,50 +334,47 @@ function convert(createElement, element) {
266
334
  }
267
335
 
268
336
  var PRODUCTION = false;
269
-
270
337
  try {
271
338
  PRODUCTION = process.env.NODE_ENV === 'production';
272
339
  } catch (e) {}
273
-
274
340
  function log () {
275
341
  if (!PRODUCTION && console && typeof console.error === 'function') {
276
342
  var _console;
277
-
278
343
  (_console = console).error.apply(_console, arguments);
279
344
  }
280
345
  }
281
346
 
347
+ // Normalize icon arguments
282
348
  function normalizeIconArgs(icon) {
283
349
  // this has everything that it needs to be rendered which means it was probably imported
284
350
  // directly from an icon svg package
285
351
  if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName && icon.icon) {
286
352
  return icon;
287
353
  }
288
-
289
354
  if (parse.icon) {
290
355
  return parse.icon(icon);
291
- } // if the icon is null, there's nothing to do
292
-
356
+ }
293
357
 
358
+ // if the icon is null, there's nothing to do
294
359
  if (icon === null) {
295
360
  return null;
296
- } // if the icon is an object and has a prefix and an icon name, return it
297
-
361
+ }
298
362
 
363
+ // if the icon is an object and has a prefix and an icon name, return it
299
364
  if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName) {
300
365
  return icon;
301
- } // if it's an array with length of two
302
-
366
+ }
303
367
 
368
+ // if it's an array with length of two
304
369
  if (Array.isArray(icon) && icon.length === 2) {
305
370
  // use the first item as prefix, second as icon name
306
371
  return {
307
372
  prefix: icon[0],
308
373
  iconName: icon[1]
309
374
  };
310
- } // if it's a string, use it as the icon name
311
-
375
+ }
312
376
 
377
+ // if it's a string, use it as the icon name
313
378
  if (typeof icon === 'string') {
314
379
  return {
315
380
  prefix: 'fas',
@@ -329,21 +394,49 @@ function objectWithKey(key, value) {
329
394
  return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};
330
395
  }
331
396
 
332
- var _excluded = ["forwardedRef"];
333
- function FontAwesomeIcon(_ref) {
334
- var forwardedRef = _ref.forwardedRef,
335
- props = _objectWithoutProperties(_ref, _excluded);
336
-
337
- var iconArgs = props.icon,
338
- maskArgs = props.mask,
339
- symbol = props.symbol,
340
- className = props.className,
341
- title = props.title,
342
- titleId = props.titleId,
343
- maskId = props.maskId;
397
+ var defaultProps = {
398
+ border: false,
399
+ className: '',
400
+ mask: null,
401
+ maskId: null,
402
+ // the fixedWidth property has been deprecated as of version 7
403
+ fixedWidth: false,
404
+ inverse: false,
405
+ flip: false,
406
+ icon: null,
407
+ listItem: false,
408
+ pull: null,
409
+ pulse: false,
410
+ rotation: null,
411
+ rotateBy: false,
412
+ size: null,
413
+ spin: false,
414
+ spinPulse: false,
415
+ spinReverse: false,
416
+ beat: false,
417
+ fade: false,
418
+ beatFade: false,
419
+ bounce: false,
420
+ shake: false,
421
+ symbol: false,
422
+ title: '',
423
+ titleId: null,
424
+ transform: null,
425
+ swapOpacity: false,
426
+ widthAuto: false
427
+ };
428
+ var FontAwesomeIcon = /*#__PURE__*/React.forwardRef(function (props, ref) {
429
+ var allProps = _objectSpread2(_objectSpread2({}, defaultProps), props);
430
+ var iconArgs = allProps.icon,
431
+ maskArgs = allProps.mask,
432
+ symbol = allProps.symbol,
433
+ className = allProps.className,
434
+ title = allProps.title,
435
+ titleId = allProps.titleId,
436
+ maskId = allProps.maskId;
344
437
  var iconLookup = normalizeIconArgs(iconArgs);
345
- var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(props)), _toConsumableArray(className.split(' '))));
346
- var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);
438
+ var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(allProps)), _toConsumableArray((className || '').split(' '))));
439
+ var transform = objectWithKey('transform', typeof allProps.transform === 'string' ? parse.transform(allProps.transform) : allProps.transform);
347
440
  var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));
348
441
  var renderedIcon = icon(iconLookup, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes), transform), mask), {}, {
349
442
  symbol: symbol,
@@ -351,24 +444,22 @@ function FontAwesomeIcon(_ref) {
351
444
  titleId: titleId,
352
445
  maskId: maskId
353
446
  }));
354
-
355
447
  if (!renderedIcon) {
356
448
  log('Could not find icon', iconLookup);
357
449
  return null;
358
450
  }
359
-
360
451
  var abstract = renderedIcon.abstract;
361
452
  var extraProps = {
362
- ref: forwardedRef
453
+ ref: ref
363
454
  };
364
- Object.keys(props).forEach(function (key) {
455
+ Object.keys(allProps).forEach(function (key) {
365
456
  // eslint-disable-next-line no-prototype-builtins
366
- if (!FontAwesomeIcon.defaultProps.hasOwnProperty(key)) {
367
- extraProps[key] = props[key];
457
+ if (!defaultProps.hasOwnProperty(key)) {
458
+ extraProps[key] = allProps[key];
368
459
  }
369
460
  });
370
461
  return convertCurry(abstract[0], extraProps);
371
- }
462
+ });
372
463
  FontAwesomeIcon.displayName = 'FontAwesomeIcon';
373
464
  FontAwesomeIcon.propTypes = {
374
465
  beat: PropTypes.bool,
@@ -380,6 +471,7 @@ FontAwesomeIcon.propTypes = {
380
471
  flash: PropTypes.bool,
381
472
  mask: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string]),
382
473
  maskId: PropTypes.string,
474
+ // the fixedWidth property has been deprecated as of version 7
383
475
  fixedWidth: PropTypes.bool,
384
476
  inverse: PropTypes.bool,
385
477
  flip: PropTypes.oneOf([true, false, 'horizontal', 'vertical', 'both']),
@@ -388,6 +480,7 @@ FontAwesomeIcon.propTypes = {
388
480
  pull: PropTypes.oneOf(['right', 'left']),
389
481
  pulse: PropTypes.bool,
390
482
  rotation: PropTypes.oneOf([0, 90, 180, 270]),
483
+ rotateBy: PropTypes.bool,
391
484
  shake: PropTypes.bool,
392
485
  size: PropTypes.oneOf(['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),
393
486
  spin: PropTypes.bool,
@@ -397,35 +490,8 @@ FontAwesomeIcon.propTypes = {
397
490
  title: PropTypes.string,
398
491
  titleId: PropTypes.string,
399
492
  transform: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
400
- swapOpacity: PropTypes.bool
401
- };
402
- FontAwesomeIcon.defaultProps = {
403
- border: false,
404
- className: '',
405
- mask: null,
406
- maskId: null,
407
- fixedWidth: false,
408
- inverse: false,
409
- flip: false,
410
- icon: null,
411
- listItem: false,
412
- pull: null,
413
- pulse: false,
414
- rotation: null,
415
- size: null,
416
- spin: false,
417
- spinPulse: false,
418
- spinReverse: false,
419
- beat: false,
420
- fade: false,
421
- beatFade: false,
422
- bounce: false,
423
- shake: false,
424
- symbol: false,
425
- title: '',
426
- titleId: null,
427
- transform: null,
428
- swapOpacity: false
493
+ swapOpacity: PropTypes.bool,
494
+ widthAuto: PropTypes.bool
429
495
  };
430
496
  var convertCurry = convert.bind(null, React.createElement);
431
497