mdc-react
Version:
Material Components for the web implemented in React
2 lines • 9.43 kB
JavaScript
/*! For license information please see index.js.LICENSE.txt */
(()=>{var e={8229:(e,r,t)=>{"use strict";t.d(r,{U:()=>n});var n={ROOT:"mdc-icon",LIGHT:"mdc-icon--light",DARK:"mdc-icon--dark",INACTIVE:"mdc-icon--inactive"}},8263:(e,r,t)=>{"use strict";t.d(r,{Z:()=>d});var n=t(6575),o=t(5697),c=t.n(o),i=t(4184),a=t.n(i),l=t(8229),s=t(5893),u=["name","type","size","light","dark","inactive","element","component","children","className"];function p(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 f(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?p(Object(t),!0).forEach((function(r){b(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function b(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var O=(0,n.forwardRef)((function(e,r){var t,n=e.name,o=e.type,c=e.size,i=e.light,p=void 0!==i&&i,O=e.dark,d=void 0!==O&&O,y=e.inactive,m=void 0!==y&&y,v=e.element,j=void 0===v?"i":v,g=e.component,h=void 0===g?j:g,P=e.children,w=void 0===P?n:P,_=e.className,E=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)t=c[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)t=c[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,u),x=a()(l.U.ROOT,(b(t={},"".concat(l.U.ROOT,"--").concat(o),o),b(t,"".concat(l.U.ROOT,"--").concat(c),c),b(t,l.U.LIGHT,p),b(t,l.U.DARK,d),b(t,l.U.INACTIVE,m),t),_);return(0,s.jsx)(h,f(f({ref:r,className:x},E),{},{children:w}))}));O.displayName="MDCIcon",O.propTypes={type:c().oneOf(["","filled","outlined","round","sharp","two-tone"]),size:c().string,light:c().bool,dark:c().bool,inactive:c().bool};const d=O},4184:(e,r)=>{var t;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],r=0;r<arguments.length;r++){var t=arguments[r];if(t){var c=typeof t;if("string"===c||"number"===c)e.push(t);else if(Array.isArray(t)){if(t.length){var i=o.apply(null,t);i&&e.push(i)}}else if("object"===c)if(t.toString===Object.prototype.toString)for(var a in t)n.call(t,a)&&t[a]&&e.push(a);else e.push(t.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(t=function(){return o}.apply(r,[]))||(e.exports=t)}()},7418:e=>{"use strict";var r=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=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(e,c){for(var i,a,l=o(e),s=1;s<arguments.length;s++){for(var u in i=Object(arguments[s]))t.call(i,u)&&(l[u]=i[u]);if(r){a=r(i);for(var p=0;p<a.length;p++)n.call(i,a[p])&&(l[a[p]]=i[a[p]])}}return l}},2703:(e,r,t)=>{"use strict";var n=t(414);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,r,t,o,c,i){if(i!==n){var a=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 a.name="Invariant Violation",a}}function r(){return e}e.isRequired=e;var t={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:c,resetWarningCache:o};return t.PropTypes=t,t}},5697:(e,r,t)=>{e.exports=t(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5251:(e,r,t)=>{"use strict";t(7418);var n=t(6575),o=60103;if("function"==typeof Symbol&&Symbol.for){var c=Symbol.for;o=c("react.element"),c("react.fragment")}var i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,r,t){var n,c={},s=null,u=null;for(n in void 0!==t&&(s=""+t),void 0!==r.key&&(s=""+r.key),void 0!==r.ref&&(u=r.ref),r)a.call(r,n)&&!l.hasOwnProperty(n)&&(c[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.defaultProps)void 0===c[n]&&(c[n]=r[n]);return{$$typeof:o,type:e,key:s,ref:u,props:c,_owner:i.current}}r.jsx=s,r.jsxs=s},5893:(e,r,t)=>{"use strict";e.exports=t(5251)},6575:e=>{"use strict";e.exports=void 0}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var c=r[n]={exports:{}};return e[n](c,c.exports,t),c.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{"use strict";var e=t(6575),r=t(5697),n=t.n(r),o=t(4184),c=t.n(o),i=["component","fallback","className","children"];function a(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 l(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?a(Object(t),!0).forEach((function(r){s(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function s(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var u=(0,e.forwardRef)((function(r,t){var n=r.component,o=r.fallback,a=r.className,s=r.children,u=void 0===s?n:s,p=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)t=c[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)t=c[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(r,i);return(0,e.isValidElement)(n)?(0,e.cloneElement)(n,l({ref:t,className:c()(a,n.props.className)},p)):(0,e.isValidElement)(o)?(0,e.cloneElement)(o,l({ref:t,className:c()(a,o.props.className)},p)):o?(0,e.createElement)(o,l({ref:t,className:a},p),u):u})),p=t(8263),f="mdc-button__icon",b=t(5893),O=["label","icon","leadingIcon","trailingIcon","raised","unelevated","outlined","touch","element","component","className","children"];function d(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 y(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?d(Object(t),!0).forEach((function(r){m(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function m(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var v=(0,e.forwardRef)((function(e,r){var t,n=e.label,o=e.icon,i=e.leadingIcon,a=void 0===i?o:i,l=e.trailingIcon,s=e.raised,d=void 0!==s&&s,v=e.unelevated,j=void 0!==v&&v,g=e.outlined,h=void 0!==g&&g,P=e.touch,w=void 0!==P&&P,_=e.element,E=void 0===_?"button":_,x=e.component,N=void 0===x?E:x,S=e.className,k=e.children,I=void 0===k?n:k,T=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)t=c[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)t=c[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,O),D=c()("mdc-button",(m(t={},"mdc-button--raised",d),m(t,"mdc-button--unelevated",j),m(t,"mdc-button--outlined",h),m(t,"mdc-button--touch",w),m(t,"mdc-button--icon-leading",Boolean(a)),m(t,"mdc-button--icon-trailing",Boolean(l)),t),S);return(0,b.jsxs)(N,y(y({ref:r,className:D},T),{},{children:[(0,b.jsx)("span",{className:"mdc-button__ripple"}),w&&(0,b.jsx)("span",{className:"mdc-button__touch"}),a&&(0,b.jsx)(u,{component:a,fallback:p.Z,className:f,"aria-hidden":"true"}),(0,b.jsx)("span",{className:"mdc-button__label",children:I}),l&&(0,b.jsx)(u,{component:l,fallback:p.Z,className:f,"aria-hidden":"true"})]}))}));v.displayName="MDCButton",v.propTypes={label:n().node,icon:n().node,leadingIcon:n().node,trailingIcon:n().node,raised:n().bool,unelevated:n().bool,outlined:n().bool,touch:n().bool}})()})();