@timbal-ai/timbal-react 1.4.0 → 1.6.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/CHANGELOG.md +30 -0
- package/README.md +43 -4
- package/dist/app.cjs +3770 -1506
- package/dist/app.d.cts +76 -31
- package/dist/app.d.ts +76 -31
- package/dist/app.esm.js +30 -8
- package/dist/{chart-artifact-C8-Py6lc.d.cts → chart-artifact-C2pZQsaP.d.ts} +247 -41
- package/dist/{chart-artifact-CMnDys2t.d.ts → chart-artifact-VAqgH-My.d.cts} +247 -41
- package/dist/{chat-ClmzWzCX.d.cts → chat-DDsp-Vzz.d.cts} +1 -1
- package/dist/{chat-ClmzWzCX.d.ts → chat-DDsp-Vzz.d.ts} +1 -1
- package/dist/chat.cjs +280 -123
- package/dist/chat.d.cts +3 -3
- package/dist/chat.d.ts +3 -3
- package/dist/chat.esm.js +4 -3
- package/dist/chunk-24B4I4XC.esm.js +232 -0
- package/dist/{chunk-VOWNCS3F.esm.js → chunk-6SQMTBPL.esm.js} +1669 -504
- package/dist/chunk-EDEKQYSU.esm.js +10 -0
- package/dist/{chunk-QIABF4KB.esm.js → chunk-ELEY66OH.esm.js} +2 -2
- package/dist/{chunk-THBA27QY.esm.js → chunk-HSL36SJ4.esm.js} +243 -124
- package/dist/chunk-JJOO4PR5.esm.js +391 -0
- package/dist/{chunk-QU7ET55D.esm.js → chunk-MBS7XHV2.esm.js} +335 -192
- package/dist/chunk-NO5AWNWT.esm.js +1066 -0
- package/dist/{chunk-VXMM2HX7.esm.js → chunk-R4RQT2XQ.esm.js} +3 -3
- package/dist/{chunk-OFWC4MIY.esm.js → chunk-TMP7RIA7.esm.js} +5 -3
- package/dist/{chunk-GQBYZRD7.esm.js → chunk-WQIQW7EM.esm.js} +40 -28
- package/dist/{chunk-OH23AX2V.esm.js → chunk-YYEI6XME.esm.js} +441 -957
- package/dist/{circular-progress-Ci8L-Hfa.d.cts → circular-progress-B9nnwzCu.d.cts} +20 -78
- package/dist/{circular-progress-Ci8L-Hfa.d.ts → circular-progress-B9nnwzCu.d.ts} +20 -78
- package/dist/index.cjs +5547 -3192
- package/dist/index.d.cts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.esm.js +76 -44
- package/dist/kanban-FFBeaZPS.d.cts +212 -0
- package/dist/kanban-FFBeaZPS.d.ts +212 -0
- package/dist/{layout-BTJyU8wd.d.ts → layout-CuKeSY74.d.ts} +1 -1
- package/dist/{layout-C2G-FcER.d.cts → layout-PzVwkJyL.d.cts} +1 -1
- package/dist/site.cjs +429 -0
- package/dist/site.d.cts +198 -0
- package/dist/site.d.ts +198 -0
- package/dist/site.esm.js +23 -0
- package/dist/studio.cjs +722 -363
- package/dist/studio.d.cts +2 -2
- package/dist/studio.d.ts +2 -2
- package/dist/studio.esm.js +8 -6
- package/dist/styles.css +56 -0
- package/dist/{timbal-v2-button-CNfdwGq4.d.cts → timbal-v2-button-DCAZNyUx.d.cts} +3 -3
- package/dist/{timbal-v2-button-CNfdwGq4.d.ts → timbal-v2-button-DCAZNyUx.d.ts} +3 -3
- package/dist/ui.cjs +1553 -708
- package/dist/ui.d.cts +11 -4
- package/dist/ui.d.ts +11 -4
- package/dist/ui.esm.js +45 -36
- package/dist/{welcome-DXqsGTwH.d.ts → welcome-B00oH5Io.d.cts} +5 -1
- package/dist/{welcome-BFGRoNfK.d.cts → welcome-DU-4NTjZ.d.ts} +5 -1
- package/package.json +9 -1
- package/dist/button-BoyX5pM_.d.cts +0 -18
- package/dist/button-BoyX5pM_.d.ts +0 -18
- package/dist/chunk-UCGVL7ZY.esm.js +0 -52
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-EDEKQYSU.esm.js";
|
|
4
|
+
|
|
5
|
+
// src/site/easing.ts
|
|
6
|
+
var EASE = {
|
|
7
|
+
/** Strong slow-out — the workhorse for entrances and reveals. */
|
|
8
|
+
out: [0.16, 1, 0.3, 1],
|
|
9
|
+
/** Symmetric in-out for loops and continuous motion. */
|
|
10
|
+
inOut: [0.65, 0, 0.35, 1],
|
|
11
|
+
/** Gentle in-out, good for parallax / large translations. */
|
|
12
|
+
soft: [0.4, 0, 0.2, 1]
|
|
13
|
+
};
|
|
14
|
+
var DURATION = {
|
|
15
|
+
fast: 0.4,
|
|
16
|
+
base: 0.7,
|
|
17
|
+
slow: 1.1
|
|
18
|
+
};
|
|
19
|
+
var SPRING = {
|
|
20
|
+
/** Tight, responsive follow. */
|
|
21
|
+
snappy: { stiffness: 350, damping: 30, mass: 0.4 },
|
|
22
|
+
/** Looser, more elastic follow. */
|
|
23
|
+
smooth: { stiffness: 150, damping: 20, mass: 0.6 }
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// src/site/Reveal.tsx
|
|
27
|
+
import * as React from "react";
|
|
28
|
+
import { motion, useReducedMotion } from "motion/react";
|
|
29
|
+
import { jsx } from "react/jsx-runtime";
|
|
30
|
+
function hidden(variant, distance) {
|
|
31
|
+
switch (variant) {
|
|
32
|
+
case "fade":
|
|
33
|
+
return { opacity: 0 };
|
|
34
|
+
case "fade-up":
|
|
35
|
+
return { opacity: 0, y: distance };
|
|
36
|
+
case "fade-down":
|
|
37
|
+
return { opacity: 0, y: -distance };
|
|
38
|
+
case "fade-left":
|
|
39
|
+
return { opacity: 0, x: distance };
|
|
40
|
+
case "fade-right":
|
|
41
|
+
return { opacity: 0, x: -distance };
|
|
42
|
+
case "blur":
|
|
43
|
+
return { opacity: 0, filter: "blur(12px)" };
|
|
44
|
+
case "scale":
|
|
45
|
+
return { opacity: 0, scale: 0.94 };
|
|
46
|
+
case "mask-up":
|
|
47
|
+
return { y: "110%" };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function shown(variant) {
|
|
51
|
+
if (variant === "mask-up") return { y: "0%" };
|
|
52
|
+
if (variant === "blur") return { opacity: 1, filter: "blur(0px)" };
|
|
53
|
+
if (variant === "scale") return { opacity: 1, scale: 1 };
|
|
54
|
+
return { opacity: 1, x: 0, y: 0 };
|
|
55
|
+
}
|
|
56
|
+
var Reveal = React.forwardRef(function Reveal2({
|
|
57
|
+
variant = "fade-up",
|
|
58
|
+
delay = 0,
|
|
59
|
+
duration = DURATION.base,
|
|
60
|
+
distance = 28,
|
|
61
|
+
amount = 0.3,
|
|
62
|
+
repeat = false,
|
|
63
|
+
as = "div",
|
|
64
|
+
className,
|
|
65
|
+
children,
|
|
66
|
+
...rest
|
|
67
|
+
}, ref) {
|
|
68
|
+
const reduce = useReducedMotion();
|
|
69
|
+
const isMask = variant === "mask-up";
|
|
70
|
+
if (reduce) {
|
|
71
|
+
const Tag = as;
|
|
72
|
+
return /* @__PURE__ */ jsx(Tag, { ref, className: cn(isMask && "overflow-hidden", className), ...rest, children });
|
|
73
|
+
}
|
|
74
|
+
const variants = {
|
|
75
|
+
hidden: hidden(variant, distance),
|
|
76
|
+
shown: shown(variant)
|
|
77
|
+
};
|
|
78
|
+
const MotionTag = motion[as] ?? motion.div;
|
|
79
|
+
const inner = /* @__PURE__ */ jsx(
|
|
80
|
+
MotionTag,
|
|
81
|
+
{
|
|
82
|
+
ref,
|
|
83
|
+
className,
|
|
84
|
+
variants,
|
|
85
|
+
initial: "hidden",
|
|
86
|
+
whileInView: "shown",
|
|
87
|
+
viewport: { once: !repeat, amount },
|
|
88
|
+
transition: { duration, delay, ease: EASE.out },
|
|
89
|
+
...rest,
|
|
90
|
+
children
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
if (isMask) {
|
|
94
|
+
return /* @__PURE__ */ jsx("span", { className: "block overflow-hidden", children: inner });
|
|
95
|
+
}
|
|
96
|
+
return inner;
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// src/site/TextReveal.tsx
|
|
100
|
+
import * as React2 from "react";
|
|
101
|
+
import { motion as motion2, useReducedMotion as useReducedMotion2 } from "motion/react";
|
|
102
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
103
|
+
var tokenVariants = {
|
|
104
|
+
hidden: { y: "115%" },
|
|
105
|
+
shown: { y: "0%" }
|
|
106
|
+
};
|
|
107
|
+
function TextReveal({
|
|
108
|
+
children,
|
|
109
|
+
splitBy = "words",
|
|
110
|
+
stagger = 0.06,
|
|
111
|
+
delay = 0,
|
|
112
|
+
duration = DURATION.base,
|
|
113
|
+
repeat = false,
|
|
114
|
+
amount = 0.4,
|
|
115
|
+
as = "span",
|
|
116
|
+
className,
|
|
117
|
+
...rest
|
|
118
|
+
}) {
|
|
119
|
+
const reduce = useReducedMotion2();
|
|
120
|
+
const Tag = as;
|
|
121
|
+
const tokens = React2.useMemo(() => {
|
|
122
|
+
if (splitBy === "lines") return children.split("\n");
|
|
123
|
+
return children.split(/(\s+)/).filter((t) => t.length > 0);
|
|
124
|
+
}, [children, splitBy]);
|
|
125
|
+
if (reduce) {
|
|
126
|
+
return /* @__PURE__ */ jsx2(Tag, { className, ...rest, children });
|
|
127
|
+
}
|
|
128
|
+
const containerVariants = {
|
|
129
|
+
hidden: {},
|
|
130
|
+
shown: { transition: { staggerChildren: stagger, delayChildren: delay } }
|
|
131
|
+
};
|
|
132
|
+
return /* @__PURE__ */ jsx2(
|
|
133
|
+
motion2.span,
|
|
134
|
+
{
|
|
135
|
+
variants: containerVariants,
|
|
136
|
+
initial: "hidden",
|
|
137
|
+
whileInView: "shown",
|
|
138
|
+
viewport: { once: !repeat, amount },
|
|
139
|
+
className: cn(as === "span" ? "inline" : "block", className),
|
|
140
|
+
...rest,
|
|
141
|
+
children: /* @__PURE__ */ jsx2(Tag, { className: as === "span" ? "inline" : "block", children: tokens.map(
|
|
142
|
+
(token, i) => /^\s+$/.test(token) && splitBy === "words" ? /* @__PURE__ */ jsx2("span", { children: " " }, i) : /* @__PURE__ */ jsx2(
|
|
143
|
+
"span",
|
|
144
|
+
{
|
|
145
|
+
className: cn(
|
|
146
|
+
"overflow-hidden",
|
|
147
|
+
splitBy === "lines" ? "block" : "inline-block align-bottom"
|
|
148
|
+
),
|
|
149
|
+
children: /* @__PURE__ */ jsx2(
|
|
150
|
+
motion2.span,
|
|
151
|
+
{
|
|
152
|
+
className: "inline-block",
|
|
153
|
+
variants: tokenVariants,
|
|
154
|
+
transition: { duration, ease: EASE.out },
|
|
155
|
+
children: token
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
},
|
|
159
|
+
i
|
|
160
|
+
)
|
|
161
|
+
) })
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// src/site/Parallax.tsx
|
|
167
|
+
import * as React3 from "react";
|
|
168
|
+
import {
|
|
169
|
+
motion as motion3,
|
|
170
|
+
useReducedMotion as useReducedMotion3,
|
|
171
|
+
useScroll,
|
|
172
|
+
useSpring,
|
|
173
|
+
useTransform
|
|
174
|
+
} from "motion/react";
|
|
175
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
176
|
+
var Parallax = React3.forwardRef(function Parallax2({ speed = 0.2, axis = "y", smooth = true, className, children, style, ...rest }, forwardedRef) {
|
|
177
|
+
const reduce = useReducedMotion3();
|
|
178
|
+
const innerRef = React3.useRef(null);
|
|
179
|
+
React3.useImperativeHandle(forwardedRef, () => innerRef.current);
|
|
180
|
+
const { scrollYProgress } = useScroll({
|
|
181
|
+
target: innerRef,
|
|
182
|
+
offset: ["start end", "end start"]
|
|
183
|
+
});
|
|
184
|
+
const range = 100 * speed;
|
|
185
|
+
const raw = useTransform(scrollYProgress, [0, 1], [range, -range]);
|
|
186
|
+
const smoothed = useSpring(raw, { stiffness: 120, damping: 30, mass: 0.4 });
|
|
187
|
+
const value = smooth ? smoothed : raw;
|
|
188
|
+
if (reduce) {
|
|
189
|
+
return /* @__PURE__ */ jsx3("div", { ref: innerRef, className, style, ...rest, children });
|
|
190
|
+
}
|
|
191
|
+
return /* @__PURE__ */ jsx3(
|
|
192
|
+
motion3.div,
|
|
193
|
+
{
|
|
194
|
+
ref: innerRef,
|
|
195
|
+
className: cn("will-change-transform", className),
|
|
196
|
+
style: { ...style, [axis]: value },
|
|
197
|
+
...rest,
|
|
198
|
+
children
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
// src/site/Marquee.tsx
|
|
204
|
+
import * as React4 from "react";
|
|
205
|
+
import {
|
|
206
|
+
motion as motion4,
|
|
207
|
+
useAnimationFrame,
|
|
208
|
+
useMotionValue,
|
|
209
|
+
useReducedMotion as useReducedMotion4
|
|
210
|
+
} from "motion/react";
|
|
211
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
212
|
+
var Marquee = React4.forwardRef(function Marquee2({ speed = 60, direction = "left", pauseOnHover = true, gap = "3rem", className, children, ...rest }, ref) {
|
|
213
|
+
const reduce = useReducedMotion4();
|
|
214
|
+
const x = useMotionValue(0);
|
|
215
|
+
const setWidthRef = React4.useRef(0);
|
|
216
|
+
const groupRef = React4.useRef(null);
|
|
217
|
+
const [paused, setPaused] = React4.useState(false);
|
|
218
|
+
React4.useEffect(() => {
|
|
219
|
+
const el = groupRef.current;
|
|
220
|
+
if (!el) return;
|
|
221
|
+
const measure = () => {
|
|
222
|
+
const gapPx = parseFloat(getComputedStyle(el.parentElement).columnGap || "0") || 0;
|
|
223
|
+
setWidthRef.current = el.offsetWidth + gapPx;
|
|
224
|
+
};
|
|
225
|
+
measure();
|
|
226
|
+
const ro = new ResizeObserver(measure);
|
|
227
|
+
ro.observe(el);
|
|
228
|
+
return () => ro.disconnect();
|
|
229
|
+
}, []);
|
|
230
|
+
useAnimationFrame((_, delta) => {
|
|
231
|
+
if (reduce || paused || setWidthRef.current === 0) return;
|
|
232
|
+
const dir = direction === "left" ? -1 : 1;
|
|
233
|
+
const moveBy = speed * delta / 1e3;
|
|
234
|
+
let next = x.get() + dir * moveBy;
|
|
235
|
+
const w = setWidthRef.current;
|
|
236
|
+
if (next <= -w) next += w;
|
|
237
|
+
else if (next >= w) next -= w;
|
|
238
|
+
x.set(next);
|
|
239
|
+
});
|
|
240
|
+
if (reduce) {
|
|
241
|
+
return /* @__PURE__ */ jsx4(
|
|
242
|
+
"div",
|
|
243
|
+
{
|
|
244
|
+
ref,
|
|
245
|
+
className: cn("flex w-full items-center overflow-x-auto", className),
|
|
246
|
+
style: { columnGap: gap },
|
|
247
|
+
...rest,
|
|
248
|
+
children
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
return /* @__PURE__ */ jsx4(
|
|
253
|
+
"div",
|
|
254
|
+
{
|
|
255
|
+
ref,
|
|
256
|
+
className: cn("w-full overflow-hidden", className),
|
|
257
|
+
onMouseEnter: pauseOnHover ? () => setPaused(true) : void 0,
|
|
258
|
+
onMouseLeave: pauseOnHover ? () => setPaused(false) : void 0,
|
|
259
|
+
...rest,
|
|
260
|
+
children: /* @__PURE__ */ jsxs(motion4.div, { className: "flex w-max flex-nowrap items-center", style: { x, columnGap: gap }, children: [
|
|
261
|
+
/* @__PURE__ */ jsx4("div", { ref: groupRef, className: "flex flex-nowrap items-center", style: { columnGap: gap }, children }),
|
|
262
|
+
/* @__PURE__ */ jsx4("div", { className: "flex flex-nowrap items-center", style: { columnGap: gap }, "aria-hidden": true, children })
|
|
263
|
+
] })
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
// src/site/Magnetic.tsx
|
|
269
|
+
import * as React5 from "react";
|
|
270
|
+
import { motion as motion5, useMotionValue as useMotionValue2, useReducedMotion as useReducedMotion5, useSpring as useSpring2 } from "motion/react";
|
|
271
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
272
|
+
var Magnetic = React5.forwardRef(function Magnetic2({ strength = 0.35, max = 24, spring = "snappy", className, children, ...rest }, forwardedRef) {
|
|
273
|
+
const reduce = useReducedMotion5();
|
|
274
|
+
const innerRef = React5.useRef(null);
|
|
275
|
+
React5.useImperativeHandle(forwardedRef, () => innerRef.current);
|
|
276
|
+
const mvx = useMotionValue2(0);
|
|
277
|
+
const mvy = useMotionValue2(0);
|
|
278
|
+
const x = useSpring2(mvx, SPRING[spring]);
|
|
279
|
+
const y = useSpring2(mvy, SPRING[spring]);
|
|
280
|
+
const clamp = (v) => Math.max(-max, Math.min(max, v));
|
|
281
|
+
function handleMove(e) {
|
|
282
|
+
if (reduce) return;
|
|
283
|
+
const el = innerRef.current;
|
|
284
|
+
if (!el) return;
|
|
285
|
+
const rect = el.getBoundingClientRect();
|
|
286
|
+
const cx = rect.left + rect.width / 2;
|
|
287
|
+
const cy = rect.top + rect.height / 2;
|
|
288
|
+
mvx.set(clamp((e.clientX - cx) * strength));
|
|
289
|
+
mvy.set(clamp((e.clientY - cy) * strength));
|
|
290
|
+
}
|
|
291
|
+
function reset() {
|
|
292
|
+
mvx.set(0);
|
|
293
|
+
mvy.set(0);
|
|
294
|
+
}
|
|
295
|
+
if (reduce) {
|
|
296
|
+
return /* @__PURE__ */ jsx5("div", { ref: innerRef, className: cn("inline-block", className), ...rest, children });
|
|
297
|
+
}
|
|
298
|
+
return /* @__PURE__ */ jsx5(
|
|
299
|
+
motion5.div,
|
|
300
|
+
{
|
|
301
|
+
ref: innerRef,
|
|
302
|
+
className: cn("inline-block", className),
|
|
303
|
+
style: { x, y },
|
|
304
|
+
onMouseMove: handleMove,
|
|
305
|
+
onMouseLeave: reset,
|
|
306
|
+
...rest,
|
|
307
|
+
children
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
// src/site/agent-instructions.ts
|
|
313
|
+
var SITE_AGENT_INSTRUCTIONS = `
|
|
314
|
+
## Site kit (@timbal-ai/timbal-react/site)
|
|
315
|
+
|
|
316
|
+
Expressive **motion & interaction primitives** for marketing, brand, landing, and editorial pages \u2014 the counterpart to \`/app\` (which is for dashboards and operations UIs). Import from \`@timbal-ai/timbal-react/site\` (or the package root).
|
|
317
|
+
|
|
318
|
+
These are **mechanics, not art direction**: they animate whatever you put inside them. Compose them under a chosen aesthetic; they do not impose colors, type, or layout.
|
|
319
|
+
|
|
320
|
+
### When to use \`/site\` (and when not to)
|
|
321
|
+
|
|
322
|
+
- **Do** use \`/site\` for landing pages, hero sections, feature walkthroughs, logo walls, pricing pages, and editorial/brand storytelling.
|
|
323
|
+
- **Do not** use \`/site\` inside dashboards, settings, tables, or in-thread chat artifacts \u2014 those stay on \`/app\` and \`/artifacts\`. Animated dashboard chrome reads as slop.
|
|
324
|
+
- Every primitive is **reduced-motion-aware** (collapses to static, no-transform output under \`prefers-reduced-motion\`) and **SSR-safe** (no layout shift \u2014 elements occupy their space from first paint). You never need to guard them yourself.
|
|
325
|
+
- Built on the \`motion\` engine the package already bundles \u2014 **no extra dependencies**.
|
|
326
|
+
|
|
327
|
+
### Dosing (anti-overuse \u2014 read this)
|
|
328
|
+
|
|
329
|
+
The failure mode is animating *everything*. Restraint is the brand signal.
|
|
330
|
+
|
|
331
|
+
- Pick **one** signature motion per section (e.g. a \`TextReveal\` headline **or** a \`Parallax\` hero image, not both stacked).
|
|
332
|
+
- Stagger entrances down the page; do not fire ten reveals at once on first paint.
|
|
333
|
+
- Reserve \`Magnetic\` for **primary** CTAs / nav, not every button.
|
|
334
|
+
- Keep \`Parallax\` \`speed\` subtle (\`0.15\`\u2013\`0.35\`); large values look gimmicky.
|
|
335
|
+
- Default durations are intentionally slow and weighted (\`DURATION.base\` = 0.7s) \u2014 that confident pacing is the point. Don't speed everything up to app-kit's 150ms.
|
|
336
|
+
|
|
337
|
+
### Component menu
|
|
338
|
+
|
|
339
|
+
| Component | Use for | Key props |
|
|
340
|
+
|-----------|---------|-----------|
|
|
341
|
+
| \`Reveal\` | Fade/slide a block in as it scrolls into view (headings, cards, images, list items). | \`variant\` (\`fade\` \\| \`fade-up\` \\| \`fade-down\` \\| \`fade-left\` \\| \`fade-right\` \\| \`blur\` \\| \`scale\` \\| \`mask-up\`, default \`fade-up\`), \`delay\`, \`duration\`, \`distance\` (px, default 28), \`amount\` (visibility fraction 0\u20131 / \`"some"\` / \`"all"\`, default 0.3), \`repeat\` (replay on re-enter), \`as\` (render element, e.g. \`"section"\`/\`"li"\`). |
|
|
342
|
+
| \`TextReveal\` | Signature editorial headline entrance \u2014 text rides up token-by-token from a clip on a stagger. | \`children\` (**plain string only**), \`splitBy\` (\`words\` default \\| \`lines\`), \`stagger\` (default 0.06), \`delay\`, \`duration\`, \`amount\` (default 0.4), \`repeat\`, \`as\` (\`span\` default \\| \`h1\`\u2013\`h4\` \\| \`p\`). |
|
|
343
|
+
| \`Parallax\` | Depth \u2014 translate a layer relative to scroll (hero images, background art). | \`speed\` (-0.6\u20260.6, positive = lags behind scroll, default 0.2), \`axis\` (\`y\` default \\| \`x\`), \`smooth\` (spring-damped, default true). |
|
|
344
|
+
| \`Marquee\` | Seamless infinite scrolling row (logo walls, testimonials, ticker). Duplicates children internally \u2014 no visible seam. | \`speed\` (px/s, default 60), \`direction\` (\`left\` default \\| \`right\`), \`pauseOnHover\` (default true), \`gap\` (CSS length, default \`"3rem"\`). |
|
|
345
|
+
| \`Magnetic\` | Pointer-following "magnetic" affordance for a **single** interactive child (primary CTA, nav link). | \`strength\` (fraction of cursor offset, default 0.35), \`max\` (px clamp, default 24), \`spring\` (\`"snappy"\` default \\| \`"smooth"\`). Wrap one button/link. |
|
|
346
|
+
|
|
347
|
+
### Motion tokens
|
|
348
|
+
|
|
349
|
+
\`EASE\` (cubic-bezier tuples: \`out\` / \`inOut\` / \`soft\`), \`DURATION\` (\`fast\` 0.4s / \`base\` 0.7s / \`slow\` 1.1s), and \`SPRING\` (\`snappy\` / \`smooth\`) are exported for custom \`motion\` work that should match the kit's feel. Prefer the component defaults; reach for tokens only when hand-rolling a bespoke animation.
|
|
350
|
+
|
|
351
|
+
### Example imports
|
|
352
|
+
|
|
353
|
+
\`\`\`tsx
|
|
354
|
+
import { Reveal, TextReveal, Parallax, Marquee, Magnetic } from "@timbal-ai/timbal-react/site";
|
|
355
|
+
\`\`\`
|
|
356
|
+
|
|
357
|
+
\`\`\`tsx
|
|
358
|
+
<Reveal variant="fade-up" delay={0.1}>
|
|
359
|
+
<TextReveal as="h1" className="text-6xl font-semibold">
|
|
360
|
+
Built for the long run
|
|
361
|
+
</TextReveal>
|
|
362
|
+
</Reveal>
|
|
363
|
+
|
|
364
|
+
<Parallax speed={0.3}>
|
|
365
|
+
<img src={hero} alt="" className="h-full w-full object-cover" />
|
|
366
|
+
</Parallax>
|
|
367
|
+
|
|
368
|
+
<Magnetic strength={0.4}>
|
|
369
|
+
<Button>Get started</Button>
|
|
370
|
+
</Magnetic>
|
|
371
|
+
\`\`\`
|
|
372
|
+
|
|
373
|
+
### Rules
|
|
374
|
+
|
|
375
|
+
- \`/site\` is for the **marketing/brand surface**, not the product app shell (\`/app\`) or in-chat widgets (\`/artifacts\`).
|
|
376
|
+
- \`TextReveal\` takes a **string** child only \u2014 it splits internally; do not pass JSX.
|
|
377
|
+
- \`Magnetic\` wraps a **single** interactive child; don't wrap whole layouts.
|
|
378
|
+
- Trust the reduced-motion / SSR handling \u2014 never add your own \`prefers-reduced-motion\` guards around these.
|
|
379
|
+
`.trim();
|
|
380
|
+
|
|
381
|
+
export {
|
|
382
|
+
EASE,
|
|
383
|
+
DURATION,
|
|
384
|
+
SPRING,
|
|
385
|
+
Reveal,
|
|
386
|
+
TextReveal,
|
|
387
|
+
Parallax,
|
|
388
|
+
Marquee,
|
|
389
|
+
Magnetic,
|
|
390
|
+
SITE_AGENT_INSTRUCTIONS
|
|
391
|
+
};
|