fancy-ui-react 0.3.0 → 0.4.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.
- package/README.md +52 -19
- package/dist/components/animated-beam/AnimatedBeam.d.ts +47 -11
- package/dist/components/animated-beam/AnimatedBeam.js +293 -118
- package/dist/components/animated-tooltip/AnimatedTooltip.d.ts +10 -1
- package/dist/components/animated-tooltip/AnimatedTooltip.js +170 -101
- package/dist/components/bento-grid/BentoFrame.d.ts +16 -0
- package/dist/components/bento-grid/BentoFrame.js +28 -0
- package/dist/components/bento-grid/BentoGrid.d.ts +5 -1
- package/dist/components/bento-grid/BentoGrid.js +71 -2
- package/dist/components/bento-grid/BentoGridCard.js +34 -26
- package/dist/components/bento-grid/BentoGridItem.js +10 -10
- package/dist/components/border-beam/BorderBeam.d.ts +55 -10
- package/dist/components/border-beam/BorderBeam.js +93 -16
- package/dist/components/compare/Compare.d.ts +32 -8
- package/dist/components/compare/Compare.js +213 -95
- package/dist/components/container-scroll/ContainerScroll.d.ts +26 -4
- package/dist/components/container-scroll/ContainerScroll.js +88 -49
- package/dist/components/dock/Dock.d.ts +10 -7
- package/dist/components/dock/Dock.js +76 -31
- package/dist/components/dock/DockIcon.d.ts +14 -3
- package/dist/components/dock/DockIcon.js +23 -19
- package/dist/components/dock/DockSeparator.d.ts +4 -1
- package/dist/components/dock/DockSeparator.js +5 -2
- package/dist/components/dock/types.d.ts +13 -6
- package/dist/components/dropdown-menu/menu-shared.d.ts +11 -8
- package/dist/components/editorial-engine/engine.js +1 -14
- package/dist/components/fireworks-hdr/webgl2-renderer.js +0 -19
- package/dist/components/fireworks-hdr/webgpu-renderer.js +3 -22
- package/dist/components/flip-card/FlipCard.d.ts +42 -1
- package/dist/components/flip-card/FlipCard.js +178 -25
- package/dist/components/flip-card/index.d.ts +1 -1
- package/dist/components/fluid-cursor/FluidCursor.js +5 -4
- package/dist/components/fluid-cursor/dev.d.ts +1 -0
- package/dist/components/fluid-cursor/dev.js +8 -0
- package/dist/components/fluid-cursor/fluid-shared.d.ts +0 -2
- package/dist/components/fluid-cursor/fluid-shared.js +0 -2
- package/dist/components/fluid-cursor/webgpu-engine.js +10 -24
- package/dist/components/glow-border/GlowBorder.d.ts +41 -1
- package/dist/components/glow-border/GlowBorder.js +96 -16
- package/dist/components/glow-border/index.d.ts +2 -2
- package/dist/components/gradient-button/GradientButton.d.ts +10 -5
- package/dist/components/gradient-button/GradientButton.js +25 -18
- package/dist/components/image-trail-cursor/ImageTrailCursor.js +1 -0
- package/dist/components/image-trail-cursor/trail-variants.d.ts +37 -1
- package/dist/components/image-trail-cursor/trail-variants.js +331 -8
- package/dist/components/interactive-hover-button/InteractiveHoverButton.js +30 -35
- package/dist/components/marquee/Marquee.d.ts +7 -3
- package/dist/components/marquee/Marquee.js +134 -2
- package/dist/components/marquee/ReviewCard.d.ts +2 -1
- package/dist/components/marquee/ReviewCard.js +20 -9
- package/dist/components/meteors/Meteors.d.ts +32 -10
- package/dist/components/meteors/Meteors.js +53 -20
- package/dist/components/mosaic-glow/mosaic-glow-core.d.ts +98 -10
- package/dist/components/neon-border/NeonBorder.d.ts +24 -5
- package/dist/components/neon-border/NeonBorder.js +37 -7
- package/dist/components/pagination/Pagination.js +220 -82
- package/dist/components/rainbow-button/RainbowButton.js +13 -5
- package/dist/components/ripple-button/RippleButton.d.ts +20 -1
- package/dist/components/ripple-button/RippleButton.js +44 -21
- package/dist/components/shimmer-button/ShimmerButton.d.ts +5 -5
- package/dist/components/shimmer-button/ShimmerButton.js +17 -19
- package/dist/components/smooth-cursor/SmoothCursor.d.ts +13 -9
- package/dist/components/smooth-cursor/SmoothCursor.js +114 -163
- package/dist/components/smooth-cursor/smooth-cursor-core.d.ts +85 -0
- package/dist/components/smooth-cursor/smooth-cursor-core.js +327 -0
- package/dist/components/stepper/Step.js +32 -19
- package/dist/components/stepper/Stepper.js +18 -2
- package/dist/components/stepper/types.d.ts +13 -0
- package/dist/components/timeline/Timeline.d.ts +8 -1
- package/dist/components/timeline/Timeline.js +165 -76
- package/dist/index.js +2 -1
- package/dist/internals/markdown.d.ts +5 -0
- package/dist/internals/motion/haptics.d.ts +0 -4
- package/dist/internals/motion/presence-core.d.ts +59 -0
- package/dist/internals/motion/presence-core.js +162 -0
- package/dist/internals/motion/presence.d.ts +2 -4
- package/dist/internals/motion/presence.js +1 -156
- package/dist/internals/motion/raf.d.ts +1 -1
- package/dist/internals/motion/stagger.d.ts +3 -4
- package/dist/internals/motion/tokens.js +4 -0
- package/dist/internals/motion/transitions.d.ts +17 -17
- package/dist/internals/motion/types.d.ts +6 -7
- package/dist/internals/relative-time.d.ts +1 -1
- package/dist/styles.css +3470 -203
- package/package.json +18 -2
- package/dist/components/fireworks-hdr/webgpu-types.d.ts +0 -159
|
@@ -1,24 +1,83 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs, jsx
|
|
3
|
-
import {
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
4
|
import { cn } from "../../utils.js";
|
|
5
5
|
import { useFancyId } from "../../internals/use-id.js";
|
|
6
6
|
import { useIsomorphicLayoutEffect } from "../../internals/dom/ssr.js";
|
|
7
7
|
import { useEventCallback } from "../../internals/dom/use-event-callback.js";
|
|
8
|
+
import { useReducedMotion } from "../../internals/motion/media-query.js";
|
|
9
|
+
/* empty css */
|
|
8
10
|
function mulberry32(seed) {
|
|
9
|
-
let
|
|
11
|
+
let a = seed >>> 0;
|
|
10
12
|
return () => {
|
|
11
|
-
|
|
12
|
-
let t =
|
|
13
|
+
a = a + 1831565813 >>> 0;
|
|
14
|
+
let t = a;
|
|
13
15
|
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
14
16
|
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
|
15
17
|
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
16
18
|
};
|
|
17
19
|
}
|
|
20
|
+
function beamDuration(seed = 1) {
|
|
21
|
+
return mulberry32(seed)() * 3 + 4;
|
|
22
|
+
}
|
|
23
|
+
const PATH_LENGTH = 1e3;
|
|
24
|
+
function packetLayers(tail, start, stop) {
|
|
25
|
+
const t = Math.min(0.9, Math.max(0.05, Number.isFinite(tail) ? tail : 0.35)) * PATH_LENGTH;
|
|
26
|
+
const spread = t * 0.07;
|
|
27
|
+
const mid = `color-mix(in oklab, ${start} 50%, ${stop})`;
|
|
28
|
+
const hot = `color-mix(in oklab, ${start} 45%, white)`;
|
|
29
|
+
const head = Math.max(12, t * 0.1);
|
|
30
|
+
const bands = [
|
|
31
|
+
["stop", stop, t, spread * 3, 0.26],
|
|
32
|
+
["mid", mid, t * 0.66, spread * 2, 0.34],
|
|
33
|
+
["start", start, t * 0.38, spread, 0.46]
|
|
34
|
+
];
|
|
35
|
+
const layers = [];
|
|
36
|
+
for (const [key, color, len, lag, opacity] of bands) {
|
|
37
|
+
for (const share of [1, 2 / 3, 1 / 3]) {
|
|
38
|
+
layers.push({ key, color, len: len * share, lag, opacity, width: 1 });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
layers.push({ key: "head", color: start, len: head * 1.7, lag: 0, opacity: 1, width: 1.6 });
|
|
42
|
+
layers.push({ key: "head", color: hot, len: head, lag: 0, opacity: 1, width: 0.7, core: true });
|
|
43
|
+
return layers;
|
|
44
|
+
}
|
|
45
|
+
function glowLayers(tail, start, stop) {
|
|
46
|
+
const all = packetLayers(tail, start, stop);
|
|
47
|
+
const bands = all.filter((l, i) => l.key !== "head" && i % 3 === 0);
|
|
48
|
+
const head = all[all.length - 2];
|
|
49
|
+
return [
|
|
50
|
+
...bands.map((l, i) => ({
|
|
51
|
+
...l,
|
|
52
|
+
opacity: Math.min(1, l.opacity * (1.5 + i * 0.4)),
|
|
53
|
+
width: 2.5
|
|
54
|
+
})),
|
|
55
|
+
{ ...head, len: head.len * 1.6, opacity: 1, width: 3.5 }
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
function dashVars(layer) {
|
|
59
|
+
const o0 = layer.len + 4;
|
|
60
|
+
const o1 = layer.len - (PATH_LENGTH - layer.lag);
|
|
61
|
+
const o2 = -1004;
|
|
62
|
+
return {
|
|
63
|
+
"--_len": layer.len.toFixed(1),
|
|
64
|
+
"--_o0": o0.toFixed(1),
|
|
65
|
+
"--_o1": o1.toFixed(1),
|
|
66
|
+
"--_o2": o2.toFixed(1)
|
|
67
|
+
};
|
|
68
|
+
}
|
|
18
69
|
function resolveTarget(target) {
|
|
19
70
|
if (!target) return null;
|
|
20
71
|
return target instanceof HTMLElement ? target : target.current;
|
|
21
72
|
}
|
|
73
|
+
const EMPTY_GEOMETRY = {
|
|
74
|
+
pathD: "",
|
|
75
|
+
flowD: "",
|
|
76
|
+
ends: { x1: 0, y1: 0, x2: 0, y2: 0 },
|
|
77
|
+
landingRadius: 24,
|
|
78
|
+
width: 0,
|
|
79
|
+
height: 0
|
|
80
|
+
};
|
|
22
81
|
function AnimatedBeam({
|
|
23
82
|
className = "",
|
|
24
83
|
containerRef,
|
|
@@ -26,9 +85,9 @@ function AnimatedBeam({
|
|
|
26
85
|
toRef,
|
|
27
86
|
curvature = 0,
|
|
28
87
|
reverse = false,
|
|
29
|
-
pathColor
|
|
88
|
+
pathColor,
|
|
30
89
|
pathWidth = 2,
|
|
31
|
-
pathOpacity
|
|
90
|
+
pathOpacity,
|
|
32
91
|
gradientStartColor = "#FFAA40",
|
|
33
92
|
gradientStopColor = "#9C40FF",
|
|
34
93
|
delay = 0,
|
|
@@ -37,47 +96,62 @@ function AnimatedBeam({
|
|
|
37
96
|
startYOffset = 0,
|
|
38
97
|
endXOffset = 0,
|
|
39
98
|
endYOffset = 0,
|
|
99
|
+
pulses = 1,
|
|
100
|
+
tail = 0.35,
|
|
101
|
+
glow = 0.6,
|
|
40
102
|
seed = 1
|
|
41
103
|
}) {
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
104
|
+
const uid = useFancyId("beam");
|
|
105
|
+
const id = uid;
|
|
106
|
+
const glowId = `${uid}-glow`;
|
|
107
|
+
const bloomId = `${uid}-bloom`;
|
|
108
|
+
const reduced = useReducedMotion();
|
|
109
|
+
const cycle = Number.isFinite(duration) && duration > 0 ? duration : beamDuration(seed);
|
|
110
|
+
const packetCount = Math.max(1, Math.min(12, Math.floor(Number.isFinite(pulses) ? pulses : 1)));
|
|
111
|
+
const packets = Array.from(
|
|
112
|
+
{ length: packetCount },
|
|
113
|
+
(_, i) => +(delay + i * cycle / packetCount).toFixed(3)
|
|
114
|
+
);
|
|
115
|
+
const layers = packetLayers(tail, gradientStartColor, gradientStopColor);
|
|
116
|
+
const glows = glowLayers(tail, gradientStartColor, gradientStopColor);
|
|
117
|
+
const glowAmount = Math.min(1, Math.max(0, Number.isFinite(glow) ? glow : 0.6));
|
|
118
|
+
const midColor = `color-mix(in oklab, ${gradientStartColor} 50%, ${gradientStopColor})`;
|
|
119
|
+
const hotColor = `color-mix(in oklab, ${gradientStartColor} 45%, white)`;
|
|
120
|
+
const fibreOpacity = pathOpacity ?? (pathColor ? 0.2 : 1);
|
|
121
|
+
const fibreStyle = pathColor ? { stroke: pathColor } : void 0;
|
|
122
|
+
const [geo, setGeo] = useState(EMPTY_GEOMETRY);
|
|
123
|
+
const { pathD, flowD, ends, landingRadius } = geo;
|
|
124
|
+
const landing = reverse ? { x: ends.x1, y: ends.y1 } : { x: ends.x2, y: ends.y2 };
|
|
125
|
+
const launch = reverse ? { x: ends.x2, y: ends.y2 } : { x: ends.x1, y: ends.y1 };
|
|
57
126
|
const updatePath = useEventCallback(() => {
|
|
58
127
|
const container = resolveTarget(containerRef);
|
|
59
128
|
const from = resolveTarget(fromRef);
|
|
60
129
|
const to = resolveTarget(toRef);
|
|
61
|
-
if (container && from && to)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
130
|
+
if (!(container && from && to)) return;
|
|
131
|
+
const containerRect = container.getBoundingClientRect();
|
|
132
|
+
const rectA = from.getBoundingClientRect();
|
|
133
|
+
const rectB = to.getBoundingClientRect();
|
|
134
|
+
const startX = rectA.left - containerRect.left + rectA.width / 2 + startXOffset;
|
|
135
|
+
const startY = rectA.top - containerRect.top + rectA.height / 2 + startYOffset;
|
|
136
|
+
const endX = rectB.left - containerRect.left + rectB.width / 2 + endXOffset;
|
|
137
|
+
const endY = rectB.top - containerRect.top + rectB.height / 2 + endYOffset;
|
|
138
|
+
const cx = (startX + endX) / 2;
|
|
139
|
+
const cy = startY - curvature;
|
|
140
|
+
const d = `M ${startX},${startY} Q ${cx},${cy} ${endX},${endY}`;
|
|
141
|
+
const target = reverse ? rectA : rectB;
|
|
142
|
+
const next = {
|
|
143
|
+
pathD: d,
|
|
144
|
+
flowD: reverse ? `M ${endX},${endY} Q ${cx},${cy} ${startX},${startY}` : d,
|
|
145
|
+
ends: { x1: startX, y1: startY, x2: endX, y2: endY },
|
|
146
|
+
landingRadius: Math.max(8, Math.max(target.width, target.height) / 2),
|
|
147
|
+
width: containerRect.width,
|
|
148
|
+
height: containerRect.height
|
|
149
|
+
};
|
|
150
|
+
setGeo(
|
|
151
|
+
(prev) => prev.pathD === next.pathD && prev.flowD === next.flowD && prev.landingRadius === next.landingRadius && prev.width === next.width && prev.height === next.height ? prev : next
|
|
152
|
+
);
|
|
79
153
|
});
|
|
80
|
-
|
|
154
|
+
useEffect(() => {
|
|
81
155
|
const container = resolveTarget(containerRef);
|
|
82
156
|
if (!container) return;
|
|
83
157
|
const resizeObserver = new ResizeObserver(() => {
|
|
@@ -89,104 +163,205 @@ function AnimatedBeam({
|
|
|
89
163
|
resizeObserver.disconnect();
|
|
90
164
|
};
|
|
91
165
|
}, [containerRef, updatePath]);
|
|
166
|
+
useIsomorphicLayoutEffect(() => {
|
|
167
|
+
updatePath();
|
|
168
|
+
}, [
|
|
169
|
+
containerRef,
|
|
170
|
+
fromRef,
|
|
171
|
+
toRef,
|
|
172
|
+
curvature,
|
|
173
|
+
reverse,
|
|
174
|
+
startXOffset,
|
|
175
|
+
startYOffset,
|
|
176
|
+
endXOffset,
|
|
177
|
+
endYOffset,
|
|
178
|
+
updatePath
|
|
179
|
+
]);
|
|
92
180
|
return /* @__PURE__ */ jsxs(
|
|
93
181
|
"svg",
|
|
94
182
|
{
|
|
95
183
|
fill: "none",
|
|
96
|
-
|
|
97
|
-
|
|
184
|
+
"aria-hidden": "true",
|
|
185
|
+
width: geo.width,
|
|
186
|
+
height: geo.height,
|
|
98
187
|
xmlns: "http://www.w3.org/2000/svg",
|
|
99
188
|
className: cn(
|
|
100
|
-
"pointer-events-none absolute top-0 left-0 transform-gpu stroke-2",
|
|
189
|
+
"animated-beam pointer-events-none absolute top-0 left-0 transform-gpu stroke-2",
|
|
101
190
|
className
|
|
102
191
|
),
|
|
103
|
-
viewBox: `0 0 ${
|
|
192
|
+
viewBox: `0 0 ${geo.width} ${geo.height}`,
|
|
193
|
+
"data-duration": cycle.toFixed(3),
|
|
194
|
+
style: { "--_dur": `${cycle.toFixed(3)}s` },
|
|
104
195
|
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
196
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
197
|
+
/* @__PURE__ */ jsxs(
|
|
198
|
+
"linearGradient",
|
|
199
|
+
{
|
|
200
|
+
id,
|
|
201
|
+
gradientUnits: "userSpaceOnUse",
|
|
202
|
+
x1: launch.x,
|
|
203
|
+
y1: launch.y,
|
|
204
|
+
x2: landing.x,
|
|
205
|
+
y2: landing.y,
|
|
206
|
+
children: [
|
|
207
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", style: { stopColor: hotColor }, stopOpacity: "0.9" }),
|
|
208
|
+
/* @__PURE__ */ jsx("stop", { offset: "30%", style: { stopColor: gradientStartColor } }),
|
|
209
|
+
/* @__PURE__ */ jsx("stop", { offset: "65%", style: { stopColor: midColor } }),
|
|
210
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", style: { stopColor: gradientStopColor } })
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
),
|
|
214
|
+
/* @__PURE__ */ jsx(
|
|
215
|
+
"filter",
|
|
216
|
+
{
|
|
217
|
+
id: glowId,
|
|
218
|
+
filterUnits: "userSpaceOnUse",
|
|
219
|
+
x: -40,
|
|
220
|
+
y: -40,
|
|
221
|
+
width: geo.width + 80,
|
|
222
|
+
height: geo.height + 80,
|
|
223
|
+
children: /* @__PURE__ */ jsx("feGaussianBlur", { stdDeviation: 1.5 + 4 * glowAmount })
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
/* @__PURE__ */ jsx(
|
|
227
|
+
"filter",
|
|
228
|
+
{
|
|
229
|
+
id: bloomId,
|
|
230
|
+
filterUnits: "userSpaceOnUse",
|
|
231
|
+
x: -40,
|
|
232
|
+
y: -40,
|
|
233
|
+
width: geo.width + 80,
|
|
234
|
+
height: geo.height + 80,
|
|
235
|
+
children: /* @__PURE__ */ jsx("feGaussianBlur", { stdDeviation: 5 + 6 * glowAmount })
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
] }),
|
|
239
|
+
/* @__PURE__ */ jsxs("g", { className: "fibre", opacity: fibreOpacity, children: [
|
|
240
|
+
/* @__PURE__ */ jsx(
|
|
241
|
+
"path",
|
|
242
|
+
{
|
|
243
|
+
className: "fibre-sheath",
|
|
244
|
+
d: pathD,
|
|
245
|
+
strokeWidth: pathWidth + 2,
|
|
246
|
+
strokeLinecap: "round",
|
|
247
|
+
style: fibreStyle,
|
|
248
|
+
strokeOpacity: pathColor ? 0.5 : 1
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
/* @__PURE__ */ jsx(
|
|
252
|
+
"path",
|
|
253
|
+
{
|
|
254
|
+
className: "fibre-core",
|
|
255
|
+
d: pathD,
|
|
256
|
+
strokeWidth: pathWidth,
|
|
257
|
+
strokeLinecap: "round",
|
|
258
|
+
style: fibreStyle
|
|
259
|
+
}
|
|
260
|
+
),
|
|
261
|
+
!pathColor && /* @__PURE__ */ jsx(
|
|
262
|
+
"path",
|
|
263
|
+
{
|
|
264
|
+
className: "fibre-glint",
|
|
265
|
+
d: pathD,
|
|
266
|
+
strokeWidth: Math.max(0.5, pathWidth * 0.3),
|
|
267
|
+
strokeLinecap: "round"
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
] }),
|
|
271
|
+
reduced ? (
|
|
272
|
+
/* Still frame: the fibre holds a soft gradient along its length. */
|
|
273
|
+
/* @__PURE__ */ jsxs("g", { className: "still", "data-still": "", children: [
|
|
158
274
|
/* @__PURE__ */ jsx(
|
|
159
|
-
"
|
|
275
|
+
"path",
|
|
160
276
|
{
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
calcMode: "spline",
|
|
168
|
-
repeatCount: "indefinite"
|
|
277
|
+
d: pathD,
|
|
278
|
+
stroke: `url(#${id})`,
|
|
279
|
+
strokeWidth: pathWidth * 2.5 + 3,
|
|
280
|
+
strokeLinecap: "round",
|
|
281
|
+
opacity: 0.35 * glowAmount,
|
|
282
|
+
filter: `url(#${glowId})`
|
|
169
283
|
}
|
|
170
284
|
),
|
|
171
285
|
/* @__PURE__ */ jsx(
|
|
172
|
-
"
|
|
286
|
+
"path",
|
|
173
287
|
{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
keySplines: "0.16 1 0.3 1",
|
|
180
|
-
calcMode: "spline",
|
|
181
|
-
repeatCount: "indefinite"
|
|
288
|
+
d: pathD,
|
|
289
|
+
stroke: `url(#${id})`,
|
|
290
|
+
strokeWidth: pathWidth,
|
|
291
|
+
strokeLinecap: "round",
|
|
292
|
+
opacity: "0.55"
|
|
182
293
|
}
|
|
183
294
|
)
|
|
184
295
|
] })
|
|
185
|
-
|
|
296
|
+
) : packets.map((packetDelay, i) => /* @__PURE__ */ jsxs(
|
|
297
|
+
"g",
|
|
298
|
+
{
|
|
299
|
+
className: "packet",
|
|
300
|
+
"data-packet": i,
|
|
301
|
+
style: { "--_delay": `${packetDelay}s` },
|
|
302
|
+
children: [
|
|
303
|
+
/* @__PURE__ */ jsxs("g", { className: "bloom", opacity: 0.3 + 0.7 * glowAmount, children: [
|
|
304
|
+
/* @__PURE__ */ jsx(
|
|
305
|
+
"circle",
|
|
306
|
+
{
|
|
307
|
+
className: "bloom-disc",
|
|
308
|
+
cx: landing.x,
|
|
309
|
+
cy: landing.y,
|
|
310
|
+
r: landingRadius + 6,
|
|
311
|
+
style: { fill: `color-mix(in oklab, ${gradientStopColor} 75%, white)` },
|
|
312
|
+
filter: `url(#${bloomId})`
|
|
313
|
+
}
|
|
314
|
+
),
|
|
315
|
+
/* @__PURE__ */ jsx(
|
|
316
|
+
"circle",
|
|
317
|
+
{
|
|
318
|
+
className: "bloom-ring",
|
|
319
|
+
cx: landing.x,
|
|
320
|
+
cy: landing.y,
|
|
321
|
+
r: landingRadius + 4,
|
|
322
|
+
strokeWidth: "1",
|
|
323
|
+
style: { stroke: `color-mix(in oklab, ${gradientStopColor} 55%, white)` }
|
|
324
|
+
}
|
|
325
|
+
)
|
|
326
|
+
] }),
|
|
327
|
+
/* @__PURE__ */ jsx("g", { filter: `url(#${glowId})`, opacity: glowAmount, children: glows.map((layer, j) => /* @__PURE__ */ jsx(
|
|
328
|
+
"path",
|
|
329
|
+
{
|
|
330
|
+
className: "packet-layer",
|
|
331
|
+
d: flowD,
|
|
332
|
+
pathLength: 1e3,
|
|
333
|
+
strokeWidth: pathWidth * layer.width + 2,
|
|
334
|
+
strokeLinecap: "round",
|
|
335
|
+
style: { ...dashVars(layer), stroke: layer.color },
|
|
336
|
+
opacity: layer.opacity
|
|
337
|
+
},
|
|
338
|
+
j
|
|
339
|
+
)) }),
|
|
340
|
+
layers.map((layer, j) => /* @__PURE__ */ jsx(
|
|
341
|
+
"path",
|
|
342
|
+
{
|
|
343
|
+
className: layer.core ? "packet-layer packet-core" : "packet-layer",
|
|
344
|
+
"data-layer": layer.key,
|
|
345
|
+
d: flowD,
|
|
346
|
+
pathLength: 1e3,
|
|
347
|
+
strokeWidth: pathWidth * layer.width,
|
|
348
|
+
strokeLinecap: "round",
|
|
349
|
+
style: layer.core ? { ...dashVars(layer), "--_core": gradientStartColor } : { ...dashVars(layer), stroke: layer.color },
|
|
350
|
+
opacity: layer.opacity
|
|
351
|
+
},
|
|
352
|
+
j
|
|
353
|
+
))
|
|
354
|
+
]
|
|
355
|
+
},
|
|
356
|
+
i
|
|
357
|
+
))
|
|
186
358
|
]
|
|
187
359
|
}
|
|
188
360
|
);
|
|
189
361
|
}
|
|
190
362
|
export {
|
|
191
|
-
AnimatedBeam
|
|
363
|
+
AnimatedBeam,
|
|
364
|
+
beamDuration,
|
|
365
|
+
glowLayers,
|
|
366
|
+
packetLayers
|
|
192
367
|
};
|
|
@@ -9,5 +9,14 @@ export interface AnimatedTooltipProps {
|
|
|
9
9
|
items: TooltipItem[];
|
|
10
10
|
/** Additional CSS classes for the container */
|
|
11
11
|
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Tint of the presence ring and the light sweep under the name. Any CSS
|
|
14
|
+
* colour (`"#f5a97f"`, `"oklch(0.7 0.14 160)"`, `"var(--primary)"`).
|
|
15
|
+
* Leave unset for the default soft iridescent pair, which adapts to the
|
|
16
|
+
* light and dark themes.
|
|
17
|
+
*/
|
|
18
|
+
accent?: string;
|
|
19
|
+
/** Avatar diameter in pixels. */
|
|
20
|
+
size?: number;
|
|
12
21
|
}
|
|
13
|
-
export declare function AnimatedTooltip({ items, className }: AnimatedTooltipProps): import("react").JSX.Element;
|
|
22
|
+
export declare function AnimatedTooltip({ items, className, accent, size }: AnimatedTooltipProps): import("react").JSX.Element;
|