@aura-react-comp/motion 0.1.3 → 0.1.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-transition.d.ts","sourceRoot":"","sources":["page-transition.tsx"],"names":[],"mappings":";AAEA;;;;;;;;;;GAUG;AAEH,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAgC,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAE7E,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,CAAC;IACnF,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAC7B,aAAa,EACb,IAAa,EACb,QAAmB,EACnB,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,mBAAmB,+
|
|
1
|
+
{"version":3,"file":"page-transition.d.ts","sourceRoot":"","sources":["page-transition.tsx"],"names":[],"mappings":";AAEA;;;;;;;;;;GAUG;AAEH,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAgC,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAE7E,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,CAAC;IACnF,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAC7B,aAAa,EACb,IAAa,EACb,QAAmB,EACnB,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,mBAAmB,+BA2BrB"}
|
|
@@ -26,10 +26,7 @@ export function PageTransition({
|
|
|
26
26
|
mode: mode,
|
|
27
27
|
initial: false,
|
|
28
28
|
children: /*#__PURE__*/_jsx(motion.div, {
|
|
29
|
-
initial:
|
|
30
|
-
opacity: 0,
|
|
31
|
-
y: 12
|
|
32
|
-
},
|
|
29
|
+
initial: false,
|
|
33
30
|
animate: {
|
|
34
31
|
opacity: 1,
|
|
35
32
|
y: 0
|
|
@@ -39,15 +36,30 @@ export function PageTransition({
|
|
|
39
36
|
y: -8
|
|
40
37
|
},
|
|
41
38
|
transition: {
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
// 快退慢进:外层只负责退场(0.6 倍时长 + accelerate)
|
|
40
|
+
duration: motionDurations[duration] * 0.6,
|
|
41
|
+
ease: motionEases.accelerate
|
|
44
42
|
},
|
|
45
43
|
style: mode === 'sync' ? {
|
|
46
44
|
position: 'relative',
|
|
47
45
|
...style
|
|
48
46
|
} : style,
|
|
49
47
|
...rest,
|
|
50
|
-
children:
|
|
48
|
+
children: /*#__PURE__*/_jsx(motion.div, {
|
|
49
|
+
initial: {
|
|
50
|
+
opacity: 0,
|
|
51
|
+
y: 16
|
|
52
|
+
},
|
|
53
|
+
animate: {
|
|
54
|
+
opacity: 1,
|
|
55
|
+
y: 0
|
|
56
|
+
},
|
|
57
|
+
transition: {
|
|
58
|
+
duration: motionDurations[duration],
|
|
59
|
+
ease: motionEases.decelerate
|
|
60
|
+
},
|
|
61
|
+
children: children
|
|
62
|
+
})
|
|
51
63
|
}, transitionKey)
|
|
52
64
|
});
|
|
53
65
|
}
|
|
@@ -5,8 +5,10 @@ export interface SkeletonShimmerProps {
|
|
|
5
5
|
radius?: number | string;
|
|
6
6
|
/** 扫过一轮的时长(秒) */
|
|
7
7
|
duration?: number;
|
|
8
|
+
/** 兄弟序号:错峰出光的相位偏移(0.12s/位) */
|
|
9
|
+
index?: number;
|
|
8
10
|
className?: string;
|
|
9
11
|
style?: React.CSSProperties;
|
|
10
12
|
}
|
|
11
|
-
export declare function SkeletonShimmer({ width, height, radius, duration, className, style, }: SkeletonShimmerProps): import("react").JSX.Element;
|
|
13
|
+
export declare function SkeletonShimmer({ width, height, radius, duration, index, className, style, }: SkeletonShimmerProps): import("react").JSX.Element;
|
|
12
14
|
//# sourceMappingURL=skeleton-shimmer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton-shimmer.d.ts","sourceRoot":"","sources":["skeleton-shimmer.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"skeleton-shimmer.d.ts","sourceRoot":"","sources":["skeleton-shimmer.tsx"],"names":[],"mappings":";AAYA,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,iBAAiB;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,eAAe,CAAC,EAC9B,KAAc,EACd,MAAW,EACX,MAAU,EACV,QAAc,EACd,KAAS,EACT,SAAS,EACT,KAAK,GACN,EAAE,oBAAoB,+BAuCtB"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* 骨架屏光泽扫过(精修版):
|
|
5
|
+
* - 光带改为 55% 宽度的柔和渐变(原全宽扫掠过于生硬);
|
|
6
|
+
* - 新增 `index`:相邻骨架块按序号错峰出光(0.12s/位),多块组合时有节奏
|
|
7
|
+
* 而非"整页同时闪";
|
|
8
|
+
* - 引擎驱动的 transform 循环(合成器友好),reduced-motion 下呈现静止底色。
|
|
6
9
|
*/
|
|
7
10
|
import { motion, useReducedMotion } from 'motion/react';
|
|
8
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -11,6 +14,7 @@ export function SkeletonShimmer({
|
|
|
11
14
|
height = 16,
|
|
12
15
|
radius = 8,
|
|
13
16
|
duration = 1.4,
|
|
17
|
+
index = 0,
|
|
14
18
|
className,
|
|
15
19
|
style
|
|
16
20
|
}) {
|
|
@@ -23,27 +27,30 @@ export function SkeletonShimmer({
|
|
|
23
27
|
width,
|
|
24
28
|
height,
|
|
25
29
|
borderRadius: radius,
|
|
26
|
-
background: 'rgba(127, 127, 127, 0.
|
|
30
|
+
background: 'rgba(127, 127, 127, 0.14)',
|
|
27
31
|
...style
|
|
28
32
|
},
|
|
29
33
|
children: !reduced && /*#__PURE__*/_jsx(motion.div, {
|
|
30
34
|
"aria-hidden": true,
|
|
31
35
|
style: {
|
|
32
36
|
position: 'absolute',
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
top: 0,
|
|
38
|
+
bottom: 0,
|
|
39
|
+
width: '55%',
|
|
40
|
+
background: 'linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent)'
|
|
35
41
|
},
|
|
36
42
|
initial: {
|
|
37
|
-
x: '-
|
|
43
|
+
x: '-60%'
|
|
38
44
|
},
|
|
39
45
|
animate: {
|
|
40
|
-
x: '
|
|
46
|
+
x: '180%'
|
|
41
47
|
},
|
|
42
48
|
transition: {
|
|
43
49
|
repeat: Infinity,
|
|
44
50
|
duration,
|
|
45
51
|
ease: 'linear',
|
|
46
|
-
repeatDelay: 0.
|
|
52
|
+
repeatDelay: 0.35,
|
|
53
|
+
delay: index % 6 * 0.12
|
|
47
54
|
}
|
|
48
55
|
})
|
|
49
56
|
});
|