motioncss-ui 0.0.0-stage → 0.1.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 +51 -2
- package/dist/motioncss-ui.js +668 -0
- package/dist/motioncss-ui.umd.cjs +33 -0
- package/package.json +44 -4
package/README.md
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
-
#
|
|
1
|
+
# motioncss-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Modern React motion and CSS effects.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install motioncss-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Magnetic
|
|
12
|
+
|
|
13
|
+
A lightweight magnetic hover effect for React elements.
|
|
14
|
+
|
|
15
|
+
### Usage
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { Magnetic } from "motioncss-ui";
|
|
19
|
+
|
|
20
|
+
function App() {
|
|
21
|
+
return (
|
|
22
|
+
<Magnetic>
|
|
23
|
+
<button>Hover Me →</button>
|
|
24
|
+
</Magnetic>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Options
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
<Magnetic
|
|
33
|
+
strength={0.4}
|
|
34
|
+
speed={0.2}
|
|
35
|
+
scale={1.05}
|
|
36
|
+
>
|
|
37
|
+
<button>Get Started</button>
|
|
38
|
+
</Magnetic>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Props
|
|
42
|
+
|
|
43
|
+
| Prop | Type | Default | Description |
|
|
44
|
+
| ----------- | ------ | ------: | -------------------------- |
|
|
45
|
+
| `strength` | number | `0.3` | Magnetic movement strength |
|
|
46
|
+
| `speed` | number | `0.25` | Animation transition speed |
|
|
47
|
+
| `scale` | number | `1` | Hover scale |
|
|
48
|
+
| `className` | string | `""` | Custom CSS class |
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|
|
@@ -0,0 +1,668 @@
|
|
|
1
|
+
import Se, { useRef as fr } from "react";
|
|
2
|
+
var U = { exports: {} }, $ = {};
|
|
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 Te;
|
|
13
|
+
function cr() {
|
|
14
|
+
if (Te) return $;
|
|
15
|
+
Te = 1;
|
|
16
|
+
var k = Se, b = Symbol.for("react.element"), D = Symbol.for("react.fragment"), _ = Object.prototype.hasOwnProperty, w = k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function O(R, s, h) {
|
|
18
|
+
var c, y = {}, E = null, Y = null;
|
|
19
|
+
h !== void 0 && (E = "" + h), s.key !== void 0 && (E = "" + s.key), s.ref !== void 0 && (Y = s.ref);
|
|
20
|
+
for (c in s) _.call(s, c) && !m.hasOwnProperty(c) && (y[c] = s[c]);
|
|
21
|
+
if (R && R.defaultProps) for (c in s = R.defaultProps, s) y[c] === void 0 && (y[c] = s[c]);
|
|
22
|
+
return { $$typeof: b, type: R, key: E, ref: Y, props: y, _owner: w.current };
|
|
23
|
+
}
|
|
24
|
+
return $.Fragment = D, $.jsx = O, $.jsxs = O, $;
|
|
25
|
+
}
|
|
26
|
+
var I = {};
|
|
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 Oe;
|
|
37
|
+
function vr() {
|
|
38
|
+
return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
39
|
+
var k = Se, b = Symbol.for("react.element"), D = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), O = Symbol.for("react.provider"), R = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), Y = Symbol.for("react.offscreen"), H = Symbol.iterator, we = "@@iterator";
|
|
40
|
+
function Pe(e) {
|
|
41
|
+
if (e === null || typeof e != "object")
|
|
42
|
+
return null;
|
|
43
|
+
var r = H && e[H] || e[we];
|
|
44
|
+
return typeof r == "function" ? r : null;
|
|
45
|
+
}
|
|
46
|
+
var P = k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
|
+
function v(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
|
+
xe("error", e, t);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function xe(e, r, t) {
|
|
55
|
+
{
|
|
56
|
+
var n = P.ReactDebugCurrentFrame, i = n.getStackAddendum();
|
|
57
|
+
i !== "" && (r += "%s", t = t.concat([i]));
|
|
58
|
+
var u = t.map(function(o) {
|
|
59
|
+
return String(o);
|
|
60
|
+
});
|
|
61
|
+
u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
var je = !1, ke = !1, De = !1, Fe = !1, Ae = !1, Z;
|
|
65
|
+
Z = Symbol.for("react.module.reference");
|
|
66
|
+
function $e(e) {
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === _ || e === m || Ae || e === w || e === h || e === c || Fe || e === Y || je || ke || De || typeof e == "object" && e !== null && (e.$$typeof === E || e.$$typeof === y || e.$$typeof === O || e.$$typeof === R || e.$$typeof === s || // 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 === Z || e.getModuleId !== void 0));
|
|
72
|
+
}
|
|
73
|
+
function Ie(e, r, t) {
|
|
74
|
+
var n = e.displayName;
|
|
75
|
+
if (n)
|
|
76
|
+
return n;
|
|
77
|
+
var i = r.displayName || r.name || "";
|
|
78
|
+
return i !== "" ? t + "(" + i + ")" : t;
|
|
79
|
+
}
|
|
80
|
+
function Q(e) {
|
|
81
|
+
return e.displayName || "Context";
|
|
82
|
+
}
|
|
83
|
+
function T(e) {
|
|
84
|
+
if (e == null)
|
|
85
|
+
return null;
|
|
86
|
+
if (typeof e.tag == "number" && v("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 _:
|
|
92
|
+
return "Fragment";
|
|
93
|
+
case D:
|
|
94
|
+
return "Portal";
|
|
95
|
+
case m:
|
|
96
|
+
return "Profiler";
|
|
97
|
+
case w:
|
|
98
|
+
return "StrictMode";
|
|
99
|
+
case h:
|
|
100
|
+
return "Suspense";
|
|
101
|
+
case c:
|
|
102
|
+
return "SuspenseList";
|
|
103
|
+
}
|
|
104
|
+
if (typeof e == "object")
|
|
105
|
+
switch (e.$$typeof) {
|
|
106
|
+
case R:
|
|
107
|
+
var r = e;
|
|
108
|
+
return Q(r) + ".Consumer";
|
|
109
|
+
case O:
|
|
110
|
+
var t = e;
|
|
111
|
+
return Q(t._context) + ".Provider";
|
|
112
|
+
case s:
|
|
113
|
+
return Ie(e, e.render, "ForwardRef");
|
|
114
|
+
case y:
|
|
115
|
+
var n = e.displayName || null;
|
|
116
|
+
return n !== null ? n : T(e.type) || "Memo";
|
|
117
|
+
case E: {
|
|
118
|
+
var i = e, u = i._payload, o = i._init;
|
|
119
|
+
try {
|
|
120
|
+
return T(o(u));
|
|
121
|
+
} catch {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
var C = Object.assign, F = 0, ee, re, te, ne, ae, oe, ie;
|
|
129
|
+
function ue() {
|
|
130
|
+
}
|
|
131
|
+
ue.__reactDisabledLog = !0;
|
|
132
|
+
function Ye() {
|
|
133
|
+
{
|
|
134
|
+
if (F === 0) {
|
|
135
|
+
ee = console.log, re = console.info, te = console.warn, ne = console.error, ae = console.group, oe = console.groupCollapsed, ie = console.groupEnd;
|
|
136
|
+
var e = {
|
|
137
|
+
configurable: !0,
|
|
138
|
+
enumerable: !0,
|
|
139
|
+
value: ue,
|
|
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
|
+
F++;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function We() {
|
|
156
|
+
{
|
|
157
|
+
if (F--, F === 0) {
|
|
158
|
+
var e = {
|
|
159
|
+
configurable: !0,
|
|
160
|
+
enumerable: !0,
|
|
161
|
+
writable: !0
|
|
162
|
+
};
|
|
163
|
+
Object.defineProperties(console, {
|
|
164
|
+
log: C({}, e, {
|
|
165
|
+
value: ee
|
|
166
|
+
}),
|
|
167
|
+
info: C({}, e, {
|
|
168
|
+
value: re
|
|
169
|
+
}),
|
|
170
|
+
warn: C({}, e, {
|
|
171
|
+
value: te
|
|
172
|
+
}),
|
|
173
|
+
error: C({}, e, {
|
|
174
|
+
value: ne
|
|
175
|
+
}),
|
|
176
|
+
group: C({}, e, {
|
|
177
|
+
value: ae
|
|
178
|
+
}),
|
|
179
|
+
groupCollapsed: C({}, e, {
|
|
180
|
+
value: oe
|
|
181
|
+
}),
|
|
182
|
+
groupEnd: C({}, e, {
|
|
183
|
+
value: ie
|
|
184
|
+
})
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
F < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
var N = P.ReactCurrentDispatcher, J;
|
|
191
|
+
function W(e, r, t) {
|
|
192
|
+
{
|
|
193
|
+
if (J === void 0)
|
|
194
|
+
try {
|
|
195
|
+
throw Error();
|
|
196
|
+
} catch (i) {
|
|
197
|
+
var n = i.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
+
J = n && n[1] || "";
|
|
199
|
+
}
|
|
200
|
+
return `
|
|
201
|
+
` + J + e;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
var q = !1, M;
|
|
205
|
+
{
|
|
206
|
+
var Me = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
M = new Me();
|
|
208
|
+
}
|
|
209
|
+
function se(e, r) {
|
|
210
|
+
if (!e || q)
|
|
211
|
+
return "";
|
|
212
|
+
{
|
|
213
|
+
var t = M.get(e);
|
|
214
|
+
if (t !== void 0)
|
|
215
|
+
return t;
|
|
216
|
+
}
|
|
217
|
+
var n;
|
|
218
|
+
q = !0;
|
|
219
|
+
var i = Error.prepareStackTrace;
|
|
220
|
+
Error.prepareStackTrace = void 0;
|
|
221
|
+
var u;
|
|
222
|
+
u = N.current, N.current = null, Ye();
|
|
223
|
+
try {
|
|
224
|
+
if (r) {
|
|
225
|
+
var o = function() {
|
|
226
|
+
throw Error();
|
|
227
|
+
};
|
|
228
|
+
if (Object.defineProperty(o.prototype, "props", {
|
|
229
|
+
set: function() {
|
|
230
|
+
throw Error();
|
|
231
|
+
}
|
|
232
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
|
+
try {
|
|
234
|
+
Reflect.construct(o, []);
|
|
235
|
+
} catch (p) {
|
|
236
|
+
n = p;
|
|
237
|
+
}
|
|
238
|
+
Reflect.construct(e, [], o);
|
|
239
|
+
} else {
|
|
240
|
+
try {
|
|
241
|
+
o.call();
|
|
242
|
+
} catch (p) {
|
|
243
|
+
n = p;
|
|
244
|
+
}
|
|
245
|
+
e.call(o.prototype);
|
|
246
|
+
}
|
|
247
|
+
} else {
|
|
248
|
+
try {
|
|
249
|
+
throw Error();
|
|
250
|
+
} catch (p) {
|
|
251
|
+
n = p;
|
|
252
|
+
}
|
|
253
|
+
e();
|
|
254
|
+
}
|
|
255
|
+
} catch (p) {
|
|
256
|
+
if (p && n && typeof p.stack == "string") {
|
|
257
|
+
for (var a = p.stack.split(`
|
|
258
|
+
`), d = n.stack.split(`
|
|
259
|
+
`), l = a.length - 1, f = d.length - 1; l >= 1 && f >= 0 && a[l] !== d[f]; )
|
|
260
|
+
f--;
|
|
261
|
+
for (; l >= 1 && f >= 0; l--, f--)
|
|
262
|
+
if (a[l] !== d[f]) {
|
|
263
|
+
if (l !== 1 || f !== 1)
|
|
264
|
+
do
|
|
265
|
+
if (l--, f--, f < 0 || a[l] !== d[f]) {
|
|
266
|
+
var g = `
|
|
267
|
+
` + a[l].replace(" at new ", " at ");
|
|
268
|
+
return e.displayName && g.includes("<anonymous>") && (g = g.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, g), g;
|
|
269
|
+
}
|
|
270
|
+
while (l >= 1 && f >= 0);
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
} finally {
|
|
275
|
+
q = !1, N.current = u, We(), Error.prepareStackTrace = i;
|
|
276
|
+
}
|
|
277
|
+
var j = e ? e.displayName || e.name : "", S = j ? W(j) : "";
|
|
278
|
+
return typeof e == "function" && M.set(e, S), S;
|
|
279
|
+
}
|
|
280
|
+
function Le(e, r, t) {
|
|
281
|
+
return se(e, !1);
|
|
282
|
+
}
|
|
283
|
+
function Ve(e) {
|
|
284
|
+
var r = e.prototype;
|
|
285
|
+
return !!(r && r.isReactComponent);
|
|
286
|
+
}
|
|
287
|
+
function L(e, r, t) {
|
|
288
|
+
if (e == null)
|
|
289
|
+
return "";
|
|
290
|
+
if (typeof e == "function")
|
|
291
|
+
return se(e, Ve(e));
|
|
292
|
+
if (typeof e == "string")
|
|
293
|
+
return W(e);
|
|
294
|
+
switch (e) {
|
|
295
|
+
case h:
|
|
296
|
+
return W("Suspense");
|
|
297
|
+
case c:
|
|
298
|
+
return W("SuspenseList");
|
|
299
|
+
}
|
|
300
|
+
if (typeof e == "object")
|
|
301
|
+
switch (e.$$typeof) {
|
|
302
|
+
case s:
|
|
303
|
+
return Le(e.render);
|
|
304
|
+
case y:
|
|
305
|
+
return L(e.type, r, t);
|
|
306
|
+
case E: {
|
|
307
|
+
var n = e, i = n._payload, u = n._init;
|
|
308
|
+
try {
|
|
309
|
+
return L(u(i), r, t);
|
|
310
|
+
} catch {
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return "";
|
|
315
|
+
}
|
|
316
|
+
var A = Object.prototype.hasOwnProperty, le = {}, fe = P.ReactDebugCurrentFrame;
|
|
317
|
+
function V(e) {
|
|
318
|
+
if (e) {
|
|
319
|
+
var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
|
|
320
|
+
fe.setExtraStackFrame(t);
|
|
321
|
+
} else
|
|
322
|
+
fe.setExtraStackFrame(null);
|
|
323
|
+
}
|
|
324
|
+
function Ue(e, r, t, n, i) {
|
|
325
|
+
{
|
|
326
|
+
var u = Function.call.bind(A);
|
|
327
|
+
for (var o in e)
|
|
328
|
+
if (u(e, o)) {
|
|
329
|
+
var a = void 0;
|
|
330
|
+
try {
|
|
331
|
+
if (typeof e[o] != "function") {
|
|
332
|
+
var d = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw d.name = "Invariant Violation", d;
|
|
334
|
+
}
|
|
335
|
+
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
|
+
} catch (l) {
|
|
337
|
+
a = l;
|
|
338
|
+
}
|
|
339
|
+
a && !(a instanceof Error) && (V(i), v("%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, o, typeof a), V(null)), a instanceof Error && !(a.message in le) && (le[a.message] = !0, V(i), v("Failed %s type: %s", t, a.message), V(null));
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
var Ne = Array.isArray;
|
|
344
|
+
function B(e) {
|
|
345
|
+
return Ne(e);
|
|
346
|
+
}
|
|
347
|
+
function Je(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 qe(e) {
|
|
354
|
+
try {
|
|
355
|
+
return ce(e), !1;
|
|
356
|
+
} catch {
|
|
357
|
+
return !0;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function ce(e) {
|
|
361
|
+
return "" + e;
|
|
362
|
+
}
|
|
363
|
+
function ve(e) {
|
|
364
|
+
if (qe(e))
|
|
365
|
+
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), ce(e);
|
|
366
|
+
}
|
|
367
|
+
var de = P.ReactCurrentOwner, Be = {
|
|
368
|
+
key: !0,
|
|
369
|
+
ref: !0,
|
|
370
|
+
__self: !0,
|
|
371
|
+
__source: !0
|
|
372
|
+
}, pe, ge;
|
|
373
|
+
function Ke(e) {
|
|
374
|
+
if (A.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 Ge(e) {
|
|
382
|
+
if (A.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 Xe(e, r) {
|
|
390
|
+
typeof e.ref == "string" && de.current;
|
|
391
|
+
}
|
|
392
|
+
function ze(e, r) {
|
|
393
|
+
{
|
|
394
|
+
var t = function() {
|
|
395
|
+
pe || (pe = !0, v("%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 He(e, r) {
|
|
404
|
+
{
|
|
405
|
+
var t = function() {
|
|
406
|
+
ge || (ge = !0, v("%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 Ze = function(e, r, t, n, i, u, o) {
|
|
415
|
+
var a = {
|
|
416
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
417
|
+
$$typeof: b,
|
|
418
|
+
// Built-in properties that belong on the element
|
|
419
|
+
type: e,
|
|
420
|
+
key: r,
|
|
421
|
+
ref: t,
|
|
422
|
+
props: o,
|
|
423
|
+
// Record the component responsible for creating this element.
|
|
424
|
+
_owner: u
|
|
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: i
|
|
441
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
442
|
+
};
|
|
443
|
+
function Qe(e, r, t, n, i) {
|
|
444
|
+
{
|
|
445
|
+
var u, o = {}, a = null, d = null;
|
|
446
|
+
t !== void 0 && (ve(t), a = "" + t), Ge(r) && (ve(r.key), a = "" + r.key), Ke(r) && (d = r.ref, Xe(r, i));
|
|
447
|
+
for (u in r)
|
|
448
|
+
A.call(r, u) && !Be.hasOwnProperty(u) && (o[u] = r[u]);
|
|
449
|
+
if (e && e.defaultProps) {
|
|
450
|
+
var l = e.defaultProps;
|
|
451
|
+
for (u in l)
|
|
452
|
+
o[u] === void 0 && (o[u] = l[u]);
|
|
453
|
+
}
|
|
454
|
+
if (a || d) {
|
|
455
|
+
var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
456
|
+
a && ze(o, f), d && He(o, f);
|
|
457
|
+
}
|
|
458
|
+
return Ze(e, a, d, i, n, de.current, o);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
var K = P.ReactCurrentOwner, ye = P.ReactDebugCurrentFrame;
|
|
462
|
+
function x(e) {
|
|
463
|
+
if (e) {
|
|
464
|
+
var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
|
|
465
|
+
ye.setExtraStackFrame(t);
|
|
466
|
+
} else
|
|
467
|
+
ye.setExtraStackFrame(null);
|
|
468
|
+
}
|
|
469
|
+
var G;
|
|
470
|
+
G = !1;
|
|
471
|
+
function X(e) {
|
|
472
|
+
return typeof e == "object" && e !== null && e.$$typeof === b;
|
|
473
|
+
}
|
|
474
|
+
function he() {
|
|
475
|
+
{
|
|
476
|
+
if (K.current) {
|
|
477
|
+
var e = T(K.current.type);
|
|
478
|
+
if (e)
|
|
479
|
+
return `
|
|
480
|
+
|
|
481
|
+
Check the render method of \`` + e + "`.";
|
|
482
|
+
}
|
|
483
|
+
return "";
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
function er(e) {
|
|
487
|
+
return "";
|
|
488
|
+
}
|
|
489
|
+
var Re = {};
|
|
490
|
+
function rr(e) {
|
|
491
|
+
{
|
|
492
|
+
var r = he();
|
|
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 Ee(e, r) {
|
|
503
|
+
{
|
|
504
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
505
|
+
return;
|
|
506
|
+
e._store.validated = !0;
|
|
507
|
+
var t = rr(r);
|
|
508
|
+
if (Re[t])
|
|
509
|
+
return;
|
|
510
|
+
Re[t] = !0;
|
|
511
|
+
var n = "";
|
|
512
|
+
e && e._owner && e._owner !== K.current && (n = " It was passed a child from " + T(e._owner.type) + "."), x(e), v('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), x(null);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
function be(e, r) {
|
|
516
|
+
{
|
|
517
|
+
if (typeof e != "object")
|
|
518
|
+
return;
|
|
519
|
+
if (B(e))
|
|
520
|
+
for (var t = 0; t < e.length; t++) {
|
|
521
|
+
var n = e[t];
|
|
522
|
+
X(n) && Ee(n, r);
|
|
523
|
+
}
|
|
524
|
+
else if (X(e))
|
|
525
|
+
e._store && (e._store.validated = !0);
|
|
526
|
+
else if (e) {
|
|
527
|
+
var i = Pe(e);
|
|
528
|
+
if (typeof i == "function" && i !== e.entries)
|
|
529
|
+
for (var u = i.call(e), o; !(o = u.next()).done; )
|
|
530
|
+
X(o.value) && Ee(o.value, r);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
function tr(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 === s || // Note: Memo only checks outer props here.
|
|
543
|
+
// Inner props are checked in the reconciler.
|
|
544
|
+
r.$$typeof === y))
|
|
545
|
+
t = r.propTypes;
|
|
546
|
+
else
|
|
547
|
+
return;
|
|
548
|
+
if (t) {
|
|
549
|
+
var n = T(r);
|
|
550
|
+
Ue(t, e.props, "prop", n, e);
|
|
551
|
+
} else if (r.PropTypes !== void 0 && !G) {
|
|
552
|
+
G = !0;
|
|
553
|
+
var i = T(r);
|
|
554
|
+
v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
|
|
555
|
+
}
|
|
556
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
function nr(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
|
+
x(e), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), x(null);
|
|
565
|
+
break;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
e.ref !== null && (x(e), v("Invalid attribute `ref` supplied to `React.Fragment`."), x(null));
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
var _e = {};
|
|
572
|
+
function me(e, r, t, n, i, u) {
|
|
573
|
+
{
|
|
574
|
+
var o = $e(e);
|
|
575
|
+
if (!o) {
|
|
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 d = er();
|
|
579
|
+
d ? a += d : a += he();
|
|
580
|
+
var l;
|
|
581
|
+
e === null ? l = "null" : B(e) ? l = "array" : e !== void 0 && e.$$typeof === b ? (l = "<" + (T(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
|
|
582
|
+
}
|
|
583
|
+
var f = Qe(e, r, t, i, u);
|
|
584
|
+
if (f == null)
|
|
585
|
+
return f;
|
|
586
|
+
if (o) {
|
|
587
|
+
var g = r.children;
|
|
588
|
+
if (g !== void 0)
|
|
589
|
+
if (n)
|
|
590
|
+
if (B(g)) {
|
|
591
|
+
for (var j = 0; j < g.length; j++)
|
|
592
|
+
be(g[j], e);
|
|
593
|
+
Object.freeze && Object.freeze(g);
|
|
594
|
+
} else
|
|
595
|
+
v("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
|
+
be(g, e);
|
|
598
|
+
}
|
|
599
|
+
if (A.call(r, "key")) {
|
|
600
|
+
var S = T(e), p = Object.keys(r).filter(function(lr) {
|
|
601
|
+
return lr !== "key";
|
|
602
|
+
}), z = p.length > 0 ? "{key: someKey, " + p.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
+
if (!_e[S + z]) {
|
|
604
|
+
var sr = p.length > 0 ? "{" + p.join(": ..., ") + ": ...}" : "{}";
|
|
605
|
+
v(`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} />`, z, S, sr, S), _e[S + z] = !0;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return e === _ ? nr(f) : tr(f), f;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
function ar(e, r, t) {
|
|
617
|
+
return me(e, r, t, !0);
|
|
618
|
+
}
|
|
619
|
+
function or(e, r, t) {
|
|
620
|
+
return me(e, r, t, !1);
|
|
621
|
+
}
|
|
622
|
+
var ir = or, ur = ar;
|
|
623
|
+
I.Fragment = _, I.jsx = ir, I.jsxs = ur;
|
|
624
|
+
})()), I;
|
|
625
|
+
}
|
|
626
|
+
var Ce;
|
|
627
|
+
function dr() {
|
|
628
|
+
return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? U.exports = cr() : U.exports = vr()), U.exports;
|
|
629
|
+
}
|
|
630
|
+
var pr = dr();
|
|
631
|
+
function yr({
|
|
632
|
+
children: k,
|
|
633
|
+
strength: b = 0.3,
|
|
634
|
+
speed: D = 0.25,
|
|
635
|
+
scale: _ = 1,
|
|
636
|
+
className: w = ""
|
|
637
|
+
}) {
|
|
638
|
+
const m = fr(null), O = (s) => {
|
|
639
|
+
const h = m.current;
|
|
640
|
+
if (!h) return;
|
|
641
|
+
const c = h.getBoundingClientRect(), y = s.clientX - (c.left + c.width / 2), E = s.clientY - (c.top + c.height / 2);
|
|
642
|
+
h.style.transform = `
|
|
643
|
+
translate(${y * b}px, ${E * b}px)
|
|
644
|
+
scale(${_})
|
|
645
|
+
`;
|
|
646
|
+
}, R = () => {
|
|
647
|
+
const s = m.current;
|
|
648
|
+
s && (s.style.transform = "translate(0, 0) scale(1)");
|
|
649
|
+
};
|
|
650
|
+
return /* @__PURE__ */ pr.jsx(
|
|
651
|
+
"div",
|
|
652
|
+
{
|
|
653
|
+
ref: m,
|
|
654
|
+
className: w,
|
|
655
|
+
onMouseMove: O,
|
|
656
|
+
onMouseLeave: R,
|
|
657
|
+
style: {
|
|
658
|
+
display: "inline-block",
|
|
659
|
+
transition: `transform ${D}s ease-out`,
|
|
660
|
+
willChange: "transform"
|
|
661
|
+
},
|
|
662
|
+
children: k
|
|
663
|
+
}
|
|
664
|
+
);
|
|
665
|
+
}
|
|
666
|
+
export {
|
|
667
|
+
yr as Magnetic
|
|
668
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
(function(O,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],S):(O=typeof globalThis<"u"?globalThis:O||self,S(O.MotionCSSUI={},O.React))})(this,(function(O,S){"use strict";var $={exports:{}},F={};/**
|
|
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 Q;function we(){if(Q)return F;Q=1;var I=S,E=Symbol.for("react.element"),M=Symbol.for("react.fragment"),_=Object.prototype.hasOwnProperty,x=I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function C(R,s,h){var c,y={},b=null,L=null;h!==void 0&&(b=""+h),s.key!==void 0&&(b=""+s.key),s.ref!==void 0&&(L=s.ref);for(c in s)_.call(s,c)&&!m.hasOwnProperty(c)&&(y[c]=s[c]);if(R&&R.defaultProps)for(c in s=R.defaultProps,s)y[c]===void 0&&(y[c]=s[c]);return{$$typeof:E,type:R,key:b,ref:L,props:y,_owner:x.current}}return F.Fragment=M,F.jsx=C,F.jsxs=C,F}var A={};/**
|
|
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 ee;function xe(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&(function(){var I=S,E=Symbol.for("react.element"),M=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),R=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),L=Symbol.for("react.offscreen"),te=Symbol.iterator,Fe="@@iterator";function Ae(e){if(e===null||typeof e!="object")return null;var r=te&&e[te]||e[Fe];return typeof r=="function"?r:null}var j=I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function d(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ie("error",e,t)}}function Ie(e,r,t){{var n=j.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var u=t.map(function(i){return String(i)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var Me=!1,Ye=!1,We=!1,$e=!1,Le=!1,ne;ne=Symbol.for("react.module.reference");function Ue(e){return!!(typeof e=="string"||typeof e=="function"||e===_||e===m||Le||e===x||e===h||e===c||$e||e===L||Me||Ye||We||typeof e=="object"&&e!==null&&(e.$$typeof===b||e.$$typeof===y||e.$$typeof===C||e.$$typeof===R||e.$$typeof===s||e.$$typeof===ne||e.getModuleId!==void 0))}function Ve(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function ae(e){return e.displayName||"Context"}function T(e){if(e==null)return null;if(typeof e.tag=="number"&&d("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 _:return"Fragment";case M:return"Portal";case m:return"Profiler";case x:return"StrictMode";case h:return"Suspense";case c:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case R:var r=e;return ae(r)+".Consumer";case C:var t=e;return ae(t._context)+".Provider";case s:return Ve(e,e.render,"ForwardRef");case y:var n=e.displayName||null;return n!==null?n:T(e.type)||"Memo";case b:{var o=e,u=o._payload,i=o._init;try{return T(i(u))}catch{return null}}}return null}var P=Object.assign,Y=0,ie,oe,ue,se,le,fe,ce;function de(){}de.__reactDisabledLog=!0;function Ne(){{if(Y===0){ie=console.log,oe=console.info,ue=console.warn,se=console.error,le=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})}Y++}}function Je(){{if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:ie}),info:P({},e,{value:oe}),warn:P({},e,{value:ue}),error:P({},e,{value:se}),group:P({},e,{value:le}),groupCollapsed:P({},e,{value:fe}),groupEnd:P({},e,{value:ce})})}Y<0&&d("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var B=j.ReactCurrentDispatcher,q;function U(e,r,t){{if(q===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||""}return`
|
|
18
|
+
`+q+e}}var K=!1,V;{var Be=typeof WeakMap=="function"?WeakMap:Map;V=new Be}function ve(e,r){if(!e||K)return"";{var t=V.get(e);if(t!==void 0)return t}var n;K=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=B.current,B.current=null,Ne();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(p){n=p}Reflect.construct(e,[],i)}else{try{i.call()}catch(p){n=p}e.call(i.prototype)}}else{try{throw Error()}catch(p){n=p}e()}}catch(p){if(p&&n&&typeof p.stack=="string"){for(var a=p.stack.split(`
|
|
19
|
+
`),v=n.stack.split(`
|
|
20
|
+
`),l=a.length-1,f=v.length-1;l>=1&&f>=0&&a[l]!==v[f];)f--;for(;l>=1&&f>=0;l--,f--)if(a[l]!==v[f]){if(l!==1||f!==1)do if(l--,f--,f<0||a[l]!==v[f]){var g=`
|
|
21
|
+
`+a[l].replace(" at new "," at ");return e.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",e.displayName)),typeof e=="function"&&V.set(e,g),g}while(l>=1&&f>=0);break}}}finally{K=!1,B.current=u,Je(),Error.prepareStackTrace=o}var D=e?e.displayName||e.name:"",w=D?U(D):"";return typeof e=="function"&&V.set(e,w),w}function qe(e,r,t){return ve(e,!1)}function Ke(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function N(e,r,t){if(e==null)return"";if(typeof e=="function")return ve(e,Ke(e));if(typeof e=="string")return U(e);switch(e){case h:return U("Suspense");case c:return U("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case s:return qe(e.render);case y:return N(e.type,r,t);case b:{var n=e,o=n._payload,u=n._init;try{return N(u(o),r,t)}catch{}}}return""}var W=Object.prototype.hasOwnProperty,pe={},ge=j.ReactDebugCurrentFrame;function J(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);ge.setExtraStackFrame(t)}else ge.setExtraStackFrame(null)}function Ge(e,r,t,n,o){{var u=Function.call.bind(W);for(var i in e)if(u(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var v=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 v.name="Invariant Violation",v}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(J(o),d("%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 pe)&&(pe[a.message]=!0,J(o),d("Failed %s type: %s",t,a.message),J(null))}}}var Xe=Array.isArray;function G(e){return Xe(e)}function ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function He(e){try{return ye(e),!1}catch{return!0}}function ye(e){return""+e}function he(e){if(He(e))return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ze(e)),ye(e)}var Re=j.ReactCurrentOwner,Ze={key:!0,ref:!0,__self:!0,__source:!0},be,Ee;function Qe(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 er(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 rr(e,r){typeof e.ref=="string"&&Re.current}function tr(e,r){{var t=function(){be||(be=!0,d("%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 nr(e,r){{var t=function(){Ee||(Ee=!0,d("%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 ar=function(e,r,t,n,o,u,i){var a={$$typeof:E,type:e,key:r,ref:t,props:i,_owner:u};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:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ir(e,r,t,n,o){{var u,i={},a=null,v=null;t!==void 0&&(he(t),a=""+t),er(r)&&(he(r.key),a=""+r.key),Qe(r)&&(v=r.ref,rr(r,o));for(u in r)W.call(r,u)&&!Ze.hasOwnProperty(u)&&(i[u]=r[u]);if(e&&e.defaultProps){var l=e.defaultProps;for(u in l)i[u]===void 0&&(i[u]=l[u])}if(a||v){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&tr(i,f),v&&nr(i,f)}return ar(e,a,v,o,n,Re.current,i)}}var X=j.ReactCurrentOwner,_e=j.ReactDebugCurrentFrame;function k(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);_e.setExtraStackFrame(t)}else _e.setExtraStackFrame(null)}var z;z=!1;function H(e){return typeof e=="object"&&e!==null&&e.$$typeof===E}function me(){{if(X.current){var e=T(X.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function or(e){return""}var Te={};function ur(e){{var r=me();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 Oe(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!==X.current&&(n=" It was passed a child from "+T(e._owner.type)+"."),k(e),d('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),k(null)}}function Se(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];H(n)&&Oe(n,r)}else if(H(e))e._store&&(e._store.validated=!0);else if(e){var o=Ae(e);if(typeof o=="function"&&o!==e.entries)for(var u=o.call(e),i;!(i=u.next()).done;)H(i.value)&&Oe(i.value,r)}}}function sr(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===s||r.$$typeof===y))t=r.propTypes;else return;if(t){var n=T(r);Ge(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!z){z=!0;var o=T(r);d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function lr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){k(e),d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),k(null);break}}e.ref!==null&&(k(e),d("Invalid attribute `ref` supplied to `React.Fragment`."),k(null))}}var Ce={};function Pe(e,r,t,n,o,u){{var i=Ue(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 v=or();v?a+=v:a+=me();var l;e===null?l="null":G(e)?l="array":e!==void 0&&e.$$typeof===E?(l="<"+(T(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var f=ir(e,r,t,o,u);if(f==null)return f;if(i){var g=r.children;if(g!==void 0)if(n)if(G(g)){for(var D=0;D<g.length;D++)Se(g[D],e);Object.freeze&&Object.freeze(g)}else d("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 Se(g,e)}if(W.call(r,"key")){var w=T(e),p=Object.keys(r).filter(function(gr){return gr!=="key"}),Z=p.length>0?"{key: someKey, "+p.join(": ..., ")+": ...}":"{key: someKey}";if(!Ce[w+Z]){var pr=p.length>0?"{"+p.join(": ..., ")+": ...}":"{}";d(`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,w,pr,w),Ce[w+Z]=!0}}return e===_?lr(f):sr(f),f}}function fr(e,r,t){return Pe(e,r,t,!0)}function cr(e,r,t){return Pe(e,r,t,!1)}var dr=cr,vr=fr;A.Fragment=_,A.jsx=dr,A.jsxs=vr})()),A}var re;function je(){return re||(re=1,process.env.NODE_ENV==="production"?$.exports=we():$.exports=xe()),$.exports}var ke=je();function De({children:I,strength:E=.3,speed:M=.25,scale:_=1,className:x=""}){const m=S.useRef(null),C=s=>{const h=m.current;if(!h)return;const c=h.getBoundingClientRect(),y=s.clientX-(c.left+c.width/2),b=s.clientY-(c.top+c.height/2);h.style.transform=`
|
|
31
|
+
translate(${y*E}px, ${b*E}px)
|
|
32
|
+
scale(${_})
|
|
33
|
+
`},R=()=>{const s=m.current;s&&(s.style.transform="translate(0, 0) scale(1)")};return ke.jsx("div",{ref:m,className:x,onMouseMove:C,onMouseLeave:R,style:{display:"inline-block",transition:`transform ${M}s ease-out`,willChange:"transform"},children:I})}O.Magnetic=De,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "motioncss-ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Modern React motion and CSS effects.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/motioncss-ui.umd.js",
|
|
7
|
+
"module": "./dist/motioncss-ui.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/motioncss-ui.js",
|
|
11
|
+
"require": "./dist/motioncss-ui.umd.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"dev": "vite",
|
|
19
|
+
"build": "vite build",
|
|
20
|
+
"preview": "vite preview"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"react",
|
|
24
|
+
"animation",
|
|
25
|
+
"css",
|
|
26
|
+
"effects",
|
|
27
|
+
"ui",
|
|
28
|
+
"motion",
|
|
29
|
+
"hover",
|
|
30
|
+
"magnetic",
|
|
31
|
+
"frontend"
|
|
32
|
+
],
|
|
33
|
+
"author": "Roshan Jadhav",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"react": ">=18",
|
|
37
|
+
"react-dom": ">=18"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/react": "^18.3.23",
|
|
41
|
+
"@types/react-dom": "^18.3.7",
|
|
42
|
+
"@vitejs/plugin-react": "^4.5.2",
|
|
43
|
+
"typescript": "^5.8.3",
|
|
44
|
+
"vite": "^6.3.5"
|
|
45
|
+
}
|
|
46
|
+
}
|