@jojovms/react-tilt-card 0.0.1
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/README.md +23 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +35 -0
- package/dist/index.mjs +682 -0
- package/dist/index.umd.js +35 -0
- package/dist/tilt.d.ts +9 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @jojovms/react-tilt-card
|
|
2
|
+
|
|
3
|
+
React wrapper for the Tilt Card library.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
```bash
|
|
7
|
+
npm install @jojovms/react-tilt-card
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
```jsx
|
|
12
|
+
import { Tilt } from '@jojovms/react-tilt-card';
|
|
13
|
+
|
|
14
|
+
const MyCard = () => (
|
|
15
|
+
<Tilt
|
|
16
|
+
max={25}
|
|
17
|
+
glare={true}
|
|
18
|
+
style={{ width: 300, height: 200, background: 'blue' }}
|
|
19
|
+
>
|
|
20
|
+
<h1>Hover Me</h1>
|
|
21
|
+
</Tilt>
|
|
22
|
+
);
|
|
23
|
+
```
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react");var Q={exports:{}},I={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Oe;function cr(){if(Oe)return I;Oe=1;var y=L,o=Symbol.for("react.element"),E=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,m=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,O={key:!0,ref:!0,__self:!0,__source:!0};function _(T,d,w){var v,R={},C=null,k=null;w!==void 0&&(C=""+w),d.key!==void 0&&(C=""+d.key),d.ref!==void 0&&(k=d.ref);for(v in d)u.call(d,v)&&!O.hasOwnProperty(v)&&(R[v]=d[v]);if(T&&T.defaultProps)for(v in d=T.defaultProps,d)R[v]===void 0&&(R[v]=d[v]);return{$$typeof:o,type:T,key:C,ref:k,props:R,_owner:m.current}}return I.Fragment=E,I.jsx=_,I.jsxs=_,I}var Y={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var we;function fr(){return we||(we=1,process.env.NODE_ENV!=="production"&&function(){var y=L,o=Symbol.for("react.element"),E=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),T=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),W=Symbol.iterator,Se="@@iterator";function Pe(e){if(e===null||typeof e!="object")return null;var r=W&&e[W]||e[Se];return typeof r=="function"?r:null}var D=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];xe("error",e,t)}}function xe(e,r,t){{var n=D.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var l=t.map(function(i){return String(i)});l.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,l)}}var je=!1,ke=!1,De=!1,Fe=!1,Me=!1,ee;ee=Symbol.for("react.module.reference");function Ae(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===O||Me||e===m||e===w||e===v||Fe||e===k||je||ke||De||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===R||e.$$typeof===_||e.$$typeof===T||e.$$typeof===d||e.$$typeof===ee||e.getModuleId!==void 0))}function $e(e,r,t){var n=e.displayName;if(n)return n;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function re(e){return e.displayName||"Context"}function S(e){if(e==null)return null;if(typeof e.tag=="number"&&h("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 E:return"Portal";case O:return"Profiler";case m:return"StrictMode";case w:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case T:var r=e;return re(r)+".Consumer";case _:var t=e;return re(t._context)+".Provider";case d:return $e(e,e.render,"ForwardRef");case R:var n=e.displayName||null;return n!==null?n:S(e.type)||"Memo";case C:{var s=e,l=s._payload,i=s._init;try{return S(i(l))}catch{return null}}}return null}var P=Object.assign,A=0,te,ne,ae,ie,oe,se,le;function ue(){}ue.__reactDisabledLog=!0;function Ie(){{if(A===0){te=console.log,ne=console.info,ae=console.warn,ie=console.error,oe=console.group,se=console.groupCollapsed,le=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ue,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}A++}}function Ye(){{if(A--,A===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:te}),info:P({},e,{value:ne}),warn:P({},e,{value:ae}),error:P({},e,{value:ie}),group:P({},e,{value:oe}),groupCollapsed:P({},e,{value:se}),groupEnd:P({},e,{value:le})})}A<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var B=D.ReactCurrentDispatcher,J;function V(e,r,t){{if(J===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);J=n&&n[1]||""}return`
|
|
18
|
+
`+J+e}}var X=!1,U;{var Le=typeof WeakMap=="function"?WeakMap:Map;U=new Le}function ce(e,r){if(!e||X)return"";{var t=U.get(e);if(t!==void 0)return t}var n;X=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var l;l=B.current,B.current=null,Ie();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(g){n=g}Reflect.construct(e,[],i)}else{try{i.call()}catch(g){n=g}e.call(i.prototype)}}else{try{throw Error()}catch(g){n=g}e()}}catch(g){if(g&&n&&typeof g.stack=="string"){for(var a=g.stack.split(`
|
|
19
|
+
`),p=n.stack.split(`
|
|
20
|
+
`),c=a.length-1,f=p.length-1;c>=1&&f>=0&&a[c]!==p[f];)f--;for(;c>=1&&f>=0;c--,f--)if(a[c]!==p[f]){if(c!==1||f!==1)do if(c--,f--,f<0||a[c]!==p[f]){var b=`
|
|
21
|
+
`+a[c].replace(" at new "," at ");return e.displayName&&b.includes("<anonymous>")&&(b=b.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,b),b}while(c>=1&&f>=0);break}}}finally{X=!1,B.current=l,Ye(),Error.prepareStackTrace=s}var M=e?e.displayName||e.name:"",x=M?V(M):"";return typeof e=="function"&&U.set(e,x),x}function We(e,r,t){return ce(e,!1)}function Ve(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function N(e,r,t){if(e==null)return"";if(typeof e=="function")return ce(e,Ve(e));if(typeof e=="string")return V(e);switch(e){case w:return V("Suspense");case v:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return We(e.render);case R:return N(e.type,r,t);case C:{var n=e,s=n._payload,l=n._init;try{return N(l(s),r,t)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,fe={},de=D.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);de.setExtraStackFrame(t)}else de.setExtraStackFrame(null)}function Ue(e,r,t,n,s){{var l=Function.call.bind($);for(var i in e)if(l(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var p=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){a=c}a&&!(a instanceof Error)&&(q(s),h("%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,i,typeof a),q(null)),a instanceof Error&&!(a.message in fe)&&(fe[a.message]=!0,q(s),h("Failed %s type: %s",t,a.message),q(null))}}}var Ne=Array.isArray;function G(e){return Ne(e)}function qe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Be(e){try{return ve(e),!1}catch{return!0}}function ve(e){return""+e}function he(e){if(Be(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qe(e)),ve(e)}var pe=D.ReactCurrentOwner,Je={key:!0,ref:!0,__self:!0,__source:!0},me,ge;function Xe(e){if($.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ge(e){if($.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ke(e,r){typeof e.ref=="string"&&pe.current}function ze(e,r){{var t=function(){me||(me=!0,h("%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 He(e,r){{var t=function(){ge||(ge=!0,h("%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 Ze=function(e,r,t,n,s,l,i){var a={$$typeof:o,type:e,key:r,ref:t,props:i,_owner:l};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function Qe(e,r,t,n,s){{var l,i={},a=null,p=null;t!==void 0&&(he(t),a=""+t),Ge(r)&&(he(r.key),a=""+r.key),Xe(r)&&(p=r.ref,Ke(r,s));for(l in r)$.call(r,l)&&!Je.hasOwnProperty(l)&&(i[l]=r[l]);if(e&&e.defaultProps){var c=e.defaultProps;for(l in c)i[l]===void 0&&(i[l]=c[l])}if(a||p){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ze(i,f),p&&He(i,f)}return Ze(e,a,p,s,n,pe.current,i)}}var K=D.ReactCurrentOwner,ye=D.ReactDebugCurrentFrame;function F(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}var z;z=!1;function H(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function Ee(){{if(K.current){var e=S(K.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function er(e){return""}var be={};function rr(e){{var r=Ee();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function Re(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=rr(r);if(be[t])return;be[t]=!0;var n="";e&&e._owner&&e._owner!==K.current&&(n=" It was passed a child from "+S(e._owner.type)+"."),F(e),h('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),F(null)}}function _e(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];H(n)&&Re(n,r)}else if(H(e))e._store&&(e._store.validated=!0);else if(e){var s=Pe(e);if(typeof s=="function"&&s!==e.entries)for(var l=s.call(e),i;!(i=l.next()).done;)H(i.value)&&Re(i.value,r)}}}function tr(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===d||r.$$typeof===R))t=r.propTypes;else return;if(t){var n=S(r);Ue(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!z){z=!0;var s=S(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function nr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){F(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),F(null);break}}e.ref!==null&&(F(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),F(null))}}var Te={};function Ce(e,r,t,n,s,l){{var i=Ae(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 p=er();p?a+=p:a+=Ee();var c;e===null?c="null":G(e)?c="array":e!==void 0&&e.$$typeof===o?(c="<"+(S(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):c=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,a)}var f=Qe(e,r,t,s,l);if(f==null)return f;if(i){var b=r.children;if(b!==void 0)if(n)if(G(b)){for(var M=0;M<b.length;M++)_e(b[M],e);Object.freeze&&Object.freeze(b)}else h("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 _e(b,e)}if($.call(r,"key")){var x=S(e),g=Object.keys(r).filter(function(ur){return ur!=="key"}),Z=g.length>0?"{key: someKey, "+g.join(": ..., ")+": ...}":"{key: someKey}";if(!Te[x+Z]){var lr=g.length>0?"{"+g.join(": ..., ")+": ...}":"{}";h(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,Z,x,lr,x),Te[x+Z]=!0}}return e===u?nr(f):tr(f),f}}function ar(e,r,t){return Ce(e,r,t,!0)}function ir(e,r,t){return Ce(e,r,t,!1)}var or=ir,sr=ar;Y.Fragment=u,Y.jsx=or,Y.jsxs=sr}()),Y}process.env.NODE_ENV==="production"?Q.exports=cr():Q.exports=fr();var dr=Q.exports,vr=Object.defineProperty,hr=(y,o,E)=>o in y?vr(y,o,{enumerable:!0,configurable:!0,writable:!0,value:E}):y[o]=E,j=(y,o,E)=>hr(y,typeof o!="symbol"?o+"":o,E);class pr{constructor(o,E={}){j(this,"element"),j(this,"options"),j(this,"glareElement",null),j(this,"bounds",null),j(this,"onMouseEnter",()=>{var u;this.bounds=this.element.getBoundingClientRect(),this.element.style.transition="none",(u=this.glareElement)!=null&&u.firstChild&&(this.glareElement.firstChild.style.transition="opacity 100ms")}),j(this,"onMouseMove",u=>{var m;if(!this.bounds)return;const O=u.clientX-this.bounds.left,_=u.clientY-this.bounds.top,T=O/this.bounds.width,d=_/this.bounds.height,w=this.options.max||15,v=(.5-d)*w*2,R=(T-.5)*w*2;if(this.element.style.transform=`
|
|
31
|
+
perspective(${this.options.perspective}px)
|
|
32
|
+
rotateX(${v}deg)
|
|
33
|
+
rotateY(${R}deg)
|
|
34
|
+
scale3d(${this.options.scale}, ${this.options.scale}, ${this.options.scale})
|
|
35
|
+
`,this.options.glare&&(m=this.glareElement)!=null&&m.firstChild){const C=this.glareElement.firstChild,k=Math.atan2(u.clientX-(this.bounds.left+this.bounds.width/2),-(u.clientY-(this.bounds.top+this.bounds.height/2)))*(180/Math.PI),W=Math.sqrt(Math.pow(T-.5,2)+Math.pow(d-.5,2))*2;C.style.transform=`translate(-50%, -50%) rotate(${k}deg)`,C.style.opacity=(W*(this.options.glareMaxOpacity||.5)).toString()}}),j(this,"onMouseLeave",()=>{var u;if(this.element.style.transition="transform 300ms ease-out",this.element.style.transform=`perspective(${this.options.perspective}px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)`,this.options.glare&&(u=this.glareElement)!=null&&u.firstChild){const m=this.glareElement.firstChild;m.style.opacity="0",m.style.transition="opacity 300ms"}}),this.element=typeof o=="string"?document.querySelector(o):o,this.options={max:15,perspective:1e3,scale:1.05,glare:!1,glareMaxOpacity:.5,...E},this.element&&this.init()}init(){this.element.style.transformStyle="preserve-3d",this.element.style.transform=`perspective(${this.options.perspective}px)`,this.options.glare&&this.addGlare(),this.element.addEventListener("mouseenter",this.onMouseEnter),this.element.addEventListener("mousemove",this.onMouseMove),this.element.addEventListener("mouseleave",this.onMouseLeave)}addGlare(){this.glareElement=document.createElement("div"),this.glareElement.style.position="absolute",this.glareElement.style.top="0",this.glareElement.style.left="0",this.glareElement.style.width="100%",this.glareElement.style.height="100%",this.glareElement.style.overflow="hidden",this.glareElement.style.pointerEvents="none",this.glareElement.style.borderRadius=getComputedStyle(this.element).borderRadius;const o=document.createElement("div");o.style.position="absolute",o.style.top="50%",o.style.left="50%",o.style.pointerEvents="none",o.style.backgroundImage="linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)",o.style.width="200%",o.style.height="200%",o.style.transform="translate(-50%, -50%) rotate(0deg)",o.style.opacity="0",o.style.transition="opacity 300ms",this.glareElement.appendChild(o),this.element.appendChild(this.glareElement)}destroy(){this.element.removeEventListener("mouseenter",this.onMouseEnter),this.element.removeEventListener("mousemove",this.onMouseMove),this.element.removeEventListener("mouseleave",this.onMouseLeave),this.glareElement&&this.glareElement.remove()}}const mr=({children:y,className:o,style:E,...u})=>{const m=L.useRef(null),O=L.useRef(null);return L.useEffect(()=>(m.current&&(O.current=new pr(m.current,u)),()=>{var _;(_=O.current)==null||_.destroy()}),[u.max,u.scale,u.glare,u.perspective]),dr.jsx("div",{ref:m,className:o,style:{display:"inline-block",...E},children:y})};exports.Tilt=mr;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,682 @@
|
|
|
1
|
+
import Se, { useRef as Ce, useEffect as fr } from "react";
|
|
2
|
+
var Z = { exports: {} }, I = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.min.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var Oe;
|
|
13
|
+
function dr() {
|
|
14
|
+
if (Oe) return I;
|
|
15
|
+
Oe = 1;
|
|
16
|
+
var y = Se, o = Symbol.for("react.element"), E = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, m = y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, O = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function _(T, d, w) {
|
|
18
|
+
var v, R = {}, C = null, k = null;
|
|
19
|
+
w !== void 0 && (C = "" + w), d.key !== void 0 && (C = "" + d.key), d.ref !== void 0 && (k = d.ref);
|
|
20
|
+
for (v in d) u.call(d, v) && !O.hasOwnProperty(v) && (R[v] = d[v]);
|
|
21
|
+
if (T && T.defaultProps) for (v in d = T.defaultProps, d) R[v] === void 0 && (R[v] = d[v]);
|
|
22
|
+
return { $$typeof: o, type: T, key: C, ref: k, props: R, _owner: m.current };
|
|
23
|
+
}
|
|
24
|
+
return I.Fragment = E, I.jsx = _, I.jsxs = _, I;
|
|
25
|
+
}
|
|
26
|
+
var Y = {};
|
|
27
|
+
/**
|
|
28
|
+
* @license React
|
|
29
|
+
* react-jsx-runtime.development.js
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license found in the
|
|
34
|
+
* LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/
|
|
36
|
+
var we;
|
|
37
|
+
function vr() {
|
|
38
|
+
return we || (we = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
+
var y = Se, o = Symbol.for("react.element"), E = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), _ = Symbol.for("react.provider"), T = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), L = Symbol.iterator, Pe = "@@iterator";
|
|
40
|
+
function xe(e) {
|
|
41
|
+
if (e === null || typeof e != "object")
|
|
42
|
+
return null;
|
|
43
|
+
var r = L && e[L] || e[Pe];
|
|
44
|
+
return typeof r == "function" ? r : null;
|
|
45
|
+
}
|
|
46
|
+
var D = y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
|
+
function h(e) {
|
|
48
|
+
{
|
|
49
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
50
|
+
t[n - 1] = arguments[n];
|
|
51
|
+
je("error", e, t);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function je(e, r, t) {
|
|
55
|
+
{
|
|
56
|
+
var n = D.ReactDebugCurrentFrame, s = n.getStackAddendum();
|
|
57
|
+
s !== "" && (r += "%s", t = t.concat([s]));
|
|
58
|
+
var l = t.map(function(i) {
|
|
59
|
+
return String(i);
|
|
60
|
+
});
|
|
61
|
+
l.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, l);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
var ke = !1, De = !1, Fe = !1, Me = !1, Ae = !1, Q;
|
|
65
|
+
Q = Symbol.for("react.module.reference");
|
|
66
|
+
function $e(e) {
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === u || e === O || Ae || e === m || e === w || e === v || Me || e === k || ke || De || Fe || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === R || e.$$typeof === _ || e.$$typeof === T || e.$$typeof === d || // This needs to include all possible module reference object
|
|
68
|
+
// types supported by any Flight configuration anywhere since
|
|
69
|
+
// we don't know which Flight build this will end up being used
|
|
70
|
+
// with.
|
|
71
|
+
e.$$typeof === Q || e.getModuleId !== void 0));
|
|
72
|
+
}
|
|
73
|
+
function Ie(e, r, t) {
|
|
74
|
+
var n = e.displayName;
|
|
75
|
+
if (n)
|
|
76
|
+
return n;
|
|
77
|
+
var s = r.displayName || r.name || "";
|
|
78
|
+
return s !== "" ? t + "(" + s + ")" : t;
|
|
79
|
+
}
|
|
80
|
+
function ee(e) {
|
|
81
|
+
return e.displayName || "Context";
|
|
82
|
+
}
|
|
83
|
+
function S(e) {
|
|
84
|
+
if (e == null)
|
|
85
|
+
return null;
|
|
86
|
+
if (typeof e.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
87
|
+
return e.displayName || e.name || null;
|
|
88
|
+
if (typeof e == "string")
|
|
89
|
+
return e;
|
|
90
|
+
switch (e) {
|
|
91
|
+
case u:
|
|
92
|
+
return "Fragment";
|
|
93
|
+
case E:
|
|
94
|
+
return "Portal";
|
|
95
|
+
case O:
|
|
96
|
+
return "Profiler";
|
|
97
|
+
case m:
|
|
98
|
+
return "StrictMode";
|
|
99
|
+
case w:
|
|
100
|
+
return "Suspense";
|
|
101
|
+
case v:
|
|
102
|
+
return "SuspenseList";
|
|
103
|
+
}
|
|
104
|
+
if (typeof e == "object")
|
|
105
|
+
switch (e.$$typeof) {
|
|
106
|
+
case T:
|
|
107
|
+
var r = e;
|
|
108
|
+
return ee(r) + ".Consumer";
|
|
109
|
+
case _:
|
|
110
|
+
var t = e;
|
|
111
|
+
return ee(t._context) + ".Provider";
|
|
112
|
+
case d:
|
|
113
|
+
return Ie(e, e.render, "ForwardRef");
|
|
114
|
+
case R:
|
|
115
|
+
var n = e.displayName || null;
|
|
116
|
+
return n !== null ? n : S(e.type) || "Memo";
|
|
117
|
+
case C: {
|
|
118
|
+
var s = e, l = s._payload, i = s._init;
|
|
119
|
+
try {
|
|
120
|
+
return S(i(l));
|
|
121
|
+
} catch {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
var P = Object.assign, A = 0, re, te, ne, ae, ie, oe, se;
|
|
129
|
+
function le() {
|
|
130
|
+
}
|
|
131
|
+
le.__reactDisabledLog = !0;
|
|
132
|
+
function Ye() {
|
|
133
|
+
{
|
|
134
|
+
if (A === 0) {
|
|
135
|
+
re = console.log, te = console.info, ne = console.warn, ae = console.error, ie = console.group, oe = console.groupCollapsed, se = console.groupEnd;
|
|
136
|
+
var e = {
|
|
137
|
+
configurable: !0,
|
|
138
|
+
enumerable: !0,
|
|
139
|
+
value: le,
|
|
140
|
+
writable: !0
|
|
141
|
+
};
|
|
142
|
+
Object.defineProperties(console, {
|
|
143
|
+
info: e,
|
|
144
|
+
log: e,
|
|
145
|
+
warn: e,
|
|
146
|
+
error: e,
|
|
147
|
+
group: e,
|
|
148
|
+
groupCollapsed: e,
|
|
149
|
+
groupEnd: e
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
A++;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function Le() {
|
|
156
|
+
{
|
|
157
|
+
if (A--, A === 0) {
|
|
158
|
+
var e = {
|
|
159
|
+
configurable: !0,
|
|
160
|
+
enumerable: !0,
|
|
161
|
+
writable: !0
|
|
162
|
+
};
|
|
163
|
+
Object.defineProperties(console, {
|
|
164
|
+
log: P({}, e, {
|
|
165
|
+
value: re
|
|
166
|
+
}),
|
|
167
|
+
info: P({}, e, {
|
|
168
|
+
value: te
|
|
169
|
+
}),
|
|
170
|
+
warn: P({}, e, {
|
|
171
|
+
value: ne
|
|
172
|
+
}),
|
|
173
|
+
error: P({}, e, {
|
|
174
|
+
value: ae
|
|
175
|
+
}),
|
|
176
|
+
group: P({}, e, {
|
|
177
|
+
value: ie
|
|
178
|
+
}),
|
|
179
|
+
groupCollapsed: P({}, e, {
|
|
180
|
+
value: oe
|
|
181
|
+
}),
|
|
182
|
+
groupEnd: P({}, e, {
|
|
183
|
+
value: se
|
|
184
|
+
})
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
A < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
var q = D.ReactCurrentDispatcher, B;
|
|
191
|
+
function W(e, r, t) {
|
|
192
|
+
{
|
|
193
|
+
if (B === void 0)
|
|
194
|
+
try {
|
|
195
|
+
throw Error();
|
|
196
|
+
} catch (s) {
|
|
197
|
+
var n = s.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
+
B = n && n[1] || "";
|
|
199
|
+
}
|
|
200
|
+
return `
|
|
201
|
+
` + B + e;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
var J = !1, V;
|
|
205
|
+
{
|
|
206
|
+
var We = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
V = new We();
|
|
208
|
+
}
|
|
209
|
+
function ue(e, r) {
|
|
210
|
+
if (!e || J)
|
|
211
|
+
return "";
|
|
212
|
+
{
|
|
213
|
+
var t = V.get(e);
|
|
214
|
+
if (t !== void 0)
|
|
215
|
+
return t;
|
|
216
|
+
}
|
|
217
|
+
var n;
|
|
218
|
+
J = !0;
|
|
219
|
+
var s = Error.prepareStackTrace;
|
|
220
|
+
Error.prepareStackTrace = void 0;
|
|
221
|
+
var l;
|
|
222
|
+
l = q.current, q.current = null, Ye();
|
|
223
|
+
try {
|
|
224
|
+
if (r) {
|
|
225
|
+
var i = function() {
|
|
226
|
+
throw Error();
|
|
227
|
+
};
|
|
228
|
+
if (Object.defineProperty(i.prototype, "props", {
|
|
229
|
+
set: function() {
|
|
230
|
+
throw Error();
|
|
231
|
+
}
|
|
232
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
|
+
try {
|
|
234
|
+
Reflect.construct(i, []);
|
|
235
|
+
} catch (g) {
|
|
236
|
+
n = g;
|
|
237
|
+
}
|
|
238
|
+
Reflect.construct(e, [], i);
|
|
239
|
+
} else {
|
|
240
|
+
try {
|
|
241
|
+
i.call();
|
|
242
|
+
} catch (g) {
|
|
243
|
+
n = g;
|
|
244
|
+
}
|
|
245
|
+
e.call(i.prototype);
|
|
246
|
+
}
|
|
247
|
+
} else {
|
|
248
|
+
try {
|
|
249
|
+
throw Error();
|
|
250
|
+
} catch (g) {
|
|
251
|
+
n = g;
|
|
252
|
+
}
|
|
253
|
+
e();
|
|
254
|
+
}
|
|
255
|
+
} catch (g) {
|
|
256
|
+
if (g && n && typeof g.stack == "string") {
|
|
257
|
+
for (var a = g.stack.split(`
|
|
258
|
+
`), p = n.stack.split(`
|
|
259
|
+
`), c = a.length - 1, f = p.length - 1; c >= 1 && f >= 0 && a[c] !== p[f]; )
|
|
260
|
+
f--;
|
|
261
|
+
for (; c >= 1 && f >= 0; c--, f--)
|
|
262
|
+
if (a[c] !== p[f]) {
|
|
263
|
+
if (c !== 1 || f !== 1)
|
|
264
|
+
do
|
|
265
|
+
if (c--, f--, f < 0 || a[c] !== p[f]) {
|
|
266
|
+
var b = `
|
|
267
|
+
` + a[c].replace(" at new ", " at ");
|
|
268
|
+
return e.displayName && b.includes("<anonymous>") && (b = b.replace("<anonymous>", e.displayName)), typeof e == "function" && V.set(e, b), b;
|
|
269
|
+
}
|
|
270
|
+
while (c >= 1 && f >= 0);
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
} finally {
|
|
275
|
+
J = !1, q.current = l, Le(), Error.prepareStackTrace = s;
|
|
276
|
+
}
|
|
277
|
+
var M = e ? e.displayName || e.name : "", x = M ? W(M) : "";
|
|
278
|
+
return typeof e == "function" && V.set(e, x), x;
|
|
279
|
+
}
|
|
280
|
+
function Ve(e, r, t) {
|
|
281
|
+
return ue(e, !1);
|
|
282
|
+
}
|
|
283
|
+
function Ue(e) {
|
|
284
|
+
var r = e.prototype;
|
|
285
|
+
return !!(r && r.isReactComponent);
|
|
286
|
+
}
|
|
287
|
+
function U(e, r, t) {
|
|
288
|
+
if (e == null)
|
|
289
|
+
return "";
|
|
290
|
+
if (typeof e == "function")
|
|
291
|
+
return ue(e, Ue(e));
|
|
292
|
+
if (typeof e == "string")
|
|
293
|
+
return W(e);
|
|
294
|
+
switch (e) {
|
|
295
|
+
case w:
|
|
296
|
+
return W("Suspense");
|
|
297
|
+
case v:
|
|
298
|
+
return W("SuspenseList");
|
|
299
|
+
}
|
|
300
|
+
if (typeof e == "object")
|
|
301
|
+
switch (e.$$typeof) {
|
|
302
|
+
case d:
|
|
303
|
+
return Ve(e.render);
|
|
304
|
+
case R:
|
|
305
|
+
return U(e.type, r, t);
|
|
306
|
+
case C: {
|
|
307
|
+
var n = e, s = n._payload, l = n._init;
|
|
308
|
+
try {
|
|
309
|
+
return U(l(s), r, t);
|
|
310
|
+
} catch {
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return "";
|
|
315
|
+
}
|
|
316
|
+
var $ = Object.prototype.hasOwnProperty, ce = {}, fe = D.ReactDebugCurrentFrame;
|
|
317
|
+
function N(e) {
|
|
318
|
+
if (e) {
|
|
319
|
+
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
|
320
|
+
fe.setExtraStackFrame(t);
|
|
321
|
+
} else
|
|
322
|
+
fe.setExtraStackFrame(null);
|
|
323
|
+
}
|
|
324
|
+
function Ne(e, r, t, n, s) {
|
|
325
|
+
{
|
|
326
|
+
var l = Function.call.bind($);
|
|
327
|
+
for (var i in e)
|
|
328
|
+
if (l(e, i)) {
|
|
329
|
+
var a = void 0;
|
|
330
|
+
try {
|
|
331
|
+
if (typeof e[i] != "function") {
|
|
332
|
+
var p = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw p.name = "Invariant Violation", p;
|
|
334
|
+
}
|
|
335
|
+
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
|
+
} catch (c) {
|
|
337
|
+
a = c;
|
|
338
|
+
}
|
|
339
|
+
a && !(a instanceof Error) && (N(s), h("%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, i, typeof a), N(null)), a instanceof Error && !(a.message in ce) && (ce[a.message] = !0, N(s), h("Failed %s type: %s", t, a.message), N(null));
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
var qe = Array.isArray;
|
|
344
|
+
function X(e) {
|
|
345
|
+
return qe(e);
|
|
346
|
+
}
|
|
347
|
+
function Be(e) {
|
|
348
|
+
{
|
|
349
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
350
|
+
return t;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function Je(e) {
|
|
354
|
+
try {
|
|
355
|
+
return de(e), !1;
|
|
356
|
+
} catch {
|
|
357
|
+
return !0;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function de(e) {
|
|
361
|
+
return "" + e;
|
|
362
|
+
}
|
|
363
|
+
function ve(e) {
|
|
364
|
+
if (Je(e))
|
|
365
|
+
return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Be(e)), de(e);
|
|
366
|
+
}
|
|
367
|
+
var he = D.ReactCurrentOwner, Xe = {
|
|
368
|
+
key: !0,
|
|
369
|
+
ref: !0,
|
|
370
|
+
__self: !0,
|
|
371
|
+
__source: !0
|
|
372
|
+
}, pe, me;
|
|
373
|
+
function Ge(e) {
|
|
374
|
+
if ($.call(e, "ref")) {
|
|
375
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
376
|
+
if (r && r.isReactWarning)
|
|
377
|
+
return !1;
|
|
378
|
+
}
|
|
379
|
+
return e.ref !== void 0;
|
|
380
|
+
}
|
|
381
|
+
function Ke(e) {
|
|
382
|
+
if ($.call(e, "key")) {
|
|
383
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
384
|
+
if (r && r.isReactWarning)
|
|
385
|
+
return !1;
|
|
386
|
+
}
|
|
387
|
+
return e.key !== void 0;
|
|
388
|
+
}
|
|
389
|
+
function ze(e, r) {
|
|
390
|
+
typeof e.ref == "string" && he.current;
|
|
391
|
+
}
|
|
392
|
+
function He(e, r) {
|
|
393
|
+
{
|
|
394
|
+
var t = function() {
|
|
395
|
+
pe || (pe = !0, h("%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));
|
|
396
|
+
};
|
|
397
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
398
|
+
get: t,
|
|
399
|
+
configurable: !0
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function Ze(e, r) {
|
|
404
|
+
{
|
|
405
|
+
var t = function() {
|
|
406
|
+
me || (me = !0, h("%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));
|
|
407
|
+
};
|
|
408
|
+
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
409
|
+
get: t,
|
|
410
|
+
configurable: !0
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
var Qe = function(e, r, t, n, s, l, i) {
|
|
415
|
+
var a = {
|
|
416
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
417
|
+
$$typeof: o,
|
|
418
|
+
// Built-in properties that belong on the element
|
|
419
|
+
type: e,
|
|
420
|
+
key: r,
|
|
421
|
+
ref: t,
|
|
422
|
+
props: i,
|
|
423
|
+
// Record the component responsible for creating this element.
|
|
424
|
+
_owner: l
|
|
425
|
+
};
|
|
426
|
+
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
427
|
+
configurable: !1,
|
|
428
|
+
enumerable: !1,
|
|
429
|
+
writable: !0,
|
|
430
|
+
value: !1
|
|
431
|
+
}), Object.defineProperty(a, "_self", {
|
|
432
|
+
configurable: !1,
|
|
433
|
+
enumerable: !1,
|
|
434
|
+
writable: !1,
|
|
435
|
+
value: n
|
|
436
|
+
}), Object.defineProperty(a, "_source", {
|
|
437
|
+
configurable: !1,
|
|
438
|
+
enumerable: !1,
|
|
439
|
+
writable: !1,
|
|
440
|
+
value: s
|
|
441
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
442
|
+
};
|
|
443
|
+
function er(e, r, t, n, s) {
|
|
444
|
+
{
|
|
445
|
+
var l, i = {}, a = null, p = null;
|
|
446
|
+
t !== void 0 && (ve(t), a = "" + t), Ke(r) && (ve(r.key), a = "" + r.key), Ge(r) && (p = r.ref, ze(r, s));
|
|
447
|
+
for (l in r)
|
|
448
|
+
$.call(r, l) && !Xe.hasOwnProperty(l) && (i[l] = r[l]);
|
|
449
|
+
if (e && e.defaultProps) {
|
|
450
|
+
var c = e.defaultProps;
|
|
451
|
+
for (l in c)
|
|
452
|
+
i[l] === void 0 && (i[l] = c[l]);
|
|
453
|
+
}
|
|
454
|
+
if (a || p) {
|
|
455
|
+
var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
456
|
+
a && He(i, f), p && Ze(i, f);
|
|
457
|
+
}
|
|
458
|
+
return Qe(e, a, p, s, n, he.current, i);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
var G = D.ReactCurrentOwner, ge = D.ReactDebugCurrentFrame;
|
|
462
|
+
function F(e) {
|
|
463
|
+
if (e) {
|
|
464
|
+
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
|
465
|
+
ge.setExtraStackFrame(t);
|
|
466
|
+
} else
|
|
467
|
+
ge.setExtraStackFrame(null);
|
|
468
|
+
}
|
|
469
|
+
var K;
|
|
470
|
+
K = !1;
|
|
471
|
+
function z(e) {
|
|
472
|
+
return typeof e == "object" && e !== null && e.$$typeof === o;
|
|
473
|
+
}
|
|
474
|
+
function ye() {
|
|
475
|
+
{
|
|
476
|
+
if (G.current) {
|
|
477
|
+
var e = S(G.current.type);
|
|
478
|
+
if (e)
|
|
479
|
+
return `
|
|
480
|
+
|
|
481
|
+
Check the render method of \`` + e + "`.";
|
|
482
|
+
}
|
|
483
|
+
return "";
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
function rr(e) {
|
|
487
|
+
return "";
|
|
488
|
+
}
|
|
489
|
+
var Ee = {};
|
|
490
|
+
function tr(e) {
|
|
491
|
+
{
|
|
492
|
+
var r = ye();
|
|
493
|
+
if (!r) {
|
|
494
|
+
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
495
|
+
t && (r = `
|
|
496
|
+
|
|
497
|
+
Check the top-level render call using <` + t + ">.");
|
|
498
|
+
}
|
|
499
|
+
return r;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
function be(e, r) {
|
|
503
|
+
{
|
|
504
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
505
|
+
return;
|
|
506
|
+
e._store.validated = !0;
|
|
507
|
+
var t = tr(r);
|
|
508
|
+
if (Ee[t])
|
|
509
|
+
return;
|
|
510
|
+
Ee[t] = !0;
|
|
511
|
+
var n = "";
|
|
512
|
+
e && e._owner && e._owner !== G.current && (n = " It was passed a child from " + S(e._owner.type) + "."), F(e), h('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), F(null);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
function Re(e, r) {
|
|
516
|
+
{
|
|
517
|
+
if (typeof e != "object")
|
|
518
|
+
return;
|
|
519
|
+
if (X(e))
|
|
520
|
+
for (var t = 0; t < e.length; t++) {
|
|
521
|
+
var n = e[t];
|
|
522
|
+
z(n) && be(n, r);
|
|
523
|
+
}
|
|
524
|
+
else if (z(e))
|
|
525
|
+
e._store && (e._store.validated = !0);
|
|
526
|
+
else if (e) {
|
|
527
|
+
var s = xe(e);
|
|
528
|
+
if (typeof s == "function" && s !== e.entries)
|
|
529
|
+
for (var l = s.call(e), i; !(i = l.next()).done; )
|
|
530
|
+
z(i.value) && be(i.value, r);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
function nr(e) {
|
|
535
|
+
{
|
|
536
|
+
var r = e.type;
|
|
537
|
+
if (r == null || typeof r == "string")
|
|
538
|
+
return;
|
|
539
|
+
var t;
|
|
540
|
+
if (typeof r == "function")
|
|
541
|
+
t = r.propTypes;
|
|
542
|
+
else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
|
|
543
|
+
// Inner props are checked in the reconciler.
|
|
544
|
+
r.$$typeof === R))
|
|
545
|
+
t = r.propTypes;
|
|
546
|
+
else
|
|
547
|
+
return;
|
|
548
|
+
if (t) {
|
|
549
|
+
var n = S(r);
|
|
550
|
+
Ne(t, e.props, "prop", n, e);
|
|
551
|
+
} else if (r.PropTypes !== void 0 && !K) {
|
|
552
|
+
K = !0;
|
|
553
|
+
var s = S(r);
|
|
554
|
+
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
|
|
555
|
+
}
|
|
556
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
function ar(e) {
|
|
560
|
+
{
|
|
561
|
+
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
562
|
+
var n = r[t];
|
|
563
|
+
if (n !== "children" && n !== "key") {
|
|
564
|
+
F(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), F(null);
|
|
565
|
+
break;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
e.ref !== null && (F(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
var _e = {};
|
|
572
|
+
function Te(e, r, t, n, s, l) {
|
|
573
|
+
{
|
|
574
|
+
var i = $e(e);
|
|
575
|
+
if (!i) {
|
|
576
|
+
var a = "";
|
|
577
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
578
|
+
var p = rr();
|
|
579
|
+
p ? a += p : a += ye();
|
|
580
|
+
var c;
|
|
581
|
+
e === null ? c = "null" : X(e) ? c = "array" : e !== void 0 && e.$$typeof === o ? (c = "<" + (S(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : c = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, a);
|
|
582
|
+
}
|
|
583
|
+
var f = er(e, r, t, s, l);
|
|
584
|
+
if (f == null)
|
|
585
|
+
return f;
|
|
586
|
+
if (i) {
|
|
587
|
+
var b = r.children;
|
|
588
|
+
if (b !== void 0)
|
|
589
|
+
if (n)
|
|
590
|
+
if (X(b)) {
|
|
591
|
+
for (var M = 0; M < b.length; M++)
|
|
592
|
+
Re(b[M], e);
|
|
593
|
+
Object.freeze && Object.freeze(b);
|
|
594
|
+
} else
|
|
595
|
+
h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
596
|
+
else
|
|
597
|
+
Re(b, e);
|
|
598
|
+
}
|
|
599
|
+
if ($.call(r, "key")) {
|
|
600
|
+
var x = S(e), g = Object.keys(r).filter(function(cr) {
|
|
601
|
+
return cr !== "key";
|
|
602
|
+
}), H = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
+
if (!_e[x + H]) {
|
|
604
|
+
var ur = g.length > 0 ? "{" + g.join(": ..., ") + ": ...}" : "{}";
|
|
605
|
+
h(`A props object containing a "key" prop is being spread into JSX:
|
|
606
|
+
let props = %s;
|
|
607
|
+
<%s {...props} />
|
|
608
|
+
React keys must be passed directly to JSX without using spread:
|
|
609
|
+
let props = %s;
|
|
610
|
+
<%s key={someKey} {...props} />`, H, x, ur, x), _e[x + H] = !0;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return e === u ? ar(f) : nr(f), f;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
function ir(e, r, t) {
|
|
617
|
+
return Te(e, r, t, !0);
|
|
618
|
+
}
|
|
619
|
+
function or(e, r, t) {
|
|
620
|
+
return Te(e, r, t, !1);
|
|
621
|
+
}
|
|
622
|
+
var sr = or, lr = ir;
|
|
623
|
+
Y.Fragment = u, Y.jsx = sr, Y.jsxs = lr;
|
|
624
|
+
}()), Y;
|
|
625
|
+
}
|
|
626
|
+
process.env.NODE_ENV === "production" ? Z.exports = dr() : Z.exports = vr();
|
|
627
|
+
var hr = Z.exports, pr = Object.defineProperty, mr = (y, o, E) => o in y ? pr(y, o, { enumerable: !0, configurable: !0, writable: !0, value: E }) : y[o] = E, j = (y, o, E) => mr(y, typeof o != "symbol" ? o + "" : o, E);
|
|
628
|
+
class gr {
|
|
629
|
+
constructor(o, E = {}) {
|
|
630
|
+
j(this, "element"), j(this, "options"), j(this, "glareElement", null), j(this, "bounds", null), j(this, "onMouseEnter", () => {
|
|
631
|
+
var u;
|
|
632
|
+
this.bounds = this.element.getBoundingClientRect(), this.element.style.transition = "none", (u = this.glareElement) != null && u.firstChild && (this.glareElement.firstChild.style.transition = "opacity 100ms");
|
|
633
|
+
}), j(this, "onMouseMove", (u) => {
|
|
634
|
+
var m;
|
|
635
|
+
if (!this.bounds) return;
|
|
636
|
+
const O = u.clientX - this.bounds.left, _ = u.clientY - this.bounds.top, T = O / this.bounds.width, d = _ / this.bounds.height, w = this.options.max || 15, v = (0.5 - d) * w * 2, R = (T - 0.5) * w * 2;
|
|
637
|
+
if (this.element.style.transform = `
|
|
638
|
+
perspective(${this.options.perspective}px)
|
|
639
|
+
rotateX(${v}deg)
|
|
640
|
+
rotateY(${R}deg)
|
|
641
|
+
scale3d(${this.options.scale}, ${this.options.scale}, ${this.options.scale})
|
|
642
|
+
`, this.options.glare && (m = this.glareElement) != null && m.firstChild) {
|
|
643
|
+
const C = this.glareElement.firstChild, k = Math.atan2(u.clientX - (this.bounds.left + this.bounds.width / 2), -(u.clientY - (this.bounds.top + this.bounds.height / 2))) * (180 / Math.PI), L = Math.sqrt(Math.pow(T - 0.5, 2) + Math.pow(d - 0.5, 2)) * 2;
|
|
644
|
+
C.style.transform = `translate(-50%, -50%) rotate(${k}deg)`, C.style.opacity = (L * (this.options.glareMaxOpacity || 0.5)).toString();
|
|
645
|
+
}
|
|
646
|
+
}), j(this, "onMouseLeave", () => {
|
|
647
|
+
var u;
|
|
648
|
+
if (this.element.style.transition = "transform 300ms ease-out", this.element.style.transform = `perspective(${this.options.perspective}px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)`, this.options.glare && (u = this.glareElement) != null && u.firstChild) {
|
|
649
|
+
const m = this.glareElement.firstChild;
|
|
650
|
+
m.style.opacity = "0", m.style.transition = "opacity 300ms";
|
|
651
|
+
}
|
|
652
|
+
}), this.element = typeof o == "string" ? document.querySelector(o) : o, this.options = {
|
|
653
|
+
max: 15,
|
|
654
|
+
perspective: 1e3,
|
|
655
|
+
scale: 1.05,
|
|
656
|
+
glare: !1,
|
|
657
|
+
glareMaxOpacity: 0.5,
|
|
658
|
+
...E
|
|
659
|
+
}, this.element && this.init();
|
|
660
|
+
}
|
|
661
|
+
init() {
|
|
662
|
+
this.element.style.transformStyle = "preserve-3d", this.element.style.transform = `perspective(${this.options.perspective}px)`, this.options.glare && this.addGlare(), this.element.addEventListener("mouseenter", this.onMouseEnter), this.element.addEventListener("mousemove", this.onMouseMove), this.element.addEventListener("mouseleave", this.onMouseLeave);
|
|
663
|
+
}
|
|
664
|
+
addGlare() {
|
|
665
|
+
this.glareElement = document.createElement("div"), this.glareElement.style.position = "absolute", this.glareElement.style.top = "0", this.glareElement.style.left = "0", this.glareElement.style.width = "100%", this.glareElement.style.height = "100%", this.glareElement.style.overflow = "hidden", this.glareElement.style.pointerEvents = "none", this.glareElement.style.borderRadius = getComputedStyle(this.element).borderRadius;
|
|
666
|
+
const o = document.createElement("div");
|
|
667
|
+
o.style.position = "absolute", o.style.top = "50%", o.style.left = "50%", o.style.pointerEvents = "none", o.style.backgroundImage = "linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)", o.style.width = "200%", o.style.height = "200%", o.style.transform = "translate(-50%, -50%) rotate(0deg)", o.style.opacity = "0", o.style.transition = "opacity 300ms", this.glareElement.appendChild(o), this.element.appendChild(this.glareElement);
|
|
668
|
+
}
|
|
669
|
+
destroy() {
|
|
670
|
+
this.element.removeEventListener("mouseenter", this.onMouseEnter), this.element.removeEventListener("mousemove", this.onMouseMove), this.element.removeEventListener("mouseleave", this.onMouseLeave), this.glareElement && this.glareElement.remove();
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
const Er = ({ children: y, className: o, style: E, ...u }) => {
|
|
674
|
+
const m = Ce(null), O = Ce(null);
|
|
675
|
+
return fr(() => (m.current && (O.current = new gr(m.current, u)), () => {
|
|
676
|
+
var _;
|
|
677
|
+
(_ = O.current) == null || _.destroy();
|
|
678
|
+
}), [u.max, u.scale, u.glare, u.perspective]), /* @__PURE__ */ hr.jsx("div", { ref: m, className: o, style: { display: "inline-block", ...E }, children: y });
|
|
679
|
+
};
|
|
680
|
+
export {
|
|
681
|
+
Er as Tilt
|
|
682
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
(function(x,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],O):(x=typeof globalThis<"u"?globalThis:x||self,O(x.ReactTiltCard={},x.React))})(this,function(x,O){"use strict";var X={exports:{}},Y={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var re;function Pe(){if(re)return Y;re=1;var y=O,o=Symbol.for("react.element"),E=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,m=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w={key:!0,ref:!0,__self:!0,__source:!0};function _(T,d,S){var v,R={},C=null,F=null;S!==void 0&&(C=""+S),d.key!==void 0&&(C=""+d.key),d.ref!==void 0&&(F=d.ref);for(v in d)u.call(d,v)&&!w.hasOwnProperty(v)&&(R[v]=d[v]);if(T&&T.defaultProps)for(v in d=T.defaultProps,d)R[v]===void 0&&(R[v]=d[v]);return{$$typeof:o,type:T,key:C,ref:F,props:R,_owner:m.current}}return Y.Fragment=E,Y.jsx=_,Y.jsxs=_,Y}var L={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var te;function xe(){return te||(te=1,process.env.NODE_ENV!=="production"&&function(){var y=O,o=Symbol.for("react.element"),E=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),T=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),F=Symbol.for("react.offscreen"),V=Symbol.iterator,Ae="@@iterator";function Ie(e){if(e===null||typeof e!="object")return null;var r=V&&e[V]||e[Ae];return typeof r=="function"?r:null}var M=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ye("error",e,t)}}function Ye(e,r,t){{var n=M.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var l=t.map(function(i){return String(i)});l.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,l)}}var Le=!1,$e=!1,We=!1,Ve=!1,Ue=!1,ne;ne=Symbol.for("react.module.reference");function Ne(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===w||Ue||e===m||e===S||e===v||Ve||e===F||Le||$e||We||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===R||e.$$typeof===_||e.$$typeof===T||e.$$typeof===d||e.$$typeof===ne||e.getModuleId!==void 0))}function Be(e,r,t){var n=e.displayName;if(n)return n;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function ae(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&h("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 E:return"Portal";case w:return"Profiler";case m:return"StrictMode";case S:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case T:var r=e;return ae(r)+".Consumer";case _:var t=e;return ae(t._context)+".Provider";case d:return Be(e,e.render,"ForwardRef");case R:var n=e.displayName||null;return n!==null?n:P(e.type)||"Memo";case C:{var s=e,l=s._payload,i=s._init;try{return P(i(l))}catch{return null}}}return null}var k=Object.assign,$=0,ie,oe,se,le,ue,fe,ce;function de(){}de.__reactDisabledLog=!0;function Je(){{if($===0){ie=console.log,oe=console.info,se=console.warn,le=console.error,ue=console.group,fe=console.groupCollapsed,ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:de,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}$++}}function Xe(){{if($--,$===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:ie}),info:k({},e,{value:oe}),warn:k({},e,{value:se}),error:k({},e,{value:le}),group:k({},e,{value:ue}),groupCollapsed:k({},e,{value:fe}),groupEnd:k({},e,{value:ce})})}$<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var G=M.ReactCurrentDispatcher,K;function U(e,r,t){{if(K===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);K=n&&n[1]||""}return`
|
|
18
|
+
`+K+e}}var q=!1,N;{var Ge=typeof WeakMap=="function"?WeakMap:Map;N=new Ge}function ve(e,r){if(!e||q)return"";{var t=N.get(e);if(t!==void 0)return t}var n;q=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var l;l=G.current,G.current=null,Je();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(g){n=g}Reflect.construct(e,[],i)}else{try{i.call()}catch(g){n=g}e.call(i.prototype)}}else{try{throw Error()}catch(g){n=g}e()}}catch(g){if(g&&n&&typeof g.stack=="string"){for(var a=g.stack.split(`
|
|
19
|
+
`),p=n.stack.split(`
|
|
20
|
+
`),f=a.length-1,c=p.length-1;f>=1&&c>=0&&a[f]!==p[c];)c--;for(;f>=1&&c>=0;f--,c--)if(a[f]!==p[c]){if(f!==1||c!==1)do if(f--,c--,c<0||a[f]!==p[c]){var b=`
|
|
21
|
+
`+a[f].replace(" at new "," at ");return e.displayName&&b.includes("<anonymous>")&&(b=b.replace("<anonymous>",e.displayName)),typeof e=="function"&&N.set(e,b),b}while(f>=1&&c>=0);break}}}finally{q=!1,G.current=l,Xe(),Error.prepareStackTrace=s}var I=e?e.displayName||e.name:"",D=I?U(I):"";return typeof e=="function"&&N.set(e,D),D}function Ke(e,r,t){return ve(e,!1)}function qe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function B(e,r,t){if(e==null)return"";if(typeof e=="function")return ve(e,qe(e));if(typeof e=="string")return U(e);switch(e){case S:return U("Suspense");case v:return U("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Ke(e.render);case R:return B(e.type,r,t);case C:{var n=e,s=n._payload,l=n._init;try{return B(l(s),r,t)}catch{}}}return""}var W=Object.prototype.hasOwnProperty,he={},pe=M.ReactDebugCurrentFrame;function J(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);pe.setExtraStackFrame(t)}else pe.setExtraStackFrame(null)}function ze(e,r,t,n,s){{var l=Function.call.bind(W);for(var i in e)if(l(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var p=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(f){a=f}a&&!(a instanceof Error)&&(J(s),h("%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,i,typeof a),J(null)),a instanceof Error&&!(a.message in he)&&(he[a.message]=!0,J(s),h("Failed %s type: %s",t,a.message),J(null))}}}var He=Array.isArray;function z(e){return He(e)}function Ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Qe(e){try{return me(e),!1}catch{return!0}}function me(e){return""+e}function ge(e){if(Qe(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ze(e)),me(e)}var ye=M.ReactCurrentOwner,er={key:!0,ref:!0,__self:!0,__source:!0},Ee,be;function rr(e){if(W.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function tr(e){if(W.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function nr(e,r){typeof e.ref=="string"&&ye.current}function ar(e,r){{var t=function(){Ee||(Ee=!0,h("%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 ir(e,r){{var t=function(){be||(be=!0,h("%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 or=function(e,r,t,n,s,l,i){var a={$$typeof:o,type:e,key:r,ref:t,props:i,_owner:l};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function sr(e,r,t,n,s){{var l,i={},a=null,p=null;t!==void 0&&(ge(t),a=""+t),tr(r)&&(ge(r.key),a=""+r.key),rr(r)&&(p=r.ref,nr(r,s));for(l in r)W.call(r,l)&&!er.hasOwnProperty(l)&&(i[l]=r[l]);if(e&&e.defaultProps){var f=e.defaultProps;for(l in f)i[l]===void 0&&(i[l]=f[l])}if(a||p){var c=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ar(i,c),p&&ir(i,c)}return or(e,a,p,s,n,ye.current,i)}}var H=M.ReactCurrentOwner,Re=M.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);Re.setExtraStackFrame(t)}else Re.setExtraStackFrame(null)}var Z;Z=!1;function Q(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function _e(){{if(H.current){var e=P(H.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function lr(e){return""}var Te={};function ur(e){{var r=_e();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function Ce(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ur(r);if(Te[t])return;Te[t]=!0;var n="";e&&e._owner&&e._owner!==H.current&&(n=" It was passed a child from "+P(e._owner.type)+"."),A(e),h('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),A(null)}}function Oe(e,r){{if(typeof e!="object")return;if(z(e))for(var t=0;t<e.length;t++){var n=e[t];Q(n)&&Ce(n,r)}else if(Q(e))e._store&&(e._store.validated=!0);else if(e){var s=Ie(e);if(typeof s=="function"&&s!==e.entries)for(var l=s.call(e),i;!(i=l.next()).done;)Q(i.value)&&Ce(i.value,r)}}}function fr(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===d||r.$$typeof===R))t=r.propTypes;else return;if(t){var n=P(r);ze(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Z){Z=!0;var s=P(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function cr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var we={};function Se(e,r,t,n,s,l){{var i=Ne(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 p=lr();p?a+=p:a+=_e();var f;e===null?f="null":z(e)?f="array":e!==void 0&&e.$$typeof===o?(f="<"+(P(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):f=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",f,a)}var c=sr(e,r,t,s,l);if(c==null)return c;if(i){var b=r.children;if(b!==void 0)if(n)if(z(b)){for(var I=0;I<b.length;I++)Oe(b[I],e);Object.freeze&&Object.freeze(b)}else h("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 Oe(b,e)}if(W.call(r,"key")){var D=P(e),g=Object.keys(r).filter(function(gr){return gr!=="key"}),ee=g.length>0?"{key: someKey, "+g.join(": ..., ")+": ...}":"{key: someKey}";if(!we[D+ee]){var mr=g.length>0?"{"+g.join(": ..., ")+": ...}":"{}";h(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,ee,D,mr,D),we[D+ee]=!0}}return e===u?cr(c):fr(c),c}}function dr(e,r,t){return Se(e,r,t,!0)}function vr(e,r,t){return Se(e,r,t,!1)}var hr=vr,pr=dr;L.Fragment=u,L.jsx=hr,L.jsxs=pr}()),L}process.env.NODE_ENV==="production"?X.exports=Pe():X.exports=xe();var je=X.exports,ke=Object.defineProperty,De=(y,o,E)=>o in y?ke(y,o,{enumerable:!0,configurable:!0,writable:!0,value:E}):y[o]=E,j=(y,o,E)=>De(y,typeof o!="symbol"?o+"":o,E);class Fe{constructor(o,E={}){j(this,"element"),j(this,"options"),j(this,"glareElement",null),j(this,"bounds",null),j(this,"onMouseEnter",()=>{var u;this.bounds=this.element.getBoundingClientRect(),this.element.style.transition="none",(u=this.glareElement)!=null&&u.firstChild&&(this.glareElement.firstChild.style.transition="opacity 100ms")}),j(this,"onMouseMove",u=>{var m;if(!this.bounds)return;const w=u.clientX-this.bounds.left,_=u.clientY-this.bounds.top,T=w/this.bounds.width,d=_/this.bounds.height,S=this.options.max||15,v=(.5-d)*S*2,R=(T-.5)*S*2;if(this.element.style.transform=`
|
|
31
|
+
perspective(${this.options.perspective}px)
|
|
32
|
+
rotateX(${v}deg)
|
|
33
|
+
rotateY(${R}deg)
|
|
34
|
+
scale3d(${this.options.scale}, ${this.options.scale}, ${this.options.scale})
|
|
35
|
+
`,this.options.glare&&(m=this.glareElement)!=null&&m.firstChild){const C=this.glareElement.firstChild,F=Math.atan2(u.clientX-(this.bounds.left+this.bounds.width/2),-(u.clientY-(this.bounds.top+this.bounds.height/2)))*(180/Math.PI),V=Math.sqrt(Math.pow(T-.5,2)+Math.pow(d-.5,2))*2;C.style.transform=`translate(-50%, -50%) rotate(${F}deg)`,C.style.opacity=(V*(this.options.glareMaxOpacity||.5)).toString()}}),j(this,"onMouseLeave",()=>{var u;if(this.element.style.transition="transform 300ms ease-out",this.element.style.transform=`perspective(${this.options.perspective}px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)`,this.options.glare&&(u=this.glareElement)!=null&&u.firstChild){const m=this.glareElement.firstChild;m.style.opacity="0",m.style.transition="opacity 300ms"}}),this.element=typeof o=="string"?document.querySelector(o):o,this.options={max:15,perspective:1e3,scale:1.05,glare:!1,glareMaxOpacity:.5,...E},this.element&&this.init()}init(){this.element.style.transformStyle="preserve-3d",this.element.style.transform=`perspective(${this.options.perspective}px)`,this.options.glare&&this.addGlare(),this.element.addEventListener("mouseenter",this.onMouseEnter),this.element.addEventListener("mousemove",this.onMouseMove),this.element.addEventListener("mouseleave",this.onMouseLeave)}addGlare(){this.glareElement=document.createElement("div"),this.glareElement.style.position="absolute",this.glareElement.style.top="0",this.glareElement.style.left="0",this.glareElement.style.width="100%",this.glareElement.style.height="100%",this.glareElement.style.overflow="hidden",this.glareElement.style.pointerEvents="none",this.glareElement.style.borderRadius=getComputedStyle(this.element).borderRadius;const o=document.createElement("div");o.style.position="absolute",o.style.top="50%",o.style.left="50%",o.style.pointerEvents="none",o.style.backgroundImage="linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)",o.style.width="200%",o.style.height="200%",o.style.transform="translate(-50%, -50%) rotate(0deg)",o.style.opacity="0",o.style.transition="opacity 300ms",this.glareElement.appendChild(o),this.element.appendChild(this.glareElement)}destroy(){this.element.removeEventListener("mouseenter",this.onMouseEnter),this.element.removeEventListener("mousemove",this.onMouseMove),this.element.removeEventListener("mouseleave",this.onMouseLeave),this.glareElement&&this.glareElement.remove()}}const Me=({children:y,className:o,style:E,...u})=>{const m=O.useRef(null),w=O.useRef(null);return O.useEffect(()=>(m.current&&(w.current=new Fe(m.current,u)),()=>{var _;(_=w.current)==null||_.destroy()}),[u.max,u.scale,u.glare,u.perspective]),je.jsx("div",{ref:m,className:o,style:{display:"inline-block",...E},children:y})};x.Tilt=Me,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
package/dist/tilt.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TiltOptions } from '@jojovms/tilt-card-core';
|
|
3
|
+
|
|
4
|
+
export interface TiltProps extends TiltOptions {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
export declare const Tilt: React.FC<TiltProps>;
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jojovms/react-tilt-card",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Tiltō: A premium 3D tilt interaction effect for your cards (React wrapper).",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"tilto",
|
|
7
|
+
"tilt-card",
|
|
8
|
+
"react",
|
|
9
|
+
"3d",
|
|
10
|
+
"hover",
|
|
11
|
+
"ui",
|
|
12
|
+
"framework",
|
|
13
|
+
"jojovms"
|
|
14
|
+
],
|
|
15
|
+
"author": "Shijo Shaji (https://shijoshaji.in)",
|
|
16
|
+
"homepage": "https://shijoshaji.in",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/shijoshaji/tilt-card.git",
|
|
20
|
+
"directory": "react"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/shijoshaji/tilt-card/issues"
|
|
24
|
+
},
|
|
25
|
+
"main": "dist/index.js",
|
|
26
|
+
"module": "dist/index.mjs",
|
|
27
|
+
"types": "dist/index.d.ts",
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": ">=16.8.0",
|
|
30
|
+
"react-dom": ">=16.8.0"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@jojovms/tilt-card-core": "*"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "vite build"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"react": "^18.2.0",
|
|
43
|
+
"react-dom": "^18.2.0",
|
|
44
|
+
"typescript": "^5.3.3",
|
|
45
|
+
"vite": "^5.0.10",
|
|
46
|
+
"vite-plugin-dts": "^3.6.4"
|
|
47
|
+
}
|
|
48
|
+
}
|