Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@movement-react/core

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@movement-react/core - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

dist/cjs/index.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@material-ui/core"),a=require("prop-types"),o=require("clsx"),r=require("@movement-react/utils"),n=require("@movement-react/theme"),i=require("webfontloader");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(e),u=l(a),s=l(o),c=l(i),f=function(){return(f=Object.assign||function(e){for(var t,a=1,o=arguments.length;a<o;a++)for(var r in t=arguments[a])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function v(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(a[o[r]]=e[o[r]])}return a}var m,p=function(e){var t=e.condition,a=e.render,o=e.children;return!0===t?a?a():o:null};!function(e){e.BLUR="blur",e.FADE="fade",e.NONE="none"}(m||(m={}));var b=d.default.forwardRef((function(e,t){var a=e.classes,o=e.effect,n=void 0===o?m.FADE:o,i=e.className,l=e.threshold,u=void 0===l?200:l,c=e.visible,f=void 0!==c&&c,v=e.height,b=e.children,g=t?d.default.useRef(t):d.default.createRef(),h=r.useInViewport(g,u);return d.default.createElement("div",{ref:g,className:s.default(a.root,i),style:{minHeight:v}},d.default.createElement("span",{className:s.default(a[n],{loaded:h||f})},d.default.createElement(p,{condition:h||f},d.default.Children.only(b))))}));b.displayName="LazyLoad";var g=t.withStyles((function(e){return{root:{width:"auto",height:"auto",minHeight:"100px"},blur:{filter:"blur(15px)",transition:"filter "+e.transitions.duration.leavingScreen/200+"s","&.loaded":{filter:"blur(0)",transition:"filter "+e.transitions.duration.leavingScreen/200+"s"}},fade:{opacity:0,transition:"opacity "+e.transitions.duration.leavingScreen/200+"s","&.loaded":{opacity:1,transition:"opacity "+e.transitions.duration.leavingScreen/200+"s"}},none:{transition:"none"}}}),{name:"MMLazyLoad"})(b);g.displayName="LazyLoad",g.propTypes={effect:u.default.oneOf([m.BLUR,m.FADE,m.NONE]),className:u.default.string,threshold:u.default.number,visible:u.default.bool,height:u.default.oneOfType([u.default.string,u.default.number])};var h=d.default.forwardRef((function(e,t){var a,o=e.alt,r=void 0===o?"image":o,n=e.src,i=e.className,l=e.classes,u=e.effect,c=void 0===u?m.BLUR:u,p=e.responsive,b=void 0===p||p,h=e.fallback,y=e.onLoad,N=e.onError,E=v(e,["alt","src","className","classes","effect","responsive","fallback","onLoad","onError"]),k=d.default.useState(!1),w=k[0],x=k[1],O=d.default.useState(n),S=O[0],L=O[1],R=d.default.useCallback((function(e){return y?y(e):null}),[y]),P=d.default.useCallback((function(e){return h&&!w?L(h):x(!0),N?N(e):null}),[N]);return d.default.createElement(g,f({effect:c},E),d.default.createElement("img",{className:s.default(i,(a={},a[l.responsive]=b,a[l.error]=w,a)),ref:t,src:S,alt:r,onLoad:R,onError:P}))}));h.displayName="LazyImage";var y=t.withStyles((function(e){return{error:{display:"none"},responsive:{width:"100%",height:"auto"}}}),{name:"MMLazyImage"})(h);y.displayName="LazyImage",y.propTypes={alt:u.default.string,src:u.default.string.isRequired,fallback:u.default.string,responsive:u.default.bool,onLoad:u.default.func,onError:u.default.func,threshold:u.default.number,visible:u.default.bool,height:u.default.oneOfType([u.default.number,u.default.string]),effect:u.default.oneOf([m.BLUR,m.FADE,m.NONE])};var N={Image:y,Component:g},E=d.default.forwardRef((function(e,t){var a,o=e.fit,r=void 0===o?"cover":o,n=e.position,i=void 0===n?"center":n,l=e.height,u=void 0===l?300:l,c=e.autoplay,f=void 0===c||c,v=e.loop,m=void 0===v||v,b=e.src,g=e.sources,h=e.classes,y=e.className,N=e.containerClassname,E=e.children,k=d.default.useState([]),w=k[0],x=k[1],O=t?d.default.useRef(t):d.default.createRef();return d.default.useEffect((function(){return!g&&b?x([{type:"video/mp4",src:b}]):g&&x((function(e){return function(){for(var e=0,t=0,a=arguments.length;t<a;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<a;t++)for(var n=arguments[t],i=0,l=n.length;i<l;i++,r++)o[r]=n[i];return o}(e,[g])})),function(){}}),[x]),d.default.createElement(p,{condition:w.length>0},d.default.createElement("div",{className:s.default(h.container,N),style:{height:u}},d.default.createElement("video",{className:s.default(h.root,h["video-fit-"+r],(a={},a[h["video-position-"+i]]=void 0!==i,a),y),ref:O,autoPlay:f,loop:m,muted:!0,controls:!1,playsInline:!0},w.map((function(e,t){return d.default.createElement("source",{src:e.src,type:e.type,key:t})}))),E))}));E.displayName="BackgroundVideo";var k=t.withStyles((function(e){return{root:{width:"100%",height:"100%",zIndex:-1,position:"absolute"},container:{position:"relative",width:"100%"},"video-fit-cover":{objectFit:"cover"},"video-fit-contain":{objectFit:"contain"},"video-position-fill":{objectFit:"fill"},"video-position-top":{objectPosition:"top"},"video-position-center":{objectPosition:"center"},"video-position-left":{objectPosition:"left"},"video-position-bottom":{objectPosition:"bottom"}}}),{name:"MMBackgroundVideo"})(E);k.displayName="BackgroundVideo";var w=d.default.forwardRef((function(e,t){var a=e.src,o=e.children,r=e.size,n=e.repeat,i=e.position,l=e.classes,u=e.className,c=e.Component,f=void 0===c?"div":c;return d.default.createElement(f,{ref:t,style:{backgroundImage:"url("+a+")",backgroundSize:r,backgroundRepeat:n,backgroundPosition:i},className:s.default(l.root,u)},o)}));w.displayName="BackgroundImage";var x=t.withStyles((function(e){return{root:{backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center"}}}),{name:"MMBackgroundImage"})(w);x.displayName="BackgroundImage";var O={Video:k,Image:x},S=d.default.forwardRef((function(e,a){var o,r=e.classes,n=e.variant,i=void 0===n?"round":n,l=e.size,u=void 0===l?"medium":l,c=e.className,m=e.pulsate,p=void 0===m||m,b=e.palette,g=void 0===b?"primary":b,h=e.children,y=v(e,["classes","variant","size","className","pulsate","palette","children"]);return d.default.createElement(t.Fab,f({ref:a,className:s.default(r.fab,r[""+g],(o={},o[r["pulsate-"+g]]=p,o),c),variant:i,size:u},y),h)}));S.displayName="MMFabUnstyled";var L=t.withStyles((function(e){for(var t={fab:{"&:hover":{animation:"none"},"&:focus":{animation:"none"},"&:disabled":{animation:"none"}}},a=0,o=["primary","secondary","success","info","error","warning"];a<o.length;a++){var n=o[a],i=e.palette,l=r.convertHexToRgba(i[""+n].main,0);t["@keyframes pulsate-"+n]={"0%":{boxShadow:"0 0 0 0 "+r.convertHexToRgba(i[""+n].main,.7)},"75%":{boxShadow:"0 0 0 20px "+l},"100%":{boxShadow:"0 0 0 0 "+l}},t["pulsate-"+n]={animation:"$pulsate-"+n+" 2s infinite"},t[""+n]={color:i[""+n].contrastText,backgroundColor:i[""+n].main,"&:hover":{backgroundColor:i[""+n].dark,"@media (hover: none)":{backgroundColor:i[""+n].main}}}}return t}),{name:"MMFab"})(S);L.displayName="Fab";var R=d.default.createContext({}),P=function(e){var t=e.config,a=e.children,o=d.default.useState(),r=o[0],n=o[1],i=function(){return n("loading")},l=function(){return n("active")},u=function(){return n("inactive")};return d.default.useEffect((function(){return c.default.load(f(f({},t),{loading:i,active:l,inactive:u}))}),[t]),d.default.createElement(R.Provider,{value:{font:r}},a)};exports.Background=O,exports.Fab=L,exports.FontProvider=P,exports.If=p,exports.Lazy=N,exports.ThemeProvider=function(e){var a=e.theme,o=void 0===a?n.defaultTheme:a,r=e.fontProps,i=e.children;return d.default.createElement(t.ThemeProvider,{theme:o},d.default.createElement(p,{condition:void 0===r},i),d.default.createElement(p,{condition:void 0!==r},d.default.createElement(P,f({},r),i)))};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@material-ui/core"),a=require("prop-types"),o=require("clsx"),r=require("@movement-react/utils"),n=require("@movement-react/theme"),i=require("webfontloader");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(e),d=l(a),u=l(o),c=l(i),f=function(){return(f=Object.assign||function(e){for(var t,a=1,o=arguments.length;a<o;a++)for(var r in t=arguments[a])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function p(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(a[o[r]]=e[o[r]])}return a}var v,m=function(e){var t=e.condition,a=e.render,o=e.children;return!0===t?a?a():o:null};"production"!==process.env.NODE_ENV&&(m.displayName="If"),function(e){e.BLUR="blur",e.FADE="fade",e.NONE="none"}(v||(v={}));var h=s.default.forwardRef((function(e,t){var a=e.classes,o=e.effect,n=void 0===o?v.FADE:o,i=e.className,l=e.threshold,d=void 0===l?200:l,c=e.visible,f=void 0!==c&&c,p=e.height,h=e.children,y=t?s.default.useRef(t):s.default.createRef(),b=r.useInViewport(y,d);return s.default.createElement("div",{ref:y,className:u.default(a.root,i),style:{minHeight:p}},s.default.createElement("span",{className:u.default(a[n],{loaded:b||f})},s.default.createElement(m,{condition:b||f},s.default.Children.only(h))))})),y=t.withStyles((function(e){return{root:{width:"auto",height:"auto",minHeight:"100px"},blur:{filter:"blur(15px)",transition:"filter "+e.transitions.duration.leavingScreen/200+"s","&.loaded":{filter:"blur(0)",transition:"filter "+e.transitions.duration.leavingScreen/200+"s"}},fade:{opacity:0,transition:"opacity "+e.transitions.duration.leavingScreen/200+"s","&.loaded":{opacity:1,transition:"opacity "+e.transitions.duration.leavingScreen/200+"s"}},none:{transition:"none"}}}),{name:"MMLazyLoad"})(h);"production"!==process.env.NODE_ENV&&(h.displayName="LazyLoad",y.displayName="LazyLoad"),y.propTypes={effect:d.default.oneOf([v.BLUR,v.FADE,v.NONE]),className:d.default.string,threshold:d.default.number,visible:d.default.bool,height:d.default.oneOfType([d.default.string,d.default.number])};var b=s.default.forwardRef((function(e,t){var a,o=e.alt,r=void 0===o?"image":o,n=e.src,i=e.className,l=e.classes,d=e.effect,c=void 0===d?v.BLUR:d,m=e.responsive,h=void 0===m||m,b=e.fallback,g=e.onLoad,N=e.onError,E=p(e,["alt","src","className","classes","effect","responsive","fallback","onLoad","onError"]),O=s.default.useState(!1),k=O[0],w=O[1],x=s.default.useState(n),S=x[0],P=x[1],L=s.default.useCallback((function(e){return g?g(e):null}),[g]),R=s.default.useCallback((function(e){return b&&!k?P(b):w(!0),N?N(e):null}),[N]);return s.default.createElement(y,f({effect:c},E),s.default.createElement("img",{className:u.default(i,(a={},a[l.responsive]=h,a[l.error]=k,a)),ref:t,src:S,alt:r,onLoad:L,onError:R}))})),g=t.withStyles((function(e){return{error:{display:"none"},responsive:{width:"100%",height:"auto"}}}),{name:"MMLazyImage"})(b);"production"!==process.env.NODE_ENV&&(b.displayName="LazyImage",g.displayName="LazyImage"),g.propTypes={alt:d.default.string,src:d.default.string.isRequired,fallback:d.default.string,responsive:d.default.bool,onLoad:d.default.func,onError:d.default.func,threshold:d.default.number,visible:d.default.bool,height:d.default.oneOfType([d.default.number,d.default.string]),effect:d.default.oneOf([v.BLUR,v.FADE,v.NONE])};var N={Image:g,Component:y},E=s.default.forwardRef((function(e,t){var a,o=e.fit,r=void 0===o?"cover":o,n=e.position,i=void 0===n?"center":n,l=e.height,d=void 0===l?300:l,c=e.autoplay,f=void 0===c||c,p=e.loop,v=void 0===p||p,h=e.src,y=e.sources,b=e.classes,g=e.className,N=e.containerClassname,E=e.children,O=s.default.useState([]),k=O[0],w=O[1],x=t?s.default.useRef(t):s.default.createRef();return s.default.useEffect((function(){return!y&&h?w([{type:"video/mp4",src:h}]):y&&w((function(e){return function(){for(var e=0,t=0,a=arguments.length;t<a;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<a;t++)for(var n=arguments[t],i=0,l=n.length;i<l;i++,r++)o[r]=n[i];return o}(e,[y])})),function(){}}),[w]),s.default.createElement(m,{condition:k.length>0},s.default.createElement("div",{className:u.default(b.container,N),style:{height:d}},s.default.createElement("video",{className:u.default(b.root,b["video-fit-"+r],(a={},a[b["video-position-"+i]]=void 0!==i,a),g),ref:x,autoPlay:f,loop:v,muted:!0,controls:!1,playsInline:!0},k.map((function(e,t){return s.default.createElement("source",{src:e.src,type:e.type,key:t})}))),E))})),O=t.withStyles((function(e){return{root:{width:"100%",height:"100%",zIndex:-1,position:"absolute"},container:{position:"relative",width:"100%"},"video-fit-cover":{objectFit:"cover"},"video-fit-contain":{objectFit:"contain"},"video-position-fill":{objectFit:"fill"},"video-position-top":{objectPosition:"top"},"video-position-center":{objectPosition:"center"},"video-position-left":{objectPosition:"left"},"video-position-bottom":{objectPosition:"bottom"}}}),{name:"MMBackgroundVideo"})(E);"production"!==process.env.NODE_ENV&&(E.displayName="BackgroundVideo",O.displayName="BackgroundVideo");var k=s.default.forwardRef((function(e,t){var a=e.src,o=e.children,r=e.size,n=e.repeat,i=e.position,l=e.classes,d=e.className,c=e.Component,f=void 0===c?"div":c;return s.default.createElement(f,{ref:t,style:{backgroundImage:"url("+a+")",backgroundSize:r,backgroundRepeat:n,backgroundPosition:i},className:u.default(l.root,d)},o)})),w=t.withStyles((function(e){return{root:{backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center"}}}),{name:"MMBackgroundImage"})(k);"production"!==process.env.NODE_ENV&&(k.displayName="BackgroundImage",w.displayName="BackgroundImage");var x={Video:O,Image:w},S=s.default.forwardRef((function(e,a){var o,r=e.classes,n=e.variant,i=void 0===n?"round":n,l=e.size,d=void 0===l?"medium":l,c=e.className,v=e.pulsate,m=void 0===v||v,h=e.palette,y=void 0===h?"primary":h,b=e.children,g=p(e,["classes","variant","size","className","pulsate","palette","children"]);return s.default.createElement(t.Fab,f({ref:a,className:u.default(r.fab,r[""+y],(o={},o[r["pulsate-"+y]]=m,o),c),variant:i,size:d},g),b)})),P=t.withStyles((function(e){for(var t={fab:{"&:hover":{animation:"none"},"&:focus":{animation:"none"},"&:disabled":{animation:"none"}}},a=0,o=["primary","secondary","success","info","error","warning"];a<o.length;a++){var n=o[a],i=e.palette,l=r.convertHexToRgba(i[""+n].main,0);t["@keyframes pulsate-"+n]={"0%":{boxShadow:"0 0 0 0 "+r.convertHexToRgba(i[""+n].main,.7)},"75%":{boxShadow:"0 0 0 20px "+l},"100%":{boxShadow:"0 0 0 0 "+l}},t["pulsate-"+n]={animation:"$pulsate-"+n+" 2s infinite"},t[""+n]={color:i[""+n].contrastText,backgroundColor:i[""+n].main,"&:hover":{backgroundColor:i[""+n].dark,"@media (hover: none)":{backgroundColor:i[""+n].main}}}}return t}),{name:"MMFab"})(S);"production"!==process.env.NODE_ENV&&(S.displayName="Fab",P.displayName="Fab");var L=s.default.createContext({}),R=function(e){var t=e.config,a=e.children,o=s.default.useState(),r=o[0],n=o[1],i=function(){return n("loading")},l=function(){return n("active")},d=function(){return n("inactive")};return s.default.useEffect((function(){return c.default.load(f(f({},t),{loading:i,active:l,inactive:d}))}),[t]),s.default.createElement(L.Provider,{value:{font:r}},a)};"production"!==process.env.NODE_ENV&&(R.displayName="FontProvider");var j=function(e){var a=e.theme,o=void 0===a?n.defaultTheme:a,r=e.fontProps,i=e.children;return s.default.createElement(t.ThemeProvider,{theme:o},s.default.createElement(m,{condition:void 0===r},i),s.default.createElement(m,{condition:void 0!==r},s.default.createElement(R,f({},r),i)))};"production"!==process.env.NODE_ENV&&(j.displayName="ThemeProvider"),exports.Background=x,exports.Fab=P,exports.FontProvider=R,exports.If=m,exports.Lazy=N,exports.ThemeProvider=j;

@@ -1,2 +0,2 @@

import e from"react";import{withStyles as o,Fab as t,ThemeProvider as n}from"@material-ui/core";import r from"prop-types";import a from"clsx";import{useInViewport as i,convertHexToRgba as s}from"@movement-react/utils";import{defaultTheme as c}from"@movement-react/theme";import l from"webfontloader";
import e from"react";import{withStyles as o,Fab as n,ThemeProvider as r}from"@material-ui/core";import t from"prop-types";import a from"clsx";import{useInViewport as i,convertHexToRgba as s}from"@movement-react/utils";import{defaultTheme as c}from"@movement-react/theme";import l from"webfontloader";
/*! *****************************************************************************

@@ -15,2 +15,2 @@ Copyright (c) Microsoft Corporation.

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var d=function(){return(d=Object.assign||function(e){for(var o,t=1,n=arguments.length;t<n;t++)for(var r in o=arguments[t])Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r]);return e}).apply(this,arguments)};function u(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}var f,m=function(e){var o=e.condition,t=e.render,n=e.children;return!0===o?t?t():n:null};!function(e){e.BLUR="blur",e.FADE="fade",e.NONE="none"}(f||(f={}));var p=e.forwardRef((function(o,t){var n=o.classes,r=o.effect,s=void 0===r?f.FADE:r,c=o.className,l=o.threshold,d=void 0===l?200:l,u=o.visible,p=void 0!==u&&u,v=o.height,g=o.children,b=t?e.useRef(t):e.createRef(),h=i(b,d);return e.createElement("div",{ref:b,className:a(n.root,c),style:{minHeight:v}},e.createElement("span",{className:a(n[s],{loaded:h||p})},e.createElement(m,{condition:h||p},e.Children.only(g))))}));p.displayName="LazyLoad";var v=o((function(e){return{root:{width:"auto",height:"auto",minHeight:"100px"},blur:{filter:"blur(15px)",transition:"filter "+e.transitions.duration.leavingScreen/200+"s","&.loaded":{filter:"blur(0)",transition:"filter "+e.transitions.duration.leavingScreen/200+"s"}},fade:{opacity:0,transition:"opacity "+e.transitions.duration.leavingScreen/200+"s","&.loaded":{opacity:1,transition:"opacity "+e.transitions.duration.leavingScreen/200+"s"}},none:{transition:"none"}}}),{name:"MMLazyLoad"})(p);v.displayName="LazyLoad",v.propTypes={effect:r.oneOf([f.BLUR,f.FADE,f.NONE]),className:r.string,threshold:r.number,visible:r.bool,height:r.oneOfType([r.string,r.number])};var g=e.forwardRef((function(o,t){var n,r=o.alt,i=void 0===r?"image":r,s=o.src,c=o.className,l=o.classes,m=o.effect,p=void 0===m?f.BLUR:m,g=o.responsive,b=void 0===g||g,h=o.fallback,y=o.onLoad,N=o.onError,E=u(o,["alt","src","className","classes","effect","responsive","fallback","onLoad","onError"]),k=e.useState(!1),O=k[0],w=k[1],L=e.useState(s),R=L[0],S=L[1],z=e.useCallback((function(e){return y?y(e):null}),[y]),P=e.useCallback((function(e){return h&&!O?S(h):w(!0),N?N(e):null}),[N]);return e.createElement(v,d({effect:p},E),e.createElement("img",{className:a(c,(n={},n[l.responsive]=b,n[l.error]=O,n)),ref:t,src:R,alt:i,onLoad:z,onError:P}))}));g.displayName="LazyImage";var b=o((function(e){return{error:{display:"none"},responsive:{width:"100%",height:"auto"}}}),{name:"MMLazyImage"})(g);b.displayName="LazyImage",b.propTypes={alt:r.string,src:r.string.isRequired,fallback:r.string,responsive:r.bool,onLoad:r.func,onError:r.func,threshold:r.number,visible:r.bool,height:r.oneOfType([r.number,r.string]),effect:r.oneOf([f.BLUR,f.FADE,f.NONE])};var h={Image:b,Component:v},y=e.forwardRef((function(o,t){var n,r=o.fit,i=void 0===r?"cover":r,s=o.position,c=void 0===s?"center":s,l=o.height,d=void 0===l?300:l,u=o.autoplay,f=void 0===u||u,p=o.loop,v=void 0===p||p,g=o.src,b=o.sources,h=o.classes,y=o.className,N=o.containerClassname,E=o.children,k=e.useState([]),O=k[0],w=k[1],L=t?e.useRef(t):e.createRef();return e.useEffect((function(){return!b&&g?w([{type:"video/mp4",src:g}]):b&&w((function(e){return function(){for(var e=0,o=0,t=arguments.length;o<t;o++)e+=arguments[o].length;var n=Array(e),r=0;for(o=0;o<t;o++)for(var a=arguments[o],i=0,s=a.length;i<s;i++,r++)n[r]=a[i];return n}(e,[b])})),function(){}}),[w]),e.createElement(m,{condition:O.length>0},e.createElement("div",{className:a(h.container,N),style:{height:d}},e.createElement("video",{className:a(h.root,h["video-fit-"+i],(n={},n[h["video-position-"+c]]=void 0!==c,n),y),ref:L,autoPlay:f,loop:v,muted:!0,controls:!1,playsInline:!0},O.map((function(o,t){return e.createElement("source",{src:o.src,type:o.type,key:t})}))),E))}));y.displayName="BackgroundVideo";var N=o((function(e){return{root:{width:"100%",height:"100%",zIndex:-1,position:"absolute"},container:{position:"relative",width:"100%"},"video-fit-cover":{objectFit:"cover"},"video-fit-contain":{objectFit:"contain"},"video-position-fill":{objectFit:"fill"},"video-position-top":{objectPosition:"top"},"video-position-center":{objectPosition:"center"},"video-position-left":{objectPosition:"left"},"video-position-bottom":{objectPosition:"bottom"}}}),{name:"MMBackgroundVideo"})(y);N.displayName="BackgroundVideo";var E=e.forwardRef((function(o,t){var n=o.src,r=o.children,i=o.size,s=o.repeat,c=o.position,l=o.classes,d=o.className,u=o.Component,f=void 0===u?"div":u;return e.createElement(f,{ref:t,style:{backgroundImage:"url("+n+")",backgroundSize:i,backgroundRepeat:s,backgroundPosition:c},className:a(l.root,d)},r)}));E.displayName="BackgroundImage";var k=o((function(e){return{root:{backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center"}}}),{name:"MMBackgroundImage"})(E);k.displayName="BackgroundImage";var O={Video:N,Image:k},w=e.forwardRef((function(o,n){var r,i=o.classes,s=o.variant,c=void 0===s?"round":s,l=o.size,f=void 0===l?"medium":l,m=o.className,p=o.pulsate,v=void 0===p||p,g=o.palette,b=void 0===g?"primary":g,h=o.children,y=u(o,["classes","variant","size","className","pulsate","palette","children"]);return e.createElement(t,d({ref:n,className:a(i.fab,i[""+b],(r={},r[i["pulsate-"+b]]=v,r),m),variant:c,size:f},y),h)}));w.displayName="MMFabUnstyled";var L=o((function(e){for(var o={fab:{"&:hover":{animation:"none"},"&:focus":{animation:"none"},"&:disabled":{animation:"none"}}},t=0,n=["primary","secondary","success","info","error","warning"];t<n.length;t++){var r=n[t],a=e.palette,i=s(a[""+r].main,0);o["@keyframes pulsate-"+r]={"0%":{boxShadow:"0 0 0 0 "+s(a[""+r].main,.7)},"75%":{boxShadow:"0 0 0 20px "+i},"100%":{boxShadow:"0 0 0 0 "+i}},o["pulsate-"+r]={animation:"$pulsate-"+r+" 2s infinite"},o[""+r]={color:a[""+r].contrastText,backgroundColor:a[""+r].main,"&:hover":{backgroundColor:a[""+r].dark,"@media (hover: none)":{backgroundColor:a[""+r].main}}}}return o}),{name:"MMFab"})(w);L.displayName="Fab";var R=e.createContext({}),S=function(o){var t=o.config,n=o.children,r=e.useState(),a=r[0],i=r[1],s=function(){return i("loading")},c=function(){return i("active")},u=function(){return i("inactive")};return e.useEffect((function(){return l.load(d(d({},t),{loading:s,active:c,inactive:u}))}),[t]),e.createElement(R.Provider,{value:{font:a}},n)},z=function(o){var t=o.theme,r=void 0===t?c:t,a=o.fontProps,i=o.children;return e.createElement(n,{theme:r},e.createElement(m,{condition:void 0===a},i),e.createElement(m,{condition:void 0!==a},e.createElement(S,d({},a),i)))};export{O as Background,L as Fab,S as FontProvider,m as If,h as Lazy,z as ThemeProvider};
***************************************************************************** */var d=function(){return(d=Object.assign||function(e){for(var o,n=1,r=arguments.length;n<r;n++)for(var t in o=arguments[n])Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t]);return e}).apply(this,arguments)};function u(e,o){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)o.indexOf(r[t])<0&&Object.prototype.propertyIsEnumerable.call(e,r[t])&&(n[r[t]]=e[r[t]])}return n}var f,p=function(e){var o=e.condition,n=e.render,r=e.children;return!0===o?n?n():r:null};"production"!==process.env.NODE_ENV&&(p.displayName="If"),function(e){e.BLUR="blur",e.FADE="fade",e.NONE="none"}(f||(f={}));var m=e.forwardRef((function(o,n){var r=o.classes,t=o.effect,s=void 0===t?f.FADE:t,c=o.className,l=o.threshold,d=void 0===l?200:l,u=o.visible,m=void 0!==u&&u,v=o.height,g=o.children,b=n?e.useRef(n):e.createRef(),h=i(b,d);return e.createElement("div",{ref:b,className:a(r.root,c),style:{minHeight:v}},e.createElement("span",{className:a(r[s],{loaded:h||m})},e.createElement(p,{condition:h||m},e.Children.only(g))))})),v=o((function(e){return{root:{width:"auto",height:"auto",minHeight:"100px"},blur:{filter:"blur(15px)",transition:"filter "+e.transitions.duration.leavingScreen/200+"s","&.loaded":{filter:"blur(0)",transition:"filter "+e.transitions.duration.leavingScreen/200+"s"}},fade:{opacity:0,transition:"opacity "+e.transitions.duration.leavingScreen/200+"s","&.loaded":{opacity:1,transition:"opacity "+e.transitions.duration.leavingScreen/200+"s"}},none:{transition:"none"}}}),{name:"MMLazyLoad"})(m);"production"!==process.env.NODE_ENV&&(m.displayName="LazyLoad",v.displayName="LazyLoad"),v.propTypes={effect:t.oneOf([f.BLUR,f.FADE,f.NONE]),className:t.string,threshold:t.number,visible:t.bool,height:t.oneOfType([t.string,t.number])};var g=e.forwardRef((function(o,n){var r,t=o.alt,i=void 0===t?"image":t,s=o.src,c=o.className,l=o.classes,p=o.effect,m=void 0===p?f.BLUR:p,g=o.responsive,b=void 0===g||g,h=o.fallback,y=o.onLoad,N=o.onError,E=u(o,["alt","src","className","classes","effect","responsive","fallback","onLoad","onError"]),O=e.useState(!1),k=O[0],w=O[1],L=e.useState(s),P=L[0],R=L[1],S=e.useCallback((function(e){return y?y(e):null}),[y]),z=e.useCallback((function(e){return h&&!k?R(h):w(!0),N?N(e):null}),[N]);return e.createElement(v,d({effect:m},E),e.createElement("img",{className:a(c,(r={},r[l.responsive]=b,r[l.error]=k,r)),ref:n,src:P,alt:i,onLoad:S,onError:z}))})),b=o((function(e){return{error:{display:"none"},responsive:{width:"100%",height:"auto"}}}),{name:"MMLazyImage"})(g);"production"!==process.env.NODE_ENV&&(g.displayName="LazyImage",b.displayName="LazyImage"),b.propTypes={alt:t.string,src:t.string.isRequired,fallback:t.string,responsive:t.bool,onLoad:t.func,onError:t.func,threshold:t.number,visible:t.bool,height:t.oneOfType([t.number,t.string]),effect:t.oneOf([f.BLUR,f.FADE,f.NONE])};var h={Image:b,Component:v},y=e.forwardRef((function(o,n){var r,t=o.fit,i=void 0===t?"cover":t,s=o.position,c=void 0===s?"center":s,l=o.height,d=void 0===l?300:l,u=o.autoplay,f=void 0===u||u,m=o.loop,v=void 0===m||m,g=o.src,b=o.sources,h=o.classes,y=o.className,N=o.containerClassname,E=o.children,O=e.useState([]),k=O[0],w=O[1],L=n?e.useRef(n):e.createRef();return e.useEffect((function(){return!b&&g?w([{type:"video/mp4",src:g}]):b&&w((function(e){return function(){for(var e=0,o=0,n=arguments.length;o<n;o++)e+=arguments[o].length;var r=Array(e),t=0;for(o=0;o<n;o++)for(var a=arguments[o],i=0,s=a.length;i<s;i++,t++)r[t]=a[i];return r}(e,[b])})),function(){}}),[w]),e.createElement(p,{condition:k.length>0},e.createElement("div",{className:a(h.container,N),style:{height:d}},e.createElement("video",{className:a(h.root,h["video-fit-"+i],(r={},r[h["video-position-"+c]]=void 0!==c,r),y),ref:L,autoPlay:f,loop:v,muted:!0,controls:!1,playsInline:!0},k.map((function(o,n){return e.createElement("source",{src:o.src,type:o.type,key:n})}))),E))})),N=o((function(e){return{root:{width:"100%",height:"100%",zIndex:-1,position:"absolute"},container:{position:"relative",width:"100%"},"video-fit-cover":{objectFit:"cover"},"video-fit-contain":{objectFit:"contain"},"video-position-fill":{objectFit:"fill"},"video-position-top":{objectPosition:"top"},"video-position-center":{objectPosition:"center"},"video-position-left":{objectPosition:"left"},"video-position-bottom":{objectPosition:"bottom"}}}),{name:"MMBackgroundVideo"})(y);"production"!==process.env.NODE_ENV&&(y.displayName="BackgroundVideo",N.displayName="BackgroundVideo");var E=e.forwardRef((function(o,n){var r=o.src,t=o.children,i=o.size,s=o.repeat,c=o.position,l=o.classes,d=o.className,u=o.Component,f=void 0===u?"div":u;return e.createElement(f,{ref:n,style:{backgroundImage:"url("+r+")",backgroundSize:i,backgroundRepeat:s,backgroundPosition:c},className:a(l.root,d)},t)})),O=o((function(e){return{root:{backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center"}}}),{name:"MMBackgroundImage"})(E);"production"!==process.env.NODE_ENV&&(E.displayName="BackgroundImage",O.displayName="BackgroundImage");var k={Video:N,Image:O},w=e.forwardRef((function(o,r){var t,i=o.classes,s=o.variant,c=void 0===s?"round":s,l=o.size,f=void 0===l?"medium":l,p=o.className,m=o.pulsate,v=void 0===m||m,g=o.palette,b=void 0===g?"primary":g,h=o.children,y=u(o,["classes","variant","size","className","pulsate","palette","children"]);return e.createElement(n,d({ref:r,className:a(i.fab,i[""+b],(t={},t[i["pulsate-"+b]]=v,t),p),variant:c,size:f},y),h)})),L=o((function(e){for(var o={fab:{"&:hover":{animation:"none"},"&:focus":{animation:"none"},"&:disabled":{animation:"none"}}},n=0,r=["primary","secondary","success","info","error","warning"];n<r.length;n++){var t=r[n],a=e.palette,i=s(a[""+t].main,0);o["@keyframes pulsate-"+t]={"0%":{boxShadow:"0 0 0 0 "+s(a[""+t].main,.7)},"75%":{boxShadow:"0 0 0 20px "+i},"100%":{boxShadow:"0 0 0 0 "+i}},o["pulsate-"+t]={animation:"$pulsate-"+t+" 2s infinite"},o[""+t]={color:a[""+t].contrastText,backgroundColor:a[""+t].main,"&:hover":{backgroundColor:a[""+t].dark,"@media (hover: none)":{backgroundColor:a[""+t].main}}}}return o}),{name:"MMFab"})(w);"production"!==process.env.NODE_ENV&&(w.displayName="Fab",L.displayName="Fab");var P=e.createContext({}),R=function(o){var n=o.config,r=o.children,t=e.useState(),a=t[0],i=t[1],s=function(){return i("loading")},c=function(){return i("active")},u=function(){return i("inactive")};return e.useEffect((function(){return l.load(d(d({},n),{loading:s,active:c,inactive:u}))}),[n]),e.createElement(P.Provider,{value:{font:a}},r)};"production"!==process.env.NODE_ENV&&(R.displayName="FontProvider");var S=function(o){var n=o.theme,t=void 0===n?c:n,a=o.fontProps,i=o.children;return e.createElement(r,{theme:t},e.createElement(p,{condition:void 0===a},i),e.createElement(p,{condition:void 0!==a},e.createElement(R,d({},a),i)))};"production"!==process.env.NODE_ENV&&(S.displayName="ThemeProvider");export{k as Background,L as Fab,R as FontProvider,p as If,h as Lazy,S as ThemeProvider};
{
"name": "@movement-react/core",
"version": "0.0.5",
"version": "0.0.6",
"description": "Core components",

@@ -32,4 +32,4 @@ "author": "Douglas Schamberg <doug.schamberg@gmail.com>",

"dependencies": {
"@movement-react/theme": "^0.0.5",
"@movement-react/utils": "^0.0.5",
"@movement-react/theme": "^0.0.6",
"@movement-react/utils": "^0.0.6",
"clsx": "^1.1.1",

@@ -43,3 +43,3 @@ "webfontloader": "^1.6.28"

},
"gitHead": "6802ecaac9baade1247f910976279909163f2887"
"gitHead": "32f2e2cdbd3301808b68b89a2368f4a8e949ea55"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc