@mieweb/ui 0.8.0-dev.17 → 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/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-V3YV2FYF.js';
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';
@@ -12524,6 +12524,9 @@ var ChatComposer = React13.forwardRef(function ChatComposer2({
12524
12524
  autoFocus = false,
12525
12525
  maxLength,
12526
12526
  showCharacterCount = false,
12527
+ canSendWhenEmpty = false,
12528
+ maxHeight = MAX_INPUT_HEIGHT,
12529
+ textareaProps,
12527
12530
  addMenuItems,
12528
12531
  allowAttachments = true,
12529
12532
  acceptedFileTypes,
@@ -12569,7 +12572,7 @@ var ChatComposer = React13.forwardRef(function ChatComposer2({
12569
12572
  const hasText = value.trim().length > 0;
12570
12573
  const hasContent = hasText || attachments.length > 0;
12571
12574
  const isOverLimit = maxLength !== void 0 && value.length > maxLength;
12572
- const canSend = hasContent && onSend !== void 0 && !disabled && !isSending && !isStreaming && !isOverLimit;
12575
+ const canSend = (hasContent || canSendWhenEmpty) && onSend !== void 0 && !disabled && !isSending && !isStreaming && !isOverLimit;
12573
12576
  const setValue = React13.useCallback(
12574
12577
  (next) => {
12575
12578
  if (!isControlled) setInternalValue(next);
@@ -12577,12 +12580,21 @@ var ChatComposer = React13.forwardRef(function ChatComposer2({
12577
12580
  },
12578
12581
  [isControlled, onValueChange]
12579
12582
  );
12580
- React13.useLayoutEffect(() => {
12583
+ const resizeTextarea = React13.useCallback(() => {
12581
12584
  const textarea = textareaRef.current;
12582
12585
  if (!textarea) return;
12583
12586
  textarea.style.height = "auto";
12584
- textarea.style.height = `${Math.min(textarea.scrollHeight, MAX_INPUT_HEIGHT)}px`;
12585
- }, [value]);
12587
+ if (textarea.scrollHeight === 0) return;
12588
+ textarea.style.height = `${textarea.scrollHeight}px`;
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]);
12586
12598
  const addFiles = React13.useCallback(
12587
12599
  (files) => {
12588
12600
  if (!allowAttachments || files.length === 0) return;
@@ -12668,7 +12680,8 @@ var ChatComposer = React13.forwardRef(function ChatComposer2({
12668
12680
  ref,
12669
12681
  () => ({
12670
12682
  addFiles,
12671
- focus: () => textareaRef.current?.focus()
12683
+ focus: () => textareaRef.current?.focus(),
12684
+ getTextarea: () => textareaRef.current
12672
12685
  }),
12673
12686
  [addFiles]
12674
12687
  );
@@ -12722,274 +12735,311 @@ var ChatComposer = React13.forwardRef(function ChatComposer2({
12722
12735
  const micVisible = (showMic || onMicClick !== void 0 || micSlot !== void 0) && (micBehavior === "always" || !hasContent);
12723
12736
  const showSelectorRow = showAgentSelector || showModelSelector;
12724
12737
  const selectedAgentOption = agents.find((agent) => agent.id === selectedAgent) ?? null;
12725
- return /* @__PURE__ */ jsxs(
12726
- "div",
12727
- {
12728
- "data-slot": "chat-composer",
12729
- className: cn(
12730
- "rounded-xl border border-neutral-200 bg-white shadow-sm",
12731
- "dark:border-neutral-700 dark:bg-neutral-800",
12732
- disabled && "opacity-60",
12733
- className
12734
- ),
12735
- children: [
12736
- attachments.length > 0 && /* @__PURE__ */ jsx(
12737
- "div",
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,
12738
12752
  {
12739
- "data-slot": "chat-composer-attachments",
12740
- className: "flex flex-wrap gap-2 px-3 pt-3",
12741
- children: attachments.map((attachment) => /* @__PURE__ */ jsx(
12742
- AttachmentPreviewItem,
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,
12743
12824
  {
12744
- attachment: { ...attachment, state: "pending" },
12745
- onRemove: () => removeAttachment(attachment.id),
12746
- disabled
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 })
12747
12846
  },
12748
- attachment.id
12847
+ item.id
12749
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
+ ]
12750
12880
  }
12751
12881
  ),
12752
- /* @__PURE__ */ jsx("div", { className: "px-1 pt-1", children: /* @__PURE__ */ jsx(
12753
- "textarea",
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",
12754
12897
  {
12755
- ref: textareaRef,
12756
- "data-slot": "chat-composer-input",
12757
- value,
12758
- onChange: (event) => setValue(event.target.value),
12759
- onKeyDown: handleKeyDown,
12760
- onPaste: handlePaste,
12761
- placeholder,
12898
+ type: "button",
12899
+ "data-slot": "chat-composer-mic-button",
12900
+ "aria-label": micLabel,
12762
12901
  disabled,
12763
- autoFocus,
12764
- rows: 1,
12765
- "aria-label": inputLabel,
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,
12766
12915
  className: cn(
12767
- "block w-full resize-none bg-transparent",
12768
- "rounded-lg px-2 pt-2 pb-1 text-sm",
12769
- "text-neutral-900 placeholder:text-neutral-400 dark:text-white dark:placeholder:text-neutral-500",
12770
- // Ring the input itself on focus rather than the whole shell.
12771
- "focus:ring-primary-500 focus:ring-1 focus:outline-none",
12772
- "disabled:cursor-not-allowed"
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
+ }
12773
12925
  )
12774
12926
  }
12775
- ) }),
12776
- /* @__PURE__ */ jsxs(
12777
- "div",
12927
+ ) : /* @__PURE__ */ jsx(
12928
+ "button",
12778
12929
  {
12779
- "data-slot": "chat-composer-toolbar",
12780
- className: "flex items-center gap-1 px-2 pb-2",
12781
- children: [
12782
- showAddMenu && /* @__PURE__ */ jsxs(
12783
- Dropdown,
12784
- {
12785
- placement: "top-start",
12786
- open: addMenuOpen,
12787
- onOpenChange: setAddMenuOpen,
12788
- trigger: /* @__PURE__ */ jsx(
12789
- "button",
12790
- {
12791
- type: "button",
12792
- "data-slot": "chat-composer-add-button",
12793
- "aria-label": addMenuLabel,
12794
- disabled,
12795
- className: iconButtonClasses,
12796
- children: /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4", "aria-hidden": "true" })
12797
- }
12798
- ),
12799
- children: [
12800
- allowAttachments && /* @__PURE__ */ jsx(
12801
- DropdownItem,
12802
- {
12803
- icon: /* @__PURE__ */ jsx(Paperclip, { className: "h-4 w-4", "aria-hidden": "true" }),
12804
- onClick: () => {
12805
- setAddMenuOpen(false);
12806
- fileInputRef.current?.click();
12807
- },
12808
- children: attachFilesLabel
12809
- }
12810
- ),
12811
- allowAttachments && addMenuItems && addMenuItems.length > 0 && /* @__PURE__ */ jsx(DropdownSeparator, {}),
12812
- addMenuItems?.map((item) => /* @__PURE__ */ jsx(
12813
- DropdownItem,
12814
- {
12815
- icon: item.icon,
12816
- disabled: item.disabled,
12817
- variant: item.variant,
12818
- checked: item.checked,
12819
- onClick: () => {
12820
- setAddMenuOpen(false);
12821
- item.onSelect?.();
12822
- },
12823
- children: /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: item.label })
12824
- },
12825
- item.id
12826
- ))
12827
- ]
12828
- }
12829
- ),
12830
- allowAttachments && /* @__PURE__ */ jsx(
12831
- "input",
12832
- {
12833
- ref: fileInputRef,
12834
- type: "file",
12835
- multiple: true,
12836
- accept: acceptedFileTypes?.join(","),
12837
- onChange: handleFileInputChange,
12838
- className: "hidden",
12839
- "aria-hidden": "true",
12840
- tabIndex: -1
12841
- }
12842
- ),
12843
- /* @__PURE__ */ jsxs("div", { className: "ms-auto flex items-center gap-1", children: [
12844
- showCharacterCount && maxLength !== void 0 && /* @__PURE__ */ jsxs(
12845
- "span",
12846
- {
12847
- "data-slot": "chat-composer-char-count",
12848
- "aria-live": "polite",
12849
- className: cn(
12850
- "pe-1 text-xs tabular-nums",
12851
- isOverLimit ? "font-medium text-red-700 dark:text-red-400" : "text-neutral-500 dark:text-neutral-400"
12852
- ),
12853
- children: [
12854
- value.length,
12855
- "/",
12856
- maxLength
12857
- ]
12858
- }
12859
- ),
12860
- micVisible && (micSlot ?? /* @__PURE__ */ jsx(
12861
- "button",
12862
- {
12863
- type: "button",
12864
- "data-slot": "chat-composer-mic-button",
12865
- "aria-label": micLabel,
12866
- disabled,
12867
- onClick: onMicClick,
12868
- className: iconButtonClasses,
12869
- children: /* @__PURE__ */ jsx(Mic, { className: "h-4 w-4", "aria-hidden": "true" })
12870
- }
12871
- )),
12872
- isStreaming && onStop ? /* @__PURE__ */ jsx(
12873
- "button",
12874
- {
12875
- type: "button",
12876
- "data-slot": "chat-composer-stop-button",
12877
- "aria-label": stopLabel,
12878
- disabled,
12879
- onClick: onStop,
12880
- className: cn(
12881
- iconButtonClasses,
12882
- "text-neutral-700 dark:text-neutral-200"
12883
- ),
12884
- children: /* @__PURE__ */ jsx(
12885
- Square,
12886
- {
12887
- className: "h-3.5 w-3.5 fill-current",
12888
- "aria-hidden": "true"
12889
- }
12890
- )
12891
- }
12892
- ) : /* @__PURE__ */ jsx(
12893
- "button",
12894
- {
12895
- type: "button",
12896
- "data-slot": "chat-composer-send-button",
12897
- "aria-label": isSending ? sendingLabel : sendLabel,
12898
- "aria-busy": isSending || void 0,
12899
- disabled: !canSend,
12900
- onClick: handleSend,
12901
- className: cn(
12902
- iconButtonClasses,
12903
- 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"
12904
- ),
12905
- children: isSending ? /* @__PURE__ */ jsx(
12906
- Loader2,
12907
- {
12908
- className: "h-4 w-4 animate-spin",
12909
- "aria-hidden": "true"
12910
- }
12911
- ) : /* @__PURE__ */ jsx(ArrowUp, { className: "h-4 w-4", "aria-hidden": "true" })
12912
- }
12913
- )
12914
- ] })
12915
- ]
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" })
12916
12947
  }
12917
- ),
12918
- showSelectorRow && /* @__PURE__ */ jsxs(
12919
- "div",
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,
12920
12960
  {
12921
- "data-slot": "chat-composer-selectors",
12922
- className: "flex items-center justify-between gap-2 border-t border-neutral-100 px-2 py-1.5 dark:border-neutral-700",
12923
- children: [
12924
- showAgentSelector ? /* @__PURE__ */ jsx(
12925
- Dropdown,
12926
- {
12927
- placement: "top-start",
12928
- open: agentMenuOpen,
12929
- onOpenChange: setAgentMenuOpen,
12930
- trigger: /* @__PURE__ */ jsxs(
12931
- "button",
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,
12932
12996
  {
12933
- type: "button",
12934
- "data-slot": "chat-composer-agent-trigger",
12935
- "aria-label": selectedAgentOption ? `${agentSelectorLabel}: ${selectedAgentOption.label}` : agentSelectorLabel,
12936
- disabled,
12937
- className: selectorTriggerClasses,
12938
- children: [
12939
- selectedAgentOption?.icon ?? /* @__PURE__ */ jsx(Bot, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
12940
- /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: selectedAgentOption?.label ?? agentSelectorLabel }),
12941
- /* @__PURE__ */ jsx(
12942
- ChevronUp,
12943
- {
12944
- className: "h-3 w-3 shrink-0",
12945
- "aria-hidden": "true"
12946
- }
12947
- )
12948
- ]
12997
+ className: "text-primary-600 dark:text-primary-400 h-4 w-4 shrink-0",
12998
+ "aria-hidden": "true"
12949
12999
  }
12950
- ),
12951
- children: agents.map((agent) => /* @__PURE__ */ jsx(
12952
- DropdownItem,
12953
- {
12954
- icon: agent.icon,
12955
- role: "menuitemradio",
12956
- "aria-checked": agent.id === selectedAgent,
12957
- onClick: () => {
12958
- setAgentMenuOpen(false);
12959
- onAgentChange?.(agent.id);
12960
- },
12961
- children: /* @__PURE__ */ jsxs("span", { className: "flex w-full items-center justify-between gap-2", children: [
12962
- /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
12963
- /* @__PURE__ */ jsx("span", { className: "block truncate", children: agent.label }),
12964
- agent.description && /* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-neutral-500 dark:text-neutral-400", children: agent.description })
12965
- ] }),
12966
- agent.id === selectedAgent && /* @__PURE__ */ jsx(
12967
- Check,
12968
- {
12969
- className: "text-primary-600 dark:text-primary-400 h-4 w-4 shrink-0",
12970
- "aria-hidden": "true"
12971
- }
12972
- )
12973
- ] })
12974
- },
12975
- agent.id
12976
- ))
12977
- }
12978
- ) : /* @__PURE__ */ jsx("span", { "aria-hidden": "true" }),
12979
- showModelSelector && modelSelectorProps && /* @__PURE__ */ jsx(
12980
- ComposerModelSelector,
12981
- {
12982
- variant: "ghost",
12983
- ...modelSelectorProps,
12984
- disabled: disabled || modelSelectorProps.disabled
12985
- }
12986
- )
12987
- ]
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
12988
13013
  }
12989
13014
  )
12990
13015
  ]
12991
13016
  }
12992
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
+ );
12993
13043
  });
12994
13044
  ChatComposer.displayName = "ChatComposer";
12995
13045
  var MODE_META = {