@tangle-network/ui 11.10.0 → 11.11.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 +14 -0
- package/README.md +4 -1
- package/dist/active-sessions-store-Gt1R0rFG.js +262 -0
- package/dist/{active-sessions-store-CeOmXgv5.d.ts → active-sessions-store-nl70ZnMC.d.ts} +40 -41
- package/dist/artifact-pane-BL_DFWNl.d.ts +32 -0
- package/dist/artifact-pane-DMXT9a8U.js +70 -0
- package/dist/auth-DOETfnd9.js +154 -0
- package/dist/auth.d.ts +2 -74
- package/dist/auth.js +2 -16
- package/dist/branding-26d5ARIr.d.ts +14 -0
- package/dist/button-C87nEe2R.js +78 -0
- package/dist/button-yoIv77e2.d.ts +16 -0
- package/dist/chat-D4jAfEmj.js +667 -0
- package/dist/chat.d.ts +2 -201
- package/dist/chat.js +2 -31
- package/dist/code-block-B36KVUSN.js +165 -0
- package/dist/code-block-B9miUPht.d.ts +23 -0
- package/dist/diff-preview-BcK3nRXb.js +533 -0
- package/dist/document-editor-pane-BcoABlhn.d.ts +131 -0
- package/dist/document-editor-pane-BxlPjaTP.js +1287 -0
- package/dist/dropdown-menu-BpcLa5vF.js +101 -0
- package/dist/editor.d.ts +76 -78
- package/dist/editor.js +2 -34
- package/dist/file-format-BgXbr-Ib.js +160 -0
- package/dist/files-Bug33qCl.js +743 -0
- package/dist/files.d.ts +2 -243
- package/dist/files.js +3 -41
- package/dist/focus-BcE_SHqz.js +57 -0
- package/dist/format-DfcLWqMa.js +54 -0
- package/dist/hooks.d.ts +30 -37
- package/dist/hooks.js +111 -46
- package/dist/index-2UntyjBb.d.ts +52 -0
- package/dist/index-BgUHilZm.d.ts +108 -0
- package/dist/index-COgqsFAQ.d.ts +42 -0
- package/dist/index-CPDET_s1.d.ts +549 -0
- package/dist/index-CUhfHT_V.d.ts +204 -0
- package/dist/index-Cg6gYAqh.d.ts +73 -0
- package/dist/index-Cq-EJzqW.d.ts +16 -0
- package/dist/index-DhYmSaLF.d.ts +245 -0
- package/dist/index-DjKxO357.d.ts +128 -0
- package/dist/index.d.ts +26 -43
- package/dist/index.js +35 -472
- package/dist/markdown-BGqicV82.js +45 -0
- package/dist/markdown.d.ts +3 -18
- package/dist/markdown.js +3 -15
- package/dist/message-vhUI0c5G.d.ts +16 -0
- package/dist/nav.d.ts +6 -8
- package/dist/nav.js +29 -11
- package/dist/openui-artifact-renderer-D3E5bIAI.d.ts +114 -0
- package/dist/openui-artifact-renderer-DrU1AdVk.js +266 -0
- package/dist/openui.d.ts +2 -115
- package/dist/openui.js +2 -13
- package/dist/parts-5mhy9yJ3.d.ts +37 -0
- package/dist/primitives-Cb8GGVKr.js +1239 -0
- package/dist/primitives.d.ts +5 -525
- package/dist/primitives.js +9 -212
- package/dist/redaction-CGGB2ENG.js +74 -0
- package/dist/redaction.d.ts +2 -42
- package/dist/redaction.js +2 -7
- package/dist/run-OyWmIDqu.d.ts +41 -0
- package/dist/run-ZsIKPA6J.js +17 -0
- package/dist/run-group-BACLbCFl.js +410 -0
- package/dist/run.d.ts +3 -126
- package/dist/run.js +5 -40
- package/dist/sdk-hooks.d.ts +2 -285
- package/dist/sdk-hooks.js +3 -36
- package/dist/stores.d.ts +13 -14
- package/dist/stores.js +34 -76
- package/dist/table-Bss73DhB.js +146 -0
- package/dist/tabs-BVHR6NkO.js +40 -0
- package/dist/text-shimmer-BUUo6I-g.js +64 -0
- package/dist/tool-call-feed-BeB1_4pX.d.ts +47 -0
- package/dist/tool-call-feed-Djt2q11V.js +109 -0
- package/dist/tool-call-step-DNebqhmX.js +434 -0
- package/dist/tool-display-BAuAVa43.js +158 -0
- package/dist/{tool-display-z4JcDmMQ.d.ts → tool-display-DgmL5rIU.d.ts} +16 -16
- package/dist/tool-previews.d.ts +2 -48
- package/dist/tool-previews.js +2 -23
- package/dist/types.d.ts +6 -19
- package/dist/types.js +0 -1
- package/dist/use-auto-scroll-C5Pjeqon.js +153 -0
- package/dist/use-sse-stream-BVgO1QBN.js +884 -0
- package/dist/use-sse-stream-Dm6R5YWz.d.ts +282 -0
- package/dist/utils-Bl_CZ0Qp.js +37 -0
- package/dist/{chunk-RQHJBTEU.js → utils-C_uf36nf.js} +4 -6
- package/dist/utils.d.ts +2 -104
- package/dist/utils.js +6 -44
- package/package.json +39 -41
- package/src/lib/focus.ts +2 -1
- package/dist/artifact-pane-DpuWcAiF.d.ts +0 -33
- package/dist/button-CMQuQEW_.d.ts +0 -17
- package/dist/chunk-34A66VBG.js +0 -214
- package/dist/chunk-3OI2QKFD.js +0 -0
- package/dist/chunk-3XXBZL53.js +0 -174
- package/dist/chunk-42PAH5D2.js +0 -112
- package/dist/chunk-4CLN43XT.js +0 -45
- package/dist/chunk-55WHV7SS.js +0 -1604
- package/dist/chunk-565EATZZ.js +0 -156
- package/dist/chunk-5Z5ZYMOJ.js +0 -0
- package/dist/chunk-6BGQA4BQ.js +0 -0
- package/dist/chunk-BEBXZPHW.js +0 -299
- package/dist/chunk-C5WF4WMV.js +0 -734
- package/dist/chunk-HFL6R6IF.js +0 -37
- package/dist/chunk-HGML45QH.js +0 -104
- package/dist/chunk-HMAPIH7L.js +0 -595
- package/dist/chunk-K5XFRUS4.js +0 -1401
- package/dist/chunk-KFQGHD73.js +0 -198
- package/dist/chunk-L57WRIND.js +0 -59
- package/dist/chunk-LTEKI7YJ.js +0 -59
- package/dist/chunk-M3QZK62R.js +0 -233
- package/dist/chunk-ND3ZFXQK.js +0 -179
- package/dist/chunk-OEX7NZE3.js +0 -321
- package/dist/chunk-OL5GYLHV.js +0 -60
- package/dist/chunk-QGFYBNSO.js +0 -133
- package/dist/chunk-R7B3UWPF.js +0 -550
- package/dist/chunk-R7SUY4E3.js +0 -65
- package/dist/chunk-REJESC5U.js +0 -117
- package/dist/chunk-RQGKSCEZ.js +0 -0
- package/dist/chunk-SNLR2AEA.js +0 -40
- package/dist/chunk-WKWBTL2V.js +0 -15
- package/dist/chunk-X7CU776B.js +0 -1048
- package/dist/chunk-XU3HB5QL.js +0 -127
- package/dist/chunk-YTO5V6QS.js +0 -19
- package/dist/chunk-YU4E5J2N.js +0 -437
- package/dist/chunk-YZ6AK25N.js +0 -886
- package/dist/code-block-0kSpWMnf.d.ts +0 -25
- package/dist/document-editor-pane-IAEQn_Dl.d.ts +0 -128
- package/dist/document-editor-pane-QHDOBA43.js +0 -13
- package/dist/message-BHWbxBtT.d.ts +0 -15
- package/dist/parts-dj7AcUg0.d.ts +0 -36
- package/dist/run-PfLmDAox.d.ts +0 -41
- package/dist/tool-call-feed-D9iofJgW.d.ts +0 -46
package/dist/sdk-hooks.d.ts
CHANGED
|
@@ -1,285 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { R as Run, G as GroupedMessage } from './run-PfLmDAox.js';
|
|
4
|
-
import { S as SessionMessage } from './message-BHWbxBtT.js';
|
|
5
|
-
import { S as SessionPart } from './parts-dj7AcUg0.js';
|
|
6
|
-
import { R as RegisterActiveSessionOptions, g as ActiveSessionTransportMode, c as ActiveSessionConnectionState } from './active-sessions-store-CeOmXgv5.js';
|
|
7
|
-
import { F as FeedSegment } from './tool-call-feed-D9iofJgW.js';
|
|
8
|
-
import 'nanostores';
|
|
9
|
-
import 'react/jsx-runtime';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Scroll-to-bottom behaviour: sticks to the bottom while streaming,
|
|
13
|
-
* pauses when user scrolls up, resumes when user scrolls back down.
|
|
14
|
-
*/
|
|
15
|
-
declare function useAutoScroll(containerRef: RefObject<HTMLElement | null>, deps?: unknown[]): {
|
|
16
|
-
isAtBottom: boolean;
|
|
17
|
-
scrollToBottom: () => void;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
interface UseDropdownMenuOptions {
|
|
21
|
-
closeOnEsc?: boolean;
|
|
22
|
-
}
|
|
23
|
-
declare function useDropdownMenu(options?: UseDropdownMenuOptions): {
|
|
24
|
-
open: boolean;
|
|
25
|
-
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
26
|
-
ref: React.RefObject<HTMLDivElement | null>;
|
|
27
|
-
toggle: () => void;
|
|
28
|
-
close: () => void;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Manages per-run collapse state with auto-collapse after run completion.
|
|
33
|
-
*
|
|
34
|
-
* - Runs stay expanded by default
|
|
35
|
-
* - Collapse is manual only
|
|
36
|
-
*/
|
|
37
|
-
declare function useRunCollapseState(runs: Run[]): {
|
|
38
|
-
isCollapsed: (runId: string) => boolean;
|
|
39
|
-
toggleCollapse: (runId: string) => void;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
interface UseRunGroupsOptions {
|
|
43
|
-
messages: SessionMessage[];
|
|
44
|
-
partMap: Record<string, SessionPart[]>;
|
|
45
|
-
isStreaming: boolean;
|
|
46
|
-
}
|
|
47
|
-
declare function useRunGroups({ messages, partMap, isStreaming, }: UseRunGroupsOptions): GroupedMessage[];
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* useToolCallStream — parses SSE events into ToolCallFeed segments.
|
|
51
|
-
*
|
|
52
|
-
* Takes raw SSE event data from the orchestrator stream and produces
|
|
53
|
-
* structured FeedSegments that ToolCallFeed can render.
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
interface UseToolCallStreamReturn {
|
|
57
|
-
/** Current feed segments (text + tool calls interleaved) */
|
|
58
|
-
segments: FeedSegment[];
|
|
59
|
-
/** Push a raw SSE event into the stream */
|
|
60
|
-
pushEvent: (event: {
|
|
61
|
-
type: string;
|
|
62
|
-
data: Record<string, unknown>;
|
|
63
|
-
}) => void;
|
|
64
|
-
/** Push a text delta (from message.part.updated) */
|
|
65
|
-
pushText: (delta: string) => void;
|
|
66
|
-
/** Mark a tool call as complete */
|
|
67
|
-
completeToolCall: (id: string, result: {
|
|
68
|
-
output?: string;
|
|
69
|
-
error?: string;
|
|
70
|
-
duration?: number;
|
|
71
|
-
}) => void;
|
|
72
|
-
/** Reset the stream */
|
|
73
|
-
reset: () => void;
|
|
74
|
-
}
|
|
75
|
-
declare function useToolCallStream(): UseToolCallStreamReturn;
|
|
76
|
-
|
|
77
|
-
interface SdkSessionAttachment {
|
|
78
|
-
name: string;
|
|
79
|
-
size?: number;
|
|
80
|
-
}
|
|
81
|
-
interface SdkSessionSeed {
|
|
82
|
-
id: string;
|
|
83
|
-
role: SessionMessage["role"];
|
|
84
|
-
createdAt?: number | string | Date;
|
|
85
|
-
content?: string;
|
|
86
|
-
attachments?: SdkSessionAttachment[];
|
|
87
|
-
parts?: SessionPart[];
|
|
88
|
-
}
|
|
89
|
-
interface SdkSessionEvent {
|
|
90
|
-
type: string;
|
|
91
|
-
data?: Record<string, unknown>;
|
|
92
|
-
}
|
|
93
|
-
interface BeginAssistantMessageOptions {
|
|
94
|
-
id?: string;
|
|
95
|
-
role?: Extract<SessionMessage["role"], "assistant" | "system">;
|
|
96
|
-
createdAt?: number | string | Date;
|
|
97
|
-
}
|
|
98
|
-
interface AppendUserMessageOptions {
|
|
99
|
-
id?: string;
|
|
100
|
-
role?: Extract<SessionMessage["role"], "user" | "system">;
|
|
101
|
-
content: string;
|
|
102
|
-
createdAt?: number | string | Date;
|
|
103
|
-
attachments?: SdkSessionAttachment[];
|
|
104
|
-
}
|
|
105
|
-
interface CompleteAssistantMessageOptions {
|
|
106
|
-
messageId?: string;
|
|
107
|
-
finalText?: string;
|
|
108
|
-
}
|
|
109
|
-
interface ApplySdkEventOptions {
|
|
110
|
-
messageId?: string;
|
|
111
|
-
}
|
|
112
|
-
interface UseSdkSessionOptions {
|
|
113
|
-
initialMessages?: SdkSessionSeed[];
|
|
114
|
-
}
|
|
115
|
-
interface UseSdkSessionReturn {
|
|
116
|
-
messages: SessionMessage[];
|
|
117
|
-
partMap: Record<string, SessionPart[]>;
|
|
118
|
-
isStreaming: boolean;
|
|
119
|
-
activeAssistantMessageId: string | null;
|
|
120
|
-
replaceHistory: (messages: SdkSessionSeed[]) => void;
|
|
121
|
-
appendUserMessage: (message: AppendUserMessageOptions) => string;
|
|
122
|
-
beginAssistantMessage: (options?: BeginAssistantMessageOptions) => string;
|
|
123
|
-
applySdkEvent: (event: SdkSessionEvent, options?: ApplySdkEventOptions) => void;
|
|
124
|
-
completeAssistantMessage: (options?: CompleteAssistantMessageOptions) => void;
|
|
125
|
-
failAssistantMessage: (error: string, options?: {
|
|
126
|
-
messageId?: string;
|
|
127
|
-
}) => void;
|
|
128
|
-
setStreaming: (value: boolean) => void;
|
|
129
|
-
reset: () => void;
|
|
130
|
-
}
|
|
131
|
-
declare function useSdkSession({ initialMessages, }?: UseSdkSessionOptions): UseSdkSessionReturn;
|
|
132
|
-
|
|
133
|
-
interface RealtimeSessionOptions extends RegisterActiveSessionOptions {
|
|
134
|
-
connectUrl?: string | null;
|
|
135
|
-
enabled?: boolean;
|
|
136
|
-
foreground?: boolean;
|
|
137
|
-
keepRegistered?: boolean;
|
|
138
|
-
reconnect?: boolean;
|
|
139
|
-
reconnectIntervalMs?: number;
|
|
140
|
-
maxReconnectAttempts?: number;
|
|
141
|
-
transportMode?: ActiveSessionTransportMode;
|
|
142
|
-
onEvent?: (event: SdkSessionEvent) => void;
|
|
143
|
-
onOpen?: () => void;
|
|
144
|
-
onClose?: () => void;
|
|
145
|
-
onError?: (error: Error) => void;
|
|
146
|
-
}
|
|
147
|
-
interface RealtimeSessionState {
|
|
148
|
-
connectionState: ActiveSessionConnectionState;
|
|
149
|
-
lastError: string | null;
|
|
150
|
-
reconnectAttempts: number;
|
|
151
|
-
isConnected: boolean;
|
|
152
|
-
}
|
|
153
|
-
interface RealtimeSessionTarget extends RealtimeSessionOptions {
|
|
154
|
-
key?: string;
|
|
155
|
-
}
|
|
156
|
-
interface RealtimeSessionRegistryProps {
|
|
157
|
-
sessions: RealtimeSessionTarget[];
|
|
158
|
-
}
|
|
159
|
-
declare function useRealtimeSession({ sessionId, projectId, projectLabel, title, href, metadata, connectUrl, enabled, foreground, keepRegistered, reconnect, reconnectIntervalMs, maxReconnectAttempts, transportMode, onEvent, onOpen, onClose, onError, }: RealtimeSessionOptions): RealtimeSessionState;
|
|
160
|
-
declare function RealtimeSessionRegistry({ sessions }: RealtimeSessionRegistryProps): React.FunctionComponentElement<RealtimeSessionTarget>[];
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* SSE Event data structure
|
|
164
|
-
*/
|
|
165
|
-
interface SSEEvent<T = unknown> {
|
|
166
|
-
id?: string;
|
|
167
|
-
event: string;
|
|
168
|
-
data: T;
|
|
169
|
-
timestamp: number;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Connection state for SSE streams
|
|
173
|
-
*/
|
|
174
|
-
type ConnectionState = "connecting" | "connected" | "reconnecting" | "disconnected" | "error";
|
|
175
|
-
/**
|
|
176
|
-
* SSE stream options
|
|
177
|
-
*/
|
|
178
|
-
interface UseSSEStreamOptions<T = unknown> {
|
|
179
|
-
/** URL to connect to */
|
|
180
|
-
url: string;
|
|
181
|
-
/** Authorization header value */
|
|
182
|
-
authToken?: string;
|
|
183
|
-
/** Enable automatic reconnection (default: true) */
|
|
184
|
-
autoReconnect?: boolean;
|
|
185
|
-
/** Max reconnection attempts (default: 5) */
|
|
186
|
-
maxRetries?: number;
|
|
187
|
-
/** Base delay between reconnects in ms (default: 1000) */
|
|
188
|
-
reconnectDelay?: number;
|
|
189
|
-
/** Event types to listen for (default: all) */
|
|
190
|
-
eventTypes?: string[];
|
|
191
|
-
/** Callback for each event */
|
|
192
|
-
onEvent?: (event: SSEEvent<T>) => void;
|
|
193
|
-
/** Callback on connection state change */
|
|
194
|
-
onStateChange?: (state: ConnectionState) => void;
|
|
195
|
-
/** Callback on error */
|
|
196
|
-
onError?: (error: Error) => void;
|
|
197
|
-
/** Custom headers */
|
|
198
|
-
headers?: Record<string, string>;
|
|
199
|
-
/** Whether to start connected (default: true) */
|
|
200
|
-
enabled?: boolean;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* SSE stream result
|
|
204
|
-
*/
|
|
205
|
-
interface UseSSEStreamResult<T = unknown> {
|
|
206
|
-
/** Current connection state */
|
|
207
|
-
state: ConnectionState;
|
|
208
|
-
/** All received events */
|
|
209
|
-
events: SSEEvent<T>[];
|
|
210
|
-
/** Most recent event */
|
|
211
|
-
lastEvent: SSEEvent<T> | null;
|
|
212
|
-
/** Error if any */
|
|
213
|
-
error: Error | null;
|
|
214
|
-
/** Manually connect */
|
|
215
|
-
connect: () => void;
|
|
216
|
-
/** Manually disconnect */
|
|
217
|
-
disconnect: () => void;
|
|
218
|
-
/** Clear events buffer */
|
|
219
|
-
clearEvents: () => void;
|
|
220
|
-
/** Retry count */
|
|
221
|
-
retryCount: number;
|
|
222
|
-
/** Time since last event (ms) */
|
|
223
|
-
timeSinceLastEvent: number;
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* React hook for consuming SSE streams with automatic reconnection,
|
|
227
|
-
* event buffering, and state management.
|
|
228
|
-
*
|
|
229
|
-
* @example
|
|
230
|
-
* ```tsx
|
|
231
|
-
* const { events, state, lastEvent } = useSSEStream({
|
|
232
|
-
* url: '/api/v1/tasks/123/stream',
|
|
233
|
-
* authToken: 'Bearer xxx',
|
|
234
|
-
* onEvent: (e) => console.log('Event:', e),
|
|
235
|
-
* });
|
|
236
|
-
*
|
|
237
|
-
* return (
|
|
238
|
-
* <div>
|
|
239
|
-
* <p>Status: {state}</p>
|
|
240
|
-
* {events.map((e, i) => (
|
|
241
|
-
* <div key={i}>{e.event}: {JSON.stringify(e.data)}</div>
|
|
242
|
-
* ))}
|
|
243
|
-
* </div>
|
|
244
|
-
* );
|
|
245
|
-
* ```
|
|
246
|
-
*/
|
|
247
|
-
declare function useSSEStream<T = unknown>(options: UseSSEStreamOptions<T>): UseSSEStreamResult<T>;
|
|
248
|
-
/**
|
|
249
|
-
* Typed event types for common streaming scenarios
|
|
250
|
-
*/
|
|
251
|
-
interface TaskStreamEvent {
|
|
252
|
-
task_id: string;
|
|
253
|
-
status?: string;
|
|
254
|
-
progress?: number;
|
|
255
|
-
message?: string;
|
|
256
|
-
result?: unknown;
|
|
257
|
-
error?: string;
|
|
258
|
-
}
|
|
259
|
-
interface AgentStreamEvent {
|
|
260
|
-
type: "message.updated" | "tool_call" | "tool_result" | "llm_response" | "error" | "session.idle" | "execution.started" | "execution.result";
|
|
261
|
-
data: unknown;
|
|
262
|
-
timestamp?: number;
|
|
263
|
-
}
|
|
264
|
-
interface TerminalStreamEvent {
|
|
265
|
-
type: "output" | "input" | "error" | "exit";
|
|
266
|
-
data: string;
|
|
267
|
-
timestamp: number;
|
|
268
|
-
}
|
|
269
|
-
interface AutomationStreamEvent {
|
|
270
|
-
automation_id: string;
|
|
271
|
-
event_id?: string;
|
|
272
|
-
status?: string;
|
|
273
|
-
variant_id?: string;
|
|
274
|
-
output?: string;
|
|
275
|
-
action_result?: unknown;
|
|
276
|
-
error?: string;
|
|
277
|
-
}
|
|
278
|
-
interface BotStreamEvent {
|
|
279
|
-
bot_id: string;
|
|
280
|
-
type: "balance" | "trade" | "decision" | "log" | "error";
|
|
281
|
-
data: unknown;
|
|
282
|
-
timestamp: number;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
export { type AgentStreamEvent, type AppendUserMessageOptions, type ApplySdkEventOptions, type AutomationStreamEvent, type BeginAssistantMessageOptions, type BotStreamEvent, type CompleteAssistantMessageOptions, type ConnectionState, type RealtimeSessionOptions, RealtimeSessionRegistry, type RealtimeSessionRegistryProps, type RealtimeSessionState, type RealtimeSessionTarget, type SSEEvent, type SdkSessionAttachment, type SdkSessionEvent, type SdkSessionSeed, type TaskStreamEvent, type TerminalStreamEvent, type UseRunGroupsOptions, type UseSSEStreamOptions, type UseSSEStreamResult, type UseSdkSessionOptions, type UseSdkSessionReturn, type UseToolCallStreamReturn, useAutoScroll, useDropdownMenu, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useToolCallStream };
|
|
1
|
+
import { A as useRunGroups, C as SdkSessionSeed, D as UseToolCallStreamReturn, E as useSdkSession, M as useDropdownMenu, N as useAutoScroll, O as useToolCallStream, S as SdkSessionEvent, T as UseSdkSessionReturn, _ as AppendUserMessageOptions, a as SSEEvent, b as CompleteAssistantMessageOptions, c as UseSSEStreamOptions, d as RealtimeSessionOptions, f as RealtimeSessionRegistry, g as useRealtimeSession, h as RealtimeSessionTarget, i as ConnectionState, j as useRunCollapseState, k as UseRunGroupsOptions, l as UseSSEStreamResult, m as RealtimeSessionState, n as AutomationStreamEvent, o as TaskStreamEvent, p as RealtimeSessionRegistryProps, r as BotStreamEvent, s as TerminalStreamEvent, t as AgentStreamEvent, u as useSSEStream, v as ApplySdkEventOptions, w as UseSdkSessionOptions, x as SdkSessionAttachment, y as BeginAssistantMessageOptions } from "./use-sse-stream-Dm6R5YWz.js";
|
|
2
|
+
export { type AgentStreamEvent, type AppendUserMessageOptions, type ApplySdkEventOptions, type AutomationStreamEvent, type BeginAssistantMessageOptions, type BotStreamEvent, type CompleteAssistantMessageOptions, type ConnectionState, type RealtimeSessionOptions, RealtimeSessionRegistry, type RealtimeSessionRegistryProps, type RealtimeSessionState, type RealtimeSessionTarget, type SSEEvent, type SdkSessionAttachment, type SdkSessionEvent, type SdkSessionSeed, type TaskStreamEvent, type TerminalStreamEvent, type UseRunGroupsOptions, type UseSSEStreamOptions, type UseSSEStreamResult, type UseSdkSessionOptions, type UseSdkSessionReturn, type UseToolCallStreamReturn, useAutoScroll, useDropdownMenu, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useToolCallStream };
|
package/dist/sdk-hooks.js
CHANGED
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
useRealtimeSession,
|
|
5
|
-
useSSEStream,
|
|
6
|
-
useSdkSession,
|
|
7
|
-
useToolCallStream
|
|
8
|
-
} from "./chunk-X7CU776B.js";
|
|
9
|
-
import "./chunk-OEX7NZE3.js";
|
|
10
|
-
import {
|
|
11
|
-
useAutoScroll,
|
|
12
|
-
useRunCollapseState,
|
|
13
|
-
useRunGroups
|
|
14
|
-
} from "./chunk-565EATZZ.js";
|
|
15
|
-
import "./chunk-QGFYBNSO.js";
|
|
16
|
-
import "./chunk-R7B3UWPF.js";
|
|
17
|
-
import "./chunk-ND3ZFXQK.js";
|
|
18
|
-
import "./chunk-HMAPIH7L.js";
|
|
19
|
-
import "./chunk-L57WRIND.js";
|
|
20
|
-
import "./chunk-4CLN43XT.js";
|
|
21
|
-
import "./chunk-XU3HB5QL.js";
|
|
22
|
-
import "./chunk-OL5GYLHV.js";
|
|
23
|
-
import "./chunk-3XXBZL53.js";
|
|
24
|
-
import "./chunk-WKWBTL2V.js";
|
|
25
|
-
import "./chunk-RQHJBTEU.js";
|
|
26
|
-
export {
|
|
27
|
-
RealtimeSessionRegistry,
|
|
28
|
-
useAutoScroll,
|
|
29
|
-
useDropdownMenu,
|
|
30
|
-
useRealtimeSession,
|
|
31
|
-
useRunCollapseState,
|
|
32
|
-
useRunGroups,
|
|
33
|
-
useSSEStream,
|
|
34
|
-
useSdkSession,
|
|
35
|
-
useToolCallStream
|
|
36
|
-
};
|
|
1
|
+
import { n as useRunCollapseState, r as useRunGroups, t as useAutoScroll } from "./use-auto-scroll-C5Pjeqon.js";
|
|
2
|
+
import { a as useToolCallStream, i as useRealtimeSession, n as useSdkSession, o as useDropdownMenu, r as RealtimeSessionRegistry, t as useSSEStream } from "./use-sse-stream-BVgO1QBN.js";
|
|
3
|
+
export { RealtimeSessionRegistry, useAutoScroll, useDropdownMenu, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useToolCallStream };
|
package/dist/stores.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { S as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { t as SessionMessage } from "./message-vhUI0c5G.js";
|
|
2
|
+
import { n as SessionPart } from "./parts-5mhy9yJ3.js";
|
|
3
|
+
import { A as updateActiveSessionMeta, C as resetActiveSessions, D as setActiveSessionRunning, E as setActiveSessionError, F as useNavbarSessions, I as useProjectActivity, L as useProjectSessions, M as useActiveSessions, N as useActiveSessionsState, O as setForegroundActiveSession, P as useHasBackgroundRunningSessions, R as useSessionsByActivity, S as registerActiveSession, T as setActiveSessionConnection, _ as getSessionsByActivity, a as ActiveSessionReconnectState, b as getTotalRunningSessionCount, c as ActiveSessionTransportMode, d as SessionProjectKey, f as activeSessionsAtom, g as getAllProjectActivity, h as getAllActiveSessions, i as ActiveSessionConnectionState, j as useActiveSession, k as unregisterActiveSession, l as ActiveSessionsState, m as getActiveSession, n as ActiveSessionActivityOptions, o as ActiveSessionRecord, p as bumpActiveSessionActivity, r as ActiveSessionConnectionOptions, s as ActiveSessionStatus, t as ActiveProjectActivity, u as RegisterActiveSessionOptions, v as getSessionsForNavbar, w as setActiveSessionAttention, x as hasBackgroundRunningSessions, y as getSessionsForProject, z as useTotalRunningSessions } from "./active-sessions-store-nl70ZnMC.js";
|
|
4
|
+
//#region src/stores/chat-store.d.ts
|
|
6
5
|
/** Ordered list of messages in the current chat session. */
|
|
7
|
-
declare const messagesAtom: nanostores.PreinitializedWritableAtom<SessionMessage[]> & object;
|
|
6
|
+
export declare const messagesAtom: import("nanostores").PreinitializedWritableAtom<SessionMessage[]> & object;
|
|
8
7
|
/** Map of message ID → parts for that message. */
|
|
9
|
-
declare const partMapAtom: nanostores.PreinitializedMapStore<Record<string, SessionPart[]>> & object;
|
|
8
|
+
export declare const partMapAtom: import("nanostores").PreinitializedMapStore<Record<string, SessionPart[]>> & object;
|
|
10
9
|
/** Whether the assistant is currently streaming a response. */
|
|
11
|
-
declare const isStreamingAtom: nanostores.PreinitializedWritableAtom<boolean> & object;
|
|
12
|
-
declare function addMessage(msg: SessionMessage): void;
|
|
13
|
-
declare function addParts(messageId: string, parts: SessionPart[]): void;
|
|
14
|
-
declare function updatePart(messageId: string, partIndex: number, part: SessionPart): void;
|
|
15
|
-
declare function clearChat(): void;
|
|
16
|
-
|
|
17
|
-
export {
|
|
10
|
+
export declare const isStreamingAtom: import("nanostores").PreinitializedWritableAtom<boolean> & object;
|
|
11
|
+
export declare function addMessage(msg: SessionMessage): void;
|
|
12
|
+
export declare function addParts(messageId: string, parts: SessionPart[]): void;
|
|
13
|
+
export declare function updatePart(messageId: string, partIndex: number, part: SessionPart): void;
|
|
14
|
+
export declare function clearChat(): void;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ActiveProjectActivity, ActiveSessionActivityOptions, ActiveSessionConnectionOptions, ActiveSessionConnectionState, ActiveSessionReconnectState, ActiveSessionRecord, ActiveSessionStatus, ActiveSessionTransportMode, ActiveSessionsState, RegisterActiveSessionOptions, SessionProjectKey, activeSessionsAtom, bumpActiveSessionActivity, getActiveSession, getAllActiveSessions, getAllProjectActivity, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getTotalRunningSessionCount, hasBackgroundRunningSessions, registerActiveSession, resetActiveSessions, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, unregisterActiveSession, updateActiveSessionMeta, useActiveSession, useActiveSessions, useActiveSessionsState, useHasBackgroundRunningSessions, useNavbarSessions, useProjectActivity, useProjectSessions, useSessionsByActivity, useTotalRunningSessions };
|
package/dist/stores.js
CHANGED
|
@@ -1,76 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
useProjectActivity,
|
|
36
|
-
useProjectSessions,
|
|
37
|
-
useSessionsByActivity,
|
|
38
|
-
useTotalRunningSessions
|
|
39
|
-
} from "./chunk-OEX7NZE3.js";
|
|
40
|
-
export {
|
|
41
|
-
activeSessionsAtom,
|
|
42
|
-
addMessage,
|
|
43
|
-
addParts,
|
|
44
|
-
bumpActiveSessionActivity,
|
|
45
|
-
clearChat,
|
|
46
|
-
getActiveSession,
|
|
47
|
-
getAllActiveSessions,
|
|
48
|
-
getAllProjectActivity,
|
|
49
|
-
getSessionsByActivity,
|
|
50
|
-
getSessionsForNavbar,
|
|
51
|
-
getSessionsForProject,
|
|
52
|
-
getTotalRunningSessionCount,
|
|
53
|
-
hasBackgroundRunningSessions,
|
|
54
|
-
isStreamingAtom,
|
|
55
|
-
messagesAtom,
|
|
56
|
-
partMapAtom,
|
|
57
|
-
registerActiveSession,
|
|
58
|
-
resetActiveSessions,
|
|
59
|
-
setActiveSessionAttention,
|
|
60
|
-
setActiveSessionConnection,
|
|
61
|
-
setActiveSessionError,
|
|
62
|
-
setActiveSessionRunning,
|
|
63
|
-
setForegroundActiveSession,
|
|
64
|
-
unregisterActiveSession,
|
|
65
|
-
updateActiveSessionMeta,
|
|
66
|
-
updatePart,
|
|
67
|
-
useActiveSession,
|
|
68
|
-
useActiveSessions,
|
|
69
|
-
useActiveSessionsState,
|
|
70
|
-
useHasBackgroundRunningSessions,
|
|
71
|
-
useNavbarSessions,
|
|
72
|
-
useProjectActivity,
|
|
73
|
-
useProjectSessions,
|
|
74
|
-
useSessionsByActivity,
|
|
75
|
-
useTotalRunningSessions
|
|
76
|
-
};
|
|
1
|
+
import { C as useHasBackgroundRunningSessions, D as useSessionsByActivity, E as useProjectSessions, O as useTotalRunningSessions, S as useActiveSessionsState, T as useProjectActivity, _ as setForegroundActiveSession, a as getAllProjectActivity, b as useActiveSession, c as getSessionsForProject, d as registerActiveSession, f as resetActiveSessions, g as setActiveSessionRunning, h as setActiveSessionError, i as getAllActiveSessions, l as getTotalRunningSessionCount, m as setActiveSessionConnection, n as bumpActiveSessionActivity, o as getSessionsByActivity, p as setActiveSessionAttention, r as getActiveSession, s as getSessionsForNavbar, t as activeSessionsAtom, u as hasBackgroundRunningSessions, v as unregisterActiveSession, w as useNavbarSessions, x as useActiveSessions, y as updateActiveSessionMeta } from "./active-sessions-store-Gt1R0rFG.js";
|
|
2
|
+
import { atom, map } from "nanostores";
|
|
3
|
+
//#region src/stores/chat-store.ts
|
|
4
|
+
/** Ordered list of messages in the current chat session. */
|
|
5
|
+
const messagesAtom = atom([]);
|
|
6
|
+
/** Map of message ID → parts for that message. */
|
|
7
|
+
const partMapAtom = map({});
|
|
8
|
+
/** Whether the assistant is currently streaming a response. */
|
|
9
|
+
const isStreamingAtom = atom(false);
|
|
10
|
+
let insertionCounter = 0;
|
|
11
|
+
function addMessage(msg) {
|
|
12
|
+
const withIndex = {
|
|
13
|
+
...msg,
|
|
14
|
+
_insertionIndex: insertionCounter++
|
|
15
|
+
};
|
|
16
|
+
messagesAtom.set([...messagesAtom.get(), withIndex]);
|
|
17
|
+
}
|
|
18
|
+
function addParts(messageId, parts) {
|
|
19
|
+
const existing = partMapAtom.get()[messageId] ?? [];
|
|
20
|
+
partMapAtom.setKey(messageId, [...existing, ...parts]);
|
|
21
|
+
}
|
|
22
|
+
function updatePart(messageId, partIndex, part) {
|
|
23
|
+
const existing = [...partMapAtom.get()[messageId] ?? []];
|
|
24
|
+
existing[partIndex] = part;
|
|
25
|
+
partMapAtom.setKey(messageId, existing);
|
|
26
|
+
}
|
|
27
|
+
function clearChat() {
|
|
28
|
+
messagesAtom.set([]);
|
|
29
|
+
partMapAtom.set({});
|
|
30
|
+
isStreamingAtom.set(false);
|
|
31
|
+
insertionCounter = 0;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { activeSessionsAtom, addMessage, addParts, bumpActiveSessionActivity, clearChat, getActiveSession, getAllActiveSessions, getAllProjectActivity, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getTotalRunningSessionCount, hasBackgroundRunningSessions, isStreamingAtom, messagesAtom, partMapAtom, registerActiveSession, resetActiveSessions, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useHasBackgroundRunningSessions, useNavbarSessions, useProjectActivity, useProjectSessions, useSessionsByActivity, useTotalRunningSessions };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { i as focusRing } from "./focus-BcE_SHqz.js";
|
|
2
|
+
import { t as cn } from "./utils-C_uf36nf.js";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/primitives/card.tsx
|
|
7
|
+
const Card = React.forwardRef(({ className, variant = "default", hover = false, ...props }, ref) => {
|
|
8
|
+
return /* @__PURE__ */ jsx("div", {
|
|
9
|
+
ref,
|
|
10
|
+
className: cn("rounded-[var(--radius-lg)] border text-card-foreground transition-[border-color,box-shadow]", "duration-[var(--transition-default)]", {
|
|
11
|
+
default: "bg-card border-border",
|
|
12
|
+
elevated: "bg-muted/50 border-border shadow-[var(--shadow-card)]",
|
|
13
|
+
glass: "bg-card/80 backdrop-blur-xl border-border shadow-[var(--shadow-card)]",
|
|
14
|
+
sandbox: "bg-muted/50 border-primary/20 shadow-[var(--shadow-accent)]"
|
|
15
|
+
}[variant], hover && "cursor-pointer hover:border-[var(--border-strong)]", className),
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
Card.displayName = "Card";
|
|
20
|
+
const CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
21
|
+
ref,
|
|
22
|
+
className: cn("flex flex-col space-y-1 p-4", className),
|
|
23
|
+
...props
|
|
24
|
+
}));
|
|
25
|
+
CardHeader.displayName = "CardHeader";
|
|
26
|
+
const CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("h3", {
|
|
27
|
+
ref,
|
|
28
|
+
className: cn("font-semibold leading-none tracking-tight", className),
|
|
29
|
+
...props
|
|
30
|
+
}));
|
|
31
|
+
CardTitle.displayName = "CardTitle";
|
|
32
|
+
const CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", {
|
|
33
|
+
ref,
|
|
34
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
35
|
+
...props
|
|
36
|
+
}));
|
|
37
|
+
CardDescription.displayName = "CardDescription";
|
|
38
|
+
const CardContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
39
|
+
ref,
|
|
40
|
+
className: cn("p-4 pt-0", className),
|
|
41
|
+
...props
|
|
42
|
+
}));
|
|
43
|
+
CardContent.displayName = "CardContent";
|
|
44
|
+
const CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
45
|
+
ref,
|
|
46
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
47
|
+
...props
|
|
48
|
+
}));
|
|
49
|
+
CardFooter.displayName = "CardFooter";
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/primitives/badge.tsx
|
|
52
|
+
const badgeVariants = cva(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 font-medium text-xs transition-colors ${focusRing}`, {
|
|
53
|
+
variants: { variant: {
|
|
54
|
+
default: "border-transparent bg-primary text-primary-foreground",
|
|
55
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground",
|
|
56
|
+
destructive: "border-transparent bg-destructive/15 border-destructive/25 text-destructive",
|
|
57
|
+
outline: "text-foreground border-border",
|
|
58
|
+
success: "border-[var(--surface-success-border)] bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]",
|
|
59
|
+
warning: "border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
|
|
60
|
+
error: "border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] text-[var(--surface-danger-text)]",
|
|
61
|
+
info: "border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
|
|
62
|
+
sandbox: "border-border bg-[var(--accent-surface-soft)] text-[var(--accent-text)]",
|
|
63
|
+
running: "border-[var(--surface-teal-border)] bg-[var(--surface-teal-bg)] text-[var(--surface-teal-text)]",
|
|
64
|
+
creating: "border-[var(--surface-violet-border)] bg-[var(--surface-violet-bg)] text-[var(--surface-violet-text)]",
|
|
65
|
+
stopped: "border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
|
|
66
|
+
warm: "border-[var(--surface-orange-border)] bg-[var(--surface-orange-bg)] text-[var(--surface-orange-text)]",
|
|
67
|
+
cold: "border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
|
|
68
|
+
deleted: "border-[var(--surface-neutral-border)] bg-[var(--surface-neutral-bg)] text-[var(--surface-neutral-text)]"
|
|
69
|
+
} },
|
|
70
|
+
defaultVariants: { variant: "default" }
|
|
71
|
+
});
|
|
72
|
+
const statusDotClass = {
|
|
73
|
+
running: "status-dot status-dot-running",
|
|
74
|
+
creating: "status-dot status-dot-creating",
|
|
75
|
+
stopped: "status-dot status-dot-stopped",
|
|
76
|
+
warm: "status-dot status-dot-warm",
|
|
77
|
+
cold: "status-dot status-dot-cold",
|
|
78
|
+
error: "status-dot status-dot-error",
|
|
79
|
+
deleted: "status-dot status-dot-deleted"
|
|
80
|
+
};
|
|
81
|
+
function Badge({ className, variant, dot, children, ...props }) {
|
|
82
|
+
const dotClass = dot && variant ? statusDotClass[variant] : null;
|
|
83
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
84
|
+
className: cn(badgeVariants({ variant }), className),
|
|
85
|
+
...props,
|
|
86
|
+
children: [dotClass && /* @__PURE__ */ jsx("span", {
|
|
87
|
+
className: dotClass,
|
|
88
|
+
"aria-hidden": true
|
|
89
|
+
}), children]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/primitives/table.tsx
|
|
94
|
+
const Table = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
95
|
+
className: "relative w-full overflow-auto",
|
|
96
|
+
children: /* @__PURE__ */ jsx("table", {
|
|
97
|
+
ref,
|
|
98
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
99
|
+
...props
|
|
100
|
+
})
|
|
101
|
+
}));
|
|
102
|
+
Table.displayName = "Table";
|
|
103
|
+
const TableHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", {
|
|
104
|
+
ref,
|
|
105
|
+
className: cn("[&_tr]:border-b", className),
|
|
106
|
+
...props
|
|
107
|
+
}));
|
|
108
|
+
TableHeader.displayName = "TableHeader";
|
|
109
|
+
const TableBody = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", {
|
|
110
|
+
ref,
|
|
111
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
112
|
+
...props
|
|
113
|
+
}));
|
|
114
|
+
TableBody.displayName = "TableBody";
|
|
115
|
+
const TableFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tfoot", {
|
|
116
|
+
ref,
|
|
117
|
+
className: cn("border-t bg-card font-medium [&>tr]:last:border-b-0", className),
|
|
118
|
+
...props
|
|
119
|
+
}));
|
|
120
|
+
TableFooter.displayName = "TableFooter";
|
|
121
|
+
const TableRow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tr", {
|
|
122
|
+
ref,
|
|
123
|
+
className: cn("border-border border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted/50", className),
|
|
124
|
+
...props
|
|
125
|
+
}));
|
|
126
|
+
TableRow.displayName = "TableRow";
|
|
127
|
+
const TableHead = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("th", {
|
|
128
|
+
ref,
|
|
129
|
+
className: cn("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", className),
|
|
130
|
+
...props
|
|
131
|
+
}));
|
|
132
|
+
TableHead.displayName = "TableHead";
|
|
133
|
+
const TableCell = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("td", {
|
|
134
|
+
ref,
|
|
135
|
+
className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className),
|
|
136
|
+
...props
|
|
137
|
+
}));
|
|
138
|
+
TableCell.displayName = "TableCell";
|
|
139
|
+
const TableCaption = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", {
|
|
140
|
+
ref,
|
|
141
|
+
className: cn("mt-4 text-muted-foreground text-sm", className),
|
|
142
|
+
...props
|
|
143
|
+
}));
|
|
144
|
+
TableCaption.displayName = "TableCaption";
|
|
145
|
+
//#endregion
|
|
146
|
+
export { TableFooter as a, TableRow as c, Card as d, CardContent as f, CardTitle as g, CardHeader as h, TableCell as i, Badge as l, CardFooter as m, TableBody as n, TableHead as o, CardDescription as p, TableCaption as r, TableHeader as s, Table as t, badgeVariants as u };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { i as focusRing } from "./focus-BcE_SHqz.js";
|
|
2
|
+
import { t as cn } from "./utils-C_uf36nf.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
6
|
+
//#region src/primitives/tabs.tsx
|
|
7
|
+
const Tabs = TabsPrimitive.Root;
|
|
8
|
+
const TabsList = React.forwardRef(({ className, variant = "default", ...props }, ref) => {
|
|
9
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.List, {
|
|
10
|
+
ref,
|
|
11
|
+
className: cn({
|
|
12
|
+
default: "inline-flex h-10 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
|
|
13
|
+
pills: "inline-flex items-center gap-2",
|
|
14
|
+
underline: "inline-flex items-center gap-4 border-b border-border"
|
|
15
|
+
}[variant], className),
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
20
|
+
const TabsTrigger = React.forwardRef(({ className, variant = "default", ...props }, ref) => {
|
|
21
|
+
const variants = {
|
|
22
|
+
default: `inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium transition-all ${focusRing} disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm`,
|
|
23
|
+
pills: `inline-flex items-center justify-center whitespace-nowrap rounded-full px-4 py-2 text-sm font-medium transition-all ${focusRing} disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=inactive]:text-muted-foreground data-[state=inactive]:hover:bg-muted`,
|
|
24
|
+
underline: `inline-flex items-center justify-center whitespace-nowrap rounded-t-md pb-3 text-sm font-medium transition-all ${focusRing} disabled:pointer-events-none disabled:opacity-50 border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground`
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.Trigger, {
|
|
27
|
+
ref,
|
|
28
|
+
className: cn(variants[variant], className),
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
33
|
+
const TabsContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(TabsPrimitive.Content, {
|
|
34
|
+
ref,
|
|
35
|
+
className: cn("mt-4", focusRing, "data-[state=active]:fade-in-0 data-[state=active]:slide-in-from-bottom-2 data-[state=active]:animate-in", className),
|
|
36
|
+
...props
|
|
37
|
+
}));
|
|
38
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { TabsTrigger as i, TabsContent as n, TabsList as r, Tabs as t };
|