@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/index.cjs CHANGED
@@ -64,7 +64,7 @@ var chunk7AECNMYV_cjs = require('./chunk-7AECNMYV.cjs');
64
64
  var chunkN5O47VGS_cjs = require('./chunk-N5O47VGS.cjs');
65
65
  var chunkX4LBUPJO_cjs = require('./chunk-X4LBUPJO.cjs');
66
66
  var chunkIUDY6S7I_cjs = require('./chunk-IUDY6S7I.cjs');
67
- var chunkYERA6RNG_cjs = require('./chunk-YERA6RNG.cjs');
67
+ var chunkVIE7UI2R_cjs = require('./chunk-VIE7UI2R.cjs');
68
68
  var chunkVROIMIHB_cjs = require('./chunk-VROIMIHB.cjs');
69
69
  var chunkNYJIXR4Y_cjs = require('./chunk-NYJIXR4Y.cjs');
70
70
  var chunk64SSWBJN_cjs = require('./chunk-64SSWBJN.cjs');
@@ -12560,12 +12560,21 @@ var ChatComposer = React13__namespace.forwardRef(function ChatComposer2({
12560
12560
  },
12561
12561
  [isControlled, onValueChange]
12562
12562
  );
12563
- React13__namespace.useLayoutEffect(() => {
12563
+ const resizeTextarea = React13__namespace.useCallback(() => {
12564
12564
  const textarea = textareaRef.current;
12565
12565
  if (!textarea) return;
12566
12566
  textarea.style.height = "auto";
12567
+ if (textarea.scrollHeight === 0) return;
12567
12568
  textarea.style.height = `${textarea.scrollHeight}px`;
12568
- }, [value]);
12569
+ }, []);
12570
+ React13__namespace.useLayoutEffect(resizeTextarea, [resizeTextarea, value]);
12571
+ React13__namespace.useEffect(() => {
12572
+ const textarea = textareaRef.current;
12573
+ if (!textarea || typeof ResizeObserver === "undefined") return;
12574
+ const observer = new ResizeObserver(resizeTextarea);
12575
+ observer.observe(textarea);
12576
+ return () => observer.disconnect();
12577
+ }, [resizeTextarea]);
12569
12578
  const addFiles = React13__namespace.useCallback(
12570
12579
  (files) => {
12571
12580
  if (!allowAttachments || files.length === 0) return;
@@ -12706,291 +12715,311 @@ var ChatComposer = React13__namespace.forwardRef(function ChatComposer2({
12706
12715
  const micVisible = (showMic || onMicClick !== void 0 || micSlot !== void 0) && (micBehavior === "always" || !hasContent);
12707
12716
  const showSelectorRow = showAgentSelector || showModelSelector;
12708
12717
  const selectedAgentOption = agents.find((agent) => agent.id === selectedAgent) ?? null;
12709
- return /* @__PURE__ */ jsxRuntime.jsxs(
12710
- "div",
12711
- {
12712
- "data-slot": "chat-composer",
12713
- className: chunkS5RVSXDV_cjs.cn(
12714
- "rounded-xl border border-neutral-200 bg-white shadow-sm",
12715
- "dark:border-neutral-700 dark:bg-neutral-800",
12716
- disabled && "opacity-60",
12717
- className
12718
- ),
12719
- children: [
12720
- attachments.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
12721
- "div",
12718
+ const cells = {
12719
+ 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",
12720
+ textarea: "px-2 pt-2 pb-1 md:py-1.5",
12721
+ 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",
12722
+ 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"
12723
+ };
12724
+ const composerCard = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12725
+ attachments.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
12726
+ "div",
12727
+ {
12728
+ "data-slot": "chat-composer-attachments",
12729
+ className: "flex flex-wrap gap-2 px-3 pt-3",
12730
+ children: attachments.map((attachment) => /* @__PURE__ */ jsxRuntime.jsx(
12731
+ chunkJWB4UA4J_cjs.AttachmentPreviewItem,
12722
12732
  {
12723
- "data-slot": "chat-composer-attachments",
12724
- className: "flex flex-wrap gap-2 px-3 pt-3",
12725
- children: attachments.map((attachment) => /* @__PURE__ */ jsxRuntime.jsx(
12726
- chunkJWB4UA4J_cjs.AttachmentPreviewItem,
12733
+ attachment: { ...attachment, state: "pending" },
12734
+ onRemove: () => removeAttachment(attachment.id),
12735
+ disabled
12736
+ },
12737
+ attachment.id
12738
+ ))
12739
+ }
12740
+ ),
12741
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-[auto_minmax(0,1fr)_auto]", children: [
12742
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cells.input, children: /* @__PURE__ */ jsxRuntime.jsx(
12743
+ "textarea",
12744
+ {
12745
+ ...textareaProps,
12746
+ ref: textareaRef,
12747
+ "data-slot": "chat-composer-input",
12748
+ value,
12749
+ onChange: (event) => {
12750
+ textareaProps?.onChange?.(event);
12751
+ setValue(event.target.value);
12752
+ },
12753
+ onKeyDown: (event) => {
12754
+ textareaProps?.onKeyDown?.(event);
12755
+ if (event.defaultPrevented) return;
12756
+ handleKeyDown(event);
12757
+ },
12758
+ onPaste: (event) => {
12759
+ textareaProps?.onPaste?.(event);
12760
+ if (event.defaultPrevented) return;
12761
+ handlePaste(event);
12762
+ },
12763
+ placeholder,
12764
+ disabled,
12765
+ autoFocus,
12766
+ rows: 1,
12767
+ "aria-label": inputLabel,
12768
+ style: {
12769
+ ...textareaProps?.style,
12770
+ maxHeight: typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight
12771
+ },
12772
+ className: chunkS5RVSXDV_cjs.cn(
12773
+ "block w-full resize-none bg-transparent",
12774
+ "rounded-lg text-sm",
12775
+ cells.textarea,
12776
+ "text-neutral-900 placeholder:text-neutral-400 dark:text-white dark:placeholder:text-neutral-500",
12777
+ // Ring the input itself on focus rather than the whole shell.
12778
+ "focus:ring-primary-500 focus:ring-1 focus:outline-none",
12779
+ "disabled:cursor-not-allowed",
12780
+ textareaProps?.className
12781
+ )
12782
+ }
12783
+ ) }),
12784
+ showAddMenu && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cells.add, children: /* @__PURE__ */ jsxRuntime.jsxs(
12785
+ chunkBT7SXNZU_cjs.Dropdown,
12786
+ {
12787
+ placement: "top-start",
12788
+ open: addMenuOpen,
12789
+ onOpenChange: setAddMenuOpen,
12790
+ trigger: /* @__PURE__ */ jsxRuntime.jsx(
12791
+ "button",
12792
+ {
12793
+ type: "button",
12794
+ "data-slot": "chat-composer-add-button",
12795
+ "aria-label": addMenuLabel,
12796
+ disabled,
12797
+ className: iconButtonClasses,
12798
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Plus, { className: "h-4 w-4", "aria-hidden": "true" })
12799
+ }
12800
+ ),
12801
+ children: [
12802
+ allowAttachments && /* @__PURE__ */ jsxRuntime.jsx(
12803
+ chunkBT7SXNZU_cjs.DropdownItem,
12727
12804
  {
12728
- attachment: { ...attachment, state: "pending" },
12729
- onRemove: () => removeAttachment(attachment.id),
12730
- disabled
12805
+ icon: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Paperclip, { className: "h-4 w-4", "aria-hidden": "true" }),
12806
+ onClick: () => {
12807
+ setAddMenuOpen(false);
12808
+ fileInputRef.current?.click();
12809
+ },
12810
+ children: attachFilesLabel
12811
+ }
12812
+ ),
12813
+ allowAttachments && addMenuItems && addMenuItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(chunkBT7SXNZU_cjs.DropdownSeparator, {}),
12814
+ addMenuItems?.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
12815
+ chunkBT7SXNZU_cjs.DropdownItem,
12816
+ {
12817
+ icon: item.icon,
12818
+ disabled: item.disabled,
12819
+ variant: item.variant,
12820
+ checked: item.checked,
12821
+ onClick: () => {
12822
+ setAddMenuOpen(false);
12823
+ item.onSelect?.();
12824
+ },
12825
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: item.label })
12731
12826
  },
12732
- attachment.id
12827
+ item.id
12733
12828
  ))
12829
+ ]
12830
+ }
12831
+ ) }),
12832
+ allowAttachments && /* @__PURE__ */ jsxRuntime.jsx(
12833
+ "input",
12834
+ {
12835
+ ref: fileInputRef,
12836
+ type: "file",
12837
+ multiple: true,
12838
+ accept: acceptedFileTypes?.join(","),
12839
+ onChange: handleFileInputChange,
12840
+ className: "hidden",
12841
+ "aria-hidden": "true",
12842
+ tabIndex: -1
12843
+ }
12844
+ ),
12845
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cells.actions, children: [
12846
+ showCharacterCount && maxLength !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(
12847
+ "span",
12848
+ {
12849
+ "data-slot": "chat-composer-char-count",
12850
+ "aria-live": "polite",
12851
+ className: chunkS5RVSXDV_cjs.cn(
12852
+ "pe-1 text-xs tabular-nums",
12853
+ isOverLimit ? "font-medium text-red-700 dark:text-red-400" : "text-neutral-500 dark:text-neutral-400"
12854
+ ),
12855
+ children: [
12856
+ value.length,
12857
+ "/",
12858
+ maxLength
12859
+ ]
12734
12860
  }
12735
12861
  ),
12736
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-1 pt-1", children: /* @__PURE__ */ jsxRuntime.jsx(
12737
- "textarea",
12862
+ micVisible && (micSlot != null ? (
12863
+ // Normalize slot content (e.g. a RecordButton) to the 32px
12864
+ // control row: taller content overflow-centers instead of
12865
+ // inflating the pill and pushing the other cells apart. A div
12866
+ // so block-level slot content stays valid HTML.
12867
+ /* @__PURE__ */ jsxRuntime.jsx(
12868
+ "div",
12869
+ {
12870
+ "data-slot": "chat-composer-mic-slot",
12871
+ className: "flex h-8 shrink-0 items-center",
12872
+ children: micSlot
12873
+ }
12874
+ )
12875
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
12876
+ "button",
12738
12877
  {
12739
- ...textareaProps,
12740
- ref: textareaRef,
12741
- "data-slot": "chat-composer-input",
12742
- value,
12743
- onChange: (event) => {
12744
- textareaProps?.onChange?.(event);
12745
- setValue(event.target.value);
12746
- },
12747
- onKeyDown: (event) => {
12748
- textareaProps?.onKeyDown?.(event);
12749
- if (event.defaultPrevented) return;
12750
- handleKeyDown(event);
12751
- },
12752
- onPaste: (event) => {
12753
- textareaProps?.onPaste?.(event);
12754
- if (event.defaultPrevented) return;
12755
- handlePaste(event);
12756
- },
12757
- placeholder,
12878
+ type: "button",
12879
+ "data-slot": "chat-composer-mic-button",
12880
+ "aria-label": micLabel,
12758
12881
  disabled,
12759
- autoFocus,
12760
- rows: 1,
12761
- "aria-label": inputLabel,
12762
- style: {
12763
- ...textareaProps?.style,
12764
- maxHeight: typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight
12765
- },
12882
+ onClick: onMicClick,
12883
+ className: iconButtonClasses,
12884
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Mic, { className: "h-4 w-4", "aria-hidden": "true" })
12885
+ }
12886
+ )),
12887
+ isStreaming && onStop ? /* @__PURE__ */ jsxRuntime.jsx(
12888
+ "button",
12889
+ {
12890
+ type: "button",
12891
+ "data-slot": "chat-composer-stop-button",
12892
+ "aria-label": stopLabel,
12893
+ disabled,
12894
+ onClick: onStop,
12766
12895
  className: chunkS5RVSXDV_cjs.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",
12773
- textareaProps?.className
12896
+ iconButtonClasses,
12897
+ "text-neutral-700 dark:text-neutral-200"
12898
+ ),
12899
+ children: /* @__PURE__ */ jsxRuntime.jsx(
12900
+ chunkL7L5S2HO_cjs.Square,
12901
+ {
12902
+ className: "h-3.5 w-3.5 fill-current",
12903
+ "aria-hidden": "true"
12904
+ }
12774
12905
  )
12775
12906
  }
12776
- ) }),
12777
- /* @__PURE__ */ jsxRuntime.jsxs(
12778
- "div",
12907
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
12908
+ "button",
12779
12909
  {
12780
- "data-slot": "chat-composer-toolbar",
12781
- className: "flex items-center gap-1 px-2 pb-2",
12782
- children: [
12783
- showAddMenu && /* @__PURE__ */ jsxRuntime.jsxs(
12784
- chunkBT7SXNZU_cjs.Dropdown,
12785
- {
12786
- placement: "top-start",
12787
- open: addMenuOpen,
12788
- onOpenChange: setAddMenuOpen,
12789
- trigger: /* @__PURE__ */ jsxRuntime.jsx(
12790
- "button",
12791
- {
12792
- type: "button",
12793
- "data-slot": "chat-composer-add-button",
12794
- "aria-label": addMenuLabel,
12795
- disabled,
12796
- className: iconButtonClasses,
12797
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Plus, { className: "h-4 w-4", "aria-hidden": "true" })
12798
- }
12799
- ),
12800
- children: [
12801
- allowAttachments && /* @__PURE__ */ jsxRuntime.jsx(
12802
- chunkBT7SXNZU_cjs.DropdownItem,
12803
- {
12804
- icon: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Paperclip, { className: "h-4 w-4", "aria-hidden": "true" }),
12805
- onClick: () => {
12806
- setAddMenuOpen(false);
12807
- fileInputRef.current?.click();
12808
- },
12809
- children: attachFilesLabel
12810
- }
12811
- ),
12812
- allowAttachments && addMenuItems && addMenuItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(chunkBT7SXNZU_cjs.DropdownSeparator, {}),
12813
- addMenuItems?.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
12814
- chunkBT7SXNZU_cjs.DropdownItem,
12815
- {
12816
- icon: item.icon,
12817
- disabled: item.disabled,
12818
- variant: item.variant,
12819
- checked: item.checked,
12820
- onClick: () => {
12821
- setAddMenuOpen(false);
12822
- item.onSelect?.();
12823
- },
12824
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: item.label })
12825
- },
12826
- item.id
12827
- ))
12828
- ]
12829
- }
12830
- ),
12831
- allowAttachments && /* @__PURE__ */ jsxRuntime.jsx(
12832
- "input",
12833
- {
12834
- ref: fileInputRef,
12835
- type: "file",
12836
- multiple: true,
12837
- accept: acceptedFileTypes?.join(","),
12838
- onChange: handleFileInputChange,
12839
- className: "hidden",
12840
- "aria-hidden": "true",
12841
- tabIndex: -1
12842
- }
12843
- ),
12844
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ms-auto flex items-center gap-1", children: [
12845
- showCharacterCount && maxLength !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(
12846
- "span",
12847
- {
12848
- "data-slot": "chat-composer-char-count",
12849
- "aria-live": "polite",
12850
- className: chunkS5RVSXDV_cjs.cn(
12851
- "pe-1 text-xs tabular-nums",
12852
- isOverLimit ? "font-medium text-red-700 dark:text-red-400" : "text-neutral-500 dark:text-neutral-400"
12853
- ),
12854
- children: [
12855
- value.length,
12856
- "/",
12857
- maxLength
12858
- ]
12859
- }
12860
- ),
12861
- micVisible && (micSlot ?? /* @__PURE__ */ jsxRuntime.jsx(
12862
- "button",
12863
- {
12864
- type: "button",
12865
- "data-slot": "chat-composer-mic-button",
12866
- "aria-label": micLabel,
12867
- disabled,
12868
- onClick: onMicClick,
12869
- className: iconButtonClasses,
12870
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Mic, { className: "h-4 w-4", "aria-hidden": "true" })
12871
- }
12872
- )),
12873
- isStreaming && onStop ? /* @__PURE__ */ jsxRuntime.jsx(
12874
- "button",
12875
- {
12876
- type: "button",
12877
- "data-slot": "chat-composer-stop-button",
12878
- "aria-label": stopLabel,
12879
- disabled,
12880
- onClick: onStop,
12881
- className: chunkS5RVSXDV_cjs.cn(
12882
- iconButtonClasses,
12883
- "text-neutral-700 dark:text-neutral-200"
12884
- ),
12885
- children: /* @__PURE__ */ jsxRuntime.jsx(
12886
- chunkL7L5S2HO_cjs.Square,
12887
- {
12888
- className: "h-3.5 w-3.5 fill-current",
12889
- "aria-hidden": "true"
12890
- }
12891
- )
12892
- }
12893
- ) : /* @__PURE__ */ jsxRuntime.jsx(
12894
- "button",
12895
- {
12896
- type: "button",
12897
- "data-slot": "chat-composer-send-button",
12898
- "aria-label": isSending ? sendingLabel : sendLabel,
12899
- "aria-busy": isSending || void 0,
12900
- disabled: !canSend,
12901
- onClick: handleSend,
12902
- className: chunkS5RVSXDV_cjs.cn(
12903
- iconButtonClasses,
12904
- 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"
12905
- ),
12906
- children: isSending ? /* @__PURE__ */ jsxRuntime.jsx(
12907
- chunkL7L5S2HO_cjs.Loader2,
12908
- {
12909
- className: "h-4 w-4 animate-spin",
12910
- "aria-hidden": "true"
12911
- }
12912
- ) : /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.ArrowUp, { className: "h-4 w-4", "aria-hidden": "true" })
12913
- }
12914
- )
12915
- ] })
12916
- ]
12910
+ type: "button",
12911
+ "data-slot": "chat-composer-send-button",
12912
+ "aria-label": isSending ? sendingLabel : sendLabel,
12913
+ "aria-busy": isSending || void 0,
12914
+ disabled: !canSend,
12915
+ onClick: handleSend,
12916
+ className: chunkS5RVSXDV_cjs.cn(
12917
+ iconButtonClasses,
12918
+ 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"
12919
+ ),
12920
+ children: isSending ? /* @__PURE__ */ jsxRuntime.jsx(
12921
+ chunkL7L5S2HO_cjs.Loader2,
12922
+ {
12923
+ className: "h-4 w-4 animate-spin",
12924
+ "aria-hidden": "true"
12925
+ }
12926
+ ) : /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.ArrowUp, { className: "h-4 w-4", "aria-hidden": "true" })
12917
12927
  }
12918
- ),
12919
- showSelectorRow && /* @__PURE__ */ jsxRuntime.jsxs(
12920
- "div",
12928
+ )
12929
+ ] })
12930
+ ] })
12931
+ ] });
12932
+ const selectorsRow = showSelectorRow && /* @__PURE__ */ jsxRuntime.jsxs(
12933
+ "div",
12934
+ {
12935
+ "data-slot": "chat-composer-selectors",
12936
+ className: "flex items-center justify-between gap-2 px-2 pt-1",
12937
+ children: [
12938
+ showAgentSelector ? /* @__PURE__ */ jsxRuntime.jsx(
12939
+ chunkBT7SXNZU_cjs.Dropdown,
12921
12940
  {
12922
- "data-slot": "chat-composer-selectors",
12923
- className: "flex items-center justify-between gap-2 border-t border-neutral-100 px-2 py-1.5 dark:border-neutral-700",
12924
- children: [
12925
- showAgentSelector ? /* @__PURE__ */ jsxRuntime.jsx(
12926
- chunkBT7SXNZU_cjs.Dropdown,
12927
- {
12928
- placement: "top-start",
12929
- open: agentMenuOpen,
12930
- onOpenChange: setAgentMenuOpen,
12931
- trigger: /* @__PURE__ */ jsxRuntime.jsxs(
12932
- "button",
12941
+ placement: "top-start",
12942
+ open: agentMenuOpen,
12943
+ onOpenChange: setAgentMenuOpen,
12944
+ trigger: /* @__PURE__ */ jsxRuntime.jsxs(
12945
+ "button",
12946
+ {
12947
+ type: "button",
12948
+ "data-slot": "chat-composer-agent-trigger",
12949
+ "aria-label": selectedAgentOption ? `${agentSelectorLabel}: ${selectedAgentOption.label}` : agentSelectorLabel,
12950
+ disabled,
12951
+ className: selectorTriggerClasses,
12952
+ children: [
12953
+ selectedAgentOption?.icon ?? /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Bot, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
12954
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: selectedAgentOption?.label ?? agentSelectorLabel }),
12955
+ /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.ChevronUp, { className: "h-3 w-3 shrink-0", "aria-hidden": "true" })
12956
+ ]
12957
+ }
12958
+ ),
12959
+ children: agents.map((agent) => /* @__PURE__ */ jsxRuntime.jsx(
12960
+ chunkBT7SXNZU_cjs.DropdownItem,
12961
+ {
12962
+ icon: agent.icon,
12963
+ role: "menuitemradio",
12964
+ "aria-checked": agent.id === selectedAgent,
12965
+ onClick: () => {
12966
+ setAgentMenuOpen(false);
12967
+ onAgentChange?.(agent.id);
12968
+ },
12969
+ children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex w-full items-center justify-between gap-2", children: [
12970
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0", children: [
12971
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate", children: agent.label }),
12972
+ agent.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-xs text-neutral-500 dark:text-neutral-400", children: agent.description })
12973
+ ] }),
12974
+ agent.id === selectedAgent && /* @__PURE__ */ jsxRuntime.jsx(
12975
+ chunkL7L5S2HO_cjs.Check,
12933
12976
  {
12934
- type: "button",
12935
- "data-slot": "chat-composer-agent-trigger",
12936
- "aria-label": selectedAgentOption ? `${agentSelectorLabel}: ${selectedAgentOption.label}` : agentSelectorLabel,
12937
- disabled,
12938
- className: selectorTriggerClasses,
12939
- children: [
12940
- selectedAgentOption?.icon ?? /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Bot, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
12941
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: selectedAgentOption?.label ?? agentSelectorLabel }),
12942
- /* @__PURE__ */ jsxRuntime.jsx(
12943
- chunkL7L5S2HO_cjs.ChevronUp,
12944
- {
12945
- className: "h-3 w-3 shrink-0",
12946
- "aria-hidden": "true"
12947
- }
12948
- )
12949
- ]
12977
+ className: "text-primary-600 dark:text-primary-400 h-4 w-4 shrink-0",
12978
+ "aria-hidden": "true"
12950
12979
  }
12951
- ),
12952
- children: agents.map((agent) => /* @__PURE__ */ jsxRuntime.jsx(
12953
- chunkBT7SXNZU_cjs.DropdownItem,
12954
- {
12955
- icon: agent.icon,
12956
- role: "menuitemradio",
12957
- "aria-checked": agent.id === selectedAgent,
12958
- onClick: () => {
12959
- setAgentMenuOpen(false);
12960
- onAgentChange?.(agent.id);
12961
- },
12962
- children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex w-full items-center justify-between gap-2", children: [
12963
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0", children: [
12964
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate", children: agent.label }),
12965
- agent.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-xs text-neutral-500 dark:text-neutral-400", children: agent.description })
12966
- ] }),
12967
- agent.id === selectedAgent && /* @__PURE__ */ jsxRuntime.jsx(
12968
- chunkL7L5S2HO_cjs.Check,
12969
- {
12970
- className: "text-primary-600 dark:text-primary-400 h-4 w-4 shrink-0",
12971
- "aria-hidden": "true"
12972
- }
12973
- )
12974
- ] })
12975
- },
12976
- agent.id
12977
- ))
12978
- }
12979
- ) : /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true" }),
12980
- showModelSelector && modelSelectorProps && /* @__PURE__ */ jsxRuntime.jsx(
12981
- ComposerModelSelector,
12982
- {
12983
- variant: "ghost",
12984
- ...modelSelectorProps,
12985
- disabled: disabled || modelSelectorProps.disabled
12986
- }
12987
- )
12988
- ]
12980
+ )
12981
+ ] })
12982
+ },
12983
+ agent.id
12984
+ ))
12985
+ }
12986
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true" }),
12987
+ showModelSelector && modelSelectorProps && /* @__PURE__ */ jsxRuntime.jsx(
12988
+ ComposerModelSelector,
12989
+ {
12990
+ variant: "ghost",
12991
+ ...modelSelectorProps,
12992
+ disabled: disabled || modelSelectorProps.disabled
12989
12993
  }
12990
12994
  )
12991
12995
  ]
12992
12996
  }
12993
12997
  );
12998
+ return /* @__PURE__ */ jsxRuntime.jsxs(
12999
+ "div",
13000
+ {
13001
+ "data-slot": "chat-composer",
13002
+ className: chunkS5RVSXDV_cjs.cn(
13003
+ "flex w-full flex-col",
13004
+ disabled && "opacity-60",
13005
+ className
13006
+ ),
13007
+ children: [
13008
+ /* @__PURE__ */ jsxRuntime.jsx(
13009
+ "div",
13010
+ {
13011
+ "data-slot": "chat-composer-card",
13012
+ className: chunkS5RVSXDV_cjs.cn(
13013
+ "rounded-2xl border border-neutral-200 bg-white shadow-sm",
13014
+ "dark:border-[#2e2e30] dark:bg-[#1c1c1e]"
13015
+ ),
13016
+ children: composerCard
13017
+ }
13018
+ ),
13019
+ selectorsRow
13020
+ ]
13021
+ }
13022
+ );
12994
13023
  });
12995
13024
  ChatComposer.displayName = "ChatComposer";
12996
13025
  var MODE_META = {
@@ -46031,11 +46060,11 @@ Object.defineProperty(exports, "CollapsibleTrigger", {
46031
46060
  });
46032
46061
  Object.defineProperty(exports, "miewebUIPreset", {
46033
46062
  enumerable: true,
46034
- get: function () { return chunkYERA6RNG_cjs.miewebUIPreset; }
46063
+ get: function () { return chunkVIE7UI2R_cjs.miewebUIPreset; }
46035
46064
  });
46036
46065
  Object.defineProperty(exports, "miewebUISafelist", {
46037
46066
  enumerable: true,
46038
- get: function () { return chunkYERA6RNG_cjs.miewebUISafelist; }
46067
+ get: function () { return chunkVIE7UI2R_cjs.miewebUISafelist; }
46039
46068
  });
46040
46069
  Object.defineProperty(exports, "Accordion", {
46041
46070
  enumerable: true,