UNPKG

@j4jinxx/icon

Version:

Minimal Icon React Component

15 lines (14 loc) 17.4 kB
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=e(require("react"));function t(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function n(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(r){i(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function o(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}function i(e,r,t){return(r=o(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},a.apply(this,arguments)}function c(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var f,s={exports:{}},l={exports:{}},p={};var y,d,m,b,v,g,h,O,S,w,j,E,x,P,$={}; /** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */function T(){return d||(d=1,"production"===process.env.NODE_ENV?l.exports=function(){if(f)return p;f=1;var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,y=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,O=e?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case r:switch(e=e.type){case u:case s:case n:case i:case o:case y:return e;default:switch(e=e&&e.$$typeof){case c:case l:case b:case m:case a:return e;default:return f}}case t:return f}}}function w(e){return S(e)===s}return p.AsyncMode=u,p.ConcurrentMode=s,p.ContextConsumer=c,p.ContextProvider=a,p.Element=r,p.ForwardRef=l,p.Fragment=n,p.Lazy=b,p.Memo=m,p.Portal=t,p.Profiler=i,p.StrictMode=o,p.Suspense=y,p.isAsyncMode=function(e){return w(e)||S(e)===u},p.isConcurrentMode=w,p.isContextConsumer=function(e){return S(e)===c},p.isContextProvider=function(e){return S(e)===a},p.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},p.isForwardRef=function(e){return S(e)===l},p.isFragment=function(e){return S(e)===n},p.isLazy=function(e){return S(e)===b},p.isMemo=function(e){return S(e)===m},p.isPortal=function(e){return S(e)===t},p.isProfiler=function(e){return S(e)===i},p.isStrictMode=function(e){return S(e)===o},p.isSuspense=function(e){return S(e)===y},p.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===s||e===i||e===o||e===y||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===m||e.$$typeof===a||e.$$typeof===c||e.$$typeof===l||e.$$typeof===g||e.$$typeof===h||e.$$typeof===O||e.$$typeof===v)},p.typeOf=S,p}():l.exports=(y||(y=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,d=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function h(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case r:var m=e.type;switch(m){case u:case f:case n:case i:case o:case l:return m;default:var b=m&&m.$$typeof;switch(b){case c:case s:case d:case y:case a:return b;default:return p}}case t:return p}}}var O=u,S=f,w=c,j=a,E=r,x=s,P=n,T=d,N=y,_=t,k=i,I=o,C=l,R=!1;function A(e){return h(e)===f}$.AsyncMode=O,$.ConcurrentMode=S,$.ContextConsumer=w,$.ContextProvider=j,$.Element=E,$.ForwardRef=x,$.Fragment=P,$.Lazy=T,$.Memo=N,$.Portal=_,$.Profiler=k,$.StrictMode=I,$.Suspense=C,$.isAsyncMode=function(e){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),A(e)||h(e)===u},$.isConcurrentMode=A,$.isContextConsumer=function(e){return h(e)===c},$.isContextProvider=function(e){return h(e)===a},$.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},$.isForwardRef=function(e){return h(e)===s},$.isFragment=function(e){return h(e)===n},$.isLazy=function(e){return h(e)===d},$.isMemo=function(e){return h(e)===y},$.isPortal=function(e){return h(e)===t},$.isProfiler=function(e){return h(e)===i},$.isStrictMode=function(e){return h(e)===o},$.isSuspense=function(e){return h(e)===l},$.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===f||e===i||e===o||e===l||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===y||e.$$typeof===a||e.$$typeof===c||e.$$typeof===s||e.$$typeof===b||e.$$typeof===v||e.$$typeof===g||e.$$typeof===m)},$.typeOf=h}()),$)),l.exports} /* object-assign (c) Sindre Sorhus @license MIT */function N(){if(b)return m;b=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;return m=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(r).map((function(e){return r[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,o){for(var i,a,c=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),u=1;u<arguments.length;u++){for(var f in i=Object(arguments[u]))r.call(i,f)&&(c[f]=i[f]);if(e){a=e(i);for(var s=0;s<a.length;s++)t.call(i,a[s])&&(c[a[s]]=i[a[s]])}}return c},m}function _(){if(g)return v;g=1;return v="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function k(){return O?h:(O=1,h=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var I=T();s.exports=function(){if(E)return j;E=1;var e=T(),r=N(),t=_(),n=k(),o=function(){if(w)return S;w=1;var e=function(){};if("production"!==process.env.NODE_ENV){var r=_(),t={},n=k();e=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}}function o(o,i,a,c,u){if("production"!==process.env.NODE_ENV)for(var f in o)if(n(o,f)){var s;try{if("function"!=typeof o[f]){var l=Error((c||"React class")+": "+a+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}s=o[f](i,f,c,a,null,r)}catch(e){s=e}if(!s||s instanceof Error||e((c||"React class")+": type specification of "+a+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof s+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),s instanceof Error&&!(s.message in t)){t[s.message]=!0;var p=u?u():"";e("Failed "+a+" type: "+s.message+(null!=p?p:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(t={})},S=o}(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}),j=function(c,u){var f="function"==typeof Symbol&&Symbol.iterator,s="@@iterator",l="<<anonymous>>",p={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:m(a),arrayOf:function(e){return m((function(r,n,o,i,a){if("function"!=typeof e)return new d("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var c=r[n];if(!Array.isArray(c))return new d("Invalid "+i+" `"+a+"` of type `"+h(c)+"` supplied to `"+o+"`, expected an array.");for(var u=0;u<c.length;u++){var f=e(c,u,o,i,a+"["+u+"]",t);if(f instanceof Error)return f}return null}))},element:m((function(e,r,t,n,o){var i=e[r];return c(i)?null:new d("Invalid "+n+" `"+o+"` of type `"+h(i)+"` supplied to `"+t+"`, expected a single ReactElement.")})),elementType:m((function(r,t,n,o,i){var a=r[t];return e.isValidElementType(a)?null:new d("Invalid "+o+" `"+i+"` of type `"+h(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return m((function(r,t,n,o,i){if(!(r[t]instanceof e)){var a=e.name||l;return new d("Invalid "+o+" `"+i+"` of type `"+((c=r[t]).constructor&&c.constructor.name?c.constructor.name:l)+"` supplied to `"+n+"`, expected instance of `"+a+"`.")}var c;return null}))},node:m((function(e,r,t,n,o){return g(e[r])?null:new d("Invalid "+n+" `"+o+"` supplied to `"+t+"`, expected a ReactNode.")})),objectOf:function(e){return m((function(r,o,i,a,c){if("function"!=typeof e)return new d("Property `"+c+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var u=r[o],f=h(u);if("object"!==f)return new d("Invalid "+a+" `"+c+"` of type `"+f+"` supplied to `"+i+"`, expected an object.");for(var s in u)if(n(u,s)){var l=e(u,s,i,a,c+"."+s,t);if(l instanceof Error)return l}return null}))},oneOf:function(e){return Array.isArray(e)?m((function(r,t,n,o,i){for(var a=r[t],c=0;c<e.length;c++)if(y(a,e[c]))return null;var u=JSON.stringify(e,(function(e,r){return"symbol"===O(r)?String(r):r}));return new d("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+n+"`, expected one of "+u+".")})):("production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var r=0;r<e.length;r++){var o=e[r];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+S(o)+" at index "+r+"."),a}return m((function(r,o,i,a,c){for(var u=[],f=0;f<e.length;f++){var s=(0,e[f])(r,o,i,a,c,t);if(null==s)return null;s.data&&n(s.data,"expectedType")&&u.push(s.data.expectedType)}return new d("Invalid "+a+" `"+c+"` supplied to `"+i+"`"+(u.length>0?", expected one of type ["+u.join(", ")+"]":"")+".")}))},shape:function(e){return m((function(r,n,o,i,a){var c=r[n],u=h(c);if("object"!==u)return new d("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");for(var f in e){var s=e[f];if("function"!=typeof s)return v(o,i,a,f,O(s));var l=s(c,f,o,i,a+"."+f,t);if(l)return l}return null}))},exact:function(e){return m((function(o,i,a,c,u){var f=o[i],s=h(f);if("object"!==s)return new d("Invalid "+c+" `"+u+"` of type `"+s+"` supplied to `"+a+"`, expected `object`.");var l=r({},o[i],e);for(var p in l){var y=e[p];if(n(e,p)&&"function"!=typeof y)return v(a,c,u,p,O(y));if(!y)return new d("Invalid "+c+" `"+u+"` key `"+p+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=y(f,p,a,c,u+"."+p,t);if(m)return m}return null}))}};function y(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}function d(e,r){this.message=e,this.data=r&&"object"==typeof r?r:{},this.stack=""}function m(e){if("production"!==process.env.NODE_ENV)var r={},n=0;function o(o,a,c,f,s,p,y){if(f=f||l,p=p||c,y!==t){if(u){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var b=f+":"+c;!r[b]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+f+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),r[b]=!0,n++)}}return null==a[c]?o?null===a[c]?new d("The "+s+" `"+p+"` is marked as required in `"+f+"`, but its value is `null`."):new d("The "+s+" `"+p+"` is marked as required in `"+f+"`, but its value is `undefined`."):null:e(a,c,f,s,p)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function b(e){return m((function(r,t,n,o,i,a){var c=r[t];return h(c)!==e?new d("Invalid "+o+" `"+i+"` of type `"+O(c)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function v(e,r,t,n,o){return new d((e||"React class")+": "+r+" type `"+t+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function g(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(g);if(null===e||c(e))return!0;var r=function(e){var r=e&&(f&&e[f]||e[s]);if("function"==typeof r)return r}(e);if(!r)return!1;var t,n=r.call(e);if(r!==e.entries){for(;!(t=n.next()).done;)if(!g(t.value))return!1}else for(;!(t=n.next()).done;){var o=t.value;if(o&&!g(o[1]))return!1}return!0;default:return!1}}function h(e){var r=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,r){return"symbol"===e||!!r&&("Symbol"===r["@@toStringTag"]||"function"==typeof Symbol&&r instanceof Symbol)}(r,e)?"symbol":r}function O(e){if(null==e)return""+e;var r=h(e);if("object"===r){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return r}function S(e){var r=O(e);switch(r){case"array":case"object":return"an "+r;case"boolean":case"date":case"regexp":return"a "+r;default:return r}}return d.prototype=Error.prototype,p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p},j}()(I.isElement,!0)}else s.exports=function(){if(P)return x;P=1;var e=_();function r(){}function t(){}return t.resetWarningCache=r,x=function(){function n(r,t,n,o,i,a){if(a!==e){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:t,resetWarningCache:r};return i.PropTypes=i,i}}()();var C=u(s.exports),R=["icon","size","color","className","style"],A=function(e){var t=e.icon,o=void 0!==t&&t,i=e.size,u=void 0===i?24:i,f=e.color,s=void 0===f?"inherit":f,l=e.className,p=void 0===l?"":l,y=e.style,d=void 0===y?{}:y,m=c(e,R);return r.default.createElement("span",a({className:"material-icons ".concat(p),style:n({color:s,fontSize:"".concat(u,"px"),lineHeight:"".concat(u,"px"),verticalAlign:"middle"},d)},m),o)};A.propTypes={icon:C.string,size:C.number,color:C.string,className:C.string,style:C.object},A.defaultProps={icon:"stop",size:24,color:"inherit"},module.exports=A;