@windrun-huaiin/third-ui 29.2.0 → 30.0.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.
Files changed (102) hide show
  1. package/dist/fuma/mdx/cheet-table.d.ts +13 -0
  2. package/dist/fuma/mdx/cheet-table.js +295 -0
  3. package/dist/fuma/mdx/cheet-table.mjs +293 -0
  4. package/dist/fuma/mdx/index.d.ts +1 -0
  5. package/dist/fuma/mdx/index.js +2 -0
  6. package/dist/fuma/mdx/index.mjs +1 -0
  7. package/dist/fuma/server/features/widgets.js +2 -0
  8. package/dist/fuma/server/features/widgets.mjs +2 -0
  9. package/dist/lib/fuma-schema-check-util.d.ts +1 -1
  10. package/dist/main/alert-dialog/confirm-dialog.d.ts +2 -1
  11. package/dist/main/alert-dialog/confirm-dialog.js +3 -3
  12. package/dist/main/alert-dialog/confirm-dialog.mjs +4 -4
  13. package/dist/main/alert-dialog/dialog-loading-action.d.ts +2 -1
  14. package/dist/main/alert-dialog/dialog-loading-action.js +6 -3
  15. package/dist/main/alert-dialog/dialog-loading-action.mjs +6 -3
  16. package/dist/main/alert-dialog/dialog-styles.d.ts +4 -2
  17. package/dist/main/alert-dialog/dialog-styles.js +8 -4
  18. package/dist/main/alert-dialog/dialog-styles.mjs +7 -5
  19. package/dist/main/alert-dialog/high-priority-confirm-dialog.d.ts +2 -1
  20. package/dist/main/alert-dialog/high-priority-confirm-dialog.js +7 -7
  21. package/dist/main/alert-dialog/high-priority-confirm-dialog.mjs +8 -8
  22. package/dist/main/alert-dialog/info-dialog.d.ts +2 -1
  23. package/dist/main/alert-dialog/info-dialog.js +3 -3
  24. package/dist/main/alert-dialog/info-dialog.mjs +4 -4
  25. package/dist/main/alert-dialog/undoable-confirm-dialog.d.ts +2 -1
  26. package/dist/main/alert-dialog/undoable-confirm-dialog.js +4 -4
  27. package/dist/main/alert-dialog/undoable-confirm-dialog.mjs +5 -5
  28. package/dist/main/anime/anime-beam-frame.d.ts +3 -0
  29. package/dist/main/anime/anime-beam-frame.js +63 -0
  30. package/dist/main/anime/anime-beam-frame.mjs +61 -0
  31. package/dist/main/anime/anime-spiral-loading.d.ts +10 -0
  32. package/dist/main/anime/anime-spiral-loading.js +77 -0
  33. package/dist/main/anime/anime-spiral-loading.mjs +75 -0
  34. package/dist/main/anime/index.d.ts +2 -0
  35. package/dist/main/anime/index.js +10 -0
  36. package/dist/main/anime/index.mjs +3 -0
  37. package/dist/main/beam-frame/animate.d.ts +3 -0
  38. package/dist/main/beam-frame/animate.js +63 -0
  39. package/dist/main/beam-frame/animate.mjs +61 -0
  40. package/dist/main/beam-frame/beam-frame.d.ts +4 -0
  41. package/dist/main/beam-frame/beam-frame.js +262 -0
  42. package/dist/main/beam-frame/beam-frame.mjs +258 -0
  43. package/dist/main/beam-frame/index.d.ts +4 -0
  44. package/dist/main/beam-frame/index.js +11 -0
  45. package/dist/main/beam-frame/index.mjs +3 -0
  46. package/dist/main/beam-frame/motion.d.ts +3 -0
  47. package/dist/main/beam-frame/motion.js +61 -0
  48. package/dist/main/beam-frame/motion.mjs +59 -0
  49. package/dist/main/beam-frame/share-config.d.ts +54 -0
  50. package/dist/main/beam-frame/share-config.js +161 -0
  51. package/dist/main/beam-frame/share-config.mjs +152 -0
  52. package/dist/main/beam-frame-config.d.ts +54 -0
  53. package/dist/main/beam-frame-config.js +161 -0
  54. package/dist/main/beam-frame-config.mjs +152 -0
  55. package/dist/main/calendar/random-date-range-dialog.d.ts +5 -2
  56. package/dist/main/calendar/random-date-range-dialog.js +239 -109
  57. package/dist/main/calendar/random-date-range-dialog.mjs +242 -112
  58. package/dist/main/cta.js +17 -1
  59. package/dist/main/cta.mjs +18 -2
  60. package/dist/main/delayed-img.d.ts +1 -1
  61. package/dist/main/delayed-img.js +8 -5
  62. package/dist/main/delayed-img.mjs +8 -5
  63. package/dist/main/info-tooltip.js +70 -9
  64. package/dist/main/info-tooltip.mjs +70 -9
  65. package/dist/main/loading-frame/index.d.ts +1 -0
  66. package/dist/main/loading.d.ts +2 -1
  67. package/dist/main/loading.js +64 -26
  68. package/dist/main/loading.mjs +64 -26
  69. package/dist/main/motion/index.d.ts +1 -0
  70. package/dist/main/motion/index.js +9 -0
  71. package/dist/main/motion/index.mjs +2 -0
  72. package/dist/main/motion/motion-beam-frame.d.ts +3 -0
  73. package/dist/main/motion/motion-beam-frame.js +61 -0
  74. package/dist/main/motion/motion-beam-frame.mjs +59 -0
  75. package/dist/main/snake-loading-frame.d.ts +7 -3
  76. package/dist/main/snake-loading-frame.js +44 -252
  77. package/dist/main/snake-loading-frame.mjs +46 -254
  78. package/package.json +16 -5
  79. package/src/fuma/mdx/cheet-table.tsx +650 -0
  80. package/src/fuma/mdx/index.ts +1 -0
  81. package/src/fuma/server/features/widgets.tsx +2 -0
  82. package/src/main/alert-dialog/confirm-dialog.tsx +5 -2
  83. package/src/main/alert-dialog/dialog-loading-action.tsx +22 -5
  84. package/src/main/alert-dialog/dialog-styles.ts +13 -3
  85. package/src/main/alert-dialog/high-priority-confirm-dialog.tsx +29 -24
  86. package/src/main/alert-dialog/info-dialog.tsx +5 -2
  87. package/src/main/alert-dialog/undoable-confirm-dialog.tsx +21 -18
  88. package/src/main/anime/anime-beam-frame.tsx +128 -0
  89. package/src/main/anime/anime-spiral-loading.tsx +123 -0
  90. package/src/main/anime/index.ts +9 -0
  91. package/src/main/beam-frame-config.tsx +341 -0
  92. package/src/main/calendar/random-date-range-dialog.tsx +242 -74
  93. package/src/main/cta.tsx +50 -21
  94. package/src/main/delayed-img.tsx +9 -4
  95. package/src/main/info-tooltip.tsx +116 -20
  96. package/src/main/loading-frame/index.ts +4 -0
  97. package/src/main/loading.tsx +75 -24
  98. package/src/main/motion/index.ts +8 -0
  99. package/src/main/motion/motion-beam-frame.tsx +137 -0
  100. package/src/main/snake-loading-frame.tsx +95 -496
  101. package/src/styles/cta.css +21 -4
  102. package/src/styles/third-ui.css +0 -20
@@ -0,0 +1,262 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var React = require('react');
6
+ var animejs = require('animejs');
7
+ var react = require('motion/react');
8
+ var lib = require('@windrun-huaiin/base-ui/lib');
9
+ var utils = require('@windrun-huaiin/lib/utils');
10
+
11
+ const THEME_PALETTES = {
12
+ purple: { a: '#AC62FD', b: '#EC4899', c: '#6366F1' },
13
+ orange: { a: '#F97316', b: '#F59E0B', c: '#EF4444' },
14
+ indigo: { a: '#6366F1', b: '#3B82F6', c: '#06B6D4' },
15
+ emerald: { a: '#10B981', b: '#14B8A6', c: '#22C55E' },
16
+ rose: { a: '#F43F5E', b: '#EC4899', c: '#FB7185' },
17
+ };
18
+ const TONE_PALETTES = {
19
+ rainbow: { a: '#22D3EE', b: '#A855F7', c: '#F97316' },
20
+ mono: { a: '#E5E7EB', b: '#94A3B8', c: '#FFFFFF' },
21
+ warm: { a: '#F97316', b: '#FBBF24', c: '#EF4444' },
22
+ cool: { a: '#06B6D4', b: '#6366F1', c: '#14B8A6' },
23
+ };
24
+ const INTENSITY_STYLE = {
25
+ subtle: {
26
+ beamOpacity: 0.86,
27
+ glowOpacity: 0.16,
28
+ beamLength: 0.24,
29
+ beamWidth: 2.2,
30
+ haloWidth: 6,
31
+ },
32
+ regular: {
33
+ beamOpacity: 1,
34
+ glowOpacity: 0.24,
35
+ beamLength: 0.34,
36
+ beamWidth: 3,
37
+ haloWidth: 8,
38
+ },
39
+ strong: {
40
+ beamOpacity: 1,
41
+ glowOpacity: 0.32,
42
+ beamLength: 0.46,
43
+ beamWidth: 4,
44
+ haloWidth: 10,
45
+ },
46
+ };
47
+ const BASE_BORDER_OPACITY = 0.18;
48
+ const BASE_DURATION_SECONDS = 1.8;
49
+ const DEFAULT_RADIUS = 24;
50
+ function getPalette(tone) {
51
+ var _a;
52
+ if (tone !== 'theme') {
53
+ return TONE_PALETTES[tone];
54
+ }
55
+ return (_a = THEME_PALETTES[lib.themeName]) !== null && _a !== void 0 ? _a : THEME_PALETTES.purple;
56
+ }
57
+ function normalizeDuration(duration) {
58
+ if (!Number.isFinite(duration)) {
59
+ return 1.8;
60
+ }
61
+ return Math.max(0.4, duration);
62
+ }
63
+ function useMeasuredFrameSize() {
64
+ const ref = React.useRef(null);
65
+ const [size, setSize] = React.useState({ width: 0, height: 0 });
66
+ React.useEffect(() => {
67
+ const node = ref.current;
68
+ if (!node) {
69
+ return undefined;
70
+ }
71
+ const updateSize = () => {
72
+ const rect = node.getBoundingClientRect();
73
+ setSize({
74
+ width: Math.max(0, rect.width),
75
+ height: Math.max(0, rect.height),
76
+ });
77
+ };
78
+ updateSize();
79
+ const observer = new ResizeObserver(updateSize);
80
+ observer.observe(node);
81
+ return () => observer.disconnect();
82
+ }, []);
83
+ return { ref, size };
84
+ }
85
+ function useInteractiveRunning(active, interactive) {
86
+ const [isInteractiveRunning, setIsInteractiveRunning] = React.useState(false);
87
+ const interactionProps = interactive
88
+ ? {
89
+ onMouseEnter: () => setIsInteractiveRunning(true),
90
+ onMouseLeave: () => setIsInteractiveRunning(false),
91
+ onFocus: () => setIsInteractiveRunning(true),
92
+ onBlur: () => setIsInteractiveRunning(false),
93
+ }
94
+ : {};
95
+ return {
96
+ isRunning: active || isInteractiveRunning,
97
+ interactionProps,
98
+ };
99
+ }
100
+ function createRootStyle({ intensity, tone, radius, }) {
101
+ const palette = getPalette(tone);
102
+ const intensityStyle = INTENSITY_STYLE[intensity];
103
+ const frameRadius = radius !== null && radius !== void 0 ? radius : DEFAULT_RADIUS;
104
+ const svgRadius = Math.max(0, Math.min(49, frameRadius));
105
+ return {
106
+ '--beam-frame-radius': `${frameRadius}px`,
107
+ '--beam-frame-svg-radius': svgRadius,
108
+ '--beam-frame-color-a': palette.a,
109
+ '--beam-frame-color-b': palette.b,
110
+ '--beam-frame-color-c': palette.c,
111
+ '--beam-frame-border-opacity': BASE_BORDER_OPACITY,
112
+ '--beam-frame-beam-opacity': intensityStyle.beamOpacity,
113
+ '--beam-frame-glow-opacity': intensityStyle.glowOpacity,
114
+ '--beam-frame-beam-length': intensityStyle.beamLength,
115
+ '--beam-frame-beam-width': intensityStyle.beamWidth,
116
+ '--beam-frame-halo-width': intensityStyle.haloWidth,
117
+ };
118
+ }
119
+ function createBaseBorderBackground() {
120
+ return 'rgba(148, 163, 184, var(--beam-frame-border-opacity))';
121
+ }
122
+ function createBorderRingMask() {
123
+ return {
124
+ WebkitMask: 'linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)',
125
+ WebkitMaskComposite: 'xor',
126
+ maskComposite: 'exclude',
127
+ padding: '1px',
128
+ };
129
+ }
130
+ function BeamFrameShell({ children, className, tone, intensity, radius, isRunning, interactionProps, renderBeam, rootRef, }) {
131
+ return (jsxRuntime.jsxs("div", Object.assign({ ref: rootRef, className: utils.cn('group/beam-frame relative isolate overflow-hidden rounded-[var(--beam-frame-radius)] p-px', className), "data-beam-running": isRunning ? 'true' : 'false', style: createRootStyle({ intensity, tone, radius }) }, interactionProps, { children: [jsxRuntime.jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 z-0 rounded-[inherit]", style: Object.assign({ background: createBaseBorderBackground() }, createBorderRingMask()) }), renderBeam(isRunning), jsxRuntime.jsx("div", { className: "relative z-10 rounded-[calc(var(--beam-frame-radius)-1px)]", children: children })] })));
132
+ }
133
+ function MotionAroundBeam({ isRunning, duration, radius, size, }) {
134
+ const gradientId = React.useId().replace(/:/g, '');
135
+ const haloGradientId = React.useId().replace(/:/g, '');
136
+ const beamGroupRef = React.useRef(null);
137
+ const controlsRef = React.useRef(null);
138
+ const hasStartedRef = React.useRef(false);
139
+ const strokeWidth = 3;
140
+ const width = Math.max(1, size.width);
141
+ const height = Math.max(1, size.height);
142
+ const rectOffset = strokeWidth / 2;
143
+ const rectWidth = Math.max(1, width - strokeWidth);
144
+ const rectHeight = Math.max(1, height - strokeWidth);
145
+ const rectRadius = Math.max(0, Math.min(radius !== null && radius !== void 0 ? radius : DEFAULT_RADIUS, rectWidth / 2, rectHeight / 2));
146
+ React.useEffect(() => {
147
+ var _a;
148
+ const node = beamGroupRef.current;
149
+ if (!node) {
150
+ return undefined;
151
+ }
152
+ if (isRunning) {
153
+ hasStartedRef.current = true;
154
+ }
155
+ node.style.opacity = isRunning || hasStartedRef.current ? 'var(--beam-frame-beam-opacity)' : '0';
156
+ if (!isRunning) {
157
+ (_a = controlsRef.current) === null || _a === void 0 ? void 0 : _a.pause();
158
+ return undefined;
159
+ }
160
+ if (controlsRef.current) {
161
+ controlsRef.current.speed = BASE_DURATION_SECONDS / duration;
162
+ controlsRef.current.play();
163
+ return undefined;
164
+ }
165
+ controlsRef.current = react.animate(node, { strokeDashoffset: [0, -1] }, {
166
+ duration: BASE_DURATION_SECONDS,
167
+ repeat: Infinity,
168
+ ease: 'linear',
169
+ });
170
+ controlsRef.current.speed = BASE_DURATION_SECONDS / duration;
171
+ return undefined;
172
+ }, [duration, isRunning]);
173
+ React.useEffect(() => {
174
+ return () => {
175
+ var _a;
176
+ (_a = controlsRef.current) === null || _a === void 0 ? void 0 : _a.stop();
177
+ controlsRef.current = null;
178
+ };
179
+ }, []);
180
+ return (jsxRuntime.jsxs("svg", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 z-0 h-full w-full overflow-visible", preserveAspectRatio: "none", viewBox: `0 0 ${width} ${height}`, children: [jsxRuntime.jsxs("g", { ref: beamGroupRef, opacity: "0", children: [jsxRuntime.jsx("rect", { x: rectOffset, y: rectOffset, width: rectWidth, height: rectHeight, rx: rectRadius, ry: rectRadius, pathLength: "1", fill: "none", stroke: `url(#${haloGradientId})`, strokeLinecap: "round", strokeWidth: "var(--beam-frame-halo-width)", vectorEffect: "non-scaling-stroke", style: {
181
+ strokeDasharray: 'calc(var(--beam-frame-beam-length) * 0.86) calc(1 - var(--beam-frame-beam-length) * 0.86)',
182
+ }, opacity: "var(--beam-frame-glow-opacity)" }), jsxRuntime.jsx("rect", { x: rectOffset, y: rectOffset, width: rectWidth, height: rectHeight, rx: rectRadius, ry: rectRadius, pathLength: "1", fill: "none", stroke: `url(#${gradientId})`, strokeLinecap: "round", strokeWidth: "var(--beam-frame-beam-width)", vectorEffect: "non-scaling-stroke", style: {
183
+ strokeDasharray: 'var(--beam-frame-beam-length) calc(1 - var(--beam-frame-beam-length))',
184
+ } })] }), jsxRuntime.jsxs("defs", { children: [jsxRuntime.jsxs("linearGradient", { id: haloGradientId, x1: "0%", x2: "100%", y1: "0%", y2: "100%", children: [jsxRuntime.jsx("stop", { offset: "0%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.18" }), jsxRuntime.jsx("stop", { offset: "34%", stopColor: "var(--beam-frame-color-b)", stopOpacity: "0.72" }), jsxRuntime.jsx("stop", { offset: "54%", stopColor: "var(--beam-frame-color-c)", stopOpacity: "1" }), jsxRuntime.jsx("stop", { offset: "74%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.66" }), jsxRuntime.jsx("stop", { offset: "100%", stopColor: "var(--beam-frame-color-b)", stopOpacity: "0.18" })] }), jsxRuntime.jsxs("linearGradient", { id: gradientId, x1: "0%", x2: "100%", y1: "0%", y2: "100%", children: [jsxRuntime.jsx("stop", { offset: "0%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.52" }), jsxRuntime.jsx("stop", { offset: "34%", stopColor: "var(--beam-frame-color-b)", stopOpacity: "0.9" }), jsxRuntime.jsx("stop", { offset: "50%", stopColor: "var(--beam-frame-color-c)", stopOpacity: "1" }), jsxRuntime.jsx("stop", { offset: "68%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.86" }), jsxRuntime.jsx("stop", { offset: "100%", stopColor: "var(--beam-frame-color-c)", stopOpacity: "0.52" })] })] })] }));
185
+ }
186
+ function MotionBeamFrame(props) {
187
+ const { children, active = false, interactive = true, intensity = 'regular', tone = 'theme', duration = 1.8, radius, className, } = props;
188
+ const prefersReducedMotion = react.useReducedMotion();
189
+ const { isRunning, interactionProps } = useInteractiveRunning(active, interactive);
190
+ const shouldRun = isRunning && !prefersReducedMotion;
191
+ const normalizedDuration = normalizeDuration(duration);
192
+ const { ref, size } = useMeasuredFrameSize();
193
+ return (jsxRuntime.jsx(BeamFrameShell, { active: active, interactive: interactive, intensity: intensity, tone: tone, duration: normalizedDuration, radius: radius, className: className, isRunning: shouldRun, interactionProps: interactionProps, rootRef: ref, renderBeam: () => (jsxRuntime.jsx(MotionAroundBeam, { isRunning: shouldRun, duration: normalizedDuration, radius: radius, size: size })), children: children }));
194
+ }
195
+ function AnimeBeamLayer({ isRunning, duration, radius, size, }) {
196
+ const aroundBeamRef = React.useRef(null);
197
+ const animationRef = React.useRef(null);
198
+ const hasStartedRef = React.useRef(false);
199
+ const gradientId = React.useId().replace(/:/g, '');
200
+ const haloGradientId = React.useId().replace(/:/g, '');
201
+ const strokeWidth = 3;
202
+ const width = Math.max(1, size.width);
203
+ const height = Math.max(1, size.height);
204
+ const rectOffset = strokeWidth / 2;
205
+ const rectWidth = Math.max(1, width - strokeWidth);
206
+ const rectHeight = Math.max(1, height - strokeWidth);
207
+ const rectRadius = Math.max(0, Math.min(radius !== null && radius !== void 0 ? radius : DEFAULT_RADIUS, rectWidth / 2, rectHeight / 2));
208
+ React.useEffect(() => {
209
+ var _a;
210
+ const node = aroundBeamRef.current;
211
+ if (!node) {
212
+ return undefined;
213
+ }
214
+ if (isRunning) {
215
+ hasStartedRef.current = true;
216
+ }
217
+ node.style.opacity = isRunning || hasStartedRef.current ? 'var(--beam-frame-beam-opacity)' : '0';
218
+ if (!isRunning) {
219
+ (_a = animationRef.current) === null || _a === void 0 ? void 0 : _a.pause();
220
+ return undefined;
221
+ }
222
+ if (animationRef.current) {
223
+ animationRef.current.playbackRate = BASE_DURATION_SECONDS / duration;
224
+ animationRef.current.play();
225
+ return undefined;
226
+ }
227
+ animationRef.current = animejs.waapi.animate(node, {
228
+ strokeDashoffset: [0, -1],
229
+ loop: true,
230
+ duration: BASE_DURATION_SECONDS * 1000,
231
+ ease: 'linear',
232
+ });
233
+ animationRef.current.playbackRate = BASE_DURATION_SECONDS / duration;
234
+ return undefined;
235
+ }, [duration, isRunning]);
236
+ React.useEffect(() => {
237
+ return () => {
238
+ var _a;
239
+ (_a = animationRef.current) === null || _a === void 0 ? void 0 : _a.revert();
240
+ animationRef.current = null;
241
+ };
242
+ }, []);
243
+ return (jsxRuntime.jsxs("svg", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 z-0 h-full w-full overflow-visible", preserveAspectRatio: "none", viewBox: `0 0 ${width} ${height}`, children: [jsxRuntime.jsxs("g", { ref: aroundBeamRef, opacity: "0", children: [jsxRuntime.jsx("rect", { x: rectOffset, y: rectOffset, width: rectWidth, height: rectHeight, rx: rectRadius, ry: rectRadius, pathLength: "1", fill: "none", stroke: `url(#${haloGradientId})`, strokeLinecap: "round", strokeWidth: "var(--beam-frame-halo-width)", vectorEffect: "non-scaling-stroke", style: {
244
+ strokeDasharray: 'calc(var(--beam-frame-beam-length) * 0.86) calc(1 - var(--beam-frame-beam-length) * 0.86)',
245
+ }, opacity: "var(--beam-frame-glow-opacity)" }), jsxRuntime.jsx("rect", { x: rectOffset, y: rectOffset, width: rectWidth, height: rectHeight, rx: rectRadius, ry: rectRadius, pathLength: "1", fill: "none", stroke: `url(#${gradientId})`, strokeLinecap: "round", strokeWidth: "var(--beam-frame-beam-width)", vectorEffect: "non-scaling-stroke", style: {
246
+ strokeDasharray: 'var(--beam-frame-beam-length) calc(1 - var(--beam-frame-beam-length))',
247
+ } })] }), jsxRuntime.jsxs("defs", { children: [jsxRuntime.jsxs("linearGradient", { id: haloGradientId, x1: "0%", x2: "100%", y1: "0%", y2: "100%", children: [jsxRuntime.jsx("stop", { offset: "0%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.18" }), jsxRuntime.jsx("stop", { offset: "34%", stopColor: "var(--beam-frame-color-b)", stopOpacity: "0.72" }), jsxRuntime.jsx("stop", { offset: "54%", stopColor: "var(--beam-frame-color-c)", stopOpacity: "1" }), jsxRuntime.jsx("stop", { offset: "74%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.66" }), jsxRuntime.jsx("stop", { offset: "100%", stopColor: "var(--beam-frame-color-b)", stopOpacity: "0.18" })] }), jsxRuntime.jsxs("linearGradient", { id: gradientId, x1: "0%", x2: "100%", y1: "0%", y2: "100%", children: [jsxRuntime.jsx("stop", { offset: "0%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.52" }), jsxRuntime.jsx("stop", { offset: "34%", stopColor: "var(--beam-frame-color-b)", stopOpacity: "0.9" }), jsxRuntime.jsx("stop", { offset: "50%", stopColor: "var(--beam-frame-color-c)", stopOpacity: "1" }), jsxRuntime.jsx("stop", { offset: "68%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.86" }), jsxRuntime.jsx("stop", { offset: "100%", stopColor: "var(--beam-frame-color-c)", stopOpacity: "0.52" })] })] })] }));
248
+ }
249
+ function AnimeBeamFrame(props) {
250
+ const { children, active = false, interactive = true, intensity = 'regular', tone = 'theme', duration = 1.8, radius, className, } = props;
251
+ const prefersReducedMotion = react.useReducedMotion();
252
+ const { isRunning, interactionProps } = useInteractiveRunning(active, interactive);
253
+ const shouldRun = isRunning && !prefersReducedMotion;
254
+ const normalizedDuration = normalizeDuration(duration);
255
+ const { ref, size } = useMeasuredFrameSize();
256
+ return (jsxRuntime.jsx(BeamFrameShell, { active: active, interactive: interactive, intensity: intensity, tone: tone, duration: normalizedDuration, radius: radius, className: className, isRunning: shouldRun, interactionProps: interactionProps, rootRef: ref, renderBeam: () => (jsxRuntime.jsx(AnimeBeamLayer, { isRunning: shouldRun, duration: normalizedDuration, radius: radius, size: size })), children: children }));
257
+ }
258
+ const BeamFrame = MotionBeamFrame;
259
+
260
+ exports.AnimeBeamFrame = AnimeBeamFrame;
261
+ exports.BeamFrame = BeamFrame;
262
+ exports.MotionBeamFrame = MotionBeamFrame;
@@ -0,0 +1,258 @@
1
+ "use client";
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import { useState, useRef, useEffect, useId } from 'react';
4
+ import { waapi } from 'animejs';
5
+ import { useReducedMotion, animate } from 'motion/react';
6
+ import { themeName } from '@windrun-huaiin/base-ui/lib';
7
+ import { cn } from '@windrun-huaiin/lib/utils';
8
+
9
+ const THEME_PALETTES = {
10
+ purple: { a: '#AC62FD', b: '#EC4899', c: '#6366F1' },
11
+ orange: { a: '#F97316', b: '#F59E0B', c: '#EF4444' },
12
+ indigo: { a: '#6366F1', b: '#3B82F6', c: '#06B6D4' },
13
+ emerald: { a: '#10B981', b: '#14B8A6', c: '#22C55E' },
14
+ rose: { a: '#F43F5E', b: '#EC4899', c: '#FB7185' },
15
+ };
16
+ const TONE_PALETTES = {
17
+ rainbow: { a: '#22D3EE', b: '#A855F7', c: '#F97316' },
18
+ mono: { a: '#E5E7EB', b: '#94A3B8', c: '#FFFFFF' },
19
+ warm: { a: '#F97316', b: '#FBBF24', c: '#EF4444' },
20
+ cool: { a: '#06B6D4', b: '#6366F1', c: '#14B8A6' },
21
+ };
22
+ const INTENSITY_STYLE = {
23
+ subtle: {
24
+ beamOpacity: 0.86,
25
+ glowOpacity: 0.16,
26
+ beamLength: 0.24,
27
+ beamWidth: 2.2,
28
+ haloWidth: 6,
29
+ },
30
+ regular: {
31
+ beamOpacity: 1,
32
+ glowOpacity: 0.24,
33
+ beamLength: 0.34,
34
+ beamWidth: 3,
35
+ haloWidth: 8,
36
+ },
37
+ strong: {
38
+ beamOpacity: 1,
39
+ glowOpacity: 0.32,
40
+ beamLength: 0.46,
41
+ beamWidth: 4,
42
+ haloWidth: 10,
43
+ },
44
+ };
45
+ const BASE_BORDER_OPACITY = 0.18;
46
+ const BASE_DURATION_SECONDS = 1.8;
47
+ const DEFAULT_RADIUS = 24;
48
+ function getPalette(tone) {
49
+ var _a;
50
+ if (tone !== 'theme') {
51
+ return TONE_PALETTES[tone];
52
+ }
53
+ return (_a = THEME_PALETTES[themeName]) !== null && _a !== void 0 ? _a : THEME_PALETTES.purple;
54
+ }
55
+ function normalizeDuration(duration) {
56
+ if (!Number.isFinite(duration)) {
57
+ return 1.8;
58
+ }
59
+ return Math.max(0.4, duration);
60
+ }
61
+ function useMeasuredFrameSize() {
62
+ const ref = useRef(null);
63
+ const [size, setSize] = useState({ width: 0, height: 0 });
64
+ useEffect(() => {
65
+ const node = ref.current;
66
+ if (!node) {
67
+ return undefined;
68
+ }
69
+ const updateSize = () => {
70
+ const rect = node.getBoundingClientRect();
71
+ setSize({
72
+ width: Math.max(0, rect.width),
73
+ height: Math.max(0, rect.height),
74
+ });
75
+ };
76
+ updateSize();
77
+ const observer = new ResizeObserver(updateSize);
78
+ observer.observe(node);
79
+ return () => observer.disconnect();
80
+ }, []);
81
+ return { ref, size };
82
+ }
83
+ function useInteractiveRunning(active, interactive) {
84
+ const [isInteractiveRunning, setIsInteractiveRunning] = useState(false);
85
+ const interactionProps = interactive
86
+ ? {
87
+ onMouseEnter: () => setIsInteractiveRunning(true),
88
+ onMouseLeave: () => setIsInteractiveRunning(false),
89
+ onFocus: () => setIsInteractiveRunning(true),
90
+ onBlur: () => setIsInteractiveRunning(false),
91
+ }
92
+ : {};
93
+ return {
94
+ isRunning: active || isInteractiveRunning,
95
+ interactionProps,
96
+ };
97
+ }
98
+ function createRootStyle({ intensity, tone, radius, }) {
99
+ const palette = getPalette(tone);
100
+ const intensityStyle = INTENSITY_STYLE[intensity];
101
+ const frameRadius = radius !== null && radius !== void 0 ? radius : DEFAULT_RADIUS;
102
+ const svgRadius = Math.max(0, Math.min(49, frameRadius));
103
+ return {
104
+ '--beam-frame-radius': `${frameRadius}px`,
105
+ '--beam-frame-svg-radius': svgRadius,
106
+ '--beam-frame-color-a': palette.a,
107
+ '--beam-frame-color-b': palette.b,
108
+ '--beam-frame-color-c': palette.c,
109
+ '--beam-frame-border-opacity': BASE_BORDER_OPACITY,
110
+ '--beam-frame-beam-opacity': intensityStyle.beamOpacity,
111
+ '--beam-frame-glow-opacity': intensityStyle.glowOpacity,
112
+ '--beam-frame-beam-length': intensityStyle.beamLength,
113
+ '--beam-frame-beam-width': intensityStyle.beamWidth,
114
+ '--beam-frame-halo-width': intensityStyle.haloWidth,
115
+ };
116
+ }
117
+ function createBaseBorderBackground() {
118
+ return 'rgba(148, 163, 184, var(--beam-frame-border-opacity))';
119
+ }
120
+ function createBorderRingMask() {
121
+ return {
122
+ WebkitMask: 'linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)',
123
+ WebkitMaskComposite: 'xor',
124
+ maskComposite: 'exclude',
125
+ padding: '1px',
126
+ };
127
+ }
128
+ function BeamFrameShell({ children, className, tone, intensity, radius, isRunning, interactionProps, renderBeam, rootRef, }) {
129
+ return (jsxs("div", Object.assign({ ref: rootRef, className: cn('group/beam-frame relative isolate overflow-hidden rounded-[var(--beam-frame-radius)] p-px', className), "data-beam-running": isRunning ? 'true' : 'false', style: createRootStyle({ intensity, tone, radius }) }, interactionProps, { children: [jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 z-0 rounded-[inherit]", style: Object.assign({ background: createBaseBorderBackground() }, createBorderRingMask()) }), renderBeam(isRunning), jsx("div", { className: "relative z-10 rounded-[calc(var(--beam-frame-radius)-1px)]", children: children })] })));
130
+ }
131
+ function MotionAroundBeam({ isRunning, duration, radius, size, }) {
132
+ const gradientId = useId().replace(/:/g, '');
133
+ const haloGradientId = useId().replace(/:/g, '');
134
+ const beamGroupRef = useRef(null);
135
+ const controlsRef = useRef(null);
136
+ const hasStartedRef = useRef(false);
137
+ const strokeWidth = 3;
138
+ const width = Math.max(1, size.width);
139
+ const height = Math.max(1, size.height);
140
+ const rectOffset = strokeWidth / 2;
141
+ const rectWidth = Math.max(1, width - strokeWidth);
142
+ const rectHeight = Math.max(1, height - strokeWidth);
143
+ const rectRadius = Math.max(0, Math.min(radius !== null && radius !== void 0 ? radius : DEFAULT_RADIUS, rectWidth / 2, rectHeight / 2));
144
+ useEffect(() => {
145
+ var _a;
146
+ const node = beamGroupRef.current;
147
+ if (!node) {
148
+ return undefined;
149
+ }
150
+ if (isRunning) {
151
+ hasStartedRef.current = true;
152
+ }
153
+ node.style.opacity = isRunning || hasStartedRef.current ? 'var(--beam-frame-beam-opacity)' : '0';
154
+ if (!isRunning) {
155
+ (_a = controlsRef.current) === null || _a === void 0 ? void 0 : _a.pause();
156
+ return undefined;
157
+ }
158
+ if (controlsRef.current) {
159
+ controlsRef.current.speed = BASE_DURATION_SECONDS / duration;
160
+ controlsRef.current.play();
161
+ return undefined;
162
+ }
163
+ controlsRef.current = animate(node, { strokeDashoffset: [0, -1] }, {
164
+ duration: BASE_DURATION_SECONDS,
165
+ repeat: Infinity,
166
+ ease: 'linear',
167
+ });
168
+ controlsRef.current.speed = BASE_DURATION_SECONDS / duration;
169
+ return undefined;
170
+ }, [duration, isRunning]);
171
+ useEffect(() => {
172
+ return () => {
173
+ var _a;
174
+ (_a = controlsRef.current) === null || _a === void 0 ? void 0 : _a.stop();
175
+ controlsRef.current = null;
176
+ };
177
+ }, []);
178
+ return (jsxs("svg", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 z-0 h-full w-full overflow-visible", preserveAspectRatio: "none", viewBox: `0 0 ${width} ${height}`, children: [jsxs("g", { ref: beamGroupRef, opacity: "0", children: [jsx("rect", { x: rectOffset, y: rectOffset, width: rectWidth, height: rectHeight, rx: rectRadius, ry: rectRadius, pathLength: "1", fill: "none", stroke: `url(#${haloGradientId})`, strokeLinecap: "round", strokeWidth: "var(--beam-frame-halo-width)", vectorEffect: "non-scaling-stroke", style: {
179
+ strokeDasharray: 'calc(var(--beam-frame-beam-length) * 0.86) calc(1 - var(--beam-frame-beam-length) * 0.86)',
180
+ }, opacity: "var(--beam-frame-glow-opacity)" }), jsx("rect", { x: rectOffset, y: rectOffset, width: rectWidth, height: rectHeight, rx: rectRadius, ry: rectRadius, pathLength: "1", fill: "none", stroke: `url(#${gradientId})`, strokeLinecap: "round", strokeWidth: "var(--beam-frame-beam-width)", vectorEffect: "non-scaling-stroke", style: {
181
+ strokeDasharray: 'var(--beam-frame-beam-length) calc(1 - var(--beam-frame-beam-length))',
182
+ } })] }), jsxs("defs", { children: [jsxs("linearGradient", { id: haloGradientId, x1: "0%", x2: "100%", y1: "0%", y2: "100%", children: [jsx("stop", { offset: "0%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.18" }), jsx("stop", { offset: "34%", stopColor: "var(--beam-frame-color-b)", stopOpacity: "0.72" }), jsx("stop", { offset: "54%", stopColor: "var(--beam-frame-color-c)", stopOpacity: "1" }), jsx("stop", { offset: "74%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.66" }), jsx("stop", { offset: "100%", stopColor: "var(--beam-frame-color-b)", stopOpacity: "0.18" })] }), jsxs("linearGradient", { id: gradientId, x1: "0%", x2: "100%", y1: "0%", y2: "100%", children: [jsx("stop", { offset: "0%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.52" }), jsx("stop", { offset: "34%", stopColor: "var(--beam-frame-color-b)", stopOpacity: "0.9" }), jsx("stop", { offset: "50%", stopColor: "var(--beam-frame-color-c)", stopOpacity: "1" }), jsx("stop", { offset: "68%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.86" }), jsx("stop", { offset: "100%", stopColor: "var(--beam-frame-color-c)", stopOpacity: "0.52" })] })] })] }));
183
+ }
184
+ function MotionBeamFrame(props) {
185
+ const { children, active = false, interactive = true, intensity = 'regular', tone = 'theme', duration = 1.8, radius, className, } = props;
186
+ const prefersReducedMotion = useReducedMotion();
187
+ const { isRunning, interactionProps } = useInteractiveRunning(active, interactive);
188
+ const shouldRun = isRunning && !prefersReducedMotion;
189
+ const normalizedDuration = normalizeDuration(duration);
190
+ const { ref, size } = useMeasuredFrameSize();
191
+ return (jsx(BeamFrameShell, { active: active, interactive: interactive, intensity: intensity, tone: tone, duration: normalizedDuration, radius: radius, className: className, isRunning: shouldRun, interactionProps: interactionProps, rootRef: ref, renderBeam: () => (jsx(MotionAroundBeam, { isRunning: shouldRun, duration: normalizedDuration, radius: radius, size: size })), children: children }));
192
+ }
193
+ function AnimeBeamLayer({ isRunning, duration, radius, size, }) {
194
+ const aroundBeamRef = useRef(null);
195
+ const animationRef = useRef(null);
196
+ const hasStartedRef = useRef(false);
197
+ const gradientId = useId().replace(/:/g, '');
198
+ const haloGradientId = useId().replace(/:/g, '');
199
+ const strokeWidth = 3;
200
+ const width = Math.max(1, size.width);
201
+ const height = Math.max(1, size.height);
202
+ const rectOffset = strokeWidth / 2;
203
+ const rectWidth = Math.max(1, width - strokeWidth);
204
+ const rectHeight = Math.max(1, height - strokeWidth);
205
+ const rectRadius = Math.max(0, Math.min(radius !== null && radius !== void 0 ? radius : DEFAULT_RADIUS, rectWidth / 2, rectHeight / 2));
206
+ useEffect(() => {
207
+ var _a;
208
+ const node = aroundBeamRef.current;
209
+ if (!node) {
210
+ return undefined;
211
+ }
212
+ if (isRunning) {
213
+ hasStartedRef.current = true;
214
+ }
215
+ node.style.opacity = isRunning || hasStartedRef.current ? 'var(--beam-frame-beam-opacity)' : '0';
216
+ if (!isRunning) {
217
+ (_a = animationRef.current) === null || _a === void 0 ? void 0 : _a.pause();
218
+ return undefined;
219
+ }
220
+ if (animationRef.current) {
221
+ animationRef.current.playbackRate = BASE_DURATION_SECONDS / duration;
222
+ animationRef.current.play();
223
+ return undefined;
224
+ }
225
+ animationRef.current = waapi.animate(node, {
226
+ strokeDashoffset: [0, -1],
227
+ loop: true,
228
+ duration: BASE_DURATION_SECONDS * 1000,
229
+ ease: 'linear',
230
+ });
231
+ animationRef.current.playbackRate = BASE_DURATION_SECONDS / duration;
232
+ return undefined;
233
+ }, [duration, isRunning]);
234
+ useEffect(() => {
235
+ return () => {
236
+ var _a;
237
+ (_a = animationRef.current) === null || _a === void 0 ? void 0 : _a.revert();
238
+ animationRef.current = null;
239
+ };
240
+ }, []);
241
+ return (jsxs("svg", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 z-0 h-full w-full overflow-visible", preserveAspectRatio: "none", viewBox: `0 0 ${width} ${height}`, children: [jsxs("g", { ref: aroundBeamRef, opacity: "0", children: [jsx("rect", { x: rectOffset, y: rectOffset, width: rectWidth, height: rectHeight, rx: rectRadius, ry: rectRadius, pathLength: "1", fill: "none", stroke: `url(#${haloGradientId})`, strokeLinecap: "round", strokeWidth: "var(--beam-frame-halo-width)", vectorEffect: "non-scaling-stroke", style: {
242
+ strokeDasharray: 'calc(var(--beam-frame-beam-length) * 0.86) calc(1 - var(--beam-frame-beam-length) * 0.86)',
243
+ }, opacity: "var(--beam-frame-glow-opacity)" }), jsx("rect", { x: rectOffset, y: rectOffset, width: rectWidth, height: rectHeight, rx: rectRadius, ry: rectRadius, pathLength: "1", fill: "none", stroke: `url(#${gradientId})`, strokeLinecap: "round", strokeWidth: "var(--beam-frame-beam-width)", vectorEffect: "non-scaling-stroke", style: {
244
+ strokeDasharray: 'var(--beam-frame-beam-length) calc(1 - var(--beam-frame-beam-length))',
245
+ } })] }), jsxs("defs", { children: [jsxs("linearGradient", { id: haloGradientId, x1: "0%", x2: "100%", y1: "0%", y2: "100%", children: [jsx("stop", { offset: "0%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.18" }), jsx("stop", { offset: "34%", stopColor: "var(--beam-frame-color-b)", stopOpacity: "0.72" }), jsx("stop", { offset: "54%", stopColor: "var(--beam-frame-color-c)", stopOpacity: "1" }), jsx("stop", { offset: "74%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.66" }), jsx("stop", { offset: "100%", stopColor: "var(--beam-frame-color-b)", stopOpacity: "0.18" })] }), jsxs("linearGradient", { id: gradientId, x1: "0%", x2: "100%", y1: "0%", y2: "100%", children: [jsx("stop", { offset: "0%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.52" }), jsx("stop", { offset: "34%", stopColor: "var(--beam-frame-color-b)", stopOpacity: "0.9" }), jsx("stop", { offset: "50%", stopColor: "var(--beam-frame-color-c)", stopOpacity: "1" }), jsx("stop", { offset: "68%", stopColor: "var(--beam-frame-color-a)", stopOpacity: "0.86" }), jsx("stop", { offset: "100%", stopColor: "var(--beam-frame-color-c)", stopOpacity: "0.52" })] })] })] }));
246
+ }
247
+ function AnimeBeamFrame(props) {
248
+ const { children, active = false, interactive = true, intensity = 'regular', tone = 'theme', duration = 1.8, radius, className, } = props;
249
+ const prefersReducedMotion = useReducedMotion();
250
+ const { isRunning, interactionProps } = useInteractiveRunning(active, interactive);
251
+ const shouldRun = isRunning && !prefersReducedMotion;
252
+ const normalizedDuration = normalizeDuration(duration);
253
+ const { ref, size } = useMeasuredFrameSize();
254
+ return (jsx(BeamFrameShell, { active: active, interactive: interactive, intensity: intensity, tone: tone, duration: normalizedDuration, radius: radius, className: className, isRunning: shouldRun, interactionProps: interactionProps, rootRef: ref, renderBeam: () => (jsx(AnimeBeamLayer, { isRunning: shouldRun, duration: normalizedDuration, radius: radius, size: size })), children: children }));
255
+ }
256
+ const BeamFrame = MotionBeamFrame;
257
+
258
+ export { AnimeBeamFrame, BeamFrame, MotionBeamFrame };
@@ -0,0 +1,4 @@
1
+ export { AnimeBeamFrame } from './animate';
2
+ export { MotionBeamFrame } from './motion';
3
+ export { MotionBeamFrame as BeamFrame } from './motion';
4
+ export type { BeamFrameProps, BeamFrameTone } from './share-config';
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var animate = require('./animate.js');
5
+ var motion = require('./motion.js');
6
+
7
+
8
+
9
+ exports.AnimeBeamFrame = animate.AnimeBeamFrame;
10
+ exports.BeamFrame = motion.MotionBeamFrame;
11
+ exports.MotionBeamFrame = motion.MotionBeamFrame;
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ export { AnimeBeamFrame } from './animate.mjs';
3
+ export { MotionBeamFrame as BeamFrame, MotionBeamFrame } from './motion.mjs';
@@ -0,0 +1,3 @@
1
+ import { type BeamFrameProps } from './share-config';
2
+ export type { BeamFrameProps, BeamFrameTone } from './share-config';
3
+ export declare function MotionBeamFrame(props: BeamFrameProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,61 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var React = require('react');
6
+ var react = require('motion/react');
7
+ var shareConfig = require('./share-config.js');
8
+
9
+ function MotionAroundBeam({ isRunning, duration, radius, size, }) {
10
+ const auraGradientId = React.useId().replace(/:/g, '');
11
+ const softGlowFilterId = React.useId().replace(/:/g, '');
12
+ const beamGroupRef = React.useRef(null);
13
+ const controlsRef = React.useRef(null);
14
+ const hasStartedRef = React.useRef(false);
15
+ React.useEffect(() => {
16
+ var _a;
17
+ const node = beamGroupRef.current;
18
+ if (!node) {
19
+ return undefined;
20
+ }
21
+ if (isRunning) {
22
+ hasStartedRef.current = true;
23
+ }
24
+ node.style.opacity = isRunning || hasStartedRef.current ? 'var(--beam-frame-beam-opacity)' : '0';
25
+ if (!isRunning) {
26
+ (_a = controlsRef.current) === null || _a === void 0 ? void 0 : _a.pause();
27
+ return undefined;
28
+ }
29
+ if (controlsRef.current) {
30
+ controlsRef.current.speed = shareConfig.BASE_DURATION_SECONDS / duration;
31
+ controlsRef.current.play();
32
+ return undefined;
33
+ }
34
+ controlsRef.current = react.animate(node, { strokeDashoffset: [0, -1] }, {
35
+ duration: shareConfig.BASE_DURATION_SECONDS,
36
+ repeat: Infinity,
37
+ ease: 'linear',
38
+ });
39
+ controlsRef.current.speed = shareConfig.BASE_DURATION_SECONDS / duration;
40
+ return undefined;
41
+ }, [duration, isRunning]);
42
+ React.useEffect(() => {
43
+ return () => {
44
+ var _a;
45
+ (_a = controlsRef.current) === null || _a === void 0 ? void 0 : _a.stop();
46
+ controlsRef.current = null;
47
+ };
48
+ }, []);
49
+ return (jsxRuntime.jsx(shareConfig.BeamSvgLayer, { beamRef: beamGroupRef, auraGradientId: auraGradientId, softGlowFilterId: softGlowFilterId, radius: radius, size: size }));
50
+ }
51
+ function MotionBeamFrame(props) {
52
+ const { children, active = false, interactive = true, tone = 'theme', duration = shareConfig.BASE_DURATION_SECONDS, radius, className, } = props;
53
+ const prefersReducedMotion = react.useReducedMotion();
54
+ const { isRunning, interactionProps } = shareConfig.useInteractiveRunning(active, interactive);
55
+ const shouldRun = isRunning && !prefersReducedMotion;
56
+ const normalizedDuration = shareConfig.normalizeDuration(duration);
57
+ const { ref, size } = shareConfig.useMeasuredFrameSize();
58
+ return (jsxRuntime.jsx(shareConfig.BeamFrameShell, { active: active, interactive: interactive, tone: tone, duration: normalizedDuration, radius: radius, className: className, isRunning: shouldRun, interactionProps: interactionProps, rootRef: ref, renderBeam: () => (jsxRuntime.jsx(MotionAroundBeam, { isRunning: shouldRun, duration: normalizedDuration, radius: radius, size: size })), children: children }));
59
+ }
60
+
61
+ exports.MotionBeamFrame = MotionBeamFrame;