Skip to content

Commit 5b286b3

Browse files
authored
New v6 sizes and animations (#466)
1 parent c28de56 commit 5b286b3

File tree

10 files changed

+16172
-6449
lines changed

10 files changed

+16172
-6449
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
node: [10.14.x]
11+
node: [14]
1212
react: [
1313
16.2.x,
1414
16.3.x,

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
nodejs 10.16.2
2-
python 3.7.5
1+
nodejs 14.17.3
2+
python 3.10.1

index.es.js

Lines changed: 78 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,40 @@ import { parse, icon } from '@fortawesome/fontawesome-svg-core';
22
import PropTypes from 'prop-types';
33
import React from 'react';
44

5-
function _typeof(obj) {
6-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
7-
_typeof = function (obj) {
8-
return typeof obj;
9-
};
10-
} else {
11-
_typeof = function (obj) {
12-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
13-
};
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;
16+
}
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+
});
1426
}
1527

16-
return _typeof(obj);
28+
return target;
29+
}
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);
1739
}
1840

1941
function _defineProperty(obj, key, value) {
@@ -31,40 +53,6 @@ function _defineProperty(obj, key, value) {
3153
return obj;
3254
}
3355

34-
function ownKeys(object, enumerableOnly) {
35-
var keys = Object.keys(object);
36-
37-
if (Object.getOwnPropertySymbols) {
38-
var symbols = Object.getOwnPropertySymbols(object);
39-
if (enumerableOnly) symbols = symbols.filter(function (sym) {
40-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
41-
});
42-
keys.push.apply(keys, symbols);
43-
}
44-
45-
return keys;
46-
}
47-
48-
function _objectSpread2(target) {
49-
for (var i = 1; i < arguments.length; i++) {
50-
var source = arguments[i] != null ? arguments[i] : {};
51-
52-
if (i % 2) {
53-
ownKeys(Object(source), true).forEach(function (key) {
54-
_defineProperty(target, key, source[key]);
55-
});
56-
} else if (Object.getOwnPropertyDescriptors) {
57-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
58-
} else {
59-
ownKeys(Object(source)).forEach(function (key) {
60-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
61-
});
62-
}
63-
}
64-
65-
return target;
66-
}
67-
6856
function _objectWithoutPropertiesLoose(source, excluded) {
6957
if (source == null) return {};
7058
var target = {};
@@ -102,30 +90,48 @@ function _objectWithoutProperties(source, excluded) {
10290
}
10391

10492
function _toConsumableArray(arr) {
105-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
93+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
10694
}
10795

10896
function _arrayWithoutHoles(arr) {
109-
if (Array.isArray(arr)) {
110-
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
111-
112-
return arr2;
113-
}
97+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
11498
}
11599

116100
function _iterableToArray(iter) {
117-
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
101+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
102+
}
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);
111+
}
112+
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;
118119
}
119120

120121
function _nonIterableSpread() {
121-
throw new TypeError("Invalid attempt to spread non-iterable instance");
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.");
122123
}
123124

124125
// Get CSS class list from a props object
125126
function classList(props) {
126127
var _classes;
127128

128-
var spin = props.spin,
129+
var beat = props.beat,
130+
fade = props.fade,
131+
flash = props.flash,
132+
spin = props.spin,
133+
spinPulse = props.spinPulse,
134+
spinReverse = props.spinReverse,
129135
pulse = props.pulse,
130136
fixedWidth = props.fixedWidth,
131137
inverse = props.inverse,
@@ -137,7 +143,12 @@ function classList(props) {
137143
pull = props.pull; // map of CSS class names to properties
138144

139145
var classes = (_classes = {
146+
'fa-beat': beat,
147+
'fa-fade': fade,
148+
'fa-flash': flash,
140149
'fa-spin': spin,
150+
'fa-spin-reverse': spinReverse,
151+
'fa-spin-pulse': spinPulse,
141152
'fa-pulse': pulse,
142153
'fa-fw': fixedWidth,
143154
'fa-inverse': inverse,
@@ -178,6 +189,8 @@ function camelize(string) {
178189
return string.substr(0, 1).toLowerCase() + string.substr(1);
179190
}
180191

192+
var _excluded$1 = ["style"];
193+
181194
function capitalize(val) {
182195
return val.charAt(0).toUpperCase() + val.slice(1);
183196
}
@@ -237,12 +250,12 @@ function convert(createElement, element) {
237250

238251
var _extraProps$style = extraProps.style,
239252
existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style,
240-
remaining = _objectWithoutProperties(extraProps, ["style"]);
253+
remaining = _objectWithoutProperties(extraProps, _excluded$1);
241254

242-
mixins.attrs['style'] = _objectSpread2({}, mixins.attrs['style'], {}, existingStyle);
255+
mixins.attrs['style'] = _objectSpread2(_objectSpread2({}, mixins.attrs['style']), existingStyle);
243256
/* eslint-enable */
244257

245-
return createElement.apply(void 0, [element.tag, _objectSpread2({}, mixins.attrs, {}, remaining)].concat(_toConsumableArray(children)));
258+
return createElement.apply(void 0, [element.tag, _objectSpread2(_objectSpread2({}, mixins.attrs), remaining)].concat(_toConsumableArray(children)));
246259
}
247260

248261
var PRODUCTION = false;
@@ -309,9 +322,10 @@ function objectWithKey(key, value) {
309322
return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};
310323
}
311324

325+
var _excluded = ["forwardedRef"];
312326
function FontAwesomeIcon(_ref) {
313327
var forwardedRef = _ref.forwardedRef,
314-
props = _objectWithoutProperties(_ref, ["forwardedRef"]);
328+
props = _objectWithoutProperties(_ref, _excluded);
315329

316330
var iconArgs = props.icon,
317331
maskArgs = props.mask,
@@ -323,7 +337,7 @@ function FontAwesomeIcon(_ref) {
323337
var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(props)), _toConsumableArray(className.split(' '))));
324338
var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);
325339
var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));
326-
var renderedIcon = icon(iconLookup, _objectSpread2({}, classes, {}, transform, {}, mask, {
340+
var renderedIcon = icon(iconLookup, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes), transform), mask), {}, {
327341
symbol: symbol,
328342
title: title,
329343
titleId: titleId
@@ -348,8 +362,11 @@ function FontAwesomeIcon(_ref) {
348362
}
349363
FontAwesomeIcon.displayName = 'FontAwesomeIcon';
350364
FontAwesomeIcon.propTypes = {
365+
beat: PropTypes.bool,
351366
border: PropTypes.bool,
352367
className: PropTypes.string,
368+
fade: PropTypes.bool,
369+
flash: PropTypes.bool,
353370
mask: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string]),
354371
fixedWidth: PropTypes.bool,
355372
inverse: PropTypes.bool,
@@ -359,8 +376,10 @@ FontAwesomeIcon.propTypes = {
359376
pull: PropTypes.oneOf(['right', 'left']),
360377
pulse: PropTypes.bool,
361378
rotation: PropTypes.oneOf([0, 90, 180, 270]),
362-
size: PropTypes.oneOf(['lg', 'xs', 'sm', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),
379+
size: PropTypes.oneOf(['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),
363380
spin: PropTypes.bool,
381+
spinPulse: PropTypes.bool,
382+
spinReverse: PropTypes.bool,
364383
symbol: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
365384
title: PropTypes.string,
366385
transform: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),

0 commit comments

Comments
 (0)