@aura-react-comp/motion 0.1.3 → 0.2.0

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,+BAgBrB"}
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
- duration: motionDurations[duration],
43
- ease: motionEases.standard
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: 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
  }
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ export interface ScrollScaleCardProps {
3
+ children: React.ReactNode;
4
+ /** 起始缩放(如 0.9) */
5
+ from?: number;
6
+ /** 起始透明度 */
7
+ fromOpacity?: number;
8
+ /** 进度映射区间:卡片进入视口底边 → 到达视口中部完成 */
9
+ className?: string;
10
+ style?: React.CSSProperties;
11
+ }
12
+ export declare function ScrollScaleCard({ children, from, fromOpacity, className, style, }: ScrollScaleCardProps): import("react").JSX.Element;
13
+ //# sourceMappingURL=scroll-scale-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-scale-card.d.ts","sourceRoot":"","sources":["scroll-scale-card.tsx"],"names":[],"mappings":";AAaA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,IAAU,EACV,WAAiB,EACjB,SAAS,EACT,KAAK,GACN,EAAE,oBAAoB,+BA2BtB"}
@@ -0,0 +1,49 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * 滚动缩放揭示:卡片随滚动从 `from` 缩放至 1,并伴随淡入。
5
+ * 现代 landing 页的 sticky 卡片揭示形态(配合使用方的滚动空间)。
6
+ *
7
+ * - 只动画 transform 与 opacity;
8
+ * - reduced-motion 下静态呈现。
9
+ */
10
+ import { motion, useReducedMotion, useScroll, useTransform } from 'motion/react';
11
+ import { useRef } from 'react';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ export function ScrollScaleCard({
14
+ children,
15
+ from = 0.9,
16
+ fromOpacity = 0.5,
17
+ className,
18
+ style
19
+ }) {
20
+ const ref = useRef(null);
21
+ const reduced = useReducedMotion();
22
+ const {
23
+ scrollYProgress
24
+ } = useScroll({
25
+ target: ref,
26
+ offset: ['start end', 'center center']
27
+ });
28
+ const scale = useTransform(scrollYProgress, [0, 1], [from, 1]);
29
+ const opacity = useTransform(scrollYProgress, [0, 1], [fromOpacity, 1]);
30
+ if (reduced) {
31
+ return /*#__PURE__*/_jsx("div", {
32
+ ref: ref,
33
+ className: className,
34
+ style: style,
35
+ children: children
36
+ });
37
+ }
38
+ return /*#__PURE__*/_jsx(motion.div, {
39
+ ref: ref,
40
+ className: className,
41
+ style: {
42
+ scale,
43
+ opacity,
44
+ willChange: 'transform, opacity',
45
+ ...style
46
+ },
47
+ children: children
48
+ });
49
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * 3D 倾斜卡片:指针位置驱动 rotateX / rotateY(弹簧平滑),
3
+ * 可选跟随指针的光泽层(radial-gradient)。
4
+ *
5
+ * - 只动画 transform 与 opacity(合成器友好);
6
+ * - 触屏(无 mousemove)与 reduced-motion 下退化为静态卡片;
7
+ * - 光泽层 pointer-events: none,不影响内部交互。
8
+ */
9
+ import { type ReactNode } from 'react';
10
+ export interface TiltCardProps {
11
+ children: ReactNode;
12
+ /** 最大倾斜角度(度) */
13
+ maxTilt?: number;
14
+ /** 悬停时的放大比例 */
15
+ scale?: number;
16
+ /** 是否显示跟随指针的光泽 */
17
+ glare?: boolean;
18
+ /** 光泽强度(0~1) */
19
+ glareOpacity?: number;
20
+ className?: string;
21
+ style?: React.CSSProperties;
22
+ }
23
+ export declare function TiltCard({ children, maxTilt, scale, glare, glareOpacity: glareStrength, className, style, }: TiltCardProps): import("react").JSX.Element;
24
+ //# sourceMappingURL=tilt-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tilt-card.d.ts","sourceRoot":"","sources":["tilt-card.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAAU,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG/C,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,SAAS,CAAC;IACpB,gBAAgB;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gBAAgB;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,OAAW,EACX,KAAY,EACZ,KAAY,EACZ,YAAY,EAAE,aAAoB,EAClC,SAAS,EACT,KAAK,GACN,EAAE,aAAa,+BA6Ef"}
@@ -0,0 +1,89 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * 3D 倾斜卡片:指针位置驱动 rotateX / rotateY(弹簧平滑),
5
+ * 可选跟随指针的光泽层(radial-gradient)。
6
+ *
7
+ * - 只动画 transform 与 opacity(合成器友好);
8
+ * - 触屏(无 mousemove)与 reduced-motion 下退化为静态卡片;
9
+ * - 光泽层 pointer-events: none,不影响内部交互。
10
+ */
11
+ import { useRef } from 'react';
12
+ import { motion, useMotionValue, useReducedMotion, useSpring, useTransform } from 'motion/react';
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { jsxs as _jsxs } from "react/jsx-runtime";
15
+ export function TiltCard({
16
+ children,
17
+ maxTilt = 8,
18
+ scale = 1.02,
19
+ glare = true,
20
+ glareOpacity: glareStrength = 0.22,
21
+ className,
22
+ style
23
+ }) {
24
+ const ref = useRef(null);
25
+ const reduced = useReducedMotion();
26
+
27
+ // 指针相对位置(0~1,0.5 为中心)
28
+ const px = useMotionValue(0.5);
29
+ const py = useMotionValue(0.5);
30
+ const rotX = useSpring(useTransform(py, [0, 1], [maxTilt, -maxTilt]), {
31
+ stiffness: 220,
32
+ damping: 24
33
+ });
34
+ const rotY = useSpring(useTransform(px, [0, 1], [-maxTilt, maxTilt]), {
35
+ stiffness: 220,
36
+ damping: 24
37
+ });
38
+ const glareX = useTransform(px, [0, 1], ['0%', '100%']);
39
+ const glareY = useTransform(py, [0, 1], ['0%', '100%']);
40
+ const glareBg = useTransform([glareX, glareY], ([x, y]) => `radial-gradient(240px circle at ${x} ${y}, rgba(255,255,255,0.65), transparent 62%)`);
41
+ const glareAlpha = useMotionValue(0);
42
+ if (reduced) {
43
+ return /*#__PURE__*/_jsx("div", {
44
+ className: className,
45
+ style: style,
46
+ children: children
47
+ });
48
+ }
49
+ const onMove = e => {
50
+ const rect = ref.current?.getBoundingClientRect();
51
+ if (!rect) return;
52
+ px.set((e.clientX - rect.left) / rect.width);
53
+ py.set((e.clientY - rect.top) / rect.height);
54
+ };
55
+ const onEnter = () => glareAlpha.set(glare ? glareStrength : 0);
56
+ const onLeave = () => {
57
+ px.set(0.5);
58
+ py.set(0.5);
59
+ glareAlpha.set(0);
60
+ };
61
+ return /*#__PURE__*/_jsxs(motion.div, {
62
+ ref: ref,
63
+ className: className,
64
+ onMouseMove: onMove,
65
+ onMouseEnter: onEnter,
66
+ onMouseLeave: onLeave,
67
+ whileHover: {
68
+ scale
69
+ },
70
+ style: {
71
+ position: 'relative',
72
+ rotateX: rotX,
73
+ rotateY: rotY,
74
+ transformPerspective: 800,
75
+ ...style
76
+ },
77
+ children: [children, glare && /*#__PURE__*/_jsx(motion.div, {
78
+ "aria-hidden": true,
79
+ style: {
80
+ position: 'absolute',
81
+ inset: 0,
82
+ pointerEvents: 'none',
83
+ borderRadius: 'inherit',
84
+ background: glareBg,
85
+ opacity: glareAlpha
86
+ }
87
+ })]
88
+ });
89
+ }
package/esm/index.d.ts CHANGED
@@ -29,6 +29,14 @@ export { FocusRing } from './primitive/focus-ring';
29
29
  export type { FocusRingProps } from './primitive/focus-ring';
30
30
  export { Keyframes, KEYFRAMES_ALLOWED_PROPS } from './primitive/keyframes';
31
31
  export type { KeyframesProps } from './primitive/keyframes';
32
+ export { TextShimmer } from './primitive/text-shimmer';
33
+ export type { TextShimmerProps } from './primitive/text-shimmer';
34
+ export { TypingDots } from './primitive/typing-dots';
35
+ export type { TypingDotsProps } from './primitive/typing-dots';
36
+ export { GradientBorder } from './primitive/gradient-border';
37
+ export type { GradientBorderProps } from './primitive/gradient-border';
38
+ export { Marquee } from './primitive/marquee';
39
+ export type { MarqueeProps } from './primitive/marquee';
32
40
  export { FlipList } from './composed/flip-list';
33
41
  export type { FlipListProps, FlipListItem } from './composed/flip-list';
34
42
  export { LayoutGroup } from './composed/layout-group';
@@ -55,4 +63,8 @@ export { Aurora } from './composed/aurora';
55
63
  export type { AuroraProps } from './composed/aurora';
56
64
  export { LottiePlayer } from './composed/lottie-player';
57
65
  export type { LottiePlayerProps } from './composed/lottie-player';
66
+ export { TiltCard } from './composed/tilt-card';
67
+ export type { TiltCardProps } from './composed/tilt-card';
68
+ export { ScrollScaleCard } from './composed/scroll-scale-card';
69
+ export type { ScrollScaleCardProps } from './composed/scroll-scale-card';
58
70
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,cAAc,UAAU,CAAC;AAGzB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG5E,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACrE,YAAY,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE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qBAAqB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC"}
package/esm/index.js CHANGED
@@ -25,6 +25,10 @@ export { Magnetic } from "./primitive/magnetic";
25
25
  export { SkeletonShimmer } from "./primitive/skeleton-shimmer";
26
26
  export { FocusRing } from "./primitive/focus-ring";
27
27
  export { Keyframes, KEYFRAMES_ALLOWED_PROPS } from "./primitive/keyframes";
28
+ export { TextShimmer } from "./primitive/text-shimmer";
29
+ export { TypingDots } from "./primitive/typing-dots";
30
+ export { GradientBorder } from "./primitive/gradient-border";
31
+ export { Marquee } from "./primitive/marquee";
28
32
  // ---- 复杂场景 ----
29
33
  export { FlipList } from "./composed/flip-list";
30
34
  export { LayoutGroup } from "./composed/layout-group";
@@ -39,4 +43,6 @@ export { Draggable } from "./composed/draggable";
39
43
  export { Cursor } from "./composed/cursor";
40
44
  export { Confetti } from "./composed/confetti";
41
45
  export { Aurora } from "./composed/aurora";
42
- export { LottiePlayer } from "./composed/lottie-player";
46
+ export { LottiePlayer } from "./composed/lottie-player";
47
+ export { TiltCard } from "./composed/tilt-card";
48
+ export { ScrollScaleCard } from "./composed/scroll-scale-card";
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ export interface GradientBorderProps {
3
+ children: React.ReactNode;
4
+ /** 边框粗细(px) */
5
+ size?: number;
6
+ /** 光效绕行一周时长(秒) */
7
+ speed?: number;
8
+ /** 渐变颜色序列(光带色) */
9
+ colors?: string[];
10
+ /** 内层背景(默认真空色令牌回退) */
11
+ background?: string;
12
+ /** 圆角(px) */
13
+ radius?: number;
14
+ className?: string;
15
+ style?: React.CSSProperties;
16
+ }
17
+ export declare function GradientBorder({ children, size, speed, colors, background, radius, className, style, }: GradientBorderProps): import("react").JSX.Element;
18
+ //# sourceMappingURL=gradient-border.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gradient-border.d.ts","sourceRoot":"","sources":["gradient-border.tsx"],"names":[],"mappings":";AAaA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,sBAAsB;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,IAAU,EACV,KAAS,EACT,MAA0C,EAC1C,UAAkD,EAClD,MAAW,EACX,SAAS,EACT,KAAK,GACN,EAAE,mBAAmB,+BA4CrB"}
@@ -0,0 +1,65 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * 流光渐变边框:旋转的 conic-gradient 底色层 + 内层实底内容,
5
+ * 实现沿边框游走的光效(AI 产品卡片标配)。
6
+ *
7
+ * - 旋转只动画 transform(合成器友好),光效为一层 conic 渐变;
8
+ * - reduced-motion 下呈现静态渐变边框;
9
+ * - 内层内容背景可用 `background` prop 覆盖(默认跟随 --aura-motion-card-bg)。
10
+ */
11
+ import { motion, useReducedMotion } from 'motion/react';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ export function GradientBorder({
15
+ children,
16
+ size = 1.5,
17
+ speed = 4,
18
+ colors = ['#534ab7', '#1d9e75', '#534ab7'],
19
+ background = 'var(--aura-motion-card-bg, #ffffff)',
20
+ radius = 12,
21
+ className,
22
+ style
23
+ }) {
24
+ const reduced = useReducedMotion();
25
+ const [c1, c2] = [colors[0] ?? '#534ab7', colors[1] ?? '#1d9e75'];
26
+ return /*#__PURE__*/_jsxs("div", {
27
+ className: className,
28
+ style: {
29
+ position: 'relative',
30
+ overflow: 'hidden',
31
+ borderRadius: radius,
32
+ padding: size,
33
+ ...style
34
+ },
35
+ children: [/*#__PURE__*/_jsx(motion.div, {
36
+ "aria-hidden": true,
37
+ style: {
38
+ position: 'absolute',
39
+ left: '50%',
40
+ top: '50%',
41
+ width: '200%',
42
+ aspectRatio: '1',
43
+ marginLeft: '-100%',
44
+ marginTop: '-100%',
45
+ background: `conic-gradient(from 0deg, transparent 0%, ${c1} 14%, ${c2} 26%, transparent 42%, transparent 100%)`
46
+ },
47
+ animate: reduced ? undefined : {
48
+ rotate: 360
49
+ },
50
+ transition: {
51
+ duration: speed,
52
+ repeat: Infinity,
53
+ ease: 'linear'
54
+ }
55
+ }), /*#__PURE__*/_jsx("div", {
56
+ style: {
57
+ position: 'relative',
58
+ borderRadius: Math.max(radius - size, 0),
59
+ background,
60
+ height: '100%'
61
+ },
62
+ children: children
63
+ })]
64
+ });
65
+ }
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ export interface MarqueeProps {
3
+ children: React.ReactNode;
4
+ /** 滚动一轮(内容总长的一半)的时长(秒) */
5
+ duration?: number;
6
+ /** 滚动方向 */
7
+ direction?: 'left' | 'right';
8
+ /** 两份内容之间的间距(px) */
9
+ gap?: number;
10
+ /** 额外间距(如 padding),会在两份内容之间保留 */
11
+ className?: string;
12
+ style?: React.CSSProperties;
13
+ }
14
+ export declare function Marquee({ children, duration, direction, gap, className, style, }: MarqueeProps): import("react").JSX.Element;
15
+ //# sourceMappingURL=marquee.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marquee.d.ts","sourceRoot":"","sources":["marquee.tsx"],"names":[],"mappings":";AAYA,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW;IACX,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,oBAAoB;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,QAAa,EACb,SAAkB,EAClB,GAAQ,EACR,SAAS,EACT,KAAK,GACN,EAAE,YAAY,+BAoCd"}
@@ -0,0 +1,68 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * 无缝滚动横幅(logo 墙 / 公告跑马灯):内容复制两份,位移 -50% 后无缝回绕。
5
+ *
6
+ * - 只动画 transform(合成器友好);
7
+ * - 单份内容宽度需 ≥ 容器宽度,否则回绕处会露出空隙;
8
+ * - reduced-motion 下静态展示(不滚动)。
9
+ */
10
+ import { motion, useReducedMotion } from 'motion/react';
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ export function Marquee({
14
+ children,
15
+ duration = 18,
16
+ direction = 'left',
17
+ gap = 48,
18
+ className,
19
+ style
20
+ }) {
21
+ const reduced = useReducedMotion();
22
+ if (reduced) {
23
+ return /*#__PURE__*/_jsx("div", {
24
+ className: className,
25
+ style: {
26
+ display: 'flex',
27
+ gap,
28
+ overflow: 'hidden',
29
+ ...style
30
+ },
31
+ children: children
32
+ });
33
+ }
34
+ const track = /*#__PURE__*/_jsx("div", {
35
+ style: {
36
+ display: 'flex',
37
+ alignItems: 'center',
38
+ gap,
39
+ flexShrink: 0
40
+ },
41
+ children: children
42
+ });
43
+ return /*#__PURE__*/_jsx("div", {
44
+ className: className,
45
+ style: {
46
+ overflow: 'hidden',
47
+ position: 'relative',
48
+ ...style
49
+ },
50
+ "aria-hidden": false,
51
+ children: /*#__PURE__*/_jsxs(motion.div, {
52
+ style: {
53
+ display: 'flex',
54
+ gap,
55
+ width: 'max-content'
56
+ },
57
+ animate: {
58
+ x: direction === 'left' ? ['0%', '-50%'] : ['-50%', '0%']
59
+ },
60
+ transition: {
61
+ duration,
62
+ repeat: Infinity,
63
+ ease: 'linear'
64
+ },
65
+ children: [track, track]
66
+ })
67
+ });
68
+ }
@@ -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":";AASA,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,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,SAAS,EACT,KAAK,GACN,EAAE,oBAAoB,+BA+BtB"}
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
- * 骨架屏光泽扫过:引擎驱动的 transform 循环(合成器友好),
5
- * reduced-motion 下呈现静止底色。
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.16)',
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
- inset: 0,
34
- background: 'linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent)'
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: '-100%'
43
+ x: '-60%'
38
44
  },
39
45
  animate: {
40
- x: '100%'
46
+ x: '180%'
41
47
  },
42
48
  transition: {
43
49
  repeat: Infinity,
44
50
  duration,
45
51
  ease: 'linear',
46
- repeatDelay: 0.2
52
+ repeatDelay: 0.35,
53
+ delay: index % 6 * 0.12
47
54
  }
48
55
  })
49
56
  });
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ export interface TextShimmerProps {
3
+ children: string;
4
+ /** 一轮流光时长(秒) */
5
+ duration?: number;
6
+ /** 高光带宽(占文字宽度的百分比,越大越柔) */
7
+ spread?: number;
8
+ /** 文字底色;默认 currentColor(继承文字颜色) */
9
+ baseColor?: string;
10
+ /** 高光颜色;默认半透明白(深底) */
11
+ highlightColor?: string;
12
+ className?: string;
13
+ style?: React.CSSProperties;
14
+ }
15
+ export declare function TextShimmer({ children, duration, spread, baseColor, highlightColor, className, style, }: TextShimmerProps): import("react").JSX.Element;
16
+ //# sourceMappingURL=text-shimmer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-shimmer.d.ts","sourceRoot":"","sources":["text-shimmer.tsx"],"names":[],"mappings":";AAYA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,QAAc,EACd,MAAW,EACX,SAA0B,EAC1B,cAA4C,EAC5C,SAAS,EACT,KAAK,GACN,EAAE,gBAAgB,+BAgClB"}
@@ -0,0 +1,52 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * 文字流光:background-clip: text + 渐变背景位移动画(AI 生成中的经典质感)。
5
+ *
6
+ * - 文字本体透明,用渐变绘制字形;高光沿文字单向流过;
7
+ * - 默认高光为半透明白(深底场景);浅底场景请传深色 highlightColor;
8
+ * - reduced-motion 下呈现静态单色文字。
9
+ */
10
+ import { motion, useReducedMotion } from 'motion/react';
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ export function TextShimmer({
13
+ children,
14
+ duration = 2.2,
15
+ spread = 12,
16
+ baseColor = 'currentColor',
17
+ highlightColor = 'rgba(255, 255, 255, 0.75)',
18
+ className,
19
+ style
20
+ }) {
21
+ const reduced = useReducedMotion();
22
+ if (reduced) {
23
+ return /*#__PURE__*/_jsx("span", {
24
+ className: className,
25
+ style: style,
26
+ children: children
27
+ });
28
+ }
29
+ const gradient = `linear-gradient(90deg, ${baseColor} ${50 - spread}%, ${highlightColor} 50%, ${baseColor} ${50 + spread}%)`;
30
+ return /*#__PURE__*/_jsx(motion.span, {
31
+ className: className,
32
+ style: {
33
+ display: 'inline-block',
34
+ backgroundImage: gradient,
35
+ backgroundSize: '200% 100%',
36
+ backgroundClip: 'text',
37
+ WebkitBackgroundClip: 'text',
38
+ color: 'transparent',
39
+ WebkitTextFillColor: 'transparent',
40
+ ...style
41
+ },
42
+ animate: {
43
+ backgroundPosition: ['150% 0%', '-50% 0%']
44
+ },
45
+ transition: {
46
+ duration,
47
+ repeat: Infinity,
48
+ ease: 'linear'
49
+ },
50
+ children: children
51
+ });
52
+ }
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ export interface TypingDotsProps {
3
+ /** 点数量 */
4
+ count?: number;
5
+ /** 点直径(px) */
6
+ size?: number;
7
+ /** 点间距(px) */
8
+ gap?: number;
9
+ /** 点颜色;默认 currentColor */
10
+ color?: string;
11
+ /** 单点一轮脉冲时长(秒) */
12
+ duration?: number;
13
+ className?: string;
14
+ style?: React.CSSProperties;
15
+ }
16
+ export declare function TypingDots({ count, size, gap, color, duration, className, style, }: TypingDotsProps): import("react").JSX.Element;
17
+ //# sourceMappingURL=typing-dots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typing-dots.d.ts","sourceRoot":"","sources":["typing-dots.tsx"],"names":[],"mappings":";AASA,MAAM,WAAW,eAAe;IAC9B,UAAU;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAS,EACT,IAAQ,EACR,GAAO,EACP,KAAsB,EACtB,QAAc,EACd,SAAS,EACT,KAAK,GACN,EAAE,eAAe,+BA4CjB"}
@@ -0,0 +1,72 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * AI 思考中的三点脉冲:三个圆点依次缩放 + 明暗呼吸(stagger 0.16s)。
5
+ * reduced-motion 下呈现静态三点。
6
+ */
7
+ import { motion, useReducedMotion } from 'motion/react';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ export function TypingDots({
10
+ count = 3,
11
+ size = 6,
12
+ gap = 5,
13
+ color = 'currentColor',
14
+ duration = 1.1,
15
+ className,
16
+ style
17
+ }) {
18
+ const reduced = useReducedMotion();
19
+ const dots = Array.from({
20
+ length: count
21
+ }, (_, i) => i);
22
+ if (reduced) {
23
+ return /*#__PURE__*/_jsx("span", {
24
+ className: className,
25
+ style: {
26
+ display: 'inline-flex',
27
+ gap,
28
+ alignItems: 'center',
29
+ ...style
30
+ },
31
+ children: dots.map(i => /*#__PURE__*/_jsx("span", {
32
+ style: {
33
+ width: size,
34
+ height: size,
35
+ borderRadius: size / 2,
36
+ background: color
37
+ }
38
+ }, i))
39
+ });
40
+ }
41
+ return /*#__PURE__*/_jsx("span", {
42
+ role: "status",
43
+ "aria-label": "\u6B63\u5728\u8F93\u5165",
44
+ "data-motion-state": "playing",
45
+ className: className,
46
+ style: {
47
+ display: 'inline-flex',
48
+ gap,
49
+ alignItems: 'center',
50
+ ...style
51
+ },
52
+ children: dots.map(i => /*#__PURE__*/_jsx(motion.span, {
53
+ "aria-hidden": true,
54
+ style: {
55
+ width: size,
56
+ height: size,
57
+ borderRadius: size / 2,
58
+ background: color
59
+ },
60
+ animate: {
61
+ scale: [0.55, 1, 0.55],
62
+ opacity: [0.35, 1, 0.35]
63
+ },
64
+ transition: {
65
+ duration,
66
+ repeat: Infinity,
67
+ ease: 'easeInOut',
68
+ delay: i * 0.16
69
+ }
70
+ }, i))
71
+ });
72
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aura-react-comp/motion",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "description": "Aura 动效组件库 — 令牌驱动的场景化动画组件(进出场、数字与文字特效、滚动驱动、编排、手势)",
5
5
  "keywords": [
6
6
  "aura",