motioncss-ui 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/motioncss-ui.js +587 -313
- package/dist/motioncss-ui.umd.cjs +23 -13
- package/package.json +12 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(P,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],x):(P=typeof globalThis<"u"?globalThis:P||self,x(P.MotionCSSUI={},P.React))})(this,(function(P,x){"use strict";var X={exports:{}},V={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var ue;function Me(){if(ue)return V;ue=1;var y=x,a=Symbol.for("react.element"),d=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,g=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function b(m,o,T){var f,R={},c=null,C=null;T!==void 0&&(c=""+T),o.key!==void 0&&(c=""+o.key),o.ref!==void 0&&(C=o.ref);for(f in o)u.call(o,f)&&!p.hasOwnProperty(f)&&(R[f]=o[f]);if(m&&m.defaultProps)for(f in o=m.defaultProps,o)R[f]===void 0&&(R[f]=o[f]);return{$$typeof:a,type:m,key:c,ref:C,props:R,_owner:g.current}}return V.Fragment=d,V.jsx=b,V.jsxs=b,V}var U={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,20 +14,30 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+
|
|
17
|
+
*/var ce;function Ye(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&(function(){var y=x,a=Symbol.for("react.element"),d=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),m=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),C=Symbol.for("react.offscreen"),h=Symbol.iterator,_="@@iterator";function A(e){if(e===null||typeof e!="object")return null;var r=h&&e[h]||e[_];return typeof r=="function"?r:null}var $=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];F("error",e,t)}}function F(e,r,t){{var n=$.ReactDebugCurrentFrame,l=n.getStackAddendum();l!==""&&(r+="%s",t=t.concat([l]));var v=t.map(function(s){return String(s)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var J=!1,Q=!1,q=!1,Ke=!1,ze=!1,de;de=Symbol.for("react.module.reference");function He(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===p||ze||e===g||e===T||e===f||Ke||e===C||J||Q||q||typeof e=="object"&&e!==null&&(e.$$typeof===c||e.$$typeof===R||e.$$typeof===b||e.$$typeof===m||e.$$typeof===o||e.$$typeof===de||e.getModuleId!==void 0))}function Ze(e,r,t){var n=e.displayName;if(n)return n;var l=r.displayName||r.name||"";return l!==""?t+"("+l+")":t}function ve(e){return e.displayName||"Context"}function I(e){if(e==null)return null;if(typeof e.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case u:return"Fragment";case d:return"Portal";case p:return"Profiler";case g:return"StrictMode";case T:return"Suspense";case f:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case m:var r=e;return ve(r)+".Consumer";case b:var t=e;return ve(t._context)+".Provider";case o:return Ze(e,e.render,"ForwardRef");case R:var n=e.displayName||null;return n!==null?n:I(e.type)||"Memo";case c:{var l=e,v=l._payload,s=l._init;try{return I(s(v))}catch{return null}}}return null}var M=Object.assign,N=0,pe,ge,ye,me,he,be,Re;function Ee(){}Ee.__reactDisabledLog=!0;function Qe(){{if(N===0){pe=console.log,ge=console.info,ye=console.warn,me=console.error,he=console.group,be=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ee,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}}function qe(){{if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:pe}),info:M({},e,{value:ge}),warn:M({},e,{value:ye}),error:M({},e,{value:me}),group:M({},e,{value:he}),groupCollapsed:M({},e,{value:be}),groupEnd:M({},e,{value:Re})})}N<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=$.ReactCurrentDispatcher,re;function G(e,r,t){{if(re===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);re=n&&n[1]||""}return`
|
|
18
|
+
`+re+e}}var te=!1,K;{var er=typeof WeakMap=="function"?WeakMap:Map;K=new er}function _e(e,r){if(!e||te)return"";{var t=K.get(e);if(t!==void 0)return t}var n;te=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=ee.current,ee.current=null,Qe();try{if(r){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(j){n=j}Reflect.construct(e,[],s)}else{try{s.call()}catch(j){n=j}e.call(s.prototype)}}else{try{throw Error()}catch(j){n=j}e()}}catch(j){if(j&&n&&typeof j.stack=="string"){for(var i=j.stack.split(`
|
|
19
|
+
`),O=n.stack.split(`
|
|
20
|
+
`),E=i.length-1,w=O.length-1;E>=1&&w>=0&&i[E]!==O[w];)w--;for(;E>=1&&w>=0;E--,w--)if(i[E]!==O[w]){if(E!==1||w!==1)do if(E--,w--,w<0||i[E]!==O[w]){var k=`
|
|
21
|
+
`+i[E].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,k),k}while(E>=1&&w>=0);break}}}finally{te=!1,ee.current=v,qe(),Error.prepareStackTrace=l}var W=e?e.displayName||e.name:"",Y=W?G(W):"";return typeof e=="function"&&K.set(e,Y),Y}function rr(e,r,t){return _e(e,!1)}function tr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function z(e,r,t){if(e==null)return"";if(typeof e=="function")return _e(e,tr(e));if(typeof e=="string")return G(e);switch(e){case T:return G("Suspense");case f:return G("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case o:return rr(e.render);case R:return z(e.type,r,t);case c:{var n=e,l=n._payload,v=n._init;try{return z(v(l),r,t)}catch{}}}return""}var B=Object.prototype.hasOwnProperty,Se={},we=$.ReactDebugCurrentFrame;function H(e){if(e){var r=e._owner,t=z(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}function nr(e,r,t,n,l){{var v=Function.call.bind(B);for(var s in e)if(v(e,s)){var i=void 0;try{if(typeof e[s]!="function"){var O=Error((n||"React class")+": "+t+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}i=e[s](r,s,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){i=E}i&&!(i instanceof Error)&&(H(l),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %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).",n||"React class",t,s,typeof i),H(null)),i instanceof Error&&!(i.message in Se)&&(Se[i.message]=!0,H(l),S("Failed %s type: %s",t,i.message),H(null))}}}var ar=Array.isArray;function ne(e){return ar(e)}function ir(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function or(e){try{return xe(e),!1}catch{return!0}}function xe(e){return""+e}function Te(e){if(or(e))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ir(e)),xe(e)}var Ce=$.ReactCurrentOwner,sr={key:!0,ref:!0,__self:!0,__source:!0},Oe,je;function ur(e){if(B.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function cr(e){if(B.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function lr(e,r){typeof e.ref=="string"&&Ce.current}function fr(e,r){{var t=function(){Oe||(Oe=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function dr(e,r){{var t=function(){je||(je=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var vr=function(e,r,t,n,l,v,s){var i={$$typeof:a,type:e,key:r,ref:t,props:s,_owner:v};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function pr(e,r,t,n,l){{var v,s={},i=null,O=null;t!==void 0&&(Te(t),i=""+t),cr(r)&&(Te(r.key),i=""+r.key),ur(r)&&(O=r.ref,lr(r,l));for(v in r)B.call(r,v)&&!sr.hasOwnProperty(v)&&(s[v]=r[v]);if(e&&e.defaultProps){var E=e.defaultProps;for(v in E)s[v]===void 0&&(s[v]=E[v])}if(i||O){var w=typeof e=="function"?e.displayName||e.name||"Unknown":e;i&&fr(s,w),O&&dr(s,w)}return vr(e,i,O,l,n,Ce.current,s)}}var ae=$.ReactCurrentOwner,Pe=$.ReactDebugCurrentFrame;function L(e){if(e){var r=e._owner,t=z(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var ie;ie=!1;function oe(e){return typeof e=="object"&&e!==null&&e.$$typeof===a}function ke(){{if(ae.current){var e=I(ae.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function gr(e){return""}var $e={};function yr(e){{var r=ke();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+t+">.")}return r}}function
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function De(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=yr(r);if($e[t])return;$e[t]=!0;var n="";e&&e._owner&&e._owner!==ae.current&&(n=" It was passed a child from "+I(e._owner.type)+"."),L(e),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),L(null)}}function Fe(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var n=e[t];oe(n)&&De(n,r)}else if(oe(e))e._store&&(e._store.validated=!0);else if(e){var l=A(e);if(typeof l=="function"&&l!==e.entries)for(var v=l.call(e),s;!(s=v.next()).done;)oe(s.value)&&De(s.value,r)}}}function mr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===o||r.$$typeof===R))t=r.propTypes;else return;if(t){var n=I(r);nr(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var l=I(r);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",l||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function hr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){L(e),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),L(null);break}}e.ref!==null&&(L(e),S("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}var Ie={};function Ae(e,r,t,n,l,v){{var s=He(e);if(!s){var i="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var O=gr();O?i+=O:i+=ke();var E;e===null?E="null":ne(e)?E="array":e!==void 0&&e.$$typeof===a?(E="<"+(I(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,i)}var w=pr(e,r,t,l,v);if(w==null)return w;if(s){var k=r.children;if(k!==void 0)if(n)if(ne(k)){for(var W=0;W<k.length;W++)Fe(k[W],e);Object.freeze&&Object.freeze(k)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fe(k,e)}if(B.call(r,"key")){var Y=I(e),j=Object.keys(r).filter(function(wr){return wr!=="key"}),se=j.length>0?"{key: someKey, "+j.join(": ..., ")+": ...}":"{key: someKey}";if(!Ie[Y+se]){var Sr=j.length>0?"{"+j.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,
|
|
31
|
-
translate(${
|
|
32
|
-
scale(${
|
|
33
|
-
`},
|
|
30
|
+
<%s key={someKey} {...props} />`,se,Y,Sr,Y),Ie[Y+se]=!0}}return e===u?hr(w):mr(w),w}}function br(e,r,t){return Ae(e,r,t,!0)}function Rr(e,r,t){return Ae(e,r,t,!1)}var Er=Rr,_r=br;U.Fragment=u,U.jsx=Er,U.jsxs=_r})()),U}var le;function Le(){return le||(le=1,process.env.NODE_ENV==="production"?X.exports=Me():X.exports=Ye()),X.exports}var D=Le();function We({children:y,strength:a=.3,speed:d=.25,scale:u=1,className:g=""}){const p=x.useRef(null),b=o=>{const T=p.current;if(!T)return;const f=T.getBoundingClientRect(),R=o.clientX-(f.left+f.width/2),c=o.clientY-(f.top+f.height/2);T.style.transform=`
|
|
31
|
+
translate(${R*a}px, ${c*a}px)
|
|
32
|
+
scale(${u})
|
|
33
|
+
`},m=()=>{const o=p.current;o&&(o.style.transform="translate(0, 0) scale(1)")};return D.jsx("div",{ref:p,className:g,onMouseMove:b,onMouseLeave:m,style:{display:"inline-block",transition:`transform ${d}s ease-out`,willChange:"transform"},children:y})}function Z(){const[y,a]=x.useState(!1);return x.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const d=window.matchMedia("(prefers-reduced-motion: reduce)");a(d.matches);const u=g=>a(g.matches);return d.addEventListener("change",u),()=>d.removeEventListener("change",u)},[]),y}function Ve({children:y,tilt:a=15,scale:d=1.03,glare:u=!0,perspective:g=1e3,className:p="",style:b}){const m=x.useRef(null),o=x.useRef(null),T=Z(),f=c=>{const C=m.current;if(!C||T)return;const h=C.getBoundingClientRect(),_=(c.clientX-h.left)/h.width,A=(c.clientY-h.top)/h.height,$=(_-.5)*2*a,S=(.5-A)*2*a;C.style.transition="transform 0.08s linear",C.style.transform=`perspective(${g}px) rotateX(${S}deg) rotateY(${$}deg) scale(${d})`;const F=o.current;F&&(F.style.opacity="1",F.style.background=`radial-gradient(circle at ${_*100}% ${A*100}%, rgba(255,255,255,0.35), transparent 55%)`)},R=()=>{const c=m.current;c&&(c.style.transition="transform 0.4s ease-out",c.style.transform=`perspective(${g}px) rotateX(0deg) rotateY(0deg) scale(1)`,o.current&&(o.current.style.opacity="0"))};return D.jsxs("div",{ref:m,className:p,onMouseMove:f,onMouseLeave:R,style:{position:"relative",transformStyle:"preserve-3d",willChange:"transform",...b},children:[y,u&&D.jsx("div",{ref:o,"aria-hidden":"true",style:{position:"absolute",inset:0,borderRadius:"inherit",pointerEvents:"none",opacity:0,transition:"opacity 0.3s ease-out"}})]})}const Ue={radial:{opacity:1,blurScale:1,gradient:"radial"},glow:{opacity:.9,blurScale:1.5,gradient:"radial"},soft:{opacity:.7,blurScale:2,gradient:"radial"},sharp:{opacity:1,blurScale:.3,gradient:"radial"},neon:{opacity:1,blurScale:1.2,gradient:"radial"}};function Ne({children:y,size:a=320,intensity:d=.85,color:u="#ffffff",blur:g=60,mode:p="radial",enabled:b=!0,className:m="",style:o}){const T=x.useRef(null),f=x.useRef(null),R=x.useRef(!1),c=Ue[p],C=x.useCallback((h,_)=>(a/2*c.blurScale,g*c.blurScale,p==="neon"?`radial-gradient(${a*c.blurScale}px circle at ${h}px ${_}px,
|
|
34
|
+
${u}33 0%,
|
|
35
|
+
${u}22 25%,
|
|
36
|
+
${u}11 50%,
|
|
37
|
+
transparent 75%)`:p==="sharp"?`radial-gradient(${a*.4}px circle at ${h}px ${_}px,
|
|
38
|
+
${u}dd 0%,
|
|
39
|
+
${u}99 30%,
|
|
40
|
+
transparent 100%)`:`radial-gradient(${a*c.blurScale}px circle at ${h}px ${_}px,
|
|
41
|
+
${u}${Math.round(d*255).toString(16).padStart(2,"0")} 0%,
|
|
42
|
+
${u}${Math.round(d*.5*255).toString(16).padStart(2,"0")} 40%,
|
|
43
|
+
transparent 100%)`),[a,d,u,g,p,c]);return x.useEffect(()=>{if(!b)return;const h=T.current,_=f.current;if(!h||!_)return;const A=F=>{const J=h.getBoundingClientRect(),Q=F.clientX-J.left,q=F.clientY-J.top;_.style.background=C(Q,q),_.style.opacity=String(c.opacity)},$=()=>{R.current=!0,_.style.transition="opacity 300ms ease",_.style.opacity=String(c.opacity)},S=()=>{R.current=!1,_.style.transition="opacity 600ms ease",_.style.opacity="0"};return h.addEventListener("mousemove",A),h.addEventListener("mouseenter",$),h.addEventListener("mouseleave",S),()=>{h.removeEventListener("mousemove",A),h.removeEventListener("mouseenter",$),h.removeEventListener("mouseleave",S)}},[b,C,c]),D.jsxs("div",{ref:T,className:`motioncss-spotlight ${m}`,style:{position:"relative",overflow:"hidden",...o},children:[y,D.jsx("div",{ref:f,"aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:10,filter:g>0?`blur(${g*.15}px)`:void 0,mixBlendMode:p==="neon"?"screen":"normal"}})]})}function fe({threshold:y=.2,rootMargin:a="0px",once:d=!0}={}){const u=x.useRef(null),[g,p]=x.useState(!1);return x.useEffect(()=>{const b=u.current;if(!b)return;if(typeof IntersectionObserver>"u"){p(!0);return}const m=new IntersectionObserver(([o])=>{o.isIntersecting?(p(!0),d&&m.disconnect()):d||p(!1)},{threshold:y,rootMargin:a});return m.observe(b),()=>m.disconnect()},[y,a,d]),{ref:u,inView:g}}function Be({children:y,stagger:a=70,duration:d=700,delay:u=0,once:g=!0,as:p="div",className:b="",style:m}){const{ref:o,inView:T}=fe({once:g}),f=Z(),R=p,c=y.split(/\s+/).filter(Boolean),C=T||f;return D.jsx(R,{ref:o,className:b,style:m,"aria-label":y,children:c.map((h,_)=>D.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",overflow:"hidden",verticalAlign:"top",paddingBottom:"0.15em",marginRight:"0.25em"},children:D.jsx("span",{style:{display:"inline-block",transform:C?"translateY(0)":"translateY(110%)",opacity:C?1:0,transition:f?"none":`transform ${d}ms cubic-bezier(0.22, 1, 0.36, 1) ${u+_*a}ms, opacity ${d}ms ease ${u+_*a}ms`},children:h})},_))})}function Xe(y,a){switch(y){case"fade-up":return`translateY(${a}px)`;case"fade-down":return`translateY(${-a}px)`;case"fade-left":return`translateX(${a}px)`;case"fade-right":return`translateX(${-a}px)`;case"zoom":return"scale(0.92)";default:return"none"}}function Je({children:y,animation:a="fade-up",duration:d=700,delay:u=0,distance:g=32,threshold:p=.2,once:b=!0,className:m="",style:o}){const{ref:T,inView:f}=fe({threshold:p,once:b}),R=Z(),c=f||R;return D.jsx("div",{ref:T,className:m,style:{opacity:c?1:0,transform:c?"none":Xe(a,g),transition:R?"none":`opacity ${d}ms ease ${u}ms, transform ${d}ms cubic-bezier(0.22, 1, 0.36, 1) ${u}ms`,willChange:"opacity, transform",...o},children:y})}function Ge({children:y,colors:a=["#6366f1","#ec4899","#f59e0b","#06b6d4"],angle:d=120,duration:u=12,className:g="",style:p}){const b=[...a,a[0]].join(", ");return D.jsx("div",{className:`mcss-gradient-flow ${g}`.trim(),style:{backgroundImage:`linear-gradient(${d}deg, ${b})`,animationDuration:`${u}s`,...p},children:y})}P.GradientFlow=Ge,P.Magnetic=We,P.RevealText=Be,P.ScrollReveal=Je,P.Spotlight=Ne,P.TiltCard=Ve,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "motioncss-ui",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Zero-dependency React motion components: Magnetic, TiltCard, Spotlight, ScrollReveal, GradientFlow.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/motioncss-ui.umd.
|
|
6
|
+
"main": "./dist/motioncss-ui.umd.cjs",
|
|
7
7
|
"module": "./dist/motioncss-ui.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
11
|
"import": "./dist/motioncss-ui.js",
|
|
11
|
-
"require": "./dist/motioncss-ui.umd.
|
|
12
|
+
"require": "./dist/motioncss-ui.umd.cjs"
|
|
12
13
|
}
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
@@ -28,6 +29,10 @@
|
|
|
28
29
|
"motion",
|
|
29
30
|
"hover",
|
|
30
31
|
"magnetic",
|
|
32
|
+
"tilt",
|
|
33
|
+
"spotlight",
|
|
34
|
+
"scroll-reveal",
|
|
35
|
+
"gradient",
|
|
31
36
|
"frontend"
|
|
32
37
|
],
|
|
33
38
|
"author": "Roshan Jadhav",
|
|
@@ -42,5 +47,8 @@
|
|
|
42
47
|
"@vitejs/plugin-react": "^4.5.2",
|
|
43
48
|
"typescript": "^5.8.3",
|
|
44
49
|
"vite": "^6.3.5"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"motioncss-ui": "^0.1.3"
|
|
45
53
|
}
|
|
46
54
|
}
|