@timbal-ai/timbal-react 0.5.4 → 0.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/README.md +128 -4
- package/dist/app.cjs +5311 -0
- package/dist/app.d.cts +29 -0
- package/dist/app.d.ts +29 -0
- package/dist/app.esm.js +81 -0
- package/dist/chart-artifact-C71dk4xI.d.ts +329 -0
- package/dist/chart-artifact-CPEpOmtV.d.cts +329 -0
- package/dist/chat-CWtQWDtJ.d.cts +650 -0
- package/dist/chat-CWtQWDtJ.d.ts +650 -0
- package/dist/chat.cjs +4162 -0
- package/dist/chat.d.cts +13 -0
- package/dist/chat.d.ts +13 -0
- package/dist/chat.esm.js +51 -0
- package/dist/chunk-4TCJQSIX.esm.js +565 -0
- package/dist/chunk-IYENDIRY.esm.js +119 -0
- package/dist/chunk-KC5QLVUG.esm.js +22 -0
- package/dist/chunk-M4V6Q6XO.esm.js +1082 -0
- package/dist/chunk-OFHLFNJH.esm.js +138 -0
- package/dist/chunk-OVHR7J3J.esm.js +1574 -0
- package/dist/chunk-WLTW56MC.esm.js +66 -0
- package/dist/chunk-YJQLLFKP.esm.js +3672 -0
- package/dist/index.cjs +1823 -359
- package/dist/index.d.cts +15 -931
- package/dist/index.d.ts +15 -931
- package/dist/index.esm.js +187 -5578
- package/dist/layout-B9VayJhZ.d.cts +75 -0
- package/dist/layout-CQWngNQ7.d.ts +75 -0
- package/dist/studio.cjs +5734 -0
- package/dist/studio.d.cts +15 -0
- package/dist/studio.d.ts +15 -0
- package/dist/studio.esm.js +27 -0
- package/dist/styles.css +52 -2
- package/dist/timbal-v2-button-F4-z7m33.d.cts +40 -0
- package/dist/timbal-v2-button-F4-z7m33.d.ts +40 -0
- package/dist/ui.cjs +720 -0
- package/dist/ui.d.cts +74 -0
- package/dist/ui.d.ts +74 -0
- package/dist/ui.esm.js +44 -0
- package/dist/welcome--80i_O0p.d.cts +190 -0
- package/dist/welcome-BOizSp5h.d.ts +190 -0
- package/package.json +35 -3
- package/scripts/dev-linked.mjs +66 -0
- package/vite/local-dev.d.ts +4 -0
- package/vite/local-dev.mjs +71 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { ToolCallMessagePartComponent } from '@assistant-ui/react';
|
|
5
|
+
import { WorkforceItem } from '@timbal-ai/timbal-sdk';
|
|
6
|
+
import { T as TimbalV2ButtonProps } from './timbal-v2-button-F4-z7m33.cjs';
|
|
7
|
+
|
|
8
|
+
declare const MarkdownText: React.MemoExoticComponent<() => react_jsx_runtime.JSX.Element>;
|
|
9
|
+
|
|
10
|
+
interface ToolStatus {
|
|
11
|
+
type: string;
|
|
12
|
+
reason?: string;
|
|
13
|
+
}
|
|
14
|
+
declare function useToolRunning(props: {
|
|
15
|
+
status?: ToolStatus;
|
|
16
|
+
result?: unknown;
|
|
17
|
+
}): boolean;
|
|
18
|
+
declare const ToolFallback: ToolCallMessagePartComponent;
|
|
19
|
+
|
|
20
|
+
interface WorkforceSelectorProps {
|
|
21
|
+
/** List of workforces to choose from. */
|
|
22
|
+
workforces: WorkforceItem[];
|
|
23
|
+
/** Currently selected workforce id. */
|
|
24
|
+
value: string;
|
|
25
|
+
/** Called when the user picks a different workforce. */
|
|
26
|
+
onChange: (id: string) => void;
|
|
27
|
+
/** Hide the selector when there's only one option. Default: true. */
|
|
28
|
+
hideWhenSingle?: boolean;
|
|
29
|
+
className?: string;
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Minimal headless workforce picker. Wraps a styled native `<select>` so
|
|
34
|
+
* the SDK doesn't need to depend on `@radix-ui/react-select`, while still
|
|
35
|
+
* matching the Studio chrome (gradient pill, soft border, chevron).
|
|
36
|
+
*
|
|
37
|
+
* Apps that want a richer UI (search, descriptions, agent icons) can build
|
|
38
|
+
* their own using `useWorkforces()`.
|
|
39
|
+
*/
|
|
40
|
+
declare const WorkforceSelector: FC<WorkforceSelectorProps>;
|
|
41
|
+
|
|
42
|
+
interface TooltipIconButtonProps extends Omit<TimbalV2ButtonProps, "isIconOnly"> {
|
|
43
|
+
/** Visible tooltip + accessible label. Always required. */
|
|
44
|
+
tooltip: string;
|
|
45
|
+
/** Tooltip placement. Default: "bottom". */
|
|
46
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Icon-only Timbal pill button with a tooltip. Used by every chat-surface
|
|
50
|
+
* toolbar (composer send/cancel, message action bar, scroll-to-bottom).
|
|
51
|
+
*
|
|
52
|
+
* Defaults to a soft `secondary` variant so it sits cleanly inside composers,
|
|
53
|
+
* message bubbles, and the action bar. Override via `variant`.
|
|
54
|
+
*/
|
|
55
|
+
declare const TooltipIconButton: React.ForwardRefExoticComponent<Omit<TooltipIconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Official layout class strings for custom `Thread` message slots.
|
|
59
|
+
*
|
|
60
|
+
* `Thread` sets `--thread-max-width` (default {@link THREAD_DEFAULT_MAX_WIDTH}).
|
|
61
|
+
* Overriding `components.AssistantMessage` or `components.UserMessage` removes
|
|
62
|
+
* the built-in chrome — apply these on `MessagePrimitive.Root`.
|
|
63
|
+
*/
|
|
64
|
+
/** Default `maxWidth` on `Thread` / `TimbalChatShell`. */
|
|
65
|
+
declare const THREAD_DEFAULT_MAX_WIDTH = "44rem";
|
|
66
|
+
/** Shared column — aligns custom messages with the composer footer. */
|
|
67
|
+
declare const threadMessageColumnClass = "mx-auto w-full max-w-(--thread-max-width)";
|
|
68
|
+
/** Matches built-in assistant message root (minus motion utilities). */
|
|
69
|
+
declare const assistantMessageRootClass: string;
|
|
70
|
+
/** Inner content padding for assistant text / artifacts. */
|
|
71
|
+
declare const assistantMessageContentClass = "wrap-break-word px-2 text-foreground leading-relaxed";
|
|
72
|
+
/** Matches built-in user message root. */
|
|
73
|
+
declare const userMessageRootClass: string;
|
|
74
|
+
|
|
75
|
+
export { MarkdownText as M, THREAD_DEFAULT_MAX_WIDTH as T, WorkforceSelector as W, ToolFallback as a, TooltipIconButton as b, type TooltipIconButtonProps as c, type WorkforceSelectorProps as d, assistantMessageContentClass as e, assistantMessageRootClass as f, userMessageRootClass as g, threadMessageColumnClass as t, useToolRunning as u };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { ToolCallMessagePartComponent } from '@assistant-ui/react';
|
|
5
|
+
import { WorkforceItem } from '@timbal-ai/timbal-sdk';
|
|
6
|
+
import { T as TimbalV2ButtonProps } from './timbal-v2-button-F4-z7m33.js';
|
|
7
|
+
|
|
8
|
+
declare const MarkdownText: React.MemoExoticComponent<() => react_jsx_runtime.JSX.Element>;
|
|
9
|
+
|
|
10
|
+
interface ToolStatus {
|
|
11
|
+
type: string;
|
|
12
|
+
reason?: string;
|
|
13
|
+
}
|
|
14
|
+
declare function useToolRunning(props: {
|
|
15
|
+
status?: ToolStatus;
|
|
16
|
+
result?: unknown;
|
|
17
|
+
}): boolean;
|
|
18
|
+
declare const ToolFallback: ToolCallMessagePartComponent;
|
|
19
|
+
|
|
20
|
+
interface WorkforceSelectorProps {
|
|
21
|
+
/** List of workforces to choose from. */
|
|
22
|
+
workforces: WorkforceItem[];
|
|
23
|
+
/** Currently selected workforce id. */
|
|
24
|
+
value: string;
|
|
25
|
+
/** Called when the user picks a different workforce. */
|
|
26
|
+
onChange: (id: string) => void;
|
|
27
|
+
/** Hide the selector when there's only one option. Default: true. */
|
|
28
|
+
hideWhenSingle?: boolean;
|
|
29
|
+
className?: string;
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Minimal headless workforce picker. Wraps a styled native `<select>` so
|
|
34
|
+
* the SDK doesn't need to depend on `@radix-ui/react-select`, while still
|
|
35
|
+
* matching the Studio chrome (gradient pill, soft border, chevron).
|
|
36
|
+
*
|
|
37
|
+
* Apps that want a richer UI (search, descriptions, agent icons) can build
|
|
38
|
+
* their own using `useWorkforces()`.
|
|
39
|
+
*/
|
|
40
|
+
declare const WorkforceSelector: FC<WorkforceSelectorProps>;
|
|
41
|
+
|
|
42
|
+
interface TooltipIconButtonProps extends Omit<TimbalV2ButtonProps, "isIconOnly"> {
|
|
43
|
+
/** Visible tooltip + accessible label. Always required. */
|
|
44
|
+
tooltip: string;
|
|
45
|
+
/** Tooltip placement. Default: "bottom". */
|
|
46
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Icon-only Timbal pill button with a tooltip. Used by every chat-surface
|
|
50
|
+
* toolbar (composer send/cancel, message action bar, scroll-to-bottom).
|
|
51
|
+
*
|
|
52
|
+
* Defaults to a soft `secondary` variant so it sits cleanly inside composers,
|
|
53
|
+
* message bubbles, and the action bar. Override via `variant`.
|
|
54
|
+
*/
|
|
55
|
+
declare const TooltipIconButton: React.ForwardRefExoticComponent<Omit<TooltipIconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Official layout class strings for custom `Thread` message slots.
|
|
59
|
+
*
|
|
60
|
+
* `Thread` sets `--thread-max-width` (default {@link THREAD_DEFAULT_MAX_WIDTH}).
|
|
61
|
+
* Overriding `components.AssistantMessage` or `components.UserMessage` removes
|
|
62
|
+
* the built-in chrome — apply these on `MessagePrimitive.Root`.
|
|
63
|
+
*/
|
|
64
|
+
/** Default `maxWidth` on `Thread` / `TimbalChatShell`. */
|
|
65
|
+
declare const THREAD_DEFAULT_MAX_WIDTH = "44rem";
|
|
66
|
+
/** Shared column — aligns custom messages with the composer footer. */
|
|
67
|
+
declare const threadMessageColumnClass = "mx-auto w-full max-w-(--thread-max-width)";
|
|
68
|
+
/** Matches built-in assistant message root (minus motion utilities). */
|
|
69
|
+
declare const assistantMessageRootClass: string;
|
|
70
|
+
/** Inner content padding for assistant text / artifacts. */
|
|
71
|
+
declare const assistantMessageContentClass = "wrap-break-word px-2 text-foreground leading-relaxed";
|
|
72
|
+
/** Matches built-in user message root. */
|
|
73
|
+
declare const userMessageRootClass: string;
|
|
74
|
+
|
|
75
|
+
export { MarkdownText as M, THREAD_DEFAULT_MAX_WIDTH as T, WorkforceSelector as W, ToolFallback as a, TooltipIconButton as b, type TooltipIconButtonProps as c, type WorkforceSelectorProps as d, assistantMessageContentClass as e, assistantMessageRootClass as f, userMessageRootClass as g, threadMessageColumnClass as t, useToolRunning as u };
|