@mieweb/ui 0.8.0-dev.18 → 0.8.0-dev.19
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/dist/{chunk-V3YV2FYF.js → chunk-PDS7OM73.js} +28 -3
- package/dist/chunk-PDS7OM73.js.map +1 -0
- package/dist/{chunk-YERA6RNG.cjs → chunk-VIE7UI2R.cjs} +28 -3
- package/dist/chunk-VIE7UI2R.cjs.map +1 -0
- package/dist/index.cjs +298 -269
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -5
- package/dist/index.d.ts +8 -5
- package/dist/index.js +296 -267
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-V3YV2FYF.js.map +0 -1
- package/dist/chunk-YERA6RNG.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -76,7 +76,7 @@ export { Checkbox, CheckboxGroup, checkboxVariants } from './chunk-753Z3NXL.js';
|
|
|
76
76
|
export { ClampedText } from './chunk-L6MDULYB.js';
|
|
77
77
|
export { CollabStatus, defaultCollabStatusLabels, useYjsCollabStatus } from './chunk-SVSHA7XV.js';
|
|
78
78
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger } from './chunk-BJKAVWED.js';
|
|
79
|
-
export { miewebUIPreset, miewebUISafelist } from './chunk-
|
|
79
|
+
export { miewebUIPreset, miewebUISafelist } from './chunk-PDS7OM73.js';
|
|
80
80
|
export { Accordion } from './chunk-KRU6IGV7.js';
|
|
81
81
|
import { Alert, AlertTitle, AlertDescription } from './chunk-3JWAABYI.js';
|
|
82
82
|
export { Alert, AlertDescription, AlertTitle, alertVariants } from './chunk-3JWAABYI.js';
|
|
@@ -12580,12 +12580,21 @@ var ChatComposer = React13.forwardRef(function ChatComposer2({
|
|
|
12580
12580
|
},
|
|
12581
12581
|
[isControlled, onValueChange]
|
|
12582
12582
|
);
|
|
12583
|
-
React13.
|
|
12583
|
+
const resizeTextarea = React13.useCallback(() => {
|
|
12584
12584
|
const textarea = textareaRef.current;
|
|
12585
12585
|
if (!textarea) return;
|
|
12586
12586
|
textarea.style.height = "auto";
|
|
12587
|
+
if (textarea.scrollHeight === 0) return;
|
|
12587
12588
|
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
12588
|
-
}, [
|
|
12589
|
+
}, []);
|
|
12590
|
+
React13.useLayoutEffect(resizeTextarea, [resizeTextarea, value]);
|
|
12591
|
+
React13.useEffect(() => {
|
|
12592
|
+
const textarea = textareaRef.current;
|
|
12593
|
+
if (!textarea || typeof ResizeObserver === "undefined") return;
|
|
12594
|
+
const observer = new ResizeObserver(resizeTextarea);
|
|
12595
|
+
observer.observe(textarea);
|
|
12596
|
+
return () => observer.disconnect();
|
|
12597
|
+
}, [resizeTextarea]);
|
|
12589
12598
|
const addFiles = React13.useCallback(
|
|
12590
12599
|
(files) => {
|
|
12591
12600
|
if (!allowAttachments || files.length === 0) return;
|
|
@@ -12726,291 +12735,311 @@ var ChatComposer = React13.forwardRef(function ChatComposer2({
|
|
|
12726
12735
|
const micVisible = (showMic || onMicClick !== void 0 || micSlot !== void 0) && (micBehavior === "always" || !hasContent);
|
|
12727
12736
|
const showSelectorRow = showAgentSelector || showModelSelector;
|
|
12728
12737
|
const selectedAgentOption = agents.find((agent) => agent.id === selectedAgent) ?? null;
|
|
12729
|
-
|
|
12730
|
-
"
|
|
12731
|
-
|
|
12732
|
-
|
|
12733
|
-
|
|
12734
|
-
|
|
12735
|
-
|
|
12736
|
-
|
|
12737
|
-
|
|
12738
|
-
|
|
12739
|
-
|
|
12740
|
-
|
|
12741
|
-
|
|
12738
|
+
const cells = {
|
|
12739
|
+
input: "col-span-3 col-start-1 row-start-1 px-1 pt-1 md:col-span-1 md:col-start-2 md:self-end md:px-0 md:py-1.5",
|
|
12740
|
+
textarea: "px-2 pt-2 pb-1 md:py-1.5",
|
|
12741
|
+
add: "col-start-1 row-start-2 pb-2 ps-2 md:row-start-1 md:self-end md:p-1.5 md:pe-0.5",
|
|
12742
|
+
actions: "col-start-3 row-start-2 flex items-center gap-1 pb-2 pe-2 md:row-start-1 md:self-end md:gap-0.5 md:p-1.5 md:ps-0.5"
|
|
12743
|
+
};
|
|
12744
|
+
const composerCard = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12745
|
+
attachments.length > 0 && /* @__PURE__ */ jsx(
|
|
12746
|
+
"div",
|
|
12747
|
+
{
|
|
12748
|
+
"data-slot": "chat-composer-attachments",
|
|
12749
|
+
className: "flex flex-wrap gap-2 px-3 pt-3",
|
|
12750
|
+
children: attachments.map((attachment) => /* @__PURE__ */ jsx(
|
|
12751
|
+
AttachmentPreviewItem,
|
|
12742
12752
|
{
|
|
12743
|
-
|
|
12744
|
-
|
|
12745
|
-
|
|
12746
|
-
|
|
12753
|
+
attachment: { ...attachment, state: "pending" },
|
|
12754
|
+
onRemove: () => removeAttachment(attachment.id),
|
|
12755
|
+
disabled
|
|
12756
|
+
},
|
|
12757
|
+
attachment.id
|
|
12758
|
+
))
|
|
12759
|
+
}
|
|
12760
|
+
),
|
|
12761
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[auto_minmax(0,1fr)_auto]", children: [
|
|
12762
|
+
/* @__PURE__ */ jsx("div", { className: cells.input, children: /* @__PURE__ */ jsx(
|
|
12763
|
+
"textarea",
|
|
12764
|
+
{
|
|
12765
|
+
...textareaProps,
|
|
12766
|
+
ref: textareaRef,
|
|
12767
|
+
"data-slot": "chat-composer-input",
|
|
12768
|
+
value,
|
|
12769
|
+
onChange: (event) => {
|
|
12770
|
+
textareaProps?.onChange?.(event);
|
|
12771
|
+
setValue(event.target.value);
|
|
12772
|
+
},
|
|
12773
|
+
onKeyDown: (event) => {
|
|
12774
|
+
textareaProps?.onKeyDown?.(event);
|
|
12775
|
+
if (event.defaultPrevented) return;
|
|
12776
|
+
handleKeyDown(event);
|
|
12777
|
+
},
|
|
12778
|
+
onPaste: (event) => {
|
|
12779
|
+
textareaProps?.onPaste?.(event);
|
|
12780
|
+
if (event.defaultPrevented) return;
|
|
12781
|
+
handlePaste(event);
|
|
12782
|
+
},
|
|
12783
|
+
placeholder,
|
|
12784
|
+
disabled,
|
|
12785
|
+
autoFocus,
|
|
12786
|
+
rows: 1,
|
|
12787
|
+
"aria-label": inputLabel,
|
|
12788
|
+
style: {
|
|
12789
|
+
...textareaProps?.style,
|
|
12790
|
+
maxHeight: typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight
|
|
12791
|
+
},
|
|
12792
|
+
className: cn(
|
|
12793
|
+
"block w-full resize-none bg-transparent",
|
|
12794
|
+
"rounded-lg text-sm",
|
|
12795
|
+
cells.textarea,
|
|
12796
|
+
"text-neutral-900 placeholder:text-neutral-400 dark:text-white dark:placeholder:text-neutral-500",
|
|
12797
|
+
// Ring the input itself on focus rather than the whole shell.
|
|
12798
|
+
"focus:ring-primary-500 focus:ring-1 focus:outline-none",
|
|
12799
|
+
"disabled:cursor-not-allowed",
|
|
12800
|
+
textareaProps?.className
|
|
12801
|
+
)
|
|
12802
|
+
}
|
|
12803
|
+
) }),
|
|
12804
|
+
showAddMenu && /* @__PURE__ */ jsx("div", { className: cells.add, children: /* @__PURE__ */ jsxs(
|
|
12805
|
+
Dropdown,
|
|
12806
|
+
{
|
|
12807
|
+
placement: "top-start",
|
|
12808
|
+
open: addMenuOpen,
|
|
12809
|
+
onOpenChange: setAddMenuOpen,
|
|
12810
|
+
trigger: /* @__PURE__ */ jsx(
|
|
12811
|
+
"button",
|
|
12812
|
+
{
|
|
12813
|
+
type: "button",
|
|
12814
|
+
"data-slot": "chat-composer-add-button",
|
|
12815
|
+
"aria-label": addMenuLabel,
|
|
12816
|
+
disabled,
|
|
12817
|
+
className: iconButtonClasses,
|
|
12818
|
+
children: /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12819
|
+
}
|
|
12820
|
+
),
|
|
12821
|
+
children: [
|
|
12822
|
+
allowAttachments && /* @__PURE__ */ jsx(
|
|
12823
|
+
DropdownItem,
|
|
12747
12824
|
{
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
12825
|
+
icon: /* @__PURE__ */ jsx(Paperclip, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
12826
|
+
onClick: () => {
|
|
12827
|
+
setAddMenuOpen(false);
|
|
12828
|
+
fileInputRef.current?.click();
|
|
12829
|
+
},
|
|
12830
|
+
children: attachFilesLabel
|
|
12831
|
+
}
|
|
12832
|
+
),
|
|
12833
|
+
allowAttachments && addMenuItems && addMenuItems.length > 0 && /* @__PURE__ */ jsx(DropdownSeparator, {}),
|
|
12834
|
+
addMenuItems?.map((item) => /* @__PURE__ */ jsx(
|
|
12835
|
+
DropdownItem,
|
|
12836
|
+
{
|
|
12837
|
+
icon: item.icon,
|
|
12838
|
+
disabled: item.disabled,
|
|
12839
|
+
variant: item.variant,
|
|
12840
|
+
checked: item.checked,
|
|
12841
|
+
onClick: () => {
|
|
12842
|
+
setAddMenuOpen(false);
|
|
12843
|
+
item.onSelect?.();
|
|
12844
|
+
},
|
|
12845
|
+
children: /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: item.label })
|
|
12751
12846
|
},
|
|
12752
|
-
|
|
12847
|
+
item.id
|
|
12753
12848
|
))
|
|
12849
|
+
]
|
|
12850
|
+
}
|
|
12851
|
+
) }),
|
|
12852
|
+
allowAttachments && /* @__PURE__ */ jsx(
|
|
12853
|
+
"input",
|
|
12854
|
+
{
|
|
12855
|
+
ref: fileInputRef,
|
|
12856
|
+
type: "file",
|
|
12857
|
+
multiple: true,
|
|
12858
|
+
accept: acceptedFileTypes?.join(","),
|
|
12859
|
+
onChange: handleFileInputChange,
|
|
12860
|
+
className: "hidden",
|
|
12861
|
+
"aria-hidden": "true",
|
|
12862
|
+
tabIndex: -1
|
|
12863
|
+
}
|
|
12864
|
+
),
|
|
12865
|
+
/* @__PURE__ */ jsxs("div", { className: cells.actions, children: [
|
|
12866
|
+
showCharacterCount && maxLength !== void 0 && /* @__PURE__ */ jsxs(
|
|
12867
|
+
"span",
|
|
12868
|
+
{
|
|
12869
|
+
"data-slot": "chat-composer-char-count",
|
|
12870
|
+
"aria-live": "polite",
|
|
12871
|
+
className: cn(
|
|
12872
|
+
"pe-1 text-xs tabular-nums",
|
|
12873
|
+
isOverLimit ? "font-medium text-red-700 dark:text-red-400" : "text-neutral-500 dark:text-neutral-400"
|
|
12874
|
+
),
|
|
12875
|
+
children: [
|
|
12876
|
+
value.length,
|
|
12877
|
+
"/",
|
|
12878
|
+
maxLength
|
|
12879
|
+
]
|
|
12754
12880
|
}
|
|
12755
12881
|
),
|
|
12756
|
-
|
|
12757
|
-
|
|
12882
|
+
micVisible && (micSlot != null ? (
|
|
12883
|
+
// Normalize slot content (e.g. a RecordButton) to the 32px
|
|
12884
|
+
// control row: taller content overflow-centers instead of
|
|
12885
|
+
// inflating the pill and pushing the other cells apart. A div
|
|
12886
|
+
// so block-level slot content stays valid HTML.
|
|
12887
|
+
/* @__PURE__ */ jsx(
|
|
12888
|
+
"div",
|
|
12889
|
+
{
|
|
12890
|
+
"data-slot": "chat-composer-mic-slot",
|
|
12891
|
+
className: "flex h-8 shrink-0 items-center",
|
|
12892
|
+
children: micSlot
|
|
12893
|
+
}
|
|
12894
|
+
)
|
|
12895
|
+
) : /* @__PURE__ */ jsx(
|
|
12896
|
+
"button",
|
|
12758
12897
|
{
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
"
|
|
12762
|
-
value,
|
|
12763
|
-
onChange: (event) => {
|
|
12764
|
-
textareaProps?.onChange?.(event);
|
|
12765
|
-
setValue(event.target.value);
|
|
12766
|
-
},
|
|
12767
|
-
onKeyDown: (event) => {
|
|
12768
|
-
textareaProps?.onKeyDown?.(event);
|
|
12769
|
-
if (event.defaultPrevented) return;
|
|
12770
|
-
handleKeyDown(event);
|
|
12771
|
-
},
|
|
12772
|
-
onPaste: (event) => {
|
|
12773
|
-
textareaProps?.onPaste?.(event);
|
|
12774
|
-
if (event.defaultPrevented) return;
|
|
12775
|
-
handlePaste(event);
|
|
12776
|
-
},
|
|
12777
|
-
placeholder,
|
|
12898
|
+
type: "button",
|
|
12899
|
+
"data-slot": "chat-composer-mic-button",
|
|
12900
|
+
"aria-label": micLabel,
|
|
12778
12901
|
disabled,
|
|
12779
|
-
|
|
12780
|
-
|
|
12781
|
-
"aria-
|
|
12782
|
-
|
|
12783
|
-
|
|
12784
|
-
|
|
12785
|
-
|
|
12902
|
+
onClick: onMicClick,
|
|
12903
|
+
className: iconButtonClasses,
|
|
12904
|
+
children: /* @__PURE__ */ jsx(Mic, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12905
|
+
}
|
|
12906
|
+
)),
|
|
12907
|
+
isStreaming && onStop ? /* @__PURE__ */ jsx(
|
|
12908
|
+
"button",
|
|
12909
|
+
{
|
|
12910
|
+
type: "button",
|
|
12911
|
+
"data-slot": "chat-composer-stop-button",
|
|
12912
|
+
"aria-label": stopLabel,
|
|
12913
|
+
disabled,
|
|
12914
|
+
onClick: onStop,
|
|
12786
12915
|
className: cn(
|
|
12787
|
-
|
|
12788
|
-
"
|
|
12789
|
-
|
|
12790
|
-
|
|
12791
|
-
|
|
12792
|
-
|
|
12793
|
-
|
|
12916
|
+
iconButtonClasses,
|
|
12917
|
+
"text-neutral-700 dark:text-neutral-200"
|
|
12918
|
+
),
|
|
12919
|
+
children: /* @__PURE__ */ jsx(
|
|
12920
|
+
Square,
|
|
12921
|
+
{
|
|
12922
|
+
className: "h-3.5 w-3.5 fill-current",
|
|
12923
|
+
"aria-hidden": "true"
|
|
12924
|
+
}
|
|
12794
12925
|
)
|
|
12795
12926
|
}
|
|
12796
|
-
)
|
|
12797
|
-
|
|
12798
|
-
"div",
|
|
12927
|
+
) : /* @__PURE__ */ jsx(
|
|
12928
|
+
"button",
|
|
12799
12929
|
{
|
|
12800
|
-
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
|
|
12806
|
-
|
|
12807
|
-
|
|
12808
|
-
|
|
12809
|
-
|
|
12810
|
-
|
|
12811
|
-
|
|
12812
|
-
|
|
12813
|
-
|
|
12814
|
-
|
|
12815
|
-
|
|
12816
|
-
|
|
12817
|
-
children: /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12818
|
-
}
|
|
12819
|
-
),
|
|
12820
|
-
children: [
|
|
12821
|
-
allowAttachments && /* @__PURE__ */ jsx(
|
|
12822
|
-
DropdownItem,
|
|
12823
|
-
{
|
|
12824
|
-
icon: /* @__PURE__ */ jsx(Paperclip, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
12825
|
-
onClick: () => {
|
|
12826
|
-
setAddMenuOpen(false);
|
|
12827
|
-
fileInputRef.current?.click();
|
|
12828
|
-
},
|
|
12829
|
-
children: attachFilesLabel
|
|
12830
|
-
}
|
|
12831
|
-
),
|
|
12832
|
-
allowAttachments && addMenuItems && addMenuItems.length > 0 && /* @__PURE__ */ jsx(DropdownSeparator, {}),
|
|
12833
|
-
addMenuItems?.map((item) => /* @__PURE__ */ jsx(
|
|
12834
|
-
DropdownItem,
|
|
12835
|
-
{
|
|
12836
|
-
icon: item.icon,
|
|
12837
|
-
disabled: item.disabled,
|
|
12838
|
-
variant: item.variant,
|
|
12839
|
-
checked: item.checked,
|
|
12840
|
-
onClick: () => {
|
|
12841
|
-
setAddMenuOpen(false);
|
|
12842
|
-
item.onSelect?.();
|
|
12843
|
-
},
|
|
12844
|
-
children: /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: item.label })
|
|
12845
|
-
},
|
|
12846
|
-
item.id
|
|
12847
|
-
))
|
|
12848
|
-
]
|
|
12849
|
-
}
|
|
12850
|
-
),
|
|
12851
|
-
allowAttachments && /* @__PURE__ */ jsx(
|
|
12852
|
-
"input",
|
|
12853
|
-
{
|
|
12854
|
-
ref: fileInputRef,
|
|
12855
|
-
type: "file",
|
|
12856
|
-
multiple: true,
|
|
12857
|
-
accept: acceptedFileTypes?.join(","),
|
|
12858
|
-
onChange: handleFileInputChange,
|
|
12859
|
-
className: "hidden",
|
|
12860
|
-
"aria-hidden": "true",
|
|
12861
|
-
tabIndex: -1
|
|
12862
|
-
}
|
|
12863
|
-
),
|
|
12864
|
-
/* @__PURE__ */ jsxs("div", { className: "ms-auto flex items-center gap-1", children: [
|
|
12865
|
-
showCharacterCount && maxLength !== void 0 && /* @__PURE__ */ jsxs(
|
|
12866
|
-
"span",
|
|
12867
|
-
{
|
|
12868
|
-
"data-slot": "chat-composer-char-count",
|
|
12869
|
-
"aria-live": "polite",
|
|
12870
|
-
className: cn(
|
|
12871
|
-
"pe-1 text-xs tabular-nums",
|
|
12872
|
-
isOverLimit ? "font-medium text-red-700 dark:text-red-400" : "text-neutral-500 dark:text-neutral-400"
|
|
12873
|
-
),
|
|
12874
|
-
children: [
|
|
12875
|
-
value.length,
|
|
12876
|
-
"/",
|
|
12877
|
-
maxLength
|
|
12878
|
-
]
|
|
12879
|
-
}
|
|
12880
|
-
),
|
|
12881
|
-
micVisible && (micSlot ?? /* @__PURE__ */ jsx(
|
|
12882
|
-
"button",
|
|
12883
|
-
{
|
|
12884
|
-
type: "button",
|
|
12885
|
-
"data-slot": "chat-composer-mic-button",
|
|
12886
|
-
"aria-label": micLabel,
|
|
12887
|
-
disabled,
|
|
12888
|
-
onClick: onMicClick,
|
|
12889
|
-
className: iconButtonClasses,
|
|
12890
|
-
children: /* @__PURE__ */ jsx(Mic, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12891
|
-
}
|
|
12892
|
-
)),
|
|
12893
|
-
isStreaming && onStop ? /* @__PURE__ */ jsx(
|
|
12894
|
-
"button",
|
|
12895
|
-
{
|
|
12896
|
-
type: "button",
|
|
12897
|
-
"data-slot": "chat-composer-stop-button",
|
|
12898
|
-
"aria-label": stopLabel,
|
|
12899
|
-
disabled,
|
|
12900
|
-
onClick: onStop,
|
|
12901
|
-
className: cn(
|
|
12902
|
-
iconButtonClasses,
|
|
12903
|
-
"text-neutral-700 dark:text-neutral-200"
|
|
12904
|
-
),
|
|
12905
|
-
children: /* @__PURE__ */ jsx(
|
|
12906
|
-
Square,
|
|
12907
|
-
{
|
|
12908
|
-
className: "h-3.5 w-3.5 fill-current",
|
|
12909
|
-
"aria-hidden": "true"
|
|
12910
|
-
}
|
|
12911
|
-
)
|
|
12912
|
-
}
|
|
12913
|
-
) : /* @__PURE__ */ jsx(
|
|
12914
|
-
"button",
|
|
12915
|
-
{
|
|
12916
|
-
type: "button",
|
|
12917
|
-
"data-slot": "chat-composer-send-button",
|
|
12918
|
-
"aria-label": isSending ? sendingLabel : sendLabel,
|
|
12919
|
-
"aria-busy": isSending || void 0,
|
|
12920
|
-
disabled: !canSend,
|
|
12921
|
-
onClick: handleSend,
|
|
12922
|
-
className: cn(
|
|
12923
|
-
iconButtonClasses,
|
|
12924
|
-
canSend && "bg-primary-800 hover:bg-primary-700 dark:bg-primary-600 dark:hover:bg-primary-500 text-white hover:text-white dark:hover:text-white"
|
|
12925
|
-
),
|
|
12926
|
-
children: isSending ? /* @__PURE__ */ jsx(
|
|
12927
|
-
Loader2,
|
|
12928
|
-
{
|
|
12929
|
-
className: "h-4 w-4 animate-spin",
|
|
12930
|
-
"aria-hidden": "true"
|
|
12931
|
-
}
|
|
12932
|
-
) : /* @__PURE__ */ jsx(ArrowUp, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12933
|
-
}
|
|
12934
|
-
)
|
|
12935
|
-
] })
|
|
12936
|
-
]
|
|
12930
|
+
type: "button",
|
|
12931
|
+
"data-slot": "chat-composer-send-button",
|
|
12932
|
+
"aria-label": isSending ? sendingLabel : sendLabel,
|
|
12933
|
+
"aria-busy": isSending || void 0,
|
|
12934
|
+
disabled: !canSend,
|
|
12935
|
+
onClick: handleSend,
|
|
12936
|
+
className: cn(
|
|
12937
|
+
iconButtonClasses,
|
|
12938
|
+
canSend && "bg-primary-800 hover:bg-primary-700 dark:bg-primary-600 dark:hover:bg-primary-500 text-white hover:text-white dark:hover:text-white"
|
|
12939
|
+
),
|
|
12940
|
+
children: isSending ? /* @__PURE__ */ jsx(
|
|
12941
|
+
Loader2,
|
|
12942
|
+
{
|
|
12943
|
+
className: "h-4 w-4 animate-spin",
|
|
12944
|
+
"aria-hidden": "true"
|
|
12945
|
+
}
|
|
12946
|
+
) : /* @__PURE__ */ jsx(ArrowUp, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12937
12947
|
}
|
|
12938
|
-
)
|
|
12939
|
-
|
|
12940
|
-
|
|
12948
|
+
)
|
|
12949
|
+
] })
|
|
12950
|
+
] })
|
|
12951
|
+
] });
|
|
12952
|
+
const selectorsRow = showSelectorRow && /* @__PURE__ */ jsxs(
|
|
12953
|
+
"div",
|
|
12954
|
+
{
|
|
12955
|
+
"data-slot": "chat-composer-selectors",
|
|
12956
|
+
className: "flex items-center justify-between gap-2 px-2 pt-1",
|
|
12957
|
+
children: [
|
|
12958
|
+
showAgentSelector ? /* @__PURE__ */ jsx(
|
|
12959
|
+
Dropdown,
|
|
12941
12960
|
{
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
|
|
12949
|
-
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12961
|
+
placement: "top-start",
|
|
12962
|
+
open: agentMenuOpen,
|
|
12963
|
+
onOpenChange: setAgentMenuOpen,
|
|
12964
|
+
trigger: /* @__PURE__ */ jsxs(
|
|
12965
|
+
"button",
|
|
12966
|
+
{
|
|
12967
|
+
type: "button",
|
|
12968
|
+
"data-slot": "chat-composer-agent-trigger",
|
|
12969
|
+
"aria-label": selectedAgentOption ? `${agentSelectorLabel}: ${selectedAgentOption.label}` : agentSelectorLabel,
|
|
12970
|
+
disabled,
|
|
12971
|
+
className: selectorTriggerClasses,
|
|
12972
|
+
children: [
|
|
12973
|
+
selectedAgentOption?.icon ?? /* @__PURE__ */ jsx(Bot, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
12974
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: selectedAgentOption?.label ?? agentSelectorLabel }),
|
|
12975
|
+
/* @__PURE__ */ jsx(ChevronUp, { className: "h-3 w-3 shrink-0", "aria-hidden": "true" })
|
|
12976
|
+
]
|
|
12977
|
+
}
|
|
12978
|
+
),
|
|
12979
|
+
children: agents.map((agent) => /* @__PURE__ */ jsx(
|
|
12980
|
+
DropdownItem,
|
|
12981
|
+
{
|
|
12982
|
+
icon: agent.icon,
|
|
12983
|
+
role: "menuitemradio",
|
|
12984
|
+
"aria-checked": agent.id === selectedAgent,
|
|
12985
|
+
onClick: () => {
|
|
12986
|
+
setAgentMenuOpen(false);
|
|
12987
|
+
onAgentChange?.(agent.id);
|
|
12988
|
+
},
|
|
12989
|
+
children: /* @__PURE__ */ jsxs("span", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
12990
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
|
|
12991
|
+
/* @__PURE__ */ jsx("span", { className: "block truncate", children: agent.label }),
|
|
12992
|
+
agent.description && /* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-neutral-500 dark:text-neutral-400", children: agent.description })
|
|
12993
|
+
] }),
|
|
12994
|
+
agent.id === selectedAgent && /* @__PURE__ */ jsx(
|
|
12995
|
+
Check,
|
|
12953
12996
|
{
|
|
12954
|
-
|
|
12955
|
-
"
|
|
12956
|
-
"aria-label": selectedAgentOption ? `${agentSelectorLabel}: ${selectedAgentOption.label}` : agentSelectorLabel,
|
|
12957
|
-
disabled,
|
|
12958
|
-
className: selectorTriggerClasses,
|
|
12959
|
-
children: [
|
|
12960
|
-
selectedAgentOption?.icon ?? /* @__PURE__ */ jsx(Bot, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
12961
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: selectedAgentOption?.label ?? agentSelectorLabel }),
|
|
12962
|
-
/* @__PURE__ */ jsx(
|
|
12963
|
-
ChevronUp,
|
|
12964
|
-
{
|
|
12965
|
-
className: "h-3 w-3 shrink-0",
|
|
12966
|
-
"aria-hidden": "true"
|
|
12967
|
-
}
|
|
12968
|
-
)
|
|
12969
|
-
]
|
|
12997
|
+
className: "text-primary-600 dark:text-primary-400 h-4 w-4 shrink-0",
|
|
12998
|
+
"aria-hidden": "true"
|
|
12970
12999
|
}
|
|
12971
|
-
)
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
12975
|
-
|
|
12976
|
-
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
|
|
12980
|
-
|
|
12981
|
-
|
|
12982
|
-
|
|
12983
|
-
|
|
12984
|
-
/* @__PURE__ */ jsx("span", { className: "block truncate", children: agent.label }),
|
|
12985
|
-
agent.description && /* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-neutral-500 dark:text-neutral-400", children: agent.description })
|
|
12986
|
-
] }),
|
|
12987
|
-
agent.id === selectedAgent && /* @__PURE__ */ jsx(
|
|
12988
|
-
Check,
|
|
12989
|
-
{
|
|
12990
|
-
className: "text-primary-600 dark:text-primary-400 h-4 w-4 shrink-0",
|
|
12991
|
-
"aria-hidden": "true"
|
|
12992
|
-
}
|
|
12993
|
-
)
|
|
12994
|
-
] })
|
|
12995
|
-
},
|
|
12996
|
-
agent.id
|
|
12997
|
-
))
|
|
12998
|
-
}
|
|
12999
|
-
) : /* @__PURE__ */ jsx("span", { "aria-hidden": "true" }),
|
|
13000
|
-
showModelSelector && modelSelectorProps && /* @__PURE__ */ jsx(
|
|
13001
|
-
ComposerModelSelector,
|
|
13002
|
-
{
|
|
13003
|
-
variant: "ghost",
|
|
13004
|
-
...modelSelectorProps,
|
|
13005
|
-
disabled: disabled || modelSelectorProps.disabled
|
|
13006
|
-
}
|
|
13007
|
-
)
|
|
13008
|
-
]
|
|
13000
|
+
)
|
|
13001
|
+
] })
|
|
13002
|
+
},
|
|
13003
|
+
agent.id
|
|
13004
|
+
))
|
|
13005
|
+
}
|
|
13006
|
+
) : /* @__PURE__ */ jsx("span", { "aria-hidden": "true" }),
|
|
13007
|
+
showModelSelector && modelSelectorProps && /* @__PURE__ */ jsx(
|
|
13008
|
+
ComposerModelSelector,
|
|
13009
|
+
{
|
|
13010
|
+
variant: "ghost",
|
|
13011
|
+
...modelSelectorProps,
|
|
13012
|
+
disabled: disabled || modelSelectorProps.disabled
|
|
13009
13013
|
}
|
|
13010
13014
|
)
|
|
13011
13015
|
]
|
|
13012
13016
|
}
|
|
13013
13017
|
);
|
|
13018
|
+
return /* @__PURE__ */ jsxs(
|
|
13019
|
+
"div",
|
|
13020
|
+
{
|
|
13021
|
+
"data-slot": "chat-composer",
|
|
13022
|
+
className: cn(
|
|
13023
|
+
"flex w-full flex-col",
|
|
13024
|
+
disabled && "opacity-60",
|
|
13025
|
+
className
|
|
13026
|
+
),
|
|
13027
|
+
children: [
|
|
13028
|
+
/* @__PURE__ */ jsx(
|
|
13029
|
+
"div",
|
|
13030
|
+
{
|
|
13031
|
+
"data-slot": "chat-composer-card",
|
|
13032
|
+
className: cn(
|
|
13033
|
+
"rounded-2xl border border-neutral-200 bg-white shadow-sm",
|
|
13034
|
+
"dark:border-[#2e2e30] dark:bg-[#1c1c1e]"
|
|
13035
|
+
),
|
|
13036
|
+
children: composerCard
|
|
13037
|
+
}
|
|
13038
|
+
),
|
|
13039
|
+
selectorsRow
|
|
13040
|
+
]
|
|
13041
|
+
}
|
|
13042
|
+
);
|
|
13014
13043
|
});
|
|
13015
13044
|
ChatComposer.displayName = "ChatComposer";
|
|
13016
13045
|
var MODE_META = {
|