@timbal-ai/timbal-react 0.7.1 → 0.8.1
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 +29 -0
- package/README.md +51 -5
- package/dist/app.cjs +1750 -1157
- package/dist/app.d.cts +2 -2
- package/dist/app.d.ts +2 -2
- package/dist/app.esm.js +27 -5
- package/dist/{button-CIKzUrJI.d.cts → button-ClSgD6OF.d.cts} +1 -1
- package/dist/{button-CIKzUrJI.d.ts → button-ClSgD6OF.d.ts} +1 -1
- package/dist/{chart-artifact-C2m891nx.d.cts → chart-artifact-DWkqIAK5.d.cts} +165 -1
- package/dist/{chart-artifact-CqqhdSR9.d.ts → chart-artifact-DwfRtQWL.d.ts} +165 -1
- package/dist/chat.esm.js +3 -3
- package/dist/{chunk-RY3LB3JN.esm.js → chunk-5ZKLPWVN.esm.js} +1 -1
- package/dist/{chunk-3WCG6ZRL.esm.js → chunk-CFU3YDTV.esm.js} +2 -2
- package/dist/{chunk-7U2N6XZA.esm.js → chunk-GBBLAM3G.esm.js} +954 -378
- package/dist/{chunk-TDIJHV4I.esm.js → chunk-OISVICYF.esm.js} +1 -1
- package/dist/chunk-P4SN7M67.esm.js +435 -0
- package/dist/{chunk-Z27GBSOT.esm.js → chunk-QIABF4KB.esm.js} +53 -51
- package/dist/{chunk-2XZ3S4OP.esm.js → chunk-QVAUCVQA.esm.js} +129 -90
- package/dist/{chunk-EQC5JEDZ.esm.js → chunk-VWHHKAHN.esm.js} +5 -5
- package/dist/index.cjs +1580 -493
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.js +93 -7
- package/dist/studio.cjs +3 -1
- package/dist/studio.esm.js +6 -6
- package/dist/ui.cjs +507 -8
- package/dist/ui.d.cts +46 -3
- package/dist/ui.d.ts +46 -3
- package/dist/ui.esm.js +66 -2
- package/package.json +1 -1
|
@@ -242,14 +242,83 @@ var TimbalV2Button = React.forwardRef(function TimbalV2Button2({
|
|
|
242
242
|
);
|
|
243
243
|
});
|
|
244
244
|
|
|
245
|
+
// src/ui/button.tsx
|
|
246
|
+
import { cva } from "class-variance-authority";
|
|
247
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
248
|
+
var LEGACY_SIZE_TO_V2 = {
|
|
249
|
+
default: "md",
|
|
250
|
+
xs: "xs",
|
|
251
|
+
sm: "sm",
|
|
252
|
+
lg: "lg",
|
|
253
|
+
icon: "sm",
|
|
254
|
+
"icon-xs": "xs",
|
|
255
|
+
"icon-sm": "sm",
|
|
256
|
+
"icon-lg": "lg"
|
|
257
|
+
};
|
|
258
|
+
var buttonVariants = cva(
|
|
259
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0",
|
|
260
|
+
{
|
|
261
|
+
variants: {
|
|
262
|
+
variant: {
|
|
263
|
+
default: "",
|
|
264
|
+
destructive: "",
|
|
265
|
+
outline: "",
|
|
266
|
+
secondary: "",
|
|
267
|
+
ghost: "",
|
|
268
|
+
link: ""
|
|
269
|
+
},
|
|
270
|
+
size: {
|
|
271
|
+
default: "",
|
|
272
|
+
xs: "",
|
|
273
|
+
sm: "",
|
|
274
|
+
lg: "",
|
|
275
|
+
icon: "",
|
|
276
|
+
"icon-xs": "",
|
|
277
|
+
"icon-sm": "",
|
|
278
|
+
"icon-lg": ""
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
defaultVariants: {
|
|
282
|
+
variant: "default",
|
|
283
|
+
size: "default"
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
function Button({
|
|
288
|
+
className,
|
|
289
|
+
variant = "default",
|
|
290
|
+
size = "default",
|
|
291
|
+
asChild = false,
|
|
292
|
+
...props
|
|
293
|
+
}) {
|
|
294
|
+
const v2Variant = TIMBAL_V2_FROM_LEGACY_BUTTON[variant ?? "default"];
|
|
295
|
+
const v2Size = LEGACY_SIZE_TO_V2[size ?? "default"];
|
|
296
|
+
const isIconOnly = typeof size === "string" && size.startsWith("icon");
|
|
297
|
+
return /* @__PURE__ */ jsx2(
|
|
298
|
+
TimbalV2Button,
|
|
299
|
+
{
|
|
300
|
+
"data-slot": "button",
|
|
301
|
+
"data-variant": variant,
|
|
302
|
+
"data-size": size,
|
|
303
|
+
variant: v2Variant,
|
|
304
|
+
size: v2Size,
|
|
305
|
+
shape: "pill",
|
|
306
|
+
isIconOnly,
|
|
307
|
+
asChild,
|
|
308
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
309
|
+
...props
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
|
|
245
314
|
// src/ui/tooltip.tsx
|
|
246
315
|
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
247
|
-
import { jsx as
|
|
316
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
248
317
|
function TooltipProvider({
|
|
249
318
|
delayDuration = 0,
|
|
250
319
|
...props
|
|
251
320
|
}) {
|
|
252
|
-
return /* @__PURE__ */
|
|
321
|
+
return /* @__PURE__ */ jsx3(
|
|
253
322
|
TooltipPrimitive.Provider,
|
|
254
323
|
{
|
|
255
324
|
"data-slot": "tooltip-provider",
|
|
@@ -261,12 +330,12 @@ function TooltipProvider({
|
|
|
261
330
|
function Tooltip({
|
|
262
331
|
...props
|
|
263
332
|
}) {
|
|
264
|
-
return /* @__PURE__ */
|
|
333
|
+
return /* @__PURE__ */ jsx3(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
|
|
265
334
|
}
|
|
266
335
|
function TooltipTrigger({
|
|
267
336
|
...props
|
|
268
337
|
}) {
|
|
269
|
-
return /* @__PURE__ */
|
|
338
|
+
return /* @__PURE__ */ jsx3(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
270
339
|
}
|
|
271
340
|
function TooltipContent({
|
|
272
341
|
className,
|
|
@@ -274,7 +343,7 @@ function TooltipContent({
|
|
|
274
343
|
children,
|
|
275
344
|
...props
|
|
276
345
|
}) {
|
|
277
|
-
return /* @__PURE__ */
|
|
346
|
+
return /* @__PURE__ */ jsx3(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs2(
|
|
278
347
|
TooltipPrimitive.Content,
|
|
279
348
|
{
|
|
280
349
|
"data-slot": "tooltip-content",
|
|
@@ -286,7 +355,7 @@ function TooltipContent({
|
|
|
286
355
|
...props,
|
|
287
356
|
children: [
|
|
288
357
|
children,
|
|
289
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ jsx3(TooltipPrimitive.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
290
359
|
]
|
|
291
360
|
}
|
|
292
361
|
) });
|
|
@@ -295,32 +364,32 @@ function TooltipContent({
|
|
|
295
364
|
// src/ui/dialog.tsx
|
|
296
365
|
import { XIcon } from "lucide-react";
|
|
297
366
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
298
|
-
import { jsx as
|
|
367
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
299
368
|
function Dialog({
|
|
300
369
|
...props
|
|
301
370
|
}) {
|
|
302
|
-
return /* @__PURE__ */
|
|
371
|
+
return /* @__PURE__ */ jsx4(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
303
372
|
}
|
|
304
373
|
function DialogTrigger({
|
|
305
374
|
...props
|
|
306
375
|
}) {
|
|
307
|
-
return /* @__PURE__ */
|
|
376
|
+
return /* @__PURE__ */ jsx4(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
308
377
|
}
|
|
309
378
|
function DialogPortal({
|
|
310
379
|
...props
|
|
311
380
|
}) {
|
|
312
|
-
return /* @__PURE__ */
|
|
381
|
+
return /* @__PURE__ */ jsx4(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
313
382
|
}
|
|
314
383
|
function DialogClose({
|
|
315
384
|
...props
|
|
316
385
|
}) {
|
|
317
|
-
return /* @__PURE__ */
|
|
386
|
+
return /* @__PURE__ */ jsx4(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
318
387
|
}
|
|
319
388
|
function DialogOverlay({
|
|
320
389
|
className,
|
|
321
390
|
...props
|
|
322
391
|
}) {
|
|
323
|
-
return /* @__PURE__ */
|
|
392
|
+
return /* @__PURE__ */ jsx4(
|
|
324
393
|
DialogPrimitive.Overlay,
|
|
325
394
|
{
|
|
326
395
|
"data-slot": "dialog-overlay",
|
|
@@ -339,7 +408,7 @@ function DialogContent({
|
|
|
339
408
|
...props
|
|
340
409
|
}) {
|
|
341
410
|
return /* @__PURE__ */ jsxs3(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
342
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ jsx4(DialogOverlay, {}),
|
|
343
412
|
/* @__PURE__ */ jsxs3(
|
|
344
413
|
DialogPrimitive.Content,
|
|
345
414
|
{
|
|
@@ -358,8 +427,8 @@ function DialogContent({
|
|
|
358
427
|
"data-slot": "dialog-close",
|
|
359
428
|
className: "ring-offset-background focus:ring-ring data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-[opacity,background-color] hover:bg-ghost-fill-hover hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
360
429
|
children: [
|
|
361
|
-
/* @__PURE__ */
|
|
362
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ jsx4(XIcon, {}),
|
|
431
|
+
/* @__PURE__ */ jsx4("span", { className: "sr-only", children: "Close" })
|
|
363
432
|
]
|
|
364
433
|
}
|
|
365
434
|
)
|
|
@@ -372,7 +441,7 @@ function DialogTitle({
|
|
|
372
441
|
className,
|
|
373
442
|
...props
|
|
374
443
|
}) {
|
|
375
|
-
return /* @__PURE__ */
|
|
444
|
+
return /* @__PURE__ */ jsx4(
|
|
376
445
|
DialogPrimitive.Title,
|
|
377
446
|
{
|
|
378
447
|
"data-slot": "dialog-title",
|
|
@@ -381,16 +450,52 @@ function DialogTitle({
|
|
|
381
450
|
}
|
|
382
451
|
);
|
|
383
452
|
}
|
|
453
|
+
function DialogDescription({
|
|
454
|
+
className,
|
|
455
|
+
...props
|
|
456
|
+
}) {
|
|
457
|
+
return /* @__PURE__ */ jsx4(
|
|
458
|
+
DialogPrimitive.Description,
|
|
459
|
+
{
|
|
460
|
+
"data-slot": "dialog-description",
|
|
461
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
462
|
+
...props
|
|
463
|
+
}
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
function DialogHeader({ className, ...props }) {
|
|
467
|
+
return /* @__PURE__ */ jsx4(
|
|
468
|
+
"div",
|
|
469
|
+
{
|
|
470
|
+
"data-slot": "dialog-header",
|
|
471
|
+
className: cn("flex flex-col gap-1.5 text-center sm:text-left", className),
|
|
472
|
+
...props
|
|
473
|
+
}
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
function DialogFooter({ className, ...props }) {
|
|
477
|
+
return /* @__PURE__ */ jsx4(
|
|
478
|
+
"div",
|
|
479
|
+
{
|
|
480
|
+
"data-slot": "dialog-footer",
|
|
481
|
+
className: cn(
|
|
482
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
483
|
+
className
|
|
484
|
+
),
|
|
485
|
+
...props
|
|
486
|
+
}
|
|
487
|
+
);
|
|
488
|
+
}
|
|
384
489
|
|
|
385
490
|
// src/ui/avatar.tsx
|
|
386
491
|
import { Avatar as AvatarPrimitive } from "radix-ui";
|
|
387
|
-
import { jsx as
|
|
492
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
388
493
|
function Avatar({
|
|
389
494
|
className,
|
|
390
495
|
size = "default",
|
|
391
496
|
...props
|
|
392
497
|
}) {
|
|
393
|
-
return /* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ jsx5(
|
|
394
499
|
AvatarPrimitive.Root,
|
|
395
500
|
{
|
|
396
501
|
"data-slot": "avatar",
|
|
@@ -407,7 +512,7 @@ function AvatarImage({
|
|
|
407
512
|
className,
|
|
408
513
|
...props
|
|
409
514
|
}) {
|
|
410
|
-
return /* @__PURE__ */
|
|
515
|
+
return /* @__PURE__ */ jsx5(
|
|
411
516
|
AvatarPrimitive.Image,
|
|
412
517
|
{
|
|
413
518
|
"data-slot": "avatar-image",
|
|
@@ -420,7 +525,7 @@ function AvatarFallback({
|
|
|
420
525
|
className,
|
|
421
526
|
...props
|
|
422
527
|
}) {
|
|
423
|
-
return /* @__PURE__ */
|
|
528
|
+
return /* @__PURE__ */ jsx5(
|
|
424
529
|
AvatarPrimitive.Fallback,
|
|
425
530
|
{
|
|
426
531
|
"data-slot": "avatar-fallback",
|
|
@@ -433,75 +538,6 @@ function AvatarFallback({
|
|
|
433
538
|
);
|
|
434
539
|
}
|
|
435
540
|
|
|
436
|
-
// src/ui/button.tsx
|
|
437
|
-
import { cva } from "class-variance-authority";
|
|
438
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
439
|
-
var LEGACY_SIZE_TO_V2 = {
|
|
440
|
-
default: "md",
|
|
441
|
-
xs: "xs",
|
|
442
|
-
sm: "sm",
|
|
443
|
-
lg: "lg",
|
|
444
|
-
icon: "sm",
|
|
445
|
-
"icon-xs": "xs",
|
|
446
|
-
"icon-sm": "sm",
|
|
447
|
-
"icon-lg": "lg"
|
|
448
|
-
};
|
|
449
|
-
var buttonVariants = cva(
|
|
450
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0",
|
|
451
|
-
{
|
|
452
|
-
variants: {
|
|
453
|
-
variant: {
|
|
454
|
-
default: "",
|
|
455
|
-
destructive: "",
|
|
456
|
-
outline: "",
|
|
457
|
-
secondary: "",
|
|
458
|
-
ghost: "",
|
|
459
|
-
link: ""
|
|
460
|
-
},
|
|
461
|
-
size: {
|
|
462
|
-
default: "",
|
|
463
|
-
xs: "",
|
|
464
|
-
sm: "",
|
|
465
|
-
lg: "",
|
|
466
|
-
icon: "",
|
|
467
|
-
"icon-xs": "",
|
|
468
|
-
"icon-sm": "",
|
|
469
|
-
"icon-lg": ""
|
|
470
|
-
}
|
|
471
|
-
},
|
|
472
|
-
defaultVariants: {
|
|
473
|
-
variant: "default",
|
|
474
|
-
size: "default"
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
);
|
|
478
|
-
function Button({
|
|
479
|
-
className,
|
|
480
|
-
variant = "default",
|
|
481
|
-
size = "default",
|
|
482
|
-
asChild = false,
|
|
483
|
-
...props
|
|
484
|
-
}) {
|
|
485
|
-
const v2Variant = TIMBAL_V2_FROM_LEGACY_BUTTON[variant ?? "default"];
|
|
486
|
-
const v2Size = LEGACY_SIZE_TO_V2[size ?? "default"];
|
|
487
|
-
const isIconOnly = typeof size === "string" && size.startsWith("icon");
|
|
488
|
-
return /* @__PURE__ */ jsx5(
|
|
489
|
-
TimbalV2Button,
|
|
490
|
-
{
|
|
491
|
-
"data-slot": "button",
|
|
492
|
-
"data-variant": variant,
|
|
493
|
-
"data-size": size,
|
|
494
|
-
variant: v2Variant,
|
|
495
|
-
size: v2Size,
|
|
496
|
-
shape: "pill",
|
|
497
|
-
isIconOnly,
|
|
498
|
-
asChild,
|
|
499
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
500
|
-
...props
|
|
501
|
-
}
|
|
502
|
-
);
|
|
503
|
-
}
|
|
504
|
-
|
|
505
541
|
// src/ui/shimmer.tsx
|
|
506
542
|
import { motion } from "motion/react";
|
|
507
543
|
import {
|
|
@@ -557,6 +593,7 @@ export {
|
|
|
557
593
|
TIMBAL_V2_SECONDARY_CHROME,
|
|
558
594
|
TIMBAL_V2_LOGO_TILE,
|
|
559
595
|
TimbalV2Button,
|
|
596
|
+
Button,
|
|
560
597
|
TooltipProvider,
|
|
561
598
|
Tooltip,
|
|
562
599
|
TooltipTrigger,
|
|
@@ -568,9 +605,11 @@ export {
|
|
|
568
605
|
DialogOverlay,
|
|
569
606
|
DialogContent,
|
|
570
607
|
DialogTitle,
|
|
608
|
+
DialogDescription,
|
|
609
|
+
DialogHeader,
|
|
610
|
+
DialogFooter,
|
|
571
611
|
Avatar,
|
|
572
612
|
AvatarImage,
|
|
573
613
|
AvatarFallback,
|
|
574
|
-
Button,
|
|
575
614
|
Shimmer
|
|
576
615
|
};
|
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
studioSidebarEntryItemVariants,
|
|
18
18
|
studioSidebarWidthTransition,
|
|
19
19
|
useShellInsetReporter
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QIABF4KB.esm.js";
|
|
21
21
|
import {
|
|
22
22
|
WorkforceSelector
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-CFU3YDTV.esm.js";
|
|
24
24
|
import {
|
|
25
25
|
Composer,
|
|
26
26
|
TimbalChat,
|
|
@@ -43,10 +43,10 @@ import {
|
|
|
43
43
|
studioTopbarIconPillClass,
|
|
44
44
|
studioTopbarPillHeightClass,
|
|
45
45
|
useTimbalRuntime
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-5ZKLPWVN.esm.js";
|
|
47
47
|
import {
|
|
48
48
|
PillSegmentedTabs
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-OISVICYF.esm.js";
|
|
50
50
|
import {
|
|
51
51
|
Avatar,
|
|
52
52
|
AvatarFallback,
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
TooltipContent,
|
|
57
57
|
TooltipTrigger,
|
|
58
58
|
cn
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-QVAUCVQA.esm.js";
|
|
60
60
|
|
|
61
61
|
// src/hooks/use-workforces.ts
|
|
62
62
|
import { useEffect, useMemo, useRef, useState } from "react";
|