react-native-vector-icons
Advanced tools
Comparing version 6.3.0 to 6.4.0
@@ -626,2 +626,3 @@ { | ||
"backward", | ||
"bacon", | ||
"balance-scale", | ||
@@ -660,2 +661,3 @@ "ban", | ||
"book-dead", | ||
"book-medical", | ||
"book-open", | ||
@@ -671,2 +673,3 @@ "book-reader", | ||
"brain", | ||
"bread-slice", | ||
"briefcase-medical", | ||
@@ -731,2 +734,3 @@ "briefcase", | ||
"check", | ||
"cheese", | ||
"chess-bishop", | ||
@@ -753,2 +757,3 @@ "chess-board", | ||
"city", | ||
"clinic-medical", | ||
"clipboard-check", | ||
@@ -781,2 +786,3 @@ "clipboard-list", | ||
"comment-dots", | ||
"comment-medical", | ||
"comment-slash", | ||
@@ -803,2 +809,3 @@ "comment", | ||
"crown", | ||
"crutch", | ||
"cube", | ||
@@ -848,2 +855,3 @@ "cubes", | ||
"edit", | ||
"egg", | ||
"eject", | ||
@@ -973,2 +981,3 @@ "ellipsis-h", | ||
"h-square", | ||
"hamburger", | ||
"hammer", | ||
@@ -980,2 +989,3 @@ "hamsa", | ||
"hand-lizard", | ||
"hand-middle-finger", | ||
"hand-paper", | ||
@@ -995,2 +1005,3 @@ "hand-peace", | ||
"hanukiah", | ||
"hard-hat", | ||
"hashtag", | ||
@@ -1021,2 +1032,3 @@ "hat-wizard", | ||
"hot-tub", | ||
"hotdog", | ||
"hotel", | ||
@@ -1030,2 +1042,3 @@ "hourglass-end", | ||
"i-cursor", | ||
"ice-cream", | ||
"icicles", | ||
@@ -1059,2 +1072,3 @@ "id-badge", | ||
"laptop-code", | ||
"laptop-medical", | ||
"laptop", | ||
@@ -1154,2 +1168,3 @@ "laugh-beam", | ||
"outdent", | ||
"pager", | ||
"paint-brush", | ||
@@ -1179,2 +1194,3 @@ "paint-roller", | ||
"people-carry", | ||
"pepper-hot", | ||
"percent", | ||
@@ -1189,2 +1205,3 @@ "percentage", | ||
"pills", | ||
"pizza-slice", | ||
"place-of-worship", | ||
@@ -1421,2 +1438,4 @@ "plane-arrival", | ||
"trash-alt", | ||
"trash-restore-alt", | ||
"trash-restore", | ||
"trash", | ||
@@ -1459,2 +1478,3 @@ "tree", | ||
"user-ninja", | ||
"user-nurse", | ||
"user-plus", | ||
@@ -1461,0 +1481,0 @@ "user-secret", |
@@ -84,2 +84,3 @@ { | ||
"backward": 61514, | ||
"bacon": 63461, | ||
"balance-scale": 62030, | ||
@@ -132,2 +133,3 @@ "ban": 61534, | ||
"book-dead": 63159, | ||
"book-medical": 63462, | ||
"book-open": 62744, | ||
@@ -142,2 +144,3 @@ "book-reader": 62938, | ||
"brain": 62940, | ||
"bread-slice": 63468, | ||
"briefcase": 61617, | ||
@@ -218,2 +221,3 @@ "briefcase-medical": 62569, | ||
"check-square": 61770, | ||
"cheese": 63471, | ||
"chess": 62521, | ||
@@ -241,2 +245,3 @@ "chess-bishop": 62522, | ||
"city": 63055, | ||
"clinic-medical": 63474, | ||
"clipboard": 62248, | ||
@@ -275,2 +280,3 @@ "clipboard-check": 62572, | ||
"comment-dots": 62637, | ||
"comment-medical": 63477, | ||
"comment-slash": 62643, | ||
@@ -315,2 +321,3 @@ "comments": 61574, | ||
"crown": 62753, | ||
"crutch": 63479, | ||
"css3": 61756, | ||
@@ -388,2 +395,3 @@ "css3-alt": 62347, | ||
"edit": 61508, | ||
"egg": 63483, | ||
"eject": 61522, | ||
@@ -582,2 +590,3 @@ "elementor": 62512, | ||
"hackerrank": 62967, | ||
"hamburger": 63493, | ||
"hammer": 63203, | ||
@@ -589,2 +598,3 @@ "hamsa": 63077, | ||
"hand-lizard": 62040, | ||
"hand-middle-finger": 63494, | ||
"hand-paper": 62038, | ||
@@ -604,2 +614,3 @@ "hand-peace": 62043, | ||
"hanukiah": 63206, | ||
"hard-hat": 63495, | ||
"hashtag": 62098, | ||
@@ -634,2 +645,3 @@ "hat-wizard": 63208, | ||
"hot-tub": 62867, | ||
"hotdog": 63503, | ||
"hotel": 62868, | ||
@@ -647,2 +659,3 @@ "hotjar": 62385, | ||
"i-cursor": 62022, | ||
"ice-cream": 63504, | ||
"icicles": 63405, | ||
@@ -700,2 +713,3 @@ "id-badge": 62145, | ||
"laptop-code": 62972, | ||
"laptop-medical": 63506, | ||
"laravel": 62397, | ||
@@ -843,2 +857,3 @@ "lastfm": 61954, | ||
"pagelines": 61836, | ||
"pager": 63509, | ||
"paint-brush": 61948, | ||
@@ -872,2 +887,3 @@ "paint-roller": 62890, | ||
"people-carry": 62670, | ||
"pepper-hot": 63510, | ||
"percent": 62101, | ||
@@ -894,2 +910,3 @@ "percentage": 62785, | ||
"pinterest-square": 61651, | ||
"pizza-slice": 63512, | ||
"place-of-worship": 63103, | ||
@@ -1205,2 +1222,4 @@ "plane": 61554, | ||
"trash-alt": 62189, | ||
"trash-restore": 63529, | ||
"trash-restore-alt": 63530, | ||
"tree": 61883, | ||
@@ -1258,2 +1277,3 @@ "trello": 61825, | ||
"user-ninja": 62724, | ||
"user-nurse": 63535, | ||
"user-plus": 62004, | ||
@@ -1260,0 +1280,0 @@ "user-secret": 61979, |
@@ -126,2 +126,3 @@ { | ||
"backward": 61514, | ||
"bacon": 63461, | ||
"badge": 62261, | ||
@@ -199,7 +200,10 @@ "badge-check": 62262, | ||
"book-heart": 62617, | ||
"book-medical": 63462, | ||
"book-open": 62744, | ||
"book-reader": 62938, | ||
"book-spells": 63160, | ||
"book-user": 63463, | ||
"bookmark": 61486, | ||
"books": 62939, | ||
"books-medical": 63464, | ||
"boot": 63362, | ||
@@ -223,4 +227,8 @@ "booth-curtain": 63284, | ||
"boxing-glove": 62520, | ||
"brackets": 63465, | ||
"brackets-curly": 63466, | ||
"braille": 62113, | ||
"brain": 62940, | ||
"bread-loaf": 63467, | ||
"bread-slice": 63468, | ||
"briefcase": 61617, | ||
@@ -241,2 +249,3 @@ "briefcase-medical": 62569, | ||
"buromobelexperte": 62335, | ||
"burrito": 63469, | ||
"bus": 61959, | ||
@@ -325,2 +334,3 @@ "bus-alt": 62814, | ||
"chart-pie-alt": 63054, | ||
"chart-scatter": 63470, | ||
"check": 61452, | ||
@@ -330,2 +340,5 @@ "check-circle": 61528, | ||
"check-square": 61770, | ||
"cheese": 63471, | ||
"cheese-swiss": 63472, | ||
"cheeseburger": 63473, | ||
"chess": 62521, | ||
@@ -371,2 +384,3 @@ "chess-bishop": 62522, | ||
"claw-marks": 63170, | ||
"clinic-medical": 63474, | ||
"clipboard": 62248, | ||
@@ -377,2 +391,3 @@ "clipboard-check": 62572, | ||
"clipboard-prescription": 62952, | ||
"clipboard-user": 63475, | ||
"clock": 61463, | ||
@@ -429,2 +444,3 @@ "clone": 62029, | ||
"comment-alt-lines": 62630, | ||
"comment-alt-medical": 63476, | ||
"comment-alt-minus": 62631, | ||
@@ -441,2 +457,3 @@ "comment-alt-plus": 62632, | ||
"comment-lines": 62640, | ||
"comment-medical": 63477, | ||
"comment-minus": 62641, | ||
@@ -492,2 +509,3 @@ "comment-plus": 62642, | ||
"critical-role": 63177, | ||
"croissant": 63478, | ||
"crop": 61733, | ||
@@ -499,2 +517,4 @@ "crop-alt": 62821, | ||
"crown": 62753, | ||
"crutch": 63479, | ||
"crutches": 63480, | ||
"css3": 61756, | ||
@@ -513,2 +533,3 @@ "css3-alt": 62347, | ||
"deaf": 62116, | ||
"debug": 63481, | ||
"deer": 63374, | ||
@@ -550,2 +571,3 @@ "deer-rudolph": 63375, | ||
"discourse": 62355, | ||
"disease": 63482, | ||
"divide": 62761, | ||
@@ -600,2 +622,4 @@ "dizzy": 62823, | ||
"edit": 61508, | ||
"egg": 63483, | ||
"egg-fried": 63484, | ||
"eject": 61522, | ||
@@ -696,2 +720,3 @@ "elementor": 62512, | ||
"file-word": 61890, | ||
"files-medical": 63485, | ||
"fill": 62837, | ||
@@ -714,2 +739,3 @@ "fill-drip": 62838, | ||
"fish": 62840, | ||
"fish-cooked": 63486, | ||
"fist-raised": 63198, | ||
@@ -726,2 +752,5 @@ "flag": 61476, | ||
"flipboard": 62541, | ||
"flower": 63487, | ||
"flower-daffodil": 63488, | ||
"flower-tulip": 63489, | ||
"flushed": 62841, | ||
@@ -735,2 +764,3 @@ "fly": 62487, | ||
"folder-times": 63071, | ||
"folder-tree": 63490, | ||
"folders": 63072, | ||
@@ -755,2 +785,3 @@ "font": 61489, | ||
"freebsd": 62372, | ||
"french-fries": 63491, | ||
"frog": 62766, | ||
@@ -788,2 +819,3 @@ "frosty-head": 63387, | ||
"gitter": 62502, | ||
"glass": 63492, | ||
"glass-champagne": 63390, | ||
@@ -853,2 +885,3 @@ "glass-cheers": 63391, | ||
"hackerrank": 62967, | ||
"hamburger": 63493, | ||
"hammer": 63203, | ||
@@ -866,2 +899,3 @@ "hammer-war": 63204, | ||
"hand-lizard": 62040, | ||
"hand-middle-finger": 63494, | ||
"hand-paper": 62038, | ||
@@ -885,2 +919,3 @@ "hand-peace": 62043, | ||
"hanukiah": 63206, | ||
"hard-hat": 63495, | ||
"hashtag": 62098, | ||
@@ -894,2 +929,4 @@ "hat-santa": 63399, | ||
"head-side": 63209, | ||
"head-side-brain": 63496, | ||
"head-side-medical": 63497, | ||
"head-vr": 63210, | ||
@@ -920,3 +957,6 @@ "heading": 61916, | ||
"home": 61461, | ||
"home-alt": 63498, | ||
"home-heart": 62665, | ||
"home-lg": 63499, | ||
"home-lg-alt": 63500, | ||
"hood-cloak": 63215, | ||
@@ -930,3 +970,6 @@ "hooli": 62503, | ||
"hospital-symbol": 62590, | ||
"hospital-user": 63501, | ||
"hospitals": 63502, | ||
"hot-tub": 62867, | ||
"hotdog": 63503, | ||
"hotel": 62868, | ||
@@ -947,2 +990,3 @@ "hotjar": 62385, | ||
"i-cursor": 62022, | ||
"ice-cream": 63504, | ||
"ice-skate": 63404, | ||
@@ -976,2 +1020,3 @@ "icicles": 63405, | ||
"ioxhost": 61960, | ||
"island-tropical": 63505, | ||
"italic": 61491, | ||
@@ -1019,2 +1064,3 @@ "itunes": 62388, | ||
"laptop-code": 62972, | ||
"laptop-medical": 63506, | ||
"laravel": 62397, | ||
@@ -1089,2 +1135,3 @@ "lastfm": 61954, | ||
"mail-bulk": 63092, | ||
"mailbox": 63507, | ||
"mailchimp": 62878, | ||
@@ -1121,2 +1168,3 @@ "male": 61827, | ||
"maxcdn": 61750, | ||
"meat": 63508, | ||
"medal": 62882, | ||
@@ -1219,2 +1267,3 @@ "medapps": 62406, | ||
"pagelines": 61836, | ||
"pager": 63509, | ||
"paint-brush": 61948, | ||
@@ -1259,2 +1308,3 @@ "paint-brush-alt": 62889, | ||
"people-carry": 62670, | ||
"pepper-hot": 63510, | ||
"percent": 62101, | ||
@@ -1290,2 +1340,4 @@ "percentage": 62785, | ||
"pinterest-square": 61651, | ||
"pizza": 63511, | ||
"pizza-slice": 63512, | ||
"place-of-worship": 63103, | ||
@@ -1314,2 +1366,3 @@ "plane": 61554, | ||
"poop": 63001, | ||
"popcorn": 63513, | ||
"portrait": 62432, | ||
@@ -1325,2 +1378,3 @@ "pound-sign": 61780, | ||
"print": 61487, | ||
"print-search": 63514, | ||
"print-slash": 63110, | ||
@@ -1392,2 +1446,3 @@ "procedures": 62599, | ||
"ring": 63243, | ||
"rings-wedding": 63515, | ||
"road": 61464, | ||
@@ -1412,8 +1467,13 @@ "robot": 62788, | ||
"rv": 63422, | ||
"sack": 63516, | ||
"sack-dollar": 63517, | ||
"sad-cry": 62899, | ||
"sad-tear": 62900, | ||
"safari": 62055, | ||
"salad": 63518, | ||
"sandwich": 63519, | ||
"sass": 62494, | ||
"satellite": 63423, | ||
"satellite-dish": 63424, | ||
"sausage": 63520, | ||
"save": 61639, | ||
@@ -1463,2 +1523,3 @@ "scalpel": 63005, | ||
"shirtsinbulk": 61972, | ||
"shish-kebab": 63521, | ||
"shoe-prints": 62795, | ||
@@ -1475,2 +1536,3 @@ "shopping-bag": 62096, | ||
"shuttlecock": 62555, | ||
"sickle": 63522, | ||
"sigma": 63115, | ||
@@ -1553,2 +1615,3 @@ "sign": 62681, | ||
"soundcloud": 61886, | ||
"soup": 63523, | ||
"sourcetree": 63443, | ||
@@ -1587,2 +1650,3 @@ "spa": 62907, | ||
"staylinked": 62453, | ||
"steak": 63524, | ||
"steam": 61878, | ||
@@ -1607,2 +1671,3 @@ "steam-square": 61879, | ||
"street-view": 61981, | ||
"stretcher": 63525, | ||
"strikethrough": 61644, | ||
@@ -1659,7 +1724,10 @@ "stripe": 62505, | ||
"tachometer-slowest": 63021, | ||
"taco": 63526, | ||
"tag": 61483, | ||
"tags": 61484, | ||
"tally": 63132, | ||
"tanakh": 63527, | ||
"tape": 62683, | ||
"tasks": 61614, | ||
"tasks-alt": 63528, | ||
"taxi": 61882, | ||
@@ -1745,2 +1813,4 @@ "teamspeak": 62713, | ||
"trash-alt": 62189, | ||
"trash-restore": 63529, | ||
"trash-restore-alt": 63530, | ||
"treasure-chest": 63267, | ||
@@ -1752,2 +1822,3 @@ "tree": 61883, | ||
"tree-large": 63453, | ||
"tree-palm": 63531, | ||
"trees": 63268, | ||
@@ -1815,7 +1886,11 @@ "trello": 61825, | ||
"user-graduate": 62721, | ||
"user-hard-hat": 63532, | ||
"user-headset": 63533, | ||
"user-injured": 63272, | ||
"user-lock": 62722, | ||
"user-md": 61680, | ||
"user-md-chat": 63534, | ||
"user-minus": 62723, | ||
"user-ninja": 62724, | ||
"user-nurse": 63535, | ||
"user-plus": 62004, | ||
@@ -1832,2 +1907,3 @@ "user-secret": 61979, | ||
"users-crown": 63141, | ||
"users-medical": 63536, | ||
"usps": 63457, | ||
@@ -1874,2 +1950,3 @@ "ussunnah": 62471, | ||
"vuejs": 62495, | ||
"walker": 63537, | ||
"walking": 62804, | ||
@@ -1886,2 +1963,4 @@ "wallet": 62805, | ||
"water-rise": 63349, | ||
"webcam": 63538, | ||
"webcam-slash": 63539, | ||
"weebly": 62924, | ||
@@ -1888,0 +1967,0 @@ "weibo": 61834, |
@@ -1,1 +0,1 @@ | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"createIconSet",{enumerable:true,get:function get(){return _createIconSet.default;}});Object.defineProperty(exports,"createIconSetFromFontello",{enumerable:true,get:function get(){return _createIconSetFromFontello.default;}});Object.defineProperty(exports,"createIconSetFromIcoMoon",{enumerable:true,get:function get(){return _createIconSetFromIcomoon.default;}});var _createIconSet=_interopRequireDefault(require("./lib/create-icon-set"));var _createIconSetFromFontello=_interopRequireDefault(require("./lib/create-icon-set-from-fontello"));var _createIconSetFromIcomoon=_interopRequireDefault(require("./lib/create-icon-set-from-icomoon")); | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"createIconSet",{enumerable:true,get:function get(){return _createIconSet.default;}});Object.defineProperty(exports,"createMultiStyleIconSet",{enumerable:true,get:function get(){return _createMultiStyleIconSet.default;}});Object.defineProperty(exports,"createIconSetFromFontello",{enumerable:true,get:function get(){return _createIconSetFromFontello.default;}});Object.defineProperty(exports,"createIconSetFromIcoMoon",{enumerable:true,get:function get(){return _createIconSetFromIcomoon.default;}});var _createIconSet=_interopRequireDefault(require("./lib/create-icon-set"));var _createMultiStyleIconSet=_interopRequireDefault(require("./lib/create-multi-style-icon-set"));var _createIconSetFromFontello=_interopRequireDefault(require("./lib/create-icon-set-from-fontello"));var _createIconSetFromIcomoon=_interopRequireDefault(require("./lib/create-icon-set-from-icomoon")); |
@@ -1,1 +0,1 @@ | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.createFA5iconSet=createFA5iconSet;exports.FA5Style=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _propTypes=_interopRequireDefault(require("prop-types"));var _createIconSet=_interopRequireWildcard(require("./create-icon-set"));var _ensureNativeModuleAvailable=_interopRequireDefault(require("./ensure-native-module-available"));var _jsxFileName="/home/travis/build/oblador/react-native-vector-icons/lib/create-icon-set-from-fontawesome5.js";var FA5Style={regular:0,light:1,solid:2,brand:3};exports.FA5Style=FA5Style;function createFA5iconSet(glyphMap){var metadata=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var proVersion=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var familyName="Font Awesome 5 "+(proVersion?'Pro':'Free');var metadataKeys=Object.keys(metadata);function createFA5iconSubset(type){var weight=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'400';var family=arguments.length>2&&arguments[2]!==undefined?arguments[2]:familyName;var fontFileID=proVersion?"Pro_"+type:type;return(0,_createIconSet.default)(glyphMap,family,"FontAwesome5_"+fontFileID+".ttf",{fontWeight:_reactNative.Platform.OS==='ios'?weight:undefined});}var RegularSet=createFA5iconSubset('Regular');var SolidSet=createFA5iconSubset('Solid','700');var LightSet=proVersion?createFA5iconSubset('Light','100'):RegularSet;var BrandsSet=createFA5iconSubset('Brands','400','Font Awesome 5 Brands');function iconSetFromStyle(style){switch(style){case FA5Style.brand:return BrandsSet;case FA5Style.light:return LightSet;case FA5Style.solid:return SolidSet;default:return RegularSet;}}function iconSetFromFamily(family){switch(family){case'brands':return BrandsSet;case'regular':return LightSet;case'solid':return SolidSet;default:return RegularSet;}}function styleFromProps(props){var light=props.light,solid=props.solid;if(light)return FA5Style.light;if(solid)return FA5Style.solid;return FA5Style.regular;}function styleToFamily(style){switch(style){case FA5Style.brand:return'brands';case FA5Style.light:return'light';case FA5Style.solid:return'solid';default:return'regular';}}function familyToStyle(family){switch(family){case'brands':return FA5Style.brand;case'light':return FA5Style.light;case'solid':return FA5Style.solid;default:return FA5Style.regular;}}function fallbackForGlyph(glyph){for(var i=0;i<metadataKeys.length;i+=1){var family=metadataKeys[i];if(metadata[family].indexOf(glyph)!==-1)return family;}return'regular';}function hasIconForStyle(glyph,style){var family=styleToFamily(style);if(metadataKeys.indexOf(family)===-1)return false;return metadata[family].indexOf(glyph)!==-1;}function getIconSetForProps(props){var name=props.name;var style=styleFromProps(props);if(hasIconForStyle(name,style))return iconSetFromStyle(style);var fallbackFamily=fallbackForGlyph(name);return iconSetFromFamily(fallbackFamily);}function createFA5iconClass(baseClass){var selectClass=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(iconSet){return iconSet;};var FA5iconClass=function(_PureComponent){(0,_inherits2.default)(FA5iconClass,_PureComponent);function FA5iconClass(){(0,_classCallCheck2.default)(this,FA5iconClass);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(FA5iconClass).apply(this,arguments));}(0,_createClass2.default)(FA5iconClass,[{key:"render",value:function render(){var selectedIconSet=getIconSetForProps(this.props);var SelectedIconClass=selectClass(selectedIconSet);var _this$props=this.props,light=_this$props.light,solid=_this$props.solid,restProps=(0,_objectWithoutProperties2.default)(_this$props,["light","solid"]);return _react.default.createElement(SelectedIconClass,(0,_extends2.default)({},restProps,{__source:{fileName:_jsxFileName,lineNumber:149}}));}}]);return FA5iconClass;}(_react.PureComponent);FA5iconClass.propTypes={light:_propTypes.default.bool,solid:_propTypes.default.bool};FA5iconClass.defaultProps={light:false,solid:false};return FA5iconClass;}var Base=RegularSet;var FA5icon=createFA5iconClass(Base);FA5icon.Button=createFA5iconClass(Base.Button,function(iconSet){return iconSet.Button;});FA5icon.TabBarItem=createFA5iconClass(Base.TabBarItem,function(iconSet){return iconSet.TabBarItem;});FA5icon.TabBarItemIOS=createFA5iconClass(Base.TabBarItemIOS,function(iconSet){return iconSet.TabBarItemIOS;});FA5icon.ToolbarAndroid=createFA5iconClass(Base.ToolbarAndroid,function(iconSet){return iconSet.ToolbarAndroid;});var imageSourceCache={};function getImageSource(name){var size=arguments.length>1&&arguments[1]!==undefined?arguments[1]:_createIconSet.DEFAULT_ICON_SIZE;var color=arguments.length>2&&arguments[2]!==undefined?arguments[2]:_createIconSet.DEFAULT_ICON_COLOR;var type=arguments.length>3&&arguments[3]!==undefined?arguments[3]:FA5Style.regular;(0,_ensureNativeModuleAvailable.default)();var style=type;if(!hasIconForStyle(name,style)){var fallbackFamily=fallbackForGlyph(name);style=familyToStyle(fallbackFamily);}if(_reactNative.Platform.OS==='ios'&&style!==FA5Style.brand){var glyph=glyphMap[name]||'?';if(typeof glyph==='number'){glyph=String.fromCharCode(glyph);}var processedColor=(0,_reactNative.processColor)(color);var cacheKey=glyph+":"+size+":"+processedColor+":"+type;var scale=_reactNative.PixelRatio.get();return new Promise(function(resolve,reject){var cached=imageSourceCache[cacheKey];if(typeof cached!=='undefined'){if(!cached||cached instanceof Error){reject(cached);}else{resolve({uri:cached,scale:scale});}}else{_createIconSet.NativeIconAPI.getImageForFontAwesome5(familyName,glyph,size,style,processedColor,function(err,image){var error=typeof err==='string'?new Error(err):err;imageSourceCache[cacheKey]=image||error||false;if(!error&&image){resolve({uri:image,scale:scale});}else{reject(error);}});}});}var iconSet=iconSetFromStyle(style);return iconSet.getImageSource(name,size,color);}FA5icon.getImageSource=getImageSource;return FA5icon;} | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.createFA5iconSet=createFA5iconSet;exports.FA5Style=void 0;var _createMultiStyleIconSet=_interopRequireDefault(require("./create-multi-style-icon-set"));var FA5Style={regular:'regular',light:'light',solid:'solid',brand:'brand'};exports.FA5Style=FA5Style;function createFA5iconSet(glyphMap){var metadata=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var pro=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var metadataKeys=Object.keys(metadata);var fontFamily="FontAwesome5"+(pro?'Pro':'Free');function fallbackFamily(glyph){for(var i=0;i<metadataKeys.length;i+=1){var family=metadataKeys[i];if(metadata[family].indexOf(glyph)!==-1){return family==='brands'?'brand':family;}}return'regular';}function glyphValidator(glyph,style){var family=style==='brand'?'brands':style;if(metadataKeys.indexOf(family)===-1)return false;return metadata[family].indexOf(glyph)!==-1;}function createFontAwesomeStyle(styleName,fontWeight){var family=arguments.length>2&&arguments[2]!==undefined?arguments[2]:fontFamily;var fontFile="FontAwesome5_"+(pro?"Pro_"+styleName:styleName)+".ttf";if(styleName==='Brands'){fontFile='FontAwesome5_Brands.ttf';}return{fontFamily:family+"-"+styleName,fontFile:fontFile,fontStyle:{fontWeight:fontWeight},glyphMap:glyphMap};}var brandIcons=createFontAwesomeStyle('Regular','400','FontAwesome5Brands');var lightIcons=createFontAwesomeStyle('Light','100');var regularIcons=createFontAwesomeStyle('Regular','400');var solidIcons=createFontAwesomeStyle('Solid','700');var Icon=(0,_createMultiStyleIconSet.default)({brand:brandIcons,light:lightIcons,regular:regularIcons,solid:solidIcons},{defaultStyle:'regular',fallbackFamily:fallbackFamily,glyphValidator:glyphValidator});return Icon;} |
@@ -626,2 +626,3 @@ { | ||
"backward", | ||
"bacon", | ||
"balance-scale", | ||
@@ -660,2 +661,3 @@ "ban", | ||
"book-dead", | ||
"book-medical", | ||
"book-open", | ||
@@ -671,2 +673,3 @@ "book-reader", | ||
"brain", | ||
"bread-slice", | ||
"briefcase-medical", | ||
@@ -731,2 +734,3 @@ "briefcase", | ||
"check", | ||
"cheese", | ||
"chess-bishop", | ||
@@ -753,2 +757,3 @@ "chess-board", | ||
"city", | ||
"clinic-medical", | ||
"clipboard-check", | ||
@@ -781,2 +786,3 @@ "clipboard-list", | ||
"comment-dots", | ||
"comment-medical", | ||
"comment-slash", | ||
@@ -803,2 +809,3 @@ "comment", | ||
"crown", | ||
"crutch", | ||
"cube", | ||
@@ -848,2 +855,3 @@ "cubes", | ||
"edit", | ||
"egg", | ||
"eject", | ||
@@ -973,2 +981,3 @@ "ellipsis-h", | ||
"h-square", | ||
"hamburger", | ||
"hammer", | ||
@@ -980,2 +989,3 @@ "hamsa", | ||
"hand-lizard", | ||
"hand-middle-finger", | ||
"hand-paper", | ||
@@ -995,2 +1005,3 @@ "hand-peace", | ||
"hanukiah", | ||
"hard-hat", | ||
"hashtag", | ||
@@ -1021,2 +1032,3 @@ "hat-wizard", | ||
"hot-tub", | ||
"hotdog", | ||
"hotel", | ||
@@ -1030,2 +1042,3 @@ "hourglass-end", | ||
"i-cursor", | ||
"ice-cream", | ||
"icicles", | ||
@@ -1059,2 +1072,3 @@ "id-badge", | ||
"laptop-code", | ||
"laptop-medical", | ||
"laptop", | ||
@@ -1154,2 +1168,3 @@ "laugh-beam", | ||
"outdent", | ||
"pager", | ||
"paint-brush", | ||
@@ -1179,2 +1194,3 @@ "paint-roller", | ||
"people-carry", | ||
"pepper-hot", | ||
"percent", | ||
@@ -1189,2 +1205,3 @@ "percentage", | ||
"pills", | ||
"pizza-slice", | ||
"place-of-worship", | ||
@@ -1421,2 +1438,4 @@ "plane-arrival", | ||
"trash-alt", | ||
"trash-restore-alt", | ||
"trash-restore", | ||
"trash", | ||
@@ -1459,2 +1478,3 @@ "tree", | ||
"user-ninja", | ||
"user-nurse", | ||
"user-plus", | ||
@@ -1461,0 +1481,0 @@ "user-secret", |
@@ -84,2 +84,3 @@ { | ||
"backward": 61514, | ||
"bacon": 63461, | ||
"balance-scale": 62030, | ||
@@ -132,2 +133,3 @@ "ban": 61534, | ||
"book-dead": 63159, | ||
"book-medical": 63462, | ||
"book-open": 62744, | ||
@@ -142,2 +144,3 @@ "book-reader": 62938, | ||
"brain": 62940, | ||
"bread-slice": 63468, | ||
"briefcase": 61617, | ||
@@ -218,2 +221,3 @@ "briefcase-medical": 62569, | ||
"check-square": 61770, | ||
"cheese": 63471, | ||
"chess": 62521, | ||
@@ -241,2 +245,3 @@ "chess-bishop": 62522, | ||
"city": 63055, | ||
"clinic-medical": 63474, | ||
"clipboard": 62248, | ||
@@ -275,2 +280,3 @@ "clipboard-check": 62572, | ||
"comment-dots": 62637, | ||
"comment-medical": 63477, | ||
"comment-slash": 62643, | ||
@@ -315,2 +321,3 @@ "comments": 61574, | ||
"crown": 62753, | ||
"crutch": 63479, | ||
"css3": 61756, | ||
@@ -388,2 +395,3 @@ "css3-alt": 62347, | ||
"edit": 61508, | ||
"egg": 63483, | ||
"eject": 61522, | ||
@@ -582,2 +590,3 @@ "elementor": 62512, | ||
"hackerrank": 62967, | ||
"hamburger": 63493, | ||
"hammer": 63203, | ||
@@ -589,2 +598,3 @@ "hamsa": 63077, | ||
"hand-lizard": 62040, | ||
"hand-middle-finger": 63494, | ||
"hand-paper": 62038, | ||
@@ -604,2 +614,3 @@ "hand-peace": 62043, | ||
"hanukiah": 63206, | ||
"hard-hat": 63495, | ||
"hashtag": 62098, | ||
@@ -634,2 +645,3 @@ "hat-wizard": 63208, | ||
"hot-tub": 62867, | ||
"hotdog": 63503, | ||
"hotel": 62868, | ||
@@ -647,2 +659,3 @@ "hotjar": 62385, | ||
"i-cursor": 62022, | ||
"ice-cream": 63504, | ||
"icicles": 63405, | ||
@@ -700,2 +713,3 @@ "id-badge": 62145, | ||
"laptop-code": 62972, | ||
"laptop-medical": 63506, | ||
"laravel": 62397, | ||
@@ -843,2 +857,3 @@ "lastfm": 61954, | ||
"pagelines": 61836, | ||
"pager": 63509, | ||
"paint-brush": 61948, | ||
@@ -872,2 +887,3 @@ "paint-roller": 62890, | ||
"people-carry": 62670, | ||
"pepper-hot": 63510, | ||
"percent": 62101, | ||
@@ -894,2 +910,3 @@ "percentage": 62785, | ||
"pinterest-square": 61651, | ||
"pizza-slice": 63512, | ||
"place-of-worship": 63103, | ||
@@ -1205,2 +1222,4 @@ "plane": 61554, | ||
"trash-alt": 62189, | ||
"trash-restore": 63529, | ||
"trash-restore-alt": 63530, | ||
"tree": 61883, | ||
@@ -1258,2 +1277,3 @@ "trello": 61825, | ||
"user-ninja": 62724, | ||
"user-nurse": 63535, | ||
"user-plus": 62004, | ||
@@ -1260,0 +1280,0 @@ "user-secret": 61979, |
@@ -126,2 +126,3 @@ { | ||
"backward": 61514, | ||
"bacon": 63461, | ||
"badge": 62261, | ||
@@ -199,7 +200,10 @@ "badge-check": 62262, | ||
"book-heart": 62617, | ||
"book-medical": 63462, | ||
"book-open": 62744, | ||
"book-reader": 62938, | ||
"book-spells": 63160, | ||
"book-user": 63463, | ||
"bookmark": 61486, | ||
"books": 62939, | ||
"books-medical": 63464, | ||
"boot": 63362, | ||
@@ -223,4 +227,8 @@ "booth-curtain": 63284, | ||
"boxing-glove": 62520, | ||
"brackets": 63465, | ||
"brackets-curly": 63466, | ||
"braille": 62113, | ||
"brain": 62940, | ||
"bread-loaf": 63467, | ||
"bread-slice": 63468, | ||
"briefcase": 61617, | ||
@@ -241,2 +249,3 @@ "briefcase-medical": 62569, | ||
"buromobelexperte": 62335, | ||
"burrito": 63469, | ||
"bus": 61959, | ||
@@ -325,2 +334,3 @@ "bus-alt": 62814, | ||
"chart-pie-alt": 63054, | ||
"chart-scatter": 63470, | ||
"check": 61452, | ||
@@ -330,2 +340,5 @@ "check-circle": 61528, | ||
"check-square": 61770, | ||
"cheese": 63471, | ||
"cheese-swiss": 63472, | ||
"cheeseburger": 63473, | ||
"chess": 62521, | ||
@@ -371,2 +384,3 @@ "chess-bishop": 62522, | ||
"claw-marks": 63170, | ||
"clinic-medical": 63474, | ||
"clipboard": 62248, | ||
@@ -377,2 +391,3 @@ "clipboard-check": 62572, | ||
"clipboard-prescription": 62952, | ||
"clipboard-user": 63475, | ||
"clock": 61463, | ||
@@ -429,2 +444,3 @@ "clone": 62029, | ||
"comment-alt-lines": 62630, | ||
"comment-alt-medical": 63476, | ||
"comment-alt-minus": 62631, | ||
@@ -441,2 +457,3 @@ "comment-alt-plus": 62632, | ||
"comment-lines": 62640, | ||
"comment-medical": 63477, | ||
"comment-minus": 62641, | ||
@@ -492,2 +509,3 @@ "comment-plus": 62642, | ||
"critical-role": 63177, | ||
"croissant": 63478, | ||
"crop": 61733, | ||
@@ -499,2 +517,4 @@ "crop-alt": 62821, | ||
"crown": 62753, | ||
"crutch": 63479, | ||
"crutches": 63480, | ||
"css3": 61756, | ||
@@ -513,2 +533,3 @@ "css3-alt": 62347, | ||
"deaf": 62116, | ||
"debug": 63481, | ||
"deer": 63374, | ||
@@ -550,2 +571,3 @@ "deer-rudolph": 63375, | ||
"discourse": 62355, | ||
"disease": 63482, | ||
"divide": 62761, | ||
@@ -600,2 +622,4 @@ "dizzy": 62823, | ||
"edit": 61508, | ||
"egg": 63483, | ||
"egg-fried": 63484, | ||
"eject": 61522, | ||
@@ -696,2 +720,3 @@ "elementor": 62512, | ||
"file-word": 61890, | ||
"files-medical": 63485, | ||
"fill": 62837, | ||
@@ -714,2 +739,3 @@ "fill-drip": 62838, | ||
"fish": 62840, | ||
"fish-cooked": 63486, | ||
"fist-raised": 63198, | ||
@@ -726,2 +752,5 @@ "flag": 61476, | ||
"flipboard": 62541, | ||
"flower": 63487, | ||
"flower-daffodil": 63488, | ||
"flower-tulip": 63489, | ||
"flushed": 62841, | ||
@@ -735,2 +764,3 @@ "fly": 62487, | ||
"folder-times": 63071, | ||
"folder-tree": 63490, | ||
"folders": 63072, | ||
@@ -755,2 +785,3 @@ "font": 61489, | ||
"freebsd": 62372, | ||
"french-fries": 63491, | ||
"frog": 62766, | ||
@@ -788,2 +819,3 @@ "frosty-head": 63387, | ||
"gitter": 62502, | ||
"glass": 63492, | ||
"glass-champagne": 63390, | ||
@@ -853,2 +885,3 @@ "glass-cheers": 63391, | ||
"hackerrank": 62967, | ||
"hamburger": 63493, | ||
"hammer": 63203, | ||
@@ -866,2 +899,3 @@ "hammer-war": 63204, | ||
"hand-lizard": 62040, | ||
"hand-middle-finger": 63494, | ||
"hand-paper": 62038, | ||
@@ -885,2 +919,3 @@ "hand-peace": 62043, | ||
"hanukiah": 63206, | ||
"hard-hat": 63495, | ||
"hashtag": 62098, | ||
@@ -894,2 +929,4 @@ "hat-santa": 63399, | ||
"head-side": 63209, | ||
"head-side-brain": 63496, | ||
"head-side-medical": 63497, | ||
"head-vr": 63210, | ||
@@ -920,3 +957,6 @@ "heading": 61916, | ||
"home": 61461, | ||
"home-alt": 63498, | ||
"home-heart": 62665, | ||
"home-lg": 63499, | ||
"home-lg-alt": 63500, | ||
"hood-cloak": 63215, | ||
@@ -930,3 +970,6 @@ "hooli": 62503, | ||
"hospital-symbol": 62590, | ||
"hospital-user": 63501, | ||
"hospitals": 63502, | ||
"hot-tub": 62867, | ||
"hotdog": 63503, | ||
"hotel": 62868, | ||
@@ -947,2 +990,3 @@ "hotjar": 62385, | ||
"i-cursor": 62022, | ||
"ice-cream": 63504, | ||
"ice-skate": 63404, | ||
@@ -976,2 +1020,3 @@ "icicles": 63405, | ||
"ioxhost": 61960, | ||
"island-tropical": 63505, | ||
"italic": 61491, | ||
@@ -1019,2 +1064,3 @@ "itunes": 62388, | ||
"laptop-code": 62972, | ||
"laptop-medical": 63506, | ||
"laravel": 62397, | ||
@@ -1089,2 +1135,3 @@ "lastfm": 61954, | ||
"mail-bulk": 63092, | ||
"mailbox": 63507, | ||
"mailchimp": 62878, | ||
@@ -1121,2 +1168,3 @@ "male": 61827, | ||
"maxcdn": 61750, | ||
"meat": 63508, | ||
"medal": 62882, | ||
@@ -1219,2 +1267,3 @@ "medapps": 62406, | ||
"pagelines": 61836, | ||
"pager": 63509, | ||
"paint-brush": 61948, | ||
@@ -1259,2 +1308,3 @@ "paint-brush-alt": 62889, | ||
"people-carry": 62670, | ||
"pepper-hot": 63510, | ||
"percent": 62101, | ||
@@ -1290,2 +1340,4 @@ "percentage": 62785, | ||
"pinterest-square": 61651, | ||
"pizza": 63511, | ||
"pizza-slice": 63512, | ||
"place-of-worship": 63103, | ||
@@ -1314,2 +1366,3 @@ "plane": 61554, | ||
"poop": 63001, | ||
"popcorn": 63513, | ||
"portrait": 62432, | ||
@@ -1325,2 +1378,3 @@ "pound-sign": 61780, | ||
"print": 61487, | ||
"print-search": 63514, | ||
"print-slash": 63110, | ||
@@ -1392,2 +1446,3 @@ "procedures": 62599, | ||
"ring": 63243, | ||
"rings-wedding": 63515, | ||
"road": 61464, | ||
@@ -1412,8 +1467,13 @@ "robot": 62788, | ||
"rv": 63422, | ||
"sack": 63516, | ||
"sack-dollar": 63517, | ||
"sad-cry": 62899, | ||
"sad-tear": 62900, | ||
"safari": 62055, | ||
"salad": 63518, | ||
"sandwich": 63519, | ||
"sass": 62494, | ||
"satellite": 63423, | ||
"satellite-dish": 63424, | ||
"sausage": 63520, | ||
"save": 61639, | ||
@@ -1463,2 +1523,3 @@ "scalpel": 63005, | ||
"shirtsinbulk": 61972, | ||
"shish-kebab": 63521, | ||
"shoe-prints": 62795, | ||
@@ -1475,2 +1536,3 @@ "shopping-bag": 62096, | ||
"shuttlecock": 62555, | ||
"sickle": 63522, | ||
"sigma": 63115, | ||
@@ -1553,2 +1615,3 @@ "sign": 62681, | ||
"soundcloud": 61886, | ||
"soup": 63523, | ||
"sourcetree": 63443, | ||
@@ -1587,2 +1650,3 @@ "spa": 62907, | ||
"staylinked": 62453, | ||
"steak": 63524, | ||
"steam": 61878, | ||
@@ -1607,2 +1671,3 @@ "steam-square": 61879, | ||
"street-view": 61981, | ||
"stretcher": 63525, | ||
"strikethrough": 61644, | ||
@@ -1659,7 +1724,10 @@ "stripe": 62505, | ||
"tachometer-slowest": 63021, | ||
"taco": 63526, | ||
"tag": 61483, | ||
"tags": 61484, | ||
"tally": 63132, | ||
"tanakh": 63527, | ||
"tape": 62683, | ||
"tasks": 61614, | ||
"tasks-alt": 63528, | ||
"taxi": 61882, | ||
@@ -1745,2 +1813,4 @@ "teamspeak": 62713, | ||
"trash-alt": 62189, | ||
"trash-restore": 63529, | ||
"trash-restore-alt": 63530, | ||
"treasure-chest": 63267, | ||
@@ -1752,2 +1822,3 @@ "tree": 61883, | ||
"tree-large": 63453, | ||
"tree-palm": 63531, | ||
"trees": 63268, | ||
@@ -1815,7 +1886,11 @@ "trello": 61825, | ||
"user-graduate": 62721, | ||
"user-hard-hat": 63532, | ||
"user-headset": 63533, | ||
"user-injured": 63272, | ||
"user-lock": 62722, | ||
"user-md": 61680, | ||
"user-md-chat": 63534, | ||
"user-minus": 62723, | ||
"user-ninja": 62724, | ||
"user-nurse": 63535, | ||
"user-plus": 62004, | ||
@@ -1832,2 +1907,3 @@ "user-secret": 61979, | ||
"users-crown": 63141, | ||
"users-medical": 63536, | ||
"usps": 63457, | ||
@@ -1874,2 +1950,3 @@ "ussunnah": 62471, | ||
"vuejs": 62495, | ||
"walker": 63537, | ||
"walking": 62804, | ||
@@ -1886,2 +1963,4 @@ "wallet": 62805, | ||
"water-rise": 63349, | ||
"webcam": 63538, | ||
"webcam-slash": 63539, | ||
"weebly": 62924, | ||
@@ -1888,0 +1967,0 @@ "weibo": 61834, |
export { default as createIconSet } from './lib/create-icon-set'; | ||
export { | ||
default as createMultiStyleIconSet, | ||
} from './lib/create-multi-style-icon-set'; | ||
export { | ||
default as createIconSetFromFontello, | ||
@@ -4,0 +7,0 @@ } from './lib/create-icon-set-from-fontello'; |
@@ -1,109 +0,20 @@ | ||
import React, { PureComponent } from 'react'; | ||
import createMultiStyleIconSet from './create-multi-style-icon-set'; | ||
import { PixelRatio, Platform, processColor } from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import createIconSet, { | ||
DEFAULT_ICON_COLOR, | ||
DEFAULT_ICON_SIZE, | ||
NativeIconAPI, | ||
} from './create-icon-set'; | ||
import ensureNativeModuleAvailable from './ensure-native-module-available'; | ||
export const FA5Style = { | ||
regular: 0, | ||
light: 1, | ||
solid: 2, | ||
brand: 3, | ||
const FA5Style = { | ||
regular: 'regular', | ||
light: 'light', | ||
solid: 'solid', | ||
brand: 'brand', | ||
}; | ||
export function createFA5iconSet(glyphMap, metadata = {}, proVersion = false) { | ||
const familyName = `Font Awesome 5 ${proVersion ? 'Pro' : 'Free'}`; | ||
function createFA5iconSet(glyphMap, metadata = {}, pro = false) { | ||
const metadataKeys = Object.keys(metadata); | ||
const fontFamily = `FontAwesome5${pro ? 'Pro' : 'Free'}`; | ||
function createFA5iconSubset(type, weight = '400', family = familyName) { | ||
const fontFileID = proVersion ? `Pro_${type}` : type; | ||
return createIconSet(glyphMap, family, `FontAwesome5_${fontFileID}.ttf`, { | ||
fontWeight: Platform.OS === 'ios' ? weight : undefined, | ||
}); | ||
} | ||
const RegularSet = createFA5iconSubset('Regular'); | ||
const SolidSet = createFA5iconSubset('Solid', '700'); | ||
const LightSet = proVersion | ||
? createFA5iconSubset('Light', '100') | ||
: RegularSet; | ||
const BrandsSet = createFA5iconSubset( | ||
'Brands', | ||
'400', | ||
'Font Awesome 5 Brands' | ||
); | ||
function iconSetFromStyle(style) { | ||
switch (style) { | ||
case FA5Style.brand: | ||
return BrandsSet; | ||
case FA5Style.light: | ||
return LightSet; | ||
case FA5Style.solid: | ||
return SolidSet; | ||
default: | ||
return RegularSet; | ||
} | ||
} | ||
function iconSetFromFamily(family) { | ||
switch (family) { | ||
case 'brands': | ||
return BrandsSet; | ||
case 'regular': | ||
return LightSet; | ||
case 'solid': | ||
return SolidSet; | ||
default: | ||
return RegularSet; | ||
} | ||
} | ||
function styleFromProps(props) { | ||
const { light, solid } = props; | ||
if (light) return FA5Style.light; | ||
if (solid) return FA5Style.solid; | ||
return FA5Style.regular; | ||
} | ||
function styleToFamily(style) { | ||
switch (style) { | ||
case FA5Style.brand: | ||
return 'brands'; | ||
case FA5Style.light: | ||
return 'light'; | ||
case FA5Style.solid: | ||
return 'solid'; | ||
default: | ||
return 'regular'; | ||
} | ||
} | ||
function familyToStyle(family) { | ||
switch (family) { | ||
case 'brands': | ||
return FA5Style.brand; | ||
case 'light': | ||
return FA5Style.light; | ||
case 'solid': | ||
return FA5Style.solid; | ||
default: | ||
return FA5Style.regular; | ||
} | ||
} | ||
function fallbackForGlyph(glyph) { | ||
function fallbackFamily(glyph) { | ||
for (let i = 0; i < metadataKeys.length; i += 1) { | ||
const family = metadataKeys[i]; | ||
if (metadata[family].indexOf(glyph) !== -1) return family; | ||
if (metadata[family].indexOf(glyph) !== -1) { | ||
return family === 'brands' ? 'brand' : family; | ||
} | ||
} | ||
@@ -114,123 +25,50 @@ | ||
function hasIconForStyle(glyph, style) { | ||
const family = styleToFamily(style); | ||
function glyphValidator(glyph, style) { | ||
const family = style === 'brand' ? 'brands' : style; | ||
if (metadataKeys.indexOf(family) === -1) return false; | ||
return metadata[family].indexOf(glyph) !== -1; | ||
} | ||
function getIconSetForProps(props) { | ||
const { name } = props; | ||
const style = styleFromProps(props); | ||
function createFontAwesomeStyle(styleName, fontWeight, family = fontFamily) { | ||
let fontFile = `FontAwesome5_${pro ? `Pro_${styleName}` : styleName}.ttf`; | ||
if (hasIconForStyle(name, style)) return iconSetFromStyle(style); | ||
const fallbackFamily = fallbackForGlyph(name); | ||
return iconSetFromFamily(fallbackFamily); | ||
} | ||
function createFA5iconClass(baseClass, selectClass = iconSet => iconSet) { | ||
class FA5iconClass extends PureComponent { | ||
static propTypes = { | ||
light: PropTypes.bool, | ||
solid: PropTypes.bool, | ||
}; | ||
static defaultProps = { | ||
light: false, | ||
solid: false, | ||
}; | ||
render() { | ||
const selectedIconSet = getIconSetForProps(this.props); | ||
const SelectedIconClass = selectClass(selectedIconSet); | ||
const { light, solid, ...restProps } = this.props; | ||
return <SelectedIconClass {...restProps} />; | ||
} | ||
if (styleName === 'Brands') { | ||
fontFile = 'FontAwesome5_Brands.ttf'; | ||
} | ||
return FA5iconClass; | ||
return { | ||
fontFamily: `${family}-${styleName}`, | ||
fontFile, | ||
fontStyle: { | ||
fontWeight, | ||
}, | ||
glyphMap, | ||
}; | ||
} | ||
const Base = RegularSet; | ||
const FA5icon = createFA5iconClass(Base); | ||
FA5icon.Button = createFA5iconClass(Base.Button, iconSet => iconSet.Button); | ||
FA5icon.TabBarItem = createFA5iconClass( | ||
Base.TabBarItem, | ||
iconSet => iconSet.TabBarItem | ||
const brandIcons = createFontAwesomeStyle( | ||
'Regular', | ||
'400', | ||
'FontAwesome5Brands' | ||
); | ||
FA5icon.TabBarItemIOS = createFA5iconClass( | ||
Base.TabBarItemIOS, | ||
iconSet => iconSet.TabBarItemIOS | ||
const lightIcons = createFontAwesomeStyle('Light', '100'); | ||
const regularIcons = createFontAwesomeStyle('Regular', '400'); | ||
const solidIcons = createFontAwesomeStyle('Solid', '700'); | ||
const Icon = createMultiStyleIconSet( | ||
{ | ||
brand: brandIcons, | ||
light: lightIcons, | ||
regular: regularIcons, | ||
solid: solidIcons, | ||
}, | ||
{ | ||
defaultStyle: 'regular', | ||
fallbackFamily, | ||
glyphValidator, | ||
} | ||
); | ||
FA5icon.ToolbarAndroid = createFA5iconClass( | ||
Base.ToolbarAndroid, | ||
iconSet => iconSet.ToolbarAndroid | ||
); | ||
const imageSourceCache = {}; | ||
return Icon; | ||
} | ||
function getImageSource( | ||
name, | ||
size = DEFAULT_ICON_SIZE, | ||
color = DEFAULT_ICON_COLOR, | ||
type = FA5Style.regular | ||
) { | ||
ensureNativeModuleAvailable(); | ||
let style = type; | ||
if (!hasIconForStyle(name, style)) { | ||
const fallbackFamily = fallbackForGlyph(name); | ||
style = familyToStyle(fallbackFamily); | ||
} | ||
if (Platform.OS === 'ios' && style !== FA5Style.brand) { | ||
let glyph = glyphMap[name] || '?'; | ||
if (typeof glyph === 'number') { | ||
glyph = String.fromCharCode(glyph); | ||
} | ||
const processedColor = processColor(color); | ||
const cacheKey = `${glyph}:${size}:${processedColor}:${type}`; | ||
const scale = PixelRatio.get(); | ||
return new Promise((resolve, reject) => { | ||
const cached = imageSourceCache[cacheKey]; | ||
if (typeof cached !== 'undefined') { | ||
if (!cached || cached instanceof Error) { | ||
reject(cached); | ||
} else { | ||
resolve({ uri: cached, scale }); | ||
} | ||
} else { | ||
NativeIconAPI.getImageForFontAwesome5( | ||
familyName, | ||
glyph, | ||
size, | ||
style, | ||
processedColor, | ||
(err, image) => { | ||
const error = typeof err === 'string' ? new Error(err) : err; | ||
imageSourceCache[cacheKey] = image || error || false; | ||
if (!error && image) { | ||
resolve({ uri: image, scale }); | ||
} else { | ||
reject(error); | ||
} | ||
} | ||
); | ||
} | ||
}); | ||
} | ||
const iconSet = iconSetFromStyle(style); | ||
return iconSet.getImageSource(name, size, color); | ||
} | ||
FA5icon.getImageSource = getImageSource; | ||
return FA5icon; | ||
} | ||
export { createFA5iconSet, FA5Style }; |
{ | ||
"name": "react-native-vector-icons", | ||
"version": "6.3.0", | ||
"version": "6.4.0", | ||
"description": "Customizable Icons for React Native with support for NavBar/TabBar/ToolbarAndroid, image source and full styling.", | ||
@@ -13,5 +13,6 @@ "main": "dist/index.js", | ||
"format": "prettier index.js *.md {bin,lib,directory,Examples}/**/*.js --write", | ||
"prepublish": "npm run build-web", | ||
"prepublish": "npm run build-web && npm run build-flow", | ||
"build": "./scripts/build-icons.sh", | ||
"build-web": "rm -rf ./dist && babel *.js --out-dir ./dist && babel lib --out-dir ./dist/lib && cp -R ./glyphmaps ./dist/glyphmaps", | ||
"build-flow": "./scripts/build-flow.sh", | ||
"build-antd": "./scripts/antdesign.sh", | ||
@@ -75,3 +76,3 @@ "build-entypo": "./scripts/entypo.sh", | ||
"@babel/core": "^7.1.2", | ||
"@mdi/font": "^3.4.93", | ||
"@mdi/font": "^3.5.95", | ||
"babel-eslint": "^10.0.1", | ||
@@ -78,0 +79,0 @@ "eslint": "^5.13.0", |
155
README.md
@@ -23,2 +23,3 @@ ![Vector Icons for React Native](https://cloud.githubusercontent.com/assets/378279/12009887/33f4ae1c-ac8d-11e5-8666-7a87458753ee.png) | ||
- [Usage with ToolbarAndroid](#usage-with-toolbarandroid) | ||
- [Multi-style fonts](#multi-style-fonts) | ||
- [Custom Fonts](#custom-fonts) | ||
@@ -41,7 +42,7 @@ - [Animation](#animation) | ||
- [`FontAwesome`](http://fortawesome.github.io/Font-Awesome/icons/) by Dave Gandy (v4.7.0, **675** icons) | ||
- [`FontAwesome 5`](https://fontawesome.com) by Fonticons, Inc. (v5.6.3, 1480 (free) **4845** (pro) icons) | ||
- [`FontAwesome 5`](https://fontawesome.com) by Fonticons, Inc. (v5.7.0, 1500 (free) **5082** (pro) icons) | ||
- [`Foundation`](http://zurb.com/playground/foundation-icon-fonts-3) by ZURB, Inc. (v3.0, **283** icons) | ||
- [`Ionicons`](https://ionicons.com/) by Ben Sperry (v4.2.4, **696** icons) | ||
- [`MaterialIcons`](https://www.google.com/design/icons/) by Google, Inc. (v3.0.1, **932** icons) | ||
- [`MaterialCommunityIcons`](https://materialdesignicons.com/) by MaterialDesignIcons.com (v3.4.93, **3494** icons) | ||
- [`MaterialCommunityIcons`](https://materialdesignicons.com/) by MaterialDesignIcons.com (v3.5.95, **3596** icons) | ||
- [`Octicons`](http://octicons.github.com) by Github, Inc. (v8.4.1, **184** icons) | ||
@@ -53,3 +54,3 @@ - [`Zocial`](http://zocial.smcllns.com/) by Sam Collins (v1.0, **100** icons) | ||
1. Run: `$ npm install react-native-vector-icons --save` | ||
1. Run: `$ npm install react-native-vector-icons` | ||
2. For each platform (iOS/Android/Windows) you plan to use, follow one of the options for the corresponding platform. | ||
@@ -69,2 +70,29 @@ 3. If you intend to use FontAwesome 5, check out [`this guide`](FONTAWESOME5.md) to get you started. | ||
<details><summary>List of all available fonts to copy & paste in info.plist</summary> | ||
```xml | ||
<key>UIAppFonts</key> | ||
<array> | ||
<string>AntDesign.ttf</string> | ||
<string>Entypo.ttf</string> | ||
<string>EvilIcons.ttf</string> | ||
<string>Feather.ttf</string> | ||
<string>FontAwesome.ttf</string> | ||
<string>FontAwesome5_Brands.ttf</string> | ||
<string>FontAwesome5_Regular.ttf</string> | ||
<string>FontAwesome5_Solid.ttf</string> | ||
<string>Foundation.ttf</string> | ||
<string>Ionicons.ttf</string> | ||
<string>MaterialIcons.ttf</string> | ||
<string>MaterialCommunityIcons.ttf</string> | ||
<string>SimpleLineIcons.ttf</string> | ||
<string>Octicons.ttf</string> | ||
<string>Zocial.ttf</string> | ||
</array> | ||
``` | ||
</details> | ||
<br> | ||
_Note: you need to recompile your project after adding new fonts, also ensure that they also appear under **Copy Bundle Resources** in **Build Phases**._ | ||
@@ -388,2 +416,41 @@ | ||
# Multi-style fonts | ||
Some fonts today use multiple styles, FontAwesome 5 for example, which is supported by this library. The usage is pretty much the same as the standard `Icon` component: | ||
```jsx | ||
import Icon from 'react-native-vector-icons/FontAwesome5'; | ||
const myIcon1 = <Icon name="comments" size={30} color="#900" />; // Defaults to regular | ||
const myIcon2 = <Icon name="comments" size={30} color="#900" solid />; | ||
const myIcon3 = <Icon name="comments" size={30} color="#900" light />; // Only in FA5 Pro | ||
``` | ||
### Static methods | ||
All static methods from `Icon` is supported by multi-styled fonts. | ||
| Prop | Description | | ||
| ---------------------- | ------------------------------------------------------------ | | ||
| **`getFontFamily`** | Returns the font family that is currently used to retrieve icons as text. Usage: `const fontFamily = Icon.getFontFamily(style)` | | ||
| **`getImageSource`** | Returns a promise that resolving to the source of a bitmap version of the icon for use with `Image` component et al. Usage: `const source = await Icon.getImageSource(name, size, color, style)` | | ||
| **`getRawGlyphMap`** | Returns the raw glyph map of the icon set. Usage: `const glyphMap = Icon.getRawGlyphMap(style)` | | ||
| **`hasIcon`** | Checks if the name is valid in current icon set. Usage: `const isNameValid = Icon.hasIcon(name, style)` | | ||
| **`getStyledIconSet`** | Use this to get a `Icon` component for a single style. Usage. `const StyledIcon = Icon.getStyledIconSet(style)` | | ||
If no style argument is passed (or if it's invalid) the methods will default to a pre-defineds fallback. | ||
### Components | ||
`Icon.Button`, `Icon.TabBarItem`, `Icon.TabBarItemIOS`, `Icon.ToolbarAndroid` are all supported, usage is just like `Icon`: | ||
```jsx | ||
import Icon from 'react-native-vector-icons/FontAwesome5'; | ||
const myButton = ( | ||
<Icon.Button name="facebook" onPress={this.loginWithFacebook} solid> | ||
Login with Facebook | ||
</Icon.Button> | ||
); | ||
``` | ||
## Custom Fonts | ||
@@ -425,5 +492,85 @@ | ||
###`createMultiStyleIconSet(styles [, options])` | ||
```jsx | ||
import { createMultiStyleIconSet } from 'react-native-vector-icons'; | ||
/* | ||
* This is just example code, you are free to | ||
* design your glyphmap and styles to your liking | ||
*/ | ||
import glyphmap from './glyphmap.json'; | ||
/* | ||
* glyphmap = { | ||
* "style1": [ | ||
* "hello", | ||
* "world" | ||
* ], | ||
* "style2": [ | ||
* "foo", | ||
* "bar" | ||
* ] | ||
* } | ||
*/ | ||
const glyphKeys = Object.keys(glyphmap); /* ["style1", "style2"] */ | ||
const options = { | ||
defaultStyle: 'style1', | ||
glyphValidator: (name, style) => glyphKeys.indexOf(name) !== -1, | ||
fallbackFamily: (name) => { | ||
for (let i = 0; i < glyphKeys.length; i++) { | ||
const style = glyphKeys[i]; | ||
if (glyphmap[style].indexOf(name) !== -1) { | ||
return style; | ||
} | ||
} | ||
/* Always return some family */ | ||
return glyphKeys[0]; | ||
} | ||
}; | ||
/* | ||
* The styles object consits of keys, which will be | ||
* used as the styles later, and objects which are | ||
* used as style objects for the font. The style | ||
* should have unique characteristics for each font | ||
* in order to ensure that the right one will be | ||
* chosen. FontAwesome 5 uses font weight since | ||
* 5.7.0 in order to diffirentiate the styles but | ||
* other properties (like fontFamily) can be used. | ||
* It's just a standard RN style object. | ||
*/ | ||
const styles = { | ||
style1: { | ||
fontWeight: '700' | ||
}, | ||
style2: { | ||
fontWeight: '100' | ||
} | ||
}; | ||
const Icon = createMultiStyleIconSet(styles, options); | ||
/* Uses default style (style1) */ | ||
<Icon name={'hello'} /> | ||
<Icon name={'world'} style1 /> | ||
/* Default style is style1 but this will fall back to style2 */ | ||
<Icon name={'foo'} /> | ||
/* This will also fall back to style2 */ | ||
<Icon name={'foo'} style1 /> | ||
/* Regular use of style2 */ | ||
<Icon name={'bar'} style2 /> | ||
``` | ||
| option | Description | default | | ||
| -------------- | ------------------------------------------------------------ | ---------------------------------- | | ||
| defaultStyle | The name of the style to be used if no style is supplied during rendering. | ` Object.keys(styles)[0]` | | ||
| fallbackFamily | Function for selecting a family if a glyph is not available. The function should accept the `name` of the glyph as a parameter. Returns the name if the family. | `(name) => Object.keys(styles)[0]` | | ||
| glyphValidator | Function for validating that a glyph is available for a chosen style. It has `name` and `style` as parameters, in that order. Returns `true` if the glyph is valid or `false` if it's not. | `(name, style) => true` | | ||
#### iOS | ||
You have to manually make a reference of your `.ttf` on your xcodeproj `Resources` folder. | ||
You have to manually make a reference of your `.ttf` on your xcodeproj `Resources` folder and in `Info.plist`. | ||
@@ -430,0 +577,0 @@ ## Animation |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3109935
160
36694
734
28
8