ai-design-system 0.1.103 → 0.1.105
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/components/composites/PromptInput/PromptInput.stories.tsx +23 -0
- package/components/composites/PromptInput/PromptInput.tsx +60 -4
- package/components/composites/PromptInput/index.ts +1 -1
- package/components/composites/ScenePlayer/ScenePlayer.tsx +8 -2
- package/components/composites/index.ts +1 -0
- package/components/features/ChatPanel/ChatPanel.tsx +17 -1
- package/components/index.ts +1 -0
- package/dist/index.cjs +123 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +28 -0
- package/dist/index.d.ts +75 -57
- package/dist/index.js +123 -56
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -360,5 +360,28 @@ export const WithSpeechInput: Story = {
|
|
|
360
360
|
},
|
|
361
361
|
};
|
|
362
362
|
|
|
363
|
+
/**
|
|
364
|
+
* Row / Inline Variant
|
|
365
|
+
* Single row where the input box and send button are side-by-side, without tools icons.
|
|
366
|
+
*/
|
|
367
|
+
export const RowVariant: Story = {
|
|
368
|
+
args: {
|
|
369
|
+
variant: "row",
|
|
370
|
+
placeholder: "Ask a question or provide instructions...",
|
|
371
|
+
onSubmit: (message) => {
|
|
372
|
+
console.log("Submitted in row mode:", message);
|
|
373
|
+
alert(`Submitted: ${message.text}`);
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
parameters: {
|
|
377
|
+
docs: {
|
|
378
|
+
description: {
|
|
379
|
+
story:
|
|
380
|
+
"Compact single-row PromptInput variant where input box and send button are in the same line without toolbar tool icons (attachments, speech mic, etc.).",
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
|
|
363
386
|
|
|
364
387
|
|
|
@@ -35,6 +35,7 @@ import { SpeechInput, type SpeechInputProps } from "@/components/ai-elements/spe
|
|
|
35
35
|
import type { FormEvent } from "react";
|
|
36
36
|
import { Button } from "@/components/primitives/Button";
|
|
37
37
|
import { Icon } from "@/components/primitives/Icon";
|
|
38
|
+
import { InputGroupAddon } from "@/components/primitives/InputGroup";
|
|
38
39
|
import { cn } from "@/lib/utils";
|
|
39
40
|
|
|
40
41
|
export interface PromptInputContextProps {
|
|
@@ -44,11 +45,14 @@ export interface PromptInputContextProps {
|
|
|
44
45
|
modelId?: string;
|
|
45
46
|
}
|
|
46
47
|
|
|
48
|
+
export type PromptInputVariant = "default" | "row" | "inline";
|
|
49
|
+
|
|
47
50
|
export interface PromptInputBlockProps
|
|
48
51
|
extends Omit<
|
|
49
52
|
AIPromptInputProps,
|
|
50
53
|
"globalDrop" | "syncHiddenInput" | "onSubmit" | "onChange"
|
|
51
54
|
> {
|
|
55
|
+
variant?: PromptInputVariant;
|
|
52
56
|
disabled?: boolean;
|
|
53
57
|
placeholder?: string;
|
|
54
58
|
value?: string;
|
|
@@ -62,6 +66,7 @@ export interface PromptInputBlockProps
|
|
|
62
66
|
onStop?: () => void;
|
|
63
67
|
context?: PromptInputContextProps | ReactNode;
|
|
64
68
|
tools?: ReactNode;
|
|
69
|
+
enableAttachments?: boolean;
|
|
65
70
|
enableSpeech?: boolean;
|
|
66
71
|
speechProps?: SpeechInputProps;
|
|
67
72
|
attachIcon?: "paperclip" | "plus";
|
|
@@ -69,6 +74,7 @@ export interface PromptInputBlockProps
|
|
|
69
74
|
|
|
70
75
|
export const PromptInput = React.memo<PromptInputBlockProps>(
|
|
71
76
|
({
|
|
77
|
+
variant = "default",
|
|
72
78
|
disabled = false,
|
|
73
79
|
placeholder,
|
|
74
80
|
value,
|
|
@@ -79,7 +85,8 @@ export const PromptInput = React.memo<PromptInputBlockProps>(
|
|
|
79
85
|
onStop,
|
|
80
86
|
context,
|
|
81
87
|
tools,
|
|
82
|
-
|
|
88
|
+
enableAttachments,
|
|
89
|
+
enableSpeech,
|
|
83
90
|
speechProps,
|
|
84
91
|
attachIcon = "paperclip",
|
|
85
92
|
accept = "image/*,audio/*",
|
|
@@ -87,8 +94,13 @@ export const PromptInput = React.memo<PromptInputBlockProps>(
|
|
|
87
94
|
maxFiles,
|
|
88
95
|
maxFileSize,
|
|
89
96
|
onError,
|
|
97
|
+
className,
|
|
90
98
|
...props
|
|
91
99
|
}) => {
|
|
100
|
+
const isRowVariant = variant === "row" || variant === "inline";
|
|
101
|
+
const showAttachments = enableAttachments ?? !isRowVariant;
|
|
102
|
+
const showSpeech = enableSpeech ?? !isRowVariant;
|
|
103
|
+
|
|
92
104
|
const existingController = useOptionalPromptInputController();
|
|
93
105
|
|
|
94
106
|
const handleSubmit = React.useCallback(
|
|
@@ -122,7 +134,44 @@ export const PromptInput = React.memo<PromptInputBlockProps>(
|
|
|
122
134
|
|
|
123
135
|
const isStopping = loading && Boolean(onStop);
|
|
124
136
|
|
|
125
|
-
const promptInputContent = (
|
|
137
|
+
const promptInputContent = isRowVariant ? (
|
|
138
|
+
<AIPromptInput
|
|
139
|
+
onSubmit={handleSubmit}
|
|
140
|
+
accept={accept}
|
|
141
|
+
multiple={multiple}
|
|
142
|
+
maxFiles={maxFiles}
|
|
143
|
+
maxFileSize={maxFileSize}
|
|
144
|
+
onError={onError}
|
|
145
|
+
className={cn(
|
|
146
|
+
"[&>[data-slot=input-group]]:rounded-2xl",
|
|
147
|
+
className?.includes("border") &&
|
|
148
|
+
"[&>[data-slot=input-group]]:border-0 [&>[data-slot=input-group]]:bg-transparent [&>[data-slot=input-group]]:shadow-none",
|
|
149
|
+
className
|
|
150
|
+
)}
|
|
151
|
+
{...props}
|
|
152
|
+
>
|
|
153
|
+
{showAttachments && <AttachmentPreviews />}
|
|
154
|
+
<PromptInputTextarea
|
|
155
|
+
placeholder={placeholder}
|
|
156
|
+
disabled={disabled}
|
|
157
|
+
onChange={isControlled ? handleControlledChange : undefined}
|
|
158
|
+
className="min-h-9 py-2 px-3 text-sm resize-none border-0 shadow-none focus-visible:ring-0 bg-transparent flex-1 field-sizing-content"
|
|
159
|
+
/>
|
|
160
|
+
<InputGroupAddon align="inline-end" className="self-end pb-1 pr-1.5 shrink-0">
|
|
161
|
+
<PromptInputSubmit
|
|
162
|
+
disabled={disabled || (loading && !onStop)}
|
|
163
|
+
status={loading ? (onStop ? "streaming" : "submitted") : undefined}
|
|
164
|
+
onClick={isStopping ? (e: React.MouseEvent) => { e.preventDefault(); onStop?.(); } : undefined}
|
|
165
|
+
className={cn(
|
|
166
|
+
"rounded-lg bg-blue-600 hover:bg-blue-700 text-white transition-colors",
|
|
167
|
+
isStopping && "bg-transparent hover:bg-accent"
|
|
168
|
+
)}
|
|
169
|
+
>
|
|
170
|
+
{loading ? undefined : <Icon name="corner-down-left" size="sm" />}
|
|
171
|
+
</PromptInputSubmit>
|
|
172
|
+
</InputGroupAddon>
|
|
173
|
+
</AIPromptInput>
|
|
174
|
+
) : (
|
|
126
175
|
<AIPromptInput
|
|
127
176
|
onSubmit={handleSubmit}
|
|
128
177
|
accept={accept}
|
|
@@ -130,6 +179,11 @@ export const PromptInput = React.memo<PromptInputBlockProps>(
|
|
|
130
179
|
maxFiles={maxFiles}
|
|
131
180
|
maxFileSize={maxFileSize}
|
|
132
181
|
onError={onError}
|
|
182
|
+
className={cn(
|
|
183
|
+
className?.includes("border") &&
|
|
184
|
+
"[&>[data-slot=input-group]]:border-0 [&>[data-slot=input-group]]:bg-transparent [&>[data-slot=input-group]]:shadow-none",
|
|
185
|
+
className
|
|
186
|
+
)}
|
|
133
187
|
{...props}
|
|
134
188
|
>
|
|
135
189
|
<PromptInputBody>
|
|
@@ -142,8 +196,10 @@ export const PromptInput = React.memo<PromptInputBlockProps>(
|
|
|
142
196
|
</PromptInputBody>
|
|
143
197
|
<PromptInputFooter>
|
|
144
198
|
<PromptInputTools>
|
|
145
|
-
|
|
146
|
-
|
|
199
|
+
{showAttachments && (
|
|
200
|
+
<AttachButton disabled={disabled || loading} icon={attachIcon} />
|
|
201
|
+
)}
|
|
202
|
+
{showSpeech && (
|
|
147
203
|
<SpeechInput
|
|
148
204
|
disabled={disabled || loading}
|
|
149
205
|
{...speechProps}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { PromptInput } from "./PromptInput";
|
|
2
|
-
export type { PromptInputBlockProps, PromptInputContextProps } from "./PromptInput";
|
|
2
|
+
export type { PromptInputBlockProps, PromptInputContextProps, PromptInputVariant } from "./PromptInput";
|
|
3
3
|
|
|
4
4
|
export { SpeechInput } from "@/components/ai-elements/speech-input";
|
|
5
5
|
export type { SpeechInputProps } from "@/components/ai-elements/speech-input";
|
|
@@ -4,7 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
import type { FormEvent } from "react";
|
|
5
5
|
import { Button } from "@/components/primitives/Button";
|
|
6
6
|
import { Icon } from "@/components/primitives/Icon";
|
|
7
|
-
import { PromptInput } from "@/components/composites/PromptInput";
|
|
7
|
+
import { PromptInput, type PromptInputVariant } from "@/components/composites/PromptInput";
|
|
8
8
|
import type { PromptInputMessage } from "@/components/ai-elements/prompt-input";
|
|
9
9
|
import { cn } from "@/lib/utils";
|
|
10
10
|
|
|
@@ -45,6 +45,8 @@ export interface ScenePlayerProps extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
45
45
|
loading?: boolean;
|
|
46
46
|
onStop?: () => void;
|
|
47
47
|
enableSpeech?: boolean;
|
|
48
|
+
enableAttachments?: boolean;
|
|
49
|
+
promptInputVariant?: PromptInputVariant;
|
|
48
50
|
onPublish?: (currentScene: SceneItem, text?: string) => void;
|
|
49
51
|
publishPlaceholder?: string;
|
|
50
52
|
onSceneChange?: (sceneIndex: number, scene: SceneItem) => void;
|
|
@@ -72,7 +74,9 @@ export const ScenePlayer = React.forwardRef<HTMLDivElement, ScenePlayerProps>(
|
|
|
72
74
|
onSubmit,
|
|
73
75
|
loading = false,
|
|
74
76
|
onStop,
|
|
75
|
-
enableSpeech =
|
|
77
|
+
enableSpeech = false,
|
|
78
|
+
enableAttachments = false,
|
|
79
|
+
promptInputVariant = "row",
|
|
76
80
|
onPublish,
|
|
77
81
|
publishPlaceholder = "Ask a question or provide instructions...",
|
|
78
82
|
onSceneChange,
|
|
@@ -408,6 +412,7 @@ export const ScenePlayer = React.forwardRef<HTMLDivElement, ScenePlayerProps>(
|
|
|
408
412
|
}}
|
|
409
413
|
>
|
|
410
414
|
<PromptInput
|
|
415
|
+
variant={promptInputVariant}
|
|
411
416
|
placeholder={placeholder || publishPlaceholder}
|
|
412
417
|
value={promptValue}
|
|
413
418
|
onChange={onPromptValueChange}
|
|
@@ -415,6 +420,7 @@ export const ScenePlayer = React.forwardRef<HTMLDivElement, ScenePlayerProps>(
|
|
|
415
420
|
loading={loading}
|
|
416
421
|
onStop={onStop}
|
|
417
422
|
enableSpeech={enableSpeech}
|
|
423
|
+
enableAttachments={enableAttachments}
|
|
418
424
|
className="border border-border bg-background shadow-md overflow-hidden rounded-2xl"
|
|
419
425
|
/>
|
|
420
426
|
</div>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { AIConversation } from "@/components/blocks/AIConversation";
|
|
5
5
|
import { FileChangeQueue } from "@/components/blocks/FileChangeQueue";
|
|
6
|
-
import { PromptInput, type PromptInputContextProps } from "@/components/composites/PromptInput";
|
|
6
|
+
import { PromptInput, type PromptInputContextProps, type PromptInputVariant } from "@/components/composites/PromptInput";
|
|
7
7
|
import { TaskQueue, type TaskItem } from "@/components/composites/TaskQueue";
|
|
8
8
|
import { ApprovalCard } from "@/components/composites/ApprovalCard";
|
|
9
9
|
import { cn } from "@/lib/utils";
|
|
@@ -194,6 +194,18 @@ export interface ChatPanelProps {
|
|
|
194
194
|
* Handler when a task item is clicked (e.g. to inspect terminal output or logs)
|
|
195
195
|
*/
|
|
196
196
|
onTaskClick?: (task: TaskItem) => void;
|
|
197
|
+
/**
|
|
198
|
+
* Layout variant for PromptInput:
|
|
199
|
+
* - "default": multi-line textarea with toolbar buttons below (attachment, mic)
|
|
200
|
+
* - "row" | "inline": single row where input box and send button are side-by-side without tools icons
|
|
201
|
+
* @default "default"
|
|
202
|
+
*/
|
|
203
|
+
promptInputVariant?: PromptInputVariant;
|
|
204
|
+
/**
|
|
205
|
+
* Whether to enable the attachment button in prompt
|
|
206
|
+
* @default true for default variant, false for row variant
|
|
207
|
+
*/
|
|
208
|
+
enableAttachments?: boolean;
|
|
197
209
|
/**
|
|
198
210
|
* Whether to enable the voice-note microphone button in prompt
|
|
199
211
|
* @default true
|
|
@@ -268,6 +280,8 @@ export const ChatPanel = React.memo<ChatPanelProps>(
|
|
|
268
280
|
onTaskRetry,
|
|
269
281
|
onTaskStopAll,
|
|
270
282
|
onTaskClick,
|
|
283
|
+
promptInputVariant = "default",
|
|
284
|
+
enableAttachments,
|
|
271
285
|
enableSpeech = true,
|
|
272
286
|
showHeader = true,
|
|
273
287
|
sessionTitle,
|
|
@@ -465,6 +479,7 @@ export const ChatPanel = React.memo<ChatPanelProps>(
|
|
|
465
479
|
/>
|
|
466
480
|
)}
|
|
467
481
|
<PromptInput
|
|
482
|
+
variant={promptInputVariant}
|
|
468
483
|
dialog={dialog}
|
|
469
484
|
placeholder={placeholder}
|
|
470
485
|
value={promptValue}
|
|
@@ -474,6 +489,7 @@ export const ChatPanel = React.memo<ChatPanelProps>(
|
|
|
474
489
|
onStop={onStop}
|
|
475
490
|
context={context}
|
|
476
491
|
enableSpeech={enableSpeech}
|
|
492
|
+
enableAttachments={enableAttachments}
|
|
477
493
|
className={cn(
|
|
478
494
|
"border border-neutral-600 bg-background shadow-sm overflow-hidden",
|
|
479
495
|
tasks.length > 0 && !dialog
|
package/components/index.ts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -6825,9 +6825,58 @@ var SpeechInput = React3__namespace.memo(
|
|
|
6825
6825
|
}
|
|
6826
6826
|
);
|
|
6827
6827
|
SpeechInput.displayName = "SpeechInput";
|
|
6828
|
+
var InputGroup2 = React3__namespace.memo(
|
|
6829
|
+
React3__namespace.forwardRef(
|
|
6830
|
+
(props, ref) => {
|
|
6831
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InputGroup, __spreadValues({ ref }, props));
|
|
6832
|
+
}
|
|
6833
|
+
)
|
|
6834
|
+
);
|
|
6835
|
+
InputGroup2.displayName = "InputGroup";
|
|
6836
|
+
var InputGroupAddon2 = React3__namespace.memo(
|
|
6837
|
+
React3__namespace.forwardRef(
|
|
6838
|
+
(props, ref) => {
|
|
6839
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InputGroupAddon, __spreadValues({ ref }, props));
|
|
6840
|
+
}
|
|
6841
|
+
)
|
|
6842
|
+
);
|
|
6843
|
+
InputGroupAddon2.displayName = "InputGroupAddon";
|
|
6844
|
+
var InputGroupButton2 = React3__namespace.memo(
|
|
6845
|
+
React3__namespace.forwardRef(
|
|
6846
|
+
(props, ref) => {
|
|
6847
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InputGroupButton, __spreadValues({ ref }, props));
|
|
6848
|
+
}
|
|
6849
|
+
)
|
|
6850
|
+
);
|
|
6851
|
+
InputGroupButton2.displayName = "InputGroupButton";
|
|
6852
|
+
var InputGroupInput2 = React3__namespace.memo(
|
|
6853
|
+
React3__namespace.forwardRef(
|
|
6854
|
+
(props, ref) => {
|
|
6855
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InputGroupInput, __spreadValues({ ref }, props));
|
|
6856
|
+
}
|
|
6857
|
+
)
|
|
6858
|
+
);
|
|
6859
|
+
InputGroupInput2.displayName = "InputGroupInput";
|
|
6860
|
+
var InputGroupText2 = React3__namespace.memo(
|
|
6861
|
+
React3__namespace.forwardRef(
|
|
6862
|
+
(props, ref) => {
|
|
6863
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InputGroupText, __spreadValues({ ref }, props));
|
|
6864
|
+
}
|
|
6865
|
+
)
|
|
6866
|
+
);
|
|
6867
|
+
InputGroupText2.displayName = "InputGroupText";
|
|
6868
|
+
var InputGroupTextarea2 = React3__namespace.memo(
|
|
6869
|
+
React3__namespace.forwardRef(
|
|
6870
|
+
(props, ref) => {
|
|
6871
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InputGroupTextarea, __spreadValues({ ref }, props));
|
|
6872
|
+
}
|
|
6873
|
+
)
|
|
6874
|
+
);
|
|
6875
|
+
InputGroupTextarea2.displayName = "InputGroupTextarea";
|
|
6828
6876
|
var PromptInput2 = React3__namespace.memo(
|
|
6829
6877
|
(_a) => {
|
|
6830
6878
|
var _b = _a, {
|
|
6879
|
+
variant = "default",
|
|
6831
6880
|
disabled = false,
|
|
6832
6881
|
placeholder,
|
|
6833
6882
|
value,
|
|
@@ -6838,15 +6887,18 @@ var PromptInput2 = React3__namespace.memo(
|
|
|
6838
6887
|
onStop,
|
|
6839
6888
|
context,
|
|
6840
6889
|
tools,
|
|
6841
|
-
|
|
6890
|
+
enableAttachments,
|
|
6891
|
+
enableSpeech,
|
|
6842
6892
|
speechProps,
|
|
6843
6893
|
attachIcon = "paperclip",
|
|
6844
6894
|
accept = "image/*,audio/*",
|
|
6845
6895
|
multiple = true,
|
|
6846
6896
|
maxFiles,
|
|
6847
6897
|
maxFileSize,
|
|
6848
|
-
onError
|
|
6898
|
+
onError,
|
|
6899
|
+
className
|
|
6849
6900
|
} = _b, props = __objRest(_b, [
|
|
6901
|
+
"variant",
|
|
6850
6902
|
"disabled",
|
|
6851
6903
|
"placeholder",
|
|
6852
6904
|
"value",
|
|
@@ -6857,6 +6909,7 @@ var PromptInput2 = React3__namespace.memo(
|
|
|
6857
6909
|
"onStop",
|
|
6858
6910
|
"context",
|
|
6859
6911
|
"tools",
|
|
6912
|
+
"enableAttachments",
|
|
6860
6913
|
"enableSpeech",
|
|
6861
6914
|
"speechProps",
|
|
6862
6915
|
"attachIcon",
|
|
@@ -6864,8 +6917,12 @@ var PromptInput2 = React3__namespace.memo(
|
|
|
6864
6917
|
"multiple",
|
|
6865
6918
|
"maxFiles",
|
|
6866
6919
|
"maxFileSize",
|
|
6867
|
-
"onError"
|
|
6920
|
+
"onError",
|
|
6921
|
+
"className"
|
|
6868
6922
|
]);
|
|
6923
|
+
const isRowVariant = variant === "row" || variant === "inline";
|
|
6924
|
+
const showAttachments = enableAttachments != null ? enableAttachments : !isRowVariant;
|
|
6925
|
+
const showSpeech = enableSpeech != null ? enableSpeech : !isRowVariant;
|
|
6869
6926
|
const existingController = useOptionalPromptInputController();
|
|
6870
6927
|
const handleSubmit = React3__namespace.useCallback(
|
|
6871
6928
|
(message, event) => {
|
|
@@ -6893,7 +6950,7 @@ var PromptInput2 = React3__namespace.memo(
|
|
|
6893
6950
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: dialog });
|
|
6894
6951
|
}
|
|
6895
6952
|
const isStopping = loading && Boolean(onStop);
|
|
6896
|
-
const promptInputContent = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6953
|
+
const promptInputContent = isRowVariant ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6897
6954
|
PromptInput,
|
|
6898
6955
|
__spreadProps(__spreadValues({
|
|
6899
6956
|
onSubmit: handleSubmit,
|
|
@@ -6901,7 +6958,55 @@ var PromptInput2 = React3__namespace.memo(
|
|
|
6901
6958
|
multiple,
|
|
6902
6959
|
maxFiles,
|
|
6903
6960
|
maxFileSize,
|
|
6904
|
-
onError
|
|
6961
|
+
onError,
|
|
6962
|
+
className: cn(
|
|
6963
|
+
"[&>[data-slot=input-group]]:rounded-2xl",
|
|
6964
|
+
(className == null ? void 0 : className.includes("border")) && "[&>[data-slot=input-group]]:border-0 [&>[data-slot=input-group]]:bg-transparent [&>[data-slot=input-group]]:shadow-none",
|
|
6965
|
+
className
|
|
6966
|
+
)
|
|
6967
|
+
}, props), {
|
|
6968
|
+
children: [
|
|
6969
|
+
showAttachments && /* @__PURE__ */ jsxRuntime.jsx(AttachmentPreviews, {}),
|
|
6970
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6971
|
+
PromptInputTextarea,
|
|
6972
|
+
{
|
|
6973
|
+
placeholder,
|
|
6974
|
+
disabled,
|
|
6975
|
+
onChange: isControlled ? handleControlledChange : void 0,
|
|
6976
|
+
className: "min-h-9 py-2 px-3 text-sm resize-none border-0 shadow-none focus-visible:ring-0 bg-transparent flex-1 field-sizing-content"
|
|
6977
|
+
}
|
|
6978
|
+
),
|
|
6979
|
+
/* @__PURE__ */ jsxRuntime.jsx(InputGroupAddon2, { align: "inline-end", className: "self-end pb-1 pr-1.5 shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6980
|
+
PromptInputSubmit,
|
|
6981
|
+
{
|
|
6982
|
+
disabled: disabled || loading && !onStop,
|
|
6983
|
+
status: loading ? onStop ? "streaming" : "submitted" : void 0,
|
|
6984
|
+
onClick: isStopping ? (e) => {
|
|
6985
|
+
e.preventDefault();
|
|
6986
|
+
onStop == null ? void 0 : onStop();
|
|
6987
|
+
} : void 0,
|
|
6988
|
+
className: cn(
|
|
6989
|
+
"rounded-lg bg-blue-600 hover:bg-blue-700 text-white transition-colors",
|
|
6990
|
+
isStopping && "bg-transparent hover:bg-accent"
|
|
6991
|
+
),
|
|
6992
|
+
children: loading ? void 0 : /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "corner-down-left", size: "sm" })
|
|
6993
|
+
}
|
|
6994
|
+
) })
|
|
6995
|
+
]
|
|
6996
|
+
})
|
|
6997
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6998
|
+
PromptInput,
|
|
6999
|
+
__spreadProps(__spreadValues({
|
|
7000
|
+
onSubmit: handleSubmit,
|
|
7001
|
+
accept,
|
|
7002
|
+
multiple,
|
|
7003
|
+
maxFiles,
|
|
7004
|
+
maxFileSize,
|
|
7005
|
+
onError,
|
|
7006
|
+
className: cn(
|
|
7007
|
+
(className == null ? void 0 : className.includes("border")) && "[&>[data-slot=input-group]]:border-0 [&>[data-slot=input-group]]:bg-transparent [&>[data-slot=input-group]]:shadow-none",
|
|
7008
|
+
className
|
|
7009
|
+
)
|
|
6905
7010
|
}, props), {
|
|
6906
7011
|
children: [
|
|
6907
7012
|
/* @__PURE__ */ jsxRuntime.jsxs(PromptInputBody, { children: [
|
|
@@ -6917,8 +7022,8 @@ var PromptInput2 = React3__namespace.memo(
|
|
|
6917
7022
|
] }),
|
|
6918
7023
|
/* @__PURE__ */ jsxRuntime.jsxs(PromptInputFooter, { children: [
|
|
6919
7024
|
/* @__PURE__ */ jsxRuntime.jsxs(PromptInputTools, { children: [
|
|
6920
|
-
/* @__PURE__ */ jsxRuntime.jsx(AttachButton, { disabled: disabled || loading, icon: attachIcon }),
|
|
6921
|
-
|
|
7025
|
+
showAttachments && /* @__PURE__ */ jsxRuntime.jsx(AttachButton, { disabled: disabled || loading, icon: attachIcon }),
|
|
7026
|
+
showSpeech && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6922
7027
|
SpeechInput,
|
|
6923
7028
|
__spreadValues({
|
|
6924
7029
|
disabled: disabled || loading
|
|
@@ -8065,6 +8170,8 @@ var ChatPanel = React3__namespace.memo(
|
|
|
8065
8170
|
onTaskRetry,
|
|
8066
8171
|
onTaskStopAll,
|
|
8067
8172
|
onTaskClick,
|
|
8173
|
+
promptInputVariant = "default",
|
|
8174
|
+
enableAttachments,
|
|
8068
8175
|
enableSpeech = true,
|
|
8069
8176
|
showHeader = true,
|
|
8070
8177
|
sessionTitle,
|
|
@@ -8232,6 +8339,7 @@ var ChatPanel = React3__namespace.memo(
|
|
|
8232
8339
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8233
8340
|
PromptInput2,
|
|
8234
8341
|
{
|
|
8342
|
+
variant: promptInputVariant,
|
|
8235
8343
|
dialog,
|
|
8236
8344
|
placeholder,
|
|
8237
8345
|
value: promptValue,
|
|
@@ -8241,6 +8349,7 @@ var ChatPanel = React3__namespace.memo(
|
|
|
8241
8349
|
onStop,
|
|
8242
8350
|
context,
|
|
8243
8351
|
enableSpeech,
|
|
8352
|
+
enableAttachments,
|
|
8244
8353
|
className: cn(
|
|
8245
8354
|
"border border-neutral-600 bg-background shadow-sm overflow-hidden",
|
|
8246
8355
|
tasks.length > 0 && !dialog ? "rounded-t-none rounded-b-2xl border-t-0" : "rounded-2xl"
|
|
@@ -9432,54 +9541,6 @@ var HoverCardContent2 = React3__namespace.memo(
|
|
|
9432
9541
|
)
|
|
9433
9542
|
);
|
|
9434
9543
|
HoverCardContent2.displayName = "HoverCardContent";
|
|
9435
|
-
var InputGroup2 = React3__namespace.memo(
|
|
9436
|
-
React3__namespace.forwardRef(
|
|
9437
|
-
(props, ref) => {
|
|
9438
|
-
return /* @__PURE__ */ jsxRuntime.jsx(InputGroup, __spreadValues({ ref }, props));
|
|
9439
|
-
}
|
|
9440
|
-
)
|
|
9441
|
-
);
|
|
9442
|
-
InputGroup2.displayName = "InputGroup";
|
|
9443
|
-
var InputGroupAddon2 = React3__namespace.memo(
|
|
9444
|
-
React3__namespace.forwardRef(
|
|
9445
|
-
(props, ref) => {
|
|
9446
|
-
return /* @__PURE__ */ jsxRuntime.jsx(InputGroupAddon, __spreadValues({ ref }, props));
|
|
9447
|
-
}
|
|
9448
|
-
)
|
|
9449
|
-
);
|
|
9450
|
-
InputGroupAddon2.displayName = "InputGroupAddon";
|
|
9451
|
-
var InputGroupButton2 = React3__namespace.memo(
|
|
9452
|
-
React3__namespace.forwardRef(
|
|
9453
|
-
(props, ref) => {
|
|
9454
|
-
return /* @__PURE__ */ jsxRuntime.jsx(InputGroupButton, __spreadValues({ ref }, props));
|
|
9455
|
-
}
|
|
9456
|
-
)
|
|
9457
|
-
);
|
|
9458
|
-
InputGroupButton2.displayName = "InputGroupButton";
|
|
9459
|
-
var InputGroupInput2 = React3__namespace.memo(
|
|
9460
|
-
React3__namespace.forwardRef(
|
|
9461
|
-
(props, ref) => {
|
|
9462
|
-
return /* @__PURE__ */ jsxRuntime.jsx(InputGroupInput, __spreadValues({ ref }, props));
|
|
9463
|
-
}
|
|
9464
|
-
)
|
|
9465
|
-
);
|
|
9466
|
-
InputGroupInput2.displayName = "InputGroupInput";
|
|
9467
|
-
var InputGroupText2 = React3__namespace.memo(
|
|
9468
|
-
React3__namespace.forwardRef(
|
|
9469
|
-
(props, ref) => {
|
|
9470
|
-
return /* @__PURE__ */ jsxRuntime.jsx(InputGroupText, __spreadValues({ ref }, props));
|
|
9471
|
-
}
|
|
9472
|
-
)
|
|
9473
|
-
);
|
|
9474
|
-
InputGroupText2.displayName = "InputGroupText";
|
|
9475
|
-
var InputGroupTextarea2 = React3__namespace.memo(
|
|
9476
|
-
React3__namespace.forwardRef(
|
|
9477
|
-
(props, ref) => {
|
|
9478
|
-
return /* @__PURE__ */ jsxRuntime.jsx(InputGroupTextarea, __spreadValues({ ref }, props));
|
|
9479
|
-
}
|
|
9480
|
-
)
|
|
9481
|
-
);
|
|
9482
|
-
InputGroupTextarea2.displayName = "InputGroupTextarea";
|
|
9483
9544
|
var Progress2 = React3__namespace.memo(
|
|
9484
9545
|
React3__namespace.forwardRef(
|
|
9485
9546
|
(props, ref) => {
|
|
@@ -14596,7 +14657,9 @@ var ScenePlayer = React3__namespace.forwardRef(
|
|
|
14596
14657
|
onSubmit,
|
|
14597
14658
|
loading = false,
|
|
14598
14659
|
onStop,
|
|
14599
|
-
enableSpeech =
|
|
14660
|
+
enableSpeech = false,
|
|
14661
|
+
enableAttachments = false,
|
|
14662
|
+
promptInputVariant = "row",
|
|
14600
14663
|
onPublish,
|
|
14601
14664
|
publishPlaceholder = "Ask a question or provide instructions...",
|
|
14602
14665
|
onSceneChange,
|
|
@@ -14622,6 +14685,8 @@ var ScenePlayer = React3__namespace.forwardRef(
|
|
|
14622
14685
|
"loading",
|
|
14623
14686
|
"onStop",
|
|
14624
14687
|
"enableSpeech",
|
|
14688
|
+
"enableAttachments",
|
|
14689
|
+
"promptInputVariant",
|
|
14625
14690
|
"onPublish",
|
|
14626
14691
|
"publishPlaceholder",
|
|
14627
14692
|
"onSceneChange",
|
|
@@ -14936,6 +15001,7 @@ var ScenePlayer = React3__namespace.forwardRef(
|
|
|
14936
15001
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14937
15002
|
PromptInput2,
|
|
14938
15003
|
{
|
|
15004
|
+
variant: promptInputVariant,
|
|
14939
15005
|
placeholder: placeholder || publishPlaceholder,
|
|
14940
15006
|
value: promptValue,
|
|
14941
15007
|
onChange: onPromptValueChange,
|
|
@@ -14943,6 +15009,7 @@ var ScenePlayer = React3__namespace.forwardRef(
|
|
|
14943
15009
|
loading,
|
|
14944
15010
|
onStop,
|
|
14945
15011
|
enableSpeech,
|
|
15012
|
+
enableAttachments,
|
|
14946
15013
|
className: "border border-border bg-background shadow-md overflow-hidden rounded-2xl"
|
|
14947
15014
|
}
|
|
14948
15015
|
)
|